summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/app/inputwin.cxx30
-rw-r--r--sc/source/ui/inc/inputwin.hxx8
2 files changed, 22 insertions, 16 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index f9d76b365959..feceafffbe2b 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2334,19 +2334,13 @@ OUString ScPosWnd::createLocalRangeName(std::u16string_view rName, std::u16strin
void ScPosWnd::FillRangeNames()
{
- m_xWidget->clear();
- m_xWidget->freeze();
-
+ std::set<OUString> aSet;
SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( auto pDocShell = dynamic_cast<ScDocShell*>( pObjSh) )
+ if (auto pDocShell = dynamic_cast<ScDocShell*>(pObjSh))
{
ScDocument& rDoc = pDocShell->GetDocument();
- m_xWidget->append_text(ScResId(STR_MANAGE_NAMES));
- m_xWidget->append_separator(u"separator"_ustr);
-
ScRange aDummy;
- std::set<OUString> aSet;
ScRangeName* pRangeNames = rDoc.GetRangeName();
for (const auto& rEntry : *pRangeNames)
{
@@ -2367,14 +2361,24 @@ void ScPosWnd::FillRangeNames()
}
}
}
+ }
- for (const auto& rItem : aSet)
- {
- m_xWidget->append_text(rItem);
- }
+ if (aSet == aRangeNames && !aSet.empty())
+ return;
+
+ aRangeNames = aSet;
+
+ m_xWidget->clear();
+ m_xWidget->freeze();
+ m_xWidget->append_text(ScResId(STR_MANAGE_NAMES));
+ m_xWidget->append_separator(u"separator"_ustr);
+ for (const auto& rItem : aSet)
+ {
+ m_xWidget->append_text(rItem);
}
m_xWidget->thaw();
- m_xWidget->set_entry_text(aPosStr);
+ if (!aPosStr.isEmpty())
+ m_xWidget->set_entry_text(aPosStr);
}
void ScPosWnd::FillFunctions()
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 832a37356424..1c5d5b73962f 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -19,6 +19,7 @@
#pragma once
+#include <set>
#include <vector>
#include <memory>
#include <vcl/customweld.hxx>
@@ -167,9 +168,10 @@ private:
ImplSVEvent* m_nAsyncGetFocusId;
- OUString aPosStr;
- void* nTipVisible;
- bool bFormulaMode;
+ OUString aPosStr;
+ void* nTipVisible;
+ bool bFormulaMode;
+ std::set<OUString> aRangeNames;
public:
ScPosWnd(vcl::Window* pParent, ScTabViewShell* pViewSh);