Simplify some initializations in writerfilter

Change-Id: Ib9f653c6add8713a9acf9f6b4605323bcb2c6db6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151470
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet
2023-05-07 17:11:16 +02:00
parent 28502c1ddb
commit 002ae41bb6

View File

@@ -6,6 +6,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#include <comphelper/propertyvalue.hxx>
#include "TrackChangesHandler.hxx" #include "TrackChangesHandler.hxx"
#include "PropertyMap.hxx" #include "PropertyMap.hxx"
#include "ConversionHelper.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> TrackChangesHandler::getRedlineProperties() const
{ {
uno::Sequence< beans::PropertyValue > aRedlineProperties(3);
beans::PropertyValue* pRedlineProperties = aRedlineProperties.getArray();
OUString sType; OUString sType;
switch ( m_pRedlineParams->m_nToken & 0xffff ) switch ( m_pRedlineParams->m_nToken & 0xffff )
{ {
@@ -75,17 +73,12 @@ uno::Sequence<beans::PropertyValue> TrackChangesHandler::getRedlineProperties()
sType = getPropertyName( PROP_TABLE_CELL_DELETE ); sType = getPropertyName( PROP_TABLE_CELL_DELETE );
break; break;
} }
return {
pRedlineProperties[0].Name = getPropertyName( PROP_REDLINE_TYPE ); comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_TYPE ), uno::Any(sType)),
pRedlineProperties[0].Value <<= sType; comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_AUTHOR), uno::Any(m_pRedlineParams->m_sAuthor)),
pRedlineProperties[1].Name = getPropertyName( PROP_REDLINE_AUTHOR ); comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_DATE_TIME), uno::Any(ConversionHelper::ConvertDateStringToDateTime( m_pRedlineParams->m_sDate )))
pRedlineProperties[1].Value <<= m_pRedlineParams->m_sAuthor; //comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_REVERT_PROPERTIES), uno::Any(pRedline->m_aRevertProperties))
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;
} }
void TrackChangesHandler::lcl_sprm(Sprm &) {} void TrackChangesHandler::lcl_sprm(Sprm &) {}