[Libreoffice-commits] core.git: 5 commits - sd/source writerperfect/CppunitTest_writerperfect_wpftimport.mk writerperfect/inc writerperfect/qa writerperfect/source

David Tardon dtardon at redhat.com
Wed Feb 15 09:18:04 UTC 2017


 sd/source/ui/slidesorter/view/SlsTheme.cxx             |    1 
 writerperfect/CppunitTest_writerperfect_wpftimport.mk  |    4 
 writerperfect/inc/DocumentHandlerForOdg.hxx            |   31 +++
 writerperfect/inc/DocumentHandlerForOdp.hxx            |   31 +++
 writerperfect/inc/DocumentHandlerForOds.hxx            |   31 +++
 writerperfect/inc/DocumentHandlerForOdt.hxx            |   31 +++
 writerperfect/qa/unit/DrawImportTest.cxx               |  154 +++++++++++++++++
 writerperfect/qa/unit/ImpressImportTest.cxx            |  154 +++++++++++++++++
 writerperfect/qa/unit/SpreadsheetImportTest.cxx        |  137 +++++++++++++++
 writerperfect/source/calc/DocumentHandlerForOds.hxx    |   31 ---
 writerperfect/source/draw/DocumentHandlerForOdg.hxx    |   31 ---
 writerperfect/source/impress/DocumentHandlerForOdp.hxx |   31 ---
 writerperfect/source/writer/DocumentHandlerForOdt.hxx  |   31 ---
 13 files changed, 573 insertions(+), 125 deletions(-)

New commits:
commit 3f60b31bc08aabd00d6499de5ee7d78ccb3d8f56
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Feb 15 10:17:39 2017 +0100

    WaE: control reaches end of non-void function
    
    Change-Id: I7186d7f6b1e51188e9ff13d654f8dcaa478fb452

diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx
index 1715406..7bc1b98 100644
--- a/sd/source/ui/slidesorter/view/SlsTheme.cxx
+++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx
@@ -182,6 +182,7 @@ ColorData Theme::GetGradientColor (
         case GradientColorClass::Fill1: return rDescriptor.maFillColor1;
         case GradientColorClass::Fill2: return rDescriptor.maFillColor2;
     }
+    return 0;
 }
 
 void Theme::SetGradient (
commit cf0fa3bbb0020e6734d5d9fec7ebf99946c94b56
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Feb 14 12:29:10 2017 +0100

    test result of presentation document import
    
    Change-Id: I4f7a9867a2fab4c49542a917aef9010e48c9b9b8

diff --git a/writerperfect/CppunitTest_writerperfect_wpftimport.mk b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
index 4cf414d..fb86265 100644
--- a/writerperfect/CppunitTest_writerperfect_wpftimport.mk
+++ b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
@@ -45,6 +45,7 @@ $(eval $(call gb_CppunitTest_use_configuration,writerperfect_wpftimport))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,writerperfect_wpftimport,\
 	writerperfect/qa/unit/DrawImportTest \
+	writerperfect/qa/unit/ImpressImportTest \
 	writerperfect/qa/unit/SpreadsheetImportTest \
 	writerperfect/qa/unit/TextImportTest \
 	writerperfect/qa/unit/wpftimport \
diff --git a/writerperfect/qa/unit/ImpressImportTest.cxx b/writerperfect/qa/unit/ImpressImportTest.cxx
new file mode 100644
index 0000000..c6a128c
--- /dev/null
+++ b/writerperfect/qa/unit/ImpressImportTest.cxx
@@ -0,0 +1,154 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <com/sun/star/drawing/XShapeDescriptor.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <cppuhelper/supportsservice.hxx>
+
+#include <rtl/ref.hxx>
+
+#include "DocumentHandlerForOdp.hxx"
+#include "ImportFilter.hxx"
+#include "WpftFilterFixture.hxx"
+#include "WpftLoader.hxx"
+#include "wpftimport.hxx"
+
+namespace
+{
+
+namespace uno = css::uno;
+
+class ImpressImportFilter : public writerperfect::ImportFilter<OdpGenerator>
+{
+public:
+    explicit ImpressImportFilter(const uno::Reference< uno::XComponentContext > &rxContext)
+        : writerperfect::ImportFilter<OdpGenerator>(rxContext) {}
+
+    // XServiceInfo
+    virtual rtl::OUString SAL_CALL getImplementationName() override;
+    virtual sal_Bool SAL_CALL supportsService(const rtl::OUString &ServiceName) override;
+    virtual uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() override;
+
+private:
+    virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, rtl::OUString &rTypeName) override;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdpGenerator &rGenerator, utl::MediaDescriptor &rDescriptor) override;
+
+    static void generate(librevenge::RVNGPresentationInterface &rDocument);
+};
+
+bool ImpressImportFilter::doImportDocument(librevenge::RVNGInputStream &, OdpGenerator &rGenerator, utl::MediaDescriptor &)
+{
+    ImpressImportFilter::generate(rGenerator);
+    return true;
+}
+
+bool ImpressImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
+{
+    rTypeName = "WpftDummyText";
+    return true;
+}
+
+// XServiceInfo
+rtl::OUString SAL_CALL ImpressImportFilter::getImplementationName()
+{
+    return OUString("org.libreoffice.comp.Wpft.QA.ImpressImportFilter");
+}
+
+sal_Bool SAL_CALL ImpressImportFilter::supportsService(const rtl::OUString &rServiceName)
+{
+    return cppu::supportsService(this, rServiceName);
+}
+
+uno::Sequence< rtl::OUString > SAL_CALL ImpressImportFilter::getSupportedServiceNames()
+{
+    return {"com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection"};
+}
+
+void ImpressImportFilter::generate(librevenge::RVNGPresentationInterface &rDocument)
+{
+    using namespace librevenge;
+
+    rDocument.startDocument(RVNGPropertyList());
+    RVNGPropertyList aProps;
+    aProps.insert("svg:width", 800);
+    aProps.insert("svg:height", 600);
+    rDocument.startSlide(aProps);
+    aProps.clear();
+    aProps.insert("svg:x", 50);
+    aProps.insert("svg:y", 50);
+    aProps.insert("svg:width", 200);
+    aProps.insert("svg:height", 100);
+    rDocument.startTextObject(aProps);
+    rDocument.openParagraph(RVNGPropertyList());
+    rDocument.openSpan(RVNGPropertyList());
+    rDocument.insertText("My hovercraft is full of eels.");
+    rDocument.closeSpan();
+    rDocument.closeParagraph();
+    rDocument.endTextObject();
+    rDocument.endSlide();
+    rDocument.endDocument();
+}
+
+}
+
+namespace
+{
+
+class ImpressImportTest : public writerperfect::test::WpftFilterFixture
+{
+public:
+    void test();
+
+    CPPUNIT_TEST_SUITE(ImpressImportTest);
+    CPPUNIT_TEST(test);
+    CPPUNIT_TEST_SUITE_END();
+};
+
+void ImpressImportTest::test()
+{
+    using namespace css;
+
+    rtl::Reference<ImpressImportFilter> xFilter{new ImpressImportFilter(m_xContext)};
+    writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(), "private:factory/sdraw", m_xDesktop, m_xContext);
+
+    uno::Reference<drawing::XDrawPagesSupplier> xDoc(aLoader.getDocument(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xDoc.is());
+    uno::Reference<drawing::XDrawPages> xPages = xDoc->getDrawPages();
+    CPPUNIT_ASSERT(xPages.is());
+    auto aPage = xPages->getByIndex(0);
+    uno::Reference<beans::XPropertySet> xPageProps;
+    CPPUNIT_ASSERT(aPage >>= xPageProps);
+    CPPUNIT_ASSERT(xPageProps.is());
+    sal_Int32 nProp = 0;
+    CPPUNIT_ASSERT(xPageProps->getPropertyValue("Height") >>= nProp);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(600), nProp);
+    CPPUNIT_ASSERT(xPageProps->getPropertyValue("Width") >>= nProp);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(800), nProp);
+    uno::Reference<drawing::XShapes> xShapes(xPageProps, uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xShapes.is());
+    auto aShape = xShapes->getByIndex(0);
+    uno::Reference<drawing::XShapeDescriptor> xShapeDesc;
+    CPPUNIT_ASSERT(aShape >>= xShapeDesc);
+    CPPUNIT_ASSERT(xShapeDesc.is());
+    CPPUNIT_ASSERT_EQUAL(rtl::OUString("com.sun.star.drawing.TextShape"), xShapeDesc->getShapeType());
+    uno::Reference<text::XText> xText(xShapeDesc, uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(rtl::OUString("My hovercraft is full of eels."), xText->getString());
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ImpressImportTest);
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e4dd3cd84218d211524b44e15a1676a9db3fc398
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Feb 14 12:25:45 2017 +0100

    test result of drawing document import
    
    Change-Id: If60a94ba67e29e3595c26e4b5d0c0b4f9790eff8

diff --git a/writerperfect/CppunitTest_writerperfect_wpftimport.mk b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
index 8b57296..4cf414d 100644
--- a/writerperfect/CppunitTest_writerperfect_wpftimport.mk
+++ b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
@@ -44,6 +44,7 @@ $(eval $(call gb_CppunitTest_use_rdbs,writerperfect_wpftimport,\
 $(eval $(call gb_CppunitTest_use_configuration,writerperfect_wpftimport))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,writerperfect_wpftimport,\
+	writerperfect/qa/unit/DrawImportTest \
 	writerperfect/qa/unit/SpreadsheetImportTest \
 	writerperfect/qa/unit/TextImportTest \
 	writerperfect/qa/unit/wpftimport \
diff --git a/writerperfect/qa/unit/DrawImportTest.cxx b/writerperfect/qa/unit/DrawImportTest.cxx
new file mode 100644
index 0000000..2c3d49c
--- /dev/null
+++ b/writerperfect/qa/unit/DrawImportTest.cxx
@@ -0,0 +1,154 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <com/sun/star/drawing/XShapeDescriptor.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <cppuhelper/supportsservice.hxx>
+
+#include <rtl/ref.hxx>
+
+#include "DocumentHandlerForOdg.hxx"
+#include "ImportFilter.hxx"
+#include "WpftFilterFixture.hxx"
+#include "WpftLoader.hxx"
+#include "wpftimport.hxx"
+
+namespace
+{
+
+namespace uno = css::uno;
+
+class DrawImportFilter : public writerperfect::ImportFilter<OdgGenerator>
+{
+public:
+    explicit DrawImportFilter(const uno::Reference< uno::XComponentContext > &rxContext)
+        : writerperfect::ImportFilter<OdgGenerator>(rxContext) {}
+
+    // XServiceInfo
+    virtual rtl::OUString SAL_CALL getImplementationName() override;
+    virtual sal_Bool SAL_CALL supportsService(const rtl::OUString &ServiceName) override;
+    virtual uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() override;
+
+private:
+    virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, rtl::OUString &rTypeName) override;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &rDescriptor) override;
+
+    static void generate(librevenge::RVNGDrawingInterface &rDocument);
+};
+
+bool DrawImportFilter::doImportDocument(librevenge::RVNGInputStream &, OdgGenerator &rGenerator, utl::MediaDescriptor &)
+{
+    DrawImportFilter::generate(rGenerator);
+    return true;
+}
+
+bool DrawImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
+{
+    rTypeName = "WpftDummyText";
+    return true;
+}
+
+// XServiceInfo
+rtl::OUString SAL_CALL DrawImportFilter::getImplementationName()
+{
+    return OUString("org.libreoffice.comp.Wpft.QA.DrawImportFilter");
+}
+
+sal_Bool SAL_CALL DrawImportFilter::supportsService(const rtl::OUString &rServiceName)
+{
+    return cppu::supportsService(this, rServiceName);
+}
+
+uno::Sequence< rtl::OUString > SAL_CALL DrawImportFilter::getSupportedServiceNames()
+{
+    return {"com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection"};
+}
+
+void DrawImportFilter::generate(librevenge::RVNGDrawingInterface &rDocument)
+{
+    using namespace librevenge;
+
+    rDocument.startDocument(RVNGPropertyList());
+    RVNGPropertyList aProps;
+    aProps.insert("svg:width", 800);
+    aProps.insert("svg:height", 600);
+    rDocument.startPage(aProps);
+    aProps.clear();
+    aProps.insert("svg:x", 50);
+    aProps.insert("svg:y", 50);
+    aProps.insert("svg:width", 200);
+    aProps.insert("svg:height", 100);
+    rDocument.startTextObject(aProps);
+    rDocument.openParagraph(RVNGPropertyList());
+    rDocument.openSpan(RVNGPropertyList());
+    rDocument.insertText("My hovercraft is full of eels.");
+    rDocument.closeSpan();
+    rDocument.closeParagraph();
+    rDocument.endTextObject();
+    rDocument.endPage();
+    rDocument.endDocument();
+}
+
+}
+
+namespace
+{
+
+class DrawImportTest : public writerperfect::test::WpftFilterFixture
+{
+public:
+    void test();
+
+    CPPUNIT_TEST_SUITE(DrawImportTest);
+    CPPUNIT_TEST(test);
+    CPPUNIT_TEST_SUITE_END();
+};
+
+void DrawImportTest::test()
+{
+    using namespace css;
+
+    rtl::Reference<DrawImportFilter> xFilter{new DrawImportFilter(m_xContext)};
+    writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(), "private:factory/sdraw", m_xDesktop, m_xContext);
+
+    uno::Reference<drawing::XDrawPagesSupplier> xDoc(aLoader.getDocument(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xDoc.is());
+    uno::Reference<drawing::XDrawPages> xPages = xDoc->getDrawPages();
+    CPPUNIT_ASSERT(xPages.is());
+    auto aPage = xPages->getByIndex(0);
+    uno::Reference<beans::XPropertySet> xPageProps;
+    CPPUNIT_ASSERT(aPage >>= xPageProps);
+    CPPUNIT_ASSERT(xPageProps.is());
+    sal_Int32 nProp = 0;
+    CPPUNIT_ASSERT(xPageProps->getPropertyValue("Height") >>= nProp);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(600), nProp);
+    CPPUNIT_ASSERT(xPageProps->getPropertyValue("Width") >>= nProp);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(800), nProp);
+    uno::Reference<drawing::XShapes> xShapes(xPageProps, uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xShapes.is());
+    auto aShape = xShapes->getByIndex(0);
+    uno::Reference<drawing::XShapeDescriptor> xShapeDesc;
+    CPPUNIT_ASSERT(aShape >>= xShapeDesc);
+    CPPUNIT_ASSERT(xShapeDesc.is());
+    CPPUNIT_ASSERT_EQUAL(rtl::OUString("com.sun.star.drawing.TextShape"), xShapeDesc->getShapeType());
+    uno::Reference<text::XText> xText(xShapeDesc, uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(rtl::OUString("My hovercraft is full of eels."), xText->getString());
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(DrawImportTest);
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 36cb6d1dc777b283bf10f7d89104f504bb624bff
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Feb 14 12:32:14 2017 +0100

    test result of spreadsheet document import
    
    Change-Id: I1cfc3c4c3c2d1c40cd97bfe6d72fb03ce8b11823

diff --git a/writerperfect/CppunitTest_writerperfect_wpftimport.mk b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
index cb2c2c5..8b57296 100644
--- a/writerperfect/CppunitTest_writerperfect_wpftimport.mk
+++ b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
@@ -44,6 +44,7 @@ $(eval $(call gb_CppunitTest_use_rdbs,writerperfect_wpftimport,\
 $(eval $(call gb_CppunitTest_use_configuration,writerperfect_wpftimport))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,writerperfect_wpftimport,\
+	writerperfect/qa/unit/SpreadsheetImportTest \
 	writerperfect/qa/unit/TextImportTest \
 	writerperfect/qa/unit/wpftimport \
 ))
diff --git a/writerperfect/qa/unit/SpreadsheetImportTest.cxx b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
new file mode 100644
index 0000000..d62e1e4
--- /dev/null
+++ b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <com/sun/star/table/XCell.hpp>
+#include <com/sun/star/table/XCellRange.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <cppuhelper/supportsservice.hxx>
+
+#include <rtl/ref.hxx>
+
+#include "DocumentHandlerForOds.hxx"
+#include "ImportFilter.hxx"
+#include "WpftFilterFixture.hxx"
+#include "WpftLoader.hxx"
+#include "wpftimport.hxx"
+
+namespace
+{
+
+namespace uno = css::uno;
+
+class SpreadsheetImportFilter : public writerperfect::ImportFilter<OdsGenerator>
+{
+public:
+    explicit SpreadsheetImportFilter(const uno::Reference< uno::XComponentContext > &rxContext)
+        : writerperfect::ImportFilter<OdsGenerator>(rxContext) {}
+
+    // XServiceInfo
+    virtual rtl::OUString SAL_CALL getImplementationName() override;
+    virtual sal_Bool SAL_CALL supportsService(const rtl::OUString &ServiceName) override;
+    virtual uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() override;
+
+private:
+    virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, rtl::OUString &rTypeName) override;
+    virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdsGenerator &rGenerator, utl::MediaDescriptor &rDescriptor) override;
+
+    static void generate(librevenge::RVNGSpreadsheetInterface &rDocument);
+};
+
+bool SpreadsheetImportFilter::doImportDocument(librevenge::RVNGInputStream &, OdsGenerator &rGenerator, utl::MediaDescriptor &)
+{
+    SpreadsheetImportFilter::generate(rGenerator);
+    return true;
+}
+
+bool SpreadsheetImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
+{
+    rTypeName = "WpftDummyText";
+    return true;
+}
+
+// XServiceInfo
+rtl::OUString SAL_CALL SpreadsheetImportFilter::getImplementationName()
+{
+    return OUString("org.libreoffice.comp.Wpft.QA.SpreadsheetImportFilter");
+}
+
+sal_Bool SAL_CALL SpreadsheetImportFilter::supportsService(const rtl::OUString &rServiceName)
+{
+    return cppu::supportsService(this, rServiceName);
+}
+
+uno::Sequence< rtl::OUString > SAL_CALL SpreadsheetImportFilter::getSupportedServiceNames()
+{
+    return {"com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection"};
+}
+
+void SpreadsheetImportFilter::generate(librevenge::RVNGSpreadsheetInterface &rDocument)
+{
+    using namespace librevenge;
+
+    rDocument.startDocument(RVNGPropertyList());
+    rDocument.openPageSpan(RVNGPropertyList());
+    rDocument.openSheet(RVNGPropertyList());
+    rDocument.openSheetRow(RVNGPropertyList());
+    rDocument.openSheetCell(RVNGPropertyList());
+    rDocument.openSpan(RVNGPropertyList());
+    rDocument.insertText("My hovercraft is full of eels.");
+    rDocument.closeSpan();
+    rDocument.closeSheetCell();
+    rDocument.closeSheetRow();
+    rDocument.closeSheet();
+    rDocument.closePageSpan();
+    rDocument.endDocument();
+}
+
+}
+
+namespace
+{
+
+class SpreadsheetImportTest : public writerperfect::test::WpftFilterFixture
+{
+public:
+    void test();
+
+    CPPUNIT_TEST_SUITE(SpreadsheetImportTest);
+    CPPUNIT_TEST(test);
+    CPPUNIT_TEST_SUITE_END();
+};
+
+void SpreadsheetImportTest::test()
+{
+    using namespace css;
+
+    rtl::Reference<SpreadsheetImportFilter> xFilter{new SpreadsheetImportFilter(m_xContext)};
+    writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(), "private:factory/scalc", m_xDesktop, m_xContext);
+
+    uno::Reference<sheet::XSpreadsheetDocument> xDoc(aLoader.getDocument(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xDoc.is());
+    uno::Reference<container::XIndexAccess> xSheets(xDoc->getSheets(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xSheets.is());
+    uno::Reference<table::XCellRange> xSheet(xSheets->getByIndex(0), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xSheet.is());
+    uno::Reference<table::XCell> xCell = xSheet->getCellByPosition(0, 0);
+    CPPUNIT_ASSERT(xCell.is());
+#if 0 // broken by commit 8154953add163554c00935486a1cf5677cef2609
+    CPPUNIT_ASSERT_EQUAL(table::CellContentType_TEXT, xCell->getType());
+    CPPUNIT_ASSERT_EQUAL(rtl::OUString("My hovercraft is full of eels"), xCell->getFormula());
+#endif
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(SpreadsheetImportTest);
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit c40b84c458b99a4655b1cdb10dee68236121fcae
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Feb 14 10:12:48 2017 +0100

    move headers used by tests to inc/
    
    Change-Id: Ice159ae9fcb7284143d9e4734b8cb34f5c6a2ec5

diff --git a/writerperfect/CppunitTest_writerperfect_wpftimport.mk b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
index 529f953..cb2c2c5 100644
--- a/writerperfect/CppunitTest_writerperfect_wpftimport.mk
+++ b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
@@ -11,7 +11,6 @@ $(eval $(call gb_CppunitTest_CppunitTest,writerperfect_wpftimport))
 
 $(eval $(call gb_CppunitTest_set_include,writerperfect_wpftimport,\
 	-I$(SRCDIR)/writerperfect/inc \
-	-I$(SRCDIR)/writerperfect/source/writer \
 	$$(INCLUDE) \
 ))
 
diff --git a/writerperfect/source/draw/DocumentHandlerForOdg.hxx b/writerperfect/inc/DocumentHandlerForOdg.hxx
similarity index 82%
rename from writerperfect/source/draw/DocumentHandlerForOdg.hxx
rename to writerperfect/inc/DocumentHandlerForOdg.hxx
index 23cc66f..4f64066 100644
--- a/writerperfect/source/draw/DocumentHandlerForOdg.hxx
+++ b/writerperfect/inc/DocumentHandlerForOdg.hxx
@@ -5,8 +5,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_WRITERPERFECT_SOURCE_DRAW_DOCUMENTHANDLERFORODG_HXX
-#define INCLUDED_WRITERPERFECT_SOURCE_DRAW_DOCUMENTHANDLERFORODG_HXX
+#ifndef INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODG_HXX
+#define INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODG_HXX
 
 #include <libodfgen/libodfgen.hxx>
 
diff --git a/writerperfect/source/impress/DocumentHandlerForOdp.hxx b/writerperfect/inc/DocumentHandlerForOdp.hxx
similarity index 81%
rename from writerperfect/source/impress/DocumentHandlerForOdp.hxx
rename to writerperfect/inc/DocumentHandlerForOdp.hxx
index fe8ae8d..8319047 100644
--- a/writerperfect/source/impress/DocumentHandlerForOdp.hxx
+++ b/writerperfect/inc/DocumentHandlerForOdp.hxx
@@ -5,8 +5,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_WRITERPERFECT_SOURCE_IMPRESS_DOCUMENTHANDLERFORODP_HXX
-#define INCLUDED_WRITERPERFECT_SOURCE_IMPRESS_DOCUMENTHANDLERFORODP_HXX
+#ifndef INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODP_HXX
+#define INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODP_HXX
 
 #include <libodfgen/libodfgen.hxx>
 
diff --git a/writerperfect/source/calc/DocumentHandlerForOds.hxx b/writerperfect/inc/DocumentHandlerForOds.hxx
similarity index 82%
rename from writerperfect/source/calc/DocumentHandlerForOds.hxx
rename to writerperfect/inc/DocumentHandlerForOds.hxx
index e10d452..e7762c4 100644
--- a/writerperfect/source/calc/DocumentHandlerForOds.hxx
+++ b/writerperfect/inc/DocumentHandlerForOds.hxx
@@ -5,8 +5,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_WRITERPERFECT_SOURCE_CALC_DOCUMENTHANDLERFORODS_HXX
-#define INCLUDED_WRITERPERFECT_SOURCE_CALC_DOCUMENTHANDLERFORODS_HXX
+#ifndef INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODS_HXX
+#define INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODS_HXX
 
 #include <libodfgen/libodfgen.hxx>
 
diff --git a/writerperfect/source/writer/DocumentHandlerForOdt.hxx b/writerperfect/inc/DocumentHandlerForOdt.hxx
similarity index 81%
rename from writerperfect/source/writer/DocumentHandlerForOdt.hxx
rename to writerperfect/inc/DocumentHandlerForOdt.hxx
index 791a8e8..8607119 100644
--- a/writerperfect/source/writer/DocumentHandlerForOdt.hxx
+++ b/writerperfect/inc/DocumentHandlerForOdt.hxx
@@ -5,8 +5,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_DOCUMENTHANDLERFORODT_HXX
-#define INCLUDED_WRITERPERFECT_SOURCE_WRITER_DOCUMENTHANDLERFORODT_HXX
+#ifndef INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODT_HXX
+#define INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODT_HXX
 
 #include <libodfgen/libodfgen.hxx>
 


More information about the Libreoffice-commits mailing list