summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-10 17:00:49 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-10 17:46:55 +0200
commit2b076a0d91ade62e678d42eb61153bf4de4531a2 (patch)
treeadae432a778c46ef46168e09b35fff4db6e55eb8 /oox
parent2c5b3e7764d7d3213d3448c3c6c424a19d0c837c (diff)
DOCX drawingML export of textboxes: write <wps:bodyPr> in oox
It's possible to write this tag in oox (so it represents the properties of the shape) or in sw (so it represents the properties of the shape's textbox). Do the previous, as the textbox is really just a container in this use case, nothing more. If we are at it, also fix the default value of <wps:bodyPr>'s l/r/t/bIns attributes. Change-Id: I0571b9d8ea7dc0acd5c61f3e28e18400d305eab3
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/shapes.cxx1
-rw-r--r--oox/source/shape/WpsContext.cxx3
2 files changed, 4 insertions, 0 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 7c3627e24fe4..02b005baeed8 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -822,6 +822,7 @@ ShapeExport& ShapeExport::WriteTextBox( Reference< XInterface > xIface, sal_Int3
if (xPropertySetInfo->hasPropertyByName("TextBox") && xPropertySet->getPropertyValue("TextBox").get<bool>())
{
GetTextExport()->WriteTextBox(uno::Reference<drawing::XShape>(xIface, uno::UNO_QUERY_THROW));
+ WriteText( xIface, /*bBodyPr=*/true, /*bText=*/false, /*nXmlNamespace=*/nXmlNamespace );
return *this;
}
}
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 90628b2f0c18..0163a506c69b 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -86,6 +86,9 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken
OptValue<OUString> oValue = rAttribs.getString(aInsets[i]);
if (oValue.has())
oInsets[i] = oox::drawingml::GetCoordinate(oValue.get());
+ else
+ // Defaults from the spec: left/right: 91440 EMU, top/bottom: 45720 EMU
+ oInsets[i] = (aInsets[i] == XML_lIns || aInsets[i] == XML_rIns) ? 254 : 127;
}
OUString aProps[] = { OUString("LeftBorderDistance"), OUString("TopBorderDistance"), OUString("RightBorderDistance"), OUString("BottomBorderDistance") };
OUString aShapeProps[] = { OUString("TextLeftDistance"), OUString("TextUpperDistance"), OUString("TextRightDistance"), OUString("TextLowerDistance") };