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
e1a5ae39
Kaydet (Commit)
e1a5ae39
authored
Eyl 25, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Related: fdo#83010 move NumericFormatter clipping to min/max into one place
Change-Id: I60cfe651a6ec25fc7e482192d908acca25c1ad8b
üst
259ab763
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
28 deletions
+18
-28
field.hxx
include/vcl/field.hxx
+2
-0
field.cxx
vcl/source/control/field.cxx
+16
-28
No files found.
include/vcl/field.hxx
Dosyayı görüntüle @
e1a5ae39
...
...
@@ -184,6 +184,8 @@ public:
void
SetMax
(
sal_Int64
nNewMax
);
sal_Int64
GetMax
()
const
{
return
mnMax
;
}
sal_Int64
ClipAgainstMinMax
(
sal_Int64
nValue
)
const
;
void
SetFirst
(
sal_Int64
nNewFirst
)
{
mnFirst
=
nNewFirst
;
}
sal_Int64
GetFirst
()
const
{
return
mnFirst
;
}
void
SetLast
(
sal_Int64
nNewLast
)
{
mnLast
=
nNewLast
;
}
...
...
vcl/source/control/field.cxx
Dosyayı görüntüle @
e1a5ae39
...
...
@@ -417,11 +417,7 @@ bool NumericFormatter::ImplNumericReformat( const OUString& rStr, sal_Int64& rVa
return
true
;
else
{
sal_Int64
nTempVal
=
rValue
;
if
(
nTempVal
>
mnMax
)
nTempVal
=
mnMax
;
else
if
(
nTempVal
<
mnMin
)
nTempVal
=
mnMin
;
sal_Int64
nTempVal
=
ClipAgainstMinMax
(
rValue
);
if
(
GetErrorHdl
().
IsSet
()
&&
(
rValue
!=
nTempVal
)
)
{
...
...
@@ -487,11 +483,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
if
(
NUMERICFORMATTER_VALUE
&
nMask
)
{
mnFieldValue
=
pMgr
->
ReadLong
();
if
(
mnFieldValue
>
mnMax
)
mnFieldValue
=
mnMax
;
else
if
(
mnFieldValue
<
mnMin
)
mnFieldValue
=
mnMin
;
mnFieldValue
=
ClipAgainstMinMax
(
pMgr
->
ReadLong
());
mnLastValue
=
mnFieldValue
;
}
...
...
@@ -554,10 +546,7 @@ OUString NumericFormatter::CreateFieldText( sal_Int64 nValue ) const
void
NumericFormatter
::
ImplSetUserValue
(
sal_Int64
nNewValue
,
Selection
*
pNewSelection
)
{
if
(
nNewValue
>
mnMax
)
nNewValue
=
mnMax
;
else
if
(
nNewValue
<
mnMin
)
nNewValue
=
mnMin
;
nNewValue
=
ClipAgainstMinMax
(
nNewValue
);
mnLastValue
=
nNewValue
;
if
(
GetField
()
)
...
...
@@ -579,11 +568,7 @@ sal_Int64 NumericFormatter::GetValue() const
if
(
ImplNumericGetValue
(
GetField
()
->
GetText
(),
nTempValue
,
GetDecimalDigits
(),
ImplGetLocaleDataWrapper
()
)
)
{
if
(
nTempValue
>
mnMax
)
nTempValue
=
mnMax
;
else
if
(
nTempValue
<
mnMin
)
nTempValue
=
mnMin
;
return
nTempValue
;
return
ClipAgainstMinMax
(
nTempValue
);
}
else
return
mnLastValue
;
...
...
@@ -656,8 +641,7 @@ void NumericFormatter::FieldUp()
else
nValue
=
(
nRemainder
==
0
)
?
nValue
+
mnSpinSize
:
nValue
-
nRemainder
;
if
(
nValue
>
mnMax
)
nValue
=
mnMax
;
nValue
=
ClipAgainstMinMax
(
nValue
);
ImplNewFieldValue
(
nValue
);
}
...
...
@@ -671,8 +655,7 @@ void NumericFormatter::FieldDown()
else
nValue
=
(
nRemainder
==
0
)
?
nValue
-
mnSpinSize
:
nValue
-
mnSpinSize
-
nRemainder
;
if
(
nValue
<
mnMin
)
nValue
=
mnMin
;
nValue
=
ClipAgainstMinMax
(
mnMin
);
ImplNewFieldValue
(
nValue
);
}
...
...
@@ -720,6 +703,15 @@ void NumericFormatter::ImplNewFieldValue( sal_Int64 nNewValue )
}
}
sal_Int64
NumericFormatter
::
ClipAgainstMinMax
(
sal_Int64
nValue
)
const
{
if
(
nValue
>
mnMax
)
nValue
=
mnMax
;
else
if
(
nValue
<
mnMin
)
nValue
=
mnMin
;
return
nValue
;
}
NumericField
::
NumericField
(
vcl
::
Window
*
pParent
,
WinBits
nWinStyle
)
:
SpinField
(
pParent
,
nWinStyle
)
{
...
...
@@ -1944,11 +1936,7 @@ sal_Int64 CurrencyFormatter::GetValue() const
sal_Int64
nTempValue
;
if
(
ImplCurrencyGetValue
(
GetField
()
->
GetText
(),
nTempValue
,
GetDecimalDigits
(),
ImplGetLocaleDataWrapper
()
)
)
{
if
(
nTempValue
>
mnMax
)
nTempValue
=
mnMax
;
else
if
(
nTempValue
<
mnMin
)
nTempValue
=
mnMin
;
return
nTempValue
;
return
ClipAgainstMinMax
(
nTempValue
);
}
else
return
mnLastValue
;
...
...
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