Cppcheck warnings.
--HG-- branch : develop
This commit is contained in:
parent
321b22faba
commit
d355b4dce8
|
@ -93,7 +93,7 @@ public:
|
|||
bool SetIncrease(int increase);
|
||||
|
||||
bool GetAutoCrop() const;
|
||||
void SetAutoCrop(bool crop);
|
||||
void SetAutoCrop(bool autoCrop);
|
||||
|
||||
bool IsSaveLength() const;
|
||||
void SetSaveLength(bool save);
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
virtual ~MainWindow() Q_DECL_OVERRIDE;
|
||||
|
||||
bool LoadPattern(const QString &curFile, const QString &customMeasureFile = QString());
|
||||
bool LoadPattern(const QString &fileName, const QString &customMeasureFile = QString());
|
||||
|
||||
public slots:
|
||||
void ProcessCMD();
|
||||
|
@ -305,7 +305,7 @@ private:
|
|||
template <typename DrawTool>
|
||||
void ApplyDetailsDialog();
|
||||
|
||||
bool SavePattern(const QString &curFile, QString &error);
|
||||
bool SavePattern(const QString &fileName, QString &error);
|
||||
void AutoSavePattern();
|
||||
void setCurrentFile(const QString &fileName);
|
||||
|
||||
|
|
|
@ -53,6 +53,18 @@ VExceptionConversionError::VExceptionConversionError(const VExceptionConversionE
|
|||
:VException(e), str(e.String())
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionConversionError &VExceptionConversionError::operator=(const VExceptionConversionError &e)
|
||||
{
|
||||
if ( &e == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VException::operator=(e);
|
||||
str = e.String();
|
||||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ErrorMessage return main error message
|
||||
|
|
|
@ -43,6 +43,7 @@ class VExceptionConversionError : public VException
|
|||
public:
|
||||
VExceptionConversionError(const QString &error, const QString &str);
|
||||
VExceptionConversionError(const VExceptionConversionError &e);
|
||||
VExceptionConversionError &operator=(const VExceptionConversionError &e);
|
||||
virtual ~VExceptionConversionError() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
|
||||
virtual QString ErrorMessage() const Q_DECL_OVERRIDE;
|
||||
QString String() const;
|
||||
|
|
|
@ -61,6 +61,21 @@ VExceptionEmptyParameter::VExceptionEmptyParameter(const VExceptionEmptyParamete
|
|||
:VException(e), name(e.Name()), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionEmptyParameter &VExceptionEmptyParameter::operator=(const VExceptionEmptyParameter &e)
|
||||
{
|
||||
if ( &e == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VException::operator=(e);
|
||||
name = e.Name();
|
||||
tagText = e.TagText();
|
||||
tagName = e.TagName();
|
||||
lineNumber = e.LineNumber();
|
||||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ErrorMessage return main error message
|
||||
|
|
|
@ -44,9 +44,9 @@ class QDomElement;
|
|||
class VExceptionEmptyParameter : public VException
|
||||
{
|
||||
public:
|
||||
VExceptionEmptyParameter(const QString &error, const QString &name,
|
||||
const QDomElement &domElement);
|
||||
VExceptionEmptyParameter(const QString &what, const QString &name, const QDomElement &domElement);
|
||||
VExceptionEmptyParameter(const VExceptionEmptyParameter &e);
|
||||
VExceptionEmptyParameter &operator=(const VExceptionEmptyParameter &e);
|
||||
virtual ~VExceptionEmptyParameter() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
|
||||
virtual QString ErrorMessage() const Q_DECL_OVERRIDE;
|
||||
virtual QString DetailedInformation() const Q_DECL_OVERRIDE;
|
||||
|
|
|
@ -58,6 +58,20 @@ VExceptionObjectError::VExceptionObjectError(const VExceptionObjectError &e)
|
|||
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionObjectError &VExceptionObjectError::operator=(const VExceptionObjectError &e)
|
||||
{
|
||||
if ( &e == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VException::operator=(e);
|
||||
tagText = e.TagText();
|
||||
tagName = e.TagName();
|
||||
lineNumber = e.LineNumber();
|
||||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ErrorMessage return main error message
|
||||
|
|
|
@ -44,8 +44,9 @@ class QDomElement;
|
|||
class VExceptionObjectError : public VException
|
||||
{
|
||||
public:
|
||||
VExceptionObjectError(const QString &error, const QDomElement &domElement);
|
||||
VExceptionObjectError(const QString &what, const QDomElement &domElement);
|
||||
VExceptionObjectError(const VExceptionObjectError &e);
|
||||
VExceptionObjectError &operator=(const VExceptionObjectError &e);
|
||||
virtual ~VExceptionObjectError() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
|
||||
virtual QString ErrorMessage() const Q_DECL_OVERRIDE;
|
||||
virtual QString DetailedInformation() const Q_DECL_OVERRIDE;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
class VExceptionUndo : public VException
|
||||
{
|
||||
public:
|
||||
explicit VExceptionUndo(const QString &error);
|
||||
explicit VExceptionUndo(const QString &what);
|
||||
VExceptionUndo(const VExceptionUndo &e);
|
||||
virtual ~VExceptionUndo() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
|
||||
};
|
||||
|
|
|
@ -58,6 +58,20 @@ VExceptionWrongId::VExceptionWrongId(const VExceptionWrongId &e)
|
|||
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionWrongId &VExceptionWrongId::operator=(const VExceptionWrongId &e)
|
||||
{
|
||||
if ( &e == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VException::operator=(e);
|
||||
tagText = e.TagText();
|
||||
tagName = e.TagName();
|
||||
lineNumber = e.LineNumber();
|
||||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ErrorMessage return main error message
|
||||
|
|
|
@ -44,8 +44,9 @@ class QDomElement;
|
|||
class VExceptionWrongId : public VException
|
||||
{
|
||||
public:
|
||||
VExceptionWrongId(const QString &error, const QDomElement &domElement);
|
||||
VExceptionWrongId(const QString &what, const QDomElement &domElement);
|
||||
VExceptionWrongId(const VExceptionWrongId &e);
|
||||
VExceptionWrongId &operator=(const VExceptionWrongId &e);
|
||||
virtual ~VExceptionWrongId() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
|
||||
virtual QString ErrorMessage() const Q_DECL_OVERRIDE;
|
||||
virtual QString DetailedInformation() const Q_DECL_OVERRIDE;
|
||||
|
|
|
@ -403,9 +403,8 @@ void QmuParserBase::CheckOprt(const QString &a_sName, const QmuParserCallback &a
|
|||
/**
|
||||
* @brief Check if a name contains invalid characters.
|
||||
*
|
||||
* @throw ParserException if the name contains invalid charakters.
|
||||
* @throw ParserException if the name contains invalid characters.
|
||||
*/
|
||||
// cppcheck-suppress
|
||||
void QmuParserBase::CheckName(const QString &a_sName, const QString &a_szCharSet) const
|
||||
{
|
||||
std::wstring a_sNameStd = a_sName.toStdWString();
|
||||
|
@ -483,9 +482,9 @@ const QString &QmuParserBase::ValidInfixOprtChars() const
|
|||
* @brief Add a user defined operator.
|
||||
* @post Will reset the Parser to string parsing mode.
|
||||
*/
|
||||
void QmuParserBase::DefinePostfixOprt(const QString &a_sName, fun_type1 a_pFun, bool a_bAllowOpt)
|
||||
void QmuParserBase::DefinePostfixOprt(const QString &a_sFun, fun_type1 a_pFun, bool a_bAllowOpt)
|
||||
{
|
||||
AddCallback(a_sName, QmuParserCallback(a_pFun, a_bAllowOpt, prPOSTFIX, cmOPRT_POSTFIX), m_PostOprtDef,
|
||||
AddCallback(a_sFun, QmuParserCallback(a_pFun, a_bAllowOpt, prPOSTFIX, cmOPRT_POSTFIX), m_PostOprtDef,
|
||||
ValidOprtChars() );
|
||||
}
|
||||
|
||||
|
|
|
@ -84,13 +84,13 @@ public:
|
|||
void EnableBuiltInOprt(bool a_bIsOn=true);
|
||||
bool HasBuiltInOprt() const;
|
||||
void AddValIdent(identfun_type a_pCallback);
|
||||
void DefineOprt(const QString &a_strName, fun_type2 a_pFun, unsigned a_iPri=0,
|
||||
void DefineOprt(const QString &a_sName, fun_type2 a_pFun, unsigned a_iPrec=0,
|
||||
EOprtAssociativity a_eAssociativity = oaLEFT, bool a_bAllowOpt = false);
|
||||
void DefineConst(const QString &a_sName, qreal a_fVal);
|
||||
void DefineStrConst(const QString &a_sName, const QString &a_strVal);
|
||||
void DefineVar(const QString &a_sName, qreal *a_fVar);
|
||||
void DefinePostfixOprt(const QString &a_strFun, fun_type1 a_pOprt, bool a_bAllowOpt=true);
|
||||
void DefineInfixOprt(const QString &a_strName, fun_type1 a_pOprt, int a_iPrec=prINFIX,
|
||||
void DefineStrConst(const QString &a_strName, const QString &a_strVal);
|
||||
void DefineVar(const QString &a_sName, qreal *a_pVar);
|
||||
void DefinePostfixOprt(const QString &a_sFun, fun_type1 a_pFun, bool a_bAllowOpt=true);
|
||||
void DefineInfixOprt(const QString &a_sName, fun_type1 a_pFun, int a_iPrec=prINFIX,
|
||||
bool a_bAllowOpt=true);
|
||||
// Clear user defined variables, constants or functions
|
||||
void ClearVar();
|
||||
|
@ -117,7 +117,7 @@ public:
|
|||
const QString& ValidInfixOprtChars() const;
|
||||
void SetArgSep(char_type cArgSep);
|
||||
QChar GetArgSep() const;
|
||||
void Q_NORETURN Error(EErrorCodes a_iErrc, int a_iPos = -1, const QString &a_strTok = QString() ) const;
|
||||
void Q_NORETURN Error(EErrorCodes a_iErrc, int a_iPos = -1, const QString &a_sTok = QString() ) const;
|
||||
|
||||
template<typename T>
|
||||
void DefineFun(const QString &a_strName, T a_pFun, bool a_bAllowOpt = true);
|
||||
|
@ -269,7 +269,7 @@ private:
|
|||
qreal ParseCmdCode() const;
|
||||
qreal ParseCmdCodeBulk(int nOffset, int nThreadID) const;
|
||||
// cppcheck-suppress functionStatic
|
||||
void CheckName(const QString &a_strName, const QString &a_CharSet) const;
|
||||
void CheckName(const QString &a_sName, const QString &a_szCharSet) const;
|
||||
// cppcheck-suppress functionStatic
|
||||
void CheckOprt(const QString &a_sName, const QmuParserCallback &a_Callback,
|
||||
const QString &a_szCharSet) const;
|
||||
|
|
|
@ -72,8 +72,7 @@ QmuParserCallback::QmuParserCallback ( fun_type2 a_pFun, bool a_bAllowOpti )
|
|||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallback::QmuParserCallback ( fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec,
|
||||
EOprtAssociativity a_eOprtAsct )
|
||||
QmuParserCallback::QmuParserCallback (fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eOprtAsct)
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 2 ), m_iPri ( a_iPrec ), m_eOprtAsct ( a_eOprtAsct ),
|
||||
m_iCode ( cmOPRT_BIN ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
|
@ -306,9 +305,9 @@ QmuParserCallback::QmuParserCallback()
|
|||
* @brief Copy constructor.
|
||||
* @throw nothrow
|
||||
*/
|
||||
QmuParserCallback::QmuParserCallback ( const QmuParserCallback &ref )
|
||||
: m_pFun ( ref.m_pFun ), m_iArgc ( ref.m_iArgc ), m_iPri ( ref.m_iPri ), m_eOprtAsct ( ref.m_eOprtAsct ),
|
||||
m_iCode ( ref.m_iCode ), m_iType ( ref.m_iType ), m_bAllowOpti ( ref.m_bAllowOpti )
|
||||
QmuParserCallback::QmuParserCallback (const QmuParserCallback &a_Fun )
|
||||
: m_pFun ( a_Fun.m_pFun ), m_iArgc ( a_Fun.m_iArgc ), m_iPri ( a_Fun.m_iPri ), m_eOprtAsct ( a_Fun.m_eOprtAsct ),
|
||||
m_iCode ( a_Fun.m_iCode ), m_iType ( a_Fun.m_iType ), m_bAllowOpti ( a_Fun.m_bAllowOpti )
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -51,7 +51,7 @@ class QmuParserCallback
|
|||
public:
|
||||
QmuParserCallback(fun_type0 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode=cmFUNC);
|
||||
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eAssociativity);
|
||||
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eOprtAsct);
|
||||
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type4 a_pFun, bool a_bAllowOpti);
|
||||
|
|
|
@ -143,7 +143,7 @@ public:
|
|||
explicit QmuParserError ( const QString &sMsg );
|
||||
QmuParserError ( EErrorCodes a_iErrc, const QString &sTok, const QString &sFormula = QString(), int a_iPos = -1 );
|
||||
QmuParserError ( EErrorCodes a_iErrc, int a_iPos, const QString &sTok );
|
||||
QmuParserError ( const QString &a_szMsg, int a_iPos, const QString &sTok = QString() );
|
||||
QmuParserError ( const QString &szMsg, int iPos, const QString &sTok = QString() );
|
||||
QmuParserError ( const QmuParserError &a_Obj );
|
||||
QmuParserError& operator= ( const QmuParserError &a_Obj );
|
||||
virtual ~QmuParserError() QMUP_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE {}
|
||||
|
|
|
@ -1218,8 +1218,8 @@ int QmuParserTester::ThrowTest ( const QString &a_str, int a_iErrc, bool a_bFail
|
|||
*
|
||||
* @return 1 in case of a failure, 0 otherwise.
|
||||
*/
|
||||
int QmuParserTester::EqnTestWithVarChange ( const QString &a_str, double a_fVar1, double a_fRes1, double a_fVar2,
|
||||
double a_fRes2 )
|
||||
int QmuParserTester::EqnTestWithVarChange (const QString &a_str, double a_fRes1, double a_fVar1, double a_fRes2,
|
||||
double a_fVar2)
|
||||
{
|
||||
QmuParserTester::c_iCount++;
|
||||
qreal fVal[2] = { -999, -999 }; // should be equalinitially
|
||||
|
@ -1233,19 +1233,19 @@ int QmuParserTester::EqnTestWithVarChange ( const QString &a_str, double a_fVar1
|
|||
p.DefineVar ( "a", &var );
|
||||
p.SetExpr ( a_str );
|
||||
|
||||
var = a_fVar1;
|
||||
var = a_fRes1;
|
||||
fVal[0] = p.Eval();
|
||||
|
||||
// cppcheck-suppress redundantAssignment
|
||||
var = a_fVar2; //-V519
|
||||
var = a_fRes2; //-V519
|
||||
fVal[1] = p.Eval();
|
||||
|
||||
if ( fabs ( a_fRes1 - fVal[0] ) > 0.0000000001 )
|
||||
if ( fabs ( a_fVar1 - fVal[0] ) > 0.0000000001 )
|
||||
{
|
||||
throw std::runtime_error ( "incorrect result (first pass)" );
|
||||
}
|
||||
|
||||
if ( fabs ( a_fRes2 - fVal[1] ) > 0.0000000001 )
|
||||
if ( fabs ( a_fVar2 - fVal[1] ) > 0.0000000001 )
|
||||
{
|
||||
throw std::runtime_error ( "incorrect result (second pass)" );
|
||||
}
|
||||
|
|
|
@ -74,8 +74,8 @@ private:
|
|||
|
||||
// Test Double Parser
|
||||
static int EqnTest ( const QString &a_str, double a_fRes, bool a_fPass );
|
||||
static int EqnTestWithVarChange ( const QString &a_str, double a_fRes1, double a_fVar1, double a_fRes2,
|
||||
double a_fVar2 );
|
||||
static int EqnTestWithVarChange (const QString &a_str, double a_fRes1, double a_fVar1, double a_fRes2,
|
||||
double a_fVar2);
|
||||
static int ThrowTest ( const QString &a_str, int a_iErrc, bool a_bFail = true );
|
||||
|
||||
// Test Bulkmode
|
||||
|
|
|
@ -236,7 +236,7 @@ bool DL_Dxf::readDxfGroups(std::stringstream& stream,
|
|||
* @param s Output\n
|
||||
* Pointer to character array that chopped line will be returned in.
|
||||
* @param size Size of \p s. (Including space for NULL.)
|
||||
* @param fp Input\n
|
||||
* @param stream Input\n
|
||||
* Handle of input file.
|
||||
*
|
||||
* @retval true if line could be read
|
||||
|
@ -246,16 +246,16 @@ bool DL_Dxf::readDxfGroups(std::stringstream& stream,
|
|||
* @todo Is it a problem if line is blank (i.e., newline only)?
|
||||
* Then, when function returns, (s==NULL).
|
||||
*/
|
||||
bool DL_Dxf::getStrippedLine(std::string& s, quint32 size, FILE *fp, bool stripSpace)
|
||||
bool DL_Dxf::getStrippedLine(std::string& s, quint32 size, FILE *stream, bool stripSpace)
|
||||
{
|
||||
if (!feof(fp))
|
||||
if (!feof(stream))
|
||||
{
|
||||
// The whole line in the file. Includes space for NULL.
|
||||
char* wholeLine = new char[size];
|
||||
// Only the useful part of the line
|
||||
char* line;
|
||||
|
||||
line = fgets(wholeLine, static_cast<int>(size), fp);
|
||||
line = fgets(wholeLine, static_cast<int>(size), stream);
|
||||
|
||||
if (line!=NULL && line[0] != '\0') // Evaluates to fgets() retval
|
||||
{
|
||||
|
|
|
@ -114,24 +114,17 @@ public:
|
|||
DL_Dxf();
|
||||
~DL_Dxf();
|
||||
|
||||
bool in(const std::string& file,
|
||||
DL_CreationInterface* creationInterface);
|
||||
bool readDxfGroups(FILE* fp,
|
||||
DL_CreationInterface* creationInterface);
|
||||
static bool getStrippedLine(std::string& s, quint32 size,
|
||||
FILE* stream, bool stripSpace = true);
|
||||
bool in(const std::string& file, DL_CreationInterface* creationInterface);
|
||||
bool readDxfGroups(FILE* fp, DL_CreationInterface* creationInterface);
|
||||
static bool getStrippedLine(std::string& s, quint32 size, FILE* stream, bool stripSpace = true);
|
||||
|
||||
bool readDxfGroups(std::stringstream& stream,
|
||||
DL_CreationInterface* creationInterface);
|
||||
bool in(std::stringstream &stream,
|
||||
DL_CreationInterface* creationInterface);
|
||||
static bool getStrippedLine(std::string& s, quint32 size,
|
||||
std::stringstream& stream, bool stripSpace = true);
|
||||
bool readDxfGroups(std::stringstream& stream, DL_CreationInterface* creationInterface);
|
||||
bool in(std::stringstream &stream, DL_CreationInterface* creationInterface);
|
||||
static bool getStrippedLine(std::string& s, quint32 size, std::stringstream& stream, bool stripSpace = true);
|
||||
|
||||
static bool stripWhiteSpace(char** s, bool stripSpaces = true);
|
||||
static bool stripWhiteSpace(char** s, bool stripSpace = true);
|
||||
|
||||
bool processDXFGroup(DL_CreationInterface* creationInterface,
|
||||
int groupCode, const std::string& groupValue);
|
||||
bool processDXFGroup(DL_CreationInterface* creationInterface, int groupCode, const std::string& groupValue);
|
||||
void addSetting(DL_CreationInterface* creationInterface);
|
||||
void addLayer(DL_CreationInterface* creationInterface);
|
||||
void addLinetype(DL_CreationInterface *creationInterface);
|
||||
|
@ -203,8 +196,7 @@ public:
|
|||
|
||||
//int stringToInt(const char* s, bool* ok=NULL);
|
||||
|
||||
DL_WriterA* out(const char* file,
|
||||
DL_Codes::version version=DL_VERSION_2000);
|
||||
DL_WriterA* out(const char* file, DL_Codes::version version=DL_VERSION_2000);
|
||||
|
||||
void writeHeader(DL_WriterA& dw) const;
|
||||
|
||||
|
@ -414,16 +406,16 @@ public:
|
|||
return static_cast<int>(strtol(str.c_str(), &p, 10));
|
||||
}
|
||||
|
||||
int getInt16Value(int code, int def)
|
||||
int getInt16Value(int code, int def)
|
||||
{
|
||||
if (!hasValue(code))
|
||||
if (!hasValue(code))
|
||||
{
|
||||
return def;
|
||||
}
|
||||
return toInt16(values[code]);
|
||||
}
|
||||
|
||||
static int toInt16(const std::string& str)
|
||||
static int toInt16(const std::string& str)
|
||||
{
|
||||
char* p;
|
||||
return static_cast<int>(strtol(str.c_str(), &p, 16));
|
||||
|
|
|
@ -860,6 +860,29 @@ struct DXFLIB_EXPORT DL_TextData
|
|||
{
|
||||
}
|
||||
|
||||
DL_TextData &operator=(const DL_TextData &d)
|
||||
{
|
||||
if ( &d == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
ipx = d.ipx;
|
||||
ipy = d.ipy;
|
||||
ipz = d.ipz;
|
||||
apx = d.apx;
|
||||
apy = d.apy;
|
||||
apz = d.apz;
|
||||
height = d.height;
|
||||
xScaleFactor = d.xScaleFactor;
|
||||
textGenerationFlags = d.textGenerationFlags;
|
||||
hJustification = d.hJustification;
|
||||
vJustification = d.vJustification;
|
||||
text = d.text;
|
||||
style = d.style;
|
||||
angle = d.angle;
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual ~DL_TextData()
|
||||
{}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class VCubicBezierData : public QSharedData
|
|||
{
|
||||
public:
|
||||
VCubicBezierData();
|
||||
VCubicBezierData(const VCubicBezierData &spline);
|
||||
VCubicBezierData(const VCubicBezierData &curve);
|
||||
VCubicBezierData(const VPointF &p1, const VPointF &p2, const VPointF &p3, const VPointF &p4);
|
||||
virtual ~VCubicBezierData();
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
VSpline Flip(const QLineF &axis, const QString &prefix = QString()) const;
|
||||
VSpline Move(qreal length, qreal angle, const QString &prefix = QString()) const;
|
||||
virtual ~VSpline();
|
||||
VSpline &operator=(const VSpline &spl);
|
||||
VSpline &operator=(const VSpline &spline);
|
||||
|
||||
virtual VPointF GetP1 () const Q_DECL_OVERRIDE;
|
||||
void SetP1 (const VPointF &p);
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
void SetPoints(const QVector<QPointF> &points);
|
||||
|
||||
Qt::PenStyle PenStyle() const;
|
||||
void SetPenStyle(const Qt::PenStyle &PenStyle);
|
||||
void SetPenStyle(const Qt::PenStyle &penStyle);
|
||||
|
||||
private:
|
||||
QSharedDataPointer<VLayoutPiecePathData> d;
|
||||
|
|
|
@ -590,6 +590,7 @@ static QString qxt_addCsvQuotes(QxtCsvModel::QuoteMode mode, QString field)
|
|||
Fields in the output file will be separated by \a separator. Set \a withHeader to true
|
||||
to output a row of headers at the top of the file.
|
||||
*/
|
||||
// cppcheck-suppress funcArgNamesDifferent
|
||||
void QxtCsvModel::toCSV(QIODevice* dest, bool withHeader, QChar separator, QTextCodec* codec) const
|
||||
{
|
||||
const QxtCsvModelPrivate& d_ptr = qxt_d();
|
||||
|
|
|
@ -52,10 +52,10 @@ class VMeasurement :public VVariable
|
|||
public:
|
||||
VMeasurement(quint32 index, const QString &name, qreal baseSize, qreal baseHeight, const qreal &base,
|
||||
const qreal &ksize, const qreal &kheight, const QString &gui_text = QString(),
|
||||
const QString &description = QString(), const QString &TagName = QString());
|
||||
const QString &description = QString(), const QString &tagName = QString());
|
||||
VMeasurement(VContainer *data, quint32 index, const QString &name, const qreal &base, const QString &formula,
|
||||
bool ok, const QString &gui_text = QString(), const QString &description = QString(),
|
||||
const QString &TagName = QString());
|
||||
const QString &tagName = QString());
|
||||
VMeasurement(const VMeasurement &m);
|
||||
VMeasurement &operator=(const VMeasurement &m);
|
||||
virtual ~VMeasurement() Q_DECL_OVERRIDE;
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
QString GetGuiText() const;
|
||||
|
||||
QString TagName() const;
|
||||
void setTagName(const QString &TagName);
|
||||
void setTagName(const QString &tagName);
|
||||
|
||||
QString GetFormula() const;
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ public:
|
|||
quint32 AddPiece(const VPiece &detail);
|
||||
quint32 AddPiecePath(const VPiecePath &path);
|
||||
void AddLine(const quint32 &firstPointId, const quint32 &secondPointId);
|
||||
void AddArc(const QSharedPointer<VAbstractCurve> &arc, const quint32 &arcId,
|
||||
void AddArc(const QSharedPointer<VAbstractCurve> &arc, const quint32 &id,
|
||||
const quint32 &parentId = NULL_ID);
|
||||
void AddSpline(const QSharedPointer<VAbstractBezier> &curve, quint32 id, quint32 parentId = NULL_ID);
|
||||
void AddCurveWithSegments(const QSharedPointer<VAbstractCubicBezierPath> &curve, const quint32 &id,
|
||||
|
|
|
@ -860,6 +860,7 @@ QVector<CustomSARecord> VPiece::FilterRecords(QVector<CustomSARecord> records) c
|
|||
{
|
||||
startIndex = i;
|
||||
filter = records.at(i);
|
||||
// cppcheck-suppress unreadVariable
|
||||
foundFilter = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,18 @@ public:
|
|||
:X(other.X), Y(other.Y), Z(other.Z)
|
||||
{}
|
||||
|
||||
Vector3D &operator=(const Vector3D &other)
|
||||
{
|
||||
if ( &other == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
X = other.X;
|
||||
Y = other.Y;
|
||||
Z = other.Z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
~Vector3D() {}
|
||||
|
||||
double X, Y, Z;
|
||||
|
|
|
@ -70,10 +70,10 @@ signals:
|
|||
|
||||
public slots:
|
||||
//! Sets the current file, does not check if it is valid
|
||||
//! \param getFile The new filepath the widget should show
|
||||
//! \param value The new filepath the widget should show
|
||||
//! \param emit_signal If true, this will emit the dataChangedByUser()-signal (if file differs from the current
|
||||
//! file)
|
||||
void setFile(const QString &getFile, bool emit_signal = false);
|
||||
void setFile(const QString &value, bool emit_signal = false);
|
||||
|
||||
//! Sets a filter for the file field
|
||||
//! \param dialog_filter The filter used for the File Dialog
|
||||
|
@ -94,10 +94,10 @@ protected:
|
|||
virtual void dropEvent(QDropEvent* event) Q_DECL_OVERRIDE;
|
||||
|
||||
//! This function checks the mime data, if it is compatible with the filters
|
||||
virtual bool checkMimeData(const QMimeData* data, QString& getFile) const;
|
||||
virtual bool checkMimeData(const QMimeData* data, QString& file) const;
|
||||
|
||||
//! This checks, if a file is compatible with the filters
|
||||
virtual bool checkFileFilter(const QString& getFile) const;
|
||||
virtual bool checkFileFilter(const QString& file) const;
|
||||
|
||||
|
||||
QString CurrentFilePath;
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
virtual ~VShortcutEditWidget() Q_DECL_OVERRIDE;
|
||||
|
||||
//! Needed for proper event handling
|
||||
virtual bool eventFilter(QObject* obj, QEvent* evenvt) Q_DECL_OVERRIDE;
|
||||
virtual bool eventFilter(QObject* obj, QEvent* event) Q_DECL_OVERRIDE;
|
||||
|
||||
//! Returns the currently set shortcut
|
||||
QString getShortcutAsString() const;
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
void EnableApply(bool enable);
|
||||
|
||||
VPiece GetPiece() const;
|
||||
void SetPiece(const VPiece &m_piece);
|
||||
void SetPiece(const VPiece &piece);
|
||||
|
||||
QString GetFormulaSAWidth() const;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||
static VToolRotation* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolRotation* Create(const quint32 _id, const quint32 &origin, QString &formulaAngle, const QString &suffix,
|
||||
static VToolRotation* Create(const quint32 _id, const quint32 &origin, QString &angle, const QString &suffix,
|
||||
const QVector<quint32> &source, const QVector<DestinationItem> &destination,
|
||||
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||
const Document &parse, const Source &typeCreation);
|
||||
|
@ -83,39 +83,39 @@ private:
|
|||
QString formulaAngle;
|
||||
|
||||
VToolRotation(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 origPointId,
|
||||
const QString &formulaAngle, const QString &suffix, const QVector<quint32> &source,
|
||||
const QString &angle, const QString &suffix, const QVector<quint32> &source,
|
||||
const QVector<DestinationItem> &destination, const Source &typeCreation,
|
||||
QGraphicsItem *parent = nullptr);
|
||||
|
||||
static DestinationItem CreatePoint(quint32 idTool, quint32 idItem, const QPointF &origin, qreal formulaAngle,
|
||||
static DestinationItem CreatePoint(quint32 idTool, quint32 idItem, const QPointF &origin, qreal angle,
|
||||
const QString &suffix, VContainer *data);
|
||||
|
||||
template <class Item>
|
||||
static DestinationItem CreateItem(quint32 idTool, quint32 idItem, const QPointF &origin, qreal formulaAngle,
|
||||
static DestinationItem CreateItem(quint32 idTool, quint32 idItem, const QPointF &origin, qreal angle,
|
||||
const QString &suffix, VContainer *data);
|
||||
template <class Item>
|
||||
static DestinationItem CreateArc(quint32 idTool, quint32 idItem, const QPointF &origin, qreal formulaAngle,
|
||||
static DestinationItem CreateArc(quint32 idTool, quint32 idItem, const QPointF &origin, qreal angle,
|
||||
const QString &suffix, VContainer *data);
|
||||
template <class Item>
|
||||
static DestinationItem CreateCurve(quint32 idTool, quint32 idItem, const QPointF &origin, qreal formulaAngle,
|
||||
static DestinationItem CreateCurve(quint32 idTool, quint32 idItem, const QPointF &origin, qreal angle,
|
||||
const QString &suffix, VContainer *data);
|
||||
template <class Item>
|
||||
static DestinationItem CreateCurveWithSegments(quint32 idTool, quint32 idItem, const QPointF &origin,
|
||||
qreal formulaAngle, const QString &suffix, VContainer *data);
|
||||
qreal angle, const QString &suffix, VContainer *data);
|
||||
|
||||
static void UpdatePoint(quint32 idTool, quint32 idItem, const QPointF &origin, qreal formulaAngle,
|
||||
static void UpdatePoint(quint32 idTool, quint32 idItem, const QPointF &origin, qreal angle,
|
||||
const QString &suffix, VContainer *data, quint32 id, qreal mx, qreal my);
|
||||
template <class Item>
|
||||
static void UpdateItem(quint32 idTool, quint32 idItem, const QPointF &origin, qreal formulaAngle,
|
||||
static void UpdateItem(quint32 idTool, quint32 idItem, const QPointF &origin, qreal angle,
|
||||
const QString &suffix, VContainer *data, quint32 id);
|
||||
template <class Item>
|
||||
static void UpdateArc(quint32 idTool, quint32 idItem, const QPointF &origin, qreal formulaAngle,
|
||||
static void UpdateArc(quint32 idTool, quint32 idItem, const QPointF &origin, qreal angle,
|
||||
const QString &suffix, VContainer *data, quint32 id);
|
||||
template <class Item>
|
||||
static void UpdateCurve(quint32 idTool, quint32 idItem, const QPointF &origin, qreal formulaAngle,
|
||||
static void UpdateCurve(quint32 idTool, quint32 idItem, const QPointF &origin, qreal angle,
|
||||
const QString &suffix, VContainer *data, quint32 id);
|
||||
template <class Item>
|
||||
static void UpdateCurveWithSegments(quint32 idTool, quint32 idItem, const QPointF &origin, qreal formulaAngle,
|
||||
static void UpdateCurveWithSegments(quint32 idTool, quint32 idItem, const QPointF &origin, qreal angle,
|
||||
const QString &suffix, VContainer *data, quint32 id);
|
||||
};
|
||||
|
||||
|
|
|
@ -53,11 +53,11 @@ class VToolPointOfContact : public VToolSinglePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||
static QPointF FindPoint(const qreal &arcRadius, const QPointF ¢er, const QPointF &firstPoint,
|
||||
static QPointF FindPoint(const qreal &radius, const QPointF ¢er, const QPointF &firstPoint,
|
||||
const QPointF &secondPoint);
|
||||
static VToolPointOfContact* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolPointOfContact* Create(const quint32 _id, QString &arcRadius, const quint32 ¢er,
|
||||
static VToolPointOfContact* Create(const quint32 _id, QString &radius, const quint32 ¢er,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const QString &pointName,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||
|
@ -108,7 +108,7 @@ private:
|
|||
/** @brief secondPointId id second line point. */
|
||||
quint32 secondPointId;
|
||||
|
||||
VToolPointOfContact(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &arcRadius,
|
||||
VToolPointOfContact(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &radius,
|
||||
const quint32 ¢er, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
};
|
||||
|
|
|
@ -53,11 +53,11 @@ public:
|
|||
static VToolPointOfIntersectionArcs *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolPointOfIntersectionArcs *Create(const quint32 _id, const QString &pointName, const quint32 &firstArcId,
|
||||
const quint32 &secondArcId, CrossCirclesPoint crossPoint,
|
||||
const quint32 &secondArcId, CrossCirclesPoint pType,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||
const Source &typeCreation);
|
||||
static QPointF FindPoint(const VArc *arc1, const VArc *arc2, const CrossCirclesPoint crossPoint);
|
||||
static QPointF FindPoint(const VArc *arc1, const VArc *arc2, const CrossCirclesPoint pType);
|
||||
static const QString ToolType;
|
||||
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
||||
enum { Type = UserType + static_cast<int>(Tool::PointOfIntersectionArcs) };
|
||||
|
@ -94,7 +94,7 @@ private:
|
|||
CrossCirclesPoint crossPoint;
|
||||
|
||||
VToolPointOfIntersectionArcs(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &firstArcId,
|
||||
const quint32 &secondArcId, CrossCirclesPoint crossPoint, const Source &typeCreation,
|
||||
const quint32 &secondArcId, CrossCirclesPoint pType, const Source &typeCreation,
|
||||
QGraphicsItem * parent = nullptr);
|
||||
};
|
||||
|
||||
|
|
|
@ -47,11 +47,11 @@ class VToolSeamAllowance : public VAbstractTool, public QGraphicsPathItem
|
|||
public:
|
||||
virtual ~VToolSeamAllowance();
|
||||
|
||||
static VToolSeamAllowance* Create(DialogTool *m_dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolSeamAllowance* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolSeamAllowance* Create(quint32 id, VPiece newPiece, QString &width, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||
const Source &typeCreation, const QString &m_drawName = QString());
|
||||
const Source &typeCreation, const QString &drawName = QString());
|
||||
|
||||
static const quint8 pieceVersion;
|
||||
|
||||
|
@ -152,7 +152,7 @@ private:
|
|||
void SetDialog();
|
||||
|
||||
VToolSeamAllowance(VAbstractPattern *doc, VContainer *data, const quint32 &id, const Source &typeCreation,
|
||||
VMainGraphicsScene *scene, const QString &m_drawName, QGraphicsItem * parent = nullptr);
|
||||
VMainGraphicsScene *scene, const QString &drawName, QGraphicsItem * parent = nullptr);
|
||||
|
||||
void UpdateExcludeState();
|
||||
void RefreshGeometry();
|
||||
|
|
|
@ -39,7 +39,7 @@ class DeletePiece : public VUndoCommand
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DeletePiece(VAbstractPattern *doc, quint32 id, const VPiece &m_detail, QUndoCommand *parent = nullptr);
|
||||
DeletePiece(VAbstractPattern *doc, quint32 id, const VPiece &detail, QUndoCommand *parent = nullptr);
|
||||
virtual ~DeletePiece();
|
||||
|
||||
virtual void undo() Q_DECL_OVERRIDE;
|
||||
|
|
|
@ -44,7 +44,7 @@ class MoveSpline : public VUndoCommand
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MoveSpline(VAbstractPattern *doc, const VSpline *oldSpl, const VSpline &spl, const quint32 &id,
|
||||
MoveSpline(VAbstractPattern *doc, const VSpline *oldSpl, const VSpline &newSpl, const quint32 &id,
|
||||
QUndoCommand *parent = nullptr);
|
||||
virtual ~MoveSpline() Q_DECL_OVERRIDE;
|
||||
virtual void undo() Q_DECL_OVERRIDE;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
class SavePieceOptions : public VUndoCommand
|
||||
{
|
||||
public:
|
||||
SavePieceOptions(const VPiece &m_oldDet, const VPiece &m_newDet, VAbstractPattern *doc, quint32 id,
|
||||
SavePieceOptions(const VPiece &oldDet, const VPiece &newDet, VAbstractPattern *doc, quint32 id,
|
||||
QUndoCommand *parent = nullptr);
|
||||
virtual ~SavePieceOptions();
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
virtual ~VisToolPiecePath() Q_DECL_EQ_DEFAULT;
|
||||
|
||||
virtual void RefreshGeometry() Q_DECL_OVERRIDE;
|
||||
void SetPath(const VPiecePath &piece);
|
||||
void SetPath(const VPiecePath &path);
|
||||
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
||||
enum { Type = UserType + static_cast<int>(Vis::ToolPiecePath)};
|
||||
|
||||
|
|
|
@ -110,8 +110,8 @@ private:
|
|||
|
||||
QPoint GetCorner(const QRect& rect, const Corner corner) const;
|
||||
|
||||
QRect AdjustRect(const QRect& rect, const qint8 offsetOutside, const qint8 offsetInside, const qint8 offsetStart,
|
||||
const qint8 offsetEnd) const;
|
||||
QRect AdjustRect(const QRect& rect, const qint8 offsetOutside, const qint8 offsetInside,
|
||||
const qint8 offsetBeginning, const qint8 offsetEnd) const;
|
||||
|
||||
// Same with a point. + means towards Outside/End, - means towards Inside/Beginning
|
||||
QPoint AdjustPoint(const QPoint& point, const qint8 offsetInsideOutside, const qint8 offsetBeginningEnd) const;
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
static QColor sidebarHighlight();
|
||||
|
||||
// Sets the base color and makes sure all top level widgets are updated
|
||||
static void setBaseColor(const QColor &color);
|
||||
static void setBaseColor(const QColor &newcolor);
|
||||
static void drawIconWithShadow(const QIcon &icon, const QRect &rect, QPainter *p, QIcon::Mode iconMode,
|
||||
int dipRadius = 3, const QColor &color = QColor(0, 0, 0, 130),
|
||||
const QPoint &dipOffset = QPoint(1, -2));
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
void setVerScrollBar(const qint32 &value);
|
||||
QTransform transform() const;
|
||||
void setTransform(const QTransform &transform);
|
||||
void SetDisableTools(bool enabled, const QString &namePP);
|
||||
void SetDisableTools(bool disable, const QString &namePP);
|
||||
QPointF getScenePos() const;
|
||||
|
||||
QRectF VisibleItemsBoundingRect() const;
|
||||
|
|
Loading…
Reference in New Issue
Block a user