diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-03-15 10:21:27 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-03-15 10:21:27 +0000 |
commit | 98a10650be5da30235f4a386a5e1349c329dc71f (patch) | |
tree | 5076319ea1720233f91e241e34a3d808fef29aee /sd/source/ui/func/fuinsert.cxx | |
parent | 522700108f064bf778cf5480a73e8c4416c9bbea (diff) |
INTEGRATION: CWS mav17 (1.31.68); FILE MERGED
2005/02/28 11:01:47 mav 1.31.68.1: #i42398# handle impossibility to get visual area
Diffstat (limited to 'sd/source/ui/func/fuinsert.cxx')
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 5985895db0c0..97305356d2f5 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fuinsert.cxx,v $ * - * $Revision: 1.31 $ + * $Revision: 1.32 $ * - * last change: $Author: rt $ $Date: 2005-01-11 12:11:43 $ + * last change: $Author: obo $ $Date: 2005-03-15 11:21:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,6 +66,9 @@ #include <toolkit/helper/vclunohelper.hxx> #include <svx/svxdlg.hxx> +#ifndef _COM_SUN_STAR_EMBED_NOVISUALAREASIZEEXCEPTION_HPP_ +#include <com/sun/star/embed/NoVisualAreaSizeException.hpp> +#endif #ifndef _COM_SUN_STAR_EMBED_ASPECTS_HPP_ #include <com/sun/star/embed/Aspects.hpp> #endif @@ -382,7 +385,16 @@ FuInsertOLE::FuInsertOLE ( if ( xObj.is() ) { sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; - awt::Size aSz = xObj->getVisualAreaSize( nAspect ); + awt::Size aSz; + try + { + aSz = xObj->getVisualAreaSize( nAspect ); + } + catch ( embed::NoVisualAreaSizeException& ) + { + // the default size will be set later + } + Size aSize( aSz.Width, aSz.Height ); MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); @@ -547,7 +559,16 @@ FuInsertOLE::FuInsertOLE ( // aIPObj->OnDocumentPrinterChanged( pDocSh->GetPrinter(FALSE) ); BOOL bInsertNewObject = TRUE; - awt::Size aSz = xObj->getVisualAreaSize( nAspect ); + awt::Size aSz; + try + { + aSz = xObj->getVisualAreaSize( nAspect ); + } + catch( embed::NoVisualAreaSizeException& ) + { + // the default size will be set later + } + Size aSize( aSz.Width, aSz.Height ); MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); @@ -623,14 +644,20 @@ FuInsertOLE::FuInsertOLE ( // New size must be set in SdrObject, or a wrong scale will be set at // ActivateObject. - aSz = xObj->getVisualAreaSize( nAspect ); - Size aNewSize = Window::LogicToLogic( Size( aSz.Width, aSz.Height ), - MapMode( aMapUnit ), MapMode( MAP_100TH_MM ) ); - if ( aNewSize != aSize ) + try { - aRect.SetSize( aNewSize ); - pObj->SetLogicRect( aRect ); + aSz = xObj->getVisualAreaSize( nAspect ); + + Size aNewSize = Window::LogicToLogic( Size( aSz.Width, aSz.Height ), + MapMode( aMapUnit ), MapMode( MAP_100TH_MM ) ); + if ( aNewSize != aSize ) + { + aRect.SetSize( aNewSize ); + pObj->SetLogicRect( aRect ); + } } + catch( embed::NoVisualAreaSizeException& ) + {} if (bCreateNew) { |