Kaydet (Commit) ebebaf70 authored tarafından Rafael Dominguez's avatar Rafael Dominguez

Display correct region name in error messages.

Change-Id: I1e3eddf9be2a75faabf0b0be91f30d7e8d43d3e4
üst e9300181
......@@ -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>
......
......@@ -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();
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment