summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-04-21 22:45:48 +0200
committerLászló Németh <nemeth@numbertext.org>2021-05-05 13:48:48 +0200
commit134fb0fdecb898b1568f57e8c9dc8c3528b0d1e0 (patch)
tree18ced39f503a19d34bf92c7f8d77c7ba9afde92b /svx
parentb8c5236b444a9fbb1d419b95faf2ab2a71913efe (diff)
tdf#141935 svx cui: apply line cap setting of line styles
Only line dash pattern of the selected line style was applied on the selected line or shape using the 1) Line Style popup menu of Drawing toolbar and sidebar pane Properties and 2) Style popup menu of Line pane of Line setting dialog window. Now both line dash and line cap settings are applied, supporting the usage of the new "rounded" preset styles and the old not "rounded" versions. Follow-up to commit b9b2c6a98fec798fc0ec76ec3cd407724f19dcac "tdf#141933 add preset dash styles with round cap". Change-Id: Ib3f64afcdcb50545166d40476a03a4b45f7d0b8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114461 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/linectrl.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 509b54c1d786..1771e2f74649 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -34,6 +34,7 @@
#include <svx/drawitem.hxx>
#include <svx/xlineit0.hxx>
+#include <svx/xlncapit.hxx>
#include <svx/xlndsit.hxx>
#include <svx/xlnstit.hxx>
#include <svx/xlnedit.hxx>
@@ -615,6 +616,18 @@ IMPL_LINK_NOARG(SvxLineBox, SelectHdl, ValueSet*, void)
aLineDashItem.QueryValue ( a );
aArgs[0].Value = a;
mxControl->dispatchLineStyleCommand(".uno:LineDash", aArgs);
+
+ // set also cap style using the toolbar line style selection popup
+ css::drawing::DashStyle eStyle = pEntry->GetDash().GetDashStyle();
+ XLineCapItem aLineCapItem(
+ eStyle == drawing::DashStyle_RECT || eStyle == drawing::DashStyle_RECTRELATIVE
+ ? css::drawing::LineCap_BUTT
+ : css::drawing::LineCap_ROUND );
+ Sequence< PropertyValue > aArgs2( 1 );
+ aArgs2[0].Name = "LineCap";
+ aLineCapItem.QueryValue ( a );
+ aArgs2[0].Value = a;
+ mxControl->dispatchLineStyleCommand(".uno:LineCap", aArgs2);
}
}
break;