Kaydet (Commit) 85ff539b authored tarafından Pallavi Jadhav's avatar Pallavi Jadhav Kaydeden (comit) Miklos Vajna

Added Unit test for PNG Crop image in Export.

Reviewed on:
	https://gerrit.libreoffice.org/6677

Change-Id: I766460915775791388850691b3b940fe32190052
üst 93a23d11
...@@ -94,7 +94,8 @@ protected: ...@@ -94,7 +94,8 @@ protected:
"math-escape.docx", "math-escape.docx",
"math-mso2k7.docx", "math-mso2k7.docx",
"ImageCrop.docx", "ImageCrop.docx",
"test_GIF_ImageCrop.docx" "test_GIF_ImageCrop.docx",
"test_PNG_ImageCrop.docx"
}; };
std::vector<const char*> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist)); std::vector<const char*> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist));
...@@ -1857,6 +1858,26 @@ DECLARE_OOXML_TEST(testGIFImageCrop, "test_GIF_ImageCrop.docx") ...@@ -1857,6 +1858,26 @@ DECLARE_OOXML_TEST(testGIFImageCrop, "test_GIF_ImageCrop.docx")
CPPUNIT_ASSERT_EQUAL( sal_Int32( 1448 ), aGraphicCropStruct.Bottom ); CPPUNIT_ASSERT_EQUAL( sal_Int32( 1448 ), aGraphicCropStruct.Bottom );
} }
DECLARE_OOXML_TEST(testPNGImageCrop, "test_PNG_ImageCrop.docx")
{
/* The problem was image cropping information was not getting saved
* after roundtrip.
* Check for presenece of cropping parameters in exported file.
*/
uno::Reference<drawing::XShape> image = getShape(1);
uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
::com::sun::star::text::GraphicCrop aGraphicCropStruct;
imageProperties->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct;
// FIXME import test is disabled (we only check after import-export-import)
// The reason is that after import this is 1141 -- why?
CPPUNIT_ASSERT_EQUAL( sal_Int32( 1231 ), aGraphicCropStruct.Left );
CPPUNIT_ASSERT_EQUAL( sal_Int32( 1295 ), aGraphicCropStruct.Right );
CPPUNIT_ASSERT_EQUAL( sal_Int32( 1358 ), aGraphicCropStruct.Top );
CPPUNIT_ASSERT_EQUAL( sal_Int32( 737 ), aGraphicCropStruct.Bottom );
}
#endif #endif
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
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