diff options
4 files changed, 27 insertions, 3 deletions
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx index 3ae57de73739..019b022bd1a3 100644 --- a/chart2/source/controller/sidebar/ChartLinePanel.cxx +++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx @@ -24,6 +24,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::sidebar { namespace { @@ -189,6 +193,11 @@ void ChartLinePanel::updateData() XLineTransparenceItem aLineTransparenceItem(nLineTransparence); updateLineTransparence(false, true, &aLineTransparenceItem); + sal_uInt32 nWidth; + xPropSet->getPropertyValue("LineWidth") >>= nWidth; + XLineWidthItem aWidthItem(nWidth); + updateLineWidth(false, true, &aWidthItem); + maLineStyleWrapper.updateData(); maLineColorWrapper.updateData(); } @@ -274,6 +283,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 2f703839a22c..ef174a5ee3a9 100644 --- a/chart2/source/controller/sidebar/ChartLinePanel.hxx +++ b/chart2/source/controller/sidebar/ChartLinePanel.hxx @@ -67,6 +67,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 cd924e6b8a8f..52411be57d2c 100644 --- a/include/svx/sidebar/LinePropertyPanelBase.hxx +++ b/include/svx/sidebar/LinePropertyPanelBase.hxx @@ -77,7 +77,7 @@ protected: virtual void setLineCap(const XLineCapItem* pItem) = 0; 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 updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem); void updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem); @@ -93,6 +93,8 @@ protected: std::unique_ptr<weld::Toolbar> mxLineStyleTB; std::unique_ptr<ToolbarUnoDispatcher> mxLineStyleDispatch; + sal_Int32 mnWidthCoreValue; + private: //ui controls std::unique_ptr<weld::Label> mxFTWidth; @@ -112,7 +114,6 @@ private: sal_uInt16 mnTrans; MapUnit meMapUnit; - sal_Int32 mnWidthCoreValue; // images from resource OUString maIMGNone; diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 287a8f90343e..594d56924e5b 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -72,6 +72,7 @@ LinePropertyPanelBase::LinePropertyPanelBase( mxColorDispatch(new ToolbarUnoDispatcher(*mxTBColor, *m_xBuilder, rxFrame)), mxLineStyleTB(m_xBuilder->weld_toolbar("linestyle")), mxLineStyleDispatch(new ToolbarUnoDispatcher(*mxLineStyleTB, *m_xBuilder, rxFrame)), + mnWidthCoreValue(0), mxFTWidth(m_xBuilder->weld_label("widthlabel")), mxTBWidth(m_xBuilder->weld_toolbar("width")), mxFTTransparency(m_xBuilder->weld_label("translabel")), @@ -86,7 +87,6 @@ LinePropertyPanelBase::LinePropertyPanelBase( mxLineStyleNoneChange(new LineStyleNoneChange(*this)), mnTrans(0), meMapUnit(MapUnit::MapMM), - mnWidthCoreValue(0), maIMGNone(BMP_NONE_ICON), mbWidthValuable(true), mbArrowSupported(true), |