summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2021-11-19 12:23:41 +0100
committerLászló Németh <nemeth@numbertext.org>2021-11-29 10:54:39 +0100
commit7b8ae6f90c37c18ff724c0751b5f73cca6ae02ac (patch)
tree64e64bd74aee738a71c8e1c5af966b5a656c9f15 /writerfilter
parent26bd14e43d7d5e81c97085f12abf1523d03bdf9a (diff)
tdf#97899 DOCX import: allow character formatting only of numbering
After the DOCX round-trip of a numbering created in Writer using direct formatting (e.g. using Toggle Ordered/Unordered List icons), it was not possible to format only the numbering or bullets, e.g. selecting and formatting them by positioning the text cursor on the numbering. Set CharStyleName property during the DOCX import to allow this formatting. Note: default list styles of Writer is still not supported, resulting missing numbering after DOCX import. Change-Id: I6f2c5d6e0d63b15e9c28367181af1e9e083ae68d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125649 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 61dbea4a5563..8829aa52697f 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -568,16 +568,15 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
lcl_mergeProperties( rAbsCharStyleProps, rCharStyleProps );
}
- if( aAbsCharStyleProps.hasElements() )
- {
- // Change the sequence into a vector
- auto aStyleProps = comphelper::sequenceToContainer<PropertyValueVector_t>(aAbsCharStyleProps);
-
- //create (or find) a character style containing the character
- // attributes of the symbol and apply it to the numbering level
- OUString sStyle = rDMapper.getOrCreateCharStyle( aStyleProps, /*bAlwaysCreate=*/true );
- aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_CHAR_STYLE_NAME), sStyle));
- }
+ // Change the sequence into a vector
+ auto aStyleProps
+ = comphelper::sequenceToContainer<PropertyValueVector_t>(aAbsCharStyleProps);
+
+ //create (or find) a character style containing the character
+ // attributes of the symbol and apply it to the numbering level
+ OUString sStyle = rDMapper.getOrCreateCharStyle(aStyleProps, /*bAlwaysCreate=*/true);
+ aLvlProps.push_back(
+ comphelper::makePropertyValue(getPropertyName(PROP_CHAR_STYLE_NAME), sStyle));
OUString sText = pAbsLevel
? pAbsLevel->GetBulletChar()