diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-03 14:32:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-03 20:10:07 +0200 |
commit | fad3923c32b58c401aa2497734ba03b6a6d64ec6 (patch) | |
tree | bb0d028bce7f0a743ed282855fc5aba0d9d84116 /sc | |
parent | dfe5ca213443415cbbcbe8968a4a872cc003c5be (diff) |
Resolves: tdf#120209 reload names if setting for their language changes
Change-Id: I386a598ae680c90e7d31bf821e7fb58391e5d45c
Reviewed-on: https://gerrit.libreoffice.org/80130
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/formdlg/dwfunctr.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/inc/dwfunctr.hxx | 20 |
2 files changed, 35 insertions, 1 deletions
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index bc99704c9dbc..76edb39ccd0d 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -47,6 +47,8 @@ ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame> &rFrame) : PanelLayout(pParent, "FunctionPanel", "modules/scalc/ui/functionpanel.ui", rFrame) + , xConfigListener(new comphelper::ConfigurationListener("/org.openoffice.Office.Calc/Formula/Syntax")) + , xConfigChange(std::make_unique<EnglishFunctionNameChange>(xConfigListener, this)) , pFuncDesc(nullptr) { get(aCatBox, "category"); @@ -99,6 +101,12 @@ ScFunctionWin::~ScFunctionWin() void ScFunctionWin::dispose() { + if (xConfigChange) + { + xConfigChange.reset(); + xConfigListener->dispose(); + xConfigListener.clear(); + } aCatBox.clear(); aFuncList.clear(); aInsertButton.clear(); @@ -412,9 +420,17 @@ IMPL_LINK_NOARG( ScFunctionWin, SetSelectionClickHdl, Button*, void ) { DoEnter(); // saves the input } + IMPL_LINK_NOARG( ScFunctionWin, SetSelectionHdl, ListBox&, void ) { DoEnter(); // saves the input } +void EnglishFunctionNameChange::setProperty(const css::uno::Any &rProperty) +{ + ConfigurationListenerProperty::setProperty(rProperty); + m_xFunctionWin->InitLRUList(); + m_xFunctionWin->UpdateFunctionList(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx index 2be013f2b9a7..3bf7158f5df7 100644 --- a/sc/source/ui/inc/dwfunctr.hxx +++ b/sc/source/ui/inc/dwfunctr.hxx @@ -19,6 +19,7 @@ #ifndef INCLUDED_SC_SOURCE_UI_INC_DWFUNCTR_HXX #define INCLUDED_SC_SOURCE_UI_INC_DWFUNCTR_HXX +#include <comphelper/configurationlistener.hxx> #include <vcl/lstbox.hxx> #include <vcl/button.hxx> #include <svx/sidebar/PanelLayout.hxx> @@ -26,6 +27,21 @@ class ScFuncDesc; namespace formula { class IFunctionDescription; } +class ScFunctionWin; + +class EnglishFunctionNameChange : public comphelper::ConfigurationListenerProperty<bool> +{ + VclPtr<ScFunctionWin> m_xFunctionWin; +protected: + virtual void setProperty(const css::uno::Any &rProperty) override; +public: + EnglishFunctionNameChange(const rtl::Reference<comphelper::ConfigurationListener> &rListener, ScFunctionWin* pFunctionWin) + : ConfigurationListenerProperty(rListener, "EnglishFunctionName") + , m_xFunctionWin(pFunctionWin) + { + } +}; + class ScFunctionWin : public PanelLayout { @@ -35,12 +51,13 @@ private: VclPtr<PushButton> aInsertButton; VclPtr<FixedText> aFiFuncDesc; + rtl::Reference<comphelper::ConfigurationListener> xConfigListener; + std::unique_ptr<EnglishFunctionNameChange> xConfigChange; const ScFuncDesc* pFuncDesc; sal_uInt16 nArgs; ::std::vector< const formula::IFunctionDescription*> aLRUList; - void UpdateFunctionList(); void UpdateLRUList(); void DoEnter(); void SetDescription(); @@ -56,6 +73,7 @@ public: virtual void dispose() override; void InitLRUList(); + void UpdateFunctionList(); }; #endif |