diff options
author | Christian Lippka <cl@openoffice.org> | 2002-12-12 12:25:36 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2002-12-12 12:25:36 +0000 |
commit | 4b86d377a2e3c9f3070f554f4a5d5c9840ad7b6a (patch) | |
tree | 9783c0534b94fa5c4c9812e4b61891831204a477 | |
parent | e4a8120262442da261a43c1f5230d6c82d5e887d (diff) |
#103556# handle multiple selections with controls correct
-rw-r--r-- | sd/source/ui/app/sdxfer.cxx | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 35ca228f8af2..ffd7916e75b4 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdxfer.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: ka $ $Date: 2002-12-11 14:54:57 $ + * last change: $Author: cl $ $Date: 2002-12-12 13:25:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,6 +144,7 @@ #include <so3/outplace.hxx> #include <svx/unomodel.hxx> +#include <svx/svditer.hxx> #include "docshell.hxx" #include "sdview.hxx" @@ -409,6 +410,38 @@ void SdTransferable::CreateData() // ----------------------------------------------------------------------------- +BOOL lcl_HasOnlyControls( SdrModel* pModel ) +{ + BOOL bOnlyControls = FALSE; // default if there are no objects + + if ( pModel ) + { + SdrPage* pPage = pModel->GetPage(0); + if (pPage) + { + SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); + SdrObject* pObj = aIter.Next(); + if ( pObj ) + { + bOnlyControls = TRUE; // only set if there are any objects at all + while ( pObj ) + { + if (!pObj->ISA(SdrUnoObj)) + { + bOnlyControls = FALSE; + break; + } + pObj = aIter.Next(); + } + } + } + } + + return bOnlyControls; +} + +// ----------------------------------------------------------------------------- + void SdTransferable::AddSupportedFormats() { if( !bPageTransferable || bPageTransferablePersistent ) @@ -453,7 +486,7 @@ void SdTransferable::AddSupportedFormats() { AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); AddFormat( SOT_FORMATSTR_ID_DRAWING ); - if( !mbIsUnoObj ) + if( !pSdDrawDocument || !lcl_HasOnlyControls( pSdDrawDocument ) ) { AddFormat( SOT_FORMAT_GDIMETAFILE ); AddFormat( SOT_FORMAT_BITMAP ); |