diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-09-09 20:00:48 +0200 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-09-11 20:40:19 +0000 |
commit | b31f33bcc1e5b8d1f791867358b5b4ad1df6e71e (patch) | |
tree | 50b297ee4a5187e120b7898afff52fcde18f3c52 /wizards/source/depot | |
parent | 20238b8fa63b8754d14b69467842f8c49fe3bb2b (diff) |
Easier conversion between Basic Date and UNO Date/Time
Utility functions to convert between Basic Date type
and the representations of Date and Time in UNO, namely:
- com.sun.star.util.Date
- com.sun.star.util.Time
- com.sun.star.util.DateTime
Name of new functions:
- CDateToUnoDate
- CDateFromUnoDate
- CDateToUnoTime
- CDateFromUnoTime
- CDateToUnoDateTime
- CDateFromUnoDateTime
Change-Id: I2b971df20df1c0351d071023e042169b548894f1
Reviewed-on: https://gerrit.libreoffice.org/5897
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'wizards/source/depot')
-rw-r--r-- | wizards/source/depot/Depot.xba | 20 | ||||
-rw-r--r-- | wizards/source/depot/Internet.xba | 8 |
2 files changed, 14 insertions, 14 deletions
diff --git a/wizards/source/depot/Depot.xba b/wizards/source/depot/Depot.xba index 73f81a1fc2ef..6a8b1419c0e0 100644 --- a/wizards/source/depot/Depot.xba +++ b/wizards/source/depot/Depot.xba @@ -129,7 +129,7 @@ Dim LocStockName as String End If End If CurRate = TransactModel.txtRate.Value - TransactDate = CDateFromISO(TransactModel.txtDate.Date) + TransactDate = CDateFromUNODate(TransactModel.txtDate.Date) DlgTransaction.EndExecute() UnprotectSheets(oSheets) @@ -148,7 +148,7 @@ Dim LocStockName as String oMovementSheet.GetCellByPosition(SBCOLUMNQUANTITY2, iNewRow).Value = -TransactModel.txtQuantity.Value End If - oMovementSheet.GetCellByPosition(SBCOLUMNDATE2, iNewRow).Value = CDateFromISO(TransactModel.txtDate.Date) + oMovementSheet.GetCellByPosition(SBCOLUMNDATE2, iNewRow).Value = CDateFromUNODate(TransactModel.txtDate.Date) oMovementSheet.GetCellByPosition(SBCOLUMNRATE2, iNewRow).Value = TransactModel.txtRate.Value oMovementSheet.GetCellByPosition(SBCOLUMNPROVPERCENT2, iNewRow).Value = TransactModel.txtCommission.EffectiveValue oMovementSheet.GetCellByPosition(SBCOLUMNPROVMIN2, iNewRow).Value = TransactModel.txtMinimum.Value @@ -290,7 +290,7 @@ Dim oModel as Object ' Store entered values in variables OldNumber = oModel.txtOldRate.Value NewNumber = oModel.txtNewRate.Value - SplitDate = CDateFromISO(oModel.txtDate.Date) + SplitDate = CDateFromUNODate(oModel.txtDate.Date) iRow = SBROWFIRSTTRANSACT2 NoteText = cSplit & SplitDate & ", " & oModel.txtOldRate.Value & oModel.lblColon.Label & oModel.txtNewRate.Value Do @@ -398,8 +398,8 @@ End Sub Sub SetupTransactionControls(CurStep as Integer) DlgReference = DlgTransaction With TransactModel - .txtDate.Date = CDateToISO(Date()) - .txtDate.DateMax = CDateToISO(Date()) + .txtDate.Date = CDateToUNODate(Date()) + .txtDate.DateMax = CDateToUNODate(Date()) .txtStockID.Enabled = False .lblStockID.Enabled = False .lblStockID.Label = sCurStockIDLabel @@ -504,12 +504,12 @@ Sub InitializeStockRatesControls(CurStep as Integer) Case 2 .txtOldRate.Value = 1 .txtNewRate.Value = 1 - .txtDate.Date = CDateToISO(Date()) + .txtDate.Date = CDateToUNODate(Date()) Case 3 - .txtStartDate.DateMax = CDateToISO(CDate(Date())-1) - .txtEndDate.DateMax = CDateToISO(CDate(Date())-1) - .txtStartDate.Date = CDateToISO(CDate(Date())-8) - .txtEndDate.Date = CDateToISO(CDate(Date())-1) + .txtStartDate.DateMax = CDateToUNODate(CDate(Date())-1) + .txtEndDate.DateMax = CDateToUNODate(CDate(Date())-1) + .txtStartDate.Date = CDateToUNODate(CDate(Date())-8) + .txtEndDate.Date = CDateToUNODate(CDate(Date())-1) .optDaily.State = 1 End Select End With diff --git a/wizards/source/depot/Internet.xba b/wizards/source/depot/Internet.xba index 3e57f0a7b7c8..b4bcf579b808 100644 --- a/wizards/source/depot/Internet.xba +++ b/wizards/source/depot/Internet.xba @@ -25,8 +25,8 @@ Function CheckHistoryControls() Dim bLocGoOn as Boolean Dim Firstdate as Date Dim LastDate as Date - LastDate = CDateFromISO(StockRatesModel.txtEndDate.Date) - FirstDate = CDateFromISO(StockRatesModel.txtStartDate.Date) + LastDate = CDateFromUNODate(StockRatesModel.txtEndDate.Date) + FirstDate = CDateFromUNODate(StockRatesModel.txtStartDate.Date) bLocGoOn = FirstDate <> 0 And LastDate <> 0 If bLocGoOn Then If FirstDate >= LastDate Then @@ -47,8 +47,8 @@ Dim oCell as Object Dim sStockID as String Dim ChartSource as String If CheckHistoryControls() Then - StartDate = CDateFromISO(StockRatesModel.txtStartDate.Date) - EndDate = CDateFromISO(StockRatesModel.txtEndDate.Date) + StartDate = CDateFromUNODate(StockRatesModel.txtStartDate.Date) + EndDate = CDateFromUNODate(StockRatesModel.txtEndDate.Date) DlgStockRates.EndExecute() If StockRatesModel.optDaily.State = 1 Then sInterval = "d" |