LibreOffice Module sw (master)
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
sw
source
filter
xml
xmlitmpr.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 "
xmlitmap.hxx
"
21
#include <
xmloff/xmlimp.hxx
>
22
23
using ::xmloff::token::IsXMLToken;
24
using ::xmloff::token::XML_TOKEN_INVALID;
25
26
// TODO: optimize this!
27
class
SvXMLItemMapEntries_impl
28
{
29
public
:
30
SvXMLItemMapEntry
const
*
mpEntries
;
31
sal_uInt16
mnCount
;
32
};
33
34
SvXMLItemMapEntries::SvXMLItemMapEntries
(
SvXMLItemMapEntry
const
* pEntries )
35
: mpImpl( new
SvXMLItemMapEntries_impl
)
36
{
37
mpImpl
->mpEntries = pEntries;
38
39
mpImpl
->mnCount = 0;
40
while
( pEntries->
eLocalName
!=
XML_TOKEN_INVALID
)
41
{
42
pEntries++;
43
mpImpl
->mnCount++;
44
}
45
}
46
47
SvXMLItemMapEntries::~SvXMLItemMapEntries
()
48
{
49
}
50
51
SvXMLItemMapEntry
const
*
SvXMLItemMapEntries::getByName
( sal_Int32 nElement )
const
52
{
53
SvXMLItemMapEntry
const
* pMap =
mpImpl
->mpEntries;
54
while
( pMap && (pMap->
eLocalName
!=
XML_TOKEN_INVALID
) )
55
{
56
if
(
IsTokenInNamespace
(nElement, pMap->
nNameSpace
) &&
57
(nElement &
TOKEN_MASK
) == pMap->
eLocalName
)
58
break
;
59
pMap++;
60
}
61
62
return
(pMap && (pMap->
eLocalName
!=
XML_TOKEN_INVALID
)) ? pMap :
nullptr
;
63
}
64
65
SvXMLItemMapEntry
const
&
SvXMLItemMapEntries::getByIndex
( sal_uInt16 nIndex )
const
66
{
67
return
mpImpl
->mpEntries[nIndex];
68
}
69
70
sal_uInt16
SvXMLItemMapEntries::getCount
()
const
71
{
72
return
mpImpl
->mnCount;
73
}
74
75
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvXMLItemMapEntries::getByName
SvXMLItemMapEntry const * getByName(sal_Int32 nElement) const
Definition:
xmlitmpr.cxx:51
SvXMLItemMapEntries::getCount
sal_uInt16 getCount() const
Definition:
xmlitmpr.cxx:70
SvXMLItemMapEntry
Definition:
xmlitmap.hxx:39
xmlimp.hxx
SvXMLItemMapEntries::getByIndex
SvXMLItemMapEntry const & getByIndex(sal_uInt16 nIndex) const
Definition:
xmlitmpr.cxx:65
xmlitmap.hxx
SvXMLItemMapEntries_impl::mnCount
sal_uInt16 mnCount
Definition:
xmlitmpr.cxx:31
SvXMLItemMapEntry::eLocalName
enum::xmloff::token::XMLTokenEnum const eLocalName
Definition:
xmlitmap.hxx:45
XML_TOKEN_INVALID
XML_TOKEN_INVALID
SvXMLItemMapEntries::~SvXMLItemMapEntries
virtual ~SvXMLItemMapEntries() override
Definition:
xmlitmpr.cxx:47
SvXMLItemMapEntries::mpImpl
std::unique_ptr< SvXMLItemMapEntries_impl > mpImpl
Definition:
xmlitmap.hxx:67
IsTokenInNamespace
constexpr bool IsTokenInNamespace(sal_Int32 nToken, sal_uInt16 nNamespacePrefix)
SvXMLItemMapEntries::SvXMLItemMapEntries
SvXMLItemMapEntries(SvXMLItemMapEntry const *pEntrys)
Definition:
xmlitmpr.cxx:34
SvXMLItemMapEntry::nNameSpace
sal_uInt16 nNameSpace
Definition:
xmlitmap.hxx:41
TOKEN_MASK
constexpr sal_Int32 TOKEN_MASK
SvXMLItemMapEntries_impl::mpEntries
SvXMLItemMapEntry const * mpEntries
Definition:
xmlitmpr.cxx:30
SvXMLItemMapEntries_impl
Definition:
xmlitmpr.cxx:27
Generated on Sat Mar 6 2021 08:39:59 for LibreOffice Module sw (master) by
1.8.10