diff options
Diffstat (limited to 'extensions/source/svg')
-rw-r--r-- | extensions/source/svg/svgaction.cxx | 181 | ||||
-rw-r--r-- | extensions/source/svg/svgaction.hxx | 6 | ||||
-rw-r--r-- | extensions/source/svg/svgcom.hxx | 17 | ||||
-rw-r--r-- | extensions/source/svg/svgprinter.cxx | 26 | ||||
-rw-r--r-- | extensions/source/svg/svguno.cxx | 12 | ||||
-rw-r--r-- | extensions/source/svg/svgwriter.cxx | 24 |
6 files changed, 117 insertions, 149 deletions
diff --git a/extensions/source/svg/svgaction.cxx b/extensions/source/svg/svgaction.cxx index 45ba9ca1c6ec..c6656a4f438e 100644 --- a/extensions/source/svg/svgaction.cxx +++ b/extensions/source/svg/svgaction.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svgaction.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:53 $ + * last change: $Author: ka $ $Date: 2001-03-22 17:49:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,12 +64,7 @@ #include <vcl/cvtgrf.hxx> #include <vcl/metric.hxx> -// ----------- -// - Defines - -// ----------- - -// #define _SVG_WRITE_TSPAN -// #define _SVG_WRITE_STRIKEOUT +#undef _SVG_USE_NATIVE_TEXTDECORATION // ----------- // - statics - @@ -300,17 +295,12 @@ NMSP_RTL::OUString SVGAttributeWriter::GetFontStyle( const Font& rFont ) // font family aStyle += B2UCONST( "font-family:" ); - aStyle += NMSP_RTL::OUString( UniString( rFont.GetName() ) ); + aStyle += NMSP_RTL::OUString( rFont.GetName().GetToken( 0, ';' ) ); // font size - const Size aFontSize( mrParent.GetVDev().LogicToLogic( Size( 0, rFont.GetHeight() ), mrParent.GetVDev().GetMapMode(), MAP_POINT ) ); - aStyle += B2UCONST( ";" ); aStyle += B2UCONST( "font-size:" ); - aStyle += NMSP_RTL::OUString::valueOf( aFontSize.Height() ); - - if( !mrParent.HasDoublePoints() ) - aStyle += B2UCONST( "pt" ); + aStyle += mrParent.GetValueString( mrParent.ImplMap( Size( 0, rFont.GetHeight() ) ).Height(), mrParent.HasDoublePoints() ); // font style if( rFont.GetItalic() != ITALIC_NONE ) @@ -351,7 +341,7 @@ NMSP_RTL::OUString SVGAttributeWriter::GetFontStyle( const Font& rFont ) // font-stretch // font-size-adjust -#ifdef _SVG_WRITE_STRIKEOUT +#ifdef _SVG_USE_NATIVE_TEXTDECORATION if( rFont.GetUnderline() != UNDERLINE_NONE || rFont.GetStrikeout() != STRIKEOUT_NONE ) { @@ -362,19 +352,10 @@ NMSP_RTL::OUString SVGAttributeWriter::GetFontStyle( const Font& rFont ) aStyle += B2UCONST( " underline" ); if( rFont.GetStrikeout() != STRIKEOUT_NONE ) - aStyle += B2UCONST( " line-trough" ); - } - -#else // _SVG_WRITE_STRIKEOUT - - if( rFont.GetUnderline() != UNDERLINE_NONE ) - { - aStyle += B2UCONST( ";" ); - aStyle += B2UCONST( "text-decoration:" ); - aStyle += B2UCONST( "underline" ); + aStyle += B2UCONST( " line-through" ); } -#endif // _SVG_WRITE_STRIKEOUT +#endif // _SVG_USE_NATIVE_TEXTDECORATION return aStyle.GetString(); } @@ -688,7 +669,7 @@ void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bo else if( bLineOnly ) { for( long i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ ) - ImplWritePolygon( rPolyPoly[ i ], sal_False, pStyle ); + ImplWritePolygon( rPolyPoly[ (USHORT) i ], sal_False, pStyle ); } else { @@ -699,7 +680,7 @@ void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bo for( long i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ ) { - const Polygon& rPoly = rPolyPoly[ i ]; + const Polygon& rPoly = rPolyPoly[ (USHORT) i ]; USHORT n = 1, nSize = rPoly.GetSize(); if( nSize > 1 ) @@ -803,31 +784,19 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, if( pDXArray ) { pOwnArray = NULL; -#ifdef _SVG_UNO3 aNormSize = Size( mpVDev->GetTextWidth( aText ), 0 ); -#else - aNormSize = mpVDev->GetTextSize( aText ); -#endif pDX = (long*) pDXArray; } else { pOwnArray = new long[ nLen ]; -#ifdef _SVG_UNO3 aNormSize = Size( mpVDev->GetTextArray( aText, pOwnArray ), 0 ); -#else - aNormSize = mpVDev->GetTextArray( aText, pOwnArray ); -#endif pDX = pOwnArray; } if( nLen > 1 ) { -#ifdef _SVG_UNO3 - aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( aText.GetChar( nLen - 1 ) ); -#else - aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextSize( aText[ (USHORT) ( nLen - 1 ) ] ).Width(); -#endif + aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( aText.GetChar( (USHORT) nLen - 1 ) ); if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) ) { @@ -842,15 +811,12 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, const Font& rFont = mpVDev->GetFont(); const FontMetric aMetric( mpVDev->GetFontMetric() ); Point aBaseLinePos( rPos ); + SvXMLElementExport* pTransform = NULL; // leading whitespaces erased? => adjust position if( nLen < rText.Len() ) { -#ifdef _SVG_UNO3 aBaseLinePos.X() += mpVDev->GetTextWidth( ' ' ) * ( rText.Len() - nLen ); -#else - aBaseLinePos.X() += mpVDev->GetTextSize( ' ' ).Width() * ( rText.Len() - nLen ); -#endif } // always adjust text position to match baseline alignment @@ -871,12 +837,39 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, // get mapped text position const Point aPt( ImplMap( aBaseLinePos ) ); + // if text is rotated, set transform at new g element + if( rFont.GetOrientation() ) + { + String aTransform; + + aTransform = NMSP_RTL::OUString::createFromAscii( "translate" ); + aTransform += '('; + aTransform += String( GetValueString( aPt.X(), mbDoublePoints ) ); + aTransform += ','; + aTransform += String( GetValueString( aPt.Y(), mbDoublePoints ) ); + aTransform += ')'; + + aTransform += String( NMSP_RTL::OUString::createFromAscii( " rotate" ) ); + aTransform += '('; + aTransform += String( NMSP_RTL::OUString::valueOf( rFont.GetOrientation() * -0.1 ) ); + aTransform += ')'; + + aTransform += String( NMSP_RTL::OUString::createFromAscii( " translate" ) ); + aTransform += '('; + aTransform += String( GetValueString( -aPt.X(), mbDoublePoints ) ); + aTransform += ','; + aTransform += String( GetValueString( -aPt.Y(), mbDoublePoints ) ); + aTransform += ')'; + + mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform ); + pTransform = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemG, TRUE, TRUE ); + } + // add additional style if requested if( pStyle && pStyle->getLength() ) mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, *pStyle ); // write text element -#ifdef _SVG_WRITE_TSPAN if( pDXArray ) { SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, TRUE, TRUE ); @@ -902,7 +895,6 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, } } else -#endif // _SVG_WRITE_TSPAN { mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, GetValueString( aPt.X(), mbDoublePoints ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, GetValueString( aPt.Y(), mbDoublePoints ) ); @@ -910,26 +902,44 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, TRUE, TRUE ); mrExport.GetDocHandler()->characters( NMSP_RTL::OUString( UniString( aText ) ) ); } -#ifndef _SVG_WRITE_STRIKEOUT + +#ifndef _SVG_USE_NATIVE_TEXTDECORATION // write strikeout if neccessary - if( rFont.GetStrikeout() ) + if( rFont.GetStrikeout() || rFont.GetUnderline() ) { - const long nYStrikeoutPos = aBaseLinePos.Y() - FRound( aMetric.GetAscent() * 0.26 ); - const long nStrikeoutHeight = Max( (long) FRound( aMetric.GetLineHeight() * 0.05 ), (long) 1 ); Polygon aPoly( 4 ); + const long nLineHeight = Max( (long) FRound( aMetric.GetLineHeight() * 0.05 ), (long) 1 ); - aPoly[ 0 ].X() = aBaseLinePos.X(); aPoly[ 0 ].Y() = nYStrikeoutPos - ( nStrikeoutHeight >> 1 ); - aPoly[ 1 ].X() = aBaseLinePos.X() + aNormSize.Width() - 1; aPoly[ 1 ].Y() = aPoly[ 0 ].Y(); - aPoly[ 2 ].X() = aPoly[ 1 ].X(); aPoly[ 2 ].Y() = aPoly[ 0 ].Y() + nStrikeoutHeight - 1; - aPoly[ 3 ].X() = aPoly[ 0 ].X(); aPoly[ 3 ].Y() = aPoly[ 2 ].Y(); + if( rFont.GetStrikeout() ) + { + const long nYLinePos = aBaseLinePos.Y() - FRound( aMetric.GetAscent() * 0.26 ); + + aPoly[ 0 ].X() = aBaseLinePos.X(); aPoly[ 0 ].Y() = nYLinePos - ( nLineHeight >> 1 ); + aPoly[ 1 ].X() = aBaseLinePos.X() + aNormSize.Width() - 1; aPoly[ 1 ].Y() = aPoly[ 0 ].Y(); + aPoly[ 2 ].X() = aPoly[ 1 ].X(); aPoly[ 2 ].Y() = aPoly[ 0 ].Y() + nLineHeight - 1; + aPoly[ 3 ].X() = aPoly[ 0 ].X(); aPoly[ 3 ].Y() = aPoly[ 2 ].Y(); - ImplWritePolygon( aPoly, FALSE ); + ImplWritePolygon( aPoly, FALSE ); + } + + if( rFont.GetUnderline() ) + { + const long nYLinePos = aBaseLinePos.Y() + ( nLineHeight << 1 ); + + aPoly[ 0 ].X() = aBaseLinePos.X(); aPoly[ 0 ].Y() = nYLinePos - ( nLineHeight >> 1 ); + aPoly[ 1 ].X() = aBaseLinePos.X() + aNormSize.Width() - 1; aPoly[ 1 ].Y() = aPoly[ 0 ].Y(); + aPoly[ 2 ].X() = aPoly[ 1 ].X(); aPoly[ 2 ].Y() = aPoly[ 0 ].Y() + nLineHeight - 1; + aPoly[ 3 ].X() = aPoly[ 0 ].X(); aPoly[ 3 ].Y() = aPoly[ 2 ].Y(); + + ImplWritePolygon( aPoly, FALSE ); + } } -#endif // _SVG_WRITE_STRIKEOUT +#endif // _SVG_USE_NATIVE_TEXTDECORATION delete[] pOwnArray; + delete pTransform; } } @@ -959,11 +969,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, const Point aPt( ImplMap( rPt ) ); const Size aSz( ImplMap( rSz ) ); FastString aImageData( (sal_Char*) aOStm.GetData(), aOStm.Tell() ); -#ifndef _SVG_UNO3 - XExtendedDocumentHandlerRef xExtDocHandler( mrExport.GetDocHandler(), USR_QUERY ); -#else REF( NMSP_SAX::XExtendedDocumentHandler ) xExtDocHandler( mrExport.GetDocHandler(), NMSP_UNO::UNO_QUERY ); -#endif if( xExtDocHandler.is() ) { @@ -1183,17 +1189,43 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL: case( META_TRANSPARENT_ACTION ): { - // !!! - mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() ); - DBG_ERROR( "META_TRANSPARENT_ACTION not supported" ); + const MetaTransparentAction* pA = (const MetaTransparentAction*) pAction; + const PolyPolygon& rPolyPoly = pA->GetPolyPolygon(); + + if( rPolyPoly.Count() ) + { + mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() ); + ImplWritePolyPolygon( rPolyPoly, sal_False, pStyle ); + } } break; case( META_FLOATTRANSPARENT_ACTION ): { - // !!! - mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() ); - DBG_ERROR( "META_FLOATTRANSPARENT_ACTION not supported" ); + const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction; + GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() ); + Point aSrcPt( aTmpMtf.GetPrefMapMode().GetOrigin() ); + const Size aSrcSize( aTmpMtf.GetPrefSize() ); + const Point aDestPt( pA->GetPoint() ); + const Size aDestSize( pA->GetSize() ); + const double fScaleX = aSrcSize.Width() ? (double) aDestSize.Width() / aSrcSize.Width() : 1.0; + const double fScaleY = aSrcSize.Height() ? (double) aDestSize.Height() / aSrcSize.Height() : 1.0; + long nMoveX, nMoveY; + + if( fScaleX != 1.0 || fScaleY != 1.0 ) + { + aTmpMtf.Scale( fScaleX, fScaleY ); + aSrcPt.X() = FRound( aSrcPt.X() * fScaleX ), aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY ); + } + + nMoveX = aDestPt.X() - aSrcPt.X(), nMoveY = aDestPt.Y() - aSrcPt.Y(); + + if( nMoveX || nMoveY ) + aTmpMtf.Move( nMoveX, nMoveY ); + + mpVDev->Push(); + ImplWriteActions( aTmpMtf, pStyle ); + mpVDev->Pop(); } break; @@ -1210,10 +1242,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL: if( pSubstAct->GetType() == META_BMPSCALE_ACTION ) { bFound = sal_True; - const MetaBmpScaleAction* pBmpScaleAction = (const MetaBmpScaleAction*) pAction; + const MetaBmpScaleAction* pBmpScaleAction = (const MetaBmpScaleAction*) pSubstAct; mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() ); ImplWriteBmp( pBmpScaleAction->GetBitmap(), - pBmpScaleAction->GetPoint(), pBmpScaleAction->GetSize(), + pA->GetPoint(), pA->GetSize(), Point(), pBmpScaleAction->GetBitmap().GetSizePixel(), pStyle ); } } @@ -1225,11 +1257,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL: const MetaCommentAction* pA = (const MetaCommentAction*) pAction; String aSkipComment; -#ifndef _SVG_UNO3 - if( pA->GetComment().ICompare( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL ) -#else if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL ) -#endif { const MetaGradientExAction* pGradAction = NULL; sal_Bool bDone = sal_False; @@ -1241,12 +1269,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL: if( pAction->GetType() == META_GRADIENTEX_ACTION ) pGradAction = (const MetaGradientExAction*) pAction; else if( ( pAction->GetType() == META_COMMENT_ACTION ) && -#ifndef _SVG_UNO3 - ( ( (const MetaCommentAction*) pAction )->GetComment().ICompare( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) ) - -#else ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) ) -#endif { bDone = sal_True; } diff --git a/extensions/source/svg/svgaction.hxx b/extensions/source/svg/svgaction.hxx index 7fa159450a72..c0c5513d25f1 100644 --- a/extensions/source/svg/svgaction.hxx +++ b/extensions/source/svg/svgaction.hxx @@ -2,9 +2,9 @@ * * $RCSfile: svgaction.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:53 $ + * last change: $Author: ka $ $Date: 2001-03-22 17:49:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -137,6 +137,8 @@ class GDIMetaFile; class SVGActionWriter { + friend class SVGAttributeWriter; + private: Stack maContextStack; diff --git a/extensions/source/svg/svgcom.hxx b/extensions/source/svg/svgcom.hxx index 4827e95255fe..e0b5f3c861e8 100644 --- a/extensions/source/svg/svgcom.hxx +++ b/extensions/source/svg/svgcom.hxx @@ -2,9 +2,9 @@ * * $RCSfile: svgcom.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:53 $ + * last change: $Author: ka $ $Date: 2001-03-22 17:49:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -115,14 +115,6 @@ // ----------------------------------------------------------------------------- -#if SUPD >= 583 -#define _SVG_UNO3 1 -#else -#undef _SVG_UNO3 -#endif - -// ----------------------------------------------------------------------------- - #define NMSP_CPPU cppu #define NMSP_RTL rtl #define NMSP_UNO com::sun::star::uno @@ -135,10 +127,7 @@ #define REF( _def_Obj ) NMSP_UNO::Reference< _def_Obj > #define SEQ( _def_Obj ) NMSP_UNO::Sequence< _def_Obj > #define ANY NMSP_UNO::Any -#ifdef _SVG_UNO3 #define B2UCONST( _def_pChar ) (NMSP_RTL::OUString(RTL_CONSTASCII_USTRINGPARAM(_def_pChar ))) -#else -#define B2UCONST( _def_pChar ) (NMSP_RTL::OUString::createFromAscii(_def_pChar)) -#endif +#define SVG_DTD_STRING B2UCONST( "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20001102//EN\" \"http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd\">" ) #endif // _SYNCCOM_HXX diff --git a/extensions/source/svg/svgprinter.cxx b/extensions/source/svg/svgprinter.cxx index 02cff8e4d25b..c6e9f1e7c024 100644 --- a/extensions/source/svg/svgprinter.cxx +++ b/extensions/source/svg/svgprinter.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svgprinter.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:53 $ + * last change: $Author: ka $ $Date: 2001-03-22 17:50:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -110,13 +110,8 @@ protected: public: -#ifndef _SVG_UNO3 - SVGPrinterExport( const XDocumentHandlerRef rxHandler, const JobSetup& rSetup, - const NMSP_RTL::OUString& rJobName, sal_uInt32 nCopies, sal_Bool bCollate ); -#else SVGPrinterExport( const REF( NMSP_SAX::XDocumentHandler )& rxHandler, const JobSetup& rSetup, const NMSP_RTL::OUString& rJobName, sal_uInt32 nCopies, sal_Bool bCollate ); -#endif virtual ~SVGPrinterExport(); virtual void writePage( const JobSetup& rJobSetup, const GDIMetaFile& rMtf ); @@ -124,13 +119,8 @@ public: // ----------------------------------------------------------------------------- -#ifndef _SVG_UNO3 -SVGPrinterExport::SVGPrinterExport( const XDocumentHandlerRef rxHandler, const JobSetup& rSetup, - const NMSP_RTL::OUString& rJobName, sal_uInt32 nCopies, sal_Bool bCollate ) : -#else SVGPrinterExport::SVGPrinterExport( const REF( NMSP_SAX::XDocumentHandler )& rxHandler, const JobSetup& rSetup, const NMSP_RTL::OUString& rJobName, sal_uInt32 nCopies, sal_Bool bCollate ) : -#endif SvXMLExport( NMSP_RTL::OUString(), rxHandler ), mpVDev( NULL ), mnPage( 0 ) @@ -139,11 +129,7 @@ SVGPrinterExport::SVGPrinterExport( const REF( NMSP_SAX::XDocumentHandler )& rxH GetDocHandler()->startDocument(); -#ifndef _SVG_UNO3 - XExtendedDocumentHandlerRef xExtDocHandler( GetDocHandler(), USR_QUERY ); -#else REF( NMSP_SAX::XExtendedDocumentHandler ) xExtDocHandler( GetDocHandler(), NMSP_UNO::UNO_QUERY ); -#endif if( xExtDocHandler.is() ) { @@ -151,7 +137,7 @@ SVGPrinterExport::SVGPrinterExport( const REF( NMSP_SAX::XDocumentHandler )& rxH const NMSP_RTL::OUString aLineFeed( NMSP_RTL::OUString::valueOf( (sal_Unicode) 0x0a ) ); // intro - xExtDocHandler->unknown( ( aString = B2UCONST( "<!DOCTYPE svg SYSTEM \"svg-19990812.dtd\" [" ) ) += aLineFeed ); + xExtDocHandler->unknown( ( aString = SVG_DTD_STRING ) += aLineFeed ); xExtDocHandler->unknown( ( aString = B2UCONST( "<!ELEMENT metadata (#PCDATA | staroffice:svgElementMeta)*> " ) += aLineFeed ) ); xExtDocHandler->unknown( ( aString = B2UCONST( "<!ELEMENT staroffice:svgElementMeta ANY> " ) += aLineFeed ) ); xExtDocHandler->unknown( ( aString = B2UCONST( "<!ATTLIST staroffice:svgElementMeta " ) += aLineFeed ) ); @@ -330,13 +316,7 @@ sal_Bool SAL_CALL SVGPrinter::startJob( const REF( NMSP_SAX::XDocumentHandler )& aMemStm.SetCompressMode( COMPRESSMODE_FULL ); aMemStm >> aJobSetup; -#ifndef _SVG_UNO3 - NMSP_UNO::Mapping ecpptosmart( CPPU_CURRENT_LANGUAGE_BINDING_NAME, "smart" ); - XDocumentHandlerRef xDocumentHandler( (XDocumentHandler*) ecpptosmart.mapInterface( rxHandler.get(), getCppuType( &rxHandler ) ) ); - xDocumentHandler->release(); -#else const REF( NMSP_SAX::XDocumentHandler ) xDocumentHandler( rxHandler ); -#endif mpWriter = new SVGPrinterExport( xDocumentHandler, aJobSetup, rJobName, nCopies, bCollate ); } diff --git a/extensions/source/svg/svguno.cxx b/extensions/source/svg/svguno.cxx index 0d2f9b63474e..b3875a4d0b67 100644 --- a/extensions/source/svg/svguno.cxx +++ b/extensions/source/svg/svguno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svguno.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:53 $ + * last change: $Author: ka $ $Date: 2001-03-22 17:49:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,22 +70,14 @@ // - factory methods - // ------------------- -#if SUPD>=590 static REF( NMSP_UNO::XInterface ) SAL_CALL create_SVGWriter( const REF( NMSP_LANG::XMultiServiceFactory )& rxFact ) -#else -static REF( NMSP_UNO::XInterface ) create_SVGWriter( const REF( NMSP_LANG::XMultiServiceFactory )& rxFact ) -#endif { return REF( NMSP_UNO::XInterface )( *new SVGWriter( rxFact ) ); } // ----------------------------------------------------------------------------- -#if SUPD>=590 static REF( NMSP_UNO::XInterface ) SAL_CALL create_SVGPrinter( const REF( NMSP_LANG::XMultiServiceFactory )& rxFact ) -#else -static REF( NMSP_UNO::XInterface ) create_SVGPrinter( const REF( NMSP_LANG::XMultiServiceFactory )& rxFact ) -#endif { return REF( NMSP_UNO::XInterface )( *new SVGPrinter( rxFact ) ); } diff --git a/extensions/source/svg/svgwriter.cxx b/extensions/source/svg/svgwriter.cxx index b6db93a46e75..26a3758c55b7 100644 --- a/extensions/source/svg/svgwriter.cxx +++ b/extensions/source/svg/svgwriter.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svgwriter.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:53 $ + * last change: $Author: ka $ $Date: 2001-03-22 17:49:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,11 +84,7 @@ protected: public: -#ifndef _SVG_UNO3 - SVGMtfExport( XDocumentHandlerRef& rXHandler ); -#else SVGMtfExport( const REF( NMSP_SAX::XDocumentHandler )& rxHandler ); -#endif virtual ~SVGMtfExport(); virtual void writeMtf( const GDIMetaFile& rMtf ); @@ -96,11 +92,7 @@ public: // ----------------------------------------------------------------------------- -#ifndef _SVG_UNO3 -SVGMtfExport::SVGMtfExport( XDocumentHandlerRef& rxHandler ) : -#else SVGMtfExport::SVGMtfExport( const REF( NMSP_SAX::XDocumentHandler )& rxHandler ) : -#endif SvXMLExport( NMSP_RTL::OUString(), rxHandler ) { GetDocHandler()->startDocument(); @@ -119,14 +111,10 @@ void SVGMtfExport::writeMtf( const GDIMetaFile& rMtf ) { const Size aSize( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_MM ) ); NMSP_RTL::OUString aAttr; -#ifndef _SVG_UNO3 - XExtendedDocumentHandlerRef xExtDocHandler( GetDocHandler(), USR_QUERY ); -#else REF( NMSP_SAX::XExtendedDocumentHandler ) xExtDocHandler( GetDocHandler(), NMSP_UNO::UNO_QUERY ); -#endif if( xExtDocHandler.is() ) - xExtDocHandler->unknown( B2UCONST( "<!DOCTYPE svg SYSTEM \"svg-19990812.dtd\">" ) ); + xExtDocHandler->unknown( SVG_DTD_STRING ); aAttr = NMSP_RTL::OUString::valueOf( aSize.Width() ); aAttr += B2UCONST( "mm" ); @@ -200,13 +188,7 @@ void SAL_CALL SVGWriter::write( const REF( NMSP_SAX::XDocumentHandler )& rxDocHa aMemStm.SetCompressMode( COMPRESSMODE_FULL ); aMemStm >> aMtf; -#ifndef _SVG_UNO3 - NMSP_UNO::Mapping ecpptosmart( CPPU_CURRENT_LANGUAGE_BINDING_NAME, "smart" ); - XDocumentHandlerRef xDocumentHandler( (XDocumentHandler*)ecpptosmart.mapInterface( rxDocHandler.get(), getCppuType(&rxDocHandler)) ); - xDocumentHandler->release(); -#else const REF( NMSP_SAX::XDocumentHandler ) xDocumentHandler( rxDocHandler ); -#endif SVGMtfExport* pWriter = new SVGMtfExport( xDocumentHandler ); pWriter->writeMtf( aMtf ); |