LibreOffice Module xmloff (master)  1
TransformerActions.cxx
Go to the documentation of this file.
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 #include <osl/diagnose.h>
23 
24 
25 using namespace ::osl;
26 using namespace ::xmloff::token;
27 using namespace ::com::sun::star::uno;
28 
30 {
31  if( !pInit )
32  return;
33 
34  XMLTransformerActions::key_type aKey;
35  XMLTransformerActions::mapped_type aData;
36  while( pInit->m_nActionType != XML_TACTION_EOT )
37  {
38  aKey.m_nPrefix = pInit->m_nPrefix;
39  aKey.SetLocalName( pInit->m_eLocalName );
40 
41  OSL_ENSURE( find( aKey ) == end(), "duplicate action map entry" );
42 
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 );
48 
49  insert( aVal );
50  ++pInit;
51  }
52 }
53 
55 {
56 }
57 
59 {
60  if( !pInit )
61  return;
62 
63  XMLTransformerActions::key_type aKey;
64  XMLTransformerActions::mapped_type aData;
65  while( pInit->m_nActionType != XML_TACTION_EOT )
66  {
67  aKey.m_nPrefix = pInit->m_nPrefix;
68  aKey.SetLocalName( pInit->m_eLocalName );
69  XMLTransformerActions::iterator aIter = find( aKey );
70  if( aIter == end() )
71  {
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 );
78  }
79 
80  ++pInit;
81  }
82 }
83 
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char aData[]
void Add(XMLTransformerActionInit const *pInit)
#define XML_TACTION_EOT
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, const OUString &_rVal, const ::comphelper::UStringMixEqual &_rCase)
XMLTransformerActions(XMLTransformerActionInit const *pInit)
::xmloff::token::XMLTokenEnum const m_eLocalName
enumrange< T >::Iterator end(enumrange< T >)
Handling of tokens in XML: