From ac6e1758bb4f711492e49e7fc6504be1ef720d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 22 Dec 2010 20:31:55 +0000 Subject: [PATCH] use final version --- ...te-when-pasting-text-into-cell-comme.patch | 39 +++++++++++++++++++ fdo32572-sc-dont-double-paste.patch | 27 ------------- libreoffice.spec | 4 +- 3 files changed, 41 insertions(+), 29 deletions(-) create mode 100644 0001-Avoid-double-paste-when-pasting-text-into-cell-comme.patch delete mode 100644 fdo32572-sc-dont-double-paste.patch diff --git a/0001-Avoid-double-paste-when-pasting-text-into-cell-comme.patch b/0001-Avoid-double-paste-when-pasting-text-into-cell-comme.patch new file mode 100644 index 0000000..e3e5ec5 --- /dev/null +++ b/0001-Avoid-double-paste-when-pasting-text-into-cell-comme.patch @@ -0,0 +1,39 @@ +From 342f3cfe6f2b27ea62bd9883e16014c188276356 Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Wed, 22 Dec 2010 12:31:22 -0500 +Subject: [PATCH 1/2] 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. +--- + 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 0d32bae..6826829 100644 +--- a/sc/source/ui/view/gridwin.cxx ++++ b/sc/source/ui/view/gridwin.cxx +@@ -4298,6 +4298,23 @@ 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 && pObj->GetLogicRect().IsInside(aLogicPos)) ++ { ++ // Inside an active drawing object. Bail out. ++ return; ++ } ++ } ++ } ++ + ScSelectionTransferObj* pOwnSelection = SC_MOD()->GetSelectionTransfer(); + if ( pOwnSelection ) + { diff --git a/fdo32572-sc-dont-double-paste.patch b/fdo32572-sc-dont-double-paste.patch deleted file mode 100644 index dba2cfd..0000000 --- a/fdo32572-sc-dont-double-paste.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx -index 0d32bae..7ecdbfa 100644 ---- a/sc/source/ui/view/gridwin.cxx -+++ b/sc/source/ui/view/gridwin.cxx -@@ -1689,6 +1689,22 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt ) - SCTAB nTab = pViewData->GetTabNo(); - ScDocument* pDoc = pViewData->GetDocument(); - -+ { -+ //If the mouse down was inside a visible note window, ignore it and leave -+ //it up to the ScPostIt to handle it -+ ScAddress aCellPos(pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo()); -+ ScPostIt* pNote = pDoc->GetNote(aCellPos); -+ SdrObject* pObj = pNote ? pNote->GetCaption() : 0; -+ if (pObj && ScDrawLayer::IsNoteCaption(pObj)) -+ { -+ Point aLogicPos = PixelToLogic(aPos); -+ if (pObj->GetLogicRect().IsInside(aLogicPos)) -+ { -+ bEEMouse = TRUE; -+ return; -+ } -+ } -+ } - - // - // AutoFilter buttons diff --git a/libreoffice.spec b/libreoffice.spec index 2ea3560..77deb29 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -95,7 +95,7 @@ Patch12: turn-script-providers-into-extensions.patch Patch13: libreoffice-installfix.patch Patch14: 0001-tidy-this-up-and-don-t-bail-out-on-mislength-records.patch Patch15: 0001-Resoves-rhbz-663857-font-color-missing-C-FAQ-10.3-do.patch -Patch16: fdo32572-sc-dont-double-paste.patch +Patch16: 0001-Avoid-double-paste-when-pasting-text-into-cell-comme.patch Patch17: 0001-Resolves-rhbz-660342-Undo-Redo-crash-with-postits.patch %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} @@ -707,7 +707,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc %patch13 -p1 -b .libreoffice-installfix.patch %patch14 -p1 -b .don-t-bail-out-on-mislength-records.patch %patch15 -p1 -b .font-color-missing-C-FAQ-10.3-do.patch -%patch16 -p1 -b .fdo32572-sc-dont-double-paste.patch +%patch16 -p1 -b .Avoid-double-paste-when-pasting-text-into-cell-comme.patch %patch17 -p1 -b .rhbz-660342-Undo-Redo-crash-with-postits.patch touch scripting/source/pyprov/delzip touch scripting/util/provider/beanshell/delzip