Hard.xba (3e02b54d) Hard.xba (b53bcc32)
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3<!--***********************************************************
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3<!--***********************************************************
4 *
4 *
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
12 *
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
14 *
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
20 * under the License.
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
20 * under the License.
21 *
21 *
22 ***********************************************************-->
22 ***********************************************************-->
23<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Hard" script:language="StarBasic">REM ***** BASIC *****
23<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Hard" script:language="StarBasic">REM ***** BASIC *****
24Option Explicit
25
26
27Sub CreateRangeList()
28Dim MaxIndex as Integer
29 MaxIndex = -1
30 EnableStep1DialogControls(False, False, False)
31 EmptySelection()

--- 51 unchanged lines hidden (view full) ---

83 End If
84 If MaxIndex &gt; -1 Then
85 ReDim Preserve RangeList(MaxIndex)
86 Else
87 ReDim RangeList()
88 End If
89 Rangeindex = MaxIndex
90End Sub
24Option Explicit
25
26
27Sub CreateRangeList()
28Dim MaxIndex as Integer
29 MaxIndex = -1
30 EnableStep1DialogControls(False, False, False)
31 EmptySelection()

--- 51 unchanged lines hidden (view full) ---

83 End If
84 If MaxIndex &gt; -1 Then
85 ReDim Preserve RangeList(MaxIndex)
86 Else
87 ReDim RangeList()
88 End If
89 Rangeindex = MaxIndex
90End Sub
91
92
91
92
93Function AddSheetRanges(oRanges as Object, r as Integer, oSheet as Object, bAutopilot)
94Dim RangeName as String
95Dim AddtoList as Boolean
96Dim iCurStep as Integer
97Dim MaxIndex as Integer
98 iCurStep = DialogModel.Step
99 While oRanges.hasMoreElements
100 oRange = oRanges.NextElement

--- 62 unchanged lines hidden (view full) ---

163 &apos; hard format
164 For i = 0 To LastIndex
165 RangeName = ListboxList(i)
166 oRange = RetrieveRangeoutofRangeName(RangeName)
167 ConvertCellCurrencies(oRange)
168 If bRemove Then
169 If oSelRanges.HasbyName(RangeName) Then
170 oSelRanges.RemovebyName(RangeName)
93Function AddSheetRanges(oRanges as Object, r as Integer, oSheet as Object, bAutopilot)
94Dim RangeName as String
95Dim AddtoList as Boolean
96Dim iCurStep as Integer
97Dim MaxIndex as Integer
98 iCurStep = DialogModel.Step
99 While oRanges.hasMoreElements
100 oRange = oRanges.NextElement

--- 62 unchanged lines hidden (view full) ---

163 &apos; hard format
164 For i = 0 To LastIndex
165 RangeName = ListboxList(i)
166 oRange = RetrieveRangeoutofRangeName(RangeName)
167 ConvertCellCurrencies(oRange)
168 If bRemove Then
169 If oSelRanges.HasbyName(RangeName) Then
170 oSelRanges.RemovebyName(RangeName)
171 oDocument.CurrentController.Select(oSelRanges)
171 oDocument.CurrentController.Select(oSelRanges)
172 End If
173 End If
174 If SwitchFormat Then
175 If oRange.getPropertyState(&quot;NumberFormat&quot;) &lt;&gt; 1 Then
176 &apos; Range is hard formatted
177 SwitchNumberFormat(oRange, oFormats, sEuroSign)
178 End If
179 Else

--- 9 unchanged lines hidden (view full) ---

189 End If
190End Sub
191
192
193Sub ConvertCellCurrencies(oRange as Object)
194Dim oValues as Object
195Dim oCells as Object
196Dim oCell as Object
172 End If
173 End If
174 If SwitchFormat Then
175 If oRange.getPropertyState(&quot;NumberFormat&quot;) &lt;&gt; 1 Then
176 &apos; Range is hard formatted
177 SwitchNumberFormat(oRange, oFormats, sEuroSign)
178 End If
179 Else

--- 9 unchanged lines hidden (view full) ---

189 End If
190End Sub
191
192
193Sub ConvertCellCurrencies(oRange as Object)
194Dim oValues as Object
195Dim oCells as Object
196Dim oCell as Object
197 oValues = oRange.queryContentCells(com.sun.star.sheet.CellFlags.VALUE)
197 oValues = oRange.queryContentCells(com.sun.star.sheet.CellFlags.VALUE)
198 If (oValues.Count &gt; 0) Then
199 oCells = oValues.Cells.createEnumeration
200 While oCells.hasMoreElements
201 oCell = oCells.nextElement
202 ModifyObjectValuewithCurrFactor(oCell)
203 Wend
204 End If
205End Sub

--- 6 unchanged lines hidden (view full) ---

212End Sub
213
214
215Function CheckIfRangeisCurrency(FormatObject as Object)
216Dim oFormatofObject() as Object
217 &apos; Retrieve the Format of the Object
218 On Local Error GoTo NOKEY
219 oFormatofObject() = oFormats.getByKey(FormatObject.NumberFormat)
198 If (oValues.Count &gt; 0) Then
199 oCells = oValues.Cells.createEnumeration
200 While oCells.hasMoreElements
201 oCell = oCells.nextElement
202 ModifyObjectValuewithCurrFactor(oCell)
203 Wend
204 End If
205End Sub

--- 6 unchanged lines hidden (view full) ---

212End Sub
213
214
215Function CheckIfRangeisCurrency(FormatObject as Object)
216Dim oFormatofObject() as Object
217 &apos; Retrieve the Format of the Object
218 On Local Error GoTo NOKEY
219 oFormatofObject() = oFormats.getByKey(FormatObject.NumberFormat)
220 On Local Error GoTo 0
220 On Local Error GoTo 0
221 CheckIfRangeIsCurrency = INT(oFormatofObject.Type) AND com.sun.star.util.NumberFormat.CURRENCY
222 Exit Function
223NOKEY:
224 CheckIfRangeisCurrency = False
225 Resume CLERROR
226 CLERROR:
227End Function
228

--- 21 unchanged lines hidden ---
221 CheckIfRangeIsCurrency = INT(oFormatofObject.Type) AND com.sun.star.util.NumberFormat.CURRENCY
222 Exit Function
223NOKEY:
224 CheckIfRangeisCurrency = False
225 Resume CLERROR
226 CLERROR:
227End Function
228

--- 21 unchanged lines hidden ---