summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
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/view
parente58dfb62106fc047d73ad0d62595ebc805ece5e1 (diff)
ManageNames: make pasting of multiple names working and fix crash
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/cellsh1.cxx11
-rw-r--r--sc/source/ui/view/editsh.cxx15
2 files changed, 22 insertions, 4 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index a8f5cba3dcc4..0aab1e5b9908 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1838,7 +1838,16 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pScMod->InputKeyEvent( KeyEvent('=',KeyCode()) );
std::vector<rtl::OUString> aNames = pDlg->GetSelectedNames();
- pHdl->InsertFunction( aNames.at(0), false ); // without "()"
+ if (aNames.size())
+ {
+ rtl::OUStringBuffer aBuffer;
+ for (std::vector<rtl::OUString>::const_iterator itr = aNames.begin();
+ itr != aNames.end(); ++itr)
+ {
+ aBuffer.append(*itr).append(' ');
+ }
+ pHdl->InsertFunction( aBuffer.makeStringAndClear(), false ); // without "()"
+ }
}
}
break;
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 15bc31eb8bac..9a1eff383f8b 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -440,9 +440,18 @@ void ScEditShell::Execute( SfxRequest& rReq )
if ( nRet == BTN_PASTE_NAME )
{
std::vector<rtl::OUString> aNames = pDlg->GetSelectedNames();
- pTableView->InsertText(aNames.at(0));
- if (pTopView)
- pTopView->InsertText(aNames.at(0));
+ if (aNames.size())
+ {
+ rtl::OUStringBuffer aBuffer;
+ for (std::vector<rtl::OUString>::const_iterator itr = aNames.begin();
+ itr != aNames.end(); ++itr)
+ {
+ aBuffer.append(*itr).append(' ');
+ }
+ pTableView->InsertText(aBuffer.toString());
+ if (pTopView)
+ pTopView->InsertText(aBuffer.makeStringAndClear());
+ }
}
delete pDlg;