tdf#116410 DOCX import: restrict increased object spacing to multiple shapes
This anchored object handling is just there to be bug-compatible with Word, it's not needed for the case when there is a single shape in the paragraph. Change-Id: I5e3dc4ba9a4a6f459ec6217e8974ebc2d7303bcc Reviewed-on: https://gerrit.libreoffice.org/51922 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
Binary file not shown.
@@ -124,6 +124,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf115719, "tdf115719.docx")
|
||||
CPPUNIT_ASSERT_EQUAL(2, getPages());
|
||||
}
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testTdf116410, "tdf116410.docx")
|
||||
{
|
||||
// Opposite of the above, was 2 pages, should be 1 page.
|
||||
CPPUNIT_ASSERT_EQUAL(1, getPages());
|
||||
}
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testParagraphSplitOnSectionBorder, "parasplit-on-section-border.odt")
|
||||
{
|
||||
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
|
||||
|
||||
@@ -1146,6 +1146,10 @@ 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.
|
||||
if (rAnchor.m_aAnchoredObjects.size() < 2)
|
||||
return;
|
||||
|
||||
// Analyze the anchored objects of this paragraph, now that we know the
|
||||
// page width.
|
||||
sal_Int32 nShapesWidth = 0;
|
||||
|
||||
Reference in New Issue
Block a user