summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx26
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: