summaryrefslogtreecommitdiff
path: root/svtools/source/control
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-09-12 23:24:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-17 10:46:27 +0100
commitc20ba023c738c0c76a07c94cb43c0a6d06f12374 (patch)
treee35855ce7fd3c777a4b12fe6356dc9c46ec99ddb /svtools/source/control
parent44aa7df623e7cc113fd81f84e4a0d3de786f311f (diff)
XubString->OUString
Change-Id: Ic8b191dfb0d14e129dc804aeb4ac14c732e72e6b
Diffstat (limited to 'svtools/source/control')
-rw-r--r--svtools/source/control/fmtfield.cxx26
-rw-r--r--svtools/source/control/stdmenu.cxx12
2 files changed, 18 insertions, 20 deletions
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index c59b1a57dcde..d4a4c5bfd649 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -395,7 +395,7 @@ void FormattedField::SetText( const XubString& rStr, const Selection& rNewSelect
}
//------------------------------------------------------------------------------
-void FormattedField::SetTextFormatted(const XubString& rStr)
+void FormattedField::SetTextFormatted(const OUString& rStr)
{
DBG_CHKTHIS(FormattedField, NULL);
@@ -628,9 +628,8 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bReset
}
else
{
- XubString sOldFormat;
LanguageType aOldLang;
- GetFormat(sOldFormat, aOldLang);
+ OUString sOldFormat = GetFormat(aOldLang);
sal_uInt32 nDestKey = pFormatter->TestNewString(sOldFormat);
if (nDestKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
@@ -652,17 +651,19 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bReset
}
//------------------------------------------------------------------------------
-void FormattedField::GetFormat(XubString& rFormatString, LanguageType& eLang) const
+OUString FormattedField::GetFormat(LanguageType& eLang) const
{
DBG_CHKTHIS(FormattedField, NULL);
const SvNumberformat* pFormatEntry = ImplGetFormatter()->GetEntry(m_nFormatKey);
DBG_ASSERT(pFormatEntry != NULL, "FormattedField::GetFormat: no number format for the given format key.");
- rFormatString = pFormatEntry ? pFormatEntry->GetFormatstring() : XubString();
+ OUString sFormatString = pFormatEntry ? pFormatEntry->GetFormatstring() : OUString();
eLang = pFormatEntry ? pFormatEntry->GetLanguage() : LANGUAGE_DONTKNOW;
+
+ return sFormatString;
}
//------------------------------------------------------------------------------
-sal_Bool FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang)
+sal_Bool FormattedField::SetFormat(const OUString& rFormatString, LanguageType eLang)
{
DBG_CHKTHIS(FormattedField, NULL);
sal_uInt32 nNewKey = ImplGetFormatter()->TestNewString(rFormatString, eLang);
@@ -709,8 +710,7 @@ void FormattedField::SetThousandsSep(sal_Bool _bUseSeparator)
// we need the language for the following
LanguageType eLang;
- String sFmtDescription;
- GetFormat(sFmtDescription, eLang);
+ String sFmtDescription = GetFormat(eLang);
// generate a new format ...
ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, _bUseSeparator, IsRed, nPrecision, nAnzLeading);
@@ -753,8 +753,7 @@ void FormattedField::SetDecimalDigits(sal_uInt16 _nPrecision)
// we need the language for the following
LanguageType eLang;
- String sFmtDescription;
- GetFormat(sFmtDescription, eLang);
+ String sFmtDescription = GetFormat(eLang);
// generate a new format ...
ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, bThousand, IsRed, _nPrecision, nAnzLeading);
@@ -913,7 +912,7 @@ void FormattedField::SetMaxValue(double dMax)
}
//------------------------------------------------------------------------------
-void FormattedField::SetTextValue(const XubString& rText)
+void FormattedField::SetTextValue(const OUString& rText)
{
DBG_CHKTHIS(FormattedField, NULL);
SetText(rText);
@@ -1126,7 +1125,7 @@ void DoubleNumericField::FormatChanged(FORMAT_CHANGE_TYPE nWhat)
}
//------------------------------------------------------------------------------
-sal_Bool DoubleNumericField::CheckText(const XubString& sText) const
+sal_Bool DoubleNumericField::CheckText(const OUString& sText) const
{
// We'd like to implement this using the NumberFormatter::IsNumberFormat, but unfortunately, this doesn't
// recognize fragments of numbers (like, for instance "1e", which happens during entering e.g. "1e10")
@@ -1230,9 +1229,8 @@ void DoubleCurrencyField::setPrependCurrSym(sal_Bool _bPrepend)
void DoubleCurrencyField::UpdateCurrencyFormat()
{
// the old settings
- XubString sOldFormat;
LanguageType eLanguage;
- GetFormat(sOldFormat, eLanguage);
+ GetFormat(eLanguage);
sal_Bool bThSep = GetThousandsSep();
sal_uInt16 nDigits = GetDecimalDigits();
diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx
index 8bfe4b4135ae..51af872507f1 100644
--- a/svtools/source/control/stdmenu.cxx
+++ b/svtools/source/control/stdmenu.cxx
@@ -58,7 +58,7 @@ void FontNameMenu::Select()
void FontNameMenu::Highlight()
{
- XubString aTempName = maCurName;
+ OUString aTempName = maCurName;
maCurName = GetItemText( GetCurItemId() );
maHighlightHdl.Call( this );
maCurName = aTempName;
@@ -84,7 +84,7 @@ void FontNameMenu::Fill( const FontList* pList )
sal_uInt16 j = GetItemCount();
while ( j )
{
- XubString aText = GetItemText( GetItemId( j-1 ) );
+ OUString aText = GetItemText( GetItemId( j-1 ) );
if ( rI18nHelper.CompareString( rName, aText ) > 0 )
break;
j--;
@@ -97,7 +97,7 @@ void FontNameMenu::Fill( const FontList* pList )
// -----------------------------------------------------------------------
-void FontNameMenu::SetCurName( const XubString& rName )
+void FontNameMenu::SetCurName(const OUString& rName)
{
maCurName = rName;
@@ -111,7 +111,7 @@ void FontNameMenu::SetCurName( const XubString& rName )
if ( IsItemChecked( nItemId ) )
nChecked = nItemId;
- XubString aText = GetItemText( nItemId );
+ OUString aText = GetItemText( nItemId );
if ( aText == maCurName )
{
CheckItem( nItemId, sal_True );
@@ -240,8 +240,8 @@ void FontSizeMenu::SetCurHeight( long nHeight )
{
mnCurHeight = nHeight;
- // check menue item
- XubString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, sal_True, sal_False );
+ // check menu item
+ OUString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, sal_True, sal_False );
sal_uInt16 nChecked = 0;
sal_uInt16 nItemCount = GetItemCount();
for( sal_uInt16 i = 0; i < nItemCount; i++ )