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:47 +0000 |
commit | f5a6a1ccfaa65385d1577c69288a92c3d2571f46 (patch) | |
tree | a1b7fdda8ef6a4d601df9b61e61632c0fc20e14a | |
parent | a0ef8ea968c8b395ad4247f5efebed54657cfd93 (diff) |
Resolves: fdo#85666 when matching existing list indent use matching level
Change-Id: I20bf0fa3a9b1562d46eba6321edca047cf02b128
(cherry picked from commit 30033deace805ce507c8532c51c42b9ede98db06)
Reviewed-on: https://gerrit.libreoffice.org/13940
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-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 d49ce125de7e..2df76ff82dd1 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(); |