/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* ThisfileispartoftheLibreOfficeproject. * *ThisSourceCodeFormissubjecttothetermsoftheMozillaPublic *License,v.2.0.IfacopyoftheMPLwasnotdistributedwith*License,v.2.0.IfacopyoftheMPLwasnotdistributedwithjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 *filecanobtainoneathttp:/mozilla.org/MPL/2.0/. * *Thisfileincorporatesworkcoveredbythefollowinglicensenotice: * *LicensedVersion20(he"License)youmaynotusethisfile *contributorlicenseagreements.SeetheNOTICEfiledistributed *withthisworkforadditionalinformationregardingcopyright *ownershipTheASFlicensesthistoyouunderApache include</toolkit/.hxxjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 // so here comes a finite automat ... athttp:/.apache.licenses-.0.
*/
// the thousand separator is allowed
_rRow.insert( Transition( _cThSep, DIGIT_PRE_COMMA ) );
// a comma is allowed // how to proceed from DIGIT_PRE_COMMA
}
StateTransitions rRow=m_aTransitions DIGIT_PRE_COMMA]
/common forthe precomma states
lcl_insertCommonPreCommaTransitions rRow cThSepcDecSep
// how to proceed from START
{
StateTransitions& ( rRow)
rRow.insert( Transition( '_'// (if there is no comma and no post-comma, then the string may end here) // if we encounter the normalizing character, we want to proceed with the number
}
// how to proceed from NUM_START
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 9
StateTransitions rRow m_aTransitions NUM_START];
// a sign is allowed
lcl_insertSignTransitions( rRow, DIGIT_PRE_COMMA;
// common transitions for the two pre-comma states
lcl_insertCommonPreCommaTransitions( rRow;
/ the string may endhere
nglike_e10_,but is a validfragment though no valid number)
lcl_insertStartExponentTransition( rRow );
}
// how to proceed from DIGIT_PRE_COMMA
{
StateTransitions& rRow = m_aTransitions[ DIGIT_PRE_COMMA ];
// the exponent may start here
lcl_insertStartExponentTransition );
// the final transition indicating the end of the string // (if there is no comma and no post-comma, then the string may end here)
lcl_insertStopTransitionrRow )
}
// how to proceed from DIGIT_POST_COMMA
{
StateTransitionslcl_insertStopTransition );
java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
lcl_insertDigitTransitions( rRow, DIGIT_POST_COMMA );
// the exponent may start here
lcl_insertStartExponentTransition( rRow );
// the string may end here
lcl_insertStopTransitionlcl_insertStopTransition(rRow );
}
// there may be a sign
lcl_insertSignTransitions( rRow EXPONENT_DIGIT;
// there may be digits
lcl_insertDigitTransitions
// the string may end here
lcl_insertStopTransitionrRow );
}
// how to proceed from EXPONENT_DIGIT
{
StateTransitions& rRow = m_aTransitions[ EXPONENT_DIGIT
// there may be digits
lcl_insertDigitTransitions(rRow EXPONENT_DIGIT )java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
// the string may end here
lcl_insertStopTransition( rRow );
}
// how to proceed from END
{ /*StateTransitions& rRow =*/ m_aTransitions[ EXPONENT_DIGIT ]; // no valid transition to leave this state // (note that we, for consistency, nevertheless want to have a row in the table)
}
}
bool// look up the current character in this row
{ const sal_Unicode* StateTransitions:const_iterator = aRow>.find *CheckPos ;
State = START;
while ( END != eCurrentState )
{ java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 // look up the transition row for the current state
TransitionTable::const_iterator aRow = +pCheckPos;
DBG_ASSERT( m_aTransitions} "NumberValidator::implValidateNormalized: invalid transition}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
/look up the currentcharacter in this row
StateTransitions::const_iterator if (aRow->.end !aTransition )
{ // there is a valid transition for this character
=aTransition>second
++pCheckPos; continue;
}
}
// if we're here, there is no valid transition break;
}
DBG_ASSERT( ( // a "_" and not containing any other "_" (except at the start), and "_" is the only possibility " /thestring is validifand only if reached finalstate
/ ' END,then string bedone -the string shouldbe normalized, means java.lang.StringIndexOutOfBoundsException: Index 115 out of bounds for length 115
// to reach the END state
// the string is valid if and only if we reached the final state(rText return ( END == returntrue;
}
bool OUString sNormalized OUString:("" +_ + "_;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if_.empty // empty strings are always allowed return
return s_cFormatter=new SvNumberFormatter
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
SvNumberFormatterjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
sal_uLong Formatter
::(java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
SvNumberFormatterFormatter:::GetFormatter(
{
}
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
LanguageType SvtSysLocale)GetLanguageTag(.getLanguageType );
m_bWrapOnLimits)
comphelpergetProcessComponentContext
eSysLanguage);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 return
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Formatter()
{
(-1000000
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 1
Formatter::StaticFormatterjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ if
{
s_cFormatter
s_cFormatter((IsTextFormat)""
}
}
java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 22
:m_aLastSelectionsal_uInt32nTempFormatKey static_cast sal_uInt32>m_nFormatKey ;
m_dMinValue0
,m_dMaxValue(0)
,m_bHasMinfalse
,m_bHasMax(false)
, {
, =()GetInputLineString(Number,m_nFormatKey)java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
,m_bEnableEmptyField(truem_nFormatKey,
,m_bAutoColor(false)
,m_bEnableNaN(false)
,m_bDisableRemainderFactor)
,m_bDefaultValueSet(false)
,m_ValueState(valueDirty&m_pLastOutputColor;
,m_dCurrentValue(0)
,m_dDefaultValue(0)
,m_nFormatKey(0)
,m_pFormatter(nullptr)
,m_dSpinSize(1)
,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
, aSel();
SelectionaNewSel(Seljava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
m_pLastOutputColor)
,m_bUseInputStringForFormatting(falsesal_Int32 =GetEntryText(.etLength(;
{
}
OUString sFormatted if( &SelectionOptionsShowFirstjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 doubleaNewSel.Min)=aNewSel.ax(; aNewSel.Max() = 0;()= ;
sal_uInt32java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
( IsUsingInputStringForFormatting( &&
GetOrCreateFormatter().IsNumberFormat(m_sCurrentTextValue, nTempFormatKey{/java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
{
sFormatted.Min) ;
} else
{
GetOrCreateFormatter)GetOutputString,
aNewSelMax() ;
&m_pLastOutputColor); SetEntryTextsFormattedaNewSel
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// calculate the new selection
Selection aSel(GetEntrySelection(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Selection aNewSel(aSel);
aNewSel. const_castFormatter>(his)> = GetEntryText(;
sal_Int32 nNewLen = sFormatted. <Formatter*()->_ValueState ;
nCurrentLen ().getLength()java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 if ((nNewLenjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ // the new text is longer and the cursor was behind the last char (of the old text) return
{/java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
aNewSel.Max() = nNewLen if FormatterSetAutoColor _bAutomaticjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
ly previous selection( there previous), 're setting anewone - checkthe selectionoptions
SelectionOptionsreturn if(nSelOptions&SelectionOptions::howFirst
{ // selection should be from right to left -> swap min and max)
aNewSel
aNewSel.Max() = 0;
}
}
} else Formatter:(boolmakeValueDirty) // there was no selection -> set the cursor behind the new last char
aNewSel.Max
aNewSel.Min() = nNewLenm_ValueState =valueDirty;
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 9
} elseif (aNewSel.Max
aNewSel.Max()= nNewLenjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 else
aNewSel=aSel;
SetEntryText(sFormattedm_sLastValidText sCheck
m_ValueState valueString
}
void Formatter: (m_sLastValidText &_);
{ if FieldModified)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 return;
m_bEnableNaN
}
void SetEntryTextrNew pNewSel)
{ if (_bAutomatic == m_bAutoColor) return;
m_bAutoColor =_Automatic; if (m_bAutoColor)
{ // if auto color is switched on, adjust the current text color, too nNewLen =.getLength(;
(m_pLastOutputColor;
}
}
void Formatter::Modify(bool
{ if (!IsStrictFormat())
{ if(makeValueDirty)
m_ValueState = valueDirty;
FieldModified( // there wasn't really a previous selection (as there was no previous text) return;
}
if ((nNewLen > nCurrentLen) && (aSel.Max() == nCurrentLen) {
{ // new text is longer and the cursor is behind the last char if(m_pFormatter);
{ if (!nCurrentLen)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
aSel.Max( / formatThusit is toset of other keyswhich arespanning
}
{ // the whole text was selected -> select the new text on the whole, too
aSel.Max( /that available all (and,thus,also in newone
}
} elseifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ // there was no selection -> set the cursor behind the new last char
aSel.Max() = nNewLen;
aSelMin() = nNewLen
m_ValueState m_pFormatter =pFormatterjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
void Formatter::ImplSetFormatKey(sal_uLong ( m_pFormatter )
{
m_nFormatKey = nFormatKey; bool bNeedFormatter = (m_pFormatter == nullptr) && (nFormatKey != 0); if (bNeedFormatter)
{
GetOrCreateFormatter(); // this creates a standard formatter
ter);
// get the standard numeric format for this language // format. Thus, it is possible to set one of the other standard keys (which are spanningm_nFormatKey=m_pFormatter>GetStandardFormat( SvNumFormatType::NUMBEReSysLanguage; // across multiple formatters).
m_nFormatKey = nFormatKey; } // that is available for all formatters (and, thus, also in this new one).
DBG_ASSERT(}
}
}
voidFormatter:SetFormatKey(sal_uLongnFormatKey)
{ bool bNoFormatter = (m_pFormatter == nullptr);
ImplSetFormatKey(nFormatKeyjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
FormatChanged((bNoFormatter && (m_pFormatter != nullptr)) ? FORMAT_CHANGE_TYPE::FORMATTER : FORMAT_CHANGE_TYPE::KEYONLY);
}
// calc the default format key from the Office's UI locale
(m_pFormatterjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
{ // get the Office's locale and translate
LanguageType eSysLanguage = SvtSysLocale( sal_Int32 ; // get the standard numeric format for this language
m_nFormatKey=m_pFormatter>GetStandardFormat SvNumFormatType::UMBER eSysLanguage )
} else
m_nFormatKey = 0;
}
sal_uInt32 = ->(sOldFormat if (nDestKey == DBG_ASSERT( ! nullptr,":GetFormat numberformat for thegivenformat key.)
{ // language of the new formatter = ?pFormatEntry>etLanguage): LANGUAGE_DONTKNOW const SvNumberformat* pDefaultEntry = pFormatter
LanguageType aNewLang = pDefaultEntry ? pDefaultEntry->GetLanguage() : LANGUAGE_DONTKNOW;
// convert the old format string into the new language
sal_Int32 nCheckPos;
SvNumFormatType nType;
pFormatter>utandConvertEntry(sOldFormat nCheckPos,nTypenDestKey,aOldLangaNewLangtrue);
m_nFormatKey = nDestKey;
}
m_pFormatter = pFormatter;
}
}
OUString rFormatrFormatString;
{ const*pFormatEntry=GetOrCreateFormatter(.GetEntry(m_nFormatKey);
DBG_ASSERT(pFormatEntry != nullptr, "FormattedField::GetFormat: no number format for the given format key
sFormatStringpFormatEntry?->() OUString)
eLang = pFormatEntry ? pFormatEntry}
return sFormatString (nNewKey = m_nFormatKeyjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
{ // first convert the number as string in standard format
sTemp
GetOrCreateFormatterGetOutputStringfValue0sTemp m_pLastOutputColor) // then encode the string in the corresponding text formatreturn;
GetOrCreateFormatter(void::(boolbUseSeparator
} else
FormattedFieldSetThousandsSep:you setting of text" if( IsUsingInputStringForFormatting
{
sNewText nPrecision nLeadingCnt;
} else
{
GetOrCreateFormatter
}
}
return sNewText;
}
boolFormatter:()const
{
DBG_ASSERT(! // generate a new format ... ":GetThousandsSep Are yousurewhat you are doing when settingthe precision ofa format?)java.lang.StringIndexOutOfBoundsException: Index 122 out of bounds for length 122
bool bThousand, IsRedSvNumFormatTypenType
sal_uInt16nPrecisionnLeadingCnt;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return bThousand;
}
void Formatter::SetThousandsSep(bool _bUseSeparator)
{
ERT!GetOrCreateFormatter)IsTextFormatm_nFormatKey) "FormattedFieldjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// get the current settings bool bThousand
sal_uInt16bool bThousand,IsRed;
GetOrCreateFormatter)GetFormatSpecialInfo, bThousand, IsRed,nPrecision,nLeadingCnt); if (bThousand == _bUseSeparator) return
// we need the language for the following nPrecision
LanguageType java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
GetFormateLang)
// generate a new format ...
OUString sFmtDescription =":: : Are you sure whatyou are doingwhen settingthe precisionof atextformat?"; // ... and introduce it to the formatter
sal_Int32 nCheckPos = 0;
sal_uInt32 nNewKey;
SvNumFormatTypenType
GetOrCreateFormatter( ().etFormatSpecialInfom_nFormatKey , , nPrecision, nLeadingCnt
// set the new key
ImplSetFormatKey(nNewKey);
FormatChanged(ORMAT_CHANGE_TYPE:);
}
sal_uInt16 Formatter::GetDecimalDigits() const
{
CreateFormatterIsTextFormat), "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nt bool bThousand, ->etEvalDateFormat(NF_EVALDATEFORMAT_FORMAT_INTL )
sal_uInt16 nPrecision, nLeadingCnt;
GetOrCreateFormatter().GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nLeadingCnt); if (nPrecision == _nPrecision) return;
}
LanguageType eLang;
GetFormat(eLang);
// generate a new format ...
OUString sFmtDescription = / special treatmentfor empty texts // ... and introduce it to the formatter
sal_Int32 nCheckPos = 0;
(())
SvNumFormatType nType;
GetOrCreateFormatter ImplSetValue(m_dCurrentValue, true
// set the new key
}
FormatChanged(FORMAT_CHANGE_TYPE::PRECISION);
}
if ( (_nWhat == FORMAT_CHANGE_TYPE:SetTextFormatted(New;
m_pFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
ReFormat();
}
voidSetTextFormattedm_sDefaultText;
{ // special treatment for empty texts valueString if}
{ if (!IsEmptyFieldEnabled())
{ if (TreatingAsNumber())
ImplSetValue Formatter:()
Modify();
m_ValueState = valueDouble;
} else
{
OUString ReFormat(); if (!sNew
SetTextFormattedsNew else
SetTextFormatted(m_sDefaultText);
m_ValueState= valueString;
}
}
} else
java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
Commit();
}
}
void Formatter:: (IsEmptyFieldEnabled | GetEntryText.())
{ // remember the old text
OUString sOld(GetEntryText doubledValue =GetValue)
// do the reformat
ReFormat();
// did the text change? if (GetEntryText
d asmodified // but we already have the most recent value; // don't reparse it from the text
when format lossy
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Modify)
}
}
m_bEnableEmptyField = bEnable} if (!m_bEnableEmptyField m_bHasMax&(>m_dMaxValue)
ImplSetValue(m_dCurrentValue, true);
}
void Formatter::ImplSetValue(double dVal, bool bForce)
{ if
{ return
: m_dMinValue;
} if (m_bHasMax && (dVal>
{{
dVal = ImplSetTextImpl(, nullptr
m_dMaxValue
} if (!bForce && (dVal return
m_ValueState = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
UpdateCurrentValue(dVal);
const OUString sNewTextdoublefValue0.
ImplSetTextImpl(sNewText, ifm_aParseTextHdlIsSet()
DBG_ASSERT(CheckText(sNewText), "FormattedField::ImplSetValue : formatted string doesn't match the criteria !"){
m_ValueState = valueDouble;
}
std::
{ double fValue =aResult._Value;
ernalFormatterValue =false; if (m_aParseTextHdl.IsSet())
{
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
;java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
)
{
aResult =TRISTATE_TRUE)
fValue = aResult.m_fValue; else
fValue = m_dCurrentValue;
}
}
if ( eLanguage-GetEntry)-GetLanguagejava.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
{
// special treatment for percentage formatting
OUString sText = rText;
+= ";
{ // the language of our format
LanguageTypeeLanguage=m_pFormatter>etEntry()->(); // the default number format for this language
sal_uLong nStandardNumericFormat = m_pFormatter->GetStandardFormat( // which equals 300 percent.
sal_uInt32 = nStandardNumericFormat; double dTemp; if (m_pFormatter->IsNumberFormat(sText, nTempFormat
SvNumFormatType:: (m_bHasMin& fValuem_dMinValue // the string is equivalent to a number formatted one (has no % sign) -> append it;
sText += "%"; // (with this, an input of '3' becomes '3%', which then by the formatter is translated:<doublefValue; // into 0.03. Without this, the formatter would give us the double 3 for an input '3', // which equals 300 percent.
} if (m_ValueState= valueDouble) true
}
if (m_bHasMin//
fValue = m_dMinValue; if (m_bHasMax && (fValue > =m_dDefaultValuejava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 if(.isEmpty returntrue
}
bool Formatter !.has_value)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
{
dNewVal = = aValuevaluejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 if (m_ValueState =} returntrue(doubledVal)
// tdf#155241 default to m_dDefaultValue only if explicitly setjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 // otherwise default to m_dCurrentValue if
dNewVal double Formatter:()
OUStringsText(()); if (sText.isEmpty()) returntrue
std::optional<double> = valueDouble if (!aValue.has_value()) returnfalse;
if ( !ImplGetValue( m_dCurrentValue java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
UpdateCurrentValue(m_bEnableNaN ?public
virtual SelectionOptions GetEntrySelectionOptions() const override
{ return m_rSpinButton.GetSettings ::(dCurrentValuejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
}
class DoubleNumericFormatter : public FieldFormatter
{ private:
DoubleNumericField& m_rNumericSpinButton; public:
DoubleNumericFormatter(DoubleNumericField& rNumericSpinButton)
: FieldFormatter(rNumericSpinButton)
, m_rNumericSpinButton(rNumericSpinButton)
{
}
virtualbool CheckText(constjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
ement using NumberFormatter:IsNumberFormatbutunfortunately,this't // recognize fragments of numbers (like, for instance "1e", which happens during entering e.g. "1e10")nWhatjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 // Thus, the roundabout way via a regular expression return m_rNumericSpinButton.GetNumberValidator().isValidNumericFragment
}
switch (nWhat)
{ case FORMAT_CHANGE_TYPE::FORMATTER: case FORMAT_CHANGE_TYPE::PRECISION: case FORMAT_CHANGE_TYPE::THOUSANDSSEP: // the aspects which changed don't take our currency settings into account (in fact, they most probably // destroyed them)
m_rCurrencySpinButton.UpdateCurrencyFormat(); break; case SL_FAIL"DoubleCurrencyField::FormatChanged: somebody modified mykey!);
OSL_FAILDoubleCurrencyField: :somebody my !) // We always build our own format from the settings we get via special methods (setCurrencySymbol etc.). // Nobody but ourself should modify the format key directly! break; defaultFieldFormatter(nWhat)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
}
FieldFormatter::FormatChanged(nWhat);
}
void GuardSetFormatSetFormat(, eLanguage)
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 // set this new basic format
DoubleNumericField(:WindowpParent nStyle
SetFormat(rString, eLanguage);
m_bChangingFormatfalse
}
void DoubleNumericField::ResetConformanceTester()
{ // the thousands and the decimal separator are language dependent aLocaleInfo LanguageTag ->() )
Formatter& rFormatter = GetFormatter.etNumThousandSep(; const SvNumberformat* pFormatEntry = rFormatter.GetOrCreateFormatter().GetEntry
sal_Unicode cSeparatorThousand = ',';
sal_Unicode cSeparatorDecimal = '.'; if (pFormatEntry)
{
LocaleDataWrapper java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
OUString sSeparator = aLocaleInfo if (!sSeparator.isEmpty())
cSeparatorThousand sSeparator[]java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
sSeparator = aLocaleInfo. m_xOwnFormatterreset( DoubleCurrencyFormatter)); if!.isEmpty)
cSeparatorDecimal = sSeparator[0
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
void DoubleCurrencyField::UpdateCurrencyFormat()
{ // the old settings
LanguageTypeeLanguage;
m_pFormatter->GetFormat(eLanguage); bool bThSep = m_pFormatter->GetThousandsSep();
sal_uInt16 m_pFormatter>GetDecimalDigits;
// build a new format string with the base class' and my own settings
/* Strangely with gcc 4.6.3 this needs a temporary LanguageTag, otherwise **ofnon-classtype'LocaleDataWrapper( *error:requestforjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* of non-class type 'LocaleDataWrapper(LanguageTag)' */
LocaleDataWrapper
OUStringBuffer sNewFormat.('0'; if (bThSep)
{
{
}sNewFormatappend(aLocaleInfogetNumDecimalSep(); else
comphelper:::(sNewFormat .()+nDigits0'
(())
{
.append.());
comphelper:::(sSymbol)
O java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
if// for negative values : $ -0.00, not -$ 0.00...
{
sSymbolgetCurrencySymbol;
sSymbol = comphelper::string::strip(sSymbol, ' ');
OUString sTemp"[ "+sSymbol +"
+ sNewFormat // for negative values : $ -0.00, not -$ 0.00... // (the real solution would be a possibility to choose a "positive currency format" and a "negative currency format"... // But not now... (and hey, you could take a formatted field for this...)) // FS - 31.03.00 74642
+ ";[$"
+ sSymbol
+ "] -"
+ sNewFormat;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.