diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-10-31 13:41:20 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-10-31 18:14:33 +0100 |
commit | d40c2be38aaf56116f4dc7be9e78f4e9695407fc (patch) | |
tree | 3f45ea21d6d8d84b6829cbf22367b61bf6e3db2c /writerfilter/source/dmapper/DomainMapper_Impl.hxx | |
parent | 94890fdc3402d1b62a22824235e557d191332bd9 (diff) |
tdf#125038 DOCX import: better support for linebreaks in IF fields
IF fields can't contain linebreaks, so instead of just calling
finishParagraph() and hoping it does something sane, explicitly handle
them: remember the properties and perform the call only once the field
is closed.
Change-Id: I676aa2c83f12cb600829177a0eb25558822b1d94
Reviewed-on: https://gerrit.libreoffice.org/81847
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.hxx')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 7dbd7032c4fa..27c606a3f681 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -129,6 +129,13 @@ public: bool getTextInserted() const; }; +/// Information about a paragraph to be finished after a field end. +struct FieldParagraph +{ + PropertyMapPtr m_pPropertyMap; + bool m_bRemove = false; +}; + /// field stack element class FieldContext : public virtual SvRefBase { @@ -155,6 +162,8 @@ class FieldContext : public virtual SvRefBase /// (Character) properties of the field itself. PropertyMapPtr m_pProperties; + std::vector<FieldParagraph> m_aParagraphsToFinish; + public: explicit FieldContext(css::uno::Reference<css::text::XTextRange> const& xStart); ~FieldContext() override; @@ -202,6 +211,8 @@ public: const PropertyMapPtr& getProperties() const { return m_pProperties; } ::std::vector<OUString> GetCommandParts() const; + + std::vector<FieldParagraph>& GetParagraphsToFinish() { return m_aParagraphsToFinish; } }; struct TextAppendContext |