r16964 by fschmid - Fixed Bug 10325: "import of svg file with some problems"
scribus-commit
scribus-commit at lists.scribus.net
Sun Nov 6 08:15:16 UTC 2011
Author: fschmid
Date: Sun Nov 6 08:15:16 2011
New Revision: 16964
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16964
Log:
Fixed Bug 10325: "import of svg file with some problems"
Modified:
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/ui/checkDocument.cpp
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16964&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sun Nov 6 08:15:16 2011
@@ -4946,12 +4946,6 @@
int retw = -1;
if (masterPageMode())
{
-/* int x = static_cast<int>(currentPage()->xOffset());
- int y = static_cast<int>(currentPage()->yOffset());
- int w = static_cast<int>(currentPage()->width());
- int h = static_cast<int>(currentPage()->height());
- QRect itemRect(qRound(currItem->BoundingX), qRound(currItem->BoundingY), qRound(currItem->BoundingW), qRound(currItem->BoundingH));
- if (QRect(x, y, w, h).intersects(itemRect)) */
double x = currentPage()->xOffset() - docPrefsData.docSetupPrefs.bleeds.Left;
double y = currentPage()->yOffset() - docPrefsData.docSetupPrefs.bleeds.Top;
double w = currentPage()->width() + docPrefsData.docSetupPrefs.bleeds.Left + docPrefsData.docSetupPrefs.bleeds.Right;
@@ -4960,6 +4954,10 @@
double y2 = currItem->BoundingY;
double w2 = currItem->BoundingW;
double h2 = currItem->BoundingH;
+ QRectF ret = QRectF(0, 0, w2 - x2, h2 - y2);
+ QTransform t = currItem->getCombinedTransform();
+ ret = t.mapRect(ret);
+ ret.getCoords(&x2, &y2, &w2, &h2);
if (( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
retw = currentPage()->pageNr();
}
@@ -4978,21 +4976,15 @@
double y2 = currItem->BoundingY;
double w2 = currItem->BoundingW;
double h2 = currItem->BoundingH;
+ QRectF ret = QRectF(0, 0, w2 - x2, h2 - y2);
+ QTransform t = currItem->getCombinedTransform();
+ ret = t.mapRect(ret);
+ ret.getCoords(&x2, &y2, &w2, &h2);
if (( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
{
retw = static_cast<int>(a);
break;
}
-/* int x = static_cast<int>(Pages->at(a)->xOffset());
- int y = static_cast<int>(Pages->at(a)->yOffset());
- int w = static_cast<int>(Pages->at(a)->width());
- int h = static_cast<int>(Pages->at(a)->height());
- QRect itemRect(qRound(currItem->BoundingX), qRound(currItem->BoundingY), qRound(currItem->BoundingW), qRound(currItem->BoundingH));
- if (QRect(x, y, w, h).intersects(itemRect))
- {
- retw = static_cast<int>(a);
- break;
- } */
}
}
if ((retw == -1) && (currItem->isBookmark))
@@ -5059,6 +5051,10 @@
double y2 = currItem->BoundingY;
double w2 = currItem->BoundingW;
double h2 = currItem->BoundingH;
+ QRectF ret = QRectF(0, 0, w2 - x2, h2 - y2);
+ QTransform t = currItem->getCombinedTransform();
+ ret = t.mapRect(ret);
+ ret.getCoords(&x2, &y2, &w2, &h2);
if (( qMax(x1, x2) <= qMin(x1 + w1, x2 + w2) && qMax(y1, y2) <= qMin(y1 + h1, y2 + h2)))
{
continue;
Modified: trunk/Scribus/scribus/ui/checkDocument.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16964&path=/trunk/Scribus/scribus/ui/checkDocument.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/checkDocument.cpp (original)
+++ trunk/Scribus/scribus/ui/checkDocument.cpp Sun Nov 6 08:15:16 2011
@@ -502,11 +502,10 @@
// FREE ITEMS **********************************************8888
QMap<PageItem*, errorCodes>::Iterator freeItemsErrorsIt;
bool hasfreeItems = false;
- for (freeItemsErrorsIt = doc->docItemErrors.begin();
- freeItemsErrorsIt != doc->docItemErrors.end();
- ++freeItemsErrorsIt)
+ for (freeItemsErrorsIt = doc->docItemErrors.begin(); freeItemsErrorsIt != doc->docItemErrors.end(); ++freeItemsErrorsIt)
{
- if (freeItemsErrorsIt.key()->OwnPage == -1)
+ if (doc->OnPage(freeItemsErrorsIt.key()) == -1)
+ // if (freeItemsErrorsIt.key()->OwnPage == -1)
{
hasfreeItems = true;
break;
@@ -518,11 +517,10 @@
bool pageGraveError = false;
QTreeWidgetItem * freeItem = new QTreeWidgetItem( reportDisplay);//, pagep );
// pagep = page;
- for (freeItemsErrorsIt = doc->docItemErrors.begin();
- freeItemsErrorsIt != doc->docItemErrors.end();
- ++freeItemsErrorsIt)
- {
- if (freeItemsErrorsIt.key()->OwnPage == -1)
+ for (freeItemsErrorsIt = doc->docItemErrors.begin(); freeItemsErrorsIt != doc->docItemErrors.end(); ++freeItemsErrorsIt)
+ {
+ if (doc->OnPage(freeItemsErrorsIt.key()) == -1)
+ // if (freeItemsErrorsIt.key()->OwnPage == -1)
{
hasError = true;
QTreeWidgetItem * object = new QTreeWidgetItem(freeItem);
More information about the scribus-commit
mailing list