30 using ::com::sun::star::uno::Reference;
31 using ::com::sun::star::uno::Any;
32 using ::com::sun::star::xml::sax::XAttributeList;
46 if ( i_rAttributes.is() )
48 m_sItemName = i_rAttributes->getValueByName(
"config:name" );
49 m_sItemType = i_rAttributes->getValueByName(
"config:type" );
65 o_rLocalName = i_rElementName;
66 const sal_Int32 nSeparatorPos = i_rElementName.indexOf(
':' );
67 if ( nSeparatorPos > -1 )
69 o_rNamespace = i_rElementName.copy( 0, nSeparatorPos );
70 o_rLocalName = i_rElementName.copy( nSeparatorPos + 1 );
73 OSL_ENSURE( o_rNamespace ==
"config",
"SettingsImport::split: unexpected namespace!" );
86 :m_rSettings( o_rSettings )
99 split( i_rElementName, sNamespace, sLocalName );
101 if ( sLocalName ==
"config-item-set" )
104 SAL_WARN(
"dbaccess",
"unknown (or unsupported at this place) element name '"
112 :m_rSettings( o_rSettings )
122 OSL_FAIL(
"ConfigItemImport::nextState: unexpected: this class is responsible for child-less items only!" );
147 if ( ::xmloff::token::IsXMLToken( rItemType, ::xmloff::token::XML_INT ) )
156 OSL_FAIL(
"ConfigItemImport::getItemValue: could not convert an int value!" );
159 else if ( ::xmloff::token::IsXMLToken( rItemType, ::xmloff::token::XML_BOOLEAN ) )
168 OSL_FAIL(
"ConfigItemImport::getItemValue: could not convert a boolean value!" );
171 else if ( ::xmloff::token::IsXMLToken( rItemType, ::xmloff::token::XML_STRING ) )
173 o_rValue <<= OUString(sValue);
177 SAL_WARN(
"dbaccess",
"ConfigItemImport::getItemValue: unsupported item type '"
178 << rItemType <<
"', ignoring");
197 split( i_rElementName, sNamespace, sLocalName );
199 if ( sLocalName ==
"config-item-set" )
201 if ( sLocalName ==
"config-item" )
204 SAL_WARN(
"dbaccess",
"unknown element name '"
205 << i_rElementName <<
"', ignoring");
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
virtual ::rtl::Reference< SettingsImport > nextState(const OUString &i_rElementName) override
virtual ~ConfigItemImport() override
virtual void getItemValue(css::uno::Any &o_rValue) const
retrieves the value represented by the element
ConfigItemImport(::comphelper::NamedValueCollection &o_rSettings)
::comphelper::NamedValueCollection & m_rSettings
virtual void endElement() override
::comphelper::NamedValueCollection m_aChildSettings
the settings represented by our child elements
ConfigItemSetImport(::comphelper::NamedValueCollection &o_rSettings)
virtual ::rtl::Reference< SettingsImport > nextState(const OUString &i_rElementName) override
virtual void getItemValue(css::uno::Any &o_rValue) const override
retrieves the value represented by the element
virtual ~ConfigItemSetImport() override
virtual ::rtl::Reference< SettingsImport > nextState(const OUString &i_rElementName) override
OfficeSettingsImport(::comphelper::NamedValueCollection &o_rSettings)
virtual ::rtl::Reference< SettingsImport > nextState(const OUString &i_rElementName) override
virtual ~OfficeSettingsImport() override
::comphelper::NamedValueCollection & m_rSettings
const OUStringBuffer & getAccumulatedCharacters() const
virtual ~SettingsImport() override
const OUString & getItemType() const
void startElement(const css::uno::Reference< css::xml::sax::XAttributeList > &i_rAttributes)
OUStringBuffer m_aCharacters
static void split(const OUString &i_rElementName, OUString &o_rNamespace, OUString &o_rLocalName)
void characters(std::u16string_view i_rCharacters)
const OUString & getItemName() const
virtual void endElement()
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
static bool convertBool(bool &rBool, std::u16string_view rString)
#define ENSURE_OR_RETURN_VOID(c, m)
#define SAL_WARN(area, stream)