diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-08-12 14:10:31 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-08-15 11:14:38 +0200 |
commit | 6f42a2c8631bace1caa4fac0b3ea554942f1fca3 (patch) | |
tree | 964b9482aebd4c4dbb19028d6e5d06676008be0b /writerfilter | |
parent | f6a0ca0e92e41ad8fea71acdacdc7ec5e775dc59 (diff) |
tdf#150382 writerfilter,sw: RTF import of paragraph border override
The style (default unnamed \s0, applied via \pard) defines green
borders, which are overridden at the 2nd paragraph and cleared.
Of course there isn't a single border control word to be found on the
2nd paragraph, the override happens by omitting the borders of the
implicitly applied style.
Hence handle LN_CT_PrBase_pBdr in getDefaultSPRM().
The export of the override relies on changes from commit
967a03eb8760fb498c5ea6c32d03d1eea486bbe2.
Change-Id: I081eb2908d76123e7828cab6c31ceb7b11760183
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138193
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfsprm.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index 2edfec829edf..90bc97001d27 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -199,6 +199,22 @@ static RTFValue::Pointer_t getDefaultSPRM(Id const id, Id nStyleType) // presumably this means 100%, cf. static const int nSingleLineSpacing = 240; return new RTFValue(240); + case NS_ooxml::LN_CT_PrBase_pBdr: + { // tdf#150382 default all paragraph borders to none + RTFSprms attributes; + RTFSprms sprms; + for (int i = 0; i < 4; ++i) + { + auto const nBorder = getParagraphBorder(i); + RTFSprms aAttributes; + RTFSprms aSprms; + aAttributes.set(NS_ooxml::LN_CT_Border_val, + new RTFValue(NS_ooxml::LN_Value_ST_Border_none)); + sprms.set(nBorder, new RTFValue(aAttributes, aSprms)); + } + return new RTFValue(attributes, sprms); + } + default: break; } |