diff options
author | Michael Brauer <mib@openoffice.org> | 2001-09-05 07:32:07 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2001-09-05 07:32:07 +0000 |
commit | cbd497bc67b5bf776eb9ba8f5e7d6ef9a132a315 (patch) | |
tree | 1b072792f4d5f76bde1dbcabc83cfc0b8b809d80 | |
parent | 13a3ac4b9b4d2b8274624a318c9f199fae8a82b7 (diff) |
#i1558#: Export master documents with bullet lists correctly, some optimization
-rw-r--r-- | xmloff/source/style/MultiPropertySetHelper.cxx | 36 | ||||
-rw-r--r-- | xmloff/source/style/prstylei.cxx | 51 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 311 | ||||
-rw-r--r-- | xmloff/source/text/txtsecte.cxx | 44 |
4 files changed, 356 insertions, 86 deletions
diff --git a/xmloff/source/style/MultiPropertySetHelper.cxx b/xmloff/source/style/MultiPropertySetHelper.cxx index 606f38422f3b..6a2761d0fe76 100644 --- a/xmloff/source/style/MultiPropertySetHelper.cxx +++ b/xmloff/source/style/MultiPropertySetHelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: MultiPropertySetHelper.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-05-17 16:13:53 $ + * last change: $Author: mib $ $Date: 2001-09-05 08:30:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -222,6 +222,38 @@ void MultiPropertySetHelper::getValues( } +const Any& MultiPropertySetHelper::getValue( sal_Int16 nIndex, + const Reference< XPropertySet> & rPropSet, + sal_Bool bTryMulti ) +{ + if( !pValues ) + { + if( bTryMulti ) + { + Reference < XMultiPropertySet > xMultiPropSet( rPropSet, + UNO_QUERY ); + if( xMultiPropSet.is() ) + getValues( xMultiPropSet ); + else + getValues( rPropSet ); + } + else + { + getValues( rPropSet ); + } + } + + return getValue( nIndex ); +} + +const Any& MultiPropertySetHelper::getValue( sal_Int16 nIndex, + const Reference< XMultiPropertySet> & rMultiPropSet ) +{ + if( !pValues ) + getValues( rMultiPropSet ); + + return getValue( nIndex ); +} // inline methods defined in header: // inline Any& MultiPropertySetHelper::getValue( sal_Int16 nIndex ) diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 7577906fe695..86b7e9cbdab0 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -2,9 +2,9 @@ * * $RCSfile: prstylei.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dvo $ $Date: 2001-06-29 21:07:17 $ + * last change: $Author: mib $ $Date: 2001-09-05 08:30:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,6 +63,9 @@ #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> #endif +#ifndef __SGI_STL_SET +#include <set> +#endif #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif @@ -84,6 +87,9 @@ #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_ #include <com/sun/star/beans/XPropertyState.hpp> #endif +#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSTATES_HPP_ +#include <com/sun/star/beans/XMultiPropertyStates.hpp> +#endif #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #endif @@ -205,6 +211,8 @@ Reference < XStyle > XMLPropStyleContext::Create() return xNewStyle; } +typedef ::std::set < OUString, ::comphelper::UStringLess > PropertyNameSet; + void XMLPropStyleContext::CreateAndInsert( sal_Bool bOverwrite ) { const OUString& rName = GetName(); @@ -257,15 +265,40 @@ void XMLPropStyleContext::CreateAndInsert( sal_Bool bOverwrite ) xPrMap = xImpPrMap->getPropertySetMapper(); if( xPrMap.is() ) { - sal_Int32 nCount = xPrMap->GetEntryCount(); - for( sal_Int32 i = 0; i < nCount; i++ ) + Reference < XMultiPropertyStates > xMultiStates( xPropSet, + UNO_QUERY ); + if( xMultiStates.is() ) + { + xMultiStates->setAllPropertiesToDefault(); + } + else { - const OUString& rName = xPrMap->GetEntryAPIName( i ); - if( xPropSetInfo->hasPropertyByName( rName ) && - PropertyState_DIRECT_VALUE == - xPropState->getPropertyState( rName ) ) + PropertyNameSet aNameSet; + sal_Int32 nCount = xPrMap->GetEntryCount(); + sal_Int32 i; + for( i = 0; i < nCount; i++ ) + { + const OUString& rName = xPrMap->GetEntryAPIName( i ); + if( xPropSetInfo->hasPropertyByName( rName ) ) + aNameSet.insert( rName ); + } + + nCount = aNameSet.size(); + Sequence < OUString > aNames( nCount ); + OUString *pNames = aNames.getArray(); + PropertyNameSet::iterator aIter = aNameSet.begin(); + while( aIter != aNameSet.end() ) + *pNames++ = *aIter++; + + Sequence < PropertyState > aStates( + xPropState->getPropertyStates( aNames ) ); + const PropertyState *pStates = aStates.getConstArray(); + pNames = aNames.getArray(); + + for( i = 0; i < nCount; i++ ) { - xPropState->setPropertyToDefault( rName ); + if( PropertyState_DIRECT_VALUE == *pStates++ ) + xPropState->setPropertyToDefault( pNames[i] ); } } } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index c87884bbd5f7..d9d0f06c7147 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtparae.cxx,v $ * - * $Revision: 1.89 $ + * $Revision: 1.90 $ * - * last change: $Author: cl $ $Date: 2001-07-24 09:15:16 $ + * last change: $Author: mib $ $Date: 2001-09-05 08:32:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -275,17 +275,68 @@ SV_IMPL_OP_PTRARR_SORT( OUStringsSort_Impl, OUStringPtr ) static txtparae_bContainsIllegalCharacters = sal_False; #endif +// The following map shows which property values are required: +// +// property auto style pass export +// -------------------------------------------------------- +// ParaStyleName if style exists always +// ParaConditionalStyleName if style exists always +// NumberingRules if style exists always +// TextSection always always +// ParaChapterNumberingLevel never always + +// The conclusion is that for auto styles the first three properties +// should be queried using a multi property set if, and only if, an +// auto style needs to be exported. TextSection should be queried by +// an individual call to getPropertyvalue, because this seems to be +// less expensive than querying the first three properties if they aren't +// required. + +// For the export pass all properties can be queried using a multi property +// set. + +static const sal_Char* aParagraphPropertyNamesAuto[] = +{ + "NumberingRules", + "ParaConditionalStyleName", + "ParaStyleName", + NULL +}; + +enum eParagraphPropertyNamesEnumAuto +{ + NUMBERING_RULES_AUTO = 0, + PARA_CONDITIONAL_STYLE_NAME_AUTO = 1, + PARA_STYLE_NAME_AUTO = 2, +}; + +static const sal_Char* aParagraphPropertyNames[] = +{ + "ParaChapterNumberingLevel", + "ParaConditionalStyleName", + "ParaStyleName", + "TextSection", + NULL +}; + +enum eParagraphPropertyNamesEnum +{ + PARA_CHAPTER_NUMERBING_LEVEL = 0, + PARA_CONDITIONAL_STYLE_NAME = 1, + PARA_STYLE_NAME = 2, + TEXT_SECTION = 3 +}; + + void XMLTextParagraphExport::Add( sal_uInt16 nFamily, const Reference < XPropertySet > & rPropSet, const XMLPropertyState** ppAddStates) { - sal_Bool bCache = sal_False; UniReference < SvXMLExportPropertyMapper > xPropMapper; switch( nFamily ) { case XML_STYLE_FAMILY_TEXT_PARAGRAPH: xPropMapper = GetParaPropMapper(); -// bCache = sal_True; break; case XML_STYLE_FAMILY_TEXT_TEXT: xPropMapper = GetTextPropMapper(); @@ -313,7 +364,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, } } - if( xPropStates.size() > 0L || bCache ) + if( xPropStates.size() > 0L ) { Reference< XPropertySetInfo > xPropSetInfo = rPropSet->getPropertySetInfo(); @@ -387,26 +438,128 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, } if( xPropStates.size() > 0 ) { - if( bCache ) + GetAutoStylePool().Add( nFamily, sParent, xPropStates ); + if( sCondParent.getLength() && sParent != sCondParent ) + GetAutoStylePool().Add( nFamily, sCondParent, xPropStates ); + } + } +} + +void XMLTextParagraphExport::Add( sal_uInt16 nFamily, + MultiPropertySetHelper& rPropSetHelper, + const Reference < XPropertySet > & rPropSet, + const XMLPropertyState** ppAddStates) +{ + UniReference < SvXMLExportPropertyMapper > xPropMapper; + switch( nFamily ) + { + case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + xPropMapper = GetParaPropMapper(); + break; +// case XML_STYLE_FAMILY_TEXT_TEXT: +// xPropMapper = GetTextPropMapper(); +// break; +// case XML_STYLE_FAMILY_TEXT_FRAME: +// xPropMapper = GetAutoFramePropMapper(); +// break; +// case XML_STYLE_FAMILY_TEXT_SECTION: +// xPropMapper = GetSectionPropMapper(); +// break; +// case XML_STYLE_FAMILY_TEXT_RUBY: +// xPropMapper = GetRubyPropMapper(); +// break; + } + DBG_ASSERT( xPropMapper.is(), "There is the property mapper?" ); + + vector< XMLPropertyState > xPropStates = + xPropMapper->Filter( rPropSet ); + if( ppAddStates ) + { + while( *ppAddStates ) + { + xPropStates.push_back( **ppAddStates ); + ppAddStates++; + } + } + + if( xPropStates.size() > 0L ) + { + OUString sParent, sCondParent; + Any aAny; + switch( nFamily ) + { + case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + if( rPropSetHelper.hasProperty( PARA_STYLE_NAME_AUTO ) ) { - GetAutoStylePool().AddAndCache( nFamily, sParent, xPropStates ); - if( sCondParent.getLength() && sParent != sCondParent ) - GetAutoStylePool().AddAndCache( nFamily, sCondParent, xPropStates ); + aAny = rPropSetHelper.getValue( PARA_STYLE_NAME_AUTO, rPropSet, + sal_True ); + aAny >>= sParent; } - else + if( rPropSetHelper.hasProperty( PARA_CONDITIONAL_STYLE_NAME_AUTO ) ) { - GetAutoStylePool().Add( nFamily, sParent, xPropStates ); - if( sCondParent.getLength() && sParent != sCondParent ) - GetAutoStylePool().Add( nFamily, sCondParent, xPropStates ); + aAny = rPropSetHelper.getValue( PARA_CONDITIONAL_STYLE_NAME_AUTO, + rPropSet, sal_True ); + aAny >>= sCondParent; + } + if( rPropSetHelper.hasProperty( NUMBERING_RULES_AUTO ) ) + { + aAny = rPropSetHelper.getValue( NUMBERING_RULES_AUTO ); + Reference < XIndexReplace > xNumRule; + aAny >>= xNumRule; + if( xNumRule.is() && xNumRule->getCount() ) + { + Reference < XNamed > xNamed( xNumRule, UNO_QUERY ); + OUString sName; + if( xNamed.is() ) + sName = xNamed->getName(); + sal_Bool bAdd = !sName.getLength(); + if( !bAdd ) + { + Reference < XPropertySet > xNumPropSet( xNumRule, + UNO_QUERY ); + OUString sIsAutomatic( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ); + if( xNumPropSet.is() && + xNumPropSet->getPropertySetInfo() + ->hasPropertyByName( sIsAutomatic ) ) + { + aAny = xNumPropSet->getPropertyValue( sIsAutomatic ); + bAdd = *(sal_Bool *)aAny.getValue(); + } + else + { + bAdd = sal_True; + } + } + if( bAdd ) + pListAutoPool->Add( xNumRule ); + } } + break; +// case XML_STYLE_FAMILY_TEXT_TEXT: +// if( xPropSetInfo->hasPropertyByName( sCharStyleName ) ) +// { +// aAny = rPropSet->getPropertyValue( sCharStyleName ); +// aAny >>= sParent; +// } +// break; +// case XML_STYLE_FAMILY_TEXT_FRAME: +// if( xPropSetInfo->hasPropertyByName( sFrameStyleName ) ) +// { +// aAny = rPropSet->getPropertyValue( sFrameStyleName ); +// aAny >>= sParent; +// } +// break; +// case XML_STYLE_FAMILY_TEXT_SECTION: +// case XML_STYLE_FAMILY_TEXT_RUBY: +// ; // section styles have no parents +// break; } - else if( bCache ) + if( xPropStates.size() > 0 ) { - GetAutoStylePool().AddAndCache( nFamily, sParent ); + GetAutoStylePool().Add( nFamily, sParent, xPropStates ); if( sCondParent.getLength() && sParent != sCondParent ) - GetAutoStylePool().AddAndCache( nFamily, sCondParent ); + GetAutoStylePool().Add( nFamily, sCondParent, xPropStates ); } - } } @@ -416,14 +569,12 @@ OUString XMLTextParagraphExport::Find( const OUString& rParent, const XMLPropertyState** ppAddStates) const { - sal_Bool bCache = sal_False; OUString sName( rParent ); UniReference < SvXMLExportPropertyMapper > xPropMapper; switch( nFamily ) { case XML_STYLE_FAMILY_TEXT_PARAGRAPH: xPropMapper = GetParaPropMapper(); -// bCache = sal_True; break; case XML_STYLE_FAMILY_TEXT_TEXT: xPropMapper = GetTextPropMapper(); @@ -438,15 +589,6 @@ OUString XMLTextParagraphExport::Find( xPropMapper = GetRubyPropMapper(); break; } - OUString sCachedName; - if( bCache ) - { - sCachedName = GetAutoStylePool().FindAndRemoveCached( nFamily ); -#ifdef PRODUCT - if( sCachedName.getLength() ) - return sCachedName; -#endif - } DBG_ASSERT( xPropMapper.is(), "There is the property mapper?" ); vector< XMLPropertyState > xPropStates = xPropMapper->Filter( rPropSet ); @@ -461,8 +603,6 @@ OUString XMLTextParagraphExport::Find( if( xPropStates.size() > 0L ) sName = GetAutoStylePool().Find( nFamily, sName, xPropStates ); - DBG_ASSERT( !bCache || !sCachedName.getLength() || sCachedName == sName, - "cache error" ); return sName; } @@ -1217,23 +1357,6 @@ void XMLTextParagraphExport::exportText( bProgress, bExportParagraph ); } -static const sal_Char* aParagraphPropertyNames[] = -{ - "ParaChapterNumberingLevel", - "ParaConditionalStyleName", - "ParaStyleName", - "TextSection", - NULL -}; - -enum eParagraphPropertyNamesEnum -{ - PARA_CHAPTER_NUMERBING_LEVEL = 0, - PARA_CONDITIONAL_STYLE_NAME = 1, - PARA_STYLE_NAME = 2, - TEXT_SECTION = 3 -}; - sal_Bool XMLTextParagraphExport::exportTextContentEnumeration( const Reference < XEnumeration > & rContEnum, sal_Bool bAutoStyles, @@ -1252,7 +1375,9 @@ sal_Bool XMLTextParagraphExport::exportTextContentEnumeration( sal_Bool bHasContent sal_False; Reference<XTextSection> xCurrentTextSection = rBaseSection; - MultiPropertySetHelper aPropSetHelper( aParagraphPropertyNames ); + MultiPropertySetHelper aPropSetHelper( + bAutoStyles ? aParagraphPropertyNamesAuto : + aParagraphPropertyNames ); Any aAny; sal_Bool bHoldElement = sal_False; @@ -1267,19 +1392,30 @@ sal_Bool XMLTextParagraphExport::exportTextContentEnumeration( { aAny = rContEnum->nextElement(); aAny >>= xTxtCntnt; + + aPropSetHelper.resetValues(); + } Reference<XServiceInfo> xServiceInfo( xTxtCntnt, UNO_QUERY ); if( xServiceInfo->supportsService( sParagraphService ) ) { - if( !bAutoStyles ) + if( bAutoStyles ) + { + exportListAndSectionChange( xCurrentTextSection, xTxtCntnt, + aPrevNumInfo, aNextNumInfo, + bAutoStyles ); + } + else { aNextNumInfo.Set( xTxtCntnt ); + + exportListAndSectionChange( xCurrentTextSection, aPropSetHelper, + TEXT_SECTION, xTxtCntnt, + aPrevNumInfo, aNextNumInfo, + bAutoStyles ); } - exportListAndSectionChange( xCurrentTextSection, xTxtCntnt, - aPrevNumInfo, aNextNumInfo, - bAutoStyles ); // if we found a mute section: skip all section content if (pSectionExport->IsMuteSection(xCurrentTextSection)) @@ -1290,6 +1426,8 @@ sal_Bool XMLTextParagraphExport::exportTextContentEnumeration( { aAny = rContEnum->nextElement(); aAny >>= xTxtCntnt; + aPropSetHelper.resetValues(); + aNextNumInfo.Reset(); } // the first non-mute element still needs to be processed bHoldElement = @@ -1384,17 +1522,12 @@ void XMLTextParagraphExport::exportParagraph( // check for supported properties if( !rPropSetHelper.checkedProperties() ) - { - if( xMultiPropSet.is() ) - rPropSetHelper.hasProperties( xMultiPropSet->getPropertySetInfo()); - else - rPropSetHelper.hasProperties( xPropSet->getPropertySetInfo() ); - } + rPropSetHelper.hasProperties( xPropSet->getPropertySetInfo() ); - if( xMultiPropSet.is() ) - rPropSetHelper.getValues( xMultiPropSet ); - else - rPropSetHelper.getValues( xPropSet ); +// if( xMultiPropSet.is() ) +// rPropSetHelper.getValues( xMultiPropSet ); +// else +// rPropSetHelper.getValues( xPropSet ); Any aAny; @@ -1402,14 +1535,19 @@ void XMLTextParagraphExport::exportParagraph( { if( bAutoStyles ) { - Add( XML_STYLE_FAMILY_TEXT_PARAGRAPH, xPropSet ); + Add( XML_STYLE_FAMILY_TEXT_PARAGRAPH, rPropSetHelper, xPropSet ); } else { OUString sStyle; if( rPropSetHelper.hasProperty( PARA_STYLE_NAME ) ) { - aAny = rPropSetHelper.getValue( PARA_STYLE_NAME ); + if( xMultiPropSet.is() ) + aAny = rPropSetHelper.getValue( PARA_STYLE_NAME, + xMultiPropSet ); + else + aAny = rPropSetHelper.getValue( PARA_STYLE_NAME, + xPropSet ); aAny >>= sStyle; } @@ -1422,7 +1560,12 @@ void XMLTextParagraphExport::exportParagraph( if( rPropSetHelper.hasProperty( PARA_CONDITIONAL_STYLE_NAME ) ) { OUString sCondStyle; - aAny = rPropSetHelper.getValue( PARA_CONDITIONAL_STYLE_NAME ); + if( xMultiPropSet.is() ) + aAny = rPropSetHelper.getValue( PARA_CONDITIONAL_STYLE_NAME, + xMultiPropSet ); + else + aAny = rPropSetHelper.getValue( PARA_CONDITIONAL_STYLE_NAME, + xPropSet ); aAny >>= sCondStyle; if( sCondStyle != sStyle ) { @@ -1437,7 +1580,13 @@ void XMLTextParagraphExport::exportParagraph( if( rPropSetHelper.hasProperty( PARA_CHAPTER_NUMERBING_LEVEL ) ) { - aAny = rPropSetHelper.getValue( PARA_CHAPTER_NUMERBING_LEVEL ); + if( xMultiPropSet.is() ) + aAny = rPropSetHelper.getValue( PARA_CHAPTER_NUMERBING_LEVEL, + xMultiPropSet ); + else + aAny = rPropSetHelper.getValue( PARA_CHAPTER_NUMERBING_LEVEL, + xPropSet ); + aAny >>= nOutlineLevel; if( -1 != nOutlineLevel ) { @@ -1457,18 +1606,38 @@ void XMLTextParagraphExport::exportParagraph( Reference < XContentEnumerationAccess > xCEA( rTextContent, UNO_QUERY ); if( xCEA.is() ) xContentEnum = xCEA->createContentEnumeration( sTextContentService ); + sal_Bool bHasContentEnum = xContentEnum.is() && + xContentEnum->hasMoreElements(); Reference < XTextSection > xSection; - if( rPropSetHelper.hasProperty( TEXT_SECTION ) ) + if( bHasContentEnum ) { - aAny = rPropSetHelper.getValue( TEXT_SECTION ); - aAny >>= xSection; + // For the auto styles, the multi property set helper is only used + // if hard attributes are existing. Therfor, it seems to be a better + // strategy to have the TextSection property seperate, because otherwise + // we always retrieve the style names even if they are not required. + if( bAutoStyles ) + { + if( xPropSet->getPropertySetInfo()->hasPropertyByName( sTextSection ) ) + { + aAny = xPropSet->getPropertyValue( sTextSection ); + aAny >>= xSection; + } + } + else + { + if( rPropSetHelper.hasProperty( TEXT_SECTION ) ) + { + aAny = rPropSetHelper.getValue( TEXT_SECTION ); + aAny >>= xSection; + } + } } if( bAutoStyles ) { sal_Bool bPrevCharIsSpace = sal_True; - if( xContentEnum.is() ) + if( bHasContentEnum ) bPrevCharIsSpace = !exportTextContentEnumeration( xContentEnum, bAutoStyles, xSection, bProgress ); @@ -1481,7 +1650,7 @@ void XMLTextParagraphExport::exportParagraph( -1 == nOutlineLevel ? XML_P : XML_H; SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, eElem, sal_True, sal_False ); - if( xContentEnum.is() ) + if( bHasContentEnum ) bPrevCharIsSpace = !exportTextContentEnumeration( xContentEnum, bAutoStyles, xSection, bProgress ); diff --git a/xmloff/source/text/txtsecte.cxx b/xmloff/source/text/txtsecte.cxx index 594773e2a664..b383757f7d67 100644 --- a/xmloff/source/text/txtsecte.cxx +++ b/xmloff/source/text/txtsecte.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtsecte.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ + * last change: $Author: mib $ $Date: 2001-09-05 08:32:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -157,6 +157,9 @@ #ifndef _XMLOFF_XMLREDLINEEXPORT_HXX #include "XMLRedlineExport.hxx" #endif +#ifndef _XMLOFF_MULTIPROPERTYSETHELPER_HXX +#include "MultiPropertySetHelper.hxx" +#endif using namespace ::com::sun::star; using namespace ::com::sun::star::text; @@ -194,7 +197,6 @@ void XMLTextParagraphExport::exportListAndSectionChange( sal_Bool bAutoStyles) { Reference<XTextSection> xNextSection; - Reference<XDocumentIndex> xNextIndex; // first: get current XTextSection Reference<XPropertySet> xPropSet(rNextSectionContent, UNO_QUERY); @@ -214,6 +216,36 @@ void XMLTextParagraphExport::exportListAndSectionChange( void XMLTextParagraphExport::exportListAndSectionChange( Reference<XTextSection> & rPrevSection, + MultiPropertySetHelper& rPropSetHelper, + sal_Int16 nTextSectionId, + const Reference<XTextContent> & rNextSectionContent, + const XMLTextNumRuleInfo& rPrevRule, + const XMLTextNumRuleInfo& rNextRule, + sal_Bool bAutoStyles) +{ + Reference<XTextSection> xNextSection; + + // first: get current XTextSection + Reference<XPropertySet> xPropSet(rNextSectionContent, UNO_QUERY); + if (xPropSet.is()) + { + if( !rPropSetHelper.checkedProperties() ) + rPropSetHelper.hasProperties( xPropSet->getPropertySetInfo() ); + if( rPropSetHelper.hasProperty( nTextSectionId )) + { + Any aAny = rPropSetHelper.getValue( nTextSectionId , xPropSet, + sal_True ); + aAny >>= xNextSection; + } + // else: no current section + } + + exportListAndSectionChange(rPrevSection, xNextSection, + rPrevRule, rNextRule, bAutoStyles); +} + +void XMLTextParagraphExport::exportListAndSectionChange( + Reference<XTextSection> & rPrevSection, const Reference<XTextSection> & rNextSection, const XMLTextNumRuleInfo& rPrevRule, const XMLTextNumRuleInfo& rNextRule, @@ -246,12 +278,16 @@ void XMLTextParagraphExport::exportListAndSectionChange( vector<Reference<XTextSection> > aNewStack; aCurrent = rNextSection; + sal_Bool bMute = sal_False; while(aCurrent.is()) { // if we have a mute section, ignore all its children // (all previous ones) if (pSectionExport->IsMuteSection(aCurrent)) + { aNewStack.clear(); + bMute = sal_True; + } aNewStack.push_back(aCurrent); aCurrent = aCurrent->getParentSection(); @@ -306,7 +342,7 @@ void XMLTextParagraphExport::exportListAndSectionChange( } // start new list - if ( !bAutoStyles ) + if ( !bAutoStyles && !bMute ) exportListChange(aEmptyNumRule, rNextRule); } else |