sc/source/ui/inc/gridwin.hxx | 11 ----------- sc/source/ui/view/dbfunc3.cxx | 12 ------------ sc/source/ui/view/gridwin.cxx | 8 -------- sc/source/ui/view/gridwin2.cxx | 2 -- sc/source/ui/view/gridwin5.cxx | 28 ---------------------------- sc/source/ui/view/viewfun2.cxx | 4 ---- sc/source/ui/view/viewfun3.cxx | 27 --------------------------- sc/source/ui/view/viewfunc.cxx | 4 ---- 8 files changed, 96 deletions(-)
New commits: commit 76d07ffc5f87790865d9ea1a5c3c1093d0d01fe6 Author: Thomas Arnhold <[email protected]> Date: Fri Jul 13 10:58:21 2012 +0100 Resolves: fdo#48256 clean out Hide/Show Cursor Change-Id: I0249d42f06f9c1168c2c0c59af927c4a0535c39e diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index bb1d2ad..63cbbe1 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -81,17 +81,6 @@ struct SpellCallbackInfo; #define SC_PD_BREAK_V 32 -class ScHideTextCursor -{ -private: - ScViewData* pViewData; - ScSplitPos eWhich; - -public: - ScHideTextCursor( ScViewData* pData, ScSplitPos eW ); - ~ScHideTextCursor(); -}; - // --------------------------------------------------------------------------- // predefines namespace sdr { namespace overlay { class OverlayObjectList; }} diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 26c00cc..cf7d96a 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -202,9 +202,7 @@ void ScDBFunc::RemoveAllOutlines( sal_Bool bRecord ) ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScOutlineDocFunc aFunc(*pDocSh); - HideCursor(); sal_Bool bOk = aFunc.RemoveAllOutlines( nTab, bRecord, false ); - ShowCursor(); if (bOk) UpdateScrollBars(); @@ -236,9 +234,7 @@ void ScDBFunc::SelectLevel( sal_Bool bColumns, sal_uInt16 nLevel, sal_Bool bReco ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScOutlineDocFunc aFunc(*pDocSh); - HideCursor(); sal_Bool bOk = aFunc.SelectLevel( nTab, bColumns, nLevel, bRecord, bPaint, false ); - ShowCursor(); if (bOk) UpdateScrollBars(); @@ -252,9 +248,7 @@ void ScDBFunc::ShowOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEn ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScOutlineDocFunc aFunc(*pDocSh); - HideCursor(); sal_Bool bOk = aFunc.ShowOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint, false ); - ShowCursor(); if ( bOk && bPaint ) UpdateScrollBars(); @@ -268,9 +262,7 @@ void ScDBFunc::HideOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEn ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScOutlineDocFunc aFunc(*pDocSh); - HideCursor(); sal_Bool bOk = aFunc.HideOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint, false ); - ShowCursor(); if ( bOk && bPaint ) UpdateScrollBars(); @@ -359,9 +351,7 @@ void ScDBFunc::ShowMarkedOutlines( sal_Bool bRecord ) { ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScOutlineDocFunc aFunc(*pDocSh); - HideCursor(); sal_Bool bDone = aFunc.ShowMarkedOutlines( aRange, bRecord, false ); - ShowCursor(); if (bDone) UpdateScrollBars(); } @@ -378,9 +368,7 @@ void ScDBFunc::HideMarkedOutlines( sal_Bool bRecord ) { ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScOutlineDocFunc aFunc(*pDocSh); - HideCursor(); sal_Bool bDone = aFunc.HideMarkedOutlines( aRange, bRecord, false ); - ShowCursor(); if (bDone) UpdateScrollBars(); } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1a6b9f9..d5400f3 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -735,9 +735,7 @@ void ScGridWindow::RefreshAutoFilterButton(const ScAddress& rPos) bool bFilterActive = IsAutoFilterActive(rPos.Col(), rPos.Row(), rPos.Tab()); mpFilterButton->setHasHiddenMember(bFilterActive); mpFilterButton->setPopupPressed(false); - HideCursor(); mpFilterButton->draw(); - ShowCursor(); } } @@ -4683,11 +4681,9 @@ void ScGridWindow::UpdateAutoFillMark(bool bMarked, const ScRange& rMarkRange) { if ( bMarked != bAutoMarkVisible || ( bMarked && rMarkRange.aEnd != aAutoMarkPos ) ) { - HideCursor(); bAutoMarkVisible = bMarked; if ( bMarked ) aAutoMarkPos = rMarkRange.aEnd; - ShowCursor(); UpdateAutoFillOverlay(); } @@ -5116,8 +5112,6 @@ bool ScGridWindow::GetEditUrlOrError( bool bSpellErr, const Point& rPos, if( !bFound ) return false; - ScHideTextCursor aHideCursor( pViewData, eWhich ); // before GetEditArea (MapMode is changed) - const ScPatternAttr* pPattern = pDoc->GetPattern( nPosX, nPosY, nTab ); // bForceToTop = sal_False, use the cell's real position Rectangle aEditRect = pViewData->GetEditArea( eWhich, nPosX, nPosY, this, pPattern, false ); @@ -5269,8 +5263,6 @@ bool ScGridWindow::GetEditUrlOrError( bool bSpellErr, const Point& rPos, SetMapMode(aOld); - // text cursor is restored in ScHideTextCursor dtor - return bRet; } return false; diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 7d3fa0a..0c7fb54 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -155,9 +155,7 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& mpFilterButton->setDrawBaseButton(false); mpFilterButton->setDrawPopupButton(true); mpFilterButton->setPopupPressed(true); - HideCursor(); mpFilterButton->draw(); - ShowCursor(); LaunchAutoFilterMenu(nCol, nRow); return true; } diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index 4293910..1ff8895 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -61,32 +61,6 @@ // ----------------------------------------------------------------------- -ScHideTextCursor::ScHideTextCursor( ScViewData* pData, ScSplitPos eW ) : - pViewData(pData), - eWhich(eW) -{ - Window* pWin = pViewData->GetView()->GetWindowByPos( eWhich ); - if (pWin) - { - Cursor* pCur = pWin->GetCursor(); - if ( pCur && pCur->IsVisible() ) - pCur->Hide(); - } -} - -ScHideTextCursor::~ScHideTextCursor() -{ - Window* pWin = pViewData->GetView()->GetWindowByPos( eWhich ); - if (pWin) - { - // restore text cursor - if ( pViewData->HasEditView(eWhich) && pWin->HasFocus() ) - pViewData->GetEditView(eWhich)->ShowCursor( false, sal_True ); - } -} - -// ----------------------------------------------------------------------- - bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard ) { bool bDone = false; @@ -368,8 +342,6 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) pViewData->GetPosFromPixel( aPosPixel.X(), aPosPixel.Y(), eWhich, nPosX, nPosY ); const ScPatternAttr* pPattern = pDoc->GetPattern( nPosX, nPosY, nTab ); - ScHideTextCursor aHideCursor( pViewData, eWhich ); // MapMode is changed in GetEditArea - // bForceToTop = sal_False, use the cell's real position aPixRect = pViewData->GetEditArea( eWhich, nPosX, nPosY, this, pPattern, false ); } diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 3fb60ab..dcc3b05 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1142,9 +1142,7 @@ sal_Bool ScViewFunc::MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool if (bOk) { - HideCursor(); bOk = pDocSh->GetDocFunc().MergeCells( aMergeOption, rDoContents, bRecord, bApi ); - ShowCursor(); if (bOk) { @@ -1243,11 +1241,9 @@ sal_Bool ScViewFunc::RemoveMerge( sal_Bool bRecord ) } while (bExtended); - HideCursor(); sal_Bool bOk = pDocSh->GetDocFunc().UnmergeCells(aOption, bRecord, false ); aExtended = aOption.getFirstSingleRange(); MarkRange( aExtended ); - ShowCursor(); if (bOk) pDocSh->UpdateOle(GetViewData()); diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index ae057a7..b6a2b98 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -182,8 +182,6 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, sal_Bool bIncludeObjects ) sal_uInt16 nExtFlags = 0; pDocSh->UpdatePaintExt( nExtFlags, aRange ); - HideCursor(); // Cursor aendert sich ! - rMark.MarkToMulti(); pDoc->DeleteSelection( IDF_ALL, rMark ); if ( bIncludeObjects ) @@ -198,7 +196,6 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, sal_Bool bIncludeObjects ) new ScUndoCut( pDocSh, aRange, aOldEnd, rMark, pUndoDoc ) ); aModificator.SetDocumentModified(); - ShowCursor(); // Cursor aendert sich ! pDocSh->UpdateOle(GetViewData()); CellContentChanged(); @@ -806,23 +803,6 @@ sal_Bool lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCo namespace { -class CursorSwitcher -{ -public: - CursorSwitcher(ScViewFunc* pViewFunc) : - mpViewFunc(pViewFunc) - { - mpViewFunc->HideCursor(); - } - - ~CursorSwitcher() - { - mpViewFunc->ShowCursor(); - } -private: - ScViewFunc* mpViewFunc; -}; - bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument* pDoc, const ScMarkData& rMark, Window* pParentWnd) { bool bIsEmpty = true; @@ -1259,8 +1239,6 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc, rMark.SetMarkArea( aUserRange ); MarkDataChanged(); - HideCursor(); // Cursor aendert sich ! - // // Aus Clipboard kopieren, // wenn gerechnet werden soll, Originaldaten merken @@ -1360,8 +1338,6 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc, PAINT_GRID ); } - ShowCursor(); // Cursor aendert sich ! - //! Block-Bereich bei RefUndoDoc weglassen !!! if ( bRecord ) @@ -1563,7 +1539,6 @@ bool ScViewFunc::PasteMultiRangesFromClip( if (pDoc->IsUndoEnabled()) pDoc->BeginDrawUndo(); - CursorSwitcher aCursorSwitch(this); sal_uInt16 nNoObjFlags = nFlags & ~IDF_OBJECTS; pDoc->CopyMultiRangeFromClip(rCurPos, aMark, nNoObjFlags, pClipDoc, true, bAsLink, false, bSkipEmpty); @@ -1716,8 +1691,6 @@ bool ScViewFunc::PasteFromClipToMultiRanges( if (pDoc->IsUndoEnabled()) pDoc->BeginDrawUndo(); - CursorSwitcher aCursorSwitch(this); - // First, paste everything but the drawing objects. for (size_t i = 0, n = aRanges.size(); i < n; ++i) { diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index a290e02..4832a27 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2309,8 +2309,6 @@ void ScViewFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOLROW if (bPaint) { - HideCursor(); - itr = pMarkData->begin(); for (; itr != itrEnd; ++itr) { @@ -2339,8 +2337,6 @@ void ScViewFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOLROW pDocSh->UpdateOle(GetViewData()); if( !pDocSh->IsReadOnly() ) aModificator.SetDocumentModified(); - - ShowCursor(); } // #i97876# Spreadsheet data changes are not notified _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
