summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper_Impl.hxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-12-06 16:54:07 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-12-06 20:34:25 +0100
commit814cb2433da6bd608e935fa5531d2a2b92867985 (patch)
treef941f00aa2a5dc72dde441e66784bd2f695a7135 /writerfilter/source/dmapper/DomainMapper_Impl.hxx
parentd22a5d7425f247c6edce2747f6fe83d80e5e51bb (diff)
Related: tdf#115719 DOCX import: fix increased spacing vs left-aligned objects
Commit 8b73bafbc18acb4dd8911d2f2de8158d98eb6144 (tdf#115719 DOCX import: increase paragraph spacing for anchored objects, 2018-02-14) added an import-time tweak for a problem that has been confirmed to be a Word layout bug in the meantime (and the tweak makes Writer behave the same way if the document has been created by an affected Word version for layout compatiblity). Later, commit 4883da6fd25e4645a3b30cb58212a2f666dae75a (Related: tdf#124600 DOCX import: ignore left wrap on left-aligned shapes, 2018-02-14) fixed left spacing of anchored objects aligned to the left, to be in sync with what the DOC import does. This broke the previous fix in case the shapes are left-aligned. Fix the problem by tracking what is the in-file-format and logical left margin, so the final doc model has the value necessary for correct horizontal positioning and the importer has the value that's necessary for correct vertical positioning. Change-Id: I8f16cbe7bad40e243111c902bdc1ab0e8141d6b9 Reviewed-on: https://gerrit.libreoffice.org/84654 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.hxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 507150ec4e50..490e4f625401 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -226,7 +226,7 @@ struct TextAppendContext
* Objects anchored to the current paragraph, may affect the paragraph
* spacing.
*/
- std::vector<css::uno::Reference<css::text::XTextContent>> m_aAnchoredObjects;
+ std::vector<AnchoredObjectInfo> m_aAnchoredObjects;
TextAppendContext(const css::uno::Reference<css::text::XTextAppend>& xAppend, const css::uno::Reference<css::text::XTextCursor>& xCur)
: xTextAppend(xAppend)
@@ -387,11 +387,18 @@ struct FloatingTableInfo
css::uno::Any getPropertyValue(const OUString &propertyName);
};
-/// Stores info about objects anchored to a given paragraph.
+/// Stores original/in-file-format info about a single anchored object.
struct AnchoredObjectInfo
{
+ css::uno::Reference<css::text::XTextContent> m_xAnchoredObject;
+ sal_Int32 m_nLeftMargin = 0;
+};
+
+/// Stores info about objects anchored to a given paragraph.
+struct AnchoredObjectsInfo
+{
css::uno::Reference<css::text::XTextRange> m_xParagraph;
- std::vector<css::uno::Reference<css::text::XTextContent>> m_aAnchoredObjects;
+ std::vector<AnchoredObjectInfo> m_aAnchoredObjects;
};
struct SymbolData
@@ -982,7 +989,7 @@ public:
std::vector<FloatingTableInfo> m_aPendingFloatingTables;
/// Paragraphs with anchored objects in the current section.
- std::vector<AnchoredObjectInfo> m_aAnchoredObjectAnchors;
+ std::vector<AnchoredObjectsInfo> m_aAnchoredObjectAnchors;
/// Append a property to a sub-grabbag if necessary (e.g. 'lineRule', 'auto')
void appendGrabBag(std::vector<css::beans::PropertyValue>& rInteropGrabBag, const OUString& aKey, const OUString& aValue);