summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorSzabolcs Toth <szabolcs450@gmail.com>2020-01-06 15:43:03 +0100
committerLászló Németh <nemeth@numbertext.org>2020-01-10 14:25:15 +0100
commitf8c12eca80b1faa65f130dfc64c303dcf88a3ac9 (patch)
tree85e37ea75d6739aad765a118cfb79d04c48507c5 /writerfilter/source
parent86be3422cd55fa9e44104f1628648061bb6a3495 (diff)
tdf#120344 DOCX: fix font style of numbering
(numbers and letters) when list items use different font type by direct formatting, solving also the mixed and changing numbering style during editing. Change-Id: I7ebf125bb1b67cbb33078a4e218798e7ffc06260 Co-Author: Balázs Nádasdy (NISZ) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86277 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index f55282f3df4f..33290f276be6 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -203,11 +203,15 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetProperties(bool bDefaults)
return aLevelProps;
}
-static bool IgnoreForCharStyle(const OUString& aStr)
+static bool IgnoreForCharStyle(const OUString& aStr, const bool bIsSymbol)
{
//Names found in PropertyIds.cxx, Lines 56-396
return (aStr=="Adjust" || aStr=="IndentAt" || aStr=="FirstLineIndent"
- || aStr=="FirstLineOffset" || aStr=="LeftMargin" || aStr=="CharFontName"
+ || aStr=="FirstLineOffset" || aStr=="LeftMargin"
+ || aStr=="CharInteropGrabBag" || aStr=="ParaInteropGrabBag" ||
+ // We need font names when they are different for the bullet and for the text.
+ // But leave symbols alone, we only want to keep the font style for letters and numbers.
+ (bIsSymbol && aStr=="CharFontName")
);
}
uno::Sequence< beans::PropertyValue > ListLevel::GetCharStyleProperties( )
@@ -217,13 +221,10 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetCharStyleProperties( )
uno::Sequence< beans::PropertyValue > vPropVals = PropertyMap::GetPropertyValues();
beans::PropertyValue* aValIter = vPropVals.begin();
beans::PropertyValue* aEndIter = vPropVals.end();
+ const bool bIsSymbol(m_sBulletChar.getLength() <= 1);
for( ; aValIter != aEndIter; ++aValIter )
- {
- if (IgnoreForCharStyle(aValIter->Name))
- continue;
- else if ( aValIter->Name != "CharInteropGrabBag" && aValIter->Name != "ParaInteropGrabBag" )
+ if (! IgnoreForCharStyle(aValIter->Name, bIsSymbol))
rProperties.emplace_back(aValIter->Name, 0, aValIter->Value, beans::PropertyState_DIRECT_VALUE);
- }
return comphelper::containerToSequence(rProperties);
}