diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-01 01:11:28 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-01 11:13:16 +0100 |
commit | 247be4c2e6e31e73396cf7b9ce6abf37c617a2e2 (patch) | |
tree | b25ed90795db072b6fe611f2ae1fe564ce207e59 /sw | |
parent | d1e5860bc001f092477421cb871636f3b0071e28 (diff) |
clean-up sw's filters-test
filters-test does not initialize vcl, for these sort of tests use
macros_test
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/filters-test.cxx | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index a8682bdeeee3..99292710f515 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -32,9 +32,6 @@ #include <cppuhelper/implbase1.hxx> -#include <com/sun/star/document/XDocumentEventListener.hpp> -#include <com/sun/star/document/XDocumentEventBroadcaster.hpp> - #include <comphelper/processfactory.hxx> #include <sfx2/app.hxx> @@ -54,29 +51,6 @@ SO2_IMPL_REF(SwDocShell) using namespace ::com::sun::star; - -class EventListener - : public ::cppu::WeakImplHelper1<document::XDocumentEventListener> -{ -public: - bool m_bLayoutFinished; - explicit EventListener() : m_bLayoutFinished(false) { } - virtual void SAL_CALL documentEventOccured( - document::DocumentEvent const& rEvent) - throw (uno::RuntimeException) - { -// fprintf(stderr, "EVENT: %s\n", ::rtl::OUStringToOString(rEvent.EventName, RTL_TEXTENCODING_UTF8).getStr()); - if (rEvent.EventName.equalsAscii("OnLayoutFinished")) - { - m_bLayoutFinished = true; - } - } - virtual void SAL_CALL disposing(lang::EventObject const&) - throw (uno::RuntimeException) - { - } -}; - /* Implementation of Filters test */ class SwFiltersTest @@ -101,18 +75,6 @@ private: bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData) { - ::rtl::Reference<EventListener> xListener; - if (false) // does not work: missing ViewShell, no VCL timers, or both - { - xListener.set(new EventListener); - uno::Reference<document::XDocumentEventBroadcaster> xGEB; - xGEB.set(::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.frame.GlobalEventBroadcaster"))), - uno::UNO_QUERY_THROW); - xGEB->addDocumentEventListener( - uno::Reference<document::XDocumentEventListener>(xListener.get())); - } SfxFilter* pFilter = new SfxFilter( rFilter, rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(), @@ -122,19 +84,6 @@ bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ, true); pSrcMed->SetFilter(pFilter); bool bLoaded = xDocShRef->DoLoad(pSrcMed); - if (bLoaded && xListener.is()) - { - TimeValue delay = {0, 100000000}; - int tries(0); - while (!xListener->m_bLayoutFinished) { - osl_waitThread(& delay); - ++tries; - if (tries >= 300) { - fprintf(stderr, "timed out: no OnLayoutFinished received\n"); - break; - } - } - } if (xDocShRef.Is()) xDocShRef->DoClose(); return bLoaded; |