summaryrefslogtreecommitdiff
path: root/chart2/source/tools
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2020-07-27 21:55:05 +0200
committerRegina Henschel <rb.henschel@t-online.de>2020-08-06 13:10:14 +0200
commit74be8bb787a44464957e5d3105c8de6d36e81b4a (patch)
tree390e2feb729f68226f2f55f62942837118b122ed /chart2/source/tools
parenta814825461b1fc26288655535b64fc38b18ecf15 (diff)
tdf#135184 add linecaps in charts
Chart is currently not able to interpret property linecap. But in case of linecap 'round' or 'square', line dashes lengths are adapted so that they look same as in MS Office (tdf#134053). This does not work, if the corresponding linecap property is not interpreted. Dashed border of data labels is not fixed because of bug tdf#135366. In addition I have fixed errors in prstDash detection, which I have noticed while creating unit tests. The unit tests cover file text, not visual appearence. Change-Id: I8cf2d2b2fc0923c2882f8148b4550bc363270480 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99562 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'chart2/source/tools')
-rw-r--r--chart2/source/tools/LinePropertiesHelper.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/chart2/source/tools/LinePropertiesHelper.cxx b/chart2/source/tools/LinePropertiesHelper.cxx
index 227ec99b6383..7e6d28860903 100644
--- a/chart2/source/tools/LinePropertiesHelper.cxx
+++ b/chart2/source/tools/LinePropertiesHelper.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/LineDash.hpp>
+#include <com/sun/star/drawing/LineCap.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
#include <tools/diagnose_ex.h>
@@ -79,6 +80,12 @@ void LinePropertiesHelper::AddPropertiesToVector(
cppu::UnoType<drawing::LineJoint>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT );
+
+ rOutProperties.emplace_back( "LineCap",
+ PROP_LINE_CAP,
+ cppu::UnoType<drawing::LineCap>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
}
void LinePropertiesHelper::AddDefaultsToMap(
@@ -89,6 +96,7 @@ void LinePropertiesHelper::AddDefaultsToMap(
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINE_COLOR, 0x000000 ); // black
::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_LINE_TRANSPARENCE, 0 );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_JOINT, drawing::LineJoint_ROUND );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_CAP, drawing::LineCap_BUTT );
}
bool LinePropertiesHelper::IsLineVisible( const css::uno::Reference<