diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-30 13:58:14 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-31 10:00:07 +0200 |
commit | 8c0db3e8ac158c8e131085843fcc326073e28c05 (patch) | |
tree | 43ce2bb0c9559d0ea3b3e0e1cd87b871a6595bf6 | |
parent | d562c4e4ead3174a9cc720835ecfbfa16e40e15d (diff) |
Get rid of a pointless indirect function pointer variable
Change-Id: I81055c6973247e226dc9dc3fda072aef94fa8966
-rw-r--r-- | sw/inc/cshtyp.hxx | 6 | ||||
-rw-r--r-- | sw/source/core/access/acctable.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/paminit.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/crsr/trvltbl.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/crsr/trvltbl.hxx | 32 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbinsdlg.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/shells/txtcrsr.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/table/tablemgr.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewmdi.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/move.cxx | 6 |
13 files changed, 25 insertions, 70 deletions
diff --git a/sw/inc/cshtyp.hxx b/sw/inc/cshtyp.hxx index 5615d341780f..ac1761b400f6 100644 --- a/sw/inc/cshtyp.hxx +++ b/sw/inc/cshtyp.hxx @@ -57,7 +57,9 @@ bool GoCurrSection( SwPaM&, SwMoveFnCollection const &); // Direction-parameter for MoveTable typedef bool (*SwWhichTable)( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); -extern SwWhichTable fnTablePrev, fnTableCurr, fnTableNext; +SW_DLLPUBLIC bool GotoPrevTable( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); +SW_DLLPUBLIC bool GotoCurrTable( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); +bool GotoNextTable( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); extern SwMoveFnCollection const & fnTableStart; extern SwMoveFnCollection const & fnTableEnd; @@ -106,8 +108,6 @@ enum class SwDocPositions SW_DLLPUBLIC SwMoveFnCollection const & GetfnParaStart(); SW_DLLPUBLIC SwMoveFnCollection const & GetfnParaEnd(); -SW_DLLPUBLIC SwWhichTable GetfnTablePrev(); -SW_DLLPUBLIC SwWhichTable GetfnTableCurr(); SW_DLLPUBLIC SwMoveFnCollection const & GetfnTableStart(); SW_DLLPUBLIC SwMoveFnCollection const & GetfnTableEnd(); diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx index 7551311f0b42..0402dd153d4e 100644 --- a/sw/source/core/access/acctable.cxx +++ b/sw/source/core/access/acctable.cxx @@ -1538,7 +1538,7 @@ void SAL_CALL SwAccessibleTable::selectAccessibleChild( // Move cursor to the end of the table creating a selection and a table // cursor. pCursorShell->SetMark(); - pCursorShell->MoveTable( fnTableCurr, fnTableEnd ); + pCursorShell->MoveTable( GotoCurrTable, fnTableEnd ); // now set the cursor into the cell again. SwPaM *pPaM = pCursorShell->GetTableCrs() ? pCursorShell->GetTableCrs() : pCursorShell->GetCursor(); @@ -1689,7 +1689,7 @@ void SAL_CALL SwAccessibleTable::deselectAccessibleChild( // Move cursor to the end of the table creating a selection and a table // cursor. pCursorShell->SetMark(); - pCursorShell->MoveTable( fnTableCurr, fnTableEnd ); + pCursorShell->MoveTable( GotoCurrTable, fnTableEnd ); // now set the cursor into the cell again. pPaM = pCursorShell->GetTableCrs() ? pCursorShell->GetTableCrs() : pCursorShell->GetCursor(); diff --git a/sw/source/core/crsr/paminit.cxx b/sw/source/core/crsr/paminit.cxx index a296b9b4102b..e21e7bf5277f 100644 --- a/sw/source/core/crsr/paminit.cxx +++ b/sw/source/core/crsr/paminit.cxx @@ -20,7 +20,6 @@ #include <pam.hxx> #include <pamtyp.hxx> #include <trvlreg.hxx> -#include <trvltbl.hxx> static SwMoveFnCollection aFwrd = { /* fnNd */ &GoNext, @@ -50,9 +49,6 @@ SwMoveFnCollection const & fnParaEnd = aBwrd; SwMoveFnCollection const & fnSectionStart = aFwrd; SwMoveFnCollection const & fnSectionEnd = aBwrd; -SwWhichTable fnTablePrev = &GotoPrevTable; -SwWhichTable fnTableCurr = &GotoCurrTable; -SwWhichTable fnTableNext = &GotoNextTable; SwMoveFnCollection const & fnTableStart = aFwrd; SwMoveFnCollection const & fnTableEnd = aBwrd; @@ -70,10 +66,6 @@ SwMoveFnCollection const & GetfnParaStart() { return fnParaStart; } -SwWhichTable GetfnTablePrev() -{ - return fnTablePrev; -} SwMoveFnCollection const & GetfnParaEnd() { return fnParaEnd; @@ -82,10 +74,6 @@ SwMoveFnCollection const & GetfnTableStart() { return fnTableStart; } -SwWhichTable GetfnTableCurr() -{ - return fnTableCurr; -} SwMoveFnCollection const & GetfnTableEnd() { return fnTableEnd; diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index f56b196c83f9..9c8f17454704 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -37,7 +37,6 @@ #include <cellatr.hxx> #include <cellfrm.hxx> #include <rowfrm.hxx> -#include <trvltbl.hxx> #include <IDocumentLayoutAccess.hxx> /// set cursor into next/previous cell diff --git a/sw/source/core/crsr/trvltbl.hxx b/sw/source/core/crsr/trvltbl.hxx deleted file mode 100644 index 51ad4206e519..000000000000 --- a/sw/source/core/crsr/trvltbl.hxx +++ /dev/null @@ -1,32 +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_TRVLTBL_HXX -#define INCLUDED_SW_SOURCE_CORE_CRSR_TRVLTBL_HXX - -#include <sal/config.h> - -// Travelling in tables -bool GotoPrevTable( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); -bool GotoCurrTable( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); -bool GotoNextTable( SwPaM&, SwMoveFnCollection const &, bool bInReadOnly ); - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 6c71f8efe400..4e92529ff215 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1607,7 +1607,7 @@ void SwXTextTableCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeExceptio SwUnoCursor& rUnoCursor = GetCursor(); SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); lcl_CursorSelect(rTableCursor, bExpand); - rTableCursor.MoveTable(fnTableCurr, fnTableStart); + rTableCursor.MoveTable(GotoCurrTable, fnTableStart); } void SwXTextTableCursor::gotoEnd(sal_Bool bExpand) throw( uno::RuntimeException, std::exception ) @@ -1616,7 +1616,7 @@ void SwXTextTableCursor::gotoEnd(sal_Bool bExpand) throw( uno::RuntimeException, SwUnoCursor& rUnoCursor = GetCursor(); SwUnoTableCursor& rTableCursor = dynamic_cast<SwUnoTableCursor&>(rUnoCursor); lcl_CursorSelect(rTableCursor, bExpand); - rTableCursor.MoveTable(fnTableCurr, fnTableEnd); + rTableCursor.MoveTable(GotoCurrTable, fnTableEnd); } sal_Bool SwXTextTableCursor::mergeRange() diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 279f96354025..d8f0546ed873 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1036,7 +1036,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, rSh.InsertTable( pModOpt->GetInsTableFlags(bHTML), nRows, nCols, text::HoriOrientation::FULL, (pSelection ? pTAutoFormat : nullptr) ); - rSh.MoveTable( GetfnTablePrev(), GetfnTableStart() ); + rSh.MoveTable( GotoPrevTable, GetfnTableStart() ); if( pSelection && pTableSet ) SetTabSet(); @@ -1173,7 +1173,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, pWait.reset(new SwWait( *pView->GetDocShell(), true )); } - rSh.MoveTable( GetfnTableCurr(), GetfnTableStart() ); + rSh.MoveTable( GotoCurrTable, GetfnTableStart() ); if( !pSelection && ( pTableSet || pTAutoFormat )) { if( pTableSet ) @@ -1462,14 +1462,14 @@ void SwInsertDBColAutoPilot::SetTabSet() rSh.GetTableFormat()->GetName() ) pTableSet->ClearItem( FN_PARAM_TABLE_NAME ); - rSh.MoveTable( GetfnTableCurr(), GetfnTableStart() ); + rSh.MoveTable( GotoCurrTable, GetfnTableStart() ); rSh.SetMark(); - rSh.MoveTable( GetfnTableCurr(), GetfnTableEnd() ); + rSh.MoveTable( GotoCurrTable, GetfnTableEnd() ); ItemSetToTableParam( *pTableSet, rSh ); rSh.ClearMark(); - rSh.MoveTable( GetfnTableCurr(), GetfnTableStart() ); + rSh.MoveTable( GotoCurrTable, GetfnTableStart() ); } DB_ColumnConfigData::~DB_ColumnConfigData() {} diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 7c281a5a4721..3293dae098a5 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2685,7 +2685,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) rSh.DelRight(); rSh.InsertTable( aInsTableOpts, nRows, nCols, text::HoriOrientation::FULL, pTAFormat ); - rSh.MoveTable( fnTablePrev, fnTableStart ); + rSh.MoveTable( GotoPrevTable, fnTableStart ); if( !aTableName.isEmpty() && !rSh.GetTableStyle( aTableName ) ) rSh.GetTableFormat()->SetName( aTableName ); diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 0f8353475cd8..132b91ca3784 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -724,11 +724,11 @@ void SwTableShell::Execute(SfxRequest &rReq) bCallDone = true; break; case FN_END_TABLE: - rSh.MoveTable( fnTableCurr, fnTableEnd ); + rSh.MoveTable( GotoCurrTable, fnTableEnd ); bCallDone = true; break; case FN_START_TABLE: - rSh.MoveTable( fnTableCurr, fnTableStart ); + rSh.MoveTable( GotoCurrTable, fnTableStart ); bCallDone = true; break; case FN_GOTO_NEXT_CELL: @@ -793,9 +793,9 @@ void SwTableShell::Execute(SfxRequest &rReq) break; case FN_TABLE_SELECT_ALL: rSh.EnterStdMode(); - rSh.MoveTable( fnTableCurr, fnTableStart ); + rSh.MoveTable( GotoCurrTable, fnTableStart ); rSh.SttSelect(); - rSh.MoveTable( fnTableCurr, fnTableEnd ); + rSh.MoveTable( GotoCurrTable, fnTableEnd ); rSh.EndSelect(); bCallDone = true; break; diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx index 3319993658d9..b14c08ce1dc5 100644 --- a/sw/source/uibase/shells/txtcrsr.cxx +++ b/sw/source/uibase/shells/txtcrsr.cxx @@ -396,10 +396,10 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) rSh.GotoFootnoteText(); break; case FN_PREV_TABLE: - bRet = rSh.MoveTable( fnTablePrev, fnTableStart); + bRet = rSh.MoveTable( GotoPrevTable, fnTableStart); break; case FN_NEXT_TABLE: - bRet = rSh.MoveTable(fnTableNext, fnTableStart); + bRet = rSh.MoveTable(GotoNextTable, fnTableStart); break; case FN_GOTO_NEXT_REGION : bRet = rSh.MoveRegion(fnRegionNext, fnRegionStart); diff --git a/sw/source/uibase/table/tablemgr.cxx b/sw/source/uibase/table/tablemgr.cxx index e9fb41e674d5..b2e7cd076a66 100644 --- a/sw/source/uibase/table/tablemgr.cxx +++ b/sw/source/uibase/table/tablemgr.cxx @@ -204,7 +204,7 @@ uno::Reference< frame::XModel > SwTableFUNC::InsertChart( { aName = pSh->GetTableFormat()->GetName(); // insert node before table - pSh->MoveTable( fnTableCurr, fnTableStart ); + pSh->MoveTable( GotoCurrTable, fnTableStart ); pSh->Up( false ); if ( pSh->IsCursorInTable() ) { diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index 1cd00ba5aec7..79a66146ecd5 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -319,9 +319,9 @@ IMPL_LINK_TYPED( SwView, MoveNavigationHdl, void*, p, void ) case NID_TBL : rSh.EnterStdMode(); if(bNext) - rSh.MoveTable(fnTableNext, fnTableStart); + rSh.MoveTable(GotoNextTable, fnTableStart); else - rSh.MoveTable(fnTablePrev, fnTableStart); + rSh.MoveTable(GotoPrevTable, fnTableStart); break; case NID_FRM : case NID_GRF: diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx index f859747361aa..3aedea42a4d5 100644 --- a/sw/source/uibase/wrtsh/move.cxx +++ b/sw/source/uibase/wrtsh/move.cxx @@ -211,7 +211,7 @@ bool SwWrtShell::GoStart( bool bKeepArea, bool *pMoveTable, *pMoveTable = false; return true; } - if( MoveTable( fnTableCurr, fnTableStart ) || bDontMoveRegion ) + if( MoveTable( GotoCurrTable, fnTableStart ) || bDontMoveRegion ) { if ( pMoveTable ) *pMoveTable = true; @@ -259,12 +259,12 @@ bool SwWrtShell::GoStart( bool bKeepArea, bool *pMoveTable, bool SwWrtShell::GoEnd(bool bKeepArea, bool *pMoveTable) { if ( pMoveTable && *pMoveTable ) - return MoveTable( fnTableCurr, fnTableEnd ); + return MoveTable( GotoCurrTable, fnTableEnd ); if ( IsCursorInTable() ) { if ( MoveSection( GoCurrSection, fnSectionEnd ) || - MoveTable( fnTableCurr, fnTableEnd ) ) + MoveTable( GotoCurrTable, fnTableEnd ) ) return true; } else |