Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D95F2D6FB for ; Wed, 25 Jul 2012 11:50:33 +0000 (UTC) Received: (qmail 87261 invoked by uid 500); 25 Jul 2012 11:50:33 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 87004 invoked by uid 500); 25 Jul 2012 11:50:27 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 86973 invoked by uid 99); 25 Jul 2012 11:50:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2012 11:50:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2012 11:50:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0F34C23888FD; Wed, 25 Jul 2012 11:49:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1365538 - in /incubator/ooo/trunk/main: filter/source/svg/svgexport.cxx filter/source/svg/svgfilter.hxx filter/source/svg/svgwriter.cxx filter/source/svg/svgwriter.hxx svtools/source/filter/filter.cxx Date: Wed, 25 Jul 2012 11:49:36 -0000 To: ooo-commits@incubator.apache.org From: alg@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120725114937.0F34C23888FD@eris.apache.org> Author: alg Date: Wed Jul 25 11:49:36 2012 New Revision: 1365538 URL: http://svn.apache.org/viewvc?rev=1365538&view=rev Log: #120175# SVG export fixes and enhancements Patch by: Sven Jacobi Review by: alg Modified: incubator/ooo/trunk/main/filter/source/svg/svgexport.cxx incubator/ooo/trunk/main/filter/source/svg/svgfilter.hxx incubator/ooo/trunk/main/filter/source/svg/svgwriter.cxx incubator/ooo/trunk/main/filter/source/svg/svgwriter.hxx incubator/ooo/trunk/main/svtools/source/filter/filter.cxx Modified: incubator/ooo/trunk/main/filter/source/svg/svgexport.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/svg/svgexport.cxx?rev=1365538&r1=1365537&r2=1365538&view=diff ============================================================================== --- incubator/ooo/trunk/main/filter/source/svg/svgexport.cxx (original) +++ incubator/ooo/trunk/main/filter/source/svg/svgexport.cxx Wed Jul 25 11:49:36 2012 @@ -31,7 +31,6 @@ #include "svgfilter.hxx" #include "impsvgdialog.hxx" -#include #include #include #include @@ -49,11 +48,41 @@ using ::rtl::OUString; SVGExport::SVGExport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, const Reference< XDocumentHandler >& rxHandler, - const Sequence< PropertyValue >& rFilterData ) : - SvXMLExport( xServiceFactory, MAP_100TH_MM ), - mrFilterData( rFilterData ) + const Sequence< PropertyValue >& rFilterData ) +: SvXMLExport( xServiceFactory, MAP_100TH_MM ) +, mbTinyProfile ( sal_True ) +, mbTSpans ( sal_True ) +, mbEmbedFonts ( sal_False ) +, mbNativeTextDecoration( sal_True ) +, mbOpacity ( sal_True ) +, mbGradient ( sal_True ) { - SetDocHandler( rxHandler ); + for ( sal_Int32 i = 0, nCount = rFilterData.getLength(); i < nCount; i++ ) + { + if ( rFilterData[ i ].Name == B2UCONST( SVG_PROP_TINYPROFILE ) ) + rFilterData[ i ].Value >>= mbTinyProfile; + else if ( rFilterData[ i ].Name == B2UCONST( "TSpans" ) ) + rFilterData[ i ].Value >>= mbTSpans; + else if ( rFilterData[ i ].Name == B2UCONST( SVG_PROP_EMBEDFONTS ) ) + rFilterData[ i ].Value >>= mbEmbedFonts; + else if ( rFilterData[ i ].Name == B2UCONST( SVG_PROP_NATIVEDECORATION ) ) + rFilterData[ i ].Value >>= mbNativeTextDecoration; + else if ( rFilterData[ i ].Name == B2UCONST( "GlyphPlacement" ) ) + rFilterData[ i ].Value >>= maGlyphPlacement; + else if ( rFilterData[ i ].Name == B2UCONST( SVG_PROP_OPACITY ) ) + rFilterData[ i ].Value >>= mbOpacity; + else if ( rFilterData[ i ].Name == B2UCONST( SVG_PROP_GRADIENT ) ) + rFilterData[ i ].Value >>= mbGradient; + } + if ( mbTinyProfile ) + mbNativeTextDecoration = sal_False; + else + { + mbTSpans = sal_False; + mbOpacity = sal_True; + mbGradient = sal_True; + } + SetDocHandler( rxHandler ); GetDocHandler()->startDocument(); } @@ -66,80 +95,6 @@ SVGExport::~SVGExport() // ----------------------------------------------------------------------------- -sal_Bool SVGExport::IsUseTinyProfile() const -{ - sal_Bool bRet = sal_False; - - if( mrFilterData.getLength() > 0 ) - mrFilterData[ 0 ].Value >>= bRet; - - return bRet; -} - -// ----------------------------------------------------------------------------- - -sal_Bool SVGExport::IsEmbedFonts() const -{ - sal_Bool bRet = sal_False; - - if( mrFilterData.getLength() > 1 ) - mrFilterData[ 1 ].Value >>= bRet; - - return bRet; -} - -// ----------------------------------------------------------------------------- - -sal_Bool SVGExport::IsUseNativeTextDecoration() const -{ - sal_Bool bRet = !IsUseTinyProfile(); - - if( bRet && ( mrFilterData.getLength() > 2 ) ) - mrFilterData[ 2 ].Value >>= bRet; - - return bRet; -} - -// ----------------------------------------------------------------------------- - -::rtl::OUString SVGExport::GetGlyphPlacement() const -{ - ::rtl::OUString aRet; - - if( mrFilterData.getLength() > 3 ) - mrFilterData[ 3 ].Value >>= aRet; - else - aRet = B2UCONST( "abs" ); - - return aRet; -} - -// ----------------------------------------------------------------------------- - -sal_Bool SVGExport::IsUseOpacity() const -{ - sal_Bool bRet = !IsUseTinyProfile(); - - if( !bRet && ( mrFilterData.getLength() > 4 ) ) - mrFilterData[ 4 ].Value >>= bRet; - - return bRet; -} - -// ----------------------------------------------------------------------------- - -sal_Bool SVGExport::IsUseGradient() const -{ - sal_Bool bRet = !IsUseTinyProfile(); - - if( !bRet && ( mrFilterData.getLength() > 5 ) ) - mrFilterData[ 5 ].Value >>= bRet; - - return bRet; -} - -// ----------------------------------------------------------------------------- - void SVGExport::pushClip( const ::basegfx::B2DPolyPolygon& rPolyPoly ) { maClipList.push_front( ::basegfx::tools::correctOrientations( rPolyPoly ) ); @@ -478,7 +433,7 @@ sal_Bool SVGFilter::implExportDocument( aAttr += OUString::valueOf( nDocWidth ); aAttr += B2UCONST( " " ); aAttr += OUString::valueOf( nDocHeight ); - + mpSVGExport->SetViewBox( Rectangle( Point(), Size( nDocWidth, nDocHeight ) ) ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "viewBox", aAttr ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", B2UCONST( "xMidYMid" ) ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "fill-rule", B2UCONST( "evenodd" ) ); @@ -1272,7 +1227,13 @@ void SVGExport::writeMtf( const GDIMetaF aAttr += B2UCONST( " " ); aAttr += rtl::OUString::valueOf( aSize.Height() * 100L ); AddAttribute( XML_NAMESPACE_NONE, "viewBox", aAttr ); + SetViewBox( Rectangle( Point(), Size( aSize.Width() * 100, aSize.Height() * 100 ) ) ); + + // standard line width is based on 1 pixel on a 90 DPI device (0.28222mmm) + AddAttribute( XML_NAMESPACE_NONE, "stroke-width", OUString::valueOf( 28.222 ) ); + AddAttribute( XML_NAMESPACE_NONE, "stroke-linejoin", B2UCONST( "round" ) ); + AddAttribute( XML_NAMESPACE_NONE, "xml:space", B2UCONST( "preserve" ) ); { SvXMLElementExport aSVG( *this, XML_NAMESPACE_NONE, "svg", sal_True, sal_True ); Modified: incubator/ooo/trunk/main/filter/source/svg/svgfilter.hxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/svg/svgfilter.hxx?rev=1365538&r1=1365537&r2=1365538&view=diff ============================================================================== --- incubator/ooo/trunk/main/filter/source/svg/svgfilter.hxx (original) +++ incubator/ooo/trunk/main/filter/source/svg/svgfilter.hxx Wed Jul 25 11:49:36 2012 @@ -79,7 +79,6 @@ #include #include #include - #include "svgfilter.hxx" #include "svgscript.hxx" @@ -113,6 +112,17 @@ class SVGExport : public SvXMLExport { typedef ::std::list< ::basegfx::B2DPolyPolygon > B2DPolyPolygonList; + rtl::OUString maGlyphPlacement; + + sal_Bool mbTinyProfile; + sal_Bool mbTSpans; + sal_Bool mbEmbedFonts; + sal_Bool mbNativeTextDecoration; + sal_Bool mbOpacity; + sal_Bool mbGradient; + + Rectangle maViewBox; + public: SVGExport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, @@ -121,13 +131,18 @@ public: virtual ~SVGExport(); - sal_Bool IsUseTinyProfile() const; - sal_Bool IsEmbedFonts() const; - sal_Bool IsUseNativeTextDecoration() const; - ::rtl::OUString GetGlyphPlacement() const; - sal_Bool IsUseOpacity() const; - sal_Bool IsUseGradient() const; + sal_Bool IsUseTinyProfile() const { return mbTinyProfile; }; + sal_Bool IsUseTSpans() const { return mbTSpans; }; + sal_Bool IsEmbedFonts() const { return mbEmbedFonts; }; + sal_Bool IsUseNativeTextDecoration() const { return mbNativeTextDecoration; }; + ::rtl::OUString GetGlyphPlacement() const { return maGlyphPlacement; }; + sal_Bool IsUseOpacity() const { return mbOpacity; }; + sal_Bool IsUseGradient() const { return mbGradient; }; + const Rectangle& GetViewBox() const { return maViewBox; }; + void SetViewBox( const Rectangle& rViewBox ) { maViewBox = rViewBox; }; + sal_Bool IsVisible( const Rectangle& rRect ) const { return GetViewBox().IsOver( rRect ); }; + void pushClip( const ::basegfx::B2DPolyPolygon& rPolyPoly ); void popClip(); sal_Bool hasClip() const; @@ -145,8 +160,7 @@ virtual sal_uInt32 exportDoc( enum ::xm private: - const Sequence< PropertyValue >& mrFilterData; - B2DPolyPolygonList maClipList; + B2DPolyPolygonList maClipList; SVGExport(); }; Modified: incubator/ooo/trunk/main/filter/source/svg/svgwriter.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/svg/svgwriter.cxx?rev=1365538&r1=1365537&r2=1365538&view=diff ============================================================================== --- incubator/ooo/trunk/main/filter/source/svg/svgwriter.cxx (original) +++ incubator/ooo/trunk/main/filter/source/svg/svgwriter.cxx Wed Jul 25 11:49:36 2012 @@ -210,13 +210,13 @@ void SVGAttributeWriter::AddGradientDef( Rectangle aRect( aPoly.GetBoundRect() ); // adjust start/end colors with intensities - aStartColor.SetRed( (sal_uInt8)( (long) aStartColor.GetRed() * rGradient.GetStartIntensity() ) / 100 ); - aStartColor.SetGreen( (sal_uInt8)( (long) aStartColor.GetGreen() * rGradient.GetStartIntensity() ) / 100 ); - aStartColor.SetBlue( (sal_uInt8)( (long) aStartColor.GetBlue() * rGradient.GetStartIntensity() ) / 100 ); + aStartColor.SetRed( (sal_uInt8)( ( (long) aStartColor.GetRed() * rGradient.GetStartIntensity() ) / 100 ) ); + aStartColor.SetGreen( (sal_uInt8)( ( (long) aStartColor.GetGreen() * rGradient.GetStartIntensity() ) / 100 ) ); + aStartColor.SetBlue( (sal_uInt8)( ( (long) aStartColor.GetBlue() * rGradient.GetStartIntensity() ) / 100 ) ); - aEndColor.SetRed( (sal_uInt8)( (long) aEndColor.GetRed() * rGradient.GetEndIntensity() ) / 100 ); - aEndColor.SetGreen( (sal_uInt8)( (long) aEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100 ); - aEndColor.SetBlue( (sal_uInt8)( (long) aEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100 ); + aEndColor.SetRed( (sal_uInt8)( ( (long) aEndColor.GetRed() * rGradient.GetEndIntensity() ) / 100 ) ); + aEndColor.SetGreen( (sal_uInt8)( ( (long) aEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100 ) ); + aEndColor.SetBlue( (sal_uInt8)( ( (long) aEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100 ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrId, ( rGradientId = B2UCONST( "Gradient_" ) ) += ::rtl::OUString::valueOf( nCurGradientId++ ) ); @@ -853,57 +853,95 @@ void SVGActionWriter::ImplWriteText( con if( nLen > 1 ) { - aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( nLen - 1 ) ); + ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBI( ::vcl::unohelper::CreateBreakIterator() ); + const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetLocale(); + sal_Int32 nCurPos = 0, nLastPos = 0, nX = aPos.X(); - if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) ) - { - const double fFactor = (double) nWidth / aNormSize.Width(); + if ( mrExport.IsUseTSpans() ) + { + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( aPos.X() ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( aPos.Y() ) ); + SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_False ); + { + rtl::OUString aString; + for( sal_Bool bCont = sal_True; bCont; ) + { + sal_Int32 nCount = 1; + const ::rtl::OUString aSpace( ' ' ); - for( i = 0; i < ( nLen - 1 ); i++ ) - pDX[ i ] = FRound( pDX[ i ] * fFactor ); - } - else - { - ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBI( ::vcl::unohelper::CreateBreakIterator() ); - const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetLocale(); - sal_Int32 nCurPos = 0, nLastPos = 0, nX = aPos.X(); + nLastPos = nCurPos; + nCurPos = xBI->nextCharacters( rText, nCurPos, rLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); + nCount = nCurPos - nLastPos; + bCont = ( nCurPos < rText.Len() ) && nCount; - // write single glyphs at absolute text positions - for( sal_Bool bCont = sal_True; bCont; ) - { - sal_Int32 nCount = 1; + if( nCount ) + { + aString += rtl::OUString::valueOf( nX ); + if( bCont ) + { + sal_Int32 nWidth = pDX[ nCurPos - 1 ]; + if ( bApplyMapping ) + nWidth = ImplMap( nWidth ); + nX = aPos.X() + nWidth; + aString += aSpace; + } + } + } + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, aString ); + SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemTSpan, sal_True, sal_False ); + mrExport.GetDocHandler()->characters( rText ); + } + } + else + { + aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( nLen - 1 ) ); - nLastPos = nCurPos; - nCurPos = xBI->nextCharacters( rText, nCurPos, rLocale, - ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, - nCount, nCount ); + if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) ) + { + const double fFactor = (double) nWidth / aNormSize.Width(); - nCount = nCurPos - nLastPos; - bCont = ( nCurPos < rText.Len() ) && nCount; - - if( nCount ) - { - const ::rtl::OUString aGlyph( rText.Copy( nLastPos, nCount ) ); + for( i = 0; i < ( nLen - 1 ); i++ ) + pDX[ i ] = FRound( pDX[ i ] * fFactor ); + } + else + { + // write single glyphs at absolute text positions + for( sal_Bool bCont = sal_True; bCont; ) + { + sal_Int32 nCount = 1; - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( nX ) ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( aPos.Y() ) ); + nLastPos = nCurPos; + nCurPos = xBI->nextCharacters( rText, nCurPos, rLocale, + ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, + nCount, nCount ); - { - SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_False ); - mrExport.GetDocHandler()->characters( aGlyph ); - } + nCount = nCurPos - nLastPos; + bCont = ( nCurPos < rText.Len() ) && nCount; + + if( nCount ) + { + const ::rtl::OUString aGlyph( rText.Copy( nLastPos, nCount ) ); - if( bCont ) - { - // #118796# do NOT access pDXArray, it may be zero (!) - sal_Int32 nWidth = pDX[ nCurPos - 1 ]; - if ( bApplyMapping ) - nWidth = ImplMap( nWidth ); - nX = aPos.X() + nWidth; - } - } - } - } + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( nX ) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( aPos.Y() ) ); + + { + SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_False ); + mrExport.GetDocHandler()->characters( aGlyph ); + } + + if( bCont ) + { + // #118796# do NOT access pDXArray, it may be zero (!) + sal_Int32 nWidth = pDX[ nCurPos - 1 ]; + if ( bApplyMapping ) + nWidth = ImplMap( nWidth ); + nX = aPos.X() + nWidth; + } + } + } + } + } } else { @@ -994,8 +1032,8 @@ void SVGActionWriter::ImplWriteBmp( cons aPt = rPt; aSz = rSz; } - - if( xExtDocHandler.is() ) + const Rectangle aRect( aPt, aSz ); + if( mrExport.IsVisible( aRect ) && xExtDocHandler.is() ) { static const sal_uInt32 nPartLen = 64; const ::rtl::OUString aSpace( ' ' ); @@ -1888,8 +1926,9 @@ SVGWriter::~SVGWriter() ANY SAL_CALL SVGWriter::queryInterface( const NMSP_UNO::Type & rType ) throw( NMSP_UNO::RuntimeException ) { - const ANY aRet( NMSP_CPPU::queryInterface( rType, static_cast< NMSP_SVG::XSVGWriter* >( this ) ) ); - + const ANY aRet( NMSP_CPPU::queryInterface( rType, + static_cast< NMSP_SVG::XSVGWriter* >( this ), + static_cast< NMSP_LANG::XInitialization* >( this ) ) ); return( aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ) ); } @@ -1919,9 +1958,7 @@ void SAL_CALL SVGWriter::write( const RE aMemStm >> aMtf; const REF( NMSP_SAX::XDocumentHandler ) xDocumentHandler( rxDocHandler ); - const Sequence< PropertyValue > aFilterData; - - SVGExport* pWriter = new SVGExport( mxFact, xDocumentHandler, aFilterData ); + SVGExport* pWriter = new SVGExport( mxFact, xDocumentHandler, maFilterData ); pWriter->writeMtf( aMtf ); delete pWriter; @@ -1929,6 +1966,18 @@ void SAL_CALL SVGWriter::write( const RE // ----------------------------------------------------------------------------- +void SVGWriter::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) +{ + if ( aArguments.getLength() == 1 ) + { + ::com::sun::star::uno::Any aArg = aArguments.getConstArray()[0]; + aArg >>= maFilterData; + } +} + +// ----------------------------------------------------------------------------- + #define SVG_WRITER_SERVICE_NAME "com.sun.star.svg.SVGWriter" #define SVG_WRITER_IMPLEMENTATION_NAME "com.sun.star.comp.Draw.SVGWriter" @@ -1955,7 +2004,7 @@ Sequence< rtl::OUString > SAL_CALL SVGWr { Sequence< rtl::OUString > aRet( 1 ); - aRet.getArray()[ 0 ] = rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SVG_WRITER_SERVICE_NAME ) ); + aRet.getArray()[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SVG_WRITER_SERVICE_NAME ) ); return aRet; } @@ -1967,4 +2016,3 @@ Reference< XInterface > SAL_CALL SVGWrit { return( static_cast< cppu::OWeakObject* >( new SVGWriter( rSMgr ) ) ); } - Modified: incubator/ooo/trunk/main/filter/source/svg/svgwriter.hxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/svg/svgwriter.hxx?rev=1365538&r1=1365537&r2=1365538&view=diff ============================================================================== --- incubator/ooo/trunk/main/filter/source/svg/svgwriter.hxx (original) +++ incubator/ooo/trunk/main/filter/source/svg/svgwriter.hxx Wed Jul 25 11:49:36 2012 @@ -66,6 +66,7 @@ #include #include #include +#include // ----------------------------------------------------------------------------- @@ -234,12 +235,13 @@ public: const ::rtl::OUString* pElementId = NULL ); }; -class SVGWriter : public NMSP_CPPU::OWeakObject, NMSP_SVG::XSVGWriter +class SVGWriter : public NMSP_CPPU::OWeakObject, NMSP_SVG::XSVGWriter, com::sun::star::lang::XInitialization { private: - REF( NMSP_LANG::XMultiServiceFactory ) mxFact; - + REF( NMSP_LANG::XMultiServiceFactory ) mxFact; + com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maFilterData; + SVGWriter(); public: @@ -255,6 +257,10 @@ public: // XSVGWriter virtual void SAL_CALL write( const REF( NMSP_SAX::XDocumentHandler )& rxDocHandler, const SEQ( sal_Int8 )& rMtfSeq ) throw( NMSP_UNO::RuntimeException ); + + // ::com::sun::star::lang::XInitialization + 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); + }; ::rtl::OUString SVGWriter_getImplementationName () @@ -276,5 +282,4 @@ sal_Bool SAL_CALL SVGWriter_supportsServ SAL_CALL SVGWriter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw ( ::com::sun::star::uno::Exception ); - #endif Modified: incubator/ooo/trunk/main/svtools/source/filter/filter.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/filter/filter.cxx?rev=1365538&r1=1365537&r2=1365538&view=diff ============================================================================== --- incubator/ooo/trunk/main/svtools/source/filter/filter.cxx (original) +++ incubator/ooo/trunk/main/svtools/source/filter/filter.cxx Wed Jul 25 11:49:36 2012 @@ -2065,9 +2065,11 @@ sal_uInt16 GraphicFilter::ExportGraphic( { ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > xSaxWriter( xMgr->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ) ), ::com::sun::star::uno::UNO_QUERY ); - - ::com::sun::star::uno::Reference< ::com::sun::star::svg::XSVGWriter > xSVGWriter( xMgr->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.svg.SVGWriter" ) ), ::com::sun::star::uno::UNO_QUERY ); + + com::sun::star::uno::Sequence< com::sun::star::uno::Any > aArguments( 1 ); + aArguments[ 0 ] <<= aConfigItem.GetFilterData(); + ::com::sun::star::uno::Reference< ::com::sun::star::svg::XSVGWriter > xSVGWriter( xMgr->createInstanceWithArguments( + ::rtl::OUString::createFromAscii( "com.sun.star.svg.SVGWriter" ), aArguments ), ::com::sun::star::uno::UNO_QUERY ); if( xSaxWriter.is() && xSVGWriter.is() ) {