diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 20:09:46 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 20:09:46 +0200 |
commit | ae2ebf8fac893aeb2a328918ce1b12ef6834f16d (patch) | |
tree | d75f454c5866f8c605245814daadd7fafa1ec98d /writerfilter/source/filter | |
parent | 6e135ba19ae197fa6b1ca65034ad3dc8876a6be0 (diff) | |
parent | 7aedcad054e814a904e8378a75632b42a3295e92 (diff) |
Merge branch 'master' into feature/gnumake4
Conflicts:
filter/source/config/cache/filtercache.cxx
filter/source/odfflatxml/makefile.mk
oox/Library_oox.mk
oox/Makefile
oox/Module_oox.mk
oox/Package_generated.mk
oox/Package_inc.mk
oox/prj/build.lst
oox/prj/d.lst
oox/prj/makefile.mk
oox/source/dump/makefile.mk
unoxml/Library_unordf.mk
unoxml/Library_unoxml.mk
writerfilter/CppunitTest_writerfilter_doctok.mk
writerfilter/Library_writerfilter.mk
writerfilter/Module_writerfilter.mk
writerfilter/Package_inc.mk
writerfilter/inc/resourcemodel/TagLogger.hxx
writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
writerfilter/prj/build.lst
writerfilter/prj/makefile.mk
writerfilter/qa/complex/ooxml/makefile.mk
writerfilter/qa/cppunittests/doctok/makefile.mk
writerfilter/qa/cppunittests/doctok/testdoctok.cxx
writerfilter/qa/cppunittests/xxml/testXXML.cxx
writerfilter/source/dmapper/DomainMapper.cxx
writerfilter/source/dmapper/DomainMapperTableHandler.cxx
writerfilter/source/dmapper/DomainMapperTableManager.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
writerfilter/source/dmapper/FontTable.cxx
writerfilter/source/dmapper/GraphicHelpers.cxx
writerfilter/source/dmapper/PropertyIds.cxx
writerfilter/source/dmapper/PropertyMap.cxx
writerfilter/source/dmapper/SettingsTable.cxx
writerfilter/source/dmapper/StyleSheetTable.cxx
writerfilter/source/dmapper/TablePropertiesHandler.cxx
writerfilter/source/dmapper/TblStylePrHandler.cxx
writerfilter/source/dmapper/ThemeTable.cxx
writerfilter/source/doctok/WW8DocumentImpl.cxx
writerfilter/source/doctok/resourcesimpl.xsl
writerfilter/source/filter/WriterFilter.cxx
writerfilter/source/generated.mk
writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
writerfilter/source/ooxml/OOXMLFactory.cxx
writerfilter/source/ooxml/OOXMLFactory.hxx
writerfilter/source/ooxml/OOXMLStreamImpl.cxx
writerfilter/source/ooxml/RefAndPointer.hxx
writerfilter/source/resourcemodel/TagLogger.cxx
writerfilter/unocomponent/component.cxx
writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx
writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx
Diffstat (limited to 'writerfilter/source/filter')
-rw-r--r-- | writerfilter/source/filter/ImportFilter.cxx | 63 | ||||
-rw-r--r-- | writerfilter/source/filter/RtfFilter.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/filter/RtfFilter.hxx | 6 | ||||
-rw-r--r-- | writerfilter/source/filter/WriterFilter.cxx | 14 | ||||
-rw-r--r-- | writerfilter/source/filter/WriterFilter.cxx.orig | 86 | ||||
-rw-r--r-- | writerfilter/source/filter/WriterFilter.hxx | 5 | ||||
-rw-r--r-- | writerfilter/source/filter/WriterFilterDetection.cxx | 43 | ||||
-rw-r--r-- | writerfilter/source/filter/WriterFilterDetection.hxx | 5 |
8 files changed, 160 insertions, 66 deletions
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx index 127c368bbc3f..f94d65590f48 100644 --- a/writerfilter/source/filter/ImportFilter.cxx +++ b/writerfilter/source/filter/ImportFilter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,13 +42,15 @@ #endif #include <resourcemodel/TagLogger.hxx> +#include <oox/ole/olestorage.hxx> +#include <oox/ole/vbaproject.hxx> +#include <oox/helper/graphichelper.hxx> using namespace ::rtl; using namespace ::com::sun::star; using ::comphelper::MediaDescriptor; -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) throw (uno::RuntimeException) { @@ -103,7 +106,9 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes writerfilter::dmapper::SourceDocumentType eType = (m_sFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_MS_Word_2007" ) ) || - m_sFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_MS_Word_2007_Template" ) )) ? + m_sFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_MS_Word_2007_Template" ) ) || + m_sFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_OOXML" ) ) || + m_sFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_OOXML_Text_Template" ) )) ? writerfilter::dmapper::DOCUMENT_OOXML : writerfilter::dmapper::DOCUMENT_DOC; writerfilter::Stream::Pointer_t pStream(new writerfilter::dmapper::DomainMapper(m_xContext, xInputStream, m_xDstDoc, eType)); //create the tokenizer and domain mapper @@ -122,6 +127,23 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes pDocument->setDrawPage(xDrawPage); pDocument->resolve(*pStream); + writerfilter::ooxml::OOXMLStream::Pointer_t pVBAProjectStream(writerfilter::ooxml::OOXMLDocumentFactory::createStream( pDocStream, writerfilter::ooxml::OOXMLStream::VBAPROJECT )); + oox::StorageRef xVbaPrjStrg( new ::oox::ole::OleStorage( m_xContext, pVBAProjectStream->getDocumentStream(), false ) ); + if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() ) + { + ::oox::ole::VbaProject aVbaProject( m_xContext, xModel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Writer" ) ) ); + uno::Reference< frame::XFrame > xFrame = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_FRAME(), uno::Reference< frame::XFrame > () ); + + // if no XFrame try fallback to what we can glean from the Model + if ( !xFrame.is() ) + { + uno::Reference< frame::XController > xController = xModel->getCurrentController(); + xFrame = xController.is() ? xController->getFrame() : NULL; + } + + oox::GraphicHelper gHelper( m_xContext, xFrame, xVbaPrjStrg ); + aVbaProject.importVbaProject( *xVbaPrjStrg, gHelper ); + } } else { @@ -131,10 +153,10 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes pDocument->resolve(*pStream); } + pStream.reset(); #ifdef DEBUG_IMPORT - writerfilter::TagLogger::dump("DOMAINMAPPER"); + dmapperLogger->endDocument(); - writerfilter::TagLogger::dump("DEBUG"); debugLogger->endDocument(); #endif @@ -142,16 +164,14 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes } return sal_False; } -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + void WriterFilter::cancel( ) throw (uno::RuntimeException) { } -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + void WriterFilter::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc ) throw (lang::IllegalArgumentException, uno::RuntimeException) { @@ -164,9 +184,8 @@ void WriterFilter::setSourceDocument( const uno::Reference< lang::XComponent >& m_xSrcDoc = xDoc; } -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + void WriterFilter::initialize( const uno::Sequence< uno::Any >& aArguments ) throw (uno::Exception, uno::RuntimeException) { uno::Sequence < beans::PropertyValue > aAnySeq; @@ -185,9 +204,8 @@ void WriterFilter::initialize( const uno::Sequence< uno::Any >& aArguments ) thr } } } -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + OUString WriterFilter_getImplementationName () throw (uno::RuntimeException) { return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.WriterFilter" ) ); @@ -195,17 +213,15 @@ OUString WriterFilter_getImplementationName () throw (uno::RuntimeException) #define SERVICE_NAME1 "com.sun.star.document.ImportFilter" #define SERVICE_NAME2 "com.sun.star.document.ExportFilter" -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + sal_Bool WriterFilter_supportsService( const OUString& ServiceName ) throw (uno::RuntimeException) { return (ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) || ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) )); } -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + uno::Sequence< OUString > WriterFilter_getSupportedServiceNames( ) throw (uno::RuntimeException) { uno::Sequence < OUString > aRet(2); @@ -217,34 +233,31 @@ uno::Sequence< OUString > WriterFilter_getSupportedServiceNames( ) throw (uno:: #undef SERVICE_NAME1 #undef SERVICE_NAME2 -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + uno::Reference< uno::XInterface > WriterFilter_createInstance( const uno::Reference< uno::XComponentContext >& xContext) throw( uno::Exception ) { return (cppu::OWeakObject*) new WriterFilter( xContext ); } -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + OUString WriterFilter::getImplementationName( ) throw (uno::RuntimeException) { return WriterFilter_getImplementationName(); } -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + sal_Bool WriterFilter::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException) { return WriterFilter_supportsService( rServiceName ); } -/*-- 09.06.2006 10:15:20--------------------------------------------------- - -----------------------------------------------------------------------*/ + uno::Sequence< OUString > WriterFilter::getSupportedServiceNames( ) throw (uno::RuntimeException) { return WriterFilter_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx index 040843afd7ce..b018aed2cfda 100644 --- a/writerfilter/source/filter/RtfFilter.cxx +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -1,8 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. * Copyright 2010 Miklos Vajna. * * OpenOffice.org - a multi-platform office productivity suite @@ -143,4 +143,4 @@ uno::Reference< uno::XInterface > RtfFilter_createInstance( const uno::Reference return (cppu::OWeakObject*) new RtfFilter( xContext ); } -/* vi:set shiftwidth=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/filter/RtfFilter.hxx b/writerfilter/source/filter/RtfFilter.hxx index 3a4be622ab17..03488db64ff1 100644 --- a/writerfilter/source/filter/RtfFilter.hxx +++ b/writerfilter/source/filter/RtfFilter.hxx @@ -1,8 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. * Copyright 2010 Miklos Vajna. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,8 @@ #include <cppuhelper/implbase5.hxx> #include <WriterFilterDllApi.hxx> -class WRITERFILTER_DLLPUBLIC RtfFilter : public cppu::WeakImplHelper5 +/// Common RTF filter, calls RtfImportFilter and RtfExportFilter via UNO. +class WRITERFILTER_WRITERFILTER_DLLPUBLIC RtfFilter : public cppu::WeakImplHelper5 < com::sun::star::document::XFilter, com::sun::star::document::XImporter, @@ -100,3 +101,4 @@ public: throw( ::com::sun::star::uno::Exception ); #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 97d5b3a74895..1e039d6febc6 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,16 +37,14 @@ using namespace ::rtl; using namespace ::cppu; using namespace ::com::sun::star; -/*-- 22.02.2007 12:19:23--------------------------------------------------- - -----------------------------------------------------------------------*/ + WriterFilter::WriterFilter( const uno::Reference< uno::XComponentContext >& rxContext) : m_xContext( rxContext ) { } -/*-- 22.02.2007 12:19:23--------------------------------------------------- - -----------------------------------------------------------------------*/ + WriterFilter::~WriterFilter() { } @@ -61,14 +60,12 @@ static struct ::cppu::ImplementationEntry s_component_entries [] = { 0, 0, 0, 0, 0, 0 } // terminate with NULL }; -SAL_DLLPUBLIC_EXPORT void SAL_CALL -component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT void * SAL_CALL -component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) { return ::cppu::component_getFactoryHelper(implName, xMgr, xRegistry, s_component_entries ); } @@ -76,3 +73,4 @@ component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiSe } //extern "C" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/filter/WriterFilter.cxx.orig b/writerfilter/source/filter/WriterFilter.cxx.orig new file mode 100644 index 000000000000..95c083598db8 --- /dev/null +++ b/writerfilter/source/filter/WriterFilter.cxx.orig @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_ +#include <cppuhelper/implementationentry.hxx> +#endif +#include <WriterFilter.hxx> +#include <WriterFilterDetection.hxx> +#include <RtfFilter.hxx> + +using namespace ::rtl; +using namespace ::cppu; +using namespace ::com::sun::star; + + + +WriterFilter::WriterFilter( const uno::Reference< uno::XComponentContext >& rxContext) : + m_xContext( rxContext ) +{ +} + + +WriterFilter::~WriterFilter() +{ +} + +extern "C" +{ +/* shared lib exports implemented with helpers */ +static struct ::cppu::ImplementationEntry s_component_entries [] = +{ + { WriterFilter_createInstance, WriterFilter_getImplementationName, WriterFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }, + { WriterFilterDetection_createInstance, WriterFilterDetection_getImplementationName, WriterFilterDetection_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0} , + { RtfFilter_createInstance, RtfFilter_getImplementationName, RtfFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }, + { 0, 0, 0, 0, 0, 0 } // terminate with NULL +}; + +<<<<<<< HEAD +SAL_DLLPUBLIC_EXPORT void SAL_CALL +component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) +======= +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) +>>>>>>> master +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +<<<<<<< HEAD +SAL_DLLPUBLIC_EXPORT void * SAL_CALL +component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) +======= +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) +>>>>>>> master +{ + return ::cppu::component_getFactoryHelper(implName, xMgr, xRegistry, s_component_entries ); +} + +} //extern "C" + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/filter/WriterFilter.hxx b/writerfilter/source/filter/WriterFilter.hxx index 0d4cb7a3a711..a2b2fb7a4b5b 100644 --- a/writerfilter/source/filter/WriterFilter.hxx +++ b/writerfilter/source/filter/WriterFilter.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,7 +38,8 @@ #include <cppuhelper/implbase5.hxx> #include <WriterFilterDllApi.hxx> -class WRITERFILTER_DLLPUBLIC WriterFilter : public cppu::WeakImplHelper5 +/// Common DOC/DOCX filter, calls DocxExportFilter via UNO or does the DOC (currently unused) / DOCX import. +class WRITERFILTER_WRITERFILTER_DLLPUBLIC WriterFilter : public cppu::WeakImplHelper5 < com::sun::star::document::XFilter, com::sun::star::document::XImporter, @@ -102,3 +104,4 @@ sal_Bool SAL_CALL WriterFilter_supportsService( const ::rtl::OUString& ServiceNa throw( ::com::sun::star::uno::Exception ); #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/filter/WriterFilterDetection.cxx b/writerfilter/source/filter/WriterFilterDetection.cxx index 87da1861cbae..994ac218f221 100644 --- a/writerfilter/source/filter/WriterFilterDetection.cxx +++ b/writerfilter/source/filter/WriterFilterDetection.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,41 +31,34 @@ #include <comphelper/storagehelper.hxx> #include <com/sun/star/io/XInputStream.hpp> #include <sot/storage.hxx> -//#ifndef _SFXDOCFILE_HXX //todo: remove sfx2! -//#include <sfx2/docfile.hxx> -//#endif #include <unotools/ucbstreamhelper.hxx> using namespace ::rtl; using namespace ::cppu; using namespace ::com::sun::star; -/*-- 22.02.2007 12:17:53--------------------------------------------------- - -----------------------------------------------------------------------*/ + WriterFilterDetection::WriterFilterDetection( const uno::Reference< uno::XComponentContext >& rxContext) : m_xContext( rxContext ) { } -/*-- 22.02.2007 12:17:53--------------------------------------------------- - -----------------------------------------------------------------------*/ + WriterFilterDetection::~WriterFilterDetection() { } -/*-- 22.02.2007 12:11:38--------------------------------------------------- - -----------------------------------------------------------------------*/ + OUString WriterFilterDetection_getImplementationName () throw (uno::RuntimeException) { return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.WriterFilterDetector" ) ); } #define SERVICE_NAME1 "com.sun.star.document.ExtendedTypeDetection" -/*-- 22.02.2007 12:11:38--------------------------------------------------- - -----------------------------------------------------------------------*/ + OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& rDescriptor ) throw( uno::RuntimeException ) { @@ -99,10 +93,10 @@ OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& r { SotStorageRef xStg = new SotStorage( pStream, sal_False ); - bool bTable2 = xStg->IsContained( rtl::OUString::createFromAscii("1Table" )); + bool bTable2 = xStg->IsContained( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1Table"))); SotStorageStreamRef xRef = - xStg->OpenSotStream(rtl::OUString::createFromAscii("WordDocument"), + xStg->OpenSotStream(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WordDocument")), STREAM_STD_READ | STREAM_NOCREATE ); @@ -119,7 +113,7 @@ OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& r else { uno::Reference< embed::XStorage > xDocStorage; - if( sURL.equalsAscii( "private:stream" ) ) + if( sURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "private:stream" ) ) ) xDocStorage = comphelper::OStorageHelper::GetStorageFromInputStream( xInputStream ); else xDocStorage = comphelper::OStorageHelper::GetStorageFromURL( @@ -144,22 +138,20 @@ OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& r } catch(const uno::Exception&) { - OSL_ASSERT("exception while opening storage"); + OSL_FAIL("exception while opening storage"); } if( !bWord ) sTypeName = ::rtl::OUString(); return sTypeName; } -/*-- 22.02.2007 12:11:38--------------------------------------------------- - -----------------------------------------------------------------------*/ + sal_Bool WriterFilterDetection_supportsService( const OUString& ServiceName ) throw (uno::RuntimeException) { return (ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) ); } -/*-- 22.02.2007 12:11:38--------------------------------------------------- - -----------------------------------------------------------------------*/ + uno::Sequence< OUString > WriterFilterDetection_getSupportedServiceNames( ) throw (uno::RuntimeException) { uno::Sequence < OUString > aRet(1); @@ -168,33 +160,30 @@ uno::Sequence< OUString > WriterFilterDetection_getSupportedServiceNames( ) thr return aRet; } #undef SERVICE_NAME1 -/*-- 22.02.2007 12:11:38--------------------------------------------------- - -----------------------------------------------------------------------*/ + uno::Reference< uno::XInterface > WriterFilterDetection_createInstance( const uno::Reference< uno::XComponentContext >& xContext) throw( uno::Exception ) { return (cppu::OWeakObject*) new WriterFilterDetection( xContext ); } -/*-- 22.02.2007 12:11:38--------------------------------------------------- - -----------------------------------------------------------------------*/ + OUString WriterFilterDetection::getImplementationName( ) throw (uno::RuntimeException) { return WriterFilterDetection_getImplementationName(); } -/*-- 22.02.2007 12:11:38--------------------------------------------------- - -----------------------------------------------------------------------*/ + sal_Bool WriterFilterDetection::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException) { return WriterFilterDetection_supportsService( rServiceName ); } -/*-- 22.02.2007 12:11:38--------------------------------------------------- - -----------------------------------------------------------------------*/ + uno::Sequence< OUString > WriterFilterDetection::getSupportedServiceNames( ) throw (uno::RuntimeException) { return WriterFilterDetection_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/filter/WriterFilterDetection.hxx b/writerfilter/source/filter/WriterFilterDetection.hxx index a5e8149d68c2..f7caa549d6d8 100644 --- a/writerfilter/source/filter/WriterFilterDetection.hxx +++ b/writerfilter/source/filter/WriterFilterDetection.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,7 +34,8 @@ #include <cppuhelper/implbase2.hxx> #include <WriterFilterDllApi.hxx> -class WRITERFILTER_DLLPUBLIC WriterFilterDetection : public cppu::WeakImplHelper2 +/// File format detection service for DOC (unused) / DOCX. +class WRITERFILTER_WRITERFILTER_DLLPUBLIC WriterFilterDetection : public cppu::WeakImplHelper2 < com::sun::star::document::XExtendedFilterDetection, com::sun::star::lang::XServiceInfo @@ -74,3 +76,4 @@ sal_Bool SAL_CALL WriterFilterDetection_supportsService( const ::rtl::OUString& #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |