summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorka <kai.ahrens@oracle.com>2011-02-04 14:52:54 +0100
committerka <kai.ahrens@oracle.com>2011-02-04 14:52:54 +0100
commit5c9af0b9251b767d88e4c191120e2eb2d7066a93 (patch)
treebc94eca349013987db98635595565e7095516323 /svtools/source
parentd1da85e8f5d3b6a0c5d1fdcc4fedb0eff5e90b65 (diff)
ka102: added/removed files for SVG import and module cleanup
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/filter/FilterConfigCache.cxx (renamed from svtools/source/filter.vcl/filter/FilterConfigCache.cxx)3
-rw-r--r--svtools/source/filter/FilterConfigCache.hxx (renamed from svtools/source/filter.vcl/filter/FilterConfigCache.hxx)0
-rw-r--r--svtools/source/filter/FilterConfigItem.cxx (renamed from svtools/source/filter.vcl/filter/FilterConfigItem.cxx)0
-rw-r--r--svtools/source/filter/SvFilterOptionsDialog.cxx (renamed from svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx)0
-rw-r--r--svtools/source/filter/SvFilterOptionsDialog.hxx (renamed from svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx)0
-rw-r--r--svtools/source/filter/exportdialog.cxx (renamed from svtools/source/filter.vcl/filter/exportdialog.cxx)0
-rw-r--r--[-rwxr-xr-x]svtools/source/filter/exportdialog.hrc (renamed from svtools/source/filter.vcl/filter/exportdialog.hrc)0
-rw-r--r--[-rwxr-xr-x]svtools/source/filter/exportdialog.hxx (renamed from svtools/source/filter.vcl/filter/exportdialog.hxx)0
-rw-r--r--svtools/source/filter/exportdialog.src (renamed from svtools/source/filter.vcl/filter/exportdialog.src)0
-rw-r--r--svtools/source/filter/filter.cxx (renamed from svtools/source/filter.vcl/filter/filter.cxx)113
-rw-r--r--svtools/source/filter/filter2.cxx (renamed from svtools/source/filter.vcl/filter/filter2.cxx)19
-rw-r--r--svtools/source/filter/igif/decode.cxx (renamed from svtools/source/filter.vcl/igif/decode.cxx)0
-rw-r--r--svtools/source/filter/igif/decode.hxx (renamed from svtools/source/filter.vcl/igif/decode.hxx)0
-rw-r--r--svtools/source/filter/igif/gifread.cxx (renamed from svtools/source/filter.vcl/igif/gifread.cxx)0
-rw-r--r--svtools/source/filter/ixbm/xbmread.cxx (renamed from svtools/source/filter.vcl/ixbm/xbmread.cxx)0
-rw-r--r--svtools/source/filter/ixpm/rgbtable.hxx (renamed from svtools/source/filter.vcl/ixpm/rgbtable.hxx)0
-rw-r--r--svtools/source/filter/ixpm/xpmread.cxx (renamed from svtools/source/filter.vcl/ixpm/xpmread.cxx)0
-rw-r--r--svtools/source/filter/jpeg/jpeg.cxx (renamed from svtools/source/filter.vcl/jpeg/jpeg.cxx)0
-rw-r--r--svtools/source/filter/jpeg/jpeg.h (renamed from svtools/source/filter.vcl/jpeg/jpeg.h)0
-rw-r--r--svtools/source/filter/jpeg/jpegc.c (renamed from svtools/source/filter.vcl/jpeg/jpegc.c)0
-rw-r--r--svtools/source/filter/sgf.ini (renamed from svtools/source/filter.vcl/filter/sgf.ini)0
-rw-r--r--svtools/source/filter/sgfbram.cxx (renamed from svtools/source/filter.vcl/filter/sgfbram.cxx)0
-rw-r--r--svtools/source/filter/sgvmain.cxx (renamed from svtools/source/filter.vcl/filter/sgvmain.cxx)0
-rw-r--r--svtools/source/filter/sgvspln.cxx (renamed from svtools/source/filter.vcl/filter/sgvspln.cxx)0
-rw-r--r--svtools/source/filter/sgvtext.cxx (renamed from svtools/source/filter.vcl/filter/sgvtext.cxx)0
-rw-r--r--svtools/source/filter/wmf/emfwr.cxx (renamed from svtools/source/filter.vcl/wmf/emfwr.cxx)27
-rw-r--r--svtools/source/filter/wmf/emfwr.hxx (renamed from svtools/source/filter.vcl/wmf/emfwr.hxx)0
-rw-r--r--svtools/source/filter/wmf/enhwmf.cxx (renamed from svtools/source/filter.vcl/wmf/enhwmf.cxx)0
-rw-r--r--svtools/source/filter/wmf/winmtf.cxx (renamed from svtools/source/filter.vcl/wmf/winmtf.cxx)0
-rw-r--r--svtools/source/filter/wmf/winmtf.hxx (renamed from svtools/source/filter.vcl/wmf/winmtf.hxx)0
-rw-r--r--svtools/source/filter/wmf/winwmf.cxx (renamed from svtools/source/filter.vcl/wmf/winwmf.cxx)0
-rw-r--r--svtools/source/filter/wmf/wmf.cxx (renamed from svtools/source/filter.vcl/wmf/wmf.cxx)0
-rw-r--r--svtools/source/filter/wmf/wmfwr.cxx (renamed from svtools/source/filter.vcl/wmf/wmfwr.cxx)28
-rw-r--r--svtools/source/filter/wmf/wmfwr.hxx (renamed from svtools/source/filter.vcl/wmf/wmfwr.hxx)0
34 files changed, 158 insertions, 32 deletions
diff --git a/svtools/source/filter.vcl/filter/FilterConfigCache.cxx b/svtools/source/filter/FilterConfigCache.cxx
index 48408609cf98..979eba91767d 100644
--- a/svtools/source/filter.vcl/filter/FilterConfigCache.cxx
+++ b/svtools/source/filter/FilterConfigCache.cxx
@@ -56,7 +56,7 @@ const char* FilterConfigCache::FilterConfigCacheEntry::InternalPixelFilterNameLi
const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameList[] =
{
- IMP_SVMETAFILE, IMP_WMF, IMP_EMF, IMP_SVSGF, IMP_SVSGV,
+ IMP_SVMETAFILE, IMP_WMF, IMP_EMF, IMP_SVSGF, IMP_SVSGV, IMP_SVG,
EXP_SVMETAFILE, EXP_WMF, EXP_EMF, EXP_SVG, NULL
};
@@ -303,6 +303,7 @@ const char* FilterConfigCache::InternalFilterListForSvxLight[] =
"xbm","1","SVIXBM",
"xpm","1","SVIXPM",
"xpm","2","exp",
+ "svg","1","SVISVG",
"svg","2","SVESVG",
NULL
};
diff --git a/svtools/source/filter.vcl/filter/FilterConfigCache.hxx b/svtools/source/filter/FilterConfigCache.hxx
index 2c6b7361e540..2c6b7361e540 100644
--- a/svtools/source/filter.vcl/filter/FilterConfigCache.hxx
+++ b/svtools/source/filter/FilterConfigCache.hxx
diff --git a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx b/svtools/source/filter/FilterConfigItem.cxx
index 312f62af9d84..312f62af9d84 100644
--- a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
+++ b/svtools/source/filter/FilterConfigItem.cxx
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx
index 1c4eeeff1bbf..1c4eeeff1bbf 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.cxx
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx b/svtools/source/filter/SvFilterOptionsDialog.hxx
index 027fac99c2e8..027fac99c2e8 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.hxx
diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index 20cc46a30ab5..20cc46a30ab5 100644
--- a/svtools/source/filter.vcl/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
diff --git a/svtools/source/filter.vcl/filter/exportdialog.hrc b/svtools/source/filter/exportdialog.hrc
index e230bcd2c5c3..e230bcd2c5c3 100755..100644
--- a/svtools/source/filter.vcl/filter/exportdialog.hrc
+++ b/svtools/source/filter/exportdialog.hrc
diff --git a/svtools/source/filter.vcl/filter/exportdialog.hxx b/svtools/source/filter/exportdialog.hxx
index 20a9ac3ea832..20a9ac3ea832 100755..100644
--- a/svtools/source/filter.vcl/filter/exportdialog.hxx
+++ b/svtools/source/filter/exportdialog.hxx
diff --git a/svtools/source/filter.vcl/filter/exportdialog.src b/svtools/source/filter/exportdialog.src
index c9e87989a314..c9e87989a314 100644
--- a/svtools/source/filter.vcl/filter/exportdialog.src
+++ b/svtools/source/filter/exportdialog.src
diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter/filter.cxx
index 7e0729082841..086f57061d7a 100644
--- a/svtools/source/filter.vcl/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -39,6 +39,7 @@
#include <vcl/salctype.hxx>
#include <vcl/pngread.hxx>
#include <vcl/pngwrite.hxx>
+#include <vcl/svgread.hxx>
#include <vcl/virdev.hxx>
#include <vcl/svapp.hxx>
#include <osl/file.hxx>
@@ -677,10 +678,22 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
return TRUE;
}
+ //--------------------------- SVG ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "SVG", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+
+ // just a simple test for the extension
+ if( rFormatExtension.CompareToAscii( "SVG", 3 ) == COMPARE_EQUAL )
+ return TRUE;
+ }
+
//--------------------------- TGA ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL ) )
{
bSomethingTested = TRUE;
+
+ // just a simple test for the extension
if( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL )
return TRUE;
}
@@ -689,6 +702,8 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
if( !bTest || ( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL ) )
{
bSomethingTested = TRUE;
+
+ // just a simple test for the extension
if( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL )
return TRUE;
}
@@ -1486,6 +1501,27 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
else
eLinkType = GFX_LINK_TYPE_NATIVE_JPG;
}
+ else if( aFilterName.EqualsIgnoreCaseAscii( IMP_SVG ) )
+ {
+ if( rGraphic.GetContext() == (GraphicReader*) 1 )
+ rGraphic.SetContext( NULL );
+
+ vcl::SVGReader aSVGReader( rIStream );
+ GDIMetaFile aSVGMtf;
+
+ if( 0 == aSVGReader.Read( aSVGMtf ).GetActionCount() )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ rGraphic = Graphic( aSVGMtf );
+
+ // Dont set any GfxLink here, since the MetaRenderGraphicAction
+ // inside the just read MetaFile contains excatly this native data;
+ // setting a ǴfxLink would also affect other program parts, since
+ // GfxLinks are preferably written to the file format in general,
+ // which would be a bad idea in case of SVG files, since earlier
+ // implementations are not able to handle native SVG data in any
+ // case. (KA 01/19/2011)
+ }
else if( aFilterName.EqualsIgnoreCaseAscii( IMP_XBM ) )
{
if( rGraphic.GetContext() == (GraphicReader*) 1 )
@@ -1826,7 +1862,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
aMTF.SetPrefSize( aGraphic.GetPrefSize() );
aMTF.SetPrefMapMode( aGraphic.GetPrefMapMode() );
}
- rOStm << aMTF;
+ aMTF.Write( rOStm, GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC );
if( rOStm.GetError() )
nStatus = GRFILTER_IOERROR;
}
@@ -1943,44 +1979,69 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
}
else if( aFilterName.EqualsIgnoreCaseAscii( EXP_SVG ) )
{
- try
+ bool bDone = false;
+
+ // do we have a native SVG RenderGraphic, whose data can be written directly?
+ if( ( GRAPHIC_GDIMETAFILE == eType ) && aGraphic.IsRenderGraphic() )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+ const ::vcl::RenderGraphic aRenderGraphic( aGraphic.GetRenderGraphic() );
- if( xMgr.is() )
+ if( aRenderGraphic.GetGraphicDataLength() &&
+ aRenderGraphic.GetGraphicDataMimeType().equalsIgnoreAsciiCase(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "image/svg+xml" ) ) ) )
{
- ::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 );
+ rOStm.Write( aRenderGraphic.GetGraphicData().get(),
+ aRenderGraphic.GetGraphicDataLength() );
- ::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 );
+ if( rOStm.GetError() )
+ {
+ nStatus = GRFILTER_IOERROR;
+ }
+ }
+ }
- if( xSaxWriter.is() && xSVGWriter.is() )
+ if( !bDone )
+ {
+ // do the normal GDIMetaFile export instead
+ try
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+
+ if( xMgr.is() )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XActiveDataSource > xActiveDataSource(
- xSaxWriter, ::com::sun::star::uno::UNO_QUERY );
+ ::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 );
- if( xActiveDataSource.is() )
+ ::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 );
+
+ if( xSaxWriter.is() && xSVGWriter.is() )
{
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xStmIf(
- static_cast< ::cppu::OWeakObject* >( new ImpFilterOutputStream( rOStm ) ) );
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XActiveDataSource > xActiveDataSource(
+ xSaxWriter, ::com::sun::star::uno::UNO_QUERY );
- SvMemoryStream aMemStm( 65535, 65535 );
+ if( xActiveDataSource.is() )
+ {
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xStmIf(
+ static_cast< ::cppu::OWeakObject* >( new ImpFilterOutputStream( rOStm ) ) );
- aMemStm.SetCompressMode( COMPRESSMODE_FULL );
- ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( aMemStm );
+ SvMemoryStream aMemStm( 65535, 65535 );
- xActiveDataSource->setOutputStream( ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >(
- xStmIf, ::com::sun::star::uno::UNO_QUERY ) );
- ::com::sun::star::uno::Sequence< sal_Int8 > aMtfSeq( (sal_Int8*) aMemStm.GetData(), aMemStm.Tell() );
- xSVGWriter->write( xSaxWriter, aMtfSeq );
+ aMemStm.SetCompressMode( COMPRESSMODE_FULL );
+ ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( aMemStm );
+
+ xActiveDataSource->setOutputStream( ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >(
+ xStmIf, ::com::sun::star::uno::UNO_QUERY ) );
+ ::com::sun::star::uno::Sequence< sal_Int8 > aMtfSeq( (sal_Int8*) aMemStm.GetData(), aMemStm.Tell() );
+ xSVGWriter->write( xSaxWriter, aMtfSeq );
+ }
}
}
}
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- nStatus = GRFILTER_IOERROR;
+ catch( ::com::sun::star::uno::Exception& )
+ {
+ nStatus = GRFILTER_IOERROR;
+ }
}
}
else
@@ -2127,6 +2188,7 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData )
case( CVT_TIF ): aShortName = TIF_SHORTNAME; break;
case( CVT_WMF ): aShortName = WMF_SHORTNAME; break;
case( CVT_EMF ): aShortName = EMF_SHORTNAME; break;
+ case( CVT_SVG ): aShortName = SVG_SHORTNAME; break;
default:
break;
@@ -2196,4 +2258,3 @@ int GraphicFilter::LoadGraphic( const String &rPath, const String &rFilterName,
return nRes;
}
-
diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter/filter2.cxx
index d91ec1a19772..15bdc5c5d080 100644
--- a/svtools/source/filter.vcl/filter/filter2.cxx
+++ b/svtools/source/filter/filter2.cxx
@@ -114,6 +114,7 @@ BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo )
else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = TRUE;
else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = TRUE;
else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectSVG( rStm, bExtendedInfo ) ) bRet = TRUE;
else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = TRUE;
else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = TRUE;
else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = TRUE;
@@ -1301,6 +1302,21 @@ BOOL GraphicDescriptor::ImpDetectEMF( SvStream&, BOOL )
|*
\************************************************************************/
+BOOL GraphicDescriptor::ImpDetectSVG( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet = aPathExt.CompareToAscii( "svg", 3 ) == COMPARE_EQUAL;
+ if (bRet)
+ nFormat = GFF_SVG;
+
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
String GraphicDescriptor::GetImportFormatShortName( sal_uInt16 nFormat )
{
ByteString aKeyName;
@@ -1331,9 +1347,8 @@ String GraphicDescriptor::GetImportFormatShortName( sal_uInt16 nFormat )
case( GFF_SVM ) : aKeyName = "svm"; break;
case( GFF_WMF ) : aKeyName = "wmf"; break;
case( GFF_EMF ) : aKeyName = "emf"; break;
+ case( GFF_SVG ) : aKeyName = "svg"; break;
}
return String( aKeyName, RTL_TEXTENCODING_ASCII_US );
}
-
-
diff --git a/svtools/source/filter.vcl/igif/decode.cxx b/svtools/source/filter/igif/decode.cxx
index bfe77319b81a..bfe77319b81a 100644
--- a/svtools/source/filter.vcl/igif/decode.cxx
+++ b/svtools/source/filter/igif/decode.cxx
diff --git a/svtools/source/filter.vcl/igif/decode.hxx b/svtools/source/filter/igif/decode.hxx
index 3c6a61e7508d..3c6a61e7508d 100644
--- a/svtools/source/filter.vcl/igif/decode.hxx
+++ b/svtools/source/filter/igif/decode.hxx
diff --git a/svtools/source/filter.vcl/igif/gifread.cxx b/svtools/source/filter/igif/gifread.cxx
index e4020c727ff4..e4020c727ff4 100644
--- a/svtools/source/filter.vcl/igif/gifread.cxx
+++ b/svtools/source/filter/igif/gifread.cxx
diff --git a/svtools/source/filter.vcl/ixbm/xbmread.cxx b/svtools/source/filter/ixbm/xbmread.cxx
index 9c7faaafa88c..9c7faaafa88c 100644
--- a/svtools/source/filter.vcl/ixbm/xbmread.cxx
+++ b/svtools/source/filter/ixbm/xbmread.cxx
diff --git a/svtools/source/filter.vcl/ixpm/rgbtable.hxx b/svtools/source/filter/ixpm/rgbtable.hxx
index afdab883b369..afdab883b369 100644
--- a/svtools/source/filter.vcl/ixpm/rgbtable.hxx
+++ b/svtools/source/filter/ixpm/rgbtable.hxx
diff --git a/svtools/source/filter.vcl/ixpm/xpmread.cxx b/svtools/source/filter/ixpm/xpmread.cxx
index 7575c94e3ed9..7575c94e3ed9 100644
--- a/svtools/source/filter.vcl/ixpm/xpmread.cxx
+++ b/svtools/source/filter/ixpm/xpmread.cxx
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter/jpeg/jpeg.cxx
index a2de92171af3..a2de92171af3 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.cxx
+++ b/svtools/source/filter/jpeg/jpeg.cxx
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.h b/svtools/source/filter/jpeg/jpeg.h
index 82a2f80a838c..82a2f80a838c 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.h
+++ b/svtools/source/filter/jpeg/jpeg.h
diff --git a/svtools/source/filter.vcl/jpeg/jpegc.c b/svtools/source/filter/jpeg/jpegc.c
index 29b4749a7b51..29b4749a7b51 100644
--- a/svtools/source/filter.vcl/jpeg/jpegc.c
+++ b/svtools/source/filter/jpeg/jpegc.c
diff --git a/svtools/source/filter.vcl/filter/sgf.ini b/svtools/source/filter/sgf.ini
index 7444e40c8836..7444e40c8836 100644
--- a/svtools/source/filter.vcl/filter/sgf.ini
+++ b/svtools/source/filter/sgf.ini
diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter/sgfbram.cxx
index 3d1a71f5a2db..3d1a71f5a2db 100644
--- a/svtools/source/filter.vcl/filter/sgfbram.cxx
+++ b/svtools/source/filter/sgfbram.cxx
diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter/sgvmain.cxx
index 293c6dab7964..293c6dab7964 100644
--- a/svtools/source/filter.vcl/filter/sgvmain.cxx
+++ b/svtools/source/filter/sgvmain.cxx
diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter/sgvspln.cxx
index d695e171a194..d695e171a194 100644
--- a/svtools/source/filter.vcl/filter/sgvspln.cxx
+++ b/svtools/source/filter/sgvspln.cxx
diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter/sgvtext.cxx
index 9a82cd486599..9a82cd486599 100644
--- a/svtools/source/filter.vcl/filter/sgvtext.cxx
+++ b/svtools/source/filter/sgvtext.cxx
diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter/wmf/emfwr.cxx
index f31fd4439e9f..4405db28966a 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.cxx
+++ b/svtools/source/filter/wmf/emfwr.cxx
@@ -33,6 +33,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <vcl/lineinfo.hxx>
+#include <vcl/rendergraphicrasterizer.hxx>
// -----------
// - Defines -
@@ -1186,7 +1187,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case META_BMP_ACTION:
{
const MetaBmpAction* pA = (const MetaBmpAction *) pAction;
- ImplWriteBmpRecord( pA->GetBitmap(), pA->GetPoint(), pA->GetBitmap().GetSizePixel(), WIN_SRCCOPY );
+ ImplWriteBmpRecord( pA->GetBitmap(), pA->GetPoint(), maVDev.PixelToLogic( pA->GetBitmap().GetSizePixel() ), WIN_SRCCOPY );
}
break;
@@ -1217,8 +1218,8 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
{
aBmp.Replace( aMsk, COL_WHITE );
aMsk.Invert();
- ImplWriteBmpRecord( aMsk, pA->GetPoint(), aMsk.GetSizePixel(), WIN_SRCPAINT );
- ImplWriteBmpRecord( aBmp, pA->GetPoint(), aBmp.GetSizePixel(), WIN_SRCAND );
+ ImplWriteBmpRecord( aMsk, pA->GetPoint(), maVDev.PixelToLogic( aMsk.GetSizePixel() ), WIN_SRCPAINT );
+ ImplWriteBmpRecord( aBmp, pA->GetPoint(), maVDev.PixelToLogic( aBmp.GetSizePixel() ), WIN_SRCAND );
}
else
ImplWriteBmpRecord( aBmp, pA->GetPoint(), aBmp.GetSizePixel(), WIN_SRCCOPY );
@@ -1407,6 +1408,26 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
}
break;
+ case( META_RENDERGRAPHIC_ACTION ):
+ {
+ const MetaRenderGraphicAction* pA = (const MetaRenderGraphicAction*) pAction;
+ const ::vcl::RenderGraphicRasterizer aRasterizer( pA->GetRenderGraphic() );
+ const BitmapEx aBmpEx( aRasterizer.Rasterize( maVDev.LogicToPixel( pA->GetSize() ) ) );
+ Bitmap aBmp( aBmpEx.GetBitmap() );
+ Bitmap aMsk( aBmpEx.GetMask() );
+
+ if( !!aMsk )
+ {
+ aBmp.Replace( aMsk, COL_WHITE );
+ aMsk.Invert();
+ ImplWriteBmpRecord( aMsk, pA->GetPoint(), pA->GetSize(), WIN_SRCPAINT );
+ ImplWriteBmpRecord( aBmp, pA->GetPoint(), pA->GetSize(), WIN_SRCAND );
+ }
+ else
+ ImplWriteBmpRecord( aBmp, pA->GetPoint(), pA->GetSize(), WIN_SRCCOPY );
+ }
+ break;
+
default:
DBG_ERROR( ( ByteString( "EMFWriter::ImplWriteActions: unsupported MetaAction #" ) += ByteString::CreateFromInt32( nType ) ).GetBuffer() );
break;
diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter/wmf/emfwr.hxx
index 6334b5dfe16f..6334b5dfe16f 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.hxx
+++ b/svtools/source/filter/wmf/emfwr.hxx
diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter/wmf/enhwmf.cxx
index 1e49e0d61446..1e49e0d61446 100644
--- a/svtools/source/filter.vcl/wmf/enhwmf.cxx
+++ b/svtools/source/filter/wmf/enhwmf.cxx
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter/wmf/winmtf.cxx
index 787e6522b890..787e6522b890 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter/wmf/winmtf.cxx
diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter/wmf/winmtf.hxx
index fb4fd2fe0c57..fb4fd2fe0c57 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.hxx
+++ b/svtools/source/filter/wmf/winmtf.hxx
diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter/wmf/winwmf.cxx
index cea1ab490b04..cea1ab490b04 100644
--- a/svtools/source/filter.vcl/wmf/winwmf.cxx
+++ b/svtools/source/filter/wmf/winwmf.cxx
diff --git a/svtools/source/filter.vcl/wmf/wmf.cxx b/svtools/source/filter/wmf/wmf.cxx
index 25ca9f721b33..25ca9f721b33 100644
--- a/svtools/source/filter.vcl/wmf/wmf.cxx
+++ b/svtools/source/filter/wmf/wmf.cxx
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter/wmf/wmfwr.cxx
index 4dff9732c7d0..82d4101b48c9 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.cxx
+++ b/svtools/source/filter/wmf/wmfwr.cxx
@@ -29,6 +29,7 @@
#include "precompiled_svtools.hxx"
#include <vcl/salbtype.hxx>
+#include <vcl/rendergraphicrasterizer.hxx>
#include "wmfwr.hxx"
#include <unotools/fontcvt.hxx>
#include "emfwr.hxx"
@@ -318,6 +319,7 @@ void WMFWriter::CountActionsAndBitmaps( const GDIMetaFile & rMTF )
case META_BMPEX_ACTION:
case META_BMPEXSCALE_ACTION:
case META_BMPEXSCALEPART_ACTION:
+ case META_RENDERGRAPHIC_ACTION:
nNumberOfBitmaps++;
break;
}
@@ -1796,6 +1798,32 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
DBG_ERROR( "Unsupported action: MetaMoveClipRegionAction!" );
}
break;
+
+ case( META_RENDERGRAPHIC_ACTION ):
+ {
+ const MetaRenderGraphicAction* pA = (const MetaRenderGraphicAction*) pMA;
+ const ::vcl::RenderGraphicRasterizer aRasterizer( pA->GetRenderGraphic() );
+ const BitmapEx aBmpEx( aRasterizer.Rasterize( pVirDev->LogicToPixel( pA->GetSize(), aSrcMapMode ) ) );
+ Bitmap aBmp( aBmpEx.GetBitmap() );
+ Bitmap aMsk( aBmpEx.GetMask() );
+
+ if( !!aMsk )
+ {
+ aBmp.Replace( aMsk, COL_WHITE );
+ aMsk.Invert();
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aMsk, W_SRCPAINT );
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aBmp, W_SRCAND );
+ }
+ else
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aBmp );
+ }
+ break;
+
+ default:
+ {
+ DBG_ERROR( "Unsupported meta action!" );
+ }
+ break;
}
nWrittenActions++;
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter/wmf/wmfwr.hxx
index 9fe698b22c2e..9fe698b22c2e 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.hxx
+++ b/svtools/source/filter/wmf/wmfwr.hxx