[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 3 18:11:41 UTC 2019


 sc/source/ui/formdlg/dwfunctr.cxx |   16 ++++++++++++++++
 sc/source/ui/inc/dwfunctr.hxx     |   20 +++++++++++++++++++-
 2 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit fad3923c32b58c401aa2497734ba03b6a6d64ec6
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 3 14:32:14 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 3 20:10:07 2019 +0200

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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


More information about the Libreoffice-commits mailing list