22#include <com/sun/star/uno/Reference.h>
23#include <com/sun/star/util/DateTime.hpp>
24#include <com/sun/star/text/XTextCursor.hpp>
37using ::com::sun::star::uno::Reference;
38using ::com::sun::star::text::XTextCursor;
40using ::com::sun::star::xml::sax::XAttributeList;
55 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
58 bool bHaveXmlId(
false );
61 switch(aIter.getToken())
65 sID = aIter.toString();
71 if (!bHaveXmlId) {
sID = aIter.toString(); }
90 sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
106 SvXMLImport::getNameFromToken(nElement));
127 GetImport().GetTextImport()->DeleteParagraph();
129 catch (uno::Exception
const&)
131 SAL_INFO(
"xmloff.text",
"XMLChangedRegionImportContext: delete paragraph failed");
140 const OUString& rType,
141 const OUString& rAuthor,
142 const OUString& rComment,
143 std::u16string_view rDate)
145 util::DateTime aDateTime;
161 Reference<XTextCursor> xCursor( rHelper->GetCursor() );
164 Reference<XTextCursor> xNewCursor =
165 rHelper->RedlineCreateText(xCursor,
sID);
171 rHelper->SetCursor( xNewCursor );
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
Import <text:deletion> and <text:insertion> elements contained in a <text:changed-region> element.
void UseRedlineText()
create redline XText/XTextCursor on demand and register with XMLTextImportHelper
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 void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
XMLChangedRegionImportContext(SvXMLImport &rImport)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
css::uno::Reference< css::text::XTextCursor > xOldCursor
if we replace the current XTextCursor/XText by the ones for the redline, we remember the old cursor h...
void SetChangeInfo(const OUString &rType, const OUString &rAuthor, const OUString &rComment, std::u16string_view rDate)
change info: To be called from change-info context
bool bMergeLastPara
merge-last-paragraph flag
virtual ~XMLChangedRegionImportContext() override
static bool parseDateTime(css::util::DateTime &rDateTime, std::u16string_view rString)
static bool convertBool(bool &rBool, std::u16string_view rString)
#define SAL_INFO(area, stream)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
@ XML_MERGE_LAST_PARAGRAPH
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)