r17400 by fschmid - Changed the data type for the Patterns, Gradients and Multilines from QMap to QHash, as QHash is ten times faster for read access.
scribus-commit
scribus-commit at lists.scribus.net
Sun Mar 25 11:10:42 UTC 2012
Author: fschmid
Date: Sun Mar 25 11:10:41 2012
New Revision: 17400
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17400
Log:
Changed the data type for the Patterns, Gradients and Multilines from QMap to QHash, as QHash is ten times faster for read access.
Modified:
trunk/Scribus/scribus/colorsetmanager.cpp
trunk/Scribus/scribus/colorsetmanager.h
trunk/Scribus/scribus/fileloader.cpp
trunk/Scribus/scribus/fileloader.h
trunk/Scribus/scribus/loadsaveplugin.cpp
trunk/Scribus/scribus/loadsaveplugin.h
trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/prefsstructs.h
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusdoc.h
trunk/Scribus/scribus/serializer.cpp
trunk/Scribus/scribus/ui/cpalette.cpp
trunk/Scribus/scribus/ui/cpalette.h
trunk/Scribus/scribus/ui/gradientaddedit.cpp
trunk/Scribus/scribus/ui/gradientaddedit.h
trunk/Scribus/scribus/ui/paintmanager.cpp
trunk/Scribus/scribus/ui/paintmanager.h
trunk/Scribus/scribus/ui/propertiespalette_line.cpp
trunk/Scribus/scribus/ui/smlinestyle.cpp
trunk/Scribus/scribus/ui/smlinestyle.h
trunk/Scribus/scribus/ui/smstyleimport.cpp
trunk/Scribus/scribus/ui/smstyleimport.h
trunk/Scribus/scribus/ui/stylemanager.cpp
trunk/Scribus/scribus/ui/symbolpalette.cpp
trunk/Scribus/scribus/ui/transparencypalette.cpp
trunk/Scribus/scribus/ui/transparencypalette.h
trunk/Scribus/scribus/util_color.cpp
trunk/Scribus/scribus/util_color.h
Modified: trunk/Scribus/scribus/colorsetmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/colorsetmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/colorsetmanager.cpp (original)
+++ trunk/Scribus/scribus/colorsetmanager.cpp Sun Mar 25 11:10:41 2012
@@ -275,13 +275,13 @@
return true;
}
-bool ColorSetManager::loadPalette(const QString& paletteFileName, ScribusDoc *doc, ColorList &colors, QMap<QString,VGradient> &gradients, QMap<QString, ScPattern> &patterns, bool merge)
+bool ColorSetManager::loadPalette(const QString& paletteFileName, ScribusDoc *doc, ColorList &colors, QHash<QString,VGradient> &gradients, QHash<QString, ScPattern> &patterns, bool merge)
{
if (checkPaletteFormat(paletteFileName))
{
ColorList colorListBack = doc->PageColors;
- QMap<QString, VGradient> dialogGradientsBack = doc->docGradients;
- QMap<QString, ScPattern> dialogPatternsBack = doc->docPatterns;
+ QHash<QString, VGradient> dialogGradientsBack = doc->docGradients;
+ QHash<QString, ScPattern> dialogPatternsBack = doc->docPatterns;
if (merge)
{
doc->PageColors = colors;
Modified: trunk/Scribus/scribus/colorsetmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/colorsetmanager.h
==============================================================================
--- trunk/Scribus/scribus/colorsetmanager.h (original)
+++ trunk/Scribus/scribus/colorsetmanager.h Sun Mar 25 11:10:41 2012
@@ -42,7 +42,7 @@
QString userPaletteFileFromName(const QString& paletteName);
bool paletteLocationLocked(const QString& palettePath);
bool checkPaletteFormat(const QString& paletteFileName);
- bool loadPalette(const QString& paletteFileName, ScribusDoc *doc, ColorList &colors, QMap<QString,VGradient> &gradients, QMap<QString, ScPattern> &patterns, bool merge);
+ bool loadPalette(const QString& paletteFileName, ScribusDoc *doc, ColorList &colors, QHash<QString,VGradient> &gradients, QHash<QString, ScPattern> &patterns, bool merge);
protected:
QStringList paletteLocations;
Modified: trunk/Scribus/scribus/fileloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/fileloader.cpp
==============================================================================
--- trunk/Scribus/scribus/fileloader.cpp (original)
+++ trunk/Scribus/scribus/fileloader.cpp Sun Mar 25 11:10:41 2012
@@ -293,7 +293,7 @@
return false;
}
-bool FileLoader::readLineStyles(QMap<QString,multiLine> *Sty)
+bool FileLoader::readLineStyles(QHash<QString,multiLine> *Sty)
{
QList<FileFormat>::const_iterator it;
if (findFormat(m_fileType, it))
Modified: trunk/Scribus/scribus/fileloader.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/fileloader.h
==============================================================================
--- trunk/Scribus/scribus/fileloader.h (original)
+++ trunk/Scribus/scribus/fileloader.h Sun Mar 25 11:10:41 2012
@@ -10,6 +10,7 @@
#include <QString>
#include <QStringList>
#include <QMap>
+#include <QHash>
#include <QList>
#include "scribusapi.h"
@@ -43,7 +44,7 @@
bool readCharStyles(ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles);
bool readPageCount(int *num1, int *num2, QStringList & masterPageNames);
bool readColors(ColorList & colors);
- bool readLineStyles(QMap<QString,multiLine> *Sty);
+ bool readLineStyles(QHash<QString, multiLine> *Sty);
QImage readThumbnail();
bool postLoad(ScribusDoc* currDoc);
void informReplacementFonts();
Modified: trunk/Scribus/scribus/loadsaveplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/loadsaveplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/loadsaveplugin.cpp (original)
+++ trunk/Scribus/scribus/loadsaveplugin.cpp Sun Mar 25 11:10:41 2012
@@ -404,7 +404,7 @@
return false;
}
-bool LoadSavePlugin::readLineStyles(const QString& /*fileName*/, QMap<QString,multiLine>* /*Sty*/)
+bool LoadSavePlugin::readLineStyles(const QString& /*fileName*/, QHash<QString,multiLine>* /*Sty*/)
{
return false;
}
@@ -524,7 +524,7 @@
return (plug && load) ? plug->readCharStyles(fileName, doc, docCharStyles) : false;
}
-bool FileFormat::readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty) const
+bool FileFormat::readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty) const
{
return (plug && load) ? plug->readLineStyles(fileName, Sty) : false;
}
Modified: trunk/Scribus/scribus/loadsaveplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/loadsaveplugin.h
==============================================================================
--- trunk/Scribus/scribus/loadsaveplugin.h (original)
+++ trunk/Scribus/scribus/loadsaveplugin.h Sun Mar 25 11:10:41 2012
@@ -110,7 +110,7 @@
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
virtual bool readCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles);
- virtual bool readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
+ virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual QImage readThumbnail(const QString& fileName);
@@ -209,7 +209,7 @@
bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null) const;
bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles) const;
bool readCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles) const;
- bool readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty) const;
+ bool readLineStyles(const QString& fileName, QHash<QString,multiLine> *Sty) const;
bool readColors(const QString& fileName, ColorList & colors) const;
bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames) const;
QImage readThumbnail(const QString& fileName) const;
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&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 Sun Mar 25 11:10:41 2012
@@ -1817,7 +1817,7 @@
QString Nam = pg.attribute("Name");
QString Nam2 = Nam;
int copyC = 1;
- QMap<QString,multiLine>::ConstIterator mlit = m_Doc->MLineStyles.find(Nam2);
+ QHash<QString,multiLine>::ConstIterator mlit = m_Doc->MLineStyles.find(Nam2);
if (mlit != m_Doc->MLineStyles.end() && ml != mlit.value())
{
while (m_Doc->MLineStyles.contains(Nam2))
@@ -2266,7 +2266,7 @@
return true;
}
-bool Scribus12Format::readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty)
+bool Scribus12Format::readLineStyles(const QString& fileName, QHash<QString,multiLine> *Sty)
{
QDomDocument docu("scridoc");
QString f(readSLA(fileName));
@@ -2305,7 +2305,7 @@
QString Nam = pg.attribute("Name");
QString Nam2 = Nam;
int copyC = 1;
- QMap<QString,multiLine>::ConstIterator mlit = Sty->find(Nam2);
+ QHash<QString,multiLine>::ConstIterator mlit = Sty->find(Nam2);
if (mlit != Sty->end() && ml != mlit.value())
{
while (Sty->contains(Nam2))
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h Sun Mar 25 11:10:41 2012
@@ -15,6 +15,7 @@
#include <QDomElement>
#include <QMap>
+#include <QHash>
#include <QString>
#include <QList>
@@ -42,7 +43,7 @@
// Special features - .sla page extraction support
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
- virtual bool readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
+ virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&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 Sun Mar 25 11:10:41 2012
@@ -3140,7 +3140,7 @@
QString mlName2 = mlName;
readMultiline(ml, reader);
int copyC = 1;
- QMap<QString,multiLine>::ConstIterator mlit = m_Doc->MLineStyles.find(mlName2);
+ QHash<QString,multiLine>::ConstIterator mlit = m_Doc->MLineStyles.find(mlName2);
if (mlit != m_Doc->MLineStyles.end() && ml != mlit.value())
{
while (m_Doc->MLineStyles.contains(mlName2))
@@ -3513,7 +3513,7 @@
return true;
}
-bool Scribus134Format::readLineStyles(const QString& fileName, QMap<QString,multiLine> *styles)
+bool Scribus134Format::readLineStyles(const QString& fileName, QHash<QString,multiLine> *styles)
{
QString f(readSLA(fileName));
if (f.isEmpty())
@@ -3547,7 +3547,7 @@
QString mlName2 = mlName;
readMultiline(ml, reader);
int copyC = 1;
- QMap<QString,multiLine>::ConstIterator mlit = styles->find(mlName2);
+ QHash<QString,multiLine>::ConstIterator mlit = styles->find(mlName2);
if (mlit != styles->end() && ml != mlit.value())
{
while (styles->contains(mlName2))
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h Sun Mar 25 11:10:41 2012
@@ -14,6 +14,7 @@
#include "styles/styleset.h"
#include <QMap>
+#include <QHash>
#include <QString>
#include <QList>
#include <QProgressBar>
@@ -50,7 +51,7 @@
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
virtual bool readCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles);
- virtual bool readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
+ virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&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 Sun Mar 25 11:10:41 2012
@@ -2078,7 +2078,7 @@
QString Nam = pg.attribute("Name");
QString Nam2 = Nam;
int copyC = 1;
- QMap<QString,multiLine>::ConstIterator mlit = m_Doc->MLineStyles.find(Nam2);
+ QHash<QString,multiLine>::ConstIterator mlit = m_Doc->MLineStyles.find(Nam2);
if (mlit != m_Doc->MLineStyles.end() && ml != mlit.value())
{
while (m_Doc->MLineStyles.contains(Nam2))
@@ -2504,7 +2504,7 @@
return true;
}
-bool Scribus13Format::readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty)
+bool Scribus13Format::readLineStyles(const QString& fileName, QHash<QString,multiLine> *Sty)
{
QDomDocument docu("scridoc");
QString f(readSLA(fileName));
@@ -2543,7 +2543,7 @@
QString Nam = pg.attribute("Name");
QString Nam2 = Nam;
int copyC = 1;
- QMap<QString,multiLine>::ConstIterator mlit = Sty->find(Nam2);
+ QHash<QString,multiLine>::ConstIterator mlit = Sty->find(Nam2);
if (mlit != Sty->end() && ml != mlit.value())
{
while (Sty->contains(Nam2))
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h Sun Mar 25 11:10:41 2012
@@ -41,7 +41,7 @@
// Special features - .sla page extraction support
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
- virtual bool readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
+ virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&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 Sun Mar 25 11:10:41 2012
@@ -5186,7 +5186,7 @@
QString mlName2 = mlName;
readMultiline(ml, reader);
int copyC = 1;
- QMap<QString,multiLine>::ConstIterator mlit = m_Doc->MLineStyles.find(mlName2);
+ QHash<QString,multiLine>::ConstIterator mlit = m_Doc->MLineStyles.find(mlName2);
if (mlit != m_Doc->MLineStyles.end() && ml != mlit.value())
{
while (m_Doc->MLineStyles.contains(mlName2))
@@ -5708,7 +5708,7 @@
return true;
}
-bool Scribus150Format::readLineStyles(const QString& fileName, QMap<QString,multiLine> *styles)
+bool Scribus150Format::readLineStyles(const QString& fileName, QHash<QString,multiLine> *styles)
{
QString f(readSLA(fileName));
if (f.isEmpty())
@@ -5742,7 +5742,7 @@
QString mlName2 = mlName;
readMultiline(ml, reader);
int copyC = 1;
- QMap<QString,multiLine>::ConstIterator mlit = styles->find(mlName2);
+ QHash<QString,multiLine>::ConstIterator mlit = styles->find(mlName2);
if (mlit != styles->end() && ml != mlit.value())
{
while (styles->contains(mlName2))
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h Sun Mar 25 11:10:41 2012
@@ -55,7 +55,7 @@
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
virtual bool readCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles);
- virtual bool readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
+ virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&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 Sun Mar 25 11:10:41 2012
@@ -450,7 +450,7 @@
void Scribus150Format::writeLinestyles(ScXmlStreamWriter& docu)
{
- QMap<QString,multiLine>::Iterator itMU;
+ QHash<QString,multiLine>::Iterator itMU;
for (itMU = m_Doc->MLineStyles.begin(); itMU != m_Doc->MLineStyles.end(); ++itMU)
{
docu.writeStartElement("MultiLine");
@@ -551,8 +551,8 @@
void Scribus150Format::writeGradients(ScXmlStreamWriter & docu, bool part)
{
- QMap<QString, VGradient>::Iterator itGrad;
- QMap<QString, VGradient> gradMap;
+ QHash<QString, VGradient>::Iterator itGrad;
+ QHash<QString, VGradient> gradMap;
if (part)
m_Doc->getUsedGradients(gradMap);
else
Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Sun Mar 25 11:10:41 2012
@@ -449,8 +449,8 @@
VerifierPrefs verifierPrefs;
QList<ArrowDesc> arrowStyles;
- QMap<QString, VGradient> defaultGradients;
- QMap<QString, ScPattern> defaultPatterns;
+ QHash<QString, VGradient> defaultGradients;
+ QHash<QString, ScPattern> defaultPatterns;
QList<PageSet> pageSets;
QStringList activePageSizes;
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Mar 25 11:10:41 2012
@@ -1862,8 +1862,8 @@
csm.findPalettes();
csm.findUserPalettes();
ColorList colorList;
- QMap<QString, VGradient> gradientsList;
- QMap<QString, ScPattern> patternsList;
+ QHash<QString, VGradient> gradientsList;
+ QHash<QString, ScPattern> patternsList;
QString Cpfad = QDir::toNativeSeparators(ScPaths::getApplicationDataDir())+"DefaultColors.xml";
QFile fc(Cpfad);
if (fc.exists())
@@ -9907,8 +9907,8 @@
void ScribusMainWindow::managePaints()
{
ColorList edc;
- QMap<QString, VGradient> *Gradients;
- QMap<QString, ScPattern> *docPatterns;
+ QHash<QString, VGradient> *Gradients;
+ QHash<QString, ScPattern> *docPatterns;
ScribusDoc* tmpDoc;
if (HaveDoc)
{
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sun Mar 25 11:10:41 2012
@@ -1051,7 +1051,7 @@
// for (uint i = 0; i < docLineStyles.count(); ++i)
// docLineStyles[i].getNamedResources(lists);
- QMap<QString,ScPattern>::ConstIterator it;
+ QHash<QString,ScPattern>::ConstIterator it;
for (it = docPatterns.begin(); it != docPatterns.end(); ++it)
{
ScPattern pa = *it;
@@ -1060,7 +1060,7 @@
pa.items.at(o)->getNamedResources(lists);
}
}
- QMap<QString,VGradient>::ConstIterator itg;
+ QHash<QString,VGradient>::ConstIterator itg;
for (itg = docGradients.begin(); itg != docGradients.end(); ++itg)
{
QList<VColorStop*> cstops = itg.value().colorStops();
@@ -1273,7 +1273,7 @@
docCellStyles[i].replaceNamedResources(newNames);
}
- QMap<QString,ScPattern>::Iterator it;
+ QHash<QString,ScPattern>::Iterator it;
for (it = docPatterns.begin(); it != docPatterns.end(); ++it)
{
if (newNames.patterns().contains(it.key()))
@@ -1288,7 +1288,7 @@
}
}
- QMap<QString,VGradient>::Iterator itg;
+ QHash<QString,VGradient>::Iterator itg;
for (itg = docGradients.begin(); itg != docGradients.end(); ++itg)
{
if (newNames.gradients().contains(itg.key()))
@@ -1499,7 +1499,7 @@
{
StyleSet<ParagraphStyle> *wrkStyles = &docParagraphStyles;
StyleSet<CharStyle> *wrkCharStyles = &docCharStyles;
- QMap<QString, multiLine> *wrkLineStyles = &MLineStyles;
+ QHash<QString, multiLine> *wrkLineStyles = &MLineStyles;
int oldStyles = wrkStyles->count();
int oldCharStyles = wrkCharStyles->count();
@@ -1536,11 +1536,11 @@
void ScribusDoc::loadStylesFromFile(QString fileName, StyleSet<ParagraphStyle> *tempStyles,
StyleSet<CharStyle> *tempCharStyles,
- QMap<QString, multiLine> *tempLineStyles)
+ QHash<QString, multiLine> *tempLineStyles)
{
StyleSet<ParagraphStyle> *wrkStyles = tempStyles;
StyleSet<CharStyle> *wrkCharStyles = tempCharStyles;
- QMap<QString, multiLine> *wrkLineStyles = tempLineStyles;
+ QHash<QString, multiLine> *wrkLineStyles = tempLineStyles;
if (!fileName.isEmpty())
{
@@ -3093,7 +3093,7 @@
{
multiLine::iterator its;
QMap<QString, QString>::const_iterator it;
- QMap<QString,multiLine>::iterator itl;
+ QHash<QString,multiLine>::iterator itl;
for (itl = MLineStyles.begin(); itl != MLineStyles.end(); ++itl)
{
multiLine& mline = itl.value();
@@ -3160,7 +3160,7 @@
bool ScribusDoc::lineStylesUseColor(const QString& colorName)
{
bool found = false;
- QMap<QString,multiLine>::const_iterator itm, itmend;
+ QHash<QString,multiLine>::const_iterator itm, itmend;
multiLine::const_iterator its, itsend;
itmend = MLineStyles.constEnd();
for (itm = MLineStyles.constBegin(); itm != itmend && !found; ++itm)
@@ -3179,12 +3179,12 @@
return found;
}
-void ScribusDoc::getUsedGradients(QMap<QString, VGradient> &gradients)
+void ScribusDoc::getUsedGradients(QHash<QString, VGradient> &gradients)
{
ResourceCollection resources;
this->getNamedResources(resources);
const QMap<QString, QString>& resGradients = resources.gradients();
- QMap<QString, VGradient>::iterator it;
+ QHash<QString, VGradient>::iterator it;
for (it = docGradients.begin(); it != docGradients.end(); ++it)
{
if (resGradients.contains(it.key()))
@@ -3194,7 +3194,7 @@
bool ScribusDoc::addGradient(QString &name, VGradient &gradient)
{
- for (QMap<QString, VGradient>::Iterator it = docGradients.begin(); it != docGradients.end(); ++it)
+ for (QHash<QString, VGradient>::Iterator it = docGradients.begin(); it != docGradients.end(); ++it)
{
if (it.value() == gradient)
{
@@ -3209,7 +3209,7 @@
return true;
}
-void ScribusDoc::setGradients(QMap<QString, VGradient> &gradients)
+void ScribusDoc::setGradients(QHash<QString, VGradient> &gradients)
{
docGradients.clear();
docGradients = gradients;
@@ -3231,7 +3231,7 @@
return true;
}
-void ScribusDoc::setPatterns(QMap<QString, ScPattern> &patterns)
+void ScribusDoc::setPatterns(QHash<QString, ScPattern> &patterns)
{
docPatterns.clear();
docPatterns = patterns;
@@ -3316,7 +3316,7 @@
}
allItems.clear();
}
- for (QMap<QString, ScPattern>::Iterator it = docPatterns.begin(); it != docPatterns.end(); ++it)
+ for (QHash<QString, ScPattern>::Iterator it = docPatterns.begin(); it != docPatterns.end(); ++it)
{
for (int c = 0; c < it.value().items.count(); ++c)
{
@@ -3531,7 +3531,7 @@
}
allItems.clear();
}
- for (QMap<QString, ScPattern>::Iterator it = docPatterns.begin(); it != docPatterns.end(); ++it)
+ for (QHash<QString, ScPattern>::Iterator it = docPatterns.begin(); it != docPatterns.end(); ++it)
{
for (int c = 0; c < it.value().items.count(); ++c)
{
@@ -4357,7 +4357,7 @@
void ScribusDoc::recalculateColors()
{
//Adjust Items of the 3 types to the colors
- QMap<QString, VGradient>::Iterator itGrad;
+ QHash<QString, VGradient>::Iterator itGrad;
for (itGrad = docGradients.begin(); itGrad != docGradients.end(); ++itGrad)
{
QList<VColorStop*> cstops = itGrad.value().colorStops();
Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sun Mar 25 11:10:41 2012
@@ -30,6 +30,7 @@
#include <QFont>
#include <QList>
#include <QMap>
+#include <QHash>
#include <QObject>
#include <QPixmap>
#include <QRectF>
@@ -616,7 +617,7 @@
*/
void loadStylesFromFile(QString fileName, StyleSet<ParagraphStyle> *tempStyles,
StyleSet<CharStyle> *tempCharStyles,
- QMap<QString, multiLine> *tempLineStyles);
+ QHash<QString, multiLine> *tempLineStyles);
const CharStyle& charStyle(QString name) { return docCharStyles.get(name); }
const StyleSet<CharStyle>& charStyles() { return docCharStyles; }
@@ -680,17 +681,17 @@
/*!
* @brief Builds a qmap of the gradients used within the document
*/
- void getUsedGradients(QMap<QString, VGradient> &Gradients);
+ void getUsedGradients(QHash<QString, VGradient> &Gradients);
/*!
* @brief Set the gradients for a document
*/
bool addGradient(QString &name, VGradient &gradient);
- void setGradients(QMap<QString, VGradient> &gradients);
+ void setGradients(QHash<QString, VGradient> &gradients);
/*!
* @brief Set the patterns for a document
*/
bool addPattern(QString &name, ScPattern& pattern);
- void setPatterns(QMap<QString, ScPattern> &patterns);
+ void setPatterns(QHash<QString, ScPattern> &patterns);
/*!
* @brief Builds a QStringList of the patterns used within the document
*/
@@ -1275,9 +1276,9 @@
bool OldBM;
bool hasName;
QTimer * const autoSaveTimer;
- QMap<QString,multiLine> MLineStyles;
- QMap<QString, ScPattern> docPatterns;
- QMap<QString, VGradient> docGradients;
+ QHash<QString,multiLine> MLineStyles;
+ QHash<QString, ScPattern> docPatterns;
+ QHash<QString, VGradient> docGradients;
QWidget* WinHan;
bool DoDrawing;
bool drawAsPreview;
Modified: trunk/Scribus/scribus/serializer.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/serializer.cpp
==============================================================================
--- trunk/Scribus/scribus/serializer.cpp (original)
+++ trunk/Scribus/scribus/serializer.cpp Sun Mar 25 11:10:41 2012
@@ -49,7 +49,7 @@
ColorList colors;
StyleSet<ParagraphStyle> pstyles;
StyleSet<CharStyle> cstyles;
- QMap<QString,multiLine> lstyles;
+ QHash<QString,multiLine> lstyles;
QList<QString> fonts;
QList<QString> patterns;
Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp Sun Mar 25 11:10:41 2012
@@ -594,8 +594,11 @@
namedGradientStroke->clear();
namedGradientStroke->setIconSize(QSize(48, 12));
namedGradientStroke->addItem( tr("Custom"));
- for (QMap<QString, VGradient>::Iterator it = gradientList->begin(); it != gradientList->end(); ++it)
- {
+ QStringList patK = gradientList->keys();
+ qSort(patK);
+ for (int a = 0; a < patK.count(); a++)
+ {
+ VGradient gr = gradientList->value(patK[a]);
QImage pixm(48, 12, QImage::Format_ARGB32_Premultiplied);
QPainter pb;
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
@@ -606,21 +609,21 @@
p->setPen(Qt::black);
p->setLineWidth(1);
p->setFillMode(2);
- p->fill_gradient = it.value();
+ p->fill_gradient = gr;
p->setGradient(VGradient::linear, FPoint(0,6), FPoint(48, 6), FPoint(0,0), 1, 0);
p->drawRect(0, 0, 48, 12);
p->end();
delete p;
QPixmap pm;
pm = QPixmap::fromImage(pixm);
- namedGradient->addItem(pm, it.key());
- namedGradientStroke->addItem(pm, it.key());
+ namedGradient->addItem(pm, patK[a]);
+ namedGradientStroke->addItem(pm, patK[a]);
}
connect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
connect(namedGradientStroke, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradientStroke(const QString &)));
}
-void Cpalette::setGradients(QMap<QString, VGradient> *docGradients)
+void Cpalette::setGradients(QHash<QString, VGradient> *docGradients)
{
gradientList = docGradients;
updateGradientList();
@@ -708,22 +711,25 @@
patternBox->setIconSize(QSize(48, 48));
patternBoxStroke->clear();
patternBoxStroke->setIconSize(QSize(48, 48));
- for (QMap<QString, ScPattern>::Iterator it = patternList->begin(); it != patternList->end(); ++it)
- {
+ QStringList patK = patternList->keys();
+ qSort(patK);
+ for (int a = 0; a < patK.count(); a++)
+ {
+ ScPattern sp = patternList->value(patK[a]);
QPixmap pm;
- if (it.value().getPattern()->width() >= it.value().getPattern()->height())
- pm=QPixmap::fromImage(it.value().getPattern()->scaledToWidth(48, Qt::SmoothTransformation));
+ if (sp.getPattern()->width() >= sp.getPattern()->height())
+ pm=QPixmap::fromImage(sp.getPattern()->scaledToWidth(48, Qt::SmoothTransformation));
else
- pm=QPixmap::fromImage(it.value().getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
+ pm=QPixmap::fromImage(sp.getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
QPixmap pm2(48, 48);
pm2.fill(palette().color(QPalette::Base));
QPainter p;
p.begin(&pm2);
p.drawPixmap(24 - pm.width() / 2, 24 - pm.height() / 2, pm);
p.end();
- QListWidgetItem *item = new QListWidgetItem(pm2, it.key(), patternBox);
+ QListWidgetItem *item = new QListWidgetItem(pm2, patK[a], patternBox);
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QListWidgetItem *itemS = new QListWidgetItem(pm2, it.key(), patternBoxStroke);
+ QListWidgetItem *itemS = new QListWidgetItem(pm2, patK[a], patternBoxStroke);
itemS->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
}
patternBox->clearSelection();
@@ -744,7 +750,7 @@
}
}
-void Cpalette::setPatterns(QMap<QString, ScPattern> *docPatterns)
+void Cpalette::setPatterns(QHash<QString, ScPattern> *docPatterns)
{
patternList = docPatterns;
updatePatternList();
Modified: trunk/Scribus/scribus/ui/cpalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/cpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.h (original)
+++ trunk/Scribus/scribus/ui/cpalette.h Sun Mar 25 11:10:41 2012
@@ -66,8 +66,8 @@
void updateColorList();
void setColors(ColorList newColorList);
- void setGradients(QMap<QString, VGradient> *docGradients);
- void setPatterns(QMap<QString, ScPattern> *docPatterns);
+ void setGradients(QHash<QString, VGradient> *docGradients);
+ void setPatterns(QHash<QString, ScPattern> *docPatterns);
private:
@@ -150,8 +150,8 @@
PageItem* currentItem;
QString sFarbe;
ColorList colorList;
- QMap<QString, ScPattern> *patternList;
- QMap<QString, VGradient> *gradientList;
+ QHash<QString, ScPattern> *patternList;
+ QHash<QString, VGradient> *gradientList;
double m_Pattern_scaleX;
double m_Pattern_scaleY;
double m_Pattern_offsetX;
Modified: trunk/Scribus/scribus/ui/gradientaddedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/gradientaddedit.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gradientaddedit.cpp (original)
+++ trunk/Scribus/scribus/ui/gradientaddedit.cpp Sun Mar 25 11:10:41 2012
@@ -27,7 +27,7 @@
#include "gradientaddedit.h"
#include <QMessageBox>
-gradientEditDialog::gradientEditDialog(QWidget* parent, QString name, VGradient gradient, ColorList doco, ScribusDoc *doc, QMap<QString, VGradient> *gradients, bool newFlag) : QDialog(parent)
+gradientEditDialog::gradientEditDialog(QWidget* parent, QString name, VGradient gradient, ColorList doco, ScribusDoc *doc, QHash<QString, VGradient> *gradients, bool newFlag) : QDialog(parent)
{
setupUi(this);
setModal(true);
Modified: trunk/Scribus/scribus/ui/gradientaddedit.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/gradientaddedit.h
==============================================================================
--- trunk/Scribus/scribus/ui/gradientaddedit.h (original)
+++ trunk/Scribus/scribus/ui/gradientaddedit.h Sun Mar 25 11:10:41 2012
@@ -38,7 +38,7 @@
Q_OBJECT
public:
- gradientEditDialog(QWidget* parent, QString name, VGradient gradient, ColorList doco, ScribusDoc *doc, QMap<QString, VGradient> *gradients, bool newFlag);
+ gradientEditDialog(QWidget* parent, QString name, VGradient gradient, ColorList doco, ScribusDoc *doc, QHash<QString, VGradient> *gradients, bool newFlag);
~gradientEditDialog() {};
QString name();
VGradient gradient();
@@ -48,7 +48,7 @@
ScribusDoc* m_doc;
bool isNew;
QString m_name;
- QMap<QString, VGradient> *m_gradients;
+ QHash<QString, VGradient> *m_gradients;
};
#endif
Modified: trunk/Scribus/scribus/ui/paintmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/paintmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.cpp (original)
+++ trunk/Scribus/scribus/ui/paintmanager.cpp Sun Mar 25 11:10:41 2012
@@ -62,7 +62,7 @@
#include "util_formats.h"
#include "util_icon.h"
-PaintManagerDialog::PaintManagerDialog(QWidget* parent, QMap<QString, VGradient> *docGradients, ColorList doco, QString docColSet, QMap<QString, ScPattern> *docPatterns, ScribusDoc *doc, ScribusMainWindow *scMW) : QDialog(parent)
+PaintManagerDialog::PaintManagerDialog(QWidget* parent, QHash<QString, VGradient> *docGradients, ColorList doco, QString docColSet, QHash<QString, ScPattern> *docPatterns, ScribusDoc *doc, ScribusMainWindow *scMW) : QDialog(parent)
{
setupUi(this);
setModal(true);
@@ -79,7 +79,7 @@
colorItems->setText(0, tr("Solid Colors"));
gradientItems = new QTreeWidgetItem(dataTree);
gradientItems->setText(0, tr("Gradients"));
- for (QMap<QString, VGradient>::Iterator it = docGradients->begin(); it != docGradients->end(); ++it)
+ for (QHash<QString, VGradient>::Iterator it = docGradients->begin(); it != docGradients->end(); ++it)
{
dialogGradients.insert(it.key(), it.value());
origNames.insert(it.key(), it.key());
@@ -88,7 +88,7 @@
patternItems = new QTreeWidgetItem(dataTree);
patternItems->setText(0, tr("Patterns"));
- for (QMap<QString, ScPattern>::Iterator it = docPatterns->begin(); it != docPatterns->end(); ++it)
+ for (QHash<QString, ScPattern>::Iterator it = docPatterns->begin(); it != docPatterns->end(); ++it)
{
dialogPatterns.insert(it.key(), it.value());
origNamesPatterns.insert(it.key(), it.key());
@@ -180,13 +180,16 @@
delete lg[a];
}
QTreeWidgetItem* ret = 0;
- for (QMap<QString, ScPattern>::Iterator it = dialogPatterns.begin(); it != dialogPatterns.end(); ++it)
- {
+ QStringList patK = dialogPatterns.keys();
+ qSort(patK);
+ for (int a = 0; a < patK.count(); a++)
+ {
+ ScPattern sp = dialogPatterns.value(patK[a]);
QPixmap pm;
- if (it.value().getPattern()->width() >= it.value().getPattern()->height())
- pm = QPixmap::fromImage(it.value().getPattern()->scaledToWidth(48, Qt::SmoothTransformation));
+ if (sp.getPattern()->width() >= sp.getPattern()->height())
+ pm = QPixmap::fromImage(sp.getPattern()->scaledToWidth(48, Qt::SmoothTransformation));
else
- pm = QPixmap::fromImage(it.value().getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
+ pm = QPixmap::fromImage(sp.getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
QPixmap pm2(48, 48);
pm2.fill(palette().color(QPalette::Base));
QPainter p;
@@ -194,8 +197,8 @@
p.drawPixmap(24 - pm.width() / 2, 24 - pm.height() / 2, pm);
p.end();
QTreeWidgetItem *item = new QTreeWidgetItem(patternItems);
- item->setText(0, it.key());
- if (it.key() == addedName)
+ item->setText(0, patK[a]);
+ if (patK[a] == addedName)
ret = item;
item->setIcon(0, pm2);
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
@@ -211,8 +214,11 @@
delete lg[a];
}
QTreeWidgetItem* ret = 0;
- for (QMap<QString, VGradient>::Iterator it = dialogGradients.begin(); it != dialogGradients.end(); ++it)
- {
+ QStringList patK = dialogGradients.keys();
+ qSort(patK);
+ for (int a = 0; a < patK.count(); a++)
+ {
+ VGradient gr = dialogGradients.value(patK[a]);
QImage pixm(48, 12, QImage::Format_ARGB32);
QPainter pb;
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
@@ -223,7 +229,7 @@
p->setPen(Qt::black);
p->setLineWidth(1);
p->setFillMode(2);
- p->fill_gradient = it.value();
+ p->fill_gradient = gr;
p->setGradient(VGradient::linear, FPoint(0,6), FPoint(48, 6), FPoint(0, 0), 1.0, 0.0);
p->drawRect(0, 0, 48, 12);
p->end();
@@ -231,8 +237,8 @@
QPixmap pm;
pm = QPixmap::fromImage(pixm);
QTreeWidgetItem *item = new QTreeWidgetItem(gradientItems);
- item->setText(0, it.key());
- if (it.key() == addedName)
+ item->setText(0, patK[a]);
+ if (patK[a] == addedName)
ret = item;
item->setIcon(0, pm);
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
@@ -797,7 +803,7 @@
if (t == QMessageBox::No)
return;
replaceMap.clear();
- for (QMap<QString, VGradient>::Iterator it = dialogGradients.begin(); it != dialogGradients.end(); ++it)
+ for (QHash<QString, VGradient>::Iterator it = dialogGradients.begin(); it != dialogGradients.end(); ++it)
{
replaceMap.insert(it.key(), "");
}
@@ -817,7 +823,7 @@
if (t == QMessageBox::No)
return;
replaceMap.clear();
- for (QMap<QString, VGradient>::Iterator it = dialogGradients.begin(); it != dialogGradients.end(); ++it)
+ for (QHash<QString, VGradient>::Iterator it = dialogGradients.begin(); it != dialogGradients.end(); ++it)
{
replaceMap.insert(it.key(), "");
}
@@ -874,7 +880,7 @@
if (t == QMessageBox::No)
return;
replaceMapPatterns.clear();
- for (QMap<QString, ScPattern>::Iterator it = dialogPatterns.begin(); it != dialogPatterns.end(); ++it)
+ for (QHash<QString, ScPattern>::Iterator it = dialogPatterns.begin(); it != dialogPatterns.end(); ++it)
{
replaceMapPatterns.insert(it.key(), "");
}
@@ -1351,7 +1357,7 @@
dialogPatterns.insert(patNam, pat);
origNamesPatterns.insert(patNam, patNam);
}
- for (QMap<QString, ScPattern>::Iterator it = m_doc->docPatterns.begin(); it != m_doc->docPatterns.end(); ++it)
+ for (QHash<QString, ScPattern>::Iterator it = m_doc->docPatterns.begin(); it != m_doc->docPatterns.end(); ++it)
{
if (!origPatterns.contains(it.key()))
{
@@ -1365,7 +1371,7 @@
uint ape = m_doc->docPatterns.count();
if (ap != ape)
{
- for (QMap<QString, ScPattern>::Iterator it = m_doc->docPatterns.begin(); it != m_doc->docPatterns.end(); ++it)
+ for (QHash<QString, ScPattern>::Iterator it = m_doc->docPatterns.begin(); it != m_doc->docPatterns.end(); ++it)
{
if (!origPatterns.contains(it.key()))
{
@@ -1384,7 +1390,7 @@
ColorList PaintManagerDialog::getGradientColors()
{
ColorList colorList;
- QMap<QString,VGradient>::Iterator itg;
+ QHash<QString,VGradient>::Iterator itg;
for (itg = dialogGradients.begin(); itg != dialogGradients.end(); ++itg)
{
QList<VColorStop*> cstops = itg.value().colorStops();
@@ -1450,7 +1456,7 @@
void PaintManagerDialog::updateGradientColors(QString newName, QString oldName)
{
- QMap<QString,VGradient>::Iterator itg;
+ QHash<QString,VGradient>::Iterator itg;
for (itg = dialogGradients.begin(); itg != dialogGradients.end(); ++itg)
{
QList<VColorStop*> cstops = itg.value().colorStops();
Modified: trunk/Scribus/scribus/ui/paintmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/paintmanager.h
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.h (original)
+++ trunk/Scribus/scribus/ui/paintmanager.h Sun Mar 25 11:10:41 2012
@@ -39,7 +39,7 @@
Q_OBJECT
public:
- PaintManagerDialog(QWidget* parent, QMap<QString, VGradient> *docGradients, ColorList doco, QString docColSet, QMap<QString, ScPattern> *docPatterns, ScribusDoc *doc, ScribusMainWindow* scMW);
+ PaintManagerDialog(QWidget* parent, QHash<QString, VGradient> *docGradients, ColorList doco, QString docColSet, QHash<QString, ScPattern> *docPatterns, ScribusDoc *doc, ScribusMainWindow* scMW);
~PaintManagerDialog() {};
/*! \brief Returns the name of the current/selected color set.
\retval QString selected name. */
@@ -54,7 +54,7 @@
QString selectedColorName();
ScribusDoc *m_doc;
ScribusMainWindow *mainWin;
- QMap<QString, VGradient> dialogGradients;
+ QHash<QString, VGradient> dialogGradients;
QMap<QString,QString> replaceMap;
QMap<QString,QString> origNames;
QStringList origGradients;
@@ -63,7 +63,7 @@
//! \brief Custom user's color set
QStringList customColSet;
bool hasImportedColors;
- QMap<QString, ScPattern> dialogPatterns;
+ QHash<QString, ScPattern> dialogPatterns;
QMap<QString,QString> replaceMapPatterns;
QMap<QString,QString> origNamesPatterns;
QStringList origPatterns;
Modified: trunk/Scribus/scribus/ui/propertiespalette_line.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/propertiespalette_line.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_line.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_line.cpp Sun Mar 25 11:10:41 2012
@@ -393,7 +393,7 @@
lineStyles->clear();
if (dd != 0)
{
- QMap<QString,multiLine>::Iterator it;
+ QHash<QString,multiLine>::Iterator it;
for (it = dd->MLineStyles.begin(); it != dd->MLineStyles.end(); ++it)
lineStyles->addItem( new LineFormatItem(dd, it.value(), it.key()) );
lineStyles->sortItems();
Modified: trunk/Scribus/scribus/ui/smlinestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/smlinestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.cpp (original)
+++ trunk/Scribus/scribus/ui/smlinestyle.cpp Sun Mar 25 11:10:41 2012
@@ -77,7 +77,7 @@
}
QList<StyleName> tmp;
- QMap<QString,multiLine>::Iterator it;
+ QHash<QString,multiLine>::Iterator it;
for (it = tmpLines.begin(); it != tmpLines.end(); ++it)
tmp << StyleName(it.key(), QString::null);
@@ -301,7 +301,7 @@
QString SMLineStyle::shortcut(const QString &stylename) const
{
QString s;
- QMap<QString, multiLine>::ConstIterator it = tmpLines.find(stylename);
+ QHash<QString, multiLine>::ConstIterator it = tmpLines.find(stylename);
if (it != tmpLines.end())
s = it.value().shortcut;
return s;
@@ -313,7 +313,7 @@
if (selection_.count() != 1)
return;
- QMap<QString, multiLine*>::iterator it;
+ QHash<QString, multiLine*>::iterator it;
for (it = selection_.begin(); it != selection_.end(); ++it)
(*it)->shortcut = shortcut;
@@ -417,7 +417,7 @@
if (currentLine_ < 0)
return;
- QMap<QString, multiLine*>::iterator it;
+ QHash<QString, multiLine*>::iterator it;
for (it = selection_.begin(); it != selection_.end(); ++it)
{
multiLine *tmp = it.value();
@@ -450,7 +450,7 @@
break;
}
- QMap<QString, multiLine*>::iterator it;
+ QHash<QString, multiLine*>::iterator it;
for (it = selection_.begin(); it != selection_.end(); ++it)
{
multiLine *tmp = it.value();
@@ -487,7 +487,7 @@
break;
}
- QMap<QString, multiLine*>::iterator it;
+ QHash<QString, multiLine*>::iterator it;
for (it = selection_.begin(); it != selection_.end(); ++it)
{
multiLine *tmp = it.value();
@@ -506,7 +506,7 @@
void SMLineStyle::slotColor(const QString &s)
{
- QMap<QString, multiLine*>::iterator it;
+ QHash<QString, multiLine*>::iterator it;
for (it = selection_.begin(); it != selection_.end(); ++it)
{
multiLine *tmp = it.value();
@@ -525,7 +525,7 @@
void SMLineStyle::slotShade(int i)
{
- QMap<QString, multiLine*>::iterator it;
+ QHash<QString, multiLine*>::iterator it;
for (it = selection_.begin(); it != selection_.end(); ++it)
{
multiLine *tmp = it.value();
@@ -544,7 +544,7 @@
void SMLineStyle::slotLineWidth()
{
- QMap<QString, multiLine*>::iterator it;
+ QHash<QString, multiLine*>::iterator it;
for (it = selection_.begin(); it != selection_.end(); ++it)
{
multiLine *tmp = it.value();
Modified: trunk/Scribus/scribus/ui/smlinestyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/smlinestyle.h
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.h (original)
+++ trunk/Scribus/scribus/ui/smlinestyle.h Sun Mar 25 11:10:41 2012
@@ -56,10 +56,10 @@
ScribusDoc *doc_;
SMLineStyleWidget *widget_;
QTabWidget *twidget_;
- QMap<QString, multiLine> tmpLines;
+ QHash<QString, multiLine> tmpLines;
bool selectionIsDirty_;
double unitRatio_;
- QMap<QString, multiLine*> selection_;
+ QHash<QString, multiLine*> selection_;
QList<RemoveItem> deleted_;
int currentLine_;
Modified: trunk/Scribus/scribus/ui/smstyleimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/smstyleimport.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smstyleimport.cpp (original)
+++ trunk/Scribus/scribus/ui/smstyleimport.cpp Sun Mar 25 11:10:41 2012
@@ -13,7 +13,7 @@
SMStyleImport::SMStyleImport(QWidget* parent,
StyleSet<ParagraphStyle> *pstyleList,
StyleSet<CharStyle> *cstyleList,
- QMap<QString, multiLine> *lstyleList)
+ QHash<QString, multiLine> *lstyleList)
: QDialog( parent, 0 )
{
setupUi(this);
Modified: trunk/Scribus/scribus/ui/smstyleimport.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/smstyleimport.h
==============================================================================
--- trunk/Scribus/scribus/ui/smstyleimport.h (original)
+++ trunk/Scribus/scribus/ui/smstyleimport.h Sun Mar 25 11:10:41 2012
@@ -27,7 +27,7 @@
SMStyleImport(QWidget* parent,
StyleSet<ParagraphStyle> *pstyleList,
StyleSet<CharStyle> *cstyleList,
- QMap<QString, multiLine> *lstyleList);
+ QHash<QString, multiLine> *lstyleList);
~SMStyleImport() {};
//! \brief True if the rename feature is ON.
Modified: trunk/Scribus/scribus/ui/stylemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/stylemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/stylemanager.cpp (original)
+++ trunk/Scribus/scribus/ui/stylemanager.cpp Sun Mar 25 11:10:41 2012
@@ -302,7 +302,7 @@
StyleSet<ParagraphStyle> tmpParaStyles;
StyleSet<CharStyle> tmpCharStyles;
- QMap<QString, multiLine> tmpLineStyles;
+ QHash<QString, multiLine> tmpLineStyles;
m_doc->loadStylesFromFile(selectedFile, &tmpParaStyles, &tmpCharStyles, &tmpLineStyles);
Modified: trunk/Scribus/scribus/ui/symbolpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/symbolpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.cpp Sun Mar 25 11:10:41 2012
@@ -219,21 +219,24 @@
{
SymbolViewWidget->clear();
SymbolViewWidget->setWordWrap(true);
- for (QMap<QString, ScPattern>::Iterator it = currDoc->docPatterns.begin(); it != currDoc->docPatterns.end(); ++it)
- {
+ QStringList patK = currDoc->docPatterns.keys();
+ qSort(patK);
+ for (int a = 0; a < patK.count(); a++)
+ {
+ ScPattern sp = currDoc->docPatterns.value(patK[a]);
QPixmap pm;
- if (it.value().getPattern()->width() >= it.value().getPattern()->height())
- pm = QPixmap::fromImage(it.value().getPattern()->scaledToWidth(48, Qt::SmoothTransformation));
+ if (sp.getPattern()->width() >= sp.getPattern()->height())
+ pm = QPixmap::fromImage(sp.getPattern()->scaledToWidth(48, Qt::SmoothTransformation));
else
- pm = QPixmap::fromImage(it.value().getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
+ pm = QPixmap::fromImage(sp.getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
QPixmap pm2(48, 48);
pm2.fill(palette().color(QPalette::Base));
QPainter p;
p.begin(&pm2);
p.drawPixmap(24 - pm.width() / 2, 24 - pm.height() / 2, pm);
p.end();
- QListWidgetItem *item = new QListWidgetItem(pm2, it.key(), SymbolViewWidget);
- if (editItemNames.contains(it.key()))
+ QListWidgetItem *item = new QListWidgetItem(pm2, patK[a], SymbolViewWidget);
+ if (editItemNames.contains(patK[a]))
item->setFlags(0);
else
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
Modified: trunk/Scribus/scribus/ui/transparencypalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/transparencypalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/transparencypalette.cpp (original)
+++ trunk/Scribus/scribus/ui/transparencypalette.cpp Sun Mar 25 11:10:41 2012
@@ -202,8 +202,11 @@
namedGradient->clear();
namedGradient->setIconSize(QSize(48, 12));
namedGradient->addItem( tr("Custom"));
- for (QMap<QString, VGradient>::Iterator it = gradientList->begin(); it != gradientList->end(); ++it)
- {
+ QStringList patK = gradientList->keys();
+ qSort(patK);
+ for (int a = 0; a < patK.count(); a++)
+ {
+ VGradient gr = gradientList->value(patK[a]);
QImage pixm(48, 12, QImage::Format_ARGB32_Premultiplied);
QPainter pb;
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
@@ -214,19 +217,19 @@
p->setPen(Qt::black);
p->setLineWidth(1);
p->setFillMode(2);
- p->fill_gradient = it.value();
+ p->fill_gradient = gr;
p->setGradient(VGradient::linear, FPoint(0,6), FPoint(48, 6), FPoint(0,0), 1, 0);
p->drawRect(0, 0, 48, 12);
p->end();
delete p;
QPixmap pm;
pm = QPixmap::fromImage(pixm);
- namedGradient->addItem(pm, it.key());
+ namedGradient->addItem(pm, patK[a]);
}
connect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
}
-void Tpalette::setGradients(QMap<QString, VGradient> *docGradients)
+void Tpalette::setGradients(QHash<QString, VGradient> *docGradients)
{
gradientList = docGradients;
updateGradientList();
@@ -426,27 +429,30 @@
disconnect(patternBox, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPattern(QListWidgetItem*)));
patternBox->clear();
patternBox->setIconSize(QSize(48, 48));
- for (QMap<QString, ScPattern>::Iterator it = patternList->begin(); it != patternList->end(); ++it)
- {
+ QStringList patK = patternList->keys();
+ qSort(patK);
+ for (int a = 0; a < patK.count(); a++)
+ {
+ ScPattern sp = patternList->value(patK[a]);
QPixmap pm;
- if (it.value().getPattern()->width() >= it.value().getPattern()->height())
- pm=QPixmap::fromImage(it.value().getPattern()->scaledToWidth(48, Qt::SmoothTransformation));
- else
- pm=QPixmap::fromImage(it.value().getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
+ if (sp.getPattern()->width() >= sp.getPattern()->height())
+ pm=QPixmap::fromImage(sp.getPattern()->scaledToWidth(48, Qt::SmoothTransformation));
+ else
+ pm=QPixmap::fromImage(sp.getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
QPixmap pm2(48, 48);
pm2.fill(palette().color(QPalette::Base));
QPainter p;
p.begin(&pm2);
p.drawPixmap(24 - pm.width() / 2, 24 - pm.height() / 2, pm);
p.end();
- QListWidgetItem *item = new QListWidgetItem(pm2, it.key(), patternBox);
+ QListWidgetItem *item = new QListWidgetItem(pm2, patK[a], patternBox);
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
}
patternBox->clearSelection();
connect(patternBox, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPattern(QListWidgetItem*)));
}
-void Tpalette::setPatterns(QMap<QString, ScPattern> *docPatterns)
+void Tpalette::setPatterns(QHash<QString, ScPattern> *docPatterns)
{
patternList = docPatterns;
updatePatternList();
Modified: trunk/Scribus/scribus/ui/transparencypalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/ui/transparencypalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/transparencypalette.h (original)
+++ trunk/Scribus/scribus/ui/transparencypalette.h Sun Mar 25 11:10:41 2012
@@ -69,8 +69,8 @@
void updateColorList();
void setColors(ColorList newColorList);
- void setGradients(QMap<QString, VGradient> *docGradients);
- void setPatterns(QMap<QString, ScPattern> *docPatterns);
+ void setGradients(QHash<QString, VGradient> *docGradients);
+ void setPatterns(QHash<QString, ScPattern> *docPatterns);
public slots:
void handleUpdateRequest(int);
@@ -116,8 +116,8 @@
PageItem* currentItem;
ColorList colorList;
int currentUnit;
- QMap<QString, ScPattern> *patternList;
- QMap<QString, VGradient> *gradientList;
+ QHash<QString, ScPattern> *patternList;
+ QHash<QString, VGradient> *gradientList;
double m_Pattern_scaleX;
double m_Pattern_scaleY;
double m_Pattern_offsetX;
Modified: trunk/Scribus/scribus/util_color.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/util_color.cpp
==============================================================================
--- trunk/Scribus/scribus/util_color.cpp (original)
+++ trunk/Scribus/scribus/util_color.cpp Sun Mar 25 11:10:41 2012
@@ -595,7 +595,7 @@
return CommonStrings::trUnknownCS;
}
-bool importColorsFromFile(QString fileName, ColorList &EditColors, QMap<QString,VGradient> *dialogGradients, bool merge)
+bool importColorsFromFile(QString fileName, ColorList &EditColors, QHash<QString, VGradient> *dialogGradients, bool merge)
{
int oldCount = EditColors.count();
if (!fileName.isEmpty())
Modified: trunk/Scribus/scribus/util_color.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17400&path=/trunk/Scribus/scribus/util_color.h
==============================================================================
--- trunk/Scribus/scribus/util_color.h (original)
+++ trunk/Scribus/scribus/util_color.h Sun Mar 25 11:10:41 2012
@@ -111,6 +111,6 @@
* \param EditColors Color list to store the imported colors
* \return true if any colors have been found
*/
-bool SCRIBUS_API importColorsFromFile(QString fileName, ColorList &EditColors, QMap<QString,VGradient> *dialogGradients = NULL, bool merge = false);
+bool SCRIBUS_API importColorsFromFile(QString fileName, ColorList &EditColors, QHash<QString,VGradient> *dialogGradients = NULL, bool merge = false);
#endif
More information about the scribus-commit
mailing list