LCOV - code coverage report
Current view: top level - libreoffice/xmloff/source/style - PageMasterExportPropMapper.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 181 223 81.2 %
Date: 2012-12-27 Functions: 11 13 84.6 %
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             : #include "PageMasterExportPropMapper.hxx"
      21             : #include <xmloff/xmltoken.hxx>
      22             : #include <comphelper/types.hxx>
      23             : #include <com/sun/star/table/BorderLine2.hpp>
      24             : #include <xmloff/PageMasterStyleMap.hxx>
      25             : #include <tools/debug.hxx>
      26             : #include <rtl/ustrbuf.hxx>
      27             : #include <comphelper/extract.hxx>
      28             : 
      29             : using namespace ::com::sun::star;
      30             : using namespace ::com::sun::star::uno;
      31             : using namespace ::com::sun::star::beans;
      32             : using namespace ::comphelper;
      33             : using namespace ::xmloff::token;
      34             : 
      35             : 
      36             : //______________________________________________________________________________
      37             : 
      38          24 : static inline sal_Bool lcl_HasSameLineWidth( const table::BorderLine2& rLine1, const table::BorderLine2& rLine2 )
      39             : {
      40             :     return  (rLine1.InnerLineWidth == rLine2.InnerLineWidth) &&
      41             :             (rLine1.OuterLineWidth == rLine2.OuterLineWidth) &&
      42             :             (rLine1.LineDistance == rLine2.LineDistance) &&
      43          24 :             (rLine1.LineWidth == rLine2.LineWidth);
      44             : }
      45             : 
      46          12 : inline sal_Bool operator==( const table::BorderLine2& rLine1, const table::BorderLine2& rLine2 )
      47             : {
      48             :     return  (rLine1.Color == rLine2.Color) &&
      49          12 :             lcl_HasSameLineWidth( rLine1, rLine2 ) &&
      50          24 :             ( rLine1.LineStyle == rLine2.LineStyle );
      51             : }
      52             : 
      53          92 : static inline void lcl_RemoveState( XMLPropertyState* pState )
      54             : {
      55          92 :     pState->mnIndex = -1;
      56          92 :     pState->maValue.clear();
      57          92 : }
      58             : 
      59           0 : static void lcl_RemoveStateIfZero16( XMLPropertyState* pState )
      60             : {
      61           0 :     sal_Int16   nValue = sal_Int16();
      62           0 :     if( (pState->maValue >>= nValue) && !nValue )
      63           0 :         lcl_RemoveState( pState );
      64           0 : }
      65             : 
      66           0 : static void lcl_AddState(::std::vector< XMLPropertyState >& rPropState, sal_Int32 nIndex, const rtl::OUString& rProperty, uno::Reference< beans::XPropertySet >& xProps)
      67             : {
      68           0 :     if(::cppu::any2bool(xProps->getPropertyValue(rProperty)))
      69           0 :         rPropState.push_back(XMLPropertyState (nIndex, cppu::bool2any(sal_True)));
      70           0 : }
      71             : 
      72             : //______________________________________________________________________________
      73             : // helper struct to handle equal XMLPropertyState's for page, header and footer
      74             : 
      75             : struct XMLPropertyStateBuffer
      76             : {
      77             :     XMLPropertyState*       pPMMarginAll;
      78             :     XMLPropertyState*       pPMMarginTop;
      79             :     XMLPropertyState*       pPMMarginBottom;
      80             :     XMLPropertyState*       pPMMarginLeft;
      81             :     XMLPropertyState*       pPMMarginRight;
      82             : 
      83             :     XMLPropertyState*       pPMBorderAll;
      84             :     XMLPropertyState*       pPMBorderTop;
      85             :     XMLPropertyState*       pPMBorderBottom;
      86             :     XMLPropertyState*       pPMBorderLeft;
      87             :     XMLPropertyState*       pPMBorderRight;
      88             : 
      89             :     XMLPropertyState*       pPMBorderWidthAll;
      90             :     XMLPropertyState*       pPMBorderWidthTop;
      91             :     XMLPropertyState*       pPMBorderWidthBottom;
      92             :     XMLPropertyState*       pPMBorderWidthLeft;
      93             :     XMLPropertyState*       pPMBorderWidthRight;
      94             : 
      95             :     XMLPropertyState*       pPMPaddingAll;
      96             :     XMLPropertyState*       pPMPaddingTop;
      97             :     XMLPropertyState*       pPMPaddingBottom;
      98             :     XMLPropertyState*       pPMPaddingLeft;
      99             :     XMLPropertyState*       pPMPaddingRight;
     100             : 
     101             :                             XMLPropertyStateBuffer();
     102             :     void                    ContextFilter( ::std::vector< XMLPropertyState >& rPropState );
     103             : };
     104             : 
     105          30 : XMLPropertyStateBuffer::XMLPropertyStateBuffer()
     106             :     :   pPMMarginAll( NULL )
     107             :     ,   pPMMarginTop( NULL )
     108             :     ,   pPMMarginBottom( NULL )
     109             :     ,   pPMMarginLeft( NULL )
     110             :     ,   pPMMarginRight( NULL )
     111             :     ,
     112             :         pPMBorderAll( NULL ),
     113             :         pPMBorderTop( NULL ),
     114             :         pPMBorderBottom( NULL ),
     115             :         pPMBorderLeft( NULL ),
     116             :         pPMBorderRight( NULL ),
     117             : 
     118             :         pPMBorderWidthAll( NULL ),
     119             :         pPMBorderWidthTop( NULL ),
     120             :         pPMBorderWidthBottom( NULL ),
     121             :         pPMBorderWidthLeft( NULL ),
     122             :         pPMBorderWidthRight( NULL ),
     123             : 
     124             :         pPMPaddingAll( NULL ),
     125             :         pPMPaddingTop( NULL ),
     126             :         pPMPaddingBottom( NULL ),
     127             :         pPMPaddingLeft( NULL ),
     128          30 :         pPMPaddingRight( NULL )
     129             : {
     130          30 : }
     131             : 
     132          30 : void XMLPropertyStateBuffer::ContextFilter( ::std::vector< XMLPropertyState >& )
     133             : {
     134          30 :     if (pPMMarginAll)
     135             :     {
     136          16 :         lcl_RemoveState(pPMMarginAll); // #i117696# do not write fo:margin
     137             :     }
     138             : 
     139          30 :     if( pPMBorderAll )
     140             :     {
     141           4 :         if( pPMBorderTop && pPMBorderBottom && pPMBorderLeft && pPMBorderRight )
     142             :         {
     143           4 :             table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight;
     144             : 
     145           4 :             pPMBorderTop->maValue >>= aLineTop;
     146           4 :             pPMBorderBottom->maValue >>= aLineBottom;
     147           4 :             pPMBorderLeft->maValue >>= aLineLeft;
     148           4 :             pPMBorderRight->maValue >>= aLineRight;
     149             : 
     150           4 :             if( (aLineTop == aLineBottom) && (aLineBottom == aLineLeft) && (aLineLeft == aLineRight) )
     151             :             {
     152           4 :                 lcl_RemoveState( pPMBorderTop );
     153           4 :                 lcl_RemoveState( pPMBorderBottom );
     154           4 :                 lcl_RemoveState( pPMBorderLeft );
     155           4 :                 lcl_RemoveState( pPMBorderRight );
     156             :             }
     157             :             else
     158           0 :                 lcl_RemoveState( pPMBorderAll );
     159             :         }
     160             :         else
     161           0 :             lcl_RemoveState( pPMBorderAll );
     162             :     }
     163             : 
     164          30 :     if( pPMBorderWidthAll )
     165             :     {
     166           4 :         if( pPMBorderWidthTop && pPMBorderWidthBottom && pPMBorderWidthLeft && pPMBorderWidthRight )
     167             :         {
     168           4 :             table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight;
     169             : 
     170           4 :             pPMBorderWidthTop->maValue >>= aLineTop;
     171           4 :             pPMBorderWidthBottom->maValue >>= aLineBottom;
     172           4 :             pPMBorderWidthLeft->maValue >>= aLineLeft;
     173           4 :             pPMBorderWidthRight->maValue >>= aLineRight;
     174             : 
     175          12 :             if( lcl_HasSameLineWidth( aLineTop, aLineBottom ) &&
     176           4 :                 lcl_HasSameLineWidth( aLineBottom, aLineLeft ) &&
     177           4 :                 lcl_HasSameLineWidth( aLineLeft, aLineRight ) )
     178             :             {
     179           4 :                 lcl_RemoveState( pPMBorderWidthTop );
     180           4 :                 lcl_RemoveState( pPMBorderWidthBottom );
     181           4 :                 lcl_RemoveState( pPMBorderWidthLeft );
     182           4 :                 lcl_RemoveState( pPMBorderWidthRight );
     183             :             }
     184             :             else
     185           0 :                 lcl_RemoveState( pPMBorderWidthAll );
     186             :         }
     187             :         else
     188           0 :             lcl_RemoveState( pPMBorderWidthAll );
     189             :     }
     190             : 
     191          30 :     if( pPMPaddingAll )
     192             :     {
     193           4 :         if( pPMPaddingTop && pPMPaddingBottom && pPMPaddingLeft && pPMPaddingRight )
     194             :         {
     195           4 :             sal_Int32 nTop = 0, nBottom = 0, nLeft = 0, nRight = 0;
     196             : 
     197           4 :             pPMPaddingTop->maValue >>= nTop;
     198           4 :             pPMPaddingBottom->maValue >>= nBottom;
     199           4 :             pPMPaddingLeft->maValue >>= nLeft;
     200           4 :             pPMPaddingRight->maValue >>= nRight;
     201             : 
     202           4 :             if( (nTop == nBottom) && (nBottom == nLeft) && (nLeft == nRight) )
     203             :             {
     204           4 :                 lcl_RemoveState( pPMPaddingTop );
     205           4 :                 lcl_RemoveState( pPMPaddingBottom );
     206           4 :                 lcl_RemoveState( pPMPaddingLeft );
     207           4 :                 lcl_RemoveState( pPMPaddingRight );
     208             :             }
     209             :             else
     210           0 :                 lcl_RemoveState( pPMPaddingAll );
     211             :         }
     212             :         else
     213           0 :             lcl_RemoveState( pPMPaddingAll );
     214             :     }
     215          30 : }
     216             : 
     217             : //______________________________________________________________________________
     218             : 
     219           4 : XMLPageMasterExportPropMapper::XMLPageMasterExportPropMapper(
     220             :         const UniReference< XMLPropertySetMapper >& rMapper,
     221             :         SvXMLExport& rExport ) :
     222             :     SvXMLExportPropertyMapper( rMapper ),
     223             :     aBackgroundImageExport( rExport ),
     224             :     aTextColumnsExport( rExport ),
     225           4 :     aFootnoteSeparatorExport( rExport )
     226             : {
     227           4 : }
     228             : 
     229           8 : XMLPageMasterExportPropMapper::~XMLPageMasterExportPropMapper()
     230             : {
     231           8 : }
     232             : 
     233          12 : void XMLPageMasterExportPropMapper::handleElementItem(
     234             :         SvXMLExport&,
     235             :         const XMLPropertyState& rProperty,
     236             :         sal_uInt16 /*nFlags*/,
     237             :         const ::std::vector< XMLPropertyState >* pProperties,
     238             :         sal_uInt32 nIdx ) const
     239             : {
     240          12 :     XMLPageMasterExportPropMapper* pThis = (XMLPageMasterExportPropMapper*) this;
     241             : 
     242          12 :     sal_uInt32 nContextId = getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex );
     243          12 :     switch( nContextId )
     244             :     {
     245             :         case CTF_PM_GRAPHICURL:
     246             :         case CTF_PM_HEADERGRAPHICURL:
     247             :         case CTF_PM_FOOTERGRAPHICURL:
     248             :             {
     249             :                 DBG_ASSERT( pProperties && (nIdx >= 2), "property vector missing" );
     250             :                 sal_Int32 nPos;
     251             :                 sal_Int32 nFilter;
     252           4 :                 switch( nContextId  )
     253             :                 {
     254             :                 case CTF_PM_GRAPHICURL:
     255           0 :                     nPos = CTF_PM_GRAPHICPOSITION;
     256           0 :                     nFilter = CTF_PM_GRAPHICFILTER;
     257           0 :                     break;
     258             :                 case CTF_PM_HEADERGRAPHICURL:
     259           2 :                     nPos = CTF_PM_HEADERGRAPHICPOSITION;
     260           2 :                     nFilter = CTF_PM_HEADERGRAPHICFILTER;
     261           2 :                     break;
     262             :                 case CTF_PM_FOOTERGRAPHICURL:
     263           2 :                     nPos = CTF_PM_FOOTERGRAPHICPOSITION;
     264           2 :                     nFilter = CTF_PM_FOOTERGRAPHICFILTER;
     265           2 :                     break;
     266             :                 default:
     267           0 :                     nPos = 0;  // TODO What values should this be?
     268           0 :                     nFilter = 0;
     269             :                 }
     270           4 :                 const Any*  pPos    = NULL;
     271           4 :                 const Any*  pFilter = NULL;
     272           4 :                 if( pProperties && (nIdx >= 2) )
     273             :                 {
     274           4 :                     const XMLPropertyState& rPos = (*pProperties)[nIdx - 2];
     275             :                     DBG_ASSERT( getPropertySetMapper()->GetEntryContextId( rPos.mnIndex ) == nPos,
     276             :                                 "invalid property map: pos expected" );
     277           4 :                     if( getPropertySetMapper()->GetEntryContextId( rPos.mnIndex ) == nPos )
     278           4 :                         pPos = &rPos.maValue;
     279             : 
     280           4 :                     const XMLPropertyState& rFilter = (*pProperties)[nIdx - 1];
     281             :                     DBG_ASSERT( getPropertySetMapper()->GetEntryContextId( rFilter.mnIndex ) == nFilter,
     282             :                                 "invalid property map: filter expected" );
     283           4 :                     if( getPropertySetMapper()->GetEntryContextId( rFilter.mnIndex ) == nFilter )
     284           4 :                         pFilter = &rFilter.maValue;
     285             :                 }
     286           4 :                 sal_uInt32 nPropIndex = rProperty.mnIndex;
     287             :                 pThis->aBackgroundImageExport.exportXML( rProperty.maValue, pPos, pFilter, NULL,
     288           4 :                     getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
     289           8 :                     getPropertySetMapper()->GetEntryXMLName( nPropIndex ) );
     290             :             }
     291           4 :             break;
     292             :         case CTF_PM_TEXTCOLUMNS:
     293           0 :             pThis->aTextColumnsExport.exportXML( rProperty.maValue );
     294           0 :             break;
     295             :         case CTF_PM_FTN_LINE_WEIGTH:
     296             :             pThis->aFootnoteSeparatorExport.exportXML( pProperties, nIdx,
     297           4 :                                                        getPropertySetMapper());
     298           4 :             break;
     299             :     }
     300          12 : }
     301             : 
     302          32 : void XMLPageMasterExportPropMapper::handleSpecialItem(
     303             :         SvXMLAttributeList&,
     304             :         const XMLPropertyState&,
     305             :         const SvXMLUnitConverter&,
     306             :         const SvXMLNamespaceMap&,
     307             :         const ::std::vector< XMLPropertyState >*,
     308             :         sal_uInt32 /*nIdx*/) const
     309             : {
     310          32 : }
     311             : 
     312          10 : void XMLPageMasterExportPropMapper::ContextFilter(
     313             :         ::std::vector< XMLPropertyState >& rPropState,
     314             :         Reference< XPropertySet > rPropSet ) const
     315             : {
     316          10 :     XMLPropertyStateBuffer  aPageBuffer;
     317          10 :     XMLPropertyStateBuffer  aHeaderBuffer;
     318          10 :     XMLPropertyStateBuffer  aFooterBuffer;
     319             : 
     320          10 :     XMLPropertyState*       pPMHeaderHeight     = NULL;
     321          10 :     XMLPropertyState*       pPMHeaderMinHeight  = NULL;
     322          10 :     XMLPropertyState*       pPMHeaderDynamic    = NULL;
     323             : 
     324          10 :     XMLPropertyState*       pPMFooterHeight     = NULL;
     325          10 :     XMLPropertyState*       pPMFooterMinHeight  = NULL;
     326          10 :     XMLPropertyState*       pPMFooterDynamic    = NULL;
     327             : 
     328          10 :     XMLPropertyState*       pPMScaleTo          = NULL;
     329          10 :     XMLPropertyState*       pPMScaleToPages     = NULL;
     330          10 :     XMLPropertyState*       pPMScaleToX         = NULL;
     331          10 :     XMLPropertyState*       pPMScaleToY         = NULL;
     332          10 :     XMLPropertyState*       pPMStandardMode     = NULL;
     333          10 :     XMLPropertyState*       pPMGridBaseWidth    = NULL;
     334             :     // same as pPMGridSnapTo but for backward compatibility only
     335          10 :     XMLPropertyState*       pPMGridSnapToChars  = NULL;
     336          10 :     XMLPropertyState*       pPMGridSnapTo       = NULL;
     337             : 
     338          10 :     XMLPropertyState*       pPrint              = NULL;
     339             : 
     340          10 :     UniReference < XMLPropertySetMapper > aPropMapper(getPropertySetMapper());
     341             : 
     342         278 :     for( ::std::vector< XMLPropertyState >::iterator aIter = rPropState.begin(); aIter != rPropState.end(); ++aIter )
     343             :     {
     344         268 :         XMLPropertyState *pProp = &(*aIter);
     345         268 :         sal_Int16 nContextId    = aPropMapper->GetEntryContextId( pProp->mnIndex );
     346         268 :         sal_Int16 nFlag         = nContextId & CTF_PM_FLAGMASK;
     347         268 :         sal_Int16 nSimpleId     = nContextId & (~CTF_PM_FLAGMASK | XML_PM_CTF_START);
     348         268 :         sal_Int16 nPrintId      = nContextId & CTF_PM_PRINTMASK;
     349             : 
     350             :         XMLPropertyStateBuffer* pBuffer;
     351         268 :         switch( nFlag )
     352             :         {
     353          78 :             case CTF_PM_HEADERFLAG:         pBuffer = &aHeaderBuffer;   break;
     354          78 :             case CTF_PM_FOOTERFLAG:         pBuffer = &aFooterBuffer;   break;
     355         112 :             default:                        pBuffer = &aPageBuffer;     break;
     356             :         }
     357             : 
     358         268 :         switch( nSimpleId )
     359             :         {
     360          16 :             case CTF_PM_MARGINALL:          pBuffer->pPMMarginAll           = pProp;    break;
     361          10 :             case CTF_PM_MARGINTOP:          pBuffer->pPMMarginTop           = pProp;    break;
     362          10 :             case CTF_PM_MARGINBOTTOM:       pBuffer->pPMMarginBottom        = pProp;    break;
     363          16 :             case CTF_PM_MARGINLEFT:         pBuffer->pPMMarginLeft          = pProp;    break;
     364          16 :             case CTF_PM_MARGINRIGHT:        pBuffer->pPMMarginRight         = pProp;    break;
     365           4 :             case CTF_PM_BORDERALL:          pBuffer->pPMBorderAll           = pProp;    break;
     366           4 :             case CTF_PM_BORDERTOP:          pBuffer->pPMBorderTop           = pProp;    break;
     367           4 :             case CTF_PM_BORDERBOTTOM:       pBuffer->pPMBorderBottom        = pProp;    break;
     368           4 :             case CTF_PM_BORDERLEFT:         pBuffer->pPMBorderLeft          = pProp;    break;
     369           4 :             case CTF_PM_BORDERRIGHT:        pBuffer->pPMBorderRight         = pProp;    break;
     370           4 :             case CTF_PM_BORDERWIDTHALL:     pBuffer->pPMBorderWidthAll      = pProp;    break;
     371           4 :             case CTF_PM_BORDERWIDTHTOP:     pBuffer->pPMBorderWidthTop      = pProp;    break;
     372           4 :             case CTF_PM_BORDERWIDTHBOTTOM:  pBuffer->pPMBorderWidthBottom   = pProp;    break;
     373           4 :             case CTF_PM_BORDERWIDTHLEFT:    pBuffer->pPMBorderWidthLeft     = pProp;    break;
     374           4 :             case CTF_PM_BORDERWIDTHRIGHT:   pBuffer->pPMBorderWidthRight    = pProp;    break;
     375           4 :             case CTF_PM_PADDINGALL:         pBuffer->pPMPaddingAll          = pProp;    break;
     376           4 :             case CTF_PM_PADDINGTOP:         pBuffer->pPMPaddingTop          = pProp;    break;
     377           4 :             case CTF_PM_PADDINGBOTTOM:      pBuffer->pPMPaddingBottom       = pProp;    break;
     378           4 :             case CTF_PM_PADDINGLEFT:        pBuffer->pPMPaddingLeft         = pProp;    break;
     379           4 :             case CTF_PM_PADDINGRIGHT:       pBuffer->pPMPaddingRight        = pProp;    break;
     380             :         }
     381             : 
     382         268 :         switch( nContextId )
     383             :         {
     384           6 :             case CTF_PM_HEADERHEIGHT:       pPMHeaderHeight     = pProp;    break;
     385           6 :             case CTF_PM_HEADERMINHEIGHT:    pPMHeaderMinHeight  = pProp;    break;
     386           2 :             case CTF_PM_HEADERDYNAMIC:      pPMHeaderDynamic    = pProp;    break;
     387           6 :             case CTF_PM_FOOTERHEIGHT:       pPMFooterHeight     = pProp;    break;
     388           6 :             case CTF_PM_FOOTERMINHEIGHT:    pPMFooterMinHeight  = pProp;    break;
     389           2 :             case CTF_PM_FOOTERDYNAMIC:      pPMFooterDynamic    = pProp;    break;
     390           0 :             case CTF_PM_SCALETO:            pPMScaleTo          = pProp;    break;
     391           0 :             case CTF_PM_SCALETOPAGES:       pPMScaleToPages     = pProp;    break;
     392           0 :             case CTF_PM_SCALETOX:           pPMScaleToX         = pProp;    break;
     393           0 :             case CTF_PM_SCALETOY:           pPMScaleToY         = pProp;    break;
     394           4 :             case CTF_PM_STANDARD_MODE:      pPMStandardMode     = pProp;    break;
     395           2 :             case CTP_PM_GRID_BASE_WIDTH:        pPMGridBaseWidth    = pProp;    break;
     396           2 :             case CTP_PM_GRID_SNAP_TO_CHARS:     pPMGridSnapToChars  = pProp;    break;
     397           2 :             case CTP_PM_GRID_SNAP_TO:       pPMGridSnapTo = pProp;    break;
     398             :         }
     399         268 :         if (nPrintId == CTF_PM_PRINTMASK)
     400             :         {
     401           0 :             pPrint = pProp;
     402           0 :             lcl_RemoveState(pPrint);
     403             :         }
     404             :     }
     405             : 
     406          10 :     if( pPMStandardMode && !getBOOL(pPMStandardMode->maValue) )
     407             :     {
     408           4 :         lcl_RemoveState(pPMStandardMode);
     409           4 :         if( pPMGridBaseWidth )
     410           2 :             lcl_RemoveState(pPMGridBaseWidth);
     411           4 :         if( pPMGridSnapToChars )
     412           2 :             lcl_RemoveState(pPMGridSnapToChars);
     413           4 :         if (pPMGridSnapTo)
     414             :         {
     415           2 :             lcl_RemoveState(pPMGridSnapTo);
     416             :         }
     417             :     }
     418             : 
     419          10 :     if( pPMGridBaseWidth && pPMStandardMode )
     420           2 :         lcl_RemoveState(pPMStandardMode);
     421             : 
     422          10 :     aPageBuffer.ContextFilter( rPropState );
     423          10 :     aHeaderBuffer.ContextFilter( rPropState );
     424          10 :     aFooterBuffer.ContextFilter( rPropState );
     425             : 
     426          10 :     if( pPMHeaderHeight && (!pPMHeaderDynamic || (pPMHeaderDynamic && getBOOL( pPMHeaderDynamic->maValue ))) )
     427           6 :         lcl_RemoveState( pPMHeaderHeight );
     428          10 :     if( pPMHeaderMinHeight && pPMHeaderDynamic && !getBOOL( pPMHeaderDynamic->maValue ) )
     429           0 :         lcl_RemoveState( pPMHeaderMinHeight );
     430          10 :     if( pPMHeaderDynamic )
     431           2 :         lcl_RemoveState( pPMHeaderDynamic );
     432             : 
     433          10 :     if( pPMFooterHeight && (!pPMFooterDynamic || (pPMFooterDynamic && getBOOL( pPMFooterDynamic->maValue ))) )
     434           6 :         lcl_RemoveState( pPMFooterHeight );
     435          10 :     if( pPMFooterMinHeight && pPMFooterDynamic && !getBOOL( pPMFooterDynamic->maValue ) )
     436           0 :         lcl_RemoveState( pPMFooterMinHeight );
     437          10 :     if( pPMFooterDynamic )
     438           2 :         lcl_RemoveState( pPMFooterDynamic );
     439             : 
     440          10 :     if( pPMScaleTo )
     441           0 :         lcl_RemoveStateIfZero16( pPMScaleTo );
     442          10 :     if( pPMScaleToPages )
     443           0 :         lcl_RemoveStateIfZero16( pPMScaleToPages );
     444          10 :     if( pPMScaleToX )
     445           0 :         lcl_RemoveStateIfZero16( pPMScaleToX );
     446          10 :     if( pPMScaleToY )
     447           0 :         lcl_RemoveStateIfZero16( pPMScaleToY );
     448             : 
     449          10 :     if (pPrint)
     450             :     {
     451           0 :         lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_ANNOTATIONS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintAnnotations")), rPropSet);
     452           0 :         lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_CHARTS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintCharts")), rPropSet);
     453           0 :         lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_DRAWING), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintDrawing")), rPropSet);
     454           0 :         lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_FORMULAS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintFormulas")), rPropSet);
     455           0 :         lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_GRID), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintGrid")), rPropSet);
     456           0 :         lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_HEADERS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintHeaders")), rPropSet);
     457           0 :         lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_OBJECTS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintObjects")), rPropSet);
     458           0 :         lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_ZEROVALUES), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintZeroValues")), rPropSet);
     459             :     }
     460             : 
     461          10 :     SvXMLExportPropertyMapper::ContextFilter(rPropState,rPropSet);
     462          10 : }
     463             : 
     464             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10