1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 #include <comphelper/propertyvalue.hxx>
10 #include "TrackChangesHandler.hxx"
11 #include "PropertyMap.hxx"
12 #include "ConversionHelper.hxx"
13 #include <ooxml/resourceids.hxx>
14 #include <oox/token/tokens.hxx>
15 #include <osl/diagnose.h>
17 namespace writerfilter::dmapper
{
19 using namespace ::com::sun::star
;
23 TrackChangesHandler::TrackChangesHandler( sal_Int32 nToken
) :
24 LoggedProperties("TrackChangesHandler"),
25 m_pRedlineParams(new RedlineParams
)
27 m_pRedlineParams
->m_nToken
= nToken
;
31 TrackChangesHandler::~TrackChangesHandler()
36 void TrackChangesHandler::lcl_attribute(Id rName
, Value
& rVal
)
38 OUString sStringValue
= rVal
.getString();
41 case NS_ooxml::LN_CT_TrackChange_author
:
43 m_pRedlineParams
->m_sAuthor
= sStringValue
;
46 case NS_ooxml::LN_CT_TrackChange_date
:
48 m_pRedlineParams
->m_sDate
= sStringValue
;
51 case NS_ooxml::LN_CT_Markup_id
:
54 OSL_FAIL( "unknown attribute");
58 uno::Sequence
<beans::PropertyValue
> TrackChangesHandler::getRedlineProperties() const
61 switch ( m_pRedlineParams
->m_nToken
& 0xffff )
63 case XML_tableRowInsert
:
64 sType
= getPropertyName( PROP_TABLE_ROW_INSERT
);
66 case XML_tableRowDelete
:
67 sType
= getPropertyName( PROP_TABLE_ROW_DELETE
);
69 case XML_tableCellInsert
:
70 sType
= getPropertyName( PROP_TABLE_CELL_INSERT
);
72 case XML_tableCellDelete
:
73 sType
= getPropertyName( PROP_TABLE_CELL_DELETE
);
77 comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_TYPE
), uno::Any(sType
)),
78 comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_AUTHOR
), uno::Any(m_pRedlineParams
->m_sAuthor
)),
79 comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_DATE_TIME
), uno::Any(ConversionHelper::ConvertDateStringToDateTime( m_pRedlineParams
->m_sDate
)))
80 //comphelper::makePropertyValue(getPropertyName(PROP_REDLINE_REVERT_PROPERTIES), uno::Any(pRedline->m_aRevertProperties))
84 void TrackChangesHandler::lcl_sprm(Sprm
&) {}
86 } //namespace writerfilter::dmapper
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */