r22589 by jghali - Fix a few signed/unsigned comparison warnings
scribus-commit
scribus-commit at lists.scribus.net
Sat Jun 30 13:40:20 UTC 2018
Author: jghali
Date: Sat Jun 30 13:40:20 2018
New Revision: 22589
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22589
Log:
Fix a few signed/unsigned comparison warnings
Modified:
trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/ui/gradientpreview.cpp
Modified: trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22589&path=/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp Sat Jun 30 13:40:20 2018
@@ -1594,7 +1594,7 @@
bool isFirst = true;
double actualStop = 0.0, lastStop = 0.0;
QList<VColorStop*> cstops = Item->stroke_gradient.colorStops();
- for (uint cst = 0; cst < Item->stroke_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < Item->stroke_gradient.Stops(); ++cst)
{
actualStop = cstops.at(cst)->rampPoint;
if ((actualStop != lastStop) || (isFirst))
@@ -1759,7 +1759,7 @@
bool isFirst = true;
double actualStop = 0.0, lastStop = 0.0;
QList<VColorStop*> cstops = Item->stroke_gradient.colorStops();
- for (uint cst = 0; cst < Item->stroke_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < Item->stroke_gradient.Stops(); ++cst)
{
actualStop = cstops.at(cst)->rampPoint;
if ((actualStop != lastStop) || (isFirst))
@@ -1921,7 +1921,7 @@
grad.setAttribute("id", "Grad"+IToStr(GradCount));
grad.setAttribute("gradientUnits", "userSpaceOnUse");
QList<VColorStop*> cstops = Item->mask_gradient.colorStops();
- for (uint cst = 0; cst < Item->mask_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < Item->mask_gradient.Stops(); ++cst)
{
QDomElement itcl = docu.createElement("stop");
itcl.setAttribute("offset", FToStr(cstops.at(cst)->rampPoint*100)+"%");
@@ -2046,7 +2046,7 @@
bool isFirst = true;
double actualStop = 0.0, lastStop = 0.0;
QList<VColorStop*> cstops = Item->fill_gradient.colorStops();
- for (uint cst = 0; cst < Item->fill_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < Item->fill_gradient.Stops(); ++cst)
{
actualStop = cstops.at(cst)->rampPoint;
if ((actualStop != lastStop) || (isFirst))
@@ -2233,7 +2233,7 @@
bool isFirst = true;
double actualStop = 0.0, lastStop = 0.0;
QList<VColorStop*> cstops = Item->stroke_gradient.colorStops();
- for (uint cst = 0; cst < Item->stroke_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < Item->stroke_gradient.Stops(); ++cst)
{
actualStop = cstops.at(cst)->rampPoint;
if ((actualStop != lastStop) || (isFirst))
Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22589&path=/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp Sat Jun 30 13:40:20 2018
@@ -2112,7 +2112,7 @@
bool isFirst = true;
double actualStop = 0.0, lastStop = 0.0;
QList<VColorStop*> cstops = Item->stroke_gradient.colorStops();
- for (uint cst = 0; cst < Item->stroke_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < Item->stroke_gradient.Stops(); ++cst)
{
actualStop = cstops.at(cst)->rampPoint;
if ((actualStop != lastStop) || (isFirst))
@@ -2213,7 +2213,7 @@
bool isFirst = true;
double actualStop = 0.0, lastStop = 0.0;
QList<VColorStop*> cstops = Item->fill_gradient.colorStops();
- for (uint cst = 0; cst < Item->fill_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < Item->fill_gradient.Stops(); ++cst)
{
actualStop = cstops.at(cst)->rampPoint;
if ((actualStop != lastStop) || (isFirst))
@@ -2345,7 +2345,7 @@
bool isFirst = true;
double actualStop = 0.0, lastStop = 0.0;
QList<VColorStop*> cstops = Item->mask_gradient.colorStops();
- for (uint cst = 0; cst < Item->mask_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < Item->mask_gradient.Stops(); ++cst)
{
actualStop = cstops.at(cst)->rampPoint;
if ((actualStop != lastStop) || (isFirst))
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22589&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Jun 30 13:40:20 2018
@@ -5062,13 +5062,13 @@
ite->setMeshPointColor(grow, 4, patch.BL.colorName, patch.BL.shade, patch.BL.transparency, true);
}
QList<VColorStop*> cstops = ite->fill_gradient.colorStops();
- for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops = ite->stroke_gradient.colorStops();
- for (uint cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops = ite->mask_gradient.colorStops();
- for (uint cst = 0; cst < ite->mask_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->mask_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
if (ite->GrType == 13)
ite->createConicalMesh();
@@ -5107,13 +5107,13 @@
ite->setMeshPointColor(grow, 4, patch.BL.colorName, patch.BL.shade, patch.BL.transparency, true);
}
QList<VColorStop*> cstops = ite->fill_gradient.colorStops();
- for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops = ite->stroke_gradient.colorStops();
- for (uint cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops = ite->mask_gradient.colorStops();
- for (uint cst = 0; cst < ite->mask_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->mask_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
if (ite->GrType == 13)
ite->createConicalMesh();
@@ -5131,7 +5131,7 @@
for (itGrad = docGradients.begin(); itGrad != docGradients.end(); ++itGrad)
{
QList<VColorStop*> cstops = itGrad.value().colorStops();
- for (uint cst = 0; cst < itGrad.value().Stops(); ++cst)
+ for (int cst = 0; cst < itGrad.value().Stops(); ++cst)
{
if (cstops.at(cst)->name != CommonStrings::None)
{
@@ -5182,13 +5182,13 @@
ite->setMeshPointColor(grow, 4, patch.BL.colorName, patch.BL.shade, patch.BL.transparency, true);
}
QList<VColorStop*> cstops = ite->fill_gradient.colorStops();
- for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops = ite->stroke_gradient.colorStops();
- for (uint cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops = ite->mask_gradient.colorStops();
- for (uint cst = 0; cst < ite->mask_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->mask_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
if (ite->GrType == 13)
ite->createConicalMesh();
@@ -5232,13 +5232,13 @@
ite->setMeshPointColor(grow, 4, patch.BL.colorName, patch.BL.shade, patch.BL.transparency, true);
}
QList<VColorStop*> cstops = ite->fill_gradient.colorStops();
- for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops = ite->stroke_gradient.colorStops();
- for (uint cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
cstops = ite->mask_gradient.colorStops();
- for (uint cst = 0; cst < ite->mask_gradient.Stops(); ++cst)
+ for (int cst = 0; cst < ite->mask_gradient.Stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
if (ite->asImageFrame())
loadPict(ite->Pfile, ite, true, false);
@@ -7187,7 +7187,7 @@
Selection tempSelection(this, false);
m_Selection->clear();
tempSelection.delaySignalsOn();
- if (oldItems>0)
+ if (oldItems > 0)
{
if (Layers.count()!= 0)
{
@@ -7195,7 +7195,7 @@
for (ScLayers::iterator it = Layers.begin(); it != Layers.end(); ++it)
{
setActiveLayer(it->ID);
- for (uint ite = 0; ite < oldItems; ++ite)
+ for (int ite = 0; ite < oldItems; ++ite)
{
PageItem *itemToCopy = Items->at(ite);
if ((itemToCopy->OwnPage == static_cast<int>(from->pageNr())) && (it->ID == itemToCopy->LayerID))
@@ -8983,12 +8983,12 @@
if (selectedItemCount == 0)
return;
- for (uint a = 0; a < selectedItemCount; ++a)
+ for (int i = 0; i < selectedItemCount; ++i)
{
UndoTransaction activeTransaction;
if (UndoManager::undoEnabled())
activeTransaction = m_undoManager->beginTransaction();
- PageItem* currItem = itemSelection->itemAt(a);
+ PageItem* currItem = itemSelection->itemAt(i);
if (currItem->asTextFrame())
{
if (currItem->OwnPage != -1)
@@ -9023,16 +9023,16 @@
{
Selection* itemSelection = (customSelection!=nullptr) ? customSelection : m_Selection;
assert(itemSelection != nullptr);
- int selectedItemCount=itemSelection->count();
+ int selectedItemCount = itemSelection->count();
if (selectedItemCount == 0)
return;
- for (uint a = 0; a < selectedItemCount; ++a)
+ for (int i = 0; i < selectedItemCount; ++i)
{
UndoTransaction activeTransaction;
if (UndoManager::undoEnabled())
activeTransaction = m_undoManager->beginTransaction();
- PageItem* currItem = itemSelection->itemAt(a);
+ PageItem* currItem = itemSelection->itemAt(i);
if (currItem->asTextFrame())
{
bool old = currItem->isBookmark;
@@ -9067,20 +9067,20 @@
{
Selection* itemSelection = (customSelection!=nullptr) ? customSelection : m_Selection;
assert(itemSelection != nullptr);
- int selectedItemCount=itemSelection->count();
+ int selectedItemCount = itemSelection->count();
if (selectedItemCount == 0)
return;
UndoTransaction activeTransaction;
if (UndoManager::undoEnabled())
activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::SetStyle, newStyle.displayName(), Um::IFont);
- for (uint aa = 0; aa < selectedItemCount; ++aa)
- {
- PageItem *currItem = itemSelection->itemAt(aa);
+ for (int i = 0; i < selectedItemCount; ++i)
+ {
+ PageItem *currItem = itemSelection->itemAt(i);
int currItemTextCount = currItem->itemText.length();
if ((currItemTextCount > 0) && ((appMode == modeEdit) || (appMode == modeEditTable)))
{
int start = currItem->firstInFrame();
- int stop = currItem->lastInFrame()+1;
+ int stop = currItem->lastInFrame() + 1;
if ((appMode == modeEdit) || (appMode == modeEditTable))
{
start = currItem->itemText.startOfSelection();
@@ -9088,7 +9088,7 @@
if (start >= stop)
start = stop = currItem->itemText.normalizedCursorPosition();
}
- for (int pos=start; pos < stop; ++pos)
+ for (int pos = start; pos < stop; ++pos)
{
if (currItem->itemText.text(pos) == SpecialChars::PARSEP)
{
@@ -9120,15 +9120,15 @@
{
Selection* itemSelection = (customSelection!=nullptr) ? customSelection : m_Selection;
assert(itemSelection != nullptr);
- int selectedItemCount=itemSelection->count();
+ int selectedItemCount = itemSelection->count();
if (selectedItemCount == 0)
return;
UndoTransaction activeTransaction;
if (UndoManager::undoEnabled())
activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::RemoveTextStyle, tr( "remove direct paragraph formatting" ), Um::IFont);
- for (uint aa = 0; aa < selectedItemCount; ++aa)
- {
- PageItem *currItem = itemSelection->itemAt(aa);
+ for (int i = 0; i < selectedItemCount; ++i)
+ {
+ PageItem *currItem = itemSelection->itemAt(i);
int currItemTextCount = currItem->itemText.length();
if ((currItemTextCount > 0) && ((appMode == modeEdit) || (appMode == modeEditTable)))
{
@@ -9212,12 +9212,12 @@
{
Selection* itemSelection = (customSelection!=nullptr) ? customSelection : m_Selection;
assert(itemSelection != nullptr);
- int selectedItemCount=itemSelection->count();
+ int selectedItemCount = itemSelection->count();
if (selectedItemCount == 0)
return;
- for (uint aa = 0; aa < selectedItemCount; ++aa)
- {
- PageItem *currItem = itemSelection->itemAt(aa);
+ for (int i = 0; i < selectedItemCount; ++i)
+ {
+ PageItem *currItem = itemSelection->itemAt(i);
if (currItem->itemText.length() == 0)
continue;
int currItemTextCount = currItem->itemText.length();
@@ -9293,9 +9293,9 @@
QPixmap* targetPixmap = (selectedItemCount > 1) ? Um::IGroup : currItem->getUPixmap();
activeTransaction = m_undoManager->beginTransaction(targetName, targetPixmap, Um::ApplyTextStyle, newStyle.displayName(), Um::IFont);
}
- for (uint aa = 0; aa < selectedItemCount; ++aa)
- {
- PageItem *currItem = itemSelection->itemAt(aa);
+ for (int i = 0; i < selectedItemCount; ++i)
+ {
+ PageItem *currItem = itemSelection->itemAt(i);
if (currItem->isTable() && appMode == modeEditTable)
currItem = currItem->asTable()->activeCell().textFrame();
int currItemTextCount = currItem->itemText.length();
@@ -9509,15 +9509,15 @@
{
Selection* itemSelection = (customSelection!=nullptr) ? customSelection : m_Selection;
assert(itemSelection != nullptr);
- int selectedItemCount=itemSelection->count();
+ int selectedItemCount = itemSelection->count();
if (selectedItemCount == 0)
return;
UndoTransaction activeTransaction;
if (UndoManager::undoEnabled())
activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::ApplyTextStyle, newStyle.asString(), Um::IFont);
- for (uint aa = 0; aa < selectedItemCount; ++aa)
- {
- PageItem *currItem = itemSelection->itemAt(aa);
+ for (int i = 0; i < selectedItemCount; ++i)
+ {
+ PageItem *currItem = itemSelection->itemAt(i);
int currItemTextCount = currItem->itemText.length();
if ((currItemTextCount > 0) && ((appMode == modeEdit) || (appMode == modeEditTable)))
{
@@ -9589,15 +9589,15 @@
{
Selection* itemSelection = (customSelection!=nullptr) ? customSelection : m_Selection;
assert(itemSelection != nullptr);
- int selectedItemCount=itemSelection->count();
+ int selectedItemCount = itemSelection->count();
if (selectedItemCount == 0)
return;
UndoTransaction activeTransaction;
if (UndoManager::undoEnabled())
activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::RemoveTextStyle, tr( "remove direct char formatting" ), Um::IFont);
- for (uint aa = 0; aa < selectedItemCount; ++aa)
- {
- PageItem *currItem = itemSelection->itemAt(aa);
+ for (int i = 0; i < selectedItemCount; ++i)
+ {
+ PageItem *currItem = itemSelection->itemAt(i);
int currItemTextCount = currItem->itemText.length();
if ((currItemTextCount > 0) && ((appMode == modeEdit) || (appMode == modeEditTable)))
{
Modified: trunk/Scribus/scribus/ui/gradientpreview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22589&path=/trunk/Scribus/scribus/ui/gradientpreview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gradientpreview.cpp (original)
+++ trunk/Scribus/scribus/ui/gradientpreview.cpp Sat Jun 30 13:40:20 2018
@@ -64,9 +64,9 @@
StopM.clear();
contextStop = 0;
ActStop = 0;
- for (uint a = 0; a < fill_gradient.Stops(); ++a)
- {
- int center = qRound(cstops.at(a)->rampPoint * (width()-20))+10;
+ for (int i = 0; i < fill_gradient.Stops(); ++i)
+ {
+ int center = qRound(cstops.at(i)->rampPoint * (width()-20))+10;
StopM.append(center);
}
}
@@ -75,9 +75,9 @@
{
QList<VColorStop*> cstops = fill_gradient.colorStops();
StopM.clear();
- for (uint a = 0; a < fill_gradient.Stops(); ++a)
- {
- int center = qRound(cstops.at(a)->rampPoint * (width()-20))+10;
+ for (int i = 0; i < fill_gradient.Stops(); ++i)
+ {
+ int center = qRound(cstops.at(i)->rampPoint * (width()-20))+10;
StopM.append(center);
}
QImage pixm(width()-20, 37, QImage::Format_ARGB32_Premultiplied);
@@ -100,9 +100,9 @@
pw.drawImage(10, 5, pixm);
if (isEditable)
{
- for (uint a = 0; a < fill_gradient.Stops(); ++a)
- {
- int center = qRound(cstops.at(a)->rampPoint * (width()-20))+10;
+ for (int i = 0; i < fill_gradient.Stops(); ++i)
+ {
+ int center = qRound(cstops.at(i)->rampPoint * (width()-20))+10;
pw.setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
if (StopM[qMax(ActStop,0)] == center)
pw.setBrush(Qt::red);
More information about the scribus-commit
mailing list