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
eb34ba3c
Kaydet (Commit)
eb34ba3c
authored
Tem 18, 2012
tarafından
Yuri Dario
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
i150733: cast double to sal_Int64 can throw a EXCEPTION_FLT_INVALID_OPERATION on Windows.
üst
1abfdc98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
field.cxx
vcl/source/control/field.cxx
+17
-10
No files found.
vcl/source/control/field.cxx
Dosyayı görüntüle @
eb34ba3c
...
...
@@ -694,10 +694,14 @@ sal_Int64 NumericFormatter::Normalize( sal_Int64 nValue ) const
sal_Int64
NumericFormatter
::
Denormalize
(
sal_Int64
nValue
)
const
{
sal_Int64
nFactor
=
ImplPower10
(
GetDecimalDigits
()
);
if
((
nValue
<
(
SAL_MIN_INT64
+
nFactor
))
||
(
nValue
>
(
SAL_MAX_INT64
-
nFactor
)))
return
(
nValue
/
nFactor
);
if
(
nValue
<
0
)
return
((
nValue
-
(
nFactor
/
2
))
/
nFactor
);
return
((
nValue
-
(
nFactor
/
2
))
/
nFactor
);
else
return
((
nValue
+
(
nFactor
/
2
))
/
nFactor
);
return
((
nValue
+
(
nFactor
/
2
))
/
nFactor
);
}
// -----------------------------------------------------------------------
...
...
@@ -1247,13 +1251,18 @@ static double nonValueDoubleToValueDouble( double nValue )
sal_Int64
MetricField
::
ConvertValue
(
sal_Int64
nValue
,
sal_Int64
mnBaseValue
,
sal_uInt16
nDecDigits
,
FieldUnit
eInUnit
,
FieldUnit
eOutUnit
)
{
double
nDouble
=
nonValueDoubleToValueDouble
(
ConvertDoubleValue
(
(
double
)
nValue
,
mnBaseValue
,
nDecDigits
,
eInUnit
,
eOutUnit
)
);
sal_Int64
nLong
;
// caution: precision loss in double cast
return
static_cast
<
sal_Int64
>
(
// #150733# cast double to sal_Int64 can throw a
// EXCEPTION_FLT_INVALID_OPERATION on Windows
nonValueDoubleToValueDouble
(
ConvertDoubleValue
(
(
double
)
nValue
,
mnBaseValue
,
nDecDigits
,
eInUnit
,
eOutUnit
)
)
);
if
(
nDouble
<=
(
double
)
SAL_MIN_INT64
)
nLong
=
SAL_MIN_INT64
;
else
if
(
nDouble
>=
(
double
)
SAL_MAX_INT64
)
nLong
=
SAL_MAX_INT64
;
else
nLong
=
static_cast
<
sal_Int64
>
(
nDouble
);
return
(
nLong
);
}
// -----------------------------------------------------------------------
...
...
@@ -1262,8 +1271,6 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
MapUnit
eInUnit
,
FieldUnit
eOutUnit
)
{
return
static_cast
<
sal_Int64
>
(
// #150733# cast double to sal_Int64 can throw a
// EXCEPTION_FLT_INVALID_OPERATION on Windows
nonValueDoubleToValueDouble
(
ConvertDoubleValue
(
nValue
,
nDigits
,
eInUnit
,
eOutUnit
)
)
);
}
...
...
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