diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-12-22 12:31:22 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-12-22 16:20:48 -0500 |
commit | a05a1b07e99d753393ec99044b834cf02a84d7d4 (patch) | |
tree | 67f664313a473a85609c109dd85bfa76d275a78a /sc | |
parent | 6b9dae27ce2e90c47e723166d111efc3d73633f4 (diff) |
Avoid double-paste when pasting text into cell comment. (fdo#32572)
Original patch is from Caolan. I re-worked it to handle more use
cases.
Signed-off-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1f21e93d28d3..f5236e4e99ff 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -4297,6 +4297,26 @@ void ScGridWindow::PasteSelection( const Point& rPosPixel ) SCsROW nPosY; pViewData->GetPosFromPixel( rPosPixel.X(), rPosPixel.Y(), eWhich, nPosX, nPosY ); + // If the mouse down was inside a visible note window, ignore it and + // leave it up to the ScPostIt to handle it + SdrView* pDrawView = pViewData->GetViewShell()->GetSdrView(); + if (pDrawView) + { + ULONG nCount = pDrawView->GetMarkedObjectCount(); + for (ULONG i = 0; i < nCount; ++i) + { + SdrObject* pObj = pDrawView->GetMarkedObjectByIndex(i); + if (pObj && ScDrawLayer::IsNoteCaption(pObj)) + { + if (pObj->GetLogicRect().IsInside(aLogicPos)) + { + // Inside an active note object. Bail out. + return; + } + } + } + } + ScSelectionTransferObj* pOwnSelection = SC_MOD()->GetSelectionTransfer(); if ( pOwnSelection ) { |