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="OtherElements" script:language="StarBasic">REM ***** BASIC ***** 241ecadb57SMathias Bauer 251ecadb57SMathias BauerSub Main 261ecadb57SMathias Bauer 271ecadb57SMathias BauerEnd Sub 281ecadb57SMathias Bauer 291ecadb57SMathias BauerSub InsertVariable 301ecadb57SMathias Bauer 311ecadb57SMathias Bauer If not IsHelpFile Then 321ecadb57SMathias Bauer msgbox(strErr_NoHelpFile) 331ecadb57SMathias Bauer Exit Sub 341ecadb57SMathias Bauer End If 351ecadb57SMathias Bauer 361ecadb57SMathias Bauer oSel = thiscomponent.getcurrentcontroller.getselection 371ecadb57SMathias Bauer oCur = oSel(0).getText.createTextCursorByRange(oSel(0)) 381ecadb57SMathias Bauer oStart = oCur.getStart 391ecadb57SMathias Bauer oCurStart = oStart.getText.createTextCursorByRange(oStart) 401ecadb57SMathias Bauer oEnd = oCur.getEnd 411ecadb57SMathias Bauer oCurEnd = oEnd.getText.createTextCursorByRange(oEnd) 421ecadb57SMathias Bauer 431ecadb57SMathias Bauer ID = inputbox("Enter an identifier for the variable element:","Enter Variable ID") 441ecadb57SMathias Bauer 451ecadb57SMathias Bauer If ID="" Then 461ecadb57SMathias Bauer Exit Sub 471ecadb57SMathias Bauer End If 481ecadb57SMathias Bauer 491ecadb57SMathias Bauer thiscomponent.getcurrentcontroller.select(oCurStart) 501ecadb57SMathias Bauer InsertTag("VAR_","<VAR ID="""+ID+""">") 511ecadb57SMathias Bauer thiscomponent.getcurrentcontroller.select(oCurEnd) 521ecadb57SMathias Bauer InsertTag("_VAR","</VAR>") 531ecadb57SMathias BauerEnd Sub 541ecadb57SMathias Bauer 551ecadb57SMathias BauerSub InsertInlineGraphic 561ecadb57SMathias Bauer If not IsHelpFile Then 571ecadb57SMathias Bauer msgbox(strErr_NoHelpFile) 581ecadb57SMathias Bauer Exit Sub 591ecadb57SMathias Bauer End If 601ecadb57SMathias Bauer sFName = OpenGraphics 611ecadb57SMathias Bauer If sFName <> "" Then 621ecadb57SMathias Bauer sAlt = InputBox("Enter an alternative Text for the graphical element."+chr(13)+"This can be changed later in the image properties.","ALT description","<ALT DESCRIPTION>") 631ecadb57SMathias Bauer sID = "img_id"+CreateID 641ecadb57SMathias Bauer InsertTag("IMG_","<IMG ID="""+sID+""">") 651ecadb57SMathias Bauer InsertGraphicFile(sFName,sID,sAlt) 661ecadb57SMathias Bauer InsertTag("_IMG","</IMG>") 671ecadb57SMathias Bauer End If 681ecadb57SMathias BauerEnd Sub 691ecadb57SMathias Bauer 701ecadb57SMathias BauerSub InsertGraphic 711ecadb57SMathias Bauer 721ecadb57SMathias Bauer If not IsHelpFile Then 731ecadb57SMathias Bauer msgbox(strErr_NoHelpFile) 741ecadb57SMathias Bauer Exit Sub 751ecadb57SMathias Bauer End If 761ecadb57SMathias Bauer 771ecadb57SMathias Bauer GlobalScope.BasicLibraries.loadLibrary("Tools") 781ecadb57SMathias Bauer sFName = OpenGraphics 791ecadb57SMathias Bauer If sFName <> "" Then 801ecadb57SMathias Bauer DocRoot = ReadConfig("HelpPrefix") 811ecadb57SMathias Bauer' msgbox("DocRoot "+DocRoot+chr(13)+"FName "+sFName) 821ecadb57SMathias Bauer 831ecadb57SMathias Bauer If not(IsSubDir(sFName,DocRoot)) Then 841ecadb57SMathias Bauer msgbox("Image is located outside of your Document Root"+chr(13)+DocRoot,48,"Warning") 851ecadb57SMathias Bauer End If 861ecadb57SMathias Bauer 871ecadb57SMathias Bauer sAlt = InputBox("Enter an alternative Text for the graphical element."+chr(13)+"This can be changed later in the image properties.","ALT description","<ALT DESCRIPTION>") 881ecadb57SMathias Bauer' sCap = InputBox("Enter a caption for the image (optional)","Caption","") 891ecadb57SMathias Bauer sID = CreateID 901ecadb57SMathias Bauer CR 911ecadb57SMathias Bauer InsertTag("IMG_","<IMG ID="""+"img_id"+sID+""">") 921ecadb57SMathias Bauer InsertGraphicFile(sFName,"img_id"+sID,sAlt) 931ecadb57SMathias Bauer' If sCap <> "" Then 941ecadb57SMathias Bauer' InsertCaption(sCap,"cap_id"+sID) 951ecadb57SMathias Bauer' End If 961ecadb57SMathias Bauer InsertTag("_IMG","</IMG>") 971ecadb57SMathias Bauer End If 981ecadb57SMathias BauerEnd Sub 991ecadb57SMathias Bauer 1001ecadb57SMathias Bauer 1011ecadb57SMathias BauerSub InsertGraphicFile(sURL As String, sName As String, sAlt As String) 1021ecadb57SMathias Bauer oSel = thiscomponent.getcurrentcontroller.getselection 1031ecadb57SMathias Bauer oCur = oSel(0).getText.createTextCursorByRange(oSel(0)) 1041ecadb57SMathias Bauer oDoc = StarDesktop.CurrentComponent 1051ecadb57SMathias Bauer oGrp = oDoc.createInstance("com.sun.star.text.GraphicObject") 1061ecadb57SMathias Bauer oGrp.GraphicURL = sURL 1071ecadb57SMathias Bauer oGrp.AnchorType = 1 1081ecadb57SMathias Bauer oGrp.Name = sName 1091ecadb57SMathias Bauer oGrp.Title = sAlt 1101ecadb57SMathias Bauer oCur.Text.InsertTextContent(oCur,oGrp,true) 1111ecadb57SMathias BauerEnd Sub 1121ecadb57SMathias Bauer 1131ecadb57SMathias BauerSub SpecifyCaption 1141ecadb57SMathias Bauer 'check if the image allows captions 1151ecadb57SMathias Bauer If thiscomponent.getcurrentcontroller.getselection.ImplementationName = "SwXTextGraphicObject" Then 1161ecadb57SMathias Bauer msgbox "Please press ESCAPE to deselect the image and recall the menu item" 1171ecadb57SMathias Bauer Exit Sub 1181ecadb57SMathias Bauer End If 1191ecadb57SMathias Bauer If IsBlockImage Then 1201ecadb57SMathias Bauer If not(HasCaption) Then 1211ecadb57SMathias Bauer sCap = InputBox("Enter a caption for the image (optional)","Caption","") 1221ecadb57SMathias Bauer If sCap <> "" Then 1231ecadb57SMathias Bauer sID = GetImageID 1241ecadb57SMathias Bauer sID = "cap"+right(sID, Len(sID)-3) 1251ecadb57SMathias Bauer GoLeft(1) 1261ecadb57SMathias Bauer InsertCaption(sCap, sID) 1271ecadb57SMathias Bauer End If 1281ecadb57SMathias Bauer Else 1291ecadb57SMathias Bauer msgbox "Image has a caption already.",0,"D'oh!" 1301ecadb57SMathias Bauer End If 1311ecadb57SMathias Bauer Else 1321ecadb57SMathias Bauer msgbox "Only block images may have captions.",0,"D'oh!" 1331ecadb57SMathias Bauer End If 1341ecadb57SMathias BauerEnd Sub 1351ecadb57SMathias Bauer 1361ecadb57SMathias BauerSub InsertCaption(sCap As String, sID as String) 1371ecadb57SMathias Bauer InsertTag("IMGCAPTION_","<IMGCAPTION id="""+sID+""">") 1381ecadb57SMathias Bauer InsertText(sCap) 1391ecadb57SMathias Bauer InsertTag("_IMGCAPTION","</IMGCAPTION>") 1401ecadb57SMathias BauerEnd Sub 1411ecadb57SMathias Bauer 1421ecadb57SMathias BauerSub InsertExtendedTip 1431ecadb57SMathias Bauer 1441ecadb57SMathias Bauer If not IsHelpFile Then 1451ecadb57SMathias Bauer msgbox(strErr_NoHelpFile) 1461ecadb57SMathias Bauer Exit Sub 1471ecadb57SMathias Bauer End If 1481ecadb57SMathias Bauer 1491ecadb57SMathias Bauer oSel = thiscomponent.getcurrentcontroller.getselection 1501ecadb57SMathias Bauer oCur = oSel(0).getText.createTextCursorByRange(oSel(0)) 1511ecadb57SMathias Bauer oStart = oCur.getStart 1521ecadb57SMathias Bauer oCurStart = oStart.getText.createTextCursorByRange(oStart) 1531ecadb57SMathias Bauer oEnd = oCur.getEnd 1541ecadb57SMathias Bauer oCurEnd = oEnd.getText.createTextCursorByRange(oEnd) 1551ecadb57SMathias Bauer 1561ecadb57SMathias Bauer Ret = msgbox ("Create a hidden tip?",3+32,"Extended Tip") 1571ecadb57SMathias Bauer 1581ecadb57SMathias Bauer If Ret=2 or Ret=3 Then 1591ecadb57SMathias Bauer Exit Sub 1601ecadb57SMathias Bauer End If 1611ecadb57SMathias Bauer 1621ecadb57SMathias Bauer thiscomponent.getcurrentcontroller.select(oCurStart) 1631ecadb57SMathias Bauer If Ret=6 Then 1641ecadb57SMathias Bauer InsertTag("AHID_","<AHID hid="""+ID+""">") 1651ecadb57SMathias Bauer ElseIf Ret=7 Then 1661ecadb57SMathias Bauer InsertTag("AVIS_","<AVIS hid="""+ID+""">") 1671ecadb57SMathias Bauer End If 1681ecadb57SMathias Bauer thiscomponent.getcurrentcontroller.select(oCurEnd) 1691ecadb57SMathias Bauer If Ret=6 Then 1701ecadb57SMathias Bauer InsertTag("_AHID","</AHID>") 1711ecadb57SMathias Bauer ElseIf Ret=7 Then 1721ecadb57SMathias Bauer InsertTag("_AVIS","</AVIS>") 1731ecadb57SMathias Bauer End If 1741ecadb57SMathias BauerEnd Sub 1751ecadb57SMathias Bauer 1761ecadb57SMathias BauerSub InsertSort 1771ecadb57SMathias Bauer CR 1781ecadb57SMathias Bauer SetParaStyle("hlp_aux_sort") 1791ecadb57SMathias Bauer InsertTag("SORT_","<SORT order=""asc"">","hlp_aux_sort") 1801ecadb57SMathias Bauer GoLeft(1) 1811ecadb57SMathias Bauer GoDown(1) 1821ecadb57SMathias Bauer msgbox "Remember to also specify the closing SORT tag!",48,"Don't forget to close the tag" 1831ecadb57SMathias BauerEnd Sub 1841ecadb57SMathias Bauer 1851ecadb57SMathias BauerSub CloseSort 1861ecadb57SMathias Bauer CR 1871ecadb57SMathias Bauer SetParaStyle("hlp_aux_sort") 1881ecadb57SMathias Bauer InsertTag("_SORT","</SORT>","hlp_aux_sort") 1891ecadb57SMathias Bauer GoLeft(1) 1901ecadb57SMathias Bauer GoDown(1) 1911ecadb57SMathias BauerEnd Sub 1921ecadb57SMathias Bauer 1931ecadb57SMathias Bauersub InsertSection 1941ecadb57SMathias Bauer 1951ecadb57SMathias Bauer 1961ecadb57SMathias Bauer If not IsHelpFile Then 1971ecadb57SMathias Bauer msgbox(strErr_NoHelpFile) 1981ecadb57SMathias Bauer Exit Sub 1991ecadb57SMathias Bauer End If 2001ecadb57SMathias Bauer 2011ecadb57SMathias Bauer dim document as object 2021ecadb57SMathias Bauer dim dispatcher as object 2031ecadb57SMathias Bauer 2041ecadb57SMathias Bauer oSel = thiscomponent.getcurrentcontroller.getselection 2051ecadb57SMathias Bauer oCur = oSel(0).getText.createTextCursorByRange(oSel(0)) 2061ecadb57SMathias Bauer oStart = oCur.getStart 2071ecadb57SMathias Bauer oCurStart = oStart.getText.createTextCursorByRange(oStart) 2081ecadb57SMathias Bauer oEnd = oCur.getEnd 2091ecadb57SMathias Bauer oCurEnd = oEnd.getText.createTextCursorByRange(oEnd) 2101ecadb57SMathias Bauer 2111ecadb57SMathias Bauer sSectionName = AlphaNum(inputbox("Please specify a section name/identifier:")) 2121ecadb57SMathias Bauer 2131ecadb57SMathias Bauer If sSectionName = "" Then 2141ecadb57SMathias Bauer Exit Sub 2151ecadb57SMathias Bauer End If 2161ecadb57SMathias Bauer 2171ecadb57SMathias Bauer If sSectionName = "" Then 2181ecadb57SMathias Bauer msgbox "No (valid) identifier -- no section."+chr(13)+"Hint: Use only A-Z,a-z,0-9 and _",48,"D'oh!" 2191ecadb57SMathias Bauer Exit Sub 2201ecadb57SMathias Bauer End If 2211ecadb57SMathias Bauer 2221ecadb57SMathias Bauer document = ThisComponent.CurrentController.Frame 2231ecadb57SMathias Bauer dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") 2241ecadb57SMathias Bauer 2251ecadb57SMathias Bauer dim args(6) as new com.sun.star.beans.PropertyValue 2261ecadb57SMathias Bauer args(0).Name = "RegionName" 2271ecadb57SMathias Bauer args(0).Value = sSectionName 2281ecadb57SMathias Bauer args(1).Name = "RegionCondition" 2291ecadb57SMathias Bauer args(1).Value = "" 2301ecadb57SMathias Bauer args(2).Name = "RegionHidden" 2311ecadb57SMathias Bauer args(2).Value = false 2321ecadb57SMathias Bauer args(3).Name = "RegionProtect" 2331ecadb57SMathias Bauer args(3).Value = false 2341ecadb57SMathias Bauer args(4).Name = "LinkName" 2351ecadb57SMathias Bauer args(4).Value = "" 2361ecadb57SMathias Bauer args(5).Name = "FilterName" 2371ecadb57SMathias Bauer args(5).Value = "" 2381ecadb57SMathias Bauer args(6).Name = "SubRegion" 2391ecadb57SMathias Bauer args(6).Value = "" 2401ecadb57SMathias Bauer 2411ecadb57SMathias Bauer dispatcher.executeDispatch(document, ".uno:InsertSection", "", 0, args()) 2421ecadb57SMathias Bauer 2431ecadb57SMathias Bauer If oCur.GetString <> "" Then 2441ecadb57SMathias Bauer thiscomponent.getcurrentcontroller.select(oCurStart) 2451ecadb57SMathias Bauer CR_before 2461ecadb57SMathias Bauer GoUp(1) 2471ecadb57SMathias Bauer InsertTag("SECTION_","<SECTION id="""+sSectionName+""">") 2481ecadb57SMathias Bauer SetParaStyle("hlp_aux_section") 2491ecadb57SMathias Bauer 2501ecadb57SMathias Bauer thiscomponent.getcurrentcontroller.select(oCurEnd) 2511ecadb57SMathias Bauer CR 2521ecadb57SMathias Bauer SetParaStyle("hlp_aux_section") 2531ecadb57SMathias Bauer InsertTag("_SECTION","</SECTION>") 2541ecadb57SMathias Bauer Else 2551ecadb57SMathias Bauer GoUp(1) 2561ecadb57SMathias Bauer InsertTagCR("SECTION_","<SECTION id="""+sSectionName+""">","hlp_aux_section") 2571ecadb57SMathias Bauer CR 2581ecadb57SMathias Bauer SetParaStyle("hlp_aux_section") 2591ecadb57SMathias Bauer InsertTag("_SECTION","</SECTION>") 2601ecadb57SMathias Bauer GoUp(1) 2611ecadb57SMathias Bauer SetParaStyle("hlp_default") 2621ecadb57SMathias Bauer End If 2631ecadb57SMathias Bauer 2641ecadb57SMathias Bauerend sub 2651ecadb57SMathias Bauer 2661ecadb57SMathias BauerSub ToggleParaL10NStatus 2671ecadb57SMathias Bauer 2681ecadb57SMathias Bauer If not IsHelpFile Then 2691ecadb57SMathias Bauer msgbox(strErr_NoHelpFile) 2701ecadb57SMathias Bauer Exit Sub 2711ecadb57SMathias Bauer End If 2721ecadb57SMathias Bauer 2731ecadb57SMathias Bauer oSel = thiscomponent.getcurrentcontroller.getselection 2741ecadb57SMathias Bauer oCur = oSel(0).getText.createTextCursorByRange(oSel(0)) 2751ecadb57SMathias Bauer 2761ecadb57SMathias Bauer oCur.gotoStartOfParagraph(0) 2771ecadb57SMathias Bauer CharStyle = oCur.charStyleName 2781ecadb57SMathias Bauer 2791ecadb57SMathias Bauer arParaData = GetParaData 2801ecadb57SMathias Bauer sID = arParaData(0) 2811ecadb57SMathias Bauer slocalize = arParaData(1) 2821ecadb57SMathias Bauer sMsg = arParaData(2) 2831ecadb57SMathias Bauer 2841ecadb57SMathias Bauer If sMsg <> "" Then 2851ecadb57SMathias Bauer msgbox "Error in paragraph status:"+chr(13)+sMsg,48,"Error" 2861ecadb57SMathias Bauer Exit Sub 2871ecadb57SMathias Bauer End If 2881ecadb57SMathias Bauer 2891ecadb57SMathias Bauer 2901ecadb57SMathias Bauer If (sID = "") Then 2911ecadb57SMathias Bauer msgbox "Paragraph has no ID. Assigning ID.",48,"Info" 2921ecadb57SMathias Bauer InsertNewParaData 2931ecadb57SMathias Bauer thiscomponent.getcurrentcontroller.select(oSel(0)) 2941ecadb57SMathias Bauer arParaData = GetParaData 2951ecadb57SMathias Bauer sID = arParaData(0) 2961ecadb57SMathias Bauer slocalize = arParaData(1) 2971ecadb57SMathias Bauer sMsg = arParaData(2) 2981ecadb57SMathias Bauer End If 2991ecadb57SMathias Bauer 3001ecadb57SMathias Bauer If slocalize = "no" Then 3011ecadb57SMathias Bauer SetParaData(sID,"yes") 3021ecadb57SMathias Bauer Else 3031ecadb57SMathias Bauer SetParaData(sID,"no") 3041ecadb57SMathias Bauer End If 3051ecadb57SMathias Bauer 3061ecadb57SMathias Bauer thiscomponent.getcurrentcontroller.select(oSel(0)) 3071ecadb57SMathias Bauer 3081ecadb57SMathias BauerEnd Sub 3091ecadb57SMathias Bauer 3101ecadb57SMathias Bauer 3111ecadb57SMathias BauerSub LocalizeImage 3121ecadb57SMathias Bauer oSel = thiscomponent.getcurrentcontroller.getselection 3131ecadb57SMathias Bauer If oSel(0).ImplementationName <> "SwXTextGraphicObject" Then 3141ecadb57SMathias Bauer msgbox "Please select an image" 3151ecadb57SMathias Bauer Else 3161ecadb57SMathias Bauer If Instr(oSel(0).Name," ")>0 Then 3171ecadb57SMathias Bauer oSel(0).Name = Left(oSel(0).Name,Instr(oSel(0).Name," ")-1) 3181ecadb57SMathias Bauer End If 3191ecadb57SMathias Bauer oSel(0).Name = oSel(0).Name + " localize=""true""" 3201ecadb57SMathias Bauer End If 3211ecadb57SMathias Bauer SetBorder 3221ecadb57SMathias BauerEnd Sub 3231ecadb57SMathias Bauer 3241ecadb57SMathias Bauer 3251ecadb57SMathias BauerSub UnLocalizeImage 3261ecadb57SMathias Bauer oSel = thiscomponent.getcurrentcontroller.getselection 3271ecadb57SMathias Bauer If oSel(0).ImplementationName <> "SwXTextGraphicObject" Then 3281ecadb57SMathias Bauer msgbox "Please select an image" 3291ecadb57SMathias Bauer Else 3301ecadb57SMathias Bauer 3311ecadb57SMathias Bauer If Instr(oSel(0).Name," ")>0 Then 3321ecadb57SMathias Bauer oSel(0).Name = Left(oSel(0).Name,Instr(oSel(0).Name," ")-1) 3331ecadb57SMathias Bauer End If 3341ecadb57SMathias Bauer UnsetBorder 3351ecadb57SMathias Bauer End If 3361ecadb57SMathias Bauer 3371ecadb57SMathias BauerEnd Sub 3381ecadb57SMathias Bauer 3391ecadb57SMathias Bauer 3401ecadb57SMathias BauerSub ResetAllParaStatusValues 3411ecadb57SMathias Bauer REM ... to be done 3421ecadb57SMathias BauerEnd Sub 3431ecadb57SMathias Bauer 3441ecadb57SMathias BauerSub InsertHowToGet 3451ecadb57SMathias Bauer 3461ecadb57SMathias Bauer If not IsHelpFile Then 3471ecadb57SMathias Bauer msgbox(strErr_NoHelpFile) 3481ecadb57SMathias Bauer Exit Sub 3491ecadb57SMathias Bauer End If 3501ecadb57SMathias Bauer 3511ecadb57SMathias Bauer document = ThisComponent.CurrentController.Frame 3521ecadb57SMathias Bauer dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") 3531ecadb57SMathias Bauer 3541ecadb57SMathias Bauer dim args(6) as new com.sun.star.beans.PropertyValue 3551ecadb57SMathias Bauer args(0).Name = "RegionName" 3561ecadb57SMathias Bauer args(0).Value = "howtoget" 3571ecadb57SMathias Bauer args(1).Name = "RegionCondition" 3581ecadb57SMathias Bauer args(1).Value = "" 3591ecadb57SMathias Bauer args(2).Name = "RegionHidden" 3601ecadb57SMathias Bauer args(2).Value = false 3611ecadb57SMathias Bauer args(3).Name = "RegionProtect" 3621ecadb57SMathias Bauer args(3).Value = false 3631ecadb57SMathias Bauer args(4).Name = "LinkName" 3641ecadb57SMathias Bauer args(4).Value = "" 3651ecadb57SMathias Bauer args(5).Name = "FilterName" 3661ecadb57SMathias Bauer args(5).Value = "" 3671ecadb57SMathias Bauer args(6).Name = "SubRegion" 3681ecadb57SMathias Bauer args(6).Value = "" 3691ecadb57SMathias Bauer 3701ecadb57SMathias Bauer dispatcher.executeDispatch(document, ".uno:InsertSection", "", 0, args()) 3711ecadb57SMathias Bauer GoUp(1) 3721ecadb57SMathias Bauer InsertTagCR("SECTION_","<SECTION id=""howtoget"">","hlp_aux_section") 3731ecadb57SMathias Bauer CR 3741ecadb57SMathias Bauer SetParaStyle("hlp_aux_section") 3751ecadb57SMathias Bauer InsertTag("_SECTION","</SECTION>") 3761ecadb57SMathias Bauer GoUp(1) 3771ecadb57SMathias Bauer SetParaStyle("hlp_default") 3781ecadb57SMathias Bauer' Embed.Main(false) 3791ecadb57SMathias BauerEnd Sub 3801ecadb57SMathias Bauer 3811ecadb57SMathias BauerSub InsertRelatedTopics 3821ecadb57SMathias Bauer 3831ecadb57SMathias Bauer If not IsHelpFile Then 3841ecadb57SMathias Bauer msgbox(strErr_NoHelpFile) 3851ecadb57SMathias Bauer Exit Sub 3861ecadb57SMathias Bauer End If 3871ecadb57SMathias Bauer 3881ecadb57SMathias Bauer document = ThisComponent.CurrentController.Frame 3891ecadb57SMathias Bauer dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") 3901ecadb57SMathias Bauer 3911ecadb57SMathias Bauer dim args(6) as new com.sun.star.beans.PropertyValue 3921ecadb57SMathias Bauer args(0).Name = "RegionName" 3931ecadb57SMathias Bauer args(0).Value = "relatedtopics" 3941ecadb57SMathias Bauer args(1).Name = "RegionCondition" 3951ecadb57SMathias Bauer args(1).Value = "" 3961ecadb57SMathias Bauer args(2).Name = "RegionHidden" 3971ecadb57SMathias Bauer args(2).Value = false 3981ecadb57SMathias Bauer args(3).Name = "RegionProtect" 3991ecadb57SMathias Bauer args(3).Value = false 4001ecadb57SMathias Bauer args(4).Name = "LinkName" 4011ecadb57SMathias Bauer args(4).Value = "" 4021ecadb57SMathias Bauer args(5).Name = "FilterName" 4031ecadb57SMathias Bauer args(5).Value = "" 4041ecadb57SMathias Bauer args(6).Name = "SubRegion" 4051ecadb57SMathias Bauer args(6).Value = "" 4061ecadb57SMathias Bauer 4071ecadb57SMathias Bauer dispatcher.executeDispatch(document, ".uno:InsertSection", "", 0, args()) 4081ecadb57SMathias Bauer GoUp(1) 4091ecadb57SMathias Bauer InsertTagCR("SECTION_","<SECTION id=""relatedtopics"">","hlp_aux_section") 4101ecadb57SMathias Bauer CR 4111ecadb57SMathias Bauer SetParaStyle("hlp_aux_section") 4121ecadb57SMathias Bauer InsertTag("_SECTION","</SECTION>") 4131ecadb57SMathias Bauer GoUp(1) 4141ecadb57SMathias Bauer SetParaStyle("hlp_default") 4151ecadb57SMathias BauerEnd Sub 4161ecadb57SMathias Bauer 4171ecadb57SMathias Bauer 4181ecadb57SMathias Bauersub UnsetBorder 4191ecadb57SMathias Bauerrem ---------------------------------------------------------------------- 4201ecadb57SMathias Bauerrem define variables 4211ecadb57SMathias Bauerdim document as object 4221ecadb57SMathias Bauerdim dispatcher as object 4231ecadb57SMathias Bauerrem ---------------------------------------------------------------------- 4241ecadb57SMathias Bauerrem get access to the document 4251ecadb57SMathias Bauerdocument = ThisComponent.CurrentController.Frame 4261ecadb57SMathias Bauerdispatcher = createUnoService("com.sun.star.frame.DispatchHelper") 4271ecadb57SMathias Bauer 4281ecadb57SMathias Bauerrem ---------------------------------------------------------------------- 4291ecadb57SMathias Bauerdim args1(7) as new com.sun.star.beans.PropertyValue 4301ecadb57SMathias Bauerargs1(0).Name = "BorderOuter.LeftBorder" 4311ecadb57SMathias Bauerargs1(0).Value = Array(0,0,0,0) 4321ecadb57SMathias Bauerargs1(1).Name = "BorderOuter.LeftDistance" 4331ecadb57SMathias Bauerargs1(1).Value = 10 4341ecadb57SMathias Bauerargs1(2).Name = "BorderOuter.RightBorder" 4351ecadb57SMathias Bauerargs1(2).Value = Array(0,0,0,0) 4361ecadb57SMathias Bauerargs1(3).Name = "BorderOuter.RightDistance" 4371ecadb57SMathias Bauerargs1(3).Value = 0 4381ecadb57SMathias Bauerargs1(4).Name = "BorderOuter.TopBorder" 4391ecadb57SMathias Bauerargs1(4).Value = Array(0,0,0,0) 4401ecadb57SMathias Bauerargs1(5).Name = "BorderOuter.TopDistance" 4411ecadb57SMathias Bauerargs1(5).Value = 0 4421ecadb57SMathias Bauerargs1(6).Name = "BorderOuter.BottomBorder" 4431ecadb57SMathias Bauerargs1(6).Value = Array(0,0,0,0) 4441ecadb57SMathias Bauerargs1(7).Name = "BorderOuter.BottomDistance" 4451ecadb57SMathias Bauerargs1(7).Value = 0 4461ecadb57SMathias Bauer 4471ecadb57SMathias Bauerdispatcher.executeDispatch(document, ".uno:BorderOuter", "", 0, args1()) 4481ecadb57SMathias Bauer 4491ecadb57SMathias Bauerrem ---------------------------------------------------------------------- 4501ecadb57SMathias Bauerdim args2(4) as new com.sun.star.beans.PropertyValue 4511ecadb57SMathias Bauerargs2(0).Name = "BorderInner.Horizontal" 4521ecadb57SMathias Bauerargs2(0).Value = Array(0,0,0,0) 4531ecadb57SMathias Bauerargs2(1).Name = "BorderInner.Vertical" 4541ecadb57SMathias Bauerargs2(1).Value = Array(0,0,0,0) 4551ecadb57SMathias Bauerargs2(2).Name = "BorderInner.Flags" 4561ecadb57SMathias Bauerargs2(2).Value = 2 4571ecadb57SMathias Bauerargs2(3).Name = "BorderInner.ValidFlags" 4581ecadb57SMathias Bauerargs2(3).Value = 63 4591ecadb57SMathias Bauerargs2(4).Name = "BorderInner.DefaultDistance" 4601ecadb57SMathias Bauerargs2(4).Value = 0 4611ecadb57SMathias Bauer 4621ecadb57SMathias Bauerdispatcher.executeDispatch(document, ".uno:BorderInner", "", 0, args2()) 4631ecadb57SMathias Bauer 4641ecadb57SMathias Bauer 4651ecadb57SMathias Bauerend sub 4661ecadb57SMathias Bauer 4671ecadb57SMathias Bauer 4681ecadb57SMathias Bauer 4691ecadb57SMathias Bauersub SetBorder 4701ecadb57SMathias Bauerrem ---------------------------------------------------------------------- 4711ecadb57SMathias Bauerrem define variables 4721ecadb57SMathias Bauerdim document as object 4731ecadb57SMathias Bauerdim dispatcher as object 4741ecadb57SMathias Bauerrem ---------------------------------------------------------------------- 4751ecadb57SMathias Bauerrem get access to the document 4761ecadb57SMathias Bauerdocument = ThisComponent.CurrentController.Frame 4771ecadb57SMathias Bauerdispatcher = createUnoService("com.sun.star.frame.DispatchHelper") 4781ecadb57SMathias Bauer 4791ecadb57SMathias Bauerrem ---------------------------------------------------------------------- 4801ecadb57SMathias Bauerdim args1(7) as new com.sun.star.beans.PropertyValue 4811ecadb57SMathias Bauerargs1(0).Name = "BorderOuter.LeftBorder" 4821ecadb57SMathias Bauerargs1(0).Value = Array(15167232,0,88,0) 4831ecadb57SMathias Bauerargs1(1).Name = "BorderOuter.LeftDistance" 4841ecadb57SMathias Bauerargs1(1).Value = 101 4851ecadb57SMathias Bauerargs1(2).Name = "BorderOuter.RightBorder" 4861ecadb57SMathias Bauerargs1(2).Value = Array(15167232,0,88,0) 4871ecadb57SMathias Bauerargs1(3).Name = "BorderOuter.RightDistance" 4881ecadb57SMathias Bauerargs1(3).Value = 101 4891ecadb57SMathias Bauerargs1(4).Name = "BorderOuter.TopBorder" 4901ecadb57SMathias Bauerargs1(4).Value = Array(15167232,0,88,0) 4911ecadb57SMathias Bauerargs1(5).Name = "BorderOuter.TopDistance" 4921ecadb57SMathias Bauerargs1(5).Value = 101 4931ecadb57SMathias Bauerargs1(6).Name = "BorderOuter.BottomBorder" 4941ecadb57SMathias Bauerargs1(6).Value = Array(15167232,0,88,0) 4951ecadb57SMathias Bauerargs1(7).Name = "BorderOuter.BottomDistance" 4961ecadb57SMathias Bauerargs1(7).Value = 101 4971ecadb57SMathias Bauer 4981ecadb57SMathias Bauerdispatcher.executeDispatch(document, ".uno:BorderOuter", "", 0, args1()) 4991ecadb57SMathias Bauer 5001ecadb57SMathias Bauerrem ---------------------------------------------------------------------- 5011ecadb57SMathias Bauerdim args2(4) as new com.sun.star.beans.PropertyValue 5021ecadb57SMathias Bauerargs2(0).Name = "BorderInner.Horizontal" 5031ecadb57SMathias Bauerargs2(0).Value = Array(0,0,0,0) 5041ecadb57SMathias Bauerargs2(1).Name = "BorderInner.Vertical" 5051ecadb57SMathias Bauerargs2(1).Value = Array(0,0,0,0) 5061ecadb57SMathias Bauerargs2(2).Name = "BorderInner.Flags" 5071ecadb57SMathias Bauerargs2(2).Value = 2 5081ecadb57SMathias Bauerargs2(3).Name = "BorderInner.ValidFlags" 5091ecadb57SMathias Bauerargs2(3).Value = 127 5101ecadb57SMathias Bauerargs2(4).Name = "BorderInner.DefaultDistance" 5111ecadb57SMathias Bauerargs2(4).Value = 0 5121ecadb57SMathias Bauer 5131ecadb57SMathias Bauerdispatcher.executeDispatch(document, ".uno:BorderInner", "", 0, args2()) 5141ecadb57SMathias Bauer 5151ecadb57SMathias Bauer 5161ecadb57SMathias Bauerend sub 517*3e02b54dSAndrew Rist</script:module> 518