nss: upgrade to release 3.73
[LibreOffice.git] / xmloff / source / transform / TransformerActions.cxx
blob870822f40828dd598e99c50697bd4b43d619a803
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/.
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 const *pInit )
31 if( !pInit )
32 return;
34 XMLTransformerActions::key_type aKey;
35 XMLTransformerActions::mapped_type aData;
36 while( pInit->m_nActionType != XML_TACTION_EOT )
38 aKey.m_nPrefix = pInit->m_nPrefix;
39 aKey.SetLocalName( pInit->m_eLocalName );
41 OSL_ENSURE( find( aKey ) == end(), "duplicate action map entry" );
43 aData.m_nActionType = pInit->m_nActionType;
44 aData.m_nParam1 = pInit->m_nParam1;
45 aData.m_nParam2 = pInit->m_nParam2;
46 aData.m_nParam3 = pInit->m_nParam3;
47 XMLTransformerActions::value_type aVal( aKey, aData );
49 insert( aVal );
50 ++pInit;
54 XMLTransformerActions::~XMLTransformerActions()
58 void XMLTransformerActions::Add( XMLTransformerActionInit const *pInit )
60 if( !pInit )
61 return;
63 XMLTransformerActions::key_type aKey;
64 XMLTransformerActions::mapped_type aData;
65 while( pInit->m_nActionType != XML_TACTION_EOT )
67 aKey.m_nPrefix = pInit->m_nPrefix;
68 aKey.SetLocalName( pInit->m_eLocalName );
69 XMLTransformerActions::iterator aIter = find( aKey );
70 if( aIter == end() )
72 aData.m_nActionType = pInit->m_nActionType;
73 aData.m_nParam1 = pInit->m_nParam1;
74 aData.m_nParam2 = pInit->m_nParam2;
75 aData.m_nParam3 = pInit->m_nParam3;
76 XMLTransformerActions::value_type aVal( aKey, aData );
77 insert( aVal );
80 ++pInit;
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */