sw/source/filter/ww8/ww8atr.cxx                   |   10 +---------
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   13 +++++++------
 2 files changed, 8 insertions(+), 15 deletions(-)

New commits:
commit 4794d48c8377f1d5942010f2af1b8902ff49fb7a
Author:     Justin Luth <[email protected]>
AuthorDate: Sat Mar 12 09:32:20 2022 +0200
Commit:     Miklos Vajna <[email protected]>
CommitDate: Fri Apr 1 14:09:46 2022 +0200

    related tdf#147861: cleanup + a function provides the name
    
    This is not quite a NonFunctionalChange because it avoids
    adding " (fixed)" to the name. But that is what I want
    anyway for bug 147861, so this is an all-around good simplification.
    
    Plus, the writerfilter loop doesn't need to run if an
    inside clause will never be true anyway.
    
    Putting this cleanup separately helps highlight the
    actual fix and not clutter the real patches.
    
    (cherry picked from commit a13faccd7e8c6503e96e9342a8615b4542b0601f)
    
    Change-Id: I12f345cc92627398ad00fe32b64b98b54e5ed14b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132397
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Miklos Vajna <[email protected]>

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index a7fccf6d6733..4dba4eaed63e 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2970,15 +2970,7 @@ void AttributeOutputBase::TextField( const 
SwFormatField& rField )
                         dynamic_cast<const SwDocInfoField *> (pField);
 
                         if (pDocInfoField != nullptr)
-                        {
-                            OUString sFieldname = 
pDocInfoField->GetFieldName();
-
-                            const sal_Int32 nIndex = sFieldname.indexOf(':');
-                            if (nIndex >= 0)
-                                sFieldname = sFieldname.copy(nIndex + 1);
-
-                            sStr = "\"" + sFieldname + "\"";
-                        }
+                            sStr = "\"" + pDocInfoField->GetName() + "\"";
                     }
                     break;
                 default:
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 8ab4e9b65235..df943fb1dda7 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5345,14 +5345,15 @@ void DomainMapper_Impl::handleAuthor
     //search for a field mapping
     OUString sFieldServiceName;
     size_t nMap = 0;
-    for( ; nMap < SAL_N_ELEMENTS(aDocProperties); ++nMap )
+    if (!xPropertySetInfo->hasPropertyByName(rFirstParam))
     {
-        if ((rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName)) 
&& (!xPropertySetInfo->hasPropertyByName(rFirstParam)))
+        for( ; nMap < SAL_N_ELEMENTS(aDocProperties); ++nMap )
         {
-            sFieldServiceName =
-            OUString::createFromAscii
-            (aDocProperties[nMap].pServiceName);
-            break;
+            if (rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName))
+            {
+                sFieldServiceName = 
OUString::createFromAscii(aDocProperties[nMap].pServiceName);
+                break;
+            }
         }
     }
     OUString sServiceName("com.sun.star.text.TextField.");

Reply via email to