summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2021-11-19 12:23:41 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-11-30 10:07:47 +0100
commit5d0f0d1a70a0b001be9db95d85f1d33a5f23f13f (patch)
tree841552b8768dd064a27de08582e4789be0c8a664 /writerfilter/source
parent843a82a1f5b3c6a220c4fdb70ae03b6ccaf592ac (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> (cherry picked from commit 7b8ae6f90c37c18ff724c0751b5f73cca6ae02ac) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125999 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'writerfilter/source')
-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()