bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / transform / TransformerActions.cxx
bloba39f27f2503455dee7c5727d78357dee5cf08a8f
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 *pInit )
31 if( 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 );
48 insert( aVal );
49 ++pInit;
54 XMLTransformerActions::~XMLTransformerActions()
58 void XMLTransformerActions::Add( XMLTransformerActionInit *pInit )
60 if( 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 );
69 if( aIter == end() )
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 );
76 insert( aVal );
79 ++pInit;
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */