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
d0aba6a0
Kaydet (Commit)
d0aba6a0
authored
Eyl 30, 2014
tarafından
Florian Reisinger
Kaydeden (comit)
Michael Meeks
Eyl 30, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
German comment translation.
Change-Id: I2a0691724e6cf0248f9b5854b824f0d6d52308ba
üst
e98e9fda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
37 deletions
+29
-37
fmtfield.hxx
include/svtools/fmtfield.hxx
+29
-37
No files found.
include/svtools/fmtfield.hxx
Dosyayı görüntüle @
d0aba6a0
...
@@ -36,9 +36,7 @@ typedef sal_uInt16 FORMAT_CHANGE_TYPE;
...
@@ -36,9 +36,7 @@ typedef sal_uInt16 FORMAT_CHANGE_TYPE;
class
SVT_DLLPUBLIC
FormattedField
:
public
SpinField
class
SVT_DLLPUBLIC
FormattedField
:
public
SpinField
{
{
private
:
private
:
// Da ein SvNumberFormatter eine ziemlich teure (sowohl zeit- als auch platz-maessig) Angelegenheit ist,
// A SvNumberFormatter is very expensive (regarding time and space), it is a Singleton
// haelt sich nicht jedes Field, an dem kein Formatter gesetzt wurde, eine eigenen Instanz, sondern es gibt nur eine
// einzige statische.
class
StaticFormatter
class
StaticFormatter
{
{
static
SvNumberFormatter
*
s_cFormatter
;
static
SvNumberFormatter
*
s_cFormatter
;
...
@@ -53,8 +51,8 @@ private:
...
@@ -53,8 +51,8 @@ private:
protected
:
protected
:
OUString
m_sLastValidText
;
OUString
m_sLastValidText
;
// hat nichts mit dem current value zu tun, ist der letzte Text, der waehrend einer Eingabe als gueltig erkannt
// Has nothing to do with the current value. It is the last text, which was valid at input (checked by CheckText,
// wurde (also durch CheckText geprueft, nicht durch den Formatter gejagt
)
// not yet through formatter
)
Selection
m_aLastSelection
;
Selection
m_aLastSelection
;
double
m_dMinValue
;
double
m_dMinValue
;
...
@@ -79,16 +77,14 @@ protected:
...
@@ -79,16 +77,14 @@ protected:
double
m_dSpinFirst
;
double
m_dSpinFirst
;
double
m_dSpinLast
;
double
m_dSpinLast
;
// es macht einen Unterschied, ob man bei eingestellter Textformatierung beim LostFocus den aktuellen String durch
// There is a difference, when text formatting is enabled, if LostFocus fotmattes the curent String and display it,
// den Formatter jagt und das Ergebnis anzeigt oder erst aus dem String ein double macht, das formatiert und dann
// or if a double is created from the String and then
// ausgibt
bool
m_bTreatAsNumber
;
bool
m_bTreatAsNumber
;
//
und mit den folgenden Members koennen wir das Ganze hier auch zur formatierten Text-Ausgabe benutzen
...
//
And with the following members we can use it for formatted text output as well
...
OUString
m_sCurrentTextValue
;
OUString
m_sCurrentTextValue
;
OUString
m_sDefaultText
;
OUString
m_sDefaultText
;
// die bei der letzten Ausgabe-Operation vom Formatter gelieferte Farbe (nicht dass wir sie beachten wuerden, aber
// The last color from the Formatter at the last output operation (not we would use it, but you can get it)
// man kann sie von aussen abfragen)
Color
*
m_pLastOutputColor
;
Color
*
m_pLastOutputColor
;
bool
m_bUseInputStringForFormatting
;
bool
m_bUseInputStringForFormatting
;
...
@@ -97,7 +93,7 @@ public:
...
@@ -97,7 +93,7 @@ public:
FormattedField
(
vcl
::
Window
*
pParent
,
WinBits
nStyle
=
0
,
SvNumberFormatter
*
pInitialFormatter
=
NULL
,
sal_Int32
nFormatKey
=
0
);
FormattedField
(
vcl
::
Window
*
pParent
,
WinBits
nStyle
=
0
,
SvNumberFormatter
*
pInitialFormatter
=
NULL
,
sal_Int32
nFormatKey
=
0
);
virtual
~
FormattedField
();
virtual
~
FormattedField
();
// Min-/Max-
Verwaltung
// Min-/Max-
management
bool
HasMinValue
()
const
{
return
m_bHasMin
;
}
bool
HasMinValue
()
const
{
return
m_bHasMin
;
}
void
ClearMinValue
()
{
m_bHasMin
=
false
;
}
void
ClearMinValue
()
{
m_bHasMin
=
false
;
}
void
SetMinValue
(
double
dMin
);
void
SetMinValue
(
double
dMin
);
...
@@ -108,33 +104,32 @@ public:
...
@@ -108,33 +104,32 @@ public:
void
SetMaxValue
(
double
dMax
);
void
SetMaxValue
(
double
dMax
);
double
GetMaxValue
()
const
{
return
m_dMaxValue
;
}
double
GetMaxValue
()
const
{
return
m_dMaxValue
;
}
//
aktueller Wert
//
Current value
virtual
void
SetValue
(
double
dVal
);
virtual
void
SetValue
(
double
dVal
);
virtual
double
GetValue
();
virtual
double
GetValue
();
// die Standard-Implementierung jagt die Eingabe jeweils durch den Formatter, so einer vorhanden ist
// The default implementation uses a formatter, if available
void
GetColor
()
const
;
void
GetColor
()
const
;
void
SetTextValue
(
const
OUString
&
rText
);
void
SetTextValue
(
const
OUString
&
rText
);
// der String wird in ein double umgewandelt (durch den Formatter) und anschliessen in SetValue gesteckt
// The String is transformed to a double (with a formatter) and SetValue is called afterwards
bool
IsEmptyFieldEnabled
()
const
{
return
m_bEnableEmptyField
;
}
bool
IsEmptyFieldEnabled
()
const
{
return
m_bEnableEmptyField
;
}
void
EnableEmptyField
(
bool
bEnable
);
void
EnableEmptyField
(
bool
bEnable
);
// wenn nicht enabled, wird beim Verlassen des Feldes der Text auf den letzten gueltigen zurueckgesetzt
// If disabled, the value will be resetted to the last valid value on leave
void
SetDefaultValue
(
double
dDefault
)
{
m_dDefaultValue
=
dDefault
;
m_bValueDirty
=
true
;
}
void
SetDefaultValue
(
double
dDefault
)
{
m_dDefaultValue
=
dDefault
;
m_bValueDirty
=
true
;
}
// wenn der aktuelle String ungueltig ist, liefert GetValue() diesen Default-Wert
// If the current String is invalid, GetValue() returns this value
double
GetDefaultValue
()
const
{
return
m_dDefaultValue
;
}
double
GetDefaultValue
()
const
{
return
m_dDefaultValue
;
}
//
Einstellungen fuer das F
ormat
//
Settings for the f
ormat
sal_uLong
GetFormatKey
()
const
{
return
m_nFormatKey
;
}
sal_uLong
GetFormatKey
()
const
{
return
m_nFormatKey
;
}
void
SetFormatKey
(
sal_uLong
nFormatKey
);
void
SetFormatKey
(
sal_uLong
nFormatKey
);
SvNumberFormatter
*
GetFormatter
()
const
{
return
m_pFormatter
;
}
SvNumberFormatter
*
GetFormatter
()
const
{
return
m_pFormatter
;
}
void
SetFormatter
(
SvNumberFormatter
*
pFormatter
,
bool
bResetFormat
=
true
);
void
SetFormatter
(
SvNumberFormatter
*
pFormatter
,
bool
bResetFormat
=
true
);
// wenn bResetFormat sal_False ist, wird versucht, das alte eingestellte Format mit 'hinueberzuretten' (teuer, wenn es sich nicht
// If bResetFormat is sal_False, the old format is tried to be kept. (expensive, if it is no default format, available in all formatters)
// um eines der Standard-Formate handelt, die in allen Formattern gleich sind)
// If sal_True, the new FormatKey is set to zero
// wenn sal_True, wird als neuer FormatKey 0 gesetzt
bool
GetThousandsSep
()
const
;
bool
GetThousandsSep
()
const
;
void
SetThousandsSep
(
bool
_bUseSeparator
);
void
SetThousandsSep
(
bool
_bUseSeparator
);
...
@@ -142,28 +137,27 @@ public:
...
@@ -142,28 +137,27 @@ public:
sal_uInt16
GetDecimalDigits
()
const
;
sal_uInt16
GetDecimalDigits
()
const
;
void
SetDecimalDigits
(
sal_uInt16
_nPrecision
);
void
SetDecimalDigits
(
sal_uInt16
_nPrecision
);
//
th
e is no check if the current format is numeric, so be cautious when calling these functions
//
Ther
e is no check if the current format is numeric, so be cautious when calling these functions
SvNumberFormatter
*
StandardFormatter
()
{
return
m_aStaticFormatter
;
}
SvNumberFormatter
*
StandardFormatter
()
{
return
m_aStaticFormatter
;
}
// Wenn man keinen eigenen Formatter explizit anlegen will, kann man diesen hier in SetFormatter stecken ...
// If no new Formatter is created explicitly, this can be used in SetFormatter...
// Das hier gelieferte Objekt wird allerdings zwischen allen Instanzen der Klasse geteilt (aus Zeit- und Platzgruenden),
// also ist etwas Vorsicht angebracht ...
OUString
GetFormat
(
LanguageType
&
eLang
)
const
;
OUString
GetFormat
(
LanguageType
&
eLang
)
const
;
bool
SetFormat
(
const
OUString
&
rFormatString
,
LanguageType
eLang
);
bool
SetFormat
(
const
OUString
&
rFormatString
,
LanguageType
eLang
);
// sal_False, wenn der FormatString nicht gesetzt werden konnte (also wahrscheinlich ungueltig ist)
// sal_False, if the FormatString could not be set (and very probably is invalid)
// This Object is shared via all instances, so be careful!
bool
IsStrictFormat
()
const
{
return
m_bStrictFormat
;
}
bool
IsStrictFormat
()
const
{
return
m_bStrictFormat
;
}
void
SetStrictFormat
(
bool
bEnable
)
{
m_bStrictFormat
=
bEnable
;
}
void
SetStrictFormat
(
bool
bEnable
)
{
m_bStrictFormat
=
bEnable
;
}
// Formatueberpruefung waehrend der Eingabe ?
// Check format during input
// Spin-Handling
// Spin-Handling
virtual
void
Up
()
SAL_OVERRIDE
;
virtual
void
Up
()
SAL_OVERRIDE
;
virtual
void
Down
()
SAL_OVERRIDE
;
virtual
void
Down
()
SAL_OVERRIDE
;
// Standard-Implementierung : hoch- oder runterzaehlen des aktuellen double einfach um die gesetzte SpinSiz
e
// Default Implementation: +/- default spin size to the double valu
e
virtual
void
First
()
SAL_OVERRIDE
;
virtual
void
First
()
SAL_OVERRIDE
;
virtual
void
Last
()
SAL_OVERRIDE
;
virtual
void
Last
()
SAL_OVERRIDE
;
// Standard-Implementierung : aktuelles double setzen auf eingestellten first respektive
last value
// Default Implementation: Current double is set to the first or
last value
void
SetSpinSize
(
double
dStep
)
{
m_dSpinSize
=
dStep
;
}
void
SetSpinSize
(
double
dStep
)
{
m_dSpinSize
=
dStep
;
}
double
GetSpinSize
()
const
{
return
m_dSpinSize
;
}
double
GetSpinSize
()
const
{
return
m_dSpinSize
;
}
...
@@ -181,19 +175,17 @@ public:
...
@@ -181,19 +175,17 @@ public:
virtual
void
SetText
(
const
OUString
&
rStr
)
SAL_OVERRIDE
;
virtual
void
SetText
(
const
OUString
&
rStr
)
SAL_OVERRIDE
;
virtual
void
SetText
(
const
OUString
&
rStr
,
const
Selection
&
rNewSelection
)
SAL_OVERRIDE
;
virtual
void
SetText
(
const
OUString
&
rStr
,
const
Selection
&
rNewSelection
)
SAL_OVERRIDE
;
// die folgenden Methoden sind interesant, wenn m_bTreatAsNumber auf sal_False sitzt
//The following methods are interesting, if m_bTreatAsNumber is set to sal_False
/** nehmen wir mal an, irgendjemand will das ganze schoene double-Handling gar nicht haben, sondern
//If someone does not care about all the double handling and just wants to print the text formatted.
einfach den Text formatiert ausgeben ...
//(((The text will be formatted, using the Formatter, and then set)
(der Text wird einfach nur durch den Formatter gejagt und dann gesetzt)
*/
void
SetTextFormatted
(
const
OUString
&
rText
);
void
SetTextFormatted
(
const
OUString
&
rText
);
OUString
GetTextValue
()
const
;
OUString
GetTextValue
()
const
;
void
SetDefaultText
(
const
OUString
&
rDefault
)
{
m_sDefaultText
=
rDefault
;
}
void
SetDefaultText
(
const
OUString
&
rDefault
)
{
m_sDefaultText
=
rDefault
;
}
OUString
GetDefaultText
()
const
{
return
m_sDefaultText
;
}
OUString
GetDefaultText
()
const
{
return
m_sDefaultText
;
}
//
die bei der letzten Ausgabe-Operation vom Formatter gelieferte Farbe (Ausgabe-Operationen werden getriggert durch
//
The last colour from the Formatter's last output operation. Output operations get triggered by:
// SetValue, SetTextValue, SetTextFormatted, also indire
kt eventuell auch durch SetMin-/-MaxValue)
// SetValue, SetTextValue, SetTextFormatted, also indire
ctly via SetMin - / -MaxValue
Color
*
GetLastOutputColor
()
const
{
return
m_pLastOutputColor
;
}
Color
*
GetLastOutputColor
()
const
{
return
m_pLastOutputColor
;
}
/** reformats the current text. Interesting if the user entered some text in an "input format", and
/** reformats the current text. Interesting if the user entered some text in an "input format", and
...
@@ -238,7 +230,7 @@ protected:
...
@@ -238,7 +230,7 @@ protected:
void
impl_Modify
(
bool
makeValueDirty
=
true
);
void
impl_Modify
(
bool
makeValueDirty
=
true
);
virtual
void
Modify
()
SAL_OVERRIDE
;
virtual
void
Modify
()
SAL_OVERRIDE
;
//
CheckText ueberschreiben fuer Ueberpruefung zur Eingabezeit
//
Override CheckTextfor input-time checks
virtual
bool
CheckText
(
const
OUString
&
)
const
{
return
true
;
}
virtual
bool
CheckText
(
const
OUString
&
)
const
{
return
true
;
}
// any aspect of the current format has changed
// any aspect of the current format has changed
...
...
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