summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-08-07 14:03:59 +0200
committerNoel Grandin <noel@peralex.com>2013-08-12 11:56:49 +0200
commitdb3f16317e0b0f931fdfcb6f19f8cc474bd70683 (patch)
treee7bde547793da27ef2861f6f051efb80c3b59207 /vcl
parent8129fffd1beefbc2844fcf3912c65290ce657d79 (diff)
convert String to OUString in VCL
Change-Id: Ie5c6874298641dc6fc1b6b4e2206a704acd7cc10
Diffstat (limited to 'vcl')
-rw-r--r--vcl/headless/svpprn.cxx8
-rw-r--r--vcl/source/control/ctrl.cxx4
-rw-r--r--vcl/source/control/field2.cxx4
-rw-r--r--vcl/source/control/fixed.cxx4
-rw-r--r--vcl/source/control/imgctrl.cxx4
-rw-r--r--vcl/source/edit/vclmedit.cxx34
-rw-r--r--vcl/source/edit/xtextedt.cxx8
-rw-r--r--vcl/source/filter/sgvmain.cxx6
-rw-r--r--vcl/source/fontsubset/cff.cxx2
-rw-r--r--vcl/source/gdi/bitmapex.cxx2
-rw-r--r--vcl/source/gdi/configsettings.cxx16
-rw-r--r--vcl/source/gdi/cvtsvm.cxx12
-rw-r--r--vcl/source/gdi/gfxlink.cxx2
-rw-r--r--vcl/source/gdi/impgraph.cxx4
-rw-r--r--vcl/source/gdi/jobset.cxx14
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx20
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx4
-rw-r--r--vcl/source/gdi/print3.cxx2
-rw-r--r--vcl/source/window/abstdlg.cxx2
-rw-r--r--vcl/source/window/dlgctrl.cxx10
-rw-r--r--vcl/source/window/status.cxx6
-rw-r--r--vcl/source/window/toolbox.cxx6
-rw-r--r--vcl/source/window/window.cxx46
-rw-r--r--vcl/source/window/winproc.cxx4
24 files changed, 112 insertions, 112 deletions
diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx
index 6ecba235d5e9..f50db9a69ec9 100644
--- a/vcl/headless/svpprn.cxx
+++ b/vcl/headless/svpprn.cxx
@@ -97,7 +97,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
pJobSetup->mnPaperBin = 0xffff;
if( rData.m_pParser )
- pKey = rData.m_pParser->getKey( String( "InputSlot" ) );
+ pKey = rData.m_pParser->getKey( OUString( "InputSlot" ) );
if( pKey )
pValue = rData.m_aContext.getValue( pKey );
if( pKey && pValue )
@@ -117,7 +117,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
pJobSetup->meDuplexMode = DUPLEX_UNKNOWN;
if( rData.m_pParser )
- pKey = rData.m_pParser->getKey( String( "Duplex" ) );
+ pKey = rData.m_pParser->getKey( OUString( "Duplex" ) );
if( pKey )
pValue = rData.m_aContext.getValue( pKey );
if( pKey && pValue )
@@ -231,8 +231,8 @@ void SvpSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
sal_Int32 nIndex = 0;
while( nIndex != -1 )
{
- String aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
- if( aToken.CompareToAscii( "pdf=", 4 ) == COMPARE_EQUAL )
+ OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
+ if( aToken.startsWith( "pdf=" ) )
{
pInfo->maLocation = getPdfDir( rInfo );
break;
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index c5de9cab7342..16841ec1656f 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -527,9 +527,9 @@ void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRec
if ( !_pVector )
{
static MetricVector aCharRects;
- static String sDisplayText;
+ static OUString sDisplayText;
aCharRects.clear();
- sDisplayText = String();
+ sDisplayText = OUString();
_pVector = &aCharRects;
_pDisplayText = &sDisplayText;
}
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 7891e63f5917..12d15a22aaca 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1035,13 +1035,13 @@ static sal_uInt16 ImplCutMonthFromString( OUString& rStr, const CalendarWrapper&
// search for a month' name
for ( sal_uInt16 i=1; i <= 12; i++ )
{
- String aMonthName = rCalendarWrapper.getMonths()[i-1].FullName;
+ OUString aMonthName = rCalendarWrapper.getMonths()[i-1].FullName;
// long month name?
if ( ImplCutMonthName( rStr, aMonthName ) )
return i;
// short month name?
- String aAbbrevMonthName = rCalendarWrapper.getMonths()[i-1].AbbrevName;
+ OUString aAbbrevMonthName = rCalendarWrapper.getMonths()[i-1].AbbrevName;
if ( ImplCutMonthName( rStr, aAbbrevMonthName ) )
return i;
}
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index a7a1ba8a9a87..267bdcc9eea7 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -577,13 +577,13 @@ void FixedLine::ImplInitSettings( sal_Bool bFont,
void FixedLine::ImplDraw( bool bLayout )
{
Size aOutSize = GetOutputSizePixel();
- String aText = GetText();
+ OUString aText = GetText();
WinBits nWinStyle = GetStyle();
MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
DecorationView aDecoView( this );
- if ( !aText.Len() )
+ if ( aText.isEmpty() )
{
if( !pVector )
{
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index cdc71fae8ffa..5b41fc616994 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -99,8 +99,8 @@ void ImageControl::ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Poi
const Rectangle aDrawRect( rPos, rSize );
if ( !*pImage )
{
- String sText( GetText() );
- if ( !sText.Len() )
+ OUString sText( GetText() );
+ if ( sText.isEmpty() )
return;
WinBits nWinStyle = GetStyle();
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 96ca07ca5f5f..922cf18e929d 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -119,9 +119,9 @@ public:
sal_Bool IsInsertMode() const;
- void InsertText( const String& rStr );
- String GetSelected() const;
- String GetSelected( LineEnd aSeparator ) const;
+ void InsertText( const OUString& rStr );
+ OUString GetSelected() const;
+ OUString GetSelected( LineEnd aSeparator ) const;
void SetSelection( const Selection& rSelection );
const Selection& GetSelection() const;
@@ -132,8 +132,8 @@ public:
void SetText( const OUString& rStr );
OUString GetText() const;
- String GetText( LineEnd aSeparator ) const;
- String GetTextLines( LineEnd aSeparator ) const;
+ OUString GetText( LineEnd aSeparator ) const;
+ OUString GetTextLines( LineEnd aSeparator ) const;
void Resize();
void GetFocus();
@@ -387,17 +387,17 @@ xub_StrLen ImpVclMEdit::GetMaxTextLen() const
mpTextWindow->GetTextEngine()->GetMaxTextLen());
}
-void ImpVclMEdit::InsertText( const String& rStr )
+void ImpVclMEdit::InsertText( const OUString& rStr )
{
mpTextWindow->GetTextView()->InsertText( rStr );
}
-String ImpVclMEdit::GetSelected() const
+OUString ImpVclMEdit::GetSelected() const
{
return mpTextWindow->GetTextView()->GetSelected();
}
-String ImpVclMEdit::GetSelected( LineEnd aSeparator ) const
+OUString ImpVclMEdit::GetSelected( LineEnd aSeparator ) const
{
return mpTextWindow->GetTextView()->GetSelected( aSeparator );
}
@@ -510,12 +510,12 @@ OUString ImpVclMEdit::GetText() const
return mpTextWindow->GetTextEngine()->GetText();
}
-String ImpVclMEdit::GetText( LineEnd aSeparator ) const
+OUString ImpVclMEdit::GetText( LineEnd aSeparator ) const
{
return mpTextWindow->GetTextEngine()->GetText( aSeparator );
}
-String ImpVclMEdit::GetTextLines( LineEnd aSeparator ) const
+OUString ImpVclMEdit::GetTextLines( LineEnd aSeparator ) const
{
return mpTextWindow->GetTextEngine()->GetTextLines( aSeparator );
}
@@ -567,17 +567,17 @@ void ImpVclMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
void ImpVclMEdit::SetSelection( const Selection& rSelection )
{
- String aText = mpTextWindow->GetTextEngine()->GetText();
+ OUString aText = mpTextWindow->GetTextEngine()->GetText();
Selection aNewSelection( rSelection );
if ( aNewSelection.Min() < 0 )
aNewSelection.Min() = 0;
- else if ( aNewSelection.Min() > aText.Len() )
- aNewSelection.Min() = aText.Len();
+ else if ( aNewSelection.Min() > aText.getLength() )
+ aNewSelection.Min() = aText.getLength();
if ( aNewSelection.Max() < 0 )
aNewSelection.Max() = 0;
- else if ( aNewSelection.Max() > aText.Len() )
- aNewSelection.Max() = aText.Len();
+ else if ( aNewSelection.Max() > aText.getLength() )
+ aNewSelection.Max() = aText.getLength();
long nEnd = std::max( aNewSelection.Min(), aNewSelection.Max() );
TextSelection aTextSel;
@@ -591,7 +591,7 @@ void ImpVclMEdit::SetSelection( const Selection& rSelection )
if ( x == aNewSelection.Max() )
aTextSel.GetEnd() = TextPaM( nPara, nChar );
- if ( ( x < aText.Len() ) && ( aText.GetChar( x ) == '\n' ) )
+ if ( ( x < aText.getLength() ) && ( aText[ x ] == '\n' ) )
{
nPara++;
nChar = 0;
@@ -1137,7 +1137,7 @@ void VclMultiLineEdit::ReplaceSelected( const OUString& rStr )
void VclMultiLineEdit::DeleteSelected()
{
- pImpVclMEdit->InsertText( String() );
+ pImpVclMEdit->InsertText( OUString() );
}
OUString VclMultiLineEdit::GetSelected() const
diff --git a/vcl/source/edit/xtextedt.cxx b/vcl/source/edit/xtextedt.cxx
index ceec23c24552..8de09acad655 100644
--- a/vcl/source/edit/xtextedt.cxx
+++ b/vcl/source/edit/xtextedt.cxx
@@ -360,10 +360,10 @@ sal_Bool ExtTextView::ImpIndentBlock( sal_Bool bRight )
else
{
// remove Tabs/Blanks
- String aText = GetTextEngine()->GetText( nPara );
- if ( aText.Len() && (
- ( aText.GetChar( 0 ) == '\t' ) ||
- ( aText.GetChar( 0 ) == ' ' ) ) )
+ OUString aText = GetTextEngine()->GetText( nPara );
+ if ( !aText.isEmpty() && (
+ ( aText[ 0 ] == '\t' ) ||
+ ( aText[ 0 ] == ' ' ) ) )
{
GetTextEngine()->ImpDeleteText( TextSelection( TextPaM( nPara, 0 ), TextPaM( nPara, 1 ) ) );
bDone = sal_True;
diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx
index 6f9a79fd0967..bc3cc484d617 100644
--- a/vcl/source/filter/sgvmain.cxx
+++ b/vcl/source/filter/sgvmain.cxx
@@ -708,10 +708,10 @@ void BmapType::Draw(OutputDevice& rOut)
{
//ifstream aInp;
unsigned char nSgfTyp;
- sal_uInt16 nVersion;
- String aStr(
+ sal_uInt16 nVersion;
+ OUString aStr(
reinterpret_cast< char const * >(&Filename[ 1 ]),
- (xub_StrLen)Filename[ 0 ], RTL_TEXTENCODING_UTF8 );
+ (sal_Int32)Filename[ 0 ], RTL_TEXTENCODING_UTF8 );
INetURLObject aFNam( aStr );
SvStream* pInp = ::utl::UcbStreamHelper::CreateStream( aFNam.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 43e397ca89d4..e94fcb992da1 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -2330,7 +2330,7 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
rFSInfo.m_nCapHeight = rFSInfo.m_nAscent; // for top-flat capital letters
rFSInfo.m_nFontType = rEmitter.mbPfbSubset ? FontSubsetInfo::TYPE1_PFB : FontSubsetInfo::TYPE1_PFA;
- rFSInfo.m_aPSName = String( rEmitter.maSubsetName, RTL_TEXTENCODING_UTF8 );
+ rFSInfo.m_aPSName = OUString( rEmitter.maSubsetName, strlen(rEmitter.maSubsetName), RTL_TEXTENCODING_UTF8 );
return true;
}
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index b7dbf7585633..c1f141e8a13e 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -94,7 +94,7 @@ BitmapEx::BitmapEx( const ResId& rResId ) :
pResMgr->ReadLong();
pResMgr->ReadLong();
- const String aFileName( pResMgr->ReadString() );
+ const OUString aFileName( pResMgr->ReadString() );
OUString aCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
if( !aImageTree->loadImage( aFileName, aCurrentSymbolsStyle, *this, true ) )
diff --git a/vcl/source/gdi/configsettings.cxx b/vcl/source/gdi/configsettings.cxx
index 30b6f463f38c..9b6dcdd2eed9 100644
--- a/vcl/source/gdi/configsettings.cxx
+++ b/vcl/source/gdi/configsettings.cxx
@@ -68,7 +68,7 @@ void SettingsConfigItem::Commit()
for( group = m_aSettings.begin(); group != m_aSettings.end(); ++group )
{
- String aKeyName( group->first );
+ OUString aKeyName( group->first );
/*sal_Bool bAdded =*/ AddNode( OUString(), aKeyName );
Sequence< PropertyValue > aValues( group->second.size() );
PropertyValue* pValues = aValues.getArray();
@@ -76,9 +76,9 @@ void SettingsConfigItem::Commit()
SmallOUStrMap::const_iterator it;
for( it = group->second.begin(); it != group->second.end(); ++it )
{
- String aName( aKeyName );
- aName.Append( '/' );
- aName.Append( String( it->first ) );
+ OUString aName( aKeyName );
+ aName += OUString('/');
+ aName += it->first;
pValues[nIndex].Name = aName;
pValues[nIndex].Handle = 0;
pValues[nIndex].Value <<= it->second;
@@ -110,16 +110,16 @@ void SettingsConfigItem::getValues()
OUStringToOString( aNames.getConstArray()[j], RTL_TEXTENCODING_ASCII_US ).getStr()
);
#endif
- String aKeyName( aNames.getConstArray()[j] );
+ OUString aKeyName( aNames.getConstArray()[j] );
Sequence< OUString > aKeys( GetNodeNames( aKeyName ) );
Sequence< OUString > aSettingsKeys( aKeys.getLength() );
const OUString* pFrom = aKeys.getConstArray();
OUString* pTo = aSettingsKeys.getArray();
for( int m = 0; m < aKeys.getLength(); m++ )
{
- String aName( aKeyName );
- aName.Append( '/' );
- aName.Append( String( pFrom[m] ) );
+ OUString aName( aKeyName );
+ aName += OUString('/');
+ aName += pFrom[m];
pTo[m] = aName;
}
Sequence< Any > aValues( GetProperties( aSettingsKeys ) );
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 2334004e0ae0..60fef66fbb12 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -258,9 +258,9 @@ void ImplWriteRasterOpAction( SvStream& rOStm, sal_Int16 nRasterOp )
rOStm << (sal_Int16) GDI_RASTEROP_ACTION << (sal_Int32) 6 << nRasterOp;
}
-sal_Bool ImplWriteUnicodeComment( SvStream& rOStm, const String& rString )
+sal_Bool ImplWriteUnicodeComment( SvStream& rOStm, const OUString& rString )
{
- xub_StrLen nStringLen = rString.Len();
+ sal_Int32 nStringLen = rString.getLength();
if ( nStringLen )
{
sal_uInt32 nSize = ( nStringLen << 1 ) + 4;
@@ -786,7 +786,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
ImplReadColor( rIStm, aActionColor ); aFont.SetColor( aActionColor );
ImplReadColor( rIStm, aActionColor ); aFont.SetFillColor( aActionColor );
rIStm.Read( aName, 32 );
- aFont.SetName( String( aName, rIStm.GetStreamCharSet() ) );
+ aFont.SetName( OUString( aName, strlen(aName), rIStm.GetStreamCharSet() ) );
rIStm >> nWidth >> nHeight;
rIStm >> nCharOrient >> nLineOrient;
rIStm >> nCharSet >> nFamily >> nPitch >> nAlign >> nWeight >> nUnderline >> nStrikeout;
@@ -1681,7 +1681,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TEXT_ACTION ):
{
MetaTextAction* pAct = (MetaTextAction*) pAction;
- String aUniText( pAct->GetText() );
+ OUString aUniText( pAct->GetText() );
OString aText(OUStringToOString(aUniText,
rActualCharSet));
const sal_uLong nStrLen = aText.getLength();
@@ -1705,7 +1705,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaTextArrayAction* pAct = (MetaTextArrayAction*)pAction;
OString aText(OUStringToOString(pAct->GetText(),
rActualCharSet));
- String aUniText( pAct->GetText(), pAct->GetIndex(), pAct->GetLen() );
+ OUString aUniText = pAct->GetText().copy( pAct->GetIndex(), pAct->GetLen() );
sal_uLong nAryLen;
sal_uLong nLen = pAct->GetLen();
const sal_uLong nTextLen = aText.getLength();
@@ -1746,7 +1746,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_STRETCHTEXT_ACTION ):
{
MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
- String aUniText( pAct->GetText() );
+ OUString aUniText( pAct->GetText() );
OString aText(OUStringToOString(aUniText,
rActualCharSet));
const sal_uLong nStrLen = aText.getLength();
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index e9de2a628e22..4dc576faa2b2 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -350,7 +350,7 @@ ImpSwap::ImpSwap( sal_uInt8* pData, sal_uLong nDataSize ) :
if( bError )
{
osl_removeFile( maURL.pData );
- maURL = String();
+ maURL = "";
}
}
}
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 6ef8d63860f1..df6de2a60d90 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1404,14 +1404,14 @@ sal_Bool ImpGraphic::ImplSwapIn()
if( ImplIsSwapOut() )
{
- String aSwapURL;
+ OUString aSwapURL;
if( mpSwapFile )
aSwapURL = mpSwapFile->aSwapURL.GetMainURL( INetURLObject::NO_DECODE );
else
aSwapURL = maDocFileURLStr;
- if( aSwapURL.Len() )
+ if( !aSwapURL.isEmpty() )
{
SvStream* pIStm = NULL;
try
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index e1e3e9b2617f..868cabe98173 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -293,17 +293,17 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
rIStream.Seek( nFirstPos + sizeof( ImplOldJobSetupData ) + 4 + sizeof( Impl364JobSetupData ) + pJobData->mnDriverDataLen );
while( rIStream.Tell() < nFirstPos + nLen )
{
- String aKey = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8);
- String aValue = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8);
- if( aKey.EqualsAscii( "COMPAT_DUPLEX_MODE" ) )
+ OUString aKey = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8);
+ OUString aValue = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8);
+ if( aKey.equalsAscii( "COMPAT_DUPLEX_MODE" ) )
{
- if( aValue.EqualsAscii( "DUPLEX_UNKNOWN" ) )
+ if( aValue.equalsAscii( "DUPLEX_UNKNOWN" ) )
pJobData->meDuplexMode = DUPLEX_UNKNOWN;
- else if( aValue.EqualsAscii( "DUPLEX_OFF" ) )
+ else if( aValue.equalsAscii( "DUPLEX_OFF" ) )
pJobData->meDuplexMode = DUPLEX_OFF;
- else if( aValue.EqualsAscii( "DUPLEX_SHORTEDGE" ) )
+ else if( aValue.equalsAscii( "DUPLEX_SHORTEDGE" ) )
pJobData->meDuplexMode = DUPLEX_SHORTEDGE;
- else if( aValue.EqualsAscii( "DUPLEX_LONGEDGE" ) )
+ else if( aValue.equalsAscii( "DUPLEX_LONGEDGE" ) )
pJobData->meDuplexMode = DUPLEX_LONGEDGE;
}
else
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index af46ba0a6acb..ed0acd8c2067 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -151,14 +151,14 @@ void doTestCode()
aWriter.SetLineColor( Color( COL_LIGHTGREEN ) );
aWriter.DrawRect( Rectangle( Point( 2000, 200 ), Size( 8000, 3000 ) ), 5000, 2000 );
- aWriter.SetFont( Font( String( "Times" ), Size( 0, 500 ) ) );
+ aWriter.SetFont( Font( OUString( "Times" ), Size( 0, 500 ) ) );
aWriter.SetTextColor( Color( COL_BLACK ) );
aWriter.SetLineColor( Color( COL_BLACK ) );
aWriter.SetFillColor( Color( COL_LIGHTBLUE ) );
Rectangle aRect( Point( 5000, 5000 ), Size( 6000, 3000 ) );
aWriter.DrawRect( aRect );
- aWriter.DrawText( aRect, String( "Link annot 1" ) );
+ aWriter.DrawText( aRect, OUString( "Link annot 1" ) );
sal_Int32 nFirstLink = aWriter.CreateLink( aRect );
PDFNote aNote;
aNote.Title = "A small test note";
@@ -199,7 +199,7 @@ void doTestCode()
aWriter.SetPageTransition( PDFWriter::WipeRightToLeft, 1500 );
aWriter.SetMapMode( MapMode( MAP_100TH_MM ) );
aWriter.SetTextColor( Color( COL_BLACK ) );
- aWriter.SetFont( Font( String( "Times" ), Size( 0, 500 ) ) );
+ aWriter.SetFont( Font( OUString( "Times" ), Size( 0, 500 ) ) );
aWriter.DrawText( Rectangle( Point( 4500, 1500 ), Size( 12000, 3000 ) ),
"Here's where all things come to an end ... well at least the paragaph from the last page.",
TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK
@@ -326,7 +326,7 @@ void doTestCode()
aWriter.NewPage( 595, 842 );
aWriter.SetMapMode( MapMode( MAP_100TH_MM ) );
- aWriter.SetFont( Font( String( "Times" ), Size( 0, 500 ) ) );
+ aWriter.SetFont( Font( OUString( "Times" ), Size( 0, 500 ) ) );
aWriter.SetTextColor( Color( COL_BLACK ) );
aRect = Rectangle( Point( 4500, 6000 ), Size( 6000, 1500 ) );
aWriter.DrawRect( aRect );
@@ -397,7 +397,7 @@ void doTestCode()
aRB1.BorderColor = Color( COL_LIGHTGREEN );
aRB1.BackgroundColor = Color( COL_LIGHTBLUE );
aRB1.TextColor = Color( COL_LIGHTRED );
- aRB1.TextFont = Font( String( "Courier" ), Size( 0, 800 ) );
+ aRB1.TextFont = Font( OUString( "Courier" ), Size( 0, 800 ) );
aWriter.CreateControl( aRB1 );
PDFWriter::RadioButtonWidget aRB2;
@@ -1757,7 +1757,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
m_aStructure[0].m_nParentElement = 0;
Font aFont;
- aFont.SetName( String( "Times" ) );
+ aFont.SetName( OUString( "Times" ) );
aFont.SetSize( Size( 0, 12 ) );
GraphicsState aState;
@@ -2310,7 +2310,7 @@ void PDFWriterImpl::endPage()
// reset the default font
Font aFont;
- aFont.SetName( String( "Times" ) );
+ aFont.SetName( OUString( "Times" ) );
aFont.SetSize( Size( 0, 12 ) );
m_aCurrentPDFState = m_aGraphicsStack.front();
@@ -4713,7 +4713,7 @@ void PDFWriterImpl::createDefaultPushButtonAppearance( PDFWidget& rButton, const
// (that is before endRedirect())
OStringBuffer aDA( 256 );
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetButtonTextColor() ), aDA );
- Font aDummyFont( String( "Helvetica" ), aFont.GetSize() );
+ Font aDummyFont( OUString( "Helvetica" ), aFont.GetSize() );
sal_Int32 nDummyBuiltin = getBestBuiltinFont( aDummyFont );
aDA.append( ' ' );
aDA.append( m_aBuiltinFonts[nDummyBuiltin].getNameObject() );
@@ -4975,7 +4975,7 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW
OStringBuffer aDA( 256 );
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ), aDA );
- sal_Int32 nBest = getBestBuiltinFont( Font( String( "ZapfDingbats" ), aFont.GetSize() ) );
+ sal_Int32 nBest = getBestBuiltinFont( Font( OUString( "ZapfDingbats" ), aFont.GetSize() ) );
aDA.append( ' ' );
aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
aDA.append( " 0 Tf" );
@@ -5100,7 +5100,7 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
OStringBuffer aDA( 256 );
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ), aDA );
- sal_Int32 nBest = getBestBuiltinFont( Font( String( "ZapfDingbats" ), aFont.GetSize() ) );
+ sal_Int32 nBest = getBestBuiltinFont( Font( OUString( "ZapfDingbats" ), aFont.GetSize() ) );
aDA.append( ' ' );
aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
aDA.append( " 0 Tf" );
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index c814b0555b56..2c3df1504887 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -834,14 +834,14 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
case( META_TEXT_ACTION ):
{
const MetaTextAction* pA = (const MetaTextAction*) pAction;
- m_rOuterFace.DrawText( pA->GetPoint(), String( pA->GetText(), pA->GetIndex(), pA->GetLen() ) );
+ m_rOuterFace.DrawText( pA->GetPoint(), pA->GetText().copy( pA->GetIndex(), pA->GetLen() ) );
}
break;
case( META_TEXTRECT_ACTION ):
{
const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
- m_rOuterFace.DrawText( pA->GetRect(), String( pA->GetText() ), pA->GetStyle() );
+ m_rOuterFace.DrawText( pA->GetRect(), pA->GetText(), pA->GetStyle() );
}
break;
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index a3f976be2691..366caa808143 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -510,7 +510,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
if( pJobNameVal )
pJobNameVal->Value >>= aJobName;
- pController->getPrinter()->StartJob( String( aJobName ), pController );
+ pController->getPrinter()->StartJob( aJobName, pController );
pController->resetPaperToLastConfigured();
diff --git a/vcl/source/window/abstdlg.cxx b/vcl/source/window/abstdlg.cxx
index 8e0af1615d41..9b1e59a07e61 100644
--- a/vcl/source/window/abstdlg.cxx
+++ b/vcl/source/window/abstdlg.cxx
@@ -36,7 +36,7 @@ VclAbstractDialogFactory* VclAbstractDialogFactory::Create()
FuncPtrCreateDialogFactory fp = 0;
#ifndef DISABLE_DYNLOADING
static ::osl::Module aDialogLibrary;
- if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( CUI_DLL_NAME ),
+ if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, OUString( CUI_DLL_NAME ),
SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
fp = ( VclAbstractDialogFactory* (SAL_CALL*)() )
aDialogLibrary.getFunctionSymbol( OUString("CreateDialogFactory") );
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index c62313089fe0..7a4946d521d1 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -1115,15 +1115,15 @@ Window* Window::GetParentLabeledBy( const Window* ) const
// -----------------------------------------------------------------------
-static sal_Unicode getAccel( const String& rStr )
+static sal_Unicode getAccel( const OUString& rStr )
{
sal_Unicode nChar = 0;
- sal_uInt16 nPos = 0;
+ sal_Int32 nPos = 0;
do
{
- nPos = rStr.Search( '~', nPos );
- if( nPos != STRING_NOTFOUND && nPos < rStr.Len() )
- nChar = rStr.GetChar( ++nPos );
+ nPos = rStr.indexOf( '~', nPos );
+ if( nPos != -1 && nPos < rStr.getLength() )
+ nChar = rStr[ ++nPos ];
else
nChar = 0;
} while( nChar == '~' );
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 07f13e5a6829..5b263c28d99f 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -832,16 +832,16 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- String aCommand = GetItemCommand( nItemId );
+ OUString aCommand = GetItemCommand( nItemId );
OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || !aHelpId.isEmpty() )
+ if ( !aCommand.isEmpty() || !aHelpId.isEmpty() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if ( aCommand.Len() )
+ if ( !aCommand.isEmpty() )
pHelp->Start( aCommand, this );
else if ( !aHelpId.isEmpty() )
pHelp->Start( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 8e9889bb558d..8a83ece0fdf1 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4326,16 +4326,16 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- String aCommand = GetItemCommand( nItemId );
+ OUString aCommand = GetItemCommand( nItemId );
OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || !aHelpId.isEmpty() )
+ if ( !aCommand.isEmpty() || !aHelpId.isEmpty() )
{
// If help is available then trigger it
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if ( aCommand.Len() )
+ if ( !aCommand.isEmpty() )
pHelp->Start( aCommand, this );
else if ( !aHelpId.isEmpty() )
pHelp->Start( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index fe0cd52d5511..dec55d113303 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -409,7 +409,7 @@ bool Window::ImplCheckUIFont( const Font& rFont )
return true;
// create a text string using the localized text of important buttons
- String aTestText;
+ OUString aTestText;
static const StandardButtonType aTestButtons[] =
{
BUTTON_OK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_ABORT,
@@ -420,13 +420,13 @@ bool Window::ImplCheckUIFont( const Font& rFont )
const int nTestButtonCount = SAL_N_ELEMENTS(aTestButtons);
for( int n = 0; n < nTestButtonCount; ++n )
{
- String aButtonStr = Button::GetStandardText( aTestButtons[n] );
+ OUString aButtonStr = Button::GetStandardText( aTestButtons[n] );
// #i115432# ignore mnemonic+accelerator part of each string
// TODO: use a string filtering method when it becomes available
- const int nLen = aButtonStr.Len();
+ const sal_Int32 nLen = aButtonStr.getLength();
bool bInside = false;
for( int i = 0; i < nLen; ++i ) {
- const sal_Unicode c = aButtonStr.GetChar( i );
+ const sal_Unicode c = aButtonStr[ i ];
if( (c == '('))
bInside = true;
if( (c == ')'))
@@ -434,14 +434,14 @@ bool Window::ImplCheckUIFont( const Font& rFont )
if( (c == '~')
|| (c == '(') || (c == ')')
|| ((c >= 'A') && (c <= 'Z') && bInside) )
- aButtonStr.SetChar( i, ' ' );
+ aButtonStr = aButtonStr.replaceAt( i, 1, " " );
}
// append sanitized button text to test string
- aTestText.Append( aButtonStr );
+ aTestText += aButtonStr;
}
const int nFirstChar = HasGlyphs( rFont, aTestText );
- const bool bUIFontOk = (nFirstChar >= aTestText.Len());
+ const bool bUIFontOk = (nFirstChar >= aTestText.getLength());
return bUIFontOk;
}
@@ -460,7 +460,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
// WTF, what makes Andale Sans UI a suitable cross-platform fallback font?
- String aUserInterfaceFont;
+ OUString aUserInterfaceFont;
bool bUseSystemFont = rSettings.GetStyleSettings().GetUseSystemUIFonts();
// check whether system UI font can display a typical UI text
@@ -470,27 +470,27 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
if ( !bUseSystemFont )
{
ImplInitFontList();
- String aConfigFont = utl::DefaultFontConfiguration::get().getUserInterfaceFont( rSettings.GetUILanguageTag() );
+ OUString aConfigFont = utl::DefaultFontConfiguration::get().getUserInterfaceFont( rSettings.GetUILanguageTag() );
sal_Int32 nIndex = 0;
while( nIndex != -1 )
{
- String aName( aConfigFont.GetToken( 0, ';', nIndex ) );
- if ( aName.Len() && mpWindowImpl->mpFrameData->mpFontList->FindFontFamily( aName ) )
+ OUString aName( aConfigFont.getToken( 0, ';', nIndex ) );
+ if ( !aName.isEmpty() && mpWindowImpl->mpFrameData->mpFontList->FindFontFamily( aName ) )
{
aUserInterfaceFont = aConfigFont;
break;
}
}
- if ( ! aUserInterfaceFont.Len() )
+ if ( aUserInterfaceFont.isEmpty() )
{
- String aFallbackFont ("Andale Sans UI" );
+ OUString aFallbackFont ("Andale Sans UI" );
if ( mpWindowImpl->mpFrameData->mpFontList->FindFontFamily( aFallbackFont ) )
aUserInterfaceFont = aFallbackFont;
}
}
- if ( !bUseSystemFont && aUserInterfaceFont.Len() )
+ if ( !bUseSystemFont && !aUserInterfaceFont.isEmpty() )
{
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
Font aFont = aStyleSettings.GetAppFont();
@@ -4925,23 +4925,23 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
if ( ImplGetParent() && !ImplIsOverlapWindow() )
aPos = ImplGetParent()->OutputToScreenPixel( aPos );
Rectangle aRect( aPos, GetSizePixel() );
- String aHelpText;
- if ( rStr.getLength() )
+ OUString aHelpText;
+ if ( !rStr.isEmpty() )
aHelpText = GetHelpText();
Help::ShowQuickHelp( this, aRect, rStr, aHelpText, QUICKHELP_CTRLTEXT );
}
}
else
{
- String aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
- if ( aStrHelpId.Len() == 0 && ImplGetParent() )
+ OUString aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aStrHelpId.isEmpty() && ImplGetParent() )
ImplGetParent()->RequestHelp( rHEvt );
else
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if( aStrHelpId.Len() > 0 )
+ if( !aStrHelpId.isEmpty() )
pHelp->Start( aStrHelpId, this );
else
pHelp->Start( OUString( OOO_HELP_INDEX ), this );
@@ -7917,7 +7917,7 @@ void Window::SetText( const OUString& rStr )
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- String oldTitle( mpWindowImpl->maText );
+ OUString oldTitle( mpWindowImpl->maText );
mpWindowImpl->maText = rStr;
if ( mpWindowImpl->mpBorderWindow )
@@ -7993,8 +7993,8 @@ const OUString& Window::GetHelpText() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- String aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
- bool bStrHelpId = (aStrHelpId.Len() > 0);
+ OUString aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ bool bStrHelpId = !aStrHelpId.isEmpty();
if ( !mpWindowImpl->maHelpText.getLength() && bStrHelpId )
{
@@ -9006,7 +9006,7 @@ void Window::SetAccessibleDescription( const OUString& rDescription )
OUString Window::GetAccessibleDescription() const
{
- String aAccessibleDescription;
+ OUString aAccessibleDescription;
if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pAccessibleDescription )
{
aAccessibleDescription = *mpWindowImpl->mpAccessibleInfos->pAccessibleDescription;
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index a5bc66171df3..052395d35a93 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -968,8 +968,8 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
{
if( Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep() )
{
- String aSep( pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep() );
- nCharCode = (sal_uInt16) aSep.GetChar(0);
+ OUString aSep( pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep() );
+ nCharCode = (sal_uInt16) aSep[0];
}
}