LCOV - code coverage report
Current view: top level - sc/source/filter/xml - xmllabri.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 47 0.0 %
Date: 2012-08-25 Functions: 0 10 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 46 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : 
      30                 :            : 
      31                 :            : //___________________________________________________________________
      32                 :            : #include "xmllabri.hxx"
      33                 :            : #include <xmloff/nmspmap.hxx>
      34                 :            : #include <xmloff/xmltoken.hxx>
      35                 :            : #include "xmlimprt.hxx"
      36                 :            : 
      37                 :            : using namespace ::com::sun::star;
      38                 :            : using ::rtl::OUString;
      39                 :            : using namespace xmloff::token;
      40                 :            : 
      41                 :            : 
      42                 :            : //___________________________________________________________________
      43                 :            : 
      44                 :          0 : ScXMLLabelRangesContext::ScXMLLabelRangesContext(
      45                 :            :         ScXMLImport& rImport,
      46                 :            :         sal_uInt16 nPrefix,
      47                 :            :         const OUString& rLName,
      48                 :            :         const uno::Reference< xml::sax::XAttributeList >& /* xAttrList */ ):
      49                 :          0 :     SvXMLImportContext( rImport, nPrefix, rLName )
      50                 :            : {
      51         [ #  # ]:          0 :     rImport.LockSolarMutex();
      52                 :          0 : }
      53                 :            : 
      54                 :          0 : ScXMLLabelRangesContext::~ScXMLLabelRangesContext()
      55                 :            : {
      56         [ #  # ]:          0 :     GetScImport().UnlockSolarMutex();
      57         [ #  # ]:          0 : }
      58                 :            : 
      59                 :          0 : SvXMLImportContext* ScXMLLabelRangesContext::CreateChildContext(
      60                 :            :         sal_uInt16 nPrefix,
      61                 :            :         const OUString& rLName,
      62                 :            :         const uno::Reference< xml::sax::XAttributeList >& xAttrList )
      63                 :            : {
      64                 :          0 :     SvXMLImportContext*     pContext(NULL);
      65                 :          0 :     const SvXMLTokenMap&    rTokenMap(GetScImport().GetLabelRangesElemTokenMap());
      66                 :            : 
      67         [ #  # ]:          0 :     switch( rTokenMap.Get( nPrefix, rLName ) )
      68                 :            :     {
      69                 :            :         case XML_TOK_LABEL_RANGE_ELEM:
      70         [ #  # ]:          0 :             pContext = new ScXMLLabelRangeContext( GetScImport(), nPrefix, rLName, xAttrList );
      71                 :          0 :         break;
      72                 :            :     }
      73         [ #  # ]:          0 :     if( !pContext )
      74         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
      75                 :            : 
      76                 :          0 :     return pContext;
      77                 :            : }
      78                 :            : 
      79                 :          0 : void ScXMLLabelRangesContext::EndElement()
      80                 :            : {
      81                 :          0 : }
      82                 :            : 
      83                 :            : 
      84                 :            : //___________________________________________________________________
      85                 :            : 
      86                 :          0 : ScXMLLabelRangeContext::ScXMLLabelRangeContext(
      87                 :            :         ScXMLImport& rImport,
      88                 :            :         sal_uInt16 nPrfx,
      89                 :            :         const OUString& rLName,
      90                 :            :         const uno::Reference< xml::sax::XAttributeList >& xAttrList ) :
      91                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
      92                 :          0 :     bColumnOrientation( false )
      93                 :            : {
      94 [ #  # ][ #  # ]:          0 :     sal_Int16               nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
      95         [ #  # ]:          0 :     const SvXMLTokenMap&    rAttrTokenMap(GetScImport().GetLabelRangeAttrTokenMap());
      96                 :            : 
      97         [ #  # ]:          0 :     for( sal_Int16 nIndex = 0; nIndex < nAttrCount; ++nIndex )
      98                 :            :     {
      99 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName  (xAttrList->getNameByIndex( nIndex ));
     100 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue     (xAttrList->getValueByIndex( nIndex ));
     101                 :          0 :         OUString    aLocalName;
     102         [ #  # ]:          0 :         sal_uInt16      nPrefix     (GetScImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ));
     103                 :            : 
     104         [ #  # ]:          0 :         switch( rAttrTokenMap.Get( nPrefix, aLocalName ) )
           [ #  #  #  # ]
     105                 :            :         {
     106                 :            :             case XML_TOK_LABEL_RANGE_ATTR_LABEL_RANGE:
     107                 :          0 :                 sLabelRangeStr = sValue;
     108                 :          0 :             break;
     109                 :            :             case XML_TOK_LABEL_RANGE_ATTR_DATA_RANGE:
     110                 :          0 :                 sDataRangeStr = sValue;
     111                 :          0 :             break;
     112                 :            :             case XML_TOK_LABEL_RANGE_ATTR_ORIENTATION:
     113         [ #  # ]:          0 :                 bColumnOrientation = IsXMLToken(sValue, XML_COLUMN );
     114                 :          0 :             break;
     115                 :            :         }
     116                 :          0 :     }
     117                 :          0 : }
     118                 :            : 
     119                 :          0 : ScXMLLabelRangeContext::~ScXMLLabelRangeContext()
     120                 :            : {
     121         [ #  # ]:          0 : }
     122                 :            : 
     123                 :          0 : SvXMLImportContext* ScXMLLabelRangeContext::CreateChildContext(
     124                 :            :         sal_uInt16 nPrefix,
     125                 :            :         const OUString& rLName,
     126                 :            :         const uno::Reference< xml::sax::XAttributeList >& /* xAttrList */ )
     127                 :            : {
     128         [ #  # ]:          0 :     return new SvXMLImportContext( GetImport(), nPrefix, rLName );
     129                 :            : }
     130                 :            : 
     131                 :          0 : void ScXMLLabelRangeContext::EndElement()
     132                 :            : {
     133                 :            :     //  Label ranges must be stored as strings until all sheets are loaded
     134                 :            :     //  (like named expressions).
     135                 :            : 
     136                 :          0 :     ScMyLabelRange* pLabelRange = new ScMyLabelRange;
     137                 :            : 
     138                 :          0 :     pLabelRange->sLabelRangeStr = sLabelRangeStr;
     139                 :          0 :     pLabelRange->sDataRangeStr = sDataRangeStr;
     140                 :          0 :     pLabelRange->bColumnOrientation = bColumnOrientation;
     141                 :            : 
     142                 :          0 :     GetScImport().AddLabelRange(pLabelRange);
     143                 :          0 : }
     144                 :            : 
     145                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10