21 #include <com/sun/star/xml/AttributeData.hpp>
23 #include <rtl/ustrbuf.hxx>
42 : mpContainer(
std::move( pContainer ) )
45 mpContainer = std::make_unique<SvXMLAttrContainerData>();
61 const sal_uInt16 nAttrCount =
mpContainer->GetAttrCount();
63 sal_Int32
nPos = aName.indexOf(
':' );
66 for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ )
75 const OUString aPrefix( aName.copy( 0L, nPos ) );
76 const OUString aLName( aName.copy( nPos+1 ) );
78 for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ )
91 class theSvUnoAttributeContainerUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSvUnoAttributeContainerUnoTunnelId> {};
96 return theSvUnoAttributeContainerUnoTunnelId::get().getSeq();
101 if( isUnoTunnelId<SvUnoAttributeContainer>(rId) )
103 return sal::static_int_cast<sal_Int64>(
reinterpret_cast<sal_uIntPtr
>(
this));
114 throw container::NoSuchElementException();
116 xml::AttributeData
aData;
117 aData.Namespace =
mpContainer->GetAttrNamespace(nAttr);
118 aData.Type =
"CDATA";
126 const sal_uInt16 nAttrCount =
mpContainer->GetAttrCount();
128 uno::Sequence< OUString > aElementNames( static_cast<sal_Int32>(nAttrCount) );
129 OUString *pNames = aElementNames.getArray();
131 for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ )
133 OUStringBuffer sBuffer(
mpContainer->GetAttrPrefix(nAttr) );
134 if( !sBuffer.isEmpty() )
135 sBuffer.append(
':' );
136 sBuffer.append(
mpContainer->GetAttrLName(nAttr) );
137 *pNames++ = sBuffer.makeStringAndClear();
140 return aElementNames;
151 if(
auto pData = o3tl::tryAccess<xml::AttributeData>(aElement) )
155 throw container::NoSuchElementException();
157 sal_Int32
nPos = aName.indexOf(
':' );
160 const OUString aPrefix( aName.copy( 0L, nPos ));
161 const OUString aLName( aName.copy( nPos+1 ));
163 if(
pData->Namespace.isEmpty() )
176 if(
pData->Namespace.isEmpty() )
184 throw lang::IllegalArgumentException();
190 auto pData = o3tl::tryAccess<xml::AttributeData>(aElement);
192 throw lang::IllegalArgumentException();
196 throw container::ElementExistException();
198 sal_Int32
nPos = aName.indexOf(
':' );
201 const OUString aPrefix( aName.copy( 0L, nPos ));
202 const OUString aLName( aName.copy( nPos+1 ));
204 if(
pData->Namespace.isEmpty() )
217 if(
pData->Namespace.isEmpty() )
229 throw container::NoSuchElementException();
237 return "SvUnoAttributeContainer";
242 return {
"com.sun.star.xml.AttributeContainer" };
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
std::unique_ptr< ContentProperties > pData
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
std::unique_ptr< SvXMLAttrContainerData > mpContainer
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual void SAL_CALL removeByName(const OUString &Name) override
constexpr OUStringLiteral aData
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
uno::Reference< uno::XInterface > SvUnoAttributeContainer_CreateInstance()
virtual void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
SAL_DLLPRIVATE sal_uInt16 getIndexByName(const OUString &aName) const
css::uno::Type const & get()
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
SvUnoAttributeContainer(std::unique_ptr< SvXMLAttrContainerData > pContainer=nullptr)
virtual css::uno::Type SAL_CALL getElementType() override
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override