[Libreoffice-commits] core.git: oox/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Dec 2 03:09:12 PST 2013
oox/source/shape/WpsContext.cxx | 15 +++++++++++++++
1 file changed, 15 insertions(+)
New commits:
commit 86bee0cb9d6c610a297d03e71107ca06f94fc3f1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Dec 2 11:49:10 2013 +0100
DOCX drawingML shape import: handle inset attrs for sw text frames
When the drawingML shape import is enabled by default, testFdo66929
(from CppunitTest_sw_ooxmlexport) fails without this.
Change-Id: I38fc64201aaf28ae2e07e57c498a64391ac56f07
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 5c2a145..c5d233e 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -68,6 +68,21 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken
xPropertySet->setPropertyValue("CharRotation", uno::makeAny(sal_Int16(900)));
}
}
+
+ // Handle inset attributes for Writer textframes.
+ sal_Int32 aInsets[] = { XML_lIns, XML_tIns, XML_rIns, XML_bIns };
+ boost::optional<sal_Int32> oInsets[4];
+ for (size_t i = 0; i < SAL_N_ELEMENTS(aInsets); ++i)
+ {
+ OptValue<OUString> oValue = rAttribs.getString(aInsets[i]);
+ if (oValue.has())
+ oInsets[i] = oox::drawingml::GetCoordinate(oValue.get());
+ }
+ OUString aProps[] = { OUString("LeftBorderDistance"), OUString("TopBorderDistance"), OUString("RightBorderDistance"), OUString("BottomBorderDistance") };
+ uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY);
+ for (size_t i = 0; i < SAL_N_ELEMENTS(aProps); ++i)
+ if (oInsets[i])
+ xPropertySet->setPropertyValue(aProps[i], uno::makeAny(*oInsets[i]));
}
break;
case XML_txbx:
More information about the Libreoffice-commits
mailing list