LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/xmloff/source/text - txtexppr.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 463 589 78.6 %
Date: 2013-07-09 Functions: 9 10 90.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             : #include <com/sun/star/table/BorderLine2.hpp>
      21             : 
      22             : #include "txtexppr.hxx"
      23             : 
      24             : #include <com/sun/star/text/SizeType.hpp>
      25             : #include <com/sun/star/text/WrapTextMode.hpp>
      26             : #include <com/sun/star/text/TextContentAnchorType.hpp>
      27             : #include <com/sun/star/awt/FontUnderline.hpp>
      28             : #include <com/sun/star/text/XChapterNumberingSupplier.hpp>
      29             : 
      30             : #include <tools/debug.hxx>
      31             : 
      32             : #include <xmloff/txtprmap.hxx>
      33             : #include <xmloff/xmlexp.hxx>
      34             : #include "XMLSectionFootnoteConfigExport.hxx"
      35             : 
      36             : 
      37             : using namespace ::com::sun::star;
      38             : using namespace ::com::sun::star::uno;
      39             : using namespace ::com::sun::star::style;
      40             : using namespace ::com::sun::star::beans;
      41             : using namespace ::com::sun::star::text;
      42             : 
      43          37 : void XMLTextExportPropertySetMapper::handleElementItem(
      44             :         SvXMLExport& rExp,
      45             :         const XMLPropertyState& rProperty,
      46             :         sal_uInt16 nFlags,
      47             :         const ::std::vector< XMLPropertyState > *pProperties,
      48             :         sal_uInt32 nIdx ) const
      49             : {
      50             :     XMLTextExportPropertySetMapper *pThis =
      51          37 :            ((XMLTextExportPropertySetMapper *)this);
      52             : 
      53          37 :     switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
      54             :     {
      55             :     case CTF_DROPCAPFORMAT:
      56             :         pThis->maDropCapExport.exportXML( rProperty.maValue, bDropWholeWord,
      57           0 :                                           sDropCharStyle );
      58           0 :         pThis->bDropWholeWord = sal_False;
      59           0 :         pThis->sDropCharStyle = OUString();
      60           0 :         break;
      61             : 
      62             :     case CTF_TABSTOP:
      63          30 :         pThis->maTabStopExport.Export( rProperty.maValue );
      64          30 :         break;
      65             : 
      66             :     case CTF_TEXTCOLUMNS:
      67           6 :         pThis->maTextColumnsExport.exportXML( rProperty.maValue );
      68           6 :         break;
      69             : 
      70             :     case CTF_BACKGROUND_URL:
      71             :         {
      72             :             DBG_ASSERT( pProperties && nIdx >= 3,
      73             :                         "property vector missing" );
      74           1 :             const Any *pPos = 0, *pFilter = 0, *pTrans = 0;
      75           1 :             if( pProperties && nIdx >= 3 )
      76             :             {
      77           1 :                 const XMLPropertyState& rTrans = (*pProperties)[nIdx-3];
      78             :                 // #99657# transparency may be there, but doesn't have to be.
      79             :                 // If it's there, it must be in the right position.
      80           2 :                 if( CTF_BACKGROUND_TRANSPARENCY == getPropertySetMapper()
      81           2 :                       ->GetEntryContextId( rTrans.mnIndex ) )
      82           0 :                     pTrans = &rTrans.maValue;
      83             : 
      84           1 :                 const XMLPropertyState& rPos = (*pProperties)[nIdx-2];
      85             :                 DBG_ASSERT( CTF_BACKGROUND_POS == getPropertySetMapper()
      86             :                         ->GetEntryContextId( rPos.mnIndex ),
      87             :                          "invalid property map: pos expected" );
      88           2 :                 if( CTF_BACKGROUND_POS == getPropertySetMapper()
      89           2 :                         ->GetEntryContextId( rPos.mnIndex ) )
      90           1 :                     pPos = &rPos.maValue;
      91             : 
      92           1 :                 const XMLPropertyState& rFilter = (*pProperties)[nIdx-1];
      93             :                 DBG_ASSERT( CTF_BACKGROUND_FILTER == getPropertySetMapper()
      94             :                         ->GetEntryContextId( rFilter.mnIndex ),
      95             :                          "invalid property map: filter expected" );
      96           2 :                 if( CTF_BACKGROUND_FILTER == getPropertySetMapper()
      97           2 :                         ->GetEntryContextId( rFilter.mnIndex ) )
      98           1 :                     pFilter = &rFilter.maValue;
      99             :             }
     100           1 :             sal_uInt32 nPropIndex = rProperty.mnIndex;
     101             :             pThis->maBackgroundImageExport.exportXML(
     102             :                     rProperty.maValue, pPos, pFilter, pTrans,
     103           1 :                     getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
     104           2 :                     getPropertySetMapper()->GetEntryXMLName( nPropIndex ) );
     105             :         }
     106           1 :         break;
     107             : 
     108             :     case CTF_SECTION_FOOTNOTE_END:
     109             :         XMLSectionFootnoteConfigExport::exportXML(rExp, sal_False,
     110             :                                                   pProperties, nIdx,
     111           0 :                                                   getPropertySetMapper());
     112           0 :         break;
     113             : 
     114             :     case CTF_SECTION_ENDNOTE_END:
     115             :         XMLSectionFootnoteConfigExport::exportXML(rExp, sal_True,
     116             :                                                   pProperties, nIdx,
     117           0 :                                                   getPropertySetMapper());
     118           0 :         break;
     119             : 
     120             :     default:
     121           0 :         SvXMLExportPropertyMapper::handleElementItem( rExp, rProperty, nFlags, pProperties, nIdx );
     122           0 :         break;
     123             :     }
     124          37 : }
     125             : 
     126           8 : void XMLTextExportPropertySetMapper::handleSpecialItem(
     127             :         SvXMLAttributeList& rAttrList,
     128             :         const XMLPropertyState& rProperty,
     129             :         const SvXMLUnitConverter& rUnitConverter,
     130             :         const SvXMLNamespaceMap& rNamespaceMap,
     131             :         const ::std::vector< XMLPropertyState > *pProperties,
     132             :         sal_uInt32 nIdx ) const
     133             : {
     134             :     XMLTextExportPropertySetMapper *pThis =
     135           8 :            ((XMLTextExportPropertySetMapper *)this);
     136             : 
     137           8 :     switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
     138             :     {
     139             :     case CTF_DROPCAPWHOLEWORD:
     140             :         DBG_ASSERT( !bDropWholeWord, "drop whole word is set already!" );
     141           0 :         pThis->bDropWholeWord = *(sal_Bool *)rProperty.maValue.getValue();
     142           0 :         break;
     143             :     case CTF_DROPCAPCHARSTYLE:
     144             :         DBG_ASSERT( sDropCharStyle.isEmpty(), "drop char style is set already!" );
     145           0 :         rProperty.maValue >>= pThis->sDropCharStyle;
     146           0 :         break;
     147             :     case CTF_NUMBERINGSTYLENAME:
     148             :     case CTF_PAGEDESCNAME:
     149             :     case CTF_OLDTEXTBACKGROUND:
     150             :     case CTF_BACKGROUND_POS:
     151             :     case CTF_BACKGROUND_FILTER:
     152             :     case CTF_BACKGROUND_TRANSPARENCY:
     153             :     case CTF_SECTION_FOOTNOTE_NUM_OWN:
     154             :     case CTF_SECTION_FOOTNOTE_NUM_RESTART:
     155             :     case CTF_SECTION_FOOTNOTE_NUM_RESTART_AT:
     156             :     case CTF_SECTION_FOOTNOTE_NUM_TYPE:
     157             :     case CTF_SECTION_FOOTNOTE_NUM_PREFIX:
     158             :     case CTF_SECTION_FOOTNOTE_NUM_SUFFIX:
     159             :     case CTF_SECTION_ENDNOTE_NUM_OWN:
     160             :     case CTF_SECTION_ENDNOTE_NUM_RESTART:
     161             :     case CTF_SECTION_ENDNOTE_NUM_RESTART_AT:
     162             :     case CTF_SECTION_ENDNOTE_NUM_TYPE:
     163             :     case CTF_SECTION_ENDNOTE_NUM_PREFIX:
     164             :     case CTF_SECTION_ENDNOTE_NUM_SUFFIX:
     165             :     case CTF_DEFAULT_OUTLINE_LEVEL:
     166             :     case CTF_OLD_FLOW_WITH_TEXT:
     167             :         // There's nothing to do here!
     168           8 :         break;
     169             :     default:
     170           0 :         SvXMLExportPropertyMapper::handleSpecialItem(rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx );
     171           0 :         break;
     172             :     }
     173           8 : }
     174             : 
     175         717 : XMLTextExportPropertySetMapper::XMLTextExportPropertySetMapper(
     176             :         const UniReference< XMLPropertySetMapper >& rMapper,
     177             :         SvXMLExport& rExp ) :
     178             :     SvXMLExportPropertyMapper( rMapper ),
     179             :     rExport( rExp ),
     180             :     bDropWholeWord( sal_False ),
     181             :     maDropCapExport( rExp ),
     182             :     maTabStopExport( rExp ),
     183             :     maTextColumnsExport( rExp ),
     184         717 :     maBackgroundImageExport( rExp )
     185             : {
     186         717 : }
     187             : 
     188        1424 : XMLTextExportPropertySetMapper::~XMLTextExportPropertySetMapper()
     189             : {
     190        1424 : }
     191             : 
     192         506 : void XMLTextExportPropertySetMapper::ContextFontFilter(
     193             :     XMLPropertyState *pFontNameState,
     194             :     XMLPropertyState *pFontFamilyNameState,
     195             :     XMLPropertyState *pFontStyleNameState,
     196             :     XMLPropertyState *pFontFamilyState,
     197             :     XMLPropertyState *pFontPitchState,
     198             :     XMLPropertyState *pFontCharsetState ) const
     199             : {
     200         506 :     OUString sFamilyName;
     201        1012 :     OUString sStyleName;
     202         506 :     FontFamily nFamily = FAMILY_DONTKNOW;
     203         506 :     FontPitch nPitch = PITCH_DONTKNOW;
     204         506 :     rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW;
     205             : 
     206        1012 :     OUString sTmp;
     207         506 :     if( pFontFamilyNameState && (pFontFamilyNameState->maValue >>= sTmp ) )
     208         418 :         sFamilyName = sTmp;
     209         506 :     if( pFontStyleNameState && (pFontStyleNameState->maValue >>= sTmp ) )
     210         418 :         sStyleName = sTmp;
     211             : 
     212         506 :     sal_Int16 nTmp = sal_Int16();
     213         506 :     if( pFontFamilyState && (pFontFamilyState->maValue >>= nTmp ) )
     214         418 :         nFamily = static_cast< FontFamily >( nTmp );
     215         506 :     if( pFontPitchState && (pFontPitchState->maValue >>= nTmp ) )
     216         418 :         nPitch = static_cast< FontPitch >( nTmp );
     217         506 :     if( pFontCharsetState && (pFontCharsetState->maValue >>= nTmp ) )
     218         418 :         eEnc = (rtl_TextEncoding)nTmp;
     219             : 
     220         506 :     OUString sName( ((SvXMLExport&)GetExport()).GetFontAutoStylePool()->Find(
     221        1518 :                         sFamilyName, sStyleName, nFamily, nPitch, eEnc ) );
     222         506 :     if( !sName.isEmpty() )
     223             :     {
     224         416 :         pFontNameState->maValue <<= sName;
     225         416 :         if( pFontFamilyNameState )
     226         416 :             pFontFamilyNameState->mnIndex = -1;
     227         416 :         if( pFontStyleNameState )
     228         416 :             pFontStyleNameState->mnIndex = -1;
     229         416 :         if( pFontFamilyState )
     230         416 :             pFontFamilyState->mnIndex = -1;
     231         416 :         if( pFontPitchState )
     232         416 :             pFontPitchState->mnIndex = -1;
     233         416 :         if( pFontCharsetState )
     234         416 :             pFontCharsetState->mnIndex = -1;
     235             :     }
     236             :     else
     237             :     {
     238          90 :         pFontNameState->mnIndex = -1;
     239             :     }
     240             : 
     241         506 :     if( pFontFamilyNameState && sFamilyName.isEmpty() )
     242             :     {
     243           0 :         pFontFamilyNameState->mnIndex = -1;
     244             :     }
     245             : 
     246         506 :     if( pFontStyleNameState && sStyleName.isEmpty() )
     247             :     {
     248         418 :         pFontStyleNameState->mnIndex = -1;
     249         506 :     }
     250         506 : }
     251             : 
     252         275 : void XMLTextExportPropertySetMapper::ContextFontHeightFilter(
     253             :     XMLPropertyState* pCharHeightState,
     254             :     XMLPropertyState* pCharPropHeightState,
     255             :     XMLPropertyState* pCharDiffHeightState ) const
     256             : {
     257         275 :     if( pCharPropHeightState )
     258             :     {
     259         275 :         sal_Int32 nTemp = 0;
     260         275 :         pCharPropHeightState->maValue >>= nTemp;
     261         275 :         if( nTemp == 100 )
     262             :         {
     263         275 :             pCharPropHeightState->mnIndex = -1;
     264         275 :             pCharPropHeightState->maValue.clear();
     265             :         }
     266             :         else
     267             :         {
     268           0 :             pCharHeightState->mnIndex = -1;
     269           0 :             pCharHeightState->maValue.clear();
     270             :         }
     271             :     }
     272         275 :     if( pCharDiffHeightState )
     273             :     {
     274         275 :         float nTemp = 0;
     275         275 :         pCharDiffHeightState->maValue >>= nTemp;
     276         275 :         if( nTemp == 0. )
     277             :         {
     278         275 :             pCharDiffHeightState->mnIndex = -1;
     279         275 :             pCharDiffHeightState->maValue.clear();
     280             :         }
     281             :         else
     282             :         {
     283           0 :             pCharHeightState->mnIndex = -1;
     284           0 :             pCharHeightState->maValue.clear();
     285             :         }
     286             :     }
     287             : 
     288         275 : }
     289             : 
     290             : // helper method; implementation below
     291             : static bool lcl_IsOutlineStyle(const SvXMLExport&, const OUString&);
     292             : 
     293             : static void
     294        4365 : lcl_checkMultiProperty(XMLPropertyState *const pState,
     295             :                        XMLPropertyState *const pRelState)
     296             : {
     297        4365 :     if (pState && pRelState)
     298             :     {
     299         143 :         sal_Int32 nTemp = 0;
     300         143 :         pRelState->maValue >>= nTemp;
     301         143 :         if (100 == nTemp)
     302             :         {
     303         143 :             pRelState->mnIndex = -1;
     304         143 :             pRelState->maValue.clear();
     305             :         }
     306             :         else
     307             :         {
     308           0 :             pState->mnIndex = -1;
     309           0 :             pState->maValue.clear();
     310             :         }
     311             :     }
     312        4365 : }
     313             : 
     314         873 : void XMLTextExportPropertySetMapper::ContextFilter(
     315             :     ::std::vector< XMLPropertyState >& rProperties,
     316             :     Reference< XPropertySet > rPropSet ) const
     317             : {
     318             :     // filter font
     319         873 :     XMLPropertyState *pFontNameState = 0;
     320         873 :     XMLPropertyState *pFontFamilyNameState = 0;
     321         873 :     XMLPropertyState *pFontStyleNameState = 0;
     322         873 :     XMLPropertyState *pFontFamilyState = 0;
     323         873 :     XMLPropertyState *pFontPitchState = 0;
     324         873 :     XMLPropertyState *pFontCharsetState = 0;
     325         873 :     XMLPropertyState *pFontNameCJKState = 0;
     326         873 :     XMLPropertyState *pFontFamilyNameCJKState = 0;
     327         873 :     XMLPropertyState *pFontStyleNameCJKState = 0;
     328         873 :     XMLPropertyState *pFontFamilyCJKState = 0;
     329         873 :     XMLPropertyState *pFontPitchCJKState = 0;
     330         873 :     XMLPropertyState *pFontCharsetCJKState = 0;
     331         873 :     XMLPropertyState *pFontNameCTLState = 0;
     332         873 :     XMLPropertyState *pFontFamilyNameCTLState = 0;
     333         873 :     XMLPropertyState *pFontStyleNameCTLState = 0;
     334         873 :     XMLPropertyState *pFontFamilyCTLState = 0;
     335         873 :     XMLPropertyState *pFontPitchCTLState = 0;
     336         873 :     XMLPropertyState *pFontCharsetCTLState = 0;
     337             : 
     338             :     // filter char height point/percent
     339         873 :     XMLPropertyState* pCharHeightState = NULL;
     340         873 :     XMLPropertyState* pCharPropHeightState = NULL;
     341         873 :     XMLPropertyState* pCharDiffHeightState = NULL;
     342         873 :     XMLPropertyState* pCharHeightCJKState = NULL;
     343         873 :     XMLPropertyState* pCharPropHeightCJKState = NULL;
     344         873 :     XMLPropertyState* pCharDiffHeightCJKState = NULL;
     345         873 :     XMLPropertyState* pCharHeightCTLState = NULL;
     346         873 :     XMLPropertyState* pCharPropHeightCTLState = NULL;
     347         873 :     XMLPropertyState* pCharDiffHeightCTLState = NULL;
     348             : 
     349             :     // filter left margin measure/percent
     350         873 :     XMLPropertyState* pParaLeftMarginState = NULL;
     351         873 :     XMLPropertyState* pParaLeftMarginRelState = NULL;
     352             : 
     353             :     // filter right margin measure/percent
     354         873 :     XMLPropertyState* pParaRightMarginState = NULL;
     355         873 :     XMLPropertyState* pParaRightMarginRelState = NULL;
     356             : 
     357             :     // filter first line indent measure/percent
     358         873 :     XMLPropertyState* pParaFirstLineState = NULL;
     359         873 :     XMLPropertyState* pParaFirstLineRelState = NULL;
     360             : 
     361             :     // filter ParaTopMargin/Relative
     362         873 :     XMLPropertyState* pParaTopMarginState = NULL;
     363         873 :     XMLPropertyState* pParaTopMarginRelState = NULL;
     364             : 
     365             :     // filter ParaTopMargin/Relative
     366         873 :     XMLPropertyState* pParaBottomMarginState = NULL;
     367         873 :     XMLPropertyState* pParaBottomMarginRelState = NULL;
     368             : 
     369             :     // filter (Left|Right|Top|Bottom|)BorderWidth
     370         873 :     XMLPropertyState* pAllBorderWidthState = NULL;
     371         873 :     XMLPropertyState* pLeftBorderWidthState = NULL;
     372         873 :     XMLPropertyState* pRightBorderWidthState = NULL;
     373         873 :     XMLPropertyState* pTopBorderWidthState = NULL;
     374         873 :     XMLPropertyState* pBottomBorderWidthState = NULL;
     375             : 
     376             :     // filter (Left|Right|Top|)BorderDistance
     377         873 :     XMLPropertyState* pAllBorderDistanceState = NULL;
     378         873 :     XMLPropertyState* pLeftBorderDistanceState = NULL;
     379         873 :     XMLPropertyState* pRightBorderDistanceState = NULL;
     380         873 :     XMLPropertyState* pTopBorderDistanceState = NULL;
     381         873 :     XMLPropertyState* pBottomBorderDistanceState = NULL;
     382             : 
     383             :     // filter (Left|Right|Top|Bottom|)Border
     384         873 :     XMLPropertyState* pAllBorderState = NULL;
     385         873 :     XMLPropertyState* pLeftBorderState = NULL;
     386         873 :     XMLPropertyState* pRightBorderState = NULL;
     387         873 :     XMLPropertyState* pTopBorderState = NULL;
     388         873 :     XMLPropertyState* pBottomBorderState = NULL;
     389             : 
     390             :     // filter height properties
     391         873 :     XMLPropertyState* pHeightMinAbsState = NULL;
     392         873 :     XMLPropertyState* pHeightMinRelState = NULL;
     393         873 :     XMLPropertyState* pHeightAbsState = NULL;
     394         873 :     XMLPropertyState* pHeightRelState = NULL;
     395         873 :     XMLPropertyState* pSizeTypeState = NULL;
     396             : 
     397             :     // filter width properties
     398         873 :     XMLPropertyState* pWidthMinAbsState = NULL;
     399         873 :     XMLPropertyState* pWidthMinRelState = NULL;
     400         873 :     XMLPropertyState* pWidthAbsState = NULL;
     401         873 :     XMLPropertyState* pWidthRelState = NULL;
     402         873 :     XMLPropertyState* pWidthTypeState = NULL;
     403             : 
     404             :     // wrap
     405         873 :     XMLPropertyState* pWrapState = NULL;
     406         873 :     XMLPropertyState* pWrapContourState = NULL;
     407         873 :     XMLPropertyState* pWrapContourModeState = NULL;
     408         873 :     XMLPropertyState* pWrapParagraphOnlyState = NULL;
     409             : 
     410             :     // anchor
     411         873 :     XMLPropertyState* pAnchorTypeState = NULL;
     412             : 
     413             :     // horizontal position and relation
     414         873 :     XMLPropertyState* pHoriOrientState = NULL;
     415         873 :     XMLPropertyState* pHoriOrientMirroredState = NULL;
     416         873 :     XMLPropertyState* pHoriOrientRelState = NULL;
     417         873 :     XMLPropertyState* pHoriOrientRelFrameState = NULL;
     418         873 :     XMLPropertyState* pHoriOrientMirrorState = NULL;
     419             :     // Horizontal position and relation for shapes (#i28749#)
     420         873 :     XMLPropertyState* pShapeHoriOrientState = NULL;
     421         873 :     XMLPropertyState* pShapeHoriOrientMirroredState = NULL;
     422         873 :     XMLPropertyState* pShapeHoriOrientRelState = NULL;
     423         873 :     XMLPropertyState* pShapeHoriOrientRelFrameState = NULL;
     424         873 :     XMLPropertyState* pShapeHoriOrientMirrorState = NULL;
     425             : 
     426             :     // vertical position and relation
     427         873 :     XMLPropertyState* pVertOrientState = NULL;
     428         873 :     XMLPropertyState* pVertOrientAtCharState = NULL;
     429         873 :     XMLPropertyState* pVertOrientRelState = NULL;
     430         873 :     XMLPropertyState* pVertOrientRelPageState = NULL;
     431         873 :     XMLPropertyState* pVertOrientRelFrameState = NULL;
     432         873 :     XMLPropertyState* pVertOrientRelAsCharState = NULL;
     433             : 
     434             :     // Vertical position and relation for shapes (#i28749#)
     435         873 :     XMLPropertyState* pShapeVertOrientState = NULL;
     436         873 :     XMLPropertyState* pShapeVertOrientAtCharState = NULL;
     437         873 :     XMLPropertyState* pShapeVertOrientRelState = NULL;
     438         873 :     XMLPropertyState* pShapeVertOrientRelPageState = NULL;
     439         873 :     XMLPropertyState* pShapeVertOrientRelFrameState = NULL;
     440             : 
     441             :     // filter underline color
     442         873 :     XMLPropertyState* pUnderlineState = NULL;
     443         873 :     XMLPropertyState* pUnderlineColorState = NULL;
     444         873 :     XMLPropertyState* pUnderlineHasColorState = NULL;
     445             : 
     446             :     // filter list style name
     447         873 :     XMLPropertyState* pListStyleName = NULL;
     448             : 
     449             :     // filter fo:clip
     450         873 :     XMLPropertyState* pClip11State = NULL;
     451         873 :     XMLPropertyState* pClipState = NULL;
     452             : 
     453             :     // filter fo:margin
     454         873 :     XMLPropertyState* pAllParaMarginRel = NULL;
     455         873 :     XMLPropertyState* pAllParaMargin = NULL;
     456         873 :     XMLPropertyState* pAllMargin = NULL;
     457             : 
     458         873 :     sal_Bool bNeedsAnchor = sal_False;
     459             : 
     460       33708 :     for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin();
     461       22472 :          aIter != rProperties.end();
     462             :          ++aIter )
     463             :     {
     464       10363 :         XMLPropertyState *propertie = &(*aIter);
     465       10363 :         if( propertie->mnIndex == -1 )
     466         646 :             continue;
     467             : 
     468        9717 :         switch( getPropertySetMapper()->GetEntryContextId( propertie->mnIndex ) )
     469             :         {
     470         436 :         case CTF_CHARHEIGHT:            pCharHeightState = propertie; break;
     471          83 :         case CTF_CHARHEIGHT_REL:        pCharPropHeightState = propertie; break;
     472          83 :         case CTF_CHARHEIGHT_DIFF:       pCharDiffHeightState = propertie; break;
     473         356 :         case CTF_CHARHEIGHT_CJK:        pCharHeightCJKState = propertie; break;
     474         107 :         case CTF_CHARHEIGHT_REL_CJK:    pCharPropHeightCJKState = propertie; break;
     475         107 :         case CTF_CHARHEIGHT_DIFF_CJK:   pCharDiffHeightCJKState = propertie; break;
     476         334 :         case CTF_CHARHEIGHT_CTL:        pCharHeightCTLState = propertie; break;
     477          85 :         case CTF_CHARHEIGHT_REL_CTL:    pCharPropHeightCTLState = propertie; break;
     478          85 :         case CTF_CHARHEIGHT_DIFF_CTL:   pCharDiffHeightCTLState = propertie; break;
     479          51 :         case CTF_PARALEFTMARGIN:        pParaLeftMarginState = propertie; break;
     480           9 :         case CTF_PARALEFTMARGIN_REL:    pParaLeftMarginRelState = propertie; break;
     481          51 :         case CTF_PARARIGHTMARGIN:       pParaRightMarginState = propertie; break;
     482           9 :         case CTF_PARARIGHTMARGIN_REL:   pParaRightMarginRelState = propertie; break;
     483          51 :         case CTF_PARAFIRSTLINE:         pParaFirstLineState = propertie; break;
     484           9 :         case CTF_PARAFIRSTLINE_REL:     pParaFirstLineRelState = propertie; break;
     485         141 :         case CTF_PARATOPMARGIN:         pParaTopMarginState = propertie; break;
     486          58 :         case CTF_PARATOPMARGIN_REL:     pParaTopMarginRelState = propertie; break;
     487         141 :         case CTF_PARABOTTOMMARGIN:      pParaBottomMarginState = propertie; break;
     488          58 :         case CTF_PARABOTTOMMARGIN_REL:  pParaBottomMarginRelState = propertie; break;
     489           7 :         case CTF_ALLBORDERWIDTH:        pAllBorderWidthState = propertie; break;
     490           7 :         case CTF_LEFTBORDERWIDTH:       pLeftBorderWidthState = propertie; break;
     491           7 :         case CTF_RIGHTBORDERWIDTH:      pRightBorderWidthState = propertie; break;
     492           7 :         case CTF_TOPBORDERWIDTH:        pTopBorderWidthState = propertie; break;
     493           7 :         case CTF_BOTTOMBORDERWIDTH:     pBottomBorderWidthState = propertie; break;
     494           7 :         case CTF_ALLBORDERDISTANCE:     pAllBorderDistanceState = propertie; break;
     495           7 :         case CTF_LEFTBORDERDISTANCE:    pLeftBorderDistanceState = propertie; break;
     496           7 :         case CTF_RIGHTBORDERDISTANCE:   pRightBorderDistanceState = propertie; break;
     497           7 :         case CTF_TOPBORDERDISTANCE:     pTopBorderDistanceState = propertie; break;
     498           7 :         case CTF_BOTTOMBORDERDISTANCE:  pBottomBorderDistanceState = propertie; break;
     499           7 :         case CTF_ALLBORDER:             pAllBorderState = propertie; break;
     500           7 :         case CTF_LEFTBORDER:            pLeftBorderState = propertie; break;
     501           7 :         case CTF_RIGHTBORDER:           pRightBorderState = propertie; break;
     502           7 :         case CTF_TOPBORDER:             pTopBorderState = propertie; break;
     503           7 :         case CTF_BOTTOMBORDER:          pBottomBorderState = propertie; break;
     504             : 
     505           0 :         case CTF_FRAMEHEIGHT_MIN_ABS:   pHeightMinAbsState = propertie; break;
     506           0 :         case CTF_FRAMEHEIGHT_MIN_REL:   pHeightMinRelState = propertie; break;
     507           0 :         case CTF_FRAMEHEIGHT_ABS:       pHeightAbsState = propertie; break;
     508           0 :         case CTF_FRAMEHEIGHT_REL:       pHeightRelState = propertie; break;
     509           0 :         case CTF_SIZETYPE:              pSizeTypeState = propertie; break;
     510             : 
     511           0 :         case CTF_FRAMEWIDTH_MIN_ABS:    pWidthMinAbsState = propertie; break;
     512           0 :         case CTF_FRAMEWIDTH_MIN_REL:    pWidthMinRelState = propertie; break;
     513           0 :         case CTF_FRAMEWIDTH_ABS:        pWidthAbsState = propertie; break;
     514           0 :         case CTF_FRAMEWIDTH_REL:        pWidthRelState = propertie; break;
     515           0 :         case CTF_FRAMEWIDTH_TYPE:       pWidthTypeState = propertie; break;
     516             : 
     517           9 :         case CTF_WRAP:                  pWrapState = propertie; break;
     518           5 :         case CTF_WRAP_CONTOUR:          pWrapContourState = propertie; break;
     519           5 :         case CTF_WRAP_CONTOUR_MODE:     pWrapContourModeState = propertie; break;
     520           9 :         case CTF_WRAP_PARAGRAPH_ONLY:   pWrapParagraphOnlyState = propertie; break;
     521           7 :         case CTF_ANCHORTYPE:            pAnchorTypeState = propertie; break;
     522             : 
     523          11 :         case CTF_HORIZONTALPOS:             pHoriOrientState = propertie; bNeedsAnchor = sal_True; break;
     524          11 :         case CTF_HORIZONTALPOS_MIRRORED:    pHoriOrientMirroredState = propertie; bNeedsAnchor = sal_True; break;
     525          11 :         case CTF_HORIZONTALREL:             pHoriOrientRelState = propertie; bNeedsAnchor = sal_True; break;
     526          11 :         case CTF_HORIZONTALREL_FRAME:       pHoriOrientRelFrameState = propertie; bNeedsAnchor = sal_True; break;
     527          11 :         case CTF_HORIZONTALMIRROR:          pHoriOrientMirrorState = propertie; bNeedsAnchor = sal_True; break;
     528          27 :         case CTF_VERTICALPOS:           pVertOrientState = propertie; bNeedsAnchor = sal_True; break;
     529          27 :         case CTF_VERTICALPOS_ATCHAR:    pVertOrientAtCharState = propertie; bNeedsAnchor = sal_True; break;
     530          27 :         case CTF_VERTICALREL:           pVertOrientRelState = propertie; bNeedsAnchor = sal_True; break;
     531          27 :         case CTF_VERTICALREL_PAGE:      pVertOrientRelPageState = propertie; bNeedsAnchor = sal_True; break;
     532          27 :         case CTF_VERTICALREL_FRAME:     pVertOrientRelFrameState = propertie; bNeedsAnchor = sal_True; break;
     533          27 :         case CTF_VERTICALREL_ASCHAR:    pVertOrientRelAsCharState = propertie; bNeedsAnchor = sal_True; break;
     534             : 
     535             :         // Handle new CTFs for shape positioning properties (#i28749#)
     536           0 :         case CTF_SHAPE_HORIZONTALPOS:             pShapeHoriOrientState = propertie; bNeedsAnchor = sal_True; break;
     537           0 :         case CTF_SHAPE_HORIZONTALPOS_MIRRORED:    pShapeHoriOrientMirroredState = propertie; bNeedsAnchor = sal_True; break;
     538           0 :         case CTF_SHAPE_HORIZONTALREL:             pShapeHoriOrientRelState = propertie; bNeedsAnchor = sal_True; break;
     539           0 :         case CTF_SHAPE_HORIZONTALREL_FRAME:       pShapeHoriOrientRelFrameState = propertie; bNeedsAnchor = sal_True; break;
     540           0 :         case CTF_SHAPE_HORIZONTALMIRROR:          pShapeHoriOrientMirrorState = propertie; bNeedsAnchor = sal_True; break;
     541           0 :         case CTF_SHAPE_VERTICALPOS:           pShapeVertOrientState = propertie; bNeedsAnchor = sal_True; break;
     542           0 :         case CTF_SHAPE_VERTICALPOS_ATCHAR:    pShapeVertOrientAtCharState = propertie; bNeedsAnchor = sal_True; break;
     543           0 :         case CTF_SHAPE_VERTICALREL:           pShapeVertOrientRelState = propertie; bNeedsAnchor = sal_True; break;
     544           0 :         case CTF_SHAPE_VERTICALREL_PAGE:      pShapeVertOrientRelPageState = propertie; bNeedsAnchor = sal_True; break;
     545           0 :         case CTF_SHAPE_VERTICALREL_FRAME:     pShapeVertOrientRelFrameState = propertie; bNeedsAnchor = sal_True; break;
     546         156 :         case CTF_FONTNAME:              pFontNameState = propertie; break;
     547         130 :         case CTF_FONTFAMILYNAME:        pFontFamilyNameState = propertie; break;
     548         128 :         case CTF_FONTSTYLENAME:         pFontStyleNameState = propertie; break;
     549         130 :         case CTF_FONTFAMILY:            pFontFamilyState = propertie; break;
     550         130 :         case CTF_FONTPITCH:             pFontPitchState = propertie; break;
     551         130 :         case CTF_FONTCHARSET:           pFontCharsetState = propertie; break;
     552             : 
     553         152 :         case CTF_FONTNAME_CJK:          pFontNameCJKState = propertie; break;
     554         122 :         case CTF_FONTFAMILYNAME_CJK:    pFontFamilyNameCJKState = propertie; break;
     555         122 :         case CTF_FONTSTYLENAME_CJK:     pFontStyleNameCJKState = propertie; break;
     556         122 :         case CTF_FONTFAMILY_CJK:        pFontFamilyCJKState = propertie; break;
     557         122 :         case CTF_FONTPITCH_CJK:         pFontPitchCJKState = propertie; break;
     558         122 :         case CTF_FONTCHARSET_CJK:       pFontCharsetCJKState = propertie; break;
     559             : 
     560         198 :         case CTF_FONTNAME_CTL:          pFontNameCTLState = propertie; break;
     561         168 :         case CTF_FONTFAMILYNAME_CTL:    pFontFamilyNameCTLState = propertie; break;
     562         168 :         case CTF_FONTSTYLENAME_CTL:     pFontStyleNameCTLState = propertie; break;
     563         168 :         case CTF_FONTFAMILY_CTL:        pFontFamilyCTLState = propertie; break;
     564         168 :         case CTF_FONTPITCH_CTL:         pFontPitchCTLState = propertie; break;
     565         168 :         case CTF_FONTCHARSET_CTL:       pFontCharsetCTLState = propertie; break;
     566          30 :         case CTF_UNDERLINE:             pUnderlineState = propertie; break;
     567          24 :         case CTF_UNDERLINE_COLOR:       pUnderlineColorState = propertie; break;
     568          24 :         case CTF_UNDERLINE_HASCOLOR:    pUnderlineHasColorState = propertie; break;
     569           0 :         case CTF_NUMBERINGSTYLENAME:    pListStyleName = propertie; break;
     570           0 :         case CTF_TEXT_CLIP11:           pClip11State = propertie; break;
     571           0 :         case CTF_TEXT_CLIP:             pClipState = propertie; break;
     572           9 :         case CTF_PARAMARGINALL_REL:     pAllParaMarginRel = propertie; break;
     573          33 :         case CTF_PARAMARGINALL:         pAllParaMargin = propertie; break;
     574           5 :         case CTF_MARGINALL:             pAllMargin = propertie; break;
     575             :         }
     576             :     }
     577             : 
     578         873 :     if( pFontNameState )
     579             :         ContextFontFilter( pFontNameState, pFontFamilyNameState,
     580             :                            pFontStyleNameState, pFontFamilyState,
     581         156 :                            pFontPitchState, pFontCharsetState );
     582         873 :     if( pFontNameCJKState )
     583             :         ContextFontFilter( pFontNameCJKState, pFontFamilyNameCJKState,
     584             :                            pFontStyleNameCJKState, pFontFamilyCJKState,
     585         152 :                            pFontPitchCJKState, pFontCharsetCJKState );
     586         873 :     if( pFontNameCTLState )
     587             :         ContextFontFilter( pFontNameCTLState, pFontFamilyNameCTLState,
     588             :                            pFontStyleNameCTLState, pFontFamilyCTLState,
     589         198 :                            pFontPitchCTLState, pFontCharsetCTLState );
     590             : 
     591         873 :     if( pCharHeightState && (pCharPropHeightState || pCharDiffHeightState ) )
     592             :         ContextFontHeightFilter( pCharHeightState, pCharPropHeightState,
     593          83 :                                  pCharDiffHeightState  );
     594         873 :     if( pCharHeightCJKState &&
     595         249 :         (pCharPropHeightCJKState || pCharDiffHeightCJKState ) )
     596             :         ContextFontHeightFilter( pCharHeightCJKState, pCharPropHeightCJKState,
     597         107 :                                  pCharDiffHeightCJKState  );
     598         873 :     if( pCharHeightCTLState &&
     599         249 :         (pCharPropHeightCTLState || pCharDiffHeightCTLState ) )
     600             :         ContextFontHeightFilter( pCharHeightCTLState, pCharPropHeightCTLState,
     601          85 :                                  pCharDiffHeightCTLState  );
     602         873 :     if( pUnderlineColorState || pUnderlineHasColorState )
     603             :     {
     604          24 :         sal_Bool bClear = !pUnderlineState;
     605          24 :         if( !bClear )
     606             :         {
     607          24 :             sal_Int16 nUnderline = 0;
     608          24 :             pUnderlineState->maValue >>= nUnderline;
     609          24 :             bClear = awt::FontUnderline::NONE == nUnderline;
     610             :         }
     611          24 :         if( bClear )
     612             :         {
     613          16 :             if( pUnderlineColorState )
     614          16 :                 pUnderlineColorState->mnIndex = -1;
     615          16 :             if( pUnderlineHasColorState )
     616          16 :                 pUnderlineHasColorState->mnIndex = -1;
     617             :         }
     618             :     }
     619             : 
     620         873 :     lcl_checkMultiProperty(pParaLeftMarginState, pParaLeftMarginRelState);
     621         873 :     lcl_checkMultiProperty(pParaRightMarginState, pParaRightMarginRelState);
     622         873 :     lcl_checkMultiProperty(pParaTopMarginState, pParaTopMarginRelState);
     623         873 :     lcl_checkMultiProperty(pParaBottomMarginState, pParaBottomMarginRelState);
     624         873 :     lcl_checkMultiProperty(pParaFirstLineState, pParaFirstLineRelState);
     625             : 
     626         873 :     if (pAllParaMarginRel)
     627             :     {   // because older OOo/LO versions can't read fo:margin:
     628           9 :         pAllParaMarginRel->mnIndex = -1; // just export individual attributes...
     629           9 :         pAllParaMarginRel->maValue.clear();
     630             :     }
     631         873 :     if (pAllParaMargin)
     632             :     {
     633          33 :         pAllParaMargin->mnIndex = -1; // just export individual attributes...
     634          33 :         pAllParaMargin->maValue.clear();
     635             :     }
     636         873 :     if (pAllMargin)
     637             :     {
     638           5 :         pAllMargin->mnIndex = -1; // just export individual attributes...
     639           5 :         pAllMargin->maValue.clear();
     640             :     }
     641             : 
     642         873 :     if( pAllBorderWidthState )
     643             :     {
     644           7 :         if( pLeftBorderWidthState && pRightBorderWidthState && pTopBorderWidthState && pBottomBorderWidthState )
     645             :         {
     646           7 :             table::BorderLine2 aLeft, aRight, aTop, aBottom;
     647             : 
     648           7 :             pLeftBorderWidthState->maValue >>= aLeft;
     649           7 :             pRightBorderWidthState->maValue >>= aRight;
     650           7 :             pTopBorderWidthState->maValue >>= aTop;
     651           7 :             pBottomBorderWidthState->maValue >>= aBottom;
     652          14 :             if( aLeft.Color == aRight.Color && aLeft.InnerLineWidth == aRight.InnerLineWidth &&
     653          21 :                 aLeft.OuterLineWidth == aRight.OuterLineWidth && aLeft.LineDistance == aRight.LineDistance &&
     654          14 :                 aLeft.LineStyle == aRight.LineStyle &&
     655          14 :                 aLeft.LineWidth == aRight.LineWidth &&
     656          21 :                 aLeft.Color == aTop.Color && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
     657          21 :                 aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
     658          14 :                 aLeft.LineStyle == aTop.LineStyle &&
     659          14 :                 aLeft.LineWidth == aTop.LineWidth &&
     660          21 :                 aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
     661          21 :                 aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance &&
     662          14 :                 aLeft.LineStyle == aBottom.LineStyle &&
     663           7 :                 aLeft.LineWidth == aBottom.LineWidth )
     664             :             {
     665           7 :                 pLeftBorderWidthState->mnIndex = -1;
     666           7 :                 pLeftBorderWidthState->maValue.clear();
     667           7 :                 pRightBorderWidthState->mnIndex = -1;
     668           7 :                 pRightBorderWidthState->maValue.clear();
     669           7 :                 pTopBorderWidthState->mnIndex = -1;
     670           7 :                 pTopBorderWidthState->maValue.clear();
     671           7 :                 pBottomBorderWidthState->mnIndex = -1;
     672           7 :                 pBottomBorderWidthState->maValue.clear();
     673             :             }
     674             :             else
     675             :             {
     676           0 :                 pAllBorderWidthState->mnIndex = -1;
     677           0 :                 pAllBorderWidthState->maValue.clear();
     678           7 :             }
     679             :         }
     680             :         else
     681             :         {
     682           0 :             pAllBorderWidthState->mnIndex = -1;
     683           0 :             pAllBorderWidthState->maValue.clear();
     684             :         }
     685             :     }
     686             : 
     687         873 :     if( pAllBorderDistanceState )
     688             :     {
     689           7 :         if( pLeftBorderDistanceState && pRightBorderDistanceState && pTopBorderDistanceState && pBottomBorderDistanceState )
     690             :         {
     691           7 :             sal_Int32 aLeft = 0, aRight = 0, aTop = 0, aBottom = 0;
     692             : 
     693           7 :             pLeftBorderDistanceState->maValue >>= aLeft;
     694           7 :             pRightBorderDistanceState->maValue >>= aRight;
     695           7 :             pTopBorderDistanceState->maValue >>= aTop;
     696           7 :             pBottomBorderDistanceState->maValue >>= aBottom;
     697           7 :             if( aLeft == aRight && aLeft == aTop && aLeft == aBottom )
     698             :             {
     699           3 :                 pLeftBorderDistanceState->mnIndex = -1;
     700           3 :                 pLeftBorderDistanceState->maValue.clear();
     701           3 :                 pRightBorderDistanceState->mnIndex = -1;
     702           3 :                 pRightBorderDistanceState->maValue.clear();
     703           3 :                 pTopBorderDistanceState->mnIndex = -1;
     704           3 :                 pTopBorderDistanceState->maValue.clear();
     705           3 :                 pBottomBorderDistanceState->mnIndex = -1;
     706           3 :                 pBottomBorderDistanceState->maValue.clear();
     707             :             }
     708             :             else
     709             :             {
     710           4 :                 pAllBorderDistanceState->mnIndex = -1;
     711           4 :                 pAllBorderDistanceState->maValue.clear();
     712           7 :             }
     713             :         }
     714             :         else
     715             :         {
     716           0 :             pAllBorderDistanceState->mnIndex = -1;
     717           0 :             pAllBorderDistanceState->maValue.clear();
     718             :         }
     719             :     }
     720             : 
     721         873 :     if( pAllBorderState )
     722             :     {
     723           7 :         if( pLeftBorderState && pRightBorderState && pTopBorderState && pBottomBorderState )
     724             :         {
     725           7 :             table::BorderLine2 aLeft, aRight, aTop, aBottom;
     726             : 
     727           7 :             pLeftBorderState->maValue >>= aLeft;
     728           7 :             pRightBorderState->maValue >>= aRight;
     729           7 :             pTopBorderState->maValue >>= aTop;
     730           7 :             pBottomBorderState->maValue >>= aBottom;
     731          14 :             if( aLeft.Color == aRight.Color && aLeft.InnerLineWidth == aRight.InnerLineWidth &&
     732          21 :                 aLeft.OuterLineWidth == aRight.OuterLineWidth && aLeft.LineDistance == aRight.LineDistance &&
     733          14 :                 aLeft.LineStyle == aRight.LineStyle &&
     734          14 :                 aLeft.LineWidth == aRight.LineWidth &&
     735          21 :                 aLeft.Color == aTop.Color && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
     736          21 :                 aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
     737          14 :                 aLeft.LineStyle == aTop.LineStyle  &&
     738          14 :                 aLeft.LineWidth == aTop.LineWidth  &&
     739          21 :                 aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
     740          21 :                 aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance &&
     741          14 :                 aLeft.LineWidth == aBottom.LineWidth &&
     742           7 :                 aLeft.LineStyle == aBottom.LineStyle )
     743             :             {
     744           7 :                 pLeftBorderState->mnIndex = -1;
     745           7 :                 pLeftBorderState->maValue.clear();
     746           7 :                 pRightBorderState->mnIndex = -1;
     747           7 :                 pRightBorderState->maValue.clear();
     748           7 :                 pTopBorderState->mnIndex = -1;
     749           7 :                 pTopBorderState->maValue.clear();
     750           7 :                 pBottomBorderState->mnIndex = -1;
     751           7 :                 pBottomBorderState->maValue.clear();
     752             :             }
     753             :             else
     754             :             {
     755           0 :                 pAllBorderState->mnIndex = -1;
     756           0 :                 pAllBorderState->maValue.clear();
     757           7 :             }
     758             :         }
     759             :         else
     760             :         {
     761           0 :             pAllBorderState->mnIndex = -1;
     762           0 :             pAllBorderState->maValue.clear();
     763             :         }
     764             :     }
     765             : 
     766         873 :     sal_Int16 nSizeType = SizeType::FIX;
     767         873 :     if( pSizeTypeState )
     768             :     {
     769           0 :         pSizeTypeState->maValue >>= nSizeType;
     770           0 :         pSizeTypeState->mnIndex = -1;
     771             :     }
     772             : 
     773         873 :     if( pHeightMinAbsState )
     774             :     {
     775           0 :         sal_Int16 nRel = sal_Int16();
     776           0 :         if( (SizeType::FIX == nSizeType) ||
     777           0 :             ( pHeightMinRelState &&
     778           0 :               ( !(pHeightMinRelState->maValue >>= nRel) || nRel > 0 ) ) )
     779             :         {
     780           0 :             pHeightMinAbsState->mnIndex = -1;
     781             :         }
     782             : 
     783             :         // export SizeType::VARIABLE als min-width="0"
     784           0 :         if( SizeType::VARIABLE == nSizeType )
     785           0 :             pHeightMinAbsState->maValue <<= static_cast<sal_Int32>( 0 );
     786             :     }
     787         873 :     if( pHeightMinRelState  && SizeType::MIN != nSizeType)
     788           0 :         pHeightMinRelState->mnIndex = -1;
     789         873 :     if( pHeightAbsState && pHeightMinAbsState &&
     790           0 :         -1 != pHeightMinAbsState->mnIndex )
     791           0 :         pHeightAbsState->mnIndex = -1;
     792         873 :     if( pHeightRelState && SizeType::FIX != nSizeType)
     793           0 :         pHeightRelState->mnIndex = -1;
     794             : 
     795             :     // frame width
     796         873 :     nSizeType = SizeType::FIX;
     797         873 :     if( pWidthTypeState )
     798             :     {
     799           0 :         pWidthTypeState->maValue >>= nSizeType;
     800           0 :         pWidthTypeState->mnIndex = -1;
     801             :     }
     802         873 :     if( pWidthMinAbsState )
     803             :     {
     804           0 :         sal_Int16 nRel = sal_Int16();
     805           0 :         if( (SizeType::FIX == nSizeType) ||
     806           0 :             ( pWidthMinRelState &&
     807           0 :               ( !(pWidthMinRelState->maValue >>= nRel) || nRel > 0 ) ) )
     808             :         {
     809           0 :             pWidthMinAbsState->mnIndex = -1;
     810             :         }
     811             : 
     812             :         // export SizeType::VARIABLE als min-width="0"
     813           0 :         if( SizeType::VARIABLE == nSizeType )
     814           0 :             pWidthMinAbsState->maValue <<= static_cast<sal_Int32>( 0 );
     815             :     }
     816         873 :     if( pWidthMinRelState  && SizeType::MIN != nSizeType)
     817           0 :         pWidthMinRelState->mnIndex = -1;
     818         873 :     if( pWidthAbsState && pWidthMinAbsState &&
     819           0 :         -1 != pWidthMinAbsState->mnIndex )
     820           0 :         pWidthAbsState->mnIndex = -1;
     821         873 :     if( pWidthRelState && SizeType::FIX != nSizeType)
     822           0 :         pWidthRelState->mnIndex = -1;
     823             : 
     824         873 :     if( pWrapState )
     825             :     {
     826             :         WrapTextMode eVal;
     827           9 :         pWrapState->maValue >>= eVal;
     828           9 :         switch( eVal )
     829             :         {
     830             :         case WrapTextMode_NONE:
     831             :             // no wrapping: disable para-only and contour
     832           0 :             if( pWrapParagraphOnlyState )
     833           0 :                 pWrapParagraphOnlyState->mnIndex = -1;
     834             :             // no break
     835             :         case WrapTextMode_THROUGHT:
     836             :             // wrap through: disable only contour
     837           4 :             if( pWrapContourState )
     838           0 :                 pWrapContourState->mnIndex = -1;
     839           4 :             break;
     840             :         default:
     841           5 :             break;
     842             :         }
     843          14 :         if( pWrapContourModeState  &&
     844           5 :             (!pWrapContourState ||
     845           5 :              !*(sal_Bool *)pWrapContourState ->maValue.getValue() ) )
     846           5 :             pWrapContourModeState->mnIndex = -1;
     847             :     }
     848             : 
     849         873 :     TextContentAnchorType eAnchor = TextContentAnchorType_AT_PARAGRAPH;
     850         873 :     if( pAnchorTypeState )
     851           7 :         pAnchorTypeState->maValue >>= eAnchor;
     852         866 :     else if( bNeedsAnchor )
     853             :     {
     854          20 :         Any aAny = rPropSet->getPropertyValue("AnchorType");
     855          20 :         aAny >>= eAnchor;
     856             :     }
     857             : 
     858             :     // states for frame positioning attributes
     859             :     {
     860         873 :         if( pHoriOrientState && pHoriOrientMirroredState )
     861             :         {
     862          22 :             if( pHoriOrientMirrorState &&
     863          11 :                 *(sal_Bool *)pHoriOrientMirrorState->maValue.getValue() )
     864           0 :                 pHoriOrientState->mnIndex = -1;
     865             :             else
     866          11 :                 pHoriOrientMirroredState->mnIndex = -1;
     867             :         }
     868         873 :         if( pHoriOrientMirrorState )
     869          11 :             pHoriOrientMirrorState->mnIndex = -1;
     870             : 
     871         873 :         if( pHoriOrientRelState && TextContentAnchorType_AT_FRAME == eAnchor )
     872           0 :             pHoriOrientRelState->mnIndex = -1;
     873         873 :         if( pHoriOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
     874          11 :             pHoriOrientRelFrameState->mnIndex = -1;
     875             : 
     876         873 :         if( pVertOrientState && TextContentAnchorType_AT_CHARACTER == eAnchor )
     877           4 :             pVertOrientState->mnIndex = -1;
     878         873 :         if( pVertOrientAtCharState && TextContentAnchorType_AT_CHARACTER != eAnchor )
     879          23 :             pVertOrientAtCharState->mnIndex = -1;
     880         895 :         if( pVertOrientRelState && TextContentAnchorType_AT_PARAGRAPH != eAnchor &&
     881          22 :             TextContentAnchorType_AT_CHARACTER != eAnchor )
     882          18 :             pVertOrientRelState->mnIndex = -1;
     883         873 :         if( pVertOrientRelPageState && TextContentAnchorType_AT_PAGE != eAnchor )
     884          27 :             pVertOrientRelPageState->mnIndex = -1;
     885         873 :         if( pVertOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
     886          27 :             pVertOrientRelFrameState->mnIndex = -1;
     887         873 :         if( pVertOrientRelAsCharState && TextContentAnchorType_AS_CHARACTER != eAnchor )
     888           9 :             pVertOrientRelAsCharState->mnIndex = -1;
     889             :     }
     890             : 
     891             :     // States for shape positioning properties (#i28749#)
     892        1728 :     if ( eAnchor != TextContentAnchorType_AS_CHARACTER &&
     893         855 :          ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 )
     894             :     {
     895             :         // no export of shape positioning properties,
     896             :         // if shape isn't anchored as-character and
     897             :         // destination file format is OpenOffice.org file format
     898         245 :         if ( pShapeHoriOrientState )
     899           0 :             pShapeHoriOrientState->mnIndex = -1;
     900         245 :         if ( pShapeHoriOrientMirroredState )
     901           0 :             pShapeHoriOrientMirroredState->mnIndex = -1;
     902         245 :         if ( pShapeHoriOrientRelState )
     903           0 :             pShapeHoriOrientRelState->mnIndex = -1;
     904         245 :         if ( pShapeHoriOrientRelFrameState )
     905           0 :             pShapeHoriOrientRelFrameState->mnIndex = -1;
     906         245 :         if ( pShapeHoriOrientMirrorState )
     907           0 :             pShapeHoriOrientMirrorState->mnIndex = -1;
     908         245 :         if ( pShapeVertOrientState )
     909           0 :             pShapeVertOrientState->mnIndex = -1;
     910         245 :         if ( pShapeVertOrientAtCharState )
     911           0 :             pShapeVertOrientAtCharState->mnIndex = -1;
     912         245 :         if ( pShapeVertOrientRelState )
     913           0 :             pShapeVertOrientRelState->mnIndex = -1;
     914         245 :         if ( pShapeVertOrientRelPageState )
     915           0 :             pShapeVertOrientRelPageState->mnIndex = -1;
     916         245 :         if ( pShapeVertOrientRelFrameState )
     917           0 :             pShapeVertOrientRelFrameState->mnIndex = -1;
     918             :     }
     919             :     else
     920             :     {
     921             :         // handling of shape positioning property states as for frames - see above
     922         628 :         if( pShapeHoriOrientState && pShapeHoriOrientMirroredState )
     923             :         {
     924           0 :             if( pShapeHoriOrientMirrorState &&
     925           0 :                 *(sal_Bool *)pShapeHoriOrientMirrorState->maValue.getValue() )
     926           0 :                 pShapeHoriOrientState->mnIndex = -1;
     927             :             else
     928           0 :                 pShapeHoriOrientMirroredState->mnIndex = -1;
     929             :         }
     930         628 :         if( pShapeHoriOrientMirrorState )
     931           0 :             pShapeHoriOrientMirrorState->mnIndex = -1;
     932             : 
     933         628 :         if( pShapeHoriOrientRelState && TextContentAnchorType_AT_FRAME == eAnchor )
     934           0 :             pShapeHoriOrientRelState->mnIndex = -1;
     935         628 :         if( pShapeHoriOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
     936           0 :             pShapeHoriOrientRelFrameState->mnIndex = -1;
     937             : 
     938         628 :         if( pShapeVertOrientState && TextContentAnchorType_AT_CHARACTER == eAnchor )
     939           0 :             pShapeVertOrientState->mnIndex = -1;
     940         628 :         if( pShapeVertOrientAtCharState && TextContentAnchorType_AT_CHARACTER != eAnchor )
     941           0 :             pShapeVertOrientAtCharState->mnIndex = -1;
     942         628 :         if( pShapeVertOrientRelState && TextContentAnchorType_AT_PARAGRAPH != eAnchor &&
     943           0 :             TextContentAnchorType_AT_CHARACTER != eAnchor )
     944           0 :             pShapeVertOrientRelState->mnIndex = -1;
     945         628 :         if( pShapeVertOrientRelPageState && TextContentAnchorType_AT_PAGE != eAnchor )
     946           0 :             pShapeVertOrientRelPageState->mnIndex = -1;
     947         628 :         if( pShapeVertOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
     948           0 :             pShapeVertOrientRelFrameState->mnIndex = -1;
     949             :     }
     950             : 
     951             :     // list style name: remove list style if it is the default outline style
     952         873 :     if( pListStyleName != NULL )
     953             :     {
     954           0 :         OUString sListStyleName;
     955           0 :         pListStyleName->maValue >>= sListStyleName;
     956           0 :         if( lcl_IsOutlineStyle( GetExport(), sListStyleName ) )
     957           0 :             pListStyleName->mnIndex = -1;
     958             :     }
     959             : 
     960         873 :     if( pClipState != NULL && pClip11State != NULL  )
     961           0 :         pClip11State->mnIndex = -1;
     962             : 
     963         873 :     SvXMLExportPropertyMapper::ContextFilter(rProperties,rPropSet);
     964         873 : }
     965             : 
     966             : 
     967           0 : static bool lcl_IsOutlineStyle(const SvXMLExport &rExport, const OUString & rName)
     968             : {
     969             :     Reference< XChapterNumberingSupplier >
     970           0 :         xCNSupplier(rExport.GetModel(), UNO_QUERY);
     971             : 
     972           0 :     OUString sOutlineName;
     973           0 :     OUString sName("Name");
     974             : 
     975           0 :     if (xCNSupplier.is())
     976             :     {
     977             :         Reference<XPropertySet> xNumRule(
     978           0 :             xCNSupplier->getChapterNumberingRules(), UNO_QUERY );
     979             :         DBG_ASSERT( xNumRule.is(), "no chapter numbering rules" );
     980           0 :         if (xNumRule.is())
     981             :         {
     982           0 :             xNumRule->getPropertyValue(sName) >>= sOutlineName;
     983           0 :         }
     984             :     }
     985             : 
     986           0 :     return rName == sOutlineName;
     987             : }
     988             : 
     989             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10