summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorSzabolcs Toth <szabolcs450@gmail.com>2020-06-04 15:43:42 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-06-25 12:17:27 +0200
commit5451833f3af5582a8cab7e4b3da402f083f56908 (patch)
tree57e362bc8969d098f16c36b2dfa111e4b161f2d4 /writerfilter
parente2ec8e1f3fac6fc0a426b5735ad21371c68760ae (diff)
tdf#132976 DOCX import: fix shape width relative to left margin
using UNO API RelativeWidthRelation and the associated lo-ext attribute for OpenDocument export. See commit 43d7f4e3640c5e370fd1204739c2b0c7eb5f40e4 (offapi: document the 4 new properties which are no longer read-only). Co-authored-by: Balázs Regényi Change-Id: I2dada8ad764a1fba33d241117cc4bc5eddae74ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95525 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 7380905abc0833d9e4c4fe731d76174db8a8724c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96998 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 73333b23e790..d7128080dfeb 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -945,6 +945,16 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
xPropertySet->setPropertyValue("RelativeWidthRelation", uno::makeAny(text::RelOrientation::FRAME));
}
break;
+ case NS_ooxml::LN_ST_SizeRelFromH_leftMargin:
+ if (m_xShape.is())
+ {
+ // Here we handle the relative size of the width of some shape.
+ // The size of the shape's width is going to be relative to the size of the left margin.
+ // E.g.: (left margin = 8 && relative size = 150%) -> width of some shape = 12.
+ uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY);
+ xPropertySet->setPropertyValue("RelativeWidthRelation", uno::makeAny(text::RelOrientation::PAGE_LEFT));
+ }
+ break;
case NS_ooxml::LN_ST_SizeRelFromH_page:
if (m_xShape.is())
{