Kaydet (Commit) cebb4abe authored tarafından Tushar Bende's avatar Tushar Bende Kaydeden (comit) Miklos Vajna

fdo#74652 : Extra image gets added to the document body after RT.

Description: There was a problem for some documents, that when opened in LibreOffice
extra image was getting added to the first page of the doc and same could be noticed
even in RoundTripped doc.

The root cause was if picture bullet is added to the doc and there is no <w:lvlPicBulletId> tag
in <w:lvl> of <w:abstractNum> then removal of extra added graphic object from document body was
getting missed because currently that is handled in ListsManager::lcl_sprm() inside "case NS_ooxml::LN_CT_Lvl_lvlPicBulletId".

Checking if there is any remaining item in m_aNumPicBullets when LO hits the ListsManager destructor.
If there is any calling dispose() for all of them.

Change-Id: Ibfc3c93b68ff7d6ef0909fe789dda6db67ac11e2
Reviewed-on: https://gerrit.libreoffice.org/8940Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 4be3e384
......@@ -2011,6 +2011,14 @@ DECLARE_OOXMLIMPORT_TEST(testFdo38414, "fdo38414.docx" )
CPPUNIT_ASSERT_EQUAL( height3, height4 );
}
DECLARE_OOXMLIMPORT_TEST(test_extra_image, "test_extra_image.docx" )
{
// fdo#74652 Check there is no shape added to the doc during import
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xDraws->getCount());
}
DECLARE_OOXMLIMPORT_TEST(testFdo74401, "fdo74401.docx")
{
uno::Reference<drawing::XShapes> xGroupShape(getShape(1), uno::UNO_QUERY);
......
......@@ -710,6 +710,16 @@ ListsManager::ListsManager(DomainMapper& rDMapper,
ListsManager::~ListsManager( )
{
uno::Reference<drawing::XShape> xShape;
for (std::vector<NumPicBullet::Pointer>::iterator it = m_aNumPicBullets.begin(); it != m_aNumPicBullets.end(); ++it)
{
xShape = (*it)->GetShape();
if (xShape.is())
{
uno::Reference<lang::XComponent> xShapeComponent(xShape, uno::UNO_QUERY);
xShapeComponent->dispose();
}
}
}
void ListsManager::lcl_attribute( Id nName, Value& rVal )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment