From 13386917bf05b515142049595b6b93fae01d2051 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 15 Jan 2015 17:25:38 +0000 Subject: 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 Reviewed-by: Michael Stahl --- sw/source/core/uibase/wrtsh/wrtsh1.cxx | 12 ++++++++++-- 1 file 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(); -- cgit v1.2.3