31#include <osl/diagnose.h>
39 ,
const Reference< XFastAttributeList > & _xAttrList
42 ,m_pContainer(_pContainer)
58 static std::map< OUString, css::uno::Type > s_aTypeNameMap = []()
60 std::map< OUString, css::uno::Type > tmp;
72 const std::map< OUString, css::uno::Type >::const_iterator aTypePos = s_aTypeNameMap.find(aIter.toString());
73 OSL_ENSURE(s_aTypeNameMap.end() != aTypePos,
"OXMLDataSourceSetting::OXMLDataSourceSetting: invalid type!");
74 if (s_aTypeNameMap.end() != aTypePos)
93 sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
158 switch (_rExpectedType.getTypeClass())
160 case TypeClass_BOOLEAN:
163 bool const bSuccess =
166 "OXMLDataSourceSetting::convertString: could not convert \""
167 << _rReadCharacters <<
"\" into a boolean!");
171 case TypeClass_SHORT:
175 bool const bSuccess =
178 "OXMLDataSourceSetting::convertString: could not convert \""
179 << _rReadCharacters <<
"\" into an integer!");
180 if (TypeClass_SHORT == _rExpectedType.getTypeClass())
181 aReturn <<= static_cast<sal_Int16>(
nValue);
186 case TypeClass_HYPER:
188 OSL_FAIL(
"OXMLDataSourceSetting::convertString: 64-bit integers not implemented yet!");
191 case TypeClass_DOUBLE:
194 bool const bSuccess =
197 "OXMLDataSourceSetting::convertString: could not convert \""
198 << _rReadCharacters <<
"\" into a double!");
202 case TypeClass_STRING:
203 aReturn <<= _rReadCharacters;
207 "OXMLDataSourceSetting::convertString: invalid type class!");
SvXMLImport & GetImport()
css::uno::Type const & get()
void addInfo(const css::beans::PropertyValue &_rInfo)
add an Info to the sequence which will be appended to the data source
virtual void SAL_CALL characters(const OUString &rChars) override
css::beans::PropertyValue m_aSetting
ODBFilter & GetOwnImport()
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
void addValue(const OUString &_sValue)
adds value to property
static css::uno::Any convertString(const css::uno::Type &_rExpectedType, const OUString &_rReadCharacters)
css::uno::Type m_aPropType
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
OXMLDataSourceSetting(ODBFilter &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_xAttrList, OXMLDataSourceSetting *_pContainer=nullptr)
virtual ~OXMLDataSourceSetting() override
OXMLDataSourceSetting * m_pContainer
css::uno::Sequence< css::uno::Any > m_aInfoSequence
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
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 SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
XML_DATA_SOURCE_SETTING_NAME
XML_DATA_SOURCE_SETTING_TYPE
XML_DATA_SOURCE_SETTING_IS_LIST
XML_DATA_SOURCE_SETTING_VALUE
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
#define PROGRESS_BAR_STEP
#define XMLOFF_WARN_UNKNOWN(area, rIter)
constexpr sal_Int32 TOKEN_MASK