diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-15 17:25:38 +0000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-01-27 15:26:29 +0000 |
commit | 13386917bf05b515142049595b6b93fae01d2051 (patch) | |
tree | 5f782b0d4d055d3a2eec3bb0e2691420b368cfca | |
parent | 6a3ee8e012e526004e86efa6cd71bf5079d90df8 (diff) |
Resolves: fdo#85666 when matching existing list indent use matching level
(cherry picked from commit 30033deace805ce507c8532c51c42b9ede98db06)
Conflicts:
sw/source/uibase/wrtsh/wrtsh1.cxx
Change-Id: I20bf0fa3a9b1562d46eba6321edca047cf02b128
Reviewed-on: https://gerrit.libreoffice.org/13941
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/source/core/uibase/wrtsh/wrtsh1.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sw/source/core/uibase/wrtsh/wrtsh1.cxx b/sw/source/core/uibase/wrtsh/wrtsh1.cxx index b1893be9f54c..ce4d7562d2a9 100644 --- a/sw/source/core/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/core/uibase/wrtsh/wrtsh1.cxx @@ -1250,14 +1250,22 @@ void SwWrtShell::NumOrBulletOn(bool bNum) const SwTwips nTxtNodeIndent = pTxtNode->GetAdditionalIndentForStartingNewList(); if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 ) { - // #i111172# + // #i111172#/fdo#85666 // If text node is already inside a list, assure that the indents // are the same. Thus, adjust the indent change value by subtracting // indents of to be applied list style. SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs; if ( pTxtNode->GetNumRule() ) { - const SwNumFmt aFmt( aNumRule.Get( 0 ) ); + int nLevel = pTxtNode->GetActualListLevel(); + + if (nLevel < 0) + nLevel = 0; + + if (nLevel >= MAXLEVEL) + nLevel = MAXLEVEL - 1; + + const SwNumFmt aFmt( aNumRule.Get( nLevel ) ); if ( aFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) { nIndentChange -= aFmt.GetIndentAt() + aFmt.GetFirstLineIndent(); |