From b1bf36532e74eb1498bd2fe906c4be34de051e56 Mon Sep 17 00:00:00 2001 From: Behrend Cornelius Date: Mon, 8 Oct 2001 08:52:01 +0000 Subject: #92590# english Texts of macros now improved --- wizards/source/gimmicks/AutoText.xba | 13 ++---- wizards/source/gimmicks/ChangeAllChars.xba | 8 ++-- wizards/source/gimmicks/GetTexts.xba | 40 +++++++++--------- wizards/source/gimmicks/ReadDir.xba | 4 +- wizards/source/gimmicks/UserfieldDlg.xdl | 14 +++---- wizards/source/gimmicks/Userfields.xba | 65 +++--------------------------- 6 files changed, 41 insertions(+), 103 deletions(-) (limited to 'wizards/source/gimmicks') diff --git a/wizards/source/gimmicks/AutoText.xba b/wizards/source/gimmicks/AutoText.xba index a8ce044ebd9f..a9534b5c531f 100644 --- a/wizards/source/gimmicks/AutoText.xba +++ b/wizards/source/gimmicks/AutoText.xba @@ -20,15 +20,8 @@ Dim oContentStyle as Object Dim oHeaderStyle as Object Dim oGroupTitleStyle as Object Dim n, m, iAutoCount as Integer -Dim oLocale as New com.sun.star.lang.Locale BasicLibraries.LoadLibrary("Tools") - oLocale = GetStarOfficeLocale() - strHeading1 = "Überschrift 1" - strGroup = "Bereich:" - strBlockName = "Name des Bausteins" - strBlockShortName = "Kürzel" - strColumnWidth = "13cm" - sDocumentTitle = "Installierte Autotextbausteine" + sDocumentTitle = "Installed AutoTexts" ' Open a new empty document oDocument = StarDesktop.LoadComponentFromURL("private:factory/swriter","_blank",0,NoArgs) @@ -74,8 +67,8 @@ Dim oLocale as New com.sun.star.lang.Locale ' oTable.KeepTogether = False oTable.RepeatHeadLine = True oAutoTextCursor.Text.InsertTextContent(oAutoTextCursor,oTable,False) - InsertStringToCell("AutoText-Title",oTable.GetCellbyPosition(0,0), "AutoTextHeading") - InsertStringToCell("AutoText-Name",oTable.GetCellbyPosition(1,0), "AutoTextHeading") + InsertStringToCell("AutoText Name",oTable.GetCellbyPosition(0,0), "AutoTextHeading") + InsertStringToCell("AutoText Shortcut",oTable.GetCellbyPosition(1,0), "AutoTextHeading") ' Insert one row at the bottom of the table oRows = oTable.Rows iAutoCount = oAutoGroup.Count diff --git a/wizards/source/gimmicks/ChangeAllChars.xba b/wizards/source/gimmicks/ChangeAllChars.xba index 544e3778860a..aa0abaa1cca8 100644 --- a/wizards/source/gimmicks/ChangeAllChars.xba +++ b/wizards/source/gimmicks/ChangeAllChars.xba @@ -16,15 +16,15 @@ Const MBYES = 6 Const MBABORT = 2 Const MBNO = 7 BasicLibraries.LoadLibrary("Tools") - MSGBOXTITLE = "Change all characters to a '" & UPPERREPLACECHAR & "'" - NOTSAVEDTEXT = "This Document is modified: All characters are changed to an " & UPPERREPLACECHAR & "'. Shall the document be saved now?" + MSGBOXTITLE = "Change All Characters to an '" & UPPERREPLACECHAR & "'" + NOTSAVEDTEXT = "This document has already been modified: All characters will be changed to an " & UPPERREPLACECHAR & "'. Should the document be saved now?" WARNING = "This macro changes all characters and numbers to an '" & UPPERREPLACECHAR & "' in this document." On Local Error GoTo NODOCUMENT oDocument = StarDesktop.ActiveFrame.Controller.Model NODOCUMENT: If Err <> 0 Then - Msgbox("This Macro extracts all Data of a displayed Writer-Document." & chr(13) & "Activate a Writer-Document!" , 16, GetProductName()) + Msgbox(WARNING & chr(13) & "First, activate a Writer document." , 16, GetProductName()) Exit Sub End If On Local Error Goto 0 @@ -51,7 +51,7 @@ Const MBNO = 7 ReplaceAllStrings(oDocument) Case Else - Msgbox("This Macro only works with Writer-Documents!", 16, GetProductName()) + Msgbox("This macro only works with Writer documents.", 16, GetProductName()) End Select End Sub diff --git a/wizards/source/gimmicks/GetTexts.xba b/wizards/source/gimmicks/GetTexts.xba index 24337735aa23..2e7d49649bcb 100644 --- a/wizards/source/gimmicks/GetTexts.xba +++ b/wizards/source/gimmicks/GetTexts.xba @@ -33,8 +33,8 @@ Dim oCharStyles as Object sDocType = GetDocumentType(oDocument) NODOCUMENT: If Err <> 0 Then - Msgbox("This Macro extracts all Data of the displayed Writer-, Calc or Draw-Documents." & chr(13) &_ - "To start this macro you have to activate a Document first!" , 16, GetProductName) + Msgbox("This macro extracts all data from the active Writer, Calc or Draw document." & chr(13) &_ + "To start this macro you have to activate a document first." , 16, GetProductName) Exit Sub End If On Local Error Goto 0 @@ -46,11 +46,11 @@ Dim oCharStyles as Object ' create and define the character styles of the Log-document oCharStyles = oLogDocument.StyleFamilies.GetByName("CharacterStyles") oLogHeaderStyle = oLogDocument.createInstance("com.sun.star.style.CharacterStyle") - oCharStyles.InsertbyName("LogHeaderText", oLogHeaderStyle) + oCharStyles.InsertbyName("Log Header", oLogHeaderStyle) oLogHeaderStyle.charWeight = com.sun.star.awt.FontWeight.BOLD oLogBodyTextStyle = oLogDocument.createInstance("com.sun.star.style.CharacterStyle") - oCharStyles.InsertbyName("LogBodyText", oLogBodyTextStyle) + oCharStyles.InsertbyName("Log Body", oLogBodyTextStyle) ' Insert the title of the activated document as a hyperlink oHyperCursor = oLogText.createTextCursor() @@ -83,7 +83,7 @@ Dim oCharStyles as Object Case "sdraw" GetDrawStrings() Case Else - Msgbox("This Macro only works with Writer-, Calc or Draw/Impress-Documents!", 16, GetProductName()) + Msgbox("This macro only works with a Writer, Calc or Draw/Impress document.", 16, GetProductName()) End Select End Sub @@ -102,21 +102,21 @@ Dim oSheets as Object For i = 0 to osheets.Count - 1 oSheet = osheets.GetbyIndex(i) SheetName = oSheet.Name - MakeLogHeadLine("Sheet No " & i & "(" & SheetName & ")" ) + MakeLogHeadLine("Sheet No. " & i & "(" & SheetName & ")" ) ' Check the "body" of the sheet GetCellTexts(oSheet) If oSheet.IsScenario then - MakeLogHeadLine("Scenario-Comments of " & SheetName & "'") + MakeLogHeadLine("Scenario Comments from " & SheetName & "'") WriteStringtoLogFile(osheet.ScenarioComment) End if - GetAnnotations(oSheet, "Annotations of '" & SheetName & "'") + GetAnnotations(oSheet, "Annotations from '" & SheetName & "'") - GetChartStrings(oSheet, "Charts of '" & SheetName & "'") + GetChartStrings(oSheet, "Charts from '" & SheetName & "'") - GetControlStrings(oSheet.DrawPage, "Controls of '" & SheetName & "'") + GetControlStrings(oSheet.DrawPage, "Controls from '" & SheetName & "'") Next ' Pictures @@ -164,7 +164,7 @@ End Sub Sub GetCalcGraphicNames() Dim n,m as integer - MakeLogHeadLine("Pictures") + MakeLogHeadLine("Graphics") For n = 0 To oDocument.Drawpages.count-1 For m = 0 To oDocument.Drawpages.GetbyIndex(n).Count - 1 WriteStringtoLogFile(oDocument.DrawPages.GetbyIndex(n).GetbyIndex(m).Text.String) @@ -264,7 +264,7 @@ Dim oFrameTextPort as Object ' Is the frame bound to the Page If oTextFrame.AnchorType = com.sun.star.text.TextContentAnchorType.AT_PAGE Then - GetParagraphTexts(oTextFrame, "Textframe Content") + GetParagraphTexts(oTextFrame, "Text Frame Contents") End If oFrameEnum = oTextFrame.CreateEnumeration @@ -290,7 +290,7 @@ Sub GetTextFieldStrings() Dim aTextField as Object Dim i as integer Dim CurElement as Object - MakeLogHeadLine("TextFields") + MakeLogHeadLine("Text Fields") aTextfield = oDocument.getTextfields.CreateEnumeration While aTextField.hasmoreElements CurElement = aTextField.NextElement @@ -312,7 +312,7 @@ Dim oDocSections as Object Dim LinkedFileName as String Dim i as Integer If Right(oDocument.URL,3) = "sgl" Then - MakeLogHeadLine("Sub Documents") + MakeLogHeadLine("Sub-documents") oDocSections = oDocument.TextSections For i = 0 to oDocSections.Count - 1 LinkedFileName = oDocSections.GetbyIndex(i).FileLink.FileURL @@ -410,7 +410,7 @@ End Sub Sub GetDocumentInfo() Dim oDocuInfo as Object - MakeLogHeadLine("Document Info") + MakeLogHeadLine("Document Properties") oDocuInfo = oDocument.DocumentInfo WriteStringToLogFile(oDocuInfo.Title) WriteStringToLogFile(oDocuInfo.Description) @@ -430,7 +430,7 @@ Dim oAllHyperLinks as Object Dim SrchAttributes(0) as new com.sun.star.beans.PropertyValue Dim oSearchDesc as Object - MakeLogHeadLine("HyperLinks") + MakeLogHeadLine("Hyperlinks") ' create a Search-Descriptor oSearchDesc = oDocument.CreateSearchDescriptor oSearchDesc.Valuesearch = False @@ -455,7 +455,7 @@ End Sub Sub GetGraphicNames() Dim i as integer Dim oDocGraphics as Object - MakeLogHeadLine("Pictures") + MakeLogHeadLine("Graphics") oDocGraphics = oDocument.GraphicObjects For i = 0 to oDocGraphics.count - 1 WriteStringtoLogFile(oDocGraphics.GetbyIndex(i).Name) @@ -465,7 +465,7 @@ End Sub Sub GetStyles() Dim m,n as integer - MakeLogHeadLine("Userdefined Templates") + MakeLogHeadLine("User-defined Templates") ' Check all StyleFamilies(i.e. PageStyles, ParagraphStyles, CharacterStyles, cellStyles) For n = 0 to oDocument.StyleFamilies.Count - 1 @@ -521,9 +521,9 @@ End Sub Sub MakeLogHeadLine(HeadText as String) - oLogCursor.CharStyleName = "LogHeaderText" + oLogCursor.CharStyleName = "Log Header" oLogText.insertControlCharacter(oLogCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False) oLogText.insertString(oLogCursor,HeadText,False) oLogText.insertControlCharacter(oLogCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False) - oLogCursor.CharStyleName = "LogBodyText" + oLogCursor.CharStyleName = "Log Body" End Sub \ No newline at end of file diff --git a/wizards/source/gimmicks/ReadDir.xba b/wizards/source/gimmicks/ReadDir.xba index b5184d8c8547..223249d3ed50 100644 --- a/wizards/source/gimmicks/ReadDir.xba +++ b/wizards/source/gimmicks/ReadDir.xba @@ -47,13 +47,13 @@ Dim oStandardTemplate as Object BasicLibraries.LoadLibrary("Tools") oDocument = StarDesktop.LoadComponentFromURL("private:factory/sdraw","_blank",0, NoArgs()) oPage = oDocument.DrawPages(0) - oStandardTemplate = oDocument.StyleFamilies.GetByName("graphics").GetByName("Standard") + oStandardTemplate = oDocument.StyleFamilies.GetByName("graphics").GetByName("Default") oStandardTemplate.CharHeight = 10 oStandardTemplate.TextLeftDistance = 100 oStandardTemplate.TextRightDistance = 100 oStandardTemplate.TextUpperDistance = 50 oStandardTemplate.TextLowerDistance = 50 - DlgReadDir = LoadDialog("Gimmicks","ReadDirDlg") + DlgReadDir = LoadDialog("Gimmicks","ReadDirdlg") oProgressBar = DlgReadDir.Model.ProgressBar1 DlgReadDir.Model.TextField1.Text = ConvertFromUrl(GetPathSettings("Work")) DlgReadDir.Model.cmdGoOn.DefaultButton = True diff --git a/wizards/source/gimmicks/UserfieldDlg.xdl b/wizards/source/gimmicks/UserfieldDlg.xdl index a03e85c1fe26..c80c0dee35b5 100644 --- a/wizards/source/gimmicks/UserfieldDlg.xdl +++ b/wizards/source/gimmicks/UserfieldDlg.xdl @@ -1,6 +1,6 @@ - + @@ -23,13 +23,13 @@ - + - + - + @@ -38,11 +38,11 @@ - + - - + + diff --git a/wizards/source/gimmicks/Userfields.xba b/wizards/source/gimmicks/Userfields.xba index 5fc07da2f542..a19681d01a2f 100644 --- a/wizards/source/gimmicks/Userfields.xba +++ b/wizards/source/gimmicks/Userfields.xba @@ -22,9 +22,9 @@ Dim SystemPath as String UserFieldDatatype(0,1) = "o" UserFieldDatatype(1,0) = "FIRSTNAME" UserFieldDatatype(1,1) = "givenname" - UserFieldDatatype(2,0) = "NAME" + UserFieldDatatype(2,0) = "LASTNAME" UserFieldDatatype(2,1) = "sn" - UserFieldDatatype(3,0) = "SHORTCUT" + UserFieldDatatype(3,0) = "INITIALS" UserFieldDatatype(3,1) = "initials" UserFieldDatatype(4,0) = "STREET" UserFieldDatatype(4,1) = "street" @@ -38,13 +38,13 @@ Dim SystemPath as String UserFieldDatatype(8,1) = "title" UserFieldDatatype(9,0) = "POSITION" UserFieldDatatype(9,1) = "position" - UserFieldDatatype(10,0) = "PHONE_PRIVATE" + UserFieldDatatype(10,0) = "PHONE_HOME" UserFieldDatatype(10,1) = "homephone" - UserFieldDatatype(11,0) = "PHONE_COMPANY" + UserFieldDatatype(11,0) = "PHONE_WORK" UserFieldDatatype(11,1) = "telephonenumber" UserFieldDatatype(12,0) = "FAX" UserFieldDatatype(12,1) = "facsimiletelephonenumber" - UserFieldDatatype(13,0) = "EMAIL" + UserFieldDatatype(13,0) = "E-MAIL" UserFieldDatatype(13,1) = "mail" UserFieldDatatype(14,0) = "STATE" UserFieldDatatype(14,1) = "st" @@ -118,30 +118,6 @@ Dim MaxIndex as Integer End Sub -Sub SaveDataToFile(FilePath as String, DataList() as String) -Dim FileChannel as Integer -Dim i as Integer -Dim oFile as Object -Dim oOutputStream as Object -Dim oStreamString as Object -Dim oUcb as Object -Dim sCRLF as String - - sCRLF = CHR(10) & CHR(13) - oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess") - oOutputStream = createUnoService("com.sun.star.io.TextOutputStream") - If oUcb.Exists(FilePath) Then - oUcb.Kill(FilePath) - End If - oFile = oUcb.OpenFileReadWrite(FilePath) - oOutputStream.SetOutputStream(oFile.GetOutputStream) - For i = 0 To Ubound(DataList()) - oOutputStream.WriteString(DataList(i) & sCRLF) - Next i - oOutputStream.CloseOutput() -End Sub - - Sub ToggleButtons(ByVal Index as Integer) Dim i as Integer CurFieldIndex = Index @@ -150,37 +126,6 @@ Dim i as Integer End Sub -Function LoadDataFromFile(FilePath as String, DataList() as String) as Boolean -Dim oInputStream as Object -Dim i as Integer -Dim oUcb as Object -Dim oFile as Object -Dim MaxIndex as Integer - oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess") - If oUcb.Exists(FilePath) Then - MaxIndex = 10 - oInputStream = createUnoService("com.sun.star.io.TextInputStream") - oFile = oUcb.OpenFileReadWrite(FilePath) - oInputStream.SetInputStream(oFile.GetInputStream) - i = -1 - Redim Preserve DataList(MaxIndex) as String - While Not oInputStream.IsEOF - i = i + 1 - If i > MaxIndex Then - MaxIndex = MaxIndex + 10 - Redim Preserve DataList(MaxIndex) as String - End If - DataList(i) = oInputStream.ReadLine - Wend - If i > -1 And i <> MaxIndex Then - Redim Preserve DataList(i) as String - End If - LoadDataFromFile() = True - oOutputStream.CloseInput() - Else - LoadDataFromFile() = False - End If -End Function Sub InitializeUserFamily() -- cgit