[Libreoffice-commits] core.git: sw/qa writerfilter/source
Tushar Bende
tushar.bende at synerzip.com
Wed Apr 16 01:44:24 PDT 2014
sw/qa/extras/ooxmlimport/data/test_extra_image.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 8 ++++++++
writerfilter/source/dmapper/NumberingManager.cxx | 10 ++++++++++
3 files changed, 18 insertions(+)
New commits:
commit cebb4abec105c2576b065853eb48af9be1d9fde6
Author: Tushar Bende <tushar.bende at synerzip.com>
Date: Fri Apr 11 22:47:33 2014 +0530
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/8940
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/qa/extras/ooxmlimport/data/test_extra_image.docx b/sw/qa/extras/ooxmlimport/data/test_extra_image.docx
new file mode 100644
index 0000000..cdb05af
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/test_extra_image.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 8961eed..6e3388b 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -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);
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index da88e52..17e359e 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -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 )
More information about the Libreoffice-commits
mailing list