LCOV - code coverage report
Current view: top level - xmloff/source/style - PageMasterImportPropMapper.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 226 273 82.8 %
Date: 2015-06-13 12:38:46 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.11