diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-30 14:54:47 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-31 10:00:07 +0200 |
commit | 12b4d982c2f0dbebd2380823f3f63fe30e219f09 (patch) | |
tree | b1b1573feffb9a7d2af5edb36549aa657d7b319e /sw | |
parent | f0a563cce1c6e6f6babbe33bc3382d4ad4439754 (diff) |
Get rid of a pointless indirect function pointer variable
Change-Id: I913a6be200b78790f465d2672d6da22a3b8d2b73
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/cshtyp.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/paminit.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/crsr/trvlreg.cxx | 31 | ||||
-rw-r--r-- | sw/source/core/crsr/trvlreg.hxx | 33 | ||||
-rw-r--r-- | sw/source/uibase/shells/txtcrsr.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewmdi.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/move.cxx | 4 |
7 files changed, 9 insertions, 76 deletions
diff --git a/sw/inc/cshtyp.hxx b/sw/inc/cshtyp.hxx index 75962455ab3b..2ac0f69c1fd9 100644 --- a/sw/inc/cshtyp.hxx +++ b/sw/inc/cshtyp.hxx @@ -73,7 +73,9 @@ extern SwPosColumn fnColumnStart, fnColumnEnd; // Direction-parameter for MoveRegion (ranges!) typedef bool (*SwWhichRegion)( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); -extern SwWhichRegion fnRegionPrev, fnRegionCurr, fnRegionNext, fnRegionCurrAndSkip; +bool GotoPrevRegion( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); +bool GotoNextRegion( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); +bool GotoCurrRegionAndSkip( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); extern SwMoveFnCollection const & fnRegionStart; extern SwMoveFnCollection const & fnRegionEnd; diff --git a/sw/source/core/crsr/paminit.cxx b/sw/source/core/crsr/paminit.cxx index e21e7bf5277f..9362d111365c 100644 --- a/sw/source/core/crsr/paminit.cxx +++ b/sw/source/core/crsr/paminit.cxx @@ -19,7 +19,6 @@ #include <pam.hxx> #include <pamtyp.hxx> -#include <trvlreg.hxx> static SwMoveFnCollection aFwrd = { /* fnNd */ &GoNext, @@ -52,10 +51,6 @@ SwMoveFnCollection const & fnSectionEnd = aBwrd; SwMoveFnCollection const & fnTableStart = aFwrd; SwMoveFnCollection const & fnTableEnd = aBwrd; -SwWhichRegion fnRegionPrev = &GotoPrevRegion; -SwWhichRegion fnRegionCurr = &GotoCurrRegion; -SwWhichRegion fnRegionCurrAndSkip = &GotoCurrRegionAndSkip; -SwWhichRegion fnRegionNext = &GotoNextRegion; SwMoveFnCollection const & fnRegionStart = aFwrd; SwMoveFnCollection const & fnRegionEnd = aBwrd; diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx index ccdde1d4e053..447eef2cc6be 100644 --- a/sw/source/core/crsr/trvlreg.cxx +++ b/sw/source/core/crsr/trvlreg.cxx @@ -26,7 +26,6 @@ #include <callnk.hxx> #include <pamtyp.hxx> #include <section.hxx> -#include <trvlreg.hxx> bool GotoPrevRegion( SwPaM& rCurrentCursor, SwMoveFnCollection const & fnPosRegion, bool bInReadOnly ) @@ -135,36 +134,6 @@ bool GotoNextRegion( SwPaM& rCurrentCursor, SwMoveFnCollection const & fnPosRegi return false; } -bool GotoCurrRegion( SwPaM& rCurrentCursor, SwMoveFnCollection const & fnPosRegion, - bool bInReadOnly ) -{ - SwSectionNode* pNd = rCurrentCursor.GetNode().FindSectionNode(); - if( !pNd ) - return false; - - SwPosition* pPos = rCurrentCursor.GetPoint(); - bool bMoveBackward = &fnPosRegion == &fnMoveBackward; - - SwContentNode* pCNd; - if( bMoveBackward ) - { - SwNodeIndex aIdx( *pNd->EndOfSectionNode() ); - pCNd = SwNodes::GoPrevSection( &aIdx, true, !bInReadOnly ); - } - else - { - SwNodeIndex aIdx( *pNd ); - pCNd = pNd->GetNodes().GoNextSection( &aIdx, true, !bInReadOnly ); - } - - if( pCNd ) - { - pPos->nNode = *pCNd; - pPos->nContent.Assign( pCNd, bMoveBackward ? pCNd->Len() : 0 ); - } - return nullptr != pCNd; -} - bool GotoCurrRegionAndSkip( SwPaM& rCurrentCursor, SwMoveFnCollection const & fnPosRegion, bool bInReadOnly ) { diff --git a/sw/source/core/crsr/trvlreg.hxx b/sw/source/core/crsr/trvlreg.hxx deleted file mode 100644 index ea069baf4f77..000000000000 --- a/sw/source/core/crsr/trvlreg.hxx +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SW_SOURCE_CORE_CRSR_TRVLREG_HXX -#define INCLUDED_SW_SOURCE_CORE_CRSR_TRVLREG_HXX - -#include <sal/config.h> - -// Travelling in regions -bool GotoPrevRegion( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); -bool GotoCurrRegion( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); -bool GotoCurrRegionAndSkip( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); -bool GotoNextRegion( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx index b14c08ce1dc5..fa25fd5d8bf8 100644 --- a/sw/source/uibase/shells/txtcrsr.cxx +++ b/sw/source/uibase/shells/txtcrsr.cxx @@ -402,10 +402,10 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) bRet = rSh.MoveTable(GotoNextTable, fnTableStart); break; case FN_GOTO_NEXT_REGION : - bRet = rSh.MoveRegion(fnRegionNext, fnRegionStart); + bRet = rSh.MoveRegion(GotoNextRegion, fnRegionStart); break; case FN_GOTO_PREV_REGION : - bRet = rSh.MoveRegion(fnRegionPrev, fnRegionStart); + bRet = rSh.MoveRegion(GotoPrevRegion, fnRegionStart); break; case FN_NEXT_TOXMARK: bRet = rSh.GotoNxtPrvTOXMark(); diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index 79a66146ecd5..a2d19dfccbe4 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -352,9 +352,9 @@ IMPL_LINK_TYPED( SwView, MoveNavigationHdl, void*, p, void ) case NID_REG : rSh.EnterStdMode(); if(bNext) - rSh.MoveRegion(fnRegionNext, fnRegionStart); + rSh.MoveRegion(GotoNextRegion, fnRegionStart); else - rSh.MoveRegion(fnRegionPrev, fnRegionStart); + rSh.MoveRegion(GotoPrevRegion, fnRegionStart); break; case NID_BKM : diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx index 58ab87399a26..34438bdfb9e5 100644 --- a/sw/source/uibase/wrtsh/move.cxx +++ b/sw/source/uibase/wrtsh/move.cxx @@ -252,7 +252,7 @@ bool SwWrtShell::GoStart( bool bKeepArea, bool *pMoveTable, return true; } // Regions ??? - return SwCursorShell::MoveRegion( fnRegionCurrAndSkip, fnRegionStart ) || + return SwCursorShell::MoveRegion( GotoCurrRegionAndSkip, fnRegionStart ) || SwCursorShell::SttEndDoc(true); } @@ -286,7 +286,7 @@ bool SwWrtShell::GoEnd(bool bKeepArea, bool *pMoveTable) } } // Regions ??? - return SwCursorShell::MoveRegion( fnRegionCurrAndSkip, fnRegionEnd ) || + return SwCursorShell::MoveRegion( GotoCurrRegionAndSkip, fnRegionEnd ) || SwCursorShell::SttEndDoc(false); } |