summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-30 13:20:34 +0200
committerNoel Grandin <noel@peralex.com>2016-08-31 10:00:07 +0200
commitd562c4e4ead3174a9cc720835ecfbfa16e40e15d (patch)
treec83bf98cd678493190937c19dda62c993849fd99 /sw/source/core
parent7bf9abffb69966882feecca4b35a04722e5b7822 (diff)
Get rid of a pointless indirect function pointer variable
Change-Id: I542a5fb00a5c972230c072d72a745fddb095f708
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/crsr/paminit.cxx7
-rw-r--r--sw/source/core/crsr/swcrsr.cxx6
-rw-r--r--sw/source/core/inc/pamtyp.hxx5
-rw-r--r--sw/source/core/unocore/unoobj.cxx26
-rw-r--r--sw/source/core/unocore/unoobj2.cxx4
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx14
-rw-r--r--sw/source/core/unocore/unotext.cxx8
7 files changed, 29 insertions, 41 deletions
diff --git a/sw/source/core/crsr/paminit.cxx b/sw/source/core/crsr/paminit.cxx
index 47879a97672f..a296b9b4102b 100644
--- a/sw/source/core/crsr/paminit.cxx
+++ b/sw/source/core/crsr/paminit.cxx
@@ -44,9 +44,6 @@ static SwMoveFnCollection aBwrd = {
/* fnSection */ &SwNodes::GoEndOfSection
};
-SwWhichPara fnParaPrev = &GoPrevPara;
-SwWhichPara fnParaCurr = &GoCurrPara;
-SwWhichPara fnParaNext = &GoNextPara;
SwMoveFnCollection const & fnParaStart = aFwrd;
SwMoveFnCollection const & fnParaEnd = aBwrd;
@@ -69,10 +66,6 @@ SwMoveFnCollection const & fnRegionEnd = aBwrd;
SwMoveFnCollection const & fnMoveBackward = aBwrd;
SwMoveFnCollection const & fnMoveForward = aFwrd;
-SwWhichPara GetfnParaCurr()
-{
- return fnParaCurr;
-}
SwMoveFnCollection const & GetfnParaStart()
{
return fnParaStart;
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 484b0be0a000..1eb2c3ea48a7 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -2037,10 +2037,10 @@ bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwMoveFnCollection const & fnPo
// for optimization test something before
const SwNode* pNd = &GetPoint()->nNode.GetNode();
bool bShortCut = false;
- if ( fnWhichPara == fnParaCurr )
+ if ( fnWhichPara == GoCurrPara )
{
// #i41048#
- // If fnWhichPara == fnParaCurr then (*fnWhichPara)( *this, fnPosPara )
+ // If fnWhichPara == GoCurrPara then (*fnWhichPara)( *this, fnPosPara )
// can already move the cursor to a different text node. In this case
// we better check if IsSelOvr().
const SwContentNode* pContentNd = pNd->GetContentNode();
@@ -2055,7 +2055,7 @@ bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwMoveFnCollection const & fnPo
{
if ( pNd->IsTextNode() &&
pNd->GetNodes()[ pNd->GetIndex() +
- (fnWhichPara == fnParaNext ? 1 : -1 ) ]->IsTextNode() )
+ (fnWhichPara == GoNextPara ? 1 : -1 ) ]->IsTextNode() )
bShortCut = true;
}
diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx
index 3e02c997ccb3..9b5bd95c5b92 100644
--- a/sw/source/core/inc/pamtyp.hxx
+++ b/sw/source/core/inc/pamtyp.hxx
@@ -42,11 +42,6 @@ bool GoPrevious(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode );
SW_DLLPUBLIC SwContentNode* GoNextNds( SwNodeIndex * pIdx, bool );
SwContentNode* GoPreviousNds( SwNodeIndex * pIdx, bool );
-// Funktionsdefinitionen fuer die SwCursorShell
-bool GoPrevPara( SwPaM&, SwMoveFnCollection const &);
-bool GoCurrPara( SwPaM&, SwMoveFnCollection const &);
-bool GoNextPara( SwPaM&, SwMoveFnCollection const &);
-
// Typedefiniton fuer Funktionen
typedef bool (*GoNd)( SwNode*, SwIndex*, sal_uInt16 );
typedef SwContentNode* (*GoNds)( SwNodeIndex*, bool );
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 76f3bc996e9a..1a17693d3dcc 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1249,7 +1249,7 @@ SwXTextCursor::gotoNextWord(sal_Bool Expand) throw (uno::RuntimeException, std::
// try to go to the start of the next paragraph
if (!bTmp)
{
- rUnoCursor.MovePara(fnParaNext, fnParaStart);
+ rUnoCursor.MovePara(GoNextPara, fnParaStart);
}
}
@@ -1436,7 +1436,7 @@ SwXTextCursor::gotoNextSentence(sal_Bool Expand) throw (uno::RuntimeException, s
bool bRet = rUnoCursor.GoSentence(SwCursor::NEXT_SENT);
if (!bRet)
{
- bRet = rUnoCursor.MovePara(fnParaNext, fnParaStart);
+ bRet = rUnoCursor.MovePara(GoNextPara, fnParaStart);
}
// if at the end of the sentence (i.e. at the space after the '.')
@@ -1471,10 +1471,10 @@ throw (uno::RuntimeException, std::exception)
bool bRet = rUnoCursor.GoSentence(SwCursor::PREV_SENT);
if (!bRet)
{
- bRet = rUnoCursor.MovePara(fnParaPrev, fnParaStart);
+ bRet = rUnoCursor.MovePara(GoPrevPara, fnParaStart);
if (bRet)
{
- rUnoCursor.MovePara(fnParaCurr, fnParaEnd);
+ rUnoCursor.MovePara(GoCurrPara, fnParaEnd);
// at the end of a paragraph move to the sentence end again
rUnoCursor.GoSentence(SwCursor::PREV_SENT);
}
@@ -1526,7 +1526,7 @@ SwXTextCursor::gotoEndOfSentence(sal_Bool Expand) throw (uno::RuntimeException,
bool bAlreadyParaEnd = SwUnoCursorHelper::IsEndOfPara(rUnoCursor);
bool bRet = !bAlreadyParaEnd
&& (rUnoCursor.GoSentence(SwCursor::END_SENT)
- || rUnoCursor.MovePara(fnParaCurr, fnParaEnd));
+ || rUnoCursor.MovePara(GoCurrPara, fnParaEnd));
if (CURSOR_META == m_pImpl->m_eType)
{
bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText,
@@ -1574,10 +1574,10 @@ throw (uno::RuntimeException, std::exception)
bool bRet = SwUnoCursorHelper::IsStartOfPara(rUnoCursor);
if (!bRet)
{
- bRet = rUnoCursor.MovePara(fnParaCurr, fnParaStart);
+ bRet = rUnoCursor.MovePara(GoCurrPara, fnParaStart);
}
- // since MovePara(fnParaCurr, fnParaStart) only returns false
+ // since MovePara(GoCurrPara, fnParaStart) only returns false
// if we were already at the start of the paragraph this function
// should always complete successfully.
OSL_ENSURE( bRet, "gotoStartOfParagraph failed" );
@@ -1599,10 +1599,10 @@ SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw (uno::RuntimeException,
bool bRet = SwUnoCursorHelper::IsEndOfPara(rUnoCursor);
if (!bRet)
{
- bRet = rUnoCursor.MovePara(fnParaCurr, fnParaEnd);
+ bRet = rUnoCursor.MovePara(GoCurrPara, fnParaEnd);
}
- // since MovePara(fnParaCurr, fnParaEnd) only returns false
+ // since MovePara(GoCurrPara, fnParaEnd) only returns false
// if we were already at the end of the paragraph this function
// should always complete successfully.
OSL_ENSURE( bRet, "gotoEndOfParagraph failed" );
@@ -1621,7 +1621,7 @@ SwXTextCursor::gotoNextParagraph(sal_Bool Expand) throw (uno::RuntimeException,
return false;
}
SwUnoCursorHelper::SelectPam(rUnoCursor, Expand);
- const bool bRet = rUnoCursor.MovePara(fnParaNext, fnParaStart);
+ const bool bRet = rUnoCursor.MovePara(GoNextPara, fnParaStart);
return bRet;
}
@@ -1638,7 +1638,7 @@ throw (uno::RuntimeException, std::exception)
return false;
}
SwUnoCursorHelper::SelectPam(rUnoCursor, Expand);
- const bool bRet = rUnoCursor.MovePara(fnParaPrev, fnParaStart);
+ const bool bRet = rUnoCursor.MovePara(GoPrevPara, fnParaStart);
return bRet;
}
@@ -2002,14 +2002,14 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
auto pTemp ( rDoc.CreateUnoCursor(aStart) );
if(!SwUnoCursorHelper::IsStartOfPara(*pTemp))
{
- pTemp->MovePara(fnParaCurr, fnParaStart);
+ pTemp->MovePara(GoCurrPara, fnParaStart);
}
pTemp->SetMark();
*pTemp->GetPoint() = aEnd;
SwUnoCursorHelper::SelectPam(*pTemp, true);
if(!SwUnoCursorHelper::IsEndOfPara(*pTemp))
{
- pTemp->MovePara(fnParaCurr, fnParaEnd);
+ pTemp->MovePara(GoCurrPara, fnParaEnd);
}
rDoc.ResetAttrs(*pTemp, true, rWhichIds);
}
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index f05434a718d8..61f3f9951a6e 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -593,7 +593,7 @@ SwXParagraphEnumerationImpl::NextElement_Impl() throw (container::NoSuchElementE
}
else
{
- aNewCursor->MovePara(fnParaNext, fnParaStart);
+ aNewCursor->MovePara(GoNextPara, fnParaStart);
}
if (m_nEndIndex < aNewCursor->Start()->nNode.GetIndex())
{
@@ -625,7 +625,7 @@ SwXParagraphEnumerationImpl::NextElement_Impl() throw (container::NoSuchElementE
// before AND after the movement...
if (lcl_CursorIsInSection( &rUnoCursor, m_pOwnStartNode ) &&
(m_bFirstParagraph || bInTable ||
- (rUnoCursor.MovePara(fnParaNext, fnParaStart) &&
+ (rUnoCursor.MovePara(GoNextPara, fnParaStart) &&
lcl_CursorIsInSection( &rUnoCursor, m_pOwnStartNode ))))
{
SwPosition* pStart = rUnoCursor.Start();
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 301f60a2c4c3..5715ac07e2bb 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -75,13 +75,13 @@ SwParaSelection::SwParaSelection(SwCursor & rCursor)
// is it at the start?
if (m_rCursor.GetPoint()->nContent != 0)
{
- m_rCursor.MovePara(fnParaCurr, fnParaStart);
+ m_rCursor.MovePara(GoCurrPara, fnParaStart);
}
// or at the end already?
if (m_rCursor.GetPoint()->nContent != m_rCursor.GetContentNode()->Len())
{
m_rCursor.SetMark();
- m_rCursor.MovePara(fnParaCurr, fnParaEnd);
+ m_rCursor.MovePara(GoCurrPara, fnParaEnd);
}
}
@@ -90,7 +90,7 @@ SwParaSelection::~SwParaSelection()
if (m_rCursor.GetPoint()->nContent != 0)
{
m_rCursor.DeleteMark();
- m_rCursor.MovePara(fnParaCurr, fnParaStart);
+ m_rCursor.MovePara(GoCurrPara, fnParaStart);
}
}
@@ -1180,7 +1180,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
auto pTemp( aCursor.GetDoc()->CreateUnoCursor(aStart) );
if(!SwUnoCursorHelper::IsStartOfPara(*pTemp))
{
- pTemp->MovePara(fnParaCurr, fnParaStart);
+ pTemp->MovePara(GoCurrPara, fnParaStart);
}
pTemp->SetMark();
@@ -1190,7 +1190,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
if (!SwUnoCursorHelper::IsEndOfPara(*pTemp))
{
- pTemp->MovePara(fnParaCurr, fnParaEnd);
+ pTemp->MovePara(GoCurrPara, fnParaEnd);
}
@@ -1399,11 +1399,11 @@ throw (uno::RuntimeException, std::exception)
SwPosition aPos( *pTextNode );
SwCursor aCursor( aPos, nullptr );
if (!SwUnoCursorHelper::IsStartOfPara(aCursor)) {
- aCursor.MovePara(fnParaCurr, fnParaStart);
+ aCursor.MovePara(GoCurrPara, fnParaStart);
}
SwUnoCursorHelper::SelectPam(aCursor, true);
if (pTextNode->GetText().getLength()) {
- aCursor.MovePara(fnParaCurr, fnParaEnd);
+ aCursor.MovePara(GoCurrPara, fnParaEnd);
}
SwUnoCursorHelper::SetString(aCursor, aString);
SwUnoCursorHelper::SelectPam(aCursor, false);
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 24d0822ad9a9..354c481dbc73 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1617,9 +1617,9 @@ SwXText::convertToTextFrame(
SwCursor aDelete(*aStartPam.GetPoint(), nullptr);
*aStartPam.GetPoint() = // park it because node is deleted
SwPosition(GetDoc()->GetNodes().GetEndOfContent());
- aDelete.MovePara(fnParaCurr, fnParaStart);
+ aDelete.MovePara(GoCurrPara, fnParaStart);
aDelete.SetMark();
- aDelete.MovePara(fnParaCurr, fnParaEnd);
+ aDelete.MovePara(GoCurrPara, fnParaEnd);
GetDoc()->getIDocumentContentOperations().DelFullPara(aDelete);
}
if (bParaAfterInserted)
@@ -1627,9 +1627,9 @@ SwXText::convertToTextFrame(
SwCursor aDelete(*pEndPam->GetPoint(), nullptr);
*pEndPam->GetPoint() = // park it because node is deleted
SwPosition(GetDoc()->GetNodes().GetEndOfContent());
- aDelete.MovePara(fnParaCurr, fnParaStart);
+ aDelete.MovePara(GoCurrPara, fnParaStart);
aDelete.SetMark();
- aDelete.MovePara(fnParaCurr, fnParaEnd);
+ aDelete.MovePara(GoCurrPara, fnParaEnd);
GetDoc()->getIDocumentContentOperations().DelFullPara(aDelete);
}
throw lang::IllegalArgumentException();