1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> 3<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Comment" script:language="StarBasic">' *** MODULE COMMENT *** 4 5Dim oDialog AS Object 6Dim document AS Object 7 8'======================================================= 9' Main 10'------------------------------------------------------- 11' Inserts a comment 12'======================================================= 13Sub Main 14 15 If not IsHelpFile Then 16 msgbox(strErr_NoHelpFile) 17 Exit Sub 18 End If 19 20 document = StarDesktop.CurrentComponent 21 22 BasicLibraries.LoadLibrary("HelpAuthoring") 23 oDialog = LoadDialog("HelpAuthoring", "dlgComment") 24 oDialogModel = oDialog.Model 25 26 if not IsHelpFile Then 27 msgbox(strErr_NoHelpFile) 28 Exit Sub 29 End If 30 31 oTxtComment = oDialog.GetControl("txtComment") 32 33 If oDialog.Execute() = 1 Then 34 oSel = thiscomponent.getcurrentcontroller.getselection 35 oCur = oSel(0).getText.createTextCursorByRange(oSel(0)) 36 oCur.gotoStartOfParagraph(0) 37 oCur.gotoEndOfParagraph(1) 38 39 If oCur.GetString = "" Then 40 SetParaStyle("hlp_aux_comment") 41 End If 42 43 If oTxtComment.Text <> "" Then 44 InsertTag("COMMENT_","<COMMENT>") 45 SetCharStyle("hlp_aux_comment") 46 InsertTag("COMMENT",oTxtComment.Text) 47 InsertTag("_COMMENT","</COMMENT>") 48 End If 49 End If 50 51 oDialog.dispose 52 53End Sub 54 55</script:module>