summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-04 17:53:18 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-04-04 20:26:09 +0200
commit599ff05300599d4e4ce818092f18e76e738b921e (patch)
tree76d6a60f8912b17e8db0d49c6bcc01a9503b949a
parentb9f7535e499002706f276c0275c1e6c3c7b6bdd4 (diff)
Related: tdf#115719 DOCX import: fix ignore of increased anchored obj spacing
If there is only a single anchored object, then ignore only the current paragraph, not all paragraphs of the section. Change-Id: I5b44a3df05de325025ec90545667b349e875b31f Reviewed-on: https://gerrit.libreoffice.org/52398 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf115719b.docxbin0 -> 16677 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx6
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx4
3 files changed, 8 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf115719b.docx b/sw/qa/extras/ooxmlimport/data/tdf115719b.docx
new file mode 100644
index 000000000000..551b9871fe60
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf115719b.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 5563ce56dc1f..ef0d085e699c 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -276,6 +276,12 @@ xray ThisComponent.StyleFamilies.PageStyles.Default.Width
CPPUNIT_ASSERT( pos.X > width / 2 );
}
+DECLARE_OOXMLIMPORT_TEST(testTdf115719b, "tdf115719b.docx")
+{
+ // This was 0, 4th (last) paragraph had no increased spacing.
+ CPPUNIT_ASSERT(getProperty<sal_Int32>(getParagraph(4), "ParaTopMargin") > 0);
+}
+
DECLARE_OOXMLIMPORT_TEST(testN766477, "n766477.docx")
{
/*
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index c1d16437cfa3..85c635fc3b32 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1144,9 +1144,9 @@ void SectionPropertyMap::HandleIncreasedAnchoredObjectSpacing(DomainMapper_Impl&
std::vector<AnchoredObjectInfo>& rAnchoredObjectAnchors = rDM_Impl.m_aAnchoredObjectAnchors;
for (auto& rAnchor : rAnchoredObjectAnchors)
{
- // Ignore the case when there is a single shape only.
+ // Ignore this paragraph when there is a single shape only.
if (rAnchor.m_aAnchoredObjects.size() < 2)
- return;
+ continue;
// Analyze the anchored objects of this paragraph, now that we know the
// page width.