summaryrefslogtreecommitdiff
path: root/sc/source/ui/namedlg
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-23 06:20:06 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-23 06:25:36 +0100
commitab63c12395ed3771b1df6822eaa8572c06db0765 (patch)
tree5b9448bdb43d84f859d4a90224dabd51779bcf68 /sc/source/ui/namedlg
parente58dfb62106fc047d73ad0d62595ebc805ece5e1 (diff)
ManageNames: make pasting of multiple names working and fix crash
Diffstat (limited to 'sc/source/ui/namedlg')
-rw-r--r--sc/source/ui/namedlg/namemgrtable.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx
index a72e765e536b..dc894a093c4b 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -140,7 +140,8 @@ void ScRangeManagerTable::Init(const boost::ptr_map<rtl::OUString, ScRangeName>&
void ScRangeManagerTable::DeleteSelectedEntries()
{
- RemoveSelection();
+ if (GetSelectionCount())
+ RemoveSelection();
}
bool ScRangeManagerTable::IsMultiSelection()
@@ -151,16 +152,19 @@ bool ScRangeManagerTable::IsMultiSelection()
std::vector<ScRangeNameLine> ScRangeManagerTable::GetSelectedEntries()
{
std::vector<ScRangeNameLine> aSelectedEntries;
- for (SvLBoxEntry* pEntry = FirstSelected(); pEntry != LastSelected(); pEntry = NextSelected(pEntry))
+ if (GetSelectionCount())
{
+ for (SvLBoxEntry* pEntry = FirstSelected(); pEntry != LastSelected(); pEntry = NextSelected(pEntry))
+ {
+ ScRangeNameLine aLine;
+ GetLine( aLine, pEntry );
+ aSelectedEntries.push_back(aLine);
+ }
+ SvLBoxEntry* pEntry = LastSelected();
ScRangeNameLine aLine;
GetLine( aLine, pEntry );
aSelectedEntries.push_back(aLine);
}
- SvLBoxEntry* pEntry = LastSelected();
- ScRangeNameLine aLine;
- GetLine( aLine, pEntry );
- aSelectedEntries.push_back(aLine);
return aSelectedEntries;
}