diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-18 17:58:17 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-18 17:58:17 +0100 |
commit | 9de415945a608b8b90b648e04ad06bac2d53a9cd (patch) | |
tree | 1b0a3446e727a2190480b9f530767308ead38dd3 /vcl | |
parent | 11f20999040e97c052c0015e3265de2a68cee666 (diff) |
vcl: Use appropriate OUString functions on string constants
Change-Id: I169624820cd7d25eab18a6b90482e075ebfebcc6
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/generic/fontmanager/fontmanager.cxx | 4 | ||||
-rw-r--r-- | vcl/generic/print/printerjob.cxx | 2 | ||||
-rw-r--r-- | vcl/generic/print/prtsetup.cxx | 10 | ||||
-rw-r--r-- | vcl/unx/generic/app/i18n_ic.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/app/wmadaptor.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/dtrans/X11_selection.cxx | 10 | ||||
-rw-r--r-- | vcl/unx/generic/dtrans/config.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 20 | ||||
-rw-r--r-- | vcl/unx/generic/printer/printerinfomanager.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 6 |
13 files changed, 37 insertions, 37 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index 33fb4ed77c3a..4fbded72515c 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -364,8 +364,8 @@ bool PrintFontManager::PrintFont::readAfmMetrics( MultiAtomProvider* pProvider, // try to parse the font name and decide whether it might be a // japanese font. Who invented this PITA ? OUString aPSNameLastToken( aPSName.copy( aPSName.lastIndexOf( '-' )+1 ) ); - if( aPSNameLastToken.equalsAscii( "H" ) || - aPSNameLastToken.equalsAscii( "V" ) ) + if( aPSNameLastToken == "H" || + aPSNameLastToken == "V" ) { static const char* pEncs[] = { diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx index 80d52b1ad1ed..f9da8c92b628 100644 --- a/vcl/generic/print/printerjob.cxx +++ b/vcl/generic/print/printerjob.cxx @@ -857,7 +857,7 @@ void PrinterJob::writeJobPatch( osl::File* pFile, const JobData& rJobData ) { const PPDValue* pVal = pKey->getValue( i ); patch_order.push_back( pVal->m_aOption.toInt32() ); - if( patch_order.back() == 0 && ! pVal->m_aOption.equalsAscii( "0" ) ) + if( patch_order.back() == 0 && pVal->m_aOption != "0" ) { WritePS( pFile, "% Warning: left out JobPatchFile option \"" ); OString aOption = OUStringToOString( pVal->m_aOption, RTL_TEXTENCODING_ASCII_US ); diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index 1af14cc01c62..7118850236b1 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -341,11 +341,11 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) for( int i = 0; i < m_pParent->m_aJobData.m_pParser->getKeys(); i++ ) { const PPDKey* pKey = m_pParent->m_aJobData.m_pParser->getKey( i ); - if( pKey->isUIKey() && - ! pKey->getKey().equalsAscii( "PageSize" ) && - ! pKey->getKey().equalsAscii( "InputSlot" ) && - ! pKey->getKey().equalsAscii( "PageRegion" ) && - ! pKey->getKey().equalsAscii( "Duplex" ) + if( pKey->isUIKey() && + pKey->getKey() != "PageSize" && + pKey->getKey() != "InputSlot" && + pKey->getKey() != "PageRegion" && + pKey->getKey() != "Duplex" ) { OUString aEntry( m_pParent->m_aJobData.m_pParser->translateKey( pKey->getKey() ) ); diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx index bdc73c01a373..379243fbe846 100644 --- a/vcl/unx/generic/app/i18n_ic.cxx +++ b/vcl/unx/generic/app/i18n_ic.cxx @@ -46,7 +46,7 @@ static void sendEmptyCommit( SalFrame* pFrame ) SalExtTextInputEvent aEmptyEv; aEmptyEv.mnTime = 0; aEmptyEv.mpTextAttr = 0; - aEmptyEv.maText = ""; + aEmptyEv.maText.clear(); aEmptyEv.mnCursorPos = 0; aEmptyEv.mnCursorFlags = 0; aEmptyEv.mbOnlyCursor = False; diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 643415cba179..908d8cefc027 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -970,7 +970,7 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const aStrMap += aKeyName; } else - aStrMap = ""; + aStrMap.clear(); } else if (!aCustomKeyName.isEmpty()) { @@ -981,7 +981,7 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const aStrMap += aCustomKeyName; } else - aStrMap = ""; + aStrMap.clear(); return aStrMap; } diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index eeaabb94abec..4fe74335a05e 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -821,7 +821,7 @@ bool WMAdaptor::getNetWmName() } // if this is metacity, check for version to enable a legacy workaround - if( m_aWMName.equalsAscii( "Metacity" ) ) + if( m_aWMName == "Metacity" ) { int nVersionMajor = 0, nVersionMinor = 0; Atom nVersionAtom = XInternAtom( m_pDisplay, "_METACITY_VERSION", True ); @@ -890,7 +890,7 @@ bool WMAdaptor::getWMshouldSwitchWorkspace() const OUString( "ShouldSwitchWorkspace" ) ) ); if( aSetting.isEmpty() ) { - if( m_aWMName.equalsAscii( "awesome" ) ) + if( m_aWMName == "awesome" ) { pWMA->m_bWMshouldSwitchWorkspace = false; } diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index d2f648a4bfa4..53c006776afa 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -613,9 +613,9 @@ bool SelectionManager::convertData( aFlavor.MimeType = convertTypeFromNative( nType, nSelection, rFormat ); sal_Int32 nIndex = 0; - if( aFlavor.MimeType.getToken( 0, ';', nIndex ).equalsAscii( "text/plain" ) ) + if( aFlavor.MimeType.getToken( 0, ';', nIndex ) == "text/plain" ) { - if( aFlavor.MimeType.getToken( 0, ';', nIndex ).equalsAscii( "charset=utf-16" ) ) + if( aFlavor.MimeType.getToken( 0, ';', nIndex ) == "charset=utf-16" ) aFlavor.DataType = cppu::UnoType<OUString>::get(); else aFlavor.DataType = getCppuType( (Sequence< sal_Int8 >*)0 ); @@ -1323,18 +1323,18 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor > { OUString aToken(pFlavors->MimeType.getToken( 0, ';', nIndex )); // omit text/plain;charset=unicode since it is not well defined - if( aToken.equalsAscii( "charset=unicode" ) ) + if( aToken == "charset=unicode" ) { pAtoms++; continue; } bHaveText = true; - if( aToken.equalsAscii( "charset=utf-16" ) ) + if( aToken == "charset=utf-16" ) { bHaveUTF16 = true; pFlavors->DataType = cppu::UnoType<OUString>::get(); } - else if( aToken.equalsAscii( "charset=utf-8" ) ) + else if( aToken == "charset=utf-8" ) { aUTF8Type = *pAtoms; } diff --git a/vcl/unx/generic/dtrans/config.cxx b/vcl/unx/generic/dtrans/config.cxx index 92f672b3359c..7d52b9882412 100644 --- a/vcl/unx/generic/dtrans/config.cxx +++ b/vcl/unx/generic/dtrans/config.cxx @@ -70,7 +70,7 @@ DtransX11ConfigItem::DtransX11ConfigItem() : m_nSelectionTimeout( 3 ) { Sequence< OUString > aKeys( 1 ); - aKeys.getArray()[0] = OUString( SELECTION_PROPERTY ); + aKeys.getArray()[0] = SELECTION_PROPERTY; Sequence< Any > aValues = GetProperties( aKeys ); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "found %" SAL_PRIdINT32 " properties for %s\n", aValues.getLength(), SELECTION_PROPERTY ); diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index c4d97a1d6142..7238a44d57f9 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -1071,7 +1071,7 @@ void PPDParser::parse( ::std::list< OString >& rLines ) { // handle main key translations of form: // *ll_CC.Translation MainKeyword/translated text: "" - if( aUniKey.equalsAscii( "Translation" ) ) + if( aUniKey == "Translation" ) { m_pTranslator->insertKey( aOption, aOptionTranslation, aTransLocale ); } @@ -1692,7 +1692,7 @@ bool PPDContext::checkConstraints( const PPDKey* pKey, const PPDValue* pNewValue // None / False and the default can always be set, but be careful ! // setting them might influence constrained values - if( pNewValue->m_aOption.equalsAscii( "None" ) || pNewValue->m_aOption.equalsAscii( "False" ) || + if( pNewValue->m_aOption == "None" || pNewValue->m_aOption == "False" || pNewValue == pKey->getDefaultValue() ) return true; @@ -1727,8 +1727,8 @@ bool PPDContext::checkConstraints( const PPDKey* pKey, const PPDValue* pNewValue continue; // this should not happen, PPD broken if( pKeyOption == pNewValue && - ! pOtherKeyOption->m_aOption.equalsAscii( "None" ) && - ! pOtherKeyOption->m_aOption.equalsAscii( "False" ) ) + pOtherKeyOption->m_aOption != "None" && + pOtherKeyOption->m_aOption != "False" ) { // check if the other value can be reset and // do so if possible @@ -1741,8 +1741,8 @@ bool PPDContext::checkConstraints( const PPDKey* pKey, const PPDValue* pNewValue else if( pOtherKeyOption ) { if( getValue( pOtherKey ) == pOtherKeyOption && - ! pNewValue->m_aOption.equalsAscii( "None" ) && - ! pNewValue->m_aOption.equalsAscii( "False" ) ) + pNewValue->m_aOption != "None" && + pNewValue->m_aOption != "False" ) return false; } else @@ -1754,10 +1754,10 @@ bool PPDContext::checkConstraints( const PPDKey* pKey, const PPDValue* pNewValue else { const PPDValue* pOtherValue = getValue( pOtherKey ); - if( ! pOtherValue->m_aOption.equalsAscii( "None" ) && - ! pOtherValue->m_aOption.equalsAscii( "False" ) && - ! pNewValue->m_aOption.equalsAscii( "None" ) && - ! pNewValue->m_aOption.equalsAscii( "False" ) ) + if( pOtherValue->m_aOption != "None" && + pOtherValue->m_aOption != "False" && + pNewValue->m_aOption != "None" && + pNewValue->m_aOption != "False" ) return false; } } diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 8f80433276a7..f4eb32eb8330 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -618,7 +618,7 @@ bool PrinterInfoManager::writePrinterConfig() while( nIndex != -1 && ! bAutoQueue ) { OUString aToken( it->second.m_aInfo.m_aFeatures.getToken( 0, ',', nIndex ) ); - if( aToken.equalsAscii( "autoqueue" ) ) + if( aToken == "autoqueue" ) bAutoQueue = true; } if( bAutoQueue ) diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 5656748b1279..77370f71eb2f 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -1035,7 +1035,7 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon ) else { const OUString& rWM( pDisplay_->getWMAdaptor()->getWindowManagerName() ); - if( rWM.equalsAscii( "KWin" ) ) // assume KDE is running + if( rWM == "KWin" ) // assume KDE is running iconSize = 48; static bool bGnomeIconSize = false; static bool bGnomeChecked = false; @@ -3384,7 +3384,7 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) { // ReflectionX in Windows mode changes focus while mouse is grabbed - if( nVisibleFloats > 0 && GetDisplay()->getWMAdaptor()->getWindowManagerName().equalsAscii( "ReflectionX Windows" ) ) + if( nVisibleFloats > 0 && GetDisplay()->getWMAdaptor()->getWindowManagerName() == "ReflectionX Windows" ) return 1; /* ignore focusout resulting from keyboard grabs @@ -4072,7 +4072,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) /* another workaround for sawfish: if a transient window for the same parent is shown * sawfish does not set the focus to it. Applies only for click to focus mode. */ - if( ! (nStyle_ & SAL_FRAME_STYLE_FLOAT ) && mbInShow && GetDisplay()->getWMAdaptor()->getWindowManagerName().equalsAscii( "Sawfish" ) ) + if( ! (nStyle_ & SAL_FRAME_STYLE_FLOAT ) && mbInShow && GetDisplay()->getWMAdaptor()->getWindowManagerName() == "Sawfish" ) { // don't set the focus into the IME status window // since this will lead to a parent loss of focus, close status, diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 967aa10d0d53..e2af3e5fb751 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -1808,7 +1808,7 @@ GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const O static const char aStarDot[] = "*."; OUString aTokens; - bool bAllGlob = rType.equalsAscii( "*.*" ) || rType.equalsAscii( "*" ); + bool bAllGlob = rType == "*.*" || rType == "*"; if (bAllGlob) gtk_file_filter_add_pattern( filter, "*" ); else diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index c840cbf91174..7341071b9cd2 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -1158,7 +1158,7 @@ static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBe XSetWMHints( pDisplay, aWindow, pHints ); XFree( pHints ); - if (GetGtkSalData()->GetGtkDisplay()->getWMAdaptor()->getWindowManagerName().equalsAscii("compiz")) + if (GetGtkSalData()->GetGtkDisplay()->getWMAdaptor()->getWindowManagerName() == "compiz") return; /* remove WM_TAKE_FOCUS protocol; this would usually be the @@ -4028,7 +4028,7 @@ void GtkSalFrame::IMHandler::sendEmptyCommit() SalExtTextInputEvent aEmptyEv; aEmptyEv.mnTime = 0; aEmptyEv.mpTextAttr = 0; - aEmptyEv.maText = ""; + aEmptyEv.maText.clear(); aEmptyEv.mnCursorPos = 0; aEmptyEv.mnCursorFlags = 0; aEmptyEv.mbOnlyCursor = False; @@ -4263,7 +4263,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p if( ! aDel.isDeleted() ) { // reset input event - pThis->m_aInputEvent.maText = ""; + pThis->m_aInputEvent.maText.clear(); pThis->m_aInputEvent.mnCursorPos = 0; pThis->updateIMSpotLocation(); } |