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