diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-02 11:49:10 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-02 12:08:48 +0100 |
commit | 86bee0cb9d6c610a297d03e71107ca06f94fc3f1 (patch) | |
tree | 5aec4036e11f4b8056fc125a62daffdf78a22c48 /oox | |
parent | e239f372c6abcd8371d0a666c828bf1c31195dd4 (diff) |
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
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/shape/WpsContext.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
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<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: |