summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2024-03-06 18:56:55 -0500
committerMiklos Vajna <vmiklos@collabora.com>2024-03-11 09:47:34 +0100
commit8192ed8c0e0e474ef631f7012577fb2821708b52 (patch)
tree346639b8fe5d1fa82588575ec1961ff3d2a84b93 /writerfilter
parent14451b801029e8efc05d7f777692a91eddab9e16 (diff)
tdf#160077 writerfilter: shape vertRelation is FRAME for layoutinCell
When layoutInCell is active, then the offset must be applied against the paragraph instead of the page or page margins. There were only two unit tests that matched this, and both were off-sheet positioned. -tdf151704_thinColumnHeight.docx -tdf92157.docx make CppunitTest_sw_ooxmlexport21 \ CPPUNIT_TEST_NAME=testTdf160077_layoutInCell Change-Id: I28241136c0c0be12d3f2dd876550ecdf91b0009c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164514 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164585 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 46a5da451226..9b0f161d2f94 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1263,6 +1263,19 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
if (m_pImpl->m_nWrap == text::WrapTextMode_THROUGH && m_pImpl->m_nHoriRelation == text::RelOrientation::FRAME)
{
+ if (m_pImpl->m_bLayoutInCell && m_pImpl->m_rDomainMapper.IsInTable()
+ && (m_pImpl->m_nVertRelation == text::RelOrientation::PAGE_FRAME
+ || m_pImpl->m_nVertRelation == text::RelOrientation::PAGE_PRINT_AREA))
+ {
+ // Impossible to be page-oriented when layout in cell.
+ // Since we are turning LayoutInCell off (to simplify layout),
+ // we need to set the orientation to the paragraph,
+ // as MSO effectively does when it forces layoutInCell.
+ // Probably also needs to happen with TEXT_LINE,
+ // but MSO is really weird with vertical relation to "line"
+ m_pImpl->m_nVertRelation = text::RelOrientation::FRAME;
+ }
+
// text::RelOrientation::FRAME is OOXML's "column", which behaves as if
// layout-in-cell would be always off.
m_pImpl->m_bLayoutInCell = false;