[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sw/source

Caolán McNamara caolanm at redhat.com
Tue Jan 27 07:27:24 PST 2015


 sw/source/uibase/wrtsh/wrtsh1.cxx |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit f5a6a1ccfaa65385d1577c69288a92c3d2571f46
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 15 17:25:38 2015 +0000

    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 at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index d49ce12..2df76ff 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();


More information about the Libreoffice-commits mailing list