summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-01-06 11:44:43 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2021-01-11 14:02:08 +0100
commit2dd29409d8a70fba4d393652d8879c8a9acd0d48 (patch)
treeab04391b429e5004f35bc352223ee1abad005cfe
parenta3a674f62ab284eab6eb5c52756e130f32c5c725 (diff)
lok: send chart line width updates
Change-Id: I4c9c4a977df12a1cefb81cfbcac73b61ff26e488 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108843 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108925 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--chart2/source/controller/sidebar/ChartLinePanel.cxx21
-rw-r--r--chart2/source/controller/sidebar/ChartLinePanel.hxx2
-rw-r--r--include/svx/sidebar/LinePropertyPanelBase.hxx5
-rw-r--r--svx/source/sidebar/line/LinePropertyPanelBase.cxx2
4 files changed, 27 insertions, 3 deletions
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx
index daf6045b244f..6436b9184acb 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -26,6 +26,10 @@
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
+#include <comphelper/lok.hxx>
+#include <sfx2/viewsh.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
namespace chart { namespace sidebar {
namespace {
@@ -203,6 +207,11 @@ void ChartLinePanel::updateData()
XLineStyleItem aStyleItem(eStyle);
updateLineStyle(false, true, &aStyleItem);
+ sal_uInt32 nWidth;
+ xPropSet->getPropertyValue("LineWidth") >>= nWidth;
+ XLineWidthItem aWidthItem(nWidth);
+ updateLineWidth(false, true, &aWidthItem);
+
css::uno::Any aLineDashName = xPropSet->getPropertyValue("LineDashName");
OUString aDashName;
aLineDashName >>= aDashName;
@@ -330,6 +339,18 @@ void ChartLinePanel::setLineWidth(const XLineWidthItem& rItem)
xPropSet->setPropertyValue("LineWidth", css::uno::Any(rItem.GetValue()));
}
+void ChartLinePanel::updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem)
+{
+ LinePropertyPanelBase::updateLineWidth(bDisabled, bSetOrDefault, pItem);
+
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (comphelper::LibreOfficeKit::isActive() && pViewShell)
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+ (".uno:LineWidth=" + std::to_string(mnWidthCoreValue)).c_str());
+ }
+}
+
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.hxx b/chart2/source/controller/sidebar/ChartLinePanel.hxx
index c0b3d19fd579..f04571ef9c00 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.hxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.hxx
@@ -73,6 +73,8 @@ protected:
virtual void setLineJoint(const XLineJointItem* pItem) override;
virtual void setLineCap(const XLineCapItem* pItem) override;
+ virtual void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem) override;
+
private:
css::uno::Reference<css::frame::XModel> mxModel;
diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx
index 2def46e3b524..3154a9444e53 100644
--- a/include/svx/sidebar/LinePropertyPanelBase.hxx
+++ b/include/svx/sidebar/LinePropertyPanelBase.hxx
@@ -94,7 +94,7 @@ protected:
void updateLineStyle(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineDash(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
- void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
+ virtual void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineStart(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineEnd(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
@@ -115,6 +115,8 @@ protected:
VclPtr<sfx2::sidebar::SidebarToolBox> mpTBColor;
+ sal_Int32 mnWidthCoreValue;
+
private:
//ui controls
VclPtr<FixedText> mpFTWidth;
@@ -136,7 +138,6 @@ private:
sal_uInt16 mnTrans;
MapUnit meMapUnit;
- sal_Int32 mnWidthCoreValue;
XLineEndListRef mxLineEndList;
XDashListRef mxLineStyleList;
std::unique_ptr<XLineStartItem> mpStartItem;
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 75a703949610..79df3a88a460 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -166,11 +166,11 @@ LinePropertyPanelBase::LinePropertyPanelBase(
vcl::Window* pParent,
const uno::Reference<css::frame::XFrame>& rxFrame)
: PanelLayout(pParent, "LinePropertyPanel", "svx/ui/sidebarline.ui", rxFrame),
+ mnWidthCoreValue(0),
mpStyleItem(),
mpDashItem(),
mnTrans(0),
meMapUnit(MapUnit::MapMM),
- mnWidthCoreValue(0),
mpStartItem(),
mpEndItem(),
mxLineWidthPopup(VclPtr<LineWidthPopup>::Create(*this)),