[Libreoffice-commits] core.git: cui/source drawinglayer/source forms/source package/source svtools/source svx/source

Muhammet Kara muhammet.kara at pardus.org.tr
Sun Oct 1 13:58:46 UTC 2017


 cui/source/tabpages/numpages.cxx             |    3 +--
 drawinglayer/source/tools/emfphelperdata.cxx |    4 ++--
 forms/source/component/Filter.cxx            |    4 ++--
 package/source/xstor/xstorage.cxx            |    2 +-
 svtools/source/control/inettbc.cxx           |    2 +-
 svx/source/sidebar/nbdtmg.cxx                |    2 +-
 6 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 50da5d0d1c5bdfbb9a2006e77a02519d0f39740f
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date:   Sat Sep 30 21:52:24 2017 +0000

    simplify some OUString compareTo calls
    
    to either startsWith or == or !=
    
    Change-Id: I595dd9d89d32134827980c4ba10f88584430137d
    Reviewed-on: https://gerrit.libreoffice.org/42988
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 4327294ba998..f8e41abbd2e4 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -712,8 +712,7 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
                 aFmt.SetPrefix(OUString());
                 aFmt.SetSuffix(OUString());
                 if( !pLevelSettings->sBulletFont.isEmpty() &&
-                    pLevelSettings->sBulletFont.compareTo(
-                            rActBulletFont.GetFamilyName()))
+                    pLevelSettings->sBulletFont != rActBulletFont.GetFamilyName())
                 {
                     //search for the font
                     if(!pList)
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 513b8fbce930..419cd778f7be 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -1225,7 +1225,7 @@ namespace emfplushelper
                                 font->family,                                    // font family
                                 emptyString,                                     // (no) font style
                                 font->Bold() ? 8u : 1u,                          // weight: 8 = bold
-                                font->family.compareTo("SYMBOL") == 0, // symbol
+                                font->family == "SYMBOL",                        // symbol
                                 stringFormat->DirectionVertical(),               // vertical
                                 font->Italic(),                                  // italic
                                 false,                                           // monospaced
@@ -1617,7 +1617,7 @@ namespace emfplushelper
                                 font->family,                                    // font family
                                 emptyString,                                     // (no) font style
                                 font->Bold() ? 8u : 1u,                          // weight: 8 = bold
-                                font->family.compareTo("SYMBOL") == 0,           // symbol
+                                font->family == "SYMBOL",                        // symbol
                                 optionFlags & 0x2,                               // vertical
                                 font->Italic(),                                  // italic
                                 false,                                           // monospaced
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx
index 414760b7573e..2e8f6df84ea3 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -355,7 +355,7 @@ namespace frm
         }
 
         OUString sText( aText.makeStringAndClear() );
-        if ( m_aText.compareTo( sText ) )
+        if ( m_aText != sText )
         {
             m_aText = sText;
             TextEvent aEvt;
@@ -513,7 +513,7 @@ namespace frm
             default:
                 return true;
         }
-        if (m_aText.compareTo(aText))
+        if ( m_aText != aText )
         {
             // check the text with the SQL-Parser
             OUString aNewText(aText);
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 3821c7488b70..9eab732a8d4f 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -1092,7 +1092,7 @@ void OStorage_Impl::Commit()
                 uno::Any aPackageElement = m_xPackageFolder->getByName( (*pElementIter)->m_aOriginalName );
                 xNewPackageFolder->insertByName( (*pElementIter)->m_aName, aPackageElement );
             }
-            else if ( (*pElementIter)->m_aName.compareTo( (*pElementIter)->m_aOriginalName ) )
+            else if ( (*pElementIter)->m_aName != (*pElementIter)->m_aOriginalName )
             {
                 // this is the case when xNewPackageFolder refers to m_xPackageFolder
                 // in case the name was changed and it is not a changed storage - rename the element
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 7ca9f391471c..0db56b44794b 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -407,7 +407,7 @@ void SvtMatchContext_Impl::ReadFolder( const OUString& rURL,
                     if (
                         !nMatchLen ||
                         (bExectMatch && aMatchName == aTitle) ||
-                        (!bExectMatch && aMatchName.compareTo(aTitle, nMatchLen) == 0)
+                        (!bExectMatch && aTitle.startsWith(aMatchName))
                        )
                     {
                         // all names fit if matchstring is empty
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index df87e2242620..629f4ba26523 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -793,7 +793,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1
         if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL)
         {
             if( pLevelSettings->sBulletFont.getLength() &&
-                pLevelSettings->sBulletFont.compareTo(rActBulletFont.GetFamilyName()))
+                pLevelSettings->sBulletFont != rActBulletFont.GetFamilyName() )
             {
                 //search for the font
                 if(!pList)


More information about the Libreoffice-commits mailing list