mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-12 20:51:17 +00:00
[generators/*] Replace deprecated foreach with range-for
This commit is contained in:
parent
c549acaab0
commit
54494cc3d4
|
@ -80,7 +80,7 @@ bool CHMGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
|
|||
QMap<QString, int> tmpPageList;
|
||||
int pageNum = 0;
|
||||
|
||||
foreach(const EBookTocEntry &e, topics)
|
||||
for (const EBookTocEntry &e : qAsConst(topics))
|
||||
{
|
||||
QDomElement item = m_docSyn.createElement(e.name);
|
||||
if (!e.url.isEmpty())
|
||||
|
@ -107,7 +107,7 @@ bool CHMGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
|
|||
pageList.prepend(home);
|
||||
m_pageUrl.resize(pageNum);
|
||||
|
||||
foreach (const QUrl &qurl, pageList)
|
||||
for (const QUrl &qurl : qAsConst(pageList))
|
||||
{
|
||||
QString url = qurl.toString();
|
||||
const QString urlLower = url.toLower();
|
||||
|
|
|
@ -122,7 +122,7 @@ bool EBook_CHM::getTableOfContents( QList<EBookTocEntry> &toc ) const
|
|||
|
||||
// Fill up the real toc
|
||||
toc.reserve( parsed.size() );
|
||||
Q_FOREACH( const ParsedEntry& e, parsed )
|
||||
for ( const ParsedEntry &e : qAsConst(parsed) )
|
||||
{
|
||||
if ( root_offset == -1 )
|
||||
root_offset = e.indent;
|
||||
|
@ -157,7 +157,8 @@ bool EBook_CHM::getIndex(QList<EBookIndexEntry> &index) const
|
|||
index.reserve( parsed.size() );
|
||||
|
||||
// Find the index root offset
|
||||
Q_FOREACH( const ParsedEntry& e, parsed )
|
||||
const QList< ParsedEntry > &parsedList = parsed;
|
||||
for ( const ParsedEntry &e : parsedList )
|
||||
{
|
||||
if ( e.urls.empty() )
|
||||
continue;
|
||||
|
@ -166,7 +167,7 @@ bool EBook_CHM::getIndex(QList<EBookIndexEntry> &index) const
|
|||
}
|
||||
|
||||
// And apply the index
|
||||
Q_FOREACH( const ParsedEntry& e, parsed )
|
||||
for( const ParsedEntry &e : parsedList )
|
||||
{
|
||||
if ( e.urls.empty() )
|
||||
continue;
|
||||
|
|
|
@ -232,13 +232,13 @@ bool EBook_EPUB::parseBookinfo()
|
|||
m_title = content_parser.metadata[ "title" ];
|
||||
|
||||
// Move the manifest entries into the list
|
||||
Q_FOREACH( QString f, content_parser.manifest.values() )
|
||||
for ( const QString &f : qAsConst(content_parser.manifest) )
|
||||
m_ebookManifest.push_back( pathToUrl( f ) );
|
||||
|
||||
// Copy the manifest information and fill up the other maps if we have it
|
||||
if ( !toc_parser.entries.isEmpty() )
|
||||
{
|
||||
Q_FOREACH( EBookTocEntry e, toc_parser.entries )
|
||||
for( EBookTocEntry e : qAsConst(toc_parser.entries) )
|
||||
{
|
||||
// Add into url-title map
|
||||
m_urlTitleMap[ e.url ] = e.name;
|
||||
|
@ -247,14 +247,13 @@ bool EBook_EPUB::parseBookinfo()
|
|||
}
|
||||
else
|
||||
{
|
||||
// Copy them from spline
|
||||
Q_FOREACH( QString u, content_parser.spine )
|
||||
// Copy them from spine
|
||||
for( QString url : qAsConst(content_parser.spine) )
|
||||
{
|
||||
EBookTocEntry e;
|
||||
QString url = u;
|
||||
|
||||
if ( content_parser.manifest.contains( u ) )
|
||||
url = content_parser.manifest[ u ];
|
||||
if ( content_parser.manifest.contains( url ) )
|
||||
url = content_parser.manifest[ url ];
|
||||
|
||||
e.name = url;
|
||||
e.url= pathToUrl( url );
|
||||
|
|
|
@ -35,12 +35,13 @@ using namespace ComicBook;
|
|||
|
||||
static void imagesInArchive( const QString &prefix, const KArchiveDirectory* dir, QStringList *entries )
|
||||
{
|
||||
Q_FOREACH ( const QString &entry, dir->entries() ) {
|
||||
const KArchiveEntry *e = dir->entry( entry );
|
||||
const QStringList entryList = dir->entries();
|
||||
for ( const QString &file : entryList ) {
|
||||
const KArchiveEntry *e = dir->entry( file );
|
||||
if ( e->isDirectory() ) {
|
||||
imagesInArchive( prefix + entry + QLatin1Char('/'), static_cast<const KArchiveDirectory*>( e ), entries );
|
||||
imagesInArchive( prefix + file + QLatin1Char('/'), static_cast<const KArchiveDirectory*>( e ), entries );
|
||||
} else if ( e->isFile() ) {
|
||||
entries->append( prefix + entry );
|
||||
entries->append( prefix + file );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +185,7 @@ void Document::pages( QVector<Okular::Page*> * pagesVector )
|
|||
pagesVector->clear();
|
||||
pagesVector->resize( mEntries.size() );
|
||||
QImageReader reader;
|
||||
foreach(const QString &file, mEntries) {
|
||||
for (const QString &file : qAsConst(mEntries)) {
|
||||
if ( mArchive ) {
|
||||
const KArchiveFile *entry = static_cast<const KArchiveFile*>( mArchiveDir->entry( file ) );
|
||||
if ( entry ) {
|
||||
|
|
|
@ -160,7 +160,7 @@ QStringList Unrar::list()
|
|||
}
|
||||
|
||||
QStringList newList;
|
||||
Q_FOREACH ( const QString &f, listFiles ) {
|
||||
for ( const QString &f : qAsConst(listFiles) ) {
|
||||
// Extract all the files to mTempDir regardless of their path inside the archive
|
||||
// This will break if ever an arvhice with two files with the same name in different subfolders
|
||||
QFileInfo fi( f );
|
||||
|
|
|
@ -77,7 +77,7 @@ QStringList FreeUnrarFlavour::processListing( const QStringList &data )
|
|||
QRegExp re( QStringLiteral("^ ([^/]+/([^\\s]+))$") );
|
||||
|
||||
QStringList newdata;
|
||||
foreach ( const QString &line, data )
|
||||
for ( const QString &line : data )
|
||||
{
|
||||
if ( re.exactMatch( line ) )
|
||||
newdata.append( re.cap( 1 ) );
|
||||
|
|
|
@ -1057,7 +1057,7 @@ bool KDjVu::exportAsPostScript( QFile* file, const QList<int>& pageList ) const
|
|||
}
|
||||
|
||||
QString pl;
|
||||
foreach ( int p, pageList )
|
||||
for ( const int p : pageList )
|
||||
{
|
||||
if ( !pl.isEmpty() )
|
||||
pl += QLatin1String( "," );
|
||||
|
|
|
@ -366,7 +366,7 @@ void dviRenderer::prescan_ParsePSSpecial(const QString& cp)
|
|||
if (cp.contains(QStringLiteral("/Dest")) && cp.contains(QStringLiteral("/Title"))) {
|
||||
const QString childrenNumberAndMoreStuff = cp.section(QLatin1Char('-'), 1, 1); // Contains from the - symbol to the end of cp, effectively containing the number of children and some stuff after it
|
||||
int indexOfFirstNonDigit = 0;
|
||||
foreach(const QChar &c, childrenNumberAndMoreStuff) {
|
||||
for (const QChar &c : childrenNumberAndMoreStuff) {
|
||||
if (c.isDigit()) ++indexOfFirstNonDigit;
|
||||
else break;
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ QLinkedList<Okular::ObjectRect*> DviGenerator::generateDviLinks( const dviPageIn
|
|||
|
||||
int pageWidth = pageInfo->width, pageHeight = pageInfo->height;
|
||||
|
||||
foreach( const Hyperlink &dviLink, pageInfo->hyperLinkList )
|
||||
for ( const Hyperlink &dviLink : qAsConst(pageInfo->hyperLinkList) )
|
||||
{
|
||||
QRect boxArea = dviLink.box;
|
||||
double nl = (double)boxArea.left() / pageWidth,
|
||||
|
@ -391,9 +391,8 @@ Okular::FontInfo::List DviGenerator::fontsForPage( int page )
|
|||
if ( m_dviRenderer && m_dviRenderer->dviFile &&
|
||||
m_dviRenderer->dviFile->font_pool )
|
||||
{
|
||||
QList<TeXFontDefinition*> fonts = m_dviRenderer->dviFile->font_pool->fontList;
|
||||
|
||||
foreach (const TeXFontDefinition* font, fonts)
|
||||
const QList<TeXFontDefinition *> fonts = m_dviRenderer->dviFile->font_pool->fontList;
|
||||
for (const TeXFontDefinition *font : fonts)
|
||||
{
|
||||
Okular::FontInfo of;
|
||||
QString name;
|
||||
|
@ -506,7 +505,7 @@ void DviGenerator::loadPages( QVector< Okular::Page * > &pagesVector )
|
|||
// filling the pages with the source references rects
|
||||
const QVector<DVI_SourceFileAnchor>& sourceAnchors = m_dviRenderer->sourceAnchors();
|
||||
QVector< QLinkedList< Okular::SourceRefObjectRect * > > refRects( numofpages );
|
||||
foreach ( const DVI_SourceFileAnchor& sfa, sourceAnchors )
|
||||
for ( const DVI_SourceFileAnchor &sfa : sourceAnchors )
|
||||
{
|
||||
if ( sfa.page < 1 || (int)sfa.page > numofpages )
|
||||
continue;
|
||||
|
@ -527,14 +526,14 @@ bool DviGenerator::print( QPrinter& printer )
|
|||
if ( !tf.open() )
|
||||
return false;
|
||||
|
||||
QList<int> pageList = Okular::FilePrinter::pageList( printer,
|
||||
const QList<int> pageList = Okular::FilePrinter::pageList( printer,
|
||||
m_dviRenderer->totalPages(),
|
||||
document()->currentPage() + 1,
|
||||
document()->bookmarkedPageList() );
|
||||
QString pages;
|
||||
QStringList printOptions;
|
||||
// List of pages to print.
|
||||
foreach ( int p, pageList )
|
||||
for ( const int p : pageList )
|
||||
{
|
||||
pages += QStringLiteral(",%1").arg(p);
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ QTextDocument* Converter::convert( const QString &fileName )
|
|||
newDoc.setContent(QStringLiteral("<img src=\"%1\" height=\"%2\" width=\"%3\" />").arg(lnk).arg(ht).arg(wd));
|
||||
imgNodes.append(newDoc.documentElement());
|
||||
}
|
||||
foreach (const QDomNode& nd, imgNodes) {
|
||||
for (const QDomNode &nd : qAsConst(imgNodes)) {
|
||||
svgs.at(i).parentNode().replaceChild(nd,svgs.at(i));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,9 +79,10 @@ QTextDocument* Converter::convert( const QString &fileName )
|
|||
//link
|
||||
if (!format.anchorHref().isEmpty()) links[format.anchorHref()]=
|
||||
QPair<int,int>(frag.position(), frag.position()+frag.length());
|
||||
if (!format.anchorNames().isEmpty()) {
|
||||
const QStringList anchors = format.anchorNames();
|
||||
if (!anchors.isEmpty()) {
|
||||
// link targets
|
||||
Q_FOREACH(const QString& name, format.anchorNames())
|
||||
for (const QString &name : anchors)
|
||||
targets[QLatin1Char('#')+name]=it;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,8 +193,11 @@ void PopplerAnnotationProxy::notifyModification( const Okular::Annotation *okl_a
|
|||
const Okular::LineAnnotation * okl_lineann = static_cast<const Okular::LineAnnotation*>(okl_ann);
|
||||
Poppler::LineAnnotation * ppl_lineann = static_cast<Poppler::LineAnnotation*>(ppl_ann);
|
||||
QLinkedList<QPointF> points;
|
||||
foreach ( const Okular::NormalizedPoint &p, okl_lineann->linePoints() )
|
||||
const QLinkedList<Okular::NormalizedPoint> annotPoints = okl_lineann->linePoints();
|
||||
for ( const Okular::NormalizedPoint &p : annotPoints )
|
||||
{
|
||||
points.append(normPointToPointF( p ));
|
||||
}
|
||||
ppl_lineann->setLinePoints( points );
|
||||
ppl_lineann->setLineStartStyle( (Poppler::LineAnnotation::TermStyle)okl_lineann->lineStartStyle() );
|
||||
ppl_lineann->setLineEndStyle( (Poppler::LineAnnotation::TermStyle)okl_lineann->lineEndStyle() );
|
||||
|
@ -233,11 +236,14 @@ void PopplerAnnotationProxy::notifyModification( const Okular::Annotation *okl_a
|
|||
const Okular::InkAnnotation * okl_inkann = static_cast<const Okular::InkAnnotation*>(okl_ann);
|
||||
Poppler::InkAnnotation * ppl_inkann = static_cast<Poppler::InkAnnotation*>(ppl_ann);
|
||||
QList< QLinkedList<QPointF> > paths;
|
||||
foreach ( const QLinkedList<Okular::NormalizedPoint> &path, okl_inkann->inkPaths() )
|
||||
const QList< QLinkedList<Okular::NormalizedPoint> > inkPathsList = okl_inkann->inkPaths();
|
||||
for ( const QLinkedList<Okular::NormalizedPoint> &path : inkPathsList )
|
||||
{
|
||||
QLinkedList<QPointF> points;
|
||||
foreach ( const Okular::NormalizedPoint &p, path )
|
||||
for ( const Okular::NormalizedPoint &p : path )
|
||||
{
|
||||
points.append(normPointToPointF( p ));
|
||||
}
|
||||
paths.append( points );
|
||||
}
|
||||
ppl_inkann->setInkPaths( paths );
|
||||
|
|
|
@ -289,7 +289,7 @@ QPair<Okular::Movie*, Okular::EmbeddedFile*> createMovieFromPopplerRichMedia( co
|
|||
bool playbackLoops = false;
|
||||
|
||||
const QStringList flashVars = params->flashVars().split( QLatin1Char( '&' ) );
|
||||
foreach ( const QString & flashVar, flashVars ) {
|
||||
for ( const QString &flashVar : flashVars ) {
|
||||
const int pos = flashVar.indexOf( QLatin1Char( '=' ) );
|
||||
if ( pos == -1 )
|
||||
continue;
|
||||
|
@ -311,7 +311,7 @@ QPair<Okular::Movie*, Okular::EmbeddedFile*> createMovieFromPopplerRichMedia( co
|
|||
return emptyResult;
|
||||
|
||||
Poppler::RichMediaAnnotation::Asset *matchingAsset = 0;
|
||||
foreach ( Poppler::RichMediaAnnotation::Asset *asset, assets ) {
|
||||
for ( Poppler::RichMediaAnnotation::Asset *asset : assets ) {
|
||||
if ( asset->name() == sourceId ) {
|
||||
matchingAsset = asset;
|
||||
break;
|
||||
|
@ -547,7 +547,7 @@ Okular::Action* createLinkFromPopplerLink(const Poppler::Link *popplerLink, bool
|
|||
static QLinkedList<Okular::ObjectRect*> generateLinks( const QList<Poppler::Link*> &popplerLinks )
|
||||
{
|
||||
QLinkedList<Okular::ObjectRect*> links;
|
||||
foreach(const Poppler::Link *popplerLink, popplerLinks)
|
||||
for (const Poppler::Link *popplerLink : popplerLinks)
|
||||
{
|
||||
QRectF linkArea = popplerLink->linkArea();
|
||||
double nl = linkArea.left(),
|
||||
|
@ -939,7 +939,7 @@ Okular::FontInfo::List PDFGenerator::fontsForPage( int page )
|
|||
}
|
||||
userMutex()->unlock();
|
||||
|
||||
foreach (const Poppler::FontInfo &font, fonts)
|
||||
for (const Poppler::FontInfo &font : qAsConst(fonts))
|
||||
{
|
||||
Okular::FontInfo of;
|
||||
of.setName( font.name() );
|
||||
|
@ -969,7 +969,7 @@ const QList<Okular::EmbeddedFile*> *PDFGenerator::embeddedFiles() const
|
|||
{
|
||||
userMutex()->lock();
|
||||
const QList<Poppler::EmbeddedFile*> &popplerFiles = pdfdoc->embeddedFiles();
|
||||
foreach(Poppler::EmbeddedFile* pef, popplerFiles)
|
||||
for (Poppler::EmbeddedFile *pef : popplerFiles)
|
||||
{
|
||||
docEmbeddedFiles.append(new PDFEmbeddedFile(pef));
|
||||
}
|
||||
|
@ -1247,7 +1247,8 @@ void PDFGenerator::resolveMediaLinkReferences( Okular::Page *page )
|
|||
resolveMediaLinkReference( const_cast<Okular::Action*>( page->pageAction( Okular::Page::Opening ) ) );
|
||||
resolveMediaLinkReference( const_cast<Okular::Action*>( page->pageAction( Okular::Page::Closing ) ) );
|
||||
|
||||
foreach ( Okular::Annotation *annotation, page->annotations() )
|
||||
const QLinkedList< Okular::Annotation* > annotations = page->annotations();
|
||||
for ( Okular::Annotation *annotation : annotations )
|
||||
{
|
||||
if ( annotation->subType() == Okular::Annotation::AScreen )
|
||||
{
|
||||
|
@ -1264,8 +1265,11 @@ void PDFGenerator::resolveMediaLinkReferences( Okular::Page *page )
|
|||
}
|
||||
}
|
||||
|
||||
foreach ( Okular::FormField *field, page->formFields() )
|
||||
const QLinkedList< Okular::FormField * > fields = page->formFields();
|
||||
for ( Okular::FormField *field : fields )
|
||||
{
|
||||
resolveMediaLinkReference( field->activationAction() );
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_POPPLER_0_63
|
||||
|
@ -1588,7 +1592,8 @@ QVariant PDFGenerator::metaData( const QString & key, const QVariant & option )
|
|||
uint numPages = doc->pages();
|
||||
for ( uint i = 0; i < numPages; i++ )
|
||||
{
|
||||
foreach ( Okular::FormField *f, doc->page( i )->formFields() )
|
||||
const QLinkedList<Okular::FormField *> formFields = doc->page( i )->formFields();
|
||||
for ( const Okular::FormField *f : formFields )
|
||||
{
|
||||
if ( f->type() == Okular::FormField::FormSignature )
|
||||
return true;
|
||||
|
@ -1727,7 +1732,7 @@ Okular::TextPage * PDFGenerator::abstractTextPage(const QList<Poppler::TextBox*>
|
|||
#endif
|
||||
QString s;
|
||||
bool addChar;
|
||||
foreach (Poppler::TextBox *word, text)
|
||||
for (const Poppler::TextBox *word : text)
|
||||
{
|
||||
const int qstringCharCount = word->text().length();
|
||||
next=word->nextWord();
|
||||
|
@ -1828,12 +1833,12 @@ void PDFGenerator::addAnnotations( Poppler::Page * popplerPage, Okular::Page * p
|
|||
<< Poppler::Annotation::AStamp
|
||||
<< Poppler::Annotation::ACaret;
|
||||
|
||||
QList<Poppler::Annotation*> popplerAnnotations = popplerPage->annotations( subtypes );
|
||||
const QList<Poppler::Annotation*> popplerAnnotations = popplerPage->annotations( subtypes );
|
||||
#else
|
||||
QList<Poppler::Annotation*> popplerAnnotations = popplerPage->annotations();
|
||||
const QList<Poppler::Annotation*> popplerAnnotations = popplerPage->annotations();
|
||||
#endif
|
||||
|
||||
foreach(Poppler::Annotation *a, popplerAnnotations)
|
||||
for (Poppler::Annotation *a : popplerAnnotations)
|
||||
{
|
||||
bool doDelete = true;
|
||||
Okular::Annotation * newann = createAnnotationFromPopplerAnnotation( a, &doDelete );
|
||||
|
@ -1964,9 +1969,9 @@ void PDFGenerator::addTransition( Poppler::Page * pdfPage, Okular::Page * page )
|
|||
|
||||
void PDFGenerator::addFormFields( Poppler::Page * popplerPage, Okular::Page * page )
|
||||
{
|
||||
QList<Poppler::FormField*> popplerFormFields = popplerPage->formFields();
|
||||
const QList<Poppler::FormField*> popplerFormFields = popplerPage->formFields();
|
||||
QLinkedList<Okular::FormField*> okularFormFields;
|
||||
foreach( Poppler::FormField *f, popplerFormFields )
|
||||
for ( Poppler::FormField *f : popplerFormFields )
|
||||
{
|
||||
Okular::FormField * of = nullptr;
|
||||
switch ( f->type() )
|
||||
|
|
|
@ -508,7 +508,7 @@ static QByteArray readFileOrDirectoryParts( const KArchiveEntry *entry, QString
|
|||
const KArchiveDirectory* relDir = static_cast<const KArchiveDirectory *>( entry );
|
||||
QStringList entries = relDir->entries();
|
||||
std::sort(entries.begin(), entries.end());
|
||||
Q_FOREACH ( const QString &entry, entries ) {
|
||||
for ( const QString &entry : qAsConst(entries) ) {
|
||||
const KArchiveEntry* relSubEntry = relDir->entry( entry );
|
||||
if ( !relSubEntry->isFile() )
|
||||
continue;
|
||||
|
@ -553,7 +553,7 @@ static const KArchiveEntry* loadEntry( KZip *archive, const QString &fileName, Q
|
|||
const KArchiveDirectory* relDir = static_cast< const KArchiveDirectory * >( newEntry );
|
||||
QStringList relEntries = relDir->entries();
|
||||
std::sort(relEntries.begin(), relEntries.end());
|
||||
Q_FOREACH ( const QString &relEntry, relEntries ) {
|
||||
for ( const QString &relEntry : qAsConst(relEntries) ) {
|
||||
if ( relEntry.compare( entryName, Qt::CaseInsensitive ) == 0 ) {
|
||||
return relDir->entry( relEntry );
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ static bool xpsGradientLessThan( const XpsGradient &g1, const XpsGradient &g2 )
|
|||
static int xpsGradientWithOffset( const QList<XpsGradient> &gradients, double offset )
|
||||
{
|
||||
int i = 0;
|
||||
Q_FOREACH ( const XpsGradient &grad, gradients ) {
|
||||
for ( const XpsGradient &grad : gradients ) {
|
||||
if ( grad.offset == offset ) {
|
||||
return i;
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ static void preprocessXpsGradients( QList<XpsGradient> &gradients )
|
|||
|
||||
static void addXpsGradientsToQGradient( const QList<XpsGradient> &gradients, QGradient *qgrad )
|
||||
{
|
||||
Q_FOREACH ( const XpsGradient &grad, gradients ) {
|
||||
for ( const XpsGradient &grad : gradients ) {
|
||||
qgrad->setColorAt( grad.offset, grad.color );
|
||||
}
|
||||
}
|
||||
|
@ -1121,7 +1121,7 @@ void XpsHandler::processPath( XpsRenderNode &node )
|
|||
m_painter->setWorldTransform( pathdata->transform, true );
|
||||
}
|
||||
|
||||
Q_FOREACH ( XpsPathFigure *figure, pathdata->paths ) {
|
||||
for ( const XpsPathFigure *figure : qAsConst(pathdata->paths) ) {
|
||||
m_painter->setBrush( figure->isFilled ? brush : QBrush() );
|
||||
m_painter->drawPath( figure->path );
|
||||
}
|
||||
|
@ -1144,7 +1144,7 @@ void XpsHandler::processPathGeometry( XpsRenderNode &node )
|
|||
{
|
||||
XpsPathGeometry * geom = new XpsPathGeometry();
|
||||
|
||||
Q_FOREACH ( const XpsRenderNode &child, node.children ) {
|
||||
for ( const XpsRenderNode &child : qAsConst(node.children) ) {
|
||||
if ( child.data.canConvert<XpsPathFigure *>() ) {
|
||||
XpsPathFigure *figure = child.data.value<XpsPathFigure *>();
|
||||
geom->paths.append( figure );
|
||||
|
@ -1194,7 +1194,7 @@ void XpsHandler::processPathFigure( XpsRenderNode &node )
|
|||
return;
|
||||
}
|
||||
|
||||
Q_FOREACH ( const XpsRenderNode &child, node.children ) {
|
||||
for ( const XpsRenderNode &child : qAsConst(node.children) ) {
|
||||
bool isStroked = true;
|
||||
att = node.attributes.value( QStringLiteral("IsStroked") );
|
||||
if ( !att.isEmpty() ) {
|
||||
|
@ -1209,7 +1209,7 @@ void XpsHandler::processPathFigure( XpsRenderNode &node )
|
|||
att = child.attributes.value( QStringLiteral("Points") );
|
||||
if ( !att.isEmpty() ) {
|
||||
const QStringList points = att.split( QLatin1Char( ' ' ), QString::SkipEmptyParts );
|
||||
Q_FOREACH ( const QString &p, points ) {
|
||||
for ( const QString &p : points ) {
|
||||
QPointF point = getPointFromString( p );
|
||||
path.lineTo( point );
|
||||
}
|
||||
|
@ -1345,7 +1345,7 @@ void XpsHandler::processEndElement( XpsRenderNode &node )
|
|||
}
|
||||
} else if (node.name == QLatin1String("LinearGradientBrush.GradientStops")) {
|
||||
QList<XpsGradient> gradients;
|
||||
Q_FOREACH ( const XpsRenderNode &child, node.children ) {
|
||||
for ( const XpsRenderNode &child : qAsConst(node.children) ) {
|
||||
double offset = child.attributes.value( QStringLiteral("Offset") ).toDouble();
|
||||
QColor color = hexToRgba( child.attributes.value( QStringLiteral("Color") ).toLatin1() );
|
||||
gradients.append( XpsGradient( offset, color ) );
|
||||
|
@ -1358,7 +1358,7 @@ void XpsHandler::processEndElement( XpsRenderNode &node )
|
|||
}
|
||||
} else if (node.name == QLatin1String("RadialGradientBrush.GradientStops")) {
|
||||
QList<XpsGradient> gradients;
|
||||
Q_FOREACH ( const XpsRenderNode &child, node.children ) {
|
||||
for ( const XpsRenderNode &child : qAsConst(node.children) ) {
|
||||
double offset = child.attributes.value( QStringLiteral("Offset") ).toDouble();
|
||||
QColor color = hexToRgba( child.attributes.value( QStringLiteral("Color") ).toLatin1() );
|
||||
gradients.append( XpsGradient( offset, color ) );
|
||||
|
|
Loading…
Reference in a new issue