diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-06 00:38:05 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-07 15:18:07 +0100 |
commit | 2aa9db44759ca5317d455d2f50e1cb1f53e01624 (patch) | |
tree | 30fd8117c6673f08c08bc1b508e05878fa67de69 /sw | |
parent | 823c76994204e43736252ee4f05f9c7c590ff347 (diff) |
loplugin:cstylecast, involving pointer to incomplete type
Change-Id: Idab944f3b9a93258b7f58a33e8a2a2c69448c7d8
Diffstat (limited to 'sw')
-rw-r--r-- | sw/Library_sw.mk | 1 | ||||
-rw-r--r-- | sw/inc/docsh.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentStatisticsManager.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/sw3io/swacorr.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/docsh.cxx | 19 |
6 files changed, 29 insertions, 5 deletions
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk index c4753150a5c8..1b16def25cf8 100644 --- a/sw/Library_sw.mk +++ b/sw/Library_sw.mk @@ -747,6 +747,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\ sw/source/uibase/web/wtextsh \ sw/source/uibase/web/wview \ sw/source/uibase/wrtsh/delete \ + sw/source/uibase/wrtsh/docsh \ sw/source/uibase/wrtsh/move \ sw/source/uibase/wrtsh/navmgr \ sw/source/uibase/wrtsh/select \ diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 53a801c2090f..3b3e0bec921a 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -36,6 +36,7 @@ class SfxDocumentInfoDialog; class SfxStyleSheetBasePool; class SfxInPlaceClient; class FontList; +class SwEditShell; class SwView; class SwWrtShell; class SwFEShell; @@ -218,6 +219,9 @@ public: /// Accress to the SwWrtShell belonging to SwView. SwWrtShell *GetWrtShell() { return mpWrtShell; } const SwWrtShell *GetWrtShell() const { return mpWrtShell; } + // Same as GetWrtShell, but return pointer to SwEditShell base of + // (potentially incomplete) SwWrtShell: + SwEditShell * GetEditShell(); /// For Core - it knows the DocShell but not the WrtShell! SwFEShell *GetFEShell(); diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index ea5c6ada3c05..364ee6da33b3 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -23,6 +23,7 @@ #include <vcl/svapp.hxx> #include <vcl/window.hxx> +#include <editsh.hxx> #include <txatritr.hxx> #include <fldbas.hxx> #include <fmtfld.hxx> @@ -44,8 +45,6 @@ using namespace ::com::sun::star; using namespace util; -OUString *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam ); - static OUString lcl_CleanStr(const SwTxtNode& rNd, sal_Int32 const nStart, sal_Int32& rEnd, std::vector<sal_Int32> &rArr, bool const bRemoveSoftHyphen) @@ -289,7 +288,7 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te } SwDocShell *const pDocShell = pNode->GetDoc()->GetDocShell(); - SwViewShell *const pWrtShell = (pDocShell) ? (SwViewShell*)(pDocShell->GetWrtShell()) : 0; + SwViewShell *const pWrtShell = (pDocShell) ? pDocShell->GetEditShell() : 0; SwPostItMgr *const pPostItMgr = (pWrtShell) ? pWrtShell->GetPostItMgr() : 0; sal_Int32 aStart = 0; diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx index 5017630bb65b..3f6ccb4d5ce0 100644 --- a/sw/source/core/doc/DocumentStatisticsManager.cxx +++ b/sw/source/core/doc/DocumentStatisticsManager.cxx @@ -18,6 +18,7 @@ */ #include <DocumentStatisticsManager.hxx> #include <doc.hxx> +#include <editsh.hxx> #include <fldbas.hxx> #include <docsh.hxx> #include <IDocumentFieldsAccess.hxx> @@ -208,7 +209,7 @@ bool DocumentStatisticsManager::IncrementalDocStatCalculate(long nChars, bool bF const ModifyBlocker_Impl b(pObjShell); // rhbz#1081176: don't jump to cursor pos because of (temporary) // activation of modified flag triggering move to input position - LockAllViews aViewGuard((SwViewShell*)pObjShell->GetWrtShell()); + LockAllViews aViewGuard(pObjShell->GetEditShell()); xDocProps->setDocumentStatistics(aStat); if (!bDocWasModified) { diff --git a/sw/source/core/sw3io/swacorr.cxx b/sw/source/core/sw3io/swacorr.cxx index b08866fe2337..37315e3cb9db 100644 --- a/sw/source/core/sw3io/swacorr.cxx +++ b/sw/source/core/sw3io/swacorr.cxx @@ -83,7 +83,7 @@ bool SwAutoCorrect::PutText( const uno::Reference < embed::XStorage >& rStg, nRet = aBlk.BeginPutDoc( rShort, rShort ); if( !IsError( nRet ) ) { - ((SwEditShell*)rDShell.GetWrtShell())->_CopySelToDoc( pDoc ); + rDShell.GetEditShell()->_CopySelToDoc( pDoc ); nRet = aBlk.PutDoc(); aBlk.AddName ( rShort, rShort, false ); if( !IsError( nRet ) ) diff --git a/sw/source/uibase/wrtsh/docsh.cxx b/sw/source/uibase/wrtsh/docsh.cxx new file mode 100644 index 000000000000..904efeba1169 --- /dev/null +++ b/sw/source/uibase/wrtsh/docsh.cxx @@ -0,0 +1,19 @@ +/* -*- 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/. + */ + +#include <sal/config.h> + +#include <docsh.hxx> +#include <wrtsh.hxx> + +SwEditShell * SwDocShell::GetEditShell() { + return mpWrtShell; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |