r23642 by jghali - Code style fixes
scribus-commit
scribus-commit at lists.scribus.net
Wed Apr 22 01:02:07 UTC 2020
Author: jghali
Date: Wed Apr 22 01:02:06 2020
New Revision: 23642
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23642
Log:
Code style fixes
Modified:
trunk/Scribus/scribus/selection.cpp
Modified: trunk/Scribus/scribus/selection.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23642&path=/trunk/Scribus/scribus/selection.cpp
==============================================================================
--- trunk/Scribus/scribus/selection.cpp (original)
+++ trunk/Scribus/scribus/selection.cpp Wed Apr 22 01:02:06 2020
@@ -255,7 +255,6 @@
//If not nullptr return it, otherwise remove from the list and return nullptr
if (!pi.isNull())
return pi;
-// SelectionList::Iterator it=m_SelList.at(index);
m_SelList.removeAt(index);
}
return nullptr;
@@ -385,9 +384,8 @@
QStringList Selection::getSelectedItemsByName() const
{
QStringList names;
- SelectionList::ConstIterator it=m_SelList.begin();
- SelectionList::ConstIterator itend=m_SelList.end();
- for ( ; it!=itend ; ++it)
+ SelectionList::ConstIterator itend = m_SelList.end();
+ for (auto it = m_SelList.begin(); it != itend ; ++it)
names.append((*it)->itemName());
return names;
}
@@ -398,10 +396,10 @@
return 0.0;
double minX = std::numeric_limits<double>::max();
double maxX = -std::numeric_limits<double>::max();
- SelectionList::ConstIterator it=m_SelList.begin();
- SelectionList::ConstIterator itend=m_SelList.end();
double x1 = 0.0, x2 = 0.0, y1 = 0.0, y2 = 0.0;
- for ( ; it != itend ; ++it)
+
+ SelectionList::ConstIterator itend = m_SelList.end();
+ for (auto it = m_SelList.begin(); it != itend ; ++it)
{
(*it)->getBoundingRect(&x1, &y1, &x2, &y2);
if (x1 < minX)
@@ -409,7 +407,7 @@
if (x2 > maxX)
maxX = x2;
}
- return maxX-minX;
+ return maxX - minX;
}
double Selection::height() const
@@ -418,10 +416,10 @@
return 0.0;
double minY = std::numeric_limits<double>::max();
double maxY = -std::numeric_limits<double>::max();
- SelectionList::ConstIterator it=m_SelList.begin();
- SelectionList::ConstIterator itend=m_SelList.end();
double x1 = 0.0, x2 = 0.0, y1 = 0.0, y2 = 0.0;
- for ( ; it != itend ; ++it)
+
+ SelectionList::ConstIterator itend = m_SelList.end();
+ for (auto it = m_SelList.begin(); it != itend ; ++it)
{
(*it)->getBoundingRect(&x1, &y1, &x2, &y2);
if (y1 < minY)
@@ -429,7 +427,7 @@
if (y2 > maxY)
maxY = y2;
}
- return maxY-minY;
+ return maxY - minY;
}
void Selection::setGroupRect()
@@ -506,7 +504,7 @@
{
double x, y, w, h;
getGroupRect(&x, &y, &w, &h);
- return QRectF(x,y,w,h);
+ return QRectF(x, y, w, h);
}
void Selection::getVisualGroupRect(double * x, double * y, double * w, double * h)
@@ -522,7 +520,7 @@
{
double x, y, w, h;
getGroupRect(&x, &y, &w, &h);
- return QRectF(x,y,w,h);
+ return QRectF(x, y, w, h);
}
bool Selection::containsItemType(PageItem::ItemType type) const
@@ -549,7 +547,7 @@
SelectionList::ConstIterator it = m_SelList.begin();
SelectionList::ConstIterator itend = m_SelList.end();
PageItem::ItemType itemType = (*it)->itemType();
- for ( ; it!=itend ; ++it)
+ for ( ; it != itend ; ++it)
{
if ((*it)->isGroup()) // ignore GroupControl items
continue;
@@ -569,7 +567,7 @@
auto it = m_SelList.begin();
auto itend = m_SelList.end();
auto ownPage = (*it)->OwnPage;
- for ( ; it!=itend ; ++it)
+ for ( ; it != itend ; ++it)
{
if ((*it)->OwnPage != ownPage)
return false;
@@ -601,9 +599,9 @@
bool haveSameParent = true;
const PageItem *firstItem = itemAt(0);
- for (int a = 1; a < selectedItemCount; ++a)
- {
- if (itemAt(a)->Parent != firstItem->Parent)
+ for (int i = 1; i < selectedItemCount; ++i)
+ {
+ if (itemAt(i)->Parent != firstItem->Parent)
{
haveSameParent = false;
break;
More information about the scribus-commit
mailing list