summaryrefslogtreecommitdiff
path: root/wizards/source
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2002-10-16 09:34:10 +0000
committerBehrend Cornelius <bc@openoffice.org>2002-10-16 09:34:10 +0000
commit815de4b23e5b9beffa0cb7e85ffb34555497d55d (patch)
treeeb6c47f6f2d4350ebcfdadfcd47d4eaadb871a2f /wizards/source
parentf13b1b61efdee23824fce005e5a195a4401000cd (diff)
#104114# New Function 'CreateNewDocument' added
Diffstat (limited to 'wizards/source')
-rw-r--r--wizards/source/tools/Debug.xba4
-rw-r--r--wizards/source/tools/Misc.xba42
-rw-r--r--wizards/source/tools/ModuleControls.xba2
-rw-r--r--wizards/source/tools/Strings.xba2
-rw-r--r--wizards/source/tools/UCB.xba24
5 files changed, 57 insertions, 17 deletions
diff --git a/wizards/source/tools/Debug.xba b/wizards/source/tools/Debug.xba
index 2f1653071b60..4ba60ffb8d95 100644
--- a/wizards/source/tools/Debug.xba
+++ b/wizards/source/tools/Debug.xba
@@ -41,7 +41,7 @@ Dim MaxIndex as Integer
sObjectStrings(1) = LocObject.dbg_Methods
sObjectStrings(2) = LocObject.dbg_SupportedInterfaces
LocUrl = &quot;private:factory/swriter&quot;
- oLocDocument = StarDesktop.LoadComponentFromURL(LocUrl,&quot;_blank&quot;,0,NoArgs)
+ oLocDocument = StarDesktop.LoadComponentFromURL(LocUrl,&quot;_default&quot;,0,NoArgs)
oLocText = oLocDocument.text
oLocCursor = oLocText.createTextCursor()
oLocCursor.gotoStart(False)
@@ -69,7 +69,7 @@ Dim oLocCursor as Object
Dim oLocText as Object
LocUrl = &quot;private:factory/swriter&quot;
- oLocDocument = StarDesktop.LoadComponentFromURL(LocUrl,&quot;_blank&quot;,0,NoArgs)
+ oLocDocument = StarDesktop.LoadComponentFromURL(LocUrl,&quot;_default&quot;,0,NoArgs)
oLocText = oLocDocument.text
oLocCursor = oLocText.createTextCursor()
oLocCursor.gotoStart(False)
diff --git a/wizards/source/tools/Misc.xba b/wizards/source/tools/Misc.xba
index 5bca3caa4b61..60d09cb6d587 100644
--- a/wizards/source/tools/Misc.xba
+++ b/wizards/source/tools/Misc.xba
@@ -141,7 +141,7 @@ Dim oComponent as Object
If Not IsMissing(bDisposable) Then
bDisposable = True
End If
- OpenDocument() = StarDesktop.LoadComponentFromURL(DocPath,&quot;_blank&quot;,0,Args())
+ OpenDocument() = StarDesktop.LoadComponentFromURL(DocPath,&quot;_default&quot;,0,Args())
End Function
@@ -719,4 +719,44 @@ Function isHighContrast(oPeer as Object)
isHighContrast = false
If myLuminance &lt;= 25 Then isHighContrast = true
End Function
+
+
+Function CreateNewDocument(sType as String, Optional sAddMsg as String) as Object
+Dim NoArgs() as new com.sun.star.beans.PropertyValue
+Dim oDocument as Object
+Dim sUrl as String
+Dim ErrMsg as String
+ On Local Error Goto NOMODULEINSTALLED
+ sUrl = &quot;private:factory/&quot; &amp; sType
+ oDocument = StarDesktop.LoadComponentFromURL(sUrl,&quot;_default&quot;,0, NoArgs())
+NOMODULEINSTALLED:
+ If (Err &lt;&gt; 0) OR IsNull(oDocument) Then
+ If InitResources(&quot;&quot;, &quot;com&quot;) Then
+ Select Case sType
+ Case &quot;swriter&quot;
+ ErrMsg = GetResText(1001)
+ Case &quot;scalc&quot;
+ ErrMsg = GetResText(1002)
+ Case &quot;simpress&quot;
+ ErrMsg = GetResText(1003)
+ Case &quot;sdraw&quot;
+ ErrMsg = GetResText(1004)
+ Case &quot;smath&quot;
+ ErrMsg = GetResText(1005)
+ Case Else
+ ErrMsg = &quot;Invalid Document Type!&quot;
+ End Select
+ ErrMsg = ReplaceString(ErrMsg, chr(13), &quot;&lt;BR&gt;&quot;)
+ If Not IsMissing(sAddMsg) Then
+ ErrMsg = ErrMsg &amp; chr(13) &amp; sAddMsg
+ End If
+ Msgbox(ErrMsg, 48, GetProductName())
+ End If
+ If Err &lt;&gt; 0 Then
+ Resume GOON
+ End If
+ End If
+GOON:
+ CreateNewDocument = oDocument
+End Function
</script:module> \ No newline at end of file
diff --git a/wizards/source/tools/ModuleControls.xba b/wizards/source/tools/ModuleControls.xba
index fc02af12f401..37a5e23204ab 100644
--- a/wizards/source/tools/ModuleControls.xba
+++ b/wizards/source/tools/ModuleControls.xba
@@ -249,7 +249,7 @@ Dim FilterIndex as Integer
End If
On Local Error Goto NOSAVING
If FilterName = &quot;&quot; Then
- &apos; Todo: Den Fall abfangen, wenn ein zu überschreibendes Dokument schreibgeschützt ist (weil es z.B. gerade geöffnet ist)
+ &apos; Todo: Catch the case that a document that has to be overwritten is writeportected (e.g. it is open)
oDocument.StoreAsUrl(sPath, NoArgs())
Else
oStoreProperties(0).Name = &quot;FilterName&quot;
diff --git a/wizards/source/tools/Strings.xba b/wizards/source/tools/Strings.xba
index 29427f286018..7a5e8872cac8 100644
--- a/wizards/source/tools/Strings.xba
+++ b/wizards/source/tools/Strings.xba
@@ -43,8 +43,6 @@ Dim BigLen%, PreLen%, PostLen%
BigLen = Len(BigString)
PostLen = Len(PostString)
FindPartString = Mid(BigString,StartPos + PreLen, EndPos - (StartPos + PreLen))
- &apos; Da diese Funktion dafür programmiert wurde, in einer Schleife abgearbeitet zu werden
- &apos; muss die initiale Suchposition hinter die Position des gefundenen Teilstrings gesetzt werden.
SearchPos = EndPos + PostLen
Else
Msgbox(&quot;No final tag for &apos;&quot; &amp; PreString &amp; &quot;&apos; existing&quot;, 16, GetProductName())
diff --git a/wizards/source/tools/UCB.xba b/wizards/source/tools/UCB.xba
index 020a26a096fa..71dae0e556f8 100644
--- a/wizards/source/tools/UCB.xba
+++ b/wizards/source/tools/UCB.xba
@@ -16,7 +16,6 @@ Dim LocsfileContent(0) as String
End Sub
-&apos; Prozedur, die die rekursive Auslesefunktion anwirft
Function ReadDirectories(ByVal AnchorDir As String, bRecursive as Boolean, bcheckFileType as Boolean, bGetByTitle as Boolean, Optional sFileContent(), Optional sExtension as String)
Dim i as integer
Dim Status as Object
@@ -71,10 +70,10 @@ Dim sFileArray(StartUbound,1) as String
&apos; precisely identified by their mimetype and their extension
FileExtension = GetFileNameExtension(FileName)
If FileExtension = sExtension Then
- AddFileNameToList(sFileArray(), FileName, RealFileContent, bGetByTitle, CurIndex)
+ AddFileNameToList(sFileArray(), FileName, RealFileContent, bGetByTitle, CurIndex)
End If
Else
- AddFileNameToList(sFileArray(), FileName, RealFileContent, bGetByTitle, CurIndex)
+ AddFileNameToList(sFileArray(), FileName, RealFileContent, bGetByTitle, CurIndex)
End If
Else
AddFileNameToList(sFileArray(), FileName, RealFileContent, bGetByTitle, CurIndex)
@@ -94,7 +93,7 @@ Dim sFileArray(StartUbound,1) as String
Loop Until DirIndex &gt;= iDirCount
If CurIndex &gt; -1 Then
ReDim Preserve sFileArray(CurIndex,1) as String
- Else
+ Else
ReDim sFileArray() as String
End If
Else
@@ -123,7 +122,7 @@ Dim FileCount As Integer
&apos; Add the documenttitles to the Filearray
Else
sFileArray(CurIndex,1) = FileContent
- End If
+ End If
End Sub
@@ -250,7 +249,7 @@ Dim MaxIndex as Integer
Redim Preserve DataList(i)
End If
LoadDataFromFile() = True
- oOutputStream.CloseInput()
+ oInputStream.CloseInput()
Else
LoadDataFromFile() = False
End If
@@ -267,9 +266,12 @@ Dim oUcb as Object
CreateFolder = True
NOSPACEONDRIVE:
If Err &lt;&gt; 0 Then
- Msgbox &quot;Folder &apos;&quot; &amp; ConvertFromUrl(sNewFolder) &amp; &quot;&apos; could not be created! Probably your harddisk is out of space!&quot;
- CreateFolder() = False
- Resume LETSGO
- LETSGO:
- End If
+ If InitResources(&quot;&quot;, &quot;com&quot;) Then
+ ErrMsg = GetResText(1000)
+ Msgbox(ErrMsg, 48, GetProductName())
+ End If
+ CreateFolder = False
+ Resume GOON
+ End If
+GOON:
End Function</script:module> \ No newline at end of file