summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/doctempl.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-30 17:01:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-05-02 13:18:57 +0200
commit34f7e618ddd3399d9e7f3998e25545256255d02d (patch)
treefd946f8f2ab8386db89f531d49fae1718a21e943 /sfx2/source/doc/doctempl.cxx
parentc881756fcfdc1fa63ff534bf4538d551b2139515 (diff)
untranslated strings are just strings
removes starmaths InsertCommand in favour of InsertCommandText Change-Id: I5659adcaa28e5b5861d1a1cc5d2afa84009490f6 Reviewed-on: https://gerrit.libreoffice.org/37113 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source/doc/doctempl.cxx')
-rw-r--r--sfx2/source/doc/doctempl.cxx36
1 files changed, 21 insertions, 15 deletions
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 3e40d2c3ff36..b743ba2ecc76 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -88,6 +88,7 @@ using namespace ::ucbhelper;
#include <sfx2/sfxresid.hxx>
#include <sfx2/templatelocnames.hrc>
#include "doc.hrc"
+#include "strings.hxx"
#include <sfx2/fcontnr.hxx>
#include <svtools/templatefoldercache.hxx>
@@ -468,25 +469,32 @@ OUString SfxDocumentTemplates::GetTemplateTargetURLFromComponent( const OUString
}
-/** Convert a resource string - a template name - to its localised pair if it exists.
- @param nSourceResIds
- Resource ID where the list of original en-US template names begin.
- @param nDestResIds
- Resource ID where the list of localised template names begin.
- @param nCount
- The number of names that have been localised.
+/** Convert a template name to its localised pair if it exists.
@param rString
Name to be translated.
@return
The localised pair of rString or rString if the former does not exist.
*/
-OUString SfxDocumentTemplates::ConvertResourceString (
- int nSourceResIds, int nDestResIds, int nCount, const OUString& rString )
+OUString SfxDocumentTemplates::ConvertResourceString(const OUString& rString)
{
- for( int i = 0; i < nCount; ++i )
+ static const OUStringLiteral aTemplateNames[] =
{
- if( rString == SFX2_RESSTR(nSourceResIds + i))
- return SFX2_RESSTR(nDestResIds + i);
+ STR_TEMPLATE_NAME1_DEF,
+ STR_TEMPLATE_NAME2_DEF,
+ STR_TEMPLATE_NAME3_DEF,
+ STR_TEMPLATE_NAME4_DEF,
+ STR_TEMPLATE_NAME5_DEF,
+ STR_TEMPLATE_NAME6_DEF,
+ STR_TEMPLATE_NAME7_DEF,
+ STR_TEMPLATE_NAME8_DEF,
+ STR_TEMPLATE_NAME9_DEF,
+ STR_TEMPLATE_NAME10_DEF
+ };
+
+ for (int i = 0; i < NUM_TEMPLATE_NAMES; ++i)
+ {
+ if (rString == aTemplateNames[i])
+ return SFX2_RESSTR(STR_TEMPLATE_NAME1 + i);
}
return rString;
}
@@ -1202,13 +1210,11 @@ void SfxDocumentTemplates::ReInitFromComponent()
pImp->ReInitFromComponent();
}
-
DocTempl_EntryData_Impl::DocTempl_EntryData_Impl( RegionData_Impl* pParent,
const OUString& rTitle )
{
mpParent = pParent;
- maTitle = SfxDocumentTemplates::ConvertResourceString(
- STR_TEMPLATE_NAME1_DEF, STR_TEMPLATE_NAME1, NUM_TEMPLATE_NAMES, rTitle );
+ maTitle = SfxDocumentTemplates::ConvertResourceString(rTitle);
}