[Libreoffice-commits] .: 2 commits - sw/source vcl/unx

Stephan Bergmann sbergmann at kemper.freedesktop.org
Mon Nov 28 01:40:47 PST 2011


 sw/source/ui/docvw/edtdd.cxx       |    2 -
 sw/source/ui/docvw/edtwin.cxx      |   38 ++++++++++++++++++-------------------
 sw/source/ui/inc/wrtsh.hxx         |   15 ++++++++------
 sw/source/ui/uiview/viewsrch.cxx   |    6 ++---
 sw/source/ui/wrtsh/select.cxx      |   10 +++++----
 sw/source/ui/wrtsh/wrtsh1.cxx      |    3 --
 vcl/unx/kde4/warning_guard_qhash.h |    2 +
 7 files changed, 41 insertions(+), 35 deletions(-)

New commits:
commit afb548ba6962c74ae99350bad0bd2c72c9ddd998
Author: Daisuke Nishino <niboshi000 at gmail.com>
Date:   Sun Nov 27 15:55:22 2011 +0900

    Hide function pointers
    
    Removed some redundant "this->", sbergman at redhat.com.

diff --git a/sw/source/ui/docvw/edtdd.cxx b/sw/source/ui/docvw/edtdd.cxx
index 766ae89..26617b6 100644
--- a/sw/source/ui/docvw/edtdd.cxx
+++ b/sw/source/ui/docvw/edtdd.cxx
@@ -75,7 +75,7 @@ void SwEditWin::StopDDTimer(SwWrtShell *pSh, const Point &rPt)
     aTimer.Stop();
     bDDTimerStarted = sal_False;
     if(!pSh->IsSelFrmMode())
-        (pSh->*pSh->fnSetCrsr)(&rPt,sal_False);
+        pSh->SetCursor(&rPt, false);
     aTimer.SetTimeoutHdl(LINK(this,SwEditWin, TimerHandler));
 }
 
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 18c13f1..23ba0bd 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -600,7 +600,7 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG )
         }
         else if ( bFrmDrag )
         {
-            (rSh.*rSh.fnDrag)(&aModPt,sal_False);
+            rSh.Drag(&aModPt, false);
             bDone = sal_True;
         }
         if ( !bDone )
@@ -614,7 +614,7 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG )
             rSh.SelectTableRowCol( *pRowColumnSelectionStart, &aPos, bIsRowDrag );
         }
         else
-            (rSh.*rSh.fnSetCrsr)( &aModPt, sal_False );
+            rSh.SetCursor( &aModPt, false );
 
         // It can be that a "jump" over a table cannot be accomplished like
         // that. So we jump over the table by Up/Down here.
@@ -3010,7 +3010,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
                                 {
                                     // move cursor here so that it is not drawn in the
                                     // frame first; ShowCrsr() happens in LeaveSelFrmMode()
-                                    bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False));
+                                    bValidCrsrPos = !(CRSR_POSCHG & rSh.SetCursor(&aDocPos, false));
                                     rSh.LeaveSelFrmMode();
                                     rView.AttrChangedNotify( &rSh );
                                     bCallBase = sal_False;
@@ -3389,7 +3389,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
                     {   // only temporary generate Move-Kontext because otherwise
                         // the query to the content form doesn't work!!!
                         MV_KONTEXT( &rSh );
-                        nTmpSetCrsr = (rSh.*rSh.fnSetCrsr)(&aDocPos,bOnlyText);
+                        nTmpSetCrsr = rSh.SetCursor(&aDocPos, bOnlyText);
                         bValidCrsrPos = !(CRSR_POSCHG & nTmpSetCrsr);
                         bCallBase = sal_False;
                     }
@@ -3762,7 +3762,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
                         pSdrView->SetAngleSnapEnabled(sal_False);
                     }
 
-                    (rSh.*rSh.fnDrag)( &aDocPt, rMEvt.IsShift() );
+                    rSh.Drag( &aDocPt, rMEvt.IsShift() );
                     bIsInMove = sal_True;
                 }
                 else if( bIsDocReadOnly )
@@ -3802,9 +3802,9 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
                             rMEvt.GetModifier() + rMEvt.GetButtons() ) &&
                             rSh.Is_FnDragEQBeginDrag() && !rSh.IsAddMode() ))
                     {
-                        (rSh.*rSh.fnDrag)( &aDocPt,sal_False );
+                        rSh.Drag( &aDocPt, false );
 
-                        bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPt,sal_False));
+                        bValidCrsrPos = !(CRSR_POSCHG & rSh.SetCursor(&aDocPt, false));
                         EnterArea();
                     }
                 }
@@ -3929,8 +3929,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
         case MOUSE_LEFT + KEY_MOD2:
             if( rSh.IsBlockMode() && !rMEvt.IsSynthetic() )
             {
-                (rSh.*rSh.fnDrag)( &aDocPt,sal_False );
-                bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPt,sal_False));
+                rSh.Drag( &aDocPt, false );
+                bValidCrsrPos = !(CRSR_POSCHG & rSh.SetCursor(&aDocPt, false));
                 EnterArea();
             }
         break;
@@ -3994,7 +3994,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
         bMBPressed = sal_False;
         if ( rSh.IsSelFrmMode() )
         {
-            (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False );
+            rSh.EndDrag( &aDocPt, false );
             bFrmDrag = sal_False;
         }
         bNoInterrupt = sal_False;
@@ -4040,7 +4040,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
             else
             {
                 const Point aDocPos( PixelToLogic( aStartPos ) );
-                bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False));
+                bValidCrsrPos = !(CRSR_POSCHG & rSh.SetCursor(&aDocPos, false));
                 rSh.Edit();
             }
 
@@ -4103,7 +4103,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
                         }
                     }
                     else
-                        (rSh.*rSh.fnEndDrag)( &aDocPt,sal_False );
+                        rSh.EndDrag( &aDocPt, false );
                 }
                 else
                 {
@@ -4152,7 +4152,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
                             CaptureMouse();
                         }
                     }
-                    (rSh.*rSh.fnEndDrag)( &aDocPt,sal_False );
+                    rSh.EndDrag( &aDocPt, false );
                 }
                 bFrmDrag = sal_False;
                 bCallBase = sal_False;
@@ -4164,7 +4164,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
             if (rSh.IsSelFrmMode())
             {
 
-                (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False );
+                rSh.EndDrag( &aDocPt, false );
                 bFrmDrag = sal_False;
                 bCallBase = sal_False;
                 break;
@@ -4174,7 +4174,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
             {
                 // the EndDrag should be called in any case
                 bHoldSelection = sal_False;
-                (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False );
+                rSh.EndDrag( &aDocPt, false );
             }
             else
             {
@@ -4186,7 +4186,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
                         // the query to the content form doesn't work!!!
                         MV_KONTEXT( &rSh );
                         const Point aDocPos( PixelToLogic( aStartPos ) );
-                        bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False));
+                        bValidCrsrPos = !(CRSR_POSCHG & rSh.SetCursor(&aDocPos, false));
                     }
                     bNoInterrupt = bTmpNoInterrupt;
 
@@ -4194,7 +4194,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
                 else
                 {
                     sal_Bool bInSel = rSh.IsInSelect();
-                    (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False );
+                    rSh.EndDrag( &aDocPt, false );
 
                     // Internetfield? --> call link (load doc!!)
                     if( !bInSel )
@@ -5337,7 +5337,7 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
         {
             // move cursor here so that it is not drawn in the
             // frame at first; ShowCrsr() happens in LeaveSelFrmMode()
-            bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False));
+            bValidCrsrPos = !(CRSR_POSCHG & rSh.SetCursor(&aDocPos, false));
             rSh.LeaveSelFrmMode();
             rView.LeaveDrawCreate();
             rView.AttrChangedNotify( &rSh );
@@ -5383,7 +5383,7 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
         {   // create only temporary move context because otherwise
             // the query against the content form doesn't work!!!
             MV_KONTEXT( &rSh );
-            (rSh.*rSh.fnSetCrsr)(&aDocPos, sal_False);
+            rSh.SetCursor(&aDocPos, false);
             bRet = sal_True;
         }
     }
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index 9d6c0a9..879ccbe 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -104,10 +104,6 @@ private:
     using SwEditShell::AutoCorrect;
     using SwCrsrShell::GotoMark;
 
-public:
-
-    using SwEditShell::Insert;
-
     typedef long (SwWrtShell::*SELECTFUNC)(const Point *, sal_Bool bProp );
 
     SELECTFUNC  fnDrag;
@@ -115,6 +111,15 @@ public:
     SELECTFUNC  fnEndDrag;
     SELECTFUNC  fnKillSel;
 
+public:
+
+    using SwEditShell::Insert;
+
+    long SetCursor    (const Point* pPt, bool bProp) { return (this->*fnSetCrsr)(pPt, bProp); }
+    long Drag         (const Point* pPt, bool bProp) { return (this->*fnDrag)(pPt, bProp); }
+    long EndDrag      (const Point* pPt, bool bProp) { return (this->*fnEndDrag)(pPt, bProp); }
+    long KillSelection(const Point* pPt, bool bProp) { return (this->*fnKillSel)(pPt, bProp); }
+
     // reset all selections
     long ResetSelect( const Point *, sal_Bool );
 
@@ -583,8 +588,6 @@ private:
     Point   aStart;
     Link    aSelTblLink;
 
-    SELECTFUNC  fnLeaveSelect;
-
     // resets the cursor stack after movement by PageUp/-Down
     SW_DLLPRIVATE void  _ResetCursorStack();
 
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index 1d852c2..29d33c1 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -299,7 +299,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
                     {
                         // bestehende Selektionen aufheben,
                         // wenn nicht in selektierten Bereichen gesucht werden soll
-                        (pWrtShell->*pWrtShell->fnKillSel)(0, sal_False);
+                        pWrtShell->KillSelection(0, false);
                         if( DOCPOS_START == aOpts.eEnd )
                             pWrtShell->EndDoc();
                         else
@@ -449,7 +449,7 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
         // falls in selektierten Bereichen gesucht werden soll, duerfen sie
         // nicht aufgehoben werden
     if (!pSrchItem->GetSelection())
-        (pWrtShell->*pWrtShell->fnKillSel)(0, sal_False);
+        pWrtShell->KillSelection(0, false);
 
     SwWait *pWait = new SwWait( *GetDocShell(), sal_True );
     if( FUNC_Search( aOpts ) )
@@ -559,7 +559,7 @@ sal_Bool SwView::SearchAll(sal_uInt16* pFound)
     {
         // bestehende Selektionen aufheben,
         // wenn nicht in selektierten Bereichen gesucht werden soll
-        (pWrtShell->*pWrtShell->fnKillSel)(0, sal_False);
+        pWrtShell->KillSelection(0, false);
 
         if( DOCPOS_START == aOpts.eEnd )
             pWrtShell->EndDoc();
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index bbc4571..6884e7d 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -421,9 +421,13 @@ void SwWrtShell::EndSelect()
     if(bInSelect && !bExtMode)
     {
         bInSelect = sal_False;
-        (this->*fnLeaveSelect)(0,sal_False);
-        if(!bAddMode)
+        if (bAddMode)
         {
+            AddLeaveSelect(0, sal_False);
+        }
+        else
+        {
+            SttLeaveSelect(0, sal_False);
             fnSetCrsr = &SwWrtShell::SetCrsrKillSel;
             fnKillSel = &SwWrtShell::ResetSelect;
         }
@@ -651,7 +655,6 @@ void SwWrtShell::EnterAddMode()
     if(IsTableMode()) return;
     if(bBlockMode)
         LeaveBlockMode();
-    fnLeaveSelect = &SwWrtShell::AddLeaveSelect;
     fnKillSel = &SwWrtShell::Ignore;
     fnSetCrsr = &SwWrtShell::SetCrsr;
     bAddMode = sal_True;
@@ -666,7 +669,6 @@ void SwWrtShell::EnterAddMode()
 
 void SwWrtShell::LeaveAddMode()
 {
-    fnLeaveSelect = &SwWrtShell::SttLeaveSelect;
     fnKillSel = &SwWrtShell::ResetSelect;
     fnSetCrsr = &SwWrtShell::SetCrsrKillSel;
     bAddMode = sal_False;
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 778d622..9dcda67 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -127,8 +127,7 @@ using namespace com::sun::star;
         pCrsrStack(0),  \
         rView(rShell),\
         aNavigationMgr(this), \
-        bDestOnStack(sal_False), \
-        fnLeaveSelect(&SwWrtShell::SttLeaveSelect)
+        bDestOnStack(sal_False)
 
 #define BITFLD_INI_LIST \
         bClearMark = \
commit 66b9a19d23fdad25db16d376ff74afc9e6f1a84e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Nov 28 10:28:28 2011 +0100

    Added upstream bug link.

diff --git a/vcl/unx/kde4/warning_guard_qhash.h b/vcl/unx/kde4/warning_guard_qhash.h
index e5c8c37..156506b 100644
--- a/vcl/unx/kde4/warning_guard_qhash.h
+++ b/vcl/unx/kde4/warning_guard_qhash.h
@@ -37,6 +37,8 @@
     Silence down this WaE:
     /usr/include/qt4/QtCore/qscopedpointer.h:83:47: error: declaration of ‘pointer’
     shadows a global declaration [-Werror=shadow]
+
+    Reported upstream as <https://bugreports.qt.nokia.com/browse/QTBUG-22908>.
 */
 
 #ifdef _MSC_VER


More information about the Libreoffice-commits mailing list