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 658 : XMLTransformerActions::XMLTransformerActions( XMLTransformerActionInit *pInit )
29 : {
30 658 : if( pInit )
31 : {
32 658 : XMLTransformerActions::key_type aKey;
33 658 : XMLTransformerActions::mapped_type aData;
34 43350 : while( pInit->m_nActionType != XML_TACTION_EOT )
35 : {
36 42034 : aKey.m_nPrefix = pInit->m_nPrefix;
37 42034 : aKey.SetLocalName( pInit->m_eLocalName );
38 :
39 : OSL_ENSURE( find( aKey ) == end(), "duplicate action map entry" );
40 :
41 42034 : aData.m_nActionType = pInit->m_nActionType;
42 42034 : aData.m_nParam1 = pInit->m_nParam1;
43 42034 : aData.m_nParam2 = pInit->m_nParam2;
44 42034 : aData.m_nParam3 = pInit->m_nParam3;
45 42034 : XMLTransformerActions::value_type aVal( aKey, aData );
46 :
47 42034 : insert( aVal );
48 42034 : ++pInit;
49 42692 : }
50 : }
51 658 : }
52 :
53 658 : XMLTransformerActions::~XMLTransformerActions()
54 : {
55 658 : }
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: */
|