Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
803b5513
Kaydet (Commit)
803b5513
authored
May 10, 2012
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
resolved fdo#46233 value >12 with AM/PM can't be clock time
üst
b43f5ccb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
zforfind.cxx
svl/source/numbers/zforfind.cxx
+9
-4
zforfind.hxx
svl/source/numbers/zforfind.hxx
+5
-1
No files found.
svl/source/numbers/zforfind.cxx
Dosyayı görüntüle @
803b5513
...
...
@@ -860,11 +860,12 @@ inline bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16& i, sal_uInt16& j )
//---------------------------------------------------------------------------
// GetTimeRef
void
ImpSvNumberInputScan
::
GetTimeRef
(
bool
ImpSvNumberInputScan
::
GetTimeRef
(
double
&
fOutNumber
,
sal_uInt16
nIndex
,
// j-value of the first numeric time part of input, default 0
sal_uInt16
nAnz
)
// count of numeric time parts
{
bool
bRet
=
true
;
sal_uInt16
nHour
;
sal_uInt16
nMinute
=
0
;
sal_uInt16
nSecond
=
0
;
...
...
@@ -893,6 +894,7 @@ void ImpSvNumberInputScan::GetTimeRef(
else
{
nHour
=
0
;
bRet
=
false
;
SAL_WARN
(
"svl.items"
,
"ImpSvNumberInputScan::GetTimeRef: bad number index"
);
}
if
(
nDecPos
==
2
&&
nAnz
==
2
)
// 45.5
...
...
@@ -903,7 +905,9 @@ void ImpSvNumberInputScan::GetTimeRef(
nSecond
=
(
sal_uInt16
)
sStrArray
[
nNums
[
nIndex
++
]].
ToInt32
();
if
(
nIndex
-
nStartIndex
<
nAnz
)
fSecond100
=
StringToDouble
(
sStrArray
[
nNums
[
nIndex
]],
true
);
if
(
nAmPm
==
-
1
&&
nHour
!=
12
)
// PM
if
(
nAmPm
&&
nHour
>
12
)
// not a valid AM/PM clock time
bRet
=
false
;
else
if
(
nAmPm
==
-
1
&&
nHour
!=
12
)
// PM
nHour
+=
12
;
else
if
(
nAmPm
==
1
&&
nHour
==
12
)
// 12 AM
nHour
=
0
;
...
...
@@ -912,6 +916,7 @@ void ImpSvNumberInputScan::GetTimeRef(
(
double
)
nMinute
*
60
+
(
double
)
nSecond
+
fSecond100
)
/
86400.0
;
return
bRet
;
}
...
...
@@ -3171,7 +3176,7 @@ bool ImpSvNumberInputScan::IsNumberFormat(
break
;
case
NUMBERFORMAT_TIME
:
GetTimeRef
(
fOutNumber
,
0
,
nAnzNums
);
res
=
GetTimeRef
(
fOutNumber
,
0
,
nAnzNums
);
if
(
nSign
<
0
)
fOutNumber
=
-
fOutNumber
;
break
;
...
...
@@ -3190,7 +3195,7 @@ bool ImpSvNumberInputScan::IsNumberFormat(
if
(
res
)
{
double
fTime
;
GetTimeRef
(
fTime
,
nCounter
,
nAnzNums
-
nCounter
);
res
=
GetTimeRef
(
fTime
,
nCounter
,
nAnzNums
-
nCounter
);
fOutNumber
+=
fTime
;
}
}
...
...
svl/source/numbers/zforfind.hxx
Dosyayı görüntüle @
803b5513
...
...
@@ -294,7 +294,11 @@ private:
sal_uInt16
&
i
,
sal_uInt16
&
j
);
void
GetTimeRef
(
// Converts time -> double (only decimals)
/** Converts time -> double (only decimals)
@return TRUE if time, FALSE if not (e.g. hours >12 with AM/PM)
*/
bool
GetTimeRef
(
double
&
fOutNumber
,
// result as double
sal_uInt16
nIndex
,
// Index of hour in input
sal_uInt16
nAnz
);
// Count of time substrings in input
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment