if ( m_pApplyTempl || rSh.IsDrawCreate() || IsDrawAction()) return;
bool bStart = false, bDelSelect = false;
SdrObject *pObj = nullptr;
Point aDocPos( PixelToLogic( rPosPixel ) ); constbool bInSelect = rSh.IsInSelect(); if (!bInSelect && rSh.TestCurrPam(aDocPos, true)) //We are not selecting and aren't at a selection
bStart = true; elseif ( !g_bFrameDrag && rSh.IsSelFrameMode() &&
rSh.IsInsideSelectedObj( aDocPos ) &&
nullptr == m_pAnchorMarker)
{ //We are not dragging internally and are not at an //object (frame, draw object)
// #i106131# *and* AnchorDrag is *not* active: When active, // entering global drag mode will destroy the AnchorHdl but // keep the now invalid ptr in place, next access will crash. // It is indeed wrong to enter drag mode when AnchorDrag is // already active
bStart = true;
} elseif( !g_bFrameDrag && m_rView.GetDocShell()->IsReadOnly() &&
OBJCNT_NONE != rSh.GetObjCntType( aDocPos, pObj ))
{
rSh.LockPaint(LockPaintReason::StartDrag); if( rSh.SelectObj( aDocPos, 0, pObj ))
bStart = bDelSelect = true; else
rSh.UnlockPaint();
} elseif (!bInSelect)// tdf#116384 only drag hyperlink if user's not currently setting the selection
{
SwContentAtPos aSwContentAtPos( IsAttrAtPos::InetAttr );
bStart = rSh.GetContentAtPos( aDocPos,
aSwContentAtPos );
}
if ( !bStart || m_bIsInDrag ) return;
// If the add selection mode has been pushed in the MouseButtonDown handler it needs to be // popped or it will remain active and noticeable in the statusbar selection control until the // next MouseButtonUp event after the DnD, since a MouseButtonUp event is not received by the // edit window when DnD is done. if (g_bModePushed)
{
rSh.PopMode();
g_bModePushed = false;
}
//A Drop to an open OutlinerView doesn't concern us (also see QueryDrop)
SwWrtShell &rSh = m_rView.GetWrtShell(); const Point aDocPt( PixelToLogic( rEvt.maPosPixel ));
SdrObject *pObj = nullptr;
OutlinerView* pOLV;
rSh.GetObjCntType( aDocPt, pObj );
// There's a special treatment for file lists with a single // element, that depends on the actual content of the // Transferable to be accessible. Since the transferable // may only be accessed after the drop has been accepted // (according to KA due to Java D&D), we'll have to // reevaluate the drop action once more _with_ the // Transferable.
sal_uInt8 nEventAction;
sal_Int8 nUserOpt = rEvt.mbDefault ? EXCHG_IN_ACTION_DEFAULT
: rEvt.mnAction;
SotExchangeActionFlags nActionFlags;
m_nDropAction = SotExchange::GetExchangeAction(
GetDataFlavorExVector(),
m_nDropDestination,
rEvt.mnAction,
nUserOpt, m_nDropFormat, nEventAction, SotClipboardFormatId::NONE,
&rEvt.maDropEvent.Transferable,
&nActionFlags );
//With the default action we still want to have a say.
SwModule* pMod = SwModule::get(); if( pMod->m_pDragDrop )
{ bool bCleanup = false; //Drawing objects in Headers/Footers are not allowed
SwWrtShell *pSrcSh = pMod->m_pDragDrop->GetShell(); if( (pSrcSh->GetSelFrameType() == FrameTypeFlags::DRAWOBJ) &&
pSrcSh->IsSelContainsControl() &&
(rSh.GetFrameType( &aDocPt, false ) & (FrameTypeFlags::HEADER|FrameTypeFlags::FOOTER)) )
{
bCleanup = true;
} // don't more position protected objects! elseif( DND_ACTION_MOVE == rEvt.mnAction &&
pSrcSh->IsSelObjProtected( FlyProtectFlags::Pos ) != FlyProtectFlags::NONE )
{
bCleanup = true;
} elseif( rEvt.mbDefault )
{ // internal Drag&Drop: within same Doc a Move // otherwise a Copy - Task 54974
nEventAction = pSrcSh->GetDoc() == rSh.GetDoc()
? DND_ACTION_MOVE
: DND_ACTION_COPY;
} if ( bCleanup )
{
CleanupDropUserMarker();
rSh.UnSetVisibleCursor(); return DND_ACTION_NONE;
}
} else
{ //D&D from outside of SW should be a Copy per default. if( EXCHG_IN_ACTION_DEFAULT == nEventAction &&
DND_ACTION_MOVE == rEvt.mnAction )
nEventAction = DND_ACTION_COPY;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.