diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-09-11 19:46:58 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-09-12 11:48:53 +0200 |
commit | 286a7f3ec8976761f3e796e13b374700063dbc4b (patch) | |
tree | 36313faaff2ae4ed10a83b2b702b96c6db241634 | |
parent | 1675f5c0f600c817b0b9a0ab0a79ae32c43e5b93 (diff) |
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@collabora.com>
-rw-r--r-- | sw/source/ui/vba/vbalistformat.cxx | 24 |
1 files changed, 21 insertions, 3 deletions
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 |