summaryrefslogtreecommitdiffstats
path: root/oox
diff options
context:
space:
mode:
authorRegényi Balázs <regenyi.balazs@nisz.hu>2020-09-22 17:12:59 +0200
committerLászló Németh <nemeth@numbertext.org>2020-09-29 12:26:25 +0200
commit79737c8b0d84d4967c5f1c41b740a8a52db8b551 (patch)
tree4bd2a23eab371f5a7977408d6ebaf7ae25a7bc61 /oox
parenttdf#80526 DOCX: import word-wrap textbox setting (diff)
downloadcore-79737c8b0d84d4967c5f1c41b740a8a52db8b551.tar.gz
core-79737c8b0d84d4967c5f1c41b740a8a52db8b551.zip
tdf#91251 XLSX textbox export: fix missing overflow properties
by grab-bagging them. Co-authored-by: Szabolcs Toth Change-Id: I242bf33e1272d913805c90a2ef902be8633618fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103182 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/drawingml/textbodyproperties.hxx2
-rw-r--r--oox/source/drawingml/shape.cxx7
-rw-r--r--oox/source/drawingml/textbodypropertiescontext.cxx4
-rw-r--r--oox/source/export/drawingml.cxx19
4 files changed, 28 insertions, 4 deletions
diff --git a/oox/inc/drawingml/textbodyproperties.hxx b/oox/inc/drawingml/textbodyproperties.hxx
index 26e34ac6a5f7..8a51c2bb906e 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -46,6 +46,8 @@ struct TextBodyProperties
sal_Int32 mnNumCol = 1;
/// Normal autofit: font scale (default: 100%).
sal_Int32 mnFontScale = 100000;
+ OUString msHorzOverflow;
+ OUString msVertOverflow;
explicit TextBodyProperties();
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index ddc5a96b8018..5af4d51cbfd4 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1429,6 +1429,13 @@ Reference< XShape > const & Shape::createAndInsert(
degrees anticlockwise. */
mpCustomShapePropertiesPtr->setTextRotateAngle(-1 * nTextRotateAngle / 60000);
}
+
+ auto sHorzOverflow = getTextBody()->getTextProperties().msHorzOverflow;
+ if (!sHorzOverflow.isEmpty())
+ putPropertyToGrabBag("horzOverflow", uno::makeAny(getTextBody()->getTextProperties().msHorzOverflow));
+ auto nVertOverflow = getTextBody()->getTextProperties().msVertOverflow;
+ if (!nVertOverflow.isEmpty())
+ putPropertyToGrabBag("vertOverflow", uno::makeAny(getTextBody()->getTextProperties().msVertOverflow));
}
// Note that the script oox/source/drawingml/customshapes/generatePresetsData.pl looks
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index d3add310097f..6a6d9e90ef63 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -80,9 +80,9 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper cons
mrTextBodyProp.maPropertyMap.setProperty(PROP_FromWordArt, bFromWordArt);
// ST_TextHorzOverflowType
-// sal_Int32 nHorzOverflow = rAttribs.getToken( XML_horzOverflow, XML_overflow );
+ mrTextBodyProp.msHorzOverflow = rAttribs.getString(XML_horzOverflow, "");
// ST_TextVertOverflowType
-// sal_Int32 nVertOverflow = rAttribs.getToken( XML_vertOverflow, XML_overflow );
+ mrTextBodyProp.msVertOverflow = rAttribs.getString(XML_vertOverflow, "");
// ST_TextColumnCount
mrTextBodyProp.mnNumCol = rAttribs.getInteger( XML_numCol, 1 );
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8ea8035ea39a..0612fe56ed43 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2955,18 +2955,31 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
}
bool isUpright = false;
+ std::optional<OUString> sHorzOverflow;
+ std::optional<OUString> sVertOverflow;
if (GetProperty(rXPropSet, "InteropGrabBag"))
{
if (rXPropSet->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"))
{
uno::Sequence<beans::PropertyValue> aGrabBag;
rXPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
- for (auto& aProp : aGrabBag)
+ for (const auto& aProp : std::as_const(aGrabBag))
{
if (aProp.Name == "Upright")
{
aProp.Value >>= isUpright;
- break;
+ }
+ else if (aProp.Name == "horzOverflow")
+ {
+ OUString sValue;
+ aProp.Value >>= sValue;
+ sHorzOverflow = sValue;
+ }
+ else if (aProp.Name == "vertOverflow")
+ {
+ OUString sValue;
+ aProp.Value >>= sValue;
+ sVertOverflow = sValue;
}
}
}
@@ -2974,6 +2987,8 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr,
XML_wrap, pWrap,
+ XML_horzOverflow, sHorzOverflow,
+ XML_vertOverflow, sVertOverflow,
XML_fromWordArt, sax_fastparser::UseIf("1", bFromWordArt),
XML_lIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeft)), nLeft != DEFLRINS),
XML_rIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRight)), nRight != DEFLRINS),