11ecadb57SMathias Bauer<?xml version="1.0" encoding="UTF-8"?>
21ecadb57SMathias Bauer<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3*3e02b54dSAndrew Rist<!--***********************************************************
4*3e02b54dSAndrew Rist *
5*3e02b54dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
6*3e02b54dSAndrew Rist * or more contributor license agreements.  See the NOTICE file
7*3e02b54dSAndrew Rist * distributed with this work for additional information
8*3e02b54dSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
9*3e02b54dSAndrew Rist * to you under the Apache License, Version 2.0 (the
10*3e02b54dSAndrew Rist * "License"); you may not use this file except in compliance
11*3e02b54dSAndrew Rist * with the License.  You may obtain a copy of the License at
12*3e02b54dSAndrew Rist *
13*3e02b54dSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
14*3e02b54dSAndrew Rist *
15*3e02b54dSAndrew Rist * Unless required by applicable law or agreed to in writing,
16*3e02b54dSAndrew Rist * software distributed under the License is distributed on an
17*3e02b54dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18*3e02b54dSAndrew Rist * KIND, either express or implied.  See the License for the
19*3e02b54dSAndrew Rist * specific language governing permissions and limitations
20*3e02b54dSAndrew Rist * under the License.
21*3e02b54dSAndrew Rist *
22*3e02b54dSAndrew Rist ***********************************************************-->
231ecadb57SMathias Bauer<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Comment" script:language="StarBasic">&apos; *** MODULE COMMENT ***
241ecadb57SMathias Bauer
251ecadb57SMathias BauerDim oDialog AS Object
261ecadb57SMathias BauerDim document AS Object
271ecadb57SMathias Bauer
281ecadb57SMathias Bauer&apos;=======================================================
291ecadb57SMathias Bauer&apos; Main
301ecadb57SMathias Bauer&apos;-------------------------------------------------------
311ecadb57SMathias Bauer&apos; Inserts a comment
321ecadb57SMathias Bauer&apos;=======================================================
331ecadb57SMathias BauerSub Main
341ecadb57SMathias Bauer
351ecadb57SMathias Bauer	If not IsHelpFile Then
361ecadb57SMathias Bauer		msgbox(strErr_NoHelpFile)
371ecadb57SMathias Bauer		Exit Sub
381ecadb57SMathias Bauer	End If
391ecadb57SMathias Bauer
401ecadb57SMathias Bauer	document = StarDesktop.CurrentComponent
411ecadb57SMathias Bauer
421ecadb57SMathias Bauer	BasicLibraries.LoadLibrary(&quot;HelpAuthoring&quot;)
431ecadb57SMathias Bauer	oDialog = LoadDialog(&quot;HelpAuthoring&quot;, &quot;dlgComment&quot;)
441ecadb57SMathias Bauer	oDialogModel = oDialog.Model
451ecadb57SMathias Bauer
461ecadb57SMathias Bauer	if not IsHelpFile Then
471ecadb57SMathias Bauer		msgbox(strErr_NoHelpFile)
481ecadb57SMathias Bauer		Exit Sub
491ecadb57SMathias Bauer	End If
501ecadb57SMathias Bauer
511ecadb57SMathias Bauer	oTxtComment = oDialog.GetControl(&quot;txtComment&quot;)
521ecadb57SMathias Bauer
531ecadb57SMathias Bauer	If oDialog.Execute() = 1 Then
541ecadb57SMathias Bauer		oSel = thiscomponent.getcurrentcontroller.getselection
551ecadb57SMathias Bauer		oCur = oSel(0).getText.createTextCursorByRange(oSel(0))
561ecadb57SMathias Bauer		oCur.gotoStartOfParagraph(0)
571ecadb57SMathias Bauer		oCur.gotoEndOfParagraph(1)
581ecadb57SMathias Bauer
591ecadb57SMathias Bauer		If oCur.GetString = &quot;&quot; Then
601ecadb57SMathias Bauer			SetParaStyle(&quot;hlp_aux_comment&quot;)
611ecadb57SMathias Bauer		End If
621ecadb57SMathias Bauer
631ecadb57SMathias Bauer		If oTxtComment.Text &lt;&gt; &quot;&quot; Then
641ecadb57SMathias Bauer			InsertTag(&quot;COMMENT_&quot;,&quot;&lt;COMMENT&gt;&quot;)
651ecadb57SMathias Bauer			SetCharStyle(&quot;hlp_aux_comment&quot;)
661ecadb57SMathias Bauer			InsertTag(&quot;COMMENT&quot;,oTxtComment.Text)
671ecadb57SMathias Bauer			InsertTag(&quot;_COMMENT&quot;,&quot;&lt;/COMMENT&gt;&quot;)
681ecadb57SMathias Bauer		End If
691ecadb57SMathias Bauer	End If
701ecadb57SMathias Bauer
711ecadb57SMathias Bauer	oDialog.dispose
721ecadb57SMathias Bauer
731ecadb57SMathias BauerEnd Sub
741ecadb57SMathias Bauer
75*3e02b54dSAndrew Rist</script:module>
76