Base: Add isNullOrEmpty string helper
This adds isNullOrEmpty string helper that cheks if string is... well null or empty. It is done to improve readability of the code and better express intent.
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#endif
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Gui/Command.h>
|
||||
@@ -47,6 +48,7 @@
|
||||
#include "TaskFilling.h"
|
||||
#include "TaskFillingEdge.h"
|
||||
#include "TaskFillingVertex.h"
|
||||
|
||||
#include "ui_TaskFilling.h"
|
||||
|
||||
|
||||
@@ -216,7 +218,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sSubName || sSubName[0] == '\0') {
|
||||
if (Base::Tools::isNullOrEmpty(sSubName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#endif
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Document.h>
|
||||
@@ -44,6 +45,7 @@
|
||||
|
||||
#include "TaskFilling.h"
|
||||
#include "TaskFillingEdge.h"
|
||||
|
||||
#include "ui_TaskFillingEdge.h"
|
||||
|
||||
|
||||
@@ -77,7 +79,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sSubName || sSubName[0] == '\0') {
|
||||
if (Base::Tools::isNullOrEmpty(sSubName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Document.h>
|
||||
@@ -36,6 +37,7 @@
|
||||
|
||||
#include "TaskFilling.h"
|
||||
#include "TaskFillingVertex.h"
|
||||
|
||||
#include "ui_TaskFillingVertex.h"
|
||||
|
||||
|
||||
@@ -69,7 +71,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sSubName || sSubName[0] == '\0') {
|
||||
if (Base::Tools::isNullOrEmpty(sSubName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Gui/Command.h>
|
||||
@@ -43,6 +44,7 @@
|
||||
#include <Mod/Part/Gui/ViewProvider.h>
|
||||
|
||||
#include "TaskGeomFillSurface.h"
|
||||
|
||||
#include "ui_TaskGeomFillSurface.h"
|
||||
|
||||
|
||||
@@ -172,7 +174,7 @@ bool GeomFillSurface::EdgeSelection::allow(App::Document*,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sSubName || sSubName[0] == '\0') {
|
||||
if (Base::Tools::isNullOrEmpty(sSubName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#endif
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Gui/Command.h>
|
||||
@@ -41,6 +42,7 @@
|
||||
#include <Mod/Part/Gui/ViewProvider.h>
|
||||
|
||||
#include "TaskSections.h"
|
||||
|
||||
#include "ui_TaskSections.h"
|
||||
|
||||
|
||||
@@ -216,7 +218,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sSubName || sSubName[0] == '\0') {
|
||||
if (Base::Tools::isNullOrEmpty(sSubName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user