update emoji autocorrect entries from po-files
[LibreOffice.git] / writerfilter / source / dmapper / TrackChangesHandler.cxx
blob877c5d7dbf51acb41f1a134845430bb40c2f30df
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
9 #include <TrackChangesHandler.hxx>
10 #include <PropertyMap.hxx>
11 #include <ConversionHelper.hxx>
12 #include <ooxml/resourceids.hxx>
13 #include <oox/token/tokens.hxx>
14 #include <osl/diagnose.h>
16 namespace writerfilter {
17 namespace dmapper {
19 using namespace ::com::sun::star;
20 using namespace oox;
23 TrackChangesHandler::TrackChangesHandler( sal_Int32 nToken ) :
24 LoggedProperties("TrackChangesHandler")
26 m_pRedlineParams = RedlineParamsPtr( new RedlineParams() );
27 m_pRedlineParams->m_nToken = nToken;
31 TrackChangesHandler::~TrackChangesHandler()
36 void TrackChangesHandler::lcl_attribute(Id rName, Value & rVal)
38 sal_Int32 nIntValue = rVal.getInt();
39 OUString sStringValue = rVal.getString();
40 (void)rName;
41 switch( rName )
43 case NS_ooxml::LN_CT_TrackChange_author:
45 m_pRedlineParams->m_sAuthor = sStringValue;
47 break;
48 case NS_ooxml::LN_CT_TrackChange_date:
50 m_pRedlineParams->m_sDate = sStringValue;
52 break;
53 case NS_ooxml::LN_CT_Markup_id:
55 m_pRedlineParams->m_nId = nIntValue;
57 break;
58 default:
59 OSL_FAIL( "unknown attribute");
63 uno::Sequence<beans::PropertyValue> TrackChangesHandler::getRedlineProperties() const
65 uno::Sequence< beans::PropertyValue > aRedlineProperties(3);
66 beans::PropertyValue* pRedlineProperties = aRedlineProperties.getArray();
68 PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
70 OUString sType;
71 switch ( m_pRedlineParams->m_nToken & 0xffff )
73 case XML_tableRowInsert:
74 sType = rPropNameSupplier.GetName( PROP_TABLE_ROW_INSERT );
75 break;
76 case XML_tableRowDelete:
77 sType = rPropNameSupplier.GetName( PROP_TABLE_ROW_DELETE );
78 break;
79 case XML_tableCellInsert:
80 sType = rPropNameSupplier.GetName( PROP_TABLE_CELL_INSERT );
81 break;
82 case XML_tableCellDelete:
83 sType = rPropNameSupplier.GetName( PROP_TABLE_CELL_DELETE );
84 break;
87 pRedlineProperties[0].Name = rPropNameSupplier.GetName( PROP_REDLINE_TYPE );
88 pRedlineProperties[0].Value <<= sType;
89 pRedlineProperties[1].Name = rPropNameSupplier.GetName( PROP_REDLINE_AUTHOR );
90 pRedlineProperties[1].Value <<= m_pRedlineParams->m_sAuthor;
91 pRedlineProperties[2].Name = rPropNameSupplier.GetName( PROP_REDLINE_DATE_TIME );
92 pRedlineProperties[2].Value <<= ConversionHelper::ConvertDateStringToDateTime( m_pRedlineParams->m_sDate );
93 //pRedlineProperties[3].Name = rPropNameSupplier.GetName( PROP_REDLINE_REVERT_PROPERTIES );
94 //pRedlineProperties[3].Value <<= pRedline->m_aRevertProperties;
96 return aRedlineProperties;
99 void TrackChangesHandler::lcl_sprm(Sprm & rSprm)
101 (void)rSprm;
104 } //namespace dmapper
105 } //namespace writerfilter
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */