29#include <com/sun/star/frame/XModel.hpp>
41 using ::com::sun::star::xml::sax::XAttributeList;
42 using ::com::sun::star::xml::sax::XFastAttributeList;
56 const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList )
61 pRet =
GetImport().GetFormImport()->createContext( _nElement, xAttrList );
70 const Reference< XPropertySet >& _rxProps,
const Reference< XPropertySetInfo >& _rxPropInfo,
71 const OUString& _rPropName,
bool _bDefault)
79 OUString sAttributeValue = _rxAttributes->getOptionalValue(nCompleteAttributeName);
80 bool bValue = _bDefault;
84 if (_rxPropInfo->hasPropertyByName(_rPropName))
86 _rxProps->setPropertyValue(_rPropName,
Any(bValue));
96 Reference< XPropertySet > xDocProperties(
GetImport().GetModel(), UNO_QUERY);
97 if ( xDocProperties.is() )
100 Reference< XPropertySetInfo > xDocPropInfo;
101 if (xDocProperties.is())
102 xDocPropInfo = xDocProperties->getPropertySetInfo();
111 "caught an exception while setting the document properties!");
133 const Reference< XPropertySet >& _rxProps,
const Reference< XPropertySetInfo >& _rxPropInfo,
134 const OUString& _rPropName,
bool _bDefault)
137 bool bValue = _bDefault;
138 if (_rxPropInfo->hasPropertyByName(_rPropName))
139 bValue = ::cppu::any2bool(_rxProps->getPropertyValue(_rPropName));
142 OUStringBuffer aValue;
149 aValue.makeStringAndClear());
156 Reference< XPropertySet > xDocProperties(_rExp.
GetModel(), UNO_QUERY);
157 if ( xDocProperties.is() )
160 Reference< XPropertySetInfo > xDocPropInfo;
161 if (xDocProperties.is())
162 xDocPropInfo = xDocProperties->getPropertySetInfo();
171 "caught an exception while retrieving the document properties!");
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
const css::uno::Reference< css::frame::XModel > & GetModel() const
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
static bool convertBool(bool &rBool, std::u16string_view rString)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
#define LEAVE_LOG_CONTEXT()
#define ENTER_LOG_CONTEXT(name)
constexpr OUStringLiteral PROPERTY_AUTOCONTROLFOCUS
constexpr OUStringLiteral PROPERTY_APPLYDESIGNMODE
#define XML_ELEMENT(prefix, name)
constexpr sal_uInt16 XML_NAMESPACE_OFFICE