LCOV - code coverage report
Current view: top level - xmloff/source/style - PageMasterImportPropMapper.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 180 270 66.7 %
Date: 2012-08-25 Functions: 4 5 80.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 163 325 50.2 %

           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                 :            : #include "PageMasterImportPropMapper.hxx"
      31                 :            : #include "PageMasterPropMapper.hxx"
      32                 :            : #include <xmloff/PageMasterStyleMap.hxx>
      33                 :            : #include <xmloff/maptype.hxx>
      34                 :            : #include <com/sun/star/table/BorderLine2.hpp>
      35                 :            : #include <com/sun/star/container/XNameContainer.hpp>
      36                 :            : #include <xmloff/xmlimp.hxx>
      37                 :            : 
      38                 :            : #define XML_LINE_LEFT 0
      39                 :            : #define XML_LINE_RIGHT 1
      40                 :            : #define XML_LINE_TOP 2
      41                 :            : #define XML_LINE_BOTTOM 3
      42                 :            : 
      43                 :            : using namespace ::com::sun::star;
      44                 :            : using namespace ::com::sun::star::uno;
      45                 :            : using namespace ::com::sun::star::container;
      46                 :            : 
      47                 :        162 : PageMasterImportPropertyMapper::PageMasterImportPropertyMapper(
      48                 :            :         const UniReference< XMLPropertySetMapper >& rMapper,
      49                 :            :         SvXMLImport& rImp ) :
      50                 :            :     SvXMLImportPropertyMapper( rMapper, rImp ),
      51                 :        162 :     rImport( rImp )
      52                 :            : {
      53                 :        162 : }
      54                 :            : 
      55                 :        162 : PageMasterImportPropertyMapper::~PageMasterImportPropertyMapper()
      56                 :            : {
      57         [ -  + ]:        324 : }
      58                 :            : 
      59                 :          0 : bool PageMasterImportPropertyMapper::handleSpecialItem(
      60                 :            :         XMLPropertyState& rProperty,
      61                 :            :         ::std::vector< XMLPropertyState >& rProperties,
      62                 :            :         const ::rtl::OUString& rValue,
      63                 :            :         const SvXMLUnitConverter& rUnitConverter,
      64                 :            :         const SvXMLNamespaceMap& rNamespaceMap ) const
      65                 :            : {
      66                 :          0 :     sal_Bool bRet = sal_False;
      67                 :            :     sal_Int16 nContextID =
      68                 :          0 :             getPropertySetMapper()->GetEntryContextId(rProperty.mnIndex);
      69                 :            : 
      70         [ #  # ]:          0 :     if( CTF_PM_REGISTER_STYLE==nContextID )
      71                 :            :     {
      72                 :            :         ::rtl::OUString sDisplayName( rImport.GetStyleDisplayName(
      73         [ #  # ]:          0 :                     XML_STYLE_FAMILY_TEXT_PARAGRAPH, rValue ) );
      74                 :            :         Reference < XNameContainer > xParaStyles =
      75 [ #  # ][ #  # ]:          0 :             rImport.GetTextImport()->GetParaStyles();
         [ #  # ][ #  # ]
      76 [ #  # ][ #  # ]:          0 :         if( xParaStyles.is() && xParaStyles->hasByName( sDisplayName ) )
         [ #  # ][ #  # ]
                 [ #  # ]
      77                 :            :         {
      78         [ #  # ]:          0 :             rProperty.maValue <<= sDisplayName;
      79                 :          0 :             bRet = sal_True;
      80                 :          0 :         }
      81                 :            :     }
      82                 :            :     else
      83                 :            :     {
      84                 :            :         bRet = SvXMLImportPropertyMapper::handleSpecialItem(
      85                 :            :                     rProperty, rProperties, rValue,
      86                 :          0 :                     rUnitConverter, rNamespaceMap );
      87                 :            :     }
      88                 :            : 
      89                 :          0 :     return bRet;
      90                 :            : }
      91                 :            : 
      92                 :            : 
      93                 :        686 : void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
      94                 :            : {
      95         [ +  - ]:        686 :     SvXMLImportPropertyMapper::finished(rProperties, nStartIndex, nEndIndex);
      96                 :        686 :     XMLPropertyState* pAllPaddingProperty = NULL;
      97                 :        686 :     XMLPropertyState* pPadding[4] = { NULL, NULL, NULL, NULL };
      98                 :        686 :     XMLPropertyState* pNewPadding[4] = { NULL, NULL, NULL, NULL };
      99                 :        686 :     XMLPropertyState* pAllBorderProperty = NULL;
     100                 :        686 :     XMLPropertyState* pBorders[4] = { NULL, NULL, NULL, NULL };
     101                 :        686 :     XMLPropertyState* pNewBorders[4] = { NULL, NULL, NULL, NULL };
     102                 :        686 :     XMLPropertyState* pAllBorderWidthProperty = NULL;
     103                 :        686 :     XMLPropertyState* pBorderWidths[4] = { NULL, NULL, NULL, NULL };
     104                 :        686 :     XMLPropertyState* pAllHeaderPaddingProperty = NULL;
     105                 :        686 :     XMLPropertyState* pHeaderPadding[4] = { NULL, NULL, NULL, NULL };
     106                 :        686 :     XMLPropertyState* pHeaderNewPadding[4] = { NULL, NULL, NULL, NULL };
     107                 :        686 :     XMLPropertyState* pAllHeaderBorderProperty = NULL;
     108                 :        686 :     XMLPropertyState* pHeaderBorders[4] = { NULL, NULL, NULL, NULL };
     109                 :        686 :     XMLPropertyState* pHeaderNewBorders[4] = { NULL, NULL, NULL, NULL };
     110                 :        686 :     XMLPropertyState* pAllHeaderBorderWidthProperty = NULL;
     111                 :        686 :     XMLPropertyState* pHeaderBorderWidths[4] = { NULL, NULL, NULL, NULL };
     112                 :        686 :     XMLPropertyState* pAllFooterPaddingProperty = NULL;
     113                 :        686 :     XMLPropertyState* pFooterPadding[4] = { NULL, NULL, NULL, NULL };
     114                 :        686 :     XMLPropertyState* pFooterNewPadding[4] = { NULL, NULL, NULL, NULL };
     115                 :        686 :     XMLPropertyState* pAllFooterBorderProperty = NULL;
     116                 :        686 :     XMLPropertyState* pFooterBorders[4] = { NULL, NULL, NULL, NULL };
     117                 :        686 :     XMLPropertyState* pFooterNewBorders[4] = { NULL, NULL, NULL, NULL };
     118                 :        686 :     XMLPropertyState* pAllFooterBorderWidthProperty = NULL;
     119                 :        686 :     XMLPropertyState* pFooterBorderWidths[4] = { NULL, NULL, NULL, NULL };
     120                 :        686 :     XMLPropertyState* pHeaderHeight = NULL;
     121                 :        686 :     XMLPropertyState* pHeaderMinHeight = NULL;
     122                 :        686 :     XMLPropertyState* pHeaderDynamic = NULL;
     123                 :        686 :     XMLPropertyState* pFooterHeight = NULL;
     124                 :        686 :     XMLPropertyState* pFooterMinHeight = NULL;
     125                 :        686 :     XMLPropertyState* pFooterDynamic = NULL;
     126                 :        686 :     XMLPropertyState* pAllMarginProperty = NULL;
     127                 :        686 :     XMLPropertyState* pMargins[4] = { NULL, NULL, NULL, NULL };
     128                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     129         [ +  + ]:       6174 :     ::std::auto_ptr<XMLPropertyState> pNewMargins[4];
     130                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     131                 :        686 :     XMLPropertyState* pAllHeaderMarginProperty = NULL;
     132                 :        686 :     XMLPropertyState* pHeaderMargins[4] = { NULL, NULL, NULL, NULL };
     133                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     134         [ +  + ]:       6174 :     ::std::auto_ptr<XMLPropertyState> pNewHeaderMargins[4];
     135                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     136                 :        686 :     XMLPropertyState* pAllFooterMarginProperty = NULL;
     137                 :        686 :     XMLPropertyState* pFooterMargins[4] = { NULL, NULL, NULL, NULL };
     138                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     139         [ +  + ]:       6174 :     ::std::auto_ptr<XMLPropertyState> pNewFooterMargins[4];
     140                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     141                 :            : 
     142                 :        686 :     ::std::vector< XMLPropertyState >::iterator aEnd = rProperties.end();
     143 [ +  - ][ +  + ]:       8010 :     for (::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin(); aIter != aEnd; ++aIter)
     144                 :            :     {
     145                 :       7324 :         XMLPropertyState *property = &(*aIter);
     146 [ +  - ][ +  - ]:       7324 :         sal_Int16 nContextID = getPropertySetMapper()->GetEntryContextId(property->mnIndex);
     147 [ +  + ][ +  - ]:       7324 :         if (property->mnIndex >= nStartIndex && property->mnIndex < nEndIndex)
     148                 :            :         {
     149   [ +  -  -  -  :       3927 :             switch (nContextID)
          -  +  -  -  -  
          -  -  -  -  -  
          -  +  -  -  -  
          -  +  +  +  +  
          +  -  -  -  -  
          -  +  -  -  -  
          -  +  -  -  -  
          -  -  -  -  -  
          -  +  +  +  +  
          +  +  +  +  +  
          -  -  +  +  +  
          -  +  -  +  +  
                      + ]
     150                 :            :             {
     151                 :          3 :                 case CTF_PM_PADDINGALL                  : pAllPaddingProperty = property; break;
     152                 :          0 :                 case CTF_PM_PADDINGLEFT                 : pPadding[XML_LINE_LEFT] = property; break;
     153                 :          0 :                 case CTF_PM_PADDINGRIGHT                : pPadding[XML_LINE_RIGHT] = property; break;
     154                 :          0 :                 case CTF_PM_PADDINGTOP                  : pPadding[XML_LINE_TOP] = property; break;
     155                 :          0 :                 case CTF_PM_PADDINGBOTTOM               : pPadding[XML_LINE_BOTTOM] = property; break;
     156                 :          3 :                 case CTF_PM_BORDERALL                   : pAllBorderProperty = property; break;
     157                 :          0 :                 case CTF_PM_BORDERLEFT                  : pBorders[XML_LINE_LEFT] = property; break;
     158                 :          0 :                 case CTF_PM_BORDERRIGHT                 : pBorders[XML_LINE_RIGHT] = property; break;
     159                 :          0 :                 case CTF_PM_BORDERTOP                   : pBorders[XML_LINE_TOP] = property; break;
     160                 :          0 :                 case CTF_PM_BORDERBOTTOM                : pBorders[XML_LINE_BOTTOM] = property; break;
     161                 :          0 :                 case CTF_PM_BORDERWIDTHALL              : pAllBorderWidthProperty = property; break;
     162                 :          0 :                 case CTF_PM_BORDERWIDTHLEFT             : pBorderWidths[XML_LINE_LEFT] = property; break;
     163                 :          0 :                 case CTF_PM_BORDERWIDTHRIGHT            : pBorderWidths[XML_LINE_RIGHT] = property; break;
     164                 :          0 :                 case CTF_PM_BORDERWIDTHTOP              : pBorderWidths[XML_LINE_TOP] = property; break;
     165                 :          0 :                 case CTF_PM_BORDERWIDTHBOTTOM           : pBorderWidths[XML_LINE_BOTTOM] = property; break;
     166                 :        102 :                 case CTF_PM_HEADERPADDINGALL            : pAllHeaderPaddingProperty = property; break;
     167                 :          0 :                 case CTF_PM_HEADERPADDINGLEFT           : pHeaderPadding[XML_LINE_LEFT] = property; break;
     168                 :          0 :                 case CTF_PM_HEADERPADDINGRIGHT          : pHeaderPadding[XML_LINE_RIGHT] = property; break;
     169                 :          0 :                 case CTF_PM_HEADERPADDINGTOP            : pHeaderPadding[XML_LINE_TOP] = property; break;
     170                 :          0 :                 case CTF_PM_HEADERPADDINGBOTTOM         : pHeaderPadding[XML_LINE_BOTTOM] = property; break;
     171                 :         93 :                 case CTF_PM_HEADERBORDERALL             : pAllHeaderBorderProperty = property; break;
     172                 :          9 :                 case CTF_PM_HEADERBORDERLEFT            : pHeaderBorders[XML_LINE_LEFT] = property; break;
     173                 :          9 :                 case CTF_PM_HEADERBORDERRIGHT           : pHeaderBorders[XML_LINE_RIGHT] = property; break;
     174                 :          9 :                 case CTF_PM_HEADERBORDERTOP             : pHeaderBorders[XML_LINE_TOP] = property; break;
     175                 :          9 :                 case CTF_PM_HEADERBORDERBOTTOM          : pHeaderBorders[XML_LINE_BOTTOM] = property; break;
     176                 :          0 :                 case CTF_PM_HEADERBORDERWIDTHALL        : pAllHeaderBorderWidthProperty = property; break;
     177                 :          0 :                 case CTF_PM_HEADERBORDERWIDTHLEFT       : pHeaderBorderWidths[XML_LINE_LEFT] = property; break;
     178                 :          0 :                 case CTF_PM_HEADERBORDERWIDTHRIGHT      : pHeaderBorderWidths[XML_LINE_RIGHT] = property; break;
     179                 :          0 :                 case CTF_PM_HEADERBORDERWIDTHTOP        : pHeaderBorderWidths[XML_LINE_TOP] = property; break;
     180                 :          0 :                 case CTF_PM_HEADERBORDERWIDTHBOTTOM     : pHeaderBorderWidths[XML_LINE_BOTTOM] = property; break;
     181                 :         93 :                 case CTF_PM_FOOTERPADDINGALL            : pAllFooterPaddingProperty = property; break;
     182                 :          0 :                 case CTF_PM_FOOTERPADDINGLEFT           : pFooterPadding[XML_LINE_LEFT] = property; break;
     183                 :          0 :                 case CTF_PM_FOOTERPADDINGRIGHT          : pFooterPadding[XML_LINE_RIGHT] = property; break;
     184                 :          0 :                 case CTF_PM_FOOTERPADDINGTOP            : pFooterPadding[XML_LINE_TOP] = property; break;
     185                 :          0 :                 case CTF_PM_FOOTERPADDINGBOTTOM         : pFooterPadding[XML_LINE_BOTTOM] = property; break;
     186                 :         93 :                 case CTF_PM_FOOTERBORDERALL             : pAllFooterBorderProperty = property; break;
     187                 :          0 :                 case CTF_PM_FOOTERBORDERLEFT            : pFooterBorders[XML_LINE_LEFT] = property; break;
     188                 :          0 :                 case CTF_PM_FOOTERBORDERRIGHT           : pFooterBorders[XML_LINE_RIGHT] = property; break;
     189                 :          0 :                 case CTF_PM_FOOTERBORDERTOP             : pFooterBorders[XML_LINE_TOP] = property; break;
     190                 :          0 :                 case CTF_PM_FOOTERBORDERBOTTOM          : pFooterBorders[XML_LINE_BOTTOM] = property; break;
     191                 :          0 :                 case CTF_PM_FOOTERBORDERWIDTHALL        : pAllFooterBorderWidthProperty = property; break;
     192                 :          0 :                 case CTF_PM_FOOTERBORDERWIDTHLEFT       : pFooterBorderWidths[XML_LINE_LEFT] = property; break;
     193                 :          0 :                 case CTF_PM_FOOTERBORDERWIDTHRIGHT      : pFooterBorderWidths[XML_LINE_RIGHT] = property; break;
     194                 :          0 :                 case CTF_PM_FOOTERBORDERWIDTHTOP        : pFooterBorderWidths[XML_LINE_TOP] = property; break;
     195                 :          0 :                 case CTF_PM_FOOTERBORDERWIDTHBOTTOM     : pFooterBorderWidths[XML_LINE_BOTTOM] = property; break;
     196                 :          3 :                 case CTF_PM_HEADERHEIGHT                : pHeaderHeight = property; break;
     197                 :        196 :                 case CTF_PM_HEADERMINHEIGHT             : pHeaderMinHeight = property; break;
     198                 :          2 :                 case CTF_PM_FOOTERHEIGHT                : pFooterHeight = property; break;
     199                 :        199 :                 case CTF_PM_FOOTERMINHEIGHT             : pFooterMinHeight = property; break;
     200                 :            :                 case CTF_PM_MARGINALL   :
     201                 :         58 :                       pAllMarginProperty = property; break;
     202                 :            :                 case CTF_PM_MARGINTOP   :
     203                 :        101 :                       pMargins[XML_LINE_TOP] = property; break;
     204                 :            :                 case CTF_PM_MARGINBOTTOM:
     205                 :        101 :                       pMargins[XML_LINE_BOTTOM] = property; break;
     206                 :            :                 case CTF_PM_MARGINLEFT  :
     207                 :        101 :                       pMargins[XML_LINE_LEFT] = property; break;
     208                 :            :                 case CTF_PM_MARGINRIGHT :
     209                 :        101 :                       pMargins[XML_LINE_RIGHT] = property; break;
     210                 :            :                 case CTF_PM_HEADERMARGINALL   :
     211                 :          0 :                       pAllHeaderMarginProperty = property; break;
     212                 :            :                 case CTF_PM_HEADERMARGINTOP   :
     213                 :          0 :                       pHeaderMargins[XML_LINE_TOP] = property; break;
     214                 :            :                 case CTF_PM_HEADERMARGINBOTTOM:
     215                 :        199 :                       pHeaderMargins[XML_LINE_BOTTOM] = property; break;
     216                 :            :                 case CTF_PM_HEADERMARGINLEFT  :
     217                 :        199 :                       pHeaderMargins[XML_LINE_LEFT] = property; break;
     218                 :            :                 case CTF_PM_HEADERMARGINRIGHT :
     219                 :        199 :                       pHeaderMargins[XML_LINE_RIGHT] = property; break;
     220                 :            :                 case CTF_PM_FOOTERMARGINALL   :
     221                 :          0 :                       pAllFooterMarginProperty = property; break;
     222                 :            :                 case CTF_PM_FOOTERMARGINTOP   :
     223                 :        201 :                       pFooterMargins[XML_LINE_TOP] = property; break;
     224                 :            :                 case CTF_PM_FOOTERMARGINBOTTOM:
     225                 :          0 :                       pFooterMargins[XML_LINE_BOTTOM] = property; break;
     226                 :            :                 case CTF_PM_FOOTERMARGINLEFT  :
     227                 :        201 :                       pFooterMargins[XML_LINE_LEFT] = property; break;
     228                 :            :                 case CTF_PM_FOOTERMARGINRIGHT :
     229                 :       3927 :                       pFooterMargins[XML_LINE_RIGHT] = property; break;
     230                 :            :             }
     231                 :            :         }
     232                 :            :     }
     233                 :            : 
     234         [ +  + ]:       3430 :     for (sal_uInt16 i = 0; i < 4; i++)
     235                 :            :     {
     236 [ +  + ][ -  + ]:       2744 :         if (pAllMarginProperty && !pMargins[i])
     237                 :            :         {
     238                 :          0 :             pNewMargins[i].reset(new XMLPropertyState(
     239                 :            :                 pAllMarginProperty->mnIndex + 1 + i,
     240         [ #  # ]:          0 :                 pAllMarginProperty->maValue));
     241                 :            :         }
     242 [ -  + ][ #  # ]:       2744 :         if (pAllHeaderMarginProperty && !pHeaderMargins[i])
     243                 :            :         {
     244                 :          0 :             pNewHeaderMargins[i].reset(new XMLPropertyState(
     245                 :            :                 pAllHeaderMarginProperty->mnIndex + 1 + i,
     246         [ #  # ]:          0 :                 pAllHeaderMarginProperty->maValue));
     247                 :            :         }
     248 [ -  + ][ #  # ]:       2744 :         if (pAllFooterMarginProperty && !pFooterMargins[i])
     249                 :            :         {
     250                 :          0 :             pNewFooterMargins[i].reset(new XMLPropertyState(
     251                 :            :                 pAllFooterMarginProperty->mnIndex + 1 + i,
     252         [ #  # ]:          0 :                 pAllFooterMarginProperty->maValue));
     253                 :            :         }
     254 [ +  + ][ +  - ]:       2744 :         if (pAllPaddingProperty && !pPadding[i])
     255         [ +  - ]:         12 :             pNewPadding[i] = new XMLPropertyState(pAllPaddingProperty->mnIndex + 1 + i, pAllPaddingProperty->maValue);
     256 [ +  + ][ +  - ]:       2744 :         if (pAllBorderProperty && !pBorders[i])
     257                 :            :         {
     258         [ +  - ]:         12 :             pNewBorders[i] = new XMLPropertyState(pAllBorderProperty->mnIndex + 1 + i, pAllBorderProperty->maValue);
     259                 :         12 :             pBorders[i] = pNewBorders[i];
     260                 :            :         }
     261         [ +  - ]:       2744 :         if( !pBorderWidths[i] )
     262                 :       2744 :             pBorderWidths[i] = pAllBorderWidthProperty;
     263                 :            :         else
     264                 :          0 :             pBorderWidths[i]->mnIndex = -1;
     265         [ +  + ]:       2744 :         if( pBorders[i] )
     266                 :            :         {
     267                 :         12 :             table::BorderLine2 aBorderLine;
     268         [ +  - ]:         12 :             pBorders[i]->maValue >>= aBorderLine;
     269         [ -  + ]:         12 :              if( pBorderWidths[i] )
     270                 :            :             {
     271                 :          0 :                 table::BorderLine2 aBorderLineWidth;
     272         [ #  # ]:          0 :                 pBorderWidths[i]->maValue >>= aBorderLineWidth;
     273                 :          0 :                 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
     274                 :          0 :                 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
     275                 :          0 :                 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
     276                 :          0 :                 aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
     277         [ #  # ]:         12 :                 pBorders[i]->maValue <<= aBorderLine;
     278                 :            :             }
     279                 :            :         }
     280 [ +  + ][ +  - ]:       2744 :         if (pAllHeaderPaddingProperty && !pHeaderPadding[i])
     281         [ +  - ]:        408 :             pHeaderNewPadding[i] = new XMLPropertyState(pAllHeaderPaddingProperty->mnIndex + 1 + i, pAllHeaderPaddingProperty->maValue);
     282 [ +  + ][ +  - ]:       2744 :         if (pAllHeaderBorderProperty && !pHeaderBorders[i])
     283         [ +  - ]:        372 :             pHeaderNewBorders[i] = new XMLPropertyState(pAllHeaderBorderProperty->mnIndex + 1 + i, pAllHeaderBorderProperty->maValue);
     284         [ +  - ]:       2744 :         if( !pHeaderBorderWidths[i] )
     285                 :       2744 :             pHeaderBorderWidths[i] = pAllHeaderBorderWidthProperty;
     286                 :            :         else
     287                 :          0 :             pHeaderBorderWidths[i]->mnIndex = -1;
     288         [ +  + ]:       2744 :         if( pHeaderBorders[i] )
     289                 :            :         {
     290                 :         36 :             table::BorderLine2 aBorderLine;
     291         [ +  - ]:         36 :             pHeaderBorders[i]->maValue >>= aBorderLine;
     292         [ -  + ]:         36 :              if( pHeaderBorderWidths[i] )
     293                 :            :             {
     294                 :          0 :                 table::BorderLine2 aBorderLineWidth;
     295         [ #  # ]:          0 :                 pHeaderBorderWidths[i]->maValue >>= aBorderLineWidth;
     296                 :          0 :                 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
     297                 :          0 :                 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
     298                 :          0 :                 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
     299                 :          0 :                 aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
     300         [ #  # ]:         36 :                 pHeaderBorders[i]->maValue <<= aBorderLine;
     301                 :            :             }
     302                 :            :         }
     303 [ +  + ][ +  - ]:       2744 :         if (pAllFooterPaddingProperty && !pFooterPadding[i])
     304         [ +  - ]:        372 :             pFooterNewPadding[i] = new XMLPropertyState(pAllFooterPaddingProperty->mnIndex + 1 + i, pAllFooterPaddingProperty->maValue);
     305 [ +  + ][ +  - ]:       2744 :         if (pAllFooterBorderProperty && !pFooterBorders[i])
     306         [ +  - ]:        372 :             pFooterNewBorders[i] = new XMLPropertyState(pAllFooterBorderProperty->mnIndex + 1 + i, pAllFooterBorderProperty->maValue);
     307         [ +  - ]:       2744 :         if( !pFooterBorderWidths[i] )
     308                 :       2744 :             pFooterBorderWidths[i] = pAllFooterBorderWidthProperty;
     309                 :            :         else
     310                 :          0 :             pFooterBorderWidths[i]->mnIndex = -1;
     311         [ -  + ]:       2744 :         if( pFooterBorders[i] )
     312                 :            :         {
     313                 :          0 :             table::BorderLine2 aBorderLine;
     314         [ #  # ]:          0 :             pFooterBorders[i]->maValue >>= aBorderLine;
     315         [ #  # ]:          0 :              if( pFooterBorderWidths[i] )
     316                 :            :             {
     317                 :          0 :                 table::BorderLine2 aBorderLineWidth;
     318         [ #  # ]:          0 :                 pFooterBorderWidths[i]->maValue >>= aBorderLineWidth;
     319                 :          0 :                 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
     320                 :          0 :                 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
     321                 :          0 :                 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
     322                 :          0 :                 aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
     323         [ #  # ]:          0 :                 pFooterBorders[i]->maValue <<= aBorderLine;
     324                 :            :             }
     325                 :            :         }
     326                 :            :     }
     327                 :            : 
     328         [ +  + ]:        686 :     if (pHeaderHeight)
     329                 :            :     {
     330                 :          3 :         sal_Bool bValue(sal_False);
     331                 :          3 :         uno::Any aAny;
     332         [ +  - ]:          3 :         aAny.setValue( &bValue, ::getBooleanCppuType() );
     333         [ +  - ]:          3 :         pHeaderDynamic = new XMLPropertyState(pHeaderHeight->mnIndex + 2, aAny);
     334                 :            :     }
     335         [ +  + ]:        686 :     if (pHeaderMinHeight)
     336                 :            :     {
     337                 :        196 :         sal_Bool bValue(sal_True);
     338                 :        196 :         uno::Any aAny;
     339         [ +  - ]:        196 :         aAny.setValue( &bValue, ::getBooleanCppuType() );
     340         [ +  - ]:        196 :         pHeaderDynamic = new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, aAny);
     341                 :            :     }
     342         [ +  + ]:        686 :     if (pFooterHeight)
     343                 :            :     {
     344                 :          2 :         sal_Bool bValue(sal_False);
     345                 :          2 :         uno::Any aAny;
     346         [ +  - ]:          2 :         aAny.setValue( &bValue, ::getBooleanCppuType() );
     347         [ +  - ]:          2 :         pFooterDynamic = new XMLPropertyState(pFooterHeight->mnIndex + 2, aAny);
     348                 :            :     }
     349         [ +  + ]:        686 :     if (pFooterMinHeight)
     350                 :            :     {
     351                 :        199 :         sal_Bool bValue(sal_True);
     352                 :        199 :         uno::Any aAny;
     353         [ +  - ]:        199 :         aAny.setValue( &bValue, ::getBooleanCppuType() );
     354         [ +  - ]:        199 :         pFooterDynamic = new XMLPropertyState(pFooterMinHeight->mnIndex + 1, aAny);
     355                 :            :     }
     356                 :            : 
     357                 :            :     // fdo#38056: nerf the various AllFoo properties so they do not override
     358                 :            :     // the individual Foo properties later on
     359         [ +  + ]:        686 :     if (pAllPaddingProperty)
     360                 :            :     {
     361                 :          3 :         pAllPaddingProperty->mnIndex = -1;
     362                 :            :     }
     363         [ +  + ]:        686 :     if (pAllBorderProperty)
     364                 :            :     {
     365                 :          3 :         pAllBorderProperty->mnIndex = -1;
     366                 :            :     }
     367         [ -  + ]:        686 :     if (pAllBorderWidthProperty)
     368                 :            :     {
     369                 :          0 :         pAllBorderWidthProperty->mnIndex = -1;
     370                 :            :     }
     371         [ +  + ]:        686 :     if (pAllHeaderPaddingProperty)
     372                 :            :     {
     373                 :        102 :         pAllHeaderPaddingProperty->mnIndex = -1;
     374                 :            :     }
     375         [ +  + ]:        686 :     if (pAllHeaderBorderProperty)
     376                 :            :     {
     377                 :         93 :         pAllHeaderBorderProperty->mnIndex = -1;
     378                 :            :     }
     379         [ -  + ]:        686 :     if (pAllHeaderBorderWidthProperty)
     380                 :            :     {
     381                 :          0 :         pAllHeaderBorderWidthProperty->mnIndex = -1;
     382                 :            :     }
     383         [ +  + ]:        686 :     if (pAllFooterPaddingProperty)
     384                 :            :     {
     385                 :         93 :         pAllFooterPaddingProperty->mnIndex = -1;
     386                 :            :     }
     387         [ +  + ]:        686 :     if (pAllFooterBorderProperty)
     388                 :            :     {
     389                 :         93 :         pAllFooterBorderProperty->mnIndex = -1;
     390                 :            :     }
     391         [ -  + ]:        686 :     if (pAllFooterBorderWidthProperty)
     392                 :            :     {
     393                 :          0 :         pAllFooterBorderWidthProperty->mnIndex = -1;
     394                 :            :     }
     395         [ +  + ]:        686 :     if (pAllMarginProperty)
     396                 :            :     {
     397                 :         58 :         pAllMarginProperty->mnIndex = -1;
     398                 :            :     }
     399         [ -  + ]:        686 :     if (pAllHeaderMarginProperty)
     400                 :            :     {
     401                 :          0 :         pAllHeaderMarginProperty->mnIndex = -1;
     402                 :            :     }
     403         [ -  + ]:        686 :     if (pAllFooterMarginProperty)
     404                 :            :     {
     405                 :          0 :         pAllFooterMarginProperty->mnIndex = -1;
     406                 :            :     }
     407                 :            : 
     408         [ +  + ]:       3430 :     for (sal_uInt16 i = 0; i < 4; i++)
     409                 :            :     {
     410         [ -  + ]:       2744 :         if (pNewMargins[i].get())
     411                 :            :         {
     412         [ #  # ]:          0 :             rProperties.push_back(*pNewMargins[i]);
     413                 :            :         }
     414         [ -  + ]:       2744 :         if (pNewHeaderMargins[i].get())
     415                 :            :         {
     416         [ #  # ]:          0 :             rProperties.push_back(*pNewHeaderMargins[i]);
     417                 :            :         }
     418         [ -  + ]:       2744 :         if (pNewFooterMargins[i].get())
     419                 :            :         {
     420         [ #  # ]:          0 :             rProperties.push_back(*pNewFooterMargins[i]);
     421                 :            :         }
     422         [ +  + ]:       2744 :         if (pNewPadding[i])
     423                 :            :         {
     424         [ +  - ]:         12 :             rProperties.push_back(*pNewPadding[i]);
     425         [ +  - ]:         12 :             delete pNewPadding[i];
     426                 :            :         }
     427         [ +  + ]:       2744 :         if (pNewBorders[i])
     428                 :            :         {
     429         [ +  - ]:         12 :             rProperties.push_back(*pNewBorders[i]);
     430         [ +  - ]:         12 :             delete pNewBorders[i];
     431                 :            :         }
     432         [ +  + ]:       2744 :         if (pHeaderNewPadding[i])
     433                 :            :         {
     434         [ +  - ]:        408 :             rProperties.push_back(*pHeaderNewPadding[i]);
     435         [ +  - ]:        408 :             delete pHeaderNewPadding[i];
     436                 :            :         }
     437         [ +  + ]:       2744 :         if (pHeaderNewBorders[i])
     438                 :            :         {
     439         [ +  - ]:        372 :             rProperties.push_back(*pHeaderNewBorders[i]);
     440         [ +  - ]:        372 :             delete pHeaderNewBorders[i];
     441                 :            :         }
     442         [ +  + ]:       2744 :         if (pFooterNewPadding[i])
     443                 :            :         {
     444         [ +  - ]:        372 :             rProperties.push_back(*pFooterNewPadding[i]);
     445         [ +  - ]:        372 :             delete pFooterNewPadding[i];
     446                 :            :         }
     447         [ +  + ]:       2744 :         if (pFooterNewBorders[i])
     448                 :            :         {
     449         [ +  - ]:        372 :             rProperties.push_back(*pFooterNewBorders[i]);
     450         [ +  - ]:        372 :             delete pFooterNewBorders[i];
     451                 :            :         }
     452                 :            :     }
     453         [ +  + ]:        686 :     if(pHeaderDynamic)
     454                 :            :     {
     455         [ +  - ]:        199 :         rProperties.push_back(*pHeaderDynamic);
     456         [ +  - ]:        199 :         delete pHeaderDynamic;
     457                 :            :     }
     458         [ +  + ]:        686 :     if(pFooterDynamic)
     459                 :            :     {
     460         [ +  - ]:        201 :         rProperties.push_back(*pFooterDynamic);
     461         [ +  - ]:        201 :         delete pFooterDynamic;
     462 [ +  + ][ +  + ]:       8918 :     }
           [ +  +  #  #  
             #  #  #  # ]
     463                 :        686 : }
     464                 :            : 
     465                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10