summaryrefslogtreecommitdiff
path: root/xmloff/source/text/txtimp.cxx
diff options
context:
space:
mode:
authorOliver Düsterhoff <od@openoffice.org>2009-11-13 09:38:27 +0000
committerOliver Düsterhoff <od@openoffice.org>2009-11-13 09:38:27 +0000
commit1c77502215e478e78a8f25307eb3537a844b6306 (patch)
treeb18ecc789082a97f377c786cc5801e22b21b99c7 /xmloff/source/text/txtimp.cxx
parent1e02fb221654a7c48c2dcd3bbe2f205fddd7629e (diff)
#i106218# method <XMLTextImportHelper::SetOutlineStyles(..)>
- First collect all paragraph styles chosen for assignment to the outline style. Then perform the intrinsic assignment. Reason: side effect of assignment in Writer.
Diffstat (limited to 'xmloff/source/text/txtimp.cxx')
-rw-r--r--xmloff/source/text/txtimp.cxx48
1 files changed, 21 insertions, 27 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,