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

New commits:
commit ca9e48c663b16bf461c37a5449c6ad5a930ad5a4
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Mar 14 13:58:42 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Mar 14 18:32:42 2022 +0100

    cid#1502951 Logically dead code
    
    Change-Id: I5968dda3b0638576fcc9ce222e47a3c04c949484
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131545
    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 45d8d809084f..98a3767cd865 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3552,19 +3552,17 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
         break;
     }
     case RedlineType::ParagraphFormat:
-        if ( bNoDate )
-            m_pSerializer->startElementNS( XML_w, XML_pPrChange,
-                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_pPrChange,
-                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_pPrChange, pAttributeList );
 
         // Check if there is any extra data stored in the redline object
         if (pRedlineData->GetExtraData())
@@ -3617,7 +3615,7 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
         }
         m_pSerializer->endElementNS( XML_w, XML_pPrChange );
         break;
-
+    }
     default:
         SAL_WARN("sw.ww8", "Unhandled redline type for export " << 
SwRedlineTypeToOUString(pRedlineData->GetType()));
         break;

Reply via email to