From 979d5bd6aefe1509d41effd7231410c5e7ae0a34 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 12 Jul 2019 20:23:35 +0300 Subject: [PATCH] Don't check margin keys if user pass --ignoremargins. (grafted from 4a3352b0be6bd084640690666af96f0c784020a4) --HG-- branch : develop --- ChangeLog.txt | 1 + src/app/valentina/core/vcmdexport.cpp | 36 ++++++++++++++++----------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 66de4fc12..cc4b38722 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -56,6 +56,7 @@ - Fix visualization for tool Point from arc and tangent. - Changing settings for move and rotate tools through property browser does not take in count previous change for label point and Show label option. - Fix locking file after double save as. +- Key --ignoremargins still required margins. # Version 0.6.1 October 23, 2018 - [#885] Regression. Broken support for multi size measurements. diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index 176956c0c..be70fc2af 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -135,21 +135,29 @@ VLayoutGeneratorPtr VCommandLine::DefaultGenerator() const } }; - CheckKey(LONG_OPTION_LEFT_MARGIN, translate("VCommandLine", "Left margin must be used together with page units.")); - CheckKey(LONG_OPTION_RIGHT_MARGIN, - translate("VCommandLine", "Right margin must be used together with page units.")); - CheckKey(LONG_OPTION_TOP_MARGIN, translate("VCommandLine", "Top margin must be used together with page units.")); - CheckKey(LONG_OPTION_BOTTOM_MARGIN, - translate("VCommandLine", "Bottom margin must be used together with page units.")); + if (not IsOptionSet(LONG_OPTION_IGNORE_MARGINS)) + { + CheckKey(LONG_OPTION_LEFT_MARGIN, + translate("VCommandLine", "Left margin must be used together with page units.")); + CheckKey(LONG_OPTION_RIGHT_MARGIN, + translate("VCommandLine", "Right margin must be used together with page units.")); + CheckKey(LONG_OPTION_TOP_MARGIN, + translate("VCommandLine", "Top margin must be used together with page units.")); + CheckKey(LONG_OPTION_BOTTOM_MARGIN, + translate("VCommandLine", "Bottom margin must be used together with page units.")); + } - CheckKey(LONG_OPTION_TILED_PDF_LEFT_MARGIN, - translate("VCommandLine", "Tiled left margin must be used together with page units.")); - CheckKey(LONG_OPTION_TILED_PDF_RIGHT_MARGIN, - translate("VCommandLine", "Tiled right margin must be used together with page units.")); - CheckKey(LONG_OPTION_TILED_PDF_TOP_MARGIN, - translate("VCommandLine", "Tiled top margin must be used together with page units.")); - CheckKey(LONG_OPTION_TILED_PDF_BOTTOM_MARGIN, - translate("VCommandLine", "Tiled bottom margin must be used together with page units.")); + if (static_cast(OptExportType()) == LayoutExportFormats::PDFTiled) + { + CheckKey(LONG_OPTION_TILED_PDF_LEFT_MARGIN, + translate("VCommandLine", "Tiled left margin must be used together with page units.")); + CheckKey(LONG_OPTION_TILED_PDF_RIGHT_MARGIN, + translate("VCommandLine", "Tiled right margin must be used together with page units.")); + CheckKey(LONG_OPTION_TILED_PDF_TOP_MARGIN, + translate("VCommandLine", "Tiled top margin must be used together with page units.")); + CheckKey(LONG_OPTION_TILED_PDF_BOTTOM_MARGIN, + translate("VCommandLine", "Tiled bottom margin must be used together with page units.")); + } // if present units MUST be set before any other to keep conversions correct if (!diag.SelectTemplate(OptPaperSize()))