summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--filter/inc/filter.hrc74
-rw-r--r--filter/prj/build.lst4
-rw-r--r--filter/source/filtertracer/exports.dxp3
-rw-r--r--filter/source/filtertracer/filtertracer.cxx289
-rw-r--r--filter/source/filtertracer/filtertracer.hxx248
-rw-r--r--filter/source/filtertracer/filtertraceruno.cxx141
-rw-r--r--filter/source/filtertracer/makefile.mk117
-rw-r--r--filter/source/flash/impswfdialog.src28
-rw-r--r--filter/source/flash/makefile.mk5
-rw-r--r--filter/source/flash/swfwriter.cxx8
-rw-r--r--filter/source/pdf/impdialog.cxx39
-rw-r--r--filter/source/pdf/impdialog.hrc6
-rw-r--r--filter/source/pdf/impdialog.src64
-rw-r--r--filter/source/pdf/makefile.mk7
-rw-r--r--filter/source/pdf/pdf.hrc63
-rw-r--r--filter/source/pdf/pdf.src94
-rw-r--r--filter/source/pdf/pdfexport.cxx57
-rw-r--r--filter/source/svg/makefile.mk8
-rw-r--r--filter/source/svg/svgexport.cxx166
-rw-r--r--filter/source/svg/svgfilter.cxx7
-rw-r--r--filter/source/svg/svgfilter.hxx8
-rw-r--r--filter/source/svg/svgscript.hxx184
-rw-r--r--filter/source/xmlfilterdetect/fdcomp.cxx270
-rw-r--r--filter/source/xmlfilterdetect/filterdetect.cxx418
-rw-r--r--filter/source/xmlfilterdetect/filterdetect.hxx222
-rw-r--r--filter/source/xmlfilterdetect/makefile.mk104
26 files changed, 2377 insertions, 257 deletions
diff --git a/filter/inc/filter.hrc b/filter/inc/filter.hrc
new file mode 100644
index 000000000000..de2a98eb9b79
--- /dev/null
+++ b/filter/inc/filter.hrc
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * $RCSfile: filter.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _FILTER_HRC
+#define _FILTER_HRC
+
+// include ---------------------------------------------------------------
+
+#include <svtools/solar.hrc>
+
+// Help-Ids --------------------------------------------------------------
+
+#define RID_PDF_EXPORT_DLG (RID_FILTER_START + 0)
+
+#endif
+
diff --git a/filter/prj/build.lst b/filter/prj/build.lst
index af1e4caad302..1c83fdd30036 100644
--- a/filter/prj/build.lst
+++ b/filter/prj/build.lst
@@ -1,10 +1,12 @@
fl filter : svtools unotools goodies xmloff svx NULL
fl filter usr1 - all fl_mkout NULL
fl filter\prj get - all fl_prj NULL
-fl filter\source\jars nmake - all fl_javafilter_binaries NULL
+fl filter\source\jars nmake - all fl_javafilter_binaries NULL
fl filter\source\xmlfilteradaptor nmake - all fl_xmlfilteradaptor NULL
+fl filter\source\xmlfilterdetect nmake - all fl_xmlfilterdetect NULL
fl filter\source\msfilter\powerpoint nmake - all fl_powerpoint NULL
fl filter\source\pdf nmake - all fl_pdf NULL
fl filter\source\svg nmake - all fl_svg NULL
fl filter\source\placeware nmake - all fl_placeware NULL
fl filter\source\flash nmake - all fl_flash NULL
+fl filter\source\filtertracer nmake - all fl_filtertracer NULL
diff --git a/filter/source/filtertracer/exports.dxp b/filter/source/filtertracer/exports.dxp
new file mode 100644
index 000000000000..0c2e3e7cddd7
--- /dev/null
+++ b/filter/source/filtertracer/exports.dxp
@@ -0,0 +1,3 @@
+component_getImplementationEnvironment
+component_writeInfo
+component_getFactory \ No newline at end of file
diff --git a/filter/source/filtertracer/filtertracer.cxx b/filter/source/filtertracer/filtertracer.cxx
new file mode 100644
index 000000000000..5b08ffa6744d
--- /dev/null
+++ b/filter/source/filtertracer/filtertracer.cxx
@@ -0,0 +1,289 @@
+/*************************************************************************
+ *
+ * $RCSfile: filtertracer.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _FILTERTRACER_HXX
+#include "filtertracer.hxx"
+#endif
+#ifndef _UTL_STREAM_WRAPPER_HXX_
+#include <unotools/streamwrap.hxx>
+#endif
+#include <uno/mapping.hxx>
+#ifndef _UNTOOLS_UCBSTREAMHELPER_HXX
+#include <unotools/ucbstreamhelper.hxx>
+#endif
+// ----------------
+// - FILTERTRACER -
+// ----------------
+
+rtl::OUString FilterTracer_getImplementationName()
+ throw( NMSP_UNO::RuntimeException )
+{
+ return B2UCONST( "com.sun.star.util.FilterTracer" );
+}
+sal_Bool SAL_CALL FilterTracer_supportsService( const rtl::OUString& ServiceName )
+ throw( NMSP_UNO::RuntimeException )
+{
+ return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.util.logging.Logger" ) );
+}
+SEQ( rtl::OUString ) SAL_CALL FilterTracer_getSupportedServiceNames()
+ throw( NMSP_UNO::RuntimeException )
+{
+ SEQ( rtl::OUString ) aRet(1);
+ rtl::OUString* pArray = aRet.getArray();
+ pArray[0] = B2UCONST( "com.sun.star.util.logging.Logger" );
+ return aRet;
+}
+
+// -----------------------------------------------------------------------------
+
+FilterTracer::FilterTracer( const REF( NMSP_LANG::XMultiServiceFactory )& rxMgr ) :
+ xFact ( rxMgr ),
+ mpStream ( NULL ),
+ mnLogLevel ( NMSP_LOGGING::LogLevel::ALL )
+{
+ REF( NMSP_UNO::XInterface ) xObj( rxMgr->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.util.TextSearch" ) ) );
+ mxTextSearch = REF( NMSP_UTIL::XTextSearch )( xObj, ::com::sun::star::uno::UNO_QUERY );
+}
+FilterTracer::~FilterTracer()
+{
+ if ( mpStream )
+ {
+ mxOutputStream = NULL;
+ delete mpStream;
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+// XInterface
+void SAL_CALL FilterTracer::acquire() throw()
+{
+ OWeakObject::acquire();
+}
+void SAL_CALL FilterTracer::release() throw()
+{
+ OWeakObject::release();
+}
+
+// -----------------------------------------------------------------------------
+
+// checks if the tokens of rFilter can be found in rString
+sal_Bool FilterTracer::ImplFilter( const rtl::OUString& rFilter, const rtl::OUString& rString )
+{
+ sal_Bool bFilter = sal_False;
+ if ( mxTextSearch.is() )
+ {
+ maSearchOptions.searchString = rFilter;
+ mxTextSearch->setOptions( maSearchOptions );
+ NMSP_UTIL::SearchResult aSearchResult = mxTextSearch->searchForward( rString, 0, rString.getLength() );
+ bFilter = aSearchResult.subRegExpressions != 0;
+ }
+ return bFilter;
+}
+
+// -----------------------------------------------------------------------------
+
+// XInitialization
+void SAL_CALL FilterTracer::initialize( const SEQ( NMSP_UNO::Any )& aArguments )
+ throw ( NMSP_UNO::Exception, NMSP_UNO::RuntimeException )
+{
+ sal_Int32 i;
+ SEQ( NMSP_BEANS::PropertyValue ) aParameter;
+ for ( i = 0; i < aArguments.getLength(); i++ )
+ {
+ if ( aArguments[ i ] >>= aParameter )
+ break;
+ }
+ for ( i = 0; i < aParameter.getLength(); i++ )
+ {
+ const NMSP_BEANS::PropertyValue& rProp = aParameter[ i ];
+ if ( rProp.Name.equalsAscii( "LogLevel" ) )
+ rProp.Value >>= mnLogLevel;
+ else if ( rProp.Name.equalsAscii( "ClassFilter" ) )
+ rProp.Value >>= msClassFilter;
+ else if ( rProp.Name.equalsAscii( "MethodFilter" ) )
+ rProp.Value >>= msMethodFilter;
+ else if ( rProp.Name.equalsAscii( "MessageFilter" ) )
+ rProp.Value >>= msMessageFilter;
+ else if ( rProp.Name.equalsAscii( "OutputStream" ) )
+ rProp.Value >>= mxOutputStream;
+ else if ( rProp.Name.equalsAscii( "URL" ) )
+ rProp.Value >>= msURL;
+ }
+
+ // check if we have to create the XOutputStream
+ if ( !mxOutputStream.is() && msURL.getLength() )
+ {
+ mpStream = ::utl::UcbStreamHelper::CreateStream( msURL, STREAM_WRITE | STREAM_TRUNC | STREAM_SHARE_DENYNONE );
+ if ( mpStream )
+ {
+ ::utl::OOutputStreamWrapper* pHelper = new ::utl::OOutputStreamWrapper( *mpStream );
+ mxOutputStream = pHelper;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+// XServiceInfo
+rtl::OUString SAL_CALL FilterTracer::getImplementationName()
+ throw( NMSP_UNO::RuntimeException )
+{
+ return FilterTracer_getImplementationName();
+}
+sal_Bool SAL_CALL FilterTracer::supportsService( const rtl::OUString& rServiceName )
+ throw( NMSP_UNO::RuntimeException )
+{
+ return FilterTracer_supportsService( rServiceName );
+}
+SEQ( rtl::OUString ) SAL_CALL FilterTracer::getSupportedServiceNames()
+ throw ( NMSP_UNO::RuntimeException )
+{
+ return FilterTracer_getSupportedServiceNames();
+}
+
+// -----------------------------------------------------------------------------
+
+// XLogger
+REF( NMSP_LOGGING::XLogger ) SAL_CALL FilterTracer::getLogger( const rtl::OUString& rName )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ REF( NMSP_LOGGING::XLogger ) xLog( this );
+ return xLog;
+}
+sal_Int32 SAL_CALL FilterTracer::getLevel() throw (::com::sun::star::uno::RuntimeException)
+{
+ return mnLogLevel;
+}
+rtl::OUString SAL_CALL FilterTracer::getName() throw (::com::sun::star::uno::RuntimeException)
+{
+ rtl::OUString aName;
+ return aName;
+}
+sal_Bool SAL_CALL FilterTracer::isLoggable( sal_Int32 nLevel )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ return mnLogLevel <= nLevel;
+}
+void SAL_CALL FilterTracer::logp( sal_Int32 nLevel, const rtl::OUString& rSourceClass,
+ const rtl::OUString& rSourceMethod, const rtl::OUString& rMessage )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ if ( mxOutputStream.is() )
+ {
+ if ( ! ( ImplFilter( msClassFilter, rSourceClass ) || ImplFilter( msMethodFilter, rSourceMethod )
+ || ImplFilter( msMessageFilter, rMessage ) ) )
+ {
+ rtl::OString sClass( rtl::OUStringToOString( rSourceClass, RTL_TEXTENCODING_UTF8 ) );
+ rtl::OString sMethod( rtl::OUStringToOString( rSourceMethod, RTL_TEXTENCODING_UTF8 ) );
+ rtl::OString sMessage( rtl::OUStringToOString( rMessage, RTL_TEXTENCODING_UTF8 ) );
+ try
+ {
+ SEQ( sal_Int8 ) aData( sClass.getLength() + sMethod.getLength() + sMessage.getLength() );
+ sal_Int8* pPtr = aData.getArray();
+ memcpy( pPtr, sClass.getStr(), sClass.getLength() );
+ pPtr += sClass.getLength();
+ memcpy( pPtr, sMethod.getStr(), sMethod.getLength() );
+ pPtr += sMethod.getLength();
+ memcpy( pPtr, sMessage.getStr(), sMessage.getLength() );
+ pPtr += sMessage.getLength();
+ mxOutputStream->writeBytes( aData );
+ }
+ catch ( ... )
+ {
+
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+// XTextSearch
+void SAL_CALL FilterTracer::setOptions( const NMSP_UTIL::SearchOptions& rSearchOptions )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ maSearchOptions = rSearchOptions;
+}
+
+// -----------------------------------------------------------------------------
+
+NMSP_UTIL::SearchResult SAL_CALL FilterTracer::searchForward( const rtl::OUString& rSearchStr,
+ sal_Int32 nStartPos, sal_Int32 nEndPos ) throw (::com::sun::star::uno::RuntimeException)
+{
+ NMSP_UTIL::SearchResult nSearchResult;
+ if ( mxTextSearch.is() )
+ mxTextSearch->searchForward( rSearchStr, nStartPos, nEndPos );
+ return nSearchResult;
+}
+
+// -----------------------------------------------------------------------------
+
+NMSP_UTIL::SearchResult SAL_CALL FilterTracer::searchBackward( const rtl::OUString& rSearchStr,
+ sal_Int32 nStartPos, sal_Int32 nEndPos ) throw (::com::sun::star::uno::RuntimeException)
+{
+ NMSP_UTIL::SearchResult nSearchResult;
+ if ( mxTextSearch.is() )
+ mxTextSearch->searchBackward( rSearchStr, nStartPos, nEndPos );
+ return nSearchResult;
+}
+
+
diff --git a/filter/source/filtertracer/filtertracer.hxx b/filter/source/filtertracer/filtertracer.hxx
new file mode 100644
index 000000000000..0e4fd1c5479e
--- /dev/null
+++ b/filter/source/filtertracer/filtertracer.hxx
@@ -0,0 +1,248 @@
+/*************************************************************************
+ *
+ * $RCSfile: filtertracer.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _FILTERTRACER_HXX
+#define _FILTERTRACER_HXX
+
+#ifndef __RTL_USTRING_
+#include <rtl/ustring>
+#endif
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+#ifndef _URLOBJ_HXX
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _STACK_HXX
+#include <tools/stack.hxx>
+#endif
+
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE4_HXX_
+#include <cppuhelper/implbase4.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_LOGGING_XLOGGER_HPP_
+#include <com/sun/star/util/logging/XLogger.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_LOGGING_LOGLEVEL_HPP_
+#include <com/sun/star/util/logging/LogLevel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_
+#include <com/sun/star/io/XOutputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XTEXTSEARCH_HPP_
+#include <com/sun/star/util/XTextSearch.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_SEARCHRESULT_HPP_
+#include <com/sun/star/util/SearchResult.hpp>
+#endif
+
+// -----------------------------------------------------------------------------
+
+#define NMSP_IO com::sun::star::io
+#define NMSP_UNO com::sun::star::uno
+#define NMSP_BEANS com::sun::star::beans
+#define NMSP_LANG com::sun::star::lang
+#define NMSP_UTIL com::sun::star::util
+#define NMSP_LOGGING NMSP_UTIL::logging
+
+
+#define REF( _def_Obj ) NMSP_UNO::Reference< _def_Obj >
+#define SEQ( _def_Obj ) NMSP_UNO::Sequence< _def_Obj >
+#define B2UCONST( _def_pChar ) (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(_def_pChar )))
+
+// ----------------
+// - FILTERTRACER -
+// ----------------
+//
+
+/** Some options of the FilterTracer can be initialized
+ via XInitialization interface.
+
+ Therefore the first sequence of PropertyValues that
+ is given in the argument list is used.
+
+ Following Properties are supported:
+
+ OutputStream com.sun.star.io.XOutputStream Defines the output stream. Optional it is possible to provide
+ the URL property, then the corresponding output stream will
+ be generated automatically.
+
+ URL string Defines the URL, which is used to create an output stream.
+ This property is used only, if there is no valid
+ OutputStream property available.
+
+ LogLevel long Defines the LogLevel for the FilterTracer.
+ Using logp with a LogLevel that is higher as the LogLevel
+ for the FilterTracer component will generate no output.
+ LogLevel constants are defined in sun::star::util::logging::LogLevel
+ The default LogLevel com::sun::star::logging::LogLevel::ALL
+
+ ClassFilter string This property defines a filter for the SourceClass string of logp.
+ The ClassFilter string can be separated into multiple tokens using
+ a semicolon. If one of the ClassFilter token is part of the
+ SourceClass string of the logp method then there will be no output.
+
+ MethodFilter string This property defines a filter for the SourceMethod string of logp.
+ The MethodFilter string can be separated into multiple tokens using
+ a semicolon. If one of the MethodFilter token is part of the
+ SourceMethod string of the logp method then there will be no output.
+
+ MessageFilter string This property defines a filter for the Message string of logp.
+ The MessageFilter string can be separated into multiple tokens using
+ a semicolon. If one of the MessageFilter token is part of the
+ Message string of the logp method then there will be no output.
+
+*/
+
+class FilterTracer : public cppu::WeakImplHelper4
+<
+ NMSP_LOGGING::XLogger,
+ NMSP_LANG::XInitialization,
+ NMSP_LANG::XServiceInfo,
+ NMSP_UTIL::XTextSearch
+>
+{
+ REF( NMSP_LANG::XMultiServiceFactory ) xFact;
+
+ sal_Int32 mnLogLevel;
+ rtl::OUString msClassFilter;
+ rtl::OUString msMethodFilter;
+ rtl::OUString msMessageFilter;
+ rtl::OUString msURL;
+
+ SvStream* mpStream;
+ REF( NMSP_IO::XOutputStream ) mxOutputStream;
+
+ REF( NMSP_UTIL::XTextSearch ) mxTextSearch;
+ NMSP_UTIL::SearchOptions maSearchOptions;
+
+ sal_Bool FilterTracer::ImplFilter( const rtl::OUString& rFilter, const rtl::OUString& rString );
+
+public:
+ FilterTracer( const REF( NMSP_LANG::XMultiServiceFactory )& rxMgr );
+ virtual ~FilterTracer();
+
+ // XInterface
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const SEQ( NMSP_UNO::Any )& aArguments )
+ throw ( NMSP_UNO::Exception, NMSP_UNO::RuntimeException );
+
+ // XServiceInfo
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw ( NMSP_UNO::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& rServiceName )
+ throw ( NMSP_UNO::RuntimeException );
+ virtual SEQ( rtl::OUString ) SAL_CALL getSupportedServiceNames()
+ throw ( NMSP_UNO::RuntimeException );
+
+ // XLogger
+ virtual REF( NMSP_LOGGING::XLogger ) SAL_CALL getLogger( const rtl::OUString& rName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getLevel() throw (::com::sun::star::uno::RuntimeException);
+ virtual rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isLoggable( sal_Int32 nLevel ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL logp( sal_Int32 nLevel, const rtl::OUString& rSourceClass,
+ const rtl::OUString& rSourceMethod, const rtl::OUString& rMessage ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XTextSearch
+ virtual void SAL_CALL setOptions( const NMSP_UTIL::SearchOptions& ) throw (::com::sun::star::uno::RuntimeException);
+ virtual NMSP_UTIL::SearchResult SAL_CALL searchForward( const rtl::OUString& rSearchStr,
+ sal_Int32 nStartPos, sal_Int32 nEndPos ) throw (::com::sun::star::uno::RuntimeException);
+ virtual NMSP_UTIL::SearchResult SAL_CALL searchBackward( const rtl::OUString& rSearchStr,
+ sal_Int32 nStartPos, sal_Int32 nEndPos ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+rtl::OUString FilterTracer_getImplementationName()
+ throw ( NMSP_UNO::RuntimeException );
+sal_Bool SAL_CALL FilterTracer_supportsService( const rtl::OUString& rServiceName )
+ throw( NMSP_UNO::RuntimeException );
+SEQ( rtl::OUString ) SAL_CALL FilterTracer_getSupportedServiceNames()
+ throw( NMSP_UNO::RuntimeException );
+
+#endif
diff --git a/filter/source/filtertracer/filtertraceruno.cxx b/filter/source/filtertracer/filtertraceruno.cxx
new file mode 100644
index 000000000000..5a8f6e59c4b4
--- /dev/null
+++ b/filter/source/filtertracer/filtertraceruno.cxx
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * $RCSfile: filtertraceruno.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "filtertracer.hxx"
+
+#include <cppuhelper/factory.hxx>
+#include <uno/mapping.hxx>
+
+// -------------------
+// - factory methods -
+// -------------------
+
+static REF( NMSP_UNO::XInterface ) SAL_CALL create_FilterTracer( const REF( NMSP_LANG::XMultiServiceFactory )& rxFact )
+{
+ return REF( NMSP_UNO::XInterface )( *new FilterTracer( rxFact ) );
+}
+
+// ------------------------------------------
+// - component_getImplementationEnvironment -
+// ------------------------------------------
+
+extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+// -----------------------
+// - component_writeInfo -
+// -----------------------
+
+extern "C" sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
+{
+ sal_Bool bRet = sal_False;
+
+ if( pRegistryKey )
+ {
+ try
+ {
+ NMSP_UNO::Reference< com::sun::star::registry::XRegistryKey > xNewKey(
+ reinterpret_cast< com::sun::star::registry::XRegistryKey * >( pRegistryKey )->createKey(
+ FilterTracer_getImplementationName() ) );
+ xNewKey = xNewKey->createKey( B2UCONST( "/UNO/SERVICES" ) );
+ const SEQ( rtl::OUString )& rSNL = FilterTracer_getSupportedServiceNames();
+ const rtl::OUString * pArray = rSNL.getConstArray();
+ for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
+ xNewKey->createKey( pArray[nPos] );
+ bRet = sal_True;
+ }
+ catch( com::sun::star::registry::InvalidRegistryException& )
+ {
+ OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
+ }
+ }
+
+ return bRet;
+}
+
+// ------------------------
+// - component_getFactory -
+// ------------------------
+
+extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey )
+{
+ REF( NMSP_LANG::XSingleServiceFactory ) xFactory;
+ void* pRet = 0;
+
+ if( rtl_str_compare( pImplName, "com.sun.star.util.FilterTracer" ) == 0 )
+ {
+ const rtl::OUString aServiceName( B2UCONST( "com.sun.star.util.FilterTracer" ) );
+
+ xFactory = REF( NMSP_LANG::XSingleServiceFactory )( cppu::createSingleFactory(
+ reinterpret_cast< NMSP_LANG::XMultiServiceFactory* >( pServiceManager ),
+ B2UCONST( "com.sun.star.util.FilterTracer" ),
+ create_FilterTracer, SEQ( rtl::OUString )( &aServiceName, 1 ) ) );
+ }
+ if( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+
+ return pRet;
+}
diff --git a/filter/source/filtertracer/makefile.mk b/filter/source/filtertracer/makefile.mk
new file mode 100644
index 000000000000..4ca85f05aa74
--- /dev/null
+++ b/filter/source/filtertracer/makefile.mk
@@ -0,0 +1,117 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: hr $ $Date: 2003-03-25 17:57:45 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+PRJNAME=filter
+TARGET=filtertracer
+
+ENABLE_EXCEPTIONS=TRUE
+USE_DEFFILE=TRUE
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Types -------------------------------------
+
+UNOTYPES= com.sun.star.uno.XWeak \
+ com.sun.star.uno.XNamingService \
+ com.sun.star.uno.XComponentContext \
+ com.sun.star.uno.XAggregation \
+ com.sun.star.lang.XServiceInfo \
+ com.sun.star.lang.XSingleServiceFactory \
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.lang.XSingleComponentFactory \
+ com.sun.star.lang.XTypeProvider \
+ com.sun.star.lang.XInitialization \
+ com.sun.star.registry.XSimpleRegistry \
+ com.sun.star.util.logging.XLogger \
+ com.sun.star.util.logging.LogLevel \
+ com.sun.star.util.XTextSearch \
+ com.sun.star.util.SearchResult
+
+
+# --- Files -------------------------------------
+
+SLOFILES= $(SLO)$/filtertracer.obj \
+ $(SLO)$/filtertraceruno.obj
+
+# --- Library -----------------------------------
+
+SHL1TARGET=$(TARGET)$(UPD)$(DLLPOSTFIX)
+SHL1STDLIBS=$(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(SALLIB) \
+ $(TOOLSLIB) \
+ $(UNOTOOLSLIB)
+
+SHL1DEPN=
+SHL1IMPLIB= i$(SHL1TARGET)
+SHL1LIBS= $(SLB)$/$(TARGET).lib
+SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME=$(SHL1TARGET)
+DEF1EXPORTFILE=exports.dxp
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
diff --git a/filter/source/flash/impswfdialog.src b/filter/source/flash/impswfdialog.src
index feebcf4a55be..0453892e4dde 100644
--- a/filter/source/flash/impswfdialog.src
+++ b/filter/source/flash/impswfdialog.src
@@ -2,9 +2,9 @@
*
* $RCSfile: impswfdialog.src,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: kz $ $Date: 2002-12-09 11:40:09 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -79,8 +79,8 @@ ModalDialog DLG_OPTIONS
Text = "1: min. Qualitt\n100: max. Qualitt" ;
Text [ ENGLISH ] = "1: min. quality\n100: max. quality" ;
Text [ english_us ] = "1: min. quality\n100: max. quality" ;
- Text [ italian ] = "1: min. qualit\n100: max. qualit" ;
- Text [ spanish ] = "1: mn. calidad\n100: mx. calidad" ;
+ Text [ italian ] = "1: qualit min.\n100: qualit max." ;
+ Text [ spanish ] = "1: calidad mn.\n100: calidad mx." ;
Text [ french ] = "1 : qualit min.\n100 : qualit max." ;
Text [ dutch ] = "1: min. kwaliteit\n100: max. kwaliteit" ;
Text [ swedish ] = "1: min. kvalitet\n100: max. kvalitet" ;
@@ -96,7 +96,7 @@ ModalDialog DLG_OPTIONS
Text[ dutch ] = "1: min. kwaliteit\n100: max. kwaliteit";
Text[ chinese_simplified ] = "1: 最差质量 \n100: 最佳质量";
Text[ greek ] = "0: \n100: ";
- Text[ korean ] = "1: 최소 성능\n100: 최대 성능";
+ Text[ korean ] = "1: 최소 품질\n100: 최대 품질";
Text[ turkish ] = "0: asg. kalite\n100: azm. kalite";
Text[ language_user1 ] = " ";
Text[ catalan ] = "0: mn. qualitat\n100: mx. qualitat";
@@ -225,22 +225,24 @@ ModalDialog DLG_OPTIONS
Text[ language_user1 ] = "EM Dec 2002: DON NOT TRANSLATE \"Macromedia Flash (SWF)\" because it is a product name. Only translate \"Options\"";
Text[ portuguese ] = "Flash Options";
Text[ russian ] = "Flash Options";
- Text[ spanish ] = "Flash Options";
- Text[ italian ] = "Flash Options";
- Text[ swedish ] = "Flash Options";
+ Text[ spanish ] = "Opciones Macromedia Flash (SWF)";
+ Text[ italian ] = "Opzioni Macromedia Flash (SWF)";
+ Text[ swedish ] = "Alternativ fr Macromedia Flash (SWF)";
Text[ polish ] = "Flash Options";
Text[ portuguese_brazilian ] = "Flash Options";
- Text[ japanese ] = "Flash Options";
- Text[ korean ] = "Flash Options";
+ Text[ japanese ] = "Macromedia Flash (SWF) オプション";
+ Text[ korean ] = "Macromedia Flash (SWF) 옵션";
Text[ turkish ] = "Flash Options";
Text[ thai ] = "Flash Options";
Text[ greek ] = "Flash Options";
Text[ dutch ] = "Flash Options";
- Text[ french ] = "Flash Options";
+ Text[ french ] = "Options Macromedia Flash (SWF)";
Text[ finnish ] = "Flash Options";
Text[ danish ] = "Flash Options";
- Text[ chinese_simplified ] = "Flash Options";
- Text[ chinese_traditional ] = "Flash Options";
+ Text[ chinese_simplified ] = "Macromedia Flash (SWF) 选项";
+ Text[ chinese_traditional ] = "Macromedia Flash (SWF) 選項";
Text[ arabic ] = "Flash Options";
Text[ catalan ] = "Flash Options";
};
+
+
diff --git a/filter/source/flash/makefile.mk b/filter/source/flash/makefile.mk
index 646de1291bbe..0a899d72d1b1 100644
--- a/filter/source/flash/makefile.mk
+++ b/filter/source/flash/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.4 $
+# $Revision: 1.5 $
#
-# last change: $Author: cl $ $Date: 2002-11-21 14:58:02 $
+# last change: $Author: hr $ $Date: 2003-03-25 17:57:46 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -66,6 +66,7 @@ TARGET=flash
ENABLE_EXCEPTIONS=TRUE
USE_DEFFILE=TRUE
+GEN_HID=TRUE
# --- Settings ----------------------------------
diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx
index 4afc13b0eba6..22d382a788ab 100644
--- a/filter/source/flash/swfwriter.cxx
+++ b/filter/source/flash/swfwriter.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swfwriter.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: cl $ $Date: 2002-11-21 14:58:03 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -119,7 +119,7 @@ Writer::Writer( sal_Int32 nTWIPWidthOutput, sal_Int32 nTWIPHeightOutput, sal_Int
// define an invisible button with the size of a page
Rectangle aRect( 0, 0, mnDocWidth * mnDocXScale, mnDocHeight * mnDocYScale );
Polygon aPoly( aRect );
- FillStyle aFill( Color(COL_WHITE) );
+ FillStyle aFill = FillStyle( Color(COL_WHITE) );
mnWhiteBackgroundShapeId = defineShape( aPoly, aFill );
Matrix3D m;
@@ -701,4 +701,4 @@ void Writer::gotoFrame( sal_uInt16 nFrame )
sal_uInt16 Writer::getWhiteBackgroundShapeId()
{
return mnWhiteBackgroundShapeId;
-} \ No newline at end of file
+}
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 1456e52a2800..001856036a45 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impdialog.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: sj $ $Date: 2002-09-17 12:58:33 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,12 +62,24 @@
#include "impdialog.hxx"
#include "impdialog.hrc"
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
+#include <com/sun/star/uno/Sequence.h>
+#endif
+#ifndef _COM_SUN_STAR_TEXT_XTEXTRANGE_HPP_
+#include <com/sun/star/text/XTextRange.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
+#include <com/sun/star/container/XIndexAccess.hpp>
+#endif
+
// ----------------
// - ImpPDFDialog -
// ----------------
+using namespace ::com::sun::star;
+
ImpPDFDialog::ImpPDFDialog( Window* pParent, ResMgr& rResMgr, Sequence< PropertyValue >& rFilterData, const Any& rSelection ) :
- ModalDialog( pParent, ResId( DLG_PDFEXPORT, &rResMgr ) ),
+ ModalDialog( pParent, ResId( RID_PDF_EXPORT_DLG, &rResMgr ) ),
maBtnOK( this, ResId( BT_OK ) ),
maBtnCancel( this, ResId( BT_CANCEL ) ),
maBtnHelp( this, ResId( BT_HELP ) ),
@@ -90,7 +102,26 @@ ImpPDFDialog::ImpPDFDialog( Window* pParent, ResMgr& rResMgr, Sequence< Property
maRbAll.Check();
TogglePagesHdl( NULL );
- maRbSelection.Enable( maSelection.hasValue() );
+
+ sal_Bool bHasSelection = maSelection.hasValue();
+ if ( bHasSelection )
+ {
+ // even if nothing is selected in writer the selection is not empty
+ Reference< container::XIndexAccess > xIndexAccess;
+ if ( maSelection >>= xIndexAccess )
+ {
+ sal_Int32 nLen = xIndexAccess->getCount();
+ if ( !nLen )
+ bHasSelection = sal_False;
+ else if ( nLen == 1 )
+ {
+ Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY );
+ if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) )
+ bHasSelection = sal_False;
+ }
+ }
+ }
+ maRbSelection.Enable( bHasSelection );
switch( nCompressMode )
{
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc
index 2a2ca2b3caec..c375c52ef52b 100644
--- a/filter/source/pdf/impdialog.hrc
+++ b/filter/source/pdf/impdialog.hrc
@@ -2,9 +2,9 @@
*
* $RCSfile: impdialog.hrc,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: sj $ $Date: 2002-09-17 12:59:11 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,7 +59,7 @@
*
************************************************************************/
-#define DLG_PDFEXPORT 1024
+#include <filter.hrc>
#define FL_PAGES 1
#define RB_ALL 2
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src
index e112595bf2ba..f8baf8f2449f 100644
--- a/filter/source/pdf/impdialog.src
+++ b/filter/source/pdf/impdialog.src
@@ -2,9 +2,9 @@
*
* $RCSfile: impdialog.src,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: kz $ $Date: 2002-09-19 19:14:32 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,7 +61,7 @@
#include "impdialog.hrc"
-ModalDialog DLG_PDFEXPORT
+ModalDialog RID_PDF_EXPORT_DLG
{
OutputSize = TRUE ;
SVLook = TRUE ;
@@ -76,6 +76,27 @@ ModalDialog DLG_PDFEXPORT
Size = MAP_APPFONT ( 111 , 8 ) ;
Text = "Seiten" ;
Text [ ENGLISH ] = "Pages" ;
+ Text[ english_us ] = "Pages";
+ Text[ portuguese ] = "Pages";
+ Text[ russian ] = "Pages";
+ Text[ greek ] = "Pages";
+ Text[ dutch ] = "Pages";
+ Text[ french ] = "Pages";
+ Text[ spanish ] = "Pginas";
+ Text[ finnish ] = "Pages";
+ Text[ italian ] = "Pagine";
+ Text[ danish ] = "Pages";
+ Text[ swedish ] = "Sidor";
+ Text[ polish ] = "Pages";
+ Text[ portuguese_brazilian ] = "Pages";
+ Text[ japanese ] = "ページ";
+ Text[ korean ] = "페이지";
+ Text[ chinese_simplified ] = "页";
+ Text[ chinese_traditional ] = "頁";
+ Text[ turkish ] = "Pages";
+ Text[ arabic ] = "Pages";
+ Text[ catalan ] = "Pages";
+ Text[ thai ] = "Pages";
};
RadioButton RB_ALL
{
@@ -111,6 +132,27 @@ ModalDialog DLG_PDFEXPORT
Size = MAP_APPFONT ( 50 , 10 ) ;
Text = "~Bereich" ;
Text [ ENGLISH ] = "~Range" ;
+ Text[ english_us ] = "~Range";
+ Text[ portuguese ] = "~Range";
+ Text[ russian ] = "~Range";
+ Text[ greek ] = "~Range";
+ Text[ dutch ] = "~Range";
+ Text[ french ] = "Plage";
+ Text[ spanish ] = "~rea";
+ Text[ finnish ] = "~Range";
+ Text[ italian ] = "~Area";
+ Text[ danish ] = "~Range";
+ Text[ swedish ] = "~Omrde";
+ Text[ polish ] = "~Range";
+ Text[ portuguese_brazilian ] = "~Range";
+ Text[ japanese ] = "範囲(~R)";
+ Text[ korean ] = "범위(~R)";
+ Text[ chinese_simplified ] = "范围(~R)";
+ Text[ chinese_traditional ] = "範圍(~R)";
+ Text[ turkish ] = "~Range";
+ Text[ arabic ] = "~Range";
+ Text[ catalan ] = "~Range";
+ Text[ thai ] = "~Range";
};
RadioButton RB_SELECTION
{
@@ -186,7 +228,7 @@ ModalDialog DLG_PDFEXPORT
Text[ greek ] = "S~creen optimized (smallest file size)";
Text[ dutch ] = "S~creen optimized (smallest file size)";
Text[ french ] = "Optimis pour l'cran (taille minimum de fichier)";
- Text[ spanish ] = "~Optimado para la pantalla (tamao mnimo de archivo)";
+ Text[ spanish ] = "~Optimizado para la pantalla (tamao mnimo de archivo)";
Text[ finnish ] = "S~creen optimized (smallest file size)";
Text[ italian ] = "Ottimizzato per lo schermo (dimensioni minime file)";
Text[ danish ] = "S~creen optimized (smallest file size)";
@@ -194,7 +236,7 @@ ModalDialog DLG_PDFEXPORT
Text[ polish ] = "S~creen optimized (smallest file size)";
Text[ portuguese_brazilian ] = "S~creen optimized (smallest file size)";
Text[ japanese ] = "画面用に最適化する (最小ファイルサイズ)";
- Text[ korean ] = "화면용으로 최적화(최소 파일 크기)";
+ Text[ korean ] = "스크린용으로 최적화 (최소 파일 크기)";
Text[ chinese_simplified ] = "优化屏幕显示(最小的文件大小)";
Text[ chinese_traditional ] = "優化屏幕顯示(最小的檔案大小)";
Text[ turkish ] = "S~creen optimized (smallest file size)";
@@ -214,9 +256,9 @@ ModalDialog DLG_PDFEXPORT
Text[ greek ] = "~Print optimized";
Text[ dutch ] = "~Print optimized";
Text[ french ] = "Optimis pour l'impression";
- Text[ spanish ] = "~Optimado para la impresin";
+ Text[ spanish ] = "~Optimizado para la impresin";
Text[ finnish ] = "~Print optimized";
- Text[ italian ] = "Ottimizzato per la stampa";
+ Text[ italian ] = "Stampa ottimizzata";
Text[ danish ] = "~Print optimized";
Text[ swedish ] = "~Utskriftsoptimerad";
Text[ polish ] = "~Print optimized";
@@ -242,15 +284,15 @@ ModalDialog DLG_PDFEXPORT
Text[ greek ] = "Pr~ess optimized";
Text[ dutch ] = "Pr~ess optimized";
Text[ french ] = "Optimis pour presse imprimer";
- Text[ spanish ] = "~Optima para la impresin";
+ Text[ spanish ] = "~Optimizado para la impresin";
Text[ finnish ] = "Pr~ess optimized";
- Text[ italian ] = "Ottimizzato per la stampa";
+ Text[ italian ] = "Prestampa ottimizzata";
Text[ danish ] = "Pr~ess optimized";
Text[ swedish ] = "Tr~yckoptimerad";
Text[ polish ] = "Pr~ess optimized";
Text[ portuguese_brazilian ] = "Pr~ess optimized";
Text[ japanese ] = "印刷準備用に最適化する";
- Text[ korean ] = "인쇄 단계용으로 최적화";
+ Text[ korean ] = "인쇄 단계를 최적화";
Text[ chinese_simplified ] = "优化新闻印刷";
Text[ chinese_traditional ] = "優化新聞印刷";
Text[ turkish ] = "Pr~ess optimized";
@@ -324,3 +366,5 @@ ModalDialog DLG_PDFEXPORT
Text[ catalan ] = "PDF Options";
Text[ thai ] = "PDF Options";
};
+
+
diff --git a/filter/source/pdf/makefile.mk b/filter/source/pdf/makefile.mk
index 456d842bfc96..b482aa6f3599 100644
--- a/filter/source/pdf/makefile.mk
+++ b/filter/source/pdf/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.5 $
+# $Revision: 1.6 $
#
-# last change: $Author: gh $ $Date: 2002-12-11 09:36:00 $
+# last change: $Author: hr $ $Date: 2003-03-25 17:57:50 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -74,7 +74,8 @@ USE_DEFFILE=TRUE
# --- Files -------------------------------------
-SRCFILES = impdialog.src
+SRCFILES = impdialog.src \
+ pdf.src
SLOFILES= $(SLO)$/pdfuno.obj \
$(SLO)$/pdfdialog.obj \
diff --git a/filter/source/pdf/pdf.hrc b/filter/source/pdf/pdf.hrc
new file mode 100644
index 000000000000..cadc36acec44
--- /dev/null
+++ b/filter/source/pdf/pdf.hrc
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * $RCSfile: pdf.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define PDF_PROGRESS_BAR 260
+
diff --git a/filter/source/pdf/pdf.src b/filter/source/pdf/pdf.src
new file mode 100644
index 000000000000..8c60e66839cc
--- /dev/null
+++ b/filter/source/pdf/pdf.src
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * $RCSfile: pdf.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#include "pdf.hrc"
+
+String PDF_PROGRESS_BAR
+{
+ Text = "Exportieren als PDF";
+ Text[ ENGLISH ] = "Export as PDF";
+ Text[ english_us ] = "Export as PDF";
+ Text[ french ] = "Export as PDF";
+ Text[ spanish ] = "Export as PDF";
+ Text[ italian ] = "Export as PDF";
+ Text[ swedish ] = "Export as PDF";
+ Text[ japanese ] = "Export as PDF";
+ Text[ korean ] = "Export as PDF";
+ Text[ chinese_simplified ] = "Export as PDF";
+ Text[ chinese_traditional ] = "Export as PDF";
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 17a0589fae4c..746e51c01306 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pdfexport.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: rt $ $Date: 2002-12-03 11:04:14 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -58,7 +58,7 @@
*
*
************************************************************************/
-
+#include "pdf.hrc"
#include "pdfexport.hxx"
#include <tools/urlobj.hxx>
#include <tools/fract.hxx>
@@ -75,8 +75,10 @@
#include <vcl/bmpacc.hxx>
#include <toolkit/awt/vclxdevice.hxx>
#include <unotools/localfilehelper.hxx>
+#include <unotools/processfactory.hxx>
#include <svtools/FilterConfigItem.hxx>
#include <svtools/filter.hxx>
+#include <svtools/solar.hrc>
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -93,6 +95,15 @@
#ifndef _COM_SUN_STAR_VIEW_XRENDERABLE_HPP_
#include <com/sun/star/view/XRenderable.hpp>
#endif
+#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
+#include <com/sun/star/frame/XModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORSUPPLIER_HPP_
+#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORFACTORY_HPP_
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#endif
using namespace ::rtl;
using namespace ::vcl;
@@ -203,8 +214,38 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
aSel = MultiSelection( aPageRange );
aSel.SetTotalRange( aRange );
}
-
- for( sal_Int32 nSel = aSel.FirstSelected(); nSel != SFX_ENDOFSELECTION; nSel = aSel.NextSelected() )
+ Reference< task::XStatusIndicator > xStatusIndicator;
+ if ( mxSrcDoc.is() )
+ {
+ Reference< frame::XModel > xModel( mxSrcDoc, UNO_QUERY );
+ if ( xModel.is() )
+ {
+ Reference< frame::XController > xController( xModel->getCurrentController());
+ if( xController.is() )
+ {
+ Reference< frame::XFrame > xFrame( xController->getFrame());
+ if( xFrame.is() )
+ {
+ Reference< task::XStatusIndicatorFactory > xFactory( xFrame, UNO_QUERY );
+ if( xFactory.is() )
+ {
+ ByteString aResMgrName( "pdffilter" );
+ aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) );
+ ResMgr* pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILanguage() );
+ if ( pResMgr )
+ {
+ xStatusIndicator = xFactory->createStatusIndicator();
+ xStatusIndicator->start( String( ResId( PDF_PROGRESS_BAR, pResMgr ) ), aSel.GetSelectCount() );
+ delete pResMgr;
+ }
+ }
+ }
+ }
+ }
+ }
+ sal_Int32 nSel, nProgressValue;
+ for( nSel = aSel.FirstSelected(), nProgressValue = 0; nSel != SFX_ENDOFSELECTION;
+ nSel = aSel.NextSelected(), nProgressValue++ )
{
Sequence< PropertyValue > aRenderer( xRenderable->getRenderer( nSel - 1, aSelection, aRenderOptions ) );
awt::Size aPageSize;
@@ -240,7 +281,11 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
pOut->Pop();
}
+ if ( xStatusIndicator.is() )
+ xStatusIndicator->setValue( nProgressValue );
}
+ if ( xStatusIndicator.is() )
+ xStatusIndicator->end();
}
catch( UnknownPropertyException )
{
@@ -602,7 +647,7 @@ sal_Bool PDFExport::ImplWriteActions( PDFWriter& rWriter, const GDIMetaFile& rMt
case( META_TEXTRECT_ACTION ):
{
const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
- DBG_ERROR( "MetaTextRectAction not supported yet" );
+ rWriter.DrawText( pA->GetRect(), String( pA->GetText() ), pA->GetStyle() );
}
break;
diff --git a/filter/source/svg/makefile.mk b/filter/source/svg/makefile.mk
index 528896148f66..17f6d9ed1f04 100644
--- a/filter/source/svg/makefile.mk
+++ b/filter/source/svg/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.4 $
+# $Revision: 1.5 $
#
-# last change: $Author: sj $ $Date: 2002-10-31 11:03:38 $
+# last change: $Author: hr $ $Date: 2003-03-25 17:57:52 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -61,7 +61,7 @@
#*************************************************************************
PRJ=..$/..
-PRJNAME=filter
+PRJNAME=svgfilter
TARGET=svgfilter
ENABLE_EXCEPTIONS=TRUE
@@ -69,7 +69,9 @@ USE_DEFFILE=TRUE
# --- Settings ----------------------------------
+.INCLUDE : svpre.mk
.INCLUDE : settings.mk
+.INCLUDE : sv.mk
# --- Types -------------------------------------
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 896bafbf3593..9b9f832ba83b 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: svgexport.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: ka $ $Date: 2002-08-21 06:03:20 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -166,7 +166,6 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
if( xDocHandler.is() )
{
mbPresentation = Reference< XPresentationSupplier >( mxSrcDoc, UNO_QUERY ).is();
- mbMultiPage = ( xDrawPages->getCount() > 1 );
mpObjects = new ObjectMap;
mpSVGExport = new SVGExport( xDocHandler );
@@ -200,7 +199,6 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
delete mpSVGExport, mpSVGExport = NULL;
delete mpSVGFontExport, mpSVGFontExport = NULL;
delete mpObjects, mpObjects = NULL;
- mbMultiPage = sal_False;
mbPresentation = sal_False;
}
}
@@ -259,11 +257,13 @@ sal_Bool SVGFilter::implExportDocumemt( const Reference< XDrawPages >& rxMasterP
OUString aAttr;
sal_Int32 nDocWidth = 0, nDocHeight = 0;
sal_Int32 nVisible = -1, nVisibleMaster = -1;
+ const sal_Bool bMultiPage = ( rxDrawPages->getCount() > 1 );
xPagePropSet->getPropertyValue( B2UCONST( "Width" ) ) >>= nDocWidth;
xPagePropSet->getPropertyValue( B2UCONST( "Height" ) ) >>= nDocHeight;
- xExtDocHandler->unknown( SVG_DTD_STRING );
+ if( xExtDocHandler.is() )
+ xExtDocHandler->unknown( SVG_DTD_STRING );
#ifdef _SVG_WRITE_EXTENTS
aAttr = OUString::valueOf( nDocWidth * 0.01 );
@@ -284,28 +284,64 @@ sal_Bool SVGFilter::implExportDocumemt( const Reference< XDrawPages >& rxMasterP
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", B2UCONST( "xMidYMid" ) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "fill-rule", B2UCONST( "evenodd" ) );
- if( mbMultiPage )
+ if( bMultiPage )
{
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:ooo", B2UCONST( "http://xml.openoffice.org/svg/export" ) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "onclick", B2UCONST( "onClick(evt)" ) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "onkeypress", B2UCONST( "onKeyPress(evt)" ) );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "onload", B2UCONST( "onLoad()" ) );
}
mpSVGDoc = new SvXMLElementExport( *mpSVGExport, XML_NAMESPACE_NONE, "svg", TRUE, TRUE );
+ for( sal_Int32 i = 0, nCount = rxDrawPages->getCount(); ( i < nCount ) && ( -1 == nVisible ); ++i )
+ {
+ Reference< XDrawPage > xDrawPage;
+ rxDrawPages->getByIndex( i ) >>= xDrawPage;
+
+ if( xDrawPage.is() )
+ {
+ Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY );
+
+ if( xPropSet.is() )
+ {
+ sal_Bool bVisible;
+
+ if( !mbPresentation || ( ( xPropSet->getPropertyValue( B2UCONST( "Visible" ) ) >>= bVisible ) && bVisible ) )
+ {
+ Reference< XMasterPageTarget > xMasterTarget( xDrawPage, UNO_QUERY );
+
+ if( xMasterTarget.is() )
+ {
+ Reference< XDrawPage > xMasterPage( xMasterTarget->getMasterPage() );
+
+ nVisible = i;
+
+ for( sal_Int32 nMaster = 0, nMasterCount = rxMasterPages->getCount(); ( nMaster < nMasterCount ) && ( -1 == nVisibleMaster ); ++nMaster )
+ {
+ Reference< XDrawPage > xMasterTestPage;
+ rxMasterPages->getByIndex( nMaster ) >>= xMasterTestPage;
+
+ if( xMasterTestPage == xMasterPage )
+ nVisibleMaster = nMaster;
+ }
+ }
+ }
+ }
+ }
+ }
+
#ifdef _SVG_EMBED_FONTS
mpSVGFontExport->EmbedFonts();
#endif
- if( mbMultiPage )
+ if( bMultiPage )
{
implGenerateMetaData( rxMasterPages, rxDrawPages );
implGenerateScript( rxMasterPages, rxDrawPages );
}
- implExportPages( rxMasterPages, sal_True );
- implExportPages( rxDrawPages, sal_False );
+ implExportPages( rxMasterPages, nVisibleMaster, sal_True );
+ implExportPages( rxDrawPages, nVisible, sal_False );
delete mpSVGDoc, mpSVGDoc = NULL;
bRet = sal_True;
@@ -338,9 +374,8 @@ sal_Bool SVGFilter::implGenerateMetaData( const Reference< XDrawPages >& rxMaste
Reference< XDrawPage > xDrawPage( rxDrawPages->getByIndex( i ), UNO_QUERY );
Reference< XMasterPageTarget > xMasterPageTarget( xDrawPage, UNO_QUERY );
Reference< XDrawPage > xMasterPage( xMasterPageTarget->getMasterPage(), UNO_QUERY );
- sal_Bool bMasterBackgroundVisible = sal_True;
- sal_Bool bMasterObjectsVisible = sal_True;
- OUString aVisibility;
+ sal_Bool bMasterVisible = sal_True;
+ OUString aMasterVisibility;
aSlideId += OUString::valueOf( i );
@@ -349,29 +384,18 @@ sal_Bool SVGFilter::implGenerateMetaData( const Reference< XDrawPages >& rxMaste
Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY );
if( xPropSet.is() )
- {
- xPropSet->getPropertyValue( B2UCONST( "IsBackgroundVisible" ) ) >>= bMasterBackgroundVisible;
- xPropSet->getPropertyValue( B2UCONST( "IsBackgroundObjectsVisible" ) ) >>= bMasterObjectsVisible;
- }
+ xPropSet->getPropertyValue( B2UCONST( "Background" ) ) >>= bMasterVisible;
}
+ if( bMasterVisible )
+ aMasterVisibility = B2UCONST( "visible" );
+ else
+ aMasterVisibility = B2UCONST( "hidden" );
+
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aSlideId );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "slide", implGetValidIDFromInterface( xDrawPage ) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "master", implGetValidIDFromInterface( xMasterPage ) );
-
- if( bMasterBackgroundVisible )
- aVisibility = B2UCONST( "visible" );
- else
- aVisibility = B2UCONST( "hidden" );
-
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "master-background-visibility", aVisibility );
-
- if( bMasterObjectsVisible )
- aVisibility = B2UCONST( "visible" );
- else
- aVisibility = B2UCONST( "hidden" );
-
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "master-objects-visibility", aVisibility );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "master-visibility", aMasterVisibility );
{
SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "ooo:slideInfo", TRUE, TRUE );
@@ -397,9 +421,11 @@ sal_Bool SVGFilter::implGenerateScript( const Reference< XDrawPages >& rxMasterP
SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "script", TRUE, TRUE );
Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY );
- xExtDocHandler->unknown( OUString::createFromAscii( aSVGScript1 ) );
- xExtDocHandler->unknown( OUString::createFromAscii( aSVGScript2 ) );
- xExtDocHandler->unknown( OUString::createFromAscii( aSVGScript3 ) );
+ if( xExtDocHandler.is() )
+ {
+ xExtDocHandler->unknown( OUString::createFromAscii( aSVGScript1 ) );
+ xExtDocHandler->unknown( OUString::createFromAscii( aSVGScript2 ) );
+ }
}
return sal_True;
@@ -407,15 +433,16 @@ sal_Bool SVGFilter::implGenerateScript( const Reference< XDrawPages >& rxMasterP
// -----------------------------------------------------------------------------
-sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxPages, sal_Bool bMaster )
+sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxMasterPages,
+ sal_Int32 nVisiblePage, sal_Bool bMaster )
{
sal_Bool bRet = sal_False;
- for( sal_Int32 i = 0, nCount = rxPages->getCount(); i < nCount; ++i )
+ for( sal_Int32 i = 0, nCount = rxMasterPages->getCount(); i < nCount; ++i )
{
Reference< XDrawPage > xDrawPage;
- rxPages->getByIndex( i ) >>= xDrawPage;
+ rxMasterPages->getByIndex( i ) >>= xDrawPage;
if( xDrawPage.is() )
{
@@ -423,71 +450,44 @@ sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxPages, sal
if( xShapes.is() )
{
- Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY );
- const OUString aPageId( implGetValidIDFromInterface( xShapes ) );
- OUString aAttr;
+ OUString aAttr;
- if( !mbMultiPage )
+ if( i == nVisiblePage )
aAttr = B2UCONST( "visible" );
else
aAttr = B2UCONST( "hidden" );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", aAttr );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aPageId );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", implGetValidIDFromInterface( xShapes ) );
{
SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", TRUE, TRUE );
const Point aNullPt;
{
- SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "desc", TRUE, TRUE );
- OUString aDesc;
-
- if( bMaster )
- aDesc = B2UCONST( "Master slide" );
- else
- aDesc = B2UCONST( "Slide" );
-
- xExtDocHandler->unknown( aDesc );
- }
-
- if( bMaster )
- {
- // master slide background
- OUString aMasterBackgroundId( aPageId );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aMasterBackgroundId += B2UCONST( "_background" ) );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", aAttr );
+ Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY );
+ if( xExtDocHandler.is() )
{
- SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", TRUE, TRUE );
- const GDIMetaFile& rMtf = (*mpObjects)[ xDrawPage ].GetRepresentation();
+ SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "desc", TRUE, TRUE );
+ OUString aDesc;
- {
- SvXMLElementExport aExpDesc( *mpSVGExport, XML_NAMESPACE_NONE, "desc", TRUE, TRUE );
- xExtDocHandler->unknown( B2UCONST( "Master slide background" ) );
- }
+ if( bMaster )
+ aDesc = B2UCONST( "Master slide" );
+ else
+ aDesc = B2UCONST( "Slide" );
- mpSVGWriter->WriteMetaFile( aNullPt, rMtf.GetPrefSize(), rMtf, SVGWRITER_WRITE_FILL );
+ xExtDocHandler->unknown( aDesc );
}
+ }
- // master slide objects
- OUString aMasterObjectsId( aPageId );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aMasterObjectsId += B2UCONST( "_objects" ) );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", aAttr );
-
- {
- SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", TRUE, TRUE );
-
- {
- SvXMLElementExport aExpDesc( *mpSVGExport, XML_NAMESPACE_NONE, "desc", TRUE, TRUE );
- xExtDocHandler->unknown( B2UCONST( "Master slide objects" ) );
- }
-
- bRet = implExportShapes( xShapes ) || bRet;
- }
+ if( bMaster )
+ {
+ const GDIMetaFile& rMtf = (*mpObjects)[ xDrawPage ].GetRepresentation();
+ mpSVGWriter->WriteMetaFile( aNullPt, rMtf.GetPrefSize(), rMtf, SVGWRITER_WRITE_FILL );
}
- else
- bRet = implExportShapes( xShapes ) || bRet;
+
+ bRet = implExportShapes( xShapes ) || bRet;
}
}
}
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 38c2089ea56a..00618134b42a 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: svgfilter.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: ka $ $Date: 2002-08-21 06:03:20 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,8 +71,7 @@ SVGFilter::SVGFilter( const Reference< XMultiServiceFactory > &rxMSF ) :
mpSVGExport( NULL ),
mpSVGFontExport( NULL ),
mpSVGWriter( NULL ),
- mbPresentation( sal_False ),
- mbMultiPage( sal_False )
+ mbPresentation( sal_False )
{
}
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 6f23a60192ae..e16c5cc7f7cb 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: svgfilter.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: ka $ $Date: 2002-08-21 06:03:21 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -257,7 +257,6 @@ private:
SVGFontExport* mpSVGFontExport;
SVGActionWriter* mpSVGWriter;
sal_Bool mbPresentation;
- sal_Bool mbMultiPage;
sal_Bool implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException);
@@ -272,7 +271,8 @@ private:
sal_Bool implExportDocumemt( const Reference< XDrawPages >& rxMasterPages,
const Reference< XDrawPages >& rxDrawPages );
- sal_Bool implExportPages( const Reference< XDrawPages >& rxMasterPages, sal_Bool bMaster );
+ sal_Bool implExportPages( const Reference< XDrawPages >& rxMasterPages,
+ sal_Int32 nVisiblePage, sal_Bool bMaster );
sal_Bool implExportShapes( const Reference< XShapes >& rxShapes );
sal_Bool implExportShape( const Reference< XShape >& rxShape );
diff --git a/filter/source/svg/svgscript.hxx b/filter/source/svg/svgscript.hxx
index a6c26a9cdb41..e8d9caf78acb 100644
--- a/filter/source/svg/svgscript.hxx
+++ b/filter/source/svg/svgscript.hxx
@@ -1,10 +1,10 @@
- /*************************************************************************
+/*************************************************************************
*
* $RCSfile: svgscript.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: ka $ $Date: 2002-08-21 06:03:21 $
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,26 +59,13 @@
*
************************************************************************/
-static const char aSVGScript1[] = "\n\
-<![CDATA[\n\
+static const char aSVGScript1[] =
+"<![CDATA[\n\
var nCurSlide = 0;\n\
var nSlides = 0;\n\
- var aSlideDescriptors = new Object();\n\
-\n\
- function SlideDescriptor( aSlide,\n\
- aMaster,\n\
- aMasterBackground,\n\
- aMasterBackgroundVisibility,\n\
- aMasterObjects,\n\
- aMasterObjectsVisibility )\n\
- {\n\
- this.aSlide = aSlide;\n\
- this.aMaster = aMaster;\n\
- this.aMasterBackground = aMasterBackground;\n\
- this.aMasterBackgroundVisibility = aMasterBackgroundVisibility;\n\
- this.aMasterObjects = aMasterObjects;\n\
- this.aMasterObjectsVisibility = aMasterObjectsVisibility;\n\
- }\n\
+ var aSlides = new Object();\n\
+ var aMasters = new Object();\n\
+ var aMasterVisibilities = new Object();\n\
\n\
function onClick( aEvt )\n\
{\n\
@@ -93,7 +80,7 @@ static const char aSVGScript1[] = "\n\
switchSlide( aEvt, nOffset );\n\
}\n\
\n\
- function onKeyPress( aEvt )\n\
+ function onKeyPress( aEvt ) \n\
{\n\
var nCode = String.fromCharCode( aEvt.getCharCode() );\n\
var nOffset = 0;\n\
@@ -109,95 +96,69 @@ static const char aSVGScript1[] = "\n\
( aEvt.getKeyCode() == aEvt.DOM_VK_PAGE_UP() ||\n\
aEvt.getKeyCode() == aEvt.DOM_VK_LEFT() ) )\n\
{\n\
- nOffset = -1;\n\
+ nOffset = -1\n\
}\n\
\n\
if( 0 != nOffset )\n\
switchSlide( aEvt, nOffset );\n\
}\n\
+\n\
";
-static const char aSVGScript2[] = "\n\
- function switchSlide( aEvt, nOffset )\n\
+static const char aSVGScript2[] =
+" function switchSlide( aEvt, nOffset ) \n\
{\n\
- var nNxtSlide = nCurSlide + nOffset;\n\
+ var nNextSlide = nCurSlide + nOffset;\n\
\n\
- if( nNxtSlide < 0 && nSlides > 0 )\n\
- nNxtSlide = nSlides - 1;\n\
- else if( nNxtSlide >= nSlides ) \n\
- nNxtSlide = 0;\n\
+ if( nNextSlide < 0 && nSlides > 0 )\n\
+ nNextSlide = nSlides - 1;\n\
+ else if( nNextSlide >= nSlides ) \n\
+ nNextSlide = 0;\n\
\n\
- var aCurDescriptor = aSlideDescriptors[ nCurSlide ];\n\
- var aNxtDescriptor = aSlideDescriptors[ nNxtSlide ];\n\
- var aVisibility = \"visibility\";\n\
+ aSlides[ nCurSlide ].setAttributeNS( null, \"visibility\", \"hidden\" );\n\
+ aSlides[ nNextSlide ].setAttributeNS( null, \"visibility\", \"visible\" );\n\
\n\
- aCurDescriptor.aSlide.setAttributeNS( null, aVisibility, \"hidden\" );\n\
- aNxtDescriptor.aSlide.setAttributeNS( null, aVisibility, \"visible\" );\n\
-\n\
- if( ( 0 == nOffset ) || \n\
- ( aCurDescriptor.aMaster != aNxtDescriptor.aMaster ) ||\n\
- ( aCurDescriptor.aMasterBackgroundVisibility != aNxtDescriptor.aMasterBackgroundVisibility ) ||\n\
- ( aCurDescriptor.aMasterObjectsVisibility != aNxtDescriptor.aMasterObjectsVisibility ) )\n\
+ var aCurMaster = aMasters[ nCurSlide ];\n\
+ var aCurMasterVisibility = aMasterVisibilities[ nCurSlide ];\n\
+ \n\
+ var aNextMaster = aMasters[ nNextSlide ];\n\
+ var aNextMasterVisibility = aMasterVisibilities[ nNextSlide ];\n\
\n\
+ if( ( aCurMaster != aNextMaster ) || ( aCurMasterVisibility != aNextMasterVisibility ) ) \n\
{\n\
- aCurDescriptor.aMaster.setAttributeNS( null, aVisibility, \"hidden\" );\n\
- aCurDescriptor.aMasterBackground.setAttributeNS( null, aVisibility, \"hidden\" );\n\
- aCurDescriptor.aMasterObjects.setAttributeNS( null, aVisibility, \"hidden\" );\n\
-\n\
- aNxtDescriptor.aMaster.setAttributeNS( null, aVisibility, \"visible\" );\n\
- aNxtDescriptor.aMasterBackground.setAttributeNS( null, aVisibility, aNxtDescriptor.aMasterBackgroundVisibility );\n\
- aNxtDescriptor.aMasterObjects.setAttributeNS( null, aVisibility, aNxtDescriptor.aMasterObjectsVisibility );\n\
+ if( aCurMaster != aNextMaster )\n\
+ aCurMaster.setAttributeNS( null, \"visibility\", \"hidden\" );\n\
+ \n\
+ aNextMaster.setAttributeNS( null, \"visibility\", aNextMasterVisibility );\n\
}\n\
\n\
- nCurSlide = nNxtSlide; \n\
+ nCurSlide = nNextSlide; \n\
}\n\
-";
-
-static const char aSVGScript3[] = "\n\
- function onLoad() \n\
+\n\
+ function init() \n\
{\n\
nSlides = document.getElementById( \"meta_slides\" ).getAttributeNS( null, \"numberOfSlides\" );\n\
\n\
for( i = 0; i < nSlides; i++ )\n\
{\n\
var aSlide = document.getElementById( \"meta_slide\" + i );\n\
- var aSlideName = aSlide.getAttributeNS( null, \"slide\" );\n\
- var aMasterName = aSlide.getAttributeNS( null, \"master\" );\n\
-\n\
- aSlideDescriptors[ i ] = new SlideDescriptor( \n\
- document.getElementById( aSlideName ),\n\
- document.getElementById( aMasterName ),\n\
- document.getElementById( aMasterName + \"_background\" ),\n\
- aSlide.getAttributeNS( null, \"master-background-visibility\" ),\n\
- document.getElementById( aMasterName + \"_objects\" ),\n\
- aSlide.getAttributeNS( null, \"master-objects-visibility\" ) );\n\
+ \n\
+ aSlides[ i ] = document.getElementById( aSlide.getAttributeNS( null, \"slide\" ) );\n\
+ aMasters[ i ] = document.getElementById( aSlide.getAttributeNS( null, \"master\" ) );\n\
+ aMasterVisibilities[ i ] = aSlide.getAttributeNS( null, \"master-visibility\" );\n\
}\n\
-\n\
- switchSlide( 0, 0 );\n\
}\n\
-]]>\n\
-";
+\n\
+ init();\n\
+]]>";
/*
<![CDATA[
var nCurSlide = 0;
var nSlides = 0;
- var aSlideDescriptors = new Object();
-
- function SlideDescriptor( aSlide,
- aMaster,
- aMasterBackground,
- aMasterBackgroundVisibility,
- aMasterObjects,
- aMasterObjectsVisibility )
- {
- this.aSlide = aSlide;
- this.aMaster = aMaster;
- this.aMasterBackground = aMasterBackground;
- this.aMasterBackgroundVisibility = aMasterBackgroundVisibility;
- this.aMasterObjects = aMasterObjects;
- this.aMasterObjectsVisibility = aMasterObjectsVisibility;
- }
+ var aSlides = new Object();
+ var aMasters = new Object();
+ var aMasterVisibilities;
function onClick( aEvt )
{
@@ -228,7 +189,7 @@ static const char aSVGScript3[] = "\n\
( aEvt.getKeyCode() == aEvt.DOM_VK_PAGE_UP() ||
aEvt.getKeyCode() == aEvt.DOM_VK_LEFT() ) )
{
- nOffset = -1;
+ nOffset = -1
}
if( 0 != nOffset )
@@ -237,57 +198,46 @@ static const char aSVGScript3[] = "\n\
function switchSlide( aEvt, nOffset )
{
- var nNxtSlide = nCurSlide + nOffset;
+ var nNextSlide = nCurSlide + nOffset;
- if( nNxtSlide < 0 && nSlides > 0 )
- nNxtSlide = nSlides - 1;
- else if( nNxtSlide >= nSlides )
- nNxtSlide = 0;
+ if( nNextSlide < 0 && nSlides > 0 )
+ nNextSlide = nSlides - 1;
+ else if( nNextSlide >= nSlides )
+ nNextSlide = 0;
- var aCurDescriptor = aSlideDescriptors[ nCurSlide ];
- var aNxtDescriptor = aSlideDescriptors[ nNxtSlide ];
+ aSlides[ nCurSlide ].setAttributeNS( null, "visibility", "hidden" );
+ aSlides[ nNextSlide ].setAttributeNS( null, "visibility", "visible" );
- aCurDescriptor.aSlide.setAttributeNS( null, "visibility", "hidden" );
- aNxtDescriptor.aSlide.setAttributeNS( null, "visibility", "visible" );
+ var aCurMaster = aMasters[ nCurSlide ];
+ var aCurMasterVisibility = aMasterVisibilities[ nCurSlide ];
- if( ( 0 == nOffset ) ||
- ( aCurDescriptor.aMaster != aNxtDescriptor.aMaster ) ||
- ( aCurDescriptor.aMasterBackgroundVisibility != aNxtDescriptor.aMasterBackgroundVisibility ) ||
- ( aCurDescriptor.aMasterObjectsVisibility != aNxtDescriptor.aMasterObjectsVisibility ) )
+ var aNextMaster = aMasters[ nNextSlide ];
+ var aNextMasterVisibility = aMasterVisibilities[ nNextSlide ];
+ if( ( aCurMaster != aNextMaster ) || ( aCurMasterVisibility != aNextMasterVisibility ) )
{
- aCurDescriptor.aMaster.setAttributeNS( null, "visibility", "hidden" );
- aCurDescriptor.aMasterBackground.setAttributeNS( null, "visibility", "hidden" );
- aCurDescriptor.aMasterObjects.setAttributeNS( null, "visibility", "hidden" );
+ if( aCurMaster != aNextMaster )
+ aCurMaster.setAttributeNS( null, "visibility", "hidden" );
- aNxtDescriptor.aMaster.setAttributeNS( null, "visibility", "visible" );
- aNxtDescriptor.aMasterBackground.setAttributeNS( null, "visibility", aNxtDescriptor.aMasterBackgroundVisibility );
- aNxtDescriptor.aMasterObjects.setAttributeNS( null, "visibility", aNxtDescriptor.aMasterObjectsVisibility );
+ aNextMaster.setAttributeNS( null, "visibility", aNextMasterVisibility );
}
- nCurSlide = nNxtSlide;
+ nCurSlide = nNextSlide;
}
- function onLoad()
+ function init()
{
nSlides = document.getElementById( "meta_slides" ).getAttributeNS( null, "numberOfSlides" );
for( i = 0; i < nSlides; i++ )
{
var aSlide = document.getElementById( "meta_slide" + i );
- var aSlideName = aSlide.getAttributeNS( null, "slide" );
- var aMasterName = aSlide.getAttributeNS( null, "master" );
- aSlideDescriptors[ i ] = new SlideDescriptor(
- document.getElementById( aSlideName ),
- document.getElementById( aMasterName ),
- document.getElementById( aMasterName + "_background" ),
- aSlide.getAttributeNS( null, "master-background-visibility" ),
- document.getElementById( aMasterName + "_objects" ),
- aSlide.getAttributeNS( null, "master-objects-visibility" ) );
+ aSlides[ i ] = document.getElementById( aSlide.getAttributeNS( null, "slide" ) );
+ aMasters[ i ] = document.getElementById( aSlide.getAttributeNS( null, "master" ) );
+ aMasterVisibilities[ i ] = aSlide.getAttributeNS( null, "master-visibility" );
}
-
- switchSlide( 0, 0 );
}
-]]>
-*/
+
+ init();
+]]*/
diff --git a/filter/source/xmlfilterdetect/fdcomp.cxx b/filter/source/xmlfilterdetect/fdcomp.cxx
new file mode 100644
index 000000000000..ea655e62fcce
--- /dev/null
+++ b/filter/source/xmlfilterdetect/fdcomp.cxx
@@ -0,0 +1,270 @@
+/*************************************************************************
+
+ *
+
+ * $RCSfile: fdcomp.cxx,v $
+
+ *
+
+ * $Revision: 1.2 $
+
+ *
+
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:54 $
+
+ *
+
+ * The Contents of this file are made available subject to the terms of
+
+ * either of the following licenses
+
+ *
+
+ * - GNU Lesser General Public License Version 2.1
+
+ * - Sun Industry Standards Source License Version 1.1
+
+ *
+
+ * Sun Microsystems Inc., October, 2000
+
+ *
+
+ * GNU Lesser General Public License Version 2.1
+
+ * =============================================
+
+ * Copyright 2000 by Sun Microsystems, Inc.
+
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+
+ *
+
+ * This library is free software; you can redistribute it and/or
+
+ * modify it under the terms of the GNU Lesser General Public
+
+ * License version 2.1, as published by the Free Software Foundation.
+
+ *
+
+ * This library 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 for more details.
+
+ *
+
+ * You should have received a copy of the GNU Lesser General Public
+
+ * License along with this library; if not, write to the Free Software
+
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+
+ * MA 02111-1307 USA
+
+ *
+
+ *
+
+ * Sun Industry Standards Source License Version 1.1
+
+ * =================================================
+
+ * The contents of this file are subject to the Sun Industry Standards
+
+ * Source License Version 1.1 (the "License"); You may not use this file
+
+ * except in compliance with the License. You may obtain a copy of the
+
+ * License at http://www.openoffice.org/license.html.
+
+ *
+
+ * Software provided under this License is provided on an "AS IS" basis,
+
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+
+ * See the License for the specific provisions governing your rights and
+
+ * obligations concerning the Software.
+
+ *
+
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+
+ *
+
+ * Copyright: 2000 by Sun Microsystems, Inc.
+
+ *
+
+ * All Rights Reserved.
+
+ *
+
+ * Contributor(s): _______________________________________
+
+ *
+
+ *
+
+ ************************************************************************/
+
+#include <stdio.h>
+
+
+
+#include <osl/mutex.hxx>
+
+#include <osl/thread.h>
+
+#include <cppuhelper/factory.hxx>
+
+
+
+#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
+
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+
+#endif
+
+
+
+#include "filterdetect.hxx"
+
+
+
+using namespace ::rtl;
+
+using namespace ::cppu;
+
+using namespace ::com::sun::star::uno;
+
+using namespace ::com::sun::star::lang;
+
+using namespace ::com::sun::star::registry;
+
+
+
+extern "C"
+
+{
+
+//==================================================================================================
+
+void SAL_CALL component_getImplementationEnvironment(
+
+ const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
+
+{
+
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+
+}
+
+//==================================================================================================
+
+sal_Bool SAL_CALL component_writeInfo(
+
+ void * pServiceManager, void * pRegistryKey )
+
+{
+
+ if (pRegistryKey)
+
+ {
+
+ try
+
+ {
+
+ Reference< XRegistryKey > xNewKey(
+
+ reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FilterDetect_getImplementationName() ) );
+
+ xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
+
+
+
+ const Sequence< OUString > & rSNL = FilterDetect_getSupportedServiceNames();
+
+ const OUString * pArray = rSNL.getConstArray();
+
+ for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
+
+ xNewKey->createKey( pArray[nPos] );
+
+
+
+ return sal_True;
+
+ }
+
+ catch (InvalidRegistryException &)
+
+ {
+
+ OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
+
+ }
+
+ }
+
+ return sal_False;
+
+}
+
+//==================================================================================================
+
+void * SAL_CALL component_getFactory(
+
+ const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
+
+{
+
+ void * pRet = 0;
+
+
+
+ OUString implName = OUString::createFromAscii( pImplName );
+
+ if ( pServiceManager && implName.equals(FilterDetect_getImplementationName()) )
+
+ {
+
+ Reference< XSingleServiceFactory > xFactory( createSingleFactory(
+
+ reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
+
+ OUString::createFromAscii( pImplName ),
+
+ FilterDetect_createInstance, FilterDetect_getSupportedServiceNames() ) );
+
+
+
+ if (xFactory.is())
+
+ {
+
+ xFactory->acquire();
+
+ pRet = xFactory.get();
+
+ }
+
+ }
+
+ return pRet;
+
+}
+
+}
+
diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx
new file mode 100644
index 000000000000..344a39709baa
--- /dev/null
+++ b/filter/source/xmlfilterdetect/filterdetect.cxx
@@ -0,0 +1,418 @@
+/*************************************************************************
+ *
+ * $RCSfile: filterdetect.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Aidan Butler (aidan.butler@sun.com)
+ *
+ *
+ *
+ ************************************************************************/
+#include <iostream.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdio.h>
+#ifndef _FILTERDETECT_HXX
+#include "filterdetect.hxx"
+#endif
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_
+#include <com/sun/star/io/XOutputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
+#include <com/sun/star/io/XInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_XML_SAX_INPUTSOURCE_HPP_
+#include <com/sun/star/xml/sax/InputSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XML_SAX_XPARSER_HPP_
+#include <com/sun/star/xml/sax/XParser.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_XML_XIMPORTFILTER_HPP_
+#include <com/sun/star/xml/XImportFilter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XML_XEXPORTFILTER_HPP_
+#include <com/sun/star/xml/XExportFilter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
+#include <com/sun/star/frame/XModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORFACTORY_HPP_
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_XSTYLEFAMILIESSUPPLIER_HPP_
+#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_XSTYLELOADER_HPP_
+#include <com/sun/star/style/XStyleLoader.hpp>
+#endif
+
+
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
+#include <com/sun/star/io/XInputStream.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_DOCUMENT_XEXTENDEDFILTERDETECTION_HPP_
+#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
+#include <com/sun/star/container/XNamesAccess.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_
+#include <com/sun/star/beans/PropertyState.hpp>
+#endif
+
+
+#ifndef _UCBHELPER_CONTENT_HXX
+#include <ucbhelper/content.hxx>
+#endif
+#ifndef _UCBHELPER_CONTENTBROKER_HXX
+#include <ucbhelper/contentbroker.hxx>
+#endif
+#ifndef _UCBHELPER_COMMANDENVIRONMENT_HXX
+#include <ucbhelper/commandenvironment.hxx>
+#endif
+
+#ifndef _UNOTOOLS_UCBHELPER_HXX
+#include <unotools/ucbhelper.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#endif
+
+
+
+
+using rtl::OUString;
+using com::sun::star::uno::Sequence;
+using com::sun::star::uno::Reference;
+using com::sun::star::uno::Any;
+using com::sun::star::uno::UNO_QUERY;
+using com::sun::star::uno::XInterface;
+using com::sun::star::uno::Exception;
+using com::sun::star::uno::RuntimeException;
+using com::sun::star::lang::XMultiServiceFactory;
+using com::sun::star::io::XActiveDataSource;
+using com::sun::star::io::XOutputStream;
+using com::sun::star::beans::PropertyValue;
+using com::sun::star::document::XExporter;
+using com::sun::star::document::XFilter;
+using com::sun::star::document::XExtendedFilterDetection;
+
+using com::sun::star::io::XInputStream;
+using com::sun::star::document::XImporter;
+using com::sun::star::xml::sax::InputSource;
+using com::sun::star::xml::sax::XDocumentHandler;
+using com::sun::star::xml::sax::XParser;
+using com::sun::star::task::XInteractionHandler;
+
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star;
+using namespace com::sun::star::container;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::beans;
+
+
+Reference< com::sun::star::frame::XModel > xModel;
+
+::rtl::OUString SAL_CALL supportedByType( const ::com::sun::star::uno::Sequence< ::rtl::OUString > urlPattern , const ::rtl::OString resultString, const ::rtl::OUString checkType);
+
+
+::rtl::OUString SAL_CALL FilterDetect::detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& aArguments ) throw( com::sun::star::uno::RuntimeException )
+{
+ ::rtl::OUString sTypeName = OUString::createFromAscii("");
+ ::rtl::OUString sUrl;
+ ::rtl::OUString originalTypeName;
+ Sequence<PropertyValue > lProps ;
+
+ com::sun::star::uno::Reference< com::sun::star::io::XInputStream > xInStream;
+ ::rtl::OUString temp;
+ //OSL_ENSURE( sal_False, " starting Detect" );
+ const PropertyValue * pValue = aArguments.getConstArray();
+ sal_Int32 nLength;
+ ::rtl::OString resultString;
+
+ sal_Int32 location=0;
+
+ nLength = aArguments.getLength();
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+
+ if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "TypeName" ) ) )
+ {
+ //pValue[i].Value >>= originalTypeName;
+ location=i;
+ // OSL_ENSURE( sal_False, ::rtl::OUStringToOString(sTypeName,RTL_TEXTENCODING_ASCII_US).getStr() );
+
+ }
+ else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "URL" ) ) )
+ {
+
+ pValue[i].Value >>= sUrl;
+ //OSL_ENSURE( sal_False, ::rtl::OUStringToOString(sUrl,RTL_TEXTENCODING_ASCII_US).getStr() );
+
+ }
+
+
+ }
+ try{
+ Reference< com::sun::star::ucb::XCommandEnvironment > xEnv;
+
+ ::ucb::Content aContent(sUrl,xEnv);
+ xInStream = aContent.openStream();
+ com::sun::star::uno::Sequence< sal_Int8 > aData;
+ if (!xInStream.is())
+ {
+ return sTypeName;
+ }
+ long nBytesToRead=xInStream->available();
+ xInStream->skipBytes (0);
+ long bytestRead =xInStream->readBytes (aData, 1000);
+ resultString=::rtl::OString((const sal_Char *)aData.getConstArray(),bytestRead) ;
+
+
+ // test typedetect code
+
+
+ Reference <XNameAccess> xTypeCont(mxMSF->createInstance(OUString::createFromAscii("com.sun.star.document.TypeDetection")),UNO_QUERY);
+ Sequence < ::rtl::OUString > myTypes= xTypeCont->getElementNames();
+ nLength = myTypes.getLength();
+
+
+ sal_Int32 new_nlength=0;
+ sal_Int32 i = 0 ;
+ while( (i < nLength) && (sTypeName.equalsAscii("")))
+ {
+
+ Any elem = xTypeCont->getByName(myTypes[i]);
+ elem >>=lProps;
+ new_nlength = lProps.getLength();
+ sal_Int32 j =0;
+ while( j < new_nlength && sTypeName.equalsAscii(""))
+ {
+
+ Sequence< ::rtl::OUString > tmpStr;
+ lProps[j].Value >>=tmpStr;
+
+ if((lProps[j].Name.equalsAscii("URLPattern")) && (tmpStr.getLength()>0) )
+ {
+
+ sTypeName = supportedByType(tmpStr,resultString, myTypes[i]);
+
+ }
+ j++;
+ }
+ i++;
+ }
+ //end test
+
+ }
+ catch(Exception &)
+ {
+ OSL_ENSURE( sal_False, "An Exception occured while opening File stream" );
+ }
+
+ if(sTypeName.equalsAscii(""))
+ {
+ //sTypeName=::rtl::OUString::createFromAscii("writer_Flat_XML_File");
+ }
+ else
+ {
+ aArguments[location].Value <<=sTypeName;
+
+ }
+ // OSL_ENSURE( sal_False, ::rtl::OUStringToOString(sTypeName,RTL_TEXTENCODING_ASCII_US).getStr() );
+
+
+ return sTypeName;
+}
+
+
+
+::rtl::OUString SAL_CALL supportedByType( const Sequence< ::rtl::OUString > urlPattern , const ::rtl::OString resultString, const ::rtl::OUString checkType)
+{
+ sal_Int32 i=0;
+ sal_Int32 checked =0;
+ ::rtl::OUString sTypeName= OUString::createFromAscii("");
+ while ( (i<urlPattern.getLength()) && (sTypeName.equalsAscii("")))
+ {
+ //OSL_ENSURE( sal_False, ::rtl::OUStringToOString(myTypes[i],RTL_TEXTENCODING_ASCII_US).getStr() );
+ // OSL_ENSURE( sal_False, ::rtl::OUStringToOString(tmpStr[k].copy(0,7),RTL_TEXTENCODING_ASCII_US).getStr() );
+
+ if((urlPattern[i].match(OUString::createFromAscii("doctype:")))&&(sTypeName.equalsAscii("")))
+ {
+ ::rtl::OString tryStr = ::rtl::OUStringToOString(urlPattern[i].copy(8),RTL_TEXTENCODING_ASCII_US).getStr();
+ // OSL_ENSURE( sal_False, tryStr);
+ while((checked <=resultString.getLength())&& (sTypeName.equalsAscii("")))
+ {
+ if( resultString.match(tryStr,checked))
+ {
+ sTypeName = checkType;
+ break;
+ }
+ checked++;
+ }
+ }
+ i++;
+ }
+ return sTypeName;
+}
+
+
+
+// XInitialization
+
+void SAL_CALL FilterDetect::initialize( const Sequence< Any >& aArguments )
+ throw (Exception, RuntimeException)
+{
+ Sequence < PropertyValue > aAnySeq;
+ sal_Int32 nLength = aArguments.getLength();
+ if ( nLength && ( aArguments[0] >>= aAnySeq ) )
+ {
+ const PropertyValue * pValue = aAnySeq.getConstArray();
+ nLength = aAnySeq.getLength();
+ for ( sal_Int32 i = 0 ; i < nLength; i++)
+ {
+
+ if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "Type" ) ) )
+ {
+ pValue[i].Value >>= msFilterName;
+
+ }
+ else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "UserData" ) ) )
+ {
+
+ pValue[i].Value >>= msUserData;
+
+ }
+ else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "TemplateName" ) ) )
+ {
+
+ pValue[i].Value>>=msTemplateName;
+ }
+
+ }
+ }
+}
+
+
+
+OUString FilterDetect_getImplementationName ()
+ throw (RuntimeException)
+{
+ return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.filters.XMLFilterDetect" ) );
+}
+#define SERVICE_NAME1 "com.sun.star.document.ExtendedTypeDetection"
+
+sal_Bool SAL_CALL FilterDetect_supportsService( const OUString& ServiceName )
+ throw (RuntimeException)
+{
+ return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) );
+}
+Sequence< OUString > SAL_CALL FilterDetect_getSupportedServiceNames( )
+ throw (RuntimeException)
+{
+ Sequence < OUString > aRet(2);
+ OUString* pArray = aRet.getArray();
+ pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) );
+ return aRet;
+}
+#undef SERVICE_NAME1
+#undef SERVICE_NAME2
+
+Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
+ throw( Exception )
+{
+ return (cppu::OWeakObject*) new FilterDetect( rSMgr );
+}
+
+// XServiceInfo
+OUString SAL_CALL FilterDetect::getImplementationName( )
+ throw (RuntimeException)
+{
+ return FilterDetect_getImplementationName();
+}
+sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName )
+ throw (RuntimeException)
+{
+ return FilterDetect_supportsService( rServiceName );
+}
+Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames( )
+ throw (RuntimeException)
+{
+ return FilterDetect_getSupportedServiceNames();
+}
diff --git a/filter/source/xmlfilterdetect/filterdetect.hxx b/filter/source/xmlfilterdetect/filterdetect.hxx
new file mode 100644
index 000000000000..813bd374ea03
--- /dev/null
+++ b/filter/source/xmlfilterdetect/filterdetect.hxx
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * $RCSfile: filterdetect.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-25 17:57:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Aidan Butler (aidan.butler@sun.com)
+ *
+ *
+ ************************************************************************/
+
+#ifndef _FILTERDETECT_HXX
+#define _FILTERDETECT_HXX
+
+
+#ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_
+#include <com/sun/star/document/XFilter.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_DOCUMENT_XEXPORTER_HPP_
+#include <com/sun/star/document/XExporter.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_DOCUMENT_XEXTENDEDFILTERDETECTION_HPP_
+#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_DOCUMENT_XIMPORTER_HPP_
+#include <com/sun/star/document/XImporter.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+
+#ifndef _CPPUHELPER_IMPLBASE5_HXX_
+#include <cppuhelper/implbase5.hxx>
+#endif
+
+#ifndef _CPPUHELPER_IMPLBASE4_HXX_
+#include <cppuhelper/implbase3.hxx>
+#endif
+
+
+
+enum FilterType
+{
+ FILTER_IMPORT,
+ FILTER_EXPORT
+};
+
+/* This component will be instantiated for both import or export. Whether it calls
+ * setSourceDocument or setTargetDocument determines which Impl function the filter
+ * member calls */
+
+class FilterDetect : public cppu::WeakImplHelper3
+
+<
+
+
+ com::sun::star::document::XExtendedFilterDetection,
+
+ com::sun::star::lang::XInitialization,
+
+ com::sun::star::lang::XServiceInfo
+
+>
+
+{
+
+protected:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
+
+ ::rtl::OUString msFilterName;
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > msUserData;
+
+ ::rtl::OUString msTemplateName;
+
+
+
+ sal_Bool SAL_CALL exportImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+
+ throw (::com::sun::star::uno::RuntimeException);
+
+ sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+
+
+
+public:
+
+ FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
+
+ : mxMSF( rxMSF ) {}
+
+ virtual ~FilterDetect() {}
+
+
+
+
+
+
+ //XExtendedFilterDetection
+ virtual ::rtl::OUString SAL_CALL FilterDetect::detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lDescriptor )
+ throw( com::sun::star::uno::RuntimeException );
+
+
+ // XInitialization
+
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+
+
+ // XServiceInfo
+
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
+
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
+
+ throw (::com::sun::star::uno::RuntimeException);
+
+};
+
+
+
+::rtl::OUString FilterDetect_getImplementationName()
+
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+
+
+sal_Bool SAL_CALL FilterDetect_supportsService( const ::rtl::OUString& ServiceName )
+
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL FilterDetect_getSupportedServiceNames( )
+
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+
+SAL_CALL FilterDetect_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
+
+ throw ( ::com::sun::star::uno::Exception );
+
+
+
+#endif
+
diff --git a/filter/source/xmlfilterdetect/makefile.mk b/filter/source/xmlfilterdetect/makefile.mk
new file mode 100644
index 000000000000..297590f0f2ee
--- /dev/null
+++ b/filter/source/xmlfilterdetect/makefile.mk
@@ -0,0 +1,104 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: hr $ $Date: 2003-03-25 17:57:55 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+PRJ=..$/..
+
+PRJNAME= filter
+TARGET= fl_xmlfilterdetect
+USE_DEFFILE= TRUE
+NO_BSYMBOLIC= TRUE
+ENABLE_EXCEPTIONS= TRUE
+BOOTSTRAP_SERVICE= FALSE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+# --- defines ------------------------------------------------------
+
+CDEFS+=-DCOMPMOD_NAMESPACE=framework
+
+# --- Targets ------------------------------------------------------
+SHL1TARGET= xmlfd$(UPD)$(DLLPOSTFIX)
+
+SHL1IMPLIB= i$(SHL1TARGET)
+
+SHL1OBJS= $(SLO)$/fdcomp.obj \
+ $(SLO)$/filterdetect.obj
+
+
+
+SHL1STDLIBS= $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(COMPHELPERLIB) \
+ $(SALLIB) \
+ $(UCBHELPERLIB)
+
+
+SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+
+
+DEF1NAME= $(SHL1TARGET)
+
+DEF1EXPORTFILE= exports.dxp
+
+.INCLUDE : target.mk