diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-20 15:36:57 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-20 16:46:33 +0100 |
commit | 418800e2e8d6b2c1b2723a7b066aca27abe8f5f8 (patch) | |
tree | bdd307049a69afb2aed4610d2921a7160eccedeb /writerfilter | |
parent | d8680de7012fb92a393066c957f82e1473b60575 (diff) |
DOCX import: handle wp14:sizeRelH/V relativeFrom=margin
No explicit code for this was necessary in case for TextFrames, but for
drawinglayer shapes the default is relativeFrom=page. To keep things
simpler, just always set these, regardless what the LO default is.
Change-Id: I9f651d7cce4a12ce7f545e42656b92d078a74327
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 2009bf54c851..3bccb1c986cd 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -754,16 +754,17 @@ void GraphicImport::lcl_attribute(Id nName, Value & val) switch (nIntValue) { case NS_ooxml::LN_ST_SizeRelFromH_margin: + if (m_xShape.is()) + { + uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY); + xPropertySet->setPropertyValue("RelativeWidthRelation", uno::makeAny(text::RelOrientation::FRAME)); + } break; case NS_ooxml::LN_ST_SizeRelFromH_page: if (m_xShape.is()) { - uno::Reference<lang::XServiceInfo> xServiceInfo(m_xShape, uno::UNO_QUERY_THROW); - if (xServiceInfo->supportsService("com.sun.star.text.TextFrame")) - { - uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY); - xPropertySet->setPropertyValue("RelativeWidthRelation", uno::makeAny(text::RelOrientation::PAGE_FRAME)); - } + uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY); + xPropertySet->setPropertyValue("RelativeWidthRelation", uno::makeAny(text::RelOrientation::PAGE_FRAME)); } break; default: @@ -777,16 +778,17 @@ void GraphicImport::lcl_attribute(Id nName, Value & val) switch (nIntValue) { case NS_ooxml::LN_ST_SizeRelFromV_margin: + if (m_xShape.is()) + { + uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY); + xPropertySet->setPropertyValue("RelativeHeightRelation", uno::makeAny(text::RelOrientation::FRAME)); + } break; case NS_ooxml::LN_ST_SizeRelFromV_page: if (m_xShape.is()) { - uno::Reference<lang::XServiceInfo> xServiceInfo(m_xShape, uno::UNO_QUERY_THROW); - if (xServiceInfo->supportsService("com.sun.star.text.TextFrame")) - { - uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY); - xPropertySet->setPropertyValue("RelativeHeightRelation", uno::makeAny(text::RelOrientation::PAGE_FRAME)); - } + uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY); + xPropertySet->setPropertyValue("RelativeHeightRelation", uno::makeAny(text::RelOrientation::PAGE_FRAME)); } break; default: |