LibreOffice Module xmloff (master) 1
xmlcnimp.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
21#include <xmloff/xmlcnimp.hxx>
22#include <rtl/ustring.hxx>
23
25{
26}
27
29 m_pImpl( new SvXMLAttrCollection( *(rCopy.m_pImpl) ) )
30{
31}
32
34{
35 m_pImpl.reset( new SvXMLAttrCollection( *rCopy.m_pImpl ) );
36 return *this;
37}
38
40{
41 m_pImpl = std::move( rCopy.m_pImpl );
42 return *this;
43}
44
45// Need destructor defined (despite it being empty) to avoid "checked_delete"
46// compiler errors.
48{
49}
50
52{
53 return ( *(rCmp.m_pImpl) == *m_pImpl );
54}
55
56bool SvXMLAttrContainerData::AddAttr( const OUString& rLName,
57 const OUString& rValue )
58{
59 assert( !rLName.isEmpty() && "empty attribute name is invalid");
60 assert( rLName.indexOf(':') == -1 && "colon in name?");
61 return m_pImpl->AddAttr(rLName, rValue);
62}
63
64bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix,
65 const OUString& rNamespace,
66 const OUString& rLName,
67 const OUString& rValue )
68{
69 assert( !rLName.isEmpty() && "empty attribute name is invalid");
70 assert( rPrefix.indexOf(':') == -1 && "colon in prefix?");
71 assert( rLName.indexOf(':') == -1 && "colon in name?");
72 return m_pImpl->AddAttr(rPrefix, rNamespace, rLName, rValue);
73}
74
75bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix,
76 const OUString& rLName,
77 const OUString& rValue )
78{
79 assert( !rLName.isEmpty() && "empty attribute name is invalid");
80 assert( rPrefix.indexOf(':') == -1 && "colon in prefix?");
81 assert( rLName.indexOf(':') == -1 && "colon in name?");
82 return m_pImpl->AddAttr(rPrefix, rLName, rValue);
83}
84
86 const OUString& rLName,
87 const OUString& rValue )
88{
89 assert( !rLName.isEmpty() && "empty attribute name is invalid");
90 assert( rLName.indexOf(':') == -1 && "colon in name?");
91 return m_pImpl->SetAt(i, rLName, rValue);
92}
93
95 const OUString& rPrefix,
96 const OUString& rNamespace,
97 const OUString& rLName,
98 const OUString& rValue )
99{
100 assert( !rLName.isEmpty() && "empty attribute name is invalid");
101 assert( rPrefix.indexOf(':') == -1 && "colon in prefix?");
102 assert( rLName.indexOf(':') == -1 && "colon in name?");
103 return m_pImpl->SetAt(i, rPrefix, rNamespace, rLName, rValue);
104}
105
107 const OUString& rPrefix,
108 const OUString& rLName,
109 const OUString& rValue )
110{
111 assert( !rLName.isEmpty() && "empty attribute name is invalid");
112 assert( rPrefix.indexOf(':') == -1 && "colon in prefix?");
113 assert( rLName.indexOf(':') == -1 && "colon in name?");
114 return m_pImpl->SetAt(i, rPrefix, rLName, rValue);
115}
116
118{
119 m_pImpl->Remove(i);
120}
121
123{
124 return m_pImpl->GetAttrCount();
125}
126
127const OUString& SvXMLAttrContainerData::GetAttrLName(size_t i) const
128{
129 return m_pImpl->GetAttrLName(i);
130}
131
132const OUString& SvXMLAttrContainerData::GetAttrValue(size_t i) const
133{
134 return m_pImpl->GetAttrValue(i);
135}
136
138{
139 return m_pImpl->GetAttrNamespace(i);
140}
141
143{
144 return m_pImpl->GetAttrPrefix(i);
145}
146
147const OUString& SvXMLAttrContainerData::GetNamespace( sal_uInt16 i ) const
148{
149 return m_pImpl->GetNamespace(i);
150}
151
152const OUString& SvXMLAttrContainerData::GetPrefix( sal_uInt16 i ) const
153{
154 return m_pImpl->GetPrefix(i);
155}
156
158{
159 return m_pImpl->GetFirstNamespaceIndex();
160}
161
162sal_uInt16 SvXMLAttrContainerData::GetNextNamespaceIndex( sal_uInt16 nIdx ) const
163{
164 return m_pImpl->GetNextNamespaceIndex( nIdx );
165}
166
167/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
size_t GetAttrCount() const
Definition: xmlcnimp.cxx:122
OUString GetAttrPrefix(size_t i) const
Definition: xmlcnimp.cxx:142
OUString GetAttrNamespace(size_t i) const
Definition: xmlcnimp.cxx:137
const OUString & GetAttrValue(size_t i) const
Definition: xmlcnimp.cxx:132
bool operator==(const SvXMLAttrContainerData &rCmp) const
Definition: xmlcnimp.cxx:51
sal_uInt16 GetNextNamespaceIndex(sal_uInt16 nIdx) const
Definition: xmlcnimp.cxx:162
const OUString & GetPrefix(sal_uInt16 i) const
Definition: xmlcnimp.cxx:152
void Remove(size_t i)
Definition: xmlcnimp.cxx:117
const OUString & GetNamespace(sal_uInt16 i) const
Definition: xmlcnimp.cxx:147
const OUString & GetAttrLName(size_t i) const
Definition: xmlcnimp.cxx:127
bool SetAt(size_t i, const OUString &rLName, const OUString &rValue)
Definition: xmlcnimp.cxx:85
std::unique_ptr< SvXMLAttrCollection > m_pImpl
Definition: xmlcnimp.hxx:33
sal_uInt16 GetFirstNamespaceIndex() const
Definition: xmlcnimp.cxx:157
SvXMLAttrContainerData & operator=(const SvXMLAttrContainerData &rCmp)
Definition: xmlcnimp.cxx:33
bool AddAttr(const OUString &rLName, const OUString &rValue)
Definition: xmlcnimp.cxx:56
int i