[Libreoffice-commits] core.git: sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Sat Sep 12 09:49:32 UTC 2020


 sw/source/ui/vba/vbalistformat.cxx |   24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

New commits:
commit 286a7f3ec8976761f3e796e13b374700063dbc4b
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Sep 11 19:46:58 2020 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sat Sep 12 11:48:53 2020 +0200

    ConvertNumbersToText: handle legacy lists
    
    Handle css::text::PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION
    
    Change-Id: I5024359b1a34b0ebb63165ace5e517dd90994faa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102510
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/ui/vba/vbalistformat.cxx b/sw/source/ui/vba/vbalistformat.cxx
index 798ca6fb29f7..281f09c048af 100644
--- a/sw/source/ui/vba/vbalistformat.cxx
+++ b/sw/source/ui/vba/vbalistformat.cxx
@@ -159,6 +159,9 @@ void SAL_CALL SwVbaListFormat::ConvertNumbersToText(  )
             sal_Int32 nListtabStopPosition = SAL_MAX_INT32;
             sal_Int32 nFirstLineIndent = SAL_MAX_INT32;
             sal_Int32 nIndentAt = SAL_MAX_INT32;
+            sal_Int32 nLeftMargin = SAL_MAX_INT32;
+            sal_Int32 nSymbolTextDistance = SAL_MAX_INT32;
+            sal_Int32 nFirstLineOffset = SAL_MAX_INT32;
             OUString sCharStyleName, sBulletChar;
             css::awt::FontDescriptor aBulletFont;
             bool bHasFont;
@@ -177,18 +180,34 @@ void SAL_CALL SwVbaListFormat::ConvertNumbersToText(  )
                 aLevelRule["NumberingType"] >>= nNumberingType;
                 // TODO: aLevelRule["Adjust"] >>= nAdjust; // HoriOrientation::LEFT/RIGHT/CENTER
                 aLevelRule["PositionAndSpaceMode"] >>= nPositionAndSpaceMode;
+
+                // for css::text::PositionAndSpaceMode::LABEL_ALIGNMENT
                 aLevelRule["LabelFollowedBy"] >>= nLabelFollowedBy;
                 aLevelRule["ListtabStopPosition"] >>= nListtabStopPosition;
                 aLevelRule["FirstLineIndent"] >>= nFirstLineIndent;
                 aLevelRule["IndentAt"] >>= nIndentAt;
+
+                // for css::text::PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION
+                aLevelRule["LeftMargin"] >>= nLeftMargin;
+                aLevelRule["SymbolTextDistance"] >>= nSymbolTextDistance;
+                aLevelRule["FirstLineOffset"] >>= nFirstLineOffset;
+
                 aLevelRule["BulletChar"] >>= sBulletChar;
                 bHasFont = (aLevelRule["BulletFont"] >>= aBulletFont);
                 bHasColor = (aLevelRule["BulletColor"] >>= aBulletColor);
             }
 
-            if (nPositionAndSpaceMode == css::text::PositionAndSpaceMode::LABEL_ALIGNMENT
-                && nNumberingType != css::style::NumberingType::BITMAP) // TODO
+            if (nNumberingType != css::style::NumberingType::BITMAP) // TODO
             {
+                if (nPositionAndSpaceMode
+                    == css::text::PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION)
+                {
+                    nIndentAt = nLeftMargin;
+                    nFirstLineIndent = nFirstLineOffset;
+                    nListtabStopPosition = nSymbolTextDistance;
+                    nLabelFollowedBy = SvxNumberFormat::LabelFollowedBy::LISTTAB;
+                }
+
                 switch (nLabelFollowedBy)
                 {
                     case SvxNumberFormat::LabelFollowedBy::LISTTAB:
@@ -277,7 +296,6 @@ void SAL_CALL SwVbaListFormat::ConvertNumbersToText(  )
             }
             else
             {
-                // TODO: css::text::PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION
                 continue; // for now, keep such lists as is
             }
             // In case of higher outline levels, each assignment of empty value just sets level 1


More information about the Libreoffice-commits mailing list