summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2001-10-31 12:33:17 +0000
committerBehrend Cornelius <bc@openoffice.org>2001-10-31 12:33:17 +0000
commitf6695e7bff52e52e59f6761bd0a1311b0a921866 (patch)
treefe49f8753e49523a77cc3ad426085638446203f6
parent505af0c39aa8ec52bc5049bf92c9037bcfe4e4ee (diff)
#93583# now previously opened documents are not disposed
-rw-r--r--wizards/source/euro/AutoPilotRun.xba36
-rw-r--r--wizards/source/euro/ConvertRun.xba3
-rw-r--r--wizards/source/euro/DlgConvert.xdl12
-rw-r--r--wizards/source/euro/DlgPassword.xdl4
-rw-r--r--wizards/source/euro/Hard.xba6
-rw-r--r--wizards/source/euro/Init.xba1
-rw-r--r--wizards/source/euro/Soft.xba4
7 files changed, 37 insertions, 29 deletions
diff --git a/wizards/source/euro/AutoPilotRun.xba b/wizards/source/euro/AutoPilotRun.xba
index ab9c7864bd27..adc7691ed2fa 100644
--- a/wizards/source/euro/AutoPilotRun.xba
+++ b/wizards/source/euro/AutoPilotRun.xba
@@ -21,6 +21,8 @@ Public oDocInfo as Object
Public oUcb as Object
Public TotDocCount as Integer
Public sTotDocCount as String
+Public OpenProperties(1) as New com.sun.star.beans.PropertyValue
+
Sub StartAutoPilot()
Dim i As Integer
@@ -28,7 +30,6 @@ Dim i As Integer
If InitResources(&quot;Euro Converter&quot;, &quot;eur&quot;) Then
oDocInfo = CreateUnoService(&quot;com.sun.star.document.DocumentProperties&quot;)
oUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
-&apos; DocDisposed = True
oLocale = GetStarOfficeLocale()
InitializeConverter(oLocale, 2)
ToggleGoOnButton()
@@ -50,27 +51,31 @@ Dim FilesList()
FilterList(0) = &quot;application/x-starcalc&quot;
FilterList(1) = &quot;application/vnd.stardivision.calc&quot;
FilterList(2) = &quot;application/vnd.sun.xml.calc&quot;
-
If DialogModel.chkTextDocuments.State = 1 Then
ReDim Preserve FilterList(6) as String
FilterList(3) = &quot;application/x-starwriter&quot;
FilterList(4) = &quot;application/vnd.stardivision.writer&quot;
FilterList(5) = &quot;application/vnd.stardivision.writer/web&quot;
FilterList(6) = &quot;application/vnd.sun.xml.writer&quot;
- End If
+ End If
FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, FilterList())
TotDocCount = Ubound(FilesList(),1) + 1
End If
InitializeProgressPage(DialogModel)
&apos; ChangeToNextProgressStep()
sTotDocCount = CStr(TotDocCount)
+ OpenProperties(0).Name = &quot;Hidden&quot;
+ OpenProperties(0).Value = True
+ OpenProperties(1).Name = &quot;AsTemplate&quot;
For DocIndex = 0 To TotDocCount - 1
If InitializeDocument(FilesList()) Then
If StoreDocument() Then
ConvertDocument()
oDocument.Store
End If
- oDocument.Dispose()
+ If bDisposable Then
+ oDocument.Dispose()
+ End If
End If
Next DocIndex
DialogModel.cmdGoOn.Enabled = True
@@ -84,6 +89,7 @@ Function InitializeDocument(FilesList()) as Boolean
&apos; The Autopilot is started from step No. 2
Dim sViewPath as String
Dim bIsReadOnly as Boolean
+Dim sExtension as String
On Local Error Goto NEXTFILE
If Not bCancelTask Then
If DialogModel.optWholeDir.State = 1 Then
@@ -98,26 +104,34 @@ Dim bIsReadOnly as Boolean
If Not oUcb.Exists(TargetDir) Then
oUcb.CreateFolder(TargetDir)
End If
- oDocument = OpenDocument(SourceFile, NoArgs(), StarDesktop)
+ 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 = True
+ End Select
+ oDocument = OpenDocument(SourceFile, OpenProperties(), bDisposable)
If (oDocument.IsReadOnly) AND (UCase(SourceFile) = UCase(TargetFile)) Then
bIsReadOnly = True
Msgbox(sMsgDOCISREADONLY, 16, GetProductName())
Else
bIsReadOnly = False
- RetrieveDocumentObjects()
+ RetrieveDocumentObjects()
sViewPath = CutPathView(SourceFile, 60)
DialogModel.lblCurDocument.Label = Str(DocIndex+1) &amp; &quot;/&quot; &amp; sTotDocCount &amp; &quot; (&quot; &amp; sViewPath &amp; &quot;)&quot;
End If
InitializeDocument() = Not bIsReadOnly
Else
- InitializeDocument() = False
+ InitializeDocument() = False
End If
NEXTFILE:
If Err &lt;&gt; 0 Then
InitializeDocument() = False
Resume LETSGO
-LETSGO:
- End If
+LETSGO:
+ End If
End Function
@@ -213,6 +227,7 @@ Dim TextBoxText as String
End If
DialogModel.txtConfig.Text = TextBoxText
ToggleProgressStep()
+ DialogModel.cmdGoOn.Enabled = False
End If
End Sub
@@ -223,7 +238,7 @@ Dim LocStep as Integer
&apos; If the Sub is call by the &apos;cmdBack&apos; Button then set the &apos;bMakeVisible&apos; variable accordingly
bMakeVisible = IsMissing(aEvent)
If bMakeVisible Then
- DialogModel.Step = 3
+ DialogModel.Step = 3
Else
DialogModel.Step = 2
End If
@@ -268,7 +283,6 @@ Sub InitializeProgressPage()
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
DialogConvert.GetControl(&quot;lblRetrieval&quot;).Visible = True
DialogConvert.GetControl(&quot;lblCurProgress&quot;).Visible = True
- DialogModel.cmdGoOn.Enabled = False
End Sub
diff --git a/wizards/source/euro/ConvertRun.xba b/wizards/source/euro/ConvertRun.xba
index c1144b8a97f6..093387865ff2 100644
--- a/wizards/source/euro/ConvertRun.xba
+++ b/wizards/source/euro/ConvertRun.xba
@@ -251,8 +251,7 @@ Dim OldCurExtension(2) as String
CreateStyleEnumeration()
End If
EnableStep1DialogControls(True, bPreSelected, True)
-&apos; Todo: auf Integer umstellen
- DialogModel.chkComplete.State = Not(Abs(bPreSelected))
+ DialogModel.chkComplete.State = Abs(Not(bPreSelected))
DialogModel.optSelRange.Enabled = bPreSelected
End Sub
diff --git a/wizards/source/euro/DlgConvert.xdl b/wizards/source/euro/DlgConvert.xdl
index 53325868441e..34757ad207a8 100644
--- a/wizards/source/euro/DlgConvert.xdl
+++ b/wizards/source/euro/DlgConvert.xdl
@@ -5,9 +5,7 @@
<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"/>
</dlg:button>
- <dlg:button dlg:id="cmdHelp" dlg:tab-index="1" dlg:left="63" dlg:top="190" dlg:width="53" dlg:height="14" dlg:tag="34674" dlg:help-url="HID:34674" dlg:value="cmdHelp">
- <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Tools.Recursive.ShowHelperDialog" script:language="StarBasic"/>
- </dlg:button>
+ <dlg:button dlg:id="cmdHelp" dlg:tab-index="1" dlg:left="63" dlg:top="190" dlg:width="53" dlg:height="14" dlg:tag="34674" dlg:value="cmdHelp" dlg:button-type="help"/>
<dlg:button dlg:id="cmdBack" dlg:tab-index="2" dlg:left="155" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:34675" dlg:value="cmdBack"/>
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="3" dlg:left="211" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:34676" dlg:value="cmdGoOn">
<script:event script:event-name="on-performaction" script:location="application" script:macro-name="Euro.Common.StartConversion" script:language="StarBasic"/>
@@ -30,7 +28,7 @@
<dlg:menulist dlg:id="lstSelection" dlg:tab-index="9" dlg:left="170" dlg:top="96" dlg:width="90" dlg:height="52" dlg:page="1" dlg:help-url="HID:34666" dlg:multiselection="true">
<script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="Euro.ConvertRun.SelectListItem" script:language="StarBasic"/>
</dlg:menulist>
- <dlg:checkbox dlg:id="chkComplete" dlg:tab-index="10" dlg:left="12" dlg:top="43" dlg:width="129" dlg:height="10" dlg:page="1" dlg:help-url="HID:34661" dlg:value="chkComplete">
+ <dlg:checkbox dlg:id="chkComplete" dlg:tab-index="10" dlg:left="12" dlg:top="43" dlg:width="129" dlg:height="10" dlg:page="1" dlg:help-url="HID:34661" dlg:value="chkComplete" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="Euro.ConvertRun.RetrieveEnableValue" script:language="StarBasic"/>
</dlg:checkbox>
<dlg:text dlg:id="lblHint" dlg:tab-index="11" dlg:left="6" dlg:top="164" dlg:width="258" dlg:height="22" dlg:value="lblHint" dlg:multiline="true"/>
@@ -41,8 +39,8 @@
<script:event script:event-name="on-performaction" script:location="application" script:macro-name="Euro.AutoPilotRun.CallFolderPicker" script:language="StarBasic"/>
</dlg:button>
<dlg:text dlg:id="lblTarget" dlg:tab-index="14" dlg:left="6" dlg:top="145" dlg:width="73" dlg:height="8" dlg:page="2" dlg:value="lblTarget"/>
- <dlg:checkbox dlg:id="chkProtect" dlg:tab-index="15" dlg:left="12" dlg:top="126" dlg:width="251" dlg:height="10" dlg:page="2" dlg:help-url="HID:34679" dlg:value="chkProtect"/>
- <dlg:checkbox dlg:id="chkRecursive" dlg:tab-index="16" dlg:left="12" dlg:top="98" dlg:width="252" dlg:height="10" dlg:page="2" dlg:help-url="HID:34671" dlg:value="chkRecursive"/>
+ <dlg:checkbox dlg:id="chkProtect" dlg:tab-index="15" dlg:left="12" dlg:top="126" dlg:width="251" dlg:height="10" dlg:page="2" dlg:help-url="HID:34679" dlg:value="chkProtect" dlg:checked="false"/>
+ <dlg:checkbox dlg:id="chkRecursive" dlg:tab-index="16" dlg:left="12" dlg:top="98" dlg:width="252" dlg:height="10" dlg:page="2" dlg:help-url="HID:34671" dlg:value="chkRecursive" dlg:checked="false"/>
<dlg:textfield dlg:id="txtSource" dlg:tab-index="17" dlg:left="80" dlg:top="82" dlg:width="165" dlg:height="12" dlg:page="2" dlg:help-url="HID:34670">
<script:event script:event-name="on-textchange" script:location="application" script:macro-name="Euro.AutoPilotRun.ToggleGoOnButton" script:language="StarBasic"/>
</dlg:textfield>
@@ -68,7 +66,7 @@
<dlg:menulist dlg:id="lstCurrencies" dlg:tab-index="29" dlg:left="170" dlg:top="51" dlg:width="90" dlg:height="12" dlg:help-url="HID:34669" dlg:spin="true" dlg:linecount="9">
<script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="Euro.ConvertRun.SelectCurrency" script:language="StarBasic"/>
</dlg:menulist>
- <dlg:checkbox dlg:id="chkTextDocuments" dlg:tab-index="30" dlg:left="12" dlg:top="112" dlg:width="251" dlg:height="10" dlg:page="2" dlg:help-url="HID:34680" dlg:value="chkTextDocuments"/>
+ <dlg:checkbox dlg:id="chkTextDocuments" dlg:tab-index="30" dlg:left="12" dlg:top="112" dlg:width="251" dlg:height="10" dlg:page="2" dlg:help-url="HID:34680" dlg:value="chkTextDocuments" dlg:checked="false"/>
<dlg:fixedline dlg:id="hlnSelection" dlg:tab-index="31" dlg:left="7" dlg:top="72" dlg:width="258" dlg:height="8" dlg:page="1" dlg:value="hlnSelection"/>
<dlg:fixedline dlg:id="hlnExtent" dlg:tab-index="32" dlg:left="6" dlg:top="39" dlg:width="156" dlg:height="8" dlg:page="2" dlg:value="hlnExtent"/>
<dlg:fixedline dlg:id="hlnProgress" dlg:tab-index="33" dlg:left="6" dlg:top="108" dlg:width="258" dlg:height="8" dlg:page="3" dlg:value="hlnProgress"/>
diff --git a/wizards/source/euro/DlgPassword.xdl b/wizards/source/euro/DlgPassword.xdl
index 1cff7379e705..3a106a259359 100644
--- a/wizards/source/euro/DlgPassword.xdl
+++ b/wizards/source/euro/DlgPassword.xdl
@@ -8,9 +8,7 @@
<dlg:button dlg:id="cmdCancel" dlg:tab-index="1" dlg:left="251" dlg:top="24" dlg:width="53" dlg:height="14" dlg:help-url="HID:34691" dlg:value="cmdCancel">
<script:event script:event-name="on-performaction" script:location="application" script:macro-name="Euro.Protect.RejectPassword" script:language="StarBasic"/>
</dlg:button>
- <dlg:button dlg:id="cmdHelp" dlg:tab-index="2" dlg:left="251" dlg:top="45" dlg:width="53" dlg:height="14" dlg:tag="34692" dlg:help-url="HID:34692" dlg:value="cmdHelp">
- <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Tools.Recursive.ShowHelperDialog" script:language="StarBasic"/>
- </dlg:button>
+ <dlg:button dlg:id="cmdHelp" dlg:tab-index="2" dlg:left="251" dlg:top="45" dlg:width="53" dlg:height="14" dlg:tag="34692" dlg:value="cmdHelp" dlg:button-type="help"/>
<dlg:textfield dlg:id="txtPassword" dlg:tab-index="3" dlg:left="11" dlg:top="18" dlg:width="232" dlg:height="12" dlg:help-url="HID:34693" dlg:echochar="*"/>
<dlg:fixedline dlg:id="hlnPassword" dlg:tab-index="4" dlg:left="6" dlg:top="6" dlg:width="238" dlg:height="8" dlg:value="hlnPassword"/>
</dlg:bulletinboard>
diff --git a/wizards/source/euro/Hard.xba b/wizards/source/euro/Hard.xba
index 5ceaf85f6462..db22d2bde95b 100644
--- a/wizards/source/euro/Hard.xba
+++ b/wizards/source/euro/Hard.xba
@@ -64,12 +64,13 @@ Dim sStatustext as String
End If
If MaxIndex &gt; -1 Then
ReDim Preserve RangeList(MaxIndex,1)
+&apos; Else
+&apos; ReDim RangeList(,1)
End If
Rangeindex = MaxIndex
End Sub
-
Function AddSheetRanges(oRanges as Object, r as Integer, oSheet as Object, bAutopilot)
Dim RangeName as String
Dim AddtoList as Boolean
@@ -230,5 +231,4 @@ Dim LocCellCount as Long
oRangeAddress = oRange.RangeAddress
LocCellCount = (oRangeAddress.EndColumn - oRangeAddress.StartColumn + 1) * (oRangeAddress.EndRow - oRangeAddress.StartRow + 1)
CountRangeCells = LocCellCount
-End Function
-</script:module> \ No newline at end of file
+End Function</script:module> \ No newline at end of file
diff --git a/wizards/source/euro/Init.xba b/wizards/source/euro/Init.xba
index fb9db101d621..15087212f800 100644
--- a/wizards/source/euro/Init.xba
+++ b/wizards/source/euro/Init.xba
@@ -20,6 +20,7 @@ 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
diff --git a/wizards/source/euro/Soft.xba b/wizards/source/euro/Soft.xba
index c774dc4b09a8..7db87ecc183e 100644
--- a/wizards/source/euro/Soft.xba
+++ b/wizards/source/euro/Soft.xba
@@ -237,6 +237,4 @@ Dim AssignString as String
End If
End If
GetAssignedRanges() = StyleRangeList()
-End Function
-
-</script:module> \ No newline at end of file
+End Function</script:module> \ No newline at end of file