diff options
author | Matus Uzak <matus.uzak@gmail.com> | 2016-04-13 02:00:03 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-04-29 10:57:47 +0000 |
commit | f9c8651506adddad4941fe08e9e76a78d14a9fe0 (patch) | |
tree | 0deda8792d2aee0a1f2602e6e2e62fc4de571bfd /oox | |
parent | d6ffb7405d3267f1e76aed7a5e3162b8700f6817 (diff) |
tdf#90736: PPTX import: Improved table border line style support
Map preset line dash values from ooxml to the smaller set of LO's
predefined table border line styles. Map custom dashing scheme
to a simple dashed line style.
Change-Id: Ia81d94cb7e20b05f1c2cc0c20c8ad398c5613d6c
Reviewed-on: https://gerrit.libreoffice.org/24048
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/table/tablecell.cxx | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index 4df26bbc1e41..9a569505aeb1 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/table/XTable.hpp> #include <com/sun/star/table/XMergeableCellRange.hpp> +#include <com/sun/star/table/BorderLineStyle.hpp> #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/drawing/TextVerticalAdjust.hpp> @@ -72,7 +73,7 @@ void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase, sal_Int32 nPropId ) { BorderLine2 aBorderLine; - if( rLineProperties.maLineFill.moFillType.differsFrom( XML_noFill )) + if ( rLineProperties.maLineFill.moFillType.differsFrom( XML_noFill )) { Color aColor = rLineProperties.maLineFill.getBestSolidColor(); aBorderLine.Color = aColor.getColor( rFilterBase.getGraphicHelper() ); @@ -91,6 +92,45 @@ void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase, aBorderLine.LineDistance = 0; } + if ( rLineProperties.moPresetDash.has() ) + { + switch ( rLineProperties.moPresetDash.get() ) + { + case XML_dot: + case XML_sysDot: + aBorderLine.LineStyle = ::table::BorderLineStyle::DOTTED; + break; + case XML_dash: + case XML_lgDash: + case XML_sysDash: + aBorderLine.LineStyle = ::table::BorderLineStyle::DASHED; + break; + case XML_dashDot: + case XML_lgDashDot: + case XML_sysDashDot: + aBorderLine.LineStyle = ::table::BorderLineStyle::DASH_DOT; + break; + case XML_lgDashDotDot: + case XML_sysDashDotDot: + aBorderLine.LineStyle = ::table::BorderLineStyle::DASH_DOT_DOT; + break; + case XML_solid: + aBorderLine.LineStyle = ::table::BorderLineStyle::SOLID; + break; + default: + aBorderLine.LineStyle = ::table::BorderLineStyle::DASHED; + break; + } + } + else if ( !rLineProperties.maCustomDash.empty() ) + { + aBorderLine.LineStyle = ::table::BorderLineStyle::DASHED; + } + else + { + aBorderLine.LineStyle = ::table::BorderLineStyle::NONE; + } + PropertySet aPropSet( rxPropSet ); aPropSet.setProperty( nPropId, aBorderLine ); } |