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