summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-08-29 13:50:46 +0300
committerTor Lillqvist <tml@collabora.com>2016-08-29 14:46:59 +0300
commite66fe457ff73520877820ef0c5d35ecffda73105 (patch)
tree2ac36a1c20ebf968120f7f9704306d5428d72b2e
parent74f6d0df265a389f9e0668f322cec183451af2ff (diff)
Get rid of a pointless indirect function pointer variable
Sure, lots of them left. And actually, I don't know, maybe there is some deeper reason why such are used in the sw coding style. Feel free to revert these commits. Change-Id: I5a1c31fe32b3bdf6d40489d029be165c38a8ba05
-rw-r--r--sw/inc/cshtyp.hxx3
-rw-r--r--sw/source/core/crsr/crsrsh.cxx2
-rw-r--r--sw/source/core/crsr/paminit.cxx1
-rw-r--r--sw/source/core/frmedt/fetab.cxx2
-rw-r--r--sw/source/core/inc/pamtyp.hxx1
-rw-r--r--sw/source/core/unocore/unoobj.cxx4
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx8
-rw-r--r--sw/source/uibase/ribbar/inputwin.cxx8
-rw-r--r--sw/source/uibase/wrtsh/move.cxx12
-rw-r--r--sw/source/uibase/wrtsh/select.cxx4
10 files changed, 22 insertions, 23 deletions
diff --git a/sw/inc/cshtyp.hxx b/sw/inc/cshtyp.hxx
index 44d9dcc2b333..1dbe447ce5c4 100644
--- a/sw/inc/cshtyp.hxx
+++ b/sw/inc/cshtyp.hxx
@@ -46,9 +46,10 @@ extern SwPosPara fnParaStart, fnParaEnd;
// Direction-parameter for MoveSection.
typedef SwMoveFnCollection* SwPosSection;
typedef bool (*SwWhichSection)( SwPaM&, SwPosSection );
-extern SwWhichSection fnSectionCurr;
extern SwPosSection fnSectionStart, fnSectionEnd;
+bool GoCurrSection( SwPaM&, SwPosSection);
+
// Direction-parameter for MoveTable
typedef SwMoveFnCollection* SwPosTable;
typedef bool (*SwWhichTable)( SwPaM&, SwPosTable, bool bInReadOnly );
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 2236caf56762..7b501f44e371 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1517,7 +1517,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd )
}
*m_pCurrentCursor->GetPoint() = *m_pCurrentCursor->GetMark();
- (*fnSectionCurr)( *m_pCurrentCursor, fnPosSect );
+ GoCurrSection( *m_pCurrentCursor, fnPosSect );
}
}
diff --git a/sw/source/core/crsr/paminit.cxx b/sw/source/core/crsr/paminit.cxx
index 23cd6cad6031..c36fe9ec2ed1 100644
--- a/sw/source/core/crsr/paminit.cxx
+++ b/sw/source/core/crsr/paminit.cxx
@@ -50,7 +50,6 @@ SwWhichPara fnParaNext = &GoNextPara;
SwPosPara fnParaStart = &aFwrd;
SwPosPara fnParaEnd = &aBwrd;
-SwWhichSection fnSectionCurr = &GoCurrSection;
SwPosSection fnSectionStart = &aFwrd;
SwPosSection fnSectionEnd = &aBwrd;
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 8d19c739f2ab..08de9c18ed86 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -2136,7 +2136,7 @@ static bool lcl_GoTableRow( SwCursorShell* pShell, bool bUp )
// go to beginning end of table box
SwPosSection fnPosSect = bUp ? fnSectionStart : fnSectionEnd;
- pShell->MoveSection( fnSectionCurr, fnPosSect );
+ pShell->MoveSection( GoCurrSection, fnPosSect );
// and go up/down into next content
return bUp ? pShell->Up() : pShell->Down();
diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx
index 0a56ac677829..4588e6cfe59b 100644
--- a/sw/source/core/inc/pamtyp.hxx
+++ b/sw/source/core/inc/pamtyp.hxx
@@ -46,7 +46,6 @@ SwContentNode* GoPreviousNds( SwNodeIndex * pIdx, bool );
bool GoPrevPara( SwPaM&, SwPosPara);
bool GoCurrPara( SwPaM&, SwPosPara);
bool GoNextPara( SwPaM&, SwPosPara);
-bool GoCurrSection( SwPaM&, SwPosSection);
// Typedefiniton fuer Funktionen
typedef bool (*GoNd)( SwNode*, SwIndex*, sal_uInt16 );
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index ff6f37e30085..76f3bc996e9a 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1015,7 +1015,7 @@ SwXTextCursor::gotoStart(sal_Bool Expand) throw (uno::RuntimeException, std::exc
|| (CURSOR_FOOTNOTE== m_pImpl->m_eType)
|| (CURSOR_REDLINE == m_pImpl->m_eType))
{
- rUnoCursor.MoveSection(fnSectionCurr, fnSectionStart);
+ rUnoCursor.MoveSection(GoCurrSection, fnSectionStart);
}
else if (CURSOR_META == m_pImpl->m_eType)
{
@@ -1042,7 +1042,7 @@ SwXTextCursor::gotoEnd(sal_Bool Expand) throw (uno::RuntimeException, std::excep
|| (CURSOR_FOOTNOTE== m_pImpl->m_eType)
|| (CURSOR_REDLINE == m_pImpl->m_eType))
{
- rUnoCursor.MoveSection( fnSectionCurr, fnSectionEnd);
+ rUnoCursor.MoveSection( GoCurrSection, fnSectionEnd);
}
else if (CURSOR_META == m_pImpl->m_eType)
{
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 4990f5c2e346..1c637baec29d 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1640,7 +1640,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
// at the beginning of the table's cell a '=' ->
// call EditRow (F2-functionality)
rSh.Push();
- if( !rSh.MoveSection( fnSectionCurr, fnSectionStart) &&
+ if( !rSh.MoveSection( GoCurrSection, fnSectionStart) &&
!rSh.IsTableBoxTextFormat() )
{
// is at the beginning of the box
@@ -1649,7 +1649,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
rSh.SwapPam();
else
rSh.SttSelect();
- rSh.MoveSection( fnSectionCurr, fnSectionEnd );
+ rSh.MoveSection( GoCurrSection, fnSectionEnd );
rSh.Pop();
rSh.EndSelect();
sFormulaEntry = "=";
@@ -2357,7 +2357,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
rSh.UnSelectFrame();
rSh.LeaveSelFrameMode();
m_rView.AttrChangedNotify(&rSh);
- rSh.MoveSection( fnSectionCurr, fnSectionEnd );
+ rSh.MoveSection( GoCurrSection, fnSectionEnd );
}
eKeyState = KS_InsChar;
}
@@ -2380,7 +2380,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
rSh.UnSelectFrame();
rSh.LeaveSelFrameMode();
m_rView.AttrChangedNotify(&rSh);
- rSh.MoveSection( fnSectionCurr, fnSectionEnd );
+ rSh.MoveSection( GoCurrSection, fnSectionEnd );
eKeyState = KS_End;
}
break;
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index 6d6eb8c2f28a..669457dbf4d1 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -254,9 +254,9 @@ void SwInputWindow::ShowWin()
if( !pWrtShell->SwCursorShell::HasSelection() )
{
- pWrtShell->MoveSection( fnSectionCurr, fnSectionStart );
+ pWrtShell->MoveSection( GoCurrSection, fnSectionStart );
pWrtShell->SetMark();
- pWrtShell->MoveSection( fnSectionCurr, fnSectionEnd );
+ pWrtShell->MoveSection( GoCurrSection, fnSectionEnd );
}
if( pWrtShell->SwCursorShell::HasSelection() )
{
@@ -497,9 +497,9 @@ void SwInputWindow::DelBoxContent()
pWrtShell->ClearMark();
pWrtShell->Pop( false );
pWrtShell->Push();
- pWrtShell->MoveSection( fnSectionCurr, fnSectionStart );
+ pWrtShell->MoveSection( GoCurrSection, fnSectionStart );
pWrtShell->SetMark();
- pWrtShell->MoveSection( fnSectionCurr, fnSectionEnd );
+ pWrtShell->MoveSection( GoCurrSection, fnSectionEnd );
pWrtShell->SwEditShell::Delete();
pWrtShell->EndAllAction();
}
diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx
index 7125044c7d13..f71b3ecd61b2 100644
--- a/sw/source/uibase/wrtsh/move.cxx
+++ b/sw/source/uibase/wrtsh/move.cxx
@@ -204,7 +204,7 @@ bool SwWrtShell::GoStart( bool bKeepArea, bool *pMoveTable,
SttSelect();
}
// Table cell ?
- if ( !bBoxSelection && (MoveSection( fnSectionCurr, fnSectionStart)
+ if ( !bBoxSelection && (MoveSection( GoCurrSection, fnSectionStart)
|| bDontMoveRegion))
{
if ( pMoveTable )
@@ -239,14 +239,14 @@ bool SwWrtShell::GoStart( bool bKeepArea, bool *pMoveTable,
const FrameTypeFlags nFrameType = GetFrameType(nullptr,false);
if ( FrameTypeFlags::FLY_ANY & nFrameType )
{
- if( MoveSection( fnSectionCurr, fnSectionStart ) )
+ if( MoveSection( GoCurrSection, fnSectionStart ) )
return true;
else if ( FrameTypeFlags::FLY_FREE & nFrameType || bDontMoveRegion )
return false;
}
if(( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER | FrameTypeFlags::FOOTNOTE ) & nFrameType )
{
- if ( MoveSection( fnSectionCurr, fnSectionStart ) )
+ if ( MoveSection( GoCurrSection, fnSectionStart ) )
return true;
else if ( bKeepArea )
return true;
@@ -263,7 +263,7 @@ bool SwWrtShell::GoEnd(bool bKeepArea, bool *pMoveTable)
if ( IsCursorInTable() )
{
- if ( MoveSection( fnSectionCurr, fnSectionEnd ) ||
+ if ( MoveSection( GoCurrSection, fnSectionEnd ) ||
MoveTable( fnTableCurr, fnTableEnd ) )
return true;
}
@@ -272,14 +272,14 @@ bool SwWrtShell::GoEnd(bool bKeepArea, bool *pMoveTable)
const FrameTypeFlags nFrameType = GetFrameType(nullptr,false);
if ( FrameTypeFlags::FLY_ANY & nFrameType )
{
- if ( MoveSection( fnSectionCurr, fnSectionEnd ) )
+ if ( MoveSection( GoCurrSection, fnSectionEnd ) )
return true;
else if ( FrameTypeFlags::FLY_FREE & nFrameType )
return false;
}
if(( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER | FrameTypeFlags::FOOTNOTE ) & nFrameType )
{
- if ( MoveSection( fnSectionCurr, fnSectionEnd) )
+ if ( MoveSection( GoCurrSection, fnSectionEnd) )
return true;
else if ( bKeepArea )
return true;
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index 4defb8b64f99..90e5c98b0f0b 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -147,9 +147,9 @@ long SwWrtShell::SelAll()
pEndPos.reset(new SwPosition( *pTmpCursor->GetMark() ));
}
Push();
- bool bIsFullSel = !MoveSection( fnSectionCurr, fnSectionStart);
+ bool bIsFullSel = !MoveSection( GoCurrSection, fnSectionStart);
SwapPam();
- bIsFullSel &= !MoveSection( fnSectionCurr, fnSectionEnd);
+ bIsFullSel &= !MoveSection( GoCurrSection, fnSectionEnd);
Pop(false);
GoStart(true, &bMoveTable, false, !bIsFullSel);
}