Fixed test failure.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-11-22 17:49:36 +02:00
parent e8570f9812
commit b7caafb0c4
2 changed files with 9 additions and 7 deletions

View File

@ -32,6 +32,7 @@
#include "xml/vdomdocument.h" #include "xml/vdomdocument.h"
#include "../vformat/vmeasurements.h" #include "../vformat/vmeasurements.h"
#include "../vmisc/commandoptions.h" #include "../vmisc/commandoptions.h"
#include "../vmisc/vsettings.h"
VCommandLinePtr VCommandLine::instance = nullptr; VCommandLinePtr VCommandLine::instance = nullptr;
@ -352,12 +353,12 @@ VLayoutGeneratorPtr VCommandLine::DefaultGenerator() const
} }
} }
int rotateDegree = OptRotation(); const int rotateDegree = OptRotation();
diag.SetRotate(rotateDegree != 0 ); diag.SetRotate(rotateDegree != 0 ); // 0 disable rotation
if (rotateDegree != 0) if (rotateDegree != VSettings::GetDefLayoutRotationIncrease())//Value by default
{ {
if (!diag.SetIncrease(rotateDegree)) if (not diag.SetIncrease(rotateDegree))
{ {
qCritical() << translate("VCommandLine", "Invalid rotation value. That must be one of predefined values.") qCritical() << translate("VCommandLine", "Invalid rotation value. That must be one of predefined values.")
<< "\n"; << "\n";
@ -523,7 +524,7 @@ DialogLayoutSettings::PaperSizeTemplate VCommandLine::OptPaperSize() const
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
int VCommandLine::OptRotation() const int VCommandLine::OptRotation() const
{ {
int rotate = 180; int rotate = VSettings::GetDefLayoutRotationIncrease();
if (parser.isSet(*optionsUsed.value(optionsIndex.value(LONG_OPTION_ROTATE)))) if (parser.isSet(*optionsUsed.value(optionsIndex.value(LONG_OPTION_ROTATE))))
{ {
bool ok = false; bool ok = false;
@ -531,7 +532,7 @@ int VCommandLine::OptRotation() const
if (not ok) if (not ok)
{ {
rotate = 180; rotate = VSettings::GetDefLayoutRotationIncrease();
} }
} }

View File

@ -258,7 +258,8 @@ bool DialogLayoutSettings::SetIncrease(int increase)
bool failed = (index == -1); bool failed = (index == -1);
if (failed) if (failed)
{ {
index = 21;//180 degree const QString def = QString::number(VSettings::GetDefLayoutRotationIncrease());// Value by default
index = ui->comboBoxIncrease->findText(def);
} }
ui->comboBoxIncrease->setCurrentIndex(index); ui->comboBoxIncrease->setCurrentIndex(index);