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;
54 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
57 bool bHaveXmlId(
false );
60 switch(aIter.getToken())
64 sID = aIter.toString();
70 if (!bHaveXmlId) {
sID = aIter.toString(); }
89 sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
105 SvXMLImport::getNameFromToken(nElement));
126 GetImport().GetTextImport()->DeleteParagraph();
128 catch (uno::Exception
const&)
130 SAL_INFO(
"xmloff.text",
"XMLChangedRegionImportContext: delete paragraph failed");
139 const OUString& rType,
140 const OUString& rAuthor,
141 const OUString& rComment,
142 std::u16string_view rDate)
144 util::DateTime aDateTime;
160 Reference<XTextCursor> xCursor( rHelper->GetCursor() );
163 Reference<XTextCursor> xNewCursor =
164 rHelper->RedlineCreateText(xCursor,
sID);
170 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)