diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-09-21 13:45:18 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-09-21 13:45:18 +0000 |
commit | 314c9347677d31143ee017582fe234c79def5099 (patch) | |
tree | 6db41e0530e6958c9ff369cdc5a887ca8cb82098 /wizards/source/euro | |
parent | 4dc1fa1fe73f9d9285bb4b745ce5fbfb1d6743d1 (diff) |
#91710# several modifications
Diffstat (limited to 'wizards/source/euro')
-rw-r--r-- | wizards/source/euro/AutoPilotRun.xba | 1 | ||||
-rw-r--r-- | wizards/source/euro/Common.xba | 36 | ||||
-rw-r--r-- | wizards/source/euro/ConvertRun.xba | 53 |
3 files changed, 29 insertions, 61 deletions
diff --git a/wizards/source/euro/AutoPilotRun.xba b/wizards/source/euro/AutoPilotRun.xba index 4b82c24be065..733e95f73593 100644 --- a/wizards/source/euro/AutoPilotRun.xba +++ b/wizards/source/euro/AutoPilotRun.xba @@ -33,7 +33,6 @@ Dim i As Integer InitializeConverter(oLocale, 2) ToggleGoOnButton() DialogModel.cmdGoOn.DefaultButton = True -' YPos = DialogConvert.PosSize.Y + DialogConvert.PosSize.Height DialogConvert.Execute End If End Sub diff --git a/wizards/source/euro/Common.xba b/wizards/source/euro/Common.xba index 866931d2300c..4f0e56a3ca07 100644 --- a/wizards/source/euro/Common.xba +++ b/wizards/source/euro/Common.xba @@ -8,11 +8,11 @@ Public PasswordModel as Object Sub RetrieveDocumentObjects() CurMimeType = oDocument.DocumentInfo.MimeType -' If Instr(1, CurMimeType, "calc") <> 0 Then + If Instr(1, CurMimeType, "calc") <> 0 Then oSheets = oDocument.Sheets oSheet = oDocument.Sheets.GetbyIndex(0) -' oAddressRanges = oDocument.createInstance("com.sun.star.sheet.SheetCellRanges") -' End If + oAddressRanges = oDocument.createInstance("com.sun.star.sheet.SheetCellRanges") + End If oStatusline = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator ' Retrieve the indices for the cellformatations oFormats = oDocument.NumberFormats @@ -40,7 +40,7 @@ Function ConvertDocument() GoOn = True ' DocDisposed = True InitializeProgressbar() -' If Instr(1, CurMimeType, "calc") <> 0 Then + If Instr(1, CurMimeType, "calc") <> 0 Then bDocHasProtectedSheets = CheckSheetProtection(oSheets) If bDocHasProtectedSheets Then bDocHasProtectedSheets = UnprotectSheetsWithPassword(oSheets, bDoUnProtect) @@ -61,18 +61,18 @@ Function ConvertDocument() ReprotectSheets() bRangeListDefined = False End If -' Else -' oStatusline.SetValue(10) -' ConvertTextFields() -' oStatusline.SetValue(80) -' ConvertWriterTables() -' End If + Else + oStatusline.SetValue(10) + ConvertTextFields() + oStatusline.SetValue(80) + ConvertWriterTables() + End If oStatusline.End On Local Error Goto 0 End Function -Sub SwitchNumberFormat(oObject as Object, oFormats as object, sNewSymbol as String) +Sub SwitchNumberFormat(oObject as Object, oFormats as object) Dim nFormatLanguage as Integer Dim nFormatDecimals as Integer Dim nFormatLeading as Integer @@ -84,19 +84,21 @@ Dim i as Integer Dim aNewStr as String Dim iNumberFormat as Long Dim AddToList as Boolean +Dim sOldCurrSymbol as String On Local Error Resume Next iNumberFormat = oObject.NumberFormat On Local Error GoTo NOKEY aFormat() = oFormats.getByKey(iNumberFormat) On Local Error GoTo 0 - ' Numberformat mit dem neuen Symbol als Basis für generateFormat - aSimpleStr = "0 [$"+sNewSymbol & aFormat.CurrencyExtension & "]" - nSimpleKey = Numberformat(oFormats, aSimpleStr, oLocale) - If Err <> 0 Then - Msgbox "Error Reading the Number Format" - Resume CLERROR + sOldCurrSymbol = aFormat.CurrencySymbol + If sOldCurrSymbol = CurrValue(CurrIndex,5) Then + aSimpleStr = "0 [$EUR]" + Else + aSimpleStr = "0 [$" & sEuroSign & aFormat.CurrencyExtension & "]" End If + ' Numberformat mit dem neuen Symbol als Basis für generateFormat + nSimpleKey = Numberformat(oFormats, aSimpleStr, oLocale) ' Typ und Währungssymbol des Numberformats heraussuchen ' neues Währungsformat mit passenden Einstellungen setzen nFormatDecimals = 2 diff --git a/wizards/source/euro/ConvertRun.xba b/wizards/source/euro/ConvertRun.xba index 2461ef293c0a..c1144b8a97f6 100644 --- a/wizards/source/euro/ConvertRun.xba +++ b/wizards/source/euro/ConvertRun.xba @@ -48,7 +48,6 @@ Dim m as Integer Dim MaxIndex as Integer Listbox = DialogModel.lstSelection If Ubound(Listbox.SelectedItems()) > -1 Then -' ToggleWindow(False) EnableStep1DialogControls(False, False, False) oSelRanges = oDocument.createInstance("com.sun.star.sheet.SheetCellRanges") @@ -78,8 +77,8 @@ Dim MaxIndex as Integer Wend Next i Else - a = -1 ' Hard Formatation is selected + a = -1 For n = 0 To Ubound(Listbox.SelectedItems()) m = Listbox.SelectedItems(n) RangeName = Listbox.StringItemList(m) @@ -103,7 +102,6 @@ Dim MaxIndex as Integer End If oDocument.CurrentController.Select(oSelRanges) EnableStep1DialogControls(True, True, True) -' ToggleWindow(True) End If End Sub @@ -136,7 +134,7 @@ Dim bDoEnableFrame as Boolean .optDocRanges.Enabled = bDoEnableFrame .optSelRange.Enabled = bDoEnableFrame End With - ' The CheckBox has the Value 'True' when the Controls in the Frame are disabled + ' The CheckBox has the Value '1' when the Controls in the Frame are disabled If bButtonsEnabled Then bCurrIsSelected = Ubound(DialogModel.lstCurrencies.SelectedItems()) <> -1 ' Enable GoOnButton only when Currency is selected @@ -245,46 +243,16 @@ Dim OldCurrIndex as Integer Dim OldCurExtension(2) as String oPreSelRange = AddSelectedRangeToSelRangesEnum() bPreSelected = True - -' bPreSelected = CheckIfRangeisCurrency(oRange) -' If bPreSelected Then -' OldCurrSymbolList() = CurrSymbolList() -' OldCurExtension() = CurExtension() -' OldCurrIndex = CurrIndex -' For i = 0 To 11 -' CurrIndex = i -' CurExtension(0) = LangIDValue(CurrIndex,0,2) -' CurExtension(1) = LangIDValue(CurrIndex,1,2) -' CurExtension(2) = LangIDValue(CurrIndex,2,2) -' InitializeCurrencyValues(CurrIndex) -' bPreSelected = CheckFormatType(oRange) -' If bPreSelected Then -' Exit For -' End If -' Next i -' If Not bPreSelected Then -' CurrIndex = OldCurrIndex -' CurrSymbolList() = OldCurrSymbolList() -' CurExtension() = OldCurExtension() -' End If -' End If - -' If CurrIndex > -1 Then - If bPreSelected Then - DialogModel.optSelRange.State = 1 - AddRangeToListbox(oPreSelRange) - Else - DialogModel.optCellTemplates.State = 1 - CreateStyleEnumeration() - End If -' End If + If bPreSelected Then + DialogModel.optSelRange.State = 1 + AddRangeToListbox(oPreSelRange) + Else + DialogModel.optCellTemplates.State = 1 + CreateStyleEnumeration() + End If EnableStep1DialogControls(True, bPreSelected, True) ' Todo: auf Integer umstellen -' If bPreselected Then - DialogModel.chkComplete.State = Not(Abs(bPreSelected)) '0 -' Else -' DialogModel.chkComplete.State = 1 -' End If + DialogModel.chkComplete.State = Not(Abs(bPreSelected)) DialogModel.optSelRange.Enabled = bPreSelected End Sub @@ -304,7 +272,6 @@ Sub CheckRangeSelection(Optional oEvent) ' oPreSelRange = AddSelectedRangeToSelRangesEnum() ' bPreSelected = CheckFormatType(oRange) ' If bPreSelected Then -' EmptySelection() AddRangeToListbox(oPreSelRange) ' End If |