diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-03-15 10:43:30 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-03-15 10:43:30 +0000 |
commit | 5533101a6f221a7addb3481535e36e90c3a3c15a (patch) | |
tree | 67e5c36d332d9ac4c3e7d1a312b389d08484e92c | |
parent | 024eea8adc4fb50c264d416e5b5aa175a8521917 (diff) |
INTEGRATION: CWS mav17 (1.19.42); FILE MERGED
2005/02/28 11:00:06 mav 1.19.42.1: #i42398# handle impossibility to get visual area
-rw-r--r-- | sc/source/ui/view/drawvie4.cxx | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index b3c8775f7a52..b5c1b5d3cbf5 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drawvie4.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: rt $ $Date: 2005-01-31 09:08:00 $ + * last change: $Author: obo $ $Date: 2005-03-15 11:43:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,6 +59,10 @@ * ************************************************************************/ +#ifndef _COM_SUN_STAR_EMBED_NOVISUALAREASIZEEXCEPTION_HPP_ +#include <com/sun/star/embed/NoVisualAreaSizeException.hpp> +#endif + #ifdef PCH #include "ui_pch.hxx" #endif @@ -66,7 +70,6 @@ #pragma hdrstop // INCLUDE --------------------------------------------------------------- - #include <sch/memchrt.hxx> #include <sch/schdll.hxx> #include <svx/svditer.hxx> @@ -312,11 +315,18 @@ void ScDrawView::SetMarkedOriginalSize() // TODO/LEAN: working with visual area can switch object to running state uno::Reference < embed::XEmbeddedObject > xObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY ); MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( ((SdrOle2Obj*)pObj)->GetAspect() ) ); - awt::Size aSz = xObj->getVisualAreaSize( ((SdrOle2Obj*)pObj)->GetAspect() ); - aOriginalSize = OutputDevice::LogicToLogic( + awt::Size aSz; + try + { + aSz = xObj->getVisualAreaSize( ((SdrOle2Obj*)pObj)->GetAspect() ); + aOriginalSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aUnit, MAP_100TH_MM ); - bDo = TRUE; + bDo = TRUE; + } catch( embed::NoVisualAreaSizeException& ) + { + OSL_ENSURE( sal_False, "Can't get the original size of the object!" ); + } } else if (nIdent == OBJ_GRAF) { |