[Libreoffice-commits] core.git: sw/source

Mike Kaganski mike.kaganski at collabora.com
Sat May 19 01:39:39 UTC 2018


 sw/source/core/doc/DocumentFieldsManager.cxx |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 1462bdc3abe60cee43cf6064663d646adbf13894
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Fri May 18 07:23:56 2018 +0100

    Don't do the string operation needlessly
    
    Change-Id: Ic5831e56d4528dcc1ad78e00569ad1d58272aeeb
    Reviewed-on: https://gerrit.libreoffice.org/54514
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index f6bd75d036a4..b4b3c0b32d80 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -279,15 +279,17 @@ SwFieldType* DocumentFieldsManager::GetFieldType(
     {
         SwFieldType* pFieldType = (*mpFieldTypes)[i];
 
-        OUString aFieldName( pFieldType->GetName() );
-        if (bDbFieldMatching && nResId == SwFieldIds::Database)    // #i51815#
-            aFieldName = aFieldName.replace(DB_DELIM, '.');
-
-        if( nResId == pFieldType->Which() &&
-            rSCmp.isEqual( rName, aFieldName ))
+        if (nResId == pFieldType->Which())
         {
-            pRet = pFieldType;
-            break;
+            OUString aFieldName( pFieldType->GetName() );
+            if (bDbFieldMatching && nResId == SwFieldIds::Database)    // #i51815#
+                aFieldName = aFieldName.replace(DB_DELIM, '.');
+
+            if (rSCmp.isEqual( rName, aFieldName ))
+            {
+                pRet = pFieldType;
+                break;
+            }
         }
     }
     return pRet;


More information about the Libreoffice-commits mailing list