From de47a96d3e0984dea8281aef00b87e0e618e8fee Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 2 Oct 2015 09:12:07 +0100 Subject: Revert "vcl event filter" that's just a local toy for now, didn't intended to push that This reverts commit 4afbd0292e09d9850a3cd0d1f169c73c5a3296db. Change-Id: I20b758d4582022ffda35c4aed7251948e721f821 --- filter/Configuration_filter.mk | 1 - filter/Library_vcleventfilter.mk | 36 ------ filter/Module_filter.mk | 1 - .../config/fragments/filters/VclEventDocument.xcu | 19 --- .../fragments/types/filters_Vcl_Event_Document.xcu | 18 --- .../source/vcleventfilter/vcleventfilter.component | 15 --- filter/source/vcleventfilter/vcleventfilter.cxx | 137 --------------------- filter/source/vcleventfilter/vcleventfilter.hxx | 66 ---------- 8 files changed, 293 deletions(-) delete mode 100644 filter/Library_vcleventfilter.mk delete mode 100644 filter/source/config/fragments/filters/VclEventDocument.xcu delete mode 100644 filter/source/config/fragments/types/filters_Vcl_Event_Document.xcu delete mode 100644 filter/source/vcleventfilter/vcleventfilter.component delete mode 100644 filter/source/vcleventfilter/vcleventfilter.cxx delete mode 100644 filter/source/vcleventfilter/vcleventfilter.hxx (limited to 'filter') diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk index 3e126b3af42b..5fe58b0e3aca 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk @@ -312,7 +312,6 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu calc_MS_Excel_40 \ calc_MS_Excel_5095 \ calc_MS_Excel_95 \ - filters_Vcl_Event_Document \ writer_MS_WinWord_5 \ writer_MS_WinWord_60 \ writer_MS_Word_95 \ diff --git a/filter/Library_vcleventfilter.mk b/filter/Library_vcleventfilter.mk deleted file mode 100644 index 0009312691be..000000000000 --- a/filter/Library_vcleventfilter.mk +++ /dev/null @@ -1,36 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -#************************************************************************* -# -# 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/. -# -#************************************************************************* - -$(eval $(call gb_Library_Library,vcleventfilter)) - -$(eval $(call gb_Library_set_componentfile,vcleventfilter,filter/source/vcleventfilter/vcleventfilter)) - -$(eval $(call gb_Library_use_external,vcleventfilter,boost_headers)) - -$(eval $(call gb_Library_use_sdk_api,vcleventfilter)) - -$(eval $(call gb_Library_use_libraries,vcleventfilter,\ - comphelper \ - ucbhelper \ - cppuhelper \ - cppu \ - sal \ - tl \ - utl \ - svt \ - $(gb_UWINAPI) \ -)) - -$(eval $(call gb_Library_add_exception_objects,vcleventfilter,\ - filter/source/vcleventfilter/vcleventfilter \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk index 668bd545bdab..4af530cd9130 100644 --- a/filter/Module_filter.mk +++ b/filter/Module_filter.mk @@ -55,7 +55,6 @@ $(eval $(call gb_Module_add_targets,filter,\ Library_graphicfilter \ Library_t602filter \ Library_textfd \ - Library_vcleventfilter \ Library_xmlfa \ Library_xmlfd \ Library_xsltdlg \ diff --git a/filter/source/config/fragments/filters/VclEventDocument.xcu b/filter/source/config/fragments/filters/VclEventDocument.xcu deleted file mode 100644 index d58a11376d49..000000000000 --- a/filter/source/config/fragments/filters/VclEventDocument.xcu +++ /dev/null @@ -1,19 +0,0 @@ - - - IMPORT ALIEN 3RDPARTYFILTER PREFERRED - - com.sun.star.comp.filters.VclEventFilter - - VclEvent Document - - 0 - filters_Vcl_Event_Document - - com.sun.star.text.TextDocument - diff --git a/filter/source/config/fragments/types/filters_Vcl_Event_Document.xcu b/filter/source/config/fragments/types/filters_Vcl_Event_Document.xcu deleted file mode 100644 index 683464a0a48c..000000000000 --- a/filter/source/config/fragments/types/filters_Vcl_Event_Document.xcu +++ /dev/null @@ -1,18 +0,0 @@ - - - com.sun.star.comp.filters.VclEventFilter - - vcl - true - VclEventDocument - - VCL Event Document - - - diff --git a/filter/source/vcleventfilter/vcleventfilter.component b/filter/source/vcleventfilter/vcleventfilter.component deleted file mode 100644 index aa1d9db430f4..000000000000 --- a/filter/source/vcleventfilter/vcleventfilter.component +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - diff --git a/filter/source/vcleventfilter/vcleventfilter.cxx b/filter/source/vcleventfilter/vcleventfilter.cxx deleted file mode 100644 index 485fa6d6f301..000000000000 --- a/filter/source/vcleventfilter/vcleventfilter.cxx +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- 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 "vcleventfilter.hxx" - -#include -#include -#include -#include - -OUString VclEventFilter_getImplementationName() - throw (css::uno::RuntimeException) -{ - return OUString ( "com.sun.star.comp.filters.VclEventFilter" ); -} - -css::uno::Sequence SAL_CALL VclEventFilter_getSupportedServiceNames() - throw (css::uno::RuntimeException) -{ - css::uno::Sequence aRet(2); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.document.ImportFilter"; - pArray[1] = "com.sun.star.document.ExtendedTypeDetection"; - return aRet; -} - -css::uno::Reference SAL_CALL VclEventFilter_createInstance(const css::uno::Reference & rSMgr) - throw (css::uno::Exception) -{ - return static_cast(new VclEventFilter( rSMgr )); -} - -extern "C" -{ - SAL_DLLPUBLIC_EXPORT void * SAL_CALL vcleventfilter_component_getFactory( - const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) - { - void * pRet = 0; - - OUString implName = OUString::createFromAscii( pImplName ); - if ( pServiceManager && implName.equals(VclEventFilter_getImplementationName()) ) - { - css::uno::Reference xFactory( - cppu::createSingleFactory( - static_cast(pServiceManager), - OUString::createFromAscii( pImplName ), - VclEventFilter_createInstance, VclEventFilter_getSupportedServiceNames())); - - if (xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } - - return pRet; - } -} - -VclEventFilter::VclEventFilter(const css::uno::Reference &r) - : mxMSF(r) -{ -} - -VclEventFilter::~VclEventFilter() -{ -} - -// XExtendedTypeDetection -OUString VclEventFilter::detect(css::uno::Sequence& rDescriptor) - throw (css::uno::RuntimeException, std::exception) -{ - fprintf(stderr, "trying detect\n"); - - sal_Int32 nLength = rDescriptor.getLength(); - const css::beans::PropertyValue *pValue = rDescriptor.getConstArray(); - for (sal_Int32 i = 0 ; i < nLength; ++i) - { - if (pValue[i].Name == "InputStream") - pValue[i].Value >>= mxInputStream; - } - - if (!mxInputStream.is()) - return OUString(); - - css::uno::Sequence< sal_Int8 > aData; - const size_t numBytes = 3; - size_t numBytesRead = mxInputStream->readSomeBytes(aData, numBytes); - - if (numBytesRead != numBytes || aData[0] != 'V' || aData[1] != 'C' || aData[2] != 'L') - return OUString(); - - return OUString("filters_Vcl_Event_Document"); -} - -// XFilter -sal_Bool SAL_CALL VclEventFilter::filter(const css::uno::Sequence& /*rDescriptor*/) - throw (css::uno::RuntimeException, std::exception) -{ - fprintf(stderr, "ta-da"); - return true; -} - -// XImporter -void SAL_CALL VclEventFilter::setTargetDocument(const css::uno::Reference& xDoc) - throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) -{ - mxDoc = xDoc; -} - -// XServiceInfo -OUString SAL_CALL VclEventFilter::getImplementationName() - throw (css::uno::RuntimeException, std::exception) -{ - return VclEventFilter_getImplementationName(); -} - -sal_Bool SAL_CALL VclEventFilter::supportsService(const OUString& rServiceName) - throw (css::uno::RuntimeException, std::exception) -{ - return cppu::supportsService( this, rServiceName ); -} - -css::uno::Sequence< OUString > SAL_CALL VclEventFilter::getSupportedServiceNames( ) - throw (css::uno::RuntimeException, std::exception) -{ - return VclEventFilter_getSupportedServiceNames(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/vcleventfilter/vcleventfilter.hxx b/filter/source/vcleventfilter/vcleventfilter.hxx deleted file mode 100644 index 7d6f2ee3da2e..000000000000 --- a/filter/source/vcleventfilter/vcleventfilter.hxx +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- 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/. - * - */ - -#ifndef INCLUDED_FILTER_SOURCE_VCLEVENT_VCLEVENTFILTER_HXX -#define INCLUDED_FILTER_SOURCE_VCLEVENT_VCLEVENTFILTER_HXX - -#include -#include -#include -#include -#include -#include -#include - -class VclEventFilter : public cppu::WeakImplHelper - < css::document::XFilter, - css::document::XImporter, - css::document::XExtendedFilterDetection, - css::lang::XServiceInfo > -{ -private: - css::uno::Reference< css::lang::XMultiServiceFactory > mxMSF; - css::uno::Reference< css::lang::XComponent > mxDoc; - css::uno::Reference < css::io::XInputStream > mxInputStream; - - bool SAL_CALL importImpl( const css::uno::Sequence< css::beans::PropertyValue >& aDescriptor ) - throw (css::uno::RuntimeException); - - public: - VclEventFilter(const css::uno::Reference &r ); - virtual ~VclEventFilter(); - - // XFilter - virtual sal_Bool SAL_CALL filter( const css::uno::Sequence< css::beans::PropertyValue >& aDescriptor ) - throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL cancel( ) - throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE {}; - - // XImporter - virtual void SAL_CALL setTargetDocument( const css::uno::Reference< css::lang::XComponent >& xDoc ) - throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // XExtendedTypeDetection - virtual OUString SAL_CALL detect( - css::uno::Sequence< css::beans::PropertyValue >& Descriptor ) - throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName( ) - throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) - throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) - throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit