summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2023-03-24 17:35:51 +0300
committerSarper Akdemir <sarper.akdemir@collabora.com>2023-04-17 16:20:18 +0200
commit77655fc3dca05d4bb2366e67ccea228e3886bfe2 (patch)
tree2afd600c70ff8758ff7b228d2082a7f2e1721238 /oox
parent1ccb5a63cd3f16f46c3d8cb7d86374805705804d (diff)
pptx export: consider RotateAngle for tcPr on export
It appears the RotateAngle property is imported, even though it has no effect on how table cell is displayed right now. Let's export the property so that we are able to roundtrip the <a:tcPr vert="vert"> & <a:tcPr vert="vert270"> Change-Id: Idc23f3b0677fdc5ed12fa5494f0f1823bb89683f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149545 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/drawingmltypes.cxx14
-rw-r--r--oox/source/export/shapes.cxx6
2 files changed, 20 insertions, 0 deletions
diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx
index 469029f48071..ff8c46050c15 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
#include <o3tl/string_view.hxx>
+#include <optional>
#include <osl/diagnose.h>
#include <sax/tools/converter.hxx>
#include <oox/token/tokens.hxx>
@@ -376,6 +377,19 @@ const char* GetHatchPattern( const drawing::Hatch& rHatch )
return sPattern;
}
+std::optional<OString> GetTextVerticalType(sal_Int32 nRotateAngle)
+{
+ switch (nRotateAngle)
+ {
+ case 9000:
+ return "vert";
+ case 27000:
+ return "vert270";
+ default:
+ return {};
+ }
+}
+
namespace
{
// ISO/IEC-29500 Part 1 ST_Percentage, and [MS-OI29500] 2.1.1324
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 83d308ca793f..eecd1b38512c 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -2312,7 +2312,13 @@ void ShapeExport::WriteTableCellProperties(const Reference< XPropertySet>& xCell
aVerticalAlignment >>= eVerticalAlignment;
sVerticalAlignment = GetTextVerticalAdjust(eVerticalAlignment);
+ sal_Int32 nRotateAngle = 0;
+ Any aRotateAngle = xCellPropSet->getPropertyValue("RotateAngle");
+ aRotateAngle >>= nRotateAngle;
+ std::optional<OString> aTextVerticalValue = GetTextVerticalType(nRotateAngle);
+
mpFS->startElementNS(XML_a, XML_tcPr, XML_anchor, sVerticalAlignment,
+ XML_vert, aTextVerticalValue,
XML_marL, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)), nLeftMargin > 0),
XML_marR, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRightMargin)), nRightMargin > 0));