do not include <ciso646> with C++20

This commit is contained in:
Roman Telezhynskyi 2023-07-17 16:33:57 +03:00
parent 62f468b57b
commit c8844853b5
24 changed files with 745 additions and 581 deletions

View File

@ -30,9 +30,13 @@
#include <QCommandLineParser> #include <QCommandLineParser>
#include <QCoreApplication> #include <QCoreApplication>
#include <ciso646>
#include <memory> #include <memory>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h" #include "../vmisc/defglobal.h"
#endif #endif

View File

@ -36,16 +36,18 @@
#include "../vgeometry/vlayoutplacelabel.h" #include "../vgeometry/vlayoutplacelabel.h"
#include "../vlayout/vlayoutpiecepath.h" #include "../vlayout/vlayoutpiecepath.h"
#include "../vlayout/vtextmanager.h" #include "../vlayout/vtextmanager.h"
#include "../vmisc/compatibility.h"
#include "../vmisc/vcommonsettings.h" #include "../vmisc/vcommonsettings.h"
#include "../vpatterndb/floatItemData/floatitemdef.h" #include "../vpatterndb/floatItemData/floatitemdef.h"
#include "compatibility.h" #include "../vwidgets/vpiecegrainline.h"
#include "svgfont/vsvgfont.h"
#include "vpiecegrainline.h"
#include "vplayoutliterals.h" #include "vplayoutliterals.h"
#include <QFont> #include <QFont>
#include <QXmlStreamAttributes> #include <QXmlStreamAttributes>
#include <Qt>
#include <ciso646> // Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")

View File

@ -29,15 +29,19 @@
#ifndef VPLAYOUTFILEWRITER_H #ifndef VPLAYOUTFILEWRITER_H
#define VPLAYOUTFILEWRITER_H #define VPLAYOUTFILEWRITER_H
#include <QCoreApplication>
#include <QLocale> #include <QLocale>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QCoreApplication>
#include <functional> #include <functional>
#include <ciso646>
#include "../vmisc/literals.h" // Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#include "../qmuparser/qmudef.h" #include "../qmuparser/qmudef.h"
#include "../vmisc/literals.h"
class VPLayout; class VPLayout;
class VPSheet; class VPSheet;
@ -75,11 +79,12 @@ private:
void WriteMargins(const QMarginsF &margins, bool ignore); void WriteMargins(const QMarginsF &margins, bool ignore);
void WriteSize(QSizeF size); void WriteSize(QSizeF size);
template <typename T> template <typename T> void SetAttribute(const QString &name, const T &value);
void SetAttribute(const QString &name, const T &value);
template <size_t N> template <size_t N>
void SetAttribute(const QString &name, const char (&value)[N]); //NOLINT(cppcoreguidelines-avoid-c-arrays) NOLINT(hicpp-avoid-c-arrays) NOLINT(modernize-avoid-c-arrays) void SetAttribute(const QString &name,
const char (&value)[N]); // NOLINT(cppcoreguidelines-avoid-c-arrays) NOLINT(hicpp-avoid-c-arrays)
// NOLINT(modernize-avoid-c-arrays)
template <typename T> template <typename T>
void SetAttributeOrRemoveIf(const QString &name, const T &value, void SetAttributeOrRemoveIf(const QString &name, const T &value,
@ -87,8 +92,7 @@ private:
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template<typename T> template <typename T> void VPLayoutFileWriter::SetAttribute(const QString &name, const T &value)
void VPLayoutFileWriter::SetAttribute(const QString &name, const T &value)
{ {
// See specification for xs:decimal // See specification for xs:decimal
const QLocale locale = QLocale::c(); const QLocale locale = QLocale::c();
@ -96,29 +100,28 @@ void VPLayoutFileWriter::SetAttribute(const QString &name, const T &value)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template <> template <> inline void VPLayoutFileWriter::SetAttribute<QString>(const QString &name, const QString &value)
inline void VPLayoutFileWriter::SetAttribute<QString>(const QString &name, const QString &value)
{ {
writeAttribute(name, value); writeAttribute(name, value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template <> template <> inline void VPLayoutFileWriter::SetAttribute<QChar>(const QString &name, const QChar &value)
inline void VPLayoutFileWriter::SetAttribute<QChar>(const QString &name, const QChar &value)
{ {
writeAttribute(name, value); writeAttribute(name, value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template <> template <> inline void VPLayoutFileWriter::SetAttribute<bool>(const QString &name, const bool &value)
inline void VPLayoutFileWriter::SetAttribute<bool>(const QString &name, const bool &value)
{ {
writeAttribute(name, value ? trueStr : falseStr); writeAttribute(name, value ? trueStr : falseStr);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template <size_t N> template <size_t N>
inline void VPLayoutFileWriter::SetAttribute(const QString &name, const char (&value)[N]) //NOLINT(cppcoreguidelines-avoid-c-arrays) NOLINT(hicpp-avoid-c-arrays) NOLINT(modernize-avoid-c-arrays) inline void VPLayoutFileWriter::SetAttribute(
const QString &name, const char (&value)[N]) // NOLINT(cppcoreguidelines-avoid-c-arrays)
// NOLINT(hicpp-avoid-c-arrays) NOLINT(modernize-avoid-c-arrays)
{ {
writeAttribute(name, QString(value)); writeAttribute(name, QString(value));
} }

View File

@ -28,7 +28,11 @@
#include "dialogdatetimeformats.h" #include "dialogdatetimeformats.h"
#include "ui_dialogdatetimeformats.h" #include "ui_dialogdatetimeformats.h"
#include <ciso646>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogDateTimeFormats::DialogDateTimeFormats(const QDate &date, const QStringList &predefinedFormats, DialogDateTimeFormats::DialogDateTimeFormats(const QDate &date, const QStringList &predefinedFormats,

View File

@ -28,7 +28,11 @@
#include "dialogknownmaterials.h" #include "dialogknownmaterials.h"
#include "ui_dialogknownmaterials.h" #include "ui_dialogknownmaterials.h"
#include <ciso646>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogKnownMaterials::DialogKnownMaterials(QWidget *parent) DialogKnownMaterials::DialogKnownMaterials(QWidget *parent)

View File

@ -34,7 +34,11 @@
#include <QSet> #include <QSet>
#include <QStringList> #include <QStringList>
#include <QSvgRenderer> #include <QSvgRenderer>
#include <ciso646>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"

View File

@ -27,20 +27,24 @@
*************************************************************************/ *************************************************************************/
#include "vbackgroundpatternimage.h" #include "vbackgroundpatternimage.h"
#include "utils.h"
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"
#include "../vmisc/defglobal.h" #include "../vmisc/defglobal.h"
#include "utils.h"
#include <QMimeType> #include <QBuffer>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QMimeDatabase>
#include <QPixmap>
#include <QBuffer>
#include <QImageReader> #include <QImageReader>
#include <ciso646> #include <QMimeDatabase>
#include <QMimeType>
#include <QPixmap>
#include <QSvgRenderer> #include <QSvgRenderer>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
const QString VBackgroundPatternImage::brokenImage = QStringLiteral("://icon/svg/broken_path.svg"); const QString VBackgroundPatternImage::brokenImage = QStringLiteral("://icon/svg/broken_path.svg");
namespace namespace

View File

@ -27,22 +27,25 @@
*************************************************************************/ *************************************************************************/
#include "vpatternimage.h" #include "vpatternimage.h"
#include <QBuffer>
#include <QDebug>
#include <QFile>
#include <QImage> #include <QImage>
#include <QImageReader> #include <QImageReader>
#include <QMimeDatabase> #include <QMimeDatabase>
#include <QPainter> #include <QPainter>
#include <QPixmap> #include <QPixmap>
#include <QRegularExpressionMatch> #include <QRegularExpressionMatch>
#include <QSvgRenderer>
#include <QDebug>
#include <QBuffer>
#include <QSize> #include <QSize>
#include <QFile> #include <QSvgRenderer>
#include <ciso646>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#include "utils.h"
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"
#include "utils.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VPatternImage::FromFile(const QString &fileName) -> VPatternImage auto VPatternImage::FromFile(const QString &fileName) -> VPatternImage

View File

@ -100,7 +100,10 @@
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wattributes") QT_WARNING_DISABLE_GCC("-Wattributes")
#include <ciso646> // Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
class QLocale; class QLocale;
class QChar; class QChar;

View File

@ -24,9 +24,13 @@
#include <QMap> #include <QMap>
#include <QString> #include <QString>
#include <locale>
#include <ciso646>
#include <QtGlobal> #include <QtGlobal>
#include <locale>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#ifdef __INTEL_COMPILER #ifdef __INTEL_COMPILER
#include "qmuparserfixes.h" #include "qmuparserfixes.h"
@ -319,11 +323,11 @@ typedef qreal ( *strfun_type2 ) ( const QString &, qreal );
typedef qreal (*strfun_type3)(const QString &, qreal, qreal); typedef qreal (*strfun_type3)(const QString &, qreal, qreal);
/** @brief Callback used for functions that identify values in a string. */ /** @brief Callback used for functions that identify values in a string. */
typedef int ( *identfun_type ) ( const QString &sExpr, qmusizetype *nPos, qreal *fVal, const QLocale &locale, typedef int (*identfun_type)(const QString &sExpr, qmusizetype *nPos, qreal *fVal, const QLocale &locale, bool cNumbers,
bool cNumbers, const QChar &decimal, const QChar &thousand ); const QChar &decimal, const QChar &thousand);
/** @brief Callback used for variable creation factory functions. */ /** @brief Callback used for variable creation factory functions. */
typedef qreal *(*facfun_type)(const QString &, void *); typedef qreal *(*facfun_type)(const QString &, void *);
} // end of namespace } // namespace qmu
#endif #endif

View File

@ -29,14 +29,27 @@
#ifndef DXFDEF_H #ifndef DXFDEF_H
#define DXFDEF_H #define DXFDEF_H
#include <QtGlobal>
#include <ciso646>
#include <QtCore/qcontainerfwd.h> #include <QtCore/qcontainerfwd.h>
#include <QtGlobal>
enum class VarMeasurement : quint8 { English=0, Metric=1 }; // Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
enum class VarMeasurement : quint8
{
English = 0,
Metric = 1
};
// Default drawing units for AutoCAD DesignCenter blocks: // Default drawing units for AutoCAD DesignCenter blocks:
enum class VarInsunits : quint8 { Inches=1, Millimeters=4, Centimeters=5 }; enum class VarInsunits : quint8
{
Inches = 1,
Millimeters = 4,
Centimeters = 5
};
// Helps mark end of string. See VDxfEngine::drawTextItem for more details // Helps mark end of string. See VDxfEngine::drawTextItem for more details
extern const QString endStringPlaceholder; extern const QString endStringPlaceholder;

View File

@ -15,12 +15,16 @@
#define DRW_VERSION "0.6.3" #define DRW_VERSION "0.6.3"
#include <string>
#include <list>
#include <cmath>
#include <unordered_map>
#include <QtGlobal> #include <QtGlobal>
#include <ciso646> #include <cmath>
#include <list>
#include <string>
#include <unordered_map>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#ifdef DRW_ASSERTS #ifdef DRW_ASSERTS
#define drw_assert(a) assert(a) #define drw_assert(a) assert(a)
@ -110,10 +114,12 @@ typedef float dfloat32; /* 32 bit floating point */
typedef double ddouble64; /* 64 bit floating point */ typedef double ddouble64; /* 64 bit floating point */
typedef long double ddouble80; /* 80 bit floating point */ typedef long double ddouble80; /* 80 bit floating point */
namespace DRW { namespace DRW
{
//! Version numbers for the DXF Format. //! Version numbers for the DXF Format.
enum Version { enum Version
{
UNKNOWNV, //!< UNKNOWN VERSION. UNKNOWNV, //!< UNKNOWN VERSION.
MC00, //!< DWG Release 1.1 MC00, //!< DWG Release 1.1
AC12, //!< DWG Release 1.2 AC12, //!< DWG Release 1.2
@ -136,27 +142,15 @@ enum Version {
}; };
const std::unordered_map<const char *, DRW::Version> dwgVersionStrings{ const std::unordered_map<const char *, DRW::Version> dwgVersionStrings{
{ "MC0.0", DRW::MC00 }, {"MC0.0", DRW::MC00}, {"AC1.2", DRW::AC12}, {"AC1.4", DRW::AC14}, {"AC1.50", DRW::AC150},
{ "AC1.2", DRW::AC12 }, {"AC2.10", DRW::AC210}, {"AC1002", DRW::AC1002}, {"AC1003", DRW::AC1003}, {"AC1004", DRW::AC1004},
{ "AC1.4", DRW::AC14 }, {"AC1006", DRW::AC1006}, {"AC1009", DRW::AC1009}, {"AC1012", DRW::AC1012}, {"AC1014", DRW::AC1014},
{ "AC1.50", DRW::AC150 }, {"AC1015", DRW::AC1015}, {"AC1018", DRW::AC1018}, {"AC1021", DRW::AC1021}, {"AC1024", DRW::AC1024},
{ "AC2.10", DRW::AC210 }, {"AC1027", DRW::AC1027}, {"AC1032", DRW::AC1032},
{ "AC1002", DRW::AC1002 },
{ "AC1003", DRW::AC1003 },
{ "AC1004", DRW::AC1004 },
{ "AC1006", DRW::AC1006 },
{ "AC1009", DRW::AC1009 },
{ "AC1012", DRW::AC1012 },
{ "AC1014", DRW::AC1014 },
{ "AC1015", DRW::AC1015 },
{ "AC1018", DRW::AC1018 },
{ "AC1021", DRW::AC1021 },
{ "AC1024", DRW::AC1024 },
{ "AC1027", DRW::AC1027 },
{ "AC1032", DRW::AC1032 },
}; };
enum error { enum error
{
BAD_NONE, /*!< No error. */ BAD_NONE, /*!< No error. */
BAD_UNKNOWN, /*!< UNKNOWN. */ BAD_UNKNOWN, /*!< UNKNOWN. */
BAD_OPEN, /*!< error opening file. */ BAD_OPEN, /*!< error opening file. */
@ -174,7 +168,8 @@ BAD_READ_SECTION, /*!< error in sections read process. */
BAD_CODE_PARSED, /*!< error in any parseCodes() method. */ BAD_CODE_PARSED, /*!< error in any parseCodes() method. */
}; };
enum class DebugLevel { enum class DebugLevel
{
None, None,
Debug Debug
}; };
@ -184,7 +179,8 @@ enum class DebugLevel {
* *
* The base class is silent and ignores all debugging. * The base class is silent and ignores all debugging.
*/ */
class DebugPrinter { class DebugPrinter
{
public: public:
virtual void printS(const std::string &s) { (void)s; } virtual void printS(const std::string &s) { (void)s; }
virtual void printI(long long int i) { (void)i; } virtual void printI(long long int i) { (void)i; }
@ -192,8 +188,18 @@ public:
virtual void printD(double d) { (void)d; } virtual void printD(double d) { (void)d; }
virtual void printH(long long int i) { (void)i; } virtual void printH(long long int i) { (void)i; }
virtual void printB(int i) { (void)i; } virtual void printB(int i) { (void)i; }
virtual void printHL(int c, int s, int h){(void)c;(void)s;(void)h;} virtual void printHL(int c, int s, int h)
virtual void printPT(double x, double y, double z){(void)x;(void)y;(void)z;} {
(void)c;
(void)s;
(void)h;
}
virtual void printPT(double x, double y, double z)
{
(void)x;
(void)y;
(void)z;
}
DebugPrinter() = default; DebugPrinter() = default;
virtual ~DebugPrinter() = default; virtual ~DebugPrinter() = default;
}; };
@ -206,7 +212,8 @@ public:
void setCustomDebugPrinter(DebugPrinter *printer); void setCustomDebugPrinter(DebugPrinter *printer);
//! Special codes for colors //! Special codes for colors
enum ColorCodes { enum ColorCodes
{
black = 250, black = 250,
green = 3, green = 3,
red = 1, red = 1,
@ -228,18 +235,21 @@ enum ColorCodes {
}; };
//! Spaces //! Spaces
enum Space { enum Space
{
ModelSpace = 0, ModelSpace = 0,
PaperSpace = 1 PaperSpace = 1
}; };
//! Special kinds of handles //! Special kinds of handles
enum HandleCodes { enum HandleCodes
{
NoHandle = 0 NoHandle = 0
}; };
//! Shadow mode //! Shadow mode
enum ShadowMode { enum ShadowMode
{
CastAndReceieveShadows = 0, CastAndReceieveShadows = 0,
CastShadows = 1, CastShadows = 1,
ReceiveShadows = 2, ReceiveShadows = 2,
@ -247,17 +257,20 @@ enum ShadowMode {
}; };
//! Special kinds of materials //! Special kinds of materials
enum MaterialCodes { enum MaterialCodes
{
MaterialByLayer = 0 MaterialByLayer = 0
}; };
//! Special kinds of plot styles //! Special kinds of plot styles
enum PlotStyleCodes { enum PlotStyleCodes
{
DefaultPlotStyle = 0 DefaultPlotStyle = 0
}; };
//! Special kinds of transparencies //! Special kinds of transparencies
enum TransparencyCodes { enum TransparencyCodes
{
Opaque = 0, Opaque = 0,
Transparent = -1 Transparent = -1
}; };
@ -286,20 +299,23 @@ static inline auto DRW_FuzzyComparePossibleNulls(double p1, double p2) -> bool
* Class to handle 3D coordinate point * Class to handle 3D coordinate point
* @author Rallaz * @author Rallaz
*/ */
class DRW_Coord { class DRW_Coord
{
public: public:
DRW_Coord() = default; DRW_Coord() = default;
DRW_Coord(double ix, double iy, double iz) DRW_Coord(double ix, double iy, double iz)
: x(ix), : x(ix),
y(iy), y(iy),
z(iz) z(iz)
{} {
}
DRW_Coord(const DRW_Coord &data) DRW_Coord(const DRW_Coord &data)
: x(data.x), : x(data.x),
y(data.y), y(data.y),
z(data.z) z(data.z)
{} {
}
auto operator=(const DRW_Coord &data) -> DRW_Coord & auto operator=(const DRW_Coord &data) -> DRW_Coord &
{ {
@ -314,10 +330,12 @@ public:
return *this; return *this;
} }
/*!< convert to unitary vector */ /*!< convert to unitary vector */
void unitize(){ void unitize()
{
double dist; double dist;
dist = hypot(hypot(x, y), z); dist = hypot(hypot(x, y), z);
if (dist > 0.0) { if (dist > 0.0)
{
x = x / dist; x = x / dist;
y = y / dist; y = y / dist;
z = z / dist; z = z / dist;
@ -330,13 +348,13 @@ public:
double z{0}; double z{0};
}; };
//! Class to handle vertex //! Class to handle vertex
/*! /*!
* Class to handle vertex for lwpolyline entity * Class to handle vertex for lwpolyline entity
* @author Rallaz * @author Rallaz
*/ */
class DRW_Vertex2D { class DRW_Vertex2D
{
public: public:
DRW_Vertex2D() DRW_Vertex2D()
: x(), : x(),
@ -353,7 +371,8 @@ public:
stawidth(0), stawidth(0),
endwidth(0), endwidth(0),
bulge(b) bulge(b)
{} {
}
public: public:
double x; /*!< x coordinate, code 10 */ double x; /*!< x coordinate, code 10 */
@ -363,15 +382,16 @@ public:
double bulge; /*!< bulge, code 42 */ double bulge; /*!< bulge, code 42 */
}; };
//! Class to handle header vars //! Class to handle header vars
/*! /*!
* Class to handle header vars * Class to handle header vars
* @author Rallaz * @author Rallaz
*/ */
class DRW_Variant { class DRW_Variant
{
public: public:
enum TYPE { enum TYPE
{
STRING, STRING,
INTEGER, INTEGER,
DOUBLE, DOUBLE,
@ -385,7 +405,8 @@ public:
code(), code(),
sdata(), sdata(),
vdata() vdata()
{} {
}
DRW_Variant(int c, dint32 i) DRW_Variant(int c, dint32 i)
: content(), : content(),
@ -459,18 +480,56 @@ public:
~DRW_Variant() = default; ~DRW_Variant() = default;
void addString(const UTF8STRING &s) {setType(STRING); sdata = s; content.s = &sdata;} void addString(const UTF8STRING &s)
void addInt(int i) {setType(INTEGER); content.i = i;} {
void addDouble(double d) {setType(DOUBLE); content.d = d;} setType(STRING);
void addCoord() {setType(COORD); vdata.x=0.0; vdata.y=0.0; vdata.z=0.0; content.v = &vdata;} sdata = s;
void addCoord(const DRW_Coord &v) {setType(COORD); vdata = v; content.v = &vdata;} content.s = &sdata;
}
void addInt(int i)
{
setType(INTEGER);
content.i = i;
}
void addDouble(double d)
{
setType(DOUBLE);
content.d = d;
}
void addCoord()
{
setType(COORD);
vdata.x = 0.0;
vdata.y = 0.0;
vdata.z = 0.0;
content.v = &vdata;
}
void addCoord(const DRW_Coord &v)
{
setType(COORD);
vdata = v;
content.v = &vdata;
}
void setType(TYPE t) { type = t; } void setType(TYPE t) { type = t; }
void setCoordX(double d) { if (type == COORD) vdata.x = d;} void setCoordX(double d)
void setCoordY(double d) { if (type == COORD) vdata.y = d;} {
void setCoordZ(double d) { if (type == COORD) vdata.z = d;} if (type == COORD)
vdata.x = d;
}
void setCoordY(double d)
{
if (type == COORD)
vdata.y = d;
}
void setCoordZ(double d)
{
if (type == COORD)
vdata.z = d;
}
private: private:
typedef union { typedef union
{
UTF8STRING *s; UTF8STRING *s;
dint32 i; dint32 i;
double d; double d;
@ -495,9 +554,11 @@ private:
* returns widthDefault. * returns widthDefault.
* @author Rallaz * @author Rallaz
*/ */
class DRW_LW_Conv{ class DRW_LW_Conv
{
public: public:
enum lineWidth { enum lineWidth
{
width00 = 0, /*!< 0.00mm (dxf 0)*/ width00 = 0, /*!< 0.00mm (dxf 0)*/
width01 = 1, /*!< 0.05mm (dxf 5)*/ width01 = 1, /*!< 0.05mm (dxf 5)*/
width02 = 2, /*!< 0.09mm (dxf 9)*/ width02 = 2, /*!< 0.09mm (dxf 9)*/
@ -529,7 +590,8 @@ public:
static auto lineWidth2dxfInt(lineWidth lw) -> int static auto lineWidth2dxfInt(lineWidth lw) -> int
{ {
switch (lw){ switch (lw)
{
case widthByLayer: case widthByLayer:
return -1; return -1;
case widthByBlock: case widthByBlock:
@ -592,7 +654,8 @@ public:
static auto dxfInt2lineWidth(int i) -> lineWidth static auto dxfInt2lineWidth(int i) -> lineWidth
{ {
if (i<0) { if (i < 0)
{
if (i == -1) if (i == -1)
return widthByLayer; return widthByLayer;
if (i == -2) if (i == -2)

View File

@ -13,18 +13,23 @@
#ifndef LIBDXFRW_H #ifndef LIBDXFRW_H
#define LIBDXFRW_H #define LIBDXFRW_H
#include <string>
#include <unordered_map>
#include "drw_entities.h" #include "drw_entities.h"
#include "drw_objects.h"
#include "drw_header.h" #include "drw_header.h"
#include "drw_interface.h" #include "drw_interface.h"
#include <ciso646> #include "drw_objects.h"
#include <string>
#include <unordered_map>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
class dxfReader; class dxfReader;
class dxfWriter; class dxfWriter;
class dxfRW { class dxfRW
{
public: public:
explicit dxfRW(const char *name); explicit dxfRW(const char *name);
~dxfRW(); ~dxfRW();

View File

@ -33,6 +33,11 @@
#include <QString> #include <QString>
#include <QtMath> #include <QtMath>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h" #include "../vmisc/defglobal.h"
#endif #endif

View File

@ -32,9 +32,13 @@
#include <QPainterPath> #include <QPainterPath>
#include <QSize> #include <QSize>
#include <QTransform> #include <QTransform>
#include <ciso646>
#include <climits> #include <climits>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
enum class LayoutExportFormats : qint8 enum class LayoutExportFormats : qint8
{ {
SVG = 0, SVG = 0,

View File

@ -50,7 +50,10 @@
template <class T> class QSharedPointer; template <class T> class QSharedPointer;
#include <ciso646> // Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
// Backport of relaxed constexpr // Backport of relaxed constexpr
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)

View File

@ -53,6 +53,11 @@
#include "../vmisc/backport/text.h" #include "../vmisc/backport/text.h"
#endif #endif
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
class QPaintDevice; class QPaintDevice;
class QPixmap; class QPixmap;
class QPoint; class QPoint;
@ -60,8 +65,6 @@ class QPointF;
class QPolygonF; class QPolygonF;
class QRectF; class QRectF;
#include <ciso646>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
static inline auto svgEngineFeatures() -> QPaintEngine::PaintEngineFeatures static inline auto svgEngineFeatures() -> QPaintEngine::PaintEngineFeatures
{ {

View File

@ -21,7 +21,6 @@
#ifndef VPROPERTY_H #ifndef VPROPERTY_H
#define VPROPERTY_H #define VPROPERTY_H
#include <QAbstractItemDelegate> #include <QAbstractItemDelegate>
#include <QEvent> #include <QEvent>
#include <QMap> #include <QMap>
@ -32,30 +31,39 @@
#include <QStringList> #include <QStringList>
#include <QStyleOptionViewItem> #include <QStyleOptionViewItem>
#include <QVariant> #include <QVariant>
#include <Qt>
#include <QtGlobal>
#include <QtCore/qcontainerfwd.h> #include <QtCore/qcontainerfwd.h>
#include <QtGlobal>
#include "vpropertyexplorer_global.h" #include "vpropertyexplorer_global.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h" #include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include <ciso646> // Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#include "vpropertydef.h" #include "vpropertydef.h"
namespace VPE namespace VPE
{ {
enum class Property : qint8 {Simple, Complex}; enum class Property : qint8
{
Simple,
Complex
};
static const int MyCustomEventType = 1099; static const int MyCustomEventType = 1099;
class VPROPERTYEXPLORERSHARED_EXPORT UserChangeEvent : public QEvent class VPROPERTYEXPLORERSHARED_EXPORT UserChangeEvent : public QEvent
{ {
public: public:
UserChangeEvent() : QEvent(static_cast<QEvent::Type>(MyCustomEventType)) {} UserChangeEvent()
: QEvent(static_cast<QEvent::Type>(MyCustomEventType))
{
}
virtual ~UserChangeEvent() override; virtual ~UserChangeEvent() override;
}; };
@ -68,6 +76,7 @@ QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
class VPROPERTYEXPLORERSHARED_EXPORT VProperty : public QObject class VPROPERTYEXPLORERSHARED_EXPORT VProperty : public QObject
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
enum DPC_DisplayColumn enum DPC_DisplayColumn
{ {
@ -241,6 +250,6 @@ private:
QT_WARNING_POP QT_WARNING_POP
} } // namespace VPE
#endif // VPROPERTY_H #endif // VPROPERTY_H

View File

@ -44,7 +44,10 @@
#include "../vlayout/vrawsapoint.h" #include "../vlayout/vrawsapoint.h"
#include "../vlayout/vsapoint.h" #include "../vlayout/vsapoint.h"
#include <ciso646> // Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#ifdef __GNUC__ #ifdef __GNUC__
#define V_UNUSED __attribute__((unused)) #define V_UNUSED __attribute__((unused))
@ -81,7 +84,9 @@ class VRawSAPoint;
class AbstractTest : public QObject class AbstractTest : public QObject
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public : explicit AbstractTest(QObject *parent = nullptr);
public:
explicit AbstractTest(QObject *parent = nullptr);
template <class T> static auto VectorFromJson(const QString &json) -> QVector<T>; template <class T> static auto VectorFromJson(const QString &json) -> QVector<T>;

View File

@ -29,7 +29,11 @@
#include <QPainter> #include <QPainter>
#include <QTextLayout> #include <QTextLayout>
#include <ciso646>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VElidedLabel::VElidedLabel(QWidget *parent) VElidedLabel::VElidedLabel(QWidget *parent)

View File

@ -27,7 +27,10 @@
*************************************************************************/ *************************************************************************/
#include "vplaintextedit.h" #include "vplaintextedit.h"
#include <ciso646> // Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VPlainTextEdit::VPlainTextEdit(QWidget *parent) VPlainTextEdit::VPlainTextEdit(QWidget *parent)

View File

@ -32,7 +32,11 @@
#include <QFile> #include <QFile>
#include <QObject> #include <QObject>
#include <QSharedPointer> #include <QSharedPointer>
#include <ciso646>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h" #include "../vmisc/defglobal.h"

View File

@ -30,7 +30,11 @@
#include "../vmisc/commandoptions.h" #include "../vmisc/commandoptions.h"
#include <QtTest> #include <QtTest>
#include <ciso646>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
TST_VCommandLine::TST_VCommandLine(QObject *parent) TST_VCommandLine::TST_VCommandLine(QObject *parent)

View File

@ -30,7 +30,11 @@
#include "../vmisc/vlockguard.h" #include "../vmisc/vlockguard.h"
#include <QtTest> #include <QtTest>
#include <ciso646>
// Header <ciso646> is removed in C++20.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
TST_VLockGuard::TST_VLockGuard(QObject *parent) TST_VLockGuard::TST_VLockGuard(QObject *parent)