summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2014-04-25 11:39:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-04-26 10:20:52 +0100
commitaf907213a26efc05bac2a02ab286a0f14aff3352 (patch)
treef479c832d99a9f7905b211c9872710bb1843fe73
parentf4a6837025a293312cbc43b9c527851362f11030 (diff)
Related: #i124451# application of index entry template patterns
-- do not propagate tab stops of unused paragraph styles -- do not propagate default tab stops (cherry picked from commit fd29c8d6368e5e6039dec45a1b40452a42e8d524) Conflicts: sw/source/core/tox/tox.cxx Change-Id: I0fce96aeb951ff0b46ff14d2ebd13864532fecc2
-rw-r--r--sw/source/core/tox/tox.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 3c4ced3aa8ca..1e1a435c3594 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -402,17 +402,15 @@ sal_uInt16 SwForm::GetFormMaxLevel( TOXTypes eTOXType )
void SwForm::AdjustTabStops( SwDoc& rDoc ) // #i21237#
{
- for(sal_uInt16 nLevel = 1; nLevel < GetFormMax(); nLevel++)
+ const sal_uInt16 nFormMaxLevel = GetFormMax();
+ for ( sal_uInt16 nLevel = 1; nLevel < nFormMaxLevel; ++nLevel )
{
- const OUString sTemplateName = GetTemplate(nLevel);
-
- SwTxtFmtColl* pColl = rDoc.FindTxtFmtCollByName( sTemplateName );
+ SwTxtFmtColl* pColl = rDoc.FindTxtFmtCollByName( GetTemplate(nLevel) );
if( pColl == NULL )
{
- const sal_uInt16 nId =
- SwStyleNameMapper::GetPoolIdFromUIName( sTemplateName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
- if ( USHRT_MAX != nId )
- pColl = rDoc.GetTxtCollFromPool( nId );
+ // Paragraph Style for this level has not been created.
+ // --> No need to propagate default values
+ continue;
}
const SvxTabStopItem* pTabStops = pColl != NULL ? &pColl->GetTabStops(sal_False) : 0;
@@ -428,6 +426,9 @@ void SwForm::AdjustTabStops( SwDoc& rDoc ) // #i21237#
{
const SvxTabStop& rTab = (*pTabStops)[nTab];
+ if ( rTab.GetAdjustment() == SVX_TAB_ADJUST_DEFAULT )
+ continue; // ignore the default tab stop
+
aIt = find_if( aIt, aCurrentPattern.end(), SwFormTokenEqualToFormTokenType(TOKEN_TAB_STOP) );
if ( aIt != aCurrentPattern.end() )
{