incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arie...@apache.org
Subject svn commit: r1215559 - in /incubator/ooo/trunk/main/vcl: source/gdi/rendergraphicrasterizer.cxx vcl.macosx.component vcl.unx.component vcl.windows.component
Date Sat, 17 Dec 2011 19:10:03 GMT
Author: arielch
Date: Sat Dec 17 19:10:02 2011
New Revision: 1215559

URL: http://svn.apache.org/viewvc?rev=1215559&view=rev
Log:
Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG

Modified:
    incubator/ooo/trunk/main/vcl/source/gdi/rendergraphicrasterizer.cxx
    incubator/ooo/trunk/main/vcl/vcl.macosx.component
    incubator/ooo/trunk/main/vcl/vcl.unx.component
    incubator/ooo/trunk/main/vcl/vcl.windows.component

Modified: incubator/ooo/trunk/main/vcl/source/gdi/rendergraphicrasterizer.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/rendergraphicrasterizer.cxx?rev=1215559&r1=1215558&r2=1215559&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/rendergraphicrasterizer.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/rendergraphicrasterizer.cxx Sat Dec 17 19:10:02
2011
@@ -32,6 +32,7 @@
 #include <vcl/unohelp.hxx>
 #include <vcl/bmpacc.hxx>
 #include <vcl/graph.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/stream.hxx>
 #include <comphelper/processfactory.hxx>
 #include <unotools/streamwrap.hxx>
@@ -231,44 +232,44 @@ void RenderGraphicRasterizer::Initialize
 
         maDefaultSizePixel.Width() = maDefaultSizePixel.Height() = 0;
 
-        if( !maRenderGraphic.IsEmpty() )
+        if ( !maRenderGraphic.IsEmpty() )
         {
             rtl::OUString aServiceName;
 
-            if( 0 == maRenderGraphic.GetGraphicDataMimeType().compareToAscii( "image/svg+xml"
) )
+            if ( 0 == maRenderGraphic.GetGraphicDataMimeType().compareToAscii( RTL_CONSTASCII_STRINGPARAM(
"image/svg+xml" ) ) )
             {
                 aServiceName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VCL_SERVICENAME_RASTERIZER_SVG
) );
             }
 
             if( aServiceName.getLength() )
             {
-                mxRasterizer.set( xFactory->createInstance( aServiceName ), uno::UNO_QUERY
);
-
-                if( mxRasterizer.is() )
+                try
                 {
-                    std::auto_ptr< VirtualDevice > apCompVDev;
-                    OutputDevice* pCompDev = NULL;
+                    mxRasterizer.set( xFactory->createInstance( aServiceName ), uno::UNO_QUERY
);
+
+                    if( mxRasterizer.is() )
+                    {
+                        std::auto_ptr< VirtualDevice > apCompVDev;
+                        OutputDevice* pCompDev = NULL;
 
 #ifndef NO_GETAPPWINDOW
-                    pCompDev = Application::GetAppWindow();
+                        pCompDev = Application::GetAppWindow();
 #endif
 
-                    if( !pCompDev )
-                    {
-                        apCompVDev.reset( new VirtualDevice );
-                        pCompDev = apCompVDev.get();
-                    }
+                        if( !pCompDev )
+                        {
+                            apCompVDev.reset( new VirtualDevice );
+                            pCompDev = apCompVDev.get();
+                        }
 
-                    const Size      aDPI( pCompDev->LogicToPixel( Size( 1, 1 ), MAP_INCH
) );
-                    awt::Size       aSizePixel;
-                    SvMemoryStream  aMemStm( maRenderGraphic.GetGraphicData().get(),
-                                             maRenderGraphic.GetGraphicDataLength(),
-                                             STREAM_READ );
+                        const Size      aDPI( pCompDev->LogicToPixel( Size( 1, 1 ), MAP_INCH
) );
+                        awt::Size       aSizePixel;
+                        SvMemoryStream  aMemStm( maRenderGraphic.GetGraphicData().get(),
+                                                maRenderGraphic.GetGraphicDataLength(),
+                                                STREAM_READ );
 
-                    uno::Reference< io::XInputStream > xIStm( new utl::OSeekableInputStreamWrapper(
aMemStm ) );
+                        uno::Reference< io::XInputStream > xIStm( new utl::OSeekableInputStreamWrapper(
aMemStm ) );
 
-                    try
-                    {
                         if( !xIStm.is() || !mxRasterizer->initializeData( xIStm, aDPI.Width(),
aDPI.Height(), aSizePixel ) )
                         {
                             mxRasterizer.clear();
@@ -279,11 +280,11 @@ void RenderGraphicRasterizer::Initialize
                             maDefaultSizePixel.Height() = aSizePixel.Height;
                         }
                     }
-                    catch( ... )
-                    {
-                        OSL_TRACE( "caught exception during initialization of SVG rasterizer
component" );
-                        mxRasterizer.clear();
-                    }
+                }
+                catch( ... )
+                {
+                    DBG_UNHANDLED_EXCEPTION();
+                    mxRasterizer.clear();
                 }
             }
         }

Modified: incubator/ooo/trunk/main/vcl/vcl.macosx.component
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/vcl.macosx.component?rev=1215559&r1=1215558&r2=1215559&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/vcl.macosx.component (original)
+++ incubator/ooo/trunk/main/vcl/vcl.macosx.component Sat Dec 17 19:10:02 2011
@@ -46,7 +46,4 @@
   <implementation name="vcl::FontIdentificator">
     <service name="com.sun.star.awt.FontIdentificator"/>
   </implementation>
-  <implementation name="vcl::rsvg::Rasterizer">
-    <service name="com.sun.star.graphic.GraphicRasterizer_RSVG"/>
-  </implementation>
 </component>

Modified: incubator/ooo/trunk/main/vcl/vcl.unx.component
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/vcl.unx.component?rev=1215559&r1=1215558&r2=1215559&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/vcl.unx.component (original)
+++ incubator/ooo/trunk/main/vcl/vcl.unx.component Sat Dec 17 19:10:02 2011
@@ -46,7 +46,4 @@
   <implementation name="vcl::FontIdentificator">
     <service name="com.sun.star.awt.FontIdentificator"/>
   </implementation>
-  <implementation name="vcl::rsvg::Rasterizer">
-    <service name="com.sun.star.graphic.GraphicRasterizer_RSVG"/>
-  </implementation>
 </component>

Modified: incubator/ooo/trunk/main/vcl/vcl.windows.component
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/vcl.windows.component?rev=1215559&r1=1215558&r2=1215559&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/vcl.windows.component (original)
+++ incubator/ooo/trunk/main/vcl/vcl.windows.component Sat Dec 17 19:10:02 2011
@@ -37,7 +37,4 @@
   <implementation name="vcl::FontIdentificator">
     <service name="com.sun.star.awt.FontIdentificator"/>
   </implementation>
-  <implementation name="vcl::rsvg::Rasterizer">
-    <service name="com.sun.star.graphic.GraphicRasterizer_RSVG"/>
-  </implementation>
 </component>



Mime
View raw message