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

Generated by: LCOV version 1.10