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 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "TransformerActions.hxx"
22 #include <osl/diagnose.h>
25 using namespace ::osl
;
26 using namespace ::xmloff::token
;
27 using namespace ::com::sun::star::uno
;
29 XMLTransformerActions::XMLTransformerActions( XMLTransformerActionInit
*pInit
)
33 XMLTransformerActions::key_type aKey
;
34 XMLTransformerActions::mapped_type aData
;
35 while( pInit
->m_nActionType
!= XML_TACTION_EOT
)
37 aKey
.m_nPrefix
= pInit
->m_nPrefix
;
38 aKey
.SetLocalName( pInit
->m_eLocalName
);
40 OSL_ENSURE( find( aKey
) == end(), "duplicate action map entry" );
42 aData
.m_nActionType
= pInit
->m_nActionType
;
43 aData
.m_nParam1
= pInit
->m_nParam1
;
44 aData
.m_nParam2
= pInit
->m_nParam2
;
45 aData
.m_nParam3
= pInit
->m_nParam3
;
46 XMLTransformerActions::value_type
aVal( aKey
, aData
);
54 XMLTransformerActions::~XMLTransformerActions()
58 void XMLTransformerActions::Add( XMLTransformerActionInit
*pInit
)
62 XMLTransformerActions::key_type aKey
;
63 XMLTransformerActions::mapped_type aData
;
64 while( pInit
->m_nActionType
!= XML_TACTION_EOT
)
66 aKey
.m_nPrefix
= pInit
->m_nPrefix
;
67 aKey
.SetLocalName( pInit
->m_eLocalName
);
68 XMLTransformerActions::iterator aIter
= find( aKey
);
71 aData
.m_nActionType
= pInit
->m_nActionType
;
72 aData
.m_nParam1
= pInit
->m_nParam1
;
73 aData
.m_nParam2
= pInit
->m_nParam2
;
74 aData
.m_nParam3
= pInit
->m_nParam3
;
75 XMLTransformerActions::value_type
aVal( aKey
, aData
);
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */