diff options
Diffstat (limited to 'svtools/source/misc/chartprettypainter.cxx')
-rw-r--r-- | svtools/source/misc/chartprettypainter.cxx | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/svtools/source/misc/chartprettypainter.cxx b/svtools/source/misc/chartprettypainter.cxx index bc2d02384816..ff461a17ada2 100644 --- a/svtools/source/misc/chartprettypainter.cxx +++ b/svtools/source/misc/chartprettypainter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,10 +33,8 @@ #include <tools/globname.hxx> #include <sot/clsids.hxx> -// header for function rtl_createUuid -#include <rtl/uuid.h> #include <vcl/pdfextoutdevdata.hxx> - +#include <comphelper/servicehelper.hxx> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <svtools/embedhlp.hxx> @@ -55,21 +54,14 @@ bool ChartPrettyPainter::DoPaint(OutputDevice* /*pOutDev*/, const Rectangle& /*r return false; } -//static +namespace +{ + class theChartPrettyPainterUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theChartPrettyPainterUnoTunnelId > {}; +} + const uno::Sequence<sal_Int8>& ChartPrettyPainter::getUnoTunnelId() { - static uno::Sequence<sal_Int8> * pSeq = 0; - if( !pSeq ) - { - osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); - if( !pSeq ) - { - static uno::Sequence< sal_Int8 > aSeq( 16 ); - rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); - pSeq = &aSeq; - } - } - return *pSeq; + return theChartPrettyPainterUnoTunnelId::get().getSeq(); } bool ChartPrettyPainter::IsChart( const svt::EmbeddedObjectRef& xObjRef ) @@ -133,8 +125,9 @@ bool ChartPrettyPainter::DoPrettyPaintChart( uno::Reference< frame::XModel > xCh catch( uno::Exception& e ) { (void)e; - DBG_ERROR( "Chart cannot be painted pretty!" ); + OSL_FAIL( "Chart cannot be painted pretty!" ); } return false; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |