diff options
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 48 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 31 |
2 files changed, 41 insertions, 38 deletions
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 23422c10f6..5e59f12ee6 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -1508,8 +1508,6 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( return sStyleName; } -// --> OD 2006-10-12 #i69629# -// adjustments to reflect change of internal data structure <mpOutlineStylesCandidates> void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName, sal_Int8 nOutlineLevel ) { @@ -1560,9 +1558,7 @@ void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName, } // else: we already had a style name, so we let it pass. } -// <-- -// --> OD 2006-10-12 #i69629# void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel, const OUString& rStyleName ) { @@ -1585,16 +1581,13 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel mpOutlineStylesCandidates[nOutlineLevel-1].push_back( rStyleName ); } } -// <-- -// --> OD 2006-10-12 #i69629# void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels ) { if ( ( mpOutlineStylesCandidates != NULL || bSetEmptyLevels ) && xChapterNumbering.is() && !IsInsertMode() ) { - // --> OD 2007-12-19 #152540# bool bChooseLastOne( false ); { if ( GetXMLImport().IsTextDocInOOoFileFormat() ) @@ -1607,15 +1600,12 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels ) sal_Int32 nBuild( 0 ); if ( GetXMLImport().getBuildIds( nUPD, nBuild ) ) { - // --> OD 2008-03-19 #i86058# // check explicitly on certain versions bChooseLastOne = ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0 ( nUPD == 680 && nBuild <= 9073 ); // OOo 2.0 - OOo 2.0.4 - // <-- } } } - // <-- OUString sOutlineStyleName; { @@ -1624,8 +1614,15 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels ) xChapterNumRule->getPropertyValue(sName) >>= sOutlineStyleName; } - OUString sEmpty; - sal_Int32 nCount = xChapterNumbering->getCount(); + const sal_Int32 nCount = xChapterNumbering->getCount(); + // --> OD 2009-11-13 #i106218# + // First collect all paragraph styles choosen for assignment to each + // list level of the outline style, then perform the intrinsic assignment. + // Reason: The assignment of a certain paragraph style to a list level + // of the outline style causes side effects on the children + // paragraph styles in Writer. + ::std::vector<OUString> sChosenStyles(nCount); + // <-- for( sal_Int32 i=0; i < nCount; ++i ) { if ( bSetEmptyLevels || @@ -1634,17 +1631,12 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels ) { // determine, which candidate is one to be assigned to the list // level of the outline style - OUString sChoosenStyle( sEmpty ); if ( mpOutlineStylesCandidates && !mpOutlineStylesCandidates[i].empty() ) { - // --> OD 2007-12-19 #152540# if ( bChooseLastOne ) - // <-- { - // --> OD 2006-11-06 #i71249# - take last added one - sChoosenStyle = mpOutlineStylesCandidates[i].back(); - // <-- + sChosenStyles[i] = mpOutlineStylesCandidates[i].back(); } else { @@ -1655,24 +1647,26 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels ) sNumberingStyleName, sOutlineStyleName ) ) { - sChoosenStyle = mpOutlineStylesCandidates[i][j]; + sChosenStyles[i] = mpOutlineStylesCandidates[i][j]; break; } } } } - - Sequence < PropertyValue > aProps( 1 ); - PropertyValue *pProps = aProps.getArray(); - pProps->Name = sHeadingStyleName; - pProps->Value <<= sChoosenStyle; - - xChapterNumbering->replaceByIndex( i, makeAny( aProps ) ); } } + // --> OD 2009-11-13 #i106218# + Sequence < PropertyValue > aProps( 1 ); + PropertyValue *pProps = aProps.getArray(); + pProps->Name = sHeadingStyleName; + for ( sal_Int32 i = 0; i < nCount; ++i ) + { + pProps->Value <<= sChosenStyles[i]; + xChapterNumbering->replaceByIndex( i, makeAny( aProps ) ); + } + // <-- } } -// <-- void XMLTextImportHelper::SetHyperlink( SvXMLImport& rImport, diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 69e73929f2..21df9d374c 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -807,6 +807,11 @@ void XMLTextParagraphExport::exportListChange( } } + const bool bExportODF = + ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0; + const SvtSaveOptions::ODFDefaultVersion eODFDefaultVersion = + GetExport().getDefaultVersion(); + // start a new list if ( rNextInfo.GetLevel() > 0 ) { @@ -829,10 +834,6 @@ void XMLTextParagraphExport::exportListChange( if ( nListLevelsToBeOpened > 0 ) { - const bool bExportODF = - ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0; - const SvtSaveOptions::ODFDefaultVersion eODFDefaultVersion = - GetExport().getDefaultVersion(); const ::rtl::OUString sListStyleName( rNextInfo.GetNumRulesName() ); // Currently only the text documents support <ListId>. // Thus, for other document types <sListId> is empty. @@ -1038,16 +1039,14 @@ void XMLTextParagraphExport::exportListChange( pListElements->Remove( pListElements->Count()-1 ); delete pElem; - if ( rNextInfo.IsRestart() && !rNextInfo.HasStartValue() ) + // --> OD 2009-11-12 #i103745# - only for sub lists + if ( rNextInfo.IsRestart() && !rNextInfo.HasStartValue() && + rNextInfo.GetLevel() != 1 ) + // <-- { // start new sub list respectively list on same list level pElem = (*pListElements)[pListElements->Count()-1]; GetExport().EndElement( *pElem, sal_True ); - if ( rNextInfo.GetLevel() == 1 ) - { - GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, - GetExport().EncodeStyleName( rNextInfo.GetNumRulesName() ) ); - } GetExport().IgnorableWhitespace(); GetExport().StartElement( *pElem, sal_False ); } @@ -1059,8 +1058,18 @@ void XMLTextParagraphExport::exportListChange( OUStringBuffer aBuffer; aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, - aBuffer.makeStringAndClear() ); + aBuffer.makeStringAndClear() ); + } + // --> OD 2009-11-12 #i103745# - handle restart without start value on list level 1 + else if ( rNextInfo.IsRestart() && /*!rNextInfo.HasStartValue() &&*/ + rNextInfo.GetLevel() == 1 ) + { + OUStringBuffer aBuffer; + aBuffer.append( (sal_Int32)rNextInfo.GetListLevelStartValue() ); + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, + aBuffer.makeStringAndClear() ); } + // <-- if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 && GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) { |