summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-15 17:25:38 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-15 17:30:05 +0000
commit30033deace805ce507c8532c51c42b9ede98db06 (patch)
treeacdb10ac8b69eb2843f122d8a2e5d9e95941a3e8
parent1a2b8b2358fe5954a5c3960c9a48467de3dc5ba8 (diff)
Resolves: fdo#85666 when matching existing list indent use matching level
Change-Id: I20bf0fa3a9b1562d46eba6321edca047cf02b128
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx12
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();