r18613 by jghali - simplify loop by removing a few indentation levels
scribus-commit
scribus-commit at lists.scribus.net
Sun Dec 1 01:30:47 UTC 2013
Author: jghali
Date: Sun Dec 1 01:30:47 2013
New Revision: 18613
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18613
Log:
simplify loop by removing a few indentation levels
Modified:
trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
Modified: trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18613&path=/trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xps/importxps.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xps/importxps.cpp Sun Dec 1 01:30:47 2013
@@ -102,24 +102,21 @@
QDomElement docElem = designMapDom.documentElement();
for(QDomElement drawPag = docElem.firstChildElement(); !drawPag.isNull(); drawPag = drawPag.nextSiblingElement())
{
- if (drawPag.tagName() == "Relationship")
- {
- if ((drawPag.hasAttribute("Target")) && (drawPag.hasAttribute("Type")))
- {
- if (drawPag.attribute("Type") == "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail")
- {
- QString thumbRef = drawPag.attribute("Target");
- if (thumbRef.startsWith("/"))
- thumbRef = thumbRef.mid(1);
- QByteArray im;
- if (uz->read(thumbRef, im))
- {
- tmp = QImage::fromData(im);
- found = true;
- break;
- }
- }
- }
+ if (drawPag.tagName() != "Relationship")
+ continue;
+ if ((!drawPag.hasAttribute("Target")) || (!drawPag.hasAttribute("Type")))
+ continue;
+ if (drawPag.attribute("Type") != "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail")
+ continue;
+ QString thumbRef = drawPag.attribute("Target");
+ if (thumbRef.startsWith("/"))
+ thumbRef = thumbRef.mid(1);
+ QByteArray im;
+ if (uz->read(thumbRef, im))
+ {
+ tmp = QImage::fromData(im);
+ found = true;
+ break;
}
}
}
More information about the scribus-commit
mailing list