diff options
author | Noel Grandin <noel@peralex.com> | 2013-08-07 14:15:08 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-08-12 11:56:50 +0200 |
commit | afc15f40f2e6cb7c5f8979f1da65efd375144d99 (patch) | |
tree | f04d62b5c871aa5618e681dded7dff69c213011b /vcl/unx | |
parent | db3f16317e0b0f931fdfcb6f19f8cc474bd70683 (diff) |
convert String to OUString in VCL
Change-Id: Ib5640b2db7963a7a8e8dabb2a8f5e5dc0410edec
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/app/i18n_cb.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/app/i18n_ic.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 42 | ||||
-rw-r--r-- | vcl/unx/generic/printer/cupsmgr.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/printer/jobdata.cxx | 12 | ||||
-rw-r--r-- | vcl/unx/generic/printer/printerinfomanager.cxx | 32 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalmenu.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/kde/UnxFilePicker.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde/salnativewidgets-kde.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde4/KDE4FilePicker.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde4/KDESalFrame.cxx | 2 |
12 files changed, 57 insertions, 57 deletions
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx index 1d1a7f6d596b..f25a518ec686 100644 --- a/vcl/unx/generic/app/i18n_cb.cxx +++ b/vcl/unx/generic/app/i18n_cb.cxx @@ -513,7 +513,7 @@ StatusDrawCallback (XIC, XPointer, XIMStatusDrawCallbackStruct *call_data) { if( call_data->type == XIMTextType ) { - String aText; + OUString aText; if( call_data->data.text ) { // XIM with text @@ -538,7 +538,7 @@ StatusDrawCallback (XIC, XPointer, XIMStatusDrawCallbackStruct *call_data) } } if( nLength ) - aText = String( pMBString, nLength, osl_getThreadTextEncoding() ); + aText = OUString( pMBString, nLength, osl_getThreadTextEncoding() ); } ::vcl::I18NStatus::get().setStatusText( aText ); } diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx index 7fa4e0392963..14fd5fc36e35 100644 --- a/vcl/unx/generic/app/i18n_ic.cxx +++ b/vcl/unx/generic/app/i18n_ic.cxx @@ -47,7 +47,7 @@ static void sendEmptyCommit( SalFrame* pFrame ) SalExtTextInputEvent aEmptyEv; aEmptyEv.mnTime = 0; aEmptyEv.mpTextAttr = 0; - aEmptyEv.maText = String(); + aEmptyEv.maText = ""; aEmptyEv.mnCursorPos = 0; aEmptyEv.mnCursorFlags = 0; aEmptyEv.mnDeltaStart = 0; diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 75b2d2e1e8ef..c7cf6e4b88e4 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -789,23 +789,23 @@ void SalDisplay::ModifierMapping() OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const { - String aStrMap; - String aCustomKeyName; + OUString aStrMap; + OUString aCustomKeyName; if( nKeyCode & KEY_MOD1 ) aStrMap += GetKeyNameFromKeySym( nCtrlKeySym_ ); if( nKeyCode & KEY_MOD2 ) { - if( aStrMap.Len() ) - aStrMap += '+'; + if( !aStrMap.isEmpty() ) + aStrMap += "+"; aStrMap += GetKeyNameFromKeySym( nMod1KeySym_ ); } if( nKeyCode & KEY_SHIFT ) { - if( aStrMap.Len() ) - aStrMap += '+'; + if( !aStrMap.isEmpty() ) + aStrMap += "+"; aStrMap += GetKeyNameFromKeySym( nShiftKeySym_ ); } nKeyCode &= 0x0FFF; @@ -903,10 +903,10 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const nKeySym = GetServerVendor() == vendor_sun ? SunXK_Cut : XK_L10; break; case KEY_ADD: - aCustomKeyName = '+'; + aCustomKeyName = "+"; break; case KEY_SUBTRACT: - aCustomKeyName = '-'; + aCustomKeyName = "-"; break; case KEY_MULTIPLY: nKeySym = XK_asterisk; @@ -915,7 +915,7 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const nKeySym = XK_slash; break; case KEY_POINT: - aCustomKeyName = '.'; + aCustomKeyName = "."; break; case KEY_COMMA: nKeySym = XK_comma; @@ -942,13 +942,13 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const nKeySym = XK_grave; break; case KEY_BRACKETLEFT: - aCustomKeyName = '['; + aCustomKeyName = "["; break; case KEY_BRACKETRIGHT: - aCustomKeyName = ']'; + aCustomKeyName = "]"; break; case KEY_SEMICOLON: - aCustomKeyName = ';'; + aCustomKeyName = ";"; break; default: @@ -958,26 +958,26 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const if( nKeySym ) { - String aKeyName = GetKeyNameFromKeySym( nKeySym ); - if( aKeyName.Len() ) + OUString aKeyName = GetKeyNameFromKeySym( nKeySym ); + if( !aKeyName.isEmpty() ) { - if( aStrMap.Len() ) - aStrMap += '+'; + if( !aStrMap.isEmpty() ) + aStrMap += "+"; aStrMap += aKeyName; } else - aStrMap.Erase(); + aStrMap = ""; } - else if (aCustomKeyName.Len()) + else if (!aCustomKeyName.isEmpty()) { // For semicolumn, bracket left and bracket right, it's better to use // their keys than their names. (fdo#32891) - if (aStrMap.Len()) - aStrMap += '+'; + if (!aStrMap.isEmpty()) + aStrMap += "+"; aStrMap += aCustomKeyName; } else - aStrMap.Erase(); + aStrMap = ""; return aStrMap; } diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx index 8510196462b1..e386d3dfc293 100644 --- a/vcl/unx/generic/printer/cupsmgr.cxx +++ b/vcl/unx/generic/printer/cupsmgr.cxx @@ -517,7 +517,7 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter ) if( ! pNewParser ) { // get the default PPD - pNewParser = PPDParser::getParser( String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) ); + pNewParser = PPDParser::getParser( OUString( "SGENPRT" ) ); PrinterInfo& rInfo = m_aPrinters[ aPrinter ].m_aInfo; diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx index d40fffd913a7..47bb0f4d4b57 100644 --- a/vcl/unx/generic/printer/jobdata.cxx +++ b/vcl/unx/generic/printer/jobdata.cxx @@ -57,17 +57,17 @@ void JobData::setCollate( bool bCollate ) const PPDParser* pParser = m_aContext.getParser(); if( pParser ) { - const PPDKey* pKey = pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ) ); + const PPDKey* pKey = pParser->getKey( OUString( "Collate" ) ); if( pKey ) { const PPDValue* pVal = NULL; if( bCollate ) - pVal = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "True" ) ) ); + pVal = pKey->getValue( OUString( "True" ) ); else { - pVal = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "False" ) ) ); + pVal = pKey->getValue( OUString( "False" ) ); if( ! pVal ) - pVal = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) ); + pVal = pKey->getValue( OUString( "None" ) ); } m_aContext.setValue( pKey, pVal ); } @@ -81,7 +81,7 @@ bool JobData::setPaper( int i_nWidth, int i_nHeight ) { OUString aPaper( m_pParser->matchPaper( i_nWidth, i_nHeight ) ); - const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); + const PPDKey* pKey = m_pParser->getKey( OUString( "PageSize" ) ); const PPDValue* pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL; bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false ); @@ -94,7 +94,7 @@ bool JobData::setPaperBin( int i_nPaperBin ) bool bSuccess = false; if( m_pParser ) { - const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ); + const PPDKey* pKey = m_pParser->getKey( OUString( "InputSlot" ) ); const PPDValue* pValue = pKey ? pKey->getValue( i_nPaperBin ) : NULL; bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false ); diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index f3e7dc8bf89f..4e53c82891a2 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -230,7 +230,7 @@ void PrinterInfoManager::initialize() m_aGlobalDefaults = PrinterInfo(); // need a parser for the PPDContext. generic printer should do. - m_aGlobalDefaults.m_pParser = PPDParser::getParser( String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) ); + m_aGlobalDefaults.m_pParser = PPDParser::getParser( OUString( "SGENPRT" ) ); m_aGlobalDefaults.m_aContext.setParser( m_aGlobalDefaults.m_pParser ); m_aGlobalDefaults.m_bPerformFontSubstitution = true; m_bDisableCUPS = false; @@ -249,7 +249,7 @@ void PrinterInfoManager::initialize() for( print_dir_it = aDirList.begin(); print_dir_it != aDirList.end(); ++print_dir_it ) { INetURLObject aFile( *print_dir_it, INET_PROT_FILE, INetURLObject::ENCODE_ALL ); - aFile.Append( String( RTL_CONSTASCII_USTRINGPARAM( PRINT_FILENAME ) ) ); + aFile.Append( OUString( PRINT_FILENAME ) ); Config aConfig( aFile.PathToFileName() ); if( aConfig.HasGroup( GLOBAL_DEFAULTS_GROUP ) ) { @@ -346,7 +346,7 @@ void PrinterInfoManager::initialize() { INetURLObject aDir( *print_dir_it, INET_PROT_FILE, INetURLObject::ENCODE_ALL ); INetURLObject aFile( aDir ); - aFile.Append( String( RTL_CONSTASCII_USTRINGPARAM( PRINT_FILENAME ) ) ); + aFile.Append( OUString( PRINT_FILENAME ) ); // check directory validity OUString aUniPath; @@ -578,8 +578,8 @@ void PrinterInfoManager::initialize() // merge paper and font substitution from default printer, // all else from global defaults PrinterInfo aMergeInfo( m_aGlobalDefaults ); - aMergeInfo.m_aDriverName = String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ); - aMergeInfo.m_aFeatures = String( RTL_CONSTASCII_USTRINGPARAM( "autoqueue" ) ); + aMergeInfo.m_aDriverName = "SGENPRT"; + aMergeInfo.m_aFeatures = "autoqueue"; if( !m_aDefaultPrinter.isEmpty() ) { @@ -587,8 +587,8 @@ void PrinterInfoManager::initialize() aMergeInfo.m_bPerformFontSubstitution = aDefaultInfo.m_bPerformFontSubstitution; fillFontSubstitutions( aMergeInfo ); - const PPDKey* pDefKey = aDefaultInfo.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); - const PPDKey* pMergeKey = aMergeInfo.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); + const PPDKey* pDefKey = aDefaultInfo.m_pParser->getKey( OUString( "PageSize" ) ); + const PPDKey* pMergeKey = aMergeInfo.m_pParser->getKey( OUString( "PageSize" ) ); const PPDValue* pDefValue = aDefaultInfo.m_aContext.getValue( pDefKey ); const PPDValue* pMergeValue = pMergeKey ? pMergeKey->getValue( pDefValue->m_aOption ) : NULL; if( pMergeKey && pMergeValue ) @@ -598,16 +598,16 @@ void PrinterInfoManager::initialize() getSystemPrintQueues(); for( ::std::list< SystemPrintQueue >::iterator it = m_aSystemPrintQueues.begin(); it != m_aSystemPrintQueues.end(); ++it ) { - String aPrinterName( RTL_CONSTASCII_USTRINGPARAM( "<" ) ); - aPrinterName += String( it->m_aQueue ); - aPrinterName.Append( '>' ); + OUString aPrinterName( "<" ); + aPrinterName += it->m_aQueue; + aPrinterName += ">"; if( m_aPrinters.find( aPrinterName ) != m_aPrinters.end() ) // probably user made this one permanent in padmin continue; - String aCmd( m_aSystemPrintCommand ); - aCmd.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "(PRINTER)" ) ), it->m_aQueue ); + OUString aCmd( m_aSystemPrintCommand ); + aCmd = aCmd.replaceAll( "(PRINTER)", it->m_aQueue ); Printer aPrinter; @@ -1070,11 +1070,11 @@ void PrinterInfoManager::getSystemPrintCommands( std::list< OUString >& rCommand std::list< SystemPrintQueue >::const_iterator it; rCommands.clear(); - String aPrinterConst( RTL_CONSTASCII_USTRINGPARAM( "(PRINTER)" ) ); + OUString aPrinterConst( "(PRINTER)" ); for( it = m_aSystemPrintQueues.begin(); it != m_aSystemPrintQueues.end(); ++it ) { - String aCmd( m_aSystemPrintCommand ); - aCmd.SearchAndReplace( aPrinterConst, it->m_aQueue ); + OUString aCmd( m_aSystemPrintCommand ); + aCmd = aCmd.replaceAll( aPrinterConst, it->m_aQueue ); rCommands.push_back( aCmd ); } } @@ -1138,7 +1138,7 @@ void PrinterInfoManager::setDefaultPaper( PPDContext& rContext ) const if( ! rContext.getParser() ) return; - const PPDKey* pPageSizeKey = rContext.getParser()->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); + const PPDKey* pPageSizeKey = rContext.getParser()->getKey( OUString( "PageSize" ) ); if( ! pPageSizeKey ) return; diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index bff9da291187..fd6aa07a0cfd 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -3907,7 +3907,7 @@ void GtkSalFrame::IMHandler::sendEmptyCommit() SalExtTextInputEvent aEmptyEv; aEmptyEv.mnTime = 0; aEmptyEv.mpTextAttr = 0; - aEmptyEv.maText = String(); + aEmptyEv.maText = ""; aEmptyEv.mnCursorPos = 0; aEmptyEv.mnCursorFlags = 0; aEmptyEv.mnDeltaStart = 0; @@ -4100,7 +4100,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p pThis->m_aInputEvent.mnTime = 0; pThis->m_aInputEvent.mpTextAttr = 0; - pThis->m_aInputEvent.maText = String( pText, RTL_TEXTENCODING_UTF8 ); + pThis->m_aInputEvent.maText = OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 ); pThis->m_aInputEvent.mnCursorPos = pThis->m_aInputEvent.maText.getLength(); pThis->m_aInputEvent.mnCursorFlags = 0; pThis->m_aInputEvent.mnDeltaStart = 0; @@ -4144,7 +4144,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p if( ! aDel.isDeleted() ) { // reset input event - pThis->m_aInputEvent.maText = String(); + pThis->m_aInputEvent.maText = ""; pThis->m_aInputEvent.mnCursorPos = 0; pThis->updateIMSpotLocation(); } @@ -4187,7 +4187,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_ bool bEndPreedit = (!pText || !*pText) && pThis->m_aInputEvent.mpTextAttr != NULL; pThis->m_aInputEvent.mnTime = 0; - pThis->m_aInputEvent.maText = String( pText, RTL_TEXTENCODING_UTF8 ); + pThis->m_aInputEvent.maText = OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 ); pThis->m_aInputEvent.mnCursorPos = nCursorPos; pThis->m_aInputEvent.mnCursorFlags = 0; pThis->m_aInputEvent.mnDeltaStart = 0; diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index c601af1d4a76..d2247045373a 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -299,7 +299,7 @@ void GtkSalMenu::ImplUpdate( gboolean bRecurse ) g_lo_menu_insert_in_section( pLOMenu, nSection, nItemPos, "EMPTY STRING" ); // Get internal menu item values. - String aText = pVCLMenu->GetItemText( nId ); + OUString aText = pVCLMenu->GetItemText( nId ); sal_Bool itemEnabled = pVCLMenu->IsItemEnabled( nId ); KeyCode nAccelKey = pVCLMenu->GetAccelKey( nId ); sal_Bool itemChecked = pVCLMenu->IsItemChecked( nId ); @@ -658,7 +658,7 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean bGetSub { GtkSalMenuItem *pSalItem = maItems[ nPos ]; - String aItemCommand = mpVCLMenu->GetItemCommand( pSalItem->mnId ); + OUString aItemCommand = mpVCLMenu->GetItemCommand( pSalItem->mnId ); gchar* aItemCommandStr = (gchar*) OUStringToOString( aItemCommand, RTL_TEXTENCODING_UTF8 ).getStr(); if ( g_strcmp0( aItemCommandStr, aCommand ) == 0 ) diff --git a/vcl/unx/kde/UnxFilePicker.cxx b/vcl/unx/kde/UnxFilePicker.cxx index 706d0957ed49..481ca9677170 100644 --- a/vcl/unx/kde/UnxFilePicker.cxx +++ b/vcl/unx/kde/UnxFilePicker.cxx @@ -918,7 +918,7 @@ void UnxFilePicker::sendAppendControlCommand( sal_Int16 nControlId ) aBuffer.appendAscii( " ", 1 ); appendEscaped( aBuffer, aType ); aBuffer.appendAscii( " ", 1 ); - appendEscaped( aBuffer, m_pResMgr? String( ResId( nTitleId, *m_pResMgr ) ): String() ); + appendEscaped( aBuffer, m_pResMgr? OUString( ResId( nTitleId, *m_pResMgr ) ): OUString() ); sendCommand( aBuffer.makeStringAndClear() ); } diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index e1923ac39502..dfbdb4293afb 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -1765,7 +1765,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r QFontInfo qFontInfo( rQFont ); // set family name - aInfo.m_aFamilyName = String( rQFont.family().utf8(), RTL_TEXTENCODING_UTF8 ); + aInfo.m_aFamilyName = OUString( rQFont.family().utf8(), strlen( rQFont.family().utf8() ), RTL_TEXTENCODING_UTF8 ); // set italic aInfo.m_eItalic = ( qFontInfo.italic()? ITALIC_NORMAL: ITALIC_NONE ); diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx index e76c7523edc5..6ffb013d949d 100644 --- a/vcl/unx/kde4/KDE4FilePicker.cxx +++ b/vcl/unx/kde4/KDE4FilePicker.cxx @@ -549,7 +549,7 @@ void KDE4FilePicker::addCustomControl(sal_Int16 controlId) if (_resMgr && resId != -1) { - OUString s = String(ResId( resId, *_resMgr )); + OUString s(ResId( resId, *_resMgr )); label = toQString(s); label.replace("~", "&"); } diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index be1fb61d28ff..71f9c56c5c0a 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -90,7 +90,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r QFontInfo qFontInfo( rQFont ); // set family name - aInfo.m_aFamilyName = String( (const char *) rQFont.family().toUtf8(), RTL_TEXTENCODING_UTF8 ); + aInfo.m_aFamilyName = OUString( (const char *) rQFont.family().toUtf8(), strlen( (const char *) rQFont.family().toUtf8() ), RTL_TEXTENCODING_UTF8 ); // set italic aInfo.m_eItalic = ( qFontInfo.italic()? ITALIC_NORMAL: ITALIC_NONE ); |