diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-21 12:23:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-21 14:26:32 +0100 |
commit | 91e181ea585855bea97a07823f7334d0b98b20d5 (patch) | |
tree | 2578b79ddca097390802b5d2f5d5676d6a7821ff | |
parent | 958f7b512cff932f7f2d52d128c297d0f0ab6354 (diff) |
remove uses of COMPARE_*
Change-Id: Icdc36b4b24d2f399f481065df3200feb98025135
36 files changed, 222 insertions, 225 deletions
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index f59653130e06..d5d249eb91f6 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -331,7 +331,8 @@ sal_Int32 compareNatural( const OUString & rLHS, const OUString & rRHS, break; } - //Squeeze these down to -1, 0, 1 in case it gets casted to a StringCompare + //Squeeze these down to -1, 0, 1 in case there is an assumption those are + //the only valid returns if (nRet > 0) nRet = 1; else if (nRet < 0) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 639d5067311a..0e3de536e19e 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -3402,16 +3402,16 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa eLeft = etQueryContainer; if ( eLeft == eRight ) - return COMPARE_EQUAL; + return 0; if ( ( eLeft == etTableContainer ) && ( eRight == etQueryContainer ) ) - return COMPARE_GREATER; + return 1; if ( ( eLeft == etQueryContainer ) && ( eRight == etTableContainer ) ) - return COMPARE_LESS; + return -1; SAL_WARN("dbaccess.ui", "SbaTableQueryBrowser::OnTreeEntryCompare: unexpected case!" ); - return COMPARE_EQUAL; + return 0; } const SvLBoxString* pLeftTextItem = static_cast<const SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); diff --git a/include/svtools/simptabl.hxx b/include/svtools/simptabl.hxx index 1b27463e09df..5b970feaf297 100644 --- a/include/svtools/simptabl.hxx +++ b/include/svtools/simptabl.hxx @@ -83,7 +83,7 @@ protected: virtual void Command( const CommandEvent& rCEvt ); - virtual StringCompare ColCompare(SvTreeListEntry*,SvTreeListEntry*); + virtual sal_Int32 ColCompare(SvTreeListEntry*,SvTreeListEntry*); public: SvSimpleTable(SvSimpleTableContainer& rParent, WinBits nBits = WB_BORDER); diff --git a/include/svtools/treelist.hxx b/include/svtools/treelist.hxx index 220b2f4c7f88..96e50ec3f848 100644 --- a/include/svtools/treelist.hxx +++ b/include/svtools/treelist.hxx @@ -26,7 +26,6 @@ #include <tools/solar.h> #include <tools/link.hxx> -#include <tools/string.hxx> #include <tools/debug.hxx> #include <limits.h> @@ -223,7 +222,7 @@ public: void SetSortMode( SvSortMode eMode ) { eSortMode = eMode; } SvSortMode GetSortMode() const { return eSortMode; } - StringCompare Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const; + sal_Int32 Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const; void SetCompareHdl( const Link& rLink ) { aCompareLink = rLink; } const Link& GetCompareHdl() const { return aCompareLink; } void Resort(); diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx index f3107d9f05a6..b4dfaf0b419b 100644 --- a/include/svx/ctredlin.hxx +++ b/include/svx/ctredlin.hxx @@ -105,7 +105,7 @@ private: protected: - virtual StringCompare ColCompare(SvTreeListEntry*,SvTreeListEntry*); + virtual sal_Int32 ColCompare(SvTreeListEntry*,SvTreeListEntry*); virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind); diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx index 0cecf316bcfc..f87f32826ecb 100644 --- a/sc/inc/userlist.hxx +++ b/sc/inc/userlist.hxx @@ -55,8 +55,8 @@ public: size_t GetSubCount() const; bool GetSubIndex(const OUString& rSubStr, sal_uInt16& rIndex) const; OUString GetSubStr(sal_uInt16 nIndex) const; - StringCompare Compare(const OUString& rSubStr1, const OUString& rSubStr2) const; - StringCompare ICompare(const OUString& rSubStr1, const OUString& rSubStr2) const; + sal_Int32 Compare(const OUString& rSubStr1, const OUString& rSubStr2) const; + sal_Int32 ICompare(const OUString& rSubStr1, const OUString& rSubStr2) const; }; /** diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 3ab133c3ddb7..117f2a096372 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1148,8 +1148,7 @@ bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos ) OUString aUpVal2( aStrVal2 ); if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN ) - if ( ScGlobal::GetCollator()->compareString( aUpVal1, aUpVal2 ) - == COMPARE_GREATER ) + if (ScGlobal::GetCollator()->compareString( aUpVal1, aUpVal2 ) > 0) { // richtige Reihenfolge fuer Wertebereich OUString aTemp( aUpVal1 ); aUpVal1 = aUpVal2; aUpVal2 = aTemp; @@ -1159,11 +1158,11 @@ bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos ) { case SC_COND_EQUAL: bValid = (ScGlobal::GetCollator()->compareString( - rArg, aUpVal1 ) == COMPARE_EQUAL); + rArg, aUpVal1 ) == 0); break; case SC_COND_NOTEQUAL: bValid = (ScGlobal::GetCollator()->compareString( - rArg, aUpVal1 ) != COMPARE_EQUAL); + rArg, aUpVal1 ) != 0); break; case SC_COND_TOP_PERCENT: case SC_COND_BOTTOM_PERCENT: @@ -1197,23 +1196,23 @@ bool ScConditionEntry::IsValidStr( const OUString& rArg, const ScAddress& rPos ) switch ( eOp ) { case SC_COND_GREATER: - bValid = ( nCompare == COMPARE_GREATER ); + bValid = ( nCompare > 0 ); break; case SC_COND_EQGREATER: - bValid = ( nCompare == COMPARE_EQUAL || nCompare == COMPARE_GREATER ); + bValid = ( nCompare >= 0 ); break; case SC_COND_LESS: - bValid = ( nCompare == COMPARE_LESS ); + bValid = ( nCompare < 0 ); break; case SC_COND_EQLESS: - bValid = ( nCompare == COMPARE_EQUAL || nCompare == COMPARE_LESS ); + bValid = ( nCompare <= 0 ); break; case SC_COND_BETWEEN: case SC_COND_NOTBETWEEN: // Test auf NOTBETWEEN: - bValid = ( nCompare == COMPARE_LESS || + bValid = ( nCompare < 0 || ScGlobal::GetCollator()->compareString( rArg, - aUpVal2 ) == COMPARE_GREATER ); + aUpVal2 ) > 0 ); if ( eOp == SC_COND_BETWEEN ) bValid = !bValid; break; diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index 0874b0a5e5c0..21bb8596de8d 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -394,7 +394,7 @@ bool ScFuncDesc::isParameterOptional(sal_uInt32 _nPos) const bool ScFuncDesc::compareByName(const ScFuncDesc* a, const ScFuncDesc* b) { - return (ScGlobal::GetCaseCollator()->compareString(*a->pFuncName, *b->pFuncName ) == COMPARE_LESS); + return (ScGlobal::GetCaseCollator()->compareString(*a->pFuncName, *b->pFuncName ) < 0); } //=================================================================== diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index ee48e0fa36e7..076b302b88a1 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -1393,66 +1393,68 @@ int SAL_CALL ScRangePairList_QsortNameCompare( const void* p1, const void* p2 ) OUString aStr1, aStr2; sal_Int32 nComp; if ( rStartPos1.Tab() == rStartPos2.Tab() ) - nComp = COMPARE_EQUAL; + nComp = 0; else { ps1->pDoc->GetName( rStartPos1.Tab(), aStr1 ); ps2->pDoc->GetName( rStartPos2.Tab(), aStr2 ); nComp = ScGlobal::GetCollator()->compareString( aStr1, aStr2 ); } - switch ( nComp ) + if (nComp < 0) { - case COMPARE_LESS: + return -1; + } + else if (nComp > 0) + { + return 1; + } + else + { + // gleiche Tabs + if ( rStartPos1.Col() < rStartPos2.Col() ) return -1; - //break; - case COMPARE_GREATER: + if ( rStartPos1.Col() > rStartPos2.Col() ) return 1; - //break; - default: - // gleiche Tabs - if ( rStartPos1.Col() < rStartPos2.Col() ) - return -1; - if ( rStartPos1.Col() > rStartPos2.Col() ) - return 1; - // gleiche Cols - if ( rStartPos1.Row() < rStartPos2.Row() ) + // gleiche Cols + if ( rStartPos1.Row() < rStartPos2.Row() ) + return -1; + if ( rStartPos1.Row() > rStartPos2.Row() ) + return 1; + // erste Ecke gleich, zweite Ecke + { + const ScAddress& rEndPos1 = ps1->pPair->GetRange(0).aEnd; + const ScAddress& rEndPos2 = ps2->pPair->GetRange(0).aEnd; + if ( rEndPos1.Tab() == rEndPos2.Tab() ) + nComp = 0; + else + { + ps1->pDoc->GetName( rEndPos1.Tab(), aStr1 ); + ps2->pDoc->GetName( rEndPos2.Tab(), aStr2 ); + nComp = ScGlobal::GetCollator()->compareString( aStr1, aStr2 ); + } + if (nComp < 0) + { return -1; - if ( rStartPos1.Row() > rStartPos2.Row() ) + } + else if (nComp > 0) + { return 1; - // erste Ecke gleich, zweite Ecke + } + else { - const ScAddress& rEndPos1 = ps1->pPair->GetRange(0).aEnd; - const ScAddress& rEndPos2 = ps2->pPair->GetRange(0).aEnd; - if ( rEndPos1.Tab() == rEndPos2.Tab() ) - nComp = COMPARE_EQUAL; - else - { - ps1->pDoc->GetName( rEndPos1.Tab(), aStr1 ); - ps2->pDoc->GetName( rEndPos2.Tab(), aStr2 ); - nComp = ScGlobal::GetCollator()->compareString( aStr1, aStr2 ); - } - switch ( nComp ) - { - case COMPARE_LESS: - return -1; - //break; - case COMPARE_GREATER: - return 1; - //break; - default: - // gleiche Tabs - if ( rEndPos1.Col() < rEndPos2.Col() ) - return -1; - if ( rEndPos1.Col() > rEndPos2.Col() ) - return 1; - // gleiche Cols - if ( rEndPos1.Row() < rEndPos2.Row() ) - return -1; - if ( rEndPos1.Row() > rEndPos2.Row() ) - return 1; - return 0; - } + // gleiche Tabs + if ( rEndPos1.Col() < rEndPos2.Col() ) + return -1; + if ( rEndPos1.Col() > rEndPos2.Col() ) + return 1; + // gleiche Cols + if ( rEndPos1.Row() < rEndPos2.Row() ) + return -1; + if ( rEndPos1.Row() > rEndPos2.Row() ) + return 1; + return 0; } + } } #ifndef _MSC_VER // MSVC is good enough to warn about unreachable code here. // Or stupid enough to bother warning about it, depending diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index 4d5ed081f978..a379e2288d13 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -143,7 +143,7 @@ OUString ScUserListData::GetSubStr(sal_uInt16 nIndex) const return OUString(); } -StringCompare ScUserListData::Compare(const OUString& rSubStr1, const OUString& rSubStr2) const +sal_Int32 ScUserListData::Compare(const OUString& rSubStr1, const OUString& rSubStr2) const { sal_uInt16 nIndex1, nIndex2; bool bFound1 = GetSubIndex(rSubStr1, nIndex1); @@ -153,22 +153,22 @@ StringCompare ScUserListData::Compare(const OUString& rSubStr1, const OUString& if (bFound2) { if (nIndex1 < nIndex2) - return COMPARE_LESS; + return -1; else if (nIndex1 > nIndex2) - return COMPARE_GREATER; + return 1; else - return COMPARE_EQUAL; + return 0; } else - return COMPARE_LESS; + return -1; } else if (bFound2) - return COMPARE_GREATER; + return 1; else - return (StringCompare) ScGlobal::GetCaseTransliteration()->compareString( rSubStr1, rSubStr2 ); + return ScGlobal::GetCaseTransliteration()->compareString( rSubStr1, rSubStr2 ); } -StringCompare ScUserListData::ICompare(const OUString& rSubStr1, const OUString& rSubStr2) const +sal_Int32 ScUserListData::ICompare(const OUString& rSubStr1, const OUString& rSubStr2) const { sal_uInt16 nIndex1, nIndex2; bool bFound1 = GetSubIndex(rSubStr1, nIndex1); @@ -178,19 +178,19 @@ StringCompare ScUserListData::ICompare(const OUString& rSubStr1, const OUString& if (bFound2) { if (nIndex1 < nIndex2) - return COMPARE_LESS; + return -1; else if (nIndex1 > nIndex2) - return COMPARE_GREATER; + return 1; else - return COMPARE_EQUAL; + return 0; } else - return COMPARE_LESS; + return -1; } else if (bFound2) - return COMPARE_GREATER; + return 1; else - return (StringCompare) ScGlobal::GetpTransliteration()->compareString( rSubStr1, rSubStr2 ); + return ScGlobal::GetpTransliteration()->compareString( rSubStr1, rSubStr2 ); } ScUserList::ScUserList() diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 29515505e54d..e08b6922a57f 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -839,7 +839,7 @@ typedef ::std::vector< XclExpTabName > XclExpTabNameVec; inline bool operator<( const XclExpTabName& rArg1, const XclExpTabName& rArg2 ) { // compare the sheet names only - return ScGlobal::GetCollator()->compareString( rArg1.first, rArg2.first ) == COMPARE_LESS; + return ScGlobal::GetCollator()->compareString( rArg1.first, rArg2.first ) < 0; } void XclExpTabInfo::CalcSortedIndexes() diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index f837b42e14d2..3f077d80d4fc 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -1881,7 +1881,7 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, FilterModified) IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData ) { - StringCompare eCompare=COMPARE_EQUAL; + sal_Int32 nCompare = 0; SCCOL nSortCol= static_cast<SCCOL>(pTheView->GetSortedCol()); if(pSortData) @@ -1897,11 +1897,10 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData ) if(pLeftData!=NULL && pRightData!=NULL) { if(pLeftData->aDateTime < pRightData->aDateTime) - eCompare=COMPARE_LESS; + nCompare = -1; else if(pLeftData->aDateTime > pRightData->aDateTime) - eCompare=COMPARE_GREATER; - - return eCompare; + nCompare = 1; + return nCompare; } } else if(CALC_POS==nSortCol) @@ -1911,24 +1910,24 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData ) if(pLeftData!=NULL && pRightData!=NULL) { - eCompare=COMPARE_GREATER; + nCompare = 1; if(pLeftData->nTable < pRightData->nTable) - eCompare=COMPARE_LESS; + nCompare = -1; else if(pLeftData->nTable == pRightData->nTable) { if(pLeftData->nRow < pRightData->nRow) - eCompare=COMPARE_LESS; + nCompare = -1; else if(pLeftData->nRow == pRightData->nRow) { if(pLeftData->nCol < pRightData->nCol) - eCompare=COMPARE_LESS; + nCompare = -1; else if(pLeftData->nCol == pRightData->nCol) - eCompare=COMPARE_EQUAL; + nCompare = 0; } } - return eCompare; + return nCompare; } } @@ -1943,17 +1942,18 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData ) if(nRightKind == SV_ITEM_ID_LBOXSTRING && nLeftKind == SV_ITEM_ID_LBOXSTRING ) { - eCompare= (StringCompare) ScGlobal::GetCaseCollator()->compareString( + nCompare = ScGlobal::GetCaseCollator()->compareString( ((SvLBoxString*)pLeftItem)->GetText(), ((SvLBoxString*)pRightItem)->GetText()); - if(eCompare==COMPARE_EQUAL) eCompare=COMPARE_LESS; + if (nCompare == 0) + nCompare = -1; } } } - return eCompare; + return nCompare; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index b2783de353f3..6488c7b46261 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -51,7 +51,7 @@ struct ScSolverOptionsEntry bool operator< (const ScSolverOptionsEntry& rOther) const { - return ( ScGlobal::GetCollator()->compareString( aDescription, rOther.aDescription ) == COMPARE_LESS ); + return (ScGlobal::GetCollator()->compareString( aDescription, rOther.aDescription ) < 0); } }; diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 13f50b18afe0..86a188842d82 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -979,7 +979,7 @@ OUString ViewShellBase::GetInitialViewShellType (void) for (sal_Int32 n=0; n<aProperties.getLength(); n++) { const beans::PropertyValue& rProperty (aProperties[n]); - if (rProperty.Name.compareToAscii(sUNO_View_PageKind) == COMPARE_EQUAL) + if (rProperty.Name == sUNO_View_PageKind) { sal_Int16 nPageKind = 0; rProperty.Value >>= nPageKind; diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 2f25eec9f03b..f8fa84a60016 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -2053,14 +2053,13 @@ Reference < XDispatch > SAL_CALL SfxAppDispatchProvider::queryDispatch( Reference < XDispatch > xDisp; const SfxSlot* pSlot = 0; SfxDispatcher* pAppDisp = SFX_APP()->GetAppDispatcher_Impl(); - if ( aURL.Protocol.compareToAscii( "slot:" ) == COMPARE_EQUAL || - aURL.Protocol.compareToAscii( "commandId:" ) == COMPARE_EQUAL ) + if ( aURL.Protocol == "slot:" || aURL.Protocol == "commandId:" ) { nId = (sal_uInt16) aURL.Path.toInt32(); SfxShell* pShell; pAppDisp->GetShellAndSlot_Impl( nId, &pShell, &pSlot, sal_True, sal_True ); } - else if ( aURL.Protocol.compareToAscii( ".uno:" ) == COMPARE_EQUAL ) + else if ( aURL.Protocol == ".uno:" ) { // Support ".uno" commands. Map commands to slotid bMasterCommand = SfxOfficeDispatch::IsMasterUnoCommand( aURL ); diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index d0948c164ec1..bafa7c2c4038 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -344,7 +344,7 @@ void ShutdownIcon::FromTemplate() Reference < ::com::sun::star::frame::XDispatch > xDisp; if ( xProv.is() ) { - if ( aTargetURL.Protocol.compareToAscii("slot:") == COMPARE_EQUAL ) + if (aTargetURL.Protocol == "slot:") xDisp = xProv->queryDispatch( aTargetURL, OUString(), 0 ); else xDisp = xProv->queryDispatch( aTargetURL, OUString("_blank"), 0 ); diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 3d067e28ed3e..0c0869c1105b 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -635,8 +635,8 @@ sal_Bool StyleTreeListBox_Impl::NotifyMoving(SvTreeListEntry* pTarget, IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() ); const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator(); for(SvTreeListEntry *pTmpEntry=FirstChild(pTarget); - pTmpEntry && COMPARE_LESS==pCollator->compareString( - GetEntryText(pTmpEntry),GetEntryText(pEntry)); + pTmpEntry && pCollator->compareString( + GetEntryText(pTmpEntry),GetEntryText(pEntry)) < 0; pTmpEntry=NextSibling(pTmpEntry),lPos++) ; return bRet? (sal_Bool)2: sal_False; diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index b426eb8e5753..165c680b6f31 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2183,7 +2183,7 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) for ( sal_Int32 nFilterProp = 0; nFilterProp<nFilterProps; nFilterProp++ ) { const beans::PropertyValue& rFilterProp = aProps[nFilterProp]; - if ( rFilterProp.Name.compareToAscii("FilterService") == COMPARE_EQUAL ) + if (rFilterProp.Name == "FilterService") { rFilterProp.Value >>= aFilterImplName; break; @@ -2312,7 +2312,7 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) for ( sal_Int32 nFilterProp = 0; nFilterProp<nFilterProps; nFilterProp++ ) { const beans::PropertyValue& rFilterProp = aProps[nFilterProp]; - if ( rFilterProp.Name.compareToAscii("FilterService") == COMPARE_EQUAL ) + if (rFilterProp.Name == "FilterService") { rFilterProp.Value >>= aFilterImplName; break; @@ -3313,7 +3313,7 @@ sal_Bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed:: // TODO/LATER: there should be a way to detect whether an object with such a MediaType can exist // probably it should be placed in the MimeType-ClassID table or in standalone table if ( !aMediaType.isEmpty() - && aMediaType.compareToAscii( "application/vnd.sun.star.oleobject" ) != COMPARE_EQUAL ) + && aMediaType != "application/vnd.sun.star.oleobject" ) { ::com::sun::star::datatransfer::DataFlavor aDataFlavor; aDataFlavor.MimeType = aMediaType; @@ -3455,7 +3455,7 @@ sal_Bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< e // TODO/LATER: there should be a way to detect whether an object with such a MediaType can exist // probably it should be placed in the MimeType-ClassID table or in standalone table if ( !aMediaType.isEmpty() - && aMediaType.compareToAscii( "application/vnd.sun.star.oleobject" ) != COMPARE_EQUAL ) + && aMediaType != "application/vnd.sun.star.oleobject" ) { ::com::sun::star::datatransfer::DataFlavor aDataFlavor; aDataFlavor.MimeType = aMediaType; diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index 5b3f08447c9b..962a67ad7fc5 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -427,7 +427,7 @@ long Select_Impl( void* /*pHdl*/, void* pVoid ) xTrans->parseStrict( aTargetURL ); Reference < XDispatch > xDisp; - if ( aTargetURL.Protocol.compareToAscii("slot:") == COMPARE_EQUAL ) + if (aTargetURL.Protocol == "slot:") xDisp = xDesktop->queryDispatch( aTargetURL, OUString(), 0 ); else { diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index a03c882d8d2e..929343a11ff9 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1874,7 +1874,7 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter ) } if ( !bHideTransFile && - ( rFilter.isEmpty() || ( rFilter.compareToAscii( ALL_FILES_FILTER ) == COMPARE_EQUAL ) ) ) + ( rFilter.isEmpty() || ( rFilter == ALL_FILES_FILTER ) ) ) // when replacing names, there is always something to filter (no view of ".nametranslation.table") return; diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx index 8070d9ccef7f..4beba6c25833 100644 --- a/svtools/source/contnr/simptabl.cxx +++ b/svtools/source/contnr/simptabl.cxx @@ -445,9 +445,9 @@ SvLBoxItem* SvSimpleTable::GetEntryAtPos( SvTreeListEntry* pEntry, sal_uInt16 nP return pItem; } -StringCompare SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight) +sal_Int32 SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight) { - StringCompare eCompare=COMPARE_EQUAL; + sal_Int32 nCompare = 0; SvLBoxItem* pLeftItem = GetEntryAtPos( pLeft, nSortCol); SvLBoxItem* pRightItem = GetEntryAtPos( pRight, nSortCol); @@ -464,13 +464,14 @@ StringCompare SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() ); const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator(); - eCompare=(StringCompare)pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(), + nCompare = pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(), ((SvLBoxString*)pRightItem)->GetText()); - if(eCompare==COMPARE_EQUAL) eCompare=COMPARE_LESS; + if (nCompare == 0) + nCompare = -1; } } - return eCompare; + return nCompare; } IMPL_LINK( SvSimpleTable, CompareHdl, SvSortData*, pData) diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index 55beae96826a..8500425ce82d 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -1498,16 +1498,16 @@ SvViewDataEntry* SvListView::GetViewData( SvTreeListEntry* pEntry ) return itr->second; } -StringCompare SvTreeList::Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const +sal_Int32 SvTreeList::Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const { if( aCompareLink.IsSet()) { SvSortData aSortData; aSortData.pLeft = pLeft; aSortData.pRight = pRight; - return (StringCompare)aCompareLink.Call( &aSortData ); + return aCompareLink.Call( &aSortData ); } - return COMPARE_EQUAL; + return 0; } void SvTreeList::Resort() @@ -1576,27 +1576,27 @@ void SvTreeList::GetInsertionPos( SvTreeListEntry* pEntry, SvTreeListEntry* pPar long i = 0; long j = rChildList.size()-1; long k; - StringCompare eCompare = COMPARE_GREATER; + sal_Int32 nCompare = 1; do { k = (i+j)/2; const SvTreeListEntry* pTempEntry = &rChildList[k]; - eCompare = Compare( pEntry, pTempEntry ); - if( eSortMode == SortDescending && eCompare != COMPARE_EQUAL ) + nCompare = Compare( pEntry, pTempEntry ); + if( eSortMode == SortDescending && nCompare != 0 ) { - if( eCompare == COMPARE_LESS ) - eCompare = COMPARE_GREATER; + if( nCompare < 0 ) + nCompare = 1; else - eCompare = COMPARE_LESS; + nCompare = -1; } - if( eCompare == COMPARE_GREATER ) + if( nCompare > 0 ) i = k + 1; else j = k - 1; - } while( (eCompare != COMPARE_EQUAL) && (i <= j) ); + } while( (nCompare != 0) && (i <= j) ); - if( eCompare != COMPARE_EQUAL ) + if( nCompare != 0 ) { if (i > static_cast<long>(rChildList.size()-1)) // not found, end of list rPos = ULONG_MAX; diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx index af0f2f9b6eaa..4f8fc91e5d6c 100644 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -128,18 +128,18 @@ static sal_Int32 ImplCompareFontInfo( ImplFontListFontInfo* pInfo1, { //Sort non italic before italics if ( pInfo1->GetItalic() < pInfo2->GetItalic() ) - return COMPARE_LESS; + return -1; else if ( pInfo1->GetItalic() > pInfo2->GetItalic() ) - return COMPARE_GREATER; + return 1; //Sort normal weight to the start, followed by lightest to heaviest weights int nWeight1 = sortWeightValue(pInfo1->GetWeight()); int nWeight2 = sortWeightValue(pInfo2->GetWeight()); if ( nWeight1 < nWeight2 ) - return COMPARE_LESS; + return -1; else if ( nWeight1 > nWeight2 ) - return COMPARE_GREATER; + return 1; return pInfo1->GetStyleName().compareTo( pInfo2->GetStyleName() ); } diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 16594c1f4706..ea051c7446e3 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -366,15 +366,15 @@ uno::Reference< beans::XPropertySet > SAL_CALL GraphicProvider::queryGraphicDesc const OUString aName( rMediaProperties[ i ].Name ); const uno::Any aValue( rMediaProperties[ i ].Value ); - if( COMPARE_EQUAL == aName.compareToAscii( "URL" ) ) + if (aName == "URL") { aValue >>= aURL; } - else if( COMPARE_EQUAL == aName.compareToAscii( "InputStream" ) ) + else if (aName == "InputStream") { aValue >>= xIStm; } - else if( COMPARE_EQUAL == aName.compareToAscii( "Bitmap" ) ) + else if (aName == "Bitmap") { aValue >>= xBtm; } @@ -442,21 +442,21 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co const OUString aName( rMediaProperties[ i ].Name ); const uno::Any aValue( rMediaProperties[ i ].Value ); - if( COMPARE_EQUAL == aName.compareToAscii( "URL" ) ) + if (aName == "URL") { OUString aURL; aValue >>= aURL; aPath = aURL; } - else if( COMPARE_EQUAL == aName.compareToAscii( "InputStream" ) ) + else if (aName == "InputStream") { aValue >>= xIStm; } - else if( COMPARE_EQUAL == aName.compareToAscii( "Bitmap" ) ) + else if (aName == "Bitmap") { aValue >>= xBtm; } - else if( COMPARE_EQUAL == aName.compareToAscii( "FilterData" ) ) + else if (aName == "FilterData") { aValue >>= aFilterData; } @@ -471,15 +471,15 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co const OUString aName( aFilterData[ i ].Name ); const uno::Any aValue( aFilterData[ i ].Value ); - if( COMPARE_EQUAL == aName.compareToAscii( "ExternalWidth" ) ) + if (aName == "ExternalWidth") { aValue >>= nExtWidth; } - else if( COMPARE_EQUAL == aName.compareToAscii( "ExternalHeight" ) ) + else if (aName == "ExternalHeight") { aValue >>= nExtHeight; } - else if( COMPARE_EQUAL == aName.compareToAscii( "ExternalMapMode" ) ) + else if (aName == "ExternalMapMode") { aValue >>= nExtMapMode; } @@ -646,17 +646,17 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal const OUString aName( rFilterData[ i ].Name ); const uno::Any aValue( rFilterData[ i ].Value ); - if( COMPARE_EQUAL == aName.compareToAscii( "PixelWidth" ) ) + if (aName == "PixelWidth") aValue >>= nPixelWidth; - else if( COMPARE_EQUAL == aName.compareToAscii( "PixelHeight" ) ) + else if (aName == "PixelHeight") aValue >>= nPixelHeight; - else if( COMPARE_EQUAL == aName.compareToAscii( "LogicalSize" ) ) + else if (aName == "LogicalSize") aValue >>= aLogicalSize; - else if (COMPARE_EQUAL == aName.compareToAscii( "GraphicCropLogic" ) ) + else if (aName == "GraphicCropLogic") aValue >>= aCropLogic; - else if (COMPARE_EQUAL == aName.compareToAscii( "RemoveCropArea" ) ) + else if (aName == "RemoveCropArea") aValue >>= bRemoveCropArea; - else if (COMPARE_EQUAL == aName.compareToAscii( "ImageResolution" ) ) + else if (aName == "ImageResolution") aValue >>= nImageResolution; } if ( rGraphic.GetType() == GRAPHIC_BITMAP ) @@ -784,7 +784,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG const OUString aName( rMediaProperties[ i ].Name ); const uno::Any aValue( rMediaProperties[ i ].Value ); - if( COMPARE_EQUAL == aName.compareToAscii( "URL" ) ) + if (aName == "URL") { OUString aURL; @@ -792,7 +792,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG pOStm = ::utl::UcbStreamHelper::CreateStream( aURL, STREAM_WRITE | STREAM_TRUNC ); aPath = aURL; } - else if( COMPARE_EQUAL == aName.compareToAscii( "OutputStream" ) ) + else if (aName == "OutputStream") { uno::Reference< io::XStream > xOStm; @@ -813,51 +813,51 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG const OUString aName( rMediaProperties[ i ].Name ); const uno::Any aValue( rMediaProperties[ i ].Value ); - if( COMPARE_EQUAL == aName.compareToAscii( "FilterData" ) ) + if (aName == "FilterData") { aValue >>= aFilterDataSeq; } - else if( COMPARE_EQUAL == aName.compareToAscii( "MimeType" ) ) + else if (aName == "MimeType") { OUString aMimeType; aValue >>= aMimeType; - if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_BMP ) ) + if (aMimeType == MIMETYPE_BMP) pFilterShortName = "bmp"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_EPS ) ) + else if (aMimeType == MIMETYPE_EPS) pFilterShortName = "eps"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_GIF ) ) + else if (aMimeType == MIMETYPE_GIF) pFilterShortName = "gif"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_JPG ) ) + else if (aMimeType == MIMETYPE_JPG) pFilterShortName = "jpg"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_MET ) ) + else if (aMimeType == MIMETYPE_MET) pFilterShortName = "met"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PNG ) ) + else if (aMimeType == MIMETYPE_PNG) pFilterShortName = "png"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PCT ) ) + else if (aMimeType == MIMETYPE_PCT) pFilterShortName = "pct"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PBM ) ) + else if (aMimeType == MIMETYPE_PBM) pFilterShortName = "pbm"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PGM ) ) + else if (aMimeType == MIMETYPE_PGM) pFilterShortName = "pgm"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_PPM ) ) + else if (aMimeType == MIMETYPE_PPM) pFilterShortName = "ppm"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_RAS ) ) + else if (aMimeType == MIMETYPE_RAS) pFilterShortName = "ras"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_SVM ) ) + else if (aMimeType == MIMETYPE_SVM) pFilterShortName = "svm"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_TIF ) ) + else if (aMimeType == MIMETYPE_TIF) pFilterShortName = "tif"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_EMF ) ) + else if (aMimeType == MIMETYPE_EMF) pFilterShortName = "emf"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_WMF ) ) + else if (aMimeType == MIMETYPE_WMF) pFilterShortName = "wmf"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_XPM ) ) + else if (aMimeType == MIMETYPE_XPM) pFilterShortName = "xpm"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_SVG ) ) + else if (aMimeType == MIMETYPE_SVG) pFilterShortName = "svg"; - else if( COMPARE_EQUAL == aMimeType.compareToAscii( MIMETYPE_VCLGRAPHIC ) ) + else if (aMimeType == MIMETYPE_VCLGRAPHIC) pFilterShortName = MIMETYPE_VCLGRAPHIC; } } diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index b9f78c19a38a..781980d62095 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -236,7 +236,7 @@ static OUString GetImageExtensionByFactory_Impl( const OUString& rURL ) for ( sal_Int32 i = 0; i < nProps; ++i ) { const ::com::sun::star::beans::PropertyValue& rProp = aTypeProps[i]; - if ( rProp.Name.compareToAscii("Extensions") == COMPARE_EQUAL ) + if (rProp.Name == "Extensions") { ::com::sun::star::uno::Sequence < OUString > aExtensions; if ( ( rProp.Value >>= aExtensions ) && aExtensions.getLength() > 0 ) diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 082421eb4997..254dad624d08 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -148,16 +148,16 @@ SvxRedlinTable::~SvxRedlinTable() delete pCommentSearcher; } -StringCompare SvxRedlinTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight) +sal_Int32 SvxRedlinTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight) { - StringCompare eCompare=COMPARE_EQUAL; + sal_Int32 nCompare = 0; if(aColCompareLink.IsSet()) { SvSortData aRedlinCompare; aRedlinCompare.pLeft=pLeft; aRedlinCompare.pRight=pRight; - eCompare=(StringCompare) aColCompareLink.Call(&aRedlinCompare); + nCompare = aColCompareLink.Call(&aRedlinCompare); } else { @@ -170,24 +170,24 @@ StringCompare SvxRedlinTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* { if(pLeftData->aDateTime < pRightData->aDateTime) { - eCompare=COMPARE_LESS; + nCompare = -1; } else if(pLeftData->aDateTime > pRightData->aDateTime) { - eCompare=COMPARE_GREATER; + nCompare = 1; } } else - eCompare=SvSimpleTable::ColCompare(pLeft,pRight); + nCompare = SvSimpleTable::ColCompare(pLeft,pRight); } else { - eCompare=SvSimpleTable::ColCompare(pLeft,pRight); + nCompare = SvSimpleTable::ColCompare(pLeft,pRight); } } - return eCompare; + return nCompare; } void SvxRedlinTable::SetCalcView(sal_Bool bFlag) { diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 52a531ca8424..2a1cd955cdd7 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -425,7 +425,7 @@ namespace const OUString* pMethodsNames = aMethodsNames.getConstArray(); for (k=0; k<aMethodsNames.getLength(); ++k, ++pMethodsNames) { - if ((*pMethodsNames).compareTo(pCurrent->EventMethod) != COMPARE_EQUAL) + if ((*pMethodsNames) != pCurrent->EventMethod) // the current ScriptEventDescriptor doesn't match the current listeners current method continue; diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 54af4a1c1b10..da61e05cdf57 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -370,7 +370,7 @@ sal_uInt16 BulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLe { if ( (cChar == pActualBullets[i]->cBulletChar|| (cChar == 9830 && 57356 == pActualBullets[i]->cBulletChar) || - (cChar == 9632 && 57354 == pActualBullets[i]->cBulletChar)))// && pFont && (pFont->GetName().CompareTo(pActualBullets[i]->aFont.GetName())==COMPARE_EQUAL)) + (cChar == 9632 && 57354 == pActualBullets[i]->cBulletChar))) { return i+1; } @@ -638,13 +638,12 @@ sal_uInt16 GraphyicBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uI if ( pGrf ) { - //const String* pGrfName = pBrsh->GetGraphicLink(); Graphic aGraphic; for (sal_uInt16 i=0; i < aGrfDataLst.size(); ++i) { GrfBulDataRelation* pEntry = aGrfDataLst[i]; sal_Bool bExist = sal_False; - if ( pEntry) // && pEntry->sGrfName.CompareTo(*pGrfName)==COMPARE_EQUAL ) + if ( pEntry) bExist = GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, pEntry->nGallaryIndex,&aGraphic); if (bExist) { Bitmap aSum=pGrf->GetBitmap(); @@ -988,7 +987,6 @@ sal_uInt16 MixBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 if ( (cChar == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar|| (cChar == 9830 && 57356 == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar) || (cChar == 9632 && 57354 == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar)))//&& - //(pFont && pFont->GetName().CompareTo(((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->aFont.GetName())==COMPARE_EQUAL) ) { return pActualBullets[i]->nIndex; } @@ -1016,8 +1014,7 @@ sal_uInt16 MixBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 { return pActualBullets[i]->nIndex; } - }else { //if ( pEntry && pGrfName && pEntry->sGrfName.CompareTo(*pGrfName)==COMPARE_EQUAL ) - //bExist = GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, pActualBullets[i]->nIndexDefault-1,pSrGrf); + }else { Graphic aSrGrf; if (pEntry) GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, pActualBullets[i]->nIndexDefault,&aSrGrf); diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index 301acda9aaa1..5f2d1388d906 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -372,9 +372,9 @@ IMPL_LINK( DictionaryList, CompareHdl, SvSortData*, pData ) return (long) ColumnCompare(pLeft,pRight); } -StringCompare DictionaryList::ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight ) +sal_Int32 DictionaryList::ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight ) { - StringCompare eCompare=COMPARE_EQUAL; + sal_Int32 nCompare = 0; SvLBoxItem* pLeftItem = getItemAtColumn( pLeft, m_nSortColumnIndex ); SvLBoxItem* pRightItem = getItemAtColumn( pRight, m_nSortColumnIndex ); @@ -390,14 +390,14 @@ StringCompare DictionaryList::ColumnCompare( SvTreeListEntry* pLeft, SvTreeListE IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() ); const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator(); - eCompare=(StringCompare)pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(), + nCompare = pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(), ((SvLBoxString*)pRightItem)->GetText()); - if(eCompare==COMPARE_EQUAL) - eCompare=COMPARE_LESS; + if (nCompare == 0) + nCompare = -1; } } - return eCompare; + return nCompare; } SvLBoxItem* DictionaryList::getItemAtColumn( SvTreeListEntry* pEntry, sal_uInt16 nColumn ) const diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx index ac645eb7faf1..7d76e36974aa 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx @@ -99,7 +99,7 @@ private: OUString makeTabString( const DictionaryEntry& rEntry ) const; DECL_LINK( CompareHdl, SvSortData* ); - StringCompare ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight ); + sal_Int32 ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry* pRight ); SvLBoxItem* getItemAtColumn( SvTreeListEntry* pEntry, sal_uInt16 nColumn ) const; public: diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 7dbf55092221..0705a1c25604 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -512,7 +512,7 @@ sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName) sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]); for(sal_uInt16 i = 0; i < nEntries; i++ ) { - if( COMPARE_EQUAL == rServiceName.compareToAscii(aProvNamesId[i].pName)) + if (rServiceName.equalsAscii(aProvNamesId[i].pName)) return aProvNamesId[i].nType; } return SW_SERVICE_INVALID; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index b382b2e75518..a76c20d03183 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -2132,7 +2132,7 @@ OUString SwXShape::getImplementationName(void) throw( uno::RuntimeException ) sal_Bool SwXShape::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { sal_Bool bRet = sal_False; - if(COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.drawing.Shape")) + if (rServiceName == "com.sun.star.drawing.Shape") bRet = sal_True; else if(xShapeAgg.is()) { diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 7af7f7ccb6da..713f299c64f7 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2755,9 +2755,9 @@ OUString SwXTextFrame::getImplementationName(void) throw( uno::RuntimeException sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { - return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.Text")|| - COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextFrame")|| - SwXFrame::supportsService(rServiceName); + return rServiceName == "com.sun.star.text.Text" || + rServiceName == "com.sun.star.text.TextFrame" || + SwXFrame::supportsService(rServiceName); } uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( uno::RuntimeException ) @@ -2917,8 +2917,8 @@ OUString SwXTextGraphicObject::getImplementationName(void) throw( uno::RuntimeEx sal_Bool SwXTextGraphicObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { - return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextGraphicObject") || - SwXFrame::supportsService(rServiceName); + return rServiceName == "com.sun.star.text.TextGraphicObject" || + SwXFrame::supportsService(rServiceName); } uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void) @@ -3178,8 +3178,8 @@ OUString SwXTextEmbeddedObject::getImplementationName(void) throw( uno::RuntimeE sal_Bool SwXTextEmbeddedObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { - return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextEmbeddedObject")|| - SwXFrame::supportsService(rServiceName); + return rServiceName == "com.sun.star.text.TextEmbeddedObject" || + SwXFrame::supportsService(rServiceName); } uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void) diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index e5d532472abd..cea2d9e26b84 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1655,11 +1655,11 @@ void SwXNumberingRules::SetNumberingRuleByIndex( bExcept = true; for(sal_uInt16 j = 0; j < SAL_N_ELEMENTS( aNumPropertyNames ); j++) { - if( pDocShell && j >= NotInChapterFirst && j <= NotInChapterLast ) + if (pDocShell && j >= NotInChapterFirst && j <= NotInChapterLast) continue; - if( !pDocShell && j >= InChapterFirst && j <= InChapterLast ) + if (!pDocShell && j >= InChapterFirst && j <= InChapterLast) continue; - if(COMPARE_EQUAL == rProp.Name.compareToAscii(aNumPropertyNames[j])) + if (rProp.Name.equalsAscii(aNumPropertyNames[j])) { bExcept = false; break; diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx index dbe1365abc43..f31c3dd1d21a 100644 --- a/sw/source/ui/dbui/dbtree.cxx +++ b/sw/source/ui/dbui/dbtree.cxx @@ -404,7 +404,7 @@ IMPL_LINK( SwDBTreeList, DBCompare, SvSortData*, pData ) SvTreeListEntry* pRight = (SvTreeListEntry*)(pData->pRight ); if (GetParent(pRight) && GetParent(GetParent(pRight))) - return COMPARE_GREATER; // don't sort column names + return 1; // don't sort column names return DefaultCompare(pData); // otherwise call base class } diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 96ad632d8064..a9de9725edfe 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -691,41 +691,40 @@ sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther ) { // compare their width, weight, italic and style name if( GetWidthType() < rOther.GetWidthType() ) - return COMPARE_LESS; + return -1; else if( GetWidthType() > rOther.GetWidthType() ) - return COMPARE_GREATER; + return 1; if( GetWeight() < rOther.GetWeight() ) - return COMPARE_LESS; + return -1; else if( GetWeight() > rOther.GetWeight() ) - return COMPARE_GREATER; + return 1; if( GetSlant() < rOther.GetSlant() ) - return COMPARE_LESS; + return -1; else if( GetSlant() > rOther.GetSlant() ) - return COMPARE_GREATER; + return 1; - sal_Int32 eCompare = GetFamilyName().compareTo( rOther.GetFamilyName() ); - return eCompare; + return GetFamilyName().compareTo( rOther.GetFamilyName() ); } sal_Int32 PhysicalFontFace::CompareWithSize( const PhysicalFontFace& rOther ) const { - sal_Int32 eCompare = CompareIgnoreSize( rOther ); - if( eCompare != COMPARE_EQUAL ) - return eCompare; + sal_Int32 nCompare = CompareIgnoreSize( rOther ); + if (nCompare != 0) + return nCompare; if( mnHeight < rOther.mnHeight ) - return COMPARE_LESS; + return -1; else if( mnHeight > rOther.mnHeight ) - return COMPARE_GREATER; + return 1; if( mnWidth < rOther.mnWidth ) - return COMPARE_LESS; + return -1; else if( mnWidth > rOther.mnWidth ) - return COMPARE_GREATER; + return 1; - return COMPARE_EQUAL; + return 0; } struct FontMatchStatus @@ -1030,9 +1029,9 @@ bool ImplDevFontListData::AddFontFace( PhysicalFontFace* pNewData ) for(; (pData=*ppHere) != NULL; ppHere=&pData->mpNext ) { sal_Int32 eComp = pNewData->CompareWithSize( *pData ); - if( eComp == COMPARE_GREATER ) + if( eComp > 0 ) continue; - if( eComp == COMPARE_LESS ) + if( eComp < 0 ) break; // ignore duplicate if its quality is worse |