[Libreoffice-commits] core.git: wizards/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Aug 22 10:37:45 UTC 2018
wizards/source/gimmicks/GetTexts.xba | 53 ++++++++++++++++-------------------
1 file changed, 25 insertions(+), 28 deletions(-)
New commits:
commit 969e2dd3575bd13813318a4f30e5b06060f3dce3
Author: Matthias Seidel <mseidel at apache.org>
AuthorDate: Tue Aug 21 15:13:15 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Aug 22 12:37:23 2018 +0200
Deleted whitespace, fixed typos and spelling errors
(cherry picked from commit 16c6c9fbce5112869d554ca1f346f7c8f1bcc024)
Change-Id: I61f469100dc49fe9c00171b59c3390834bb3af78
Reviewed-on: https://gerrit.libreoffice.org/59425
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/wizards/source/gimmicks/GetTexts.xba b/wizards/source/gimmicks/GetTexts.xba
index 452ea776e413..af93738fdfc7 100644
--- a/wizards/source/gimmicks/GetTexts.xba
+++ b/wizards/source/gimmicks/GetTexts.xba
@@ -18,12 +18,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="GetTexts" script:language="StarBasic">Option Explicit
-' Macro-Description:
-' This Macro extracts the strings out of the currently activated document and inserts them into a log document.
-' The aim of the macro is to provide the programmer an insight into the StarOffice API
-' It focusses on how document-Objects are accessed.
-' Therefore not only texts of the document-body are retrieved but also Texts of general
-' document Objects like, Annotations, charts and general Document Information
+' Description:
+' This macro extracts the strings out of the currently active document and inserts them into a log document.
+' The aim of the macro is to provide the programmer an insight into the OpenOffice API.
+' It focuses on how document objects are accessed.
+' Therefore not only texts of the document body are retrieved but also texts of general
+' document objects like, annotations, charts and general document information.
Public oLogDocument, oLogText, oLogCursor, oLogHeaderStyle, oLogBodyTextStyle as Object
Public oDocument as Object
@@ -35,13 +35,13 @@ Sub Main
Dim sDocType as String
Dim oHyperCursor as Object
Dim oCharStyles as Object
- BasicLibraries.LoadLibrary("Tools")
+ BasicLibraries.LoadLibrary("Tools")
On Local Error GoTo NODOCUMENT
oDocument = StarDesktop.ActiveFrame.Controller.Model
sDocType = GetDocumentType(oDocument)
NODOCUMENT:
If Err <> 0 Then
- Msgbox("This macro extracts all data from the active Writer, Calc or Draw document." & chr(13) &_
+ Msgbox("This macro extracts all data from the active Writer, Calc or Draw/Impress document." & chr(13) &_
"To start this macro you have to activate a document first." , 16, GetProductName)
Exit Sub
End If
@@ -52,7 +52,7 @@ Dim oCharStyles as Object
If Not IsNull(oLogDocument) Then
oLogText = oLogDocument.Text
- ' create and define the character styles of the Log-document
+ ' 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("Log Header", oLogHeaderStyle)
@@ -98,7 +98,7 @@ Dim oCharStyles as Object
End Sub
-' ***********************************************Calc-Documents**************************************************
+' ***********************************************Calc documents**************************************************
Sub GetCalcStrings()
Dim i, n as integer
@@ -111,7 +111,7 @@ 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)
@@ -182,7 +182,7 @@ Dim n,m as integer
End Sub
-' ***********************************************Writer-Documents**************************************************
+' ***********************************************Writer documents**************************************************
Sub GetParagraphTexts(oParaObject as Object, HeadLine as String)
Dim ParaEnum as Object
@@ -199,7 +199,7 @@ Dim oCell as Object
While ParaEnum.HasMoreElements
oPara = ParaEnum.NextElement
- ' Note: The Enumeration ParaEnum lists all tables and Paragraphs.
+ ' Note: The enumeration ParaEnum lists all tables and paragraphs.
' Therefore we have to find out what kind of object "oPara" actually is
If oPara.supportsService("com.sun.star.text.Paragraph") Then
' "oPara" is a Paragraph
@@ -222,7 +222,6 @@ Dim oCell as Object
End Sub
-
Sub GetChartStrings(oSheet as Object, HeaderLine as String)
Dim i as Integer
Dim aChartObject as Object
@@ -257,7 +256,6 @@ Dim aChartDiagram as Object
End Sub
-
Sub GetFrameTexts()
Dim i as integer
Dim oTextFrame as object
@@ -271,8 +269,8 @@ Dim oFrameTextPort as Object
oTextFrame = oDocument.TextFrames.GetbyIndex(i)
WriteStringToLogFile(oTextFrame.Name)
- ' Is the frame bound to the Page
- If oTextFrame.AnchorType = com.sun.star.text.TextContentAnchorType.AT_PAGE Then
+ ' Is the frame bound to the page?
+ If oTextFrame.AnchorType = com.sun.star.text.TextContentAnchorType.AT_PAGE Then
GetParagraphTexts(oTextFrame, "Text Frame Contents")
End If
@@ -315,7 +313,6 @@ Dim CurElement as Object
End Sub
-
Sub GetLinkedFileNames()
Dim oDocSections as Object
Dim LinkedFileName as String
@@ -357,7 +354,7 @@ Sub GetWriterStrings()
End Sub
-' ***********************************************Draw-Documents**************************************************
+' ***********************************************Draw/Impress documents**************************************************
Sub GetDrawPageTitles(LocObject as Object)
Dim n as integer
@@ -366,9 +363,9 @@ Dim oPage as Object
For n = 0 to LocObject.Count - 1
oPage = LocObject.GetbyIndex(n)
WriteStringtoLogFile(oPage.Name)
- ' Is the Page a DrawPage and not a MasterPage?
+ ' Is the page a DrawPage and not a MasterPage?
If oPage.supportsService("com.sun.star.drawing.DrawPage")then
- ' Get the Name of the NotesPage (only relevant for Impress-Documents)
+ ' Get the name of the NotesPage (only relevant for Impress documents)
If oDocument.supportsService("com.sun.star.presentation.PresentationDocument") then
WriteStringtoLogFile(oPage.NotesPage.Name)
End If
@@ -425,10 +422,10 @@ Dim oDocuProps as Object
WriteStringToLogFile(oDocuProps.Description)
WriteStringToLogFile(oDocuProps.Subject)
WriteStringToLogFile(oDocuProps.Author)
-' WriteStringToLogFile(oDocuProps.UserDefinedProperties.ReplyTo)
-' WriteStringToLogFile(oDocuProps.UserDefinedProperties.Recipient)
-' WriteStringToLogFile(oDocuProps.UserDefinedProperties.References)
-' WriteStringToLogFile(oDocuProps.Keywords)
+ ' WriteStringToLogFile(oDocuProps.UserDefinedProperties.ReplyTo)
+ ' WriteStringToLogFile(oDocuProps.UserDefinedProperties.Recipient)
+ ' WriteStringToLogFile(oDocuProps.UserDefinedProperties.References)
+ ' WriteStringToLogFile(oDocuProps.Keywords)
End Sub
@@ -454,7 +451,7 @@ Dim oSearchDesc as Object
For i = 0 to oAllHyperLinks.Count - 1
oFound = oAllHyperLinks(i)
oCrsr = oFound.Text.createTextCursorByRange(oFound)
- WriteStringToLogFile(oCrs.HyperLinkURL) 'Url
+ WriteStringToLogFile(oCrs.HyperLinkURL) 'Url
WriteStringToLogFile(oCrs.HyperLinkTarget) 'Name
WriteStringToLogFile(oCrs.HyperLinkName) 'Frame
Next i
@@ -517,14 +514,14 @@ Dim i as integer
End If
End Sub
-' ***********************************************LogDocument**************************************************
+' ***********************************************Log document**************************************************
Sub WriteStringtoLogFile( sString as String)
If (Not FieldInArray(LogArray(),LogIndex,sString))AND (NOT ISNULL(sString)) Then
LogArray(LogIndex) = sString
LogIndex = LogIndex + 1
oLogText.insertString(oLogCursor,sString,False)
- oLogText.insertControlCharacter(oLogCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
+ oLogText.insertControlCharacter(oLogCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
End If
End Sub
More information about the Libreoffice-commits
mailing list