Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3300
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/00/3300/1
Display correct region name in error messages.
Change-Id: Icf4149272f67df6681bdad711362dd7d3802d04a
---
M sfx2/inc/sfx2/templatelocalview.hxx
M sfx2/source/control/templatelocalview.cxx
M sfx2/source/doc/templatedlg.cxx
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx
index 2e7e400..09b69ce 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -50,6 +50,8 @@
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 a4437c3..884897c 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -194,6 +194,17 @@
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 948de70..6f78ebe 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1467,7 +1467,7 @@
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();
@@ -1523,7 +1523,7 @@
{
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();
}
}
@@ -1577,7 +1577,7 @@
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();
--
To view, visit https://gerrit.libreoffice.org/3300
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf4149272f67df6681bdad711362dd7d3802d04a
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Rafael Dominguez <venccsralph@gmail.com>
Context
- [PATCH libreoffice-4-0] Display correct region name in error messages. · Rafael Dominguez (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.