summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorPeter Rabi <prabi@caesar.elte.hu>2011-07-22 15:32:43 +0200
committerAndras Timar <atimar@suse.com>2011-07-22 21:57:31 +0200
commitabec2797a9657380d8bd6ef7eda1219744f2edd6 (patch)
treefead146b2424ee6b920ede0b024f3a347fecff51 /sfx2
parent5c10e9985ca589e182db1a9436ca6570d222e5f3 (diff)
Bugfix fdo#32895 : un-translated template names (part 2/2)
Contributed under license LGPLv3+/MPL.
Diffstat (limited to 'sfx2')
-rwxr-xr-xsfx2/AllLangResTarget_sfx2.mk1
-rwxr-xr-xsfx2/Package_inc.mk1
-rw-r--r--sfx2/inc/sfx2/templatelocnames.hrc81
-rw-r--r--sfx2/source/doc/doctempl.cxx20
-rw-r--r--sfx2/source/doc/templatelocnames.src281
5 files changed, 383 insertions, 1 deletions
diff --git a/sfx2/AllLangResTarget_sfx2.mk b/sfx2/AllLangResTarget_sfx2.mk
index 77691fe880..665d53f6fe 100755
--- a/sfx2/AllLangResTarget_sfx2.mk
+++ b/sfx2/AllLangResTarget_sfx2.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_SrsTarget_add_files,sfx/res,\
sfx2/source/doc/docvor.src \
sfx2/source/doc/graphhelp.src \
sfx2/source/doc/new.src \
+ sfx2/source/doc/templatelocnames.src \
sfx2/source/menu/menu.src \
sfx2/source/view/view.src \
))
diff --git a/sfx2/Package_inc.mk b/sfx2/Package_inc.mk
index 5731762932..53b7cf9c42 100755
--- a/sfx2/Package_inc.mk
+++ b/sfx2/Package_inc.mk
@@ -128,6 +128,7 @@ $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/tabdlg.hxx,sfx2/tabdlg.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/taskpane.hxx,sfx2/taskpane.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/tbxctrl.hxx,sfx2/tbxctrl.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templdlg.hxx,sfx2/templdlg.hxx))
+$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/templatelocnames.hrc,sfx2/templatelocnames.hrc))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/titledockwin.hxx,sfx2/titledockwin.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/tplpitem.hxx,sfx2/tplpitem.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/unoctitm.hxx,sfx2/unoctitm.hxx))
diff --git a/sfx2/inc/sfx2/templatelocnames.hrc b/sfx2/inc/sfx2/templatelocnames.hrc
new file mode 100644
index 0000000000..f8034ed181
--- /dev/null
+++ b/sfx2/inc/sfx2/templatelocnames.hrc
@@ -0,0 +1,81 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Péter Rabi <prabi@caesar.elte.hu>
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#define NUM_TEMPLATE_NAMES 25
+#define TEMPL_LOC_OFFSET 2190
+
+#define STR_TEMPLATE_NAME1_DEF (TEMPL_LOC_OFFSET + 1)
+#define STR_TEMPLATE_NAME2_DEF (TEMPL_LOC_OFFSET + 2)
+#define STR_TEMPLATE_NAME3_DEF (TEMPL_LOC_OFFSET + 3)
+#define STR_TEMPLATE_NAME4_DEF (TEMPL_LOC_OFFSET + 4)
+#define STR_TEMPLATE_NAME5_DEF (TEMPL_LOC_OFFSET + 5)
+#define STR_TEMPLATE_NAME6_DEF (TEMPL_LOC_OFFSET + 6)
+#define STR_TEMPLATE_NAME7_DEF (TEMPL_LOC_OFFSET + 7)
+#define STR_TEMPLATE_NAME8_DEF (TEMPL_LOC_OFFSET + 8)
+#define STR_TEMPLATE_NAME9_DEF (TEMPL_LOC_OFFSET + 9)
+#define STR_TEMPLATE_NAME10_DEF (TEMPL_LOC_OFFSET + 10)
+#define STR_TEMPLATE_NAME11_DEF (TEMPL_LOC_OFFSET + 11)
+#define STR_TEMPLATE_NAME12_DEF (TEMPL_LOC_OFFSET + 12)
+#define STR_TEMPLATE_NAME13_DEF (TEMPL_LOC_OFFSET + 13)
+#define STR_TEMPLATE_NAME14_DEF (TEMPL_LOC_OFFSET + 14)
+#define STR_TEMPLATE_NAME15_DEF (TEMPL_LOC_OFFSET + 15)
+#define STR_TEMPLATE_NAME16_DEF (TEMPL_LOC_OFFSET + 16)
+#define STR_TEMPLATE_NAME17_DEF (TEMPL_LOC_OFFSET + 17)
+#define STR_TEMPLATE_NAME18_DEF (TEMPL_LOC_OFFSET + 18)
+#define STR_TEMPLATE_NAME19_DEF (TEMPL_LOC_OFFSET + 19)
+#define STR_TEMPLATE_NAME20_DEF (TEMPL_LOC_OFFSET + 20)
+#define STR_TEMPLATE_NAME21_DEF (TEMPL_LOC_OFFSET + 21)
+#define STR_TEMPLATE_NAME22_DEF (TEMPL_LOC_OFFSET + 22)
+#define STR_TEMPLATE_NAME23_DEF (TEMPL_LOC_OFFSET + 23)
+#define STR_TEMPLATE_NAME24_DEF (TEMPL_LOC_OFFSET + 24)
+#define STR_TEMPLATE_NAME25_DEF (TEMPL_LOC_OFFSET + 25)
+
+#define STR_TEMPLATE_NAME1 (TEMPL_LOC_OFFSET + 51)
+#define STR_TEMPLATE_NAME2 (TEMPL_LOC_OFFSET + 52)
+#define STR_TEMPLATE_NAME3 (TEMPL_LOC_OFFSET + 53)
+#define STR_TEMPLATE_NAME4 (TEMPL_LOC_OFFSET + 54)
+#define STR_TEMPLATE_NAME5 (TEMPL_LOC_OFFSET + 55)
+#define STR_TEMPLATE_NAME6 (TEMPL_LOC_OFFSET + 56)
+#define STR_TEMPLATE_NAME7 (TEMPL_LOC_OFFSET + 57)
+#define STR_TEMPLATE_NAME8 (TEMPL_LOC_OFFSET + 58)
+#define STR_TEMPLATE_NAME9 (TEMPL_LOC_OFFSET + 59)
+#define STR_TEMPLATE_NAME10 (TEMPL_LOC_OFFSET + 60)
+#define STR_TEMPLATE_NAME11 (TEMPL_LOC_OFFSET + 61)
+#define STR_TEMPLATE_NAME12 (TEMPL_LOC_OFFSET + 62)
+#define STR_TEMPLATE_NAME13 (TEMPL_LOC_OFFSET + 63)
+#define STR_TEMPLATE_NAME14 (TEMPL_LOC_OFFSET + 64)
+#define STR_TEMPLATE_NAME15 (TEMPL_LOC_OFFSET + 65)
+#define STR_TEMPLATE_NAME16 (TEMPL_LOC_OFFSET + 66)
+#define STR_TEMPLATE_NAME17 (TEMPL_LOC_OFFSET + 67)
+#define STR_TEMPLATE_NAME18 (TEMPL_LOC_OFFSET + 68)
+#define STR_TEMPLATE_NAME19 (TEMPL_LOC_OFFSET + 69)
+#define STR_TEMPLATE_NAME20 (TEMPL_LOC_OFFSET + 70)
+#define STR_TEMPLATE_NAME21 (TEMPL_LOC_OFFSET + 71)
+#define STR_TEMPLATE_NAME22 (TEMPL_LOC_OFFSET + 72)
+#define STR_TEMPLATE_NAME23 (TEMPL_LOC_OFFSET + 73)
+#define STR_TEMPLATE_NAME24 (TEMPL_LOC_OFFSET + 74)
+#define STR_TEMPLATE_NAME25 (TEMPL_LOC_OFFSET + 75)
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 );
diff --git a/sfx2/source/doc/templatelocnames.src b/sfx2/source/doc/templatelocnames.src
new file mode 100644
index 0000000000..9b977554a4
--- /dev/null
+++ b/sfx2/source/doc/templatelocnames.src
@@ -0,0 +1,281 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Péter Rabi <prabi@caesar.elte.hu>
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <sfx2/templatelocnames.hrc>
+
+// Do not translate STR_TEMPLATE_NAME*_DEF names!!
+String STR_TEMPLATE_NAME1_DEF
+{
+ Text = "Blue Border" ;
+};
+
+String STR_TEMPLATE_NAME2_DEF
+{
+ Text = "Black and White" ;
+};
+
+String STR_TEMPLATE_NAME3_DEF
+{
+ Text = "Blue and Grey" ;
+};
+
+String STR_TEMPLATE_NAME4_DEF
+{
+ Text = "Blue Lines and Gradients" ;
+};
+
+String STR_TEMPLATE_NAME5_DEF
+{
+ Text = "Blue with Bottom Title" ;
+};
+
+String STR_TEMPLATE_NAME6_DEF
+{
+ Text = "Notebook" ;
+};
+
+String STR_TEMPLATE_NAME7_DEF
+{
+ Text = "Brown" ;
+};
+
+String STR_TEMPLATE_NAME8_DEF
+{
+ Text = "Characters with Glow" ;
+};
+
+String STR_TEMPLATE_NAME9_DEF
+{
+ Text = "Forest" ;
+};
+
+String STR_TEMPLATE_NAME10_DEF
+{
+ Text = "Fresco" ;
+};
+
+String STR_TEMPLATE_NAME11_DEF
+{
+ Text = "Glacier" ;
+};
+
+String STR_TEMPLATE_NAME12_DEF
+{
+ Text = "Green with White Lines" ;
+};
+
+String STR_TEMPLATE_NAME13_DEF
+{
+ Text = "Keyboard" ;
+};
+
+String STR_TEMPLATE_NAME14_DEF
+{
+ Text = "Light Blue Shapes" ;
+};
+
+String STR_TEMPLATE_NAME15_DEF
+{
+ Text = "Numbers on Dark Background" ;
+};
+
+String STR_TEMPLATE_NAME16_DEF
+{
+ Text = "Blue Step Gradients" ;
+};
+
+String STR_TEMPLATE_NAME17_DEF
+{
+ Text = "White Blue and Lightnings" ;
+};
+
+String STR_TEMPLATE_NAME18_DEF
+{
+ Text = "Noise Paper" ;
+};
+
+String STR_TEMPLATE_NAME19_DEF
+{
+ Text = "Red Noise Shapes" ;
+};
+
+String STR_TEMPLATE_NAME20_DEF
+{
+ Text = "Rounded Rectangles" ;
+};
+
+String STR_TEMPLATE_NAME21_DEF
+{
+ Text = "Blue and Red Gradient" ;
+};
+
+String STR_TEMPLATE_NAME22_DEF
+{
+ Text = "Technical Polygon" ;
+};
+
+String STR_TEMPLATE_NAME23_DEF
+{
+ Text = "Tunnel" ;
+};
+
+String STR_TEMPLATE_NAME24_DEF
+{
+ Text = "Water" ;
+};
+
+String STR_TEMPLATE_NAME25_DEF
+{
+ Text = "Wine" ;
+};
+
+/////////////////////////////////////////////////
+
+String STR_TEMPLATE_NAME1
+{
+ Text [ en-US ] = "Blue Border" ;
+};
+
+String STR_TEMPLATE_NAME2
+{
+ Text [ en-US ] = "Black and White" ;
+};
+
+String STR_TEMPLATE_NAME3
+{
+ Text [ en-US ] = "Blue and Grey" ;
+};
+
+String STR_TEMPLATE_NAME4
+{
+ Text [ en-US ] = "Blue Lines and Gradients" ;
+};
+
+String STR_TEMPLATE_NAME5
+{
+ Text [ en-US ] = "Blue with Bottom Title" ;
+};
+
+String STR_TEMPLATE_NAME6
+{
+ Text [ en-US ] = "Notebook" ;
+};
+
+String STR_TEMPLATE_NAME7
+{
+ Text [ en-US ] = "Brown" ;
+};
+
+String STR_TEMPLATE_NAME8
+{
+ Text [ en-US ] = "Characters with Glow" ;
+};
+
+String STR_TEMPLATE_NAME9
+{
+ Text [ en-US ] = "Forest" ;
+};
+
+String STR_TEMPLATE_NAME10
+{
+ Text [ en-US ] = "Fresco" ;
+};
+
+String STR_TEMPLATE_NAME11
+{
+ Text [ en-US ] = "Glacier" ;
+};
+
+String STR_TEMPLATE_NAME12
+{
+ Text [ en-US ] = "Green with White Lines" ;
+};
+
+String STR_TEMPLATE_NAME13
+{
+ Text [ en-US ] = "Keyboard" ;
+};
+
+String STR_TEMPLATE_NAME14
+{
+ Text [ en-US ] = "Light Blue Shapes" ;
+};
+
+String STR_TEMPLATE_NAME15
+{
+ Text [ en-US ] = "Numbers on Dark Background" ;
+};
+
+String STR_TEMPLATE_NAME16
+{
+ Text [ en-US ] = "Blue Step Gradients" ;
+};
+
+String STR_TEMPLATE_NAME17
+{
+ Text [ en-US ] = "White Blue and Lightnings" ;
+};
+
+String STR_TEMPLATE_NAME18
+{
+ Text [ en-US ] = "Noise Paper" ;
+};
+
+String STR_TEMPLATE_NAME19
+{
+ Text [ en-US ] = "Red Noise Shapes" ;
+};
+
+String STR_TEMPLATE_NAME20
+{
+ Text [ en-US ] = "Rounded Rectangles" ;
+};
+
+String STR_TEMPLATE_NAME21
+{
+ Text [ en-US ] = "Blue and Red Gradient" ;
+};
+
+String STR_TEMPLATE_NAME22
+{
+ Text [ en-US ] = "Technical Polygon" ;
+};
+
+String STR_TEMPLATE_NAME23
+{
+ Text [ en-US ] = "Tunnel" ;
+};
+
+String STR_TEMPLATE_NAME24
+{
+ Text [ en-US ] = "Water" ;
+};
+
+String STR_TEMPLATE_NAME25
+{
+ Text [ en-US ] = "Wine" ;
+};