From 134fb0fdecb898b1568f57e8c9dc8c3528b0d1e0 Mon Sep 17 00:00:00 2001 From: László Németh Date: Wed, 21 Apr 2021 22:45:48 +0200 Subject: tdf#141935 svx cui: apply line cap setting of line styles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: László Németh --- svx/source/tbxctrls/linectrl.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'svx/source') 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 #include +#include #include #include #include @@ -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; -- cgit v1.2.3