Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24733 → Rev 24734

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