summaryrefslogtreecommitdiff
path: root/lotuswordpro/source/filter/lwpfilter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lotuswordpro/source/filter/lwpfilter.cxx')
-rw-r--r--lotuswordpro/source/filter/lwpfilter.cxx151
1 files changed, 0 insertions, 151 deletions
diff --git a/lotuswordpro/source/filter/lwpfilter.cxx b/lotuswordpro/source/filter/lwpfilter.cxx
index c316cc750c8d..edf53d5aec92 100644
--- a/lotuswordpro/source/filter/lwpfilter.cxx
+++ b/lotuswordpro/source/filter/lwpfilter.cxx
@@ -130,157 +130,6 @@ void LWPFilterReader::cancel() throw (com::sun::star::uno::RuntimeException, std
{
}
-LWPFilterImportFilter::LWPFilterImportFilter( const uno::Reference< XMultiServiceFactory >& xFact )
-{
- try
- {
- uno::Reference< XDocumentHandler > xDoc( xFact->createInstance( OUString( STR_WRITER_IMPORTER_NAME ) ), UNO_QUERY );
-
- LWPFilterReader *p = new LWPFilterReader;
- p->setDocumentHandler( xDoc );
-
- uno::Reference< XImporter > xImporter = uno::Reference< XImporter >( xDoc, UNO_QUERY );
- rImporter = xImporter;
- uno::Reference< XFilter > xFilter = uno::Reference< XFilter >( p );
- rFilter = xFilter;
- }
- catch( Exception & )
- {
- exit( 1 );
- }
-}
-
-LWPFilterImportFilter::~LWPFilterImportFilter()
-{
-}
-
-sal_Bool LWPFilterImportFilter::filter( const Sequence< PropertyValue >& aDescriptor )
- throw( RuntimeException, std::exception )
-{
- sal_Bool ret = rFilter->filter( aDescriptor );
-
- return ret;
-}
-
-void LWPFilterImportFilter::cancel() throw (::com::sun::star::uno::RuntimeException, std::exception)
-{
- rFilter->cancel();
-}
-
-void LWPFilterImportFilter::setTargetDocument( const uno::Reference< XComponent >& xDoc )
- throw( IllegalArgumentException, RuntimeException, std::exception )
-{
- rImporter->setTargetDocument( xDoc );
-}
-
-OUString LWPFilterImportFilter::getImplementationName() throw(std::exception)
-{
- return OUString( STR_IMPLEMENTATION_NAME );
-}
-
-sal_Bool LWPFilterImportFilter::supportsService( const OUString& ServiceName ) throw(std::exception)
-{
- return cppu::supportsService(this, ServiceName);
-}
-
-Sequence< OUString> LWPFilterImportFilter::getSupportedServiceNames( void ) throw(std::exception)
-{
- Sequence< OUString > seq(1);
- seq[0] = STR_SERVICE_NAME;
- return seq;
-}
-
-OUString SAL_CALL LWPFilterImportFilter::detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
- throw (::com::sun::star::uno::RuntimeException, std::exception)
-{
- OUString ret;
- OUString aTypeName; // a name describing the type (from MediaDescriptor, usually from flat detection)
- // opening as template is done when a parameter tells to do so and a template filter can be detected
- // (otherwise no valid filter would be found) or if the detected filter is a template filter and
- // there is no parameter that forbids to open as template
- sal_Bool bOpenAsTemplate = sal_False;
- sal_Int32 nPropertyCount = aDescriptor.getLength();
- for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
- {
- if ( aDescriptor[nProperty].Name == "TypeName" )
- {
- aDescriptor[nProperty].Value >>= aTypeName;
- }
- else if ( aDescriptor[nProperty].Name == "AsTemplate" )
- {
- bOpenAsTemplate = sal_True;
- }
- }
-
- for( sal_Int32 i = 0; i < aDescriptor.getLength(); i++ )
- {
- OUString strTemp;
- aDescriptor[i].Value >>= strTemp;
- if ( aDescriptor[i].Name == "InputStream" )
- {
- uno::Reference< XInputStream> rInputStream;
- aDescriptor[i].Value >>= rInputStream;
-
- // TODO TRANSFORM IMPLEMENTATION HERE!!!!!!
- // and call m_DocumentHandler's SAX mDochods
-
- if( IsWordproFile(rInputStream) )
- {
- if ( aTypeName == "wordpro_template" )
- {
- if(!bOpenAsTemplate)
- {
- aDescriptor.realloc( nPropertyCount + 1 );
- aDescriptor[nPropertyCount].Name = "AsTemplate";
- aDescriptor[nPropertyCount].Value <<= sal_True;
- }
- return OUString("wordpro_template");
- }
- else
- {
- return OUString("wordpro");
- }
- }
- return ret;
- }
- else if ( aDescriptor[i].Name == "URL" )
- {
- OUString sURL;
-
- aDescriptor[i].Value >>= sURL;
- /*
- osl::FileBase::RC rc = osl::FileBase::getSystemPathFromFileURL( sURL, sFileName );
- if(rc != osl::FileBase::E_None)
- {
- SAXException except;
- except.Message = "GDocting system path from URL failed!";
- throw except;
- }
- */
- //end with .lwp:
- if( IsWordproFile(sURL) )
- {
- if ( aTypeName == "wordpro_template" )
- {
- if(!bOpenAsTemplate)
- {
- aDescriptor.realloc( nPropertyCount + 1 );
- aDescriptor[nPropertyCount].Name = "AsTemplate";
- aDescriptor[nPropertyCount].Value <<= sal_True;
- }
- return OUString("wordpro_template");
- }
- else
- {
- return OUString("wordpro");
- }
- }
- return ret;
- }
- }
- return ret;
-}
-
/**
* @descr decompressed small file
* @param pCompressed - real file stream