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>
42 using ::com::sun::star::beans::XPropertySet;
43 using ::com::sun::star::uno::Reference;
44 using ::com::sun::star::xml::sax::XAttributeList;
45 using ::com::sun::star::xml::sax::XFastAttributeList;
46 using ::com::sun::star::lang::XMultiServiceFactory;
47 using ::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") );
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();
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 )
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
css::uno::Sequence< sal_Int8 > aSequence
SvXMLImport & GetImport()
static void decode(css::uno::Sequence< sal_Int8 > &aPass, std::u16string_view sBuffer)
SvXMLNamespaceMap & GetNamespaceMap()
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
bool bIsCurrentlyVisibleOK
#define XMLOFF_WARN_UNKNOWN(area, rIter)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
void ProcessAttributes(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
css::uno::Reference< css::beans::XPropertySet > xSectionPropertySet
TextSection (as XPropertySet) for passing down to data source elements.
static bool convertBool(bool &rBool, std::u16string_view rString)
void SetXmlId(css::uno::Reference< css::uno::XInterface > const &i_xIfc, OUString const &i_rXmlId)
set the XmlId attribute of given UNO object (for RDF metadata)
This class deliberately does not support XWeak, to improve performance when loading large documents...
Handling of tokens in XML:
#define XML_ELEMENT(prefix, name)
Reference< XSingleServiceFactory > xFactory
constexpr sal_Int32 TOKEN_MASK
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
constexpr sal_uInt16 XML_NAMESPACE_OOOW
XMLSectionImportContext(SvXMLImport &rImport)
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 ~XMLSectionImportContext() override
bool m_bDetectedRangeSegmentation false