diff --git a/ChangeLog.txt b/ChangeLog.txt
index ae8a2f9be..3a86be3b1 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -41,6 +41,8 @@
- [#560] Flipped pattern pieces in Layout.
- [#138] New tool: 'Mirror Point' or 'Symmetric Point'.
- [#573] New tool: 'Move Point'.
+- [#577] 10 new colors added for the lines
+- [#570] Tiled PDF : Margin values correctly taken into account
# Version 0.4.5 October 15, 2016
- [#435] Valentina doesn't change the cursor.
diff --git a/dist/ebuild/valentina-0.0.0(template_stable).ebuild b/dist/ebuild/valentina-0.0.0(template_stable).ebuild
index a36c0c907..eba6dc87f 100644
--- a/dist/ebuild/valentina-0.0.0(template_stable).ebuild
+++ b/dist/ebuild/valentina-0.0.0(template_stable).ebuild
@@ -33,7 +33,7 @@ CDEPEND="
dev-qt/qtprintsupport:5
dev-qt/qtnetwork:5
app-text/poppler"
-RDEPEND="${CDEPEND}
+RDEPEND="${CDEPEND}"
DEPEND="${CDEPEND}
app-arch/unzip"
diff --git a/dist/ebuild/valentina-0.0.0_alpha(template_unstable).ebuild b/dist/ebuild/valentina-0.0.0_alpha(template_unstable).ebuild
index 8b2191555..104fcc9fa 100644
--- a/dist/ebuild/valentina-0.0.0_alpha(template_unstable).ebuild
+++ b/dist/ebuild/valentina-0.0.0_alpha(template_unstable).ebuild
@@ -35,7 +35,7 @@ CDEPEND="
dev-qt/qtprintsupport:5
dev-qt/qtnetwork:5
app-text/poppler"
-RDEPEND="${CDEPEND}
+RDEPEND="${CDEPEND}"
DEPEND="${CDEPEND}
dev-util/ccache"
diff --git a/src/app/tape/dialogs/dialogmdatabase.cpp b/src/app/tape/dialogs/dialogmdatabase.cpp
index ea5c5304e..e3ce2ccf8 100644
--- a/src/app/tape/dialogs/dialogmdatabase.cpp
+++ b/src/app/tape/dialogs/dialogmdatabase.cpp
@@ -168,7 +168,7 @@ void DialogMDataBase::RetranslateGroups()
QString DialogMDataBase::ImgTag(const QString &number)
{
QString imgUrl(""); // In case of error
- const QString filePath = QString("://diagrams/%1.svg").arg(MapDiagrams(number));
+ const QString filePath = QString("://diagrams/%1.svg").arg(MapDiagrams(qApp->TrVars(), number));
if (QFileInfo(filePath).exists())
{
// Load your SVG
diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp
index f6d1c7d9a..f938970f3 100644
--- a/src/app/valentina/core/vcmdexport.cpp
+++ b/src/app/valentina/core/vcmdexport.cpp
@@ -33,6 +33,7 @@
#include "../vformat/vmeasurements.h"
#include "../vmisc/commandoptions.h"
#include "../vmisc/vsettings.h"
+#include
VCommandLinePtr VCommandLine::instance = nullptr;
diff --git a/src/app/valentina/core/vformulapropertyeditor.cpp b/src/app/valentina/core/vformulapropertyeditor.cpp
index ca671c9c2..0100c8741 100644
--- a/src/app/valentina/core/vformulapropertyeditor.cpp
+++ b/src/app/valentina/core/vformulapropertyeditor.cpp
@@ -33,6 +33,8 @@
#include
#include
#include
+#include
+#include
#include "../vpropertyexplorer/vproperty.h"
#include "../vtools/dialogs/support/dialogeditwrongformula.h"
diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp
index 864e44aae..40183cc34 100644
--- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp
+++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp
@@ -40,6 +40,8 @@
#include
#include
+#include
+#include
using namespace VPE;
diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp
index 3fd144b6b..bd177bdea 100644
--- a/src/app/valentina/dialogs/dialoghistory.cpp
+++ b/src/app/valentina/dialogs/dialoghistory.cpp
@@ -39,6 +39,7 @@
#include "../vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h"
#include "../xml/vpattern.h"
#include "../vmisc/diagnostic.h"
+#include
//---------------------------------------------------------------------------------------------------------------------
/**
diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp
index f4cb267cd..6faed5795 100644
--- a/src/app/valentina/dialogs/dialogsavelayout.cpp
+++ b/src/app/valentina/dialogs/dialogsavelayout.cpp
@@ -38,6 +38,7 @@
#include
#include
#include
+#include
const QString baseFilenameRegExp = QStringLiteral("^[\\w\\-. ]+$");
diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp
index 141bf9f81..b9e60f453 100644
--- a/src/app/valentina/mainwindowsnogui.cpp
+++ b/src/app/valentina/mainwindowsnogui.cpp
@@ -384,7 +384,27 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer)
// Render
QRectF source;
isTiled ? source = poster->at(index).rect : source = paper->rect();
- QRectF target(0, 0, source.width() * scale, source.height() * scale);
+
+ qreal x,y;
+ if(printer->fullPage())
+ {
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
+ QMarginsF printerMargins = printer->pageLayout().margins();
+ x = qFloor(ToPixel(printerMargins.left(),Unit::Mm));
+ y = qFloor(ToPixel(printerMargins.top(),Unit::Mm));
+ #else
+ qreal left = 0, top = 0, right = 0, bottom = 0;
+ printer->getPageMargins(&left, &top, &right, &bottom, QPrinter::Millimeter);
+ x = qFloor(ToPixel(left,Unit::Mm));
+ y = qFloor(ToPixel(top,Unit::Mm));
+ #endif
+ }
+ else
+ {
+ x = 0; y = 0;
+ }
+
+ QRectF target(x * scale, y * scale, source.width() * scale, source.height() * scale);
scenes.at(paperIndex)->render(&painter, target, source, Qt::IgnoreAspectRatio);
diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp
index 9f2a0cc01..c6186ca16 100644
--- a/src/app/valentina/xml/vpattern.cpp
+++ b/src/app/valentina/xml/vpattern.cpp
@@ -56,6 +56,8 @@
#include
#include
#include
+#include
+#include
const QString VPattern::AttrReadOnly = QStringLiteral("readOnly");
diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp
index d581ea542..450dede6e 100644
--- a/src/libs/ifc/ifcdef.cpp
+++ b/src/libs/ifc/ifcdef.cpp
@@ -144,13 +144,23 @@ const QString TypeLineDotLine = QStringLiteral("dotLine");
const QString TypeLineDashDotLine = QStringLiteral("dashDotLine");
const QString TypeLineDashDotDotLine = QStringLiteral("dashDotDotLine");
-const QString ColorBlack = QStringLiteral("black");
-const QString ColorGreen = QStringLiteral("green");
-const QString ColorBlue = QStringLiteral("blue");
-const QString ColorDarkRed = QStringLiteral("darkRed");
-const QString ColorDarkGreen = QStringLiteral("darkGreen");
-const QString ColorDarkBlue = QStringLiteral("darkBlue");
-const QString ColorYellow = QStringLiteral("yellow");
+const QString ColorBlack = QStringLiteral("black");
+const QString ColorGreen = QStringLiteral("green");
+const QString ColorBlue = QStringLiteral("blue");
+const QString ColorDarkRed = QStringLiteral("darkRed");
+const QString ColorDarkGreen = QStringLiteral("darkGreen");
+const QString ColorDarkBlue = QStringLiteral("darkBlue");
+const QString ColorYellow = QStringLiteral("yellow");
+const QString ColorLightSalmon = QStringLiteral("lightsalmon");
+const QString ColorGoldenRod = QStringLiteral("goldenrod");
+const QString ColorOrange = QStringLiteral("orange");
+const QString ColorDeepPink = QStringLiteral("deeppink");
+const QString ColorViolet = QStringLiteral("violet");
+const QString ColorDarkViolet = QStringLiteral("darkviolet");
+const QString ColorMediumSeaGreen = QStringLiteral("mediumseagreen");
+const QString ColorLime = QStringLiteral("lime");
+const QString ColorDeepSkyBlue = QStringLiteral("deepskyblue");
+const QString ColorCornFlowerBlue = QStringLiteral("cornflowerblue");
//variables
const QString line_ = QStringLiteral("Line_");
diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h
index 0d376157d..d3594f201 100644
--- a/src/libs/ifc/ifcdef.h
+++ b/src/libs/ifc/ifcdef.h
@@ -152,6 +152,17 @@ extern const QString ColorDarkRed;
extern const QString ColorDarkGreen;
extern const QString ColorDarkBlue;
extern const QString ColorYellow;
+extern const QString ColorLightSalmon;
+extern const QString ColorGoldenRod;
+extern const QString ColorOrange;
+extern const QString ColorDeepPink;
+extern const QString ColorViolet;
+extern const QString ColorDarkViolet;
+extern const QString ColorMediumSeaGreen;
+extern const QString ColorLime;
+extern const QString ColorDeepSkyBlue;
+extern const QString ColorCornFlowerBlue;
+
// variables name
// Hacks for avoiding the linker error "undefined reference to"
diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc
index 6a0edbcae..65b00335b 100644
--- a/src/libs/ifc/schema.qrc
+++ b/src/libs/ifc/schema.qrc
@@ -20,6 +20,7 @@
schema/pattern/v0.3.4.xsd
schema/pattern/v0.3.5.xsd
schema/pattern/v0.3.6.xsd
+ schema/pattern/v0.3.7.xsd
schema/standard_measurements/v0.3.0.xsd
schema/standard_measurements/v0.4.0.xsd
schema/standard_measurements/v0.4.1.xsd
diff --git a/src/libs/ifc/schema/pattern/v0.3.7.xsd b/src/libs/ifc/schema/pattern/v0.3.7.xsd
new file mode 100644
index 000000000..7979e681b
--- /dev/null
+++ b/src/libs/ifc/schema/pattern/v0.3.7.xsd
@@ -0,0 +1,592 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h
index 3bb8875cd..1d1ed589b 100644
--- a/src/libs/ifc/xml/vdomdocument.h
+++ b/src/libs/ifc/xml/vdomdocument.h
@@ -40,6 +40,7 @@
#include
#include
#include
+#include
#include "../ifc/ifcdef.h"
#include "../vmisc/def.h"
diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp
index 6f9788537..75f592e4d 100644
--- a/src/libs/ifc/xml/vpatternconverter.cpp
+++ b/src/libs/ifc/xml/vpatternconverter.cpp
@@ -58,8 +58,8 @@ class QDomElement;
*/
const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.0");
-const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.3.6");
-const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.3.6.xsd");
+const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.3.7");
+const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.3.7.xsd");
//VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!!
//VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!!
@@ -171,6 +171,8 @@ QString VPatternConverter::XSDSchema(int ver) const
case (0x000305):
return QStringLiteral("://schema/pattern/v0.3.5.xsd");
case (0x000306):
+ return QStringLiteral("://schema/pattern/v0.3.6.xsd");
+ case (0x000307):
return CurrentSchema;
default:
InvalidVersion(ver);
@@ -262,6 +264,10 @@ void VPatternConverter::ApplyPatches()
ValidateXML(XSDSchema(0x000306), fileName);
V_FALLTHROUGH
case (0x000306):
+ ToV0_3_7();
+ ValidateXML(XSDSchema(0x000307), fileName);
+ V_FALLTHROUGH
+ case (0x000307):
break;
default:
break;
@@ -436,6 +442,13 @@ void VPatternConverter::ToV0_3_6()
Save();
}
+//---------------------------------------------------------------------------------------------------------------------
+void VPatternConverter::ToV0_3_7()
+{
+ SetVersion(QStringLiteral("0.3.7"));
+ Save();
+}
+
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::TagUnitToV0_2_0()
{
diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h
index 87cd058d2..e7fea3f78 100644
--- a/src/libs/ifc/xml/vpatternconverter.h
+++ b/src/libs/ifc/xml/vpatternconverter.h
@@ -55,10 +55,10 @@ public:
// GCC 4.6 doesn't allow constexpr and const together
#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) <= 406
static Q_DECL_CONSTEXPR int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0);
- static Q_DECL_CONSTEXPR int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 3, 6);
+ static Q_DECL_CONSTEXPR int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 3, 7);
#else
static Q_DECL_CONSTEXPR const int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0);
- static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 3, 6);
+ static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 3, 7);
#endif
protected:
@@ -95,6 +95,7 @@ private:
void ToV0_3_4();
void ToV0_3_5();
void ToV0_3_6();
+ void ToV0_3_7();
void TagUnitToV0_2_0();
void TagIncrementToV0_2_0();
diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp
index d413ab148..34d05b03f 100644
--- a/src/libs/vlayout/vposter.cpp
+++ b/src/libs/vlayout/vposter.cpp
@@ -267,8 +267,28 @@ QRect VPoster::PageRect() const
// we can't use method pageRect(QPrinter::Point). Our dpi value can be different.
// We convert value yourself to pixels.
const QRectF rect = printer->pageRect(QPrinter::Millimeter);
- const QRect pageRect(0, 0, qFloor(ToPixel(rect.width())), qFloor(ToPixel(rect.height())));
- return pageRect;
+
+ if(printer->fullPage())
+ {
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
+ QMarginsF pMargins = printer->pageLayout().margins();
+ QRectF newRect = rect.marginsRemoved(pMargins);
+ const QRect pageRectFP(0, 0, qFloor(ToPixel(newRect.width())), qFloor(ToPixel(newRect.height())));
+ return pageRectFP;
+ #else
+ qreal left = 0 , top = 0, right = 0, bottom = 0;
+ printer->getPageMargins(&left, &top, &right, &bottom, QPrinter::Millimeter);
+ qreal newWidth = rect.width()-left-right;
+ qreal newHeight = rect.height()-top-bottom;
+ const QRect pageRectFP(0, 0, qFloor(ToPixel(newWidth)), qFloor(ToPixel(newHeight)));
+ return pageRectFP;
+ #endif
+ }
+ else
+ {
+ const QRect pageRect(0, 0, qFloor(ToPixel(rect.width())), qFloor(ToPixel(rect.height())));
+ return pageRect;
+ }
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp
index af7e43258..fdf0eaa47 100644
--- a/src/libs/vmisc/def.cpp
+++ b/src/libs/vmisc/def.cpp
@@ -1147,20 +1147,22 @@ QStringList ListPMSystems()
}
//---------------------------------------------------------------------------------------------------------------------
-QStringList ListNumbers(const QStringList &listMeasurements)
+QStringList ListNumbers(const VTranslateMeasurements *trM, const QStringList &listMeasurements)
{
+ SCASSERT(trM != nullptr);
+
QStringList numbers;
for (int i=0; i < listMeasurements.size(); ++i)
{
- numbers.append(qApp->TrVars()->MNumber(listMeasurements.at(i)));
+ numbers.append(trM->MNumber(listMeasurements.at(i)));
}
return numbers;
}
//---------------------------------------------------------------------------------------------------------------------
-QString MapDiagrams(const QString &number)
+QString MapDiagrams(const VTranslateMeasurements *trM, const QString &number)
{
- switch (ListNumbers(ListGroupA()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupA()).indexOf(number))
{
// A
case 0: // A01
@@ -1213,7 +1215,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupB()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupB()).indexOf(number))
{
// B
case 0: // B01
@@ -1230,7 +1232,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupC()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupC()).indexOf(number))
{
// C
case 0: // C01
@@ -1243,7 +1245,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupD()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupD()).indexOf(number))
{
// D
case 0: // D01
@@ -1260,7 +1262,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupE()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupE()).indexOf(number))
{
// E
case 0: // E01
@@ -1275,7 +1277,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupF()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupF()).indexOf(number))
{
// F
case 0: // F01
@@ -1294,7 +1296,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupG()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupG()).indexOf(number))
{
// G
case 0: // G01
@@ -1393,7 +1395,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupH()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupH()).indexOf(number))
{
// H
case 0: // H01
@@ -1484,7 +1486,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupI()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupI()).indexOf(number))
{
// I
case 0: // I01
@@ -1519,7 +1521,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupJ()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupJ()).indexOf(number))
{
// J
case 0: // J01
@@ -1546,7 +1548,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupK()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupK()).indexOf(number))
{
// K
case 0: // K01
@@ -1579,7 +1581,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupL()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupL()).indexOf(number))
{
// L
case 0: // L01
@@ -1630,7 +1632,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupM()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupM()).indexOf(number))
{
// M
case 0: // M01
@@ -1665,7 +1667,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupN()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupN()).indexOf(number))
{
// N
case 0: // N01
@@ -1688,7 +1690,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupO()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupO()).indexOf(number))
{
// O
case 0: // O01
@@ -1723,7 +1725,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupP()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupP()).indexOf(number))
{
// P
case 0: // P01
@@ -1754,7 +1756,7 @@ QString MapDiagrams(const QString &number)
break;
}
- switch (ListNumbers(ListGroupQ()).indexOf(number))
+ switch (ListNumbers(trM, ListGroupQ()).indexOf(number))
{
// Q
case 0: // Q01
diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h
index e75f431ef..dd5dda5e4 100644
--- a/src/libs/vmisc/def.h
+++ b/src/libs/vmisc/def.h
@@ -51,6 +51,7 @@ template class QSharedPointer;
class QComboBox;
class QMarginsF;
+class VTranslateMeasurements;
#define SceneSize 50000
#define DefPointRadius 1.5//mm
@@ -499,8 +500,8 @@ QStringList ListGroupO();
QStringList ListGroupP();
QStringList ListGroupQ();
-QStringList ListNumbers(const QStringList & listMeasurements);
-QString MapDiagrams(const QString &number);
+QStringList ListNumbers(const VTranslateMeasurements *trM, const QStringList & listMeasurements);
+QString MapDiagrams(const VTranslateMeasurements *trM, const QString &number);
// pattern making systems codes
extern const QString p0_S;
diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.cpp b/src/libs/vtools/dialogs/tools/dialogalongline.cpp
index ee14c0525..93909f136 100644
--- a/src/libs/vtools/dialogs/tools/dialogalongline.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogalongline.cpp
@@ -332,7 +332,7 @@ void DialogAlongLine::SetTypeLine(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogAlongLine::GetLineColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineColor);
+ return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -359,7 +359,7 @@ void DialogAlongLine::SetPointName(const QString &value)
*/
QString DialogAlongLine::GetTypeLine() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineType);
+ return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogarc.cpp b/src/libs/vtools/dialogs/tools/dialogarc.cpp
index a7f40d7b3..435cbccbc 100644
--- a/src/libs/vtools/dialogs/tools/dialogarc.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogarc.cpp
@@ -164,7 +164,7 @@ void DialogArc::SetF2(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogArc::GetColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxColor);
+ return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp
index 02cb2de0e..d283430ad 100644
--- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp
@@ -192,7 +192,7 @@ void DialogArcWithLength::SetLength(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogArcWithLength::GetColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxColor);
+ return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogbisector.cpp b/src/libs/vtools/dialogs/tools/dialogbisector.cpp
index 070edd7d5..76e617c6d 100644
--- a/src/libs/vtools/dialogs/tools/dialogbisector.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogbisector.cpp
@@ -313,7 +313,7 @@ void DialogBisector::SetThirdPointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogBisector::GetLineColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineColor);
+ return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -355,7 +355,7 @@ void DialogBisector::closeEvent(QCloseEvent *event)
*/
QString DialogBisector::GetTypeLine() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineType);
+ return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp b/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp
index 8a4fe49c2..0558c91e4 100644
--- a/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp
@@ -110,7 +110,7 @@ void DialogCubicBezier::SetSpline(const VCubicBezier &spline)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCubicBezier::GetColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxColor);
+ return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp
index 194415fb6..cf8a1f340 100644
--- a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp
@@ -117,7 +117,7 @@ void DialogCubicBezierPath::SetPath(const VCubicBezierPath &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCubicBezierPath::GetColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxColor);
+ return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp
index a83349d8a..d4ae3165e 100644
--- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp
@@ -108,7 +108,7 @@ void DialogCurveIntersectAxis::SetPointName(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCurveIntersectAxis::GetTypeLine() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineType);
+ return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -178,7 +178,7 @@ void DialogCurveIntersectAxis::setCurveId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCurveIntersectAxis::GetLineColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineColor);
+ return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogendline.cpp b/src/libs/vtools/dialogs/tools/dialogendline.cpp
index ae9f1622e..73a098eed 100644
--- a/src/libs/vtools/dialogs/tools/dialogendline.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogendline.cpp
@@ -281,7 +281,7 @@ void DialogEndLine::SetBasePointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogEndLine::GetLineColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineColor);
+ return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -375,7 +375,7 @@ DialogEndLine::~DialogEndLine()
*/
QString DialogEndLine::GetTypeLine() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineType);
+ return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogheight.cpp b/src/libs/vtools/dialogs/tools/dialogheight.cpp
index e4b3c0880..cd710a1dd 100644
--- a/src/libs/vtools/dialogs/tools/dialogheight.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogheight.cpp
@@ -164,7 +164,7 @@ void DialogHeight::SetP2LineId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogHeight::GetLineColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineColor);
+ return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -295,7 +295,7 @@ void DialogHeight::ShowVisualization()
*/
QString DialogHeight::GetTypeLine() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineType);
+ return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogline.cpp b/src/libs/vtools/dialogs/tools/dialogline.cpp
index 7258a303f..69801ed13 100644
--- a/src/libs/vtools/dialogs/tools/dialogline.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogline.cpp
@@ -110,7 +110,7 @@ void DialogLine::SetTypeLine(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLine::GetLineColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineColor);
+ return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -247,5 +247,5 @@ quint32 DialogLine::GetSecondPoint() const
*/
QString DialogLine::GetTypeLine() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineType);
+ return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp
index acd682196..698403ef7 100644
--- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp
+++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp
@@ -121,7 +121,7 @@ void DialogLineIntersectAxis::SetPointName(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLineIntersectAxis::GetTypeLine() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineType);
+ return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -207,7 +207,7 @@ void DialogLineIntersectAxis::SetSecondPointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLineIntersectAxis::GetLineColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineColor);
+ return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialognormal.cpp b/src/libs/vtools/dialogs/tools/dialognormal.cpp
index 322f8abfc..992f25314 100644
--- a/src/libs/vtools/dialogs/tools/dialognormal.cpp
+++ b/src/libs/vtools/dialogs/tools/dialognormal.cpp
@@ -242,7 +242,7 @@ void DialogNormal::SetSecondPointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogNormal::GetLineColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineColor);
+ return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -331,7 +331,7 @@ void DialogNormal::SetPointName(const QString &value)
*/
QString DialogNormal::GetTypeLine() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineType);
+ return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp
index d659aeac2..b25739dd8 100644
--- a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp
@@ -267,7 +267,7 @@ void DialogShoulderPoint::SetP3(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogShoulderPoint::GetLineColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineColor);
+ return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -354,7 +354,7 @@ void DialogShoulderPoint::SetPointName(const QString &value)
*/
QString DialogShoulderPoint::GetTypeLine() const
{
- return GetComboBoxCurrentData(ui->comboBoxLineType);
+ return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogspline.cpp b/src/libs/vtools/dialogs/tools/dialogspline.cpp
index 3c3689ee5..f1075487b 100644
--- a/src/libs/vtools/dialogs/tools/dialogspline.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogspline.cpp
@@ -614,7 +614,7 @@ void DialogSpline::SetSpline(const VSpline &spline)
//---------------------------------------------------------------------------------------------------------------------
QString DialogSpline::GetColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxColor);
+ return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp
index b9be5f697..5d1aad667 100644
--- a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp
@@ -172,7 +172,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogSplinePath::GetColor() const
{
- return GetComboBoxCurrentData(ui->comboBoxColor);
+ return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp
index 246b8a2ad..4e6a92039 100644
--- a/src/libs/vtools/dialogs/tools/dialogtool.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp
@@ -302,7 +302,7 @@ void DialogTool::FillComboBoxHCrossCurvesPoint(QComboBox *box) const
}
//---------------------------------------------------------------------------------------------------------------------
-QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const
+QString DialogTool::GetComboBoxCurrentData(const QComboBox *box, const QString &def) const
{
SCASSERT(box != nullptr)
QString value;
@@ -313,7 +313,7 @@ QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const
#endif
if (value.isEmpty())
{
- value = TypeLineLine;
+ value = def;
}
return value;
}
diff --git a/src/libs/vtools/dialogs/tools/dialogtool.h b/src/libs/vtools/dialogs/tools/dialogtool.h
index 53e4bbb1a..cc5d29af8 100644
--- a/src/libs/vtools/dialogs/tools/dialogtool.h
+++ b/src/libs/vtools/dialogs/tools/dialogtool.h
@@ -224,7 +224,7 @@ protected:
void FillComboBoxHCrossCurvesPoint(QComboBox *box) const;
virtual void CheckState();
- QString GetComboBoxCurrentData(const QComboBox *box)const;
+ QString GetComboBoxCurrentData(const QComboBox *box, const QString &def)const;
void ChangeCurrentData(QComboBox *box, const QVariant &value) const;
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer, const QString &postfix = QString());
void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer,
diff --git a/src/libs/vtools/tools/vabstracttool.cpp b/src/libs/vtools/tools/vabstracttool.cpp
index 3fd582eef..98c06914a 100644
--- a/src/libs/vtools/tools/vabstracttool.cpp
+++ b/src/libs/vtools/tools/vabstracttool.cpp
@@ -223,9 +223,12 @@ QMap VAbstractTool::LineStylesPics()
//---------------------------------------------------------------------------------------------------------------------
const QStringList VAbstractTool::Colors()
{
- const QStringList colors = QStringList() << ColorBlack << ColorGreen << ColorBlue
- << ColorDarkRed << ColorDarkGreen
- << ColorDarkBlue << ColorYellow;
+ const QStringList colors = QStringList() << ColorBlack << ColorGreen << ColorBlue
+ << ColorDarkRed << ColorDarkGreen << ColorDarkBlue
+ << ColorYellow << ColorLightSalmon << ColorGoldenRod
+ << ColorOrange << ColorDeepPink << ColorViolet
+ << ColorDarkViolet << ColorMediumSeaGreen << ColorLime
+ << ColorDeepSkyBlue << ColorCornFlowerBlue;
return colors;
}
@@ -261,6 +264,36 @@ QMap VAbstractTool::ColorsList()
case 6: // ColorYellow
name = tr("yellow");
break;
+ case 7: // ColorLightSalmon
+ name = tr("light salmon");
+ break;
+ case 8: // ColorGoldenRod
+ name = tr("golden rod");
+ break;
+ case 9: // ColorOrange
+ name = tr("orange");
+ break;
+ case 10: // ColorDeepPink
+ name = tr("deep pink");
+ break;
+ case 11: // ColorViolet
+ name = tr("violet");
+ break;
+ case 12: // ColorDarkViolet
+ name = tr("dark violet");
+ break;
+ case 13: // ColorMediumSeaGreen
+ name = tr("medium sea green");
+ break;
+ case 14: // ColorLime
+ name = tr("lime");
+ break;
+ case 15: // ColorDeepSkyBlue
+ name = tr("deep sky blue");
+ break;
+ case 16: // ColorCornFlowerBlue
+ name = tr("corn flower blue");
+ break;
default:
name = tr("black");
break;
diff --git a/src/libs/vtools/undocommands/savedetailoptions.cpp b/src/libs/vtools/undocommands/savedetailoptions.cpp
index 11a418c52..5cc0c525d 100644
--- a/src/libs/vtools/undocommands/savedetailoptions.cpp
+++ b/src/libs/vtools/undocommands/savedetailoptions.cpp
@@ -31,6 +31,7 @@
#include
#include
#include
+#include
#include "../ifc/xml/vabstractpattern.h"
#include "../ifc/ifcdef.h"
diff --git a/src/test/ValentinaTest/tst_vposter.cpp b/src/test/ValentinaTest/tst_vposter.cpp
index b2c4ccaa1..da7556904 100644
--- a/src/test/ValentinaTest/tst_vposter.cpp
+++ b/src/test/ValentinaTest/tst_vposter.cpp
@@ -50,6 +50,15 @@ void TST_VPoster::BigPoster()
printer.setFullPage(true);
// We need to set full page because otherwise QPrinter->pageRect returns different values in Windows and Linux
+ //sets the margins to 0 to perform the test.
+ const qreal left = 0, top = 0, right = 0, bottom = 0;
+#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
+ printer.setPageMargins(QMarginsF(left, top, right, bottom), QPageLayout::Millimeter);
+#else
+ printer.setPageMargins(left, top, right, bottom, QPrinter::Millimeter);
+#endif //QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
+
+
const QRect image(0, 0, 2622, 3178); // Little bit bigger than A1
VPoster posterazor(&printer);
const QVector poster = posterazor.Calc(image, 0);