From 86bee0cb9d6c610a297d03e71107ca06f94fc3f1 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 2 Dec 2013 11:49:10 +0100 Subject: 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 --- oox/source/shape/WpsContext.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index 5c2a145d3618..c5d233eedcb6 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 oInsets[4]; + for (size_t i = 0; i < SAL_N_ELEMENTS(aInsets); ++i) + { + OptValue 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 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: -- cgit