33#include <com/sun/star/container/XNamed.hpp>
34#include <com/sun/star/frame/XModel.hpp>
35#include <com/sun/star/uno/Reference.h>
36#include <com/sun/star/text/XTextContent.hpp>
37#include <com/sun/star/beans/XPropertySet.hpp>
38#include <com/sun/star/lang/XMultiServiceFactory.hpp>
39#include <com/sun/star/text/ControlCharacter.hpp>
42using ::com::sun::star::beans::XPropertySet;
43using ::com::sun::star::uno::Reference;
44using ::com::sun::star::xml::sax::XAttributeList;
45using ::com::sun::star::xml::sax::XFastAttributeList;
46using ::com::sun::star::lang::XMultiServiceFactory;
47using ::com::sun::star::container::XNamed;
66, bIsCurrentlyVisible(true)
67, bIsCurrentlyVisibleOK(false)
77 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
96 Reference<XMultiServiceFactory>
xFactory(
101 Reference<XInterface> xIfc =
102 xFactory->createInstance( bIsIndexHeader ? OUString(
"com.sun.star.text.IndexHeaderSection")
103 : OUString(
"com.sun.star.text.TextSection") );
107 Reference<XPropertySet> xPropSet(xIfc, UNO_QUERY);
113 Reference<XNamed> xNamed(xPropSet, UNO_QUERY);
114 xNamed->setName(
sName);
122 if (pStyle !=
nullptr)
129 if (! bIsIndexHeader)
143 xPropSet->setPropertyValue(
"Condition",
Any(
sCond) );
151 xPropSet->setPropertyValue(
"ProtectionKey",
Any(
aSequence));
155 xPropSet->setPropertyValue(
"IsProtected",
Any(
bProtect) );
160 Reference<XTextRange> xStart =
161 rHelper->GetCursor()->getStart();
163 OUString sMarkerString(
" ");
165 OUString sMarkerString(
"X");
167 rHelper->InsertString(sMarkerString);
168 rHelper->InsertControlCharacter(
169 ControlCharacter::APPEND_PARAGRAPH );
170 rHelper->InsertString(sMarkerString);
173 rHelper->GetCursor()->gotoRange(xStart,
false);
174 rHelper->GetCursor()->goRight(1,
true);
181 rHelper->GetText()->insertTextContent(
182 rHelper->GetCursorAsRange(), xTextContent,
true );
185 rHelper->GetText()->insertString(
186 rHelper->GetCursorAsRange(),
"",
true);
190 rHelper->RedlineAdjustStartNodeCursor();
197 const Reference<XFastAttributeList> & xAttrList )
201 switch (aIter.getToken())
204 sXmlId = aIter.toString();
210 sName = aIter.toString();
215 OUString sValue = aIter.toString();
217 sal_uInt16 nPrefix =
GetImport().GetNamespaceMap().
218 GetKeyByAttrValueQName(sValue, &sTmp);
278 rHelper->GetCursor()->goRight(1,
false);
281 rHelper->GetCursor()->goLeft(1,
true);
282 rHelper->GetText()->insertString(rHelper->GetCursorAsRange(),
287 rHelper->GetCursor()->goRight(1,
true);
288 rHelper->GetText()->insertString(rHelper->GetCursorAsRange(),
292 rHelper->RedlineAdjustStartNodeCursor();
297 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
313 auto pContext =
GetImport().GetTextImport()->CreateTextChildContext(
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
css::uno::Reference< css::beans::XPropertySet > xSectionPropertySet
TextSection (as XPropertySet) for passing down to data source elements.
XMLSectionImportContext(SvXMLImport &rImport)
css::uno::Sequence< sal_Int8 > aSequence
virtual ~XMLSectionImportContext() override
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
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 ProcessAttributes(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
bool bIsCurrentlyVisibleOK
static void decode(css::uno::Sequence< sal_Int8 > &aPass, std::u16string_view sBuffer)
static bool convertBool(bool &rBool, std::u16string_view rString)
Reference< XSingleServiceFactory > xFactory
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)
constexpr sal_Int32 TOKEN_MASK
constexpr sal_uInt16 XML_NAMESPACE_OOOW