1 'encoding UTF-8 Do not remove or change this line!
2 '*******************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: w_tool5.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:43:52 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/******************************************************************************
34 '* owner : helge.delfs@sun.com
36 '* short description : Description of file
38 '\******************************************************************************
40 function hLevelContent () as String
41 ' presupposition: just stay in line with the to check content
42 ' easy to enhance; on demand you can add text to the paragraph and only have to chage this function
44 ' output: paragraph content
46 wTypeKeys "<end><shift home>" 'select line
48 sTemp = GetClipboardText()
49 'i don't need the first '-', so i start searching at 2. char
50 hLevelContent = Right(sTemp, Len(sTemp)-InStr(2,sTemp,"-")
53 '------------------------------------------------------------------------------
55 function hLevelChange(aL() as integer,i as integer,x as integer ,y as integer, sublevel as boolean ) as boolean
56 ' ALSO boolean, if it schould be checked, if it got changed! else don't adjust array!!!
57 ' input: level Nr., how many levels +/-
58 ' return: false, if wrong paragraph
66 if (hLevelOk (i)) then
67 if (aL (i,1) + x) > 0 then ' CHG <-> level 'stufen'
68 ' has to work for +/- x
70 aL (i,1) = aL (i,1) + x
73 do while (aL (iTemp,1) > xTemp)
74 aL (iTemp,1) = aL (iTemp,1) + x
79 'warnlog "This makes no sense; you trie to 'move to the left'; it doesn't go further! Entry: "+i
82 do while (i <> aL(itemp,2))
85 printlog "CHG: found i="+i+" at: "+iTemp
87 ' move entry without sublevels
88 if (y < -1) OR (y > 1) then warnlog "y ! aus (-1,1) is not implemented :-( yet !"
90 xtemp = aL( itemp+y ,1)
91 aL( itemp+y ,1) = aL( itemp ,1)
93 xtemp = aL( itemp+y ,2)
94 aL( itemp+y ,2) = aL( itemp ,2)
96 if (sublevel) then ' with sublevel
97 yTemp = aL( iTemp+y ,1) ' save hor <-> level in yTemp
99 do while (aL (iTemp ,1) > yTemp)
100 xtemp = aL( itemp+sTemp ,1)
101 aL( itemp+sTemp ,1) = aL( itemp ,1)
102 aL( itemp ,1) = xtemp
103 xtemp = aL( itemp+sTemp ,2)
104 aL( itemp+sTemp ,2) = aL( itemp ,2)
105 aL( itemp ,2) = xtemp
112 xtemp = aL( itemp+j ,1) ' hori <-> level copy
113 aL( itemp+j ,1) = aL( itemp+j+1 ,1)
114 aL( itemp+j+1 ,1) = xtemp ' ^
115 xtemp = aL( itemp+j ,2) ' vert | level copy
116 aL( itemp+j ,2) = aL( itemp+j+1 ,2) ' v
117 aL( itemp+j+1 ,2) = xtemp
119 if (sublevel) then ' with sublevel
120 yTemp = aL( iTemp+y ,1) ' save hor <-> level in yTemp
122 do while (aL (iTemp,1) > yTemp)
123 xtemp = aL( itemp+y ,1)
124 aL( itemp+y ,1) = aL( itemp+y+1 ,1)
125 aL( itemp+y+1 ,1) = xtemp
126 xtemp = aL( itemp+y ,2)
127 aL( itemp+y ,2) = aL( itemp+y+1 ,2)
128 aL( itemp+y+1 ,2) = xtemp
138 '------------------------------------------------------------------------------
140 function hLevelPrint (aL()as integer) as boolean
144 ' how big is this array??!!! pd: it has to be in aL(0,0)
145 printlog "---------------------------------------------------------------------"
149 sTemp = sTemp + "..."
151 printlog sTemp + i + " "+aL(i,2)+ " +1: "+aL(i,1)
153 printlog "---------------------------------------------------------------------"
156 '------------------------------------------------------------------------------
158 function hIsNumberingBullets () as Boolean
159 '/// am i in a NumberingBullets area ?? ///'
160 '/// Output: True / False (as Boolean) ///'
161 dim NOerror as Boolean
163 hIsNumberingBullets = false
168 FormatNumberingBullets
171 Warnlog "w_tool5.inc::hIsNumberingBullets::Slot not available"
177 Active.SetPage TabBullet
180 if (remove.isEnabled) then
181 hIsNumberingBullets = true
183 hIsNumberingBullets = false
190 '------------------------------------------------------------------------------
192 sub hFormatParagraphNumbering (sStyle as string,bRestart as integer,sStartW as string)
196 Active.SetPage TabNumerierungAbsatz
197 Kontext "TabNumerierungAbsatz"
200 if (sStyle <> "") then
201 Vorlage.Select sStyle
205 if (bRestart <> -1) then
207 case 0: NumerierungNeuBeginnen.UnCheck
208 case 1: NumerierungNeuBeginnen.Check
209 case 2: NumerierungNeuBeginnen.TriState
212 if (sStartW <> -1) then
214 case 0: NumerierungBeginnenBei.UnCheck
215 case 1: NumerierungBeginnenBei.Check
219 Warnlog "Not possible; wrong style=none??"
222 TabNumerierungAbsatz.OK
226 '------------------------------------------------------------------------------
228 function hFindInDocument (sTempSearch as string) as boolean
231 hFindInDocument = FALSE
232 Call hFindeImDokument (sTempSearch, 1)
234 sTemp = right (GetClipboardText(), len(sTempSearch))
235 if (sTemp <> sTempSearch) then
236 Warnlog "Found: '" & sTemp & "' and not: " & sTempSearch
237 hFindInDocument = FALSE
239 hFindInDocument = TRUE