[Libreoffice-commits] .: sw/inc sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 2 13:45:11 PDT 2012


 sw/inc/crsrsh.hxx                |    6 ---
 sw/inc/viscrs.hxx                |   14 --------
 sw/source/core/crsr/viscrs.cxx   |   64 ---------------------------------------
 sw/source/core/layout/layact.cxx |    3 -
 sw/source/ui/docvw/edtwin.cxx    |   13 -------
 5 files changed, 100 deletions(-)

New commits:
commit c2eb9698eff7412e6973e659f26e7e39eeaf2887
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue Oct 2 22:36:28 2012 +0900

    Remove dead code
    
    SW_CRSR_TIMER was undefined
    
    Change-Id: Ib851170ea61547e0ceaa6721c0b2fb90fecaecd3
    Reviewed-on: https://gerrit.libreoffice.org/747
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 4c7e48c..e8678e9 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -750,12 +750,6 @@ public:
     // is the whole document protected/hidden (for UI...)
     sal_Bool IsAllProtect() const { return bAllProtect; }
 
-#ifdef SW_CRSR_TIMER
-    // Set flag at VisCrsr. Is it triggered by Timer (TRUE) or directly (FALSE).
-    // Default is triggert by Timer.
-    sal_Bool ChgCrsrTimerFlag( sal_Bool bTimerOn = sal_True );
-#endif
-
     sal_Bool BasicActionPend() const    { return nBasicActionCnt != nStartAction; }
 
     sal_Bool GotoRegion( const String& rName );
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index 5b0b925..f8b274b 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -39,9 +39,6 @@ class SwShellCrsr;
 // From here classes/methods for non-text cursor.
 
 class SwVisCrsr
-#ifdef SW_CRSR_TIMER
-                : private Timer
-#endif
 {
     friend void _InitCore();
     friend void _FinitCore();
@@ -49,16 +46,9 @@ class SwVisCrsr
     sal_Bool bIsVisible : 1;
     sal_Bool bIsDragCrsr : 1;
 
-#ifdef SW_CRSR_TIMER
-    sal_Bool bTimerOn : 1;
-#endif
-
     Cursor aTxtCrsr;
     const SwCrsrShell* pCrsrShell;
 
-#ifdef SW_CRSR_TIMER
-    virtual void Timeout();
-#endif
     void _SetPosAndShow();
 
 public:
@@ -70,10 +60,6 @@ public:
 
     sal_Bool IsVisible() const { return bIsVisible; }
     void SetDragCrsr( sal_Bool bFlag = sal_True ) { bIsDragCrsr = bFlag; }
-
-#ifdef SW_CRSR_TIMER
-    sal_Bool ChgTimerFlag( sal_Bool bTimerOn = sal_True );
-#endif
 };
 
 
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 09eebb7..88d8404 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -70,22 +70,12 @@ SwVisCrsr::SwVisCrsr( const SwCrsrShell * pCShell )
     bIsVisible = aTxtCrsr.IsVisible();
     bIsDragCrsr = sal_False;
     aTxtCrsr.SetWidth( 0 );
-
-#ifdef SW_CRSR_TIMER
-    bTimerOn = sal_True;
-    SetTimeout( 50 ); // 50 millisecond delay
-#endif
 }
 
 
 
 SwVisCrsr::~SwVisCrsr()
 {
-#ifdef SW_CRSR_TIMER
-    if( bTimerOn )
-        Stop(); // stop timer
-#endif
-
     if( bIsVisible && aTxtCrsr.IsVisible() )
         aTxtCrsr.Hide();
 
@@ -103,21 +93,7 @@ void SwVisCrsr::Show()
 
         // display at all?
         if( pCrsrShell->VisArea().IsOver( pCrsrShell->aCharRect ) )
-#ifdef SW_CRSR_TIMER
-        {
-            if( bTimerOn )
-                Start();    // start timer
-            else
-            {
-                if( IsActive() )
-                    Stop(); // stop timer
-
-                _SetPosAndShow();
-            }
-        }
-#else
             _SetPosAndShow();
-#endif
     }
 }
 
@@ -129,51 +105,11 @@ void SwVisCrsr::Hide()
     {
         bIsVisible = sal_False;
 
-#ifdef SW_CRSR_TIMER
-        if( IsActive() )
-            Stop(); // stop timer
-#endif
-
         if( aTxtCrsr.IsVisible() )      // Shouldn't the flags be in effect?
             aTxtCrsr.Hide();
     }
 }
 
-#ifdef SW_CRSR_TIMER
-
-void SwVisCrsr::Timeout()
-{
-    OSL_ENSURE( !bIsDragCrsr, "stop timer before" );
-    if( bIsVisible )
-    {
-        if ( !pCrsrShell->GetWin() ) // SwFrmFmt::GetGraphic suspends Win temporarily!
-            Start();
-        else
-            _SetPosAndShow();
-    }
-}
-
-sal_Bool SwCrsrShell::ChgCrsrTimerFlag( sal_Bool bTimerOn )
-{
-    return pVisCrsr->ChgTimerFlag( bTimerOn );
-}
-
-
-sal_Bool SwVisCrsr::ChgTimerFlag( sal_Bool bFlag )
-{
-    bOld = bTimerOn;
-    if( !bFlag && bIsVisible && IsActive() )
-    {
-        Stop(); // stop timer
-        _SetPosAndShow();
-    }
-    bTimerOn = bFlag;
-    return bOld;
-}
-
-#endif
-
-
 void SwVisCrsr::_SetPosAndShow()
 {
     SwRect aRect;
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index d542238..26de885 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -2330,9 +2330,6 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
             sal_Bool bVis = sal_False;
             if ( pSh->ISA(SwCrsrShell) )
             {
-#ifdef SW_CRSR_TIMER
-                ((SwCrsrShell*)pSh)->ChgCrsrTimerFlag( sal_False );
-#endif
                 bVis = ((SwCrsrShell*)pSh)->GetCharRect().IsOver(pSh->VisArea());
             }
             aBools.push_back( bVis );
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index f9ae3ce..711c63c 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -2007,9 +2007,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
                 case KEY_TAB:
                 {
 
-#ifdef SW_CRSR_TIMER
-                    sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False );
-#endif
                     if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark() || rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT)
                     {
                         eKeyState=KS_GotoNextFieldMark;
@@ -2052,17 +2049,10 @@ KEYINPUT_CHECKTABLE_INSDEL:
                                 eKeyState = KS_OutlineDown;
                         }
                     }
-#ifdef SW_CRSR_TIMER
-                    rSh.ChgCrsrTimerFlag( bOld );
-#endif
                 }
                 break;
                 case KEY_TAB | KEY_SHIFT:
                 {
-#ifdef SW_CRSR_TIMER
-                    sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False );
-                    sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False );
-#endif
                     if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark()|| rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) {
                         eKeyState=KS_GotoPrevFieldMark;
                     }
@@ -2103,9 +2093,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
                                 eKeyState = KS_OutlineUp;
                         }
                     }
-#ifdef SW_CRSR_TIMER
-                    rSh.ChgCrsrTimerFlag( bOld );
-#endif
                 }
                 break;
                 case KEY_TAB | KEY_MOD1:


More information about the Libreoffice-commits mailing list