diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-15 17:25:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-15 17:30:05 +0000 |
commit | 30033deace805ce507c8532c51c42b9ede98db06 (patch) | |
tree | acdb10ac8b69eb2843f122d8a2e5d9e95941a3e8 | |
parent | 1a2b8b2358fe5954a5c3960c9a48467de3dc5ba8 (diff) |
Resolves: fdo#85666 when matching existing list indent use matching level
Change-Id: I20bf0fa3a9b1562d46eba6321edca047cf02b128
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh1.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 3865697dc3aa..34e11b3b172a 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1260,14 +1260,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(); |