summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/doctempl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc/doctempl.cxx')
-rw-r--r--sfx2/source/doc/doctempl.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index d28d0e6c5c..dc72cb573e 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -94,6 +94,7 @@ using namespace ::ucbhelper;
#include "sfxtypes.hxx"
#include <sfx2/app.hxx>
#include "sfx2/sfxresid.hxx"
+#include <sfx2/templatelocnames.hrc>
#include "doc.hrc"
#include <sfx2/fcontnr.hxx>
#include <svtools/templatefoldercache.hxx>
@@ -151,6 +152,8 @@ class DocTempl_EntryData_Impl
private:
RegionData_Impl* GetParent() const { return mpParent; }
+ OUString ConvertResourceString(
+ int nSourceResIds, int nDestResIds, int nCount, const OUString& rString );
public:
DocTempl_EntryData_Impl( RegionData_Impl* pParent,
@@ -1761,12 +1764,27 @@ DocTempl_EntryData_Impl::DocTempl_EntryData_Impl( RegionData_Impl* pParent,
const OUString& rTitle )
{
mpParent = pParent;
- maTitle = rTitle;
+ maTitle = ConvertResourceString(
+ STR_TEMPLATE_NAME1_DEF, STR_TEMPLATE_NAME1, NUM_TEMPLATE_NAMES, rTitle );
mbIsOwner = sal_False;
mbDidConvert= sal_False;
}
// -----------------------------------------------------------------------
+OUString DocTempl_EntryData_Impl::ConvertResourceString (
+ int nSourceResIds, int nDestResIds, int nCount, const OUString& rString )
+{
+ for( int i = 0; i < nCount; ++i )
+ {
+ if( rString == ResId::toString( (const ResId)SfxResId( (sal_uInt16)(nSourceResIds + i) ) ) )
+ {
+ return ResId::toString( (const ResId)SfxResId( (sal_uInt16)(nDestResIds + i) ) );
+ }
+ }
+ return rString;
+}
+
+// -----------------------------------------------------------------------
int DocTempl_EntryData_Impl::Compare( const OUString& rTitle ) const
{
return maTitle.compareTo( rTitle );