summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2022-11-03 16:10:11 +0100
committerLászló Németh <nemeth@numbertext.org>2022-11-14 12:15:01 +0100
commit1b167f3e0b1afec7c257f458db7505d8d8f177b3 (patch)
treefc1931af02f61ad890325b39e4e45075ccaecfdc /oox
parent2d7db6981e5087507c02bde6c0841c388cfaad0f (diff)
tdf#142291 PPTX export: fix table border styles
Export border style subset used by the PPTX import, ::table::BorderLineStyle::SOLID, DOTTED, DASHED, DASH_DOT and DASH_DOT_DOT. See also tablecell.cxx:applyLineAttributes(). Change-Id: I5e4d631f7ca410beb76155579ea5b21a6eb66350 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142240 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/source/export/shapes.cxx27
1 files changed, 26 insertions, 1 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index d102880af7bd..88be4362b228 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -24,6 +24,7 @@
#include <filter/msfilter/util.hxx>
#include <o3tl/string_view.hxx>
+#include <o3tl/any.hxx>
#include <oox/core/xmlfilterbase.hxx>
#include <oox/export/shapes.hxx>
#include <oox/export/utils.hxx>
@@ -65,6 +66,7 @@
#include <com/sun/star/presentation/ClickAction.hpp>
#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
#include <com/sun/star/container/XIdentifierAccess.hpp>
+#include <com/sun/star/table/BorderLineStyle.hpp>
#include <tools/globname.hxx>
#include <comphelper/classids.hxx>
#include <comphelper/propertysequence.hxx>
@@ -2290,7 +2292,30 @@ void ShapeExport::WriteBorderLine(const sal_Int32 XML_line, const BorderLine2& r
mpFS->singleElementNS(XML_a, XML_noFill);
else
DrawingML::WriteSolidFill( ::Color(ColorTransparency, rBorderLine.Color) );
- mpFS->endElementNS( XML_a, XML_line );
+
+ OUString sBorderStyle;
+ sal_Int16 nStyle = rBorderLine.LineStyle;
+ mAny.setValue(&nStyle, cppu::UnoType<sal_Int16>::get());
+ switch (*o3tl::doAccess<sal_Int16>(mAny))
+ {
+ case ::table::BorderLineStyle::SOLID:
+ sBorderStyle = "solid";
+ break;
+ case ::table::BorderLineStyle::DOTTED:
+ sBorderStyle = "dot";
+ break;
+ case ::table::BorderLineStyle::DASHED:
+ sBorderStyle = "dash";
+ break;
+ case ::table::BorderLineStyle::DASH_DOT:
+ sBorderStyle = "dashDot";
+ break;
+ case ::table::BorderLineStyle::DASH_DOT_DOT:
+ sBorderStyle = "sysDashDotDot";
+ break;
+ }
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, sBorderStyle);
+ mpFS->endElementNS(XML_a, XML_line);
}
else if( nBorderWidth == 0)
{