Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #include "TransformerActions.hxx"
21 :
22 :
23 :
24 : using namespace ::osl;
25 : using namespace ::xmloff::token;
26 : using namespace ::com::sun::star::uno;
27 :
28 0 : XMLTransformerActions::XMLTransformerActions( XMLTransformerActionInit *pInit )
29 : {
30 0 : if( pInit )
31 : {
32 0 : XMLTransformerActions::key_type aKey;
33 0 : XMLTransformerActions::mapped_type aData;
34 0 : while( pInit->m_nActionType != XML_TACTION_EOT )
35 : {
36 0 : aKey.m_nPrefix = pInit->m_nPrefix;
37 0 : aKey.SetLocalName( pInit->m_eLocalName );
38 :
39 : OSL_ENSURE( find( aKey ) == end(), "duplicate action map entry" );
40 :
41 0 : aData.m_nActionType = pInit->m_nActionType;
42 0 : aData.m_nParam1 = pInit->m_nParam1;
43 0 : aData.m_nParam2 = pInit->m_nParam2;
44 0 : aData.m_nParam3 = pInit->m_nParam3;
45 0 : XMLTransformerActions::value_type aVal( aKey, aData );
46 :
47 0 : insert( aVal );
48 0 : ++pInit;
49 0 : }
50 : }
51 0 : }
52 :
53 0 : XMLTransformerActions::~XMLTransformerActions()
54 : {
55 0 : }
56 :
57 0 : void XMLTransformerActions::Add( XMLTransformerActionInit *pInit )
58 : {
59 0 : if( pInit )
60 : {
61 0 : XMLTransformerActions::key_type aKey;
62 0 : XMLTransformerActions::mapped_type aData;
63 0 : while( pInit->m_nActionType != XML_TACTION_EOT )
64 : {
65 0 : aKey.m_nPrefix = pInit->m_nPrefix;
66 0 : aKey.SetLocalName( pInit->m_eLocalName );
67 0 : XMLTransformerActions::iterator aIter = find( aKey );
68 0 : if( aIter == end() )
69 : {
70 0 : aData.m_nActionType = pInit->m_nActionType;
71 0 : aData.m_nParam1 = pInit->m_nParam1;
72 0 : aData.m_nParam2 = pInit->m_nParam2;
73 0 : aData.m_nParam3 = pInit->m_nParam3;
74 0 : XMLTransformerActions::value_type aVal( aKey, aData );
75 0 : insert( aVal );
76 : }
77 :
78 0 : ++pInit;
79 0 : }
80 : }
81 0 : }
82 :
83 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|