summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-10 11:27:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-10 14:01:25 +0100
commit248ceefbbc3be28f7192b986d5d34985106268e1 (patch)
tree3cf842b2efe86785e1589cee35e097890d7d4a9a /svx
parentb4365b985178e1866c74afd757a104aad1d405a9 (diff)
Resolves: tdf#138789 disable widgets on 'none' when status changes
instead of when chage is dispatched, the chart case has its own dispatcher that disables the base class one. This fixes the reported problem, and the related problem of updating when moving focus from one line that has style 'none' to one that doesn't, and vice-versa, where no change is dispached on received on context change Change-Id: I6afb396e75ba93c13fcae71c52618cfce7f9cecb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107524 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sidebar/line/LinePropertyPanelBase.cxx18
-rw-r--r--svx/source/tbxctrls/linectrl.cxx9
2 files changed, 15 insertions, 12 deletions
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 2738f1fc4023..f1b49ebde5c1 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -36,26 +36,20 @@ const char SELECTWIDTH[] = "SelectWidth";
namespace svx::sidebar {
// trigger disabling the arrows if the none line style is selected
-class DisableArrowsWrapper
+class LineStyleNoneChange
{
private:
LinePropertyPanelBase& m_rPanel;
public:
- DisableArrowsWrapper(LinePropertyPanelBase& rPanel)
+ LineStyleNoneChange(LinePropertyPanelBase& rPanel)
: m_rPanel(rPanel)
{
}
- bool operator()(std::u16string_view rCommand, const css::uno::Any& rValue)
+ void operator()(bool bLineStyleNone)
{
- if (rCommand == u".uno:XLineStyle")
- {
- css::drawing::LineStyle eLineStyle(css::drawing::LineStyle_NONE);
- rValue >>= eLineStyle;
- m_rPanel.SetNoneLineStyle(eLineStyle == css::drawing::LineStyle_NONE);
- }
- return false;
+ m_rPanel.SetNoneLineStyle(bLineStyleNone);
}
};
@@ -89,7 +83,7 @@ LinePropertyPanelBase::LinePropertyPanelBase(
mxGridLineProps(m_xBuilder->weld_widget("lineproperties")),
mxBoxArrowProps(m_xBuilder->weld_widget("arrowproperties")),
mxLineWidthPopup(new LineWidthPopup(mxTBWidth.get(), *this)),
- mxDisableArrowsWrapper(new DisableArrowsWrapper(*this)),
+ mxLineStyleNoneChange(new LineStyleNoneChange(*this)),
mnTrans(0),
meMapUnit(MapUnit::MapMM),
mnWidthCoreValue(0),
@@ -150,7 +144,7 @@ void LinePropertyPanelBase::Initialize()
mxLBCapStyle->connect_changed( LINK( this, LinePropertyPanelBase, ChangeCapStyleHdl ) );
SvxLineStyleToolBoxControl* pLineStyleControl = getLineStyleToolBoxControl(*mxLineStyleDispatch);
- pLineStyleControl->setLineStyleSelectFunction(*mxDisableArrowsWrapper);
+ pLineStyleControl->setLineStyleIsNoneFunction(*mxLineStyleNoneChange);
}
void LinePropertyPanelBase::updateLineTransparence(bool bDisabled, bool bSetOrDefault,
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 5123db3f4bf7..895558d12f20 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -96,6 +96,7 @@ void SAL_CALL SvxLineStyleToolBoxControl::statusChanged( const frame::FeatureSta
XDashListRef xList = pItem->GetDashList();
int nIndex = m_xBtnUpdater->GetStyleIndex();
+ bool bNoneLineStyle = false;
switch (nIndex)
{
case -1:
@@ -110,6 +111,7 @@ void SAL_CALL SvxLineStyleToolBoxControl::statusChanged( const frame::FeatureSta
}
else
pToolBox->SetItemImage(nId, Image(aEmpty));
+ bNoneLineStyle = true;
break;
}
case 1:
@@ -131,6 +133,8 @@ void SAL_CALL SvxLineStyleToolBoxControl::statusChanged( const frame::FeatureSta
pToolBox->SetItemImage(nId, Image(xList->GetUiBitmap(nIndex - 2)));
break;
}
+ if (m_aLineStyleIsNoneFunction)
+ m_aLineStyleIsNoneFunction(bNoneLineStyle);
}
void SAL_CALL SvxLineStyleToolBoxControl::execute(sal_Int16 /*KeyModifier*/)
@@ -173,6 +177,11 @@ void SvxLineStyleToolBoxControl::setLineStyleSelectFunction(const LineStyleSelec
m_aLineStyleSelectFunction = rLineStyleSelectFunction;
}
+void SvxLineStyleToolBoxControl::setLineStyleIsNoneFunction(const LineStyleIsNoneFunction& rLineStyleIsNoneFunction)
+{
+ m_aLineStyleIsNoneFunction = rLineStyleIsNoneFunction;
+}
+
void SvxLineStyleToolBoxControl::dispatchLineStyleCommand(const OUString& rCommand, const Sequence<PropertyValue>& rArgs)
{
if (m_aLineStyleSelectFunction && m_aLineStyleSelectFunction(rCommand, rArgs[0].Value))