r22509 by jghali - remove some iterator ugliness by using c++11 auto type deduction
scribus-commit
scribus-commit at lists.scribus.net
Tue May 1 18:38:11 UTC 2018
Author: jghali
Date: Tue May 1 18:38:11 2018
New Revision: 22509
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22509
Log:
remove some iterator ugliness by using c++11 auto type deduction
Modified:
trunk/Scribus/scribus/canvas.cpp
trunk/Scribus/scribus/collect4output.cpp
trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp
trunk/Scribus/scribus/desaxe/digester.cpp
trunk/Scribus/scribus/desaxe/saxiohelper.cpp
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pgf.cpp
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusdoc.h
trunk/Scribus/scribus/text/glyphcluster.cpp
trunk/Scribus/scribus/ui/charselectenhanced.cpp
trunk/Scribus/scribus/ui/inlinepalette.cpp
trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
trunk/Scribus/scribus/ui/smlinestyle.cpp
trunk/Scribus/scribus/util.cpp
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Tue May 1 18:38:11 2018
@@ -1467,7 +1467,7 @@
//then we must be sure that text frames are valid and all notes frames are created before we start drawing
if (!notesFramesPass && !m_doc->notesList().isEmpty())
{
- for (QList<PageItem*>::iterator it = m_doc->Items->begin(); it != m_doc->Items->end(); ++it)
+ for (auto it = m_doc->Items->begin(); it != m_doc->Items->end(); ++it)
{
PageItem* currItem = *it;
if ( !currItem->isTextFrame()
Modified: trunk/Scribus/scribus/collect4output.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/collect4output.cpp
==============================================================================
--- trunk/Scribus/scribus/collect4output.cpp (original)
+++ trunk/Scribus/scribus/collect4output.cpp Tue May 1 18:38:11 2018
@@ -229,7 +229,7 @@
emit itemsCollected(c++);
}
}
- for (QHash<int, PageItem*>::iterator itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
+ for (auto itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
{
PageItem *it = itf.value();
if (it->isGroup())
Modified: trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp (original)
+++ trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp Tue May 1 18:38:11 2018
@@ -12,7 +12,7 @@
if (path.isEmpty())
return;
- QMap<QString, QWeakPointer<ScColorProfileData> >::iterator iter = m_profileMap.find(path);
+ auto iter = m_profileMap.find(path);
if (iter != m_profileMap.end())
{
QSharedPointer<ScColorProfileData> strongRef = iter.value().toStrongRef();
@@ -34,7 +34,7 @@
bool ScColorProfileCache::contains(const QString& profilePath)
{
- QMap<QString, QWeakPointer<ScColorProfileData> >::iterator iter = m_profileMap.find(profilePath);
+ auto iter = m_profileMap.find(profilePath);
if (iter != m_profileMap.end())
{
QSharedPointer<ScColorProfileData> strongRef = iter.value().toStrongRef();
@@ -46,7 +46,7 @@
ScColorProfile ScColorProfileCache::profile(const QString& profilePath)
{
ScColorProfile profile;
- QMap<QString, QWeakPointer<ScColorProfileData> >::iterator iter = m_profileMap.find(profilePath);
+ auto iter = m_profileMap.find(profilePath);
if (iter != m_profileMap.end())
profile = ScColorProfile(iter.value());
return profile;
Modified: trunk/Scribus/scribus/desaxe/digester.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/desaxe/digester.cpp
==============================================================================
--- trunk/Scribus/scribus/desaxe/digester.cpp (original)
+++ trunk/Scribus/scribus/desaxe/digester.cpp Tue May 1 18:38:11 2018
@@ -225,7 +225,7 @@
if (dfa)
{
std::set<dfa_state_t> morituri(dfa->states());
- for (std::set<dfa_state_t>::iterator i=morituri.begin(); i != morituri.end(); ++i) {
+ for (auto i = morituri.begin(); i != morituri.end(); ++i) {
delete *i;
}
delete dfa;
Modified: trunk/Scribus/scribus/desaxe/saxiohelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/desaxe/saxiohelper.cpp
==============================================================================
--- trunk/Scribus/scribus/desaxe/saxiohelper.cpp (original)
+++ trunk/Scribus/scribus/desaxe/saxiohelper.cpp Tue May 1 18:38:11 2018
@@ -146,8 +146,7 @@
Xml_string toXMLString(const QList<float>& floatlist)
{
QString result = "";
- QList<float>::const_iterator dax;
- for (dax = floatlist.begin(); dax != floatlist.end(); ++dax)
+ for (auto dax = floatlist.cbegin(); dax != floatlist.cend(); ++dax)
result += toXMLString(*dax) + " ";
return result;
}
@@ -156,7 +155,7 @@
{
QStringList strlist = str.split(' ', QString::SkipEmptyParts);
QList<double> result;
- for (QStringList::iterator it=strlist.begin(); it != strlist.end(); ++it)
+ for (auto it = strlist.begin(); it != strlist.end(); ++it)
result.append(parseDouble(*it));
return result;
}
@@ -164,8 +163,7 @@
Xml_string toXMLString(const QVector<double>& doublelist)
{
QString result = "";
- QVector<double>::const_iterator dax;
- for (dax = doublelist.begin(); dax != doublelist.end(); ++dax)
+ for (auto dax = doublelist.cbegin(); dax != doublelist.cend(); ++dax)
result += toXMLString(*dax) + " ";
return result;
}
@@ -173,8 +171,7 @@
Xml_string toXMLString(const QVector<float>& floatlist)
{
QString result = "";
- QVector<float>::const_iterator dax;
- for (dax = floatlist.begin(); dax != floatlist.end(); ++dax)
+ for (auto dax = floatlist.cbegin(); dax != floatlist.cend(); ++dax)
result += toXMLString(*dax) + " ";
return result;
}
@@ -183,7 +180,7 @@
{
QStringList strlist = str.split(' ', QString::SkipEmptyParts);
QVector<double> result;
- for (QStringList::iterator it=strlist.begin(); it != strlist.end(); ++it)
+ for (auto it = strlist.cbegin(); it != strlist.cend(); ++it)
result.append(parseDouble(*it));
return result;
}
@@ -192,8 +189,7 @@
Xml_string toXMLString(const QList<int>& intlist)
{
QString result = "";
- QList<int>::const_iterator dax;
- for (dax = intlist.begin(); dax != intlist.end(); ++dax)
+ for (auto dax = intlist.cbegin(); dax != intlist.cend(); ++dax)
result += toXMLString(*dax) + " ";
return result;
}
@@ -203,7 +199,7 @@
{
QStringList strlist = str.split(' ', QString::SkipEmptyParts);
QList<int> result;
- for (QStringList::iterator it=strlist.begin(); it != strlist.end(); ++it)
+ for (auto it = strlist.cbegin(); it != strlist.cend(); ++it)
result.append(parseInt(*it));
return result;
}
@@ -211,8 +207,7 @@
Xml_string toXMLString(const QVector<int>& intlist)
{
QString result = "";
- QVector<int>::const_iterator dax;
- for (dax = intlist.begin(); dax != intlist.end(); ++dax)
+ for (auto dax = intlist.cbegin(); dax != intlist.cend(); ++dax)
result += toXMLString(*dax) + " ";
return result;
}
@@ -222,7 +217,7 @@
{
QStringList strlist = str.split(' ', QString::SkipEmptyParts);
QVector<int> result;
- for (QStringList::iterator it=strlist.begin(); it != strlist.end(); ++it)
+ for (auto it = strlist.cbegin(); it != strlist.cend(); ++it)
result.append(parseInt(*it));
return result;
}
@@ -232,7 +227,7 @@
{
QStringList strlist = str.split(' ', QString::SkipEmptyParts);
QStack<int> result;
- for (QStringList::iterator it=strlist.begin(); it != strlist.end(); ++it)
+ for (auto it = strlist.cbegin(); it != strlist.cend(); ++it)
result.append(parseInt(*it));
return result;
}
@@ -241,8 +236,7 @@
Xml_string toXMLString(const QStringList& list)
{
QString result = "";
- QStringList::const_iterator dax;
- for (dax = list.begin(); dax != list.end(); ++dax)
+ for (auto dax = list.cbegin(); dax != list.cend(); ++dax)
result += *dax + " ";
return result;
}
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pgf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pgf.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pgf.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pgf.cpp Tue May 1 18:38:11 2018
@@ -221,7 +221,7 @@
m_pixelFormat = Format_BGRA_8;
return true;
}
- catch(IOException& e)
+ catch (IOException& /*e*/)
{
return false;
}
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Tue May 1 18:38:11 2018
@@ -8629,8 +8629,7 @@
PageItem_OSGFrame *osgframe = ite->asOSGFrame();
QList<uint> viewList;
PdfId viewObj = 0;
- QHash<QString, PageItem_OSGFrame::viewDefinition>::iterator itv;
- for (itv = osgframe->viewMap.begin(); itv != osgframe->viewMap.end(); ++itv)
+ for (auto itv = osgframe->viewMap.begin(); itv != osgframe->viewMap.end(); ++itv)
{
PdfId viewObjL = writer.newObject();
viewList.append(viewObjL);
Modified: trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp Tue May 1 18:38:11 2018
@@ -2161,8 +2161,7 @@
stroke += " stroke-dasharray:";
if (Item->DashValues.count() != 0)
{
- QVector<double>::iterator it;
- for ( it = Item->DashValues.begin(); it != Item->DashValues.end(); ++it )
+ for (auto it = Item->DashValues.cbegin(); it != Item->DashValues.cend(); ++it )
{
stroke += IToStr(static_cast<int>(*it))+" ";
}
Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp Tue May 1 18:38:11 2018
@@ -1968,8 +1968,7 @@
QString dashVals = "";
if (Item->DashValues.count() != 0)
{
- QVector<double>::iterator it;
- for ( it = Item->DashValues.begin(); it != Item->DashValues.end(); ++it )
+ for (auto it = Item->DashValues.cbegin(); it != Item->DashValues.cend(); ++it)
{
dashVals += FToStr((*it) / Item->lineWidth())+" ";
}
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Tue May 1 18:38:11 2018
@@ -1316,7 +1316,7 @@
if (item->prevInChain() == 0 && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
- for (QHash<int, PageItem*>::iterator itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
+ for (auto itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
{
PageItem *item = itf.value();
if (item->prevInChain() == 0 && item->itemText.length() > 0)
@@ -2164,7 +2164,7 @@
if (item->prevInChain() == 0 && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
- for (QHash<int, PageItem*>::iterator itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
+ for (auto itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
{
PageItem *item = itf.value();
if (item->prevInChain() == 0 && item->itemText.length() > 0)
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Tue May 1 18:38:11 2018
@@ -1138,7 +1138,7 @@
if (item->prevInChain() == 0 && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
- for (QHash<int, PageItem*>::iterator itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
+ for (auto itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
{
PageItem *item = itf.value();
if (item->prevInChain() == 0 && item->itemText.length() > 0)
@@ -2464,7 +2464,7 @@
if (item->prevInChain() == 0 && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
- for (QHash<int, PageItem*>::iterator itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
+ for (auto itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
{
PageItem *item = itf.value();
if (item->prevInChain() == 0 && item->itemText.length() > 0)
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&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 Tue May 1 18:38:11 2018
@@ -6860,9 +6860,8 @@
}
if (!markeredMarksMap.isEmpty())
{
- QMap<Mark*,QMap<QString, MarkType> >::iterator markIt;
- QMap<Mark*,QMap<QString, MarkType> >::iterator end = markeredMarksMap.end();
- for (markIt = markeredMarksMap.begin(); markIt != end; ++markIt)
+ auto end = markeredMarksMap.end();
+ for (auto markIt = markeredMarksMap.begin(); markIt != end; ++markIt)
{
Mark* mark = markIt.key();
QMap<QString, MarkType> mark2map = markIt.value();
@@ -6961,9 +6960,8 @@
if (!notesNSets.isEmpty())
{
assert(!m_Doc->notesList().isEmpty());
- QMap<TextNote*, QString>::iterator it;
- QMap<TextNote*, QString>::iterator end = notesNSets.end();
- for (it = notesNSets.begin(); it != end; ++it)
+ auto end = notesNSets.end();
+ for (auto it = notesNSets.begin(); it != end; ++it)
{
TextNote* note = it.key();
assert(note != NULL);
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Tue May 1 18:38:11 2018
@@ -2058,8 +2058,7 @@
}
if (((item->asImageFrame()) || (item->asTextFrame())) && (!item->Pfile.isEmpty()) && (item->pixm.imgInfo.layerInfo.count() != 0) && (item->pixm.imgInfo.isRequest))
{
- QMap<int, ImageLoadRequest>::iterator it2;
- for (it2 = item->pixm.imgInfo.RequestProps.begin(); it2 != item->pixm.imgInfo.RequestProps.end(); ++it2)
+ for (auto it2 = item->pixm.imgInfo.RequestProps.begin(); it2 != item->pixm.imgInfo.RequestProps.end(); ++it2)
{
docu.writeEmptyElement("PSDLayer");
docu.writeAttribute("Layer",it2.key());
@@ -2214,8 +2213,7 @@
PageItem_OSGFrame *osgitem = item->asOSGFrame();
if (!item->Pfile.isEmpty())
{
- QHash<QString, PageItem_OSGFrame::viewDefinition>::iterator itv;
- for (itv = osgitem->viewMap.begin(); itv != osgitem->viewMap.end(); ++itv)
+ for (auto itv = osgitem->viewMap.begin(); itv != osgitem->viewMap.end(); ++itv)
{
QString tmp;
docu.writeStartElement("OSGViews");
Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Tue May 1 18:38:11 2018
@@ -1360,8 +1360,7 @@
{
if (!m_radioMap.isEmpty())
{
- QHash<QString, QList<int> >::iterator it;
- for (it = m_radioMap.begin(); it != m_radioMap.end(); ++it)
+ for (auto it = m_radioMap.begin(); it != m_radioMap.end(); ++it)
{
tmpSel->clear();
QList<int> refList = it.value();
Modified: trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&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 Tue May 1 18:38:11 2018
@@ -1626,8 +1626,7 @@
{
if (!linkSources.isEmpty())
{
- QHash<PageItem*, QString>::iterator it;
- for (it = linkSources.begin(); it != linkSources.end(); ++it)
+ for (auto it = linkSources.begin(); it != linkSources.end(); ++it)
{
PageItem* linkS = it.key();
QString target = it.value();
Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp Tue May 1 18:38:11 2018
@@ -42,9 +42,10 @@
m_wfList=wfList;
bool b=languagesComboBox->blockSignals(true);
languagesComboBox->clear();
- QMap<QString, QString>::iterator it = m_dictionaryMap->begin();
+
QStringList langsToAdd;
- while (it != m_dictionaryMap->end())
+ auto it = m_dictionaryMap->cbegin();
+ while (it != m_dictionaryMap->cend())
{
QString lang=LanguageManager::instance()->getLangFromAbbrev(it.key(), true);
if (!langsToAdd.contains(lang))
@@ -184,21 +185,22 @@
void HunspellDialog::setLanguageCombo(const QString &newLangAbbrev)
{
- QMap<QString, QString>::iterator it = m_dictionaryMap->begin();
- bool found=false;
- while (it != m_dictionaryMap->end())
- {
- if (it.key()==newLangAbbrev)
+ bool found = false;
+
+ auto it = m_dictionaryMap->cbegin();
+ while (it != m_dictionaryMap->cend())
+ {
+ if (it.key() == newLangAbbrev)
{
found=true;
break;
}
++it;
}
- int i=0;
+ int i = 0;
if (found)
- i=languagesComboBox->findText(LanguageManager::instance()->getLangFromAbbrev(newLangAbbrev,true));
- bool b=languagesComboBox->blockSignals(true);
+ i = languagesComboBox->findText(LanguageManager::instance()->getLangFromAbbrev(newLangAbbrev,true));
+ bool b = languagesComboBox->blockSignals(true);
languagesComboBox->setCurrentIndex(i);
languagesComboBox->blockSignals(b);
}
Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp Tue May 1 18:38:11 2018
@@ -79,8 +79,8 @@
return false;
//Initialise one hunspeller for each dictionary found
- QMap<QString, QString>::iterator it = dictionaryMap.begin();
- while (it != dictionaryMap.end())
+ auto it = dictionaryMap.cbegin();
+ while (it != dictionaryMap.cend())
{
//qDebug()<<"hunspell init:"<<it.key()<<it.value();
hspellerMap.insert(it.key(), new HunspellDict(it.value()+".aff", it.value()+".dic"));
@@ -165,10 +165,10 @@
{
//qDebug()<<"Spelling language to match style language IS installed ("<<wordLang<<")";
int i = 0;
- QMap<QString, QString>::iterator it = dictionaryMap.begin();
- while (it != dictionaryMap.end())
+ auto it = dictionaryMap.cbegin();
+ while (it != dictionaryMap.cend())
{
- if (it.key()==wordLang)
+ if (it.key() == wordLang)
break;
++i;
++it;
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue May 1 18:38:11 2018
@@ -563,7 +563,7 @@
continue;
if (osgDB::queryPlugin(*itr, infoList))
{
- for(osgDB::ReaderWriterInfoList::iterator rwi_itr = infoList.begin(); rwi_itr != infoList.end(); ++rwi_itr)
+ for (auto rwi_itr = infoList.begin(); rwi_itr != infoList.end(); ++rwi_itr)
{
osgDB::ReaderWriterInfo& info = *(*rwi_itr);
osgDB::ReaderWriter::FormatDescriptionMap::iterator fdm_itr;
@@ -2431,7 +2431,7 @@
{
if (!scrWindowsActions.isEmpty())
{
- for (QMap<QString, QPointer<ScrAction> >::iterator it = scrWindowsActions.begin(); it != scrWindowsActions.end(); ++it)
+ for (auto it = scrWindowsActions.begin(); it != scrWindowsActions.end(); ++it)
{
scrMenuMgr->removeMenuItem(it.key(), it.value(), "Windows");
}
@@ -3783,7 +3783,7 @@
doc->reformPages();
doc->refreshGuides();
doc->setLoading(false);
- for (QList<PageItem*>::iterator itm = doc->MasterItems.begin(); itm != doc->MasterItems.end(); ++itm)
+ for (auto itm = doc->MasterItems.begin(); itm != doc->MasterItems.end(); ++itm)
{
PageItem* ite = *itm;
// TODO fix that for Groups on Masterpages
@@ -3796,7 +3796,7 @@
/*QTime t;
t.start();*/
doc->flag_Renumber = false;
- for (QList<PageItem*>::iterator iti = doc->Items->begin(); iti != doc->Items->end(); ++iti)
+ for (auto iti = doc->Items->begin(); iti != doc->Items->end(); ++iti)
{
PageItem* ite = *iti;
if((ite->nextInChain() == NULL) && !ite->isNoteFrame()) //do not layout notes frames
@@ -3808,7 +3808,7 @@
doc->updateMarks(true);
doc->setLoading(false);
}
- for (QHash<int, PageItem*>::iterator itf = doc->FrameItems.begin(); itf != doc->FrameItems.end(); ++itf)
+ for (auto itf = doc->FrameItems.begin(); itf != doc->FrameItems.end(); ++itf)
{
PageItem *ite = itf.value();
// qDebug() << QString("load F: %1 %2 %3").arg(azz).arg((uint)ite).arg(ite->itemType());
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Tue May 1 18:38:11 2018
@@ -663,7 +663,7 @@
}
allItems.clear();
}
- for (QHash<int, PageItem*>::iterator itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
+ for (auto itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
{
PageItem *currItem = itf.value();
if (currItem->isGroup())
@@ -1386,7 +1386,7 @@
if (newNames.charStyles().contains(nStyle->marksChStyle()))
nStyle->setMarksCharStyle(newNames.charStyles().value(nStyle->marksChStyle()));
}
- for (QHash<int, PageItem*>::iterator itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
+ for (auto itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
{
PageItem *currItem = itf.value();
if (currItem)
@@ -3063,10 +3063,9 @@
bool ScribusDoc::setLayerPrintable(const int layerID, const bool isPrintable)
{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- bool found=false;
- for (it = Layers.begin(); it != itend; ++it)
+ bool found = false;
+ auto itend = Layers.end();
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
{
@@ -3089,11 +3088,10 @@
}
-bool ScribusDoc::layerPrintable(const int layerID)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+bool ScribusDoc::layerPrintable(const int layerID) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->ID == layerID)
return it->isPrintable;
@@ -3104,10 +3102,9 @@
bool ScribusDoc::setLayerVisible(const int layerID, const bool isViewable)
{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- bool found=false;
- for (it = Layers.begin(); it != itend; ++it)
+ bool found = false;
+ auto itend = Layers.end();
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
{
@@ -3122,11 +3119,10 @@
}
-bool ScribusDoc::layerVisible(const int layerID)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+bool ScribusDoc::layerVisible(const int layerID) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->ID == layerID)
return it->isViewable;
@@ -3136,10 +3132,9 @@
bool ScribusDoc::setLayerSelectable(const int layerID, const bool isSelectable)
{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- bool found=false;
- for (it = Layers.begin(); it != itend; ++it)
+ bool found = false;
+ auto itend = Layers.end();
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
{
@@ -3154,11 +3149,10 @@
}
-bool ScribusDoc::layerSelectable(const int layerID)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+bool ScribusDoc::layerSelectable(const int layerID) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->ID == layerID)
return it->isSelectable;
@@ -3169,10 +3163,9 @@
bool ScribusDoc::setLayerLocked(const int layerID, const bool isLocked)
{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- bool found=false;
- for (it = Layers.begin(); it != itend; ++it)
+ bool found = false;
+ auto itend = Layers.end();
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
{
@@ -3196,11 +3189,10 @@
}
-bool ScribusDoc::layerLocked(const int layerID)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+bool ScribusDoc::layerLocked(const int layerID) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->ID == layerID)
return !it->isEditable;
@@ -3211,10 +3203,9 @@
bool ScribusDoc::setLayerFlow(const int layerID, const bool flow)
{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- bool found=false;
- for (it = Layers.begin(); it != itend; ++it)
+ bool found = false;
+ auto itend = Layers.end();
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
{
@@ -3234,7 +3225,7 @@
if (found)
{
// #9188 : invalidate layout of items below layer
- for (it = Layers.begin(); it != itend; ++it)
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
break;
@@ -3246,11 +3237,10 @@
}
-bool ScribusDoc::layerFlow(const int layerID)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+bool ScribusDoc::layerFlow(const int layerID) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->ID == layerID)
return it->flowControl;
@@ -3261,10 +3251,9 @@
bool ScribusDoc::setLayerTransparency(const int layerID, double trans)
{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- bool found=false;
- for (it = Layers.begin(); it != itend; ++it)
+ bool found = false;
+ auto itend = Layers.end();
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
{
@@ -3288,11 +3277,10 @@
}
-double ScribusDoc::layerTransparency(const int layerID)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+double ScribusDoc::layerTransparency(const int layerID) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->ID == layerID)
return it->transparency;
@@ -3303,10 +3291,9 @@
bool ScribusDoc::setLayerBlendMode(const int layerID, int blend)
{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- bool found=false;
- for (it = Layers.begin(); it != itend; ++it)
+ bool found = false;
+ auto itend = Layers.end();
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
{
@@ -3330,11 +3317,10 @@
}
-int ScribusDoc::layerBlendMode(const int layerID)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+int ScribusDoc::layerBlendMode(const int layerID) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->ID == layerID)
return it->blendMode;
@@ -3345,10 +3331,9 @@
bool ScribusDoc::setLayerOutline(const int layerID, const bool outline)
{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- bool found=false;
- for (it = Layers.begin(); it != itend; ++it)
+ bool found = false;
+ auto itend = Layers.end();
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
{
@@ -3363,11 +3348,10 @@
}
-bool ScribusDoc::layerOutline(const int layerID)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+bool ScribusDoc::layerOutline(const int layerID) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->ID == layerID)
return it->outlineMode;
@@ -3378,10 +3362,9 @@
bool ScribusDoc::setLayerMarker(const int layerID, QColor color)
{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- bool found=false;
- for (it = Layers.begin(); it != itend; ++it)
+ bool found = false;
+ auto itend = Layers.end();
+ for (auto it = Layers.begin(); it != itend; ++it)
{
if (it->ID == layerID)
{
@@ -3396,11 +3379,10 @@
}
-QColor ScribusDoc::layerMarker(const int layerID)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+QColor ScribusDoc::layerMarker(const int layerID) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->ID == layerID)
return it->markerColor;
@@ -3409,13 +3391,14 @@
}
-int ScribusDoc::layerLevelFromID(const int layerID)
-{
- int layerCount=Layers.count();
+int ScribusDoc::layerLevelFromID(const int layerID) const
+{
+ int layerCount = Layers.count();
for (int i=0; i < layerCount; ++i)
{
- if (Layers[i].ID == layerID)
- return Layers[i].Level;
+ const ScLayer& layer = Layers.at(i);
+ if (layer.ID == layerID)
+ return layer.Level;
}
return -1;
}
@@ -3427,22 +3410,22 @@
}
-int ScribusDoc::layerIDFromLevel(const int layerLevel)
-{
- int layerCount=Layers.count();
- for (int i=0; i < layerCount; ++i)
- {
- if (Layers[i].Level == layerLevel)
- return Layers[i].ID;
+int ScribusDoc::layerIDFromLevel(const int layerLevel) const
+{
+ int layerCount = Layers.count();
+ for (int i = 0; i < layerCount; ++i)
+ {
+ const ScLayer& layer = Layers.at(i);
+ if (layer.Level == layerLevel)
+ return layer.ID;
}
return -1;
}
-int ScribusDoc::layerIDFromName(const QString& name)
-{
- ScLayers::iterator itend=Layers.end();
- ScLayers::iterator it;
- for (it = Layers.begin(); it != itend; ++it)
+int ScribusDoc::layerIDFromName(const QString& name) const
+{
+ auto itend = Layers.cend();
+ for (auto it = Layers.cbegin(); it != itend; ++it)
{
if (it->Name == name)
return it->ID;
@@ -3546,11 +3529,12 @@
QString ScribusDoc::layerName(const int layerID) const
{
- int layerCount=Layers.count();
+ int layerCount = Layers.count();
for (int i=0; i < layerCount; ++i)
{
- if (Layers[i].ID == layerID)
- return Layers[i].Name;
+ const ScLayer& layer = Layers[i];
+ if (layer.ID == layerID)
+ return layer.Name;
}
return QString::null;
}
@@ -3875,7 +3859,7 @@
}
allItems.clear();
}
- for (QHash<int, PageItem*>::iterator itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
+ for (auto itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
{
PageItem *currItem = itf.value();
if (currItem->isGroup())
@@ -4219,7 +4203,7 @@
}
allItems.clear();
}
- for (QHash<int, PageItem*>::iterator itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
+ for (auto itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
{
PageItem *currItem = itf.value();
if (currItem->isGroup())
@@ -4703,7 +4687,7 @@
allItems.clear();
}
}
- for (QHash<int, PageItem*>::iterator itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
+ for (auto itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
{
PageItem *it = itf.value();
if (it->isGroup())
@@ -5238,7 +5222,7 @@
QList<PageItem*> itemList = FrameItems.values();
recalculateColorsList(&itemList);
QList<PageItem*> allItems;
- for (QHash<int, PageItem*>::iterator it = FrameItems.begin(); it != FrameItems.end(); ++it)
+ for (auto it = FrameItems.begin(); it != FrameItems.end(); ++it)
{
PageItem *ite = it.value();
if (ite->isGroup())
@@ -6184,7 +6168,7 @@
// #10379: Scribus crash when opening .sla document
// OwnPage is not meaningful for inline frame
- for (QHash<int, PageItem*>::iterator it = FrameItems.begin(); it != FrameItems.end(); ++it)
+ for (auto it = FrameItems.begin(); it != FrameItems.end(); ++it)
{
currItem = it.value();
currItem->OwnPage = -1;
@@ -7457,7 +7441,7 @@
int counter = 0;
if (usingGUI && dia != nullptr)
counter = dia->value();
- for (QHash<int, PageItem*>::iterator itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
+ for (auto itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
{
PageItem *it = itf.value();
if (it->isGroup())
@@ -10030,7 +10014,7 @@
}
allItems.clear();
}
- for (QHash<int, PageItem*>::iterator it = FrameItems.begin(); it != FrameItems.end(); ++it)
+ for (auto it = FrameItems.begin(); it != FrameItems.end(); ++it)
{
PageItem *currItem = it.value();
if (currItem->isGroup())
@@ -10168,7 +10152,7 @@
}
allItems.clear();
}
- for (QHash<int, PageItem*>::iterator it = FrameItems.begin(); it != FrameItems.end(); ++it)
+ for (auto it = FrameItems.begin(); it != FrameItems.end(); ++it)
{
PageItem *currItem = it.value();
if (currItem->isGroup())
@@ -10291,7 +10275,7 @@
}
allItems.clear();
}
- for (QHash<int, PageItem*>::iterator it = FrameItems.begin(); it != FrameItems.end(); ++it)
+ for (auto it = FrameItems.begin(); it != FrameItems.end(); ++it)
{
PageItem *currItem = it.value();
if (currItem->isGroup())
@@ -10395,7 +10379,7 @@
allItems.clear();
}
- for (QHash<int, PageItem*>::iterator it = FrameItems.begin(); it != FrameItems.end(); ++it)
+ for (auto it = FrameItems.begin(); it != FrameItems.end(); ++it)
{
PageItem *currItem = it.value();
if (currItem->isGroup())
@@ -10534,7 +10518,7 @@
}
allItems.clear();
}
- for (QHash<int, PageItem*>::iterator it = FrameItems.begin(); it != FrameItems.end(); ++it)
+ for (auto it = FrameItems.begin(); it != FrameItems.end(); ++it)
{
PageItem *currItem = it.value();
if (currItem->isGroup())
@@ -11346,7 +11330,7 @@
}
allItems.clear();
}
- for (QHash<int, PageItem*>::iterator it = FrameItems.begin(); it != FrameItems.end(); ++it)
+ for (auto it = FrameItems.begin(); it != FrameItems.end(); ++it)
{
PageItem *currItem = it.value();
if (currItem->isGroup())
@@ -16432,7 +16416,7 @@
allItems.clear();
}
}
- for (QHash<int, PageItem*>::iterator itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
+ for (auto itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
{
PageItem *ite = itf.value();
if (ite->isGroup())
@@ -18370,7 +18354,7 @@
allItems.clear();
}
}
- for (QHash<int, PageItem*>::iterator itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
+ for (auto itf = FrameItems.begin(); itf != FrameItems.end(); ++itf)
{
it = itf.value();
if (it->isGroup())
Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Tue May 1 18:38:11 2018
@@ -324,7 +324,7 @@
* @param layerID ID of the layer
* @return Printable or not
*/
- bool layerPrintable(const int layerID);
+ bool layerPrintable(const int layerID) const;
/**
* @brief Set the layer visible via the layer number
* @param layerID ID of the layer
@@ -337,13 +337,13 @@
* @param layerID ID of the layer
* @return Visible or not
*/
- bool layerVisible(const int layerID);
+ bool layerVisible(const int layerID) const;
/**
* @brief are objects on the layer selectable
* @param layerID ID of the layer
* @return Items selectable or not
*/
- bool layerSelectable(const int layerID);
+ bool layerSelectable(const int layerID) const;
/**
* @brief Set objects on the layer selectable via the layer ID
* @param layerID ID of the layer
@@ -363,7 +363,7 @@
* @param layerID ID of the layer
* @return Locked or not
*/
- bool layerLocked(const int layerID);
+ bool layerLocked(const int layerID) const;
/**
* @brief Set the layer flow via the layer number
* @param layerID ID of the layer
@@ -376,7 +376,7 @@
* @param layerID ID of the layer
* @return flow or not
*/
- bool layerFlow(const int layerID);
+ bool layerFlow(const int layerID) const;
/**
* @brief Set the layer transparency via the layer number
* @param layerID ID of the layer
@@ -389,7 +389,7 @@
* @param layerID ID of the layer
* @return transparency value 0.0 - 1.0
*/
- double layerTransparency(const int layerID);
+ double layerTransparency(const int layerID) const;
/**
* @brief Set the layer layerBlendMode via the layer number
* @param layerID ID of the layer
@@ -402,13 +402,13 @@
* @param layerID ID of the layer
* @return layerBlendMode
*/
- int layerBlendMode(const int ID);
+ int layerBlendMode(const int ID) const;
/**
* @brief Return the level of the requested layer
* @param layerID ID of the layer
* @return Level of the layer
*/
- int layerLevelFromID(const int layerID);
+ int layerLevelFromID(const int layerID) const;
/**
* @brief Set the layer marker color
* @param ID Number of the layer
@@ -421,7 +421,7 @@
* @param layerID ID of the layer
* @return marker color
*/
- QColor layerMarker(const int layerID);
+ QColor layerMarker(const int layerID) const;
/**
* @brief Set the layer outline mode via the layer number
* @param layerID ID of the layer
@@ -434,18 +434,18 @@
* @param layerID ID of the layer
* @return outline or not
*/
- bool layerOutline(const int layerID);
+ bool layerOutline(const int layerID) const;
/**
* @brief Return the number of the layer at a certain level
* @param layerLevel Layer level
* @return Layer ID
*/
- int layerIDFromLevel(const int layerLevel);
+ int layerIDFromLevel(const int layerLevel) const;
/**
* @brief Return the layer count
* @return Number of layers in doc
*/
- int layerIDFromName(const QString& name);
+ int layerIDFromName(const QString& name) const;
int layerCount() const;
/**
* @brief Lower a layer
Modified: trunk/Scribus/scribus/text/glyphcluster.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/text/glyphcluster.cpp
==============================================================================
--- trunk/Scribus/scribus/text/glyphcluster.cpp (original)
+++ trunk/Scribus/scribus/text/glyphcluster.cpp Tue May 1 18:38:11 2018
@@ -25,7 +25,7 @@
double GlyphCluster::width() const
{
double width = 0;
- for (const GlyphLayout gl : m_glyphs)
+ for (const GlyphLayout& gl : m_glyphs)
{
width += gl.xadvance * m_scaleH;
}
@@ -36,7 +36,7 @@
{
const ScFace &font = m_style->font();
double asc = 0;
- for (const GlyphLayout gl : m_glyphs)
+ for (const GlyphLayout& gl : m_glyphs)
{
GlyphMetrics gm = font.glyphBBox(gl.glyph, m_style->fontSize() / 10.0);
asc = qMax(asc, gm.ascent * m_scaleV);
@@ -48,7 +48,7 @@
{
const ScFace &font = m_style->font();
double des = 0;
- for (const GlyphLayout gl : m_glyphs)
+ for (const GlyphLayout& gl : m_glyphs)
{
GlyphMetrics gm = font.glyphBBox(gl.glyph, m_style->fontSize() / 10.0);
des = qMax(des, gm.descent * m_scaleV);
Modified: trunk/Scribus/scribus/ui/charselectenhanced.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/ui/charselectenhanced.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/charselectenhanced.cpp (original)
+++ trunk/Scribus/scribus/ui/charselectenhanced.cpp Tue May 1 18:38:11 2018
@@ -107,8 +107,7 @@
charactersHebrew.clear();
ScFace::FaceEncoding glyphs;
(*m_doc->AllFonts)[m_fontInUse].glyphNames(glyphs);
- for (ScFace::FaceEncoding::iterator it=glyphs.begin();
- it != glyphs.end(); ++it)
+ for (auto it = glyphs.begin(); it != glyphs.end(); ++it)
{
charcode = it.value().charcode;
gname = it.value().glyphName;
Modified: trunk/Scribus/scribus/ui/inlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/ui/inlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/inlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/inlinepalette.cpp Tue May 1 18:38:11 2018
@@ -255,7 +255,7 @@
InlineViewWidget->setWordWrap(true);
if (!m_doc)
return;
- for (QHash<int, PageItem*>::iterator it = m_doc->FrameItems.begin(); it != m_doc->FrameItems.end(); ++it)
+ for (auto it = m_doc->FrameItems.begin(); it != m_doc->FrameItems.end(); ++it)
{
PageItem *currItem = it.value();
QPixmap pm = QPixmap::fromImage(currItem->DrawObj_toImage(48));
Modified: trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp Tue May 1 18:38:11 2018
@@ -416,16 +416,16 @@
void Prefs_KeyboardShortcuts::applySearch( const QString & newss )
{
//Must run this as if newss is not empty and we go to the next for loop, the set visible doesn't work
- for (QList<QTreeWidgetItem*>::iterator it=lviToMenuMap.begin(); it!=lviToMenuMap.end(); ++it)
+ for (auto it = lviToMenuMap.begin(); it != lviToMenuMap.end(); ++it)
(*it)->setHidden(false);
if (newss.isEmpty())
{
- for (QMap<QTreeWidgetItem*, QString>::iterator it=lviToActionMap.begin(); it!=lviToActionMap.end(); ++it)
+ for (auto it = lviToActionMap.begin(); it != lviToActionMap.end(); ++it)
it.key()->setHidden(false);
return;
}
//Seem to need to do this.. isOpen doesn't seem to do what it says
- for (QMap<QTreeWidgetItem*, QString>::iterator it=lviToActionMap.begin(); it!=lviToActionMap.end(); ++it)
+ for (auto it = lviToActionMap.begin(); it != lviToActionMap.end(); ++it)
{
if (it.key()->text(0).contains(newss, Qt::CaseInsensitive))
it.key()->setHidden(false);
Modified: trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pdfexport.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_pdfexport.cpp Tue May 1 18:38:11 2018
@@ -295,7 +295,7 @@
// Build a list of all Fonts used in Annotations;
PageItem *pgit;
QList<PageItem*> allItems;
- for (QHash<int, PageItem*>::iterator it = m_doc->FrameItems.begin(); it != m_doc->FrameItems.end(); ++it)
+ for (auto it = m_doc->FrameItems.begin(); it != m_doc->FrameItems.end(); ++it)
{
PageItem *currItem = it.value();
if (currItem->isGroup())
Modified: trunk/Scribus/scribus/ui/smlinestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/ui/smlinestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.cpp (original)
+++ trunk/Scribus/scribus/ui/smlinestyle.cpp Tue May 1 18:38:11 2018
@@ -256,7 +256,7 @@
ite->NamedLStyle = replacement[ite->NamedLStyle];
}
}
- for (QHash<int, PageItem*>::iterator it = m_doc->FrameItems.begin(); it != m_doc->FrameItems.end(); ++it)
+ for (auto it = m_doc->FrameItems.begin(); it != m_doc->FrameItems.end(); ++it)
{
ite = it.value();
if (!ite->NamedLStyle.isEmpty())
Modified: trunk/Scribus/scribus/util.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22509&path=/trunk/Scribus/scribus/util.cpp
==============================================================================
--- trunk/Scribus/scribus/util.cpp (original)
+++ trunk/Scribus/scribus/util.cpp Tue May 1 18:38:11 2018
@@ -455,13 +455,13 @@
QImage pgPix(10, 10, QImage::Format_ARGB32_Premultiplied);
QRect rd; // = QRect(0,0,9,9);
ScPainter *painter = new ScPainter(&pgPix, pgPix.width(), pgPix.height());
- for (QList<PageItem*>::iterator it = currentDoc->MasterItems.begin(); it != currentDoc->MasterItems.end(); ++it)
+ for (auto it = currentDoc->MasterItems.begin(); it != currentDoc->MasterItems.end(); ++it)
{
PageItem* currItem = *it;
if (currItem->itemType() == PageItem::PathText)
currItem->DrawObj(painter, rd);
}
- for (QList<PageItem*>::iterator it = currentDoc->Items->begin(); it != currentDoc->Items->end(); ++it)
+ for (auto it = currentDoc->Items->begin(); it != currentDoc->Items->end(); ++it)
{
PageItem* currItem = *it;
currItem->layout();
More information about the scribus-commit
mailing list