From 213311524eb7f95796ede6ed92c01fb7cf8a2760 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 26 Jan 2022 17:55:10 +0100 Subject: [PATCH] Image: modernize C++11 * remove redundant void-arg * use nullptr * replace deprecated headers --- src/Mod/Image/App/ImagePlane.cpp | 2 +- src/Mod/Image/App/ImagePlane.h | 4 ++-- src/Mod/Image/Gui/AppImageGui.cpp | 4 ++-- src/Mod/Image/Gui/AppImageGuiPy.cpp | 2 +- src/Mod/Image/Gui/CMakeLists.txt | 4 ++-- src/Mod/Image/Gui/Command.cpp | 6 +++--- src/Mod/Image/Gui/ImageView.cpp | 2 +- src/Mod/Image/Gui/ViewProviderImagePlane.cpp | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Mod/Image/App/ImagePlane.cpp b/src/Mod/Image/App/ImagePlane.cpp index c131811e5b..cfdbd96ae4 100644 --- a/src/Mod/Image/App/ImagePlane.cpp +++ b/src/Mod/Image/App/ImagePlane.cpp @@ -38,7 +38,7 @@ PROPERTY_SOURCE(Image::ImagePlane, App::GeoFeature) ImagePlane::ImagePlane() { - ADD_PROPERTY_TYPE( ImageFile,(0) , "ImagePlane",Prop_None,"File of the image"); + ADD_PROPERTY_TYPE( ImageFile,(nullptr) , "ImagePlane",Prop_None,"File of the image"); ADD_PROPERTY_TYPE( XSize, (100), "ImagePlane",Prop_None,"Size of a pixel in X"); ADD_PROPERTY_TYPE( YSize, (100), "ImagePlane",Prop_None,"Size of a pixel in Y"); } diff --git a/src/Mod/Image/App/ImagePlane.h b/src/Mod/Image/App/ImagePlane.h index 22a462f840..1e6dad1110 100644 --- a/src/Mod/Image/App/ImagePlane.h +++ b/src/Mod/Image/App/ImagePlane.h @@ -38,7 +38,7 @@ class ImageExport ImagePlane : public App::GeoFeature public: /// Constructor - ImagePlane(void); + ImagePlane(); virtual ~ImagePlane(); App::PropertyFileIncluded ImageFile; @@ -46,7 +46,7 @@ public: App::PropertyLength YSize; /// returns the type name of the ViewProvider - virtual const char* getViewProviderName(void) const { + virtual const char* getViewProviderName() const { return "ImageGui::ViewProviderImagePlane"; } }; diff --git a/src/Mod/Image/Gui/AppImageGui.cpp b/src/Mod/Image/Gui/AppImageGui.cpp index 5c1300a167..170ee8b3bc 100644 --- a/src/Mod/Image/Gui/AppImageGui.cpp +++ b/src/Mod/Image/Gui/AppImageGui.cpp @@ -23,7 +23,7 @@ #include "ViewProviderImagePlane.h" // use a different name to CreateCommand() -void CreateImageCommands(void); +void CreateImageCommands(); void loadImageResource() { @@ -42,7 +42,7 @@ PyMOD_INIT_FUNC(ImageGui) { if (!Gui::Application::Instance) { PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application."); - PyMOD_Return(0); + PyMOD_Return(nullptr); } PyObject* mod = ImageGui::initModule(); diff --git a/src/Mod/Image/Gui/AppImageGuiPy.cpp b/src/Mod/Image/Gui/AppImageGuiPy.cpp index 261ae29e6c..1ef7e7f3fe 100644 --- a/src/Mod/Image/Gui/AppImageGuiPy.cpp +++ b/src/Mod/Image/Gui/AppImageGuiPy.cpp @@ -58,7 +58,7 @@ private: Py::Object open(const Py::Tuple& args) { char* Name; - const char* DocName=0; + const char* DocName=nullptr; if (!PyArg_ParseTuple(args.ptr(), "et|s","utf-8",&Name,&DocName)) throw Py::Exception(); diff --git a/src/Mod/Image/Gui/CMakeLists.txt b/src/Mod/Image/Gui/CMakeLists.txt index b6e16385e7..a3a76ca2d7 100644 --- a/src/Mod/Image/Gui/CMakeLists.txt +++ b/src/Mod/Image/Gui/CMakeLists.txt @@ -51,13 +51,13 @@ SET(ImageGui_SRCS Command.cpp ImageOrientationDialog.cpp ImageOrientationDialog.h + OpenGLImageBox.cpp + OpenGLImageBox.h ViewProviderImagePlane.cpp ViewProviderImagePlane.h Resources/Image.qrc ImageView.cpp ImageView.h - OpenGLImageBox.cpp - OpenGLImageBox.h PreCompiled.cpp PreCompiled.h Workbench.cpp diff --git a/src/Mod/Image/Gui/Command.cpp b/src/Mod/Image/Gui/Command.cpp index d64cfcea79..1e7492f3b5 100644 --- a/src/Mod/Image/Gui/Command.cpp +++ b/src/Mod/Image/Gui/Command.cpp @@ -19,7 +19,7 @@ # include #endif -#include +#include #if defined(FC_OS_WIN32) #include #endif @@ -187,7 +187,7 @@ void CmdImageScaling::activated(int iMsg) //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #if HAVE_OPENCV2 -DEF_STD_CMD(CmdImageCapturerTest); +DEF_STD_CMD(CmdImageCapturerTest) CmdImageCapturerTest::CmdImageCapturerTest() : Command("Image_CapturerTest") @@ -226,7 +226,7 @@ void CmdImageCapturerTest::activated(int iMsg) } #endif -void CreateImageCommands(void) +void CreateImageCommands() { Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager(); diff --git a/src/Mod/Image/Gui/ImageView.cpp b/src/Mod/Image/Gui/ImageView.cpp index f549343695..02d59d3c71 100644 --- a/src/Mod/Image/Gui/ImageView.cpp +++ b/src/Mod/Image/Gui/ImageView.cpp @@ -39,7 +39,7 @@ using namespace ImageGui; TYPESYSTEM_SOURCE_ABSTRACT(ImageGui::ImageView, Gui::MDIView) ImageView::ImageView(QWidget* parent) - : MDIView(0, parent), _ignoreCloseEvent(false) + : MDIView(nullptr, parent), _ignoreCloseEvent(false) { // Create an OpenGL widget for displaying images // Since Qt5 there is a weird behaviour when creating a GLImageBox. diff --git a/src/Mod/Image/Gui/ViewProviderImagePlane.cpp b/src/Mod/Image/Gui/ViewProviderImagePlane.cpp index 3fc49e3bf9..29e2c2f961 100644 --- a/src/Mod/Image/Gui/ViewProviderImagePlane.cpp +++ b/src/Mod/Image/Gui/ViewProviderImagePlane.cpp @@ -74,7 +74,7 @@ ViewProviderImagePlane::~ViewProviderImagePlane() void ViewProviderImagePlane::attach(App::DocumentObject *pcObj) { - ViewProviderDocumentObject::attach(pcObj); + ViewProviderGeometryObject::attach(pcObj); // NOTE: SoFCSelection node has beem removed because it led to // problems using the image as a construction plane with the @@ -114,7 +114,7 @@ void ViewProviderImagePlane::setDisplayMode(const char* ModeName) ViewProviderGeometryObject::setDisplayMode(ModeName); } -std::vector ViewProviderImagePlane::getDisplayModes(void) const +std::vector ViewProviderImagePlane::getDisplayModes() const { std::vector StrList; StrList.push_back("ImagePlane");