Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24734 → Rev 24733

/trunk/Scribus/scribus/sccolor.cpp
365,19 → 365,20
void ScColor::setNamedColor(QString colorName)
{
bool ok;
QStringView colorNameView(colorName);
if (colorName.length () == 9)
{
int c = colorName.midRef(1,2).toInt(&ok, 16);
int m = colorName.midRef(3,2).toInt(&ok, 16);
int y = colorName.midRef(5,2).toInt(&ok, 16);
int k = colorName.midRef(7,2).toInt(&ok, 16);
int c = colorNameView.mid(1,2).toInt(&ok, 16);
int m = colorNameView.mid(3,2).toInt(&ok, 16);
int y = colorNameView.mid(5,2).toInt(&ok, 16);
int k = colorNameView.mid(7,2).toInt(&ok, 16);
setColor(c, m, y, k);
}
else if (colorName.length () == 7)
{
int r = colorName.midRef(1,2).toInt(&ok, 16);
int g = colorName.midRef(3,2).toInt(&ok, 16);
int b = colorName.midRef(5,2).toInt(&ok, 16);
int r = colorNameView.mid(1,2).toInt(&ok, 16);
int g = colorNameView.mid(3,2).toInt(&ok, 16);
int b = colorNameView.mid(5,2).toInt(&ok, 16);
setRgbColor(r, g, b);
}
}
/trunk/Scribus/scribus/latexhelpers.cpp
171,11 → 171,11
m_error += new_error + "\n";
}
 
bool LatexConfigParser::StrRefToBool(const QStringRef &str) const
bool LatexConfigParser::StrViewToBool(const QStringView &str) const
{
if (str == "1" || str == "true")
if (str == QStringView(u"1") || str == QStringView(u"true"))
return true;
if (str == "0" || str == "false" || str.isEmpty())
if (str == QStringView(u"0") || str == QStringView(u"false") || str.isEmpty())
return false;
qWarning() << "Invalid bool string:" << str.toString();
return false;
202,10 → 202,10
continue;
}
QString regex = xml.attributes().value("regex").toString();
bool bold = StrRefToBool(xml.attributes().value("bold"));
bool italic = StrRefToBool(xml.attributes().value("italic"));
bool underline = StrRefToBool(xml.attributes().value("underline"));
bool minimal = StrRefToBool(xml.attributes().value("minimal"));
bool bold = StrViewToBool(xml.attributes().value("bold"));
bool italic = StrViewToBool(xml.attributes().value("italic"));
bool underline = StrViewToBool(xml.attributes().value("underline"));
bool minimal = StrViewToBool(xml.attributes().value("minimal"));
QString colorStr = xml.attributes().value("color").toString();
QColor color(colorStr);
if (!color.isValid())
/trunk/Scribus/scribus/latexhelpers.h
26,7 → 26,7
#include <QObject>
#include <QPointer>
#include <QString>
#include <QStringRef>
#include <QStringView>
#include <QSyntaxHighlighter>
#include <QXmlStreamReader>
 
89,7 → 89,7
void parseTab();
void parseHighlighter();
void ignoreList();
bool StrRefToBool(const QStringRef& str) const;
bool StrViewToBool(const QStringView& str) const;
};
 
class LatexConfigCache;
/trunk/Scribus/scribus/nftrcreader.cpp
8,7 → 8,7
* Riku Leino, tsoots@gmail.com *
***************************************************************************/
 
#include <QStringRef>
#include <QStringView>
 
#include "nftrcreader.h"
 
36,16 → 36,16
if (tType != QXmlStreamReader::StartElement)
continue;
 
QStringRef tagName = reader.name();
QStringView tagName = reader.name();
if (firstElement)
{
if (tagName != "templates")
if (tagName != QStringView(u"templates"))
return false;
firstElement = false;
continue;
}
 
if (tagName == "template")
if (tagName == QStringView(u"template"))
{
QXmlStreamAttributes attrs = reader.attributes();
QString attrCat = attrs.value("category").toString();
72,8 → 72,8
if (!reader.isStartElement())
return false;
 
QStringRef elemName = reader.name();
if (elemName != "template")
QStringView elemName = reader.name();
if (elemName != QStringView(u"template"))
return false;
 
while (!reader.atEnd() && !reader.hasError())
87,10 → 87,10
if (tType != QXmlStreamReader::StartElement)
continue;
 
QStringRef tagName = reader.name();
if (tagName == "name")
QStringView tagName = reader.name();
if (tagName == QStringView(u"name"))
nftTemplate->name = reader.readElementText();
else if (tagName == "file")
else if (tagName == QStringView(u"file"))
{
QString tmp = reader.readElementText();
if (tmp.left(1) == "/")
98,7 → 98,7
else
nftTemplate->file = currentDir + "/" + tmp;
}
else if (tagName == "tnail")
else if (tagName == QStringView(u"tnail"))
{
QString tmp = reader.readElementText();
if (tmp.left(1) == "/")
106,7 → 106,7
else
nftTemplate->tnail = currentDir + "/" + tmp;
}
else if (tagName == "img")
else if (tagName == QStringView(u"img"))
{
QString tmp = reader.readElementText();
if (tmp.left(1) == "/")
114,21 → 114,21
else
nftTemplate->img = currentDir + "/" + tmp;
}
else if (tagName == "psize")
else if (tagName == QStringView(u"psize"))
nftTemplate->psize = reader.readElementText();
else if (tagName == "color")
else if (tagName == QStringView(u"color"))
nftTemplate->color = reader.readElementText();
else if (tagName == "descr")
else if (tagName == QStringView(u"descr"))
nftTemplate->descr = reader.readElementText();
else if (tagName == "usage")
else if (tagName == QStringView(u"usage"))
nftTemplate->usage = reader.readElementText();
else if (tagName == "scribus_version")
else if (tagName == QStringView(u"scribus_version"))
nftTemplate->scribusVersion = reader.readElementText();
else if (tagName == "date")
else if (tagName == QStringView(u"date"))
nftTemplate->date = reader.readElementText();
else if (tagName == "author")
else if (tagName == QStringView(u"author"))
nftTemplate->author = reader.readElementText();
else if (tagName == "email")
else if (tagName == QStringView(u"email"))
nftTemplate->email = reader.readElementText();
else
{
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
18,6 → 18,7
#include <QIODevice>
#include <QList>
#include <QScopedPointer>
#include <QStringView>
 
#include "../../formatidlist.h"
#include "commonstrings.h"
/trunk/Scribus/scribus/plugins/saveastemplateplugin/satdialog.cpp
36,7 → 36,7
 
QXmlStreamReader sReader(&qFile);
QXmlStreamReader::TokenType tagType;
QStringRef tagName;
QStringView tagName;
 
while (!sReader.atEnd() && !sReader.hasError())
{
45,7 → 45,7
continue;
 
tagName = sReader.name();
if (tagName != "template")
if (tagName != QStringView(u"template"))
continue;
 
QXmlStreamAttributes attrs = sReader.attributes();
/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
1360,7 → 1360,7
{
if (data.contains("~>"))
{
dataString += data.midRef(1);
dataString += QStringView{data}.mid(1);
dataMode = false;
QByteArray fData;
decodeA85(fData, dataString);
1419,7 → 1419,9
currentSpecialPath.svgInit();
}
else
dataString += data.midRef(1);
{
dataString += QStringView{data}.mid(1);
}
return;
}
getCommands(data, da);
2968,7 → 2970,7
for (int a = 1; a < tmp.length(); a += 2)
{
bool ok;
ushort data = tmp.midRef(a, 2).toUShort(&ok, 16);
ushort data = QStringView{tmp}.mid(a, 2).toUShort(&ok, 16);
psdata[dataPointer++] = data;
}
}
/trunk/Scribus/scribus/scribusXml.cpp
83,7 → 83,7
ff = file;
 
bool succeed = false;
QStringRef tName;
QStringView tName;
QXmlStreamReader sReader(ff);
QXmlStreamReader::TokenType tType;
while (!sReader.atEnd() && !sReader.hasError())
92,7 → 92,7
if (tType == QXmlStreamReader::StartElement)
{
tName = sReader.name();
if ((tName == "SCRIBUSELEM") || (tName == "SCRIBUSELEMUTF8"))
if ((tName == QStringView(u"SCRIBUSELEM")) || (tName == QStringView(u"SCRIBUSELEMUTF8")))
{
QXmlStreamAttributes attrs = sReader.attributes();;
QString attx = attrs.value("XP").toString();
/trunk/Scribus/scribus/ui/helpbrowser.cpp
81,7 → 81,7
 
QXmlStreamReader sReader(&qFile);
QXmlStreamReader::TokenType tagType;
QStringRef tagName;
QStringView tagName;
 
while (!sReader.atEnd() && !sReader.hasError())
{
90,7 → 90,7
continue;
 
tagName = sReader.name();
if (tagName != "item")
if (tagName != QStringView(u"item"))
continue;
 
struct histd2 his;
126,7 → 126,7
 
QXmlStreamReader sReader(&qFile);
QXmlStreamReader::TokenType tagType;
QStringRef tagName;
QStringView tagName;
 
while (!sReader.atEnd() && !sReader.hasError())
{
135,7 → 135,7
continue;
 
tagName = sReader.name();
if (tagName != "item")
if (tagName != QStringView(u"item"))
continue;
 
QXmlStreamAttributes attrs = sReader.attributes();
/trunk/Scribus/scribus/ui/annot.cpp
27,6 → 27,7
#include <QSpacerItem>
#include <QStackedWidget>
#include <QStringList>
#include <QStringView>
#include <QWidget>
 
#include "annotation.h"
773,7 → 774,7
if (pfol.count() > 1)
{
tm2 = pfol[0].simplified();
tm += tm2.midRef(1, tm2.length()-2);
tm += QStringView{tm2}.mid(1, tm2.length()-2);
for (int cfx = 1; cfx < pfol.count(); ++cfx)
{
tm2 = pfol[cfx].simplified();
/trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
17,6 → 17,7
#include <QMimeData>
#include <QMessageBox>
#include <QPainter>
#include <QStringView>
 
#include "commonstrings.h"
#include "iconmanager.h"
261,7 → 262,7
int st = str.indexOf(" ");
int en = str.indexOf(" ", st + 1);
tmp = str.mid(en+1);
int dr = str.midRef(st, en-st).toInt();
int dr = QStringView{str}.mid(st, en-st).toInt();
int a = rowAt(e->pos().y());
int b = columnAt(e->pos().x());
if ((a == -1) || (b == -1))
/trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
550,7 → 550,7
// FIXME: move to a new masterpages.h
bool PagePalette_MasterPages::isReservedName(const QString& name) const
{
bool retval = name == CommonStrings::masterPageNormal ||
return name == CommonStrings::masterPageNormal ||
name == CommonStrings::trMasterPageNormal ||
name == CommonStrings::masterPageNormalLeft ||
name == CommonStrings::trMasterPageNormalLeft ||
558,7 → 558,6
name == CommonStrings::trMasterPageNormalMiddle ||
name == CommonStrings::masterPageNormalRight ||
name == CommonStrings::trMasterPageNormalRight;
return retval;
}
 
// FIXME: move to a new masterpages.h
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
10,6 → 10,7
#include <QFile>
#include <QFileInfo>
#include <QRegExp>
#include <QStringView>
 
#include "cmsettings.h"
#include "colormgmt/sccolormgmtengine.h"
100,7 → 101,7
for (int a = 2; a < tmp.length(); a += 2)
{
bool ok;
ushort data = tmp.midRef(a, 2).toUShort(&ok, 16);
ushort data = QStringView{tmp}.mid(a, 2).toUShort(&ok, 16);
psdata.resize(psdata.size()+1);
psdata[psdata.size()-1] = data;
}
425,7 → 426,7
for (int a = 2; a < tmp.length(); a += 2)
{
bool ok;
ushort data = tmp.midRef(a, 2).toUShort(&ok, 16);
ushort data = QStringView{tmp}.mid(a, 2).toUShort(&ok, 16);
psdata.resize(psdata.size()+1);
psdata[psdata.size()-1] = data;
}
442,7 → 443,7
for (int a = 2; a < tmp.length(); a += 2)
{
bool ok;
ushort data = tmp.midRef(a, 2).toUShort(&ok, 16);
ushort data = QStringView{tmp}.mid(a, 2).toUShort(&ok, 16);
psdata.resize(psdata.size()+1);
psdata[psdata.size()-1] = data;
}
1244,7 → 1245,7
for (int a = 0; a < tmp.length(); a += 2)
{
bool ok;
ushort data = tmp.midRef(a, 2).toUShort(&ok, 16);
ushort data = QStringView{tmp}.mid(a, 2).toUShort(&ok, 16);
psdata.resize(psdata.size()+1);
psdata[psdata.size()-1] = data;
}
1377,7 → 1378,7
for (int a = 0; a < tmp.length(); a += 2)
{
bool ok;
ushort data = tmp.midRef(a, 2).toUShort(&ok, 16);
ushort data = QStringView{tmp}.mid(a, 2).toUShort(&ok, 16);
psdata.resize(psdata.size()+1);
psdata[psdata.size()-1] = data;
}
/trunk/Scribus/CMakeLists_Dependencies.cmake
67,8 → 67,6
else()
#WANT QT6
message(STATUS "Qt6 Requested")
set(QT_MIN_VERSION "6.2.0")
 
find_package(Qt6 COMPONENTS Core REQUIRED)
add_definitions(${Qt6Core_DEFINITIONS})
include_directories(${Qt6Core_INCLUDE_DIRS})