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">&apos; *** MODULE COMMENT ***
4*1ecadb57SMathias Bauer
5*1ecadb57SMathias BauerDim oDialog AS Object
6*1ecadb57SMathias BauerDim document AS Object
7*1ecadb57SMathias Bauer
8*1ecadb57SMathias Bauer&apos;=======================================================
9*1ecadb57SMathias Bauer&apos; Main
10*1ecadb57SMathias Bauer&apos;-------------------------------------------------------
11*1ecadb57SMathias Bauer&apos; Inserts a comment
12*1ecadb57SMathias Bauer&apos;=======================================================
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(&quot;HelpAuthoring&quot;)
23*1ecadb57SMathias Bauer	oDialog = LoadDialog(&quot;HelpAuthoring&quot;, &quot;dlgComment&quot;)
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(&quot;txtComment&quot;)
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 = &quot;&quot; Then
40*1ecadb57SMathias Bauer			SetParaStyle(&quot;hlp_aux_comment&quot;)
41*1ecadb57SMathias Bauer		End If
42*1ecadb57SMathias Bauer
43*1ecadb57SMathias Bauer		If oTxtComment.Text &lt;&gt; &quot;&quot; Then
44*1ecadb57SMathias Bauer			InsertTag(&quot;COMMENT_&quot;,&quot;&lt;COMMENT&gt;&quot;)
45*1ecadb57SMathias Bauer			SetCharStyle(&quot;hlp_aux_comment&quot;)
46*1ecadb57SMathias Bauer			InsertTag(&quot;COMMENT&quot;,oTxtComment.Text)
47*1ecadb57SMathias Bauer			InsertTag(&quot;_COMMENT&quot;,&quot;&lt;/COMMENT&gt;&quot;)
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>