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

New commits:
commit d8a27d9fda55a355ca0376f7024af06bb0cd4984
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Mar 11 14:08:30 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Mar 12 11:48:37 2022 +0100

    cid#1502952 Logically dead code
    
    and
    
    cid#1502951 Logically dead code
    cid#1502949 Logically dead code
    
    Change-Id: I3e1f1c8457dbb3d8a0c4754efbc34c36972b7c31
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131385
    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 c49d76fff70d..b8d7095a0de4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -8541,23 +8541,20 @@ DocxAttributeOutput::hasResolved 
DocxAttributeOutput::WritePostitFields()
         const DateTime aDateTime = f->GetDateTime();
         bool bNoDate = bRemovePersonalInfo ||
             ( aDateTime.GetYear() == 1970 && aDateTime.GetMonth() == 1 && 
aDateTime.GetDay() == 1 );
-        if ( bNoDate )
-            m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, 
XML_id ), idstr,
-                FSNS( XML_w, XML_author ), bRemovePersonalInfo
-                     ? "Author" + OUString::number( 
GetExport().GetInfoID(f->GetPar1()) )
-                     : f->GetPar1(),
-                FSNS( XML_w, XML_initials ), bRemovePersonalInfo
-                     ? OUString::number( 
GetExport().GetInfoID(f->GetInitials()) )
-                     : f->GetInitials() );
-        else
-            m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, 
XML_id ), idstr,
-                FSNS( XML_w, XML_author ), bRemovePersonalInfo
-                     ? "Author" + OUString::number( 
GetExport().GetInfoID(f->GetPar1()) )
-                     : f->GetPar1(),
-                FSNS( XML_w, XML_date ), DateTimeToOString( aDateTime ),
-                FSNS( XML_w, XML_initials ), bRemovePersonalInfo
-                     ? OUString::number( 
GetExport().GetInfoID(f->GetInitials()) )
-                     : f->GetInitials() );
+
+        rtl::Reference<sax_fastparser::FastAttributeList> pAttributeList
+            = sax_fastparser::FastSerializerHelper::createAttrList();
+
+        pAttributeList->add(FSNS( XML_w, XML_id ), idstr);
+        pAttributeList->add(FSNS( XML_w, XML_author ), bRemovePersonalInfo
+                 ? "Author" + OString::number( 
GetExport().GetInfoID(f->GetPar1()) )
+                 : f->GetPar1().toUtf8());
+        if (!bNoDate)
+            pAttributeList->add(FSNS( XML_w, XML_date ), DateTimeToOString( 
aDateTime ));
+        pAttributeList->add(FSNS( XML_w, XML_initials ), bRemovePersonalInfo
+                 ? OString::number( GetExport().GetInfoID(f->GetInitials()) )
+                 : f->GetInitials().toUtf8());
+        m_pSerializer->startElementNS( XML_w, XML_comment, pAttributeList );
 
         const bool bNeedParaId = f->GetResolved();
         if (bNeedParaId)

Reply via email to