summaryrefslogtreecommitdiff
path: root/sc/source/ui/namedlg
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/namedlg')
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx6
-rw-r--r--sc/source/ui/namedlg/namemgrtable.cxx12
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 93456b551433..a3a27147c17b 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -364,7 +364,13 @@ bool ScNameDlg::AddPushed()
void ScNameDlg::SetEntry(const rtl::OUString& rName, const rtl::OUString& rScope)
{
if (!rName.isEmpty())
+ {
mbDataChanged = true;
+ ScRangeNameLine aLine;
+ aLine.aName = rName;
+ aLine.aScope = rScope;
+ mpRangeManagerTable->SetEntry(aLine);
+ }
}
void ScNameDlg::RemovePushed()
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx
index 40bd5aa459e9..99b1ea0367ba 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -209,6 +209,18 @@ std::vector<ScRangeNameLine> ScRangeManagerTable::GetSelectedEntries()
return aSelectedEntries;
}
+void ScRangeManagerTable::SetEntry(const ScRangeNameLine& rLine)
+{
+ for (SvLBoxEntry* pEntry = First(); pEntry; pEntry = Next(pEntry))
+ {
+ if (rLine.aName == rtl::OUString(GetEntryText(pEntry, 0))
+ && rLine.aScope == rtl::OUString(GetEntryText(pEntry, 2)))
+ {
+ SetCurEntry(pEntry);
+ }
+ }
+}
+
namespace {
//ensure that the minimum column size is respected