From dac4ca5f682fdd0c3eee7f7ee1d98c9b3c8b7ce4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 25 Jun 2014 14:57:44 +0200 Subject: new loplugin: externalandnotdefined Find "missing headers," where a function is declared directly in the .cxx (as extern) and not defined, and should arguably instead be declared in an include file. Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2 --- basic/inc/sb.hxx | 2 ++ basic/source/classes/sbunoobj.cxx | 21 ++++++++++----------- basic/source/classes/sbxmod.cxx | 19 ++++++++----------- basic/source/comp/dim.cxx | 2 -- basic/source/inc/sbunoobj.hxx | 3 +++ basic/source/inc/sbxmod.hxx | 27 +++++++++++++++++++++++++++ basic/source/runtime/methods.cxx | 4 +--- 7 files changed, 51 insertions(+), 27 deletions(-) create mode 100644 basic/source/inc/sbxmod.hxx (limited to 'basic') diff --git a/basic/inc/sb.hxx b/basic/inc/sb.hxx index cd028f7985dc..ce78553c8071 100644 --- a/basic/inc/sb.hxx +++ b/basic/inc/sb.hxx @@ -31,6 +31,8 @@ // create object from user-type (+StringID+StringID) SbxObject* createUserTypeImpl( const OUString& rClassName ); +SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ); + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 1d8dc31c75c7..2e6aa8f75391 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -72,17 +72,6 @@ #include -using com::sun::star::uno::Reference; -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; -using namespace com::sun::star::reflection; -using namespace com::sun::star::beans; -using namespace com::sun::star::script; -using namespace com::sun::star::container; -using namespace com::sun::star::bridge; -using namespace cppu; - - #include #include #include @@ -98,6 +87,16 @@ using namespace cppu; #include #include +using com::sun::star::uno::Reference; +using namespace com::sun::star::uno; +using namespace com::sun::star::lang; +using namespace com::sun::star::reflection; +using namespace com::sun::star::beans; +using namespace com::sun::star::script; +using namespace com::sun::star::container; +using namespace com::sun::star::bridge; +using namespace cppu; + TYPEINIT1(SbUnoMethod,SbxMethod) TYPEINIT1(SbUnoProperty,SbxProperty) TYPEINIT1(SbUnoObject,SbxObject) diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 7102950e068f..c8b2090236c7 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -55,8 +55,6 @@ #include #include -using namespace com::sun::star; - #ifdef UNX #include #endif @@ -71,13 +69,6 @@ using namespace com::sun::star; #include #include -using namespace ::com::sun::star; -using namespace com::sun::star::lang; -using namespace com::sun::star::reflection; -using namespace com::sun::star::beans; -using namespace com::sun::star::script; -using namespace com::sun::star::uno; - #include #include #include @@ -86,6 +77,14 @@ using namespace com::sun::star::uno; #include #include #include "sbcomp.hxx" +#include "sbxmod.hxx" + +using namespace com::sun::star; +using namespace com::sun::star::lang; +using namespace com::sun::star::reflection; +using namespace com::sun::star::beans; +using namespace com::sun::star::script; +using namespace com::sun::star::uno; typedef ::cppu::WeakImplHelper1< XInvocation > DocObjectWrapper_BASE; typedef ::std::map< sal_Int16, Any, ::std::less< sal_Int16 > > OutParamMap; @@ -2662,8 +2661,6 @@ void SbUserFormModule::Unload() } -void registerComponentToBeDisposedForBasic( Reference< XComponent > xComponent, StarBASIC* pBasic ); - void SbUserFormModule::InitObject() { try diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index 58db8ffdcaf5..e5e4c162bcda 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -34,8 +34,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ); - // Declaration of a variable // If there are errors it will be parsed up to the comma or the newline. // Return-value: a new instance, which were inserted and then deleted. diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx index 29033ff984c6..aa5c2f981b28 100644 --- a/basic/source/inc/sbunoobj.hxx +++ b/basic/source/inc/sbunoobj.hxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,8 @@ #include #include +void registerComponentToBeDisposedForBasic( css::uno::Reference< css::lang::XComponent > xComponent, StarBASIC* pBasic ); + class StructRefInfo { com::sun::star::uno::Any& maAny; diff --git a/basic/source/inc/sbxmod.hxx b/basic/source/inc/sbxmod.hxx new file mode 100644 index 000000000000..3784c7fe045d --- /dev/null +++ b/basic/source/inc/sbxmod.hxx @@ -0,0 +1,27 @@ +/* -*- 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_BASIC_SOURCE_INC_SBXMOD_HXX +#define INCLUDED_BASIC_SOURCE_INC_SBXMOD_HXX + +css::uno::Reference< css::frame::XModel > getDocumentModel( StarBASIC* ); + +#endif // INCLUDED_BASIC_SOURCE_INC_SBXMOD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 95ac76ea9306..3397f56d8f0b 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -85,6 +85,7 @@ using namespace com::sun::star::uno; #include #include "sbobjmod.hxx" +#include "sbxmod.hxx" #ifdef WNT #include @@ -95,9 +96,6 @@ using namespace com::sun::star::uno; #ifndef DISABLE_SCRIPTING -// from source/classes/sbxmod.cxx -uno::Reference< frame::XModel > getDocumentModel( StarBASIC* ); - static void FilterWhiteSpace( OUString& rStr ) { if (rStr.isEmpty()) -- cgit