[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 19 09:06:14 UTC 2018


 sw/source/uibase/inc/wrtsh.hxx    |   14 +++++++-------
 sw/source/uibase/wrtsh/wrtsh1.cxx |   21 ++++++---------------
 2 files changed, 13 insertions(+), 22 deletions(-)

New commits:
commit 0043a27279028d2a5918160c4f992514ac5566e3
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Wed Dec 19 06:51:40 2018 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Dec 19 10:05:50 2018 +0100

    Replace a macro with default member initializers
    
    Unfortunately, this doesn't work with bitfields (yet).
    
    Change-Id: I72fa3dc96324847a3dd732c3246dfe2851f93c09
    Reviewed-on: https://gerrit.libreoffice.org/65392
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 8dd284c41cda..0d7102043ad2 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -101,10 +101,10 @@ private:
     typedef long (SwWrtShell::*SELECTFUNC)(const Point *, bool bProp );
     typedef void (SwWrtShell::*SELECTFUNC2)(const Point *, bool bProp );
 
-    SELECTFUNC2  m_fnDrag;
-    SELECTFUNC   m_fnSetCursor;
-    SELECTFUNC2  m_fnEndDrag;
-    SELECTFUNC   m_fnKillSel;
+    SELECTFUNC2 m_fnDrag      = &SwWrtShell::BeginDrag;
+    SELECTFUNC  m_fnSetCursor = &SwWrtShell::SetCursor;
+    SELECTFUNC2 m_fnEndDrag   = &SwWrtShell::DefaultEndDrag;
+    SELECTFUNC  m_fnKillSel   = &SwWrtShell::Ignore;
 
 public:
 
@@ -498,7 +498,7 @@ private:
             bExt(_bExt),
             bIns(_bIns)
              {}
-    } *m_pModeStack;
+    } *m_pModeStack = nullptr;
 
     // carry cursor along when PageUp / -Down
     enum PageMove
@@ -506,7 +506,7 @@ private:
         MV_NO,
         MV_PAGE_UP,
         MV_PAGE_DOWN
-    }  m_ePageMove;
+    } m_ePageMove = MV_NO;
 
     struct CursorStack
     {
@@ -533,7 +533,7 @@ private:
     SwNavigationMgr m_aNavigationMgr;
 
     Point   m_aDest;
-    bool    m_bDestOnStack;
+    bool    m_bDestOnStack = false;
     bool    HasCursorStack() const { return nullptr != m_pCursorStack; }
     SAL_DLLPRIVATE bool  PushCursor(SwTwips lOffset, bool bSelect);
     SAL_DLLPRIVATE bool  PopCursor(bool bUpdate, bool bSelect = false);
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 57fb431a5cc5..6d9a11eeb984 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -107,17 +107,6 @@
 using namespace sw::mark;
 using namespace com::sun::star;
 
-#define COMMON_INI_LIST \
-        m_fnDrag(&SwWrtShell::BeginDrag),\
-        m_fnSetCursor(&SwWrtShell::SetCursor),\
-        m_fnEndDrag(&SwWrtShell::DefaultEndDrag),\
-        m_fnKillSel(&SwWrtShell::Ignore),\
-        m_pModeStack(nullptr), \
-        m_ePageMove(MV_NO),\
-        m_rView(rShell),\
-        m_aNavigationMgr(*this), \
-        m_bDestOnStack(false)
-
 #define BITFLD_INI_LIST \
         m_bClearMark = \
         m_bIns = true;\
@@ -1621,8 +1610,9 @@ void SwWrtShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar )
 // Some kind of controlled copy ctor
 
 SwWrtShell::SwWrtShell( SwWrtShell& rSh, vcl::Window *_pWin, SwView &rShell )
-    : SwFEShell( rSh, _pWin ),
-     COMMON_INI_LIST
+    : SwFEShell(rSh, _pWin)
+    , m_rView(rShell)
+    , m_aNavigationMgr(*this)
 {
     BITFLD_INI_LIST
     SET_CURR_SHELL( this );
@@ -1639,8 +1629,9 @@ SwWrtShell::SwWrtShell( SwWrtShell& rSh, vcl::Window *_pWin, SwView &rShell )
 
 SwWrtShell::SwWrtShell( SwDoc& rDoc, vcl::Window *_pWin, SwView &rShell,
                         const SwViewOption *pViewOpt )
-    : SwFEShell( rDoc, _pWin, pViewOpt),
-      COMMON_INI_LIST
+    : SwFEShell(rDoc, _pWin, pViewOpt)
+    , m_rView(rShell)
+    , m_aNavigationMgr(*this)
 {
     BITFLD_INI_LIST
     SET_CURR_SHELL( this );


More information about the Libreoffice-commits mailing list