LCOV - code coverage report
Current view: top level - xmloff/source/style - PageMasterImportPropMapper.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 204 273 74.7 %
Date: 2014-11-03 Functions: 4 5 80.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         800 : PageMasterImportPropertyMapper::PageMasterImportPropertyMapper(
      40             :         const rtl::Reference< XMLPropertySetMapper >& rMapper,
      41             :         SvXMLImport& rImp ) :
      42             :     SvXMLImportPropertyMapper( rMapper, rImp ),
      43         800 :     rImport( rImp )
      44             : {
      45         800 : }
      46             : 
      47        1600 : PageMasterImportPropertyMapper::~PageMasterImportPropertyMapper()
      48             : {
      49        1600 : }
      50             : 
      51           0 : 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           0 :     bool bRet = false;
      59             :     sal_Int16 nContextID =
      60           0 :             getPropertySetMapper()->GetEntryContextId(rProperty.mnIndex);
      61             : 
      62           0 :     if( CTF_PM_REGISTER_STYLE==nContextID )
      63             :     {
      64             :         OUString sDisplayName( rImport.GetStyleDisplayName(
      65           0 :                     XML_STYLE_FAMILY_TEXT_PARAGRAPH, rValue ) );
      66             :         Reference < XNameContainer > xParaStyles =
      67           0 :             rImport.GetTextImport()->GetParaStyles();
      68           0 :         if( xParaStyles.is() && xParaStyles->hasByName( sDisplayName ) )
      69             :         {
      70           0 :             rProperty.maValue <<= sDisplayName;
      71           0 :             bRet = true;
      72           0 :         }
      73             :     }
      74             :     else
      75             :     {
      76             :         bRet = SvXMLImportPropertyMapper::handleSpecialItem(
      77             :                     rProperty, rProperties, rValue,
      78           0 :                     rUnitConverter, rNamespaceMap );
      79             :     }
      80             : 
      81           0 :     return bRet;
      82             : }
      83             : 
      84             : 
      85        2688 : void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
      86             : {
      87        2688 :     SvXMLImportPropertyMapper::finished(rProperties, nStartIndex, nEndIndex);
      88        2688 :     XMLPropertyState* pAllPaddingProperty = NULL;
      89        2688 :     XMLPropertyState* pPadding[4] = { NULL, NULL, NULL, NULL };
      90        2688 :     XMLPropertyState* pNewPadding[4] = { NULL, NULL, NULL, NULL };
      91        2688 :     XMLPropertyState* pAllBorderProperty = NULL;
      92        2688 :     XMLPropertyState* pBorders[4] = { NULL, NULL, NULL, NULL };
      93        2688 :     XMLPropertyState* pNewBorders[4] = { NULL, NULL, NULL, NULL };
      94        2688 :     XMLPropertyState* pAllBorderWidthProperty = NULL;
      95        2688 :     XMLPropertyState* pBorderWidths[4] = { NULL, NULL, NULL, NULL };
      96        2688 :     XMLPropertyState* pAllHeaderPaddingProperty = NULL;
      97        2688 :     XMLPropertyState* pHeaderPadding[4] = { NULL, NULL, NULL, NULL };
      98        2688 :     XMLPropertyState* pHeaderNewPadding[4] = { NULL, NULL, NULL, NULL };
      99        2688 :     XMLPropertyState* pAllHeaderBorderProperty = NULL;
     100        2688 :     XMLPropertyState* pHeaderBorders[4] = { NULL, NULL, NULL, NULL };
     101        2688 :     XMLPropertyState* pHeaderNewBorders[4] = { NULL, NULL, NULL, NULL };
     102        2688 :     XMLPropertyState* pAllHeaderBorderWidthProperty = NULL;
     103        2688 :     XMLPropertyState* pHeaderBorderWidths[4] = { NULL, NULL, NULL, NULL };
     104        2688 :     XMLPropertyState* pAllFooterPaddingProperty = NULL;
     105        2688 :     XMLPropertyState* pFooterPadding[4] = { NULL, NULL, NULL, NULL };
     106        2688 :     XMLPropertyState* pFooterNewPadding[4] = { NULL, NULL, NULL, NULL };
     107        2688 :     XMLPropertyState* pAllFooterBorderProperty = NULL;
     108        2688 :     XMLPropertyState* pFooterBorders[4] = { NULL, NULL, NULL, NULL };
     109        2688 :     XMLPropertyState* pFooterNewBorders[4] = { NULL, NULL, NULL, NULL };
     110        2688 :     XMLPropertyState* pAllFooterBorderWidthProperty = NULL;
     111        2688 :     XMLPropertyState* pFooterBorderWidths[4] = { NULL, NULL, NULL, NULL };
     112        2688 :     XMLPropertyState* pHeaderHeight = NULL;
     113        2688 :     XMLPropertyState* pHeaderMinHeight = NULL;
     114        2688 :     boost::scoped_ptr<XMLPropertyState> xHeaderDynamic;
     115        2688 :     XMLPropertyState* pFooterHeight = NULL;
     116        2688 :     XMLPropertyState* pFooterMinHeight = NULL;
     117        5376 :     boost::scoped_ptr<XMLPropertyState> xFooterDynamic;
     118        2688 :     XMLPropertyState* pAllMarginProperty = NULL;
     119        2688 :     XMLPropertyState* pMargins[4] = { NULL, NULL, NULL, NULL };
     120        5376 :     ::std::unique_ptr<XMLPropertyState> pNewMargins[4];
     121        2688 :     XMLPropertyState* pAllHeaderMarginProperty = NULL;
     122        2688 :     XMLPropertyState* pHeaderMargins[4] = { NULL, NULL, NULL, NULL };
     123        5376 :     ::std::unique_ptr<XMLPropertyState> pNewHeaderMargins[4];
     124        2688 :     XMLPropertyState* pAllFooterMarginProperty = NULL;
     125        2688 :     XMLPropertyState* pFooterMargins[4] = { NULL, NULL, NULL, NULL };
     126        5376 :     ::std::unique_ptr<XMLPropertyState> pNewFooterMargins[4];
     127             : 
     128        2688 :     ::std::vector< XMLPropertyState >::iterator aEnd = rProperties.end();
     129       30088 :     for (::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin(); aIter != aEnd; ++aIter)
     130             :     {
     131       27400 :         XMLPropertyState *property = &(*aIter);
     132       27400 :         sal_Int16 nContextID = getPropertySetMapper()->GetEntryContextId(property->mnIndex);
     133       27400 :         if (property->mnIndex >= nStartIndex && property->mnIndex < nEndIndex)
     134             :         {
     135       16908 :             switch (nContextID)
     136             :             {
     137           8 :                 case CTF_PM_PADDINGALL                  : pAllPaddingProperty = property; break;
     138           6 :                 case CTF_PM_PADDINGLEFT                 : pPadding[XML_LINE_LEFT] = property; break;
     139           6 :                 case CTF_PM_PADDINGRIGHT                : pPadding[XML_LINE_RIGHT] = property; break;
     140           6 :                 case CTF_PM_PADDINGTOP                  : pPadding[XML_LINE_TOP] = property; break;
     141           6 :                 case CTF_PM_PADDINGBOTTOM               : pPadding[XML_LINE_BOTTOM] = property; break;
     142          10 :                 case CTF_PM_BORDERALL                   : pAllBorderProperty = property; break;
     143           2 :                 case CTF_PM_BORDERLEFT                  : pBorders[XML_LINE_LEFT] = property; break;
     144           2 :                 case CTF_PM_BORDERRIGHT                 : pBorders[XML_LINE_RIGHT] = property; break;
     145           2 :                 case CTF_PM_BORDERTOP                   : pBorders[XML_LINE_TOP] = property; break;
     146           2 :                 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           2 :                 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         280 :                 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         268 :                 case CTF_PM_HEADERBORDERALL             : pAllHeaderBorderProperty = property; break;
     158          10 :                 case CTF_PM_HEADERBORDERLEFT            : pHeaderBorders[XML_LINE_LEFT] = property; break;
     159          10 :                 case CTF_PM_HEADERBORDERRIGHT           : pHeaderBorders[XML_LINE_RIGHT] = property; break;
     160          10 :                 case CTF_PM_HEADERBORDERTOP             : pHeaderBorders[XML_LINE_TOP] = property; break;
     161          10 :                 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           2 :                 case CTF_PM_HEADERBORDERWIDTHBOTTOM     : pHeaderBorderWidths[XML_LINE_BOTTOM] = property; break;
     167         268 :                 case CTF_PM_FOOTERPADDINGALL            : pAllFooterPaddingProperty = property; break;
     168           0 :                 case CTF_PM_FOOTERPADDINGLEFT           : pFooterPadding[XML_LINE_LEFT] = property; break;
     169           0 :                 case CTF_PM_FOOTERPADDINGRIGHT          : pFooterPadding[XML_LINE_RIGHT] = property; break;
     170           0 :                 case CTF_PM_FOOTERPADDINGTOP            : pFooterPadding[XML_LINE_TOP] = property; break;
     171           0 :                 case CTF_PM_FOOTERPADDINGBOTTOM         : pFooterPadding[XML_LINE_BOTTOM] = property; break;
     172         266 :                 case CTF_PM_FOOTERBORDERALL             : pAllFooterBorderProperty = property; break;
     173           0 :                 case CTF_PM_FOOTERBORDERLEFT            : pFooterBorders[XML_LINE_LEFT] = property; break;
     174           0 :                 case CTF_PM_FOOTERBORDERRIGHT           : pFooterBorders[XML_LINE_RIGHT] = property; break;
     175           0 :                 case CTF_PM_FOOTERBORDERTOP             : pFooterBorders[XML_LINE_TOP] = property; break;
     176           0 :                 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           8 :                 case CTF_PM_HEADERHEIGHT                : pHeaderHeight = property; break;
     183         592 :                 case CTF_PM_HEADERMINHEIGHT             : pHeaderMinHeight = property; break;
     184          10 :                 case CTF_PM_FOOTERHEIGHT                : pFooterHeight = property; break;
     185         584 :                 case CTF_PM_FOOTERMINHEIGHT             : pFooterMinHeight = property; break;
     186             :                 case CTF_PM_MARGINALL   :
     187          54 :                       pAllMarginProperty = property; break;
     188             :                 case CTF_PM_MARGINTOP   :
     189         912 :                       pMargins[XML_LINE_TOP] = property; break;
     190             :                 case CTF_PM_MARGINBOTTOM:
     191         912 :                       pMargins[XML_LINE_BOTTOM] = property; break;
     192             :                 case CTF_PM_MARGINLEFT  :
     193         912 :                       pMargins[XML_LINE_LEFT] = property; break;
     194             :                 case CTF_PM_MARGINRIGHT :
     195         912 :                       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         600 :                       pHeaderMargins[XML_LINE_BOTTOM] = property; break;
     202             :                 case CTF_PM_HEADERMARGINLEFT  :
     203         596 :                       pHeaderMargins[XML_LINE_LEFT] = property; break;
     204             :                 case CTF_PM_HEADERMARGINRIGHT :
     205         596 :                       pHeaderMargins[XML_LINE_RIGHT] = property; break;
     206             :                 case CTF_PM_FOOTERMARGINALL   :
     207           0 :                       pAllFooterMarginProperty = property; break;
     208             :                 case CTF_PM_FOOTERMARGINTOP   :
     209         594 :                       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         594 :                       pFooterMargins[XML_LINE_LEFT] = property; break;
     214             :                 case CTF_PM_FOOTERMARGINRIGHT :
     215         594 :                       pFooterMargins[XML_LINE_RIGHT] = property; break;
     216             :             }
     217             :         }
     218             :     }
     219             : 
     220       13440 :     for (sal_uInt16 i = 0; i < 4; i++)
     221             :     {
     222       10752 :         if (pAllMarginProperty && !pMargins[i])
     223             :         {
     224           0 :             pNewMargins[i].reset(new XMLPropertyState(
     225           0 :                 pAllMarginProperty->mnIndex + 1 + i,
     226           0 :                 pAllMarginProperty->maValue));
     227             :         }
     228       10752 :         if (pAllHeaderMarginProperty && !pHeaderMargins[i])
     229             :         {
     230           0 :             pNewHeaderMargins[i].reset(new XMLPropertyState(
     231           0 :                 pAllHeaderMarginProperty->mnIndex + 1 + i,
     232           0 :                 pAllHeaderMarginProperty->maValue));
     233             :         }
     234       10752 :         if (pAllFooterMarginProperty && !pFooterMargins[i])
     235             :         {
     236           0 :             pNewFooterMargins[i].reset(new XMLPropertyState(
     237           0 :                 pAllFooterMarginProperty->mnIndex + 1 + i,
     238           0 :                 pAllFooterMarginProperty->maValue));
     239             :         }
     240       10752 :         if (pAllPaddingProperty && !pPadding[i])
     241          32 :             pNewPadding[i] = new XMLPropertyState(pAllPaddingProperty->mnIndex + 1 + i, pAllPaddingProperty->maValue);
     242       10752 :         if (pAllBorderProperty && !pBorders[i])
     243             :         {
     244          40 :             pNewBorders[i] = new XMLPropertyState(pAllBorderProperty->mnIndex + 1 + i, pAllBorderProperty->maValue);
     245          40 :             pBorders[i] = pNewBorders[i];
     246             :         }
     247       10752 :         if( !pBorderWidths[i] )
     248       10750 :             pBorderWidths[i] = pAllBorderWidthProperty;
     249             :         else
     250           2 :             pBorderWidths[i]->mnIndex = -1;
     251       10752 :         if( pBorders[i] )
     252             :         {
     253          48 :             table::BorderLine2 aBorderLine;
     254          48 :             pBorders[i]->maValue >>= aBorderLine;
     255          48 :              if( pBorderWidths[i] )
     256             :             {
     257           2 :                 table::BorderLine2 aBorderLineWidth;
     258           2 :                 pBorderWidths[i]->maValue >>= aBorderLineWidth;
     259           2 :                 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
     260           2 :                 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
     261           2 :                 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
     262           2 :                 aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
     263           2 :                 pBorders[i]->maValue <<= aBorderLine;
     264             :             }
     265             :         }
     266       10752 :         if (pAllHeaderPaddingProperty && !pHeaderPadding[i])
     267        1120 :             pHeaderNewPadding[i] = new XMLPropertyState(pAllHeaderPaddingProperty->mnIndex + 1 + i, pAllHeaderPaddingProperty->maValue);
     268       10752 :         if (pAllHeaderBorderProperty && !pHeaderBorders[i])
     269        1072 :             pHeaderNewBorders[i] = new XMLPropertyState(pAllHeaderBorderProperty->mnIndex + 1 + i, pAllHeaderBorderProperty->maValue);
     270       10752 :         if( !pHeaderBorderWidths[i] )
     271       10750 :             pHeaderBorderWidths[i] = pAllHeaderBorderWidthProperty;
     272             :         else
     273           2 :             pHeaderBorderWidths[i]->mnIndex = -1;
     274       10752 :         if( pHeaderBorders[i] )
     275             :         {
     276          40 :             table::BorderLine2 aBorderLine;
     277          40 :             pHeaderBorders[i]->maValue >>= aBorderLine;
     278          40 :              if( pHeaderBorderWidths[i] )
     279             :             {
     280           2 :                 table::BorderLine2 aBorderLineWidth;
     281           2 :                 pHeaderBorderWidths[i]->maValue >>= aBorderLineWidth;
     282           2 :                 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
     283           2 :                 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
     284           2 :                 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
     285           2 :                 aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
     286           2 :                 pHeaderBorders[i]->maValue <<= aBorderLine;
     287             :             }
     288             :         }
     289       10752 :         if (pAllFooterPaddingProperty && !pFooterPadding[i])
     290        1072 :             pFooterNewPadding[i] = new XMLPropertyState(pAllFooterPaddingProperty->mnIndex + 1 + i, pAllFooterPaddingProperty->maValue);
     291       10752 :         if (pAllFooterBorderProperty && !pFooterBorders[i])
     292        1064 :             pFooterNewBorders[i] = new XMLPropertyState(pAllFooterBorderProperty->mnIndex + 1 + i, pAllFooterBorderProperty->maValue);
     293       10752 :         if( !pFooterBorderWidths[i] )
     294       10752 :             pFooterBorderWidths[i] = pAllFooterBorderWidthProperty;
     295             :         else
     296           0 :             pFooterBorderWidths[i]->mnIndex = -1;
     297       10752 :         if( pFooterBorders[i] )
     298             :         {
     299           0 :             table::BorderLine2 aBorderLine;
     300           0 :             pFooterBorders[i]->maValue >>= aBorderLine;
     301           0 :              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        2688 :     if (pHeaderHeight)
     315             :     {
     316           8 :         sal_Bool bValue(sal_False);
     317           8 :         uno::Any aAny;
     318           8 :         aAny.setValue( &bValue, ::getBooleanCppuType() );
     319           8 :         xHeaderDynamic.reset(new XMLPropertyState(pHeaderHeight->mnIndex + 2, aAny));
     320             :     }
     321        2688 :     if (pHeaderMinHeight)
     322             :     {
     323         592 :         sal_Bool bValue(sal_True);
     324         592 :         uno::Any aAny;
     325         592 :         aAny.setValue( &bValue, ::getBooleanCppuType() );
     326         592 :         xHeaderDynamic.reset(new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, aAny));
     327             :     }
     328        2688 :     if (pFooterHeight)
     329             :     {
     330          10 :         sal_Bool bValue(sal_False);
     331          10 :         uno::Any aAny;
     332          10 :         aAny.setValue( &bValue, ::getBooleanCppuType() );
     333          10 :         xFooterDynamic.reset(new XMLPropertyState(pFooterHeight->mnIndex + 2, aAny));
     334             :     }
     335        2688 :     if (pFooterMinHeight)
     336             :     {
     337         584 :         sal_Bool bValue(sal_True);
     338         584 :         uno::Any aAny;
     339         584 :         aAny.setValue( &bValue, ::getBooleanCppuType() );
     340         584 :         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        2688 :     if (pAllPaddingProperty)
     346             :     {
     347           8 :         pAllPaddingProperty->mnIndex = -1;
     348             :     }
     349        2688 :     if (pAllBorderProperty)
     350             :     {
     351          10 :         pAllBorderProperty->mnIndex = -1;
     352             :     }
     353        2688 :     if (pAllBorderWidthProperty)
     354             :     {
     355           0 :         pAllBorderWidthProperty->mnIndex = -1;
     356             :     }
     357        2688 :     if (pAllHeaderPaddingProperty)
     358             :     {
     359         280 :         pAllHeaderPaddingProperty->mnIndex = -1;
     360             :     }
     361        2688 :     if (pAllHeaderBorderProperty)
     362             :     {
     363         268 :         pAllHeaderBorderProperty->mnIndex = -1;
     364             :     }
     365        2688 :     if (pAllHeaderBorderWidthProperty)
     366             :     {
     367           0 :         pAllHeaderBorderWidthProperty->mnIndex = -1;
     368             :     }
     369        2688 :     if (pAllFooterPaddingProperty)
     370             :     {
     371         268 :         pAllFooterPaddingProperty->mnIndex = -1;
     372             :     }
     373        2688 :     if (pAllFooterBorderProperty)
     374             :     {
     375         266 :         pAllFooterBorderProperty->mnIndex = -1;
     376             :     }
     377        2688 :     if (pAllFooterBorderWidthProperty)
     378             :     {
     379           0 :         pAllFooterBorderWidthProperty->mnIndex = -1;
     380             :     }
     381        2688 :     if (pAllMarginProperty)
     382             :     {
     383          54 :         pAllMarginProperty->mnIndex = -1;
     384             :     }
     385        2688 :     if (pAllHeaderMarginProperty)
     386             :     {
     387           0 :         pAllHeaderMarginProperty->mnIndex = -1;
     388             :     }
     389        2688 :     if (pAllFooterMarginProperty)
     390             :     {
     391           0 :         pAllFooterMarginProperty->mnIndex = -1;
     392             :     }
     393             : 
     394       13440 :     for (sal_uInt16 i = 0; i < 4; i++)
     395             :     {
     396       10752 :         if (pNewMargins[i].get())
     397             :         {
     398           0 :             rProperties.push_back(*pNewMargins[i]);
     399             :         }
     400       10752 :         if (pNewHeaderMargins[i].get())
     401             :         {
     402           0 :             rProperties.push_back(*pNewHeaderMargins[i]);
     403             :         }
     404       10752 :         if (pNewFooterMargins[i].get())
     405             :         {
     406           0 :             rProperties.push_back(*pNewFooterMargins[i]);
     407             :         }
     408       10752 :         if (pNewPadding[i])
     409             :         {
     410          32 :             rProperties.push_back(*pNewPadding[i]);
     411          32 :             delete pNewPadding[i];
     412             :         }
     413       10752 :         if (pNewBorders[i])
     414             :         {
     415          40 :             rProperties.push_back(*pNewBorders[i]);
     416          40 :             delete pNewBorders[i];
     417             :         }
     418       10752 :         if (pHeaderNewPadding[i])
     419             :         {
     420        1120 :             rProperties.push_back(*pHeaderNewPadding[i]);
     421        1120 :             delete pHeaderNewPadding[i];
     422             :         }
     423       10752 :         if (pHeaderNewBorders[i])
     424             :         {
     425        1072 :             rProperties.push_back(*pHeaderNewBorders[i]);
     426        1072 :             delete pHeaderNewBorders[i];
     427             :         }
     428       10752 :         if (pFooterNewPadding[i])
     429             :         {
     430        1072 :             rProperties.push_back(*pFooterNewPadding[i]);
     431        1072 :             delete pFooterNewPadding[i];
     432             :         }
     433       10752 :         if (pFooterNewBorders[i])
     434             :         {
     435        1064 :             rProperties.push_back(*pFooterNewBorders[i]);
     436        1064 :             delete pFooterNewBorders[i];
     437             :         }
     438             :     }
     439        2688 :     if(xHeaderDynamic)
     440             :     {
     441         600 :         rProperties.push_back(*xHeaderDynamic);
     442         600 :         xHeaderDynamic.reset();
     443             :     }
     444        2688 :     if(xFooterDynamic)
     445             :     {
     446         594 :         rProperties.push_back(*xFooterDynamic);
     447         594 :         xFooterDynamic.reset();
     448        2688 :     }
     449        2688 : }
     450             : 
     451             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10