From 49e315c467d4800ae08c0149a4f5f38eb64b16f6 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 10 Feb 2011 17:34:10 +0000 Subject: catch exceptions from failing UNO-ness, fdo#33785 backstop. --- vcl/source/gdi/gdimtf.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'vcl/source/gdi/gdimtf.cxx') diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index fdb6ab0e6b4a..ce7aa4764d76 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -512,7 +512,10 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S if (!win) win = Application::GetFirstTopLevelWindow(); - if (win) { + if (!win) + return false; + + try { const uno::Reference& xCanvas = win->GetCanvas (); Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1); const uno::Reference& xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize)); @@ -566,6 +569,10 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S } } } + } catch( uno::RuntimeException& ) { + throw; // runtime errors are fatal + } catch( uno::Exception& ) { + // ignore errors, no way of reporting them here } return false; -- cgit From 930183694d4bdbf100b0549a9d7312c2ef107ae2 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 15 Feb 2011 17:26:00 +0100 Subject: GDIMetaFile::bUseCanvas related changes (prerequisite for fixing n#650049) - add GetUseCanvas() for read access - update bUseCanvas when playing on metafile --- vcl/source/gdi/gdimtf.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vcl/source/gdi/gdimtf.cxx') diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index ce7aa4764d76..655b3ec2fe8a 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -437,6 +437,8 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf, ULONG nPos ) MetaAction* pAction = GetCurAction(); const ULONG nObjCount = Count(); + rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas ); + if( nPos > nObjCount ) nPos = nObjCount; -- cgit