Kaydet (Commit) 23cafe3f authored tarafından Noel Grandin's avatar Noel Grandin

convert svtools/source/control/* from String to OUString

Change-Id: I32e411801d3754ca635cfc3ed9529b8ea43ffa3c
üst d71c8d1e
...@@ -403,7 +403,7 @@ void Calendar::ImplFormat() ...@@ -403,7 +403,7 @@ void Calendar::ImplFormat()
for ( sal_Int16 nDayOfWeek = 0; nDayOfWeek < 7; nDayOfWeek++ ) for ( sal_Int16 nDayOfWeek = 0; nDayOfWeek < 7; nDayOfWeek++ )
{ {
// Use narrow name. // Use narrow name.
String aDayOfWeek( maCalendarWrapper.getDisplayName( OUString aDayOfWeek( maCalendarWrapper.getDisplayName(
i18n::CalendarDisplayIndex::DAY, nDay, 2)); i18n::CalendarDisplayIndex::DAY, nDay, 2));
long nOffX = (mnDayWidth-GetTextWidth( aDayOfWeek ))/2; long nOffX = (mnDayWidth-GetTextWidth( aDayOfWeek ))/2;
if ( mnWinStyle & WB_BOLDTEXT ) if ( mnWinStyle & WB_BOLDTEXT )
...@@ -883,9 +883,9 @@ void Calendar::ImplDraw( sal_Bool bPaint ) ...@@ -883,9 +883,9 @@ void Calendar::ImplDraw( sal_Bool bPaint )
// Monat in der Titleleiste ausgeben // Monat in der Titleleiste ausgeben
nDeltaX = nX; nDeltaX = nX;
nDeltaY = nY+TITLE_BORDERY; nDeltaY = nY+TITLE_BORDERY;
String aMonthText( maCalendarWrapper.getDisplayName( OUString aMonthText( maCalendarWrapper.getDisplayName(
i18n::CalendarDisplayIndex::MONTH, nMonth-1, 1)); i18n::CalendarDisplayIndex::MONTH, nMonth-1, 1));
aMonthText += ' '; aMonthText += " ";
aMonthText += OUString::number(nYear); aMonthText += OUString::number(nYear);
long nMonthTextWidth = GetTextWidth( aMonthText ); long nMonthTextWidth = GetTextWidth( aMonthText );
long nMonthOffX1 = 0; long nMonthOffX1 = 0;
...@@ -903,7 +903,7 @@ void Calendar::ImplDraw( sal_Bool bPaint ) ...@@ -903,7 +903,7 @@ void Calendar::ImplDraw( sal_Bool bPaint )
// Abbreviated month name. // Abbreviated month name.
aMonthText = maCalendarWrapper.getDisplayName( aMonthText = maCalendarWrapper.getDisplayName(
i18n::CalendarDisplayIndex::MONTH, nMonth-1, 0); i18n::CalendarDisplayIndex::MONTH, nMonth-1, 0);
aMonthText += ' '; aMonthText += " ";
aMonthText += OUString::number(nYear); aMonthText += OUString::number(nYear);
nMonthTextWidth = GetTextWidth( aMonthText ); nMonthTextWidth = GetTextWidth( aMonthText );
} }
......
...@@ -1810,7 +1810,7 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList ) ...@@ -1810,7 +1810,7 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList )
sal_uLong nCount = aFontSizeNames.Count(); sal_uLong nCount = aFontSizeNames.Count();
for( sal_uLong i = 0; i < nCount; i++ ) for( sal_uLong i = 0; i < nCount; i++ )
{ {
String aSizeName = aFontSizeNames.GetIndexName( i ); OUString aSizeName = aFontSizeNames.GetIndexName( i );
sal_IntPtr nSize = aFontSizeNames.GetIndexSize( i ); sal_IntPtr nSize = aFontSizeNames.GetIndexSize( i );
ComboBox::InsertEntry( aSizeName, nPos ); ComboBox::InsertEntry( aSizeName, nPos );
ComboBox::SetEntryData( nPos, (void*)(-nSize) ); // mark as special ComboBox::SetEntryData( nPos, (void*)(-nSize) ); // mark as special
...@@ -1823,8 +1823,8 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList ) ...@@ -1823,8 +1823,8 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList )
pTempAry = pAry; pTempAry = pAry;
while ( *pTempAry ) while ( *pTempAry )
{ {
String aSizeName = aFontSizeNames.Size2Name( *pTempAry ); OUString aSizeName = aFontSizeNames.Size2Name( *pTempAry );
if ( aSizeName.Len() ) if ( !aSizeName.isEmpty() )
{ {
ComboBox::InsertEntry( aSizeName, nPos ); ComboBox::InsertEntry( aSizeName, nPos );
ComboBox::SetEntryData( nPos, (void*)(-(*pTempAry)) ); // mark as special ComboBox::SetEntryData( nPos, (void*)(-(*pTempAry)) ); // mark as special
...@@ -1955,8 +1955,8 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue, FieldUnit eInUnit ) ...@@ -1955,8 +1955,8 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue, FieldUnit eInUnit )
FontSizeNames aFontSizeNames( GetSettings().GetUILanguageTag().getLanguageType() ); FontSizeNames aFontSizeNames( GetSettings().GetUILanguageTag().getLanguageType() );
// conversion loses precision; however font sizes should // conversion loses precision; however font sizes should
// never have a problem with that // never have a problem with that
String aName = aFontSizeNames.Size2Name( static_cast<long>(nTempValue) ); OUString aName = aFontSizeNames.Size2Name( static_cast<long>(nTempValue) );
if ( aName.Len() && (GetEntryPos( aName ) != LISTBOX_ENTRY_NOTFOUND) ) if ( !aName.isEmpty() && (GetEntryPos( aName ) != LISTBOX_ENTRY_NOTFOUND) )
{ {
mnLastValue = nTempValue; mnLastValue = nTempValue;
SetText( aName ); SetText( aName );
......
...@@ -896,7 +896,7 @@ long FontSizeNames::Name2Size( const OUString& rName ) const ...@@ -896,7 +896,7 @@ long FontSizeNames::Name2Size( const OUString& rName ) const
OUString FontSizeNames::Size2Name( long nValue ) const OUString FontSizeNames::Size2Name( long nValue ) const
{ {
String aStr; OUString aStr;
// binary search // binary search
for( long lower = 0, upper = mnElem - 1; lower <= upper; ) for( long lower = 0, upper = mnElem - 1; lower <= upper; )
...@@ -904,7 +904,7 @@ OUString FontSizeNames::Size2Name( long nValue ) const ...@@ -904,7 +904,7 @@ OUString FontSizeNames::Size2Name( long nValue ) const
long mid = (upper + lower) >> 1; long mid = (upper + lower) >> 1;
if ( nValue == mpArray[mid].mnSize ) if ( nValue == mpArray[mid].mnSize )
{ {
aStr = String( mpArray[mid].mszUtf8Name, RTL_TEXTENCODING_UTF8 ); aStr = OUString( mpArray[mid].mszUtf8Name, strlen(mpArray[mid].mszUtf8Name), RTL_TEXTENCODING_UTF8 );
break; break;
} }
else if ( nValue < mpArray[mid].mnSize ) else if ( nValue < mpArray[mid].mnSize )
...@@ -920,10 +920,10 @@ OUString FontSizeNames::Size2Name( long nValue ) const ...@@ -920,10 +920,10 @@ OUString FontSizeNames::Size2Name( long nValue ) const
OUString FontSizeNames::GetIndexName( sal_uLong nIndex ) const OUString FontSizeNames::GetIndexName( sal_uLong nIndex ) const
{ {
String aStr; OUString aStr;
if ( nIndex < mnElem ) if ( nIndex < mnElem )
aStr = String( mpArray[nIndex].mszUtf8Name, RTL_TEXTENCODING_UTF8 ); aStr = OUString( mpArray[nIndex].mszUtf8Name, strlen(mpArray[nIndex].mszUtf8Name), RTL_TEXTENCODING_UTF8 );
return aStr; return aStr;
} }
......
...@@ -39,10 +39,10 @@ namespace svt ...@@ -39,10 +39,10 @@ namespace svt
//--------------------------------------------------------------------- //---------------------------------------------------------------------
void FileURLBox::DisplayURL( const OUString& _rURL ) void FileURLBox::DisplayURL( const OUString& _rURL )
{ {
String sOldText = GetText(); OUString sOldText = GetText();
OFileNotation aTransformer( _rURL, OFileNotation::N_URL ); OFileNotation aTransformer( _rURL, OFileNotation::N_URL );
String sNewText = aTransformer.get( OFileNotation::N_SYSTEM ); OUString sNewText = aTransformer.get( OFileNotation::N_SYSTEM );
SetText( sNewText ); SetText( sNewText );
if ( sOldText != sNewText ) if ( sOldText != sNewText )
......
...@@ -81,10 +81,10 @@ namespace validation ...@@ -81,10 +81,10 @@ namespace validation
public: public:
NumberValidator( const sal_Unicode _cThSep, const sal_Unicode _cDecSep ); NumberValidator( const sal_Unicode _cThSep, const sal_Unicode _cDecSep );
sal_Bool isValidNumericFragment( const String& _rText ); sal_Bool isValidNumericFragment( const OUString& _rText );
private: private:
sal_Bool implValidateNormalized( const String& _rText ); sal_Bool implValidateNormalized( const OUString& _rText );
}; };
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
...@@ -219,9 +219,9 @@ namespace validation ...@@ -219,9 +219,9 @@ namespace validation
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
sal_Bool NumberValidator::implValidateNormalized( const String& _rText ) sal_Bool NumberValidator::implValidateNormalized( const OUString& _rText )
{ {
const sal_Unicode* pCheckPos = _rText.GetBuffer(); const sal_Unicode* pCheckPos = _rText.getStr();
State eCurrentState = START; State eCurrentState = START;
while ( END != eCurrentState ) while ( END != eCurrentState )
...@@ -259,16 +259,16 @@ namespace validation ...@@ -259,16 +259,16 @@ namespace validation
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
sal_Bool NumberValidator::isValidNumericFragment( const String& _rText ) sal_Bool NumberValidator::isValidNumericFragment( const OUString& _rText )
{ {
if ( !_rText.Len() ) if ( _rText.isEmpty() )
// empty strings are always allowed // empty strings are always allowed
return sal_True; return sal_True;
// normalize the string // normalize the string
String sNormalized( RTL_CONSTASCII_USTRINGPARAM("_") ); OUString sNormalized( "_" );
sNormalized.Append( _rText ); sNormalized += _rText;
sNormalized.AppendAscii( "_" ); sNormalized += "_";
return implValidateNormalized( sNormalized ); return implValidateNormalized( sNormalized );
} }
...@@ -499,7 +499,7 @@ void FormattedField::impl_Modify(bool makeValueDirty) ...@@ -499,7 +499,7 @@ void FormattedField::impl_Modify(bool makeValueDirty)
return; return;
} }
String sCheck = GetText(); OUString sCheck = GetText();
if (CheckText(sCheck)) if (CheckText(sCheck))
{ {
m_sLastValidText = sCheck; m_sLastValidText = sCheck;
...@@ -879,8 +879,8 @@ long FormattedField::Notify(NotifyEvent& rNEvt) ...@@ -879,8 +879,8 @@ long FormattedField::Notify(NotifyEvent& rNEvt)
} }
else else
{ {
String sNew = GetTextValue(); OUString sNew = GetTextValue();
if (sNew.Len()) if (!sNew.isEmpty())
SetTextFormatted(sNew); SetTextFormatted(sNew);
else else
SetTextFormatted(m_sDefaultText); SetTextFormatted(m_sDefaultText);
...@@ -996,8 +996,8 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal) ...@@ -996,8 +996,8 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal)
return sal_True; return sal_True;
dNewVal = m_dDefaultValue; dNewVal = m_dDefaultValue;
String sText(GetText()); OUString sText(GetText());
if (!sText.Len()) if (sText.isEmpty())
return sal_True; return sal_True;
DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !"); DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !");
...@@ -1022,7 +1022,7 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal) ...@@ -1022,7 +1022,7 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal)
NUMBERFORMAT_NUMBER == m_pFormatter->GetType(nTempFormat)) NUMBERFORMAT_NUMBER == m_pFormatter->GetType(nTempFormat))
// der String entspricht einer Number-Formatierung, hat also nur kein % // der String entspricht einer Number-Formatierung, hat also nur kein %
// -> append it // -> append it
sText += '%'; sText += "%";
// (with this, a input of '3' becomes '3%', which then by the formatter is translated // (with this, a input of '3' becomes '3%', which then by the formatter is translated
// into 0.03. Without this, the formatter would give us the double 3 for an input '3', // into 0.03. Without this, the formatter would give us the double 3 for an input '3',
// which equals 300 percent. // which equals 300 percent.
...@@ -1161,13 +1161,13 @@ void DoubleNumericField::ResetConformanceTester() ...@@ -1161,13 +1161,13 @@ void DoubleNumericField::ResetConformanceTester()
{ {
LocaleDataWrapper aLocaleInfo( LanguageTag( pFormatEntry->GetLanguage()) ); LocaleDataWrapper aLocaleInfo( LanguageTag( pFormatEntry->GetLanguage()) );
String sSeparator = aLocaleInfo.getNumThousandSep(); OUString sSeparator = aLocaleInfo.getNumThousandSep();
if (sSeparator.Len()) if (!sSeparator.isEmpty())
cSeparatorThousand = sSeparator.GetBuffer()[0]; cSeparatorThousand = sSeparator[0];
sSeparator = aLocaleInfo.getNumDecimalSep(); sSeparator = aLocaleInfo.getNumDecimalSep();
if (sSeparator.Len()) if (!sSeparator.isEmpty())
cSeparatorDecimal = sSeparator.GetBuffer()[0]; cSeparatorDecimal = sSeparator[0];
} }
delete m_pNumberValidator; delete m_pNumberValidator;
......
...@@ -186,8 +186,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) ...@@ -186,8 +186,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
sal_uLong nCount = aFontSizeNames.Count(); sal_uLong nCount = aFontSizeNames.Count();
for( sal_uLong i = 0; i < nCount; i++ ) for( sal_uLong i = 0; i < nCount; i++ )
{ {
String aSizeName = aFontSizeNames.GetIndexName( i ); OUString aSizeName = aFontSizeNames.GetIndexName( i );
long nSize = aFontSizeNames.GetIndexSize( i ); long nSize = aFontSizeNames.GetIndexSize( i );
mpHeightAry[nPos] = nSize; mpHeightAry[nPos] = nSize;
nPos++; // Id is nPos+1 nPos++; // Id is nPos+1
InsertItem( nPos, aSizeName, MIB_RADIOCHECK | MIB_AUTOCHECK ); InsertItem( nPos, aSizeName, MIB_RADIOCHECK | MIB_AUTOCHECK );
...@@ -199,8 +199,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) ...@@ -199,8 +199,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
pTempAry = pAry; pTempAry = pAry;
while ( *pTempAry ) while ( *pTempAry )
{ {
String aSizeName = aFontSizeNames.Size2Name( *pTempAry ); OUString aSizeName = aFontSizeNames.Size2Name( *pTempAry );
if ( aSizeName.Len() ) if ( !aSizeName.isEmpty() )
{ {
mpHeightAry[nPos] = *pTempAry; mpHeightAry[nPos] = *pTempAry;
nPos++; // Id is nPos+1 nPos++; // Id is nPos+1
......
...@@ -1157,7 +1157,7 @@ public: ...@@ -1157,7 +1157,7 @@ public:
} }
} }
void drawText(const String& aText) void drawText(const OUString& aText)
{ {
Rectangle aRect = maRect; Rectangle aRect = maRect;
long nTextWidth = mrParent.GetTextWidth(aText); long nTextWidth = mrParent.GetTextWidth(aText);
......
...@@ -736,15 +736,15 @@ OUString SAL_CALL ToolbarMenuEntryAcc::getAccessibleDescription() throw (Runtime ...@@ -736,15 +736,15 @@ OUString SAL_CALL ToolbarMenuEntryAcc::getAccessibleDescription() throw (Runtime
OUString SAL_CALL ToolbarMenuEntryAcc::getAccessibleName() throw (RuntimeException) OUString SAL_CALL ToolbarMenuEntryAcc::getAccessibleName() throw (RuntimeException)
{ {
const SolarMutexGuard aSolarGuard; const SolarMutexGuard aSolarGuard;
String aRet; OUString aRet;
if( mpParent ) if( mpParent )
{ {
aRet = mpParent->maText; aRet = mpParent->maText;
if( !aRet.Len() ) if( aRet.isEmpty() )
{ {
aRet = String( RTL_CONSTASCII_USTRINGPARAM( "Item " ) ); aRet = "Item ";
aRet += OUString::number( mpParent->mnEntryId ); aRet += OUString::number( mpParent->mnEntryId );
} }
} }
......
...@@ -268,7 +268,7 @@ OUString SAL_CALL ValueSetAcc::getAccessibleDescription() ...@@ -268,7 +268,7 @@ OUString SAL_CALL ValueSetAcc::getAccessibleDescription()
{ {
ThrowIfDisposed(); ThrowIfDisposed();
const SolarMutexGuard aSolarGuard; const SolarMutexGuard aSolarGuard;
String aRet( RTL_CONSTASCII_USTRINGPARAM( "ValueSet" ) ); OUString aRet( "ValueSet" );
return aRet; return aRet;
} }
...@@ -280,12 +280,12 @@ OUString SAL_CALL ValueSetAcc::getAccessibleName() ...@@ -280,12 +280,12 @@ OUString SAL_CALL ValueSetAcc::getAccessibleName()
{ {
ThrowIfDisposed(); ThrowIfDisposed();
const SolarMutexGuard aSolarGuard; const SolarMutexGuard aSolarGuard;
String aRet; OUString aRet;
if ( mpParent ) if ( mpParent )
aRet = mpParent->GetAccessibleName(); aRet = mpParent->GetAccessibleName();
if ( !aRet.Len() ) if ( aRet.isEmpty() )
{ {
Window* pLabel = mpParent->GetAccessibleRelationLabeledBy(); Window* pLabel = mpParent->GetAccessibleRelationLabeledBy();
if ( pLabel && pLabel != mpParent ) if ( pLabel && pLabel != mpParent )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment