diff --git a/src/libs/vdxf/libdxfrw/drw_entities.h b/src/libs/vdxf/libdxfrw/drw_entities.h index fa34584ba..79095fb35 100644 --- a/src/libs/vdxf/libdxfrw/drw_entities.h +++ b/src/libs/vdxf/libdxfrw/drw_entities.h @@ -664,7 +664,7 @@ public: delete item; } void applyExtrusion() override; - void addVertex(DRW_Vertex2D v) + void addVertex(const DRW_Vertex2D &v) { auto *vert = new DRW_Vertex2D(); vert->x = v.x; @@ -917,7 +917,7 @@ public: for (DRW_Vertex *item : vertlist) delete item; } - void addVertex(DRW_Vertex v) + void addVertex(const DRW_Vertex& v) { auto *vert = new DRW_Vertex(); vert->basePoint.x = v.basePoint.x; diff --git a/src/libs/vdxf/libdxfrw/drw_header.cpp b/src/libs/vdxf/libdxfrw/drw_header.cpp index 017a60cc4..bac771819 100644 --- a/src/libs/vdxf/libdxfrw/drw_header.cpp +++ b/src/libs/vdxf/libdxfrw/drw_header.cpp @@ -1831,7 +1831,7 @@ void DRW_Header::write(const std::unique_ptr &writer, DRW::Version ve #endif } -void DRW_Header::addDouble(std::string key, double value, int code) +void DRW_Header::addDouble(const std::string &key, double value, int code) { curr = new DRW_Variant(); curr->addDouble(value); @@ -1839,7 +1839,7 @@ void DRW_Header::addDouble(std::string key, double value, int code) vars[key] = curr; } -void DRW_Header::addInt(std::string key, int value, int code) +void DRW_Header::addInt(const std::string &key, int value, int code) { curr = new DRW_Variant(); curr->addInt(value); @@ -1847,7 +1847,7 @@ void DRW_Header::addInt(std::string key, int value, int code) vars[key] = curr; } -void DRW_Header::addStr(std::string key, const std::string &value, int code) +void DRW_Header::addStr(const std::string &key, const std::string &value, int code) { curr = new DRW_Variant(); curr->addString(value); @@ -1855,7 +1855,7 @@ void DRW_Header::addStr(std::string key, const std::string &value, int code) vars[key] = curr; } -void DRW_Header::addCoord(std::string key, const DRW_Coord &value, int code) +void DRW_Header::addCoord(const std::string &key, const DRW_Coord &value, int code) { curr = new DRW_Variant(); curr->addCoord(value); diff --git a/src/libs/vdxf/libdxfrw/drw_header.h b/src/libs/vdxf/libdxfrw/drw_header.h index a6f4b92df..092b325c6 100644 --- a/src/libs/vdxf/libdxfrw/drw_header.h +++ b/src/libs/vdxf/libdxfrw/drw_header.h @@ -107,10 +107,10 @@ public: return *this; } - void addDouble(std::string key, double value, int code); - void addInt(std::string key, int value, int code); - void addStr(std::string key, const std::string &value, int code); - void addCoord(std::string key, const DRW_Coord &value, int code); + void addDouble(const std::string &key, double value, int code); + void addInt(const std::string &key, int value, int code); + void addStr(const std::string &key, const std::string &value, int code); + void addCoord(const std::string &key, const DRW_Coord &value, int code); auto getComments() const -> std::string { return comments; } void write(const std::unique_ptr& writer, DRW::Version ver); void addComment(const std::string &c); diff --git a/src/libs/vdxf/libdxfrw/intern/dxfwriter.cpp b/src/libs/vdxf/libdxfrw/intern/dxfwriter.cpp index 0b12cf874..abdd92d24 100644 --- a/src/libs/vdxf/libdxfrw/intern/dxfwriter.cpp +++ b/src/libs/vdxf/libdxfrw/intern/dxfwriter.cpp @@ -105,7 +105,7 @@ auto dxfWriter::writeUtf8Caps(int code, const std::string &text) -> bool return writeString(code, t); } -auto dxfWriterBinary::writeString(int code, std::string text) -> bool +auto dxfWriterBinary::writeString(int code, const std::string &text) -> bool { char bufcode[2]; bufcode[0] = static_cast(code & 0xFF); @@ -227,7 +227,7 @@ dxfWriterAscii::dxfWriterAscii(std::ofstream *stream):dxfWriter(stream){ filestr->precision(16); } -auto dxfWriterAscii::writeString(int code, std::string text) -> bool +auto dxfWriterAscii::writeString(int code, const std::string &text) -> bool { // *filestr << code << std::endl << text << std::endl ; filestr->width(3); diff --git a/src/libs/vdxf/libdxfrw/intern/dxfwriter.h b/src/libs/vdxf/libdxfrw/intern/dxfwriter.h index 8bbd4b5ac..934f9f66f 100644 --- a/src/libs/vdxf/libdxfrw/intern/dxfwriter.h +++ b/src/libs/vdxf/libdxfrw/intern/dxfwriter.h @@ -25,7 +25,7 @@ public: } virtual ~dxfWriter() = default; - virtual auto writeString(int code, std::string text) -> bool = 0; + virtual auto writeString(int code, const std::string &text) -> bool = 0; auto writeUtf8String(int code, const std::string &text) -> bool; auto writeUtf8Caps(int code, const std::string &text) -> bool; auto fromUtf8String(const std::string &t) -> std::string { return encoder.fromUtf8(t); } @@ -52,7 +52,7 @@ public: using dxfWriter::dxfWriter; virtual ~dxfWriterBinary() = default; - virtual auto writeString(int code, std::string text) -> bool override; + virtual auto writeString(int code, const std::string &text) -> bool override; virtual auto writeInt16(int code, int data) -> bool override; virtual auto writeInt32(int code, int data) -> bool override; virtual auto writeInt64(int code, unsigned long long int data) -> bool override; @@ -65,7 +65,7 @@ class dxfWriterAscii final : public dxfWriter public: explicit dxfWriterAscii(std::ofstream *stream); virtual ~dxfWriterAscii() = default; - virtual auto writeString(int code, std::string text) -> bool override; + virtual auto writeString(int code, const std::string &text) -> bool override; virtual auto writeInt16(int code, int data) -> bool override; virtual auto writeInt32(int code, int data) -> bool override; virtual auto writeInt64(int code, unsigned long long int data) -> bool override; diff --git a/src/libs/vdxf/libdxfrw/libdxfrw.cpp b/src/libs/vdxf/libdxfrw/libdxfrw.cpp index 5d6799146..fbbe8b4fe 100644 --- a/src/libs/vdxf/libdxfrw/libdxfrw.cpp +++ b/src/libs/vdxf/libdxfrw/libdxfrw.cpp @@ -1685,7 +1685,7 @@ auto dxfRW::writeImage(DRW_Image *ent, const std::string &name) -> DRW_ImageDef return nullptr; // not exist in acad 12 } -auto dxfRW::writeBlockRecord(std::string name) -> bool +auto dxfRW::writeBlockRecord(const std::string &name) -> bool { if (version > DRW::AC1009) { diff --git a/src/libs/vdxf/libdxfrw/libdxfrw.h b/src/libs/vdxf/libdxfrw/libdxfrw.h index 0c55f5b91..6daa11c10 100644 --- a/src/libs/vdxf/libdxfrw/libdxfrw.h +++ b/src/libs/vdxf/libdxfrw/libdxfrw.h @@ -69,7 +69,7 @@ public: auto writeLWPolyline(DRW_LWPolyline *ent) -> bool; auto writePolyline(DRW_Polyline *ent) -> bool; auto writeSpline(DRW_Spline *ent) -> bool; - auto writeBlockRecord(std::string name) -> bool; + auto writeBlockRecord(const std::string &name) -> bool; auto writeBlock(DRW_Block *bk) -> bool; auto writeInsert(DRW_Insert *ent) -> bool; auto writeMText(DRW_MText *ent) -> bool; diff --git a/src/libs/vgeometry/vsplinepoint_p.h b/src/libs/vgeometry/vsplinepoint_p.h index 6f2e05330..f6016c7b9 100644 --- a/src/libs/vgeometry/vsplinepoint_p.h +++ b/src/libs/vgeometry/vsplinepoint_p.h @@ -90,7 +90,7 @@ class VSplinePointData final : public QSharedData { public: VSplinePointData() = default; - VSplinePointData(VPointF pSpline, qreal angle1, const QString &angle1F, qreal angle2, const QString &angle2F, + VSplinePointData(const VPointF &pSpline, qreal angle1, const QString &angle1F, qreal angle2, const QString &angle2F, qreal length1, const QString &length1F, qreal length2, const QString &length2F); VSplinePointData(const VSplinePointData &point); ~VSplinePointData() = default; @@ -119,7 +119,7 @@ private: }; //--------------------------------------------------------------------------------------------------------------------- -inline VSplinePointData::VSplinePointData(VPointF pSpline, qreal angle1, const QString &angle1F, qreal angle2, +inline VSplinePointData::VSplinePointData(const VPointF &pSpline, qreal angle1, const QString &angle1F, qreal angle2, const QString &angle2F, qreal length1, const QString &length1F, qreal length2, const QString &length2F) : pSpline(pSpline), diff --git a/src/test/ValentinaTest/tst_vabstractcurve.cpp b/src/test/ValentinaTest/tst_vabstractcurve.cpp index 0adaf4a51..c5457c86f 100644 --- a/src/test/ValentinaTest/tst_vabstractcurve.cpp +++ b/src/test/ValentinaTest/tst_vabstractcurve.cpp @@ -178,7 +178,7 @@ void TST_VAbstractCurve::CurveIntersectLine_data() QTest::addColumn>("intersections"); QTest::addColumn("line"); - auto ASSERT_TEST_CASE = [](const char *title, const QString &input, const QString &output, QLineF line) + auto ASSERT_TEST_CASE = [](const char *title, const QString &input, const QString &output, const QLineF &line) { QVector const points = AbstractTest::VectorFromJson(input); QVector const intersections = AbstractTest::VectorFromJson(output);