summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/sbx/sbxscan.cxx8
-rw-r--r--cui/source/tabpages/tabstpge.cxx2
-rw-r--r--editeng/source/items/paraitem.cxx2
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx2
-rw-r--r--sc/source/core/data/dpcache.cxx2
-rw-r--r--sc/source/core/tool/compiler.cxx4
-rw-r--r--sc/source/filter/excel/excimp8.cxx2
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx2
-rw-r--r--sc/source/ui/cctrl/editfield.cxx4
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx8
-rw-r--r--sc/source/ui/view/cellsh2.cxx4
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx2
-rw-r--r--svl/source/numbers/zforfind.cxx4
-rw-r--r--svl/source/numbers/zforscan.cxx8
-rw-r--r--svtools/source/contnr/fileview.cxx2
-rw-r--r--svx/source/dialog/_contdlg.cxx4
-rw-r--r--svx/source/dialog/imapdlg.cxx4
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/items/chrtitem.cxx2
-rw-r--r--svx/source/stbctrls/pszctrl.cxx2
-rw-r--r--svx/source/svdraw/svdattr.cxx2
-rw-r--r--svx/source/svdraw/svdmodel.cxx4
-rw-r--r--svx/source/svdraw/svdomeas.cxx2
-rw-r--r--svx/source/svdraw/svdtrans.cxx2
-rw-r--r--sw/source/core/bastyp/calc.cxx10
-rw-r--r--sw/source/core/doc/docsort.cxx4
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx2
-rw-r--r--unotools/inc/unotools/localedatawrapper.hxx250
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx211
-rw-r--r--vcl/inc/vcl/longcurr.hxx8
-rw-r--r--vcl/source/control/field.cxx9
-rw-r--r--vcl/source/control/field2.cxx18
-rw-r--r--vcl/source/control/longcurr.cxx9
-rw-r--r--xmloff/source/style/xmlnumfi.cxx2
34 files changed, 300 insertions, 303 deletions
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 80276a3f217f..8bbe8b7813bb 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -59,8 +59,8 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep )
{
SvtSysLocale aSysLocale;
const LocaleDataWrapper& rData = aSysLocale.GetLocaleData();
- rcDecimalSep = rData.getNumDecimalSep().GetBuffer()[0];
- rcThousandSep = rData.getNumThousandSep().GetBuffer()[0];
+ rcDecimalSep = rData.getNumDecimalSep()[0];
+ rcThousandSep = rData.getNumThousandSep()[0];
}
// scanning a string according to BASIC-conventions
@@ -870,8 +870,8 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
{
SvtSysLocale aSysLocale;
const LocaleDataWrapper& rData = aSysLocale.GetLocaleData();
- sal_Unicode cComma = rData.getNumDecimalSep().GetBuffer()[0];
- sal_Unicode c1000 = rData.getNumThousandSep().GetBuffer()[0];
+ sal_Unicode cComma = rData.getNumDecimalSep()[0];
+ sal_Unicode c1000 = rData.getNumThousandSep()[0];
String aCurrencyStrg = rData.getCurrSymbol();
// initialize the Basic-formater help object:
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 3b039b54dcec..ecb0461cdf7c 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -196,7 +196,7 @@ SvxTabulatorTabPage::SvxTabulatorTabPage( Window* pParent,
// Get the default decimal char from the system
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- aAktTab.GetDecimal() = aLocaleWrapper.getNumDecimalSep().GetChar(0);
+ aAktTab.GetDecimal() = aLocaleWrapper.getNumDecimalSep()[0];
FreeResource();
}
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 109578b384ce..382f9bd839fa 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -884,7 +884,7 @@ SvxTabStop::SvxTabStop( const sal_Int32 nPos, const SvxTabAdjust eAdjst,
void SvxTabStop::fillDecimal() const
{
if ( cDfltDecimalChar == m_cDecimal )
- m_cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0);
+ m_cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep()[0];
}
// -----------------------------------------------------------------------
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 042e49b9f7e6..d2936a91f508 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1757,7 +1757,7 @@ void FormulaCompiler::AppendDouble( rtl::OUStringBuffer& rBuffer, double fVal )
::rtl::math::doubleToUStringBuffer( rBuffer, fVal,
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max,
- aSysLocale.GetLocaleDataPtr()->getNumDecimalSep().GetChar(0),
+ aSysLocale.GetLocaleDataPtr()->getNumDecimalSep()[0],
true );
}
}
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 6908163a215f..742b6eb7a654 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -1006,7 +1006,7 @@ rtl::OUString ScDPCache::GetFormattedString(long nDim, const ScDPItemData& rItem
if (!p)
return rItem.GetString();
- sal_Unicode cDecSep = ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0);
+ sal_Unicode cDecSep = ScGlobal::pLocaleData->getNumDecimalSep()[0];
return ScDPUtil::getNumGroupName(fVal, p->maInfo, cDecSep, mpDoc->GetFormatTable());
}
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 7833786b6c17..97ae77012619 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -1867,7 +1867,7 @@ xub_StrLen ScCompiler::NextSymbol(bool bInArray)
sal_Unicode cArrayColSep = mxSymbols->getSymbol( ocArrayColSep).GetChar(0);
sal_Unicode cArrayRowSep = mxSymbols->getSymbol( ocArrayRowSep).GetChar(0);
sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' :
- ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0));
+ ScGlobal::pLocaleData->getNumDecimalSep()[0]);
// special symbols specific to address convention used
sal_Unicode cSheetPrefix = pConv->getSpecialSymbol(ScCompiler::Convention::ABS_SHEET_PREFIX);
@@ -2786,7 +2786,7 @@ bool ScCompiler::IsReference( const String& rName )
// Has to be called before IsValue
sal_Unicode ch1 = rName.GetChar(0);
sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' :
- ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0) );
+ ScGlobal::pLocaleData->getNumDecimalSep()[0] );
if ( ch1 == cDecSep )
return false;
// Who was that imbecile introducing '.' as the sheet name separator!?!
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 91d5a018cee8..3dbc3cf5aede 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -500,7 +500,7 @@ void XclImpAutoFilterData::CreateFromDouble( rtl::OUString& rStr, double fVal )
{
rStr += ::rtl::math::doubleToUString(fVal,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0), true);
+ ScGlobal::pLocaleData->getNumDecimalSep()[0], true);
}
void XclImpAutoFilterData::SetCellAttribs()
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index f1f8a4053afe..4e7e4af970c9 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1244,7 +1244,7 @@ ExcEScenario::ExcEScenario( const XclExpRoot& rRoot, SCTAB nTab )
sText = ::rtl::math::doubleToUString( fVal,
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max,
- ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0),
+ ScGlobal::pLocaleData->getNumDecimalSep()[0],
sal_True );
}
else
diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx
index 51147e5cd2cb..3ee77c71edec 100644
--- a/sc/source/ui/cctrl/editfield.cxx
+++ b/sc/source/ui/cctrl/editfield.cxx
@@ -42,12 +42,12 @@ namespace {
sal_Unicode lclGetDecSep()
{
- return ScGlobal::GetpLocaleData()->getNumDecimalSep().GetChar( 0 );
+ return ScGlobal::GetpLocaleData()->getNumDecimalSep()[0];
}
sal_Unicode lclGetGroupSep()
{
- return ScGlobal::GetpLocaleData()->getNumThousandSep().GetChar( 0 );
+ return ScGlobal::GetpLocaleData()->getNumThousandSep()[0];
}
} // namespace
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 232cb1a52950..cd73cf841a02 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -105,7 +105,7 @@ void ScSolverOptionsString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16,
if ( mbIsDouble )
sTxt += (String)rtl::math::doubleToUString( mfDoubleValue,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::GetpLocaleData()->getNumDecimalSep().GetChar(0), true );
+ ScGlobal::GetpLocaleData()->getNumDecimalSep()[0], true );
else
sTxt += String::CreateFromInt32( mnIntValue );
rDev.SetFont( aFont );
@@ -470,7 +470,7 @@ void ScSolverValueDialog::SetValue( double fValue )
{
maEdValue.SetText( rtl::math::doubleToUString( fValue,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::GetpLocaleData()->getNumDecimalSep().GetChar(0), true ) );
+ ScGlobal::GetpLocaleData()->getNumDecimalSep()[0], true ) );
}
double ScSolverValueDialog::GetValue() const
@@ -480,8 +480,8 @@ double ScSolverValueDialog::GetValue() const
const LocaleDataWrapper* pLocaleData = ScGlobal::GetpLocaleData();
rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
double fValue = rtl::math::stringToDouble( aInput,
- pLocaleData->getNumDecimalSep().GetChar(0),
- pLocaleData->getNumThousandSep().GetChar(0),
+ pLocaleData->getNumDecimalSep()[0],
+ pLocaleData->getNumThousandSep()[0],
&eStatus, NULL );
return fValue;
}
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 9cf1834b1a06..65f89f834310 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -842,7 +842,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if (pDoc->GetFormatTable()->IsNumberFormat(aTemp1, nNumIndex, nVal))
aExpr1 =String( ::rtl::math::doubleToUString( nVal,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0), sal_True));
+ ScGlobal::pLocaleData->getNumDecimalSep()[0], sal_True));
else
aExpr1 = aTemp1;
}
@@ -859,7 +859,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if (pDoc->GetFormatTable()->IsNumberFormat(aTemp2, nNumIndex, nVal))
aExpr2 =String( ::rtl::math::doubleToUString( nVal,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0), sal_True));
+ ScGlobal::pLocaleData->getNumDecimalSep()[0], sal_True));
else
aExpr2 = aTemp2;
}
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index d96b6d048135..d60f0cef199b 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -165,7 +165,7 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE
{
aSizeStr = ::rtl::math::doubleToUString( fSize,
rtl_math_StringFormat_F, nDec,
- rLocaleWrapper.getNumDecimalSep().GetChar(0) );
+ rLocaleWrapper.getNumDecimalSep()[0] );
aSizeStr += aUnitStr;
aSizeStr += DEFINE_CONST_UNICODE(" (");
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 5a21693a7f90..6fa22c953bee 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -726,13 +726,13 @@ bool ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos
if ( StringContains( pChr->uppercase( pLoc->getTimeAM() ), rString, nPos ) )
{
nAmPm = 1;
- nPos = nPos + pLoc->getTimeAM().Len();
+ nPos = nPos + pLoc->getTimeAM().getLength();
return true;
}
else if ( StringContains( pChr->uppercase( pLoc->getTimePM() ), rString, nPos ) )
{
nAmPm = -1;
- nPos = nPos + pLoc->getTimePM().Len();
+ nPos = nPos + pLoc->getTimePM().getLength();
return true;
}
}
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index c883242f7a1d..0dfe952936f4 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -1224,7 +1224,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType()
eNewType = NUMBERFORMAT_TEXT;
break;
default:
- if ( sStrArray[i] == pLoc->getTime100SecSep() )
+ if (pLoc->getTime100SecSep().equals(sStrArray[i]))
bDecSep = true; // for SS,0
eNewType = NUMBERFORMAT_UNDEFINED;
break;
@@ -1273,7 +1273,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType()
{
if (nCurrPos != STRING_NOTFOUND)
eScannedType = NUMBERFORMAT_UNDEFINED;
- else if ( sStrArray[i] != pLoc->getTimeSep() )
+ else if (!pLoc->getTimeSep().equals(sStrArray[i]))
return nPos;
}
}
@@ -1292,8 +1292,8 @@ xub_StrLen ImpSvNumberformatScan::ScanType()
{
if (nCurrPos != STRING_NOTFOUND)
eScannedType = NUMBERFORMAT_UNDEFINED;
- else if ( sStrArray[i] != pFormatter->GetDateSep()
- && sStrArray[i] != pLoc->getTimeSep() )
+ else if ( pFormatter->GetDateSep() != sStrArray[i]
+ && !pLoc->getTimeSep().equals(sStrArray[i]) )
return nPos;
}
}
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 9f100f8ca79d..4acae0d06b9a 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -698,7 +698,7 @@ OUString CreateExactSizeText( sal_Int64 nSize )
OUString aSizeStr( ::rtl::math::doubleToUString( fSize,
rtl_math_StringFormat_F, nDec,
- SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0)));
+ SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]) );
aSizeStr += aUnitStr;
return aSizeStr;
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index 32b962b11c07..50486b8650bf 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -579,7 +579,7 @@ IMPL_LINK( SvxSuperContourDlg, MousePosHdl, ContourWindow*, pWnd )
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
const Point& rMousePos = pWnd->GetMousePos();
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0);
+ const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
aStr.Assign( GetUnitString( rMousePos.X(), eFieldUnit, cSep ) );
aStr.Append( String::CreateFromAscii( " / " ) );
@@ -596,7 +596,7 @@ IMPL_LINK( SvxSuperContourDlg, GraphSizeHdl, ContourWindow*, pWnd )
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
const Size& rSize = pWnd->GetGraphicSize();
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0);
+ const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
aStr.Assign( GetUnitString( rSize.Width(), eFieldUnit, cSep ) );
aStr.Append( String::CreateFromAscii( " x " ) );
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index b6a211e017e4..643fe62d20ae 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -676,7 +676,7 @@ IMPL_LINK( SvxIMapDlg, MousePosHdl, IMapWindow*, pWnd )
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
const Point& rMousePos = pWnd->GetMousePos();
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0);
+ const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
aStr.Assign( GetUnitString( rMousePos.X(), eFieldUnit, cSep ) );
aStr.Append( DEFINE_CONST_UNICODE( " / " ) );
@@ -693,7 +693,7 @@ IMPL_LINK( SvxIMapDlg, GraphSizeHdl, IMapWindow*, pWnd )
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
const Size& rSize = pWnd->GetGraphicSize();
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0);
+ const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
aStr.Assign( GetUnitString( rSize.Width(), eFieldUnit, cSep ) );
aStr.Append( DEFINE_CONST_UNICODE( " x " ) );
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 374bb29b54d3..8a6758e105c2 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -3256,7 +3256,7 @@ void FormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos)
,xFormatter
,xField
,aAppLocale
- ,(sal_Char)aLocaleWrapper.getNumDecimalSep().GetChar(0)
+ ,(sal_Char)aLocaleWrapper.getNumDecimalSep()[0]
,getParseContext());
aRow[(*iter).xText] = sCriteria;
}
diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx
index 09eeadc581bc..1d704c5106be 100644
--- a/svx/source/items/chrtitem.cxx
+++ b/svx/source/items/chrtitem.cxx
@@ -268,7 +268,7 @@ SfxItemPresentation SvxDoubleItem::GetPresentation
if ( pIntlWrapper )
{
rText = ::rtl::math::doubleToUString( fVal, rtl_math_StringFormat_E, 4,
- pIntlWrapper->getLocaleData()->getNumDecimalSep().GetChar(0), true );
+ pIntlWrapper->getLocaleData()->getNumDecimalSep()[0], true );
}
else
rText = GetValueText();
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index 27811db92f02..8b09cb2cf2a6 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -76,7 +76,7 @@ String SvxPosSizeStatusBarControl::GetMetricStr_Impl( long nVal )
FieldUnit eInUnit = FUNIT_100TH_MM;
String sMetric;
- const sal_Unicode cSep = Application::GetSettings().GetLocaleDataWrapper().getNumDecimalSep().GetChar(0);
+ const sal_Unicode cSep = Application::GetSettings().GetLocaleDataWrapper().getNumDecimalSep()[0];
sal_Int64 nConvVal = MetricField::ConvertValue( nVal * 100, 0L, 0, eInUnit, eOutUnit );
if ( nConvVal < 0 && ( nConvVal / 100 == 0 ) )
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index e953c4cf2aa9..8b2b15202614 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -898,7 +898,7 @@ SfxItemPresentation SdrAngleItem::GetPresentation(
else
{
sal_Unicode cDec =
- pIntlWrapper->getLocaleData()->getNumDecimalSep().GetChar(0);
+ pIntlWrapper->getLocaleData()->getNumDecimalSep()[0];
rText.Insert(cDec, nLen-2);
if(bNull1)
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index eeed2c54740f..2d194bb2d115 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1299,7 +1299,7 @@ void SdrModel::TakeMetricStr(long nVal, rtl::OUString& rStr, bool bNoUnitChars,
aBuf.insert(0, sal_Unicode('0'));
}
- sal_Unicode cDec( rLoc.getNumDecimalSep().GetChar(0) );
+ sal_Unicode cDec( rLoc.getNumDecimalSep()[0] );
// insert KommaChar (decimal point character)
sal_Int32 nVorKomma = aBuf.getLength() - nKomma;
@@ -1369,7 +1369,7 @@ void SdrModel::TakeWinkStr(long nWink, rtl::OUString& rStr, bool bNoDegChar) con
while(aBuf.getLength() < nAnz)
aBuf.insert(0, sal_Unicode('0'));
- aBuf.insert(aBuf.getLength()-2, rLoc.getNumDecimalSep().GetChar(0));
+ aBuf.insert(aBuf.getLength()-2, rLoc.getNumDecimalSep()[0]);
if(bNeg)
aBuf.insert(0, sal_Unicode('-'));
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 2e7cd0546c29..439bfba81f8e 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -131,7 +131,7 @@ void SdrMeasureObj::TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMe
rStr += sal_Unicode('?');
}
- sal_Unicode cDec(SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0));
+ sal_Unicode cDec(SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]);
if(rStr.Search(cDec) != STRING_NOTFOUND)
{
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index a9c585366b6e..333582a64ef5 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -914,7 +914,7 @@ void SdrFormatter::TakeStr(long nVal, XubString& rStr) const
if(nK > 0)
{
// do we still have decimal places?
- sal_Unicode cDec(rLoc.getNumDecimalSep().GetChar(0));
+ sal_Unicode cDec(rLoc.getNumDecimalSep()[0]);
aStr.Insert(cDec, nVorKomma);
}
}
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index b19c2ccc1b9d..73baaf1ce835 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -467,7 +467,7 @@ String SwCalc::GetStrResult( double nValue, sal_Bool )
String aRetStr( ::rtl::math::doubleToUString( nValue,
rtl_math_StringFormat_Automatic,
nDec,
- pLclData->getNumDecimalSep().GetChar(0),
+ pLclData->getNumDecimalSep()[0],
true ));
return aRetStr;
@@ -916,8 +916,8 @@ if( !nUseOld )
else
{
sal_Unicode ch;
- sal_Unicode cTSep = pLclData->getNumThousandSep().GetChar(0),
- cDSep = pLclData->getNumDecimalSep().GetChar(0);
+ sal_Unicode cTSep = pLclData->getNumThousandSep()[0],
+ cDSep = pLclData->getNumDecimalSep()[0];
do {
if( 0 == ( ch = NextCh( sCommand, nCommandPos ) ) )
@@ -1528,8 +1528,8 @@ lcl_Str2Double( const String& rCommand, xub_StrLen& rCommandPos, double& rVal,
const sal_Unicode* pEnd;
rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos,
rCommand.GetBuffer() + rCommand.Len(),
- pLclData->getNumDecimalSep().GetChar(0),
- pLclData->getNumThousandSep().GetChar(0),
+ pLclData->getNumDecimalSep()[0],
+ pLclData->getNumThousandSep()[0],
&eStatus, &pEnd );
rCommandPos = static_cast<xub_StrLen>(pEnd - rCommand.GetBuffer());
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 2412d981c260..7f31f84d5ee5 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -118,8 +118,8 @@ double SwSortElement::StrToDouble( const String& rStr ) const
rtl_math_ConversionStatus eStatus;
sal_Int32 nEnd;
double nRet = ::rtl::math::stringToDouble( rStr,
- pLclData->getNumDecimalSep().GetChar(0),
- pLclData->getNumThousandSep().GetChar(0),
+ pLclData->getNumDecimalSep()[0],
+ pLclData->getNumThousandSep()[0],
&eStatus, &nEnd );
if( rtl_math_ConversionStatus_Ok != eStatus || nEnd == 0 )
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 6af0100d5070..178483b57ab8 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -5605,7 +5605,7 @@ WW8Fib::WW8Fib(sal_uInt8 nVer)
Locale aTempLocale;
SvxLanguageToLocale( aTempLocale, lid );
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), aTempLocale );
- nNumDecimalSep = aLocaleWrapper.getNumDecimalSep().GetChar( 0 );
+ nNumDecimalSep = aLocaleWrapper.getNumDecimalSep()[0];
}
sal_Unicode WW8Fib::getNumDecimalSep() const
diff --git a/unotools/inc/unotools/localedatawrapper.hxx b/unotools/inc/unotools/localedatawrapper.hxx
index 6474ba05277b..0743c5be2491 100644
--- a/unotools/inc/unotools/localedatawrapper.hxx
+++ b/unotools/inc/unotools/localedatawrapper.hxx
@@ -30,16 +30,14 @@
#define _UNOTOOLS_LOCALEDATAWRAPPER_HXX
#include <boost/noncopyable.hpp>
-#include <tools/string.hxx>
+#include <boost/shared_ptr.hpp>
#include <com/sun/star/i18n/XLocaleData4.hpp>
#include <com/sun/star/i18n/LocaleItem.hpp>
#include <com/sun/star/i18n/reservedWords.hpp>
+#include <rtl/ustring.hxx>
#include <unotools/readwritemutexguard.hxx>
#include "unotools/unotoolsdllapi.h"
-#include <boost/shared_ptr.hpp>
-
-
namespace com { namespace sun { namespace star {
namespace lang {
class XMultiServiceFactory;
@@ -75,10 +73,10 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper : private boost::noncopyable
::com::sun::star::uno::Sequence< ::rtl::OUString > aReservedWordSeq;
::com::sun::star::uno::Sequence< sal_Int32 > aGrouping;
// cached items
- String aLocaleItem[::com::sun::star::i18n::LocaleItem::COUNT];
- String aReservedWord[::com::sun::star::i18n::reservedWords::COUNT];
- String aCurrSymbol;
- String aCurrBankSymbol;
+ rtl::OUString aLocaleItem[::com::sun::star::i18n::LocaleItem::COUNT];
+ rtl::OUString aReservedWord[::com::sun::star::i18n::reservedWords::COUNT];
+ rtl::OUString aCurrSymbol;
+ rtl::OUString aCurrBankSymbol;
int nDateFormat;
int nLongDateFormat;
sal_uInt16 nCurrPositiveFormat;
@@ -92,32 +90,32 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper : private boost::noncopyable
sal_Unicode cCurrZeroChar;
// whenever Locale changes
- void invalidateData();
+ void invalidateData();
- void getOneLocaleItemImpl( sal_Int16 nItem );
- const String& getOneLocaleItem( sal_Int16 nItem ) const;
+ void getOneLocaleItemImpl( sal_Int16 nItem );
+ const rtl::OUString& getOneLocaleItem( sal_Int16 nItem ) const;
- void getOneReservedWordImpl( sal_Int16 nWord );
- const String& getOneReservedWord( sal_Int16 nWord ) const;
+ void getOneReservedWordImpl( sal_Int16 nWord );
+ const rtl::OUString& getOneReservedWord( sal_Int16 nWord ) const;
- void getCurrSymbolsImpl();
- void getCurrFormatsImpl();
+ void getCurrSymbolsImpl();
+ void getCurrFormatsImpl();
- void scanCurrFormatImpl( const String& rCode,
- xub_StrLen nStart, xub_StrLen& nSign,
- xub_StrLen& nPar, xub_StrLen& nNum,
- xub_StrLen& nBlank, xub_StrLen& nSym );
+ void scanCurrFormatImpl( const rtl::OUString& rCode,
+ sal_Int32 nStart, sal_Int32& nSign,
+ sal_Int32& nPar, sal_Int32& nNum,
+ sal_Int32& nBlank, sal_Int32& nSym );
- void getDateFormatsImpl();
- DateFormat scanDateFormatImpl( const String& rCode );
+ void getDateFormatsImpl();
+ DateFormat scanDateFormatImpl( const rtl::OUString& rCode );
- void getDefaultCalendarImpl();
+ void getDefaultCalendarImpl();
- sal_Unicode* ImplAddFormatNum( sal_Unicode* pBuf,
- sal_Int64 nNumber, sal_uInt16 nDecimals,
- sal_Bool bUseThousandSep, sal_Bool bTrailingZeros ) const;
+ sal_Unicode* ImplAddFormatNum( sal_Unicode* pBuf,
+ sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep, sal_Bool bTrailingZeros ) const;
- void getDigitGroupingImpl();
+ void getDigitGroupingImpl();
public:
LocaleDataWrapper(
@@ -172,7 +170,7 @@ public:
static ::com::sun::star::uno::Sequence< sal_uInt16 > getInstalledLanguageTypes();
/// maps the LocaleData string to the International enum
- MeasurementSystem mapMeasurementStringToEnum( const String& rMS ) const;
+ MeasurementSystem mapMeasurementStringToEnum( const rtl::OUString& rMS ) const;
/// Convenience method to obtain the default calendar.
const ::boost::shared_ptr< ::com::sun::star::i18n::Calendar2 > getDefaultCalendar() const;
@@ -197,107 +195,107 @@ public:
// Functionality of class International methods, LocaleItem
- inline const String& getDateSep() const
+ const rtl::OUString& getDateSep() const
{ return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DATE_SEPARATOR ); }
- inline const String& getNumThousandSep() const
+ const rtl::OUString& getNumThousandSep() const
{ return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::THOUSAND_SEPARATOR ); }
- inline const String& getNumDecimalSep() const
+ const rtl::OUString& getNumDecimalSep() const
{ return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DECIMAL_SEPARATOR ); }
- inline const String& getTimeSep() const
+ const rtl::OUString& getTimeSep() const
{ return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_SEPARATOR ); }
- inline const String& getTime100SecSep() const
+ const rtl::OUString& getTime100SecSep() const
{ return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_100SEC_SEPARATOR ); }
- inline const String& getListSep() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LIST_SEPARATOR ); }
- inline const String& getQuotationMarkStart() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::SINGLE_QUOTATION_START ); }
- inline const String& getQuotationMarkEnd() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::SINGLE_QUOTATION_END ); }
- inline const String& getDoubleQuotationMarkStart() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DOUBLE_QUOTATION_START ); }
- inline const String& getDoubleQuotationMarkEnd() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DOUBLE_QUOTATION_END ); }
- inline const String& getMeasurementSystem() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::MEASUREMENT_SYSTEM ); }
- inline MeasurementSystem getMeasurementSystemEnum() const
- { return mapMeasurementStringToEnum( getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::MEASUREMENT_SYSTEM ) ); }
- inline const String& getTimeAM() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_AM ); }
- inline const String& getTimePM() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_PM ); }
- inline const String& getLongDateDayOfWeekSep() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_DAY_OF_WEEK_SEPARATOR ); }
- inline const String& getLongDateDaySep() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_DAY_SEPARATOR ); }
- inline const String& getLongDateMonthSep() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_MONTH_SEPARATOR ); }
- inline const String& getLongDateYearSep() const
- { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_YEAR_SEPARATOR ); }
+ const rtl::OUString& getListSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LIST_SEPARATOR ); }
+ const rtl::OUString& getQuotationMarkStart() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::SINGLE_QUOTATION_START ); }
+ const rtl::OUString& getQuotationMarkEnd() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::SINGLE_QUOTATION_END ); }
+ const rtl::OUString& getDoubleQuotationMarkStart() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DOUBLE_QUOTATION_START ); }
+ const rtl::OUString& getDoubleQuotationMarkEnd() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DOUBLE_QUOTATION_END ); }
+ const rtl::OUString& getMeasurementSystem() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::MEASUREMENT_SYSTEM ); }
+ MeasurementSystem getMeasurementSystemEnum() const
+ { return mapMeasurementStringToEnum( getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::MEASUREMENT_SYSTEM ) ); }
+ const rtl::OUString& getTimeAM() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_AM ); }
+ const rtl::OUString& getTimePM() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_PM ); }
+ const rtl::OUString& getLongDateDayOfWeekSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_DAY_OF_WEEK_SEPARATOR ); }
+ const rtl::OUString& getLongDateDaySep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_DAY_SEPARATOR ); }
+ const rtl::OUString& getLongDateMonthSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_MONTH_SEPARATOR ); }
+ const rtl::OUString& getLongDateYearSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_YEAR_SEPARATOR ); }
// currency
- const String& getCurrSymbol() const;
- const String& getCurrBankSymbol() const;
- sal_uInt16 getCurrPositiveFormat() const;
- sal_uInt16 getCurrNegativeFormat() const;
- sal_uInt16 getCurrDigits() const;
+ const rtl::OUString& getCurrSymbol() const;
+ const rtl::OUString& getCurrBankSymbol() const;
+ sal_uInt16 getCurrPositiveFormat() const;
+ sal_uInt16 getCurrNegativeFormat() const;
+ sal_uInt16 getCurrDigits() const;
// simple date and time formatting
- DateFormat getDateFormat() const;
- DateFormat getLongDateFormat() const;
- /// only numerical values of Gregorian calendar
- String getDate( const Date& rDate ) const;
- String getTime( const Time& rTime, sal_Bool bSec = sal_True,
- sal_Bool b100Sec = sal_False ) const;
- String getDuration( const Time& rTime,
- sal_Bool bSec = sal_True, sal_Bool b100Sec = sal_False ) const;
-
- /** The CalendarWrapper already <b>MUST</b>
- have loaded a calendar.
- @param nDisplayDayOfWeek
- 0 := abbreviated name
- 1 := full name
- @param bDayOfMonthWithLeadingZero
- <FALSE/> := without leading zero
- <TRUE/> := with leading zero if <10
- @param nDisplayMonth
- 0 := abbreviated name
- 1 := full name
- @param bTwoDigitYear
- <FALSE/> := full year
- <TRUE/> := year % 100
- */
- String getLongDate( const Date& rDate,
- CalendarWrapper& rCal,
- sal_Int16 nDisplayDayOfWeek = 1,
- sal_Bool bDayOfMonthWithLeadingZero = sal_False,
- sal_Int16 nDisplayMonth = 1,
- sal_Bool bTwoDigitYear = sal_False
- ) const;
-
- /** Simple number formatting
- @param nNumber
- value * 10**nDecimals
- @param bTrailingZeros
- </sal_True> := always display trailing zeros in
- decimal places, even if integer value.
- </sal_False> := trailing zeros are only displayed
- if the value is not an integer value.
- */
- String getNum( sal_Int64 nNumber, sal_uInt16 nDecimals,
- sal_Bool bUseThousandSep = sal_True,
- sal_Bool bTrailingZeros = sal_True ) const;
-
- /// "Secure" currency formatted string.
- String getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
- const String& rCurrencySymbol,
- sal_Bool bUseThousandSep = sal_True ) const;
- /** Default currency formatted string, use with
- care as default currency may change in any
- locale, for example, DEM -> EUR */
- String getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
- sal_Bool bUseThousandSep = sal_True ) const
- { return getCurr( nNumber, nDecimals,
- getCurrSymbol(), bUseThousandSep ); }
+ DateFormat getDateFormat() const;
+ DateFormat getLongDateFormat() const;
+ /// only numerical values of Gregorian calendar
+ rtl::OUString getDate( const Date& rDate ) const;
+ rtl::OUString getTime( const Time& rTime, sal_Bool bSec = sal_True,
+ sal_Bool b100Sec = sal_False ) const;
+ rtl::OUString getDuration( const Time& rTime,
+ sal_Bool bSec = sal_True, sal_Bool b100Sec = sal_False ) const;
+
+ /** The CalendarWrapper already <b>MUST</b>
+ have loaded a calendar.
+ @param nDisplayDayOfWeek
+ 0 := abbreviated name
+ 1 := full name
+ @param bDayOfMonthWithLeadingZero
+ <FALSE/> := without leading zero
+ <TRUE/> := with leading zero if <10
+ @param nDisplayMonth
+ 0 := abbreviated name
+ 1 := full name
+ @param bTwoDigitYear
+ <FALSE/> := full year
+ <TRUE/> := year % 100
+ */
+ rtl::OUString getLongDate( const Date& rDate,
+ CalendarWrapper& rCal,
+ sal_Int16 nDisplayDayOfWeek = 1,
+ sal_Bool bDayOfMonthWithLeadingZero = sal_False,
+ sal_Int16 nDisplayMonth = 1,
+ sal_Bool bTwoDigitYear = sal_False
+ ) const;
+
+ /** Simple number formatting
+ @param nNumber
+ value * 10**nDecimals
+ @param bTrailingZeros
+ </sal_True> := always display trailing zeros in
+ decimal places, even if integer value.
+ </sal_False> := trailing zeros are only displayed
+ if the value is not an integer value.
+ */
+ rtl::OUString getNum( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep = sal_True,
+ sal_Bool bTrailingZeros = sal_True ) const;
+
+ /// "Secure" currency formatted string.
+ rtl::OUString getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ const rtl::OUString& rCurrencySymbol,
+ sal_Bool bUseThousandSep = sal_True ) const;
+ /** Default currency formatted string, use with
+ care as default currency may change in any
+ locale, for example, DEM -> EUR */
+ rtl::OUString getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep = sal_True ) const
+ { return getCurr( nNumber, nDecimals,
+ getCurrSymbol(), bUseThousandSep ); }
// dummy returns, to be implemented
inline sal_Unicode getCurrZeroChar() const
@@ -313,19 +311,19 @@ public:
// reserved words
- inline const String& getTrueWord() const
+ const rtl::OUString& getTrueWord() const
{ return getOneReservedWord( ::com::sun::star::i18n::reservedWords::TRUE_WORD ); }
- inline const String& getFalseWord() const
+ const rtl::OUString& getFalseWord() const
{ return getOneReservedWord( ::com::sun::star::i18n::reservedWords::FALSE_WORD ); }
/// return a quarter string matching nQuarter (0..3) => "1st quarter" .. "4th quarter"
- inline const String& getQuarterWord( sal_Int16 nQuarter ) const
+ const rtl::OUString& getQuarterWord( sal_Int16 nQuarter ) const
{ return getOneReservedWord( ::com::sun::star::i18n::reservedWords::QUARTER1_WORD + nQuarter ); }
- inline const String& getAboveWord() const
+ const rtl::OUString& getAboveWord() const
{ return getOneReservedWord( ::com::sun::star::i18n::reservedWords::ABOVE_WORD ); }
- inline const String& getBelowWord() const
+ const rtl::OUString& getBelowWord() const
{ return getOneReservedWord( ::com::sun::star::i18n::reservedWords::BELOW_WORD ); }
/// return a quarter abbreviation string matching nQuarter (0..3) => "Q1" .. "Q2"
- inline const String& getQuarterAbbreviation( sal_Int16 nQuarter ) const
+ const rtl::OUString& getQuarterAbbreviation( sal_Int16 nQuarter ) const
{ return getOneReservedWord( ::com::sun::star::i18n::reservedWords::QUARTER1_ABBREVIATION + nQuarter ); }
/** Return whether locale data checks are enabled.
@@ -347,7 +345,7 @@ public:
/** Ouput a message during locale data checking. The (UTF-8) string is
written to stderr and in a non-product build or if DBG_UTIL is enabled
also raised as an assertion message box. */
- static void outputCheckMessage( const String& rMsg );
+ static void outputCheckMessage( const rtl::OUString& rMsg );
static void outputCheckMessage( const char* pStr);
private:
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 1e2ee1562465..698a457d6724 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -110,24 +110,20 @@ const ::com::sun::star::lang::Locale& LocaleDataWrapper::getLocale() const
void LocaleDataWrapper::invalidateData()
{
- aCurrSymbol.Erase();
- aCurrBankSymbol.Erase();
+ aCurrSymbol = rtl::OUString();
+ aCurrBankSymbol = rtl::OUString();
nDateFormat = nLongDateFormat = nDateFormatInvalid;
nCurrPositiveFormat = nCurrNegativeFormat = nCurrDigits = nCurrFormatInvalid;
if ( bLocaleDataItemValid )
{
- for ( sal_Int32 j=0; j<LocaleItem::COUNT; j++ )
- {
- aLocaleItem[j].Erase();
- }
+ for (sal_Int32 j=0; j<LocaleItem::COUNT; ++j)
+ aLocaleItem[j] = rtl::OUString();
bLocaleDataItemValid = sal_False;
}
if ( bReservedWordValid )
{
- for ( sal_Int16 j=0; j<reservedWords::COUNT; j++ )
- {
- aReservedWord[j].Erase();
- }
+ for ( sal_Int16 j=0; j<reservedWords::COUNT; ++j )
+ aReservedWord[j] = rtl::OUString();
bReservedWordValid = sal_False;
}
xDefaultCalendar.reset();
@@ -370,7 +366,7 @@ void LocaleDataWrapper::invalidateData()
return rInstalledLanguageTypes;
}
-const String& LocaleDataWrapper::getOneLocaleItem( sal_Int16 nItem ) const
+const rtl::OUString& LocaleDataWrapper::getOneLocaleItem( sal_Int16 nItem ) const
{
::utl::ReadWriteGuard aGuard( aMutex );
if ( nItem >= LocaleItem::COUNT )
@@ -378,7 +374,7 @@ const String& LocaleDataWrapper::getOneLocaleItem( sal_Int16 nItem ) const
SAL_WARN( "unotools", "getOneLocaleItem: bounds" );
return aLocaleItem[0];
}
- if ( aLocaleItem[nItem].Len() == 0 )
+ if (aLocaleItem[nItem].isEmpty())
{ // no cached content
aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getOneLocaleItemImpl( nItem );
@@ -466,7 +462,7 @@ void LocaleDataWrapper::getOneReservedWordImpl( sal_Int16 nWord )
}
-const String& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const
+const rtl::OUString& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const
{
::utl::ReadWriteGuard aGuard( aMutex );
if ( nWord < 0 || nWord >= reservedWords::COUNT )
@@ -474,7 +470,7 @@ const String& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const
SAL_WARN( "unotools", "getOneReservedWord: bounds" );
nWord = reservedWords::FALSE_WORD;
}
- if ( aReservedWord[nWord].Len() == 0 )
+ if (aReservedWord[nWord].isEmpty())
{ // no cached content
aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getOneReservedWordImpl( nWord );
@@ -483,10 +479,10 @@ const String& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const
}
-MeasurementSystem LocaleDataWrapper::mapMeasurementStringToEnum( const String& rMS ) const
+MeasurementSystem LocaleDataWrapper::mapMeasurementStringToEnum( const rtl::OUString& rMS ) const
{
//! TODO: could be cached too
- if ( rMS.EqualsIgnoreCaseAscii( "metric" ) )
+ if ( rMS.equalsIgnoreAsciiCase( "metric" ) )
return MEASURE_METRIC;
//! TODO: other measurement systems? => extend enum MeasurementSystem
return MEASURE_US;
@@ -543,10 +539,10 @@ const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > L
// --- currencies -----------------------------------------------------
-const String& LocaleDataWrapper::getCurrSymbol() const
+const rtl::OUString& LocaleDataWrapper::getCurrSymbol() const
{
::utl::ReadWriteGuard aGuard( aMutex );
- if ( !aCurrSymbol.Len() )
+ if (aCurrSymbol.isEmpty())
{
aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getCurrSymbolsImpl();
@@ -555,10 +551,10 @@ const String& LocaleDataWrapper::getCurrSymbol() const
}
-const String& LocaleDataWrapper::getCurrBankSymbol() const
+const rtl::OUString& LocaleDataWrapper::getCurrBankSymbol() const
{
::utl::ReadWriteGuard aGuard( aMutex );
- if ( !aCurrBankSymbol.Len() )
+ if (aCurrBankSymbol.isEmpty())
{
aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getCurrSymbolsImpl();
@@ -628,7 +624,7 @@ void LocaleDataWrapper::getCurrSymbolsImpl()
if (areChecksEnabled())
outputCheckMessage( String( RTL_CONSTASCII_USTRINGPARAM(
"LocaleDataWrapper::getCurrSymbolsImpl: no currency at all, using ShellsAndPebbles")));
- aCurrSymbol.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "ShellsAndPebbles" ) );
+ aCurrSymbol = rtl::OUString("ShellsAndPebbles");
aCurrBankSymbol = aCurrSymbol;
nCurrPositiveFormat = nCurrNegativeFormat = nCurrFormatDefault;
nCurrDigits = 2;
@@ -641,13 +637,13 @@ void LocaleDataWrapper::getCurrSymbolsImpl()
}
-void LocaleDataWrapper::scanCurrFormatImpl( const String& rCode,
- xub_StrLen nStart, xub_StrLen& nSign, xub_StrLen& nPar,
- xub_StrLen& nNum, xub_StrLen& nBlank, xub_StrLen& nSym )
+void LocaleDataWrapper::scanCurrFormatImpl( const rtl::OUString& rCode,
+ sal_Int32 nStart, sal_Int32& nSign, sal_Int32& nPar,
+ sal_Int32& nNum, sal_Int32& nBlank, sal_Int32& nSym )
{
- nSign = nPar = nNum = nBlank = nSym = STRING_NOTFOUND;
- const sal_Unicode* const pStr = rCode.GetBuffer();
- const sal_Unicode* const pStop = pStr + rCode.Len();
+ nSign = nPar = nNum = nBlank = nSym = -1;
+ const sal_Unicode* const pStr = rCode.getStr();
+ const sal_Unicode* const pStop = pStr + rCode.getLength();
const sal_Unicode* p = pStr + nStart;
int nInSection = 0;
sal_Bool bQuote = sal_False;
@@ -667,17 +663,17 @@ void LocaleDataWrapper::scanCurrFormatImpl( const String& rCode,
bQuote = sal_True;
break;
case '-' :
- if ( !nInSection && nSign == STRING_NOTFOUND )
- nSign = (xub_StrLen)(p - pStr);
+ if (!nInSection && nSign == -1)
+ nSign = p - pStr;
break;
case '(' :
- if ( !nInSection && nPar == STRING_NOTFOUND )
- nPar = (xub_StrLen)(p - pStr);
+ if (!nInSection && nPar == -1)
+ nPar = p - pStr;
break;
case '0' :
case '#' :
- if ( !nInSection && nNum == STRING_NOTFOUND )
- nNum = (xub_StrLen)(p - pStr);
+ if (!nInSection && nNum == -1)
+ nNum = p - pStr;
break;
case '[' :
nInSection++;
@@ -686,17 +682,17 @@ void LocaleDataWrapper::scanCurrFormatImpl( const String& rCode,
if ( nInSection )
{
nInSection--;
- if ( !nInSection && nBlank == STRING_NOTFOUND
- && nSym != STRING_NOTFOUND && p < pStop-1 && *(p+1) == ' ' )
- nBlank = (xub_StrLen)(p - pStr + 1);
+ if (!nInSection && nBlank == -1
+ && nSym != -1 && p < pStop-1 && *(p+1) == ' ' )
+ nBlank = p - pStr + 1;
}
break;
case '$' :
- if ( nSym == STRING_NOTFOUND && nInSection && *(p-1) == '[' )
+ if (nSym == -1 && nInSection && *(p-1) == '[')
{
- nSym = (xub_StrLen)(p - pStr + 1);
- if ( nNum != STRING_NOTFOUND && *(p-2) == ' ' )
- nBlank = (xub_StrLen)(p - pStr - 2);
+ nSym = p - pStr + 1;
+ if (nNum != -1 && *(p-2) == ' ')
+ nBlank = p - pStr - 2;
}
break;
case ';' :
@@ -704,14 +700,14 @@ void LocaleDataWrapper::scanCurrFormatImpl( const String& rCode,
p = pStop;
break;
default:
- if ( !nInSection && nSym == STRING_NOTFOUND && rCode.Equals( aCurrSymbol, (xub_StrLen)(p-pStr), aCurrSymbol.Len() ) )
+ if (!nInSection && nSym == -1 && String(rCode).Equals( aCurrSymbol, (xub_StrLen)(p-pStr), aCurrSymbol.getLength()))
{ // currency symbol not surrounded by [$...]
- nSym = (xub_StrLen)(p - pStr);
- if ( nBlank == STRING_NOTFOUND && pStr < p && *(p-1) == ' ' )
- nBlank = (xub_StrLen)(p - pStr - 1);
- p += aCurrSymbol.Len() - 1;
- if ( nBlank == STRING_NOTFOUND && p < pStop-2 && *(p+2) == ' ' )
- nBlank = (xub_StrLen)(p - pStr + 2);
+ nSym = p - pStr;
+ if (nBlank == -1 && pStr < p && *(p-1) == ' ')
+ nBlank = p - pStr - 1;
+ p += aCurrSymbol.getLength() - 1;
+ if (nBlank == -1 && p < pStop-2 && *(p+2) == ' ')
+ nBlank = p - pStr + 2;
}
}
}
@@ -719,7 +715,6 @@ void LocaleDataWrapper::scanCurrFormatImpl( const String& rCode,
}
}
-
void LocaleDataWrapper::getCurrFormatsImpl()
{
NumberFormatCodeWrapper aNumberFormatCode( xSMgr, getLocale() );
@@ -772,18 +767,18 @@ void LocaleDataWrapper::getCurrFormatsImpl()
// make sure it's loaded
getCurrSymbol();
- xub_StrLen nSign, nPar, nNum, nBlank, nSym;
+ sal_Int32 nSign, nPar, nNum, nBlank, nSym;
// positive format
nElem = (nDef >= 0 ? nDef : (nNeg >= 0 ? nNeg : 0));
scanCurrFormatImpl( pFormatArr[nElem].Code, 0, nSign, nPar, nNum, nBlank, nSym );
- if (areChecksEnabled() && (nNum == STRING_NOTFOUND || nSym == STRING_NOTFOUND))
+ if (areChecksEnabled() && (nNum == -1 || nSym == -1))
{
rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM(
"LocaleDataWrapper::getCurrFormatsImpl: CurrPositiveFormat?"));
outputCheckMessage( appendLocaleInfo( aMsg ) );
}
- if ( nBlank == STRING_NOTFOUND )
+ if (nBlank == -1)
{
if ( nSym < nNum )
nCurrPositiveFormat = 0; // $1
@@ -804,17 +799,17 @@ void LocaleDataWrapper::getCurrFormatsImpl()
else
{
const ::rtl::OUString& rCode = pFormatArr[nNeg].Code;
- xub_StrLen nDelim = (xub_StrLen)rCode.indexOf( ';' );
+ sal_Int32 nDelim = rCode.indexOf(';');
scanCurrFormatImpl( rCode, nDelim+1, nSign, nPar, nNum, nBlank, nSym );
- if (areChecksEnabled() && (nNum == STRING_NOTFOUND ||
- nSym == STRING_NOTFOUND || (nPar == STRING_NOTFOUND &&
- nSign == STRING_NOTFOUND)))
+ if (areChecksEnabled() && (nNum == -1 ||
+ nSym == -1 || (nPar == -1 &&
+ nSign == -1)))
{
rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM(
"LocaleDataWrapper::getCurrFormatsImpl: CurrNegativeFormat?"));
outputCheckMessage( appendLocaleInfo( aMsg ) );
}
- if ( nBlank == STRING_NOTFOUND )
+ if (nBlank == -1)
{
if ( nSym < nNum )
{
@@ -894,7 +889,7 @@ DateFormat LocaleDataWrapper::getLongDateFormat() const
}
-DateFormat LocaleDataWrapper::scanDateFormatImpl( const String& rCode )
+DateFormat LocaleDataWrapper::scanDateFormatImpl( const rtl::OUString& rCode )
{
// Only some european versions were translated, the ones with different
// keyword combinations are:
@@ -902,35 +897,35 @@ DateFormat LocaleDataWrapper::scanDateFormatImpl( const String& rCode )
// Dutch DMJ, Finnish PKV
// default is English keywords for every other language
- xub_StrLen nDay = rCode.Search( 'D' );
- xub_StrLen nMonth = rCode.Search( 'M' );
- xub_StrLen nYear = rCode.Search( 'Y' );
- if ( nDay == STRING_NOTFOUND || nMonth == STRING_NOTFOUND || nYear == STRING_NOTFOUND )
+ sal_Int32 nDay = rCode.indexOf('D');
+ sal_Int32 nMonth = rCode.indexOf('M');
+ sal_Int32 nYear = rCode.indexOf('Y');
+ if (nDay == -1 || nMonth == -1 || nYear == -1)
{ // This algorithm assumes that all three parts (DMY) are present
- if ( nMonth == STRING_NOTFOUND )
+ if (nMonth == -1)
{ // only Finnish has something else than 'M' for month
- nMonth = rCode.Search( 'K' );
- if ( nMonth != STRING_NOTFOUND )
+ nMonth = rCode.indexOf('K');
+ if (nMonth != -1)
{
- nDay = rCode.Search( 'P' );
- nYear = rCode.Search( 'V' );
+ nDay = rCode.indexOf('P');
+ nYear = rCode.indexOf('V');
}
}
- else if ( nDay == STRING_NOTFOUND )
+ else if (nDay == -1)
{ // We have a month 'M' if we reach this branch.
// Possible languages containing 'M' but no 'D':
// German, French, Italian
- nDay = rCode.Search( 'T' ); // German
- if ( nDay != STRING_NOTFOUND )
- nYear = rCode.Search( 'J' );
+ nDay = rCode.indexOf('T'); // German
+ if (nDay != -1)
+ nYear = rCode.indexOf('J');
else
{
- nYear = rCode.Search( 'A' ); // French, Italian
- if ( nYear != STRING_NOTFOUND )
+ nYear = rCode.indexOf('A'); // French, Italian
+ if (nYear != -1)
{
- nDay = rCode.Search( 'J' ); // French
- if ( nDay == STRING_NOTFOUND )
- nDay = rCode.Search( 'G' ); // Italian
+ nDay = rCode.indexOf('J'); // French
+ if (nDay == -1)
+ nDay = rCode.indexOf('G'); // Italian
}
}
}
@@ -938,11 +933,11 @@ DateFormat LocaleDataWrapper::scanDateFormatImpl( const String& rCode )
{ // We have a month 'M' and a day 'D'.
// Possible languages containing 'D' and 'M' but not 'Y':
// Spanish, Dutch
- nYear = rCode.Search( 'A' ); // Spanish
- if ( nYear == STRING_NOTFOUND )
- nYear = rCode.Search( 'J' ); // Dutch
+ nYear = rCode.indexOf('A'); // Spanish
+ if (nYear == -1)
+ nYear = rCode.indexOf('J'); // Dutch
}
- if ( nDay == STRING_NOTFOUND || nMonth == STRING_NOTFOUND || nYear == STRING_NOTFOUND )
+ if (nDay == -1 || nMonth == -1 || nYear == -1)
{
if (areChecksEnabled())
{
@@ -950,17 +945,17 @@ DateFormat LocaleDataWrapper::scanDateFormatImpl( const String& rCode )
"LocaleDataWrapper::scanDateFormat: not all DMY present"));
outputCheckMessage( appendLocaleInfo( aMsg ) );
}
- if ( nDay == STRING_NOTFOUND )
- nDay = rCode.Len();
- if ( nMonth == STRING_NOTFOUND )
- nMonth = rCode.Len();
- if ( nYear == STRING_NOTFOUND )
- nYear = rCode.Len();
+ if (nDay == -1)
+ nDay = rCode.getLength();
+ if (nMonth == -1)
+ nMonth = rCode.getLength();
+ if (nYear == -1)
+ nYear = rCode.getLength();
}
}
- // compare with <= because each position may equal rCode.Len()
+ // compare with <= because each position may equal rCode.getLength()
if ( nDay <= nMonth && nMonth <= nYear )
- return DMY; // also if every position equals rCode.Len()
+ return DMY; // also if every position equals rCode.getLength()
else if ( nMonth <= nDay && nDay <= nYear )
return MDY;
else if ( nYear <= nMonth && nMonth <= nDay )
@@ -1210,16 +1205,16 @@ static sal_Unicode* ImplAdd2UNum( sal_Unicode* pBuf, sal_uInt16 nNumber, int bLe
}
-inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, const String& rStr )
+inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, const rtl::OUString& rStr )
{
- if ( rStr.Len() == 1 )
- *pBuf++ = rStr.GetChar(0);
- else if ( rStr.Len() == 0 )
+ if ( rStr.getLength() == 1 )
+ *pBuf++ = rStr[0];
+ else if (rStr.isEmpty())
;
else
{
- memcpy( pBuf, rStr.GetBuffer(), rStr.Len() * sizeof(sal_Unicode) );
- pBuf += rStr.Len();
+ memcpy( pBuf, rStr.getStr(), rStr.getLength() * sizeof(sal_Unicode) );
+ pBuf += rStr.getLength();
}
return pBuf;
}
@@ -1302,7 +1297,7 @@ sal_Unicode* LocaleDataWrapper::ImplAddFormatNum( sal_Unicode* pBuf,
}
else
{
- const String& rThoSep = getNumThousandSep();
+ const rtl::OUString& rThoSep = getNumThousandSep();
// copy number to buffer (excluding decimals)
sal_uInt16 nNumLen2 = nNumLen-nDecimals;
@@ -1350,7 +1345,7 @@ sal_Unicode* LocaleDataWrapper::ImplAddFormatNum( sal_Unicode* pBuf,
// --- simple date and time formatting --------------------------------
-String LocaleDataWrapper::getDate( const Date& rDate ) const
+rtl::OUString LocaleDataWrapper::getDate( const Date& rDate ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
//!TODO: leading zeros et al
@@ -1393,11 +1388,11 @@ String LocaleDataWrapper::getDate( const Date& rDate ) const
pBuf = ImplAdd2UNum( pBuf, nDay, sal_True /* IsDateDayLeadingZero() */ );
}
- return String( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
+ return rtl::OUString(aBuf, pBuf-aBuf);
}
-String LocaleDataWrapper::getTime( const Time& rTime, sal_Bool bSec, sal_Bool b100Sec ) const
+rtl::OUString LocaleDataWrapper::getTime( const Time& rTime, sal_Bool bSec, sal_Bool b100Sec ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
//!TODO: leading zeros et al
@@ -1431,7 +1426,7 @@ String LocaleDataWrapper::getTime( const Time& rTime, sal_Bool bSec, sal_Bool b1
}
}
- String aStr( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
+ rtl::OUString aStr(aBuf, pBuf - aBuf);
if ( bHour12 )
{
@@ -1445,7 +1440,7 @@ String LocaleDataWrapper::getTime( const Time& rTime, sal_Bool bSec, sal_Bool b1
}
-String LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCal,
+rtl::OUString LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCal,
sal_Int16 nDisplayDayOfWeek, sal_Bool bDayOfMonthWithLeadingZero,
sal_Int16 nDisplayMonth, sal_Bool bTwoDigitYear ) const
{
@@ -1502,7 +1497,7 @@ String LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCal,
}
-String LocaleDataWrapper::getDuration( const Time& rTime, sal_Bool bSec, sal_Bool b100Sec ) const
+rtl::OUString LocaleDataWrapper::getDuration( const Time& rTime, sal_Bool bSec, sal_Bool b100Sec ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
sal_Unicode aBuf[128];
@@ -1541,13 +1536,13 @@ inline size_t ImplGetNumberStringLengthGuess( const LocaleDataWrapper& rLoc, sal
const size_t nDig = ((sizeof(sal_Int64) * 8) / 3) + 1;
// digits, separators (pessimized for insane "every digit may be grouped"), leading zero, sign
size_t nGuess = ((nDecimals < nDig) ?
- (((nDig - nDecimals) * rLoc.getNumThousandSep().Len()) + nDig) :
- nDecimals) + rLoc.getNumDecimalSep().Len() + 3;
+ (((nDig - nDecimals) * rLoc.getNumThousandSep().getLength()) + nDig) :
+ nDecimals) + rLoc.getNumDecimalSep().getLength() + 3;
return nGuess;
}
-String LocaleDataWrapper::getNum( sal_Int64 nNumber, sal_uInt16 nDecimals,
+rtl::OUString LocaleDataWrapper::getNum( sal_Int64 nNumber, sal_uInt16 nDecimals,
sal_Bool bUseThousandSep, sal_Bool bTrailingZeros ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
@@ -1567,8 +1562,8 @@ String LocaleDataWrapper::getNum( sal_Int64 nNumber, sal_uInt16 nDecimals,
}
-String LocaleDataWrapper::getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
- const String& rCurrencySymbol, sal_Bool bUseThousandSep ) const
+rtl::OUString LocaleDataWrapper::getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ const rtl::OUString& rCurrencySymbol, sal_Bool bUseThousandSep ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
sal_Unicode aBuf[192];
@@ -1581,8 +1576,8 @@ String LocaleDataWrapper::getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
new sal_Unicode[nGuess + 16]);
sal_Unicode* const pBuffer =
- ((size_t(rCurrencySymbol.Len()) + nGuess + 20) < SAL_N_ELEMENTS(aBuf) ? aBuf :
- new sal_Unicode[ rCurrencySymbol.Len() + nGuess + 20 ]);
+ ((size_t(rCurrencySymbol.getLength()) + nGuess + 20) < SAL_N_ELEMENTS(aBuf) ? aBuf :
+ new sal_Unicode[ rCurrencySymbol.getLength() + nGuess + 20 ]);
sal_Unicode* pBuf = pBuffer;
sal_Bool bNeg;
@@ -1797,7 +1792,7 @@ rtl::OUString LocaleDataWrapper::appendLocaleInfo(const rtl::OUString& rDebugMsg
// static
-void LocaleDataWrapper::outputCheckMessage( const String& rMsg )
+void LocaleDataWrapper::outputCheckMessage( const rtl::OUString& rMsg )
{
outputCheckMessage(rtl::OUStringToOString(rMsg, RTL_TEXTENCODING_UTF8).getStr());
}
diff --git a/vcl/inc/vcl/longcurr.hxx b/vcl/inc/vcl/longcurr.hxx
index 1981000bc894..04564fdc7369 100644
--- a/vcl/inc/vcl/longcurr.hxx
+++ b/vcl/inc/vcl/longcurr.hxx
@@ -51,10 +51,10 @@ protected:
BigInt mnMin;
BigInt mnMax;
BigInt mnCorrectedValue;
- String maCurrencySymbol;
- sal_uInt16 mnType;
- sal_uInt16 mnDecimalDigits;
- sal_Bool mbThousandSep;
+ rtl::OUString maCurrencySymbol;
+ sal_uInt16 mnType;
+ sal_uInt16 mnDecimalDigits;
+ sal_Bool mbThousandSep;
LongCurrencyFormatter();
public:
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 03fdc09e7112..0bc5425b1fc2 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -48,6 +48,7 @@
#include <unotools/localedatawrapper.hxx>
using namespace ::com::sun::star;
+using namespace ::comphelper;
// -----------------------------------------------------------------------
@@ -84,8 +85,8 @@ static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
((cChar >= '0') && (cChar <= '9')) ||
- (cChar == rLocaleDataWrappper.getNumDecimalSep() ) ||
- (bThousandSep && (cChar == rLocaleDataWrappper.getNumThousandSep())) ||
+ string::equals(rLocaleDataWrappper.getNumDecimalSep(), cChar) ||
+ (bThousandSep && string::equals(rLocaleDataWrappper.getNumThousandSep(), cChar)) ||
(cChar == '-') )
return sal_False;
else
@@ -111,7 +112,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
return sal_False;
// Fuehrende und nachfolgende Leerzeichen entfernen
- aStr = comphelper::string::strip(aStr, ' ');
+ aStr = string::strip(aStr, ' ');
// Position des Dezimalpunktes suchen
nDecPos = aStr.Search( rLocaleDataWrappper.getNumDecimalSep() );
@@ -1080,7 +1081,7 @@ static FieldUnit ImplStringToMetric(const rtl::OUString &rMetricString)
{
// return FieldUnit
rtl::OUString aStr(rMetricString.toAsciiLowerCase());
- aStr = comphelper::string::remove(aStr, ' ');
+ aStr = string::remove(aStr, ' ');
for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
{
if ( it->first.Equals( aStr ) )
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 67b82700dcc2..4ed66e5f1325 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -26,6 +26,7 @@
*
************************************************************************/
+#include <comphelper/string.hxx>
#include <tools/rc.h>
#include <vcl/svapp.hxx>
#include <vcl/sound.hxx>
@@ -48,6 +49,7 @@
#include <unotools/misccfg.hxx>
using namespace ::com::sun::star;
+using namespace ::comphelper;
// =======================================================================
@@ -2194,13 +2196,13 @@ static sal_Bool ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
((cChar >= '0') && (cChar <= '9')) ||
- (cChar == rLocaleDataWrapper.getTimeSep()) ||
- ( ( rLocaleDataWrapper.getTimeAM().Search( cChar ) != STRING_NOTFOUND ) ) ||
- ( ( rLocaleDataWrapper.getTimePM().Search( cChar ) != STRING_NOTFOUND ) ) ||
+ string::equals(rLocaleDataWrapper.getTimeSep(), cChar) ||
+ (rLocaleDataWrapper.getTimeAM().indexOf(cChar) != -1) ||
+ (rLocaleDataWrapper.getTimePM().indexOf(cChar) != -1) ||
// Accept AM/PM:
(cChar == 'a') || (cChar == 'A') || (cChar == 'm') || (cChar == 'M') || (cChar == 'p') || (cChar == 'P') ||
- ((eFormat == TIMEF_100TH_SEC) && (cChar == rLocaleDataWrapper.getTime100SecSep())) ||
- ((eFormat == TIMEF_SEC_CS) && (cChar == rLocaleDataWrapper.getTime100SecSep())) ||
+ ((eFormat == TIMEF_100TH_SEC) && string::equals(rLocaleDataWrapper.getTime100SecSep(), cChar)) ||
+ ((eFormat == TIMEF_SEC_CS) && string::equals(rLocaleDataWrapper.getTime100SecSep(), cChar)) ||
(bDuration && (cChar == '-')) )
return sal_False;
else
@@ -2263,7 +2265,7 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
return sal_False;
// Nach Separatoren suchen
- if ( rLocaleDataWrapper.getTimeSep().Len() )
+ if (!rLocaleDataWrapper.getTimeSep().isEmpty())
{
XubString aSepStr( RTL_CONSTASCII_USTRINGPARAM( ",.;:/" ) );
if ( !bDuration )
@@ -2272,12 +2274,12 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
// Die obigen Zeichen durch das Separatorzeichen ersetzen
for ( xub_StrLen i = 0; i < aSepStr.Len(); i++ )
{
- if ( aSepStr.GetChar( i ) == rLocaleDataWrapper.getTimeSep() )
+ if (string::equals(rLocaleDataWrapper.getTimeSep(), aSepStr.GetChar(i)))
continue;
for ( xub_StrLen j = 0; j < aStr.Len(); j++ )
{
if ( aStr.GetChar( j ) == aSepStr.GetChar( i ) )
- aStr.SetChar( j, rLocaleDataWrapper.getTimeSep().GetChar(0) );
+ aStr.SetChar( j, rLocaleDataWrapper.getTimeSep()[0] );
}
}
}
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx
index 8f4eb0166298..0ae610fa2e06 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -44,6 +44,7 @@
#include <unotools/localedatawrapper.hxx>
+using namespace ::comphelper;
// =======================================================================
@@ -126,8 +127,8 @@ static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
((cChar >= '0') && (cChar <= '9')) ||
- (bThousandSep && (cChar == rLocaleDataWrapper.getNumThousandSep())) ||
- (cChar == rLocaleDataWrapper.getNumDecimalSep() ) ||
+ (bThousandSep && string::equals(rLocaleDataWrapper.getNumThousandSep(), cChar)) ||
+ (string::equals(rLocaleDataWrapper.getNumDecimalSep(), cChar) ) ||
(cChar == '-') )
return sal_False;
else
@@ -153,7 +154,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
return sal_False;
// Fuehrende und nachfolgende Leerzeichen entfernen
- aStr = comphelper::string::strip(aStr, ' ');
+ aStr = string::strip(aStr, ' ');
// Position des Dezimalpunktes suchen
nDecPos = aStr.Search( rLocaleDataWrapper.getNumDecimalSep() );
@@ -360,7 +361,7 @@ void LongCurrencyFormatter::SetCurrencySymbol( const String& rStr )
String LongCurrencyFormatter::GetCurrencySymbol() const
{
- return maCurrencySymbol.Len() ? maCurrencySymbol : GetLocaleDataWrapper().getCurrSymbol();
+ return !maCurrencySymbol.isEmpty() ? maCurrencySymbol : GetLocaleDataWrapper().getCurrSymbol();
}
// -----------------------------------------------------------------------
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 9c825de52115..7221f2af606c 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -778,7 +778,7 @@ sal_Bool lcl_ValidChar( sal_Unicode cChar, const SvXMLNumFormatContext& rParent
if ( ( nFormatType == XML_TOK_STYLES_NUMBER_STYLE ||
nFormatType == XML_TOK_STYLES_CURRENCY_STYLE ||
nFormatType == XML_TOK_STYLES_PERCENTAGE_STYLE ) &&
- (cChar == (cTS = rParent.GetLocaleData().getNumThousandSep().GetChar(0)) ||
+ (cChar == (cTS = rParent.GetLocaleData().getNumThousandSep()[0]) ||
(cChar == ' ' && cTS == cNBSP)) )
{
// #i22394# Extra occurrences of thousands separator must be quoted, so they