From d11ac6045926d4c6e392b3797939fbb7c7d37b27 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 14 Oct 2016 16:55:51 +0200 Subject: clang-cl loplugin: extensions Change-Id: I659d8a3b098c7417235006c86ea60e7fe1e56a44 Reviewed-on: https://gerrit.libreoffice.org/29867 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- extensions/source/update/check/onlinecheck.cxx | 4 +++- extensions/source/update/check/onlinecheck.hxx | 33 ++++++++++++++++++++++++++ extensions/source/update/check/updatecheck.cxx | 7 ++---- 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 extensions/source/update/check/onlinecheck.hxx (limited to 'extensions/source/update') diff --git a/extensions/source/update/check/onlinecheck.cxx b/extensions/source/update/check/onlinecheck.cxx index 9324ff7699b5..3207647447f0 100644 --- a/extensions/source/update/check/onlinecheck.cxx +++ b/extensions/source/update/check/onlinecheck.cxx @@ -24,6 +24,8 @@ #include #include +#include + #define WIN32_LEAN_AND_MEAN #include #include @@ -48,7 +50,7 @@ extern "C" bool SAL_CALL WNT_hasInternetConnection() SAL_N_ELEMENTS(szConnectionName), 0 ); - return fIsConnected ? true : false; + return fIsConnected; #ifndef __MINGW32__ } __except( EXCEPTION_EXECUTE_HANDLER ) { diff --git a/extensions/source/update/check/onlinecheck.hxx b/extensions/source/update/check/onlinecheck.hxx new file mode 100644 index 000000000000..731d3e6c2cbb --- /dev/null +++ b/extensions/source/update/check/onlinecheck.hxx @@ -0,0 +1,33 @@ +/* -*- 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_EXTENSIONS_SOURCE_UPDATE_CHECK_ONLINECHECK_HXX +#define INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_ONLINECHECK_HXX + +#include + +#include + +#if defined(_WIN32) +extern "C" bool SAL_CALL WNT_hasInternetConnection(); +#endif + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index 7bee406f8b2d..437af2a3d541 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -53,6 +53,7 @@ #endif #endif +#include #include "updateprotocol.hxx" #include "updatecheckconfig.hxx" @@ -70,10 +71,6 @@ namespace uno = com::sun::star::uno ; #define PROPERTY_CLICK_HDL "MenuClickHDL" #define PROPERTY_SHOW_MENUICON "MenuIconVisible" -#if defined(_WIN32) -extern "C" bool SAL_CALL WNT_hasInternetConnection(); -#endif - // Returns the URL of the release note for the given position OUString getReleaseNote(const UpdateInfo& rInfo, sal_uInt8 pos, bool autoDownloadEnabled) { @@ -606,7 +603,7 @@ DownloadThread::run() #ifdef _WIN32 CoUninitialize(); - CoInitialize( NULL ); + CoInitialize( nullptr ); #endif while( schedule() ) -- cgit