diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-10-04 17:47:18 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-10-04 17:47:18 +0000 |
commit | fee206f1b99f15b523de8be0755fd43db5f57378 (patch) | |
tree | d877b4df461f51c9f06e9b574504efefbbb1e2dd /sd/source/ui/view/sdview3.cxx | |
parent | 490659dfcb1da7f7a509190986d86d831a976029 (diff) |
INTEGRATION: CWS mav09 (1.49.82); FILE MERGED
2004/09/16 18:48:56 mav 1.49.82.11: RESYNC: (1.52-1.53); FILE MERGED
2004/08/09 20:28:42 mav 1.49.82.10: RESYNC: (1.50-1.52); FILE MERGED
2004/07/15 10:51:10 mba 1.49.82.9: #i27773#: scaling for inplace mode
2004/07/08 22:48:00 mav 1.49.82.8: RESYNC: (1.49-1.50); FILE MERGED
2004/06/10 16:47:45 mba 1.49.82.7: #i27773#: some fixed to make InPlace Editing work
2004/06/01 08:11:07 mba 1.49.82.6: #i27773#: new embedding API
2004/05/19 18:16:23 mav 1.49.82.5: #i27773# adopt to incompatible changes
2004/05/16 17:29:17 mba 1.49.82.4: #i27773#: new EmbeddedObjectContainer
2004/05/04 14:07:14 mba 1.49.82.3: #i27773#: remove so3
2004/04/27 17:02:10 mba 1.49.82.2: #i27773#: new embedding API
2004/04/14 14:12:31 mba 1.49.82.1: #i27773#: remove so3; new storage API
Diffstat (limited to 'sd/source/ui/view/sdview3.cxx')
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 288 |
1 files changed, 149 insertions, 139 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 9827c9814..18a9e2f8b 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdview3.cxx,v $ * - * $Revision: 1.53 $ + * $Revision: 1.54 $ * - * last change: $Author: kz $ $Date: 2004-08-31 13:50:51 $ + * last change: $Author: kz $ $Date: 2004-10-04 18:47:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,7 +62,7 @@ #include "View.hxx" -#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ +#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ #include <com/sun/star/lang/XComponent.hpp> #endif #ifndef _FILELIST_HXX @@ -123,9 +123,7 @@ #ifndef _SFXITEMPOOL_HXX //autogen #include <svtools/itempool.hxx> #endif -#ifndef _SO_CLSIDS_HXX -#include <so3/clsids.hxx> -#endif +#include <sot/clsids.hxx> #ifndef _FM_FMMODEL_HXX #include <svx/fmmodel.hxx> #endif @@ -138,9 +136,6 @@ #ifndef _EDITENG_HXX //autogen #include <svx/editeng.hxx> #endif -#ifndef _TRANSBND_HXX -#include <so3/transbnd.hxx> -#endif #ifndef _E3D_OBJ3D_HXX #include <svx/obj3d.hxx> #endif @@ -151,10 +146,12 @@ #ifndef SVX_UNOMODEL_HXX #include <svx/unomodel.hxx> #endif -#ifndef _UTL_STREAM_WRAPPER_HXX_ +#ifndef _UTL_STREAM_WRAPPER_HXX_ #include <unotools/streamwrap.hxx> #endif +#include <toolkit/helper/vclunohelper.hxx> + #include "DrawDocShell.hxx" #ifndef SD_FU_POOR_HXX #include "fupoor.hxx" @@ -178,6 +175,8 @@ #include "unomodel.hxx" #include "ViewClipboard.hxx" +#include <sfx2/ipclient.hxx> +#include <comphelper/storagehelper.hxx> #include <tools/stream.hxx> #include <vcl/cvtgrf.hxx> @@ -185,6 +184,7 @@ // - Namespaces - // -------------- +using namespace ::com::sun::star; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; @@ -250,8 +250,8 @@ void ImpCheckInsertPos(Point& rPos, const Size& rSize, const Rectangle& rWorkAre } } -BOOL View::InsertData( const TransferableDataHelper& rDataHelper, - const Point& rPos, sal_Int8& rDnDAction, BOOL bDrag, +BOOL View::InsertData( const TransferableDataHelper& rDataHelper, + const Point& rPos, sal_Int8& rDnDAction, BOOL bDrag, ULONG nFormat, USHORT nPage, USHORT nLayer ) { aDropPos = rPos; @@ -273,8 +273,8 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, { OSL_ASSERT (pViewSh->GetViewShell()!=NULL); SfxInPlaceClient* pIpClient = pViewSh->GetViewShell()->GetIPClient(); - if( pViewSh->ISA(SlideViewShell) - || (pIpClient!=NULL && pIpClient->IsInPlaceActive())) + if( pViewSh->ISA(SlideViewShell) + || (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive())) nPasteOptions |= SDRINSERT_DONTMARK; } @@ -300,7 +300,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, else if( SD_MOD()->pTransferSelection == (SdTransferable*) pImplementation ) pOwnData = SD_MOD()->pTransferSelection; } - + // ImageMap? if( !pOwnData && aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVIM ) ) { @@ -397,7 +397,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, sal_uInt32 a, nConnectorCount(0L); Point aCurPos; - // calculate real position of current + // calculate real position of current // source objects, if necessary (#103207) if( pOwnData == SD_MOD()->pTransferSelection ) { @@ -405,7 +405,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, if( pMarkList->TakeBoundRect( pPV, aCurBoundRect ) ) aCurPos = aCurBoundRect.TopLeft(); - else + else aCurPos = pOwnData->GetStartPos(); } else @@ -449,7 +449,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, for(a = 0; a < aConnectorContainer.Count(); a++) { ImpRememberOrigAndClone* pRem = (ImpRememberOrigAndClone*)aConnectorContainer.GetObject(a); - + if(pRem->pClone->ISA(SdrEdgeObj)) { SdrEdgeObj* pOrigEdge = (SdrEdgeObj*)pRem->pOrig; @@ -474,7 +474,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, if(pGlueList) { sal_uInt16 nInd = pGlueList->FindGluePoint(rConn0.GetConnectorId()); - + if(SDRGLUEPOINT_NOTFOUND != nInd) { const SdrGluePoint& rGluePoint = (*pGlueList)[nInd]; @@ -506,7 +506,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, if(pGlueList) { sal_uInt16 nInd = pGlueList->FindGluePoint(rConn1.GetConnectorId()); - + if(SDRGLUEPOINT_NOTFOUND != nInd) { const SdrGluePoint& rGluePoint = (*pGlueList)[nInd]; @@ -568,7 +568,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, while( aIter.IsMore() ) { pObj = aIter.Next(); - + String aName( pObj->GetName() ); if( aName.Len() ) @@ -602,8 +602,8 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, else { SdDrawDocument* pWorkModel = (SdDrawDocument*) pOwnData->GetWorkDocument(); - SdPage* pWorkPage = (SdPage*) pWorkModel->GetSdPage( 0, PK_STANDARD ); - + SdPage* pWorkPage = (SdPage*) pWorkModel->GetSdPage( 0, PK_STANDARD ); + pWorkPage->SetRectsDirty(); // #104148# Use SnapRect, not BoundRect @@ -611,7 +611,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, aDropPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ); aDropPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ); - + // delete pages, that are not of any interest for us for( long i = ( pWorkModel->GetPageCount() - 1 ); i >= 0; i-- ) { @@ -620,7 +620,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, if( pPage->GetPageKind() != PK_STANDARD ) pWorkModel->DeletePage( (USHORT) i ); } - + bReturn = Paste( *pWorkModel, aDropPos, pPage, nPasteOptions ); if( !pPage ) @@ -779,39 +779,38 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, } } else if( !bLink && - ( CHECK_FORMAT_TRANS( SOT_FORMATSTR_ID_EMBED_SOURCE ) || + ( CHECK_FORMAT_TRANS( SOT_FORMATSTR_ID_EMBED_SOURCE ) || CHECK_FORMAT_TRANS( SOT_FORMATSTR_ID_EMBEDDED_OBJ ) ) && aDataHelper.HasFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ) ) { - SotStorageStreamRef xStm; + //TODO/LATER: is it possible that this format is binary?! (from old versions of SO) + uno::Reference < io::XInputStream > xStm; TransferableObjectDescriptor aObjDesc; if( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) && - ( aDataHelper.GetSotStorageStream( nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE, xStm ) || - aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ, xStm ) ) ) + ( aDataHelper.GetInputStream( nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE, xStm ) || + aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ, xStm ) ) ) { - SvStorageRef xStore( new SvStorage( *xStm ) ); - if( pDoc->GetDocSh() && ( pDoc->GetDocSh()->GetClassName() == aObjDesc.maClassName ) ) { + uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromInputStream( xStm ); ::sd::DrawDocShellRef xDocShRef( new ::sd::DrawDocShell( SFX_CREATE_MODE_EMBEDDED, TRUE, pDoc->GetDocumentType() ) ); - if( xDocShRef->DoLoad( xStore ) ) { SdDrawDocument* pModel = (SdDrawDocument*) xDocShRef->GetDoc(); - SdPage* pWorkPage = (SdPage*) pModel->GetSdPage( 0, PK_STANDARD ); - + SdPage* pWorkPage = (SdPage*) pModel->GetSdPage( 0, PK_STANDARD ); + pWorkPage->SetRectsDirty(); if( pOwnData ) { // #104148# Use SnapRect, not BoundRect Size aSize( pWorkPage->GetAllObjSnapRect().GetSize() ); - + aDropPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ); aDropPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ); } - + // delete pages, that are not of any interest for us for( long i = ( pModel->GetPageCount() - 1 ); i >= 0; i-- ) { @@ -820,7 +819,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, if( pPage->GetPageKind() != PK_STANDARD ) pModel->DeletePage( (USHORT) i ); } - + bReturn = Paste( *pModel, aDropPos, pPage, nPasteOptions ); if( !pPage ) @@ -837,52 +836,58 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, } else { - SvInPlaceObjectRef xIPObj( &( (SvFactory*) SvInPlaceObject::ClassFactory() )->CreateAndLoad( xStore ) ); - - if( xIPObj.Is() ) + ::rtl::OUString aName; + uno::Reference < embed::XEmbeddedObject > xObj = pDocSh->GetEmbeddedObjectContainer().InsertEmbeddedObject( xStm, aName ); + + awt::Size aSz; + MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( aObjDesc.mnViewAspect ) ); + if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() ) { - String aName( pDocSh->InsertObject( xIPObj, String() )->GetObjName() ); + Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MAP_100TH_MM, aMapUnit ) ); + aSz.Width = aTmp.Width(); + aSz.Height = aTmp.Height(); + xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); + } - if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() ) - xIPObj->SetVisAreaSize( OutputDevice::LogicToLogic( aObjDesc.maSize, MAP_100TH_MM, xIPObj->GetMapUnit() ) ); + aSz = xObj->getVisualAreaSize( aObjDesc.mnViewAspect ); + Size aSize( aSz.Width, aSz.Height ); - Size aSize( xIPObj->GetVisArea().GetSize() ); + if( !aSize.Width() || !aSize.Height() ) + { + aSize.Width() = 14100; + aSize.Height() = 10000; + aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MAP_100TH_MM, aMapUnit ); + aSz.Width = aSize.Width(); + aSz.Height = aSize.Height(); + xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); + } - if( !aSize.Width() || !aSize.Height() ) - { - aSize.Width() = 14100; - aSize.Height() = 10000; - xIPObj->SetVisAreaSize( OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, xIPObj->GetMapUnit() ) ); - aSize = xIPObj->GetVisArea().GetSize(); - } + aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM ); + Size aMaxSize( pDoc->GetMaxObjSize() ); - aSize = OutputDevice::LogicToLogic( aSize, xIPObj->GetMapUnit(), MAP_100TH_MM ); - Size aMaxSize( pDoc->GetMaxObjSize() ); - - aDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1; - aDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1; - - Rectangle aRect( aDropPos, aSize ); - SdrOle2Obj* pObj = new SdrOle2Obj( xIPObj, aName, aRect ); - SdrPageView* pPV = GetPageViewPvNum( 0 ); - ULONG nOptions = SDRINSERT_SETDEFLAYER; + aDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1; + aDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1; - if (pViewSh!=NULL) - { - OSL_ASSERT (pViewSh->GetViewShell()!=NULL); - SfxInPlaceClient* pIpClient - = pViewSh->GetViewShell()->GetIPClient(); - if (pIpClient!=NULL && pIpClient->IsInPlaceActive()) - nOptions |= SDRINSERT_DONTMARK; - } + Rectangle aRect( aDropPos, aSize ); + SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, aObjDesc.mnViewAspect ), aName, aRect ); + SdrPageView* pPV = GetPageViewPvNum( 0 ); + ULONG nOptions = SDRINSERT_SETDEFLAYER; - InsertObject( pObj, *pPV, nOptions ); + if (pViewSh!=NULL) + { + OSL_ASSERT (pViewSh->GetViewShell()!=NULL); + SfxInPlaceClient* pIpClient + = pViewSh->GetViewShell()->GetIPClient(); + if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) + nOptions |= SDRINSERT_DONTMARK; + } - if( pImageMap ) - pObj->InsertUserData( new SdIMapInfo( *pImageMap ) ); + InsertObject( pObj, *pPV, nOptions ); - bReturn = TRUE; - } + if( pImageMap ) + pObj->InsertUserData( new SdIMapInfo( *pImageMap ) ); + + bReturn = TRUE; } } } @@ -891,63 +896,68 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, CHECK_FORMAT_TRANS( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ) ) && aDataHelper.HasFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ) ) { - SotStorageStreamRef xStm; + uno::Reference < io::XInputStream > xStm; TransferableObjectDescriptor aObjDesc; - if( aDataHelper.GetTransferableObjectDescriptor( - SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE, aObjDesc )) + //TODO/MBA: testing + if ( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE, aObjDesc ) && + ( aDataHelper.GetInputStream( nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, xStm ) || + aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, xStm ) ) ) { - UniString aEmptyStr; - SvStorage* xStore = new SvStorage( aEmptyStr, STREAM_STD_READWRITE ); - SvInPlaceObjectRef xIPObj= &((SvFactory*)SvInPlaceObject::ClassFactory()) - ->CreateAndInit( aDataHelper.GetTransferable(), xStore); - - if( xIPObj.Is() ) + ::rtl::OUString aName; + uno::Reference < embed::XEmbeddedObject > xObj = pDocSh->GetEmbeddedObjectContainer().InsertEmbeddedObject( xStm, aName ); + + MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( aObjDesc.mnViewAspect ) ); + awt::Size aSz; + if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() ) { - String aName( pDocSh->InsertObject( xIPObj, String() )->GetObjName() ); - - if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() ) - xIPObj->SetVisAreaSize( OutputDevice::LogicToLogic( aObjDesc.maSize, MAP_100TH_MM, xIPObj->GetMapUnit() ) ); - - Size aSize( xIPObj->GetVisArea().GetSize() ); - - if( !aSize.Width() || !aSize.Height() ) - { - aSize.Width() = 14100; - aSize.Height() = 10000; - xIPObj->SetVisAreaSize( OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, xIPObj->GetMapUnit() ) ); - aSize = xIPObj->GetVisArea().GetSize(); - } - - aSize = OutputDevice::LogicToLogic( aSize, xIPObj->GetMapUnit(), MAP_100TH_MM ); - Size aMaxSize( pDoc->GetMaxObjSize() ); - - aDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1; - aDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1; - - Rectangle aRect( aDropPos, aSize ); - SdrOle2Obj* pObj = new SdrOle2Obj( xIPObj, aName, aRect ); - SdrPageView* pPV = GetPageViewPvNum( 0 ); - ULONG nOptions = SDRINSERT_SETDEFLAYER; + Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MAP_100TH_MM, aMapUnit ) ); + aSz.Width = aTmp.Width(); + aSz.Height = aTmp.Height(); + xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); + } - if (pViewSh != NULL) - { - OSL_ASSERT (pViewSh->GetViewShell()!=NULL); - SfxInPlaceClient* pIpClient = - pViewSh->GetViewShell()->GetIPClient(); - if (pIpClient!=NULL && pIpClient->IsInPlaceActive()) - nOptions |= SDRINSERT_DONTMARK; - } - - InsertObject( pObj, *pPV, nOptions ); - - if( pImageMap ) - pObj->InsertUserData( new SdIMapInfo( *pImageMap ) ); - - bReturn = TRUE; - + aSz = xObj->getVisualAreaSize( aObjDesc.mnViewAspect ); + Size aSize( aSz.Width, aSz.Height ); + + if( !aSize.Width() || !aSize.Height() ) + { + aSize.Width() = 14100; + aSize.Height() = 10000; + aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MAP_100TH_MM, aMapUnit ); + aSz.Width = aSize.Width(); + aSz.Height = aSize.Height(); + xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); + } + + aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM ); + Size aMaxSize( pDoc->GetMaxObjSize() ); + + aDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1; + aDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1; + + Rectangle aRect( aDropPos, aSize ); + SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, aObjDesc.mnViewAspect ), aName, aRect ); + SdrPageView* pPV = GetPageViewPvNum( 0 ); + ULONG nOptions = SDRINSERT_SETDEFLAYER; + + if (pViewSh!=NULL) + { + OSL_ASSERT (pViewSh->GetViewShell()!=NULL); + SfxInPlaceClient* pIpClient + = pViewSh->GetViewShell()->GetIPClient(); + if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) + nOptions |= SDRINSERT_DONTMARK; } + + InsertObject( pObj, *pPV, nOptions ); + + if( pImageMap ) + pObj->InsertUserData( new SdIMapInfo( *pImageMap ) ); + + bReturn = TRUE; } + //TODO/LATER: if format is not available, create picture } else if( ( !bLink || pPickObj ) && CHECK_FORMAT_TRANS( SOT_FORMATSTR_ID_SVXB ) ) { @@ -966,12 +976,12 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, SdrPage* pWorkPage = (SdrPage*) ( ( pWorkModel->GetPageCount() > 1 ) ? pWorkModel->GetSdPage( 0, PK_STANDARD ) : pWorkModel->GetPage( 0 ) ); - + pWorkPage->SetRectsDirty(); - + // #104148# Use SnapRect, not BoundRect Size aSize( pWorkPage->GetAllObjSnapRect().GetSize() ); - + aInsertPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ); aInsertPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ); } @@ -979,7 +989,7 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper, // #90129# restrict movement to WorkArea Size aImageMapSize = OutputDevice::LogicToLogic(aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), MapMode(MAP_100TH_MM)); - + ImpCheckInsertPos(aInsertPos, aImageMapSize, GetWorkArea()); InsertGraphic( aGraphic, nAction, aInsertPos, NULL, pImageMap ); @@ -1026,12 +1036,12 @@ if( aPreviewSizePixel.Width() && aPreviewSizePixel.Height() ) SdrPage* pWorkPage = (SdrPage*) ( ( pWorkModel->GetPageCount() > 1 ) ? pWorkModel->GetSdPage( 0, PK_STANDARD ) : pWorkModel->GetPage( 0 ) ); - + pWorkPage->SetRectsDirty(); - + // #104148# Use SnapRect, not BoundRect Size aSize( pWorkPage->GetAllObjSnapRect().GetSize() ); - + aInsertPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ); aInsertPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ); } @@ -1058,12 +1068,12 @@ if( aPreviewSizePixel.Width() && aPreviewSizePixel.Height() ) SdrPage* pWorkPage = (SdrPage*) ( ( pWorkModel->GetPageCount() > 1 ) ? pWorkModel->GetSdPage( 0, PK_STANDARD ) : pWorkModel->GetPage( 0 ) ); - + pWorkPage->SetRectsDirty(); - + // #104148# Use SnapRect, not BoundRect Size aSize( pWorkPage->GetAllObjSnapRect().GetSize() ); - + aInsertPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ); aInsertPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ); } @@ -1085,7 +1095,7 @@ if( aPreviewSizePixel.Width() && aPreviewSizePixel.Height() ) XFillExchangeData aFillData( XFillAttrSetItem( &pDoc->GetPool() ) ); *xStm >> aFillData; - + BegUndo( String( SdResId( STR_UNDO_DRAGDROP ) ) ); AddUndo( new SdrUndoAttrObj( *pPickObj ) ); EndUndo(); @@ -1123,10 +1133,10 @@ if( aPreviewSizePixel.Width() && aPreviewSizePixel.Height() ) pPickObj->IsHit( aHitPosB, nHitLog, pVisiLayer ) ) { // area fill - if(eFill == XFILL_SOLID ) + if(eFill == XFILL_SOLID ) aSet.Put(XFillColorItem(aName, aColor)); - aSet.Put( XFillStyleItem( eFill ) ); + aSet.Put( XFillStyleItem( eFill ) ); } else aSet.Put( XLineColorItem( aName, aColor ) ); @@ -1229,7 +1239,7 @@ if( aPreviewSizePixel.Width() && aPreviewSizePixel.Height() ) } else if( !bLink && CHECK_FORMAT_TRANS( FORMAT_STRING ) ) { - if( ( FORMAT_STRING == nFormat ) || + if( ( FORMAT_STRING == nFormat ) || ( !aDataHelper.HasFormat( SOT_FORMATSTR_ID_SOLK ) && !aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) && !aDataHelper.HasFormat( SOT_FORMATSTR_ID_FILENAME ) ) ) @@ -1245,7 +1255,7 @@ if( aPreviewSizePixel.Width() && aPreviewSizePixel.Height() ) pOLV->InsertText( aOUString ); bReturn = TRUE; } - + if( !bReturn ) bReturn = SdrView::Paste( aOUString, aDropPos, pPage, nPasteOptions ); } |