writerfilter/source/dmapper/TrackChangesHandler.cxx |   21 ++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

New commits:
commit 002ae41bb6088002ba3ed0188ac822fb823a23f9
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sun May 7 17:11:16 2023 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Sun May 7 23:15:54 2023 +0200

    Simplify some initializations in writerfilter
    
    Change-Id: Ib9f653c6add8713a9acf9f6b4605323bcb2c6db6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151470
    Tested-by: Julien Nabet <serval2...@yahoo.fr>
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/writerfilter/source/dmapper/TrackChangesHandler.cxx 
b/writerfilter/source/dmapper/TrackChangesHandler.cxx
index 212f88261c4a..47a52d6df695 100644
--- a/writerfilter/source/dmapper/TrackChangesHandler.cxx
+++ b/writerfilter/source/dmapper/TrackChangesHandler.cxx
@@ -6,6 +6,7 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
+#include <comphelper/propertyvalue.hxx>
 #include "TrackChangesHandler.hxx"
 #include "PropertyMap.hxx"
 #include "ConversionHelper.hxx"
@@ -56,9 +57,6 @@ void TrackChangesHandler::lcl_attribute(Id rName, Value & 
rVal)
 
 uno::Sequence<beans::PropertyValue> 
TrackChangesHandler::getRedlineProperties() const
 {
-    uno::Sequence< beans::PropertyValue > aRedlineProperties(3);
-    beans::PropertyValue* pRedlineProperties = aRedlineProperties.getArray();
-
     OUString sType;
     switch ( m_pRedlineParams->m_nToken & 0xffff )
     {
@@ -75,17 +73,12 @@ uno::Sequence<beans::PropertyValue> 
TrackChangesHandler::getRedlineProperties()
             sType = getPropertyName( PROP_TABLE_CELL_DELETE );
             break;
     }
-
-    pRedlineProperties[0].Name = getPropertyName( PROP_REDLINE_TYPE );
-    pRedlineProperties[0].Value <<= sType;
-    pRedlineProperties[1].Name = getPropertyName( PROP_REDLINE_AUTHOR );
-    pRedlineProperties[1].Value <<= m_pRedlineParams->m_sAuthor;
-    pRedlineProperties[2].Name = getPropertyName( PROP_REDLINE_DATE_TIME );
-    pRedlineProperties[2].Value <<= 
ConversionHelper::ConvertDateStringToDateTime( m_pRedlineParams->m_sDate );
-    //pRedlineProperties[3].Name = getPropertyName( 
PROP_REDLINE_REVERT_PROPERTIES );
-    //pRedlineProperties[3].Value <<= pRedline->m_aRevertProperties;
-
-    return aRedlineProperties;
+    return {
+               comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_TYPE 
), uno::Any(sType)),
+               
comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_AUTHOR), 
uno::Any(m_pRedlineParams->m_sAuthor)),
+               
comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_DATE_TIME), 
uno::Any(ConversionHelper::ConvertDateStringToDateTime( 
m_pRedlineParams->m_sDate )))
+               
//comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_REVERT_PROPERTIES),
 uno::Any(pRedline->m_aRevertProperties))
+           };
 }
 
 void TrackChangesHandler::lcl_sprm(Sprm &) {}

Reply via email to