summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun <varun.dhall@studentpartner.com>2015-06-09 03:48:32 +0530
committerMichael Stahl <mstahl@redhat.com>2015-06-10 16:51:04 +0200
commitc979a944c7a00a35293d1de3c32b06f90e0bfa5f (patch)
treef8b8fc1e1dbe46da3b4dac555aeeeee75f8ff855
parent4deaf89bbeadf0395810ab5f1213aecf2b078c8b (diff)
Added Test for Export to Picture
Change-Id: I62d44e29cd4376f17270cef548d2cec6f4b621b9 Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index f48dd91293dd..acc31ae19e8d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -51,6 +51,7 @@
#include "com/sun/star/util/SearchAlgorithms.hpp"
#include "com/sun/star/i18n/TransliterationModulesExtra.hpp"
#include "com/sun/star/sdbcx/XTablesSupplier.hpp"
+#include <osl/file.hxx>
static const char* DATA_DIRECTORY = "/sw/qa/extras/uiwriter/data/";
@@ -90,6 +91,7 @@ public:
void testTdf68183();
void testCp1000115();
void testTdf90003();
+ void testExportToPicture();
void testSearchWithTransliterate();
void testTableBackgroundColor();
void testTdf90362();
@@ -130,6 +132,7 @@ public:
CPPUNIT_TEST(testTdf68183);
CPPUNIT_TEST(testCp1000115);
CPPUNIT_TEST(testTdf90003);
+ CPPUNIT_TEST(testExportToPicture);
CPPUNIT_TEST(testSearchWithTransliterate);
CPPUNIT_TEST(testTableBackgroundColor);
CPPUNIT_TEST(testTdf90362);
@@ -872,6 +875,32 @@ void SwUiWriterTest::testTdf90003()
assertXPath(pXmlDoc, "//Special[@nType='POR_FLY']", 0);
}
+void SwUiWriterTest::testExportToPicture()
+{
+ createDoc();
+ uno::Sequence<beans::PropertyValue> aFilterData =
+ {
+ beans::PropertyValue("PixelWidth", sal_Int32(0), uno::makeAny(sal_Int32(610)), beans::PropertyState_DIRECT_VALUE),
+ beans::PropertyValue("PixelHeight", sal_Int32(0), uno::makeAny(sal_Int32(610)), beans::PropertyState_DIRECT_VALUE)
+ };
+ uno::Sequence<beans::PropertyValue> aDescriptor =
+ {
+ beans::PropertyValue("FilterName", sal_Int32(0), uno::makeAny(OUString("writer_png_Export")), beans::PropertyState_DIRECT_VALUE),
+ beans::PropertyValue("FilterData", sal_Int32(0), uno::makeAny(aFilterData), beans::PropertyState_DIRECT_VALUE)
+ };
+ utl::TempFile aTempFile;
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ xStorable->storeToURL(aTempFile.GetURL(), aDescriptor);
+ sal_Bool extchk = aTempFile.IsValid();
+ CPPUNIT_ASSERT_EQUAL(sal_Bool(true), extchk);
+ osl::File tmpFile(aTempFile.GetURL());
+ tmpFile.open(sal_uInt32(osl_File_OpenFlag_Read));
+ sal_uInt64 val;
+ CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, tmpFile.getSize(val));
+ CPPUNIT_ASSERT(val > 100);
+ aTempFile.EnableKillingFile();
+}
+
void SwUiWriterTest::testSearchWithTransliterate()
{
SwDoc* pDoc = createDoc();