diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-05-11 14:26:22 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-05-11 14:26:22 +0000 |
commit | 8cf6a240220b161461597006f2b43521cd96bf75 (patch) | |
tree | 71f8065d2dc050f2e10faf6c98f068a2c60b4b1b /wizards/source/euro/Common.xba | |
parent | bc8d9fd86094969af4538f38c7b8578941f1e3f7 (diff) |
## new module added for writer documents
Diffstat (limited to 'wizards/source/euro/Common.xba')
-rw-r--r-- | wizards/source/euro/Common.xba | 101 |
1 files changed, 56 insertions, 45 deletions
diff --git a/wizards/source/euro/Common.xba b/wizards/source/euro/Common.xba index 5bd11f9d02f2..0c3308956eaf 100644 --- a/wizards/source/euro/Common.xba +++ b/wizards/source/euro/Common.xba @@ -7,12 +7,15 @@ Public DialogPassword as Object Public PasswordModel as Object Sub RetrieveDocumentObjects() - oSheets = oDocument.Sheets - oSheet = oDocument.Sheets.GetbyIndex(0) + CurMimeType = oDocument.DocumentInfo.MimeType + 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 oStatusline = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator ' Retrieve the indices for the cellformatations oFormats = oDocument.NumberFormats - oAddressRanges = oDocument.createInstance("com.sun.star.sheet.SheetCellRanges") End Sub @@ -48,56 +51,64 @@ Dim DummyList(100) as String Dim RangeName as String Dim oDummySheet as Object Dim AddRange as Boolean +Dim CurMimeType as String GoOn = True DocDisposed = True CurCellCount = 0 StatusValue = 0 AddRange = True - oStatusline.Start(sStsPROGRESS,100) '"Konvertierungsfortschritt:" StatusValue = 0 - If Not bRangeListDefined Then - TotCellCount = 0 - CreateRangeEnumeration(True) - Else - IncreaseStatusvalue(SBRelGet/3) - End If - ' Check protected Areas - a = 1 - i = 0 - For i = 1 To Val(RangeList(0)) - RangeName = RangeList(i) - If Rangename <> "" Then - oDummySheet = RetrieveSheetoutofRangeName(RangeName) + If Instr(1, CurMimeType, "calc") <> 0 Then + If Not bRangeListDefined Then + TotCellCount = 0 + CreateRangeEnumeration(True) + Else + IncreaseStatusvalue(SBRelGet/3) + End If + ' Check protected Areas + a = 1 + i = 0 + For i = 1 To Val(RangeList(0)) + RangeName = RangeList(i) + If Rangename <> "" Then + oDummySheet = RetrieveSheetoutofRangeName(RangeName) - ' Unprotect the sheet if necessary - AddRange = UnprotectSheet(oDummySheet) - If AddRange Then + ' Unprotect the sheet if necessary + AddRange = UnprotectSheet(oDummySheet) + If AddRange Then ' Todo: Umschreiben mit Redim RangeList(RangeIndex) Preserve - DummyList(a) = RangeName - DummyList(0) = Str(a) - a = a + 1 - Else - Exit For + DummyList(a) = RangeName + DummyList(0) = Str(a) + a = a + 1 + Else + Exit For + End If End If + Next + RangeIndex = Val(DummyList(0)) + If AddRange And RangeIndex > 0 Then + Dim LocRangeList(RangeIndex-1) as String + Dim LocRangeBools(RangeIndex-1) as String + For i = 1 To RangeIndex + LocRangeList(i-1 ) = DummyList(i) + LocRangeBools(i-1) = True + Next i + ConvertThehardWay(LocRangeList(), LocRangeBools(), True, True) + MakeStyleEnumeration(True) + oDocument.calculateAll() End If - Next - RangeIndex = Val(DummyList(0)) - If AddRange And RangeIndex > 0 Then - Dim LocRangeList(RangeIndex-1) as String - Dim LocRangeBools(RangeIndex-1) as String - For i = 1 To RangeIndex - LocRangeList(i-1 ) = DummyList(i) - LocRangeBools(i-1) = True - Next i - ConvertThehardWay(LocRangeList(), LocRangeBools(), True, True) - MakeStyleEnumeration(True) - oDocument.calculateAll() - End If - ReprotectSheets() + ReprotectSheets() + bRangeListDefined = False + ConvertDocument = AddRange + Else + oStatusline.SetValue(10) + ConvertTextFields() + oStatusline.SetValue(80) + ConvertWriterTables() + End If oStatusline.End - bRangeListDefined = False - ConvertDocument = AddRange + On Local Error Goto 0 End Function @@ -127,8 +138,8 @@ Dim AddToList as Boolean On Local Error GoTo NOKEY aFormat() = oFormats.getByKey(iNumberFormat) On Local Error GoTo 0 - ' Typ und Währungssymbol des Numberformats heraussuchen - ' neues Währungsformat mit passenden Einstellungen setzen + ' Typ und Währungssymbol des Numberformats heraussuchen + ' neues Währungsformat mit passenden Einstellungen setzen nFormatDecimals = aFormat.Decimals nFormatLeading = aFormat.LeadingZeros bFormatNegRed = aFormat.NegativeRed @@ -209,7 +220,7 @@ End Function Sub StartConversion() GoOn = True -' ToggleWindow(False) + ToggleWindow(False) If DialogModel.Step = 2 Then ConvertDocuments() Else @@ -219,7 +230,7 @@ Sub StartConversion() ConvertRangesorStylesofDocument() End If End If -' ToggleWindow(True) + ToggleWindow(True) End Sub |