sw/source/filter/ww8/docxattributeoutput.cxx |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

New commits:
commit d71323b29cdf9714c2979484b359c15b50c778a5
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Mar 13 11:40:35 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Mar 13 18:36:49 2022 +0100

    cid#1502951 Logically dead code
    
    Change-Id: I59efa10d5aab53e3c0d830d04b659c39f14bdd3d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131499
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8e548cbebab3..2915d96c5722 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3515,19 +3515,17 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
         break;
 
     case RedlineType::Format:
-        if ( bNoDate )
-            m_pSerializer->startElementNS( XML_w, XML_rPrChange,
-                FSNS( XML_w, XML_id ), aId,
-                FSNS( XML_w, XML_author ), bRemovePersonalInfo
-                    ? "Author" + OUString::number( 
GetExport().GetInfoID(rAuthor) )
-                    : rAuthor );
-        else
-            m_pSerializer->startElementNS( XML_w, XML_rPrChange,
-                FSNS( XML_w, XML_id ), aId,
-                FSNS( XML_w, XML_author ), bRemovePersonalInfo
-                    ? "Author" + OUString::number( 
GetExport().GetInfoID(rAuthor) )
-                    : rAuthor,
-                FSNS( XML_w, XML_date ), DateTimeToOString( aDateTime ) );
+    {
+        rtl::Reference<sax_fastparser::FastAttributeList> pAttributeList
+            = sax_fastparser::FastSerializerHelper::createAttrList();
+
+        pAttributeList->add(FSNS( XML_w, XML_id ), aId);
+        pAttributeList->add(FSNS( XML_w, XML_author ), bRemovePersonalInfo
+                    ? "Author" + OString::number( 
GetExport().GetInfoID(rAuthor) )
+                    : rAuthor.toUtf8());
+        if (!bNoDate)
+            pAttributeList->add(FSNS( XML_w, XML_date ), DateTimeToOString( 
aDateTime ));
+        m_pSerializer->startElementNS( XML_w, XML_rPrChange, pAttributeList );
 
         // Check if there is any extra data stored in the redline object
         if (pRedlineData->GetExtraData())
@@ -3559,7 +3557,7 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
 
         m_pSerializer->endElementNS( XML_w, XML_rPrChange );
         break;
-
+    }
     case RedlineType::ParagraphFormat:
         if ( bNoDate )
             m_pSerializer->startElementNS( XML_w, XML_pPrChange,

Reply via email to