diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-01-20 13:45:54 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-01-20 15:18:32 +0100 |
commit | c82ed24c4e51492105b5d94e164ece3cf86d6d86 (patch) | |
tree | ccbd7cb84e09864e13b3c2d8d26fe41f089a8099 | |
parent | 35e8190b0317972abb376dd2ed55567c43bc8b4d (diff) |
rhbz#746174: also export list restart for non root list
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 6db50ffed16f..376112129f2f 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -903,14 +903,14 @@ void XMLTextParagraphExport::exportListChange( { const ::rtl::OUString sListStyleName( rNextInfo.GetNumRulesName() ); // Currently only the text documents support <ListId>. // Thus, for other document types <sListId> is empty. const ::rtl::OUString sListId( rNextInfo.GetListId() ); bool bExportListStyle( true ); - bool bRestartNumberingAtContinuedRootList( false ); - sal_Int16 nRestartValueForContinuedRootList( -1 ); + bool bRestartNumberingAtContinuedList( false ); + sal_Int32 nRestartValueForContinuedList( -1 ); bool bContinueingPreviousSubList = !bRootListToBeStarted && rNextInfo.IsContinueingPreviousSubTree(); do { GetExport().CheckAttrList(); if ( bRootListToBeStarted ) @@ -977,15 +977,15 @@ void XMLTextParagraphExport::exportListChange( } if ( rNextInfo.IsRestart() && ( nListLevelsToBeOpened != 1 || !rNextInfo.HasStartValue() ) ) { - bRestartNumberingAtContinuedRootList = true; - nRestartValueForContinuedRootList = - rNextInfo.GetListLevelStartValue(); + bRestartNumberingAtContinuedList = true; + nRestartValueForContinuedList = + rNextInfo.GetListLevelStartValue(); } } mpTextListsHelper->KeepListAsProcessed( sNewListId, sListStyleName, sContinueListId ); @@ -1000,12 +1000,24 @@ void XMLTextParagraphExport::exportListChange( else if ( bExportListStyle && !mpTextListsHelper->EqualsToTopListStyleOnStack( sListStyleName ) ) { GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetExport().EncodeStyleName( sListStyleName ) ); bExportListStyle = false; + + + } + else + { + // rhbz#746174: also export list restart for non root list + if (rNextInfo.IsRestart() && !rNextInfo.HasStartValue()) + { + bRestartNumberingAtContinuedList = true; + nRestartValueForContinuedList = + rNextInfo.GetListLevelStartValue(); + } } if ( bContinueingPreviousSubList ) { GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_CONTINUE_NUMBERING, XML_TRUE ); @@ -1027,32 +1039,30 @@ void XMLTextParagraphExport::exportListChange( mpTextListsHelper->PushListOnStack( sListId, sListStyleName ); // <text:list-header> or <text:list-item> GetExport().CheckAttrList(); - /* Export start value in case of <bRestartNumberingAtContinuedRootList> - at correct list item (#i97309#) - */ + /* Export start value at correct list item (#i97309#) */ if ( nListLevelsToBeOpened == 1 ) { if ( rNextInfo.HasStartValue() ) { OUStringBuffer aBuffer; aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aBuffer.makeStringAndClear() ); } - else if ( bRestartNumberingAtContinuedRootList ) + else if (bRestartNumberingAtContinuedList) { OUStringBuffer aBuffer; - aBuffer.append( (sal_Int32)nRestartValueForContinuedRootList ); + aBuffer.append( nRestartValueForContinuedList ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aBuffer.makeStringAndClear() ); - bRestartNumberingAtContinuedRootList = false; + bRestartNumberingAtContinuedList = false; } } eLName = ( rNextInfo.IsNumbered() || nListLevelsToBeOpened > 1 ) ? XML_LIST_ITEM : XML_LIST_HEADER; |