diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-02-07 16:11:39 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-02-07 16:11:39 +0100 |
commit | 5ab2b21b0a7e63e88737044afcde58659c315790 (patch) | |
tree | f4f43d1a402bbdf7e4dce3cbe3623eedd3f74812 /vcl | |
parent | 7e2ded8f9448a44733db667612c3ce1ea0187106 (diff) |
ka102: handle load failure case more gracefully, add service on windows and mac
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/components/rasterizer_rsvg.cxx | 25 | ||||
-rw-r--r-- | vcl/util/vcl.macosx.component | 3 | ||||
-rw-r--r-- | vcl/util/vcl.windows.component | 3 |
3 files changed, 17 insertions, 14 deletions
diff --git a/vcl/source/components/rasterizer_rsvg.cxx b/vcl/source/components/rasterizer_rsvg.cxx index 52a550220923..19acd33cad8a 100644 --- a/vcl/source/components/rasterizer_rsvg.cxx +++ b/vcl/source/components/rasterizer_rsvg.cxx @@ -295,6 +295,8 @@ LibraryWrapper::LibraryWrapper() : OSL_ENSURE( mpCairoLib, "cairo library could not be loaded" ); OSL_ENSURE( mpRSVGLib, "librsvg library could not be loaded" ); + bCont = bCont && mpGObjectLib != NULL && mpCairoLib != NULL && mpRSVGLib != NULL; + // unload all libraries in case of failure if( !bCont ) { @@ -316,6 +318,8 @@ LibraryWrapper::LibraryWrapper() : mpGObjectLib = NULL; } } + else + rsvg_init(); } // --------------------------- @@ -379,21 +383,14 @@ Rasterizer::Rasterizer() : mnDefaultHeight( 0 ), mbLibInit( true ) { - static bool bLibInitialized = false; - - if( !bLibInitialized ) + try { - try - { - LibraryWrapper& rLib = LibraryWrapper::get(); - rLib.rsvg_init(); - } - catch( ... ) - { - mbLibInit = false; - } - - bLibInitialized = true; + LibraryWrapper& rLib = LibraryWrapper::get(); + mbLibInit = rLib.isValid(); + } + catch( ... ) + { + mbLibInit = false; } } diff --git a/vcl/util/vcl.macosx.component b/vcl/util/vcl.macosx.component index 3aabcd8c7050..023f805672bd 100644 --- a/vcl/util/vcl.macosx.component +++ b/vcl/util/vcl.macosx.component @@ -46,4 +46,7 @@ <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> diff --git a/vcl/util/vcl.windows.component b/vcl/util/vcl.windows.component index 72f7ace9f251..df786c4d832b 100644 --- a/vcl/util/vcl.windows.component +++ b/vcl/util/vcl.windows.component @@ -37,4 +37,7 @@ <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> |