summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2001-11-19 15:24:29 +0000
committerBehrend Cornelius <bc@openoffice.org>2001-11-19 15:24:29 +0000
commitda7bd58fe04af8caff8093b22a6c3f7535aa7929 (patch)
tree2140535d416b0eeb8b8014e825dabe51ea48de35
parent96417befe597c718e0e27fe53cc9eb30b550b9ac (diff)
#94155# Preselection improved
-rw-r--r--wizards/source/euro/AutoPilotRun.xba115
-rw-r--r--wizards/source/euro/Common.xba29
-rw-r--r--wizards/source/euro/ConvertRun.xba5
-rw-r--r--wizards/source/euro/DlgConvert.xdl4
-rw-r--r--wizards/source/euro/Init.xba3
-rw-r--r--wizards/source/euro/dialog.xlb4
-rw-r--r--wizards/source/euro/script.xlb4
7 files changed, 47 insertions, 117 deletions
diff --git a/wizards/source/euro/AutoPilotRun.xba b/wizards/source/euro/AutoPilotRun.xba
index f4199c66d913..2d56a31fdfb8 100644
--- a/wizards/source/euro/AutoPilotRun.xba
+++ b/wizards/source/euro/AutoPilotRun.xba
@@ -42,6 +42,8 @@ End Sub
Sub ConvertDocuments()
Dim FilesList()
+Dim bDisposable as Boolean
+
If Source &lt;&gt; &quot;&quot; And TargetDir &lt;&gt; &quot;&quot; Then
If DialogModel.optSingleFile.State = 1 Then
SourceFile = Source
@@ -66,11 +68,11 @@ Dim FilesList()
&apos; ChangeToNextProgressStep()
sTotDocCount = CStr(TotDocCount)
OpenProperties(0).Name = &quot;Hidden&quot;
- OpenProperties(0).Value = False
+ OpenProperties(0).Value = True
OpenProperties(1).Name = &quot;AsTemplate&quot;
-
+ OpenProperties(1).Value = False
For DocIndex = 0 To TotDocCount - 1
- If InitializeDocument(FilesList()) Then
+ If InitializeDocument(FilesList(), bDisposable) Then
If StoreDocument() Then
ConvertDocument()
oDocument.Store
@@ -88,7 +90,7 @@ Dim FilesList()
End Sub
-Function InitializeDocument(FilesList()) as Boolean
+Function InitializeDocument(FilesList(), bDisposable as Boolean) as Boolean
&apos; The Autopilot is started from step No. 2
Dim sViewPath as String
Dim bIsReadOnly as Boolean
@@ -105,13 +107,6 @@ Dim sExtension as String
End If
If CreateFolder(TargetDir) Then
sExtension = GetFileNameExtension(SourceFile, &quot;/&quot;)
- OpenProperties(1).Value = False
- Select Case sExtension
- Case &quot;vor&quot;, &quot;stc&quot;, &quot;stw&quot;, &quot;sti&quot;, &quot;std&quot;
- OpenProperties(1).Value = False
- Case Else
- OpenProperties(1).Value = False
- End Select
oDocument = OpenDocument(SourceFile, OpenProperties(), bDisposable)
If (oDocument.IsReadOnly) AND (UCase(SourceFile) = UCase(TargetFile)) Then
bIsReadOnly = True
@@ -199,12 +194,6 @@ Sub SwapExtent()
End Sub
-Sub HelperDialog()
-&apos;Todo: The String &quot;start&quot; can be replaced by a HelpIndex
- StarDesktop.LoadComponentfromUrl(&quot;vnd.sun.star.help://&quot; &amp; sDocType &amp; &quot;/start&quot;, &quot;_OFFICE_HELP&quot;, 64, NoArgs())
-End Sub
-
-
Sub InitializeThirdStep()
Dim TextBoxText as String
Source = AssignFileName(DialogModel.txtSource.Text, DialogModel.lblSource.Label, True)
@@ -361,83 +350,33 @@ End Sub
Sub CallFilePicker()
If DialogModel.optSingleFile.State = 1 Then
Dim oMasterKey as Object
- Dim oFilters() as Object
+ Dim oTypes() as Object
+ Dim oUIKey() as Object
oMasterKey = GetRegistryKeyContent(&quot;org.openoffice.Office.TypeDetection/&quot;)
- oFilters() = oMasterKey.Types
-
+ oTypes() = oMasterKey.Types
+ oUIKey = GetRegistryKeyContent(&quot;org.openoffice.Office.UI/FilterClassification/LocalFilters&quot;)
If DialogModel.chkTextDocuments.State = 1 Then
- Dim FilterNames(21,1) as String
-
- FilterNames(9,0) = oFilters.GetByName(&quot;writer_StarOffice_XML_Writer&quot;).UIName
- FilterNames(9,1) = &quot;*.sxw&quot;
-
- FilterNames(10,0) = oFilters.GetByName(&quot;writer_StarOffice_XML_Writer_Template&quot;).UIName
- FilterNames(10,1) = &quot;*.vor&quot;
-
- FilterNames(11,0) = oFilters.GetByName(&quot;writer_StarWriter_10&quot;).UIName
- FilterNames(11,1) = &quot;*.sdw&quot;
-
- FilterNames(12,0) = oFilters.GetByName(&quot;writer_StarWriter_30&quot;).UIName
- FilterNames(12,1) = &quot;*.sdw&quot;
-
- FilterNames(13,0) = oFilters.GetByName(&quot;writer_StarWriter_30_VorlageTemplate&quot;).UIName
- FilterNames(13,1) = &quot;*.vor&quot;
-
- FilterNames(14,0) = oFilters.GetByName(&quot;writer_StarWriter_40&quot;).UIName
- FilterNames(14,1) = &quot;*.sdw&quot;
-
- FilterNames(15,0) = oFilters.GetByName(&quot;writer_StarWriter_40_VorlageTemplate&quot;).UIName
- FilterNames(15,1) = &quot;*.vor&quot;
-
- FilterNames(16,0) = oFilters.GetByName(&quot;writer_StarWriter_50&quot;).UIName
- FilterNames(16,1) = &quot;*.sdw&quot;
-
- FilterNames(17,0) = oFilters.GetByName(&quot;writer_StarWriter_50_VorlageTemplate&quot;).UIName
- FilterNames(17,1) = &quot;*.vor&quot;
-
- FilterNames(18,0) = oFilters.GetByName(&quot;writer_web_StarOffice_XML_Writer_Web_Template&quot;).UIName
- FilterNames(18,1) = &quot;*.stw&quot;
-
- FilterNames(19,0) = oFilters.GetByName(&quot;writer_web_StarWriterWeb_40_VorlageTemplate&quot;).UIName
- FilterNames(19,1) = &quot;*.vor&quot;
-
- FilterNames(20,0) = oFilters.GetByName(&quot;writer_web_StarWriterWeb_50_VorlageTemplate&quot;).UIName
- FilterNames(20,1) = &quot;*.vor&quot;
-
- FilterNames(21,0) = oFilters.GetByName(&quot;writer_web_HTML&quot;).UIName
- FilterNames(21,1) = &quot;*.HTML&quot;
-
+ Dim FilterNames(7,1) as String
+ FilterNames(4,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer&quot;).UIName
+ FilterNames(4,1) = &quot;*.sxw&quot;
+ FilterNames(5,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer_Template&quot;).UIName
+ FilterNames(5,1) = &quot;*.stw&quot;
+ FilterNames(6,0) = oUIKey.Classes.GetByName(&quot;sw3to5&quot;).DisplayName
+ FilterNames(6,1) = &quot;*.sdw&quot;
+ FilterNames(7,0) = oUIKey.Classes.GetByName(&quot;sw3to5templ&quot;).DisplayName
+ Filternames(7,1) = &quot;*.vor&quot;
Else
- ReDim FilterNames(8,1) as String
+ ReDim FilterNames(3,1) as String
End If
- FilterNames(0,0) = oFilters.GetByName(&quot;calc_StarOffice_XML_Calc&quot;).UIName
+ FilterNames(0,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc&quot;).UIName
Filternames(0,1) = &quot;*.sxc&quot;
-
- FilterNames(1,0) = oFilters.GetByName(&quot;calc_StarOffice_XML_Calc_Template&quot;).UIName
- Filternames(1,1) = &quot;*.stw&quot;
-
- FilterNames(2,0) = oFilters.GetByName(&quot;calc_StarCalc_10&quot;).UIName
- Filternames(2,1) = &quot;*.sdc&quot;
-
- FilterNames(3,0) = oFilters.GetByName(&quot;calc_StarCalc_30&quot;).UIName
- Filternames(3,1) = &quot;*.sdc&quot;
-
- FilterNames(4,0) = oFilters.GetByName(&quot;calc_StarCalc_30_VorlageTemplate&quot;).UIName
- Filternames(4,1) = &quot;*.vor&quot;
-
- FilterNames(5,0) = oFilters.GetByName(&quot;calc_StarCalc_40&quot;).UIName
- Filternames(5,1) = &quot;*.sdc&quot;
-
- FilterNames(6,0) = oFilters.GetByName(&quot;calc_StarCalc_40_VorlageTemplate&quot;).UIName
- Filternames(6,1) = &quot;*.vor&quot;
-
- FilterNames(7,0) = oFilters.GetByName(&quot;calc_StarCalc_50&quot;).UIName
- Filternames(7,1) = &quot;*.sdc&quot;
-
- FilterNames(8,0) = oFilters.GetByName(&quot;calc_StarCalc_50_VorlageTemplate&quot;).UIName
- Filternames(8,1) = &quot;*.vor&quot;
-
+ FilterNames(1,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc_Template&quot;).UIName
+ Filternames(1,1) = &quot;*.stc&quot;
+ FilterNames(2,0) = oUIKey.Classes.GetByName(&quot;sc345&quot;).DisplayName
+ FilterNames(2,1) = &quot;*.sdc&quot;
+ FilterNames(3,0) = oUIKey.Classes.GetByName(&quot;sc345templ&quot;).DisplayName
+ Filternames(3,1) = &quot;*.vor&quot;
GetFileName(DialogModel.txtSource, Filternames())
Else
GetFolderName(DialogModel.txtSource)
diff --git a/wizards/source/euro/Common.xba b/wizards/source/euro/Common.xba
index 26d0da7c0e5f..0fcb07b30f22 100644
--- a/wizards/source/euro/Common.xba
+++ b/wizards/source/euro/Common.xba
@@ -216,25 +216,18 @@ Dim OldCurrIndex as Integer
CurExtension(1) = LangIDValue(CurrIndex,1,2)
CurExtension(2) = LangIDValue(CurrIndex,2,2)
If DialogModel.Step = 1 Then
- If OldCurrIndex = -1 Then
- DialogModel.chkComplete.State = 1
- EnableStep1DialogControls(True,False, True)
- SetOptionValuestoNull()
- Else
- EnableStep1DialogControls(False,False, False)
- If DialogModel.optCellTemplates.State = 1 Then
- EnableStep1DialogControls(False, False, False)
- CreateStyleEnumeration()
- ElseIf ((DialogModel.optSheetRanges.State = 1) OR (DialogModel.optDocRanges.State = 1)) AND (DialogModel.Step = 1) Then
- UpRangeList = UBound(RangeList())
- ReDim RangeList(UpRangeList) &apos;as String
- CreateRangeEnumeration(False)
- ElseIf DialogModel.optSelRange.State= 1 Then
- &apos;Preselected Range
-&apos; CheckRangeSelection()
- End If
- EnableStep1DialogControls(True, True, True)
+ EnableStep1DialogControls(False,False, False)
+ If DialogModel.optCellTemplates.State = 1 Then
+ EnableStep1DialogControls(False, False, False)
+ CreateStyleEnumeration()
+ ElseIf ((DialogModel.optSheetRanges.State = 1) OR (DialogModel.optDocRanges.State = 1)) AND (DialogModel.Step = 1) Then
+ UpRangeList = UBound(RangeList())
+ ReDim RangeList(UpRangeList) &apos;as String
+ CreateRangeEnumeration(False)
+ ElseIf DialogModel.optSelRange.State= 1 Then
+ &apos;Preselected Range
End If
+ EnableStep1DialogControls(True, True, True)
ElseIf DialogModel.Step = 2 Then
EnableStep2DialogControls(True)
End If
diff --git a/wizards/source/euro/ConvertRun.xba b/wizards/source/euro/ConvertRun.xba
index aeaab396fe10..fd45e2be09cc 100644
--- a/wizards/source/euro/ConvertRun.xba
+++ b/wizards/source/euro/ConvertRun.xba
@@ -8,7 +8,6 @@ Public oPreSelRange as Object
&apos; Todo Vorselektion der Listbox
&apos; Mauspointer umschalten:
-&apos; Todo: Sinnigkeit von &apos;DocDisposed&apos; noch einmal überprüfen
&apos; Todo: In der Hilfe sollte ein Hinweis erscheinen, dass immer zwei Nachkommastellen angezeigt werden
&apos; und die resultierende Betrag ebenfalls bis auf zwei Stellen nach dem Komma gerundet wird
@@ -17,8 +16,7 @@ Sub Main()
If InitResources(&quot;Euro Converter&quot;, &quot;eur&quot;) Then
bDoUnProtect = False
bPreSelected = True
-&apos; DocDisposed = False
- oDocument = StarDesktop.CurrentFrame.Controller.Model
+ oDocument = ThisComponent
RetrieveDocumentObjects() &apos; Statusline, SheetsCollection etc.
InitializeConverter(oDocument.CharLocale, 1)
GetPreSelectedRange()
@@ -246,6 +244,7 @@ Dim OldCurrSymbolList(2) as String
Dim OldCurrIndex as Integer
Dim OldCurExtension(2) as String
oPreSelRange = AddSelectedRangeToSelRangesEnum()
+
DialogModel.chkComplete.State = Abs(Not(bPreSelected))
If bPreSelected Then
DialogModel.optSelRange.State = 1
diff --git a/wizards/source/euro/DlgConvert.xdl b/wizards/source/euro/DlgConvert.xdl
index e28f8535f7e6..1c44ad984dc9 100644
--- a/wizards/source/euro/DlgConvert.xdl
+++ b/wizards/source/euro/DlgConvert.xdl
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
-<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="DialogConvert" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="2" dlg:help-url="HID:34660">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="DialogConvert" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="3" dlg:help-url="HID:34660">
<dlg:bulletinboard>
<dlg:button dlg:id="cmdCancel" dlg:tab-index="0" dlg:left="6" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:34673" dlg:value="cmdCancel">
<script:event script:event-name="on-performaction" script:location="application" script:macro-name="Euro.Common.CancelTask" script:language="StarBasic"/>
@@ -60,7 +60,7 @@
</dlg:radiogroup>
<dlg:text dlg:id="lblCurProgress" dlg:tab-index="22" dlg:left="16" dlg:top="130" dlg:width="181" dlg:height="8" dlg:page="3"/>
<dlg:text dlg:id="lblRetrieval" dlg:tab-index="23" dlg:left="9" dlg:top="119" dlg:width="178" dlg:height="8" dlg:page="3" dlg:value="lblRetrieval"/>
- <dlg:textfield dlg:id="txtConfig" dlg:tab-index="24" dlg:left="6" dlg:top="50" dlg:width="258" dlg:height="55" dlg:page="3" dlg:vscroll="true" dlg:multiline="true"/>
+ <dlg:textfield dlg:id="txtConfig" dlg:tab-index="24" dlg:left="6" dlg:top="50" dlg:width="258" dlg:height="55" dlg:page="3" dlg:vscroll="true" dlg:multiline="true" dlg:readonly="true"/>
<dlg:text dlg:id="lblConfig" dlg:tab-index="25" dlg:left="6" dlg:top="39" dlg:width="94" dlg:height="8" dlg:page="3" dlg:value="lblConfig"/>
<dlg:text dlg:id="lblCurDocument" dlg:tab-index="26" dlg:left="16" dlg:top="141" dlg:width="208" dlg:height="8" dlg:page="3"/>
<dlg:img dlg:id="imgPreview" dlg:tab-index="27" dlg:left="6" dlg:top="6" dlg:width="258" dlg:height="26" dlg:src="file:///D:/office630np/share/template/german/wizard/bitmap/euro_2.bmp"/>
diff --git a/wizards/source/euro/Init.xba b/wizards/source/euro/Init.xba
index 80e7d8145091..0b6790bd597a 100644
--- a/wizards/source/euro/Init.xba
+++ b/wizards/source/euro/Init.xba
@@ -20,7 +20,6 @@ Public UnprotectList() as String
Public FilterNames(2,1) as String
Public bDoUnProtect as Boolean
Public bCancelTask as Boolean
-Public bDisposable as Boolean
Public sREADY as String
Public sPROTECT as String
@@ -513,7 +512,7 @@ Dim bTakeThisLocale as Boolean
If DialogModel.Step = 2 Then
bTakeThisLocale = LangIDValue(n,m,0) = sLanguage
Else
- bTakeThisLocale = LangIDValue(n,m,0) = sLanguage AND LangIDValue(n,m,1) = sCountry
+ bTakeThisLocale = LangIDValue(n,m,0) = sLanguage&apos; AND LangIDValue(n,m,1) = sCountry
End If
If bTakeThisLocale Then
CurrIndex = n
diff --git a/wizards/source/euro/dialog.xlb b/wizards/source/euro/dialog.xlb
index c461ce54f0cd..296b542d5bcb 100644
--- a/wizards/source/euro/dialog.xlb
+++ b/wizards/source/euro/dialog.xlb
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
-<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Euro" library:readonly="true" library:passwordprotected="false">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Euro" library:readonly="false" library:passwordprotected="false">
<library:element library:name="DlgConvert"/>
<library:element library:name="DlgPassword"/>
-</library:library>
+</library:library> \ No newline at end of file
diff --git a/wizards/source/euro/script.xlb b/wizards/source/euro/script.xlb
index 1bc4927c2a5a..02b3d34e92e4 100644
--- a/wizards/source/euro/script.xlb
+++ b/wizards/source/euro/script.xlb
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
-<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Euro" library:readonly="true" library:passwordprotected="false">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Euro" library:readonly="false" library:passwordprotected="false">
<library:element library:name="ConvertRun"/>
<library:element library:name="AutoPilotRun"/>
<library:element library:name="Hard"/>
@@ -9,4 +9,4 @@
<library:element library:name="Common"/>
<library:element library:name="Writer"/>
<library:element library:name="Protect"/>
-</library:library>
+</library:library> \ No newline at end of file