Kaydet (Commit) 8398d5d9 authored tarafından Prashant Pandey's avatar Prashant Pandey Kaydeden (comit) Miklos Vajna

fdo#62096: Replaced some OUString 'compareTo' with '=='

Change-Id: I1d095cf5640595789f4ae99f1b0679be88b0baa9
üst a6475acf
...@@ -1472,7 +1472,7 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl ...@@ -1472,7 +1472,7 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl
{ {
aSingleType = rType.GetToken( 0, FILEDIALOG_DEF_EXTSEP, nIdx ); aSingleType = rType.GetToken( 0, FILEDIALOG_DEF_EXTSEP, nIdx );
#ifdef UNX #ifdef UNX
if ( aSingleType.CompareTo( _rFilter ) == COMPARE_EQUAL ) if ( aSingleType == _rFilter )
#else #else
if ( aSingleType.CompareIgnoreCaseToAscii( _rFilter ) == COMPARE_EQUAL ) if ( aSingleType.CompareIgnoreCaseToAscii( _rFilter ) == COMPARE_EQUAL )
#endif #endif
...@@ -1480,7 +1480,7 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl ...@@ -1480,7 +1480,7 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl
} }
} }
#ifdef UNX #ifdef UNX
else if ( rType.CompareTo( _rFilter ) == COMPARE_EQUAL ) else if ( rType == _rFilter )
#else #else
else if ( rType.CompareIgnoreCaseToAscii( _rFilter ) == COMPARE_EQUAL ) else if ( rType.CompareIgnoreCaseToAscii( _rFilter ) == COMPARE_EQUAL )
#endif #endif
......
...@@ -272,7 +272,7 @@ sal_Bool SAL_CALL CmdMailSuppl::supportsService( const OUString& ServiceName ) ...@@ -272,7 +272,7 @@ sal_Bool SAL_CALL CmdMailSuppl::supportsService( const OUString& ServiceName )
Sequence < OUString > SupportedServicesNames = Component_getSupportedServiceNames(); Sequence < OUString > SupportedServicesNames = Component_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
if (SupportedServicesNames[n].compareTo(ServiceName) == 0) if ( SupportedServicesNames[n] == ServiceName )
return sal_True; return sal_True;
return sal_False; return sal_False;
......
...@@ -284,7 +284,7 @@ sal_Bool SAL_CALL ShellExec::supportsService( const OUString& ServiceName ) ...@@ -284,7 +284,7 @@ sal_Bool SAL_CALL ShellExec::supportsService( const OUString& ServiceName )
Sequence < OUString > SupportedServicesNames = ShellExec_getSupportedServiceNames(); Sequence < OUString > SupportedServicesNames = ShellExec_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
if (SupportedServicesNames[n].compareTo(ServiceName) == 0) if ( SupportedServicesNames[n] == ServiceName )
return sal_True; return sal_True;
return sal_False; return sal_False;
......
...@@ -361,7 +361,7 @@ sal_Bool SAL_CALL CSysShExec::supportsService( const OUString& ServiceName ) ...@@ -361,7 +361,7 @@ sal_Bool SAL_CALL CSysShExec::supportsService( const OUString& ServiceName )
Sequence < OUString > SupportedServicesNames = SysShExec_getSupportedServiceNames(); Sequence < OUString > SupportedServicesNames = SysShExec_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; ) for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
if (SupportedServicesNames[n].compareTo(ServiceName) == 0) if ( SupportedServicesNames[n] == ServiceName )
return sal_True; return sal_True;
return sal_False; return sal_False;
......
...@@ -82,7 +82,7 @@ sal_Bool SAL_CALL CSmplMailSuppl::supportsService(const OUString& ServiceName) ...@@ -82,7 +82,7 @@ sal_Bool SAL_CALL CSmplMailSuppl::supportsService(const OUString& ServiceName)
Sequence <OUString> SupportedServicesNames = Component_getSupportedServiceNames(); Sequence <OUString> SupportedServicesNames = Component_getSupportedServiceNames();
for (sal_Int32 n = SupportedServicesNames.getLength(); n--;) for (sal_Int32 n = SupportedServicesNames.getLength(); n--;)
if (SupportedServicesNames[n].compareTo(ServiceName) == 0) if ( SupportedServicesNames[n] == ServiceName )
return sal_True; return sal_True;
return sal_False; return sal_False;
......
...@@ -178,7 +178,7 @@ sal_Bool SAL_CALL FSStorageFactory::supportsService( const OUString& ServiceName ...@@ -178,7 +178,7 @@ sal_Bool SAL_CALL FSStorageFactory::supportsService( const OUString& ServiceName
uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames(); uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
if ( ServiceName.compareTo( aSeq[nInd] ) == 0 ) if ( ServiceName == aSeq[nInd] )
return sal_True; return sal_True;
return sal_False; return sal_False;
......
...@@ -1912,7 +1912,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t ...@@ -1912,7 +1912,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
sal_Bool bVoid = !Value.hasValue(); sal_Bool bVoid = !Value.hasValue();
if ( 0 == PropertyName.compareTo( FM_PROP_TEXTLINECOLOR ) ) if ( PropertyName == FM_PROP_TEXTLINECOLOR )
{ {
::Color aTextLineColor( bVoid ? COL_TRANSPARENT : ::comphelper::getINT32( Value ) ); ::Color aTextLineColor( bVoid ? COL_TRANSPARENT : ::comphelper::getINT32( Value ) );
if (bVoid) if (bVoid)
...@@ -1944,21 +1944,21 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t ...@@ -1944,21 +1944,21 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
if (isDesignMode()) if (isDesignMode())
pGrid->Invalidate(); pGrid->Invalidate();
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_FONTEMPHASISMARK ) ) else if ( PropertyName == FM_PROP_FONTEMPHASISMARK )
{ {
Font aGridFont = pGrid->GetControlFont(); Font aGridFont = pGrid->GetControlFont();
sal_Int16 nValue = ::comphelper::getINT16(Value); sal_Int16 nValue = ::comphelper::getINT16(Value);
aGridFont.SetEmphasisMark( nValue ); aGridFont.SetEmphasisMark( nValue );
pGrid->SetControlFont( aGridFont ); pGrid->SetControlFont( aGridFont );
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_FONTRELIEF ) ) else if ( PropertyName == FM_PROP_FONTRELIEF )
{ {
Font aGridFont = pGrid->GetControlFont(); Font aGridFont = pGrid->GetControlFont();
sal_Int16 nValue = ::comphelper::getINT16(Value); sal_Int16 nValue = ::comphelper::getINT16(Value);
aGridFont.SetRelief( (FontRelief)nValue ); aGridFont.SetRelief( (FontRelief)nValue );
pGrid->SetControlFont( aGridFont ); pGrid->SetControlFont( aGridFont );
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_HELPURL ) ) else if ( PropertyName == FM_PROP_HELPURL )
{ {
OUString sHelpURL; OUString sHelpURL;
OSL_VERIFY( Value >>= sHelpURL ); OSL_VERIFY( Value >>= sHelpURL );
...@@ -1967,11 +1967,11 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t ...@@ -1967,11 +1967,11 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
sHelpURL = aHID.GetURLPath(); sHelpURL = aHID.GetURLPath();
pGrid->SetHelpId( OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) ); pGrid->SetHelpId( OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) );
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) ) else if ( PropertyName == FM_PROP_DISPLAYSYNCHRON )
{ {
pGrid->setDisplaySynchron(::comphelper::getBOOL(Value)); pGrid->setDisplaySynchron(::comphelper::getBOOL(Value));
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_CURSORCOLOR ) ) else if ( PropertyName == FM_PROP_CURSORCOLOR )
{ {
if (bVoid) if (bVoid)
pGrid->SetCursorColor(COL_TRANSPARENT); pGrid->SetCursorColor(COL_TRANSPARENT);
...@@ -1980,13 +1980,13 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t ...@@ -1980,13 +1980,13 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
if (isDesignMode()) if (isDesignMode())
pGrid->Invalidate(); pGrid->Invalidate();
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_ALWAYSSHOWCURSOR ) ) else if ( PropertyName == FM_PROP_ALWAYSSHOWCURSOR )
{ {
pGrid->EnablePermanentCursor(::comphelper::getBOOL(Value)); pGrid->EnablePermanentCursor(::comphelper::getBOOL(Value));
if (isDesignMode()) if (isDesignMode())
pGrid->Invalidate(); pGrid->Invalidate();
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_FONT ) ) else if ( PropertyName == FM_PROP_FONT )
{ {
if ( bVoid ) if ( bVoid )
pGrid->SetControlFont( Font() ); pGrid->SetControlFont( Font() );
...@@ -2020,7 +2020,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t ...@@ -2020,7 +2020,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
} }
} }
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_BACKGROUNDCOLOR ) ) else if ( PropertyName == FM_PROP_BACKGROUNDCOLOR )
{ {
if ( bVoid ) if ( bVoid )
{ {
...@@ -2033,7 +2033,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t ...@@ -2033,7 +2033,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
pGrid->SetControlBackground( aColor ); pGrid->SetControlBackground( aColor );
} }
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_TEXTCOLOR ) ) else if ( PropertyName == FM_PROP_TEXTCOLOR )
{ {
if ( bVoid ) if ( bVoid )
{ {
...@@ -2046,7 +2046,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t ...@@ -2046,7 +2046,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
pGrid->SetControlForeground( aColor ); pGrid->SetControlForeground( aColor );
} }
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_ROWHEIGHT ) ) else if ( PropertyName == FM_PROP_ROWHEIGHT )
{ {
sal_Int32 nLogHeight(0); sal_Int32 nLogHeight(0);
if (Value >>= nLogHeight) if (Value >>= nLogHeight)
...@@ -2059,19 +2059,19 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t ...@@ -2059,19 +2059,19 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
else if (bVoid) else if (bVoid)
pGrid->SetDataRowHeight(0); pGrid->SetDataRowHeight(0);
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_HASNAVIGATION ) ) else if ( PropertyName == FM_PROP_HASNAVIGATION )
{ {
sal_Bool bValue( sal_True ); sal_Bool bValue( sal_True );
OSL_VERIFY( Value >>= bValue ); OSL_VERIFY( Value >>= bValue );
pGrid->EnableNavigationBar( bValue ); pGrid->EnableNavigationBar( bValue );
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_RECORDMARKER ) ) else if ( PropertyName == FM_PROP_RECORDMARKER )
{ {
sal_Bool bValue( sal_True ); sal_Bool bValue( sal_True );
OSL_VERIFY( Value >>= bValue ); OSL_VERIFY( Value >>= bValue );
pGrid->EnableHandle( bValue ); pGrid->EnableHandle( bValue );
} }
else if ( 0 == PropertyName.compareTo( FM_PROP_ENABLED ) ) else if ( PropertyName == FM_PROP_ENABLED )
{ {
sal_Bool bValue( sal_True ); sal_Bool bValue( sal_True );
OSL_VERIFY( Value >>= bValue ); OSL_VERIFY( Value >>= bValue );
...@@ -2125,37 +2125,37 @@ Any FmXGridPeer::getProperty( const OUString& _rPropertyName ) throw( RuntimeExc ...@@ -2125,37 +2125,37 @@ Any FmXGridPeer::getProperty( const OUString& _rPropertyName ) throw( RuntimeExc
FmGridControl* pGrid = (FmGridControl*) GetWindow(); FmGridControl* pGrid = (FmGridControl*) GetWindow();
Window* pDataWindow = &pGrid->GetDataWindow(); Window* pDataWindow = &pGrid->GetDataWindow();
if ( 0 == _rPropertyName.compareTo( FM_PROP_NAME ) ) if ( _rPropertyName == FM_PROP_NAME )
{ {
Font aFont = pDataWindow->GetControlFont(); Font aFont = pDataWindow->GetControlFont();
aProp <<= ImplCreateFontDescriptor( aFont ); aProp <<= ImplCreateFontDescriptor( aFont );
} }
else if ( 0 == _rPropertyName.compareTo( FM_PROP_TEXTCOLOR ) ) else if ( _rPropertyName == FM_PROP_TEXTCOLOR )
{ {
aProp <<= (sal_Int32)pDataWindow->GetControlForeground().GetColor(); aProp <<= (sal_Int32)pDataWindow->GetControlForeground().GetColor();
} }
else if ( 0 == _rPropertyName.compareTo( FM_PROP_BACKGROUNDCOLOR ) ) else if ( _rPropertyName == FM_PROP_BACKGROUNDCOLOR )
{ {
aProp <<= (sal_Int32)pDataWindow->GetControlBackground().GetColor(); aProp <<= (sal_Int32)pDataWindow->GetControlBackground().GetColor();
} }
else if ( 0 == _rPropertyName.compareTo( FM_PROP_ROWHEIGHT ) ) else if ( _rPropertyName == FM_PROP_ROWHEIGHT )
{ {
sal_Int32 nPixelHeight = pGrid->GetDataRowHeight(); sal_Int32 nPixelHeight = pGrid->GetDataRowHeight();
// take the zoom factor into account // take the zoom factor into account
nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight); nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight);
aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MAP_10TH_MM).Y(); aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MAP_10TH_MM).Y();
} }
else if ( 0 == _rPropertyName.compareTo( FM_PROP_HASNAVIGATION ) ) else if ( _rPropertyName == FM_PROP_HASNAVIGATION )
{ {
sal_Bool bHasNavBar = pGrid->HasNavigationBar(); sal_Bool bHasNavBar = pGrid->HasNavigationBar();
aProp <<= (sal_Bool)bHasNavBar; aProp <<= (sal_Bool)bHasNavBar;
} }
else if ( 0 == _rPropertyName.compareTo( FM_PROP_RECORDMARKER ) ) else if ( _rPropertyName == FM_PROP_RECORDMARKER )
{ {
sal_Bool bHasHandle = pGrid->HasHandle(); sal_Bool bHasHandle = pGrid->HasHandle();
aProp <<= (sal_Bool)bHasHandle; aProp <<= (sal_Bool)bHasHandle;
} }
else if ( 0 == _rPropertyName.compareTo( FM_PROP_ENABLED ) ) else if ( _rPropertyName == FM_PROP_ENABLED )
{ {
aProp <<= (sal_Bool)pDataWindow->IsEnabled(); aProp <<= (sal_Bool)pDataWindow->IsEnabled();
} }
...@@ -2936,7 +2936,7 @@ IMPL_LINK(FmXGridPeer, OnExecuteGridSlot, void*, pSlot) ...@@ -2936,7 +2936,7 @@ IMPL_LINK(FmXGridPeer, OnExecuteGridSlot, void*, pSlot)
if (m_pDispatchers[i].is()) if (m_pDispatchers[i].is())
{ {
// commit any changes done so far, if it's not the undoRecord URL // commit any changes done so far, if it's not the undoRecord URL
if ( 0 == pUrls->Complete.compareTo( FMURL_RECORD_UNDO ) || commit() ) if ( pUrls->Complete == FMURL_RECORD_UNDO || commit() )
m_pDispatchers[i]->dispatch(*pUrls, Sequence< PropertyValue>()); m_pDispatchers[i]->dispatch(*pUrls, Sequence< PropertyValue>());
return 1; // handled return 1; // handled
......
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