25#include <com/sun/star/uno/Any.hxx>
26#include <com/sun/star/uno/RuntimeException.hpp>
28#include <rtl/strbuf.hxx>
29#include <rtl/string.hxx>
30#include <rtl/ustring.hxx>
56 original.is() &&
update.is() && original->kind() ==
update->kind() &&
58 if (
update->getLayer() < original->getLayer() ||
59 update->getLayer() > original->getFinalized())
62 switch (original->kind()) {
68 for (
auto const& updateMember :
update->getMembers())
74 static_cast< GroupNode *
>(
75 original.get())->isExtensible())
79 }
else if (updateMember.second->kind() == i1->second->kind()) {
80 merge(i1->second, updateMember.second);
85 for (
auto const& updateMember :
update->getMembers())
90 if (
static_cast< SetNode *
>(original.get())->
91 isValidTemplate(updateMember.second->getTemplateName()))
95 }
else if (updateMember.second->kind() == i1->second->kind() &&
96 (updateMember.second->getTemplateName() ==
97 i1->second->getTemplateName()))
99 merge(i1->second, updateMember.second);
112 valueParser_(layer), data_(data), state_(STATE_START), ignoring_()
123 std::set< OUString >
const * )
130 name ==
"component-schema")
143 (
name ==
"info" ||
name ==
"import" ||
144 name ==
"uses" ||
name ==
"constraints")))
249 throw css::uno::RuntimeException(
250 "bad member <" +
name.convertFromUtf8() +
"> in " + reader.
getUrl());
268 if (!itPair.second) {
269 merge(itPair.first->second,
top.node);
277 if (!itPair.second) {
278 merge(itPair.first->second,
top.node);
285 throw css::uno::RuntimeException(
286 "this cannot happen");
289 if (!
elements_.top().node->getMembers().insert(
292 throw css::uno::RuntimeException(
293 "duplicate " +
top.name +
" in " + reader.
getUrl());
308 throw css::uno::RuntimeException(
309 "no component element in " + reader.
getUrl());
324 OStringBuffer buf(256);
326 bool hasPackage =
false;
327 bool hasName =
false;
337 throw css::uno::RuntimeException(
338 "multiple component-schema package attributes in " +
348 throw css::uno::RuntimeException(
349 "multiple component-schema name attributes in " +
358 throw css::uno::RuntimeException(
359 "no component-schema package attribute in " + reader.
getUrl());
362 throw css::uno::RuntimeException(
363 "no component-schema name attribute in " + reader.
getUrl());
370 bool hasName =
false;
373 bool hasNodeType =
false;
385 attrLn ==
"component")
389 attrLn ==
"node-type")
396 throw css::uno::RuntimeException(
397 "no node-ref name attribute in " + reader.
getUrl());
403 component, hasNodeType, nodeType,
nullptr)));
407 throw css::uno::RuntimeException(
408 "unknown node-ref " +
name +
" in " + reader.
getUrl());
416 bool hasName =
false;
419 bool localized =
false;
420 bool nillable =
true;
436 attrLn ==
"localized")
440 attrLn ==
"nillable")
446 throw css::uno::RuntimeException(
447 "no prop name attribute in " + reader.
getUrl());
450 throw css::uno::RuntimeException(
451 "no prop type attribute in " + reader.
getUrl());
462 css::uno::Any(),
false))),
477 attrLn ==
"separator")
480 if (attrSeparator.
length == 0) {
481 throw css::uno::RuntimeException(
482 "bad oor:separator attribute in " + reader.
getUrl());
492 bool hasName =
false;
494 bool extensible =
false;
505 attrLn ==
"extensible")
511 throw css::uno::RuntimeException(
512 "no group name attribute in " + reader.
getUrl());
521 isTemplate ?
name : OUString()),
526 bool hasName =
false;
529 bool hasNodeType =
false;
541 attrLn ==
"component")
545 attrLn ==
"node-type")
552 throw css::uno::RuntimeException(
553 "no set name attribute in " + reader.
getUrl());
563 component, hasNodeType, nodeType,
nullptr),
564 isTemplate ?
name : OUString()),
570 bool hasNodeType =
false;
579 attrLn ==
"component")
583 attrLn ==
"node-type")
589 set->getAdditionalTemplateNames().push_back(
NodeMapImpl::iterator iterator
std::pair< iterator, bool > insert(const value_type &vt)
NodeMapImpl::value_type value_type
@ KIND_LOCALIZED_PROPERTY
void characters(xmlreader::Span const &text)
bool startElement(xmlreader::XmlReader &reader, int nsId, xmlreader::Span const &name)
xmlreader::XmlReader::Text getTextMode() const
void start(rtl::Reference< Node > const &property, OUString const &localizedName=OUString())
virtual xmlreader::XmlReader::Text getTextMode() override
XcsParser(int layer, Data &data)
void handleProp(xmlreader::XmlReader &reader)
virtual bool startElement(xmlreader::XmlReader &reader, int nsId, xmlreader::Span const &name, std::set< OUString > const *existingDependencies) override
void handleComponentSchema(xmlreader::XmlReader &reader)
void handleNodeRef(xmlreader::XmlReader &reader)
void handlePropValue(xmlreader::XmlReader &reader, rtl::Reference< Node > const &property)
void handleGroup(xmlreader::XmlReader &reader, bool isTemplate)
void handleSetItem(xmlreader::XmlReader &reader, SetNode *set)
void handleSet(xmlreader::XmlReader &reader, bool isTemplate)
virtual void endElement(xmlreader::XmlReader const &reader) override
virtual void characters(xmlreader::Span const &text) override
virtual ~XcsParser() override
const OUString & getUrl() const
bool nextAttribute(int *nsId, Span *localName)
Span getAttributeValue(bool fullyNormalize)
std::map< const SwTextNode *, const sal_uInt32 > NodeMap
void set(css::uno::UnoInterfaceReference const &value)
Type parseType(xmlreader::XmlReader const &reader, xmlreader::Span const &text)
bool parseBoolean(xmlreader::Span const &text)
OUString parseTemplateReference(std::u16string_view component, bool hasNodeType, std::u16string_view nodeType, OUString const *defaultTemplateName)
PyObject_HEAD PyUNO_callable_Internals * members
static OUString fullTemplateName(std::u16string_view component, std::u16string_view name)
NodeMap & getComponents() const
rtl::Reference< Node > getTemplate(int layer, OUString const &fullName) const
rtl::OUString convertFromUtf8() const