error: implicit conversion changes signedness: 'quint32' (aka 'unsigned int')

to 'int'.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-12-29 17:13:30 +02:00
parent f83f28998f
commit d0dc209c45
3 changed files with 33 additions and 3 deletions

View File

@ -377,6 +377,35 @@ quint32 VDomDocument::GetParametrUInt(const QDomElement &domElement, const QStri
return id;
}
//---------------------------------------------------------------------------------------------------------------------
int VDomDocument::GetParametrInt(const QDomElement &domElement, const QString &name, const QString &defValue)
{
Q_ASSERT_X(not name.isEmpty(), Q_FUNC_INFO, "name of parametr is empty");
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); //-V591
bool ok = false;
QString parametr;
int value = 0;
try
{
parametr = GetParametrString(domElement, name, defValue);
value = parametr.toInt(&ok);
if (ok == false)
{
throw VExceptionConversionError(QObject::tr("Can't convert toInt parameter"), name);
}
}
catch (const VExceptionEmptyParameter &e)
{
VExceptionConversionError excep(QObject::tr("Can't convert toInt parameter"), name);
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
return value;
}
//---------------------------------------------------------------------------------------------------------------------
bool VDomDocument::GetParametrBool(const QDomElement &domElement, const QString &name, const QString &defValue)
{

View File

@ -106,6 +106,7 @@ public:
bool removeCondition) const;
static quint32 GetParametrUInt(const QDomElement& domElement, const QString &name, const QString &defValue);
static int GetParametrInt(const QDomElement& domElement, const QString &name, const QString &defValue);
static bool GetParametrBool(const QDomElement& domElement, const QString &name, const QString &defValue);
static NodeUsage GetParametrUsage(const QDomElement& domElement, const QString &name);

View File

@ -92,13 +92,13 @@ VWatermarkData VWatermark::GetWatermark() const
if (not root.isNull() && root.isElement())
{
const QDomElement rootElement = root.toElement();
data.opacity = GetParametrUInt(rootElement, AttrOpacity, QChar('2'));
data.opacity = GetParametrInt(rootElement, AttrOpacity, QChar('2'));
QDomElement text = rootElement.firstChildElement(TagText);
if (not text.isNull())
{
data.text = GetParametrEmptyString(text, AttrText);
data.textRotation = GetParametrUInt(text, AttrRotation, QChar('0'));
data.textRotation = GetParametrInt(text, AttrRotation, QChar('0'));
data.font.fromString(GetParametrEmptyString(text, AttrFont));
}
@ -106,7 +106,7 @@ VWatermarkData VWatermark::GetWatermark() const
if (not image.isNull())
{
data.path = GetParametrEmptyString(image, AttrPath);
data.imageRotation = GetParametrUInt(image, AttrRotation, QChar('0'));
data.imageRotation = GetParametrInt(image, AttrRotation, QChar('0'));
data.grayscale = GetParametrBool(image, AttrGrayscale, falseStr);
}
}