diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-04-11 11:19:56 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-04-14 03:13:23 +0200 |
commit | 02c902bde09984a87f19ac0eb63942724056c982 (patch) | |
tree | c72c2522ffd8922b3bd154f2e3e6d7e9b31ed044 /writerfilter/source/dmapper/DomainMapper_Impl.cxx | |
parent | 996d264dd4ca37c869e5109296de6ae306f740d9 (diff) |
tdf#154703 docx export framePr: merge para/frame FormatBox
Now that export knows about both frame and para border spacing,
we can remove an import hack.
When exporting the paragraph properties, not only do the direct
border settings and the paragraph styles settings apply,
but also (uniquely for framePr) do the frame properties.
The most significant property is the border spacing.
On import only the paragraph keeps the spacing
(with the purpose of keeping paragraph shading looking right)
and the frames itself has no border spacing.
[That is also good, because the frame size
is specified as the size without border spacing,
and LO does not expand the frame when borders spacing is added.]
One exception of course is if the user adds spacing during editing.
Another (theoretical) situation comes during an ODT->DOCX export.
Fortunately, both of these situations should be handled by just
adding the frame and paragraph properties together.
It is emulation, but it seems to work pretty good.
I modified the unit test from
7.1 commit 49e2bd6103669ca94d4e308fc08beed57f85c7e2
Author: Tibor Nagy on Mon Aug 10 10:51:20 2020 +0200
tdf#131420 DOCX export: fix missing border of frame
because we should _not_ have two pBdr entries,
just one, non-empty entry.
Table import and export are already a mess.
See ooxmpexort5's fdo 60957-2.docx for a great example,
and tdf104394_lostTextbox.docx is also fascinatingly complex.
Change-Id: I011100ee2790de6b8573d6a8bc99b9455f65e76d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150242
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index f76ca11b01a1..07a475485eca 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1563,10 +1563,9 @@ static void lcl_MoveBorderPropertiesToFrame(std::vector<beans::PropertyValue>& r xTextRangeProperties->setPropertyValue( sPropertyName, uno::Any(table::BorderLine2())); else if (nProperty > 5) { - // Do not duplicate the top/bottom border spacing. - // [NOTE: left/right need to be duplicated because of INVERT_BORDER_SPACING] - // Hack: a minimal distance is given so left/right shading extends to the edge. - xTextRangeProperties->setPropertyValue( sPropertyName, uno::Any(sal_Int32(1))); + // Do not duplicate the top6/bottom7 border spacing. + // left4/right5 need to be duplicated because of INVERT_BORDER_SPACING + aValue.Value <<= sal_Int32(0); } if (aValue.Value.hasValue()) rFrameProperties.push_back(aValue); |