30using namespace css::uno;
66 OUString
const & , OUString
const & )
74 sal_Int32 , OUString
const & ,
75 Reference< xml::input::XAttributes >
const & )
77 throw xml::sax::SAXException(
"unexpected element!", Reference< XInterface >(),
Any() );
82 Reference< xml::input::XAttributes >
const & xAttributes,
86 , _aLocalName(
std::move( aLocalName ))
87 , _xAttributes( xAttributes )
99 Reference< xml::input::XNamespaceMapping >
const & xNamespaceMapping )
110 OUString
const & , OUString
const & )
115 Reference< xml::sax::XLocator >
const & )
120 sal_Int32 nUid, OUString
const & rLocalName,
121 Reference< xml::input::XAttributes >
const & xAttributes )
125 throw xml::sax::SAXException(
"illegal namespace!", Reference< XInterface >(),
Any() );
127 else if (
mpLibArray && rLocalName ==
"libraries" )
131 else if (
mpLibDesc && rLocalName ==
"library" )
141 return new LibraryElement( rLocalName, xAttributes,
nullptr,
this );
145 throw xml::sax::SAXException(
"illegal root element (expected libraries) given: " + rLocalName, Reference< XInterface >(),
Any() );
151 SAL_INFO(
"xmlscript.xmllib",
"LibraryImport::~LibraryImport()." );
156 sal_Int32 nUid, OUString
const & rLocalName,
157 Reference< xml::input::XAttributes >
const & xAttributes )
159 if (
mxImport->XMLNS_LIBRARY_UID != nUid)
161 throw xml::sax::SAXException(
"illegal namespace!", Reference< XInterface >(),
Any() );
164 else if ( rLocalName ==
"library" )
169 aDesc.
aName = xAttributes->getValueByUidName(
mxImport->XMLNS_LIBRARY_UID,
"name" );
180 throw xml::sax::SAXException(
"expected styles of bulletinboard element!", Reference< XInterface >(),
Any() );
189 for( sal_Int32
i = 0 ;
i < nLibCount ;
i++ )
198 sal_Int32 nUid, OUString
const & rLocalName,
199 Reference< xml::input::XAttributes >
const & xAttributes )
201 if (
mxImport->XMLNS_LIBRARY_UID != nUid)
203 throw xml::sax::SAXException(
"illegal namespace!", Reference< XInterface >(),
Any() );
206 else if ( rLocalName ==
"element" )
208 OUString aValue( xAttributes->getValueByUidName(
mxImport->XMLNS_LIBRARY_UID,
"name" ) );
209 if (!aValue.isEmpty())
216 throw xml::sax::SAXException(
"expected styles or bulletinboard element!", Reference< XInterface >(),
Any() );
222 sal_Int32 nElementCount =
mElements.size();
223 Sequence< OUString > aElementNames( nElementCount );
224 OUString* pElementNames = aElementNames.getArray();
225 for( sal_Int32
i = 0 ;
i < nElementCount ;
i++ )
231 pLib->aElementNames = aElementNames;
234Reference< css::xml::sax::XDocumentHandler >
240css::uno::Reference< css::xml::sax::XDocumentHandler >
unotools::WeakReference< AnimationNode > mxParent
OUString const _aLocalName
virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL getParent() override
virtual void SAL_CALL characters(OUString const &rChars) override
virtual sal_Int32 SAL_CALL getUid() override
css::uno::Reference< css::xml::input::XAttributes > _xAttributes
virtual void SAL_CALL processingInstruction(OUString const &rTarget, OUString const &rData) override
virtual void SAL_CALL endElement() override
virtual void SAL_CALL ignorableWhitespace(OUString const &rWhitespaces) override
virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL startChildElement(sal_Int32 nUid, OUString const &rLocalName, css::uno::Reference< css::xml::input::XAttributes > const &xAttributes) override
rtl::Reference< LibraryImport > mxImport
LibElementBase(OUString aLocalName, css::uno::Reference< css::xml::input::XAttributes > const &xAttributes, LibElementBase *pParent, LibraryImport *pImport)
virtual css::uno::Reference< css::xml::input::XAttributes > SAL_CALL getAttributes() override
virtual ~LibElementBase() override
rtl::Reference< LibElementBase > mxParent
virtual OUString SAL_CALL getLocalName() override
friend class LibraryElement
std::vector< LibDescriptor > mLibDescriptors
virtual void SAL_CALL endElement() override
virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL startChildElement(sal_Int32 nUid, OUString const &rLocalName, css::uno::Reference< css::xml::input::XAttributes > const &xAttributes) override
virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL startChildElement(sal_Int32 nUid, OUString const &rLocalName, css::uno::Reference< css::xml::input::XAttributes > const &xAttributes) override
std::vector< OUString > mElements
virtual void SAL_CALL endElement() override
#define SAL_INFO(area, stream)
bool getBoolAttr(sal_Bool *pRet, OUString const &rAttrName, css::uno::Reference< css::xml::input::XAttributes > const &xAttributes, sal_Int32 nUid)
Reference< css::xml::sax::XDocumentHandler > importLibraryContainer(LibDescriptorArray *pLibArray)
css::uno::Reference< css::xml::sax::XDocumentHandler > importLibrary(LibDescriptor &rLib)
css::uno::Reference< css::xml::sax::XDocumentHandler > createDocumentHandler(css::uno::Reference< css::xml::input::XRoot > const &xRoot)
Creates a document handler to be used for SAX1 parser that can handle namespaces.
std::unique_ptr< LibDescriptor[]> mpLibs
virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL startRootElement(sal_Int32 nUid, OUString const &rLocalName, css::uno::Reference< css::xml::input::XAttributes > const &xAttributes) override
friend class LibraryElement
virtual void SAL_CALL startDocument(css::uno::Reference< css::xml::input::XNamespaceMapping > const &xNamespaceMapping) override
virtual void SAL_CALL setDocumentLocator(css::uno::Reference< css::xml::sax::XLocator > const &xLocator) override
LibDescriptor *const mpLibDesc
sal_Int32 XMLNS_XLINK_UID
virtual void SAL_CALL endDocument() override
LibDescriptorArray * mpLibArray
friend class LibrariesElement
sal_Int32 XMLNS_LIBRARY_UID
virtual ~LibraryImport() override
virtual void SAL_CALL processingInstruction(OUString const &rTarget, OUString const &rData) override
constexpr OUStringLiteral XMLNS_LIBRARY_URI
constexpr OUStringLiteral XMLNS_XLINK_URI