diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2013-04-07 21:46:11 -0430 |
---|---|---|
committer | Rafael Dominguez <venccsralph@gmail.com> | 2013-04-09 10:40:07 -0430 |
commit | ebebaf709af8bdfaf65cb7747c38fadc9ca02259 (patch) | |
tree | 7caec4c02d761fcf929162ba6c0a3b8c2d5c7ddf /sfx2 | |
parent | e93001816144dbc6edcbaffdb076c8a3d5cf05e1 (diff) |
Display correct region name in error messages.
Change-Id: I1e3eddf9be2a75faabf0b0be91f30d7e8d43d3e4
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/templatelocalview.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/templatelocalview.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 6 |
3 files changed, 16 insertions, 3 deletions
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx index bd1b43130230..6cefaf1782c0 100644 --- a/sfx2/inc/sfx2/templatelocalview.hxx +++ b/sfx2/inc/sfx2/templatelocalview.hxx @@ -50,6 +50,8 @@ public: OUString getRegionName(const sal_uInt16 nRegionId) const; + OUString getRegionItemName(const sal_uInt16 nItemId) const; + std::vector<OUString> getFolderNames (); std::vector<TemplateItemProperties> diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index b07359e3fc4a..5defbbf46ffd 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -194,6 +194,17 @@ OUString TemplateLocalView::getRegionName(const sal_uInt16 nRegionId) const return mpDocTemplates->GetRegionName(nRegionId); } +OUString TemplateLocalView::getRegionItemName(const sal_uInt16 nItemId) const +{ + for (size_t i = 0; i < maRegions.size(); ++i) + { + if (maRegions[i]->mnId == nItemId) + return maRegions[i]->maTitle; + } + + return OUString(); +} + std::vector<OUString> TemplateLocalView::getFolderNames() { size_t n = maRegions.size(); diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index b53aee3831de..d5894546d13b 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -1490,7 +1490,7 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId) aTemplateList = aTemplateList + "\n" + (*pIter)->maTitle; } - OUString aDst = maView->GetItemText(nItemId); + OUString aDst = maView->getRegionItemName(nItemId); OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString()); aMsg = aMsg.replaceFirst("$1",aDst); ErrorBox(this, WB_OK,aMsg.replaceFirst( "$2",aTemplateList)).Execute(); @@ -1546,7 +1546,7 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId) { OUString aMsg(SfxResId(STR_MSG_ERROR_REMOTE_MOVE).toString()); aMsg = aMsg.replaceFirst("$1",mpOnlineView->getCurRegionName()); - aMsg = aMsg.replaceFirst("$2",maView->GetItemText(nItemId)); + aMsg = aMsg.replaceFirst("$2",maView->getRegionItemName(nItemId)); ErrorBox(this,WB_OK,aMsg.replaceFirst("$1",aTemplateList)).Execute(); } } @@ -1600,7 +1600,7 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId) if (!aTemplateList.isEmpty()) { - OUString aDst = maView->GetItemText(nItemId); + OUString aDst = maView->getRegionItemName(nItemId); OUString aMsg(SfxResId(STR_MSG_ERROR_LOCAL_MOVE).toString()); aMsg = aMsg.replaceFirst("$1",aDst); ErrorBox(this, WB_OK,aMsg.replaceFirst( "$2",aTemplateList)).Execute(); |