r23457 by jghali - Remove some useless if blocks
scribus-commit
scribus-commit at lists.scribus.net
Thu Feb 6 18:12:16 UTC 2020
Author: jghali
Date: Thu Feb 6 18:12:16 2020
New Revision: 23457
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23457
Log:
Remove some useless if blocks
Modified:
trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23457&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Thu Feb 6 18:12:16 2020
@@ -646,38 +646,36 @@
}
}
}
- if (groupStackP.count() > 0)
- {
- while (groupStackP.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackP.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->DocItems.removeOne(cItem);
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
- if (!converted)
- gItem->groupItemList = gpL;
- }
+
+ while (groupStackP.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackP.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->DocItems.removeOne(cItem);
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
+ if (!converted)
+ gItem->groupItemList = gpL;
}
while (groupStackF.count() > 0)
@@ -2225,38 +2223,36 @@
ta->m_bottomLink = nullptr;
}
}
- if (groupStackP.count() > 0)
- {
- while (groupStackP.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackP.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->DocItems.removeOne(cItem);
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
- if (!converted)
- gItem->groupItemList = gpL;
- }
+
+ while (groupStackP.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackP.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->DocItems.removeOne(cItem);
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
+ if (!converted)
+ gItem->groupItemList = gpL;
}
uint itemCount2 = m_Doc->Items->count();
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23457&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Thu Feb 6 18:12:16 2020
@@ -1101,104 +1101,99 @@
}
}
}
- if (groupStackP.count() > 0)
- {
- while (groupStackP.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackP.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->DocItems.removeOne(cItem);
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
- if (!converted)
- gItem->groupItemList = gpL;
- }
- }
- if (groupStackF.count() > 0)
- {
- while (groupStackF.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackF.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->FrameItems.remove(m_Doc->FrameItems.key(cItem));
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackF, nullptr);
- if (!converted)
- gItem->groupItemList = gpL;
- }
- }
- if (groupStackM.count() > 0)
- {
- while (groupStackM.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackM.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->MasterItems.removeOne(cItem);
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackM, &m_Doc->MasterItems);
- if (!converted)
- gItem->groupItemList = gpL;
- }
+
+ while (groupStackP.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackP.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->DocItems.removeOne(cItem);
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
+ if (!converted)
+ gItem->groupItemList = gpL;
+ }
+
+
+ while (groupStackF.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackF.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->FrameItems.remove(m_Doc->FrameItems.key(cItem));
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackF, nullptr);
+ if (!converted)
+ gItem->groupItemList = gpL;
+ }
+
+ while (groupStackM.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackM.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->MasterItems.removeOne(cItem);
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackM, &m_Doc->MasterItems);
+ if (!converted)
+ gItem->groupItemList = gpL;
}
if (m_Doc->Layers.count() == 0)
@@ -1821,105 +1816,99 @@
}
}
- if (groupStackP.count() > 0)
- {
- while (groupStackP.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackP.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->DocItems.removeOne(cItem);
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
- if (!converted)
- gItem->groupItemList = gpL;
- }
- }
- if (groupStackF.count() > 0)
- {
- while (groupStackF.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackF.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->FrameItems.remove(m_Doc->FrameItems.key(cItem));
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackF, nullptr);
- if (!converted)
- gItem->groupItemList = gpL;
- }
- }
- if (groupStackM.count() > 0)
- {
- while (groupStackM.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackM.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->MasterItems.removeOne(cItem);
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackM, &m_Doc->MasterItems);
- if (!converted)
- gItem->groupItemList = gpL;
- }
- }
+ while (groupStackP.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackP.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->DocItems.removeOne(cItem);
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
+ if (!converted)
+ gItem->groupItemList = gpL;
+ }
+
+ while (groupStackF.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackF.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->FrameItems.remove(m_Doc->FrameItems.key(cItem));
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackF, nullptr);
+ if (!converted)
+ gItem->groupItemList = gpL;
+ }
+
+ while (groupStackM.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackM.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->MasterItems.removeOne(cItem);
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackM, &m_Doc->MasterItems);
+ if (!converted)
+ gItem->groupItemList = gpL;
+ }
+
//update names to pointers
updateNames2Ptr();
@@ -4421,38 +4410,36 @@
}
}
}
- if (groupStackP.count() > 0)
- {
- while (groupStackP.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackP.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->DocItems.removeOne(cItem);
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
- if (!converted)
- gItem->groupItemList = gpL;
- }
+
+ while (groupStackP.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackP.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->DocItems.removeOne(cItem);
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
+ if (!converted)
+ gItem->groupItemList = gpL;
}
int itemCount2 = m_Doc->Items->count();
@@ -6515,71 +6502,68 @@
}
}
}
- if (groupStackP.count() > 0)
- {
- while (groupStackP.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackP.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->DocItems.removeOne(cItem);
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
- if (!converted)
- gItem->groupItemList = gpL;
- }
- }
- if (groupStackF.count() > 0)
- {
- while (groupStackF.count() > 0)
- {
- bool isTableIt = false;
- QList<PageItem*> gpL = groupStackF.pop();
- PageItem* gItem = gpL.takeFirst();
- for (int id = 0; id < gpL.count(); id++)
- {
- PageItem* cItem = gpL.at(id);
- isTableIt = cItem->isTableItem;
- cItem->gXpos = cItem->xPos() - gItem->xPos();
- cItem->gYpos = cItem->yPos() - gItem->yPos();
- cItem->Parent = gItem;
- if (gItem->rotation() != 0)
- {
- QTransform ma;
- ma.rotate(-gItem->rotation());
- FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
- cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
- cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- cItem->setRotation(cItem->rotation() - gItem->rotation());
- cItem->oldRot = cItem->rotation();
- }
- m_Doc->FrameItems.remove(m_Doc->FrameItems.key(cItem));
- }
- bool converted = false;
- if (isTableIt)
- converted = convertOldTable(m_Doc, gItem, gpL, &groupStackF, nullptr);
- if (!converted)
- gItem->groupItemList = gpL;
- }
+
+ while (groupStackP.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackP.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->DocItems.removeOne(cItem);
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackP, &m_Doc->DocItems);
+ if (!converted)
+ gItem->groupItemList = gpL;
+ }
+
+
+ while (groupStackF.count() > 0)
+ {
+ bool isTableIt = false;
+ QList<PageItem*> gpL = groupStackF.pop();
+ PageItem* gItem = gpL.takeFirst();
+ for (int id = 0; id < gpL.count(); id++)
+ {
+ PageItem* cItem = gpL.at(id);
+ isTableIt = cItem->isTableItem;
+ cItem->gXpos = cItem->xPos() - gItem->xPos();
+ cItem->gYpos = cItem->yPos() - gItem->yPos();
+ cItem->Parent = gItem;
+ if (gItem->rotation() != 0)
+ {
+ QTransform ma;
+ ma.rotate(-gItem->rotation());
+ FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
+ cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+ cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+ cItem->setRotation(cItem->rotation() - gItem->rotation());
+ cItem->oldRot = cItem->rotation();
+ }
+ m_Doc->FrameItems.remove(m_Doc->FrameItems.key(cItem));
+ }
+ bool converted = false;
+ if (isTableIt)
+ converted = convertOldTable(m_Doc, gItem, gpL, &groupStackF, nullptr);
+ if (!converted)
+ gItem->groupItemList = gpL;
}
// reestablish first/lastAuto
More information about the scribus-commit
mailing list