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 /svtools | |
parent | 958f7b512cff932f7f2d52d128c297d0f0ab6354 (diff) |
remove uses of COMPARE_*
Change-Id: Icdc36b4b24d2f399f481065df3200feb98025135
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/fileview.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/simptabl.cxx | 11 | ||||
-rw-r--r-- | svtools/source/contnr/treelist.cxx | 24 | ||||
-rw-r--r-- | svtools/source/control/ctrltool.cxx | 8 | ||||
-rw-r--r-- | svtools/source/graphic/provider.cxx | 76 | ||||
-rw-r--r-- | svtools/source/misc/imagemgr.cxx | 2 |
6 files changed, 62 insertions, 61 deletions
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 ) |