summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2012-08-25 16:13:25 +0200
committerAndras Timar <atimar@suse.com>2012-08-25 16:14:58 +0200
commit90083b70f59570f6576c0257576cb416b7eabbbf (patch)
tree85fd43ec263dd29c3807c50960bf7989cdd304a2 /wizards
parent3766ca46ff3c474ee7c94ad75cba14d6746c3331 (diff)
localize spreadsheet style template names runtime
Change-Id: I16d45284cfb4ab8d239ea5e9a326160a742c4bf1
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/template/Samples.xba31
-rw-r--r--wizards/source/template/template.src187
2 files changed, 205 insertions, 13 deletions
diff --git a/wizards/source/template/Samples.xba b/wizards/source/template/Samples.xba
index 7252c57a1bc9..03f6c68bb107 100644
--- a/wizards/source/template/Samples.xba
+++ b/wizards/source/template/Samples.xba
@@ -21,6 +21,9 @@
Const SAMPLES = 1000
Const STYLES = 1100
+Const STYLENAME_DEF = 1120
+Const STYLENAME = 1150
+Const NumStyles = 18
Const aTempFileName = &quot;Berend_Ilko_Tom_Stella_Volker.stc&quot;
Public Const Twip = 425
Dim oUcbObject as Object
@@ -51,10 +54,10 @@ Dim RValue as Integer
Dim oNewDocument as Object
Dim mFileProperties(1) as New com.sun.star.beans.PropertyValue
PrepareForEditing = NULL
- BasicLibraries.LoadLibrary( &quot;Tools&quot; )
+ BasicLibraries.LoadLibrary( &quot;Tools&quot; )
If InitResources(&quot;&apos;Template&apos;&quot;, &quot;tpl&quot;) then
If IsMissing(oDocument) Then
- oDocument = ThisComponent
+ oDocument = ThisComponent
End If
If oDocument.IsReadOnly then
MMessage = GetResText(SAMPLES)
@@ -89,11 +92,13 @@ Sub ShowStyles
Dim TemplateDir, ActFileTitle, DisplayDummy as String
Dim sFilterName(0) as String
Dim StyleNames() as String
+Dim LocalizedStyleNames(NumStyles,2) As String
+Dim LocalizedStyleName As String
Dim t as Integer
Dim MaxIndex as Integer
- BasicLibraries.LoadLibrary(&quot;Tools&quot;)
+ BasicLibraries.LoadLibrary(&quot;Tools&quot;)
If InitResources(&quot;&apos;Template&apos;&quot;, &quot;tpl&quot;) then
- oDocument = ThisComponent
+ oDocument = ThisComponent
If oDocument.SupportsService(&quot;com.sun.star.sheet.SpreadsheetDocument&quot;) Then
ToggleWindow(False)
oUcbObject = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
@@ -107,8 +112,18 @@ Dim MaxIndex as Integer
DialogModel.Title = GetResText(STYLES)
DialogModel.cmdCancel.Label = GetResText(STYLES+2)
DialogModel.cmdOk.Label = GetResText(STYLES+3)
+ For t = 0 to NumStyles - 1
+ LocalizedStyleNames(t,0) = GetResText(STYLENAME_DEF+t)
+ LocalizedStyleNames(t,1) = GetResText(STYLENAME+t)
+ Next t
Stylenames() = ReadDirectories(StylesDir, False, False, True,)
MaxIndex = Ubound(Stylenames())
+ For t = 0 to MaxIndex
+ LocalizedStyleName = StringInMultiArray(LocalizedStyleNames(), StyleNames(t,1), 0, 1)
+ If LocalizedStyleName &lt;&gt; "" Then
+ StyleNames(t,1) = LocalizedStyleName
+ End If
+ Next t
BubbleSortList(Stylenames(),True)
Dim cStyles(MaxIndex)
For t = 0 to MaxIndex
@@ -134,8 +149,8 @@ Dim Position as Integer
If Position &gt; -1 Then
ToggleWindow(False)
StylePath = Files(Position)
- aOptions(0).Name = &quot;OverwriteStyles&quot;
- aOptions(0).Value = true
+ aOptions(0).Name = &quot;OverwriteStyles&quot;
+ aOptions(0).Value = true
oFamilies.loadStylesFromURL(StylePath, aOptions())
ToggleWindow(True)
End If
@@ -171,8 +186,8 @@ Sub RestoreCurrentStyles
ToggleWindow(False)
On Local Error Goto NoFile
If FileExists(aTempURL) Then
- aOptions(0).Name = &quot;OverwriteStyles&quot;
- aOptions(0).Value = true
+ aOptions(0).Name = &quot;OverwriteStyles&quot;
+ aOptions(0).Value = true
oFamilies.LoadStylesFromURL(aTempURL, aOptions())
KillTempFile()
End If
diff --git a/wizards/source/template/template.src b/wizards/source/template/template.src
index a94ce8e5d45e..60ae43f9e764 100644
--- a/wizards/source/template/template.src
+++ b/wizards/source/template/template.src
@@ -17,6 +17,8 @@
*/
#define SAMPLES 1000
#define STYLES 1100
+#define STYLENAME_DEF 1120
+#define STYLENAME 1150
#define AgendaDlgName 1200
#define AgendaDlgNoCancel 1201
#define AgendaDlgFrame 1202
@@ -29,7 +31,6 @@
#define TextField 1400
#define Newsletter 1450
-// --------------------------------------------------------------------
String SAMPLES
{
Text [ en-US ] = "In order to use the full functionality of this sample, create a document that is based on this template.";
@@ -40,7 +41,6 @@ String SAMPLES + 1
Text [ en-US ] = "Remarks";
};
-// --------------------------------------------------------------------
String STYLES
{
Text [ en-US ] = "Theme Selection";
@@ -61,7 +61,186 @@ String STYLES + 3
Text [ en-US ] = "~OK";
};
-// --------------------------------------------------------------------
+String STYLENAME_DEF
+{
+ Text = "(Standard)";
+};
+
+String STYLENAME_DEF + 1
+{
+ Text = "Autumn Leaves";
+};
+
+String STYLENAME_DEF + 2
+{
+ Text = "Be";
+};
+
+String STYLENAME_DEF + 3
+{
+ Text = "Black and White";
+};
+
+String STYLENAME_DEF + 4
+{
+ Text = "Blackberry Bush";
+};
+
+String STYLENAME_DEF + 5
+{
+ Text = "Blue Jeans";
+};
+
+String STYLENAME_DEF + 6
+{
+ Text = "Fifties Diner";
+};
+
+String STYLENAME_DEF + 7
+{
+ Text = "Glacier";
+};
+
+String STYLENAME_DEF + 8
+{
+ Text = "Green Grapes";
+};
+
+String STYLENAME_DEF + 9
+{
+ Text = "Marine";
+};
+
+String STYLENAME_DEF + 10
+{
+ Text = "Millennium";
+};
+
+String STYLENAME_DEF + 11
+{
+ Text = "Nature";
+};
+
+String STYLENAME_DEF + 12
+{
+ Text = "Neon";
+};
+
+String STYLENAME_DEF + 13
+{
+ Text = "Night";
+};
+
+String STYLENAME_DEF + 14
+{
+ Text = "PC Nostalgia";
+};
+
+String STYLENAME_DEF + 15
+{
+ Text = "Pastel";
+};
+
+String STYLENAME_DEF + 16
+{
+ Text = "Pool Party";
+};
+
+String STYLENAME_DEF + 17
+{
+ Text = "Pumpkin";
+};
+
+String STYLENAME
+{
+ Text [ en-US ] = "(Standard)";
+};
+
+String STYLENAME + 1
+{
+ Text [ en-US ] = "Autumn Leaves";
+};
+
+String STYLENAME + 2
+{
+ Text [ en-US ] = "Be";
+};
+
+String STYLENAME + 3
+{
+ Text [ en-US ] = "Black and White";
+};
+
+String STYLENAME + 4
+{
+ Text [ en-US ] = "Blackberry Bush";
+};
+
+String STYLENAME + 5
+{
+ Text [ en-US ] = "Blue Jeans";
+};
+
+String STYLENAME + 6
+{
+ Text [ en-US ] = "Fifties Diner";
+};
+
+String STYLENAME + 7
+{
+ Text [ en-US ] = "Glacier";
+};
+
+String STYLENAME + 8
+{
+ Text [ en-US ] = "Green Grapes";
+};
+
+String STYLENAME + 9
+{
+ Text [ en-US ] = "Marine";
+};
+
+String STYLENAME + 10
+{
+ Text [ en-US ] = "Millennium";
+};
+
+String STYLENAME + 11
+{
+ Text [ en-US ] = "Nature";
+};
+
+String STYLENAME + 12
+{
+ Text [ en-US ] = "Neon";
+};
+
+String STYLENAME + 13
+{
+ Text [ en-US ] = "Night";
+};
+
+String STYLENAME + 14
+{
+ Text [ en-US ] = "PC Nostalgia";
+};
+
+String STYLENAME + 15
+{
+ Text [ en-US ] = "Pastel";
+};
+
+String STYLENAME + 16
+{
+ Text [ en-US ] = "Pool Party";
+};
+
+String STYLENAME + 17
+{
+ Text [ en-US ] = "Pumpkin";
+};
+
String AgendaDlgName
{
Text [ en-US ] = "Minutes Template";
@@ -87,7 +266,6 @@ String AgendaDlgButton2
Text [ en-US ] = "Evaluation Minutes";
};
-// --------------------------------------------------------------------
String CorrespondenceNoTextmark
{
Text [ en-US ] = "The bookmark 'Recipient' is missing.";
@@ -347,4 +525,3 @@ String Newsletter + 12
{
Text [ en-US ] = "Double-sided";
};
-