r24834 by jghali - Fixes for Qt6 (and bye bye Qt5 compatibility!)
scribus-commit
scribus-commit at lists.scribus.net
Sat Jan 29 20:52:40 UTC 2022
Author: jghali
Date: Sat Jan 29 20:52:40 2022
New Revision: 24834
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24834
Log:
Fixes for Qt6 (and bye bye Qt5 compatibility!)
Modified:
trunk/Scribus/scribus/actionmanager.cpp
trunk/Scribus/scribus/colorsetmanager.cpp
trunk/Scribus/scribus/desaxe/digester.cpp
trunk/Scribus/scribus/desaxe/saxiohelper.cpp
trunk/Scribus/scribus/fonts/scface_ttf.cpp
trunk/Scribus/scribus/hyphenator.cpp
trunk/Scribus/scribus/iconmanager.cpp
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
trunk/Scribus/scribus/latexhelpers.cpp
trunk/Scribus/scribus/latexhelpers.h
trunk/Scribus/scribus/nftrcreader.cpp
trunk/Scribus/scribus/nfttemplate.cpp
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/pdfoptionsio.cpp
trunk/Scribus/scribus/prefsfile.cpp
trunk/Scribus/scribus/prefsmanager.cpp
trunk/Scribus/scribus/sccolor.cpp
trunk/Scribus/scribus/scfonts.cpp
trunk/Scribus/scribus/scimagecacheproxy.cpp
trunk/Scribus/scribus/scpainter.cpp
trunk/Scribus/scribus/scpainterex_cairo.cpp
trunk/Scribus/scribus/scribusXml.cpp
trunk/Scribus/scribus/scribusapp.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusview.cpp
trunk/Scribus/scribus/scribusview.h
trunk/Scribus/scribus/scslainforeader.cpp
trunk/Scribus/scribus/scxmlstreamreader.cpp
trunk/Scribus/scribus/third_party/fparser/fpoptimizer.cc
trunk/Scribus/scribus/ui/about.cpp
trunk/Scribus/scribus/ui/annot.cpp
trunk/Scribus/scribus/ui/colorsandfills.cpp
trunk/Scribus/scribus/ui/dasheditor.cpp
trunk/Scribus/scribus/ui/dasheditor.h
trunk/Scribus/scribus/ui/helpbrowser.cpp
trunk/Scribus/scribus/ui/latexeditor.cpp
trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
trunk/Scribus/scribus/ui/picstatus.cpp
trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
trunk/Scribus/scribus/ui/prefs_spelling.cpp
trunk/Scribus/scribus/ui/printpreview.cpp
trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
trunk/Scribus/scribus/ui/resourcemanager.cpp
trunk/Scribus/scribus/ui/scrapbookpalette.cpp
trunk/Scribus/scribus/upgradechecker.cpp
trunk/Scribus/scribus/util.cpp
trunk/Scribus/scribus/util_printer.h
Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Sat Jan 29 20:52:40 2022
@@ -1419,7 +1419,7 @@
charCode==29 ||
charCode==30 ||
((*mainWindow->doc->AllFonts)[fontName].usable() &&
- (*mainWindow->doc->AllFonts)[fontName].canRender(charCode)) )
+ (*mainWindow->doc->AllFonts)[fontName].canRender( QChar(charCode) )) )
(*actionMap)[*it]->setEnabled(true);
else
(*actionMap)[*it]->setEnabled(false);
@@ -1907,53 +1907,53 @@
defKeys.clear();
defKeys.insert("fileNew", QKeySequence::New);
- defKeys.insert("fileNewFromTemplate", Qt::CTRL+Qt::ALT+Qt::Key_N);
+ defKeys.insert("fileNewFromTemplate", Qt::CTRL | Qt::ALT | Qt::Key_N);
defKeys.insert("fileOpen", QKeySequence::Open);
defKeys.insert("fileClose", QKeySequence::Close);
defKeys.insert("fileSave", QKeySequence::Save);
- defKeys.insert("fileSaveAs", Qt::CTRL+Qt::SHIFT+Qt::Key_S);
- defKeys.insert("fileImportText", Qt::CTRL+Qt::Key_I);
- defKeys.insert("fileImportImage", Qt::CTRL+Qt::Key_I);
+ defKeys.insert("fileSaveAs", Qt::CTRL | Qt::SHIFT | Qt::Key_S);
+ defKeys.insert("fileImportText", Qt::CTRL | Qt::Key_I);
+ defKeys.insert("fileImportImage", Qt::CTRL | Qt::Key_I);
defKeys.insert("filePrint", QKeySequence::Print);
- defKeys.insert("fileExportAsPDF", Qt::CTRL+Qt::SHIFT+Qt::Key_P);
- defKeys.insert("fileQuit", Qt::CTRL+Qt::Key_Q);
+ defKeys.insert("fileExportAsPDF", Qt::CTRL | Qt::SHIFT | Qt::Key_P);
+ defKeys.insert("fileQuit", Qt::CTRL | Qt::Key_Q);
//Edit Menu
defKeys.insert("editUndoAction", QKeySequence::Undo);
defKeys.insert("editRedoAction", QKeySequence::Redo);
defKeys.insert("editCut", QKeySequence::Cut);
defKeys.insert("editCopy", QKeySequence::Copy);
defKeys.insert("editPaste", QKeySequence::Paste);
- defKeys.insert("editClearContents", Qt::CTRL+Qt::SHIFT+Qt::Key_Delete);
- defKeys.insert("editCopyContents", Qt::CTRL+Qt::SHIFT+Qt::Key_C);
- defKeys.insert("editPasteContents", Qt::CTRL+Qt::SHIFT+Qt::Key_V);
- defKeys.insert("editPasteContentsAbs", Qt::CTRL+Qt::ALT+Qt::SHIFT+Qt::Key_V);
- defKeys.insert("editSelectAll", Qt::CTRL+Qt::Key_A);
- defKeys.insert("editSelectAllOnLayer", Qt::CTRL+Qt::ALT+Qt::Key_A);
- defKeys.insert("editDeselectAll", Qt::CTRL+Qt::SHIFT+Qt::Key_A);
- defKeys.insert("editSearchReplace", Qt::CTRL+Qt::Key_F);
+ defKeys.insert("editClearContents", Qt::CTRL | Qt::SHIFT | Qt::Key_Delete);
+ defKeys.insert("editCopyContents", Qt::CTRL | Qt::SHIFT | Qt::Key_C);
+ defKeys.insert("editPasteContents", Qt::CTRL | Qt::SHIFT | Qt::Key_V);
+ defKeys.insert("editPasteContentsAbs", Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_V);
+ defKeys.insert("editSelectAll", Qt::CTRL | Qt::Key_A);
+ defKeys.insert("editSelectAllOnLayer", Qt::CTRL | Qt::ALT | Qt::Key_A);
+ defKeys.insert("editDeselectAll", Qt::CTRL | Qt::SHIFT | Qt::Key_A);
+ defKeys.insert("editSearchReplace", Qt::CTRL | Qt::Key_F);
defKeys.insert("editStyles", QKeySequence(Qt::Key_F4));
- defKeys.insert("styleImageEffects", Qt::CTRL+Qt::Key_E);
+ defKeys.insert("styleImageEffects", Qt::CTRL | Qt::Key_E);
//Item Menu
- defKeys.insert("itemDuplicate", Qt::CTRL+Qt::Key_D);
- defKeys.insert("itemMulDuplicate", Qt::CTRL+Qt::SHIFT+Qt::Key_D);
+ defKeys.insert("itemDuplicate", Qt::CTRL | Qt::Key_D);
+ defKeys.insert("itemMulDuplicate", Qt::CTRL | Qt::SHIFT | Qt::Key_D);
defKeys.insert("itemDelete", QKeySequence::Delete);
- defKeys.insert("itemGroup", Qt::CTRL+Qt::Key_G);
- defKeys.insert("itemUngroup", Qt::CTRL+Qt::SHIFT+Qt::Key_G);
- defKeys.insert("itemLock", Qt::CTRL+Qt::Key_L);
- defKeys.insert("itemLockSize", Qt::CTRL+Qt::SHIFT+Qt::Key_L);
+ defKeys.insert("itemGroup", Qt::CTRL | Qt::Key_G);
+ defKeys.insert("itemUngroup", Qt::CTRL | Qt::SHIFT | Qt::Key_G);
+ defKeys.insert("itemLock", Qt::CTRL | Qt::Key_L);
+ defKeys.insert("itemLockSize", Qt::CTRL | Qt::SHIFT | Qt::Key_L);
defKeys.insert("itemLowerToBottom", Qt::Key_End);
defKeys.insert("itemRaiseToTop", Qt::Key_Home);
- defKeys.insert("itemLower", Qt::CTRL+Qt::Key_End);
- defKeys.insert("itemRaise", Qt::CTRL+Qt::Key_Home);
+ defKeys.insert("itemLower", Qt::CTRL | Qt::Key_End);
+ defKeys.insert("itemRaise", Qt::CTRL | Qt::Key_Home);
//Insert Menu
//Page menu
//View Menu
- defKeys.insert("viewFitInWindow", Qt::CTRL+Qt::Key_0);
- defKeys.insert("viewFit100", Qt::CTRL+Qt::Key_1);
- defKeys.insert("viewPreviewMode", Qt::CTRL+Qt::ALT+Qt::Key_P);
- defKeys.insert("viewShowRulers", Qt::CTRL+Qt::SHIFT+Qt::Key_R);
+ defKeys.insert("viewFitInWindow", Qt::CTRL | Qt::Key_0);
+ defKeys.insert("viewFit100", Qt::CTRL | Qt::Key_1);
+ defKeys.insert("viewPreviewMode", Qt::CTRL | Qt::ALT | Qt::Key_P);
+ defKeys.insert("viewShowRulers", Qt::CTRL | Qt::SHIFT | Qt::Key_R);
defKeys.insert("viewShowContextMenu", Qt::Key_Menu); //Context menu key on Windows. Do we have one to use on Linux/OSX? Super_L ?
//Tool menu
@@ -1975,10 +1975,10 @@
defKeys.insert("toolsInsertRenderFrame", Qt::Key_D); //TODO: First free key. Select a meaningful
defKeys.insert("toolsRotate", Qt::Key_R);
defKeys.insert("toolsZoom", Qt::Key_Z);
- defKeys.insert("toolsZoomIn", Qt::CTRL+Qt::Key_Plus);
- defKeys.insert("toolsZoomOut", Qt::CTRL+Qt::Key_Minus);
+ defKeys.insert("toolsZoomIn", Qt::CTRL | Qt::Key_Plus);
+ defKeys.insert("toolsZoomOut", Qt::CTRL | Qt::Key_Minus);
defKeys.insert("toolsEditContents", Qt::Key_E);
- defKeys.insert("toolsEditWithStoryEditor", Qt::CTRL+Qt::Key_T);
+ defKeys.insert("toolsEditWithStoryEditor", Qt::CTRL | Qt::Key_T);
defKeys.insert("toolsLinkTextFrame", Qt::Key_N);
defKeys.insert("toolsUnlinkTextFrame", Qt::Key_U);
defKeys.insert("toolsEyeDropper", Qt::Key_Y);
@@ -1987,29 +1987,29 @@
//Extras Menu
//Windows Menu
//Help Menu
- defKeys.insert("helpActionSearch", Qt::CTRL+Qt::Key_Slash);
+ defKeys.insert("helpActionSearch", Qt::CTRL | Qt::Key_Slash);
defKeys.insert("helpManual", Qt::Key_F1);
//GUI and specials
defKeys.insert("specialToggleAllPalettes", Qt::Key_F12);
defKeys.insert("specialToggleAllGuides", Qt::Key_F11);
- defKeys.insert("specialUnicodeSequenceBegin", Qt::CTRL+Qt::SHIFT+Qt::Key_U);
+ defKeys.insert("specialUnicodeSequenceBegin", Qt::CTRL | Qt::SHIFT | Qt::Key_U);
//typography
- defKeys.insert("unicodeFrameBreak", Qt::CTRL+Qt::Key_Return);
- defKeys.insert("unicodeColumnBreak", Qt::CTRL+Qt::SHIFT+Qt::Key_Return);
-
- defKeys.insert("unicodeSoftHyphen", Qt::CTRL+Qt::SHIFT+Qt::Key_Minus);
- defKeys.insert("unicodeNonBreakingHyphen", Qt::CTRL+Qt::ALT+Qt::Key_Minus);
- defKeys.insert("unicodeNonBreakingSpace", Qt::CTRL+Qt::Key_Space);
- defKeys.insert("unicodeNarrowNoBreakSpace", Qt::CTRL+Qt::ALT+Qt::Key_Space);
- defKeys.insert("unicodePageNumber", Qt::CTRL+Qt::SHIFT+Qt::ALT+Qt::Key_P);
- defKeys.insert("unicodeNewLine", Qt::SHIFT+Qt::Key_Return);
+ defKeys.insert("unicodeFrameBreak", Qt::CTRL | Qt::Key_Return);
+ defKeys.insert("unicodeColumnBreak", Qt::CTRL | Qt::SHIFT | Qt::Key_Return);
+
+ defKeys.insert("unicodeSoftHyphen", Qt::CTRL | Qt::SHIFT | Qt::Key_Minus);
+ defKeys.insert("unicodeNonBreakingHyphen", Qt::CTRL | Qt::ALT | Qt::Key_Minus);
+ defKeys.insert("unicodeNonBreakingSpace", Qt::CTRL | Qt::Key_Space);
+ defKeys.insert("unicodeNarrowNoBreakSpace", Qt::CTRL | Qt::ALT | Qt::Key_Space);
+ defKeys.insert("unicodePageNumber", Qt::CTRL | Qt::SHIFT | Qt::ALT | Qt::Key_P);
+ defKeys.insert("unicodeNewLine", Qt::SHIFT | Qt::Key_Return);
//Plugins
- defKeys.insert("ExportAsImage", Qt::CTRL+Qt::SHIFT+Qt::Key_E);
- defKeys.insert("NewFromDocumentTemplate", Qt::CTRL+Qt::ALT+Qt::Key_N);
- defKeys.insert("SaveAsDocumentTemplate", Qt::CTRL+Qt::ALT+Qt::Key_S);
+ defKeys.insert("ExportAsImage", Qt::CTRL | Qt::SHIFT | Qt::Key_E);
+ defKeys.insert("NewFromDocumentTemplate", Qt::CTRL | Qt::ALT | Qt::Key_N);
+ defKeys.insert("SaveAsDocumentTemplate", Qt::CTRL | Qt::ALT | Qt::Key_S);
}
void ActionManager::createDefaultMenuNames()
Modified: trunk/Scribus/scribus/colorsetmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/colorsetmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/colorsetmanager.cpp (original)
+++ trunk/Scribus/scribus/colorsetmanager.cpp Sat Jan 29 20:52:40 2022
@@ -289,7 +289,7 @@
return false;
QDomDocument docu("scridoc");
QTextStream ts(&f);
- ts.setCodec("UTF-8");
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int errorLine = 0, errorColumn = 0;
if (!docu.setContent(ts.readAll(), &errorMsg, &errorLine, &errorColumn))
Modified: trunk/Scribus/scribus/desaxe/digester.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/desaxe/digester.cpp
==============================================================================
--- trunk/Scribus/scribus/desaxe/digester.cpp (original)
+++ trunk/Scribus/scribus/desaxe/digester.cpp Sat Jan 29 20:52:40 2022
@@ -448,8 +448,8 @@
return nfa;
}
-struct CreateDFAState : public std::unary_function <std::set<nfa_state_t>, dfa_state_t> {
-
+struct CreateDFAState
+{
CreateDFAState(const std::vector<rule_t>& rules, const std::vector<nfa_state_t>& accepting)
: n(0), rules_(rules), accepting_(accepting)
{}
Modified: trunk/Scribus/scribus/desaxe/saxiohelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/desaxe/saxiohelper.cpp
==============================================================================
--- trunk/Scribus/scribus/desaxe/saxiohelper.cpp (original)
+++ trunk/Scribus/scribus/desaxe/saxiohelper.cpp Sat Jan 29 20:52:40 2022
@@ -29,7 +29,7 @@
|| (i > 0 && (ch == '-' || ch == '.' || ('0' <= ch && ch <= '9') || ch == 0xB7
|| (0x300 <= ch && ch <= 0x36F) || (0x203F <= ch && ch <= 0x2040) )))
{
- result += ch;
+ result += QChar(ch);
}
else
{
Modified: trunk/Scribus/scribus/fonts/scface_ttf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/fonts/scface_ttf.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.cpp (original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.cpp Sat Jan 29 20:52:40 2022
@@ -201,7 +201,7 @@
str += "/FontName /" + psName + " def\n";
str += "/Encoding /ISOLatin1Encoding where {pop ISOLatin1Encoding} {StandardEncoding} ifelse def\n";
str += "/PaintType 0 def\n/FontMatrix [1 0 0 1 0 0] def\n";
- str += "/FontBBox ["+m_pdfFontBBox+"] def\n";
+ str += "/FontBBox [" + m_pdfFontBBox + "] def\n";
str += "/FontType 42 def\n";
str += "/FontInfo 8 dict dup begin\n";
str += "/FamilyName (" + psName + ") def\n";
Modified: trunk/Scribus/scribus/hyphenator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/hyphenator.cpp
==============================================================================
--- trunk/Scribus/scribus/hyphenator.cpp (original)
+++ trunk/Scribus/scribus/hyphenator.cpp Sat Jan 29 20:52:40 2022
@@ -29,6 +29,7 @@
#include <QCursor>
#include <QCheckBox>
#include <QByteArray>
+#include <QStringView>
#include <unicode/brkiter.h>
#include "langmgr.h"
@@ -188,7 +189,7 @@
int i = 0;
buffer[te.length()] = '\0';
bool hasHyphen = false;
- for (i = 1; i < wordLower.length()-1; ++i)
+ for (i = 1; i < wordLower.length() - 1; ++i)
{
if(buffer[i] & 1)
{
@@ -199,13 +200,13 @@
QString outs = "";
QString input = "";
outs += word[0];
- for (i = 1; i < wordLower.length()-1; ++i)
+ for (i = 1; i < wordLower.length() - 1; ++i)
{
outs += word[i];
if(buffer[i] & 1)
outs += "-";
}
- outs += word.rightRef(1);
+ outs += QStringView(word).last();
input = outs;
if (!ignoredWords.contains(word))
{
Modified: trunk/Scribus/scribus/iconmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/iconmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/iconmanager.cpp (original)
+++ trunk/Scribus/scribus/iconmanager.cpp Sat Jan 29 20:52:40 2022
@@ -84,7 +84,7 @@
if (!dataFile.open(QIODevice::ReadOnly))
continue;
QTextStream ts(&dataFile);
- ts.setCodec(QTextCodec::codecForName("UTF-8"));
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int eline;
int ecol;
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp Sat Jan 29 20:52:40 2022
@@ -10,6 +10,7 @@
#include <QFile>
#include <QFileInfo>
#include <QRegExp>
+#include <QStringView>
#include "cmsettings.h"
#include "colormgmt/sccolormgmtengine.h"
@@ -83,7 +84,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).sliced(a, 2).toUShort(&ok, 16);
psdata.resize(psdata.size()+1);
psdata[psdata.size()-1] = data;
}
@@ -408,7 +409,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).sliced(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).sliced(a, 2).toUShort(&ok, 16);
psdata.resize(psdata.size()+1);
psdata[psdata.size()-1] = data;
}
@@ -1230,7 +1231,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).sliced(a, 2).toUShort(&ok, 16);
psdata.resize(psdata.size()+1);
psdata[psdata.size()-1] = data;
}
@@ -1363,7 +1364,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).sliced(a, 2).toUShort(&ok, 16);
psdata.resize(psdata.size()+1);
psdata[psdata.size()-1] = data;
}
Modified: trunk/Scribus/scribus/latexhelpers.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/latexhelpers.cpp
==============================================================================
--- trunk/Scribus/scribus/latexhelpers.cpp (original)
+++ trunk/Scribus/scribus/latexhelpers.cpp Sat Jan 29 20:52:40 2022
@@ -112,7 +112,7 @@
xml.readNext();
if (xml.isWhitespace() || xml.isComment() || xml.isStartDocument() || xml.isEndDocument())
continue;
- if (xml.isStartElement() && xml.name() == "editorsettings")
+ if (xml.isStartElement() && xml.name() == QLatin1String("editorsettings"))
{
m_description = xml.attributes().value("description").toString();
m_icon = xml.attributes().value("icon").toString();
@@ -134,8 +134,10 @@
while (!xml.atEnd())
{
xml.readNext();
- if (xml.isEndElement() && xml.name() == "editorsettings") break;
- if (xml.isWhitespace() || xml.isComment() || xml.isEndElement()) continue;
+ if (xml.isEndElement() && xml.name() == QLatin1String("editorsettings"))
+ break;
+ if (xml.isWhitespace() || xml.isComment() || xml.isEndElement())
+ continue;
if (!xml.isStartElement())
{
formatError("Unexpected element in <editorsettings>"+xml.name().toString()+", Token String: "+
@@ -143,19 +145,19 @@
continue;
}
- if (xml.name() == "executable") {
+ if (xml.name() == QLatin1String("executable")){
m_executable = xml.attributes().value("command").toString();
- } else if (xml.name() == "imagefile") {
+ } else if (xml.name() == QLatin1String("imagefile")) {
m_imageExtension = xml.attributes().value("extension").toString();
- } else if (xml.name() == "highlighter") {
+ } else if (xml.name() == QLatin1String("highlighter")) {
parseHighlighter();
- } else if (xml.name() == "empty-frame-text") {
+ } else if (xml.name() == QLatin1String("empty-frame-text")) {
m_emptyFrameText = xml.readI18nText(true);
- } else if (xml.name() == "preamble") {
+ } else if (xml.name() == QLatin1String("preamble")) {
m_preamble = xml.readElementText();
- } else if (xml.name() == "postamble") {
+ } else if (xml.name() == QLatin1String("postamble")) {
m_postamble = xml.readElementText();
- } else if (xml.name() == "tab") {
+ } else if (xml.name() == QLatin1String("tab")) {
parseTab();
} else {
formatError("Unknown tag in <editorsettings>: "+xml.name().toString());
@@ -171,11 +173,11 @@
m_error += new_error + "\n";
}
-bool LatexConfigParser::StrRefToBool(const QStringRef &str) const
-{
- if (str == "1" || str == "true")
+bool LatexConfigParser::StrViewToBool(const QStringView& str) const
+{
+ if (str == QLatin1String("1") || str == QLatin1String("true"))
return true;
- if (str == "0" || str == "false" || str.isEmpty())
+ if (str == QLatin1String("0") || str == QLatin1String("false") || str.isEmpty())
return false;
qWarning() << "Invalid bool string:" << str.toString();
return false;
@@ -190,11 +192,11 @@
xml.readNext();
if (xml.isWhitespace() || xml.isComment())
continue;
- if (xml.isEndElement() && xml.name() == "highlighter")
+ if (xml.isEndElement() && xml.name() == QLatin1String("highlighter"))
break;
- if (xml.isEndElement() && xml.name() == "rule")
- continue;
- if (!xml.isStartElement() || xml.name() != "rule")
+ if (xml.isEndElement() && xml.name() == QLatin1String("rule"))
+ continue;
+ if (!xml.isStartElement() || xml.name() != QLatin1String("rule"))
{
formatError("Unexpected element in <highlighter>: "+
xml.name().toString()+", Token String: "+
@@ -202,10 +204,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())
@@ -237,21 +239,23 @@
while (!xml.atEnd())
{
xml.readNext();
- if (xml.isWhitespace() || xml.isComment()) continue;
- if (xml.isEndElement() && xml.name() == "tab") break;
+ if (xml.isWhitespace() || xml.isComment())
+ continue;
+ if (xml.isEndElement() && xml.name() == QLatin1String("tab"))
+ break;
if (!xml.isStartElement())
{
formatError("Unexpected element in <tab>: "+xml.name().toString()+", Token String: "+
xml.tokenString());
continue;
}
- if (xml.name() == "title")
+ if (xml.name() == QLatin1String("title"))
{
if (!title.isEmpty())
formatError("Second <title> tag in <tab>");
title = xml.readI18nText();
}
- else if (xml.name() == "item")
+ else if (xml.name() == QLatin1String("item"))
{
if (!itemstab)
formatError("Found <item> in a 'settings'-tab!");
@@ -259,15 +263,18 @@
// QString img = xml.attributes().value("image").toString();
text = xml.readI18nText();
}
- else if (xml.name() == "comment" || xml.name() == "font"
- || xml.name() == "spinbox" || xml.name() == "color"
- || xml.name() == "text" || xml.name() == "list")
+ else if (xml.name() == QLatin1String("comment") ||
+ xml.name() == QLatin1String("font") ||
+ xml.name() == QLatin1String("spinbox") ||
+ xml.name() == QLatin1String("color") ||
+ xml.name() == QLatin1String("text") ||
+ xml.name() == QLatin1String("list"))
{
//TODO: Store this + attributes in a list
// QString tagname = xml.name().toString();
name = xml.attributes().value("name").toString();
default_value = xml.attributes().value("default").toString();
- if (xml.name() != "list")
+ if (xml.name() != QLatin1String("list"))
text = xml.readI18nText();
else
ignoreList();
@@ -294,7 +301,8 @@
while (!xml.atEnd())
{
xml.readNext();
- if (xml.isEndElement() && xml.name() == "list") break;
+ if (xml.isEndElement() && xml.name() == QLatin1String("list"))
+ break;
}
}
@@ -351,7 +359,7 @@
{
if (isEndElement())
{
- if (name() == "i18n")
+ if (name() == QLatin1String("i18n"))
{
i18n = false;
}
@@ -389,7 +397,7 @@
{
if (isStartElement())
{
- if (name() == "i18n")
+ if (name() == QLatin1String("i18n"))
{
i18n = true;
continue;
Modified: trunk/Scribus/scribus/latexhelpers.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/latexhelpers.h
==============================================================================
--- trunk/Scribus/scribus/latexhelpers.h (original)
+++ trunk/Scribus/scribus/latexhelpers.h Sat Jan 29 20:52:40 2022
@@ -27,6 +27,7 @@
#include <QPointer>
#include <QString>
#include <QStringRef>
+#include <QStringView>
#include <QSyntaxHighlighter>
#include <QXmlStreamReader>
@@ -89,7 +90,7 @@
void parseTab();
void parseHighlighter();
void ignoreList();
- bool StrRefToBool(const QStringRef& str) const;
+ bool StrViewToBool(const QStringView& str) const;
};
class LatexConfigCache;
Modified: trunk/Scribus/scribus/nftrcreader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/nftrcreader.cpp
==============================================================================
--- trunk/Scribus/scribus/nftrcreader.cpp (original)
+++ trunk/Scribus/scribus/nftrcreader.cpp Sat Jan 29 20:52:40 2022
@@ -8,7 +8,7 @@
* Riku Leino, tsoots at 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 != QLatin1String("templates"))
return false;
firstElement = false;
continue;
}
- if (tagName == "template")
+ if (tagName == QLatin1String("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 != QLatin1String("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 == QLatin1String("name"))
nftTemplate->name = reader.readElementText();
- else if (tagName == "file")
+ else if (tagName == QLatin1String("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 == QLatin1String("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 == QLatin1String("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 == QLatin1String("psize"))
nftTemplate->psize = reader.readElementText();
- else if (tagName == "color")
+ else if (tagName == QLatin1String("color"))
nftTemplate->color = reader.readElementText();
- else if (tagName == "descr")
+ else if (tagName == QLatin1String("descr"))
nftTemplate->descr = reader.readElementText();
- else if (tagName == "usage")
+ else if (tagName == QLatin1String("usage"))
nftTemplate->usage = reader.readElementText();
- else if (tagName == "scribus_version")
+ else if (tagName == QLatin1String("scribus_version"))
nftTemplate->scribusVersion = reader.readElementText();
- else if (tagName == "date")
+ else if (tagName == QLatin1String("date"))
nftTemplate->date = reader.readElementText();
- else if (tagName == "author")
+ else if (tagName == QLatin1String("author"))
nftTemplate->author = reader.readElementText();
- else if (tagName == "email")
+ else if (tagName == QLatin1String("email"))
nftTemplate->email = reader.readElementText();
else
{
Modified: trunk/Scribus/scribus/nfttemplate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/nfttemplate.cpp
==============================================================================
--- trunk/Scribus/scribus/nfttemplate.cpp (original)
+++ trunk/Scribus/scribus/nfttemplate.cpp Sat Jan 29 20:52:40 2022
@@ -31,7 +31,7 @@
QString tmp;
bool collect = false;
QTextStream stream(&tmplXml);
- stream.setCodec("UTF-8");
+ stream.setEncoding(QStringConverter::Utf8);
QString line = stream.readLine();
while (!line.isNull())
{
@@ -76,7 +76,7 @@
if (tmplXml.open(QIODevice::WriteOnly))
{
QTextStream instream(&tmplXml);
- instream.setCodec("UTF-8");
+ instream.setEncoding(QStringConverter::Utf8);
instream << newTmplXml;
tmplXml.close();
}
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Sat Jan 29 20:52:40 2022
@@ -1746,7 +1746,7 @@
// In some case (arial!), all used glyphs may not be listed in the encoding map,
// and glyphs such as old numerals may be found only in the usedGlyphs map
- QList<uint> keys = encoding.uniqueKeys() + usedGlyphs.uniqueKeys();
+ QList<uint> keys = encoding.keys() + usedGlyphs.keys();
std::sort(keys.begin(), keys.end());
auto lastIt = std::unique(keys.begin(), keys.end());
keys.erase(lastIt, keys.end());
@@ -2083,7 +2083,7 @@
QByteArray font;
face.rawData(font);
/*dumpFont(face.psName() + ".ttf", font);*/
- QList<ScFace::gid_type> glyphs = usedGlyphs.uniqueKeys();
+ QList<ScFace::gid_type> glyphs = usedGlyphs.keys();
glyphs.removeAll(0);
glyphs.prepend(0);
@@ -2120,7 +2120,7 @@
face.rawData(data);
font = sfnt::getTable(data, "CFF ");
/*dumpFont(face.psName() + ".cff", font);*/
- QList<ScFace::gid_type> glyphs = usedGlyphs.uniqueKeys();
+ QList<ScFace::gid_type> glyphs = usedGlyphs.keys();
glyphs.removeAll(0);
glyphs.prepend(0);
@@ -2147,7 +2147,7 @@
{
QByteArray data;
face.rawData(data);
- QList<ScFace::gid_type> glyphs = usedGlyphs.uniqueKeys();
+ QList<ScFace::gid_type> glyphs = usedGlyphs.keys();
glyphs.removeAll(0);
glyphs.prepend(0);
@@ -3265,8 +3265,8 @@
// PutDoc("/BBox [ 0 0 " + FToStr(ActPageP->width()) + " " + FToStr(ActPageP->height()) + " ]\n");
Pdf::ResourceDictionary dict;
- dict.XObject.unite(pageData.ImgObjects);
- dict.XObject.unite(pageData.XObjects);
+ dict.XObject.insert(pageData.ImgObjects);
+ dict.XObject.insert(pageData.XObjects);
dict.Font = pageData.FObjects;
dict.Shading = Shadings;
dict.Pattern = Patterns;
@@ -4032,8 +4032,8 @@
PutDoc("/BBox [ " + FToStr(-bleedLeft) + " " + FToStr(-Options.bleeds.bottom()) + " " + FToStr(maxBoxX) + " " + FToStr(maxBoxY) + " ]\n");
PutDoc("/Resources ");
Pdf::ResourceDictionary dict;
- dict.XObject.unite(pageData.ImgObjects);
- dict.XObject.unite(pageData.XObjects);
+ dict.XObject.insert(pageData.ImgObjects);
+ dict.XObject.insert(pageData.XObjects);
dict.Font = pageData.FObjects;
dict.Shading = Shadings;
dict.Pattern = Patterns;
@@ -4121,8 +4121,8 @@
PutDoc("/Group " + Pdf::toObjRef(Gobj) + "\n");
PutDoc("/Resources ");
Pdf::ResourceDictionary dict;
- dict.XObject.unite(pageData.ImgObjects);
- dict.XObject.unite(pageData.XObjects);
+ dict.XObject.insert(pageData.ImgObjects);
+ dict.XObject.insert(pageData.XObjects);
dict.Font = pageData.FObjects;
dict.Shading = Shadings;
dict.Pattern = Patterns;
@@ -4196,7 +4196,7 @@
ite->doc()->guidesPrefs().showControls = saveControl;
ite->setHasSoftShadow(savedShadow);
- ScImage img = imgC.alphaChannel().convertToFormat(QImage::Format_RGB32);
+ ScImage img = imgC.convertToFormat(QImage::Format_Alpha8).convertToFormat(QImage::Format_RGB32);
PdfId maskObj = writer.newObject();
writer.startObj(maskObj);
@@ -6209,7 +6209,7 @@
double actualStop = cstops.at(cst)->rampPoint;
qStopColor = cstops.at(cst)->color;
double a = cstops.at(cst)->opacity;
- double r, g, b;
+ float r, g, b;
qStopColor.getRgbF(&r, &g, &b);
if ((GType == 4) || (GType == 5))
a = /* 1.0 - */ (0.3 * r + 0.59 * g + 0.11 * b);
@@ -6297,8 +6297,8 @@
PutDoc("/Resources ");
Pdf::ResourceDictionary dict;
dict.Pattern = Patterns;
- dict.XObject.unite(pageData.ImgObjects);
- dict.XObject.unite(pageData.XObjects);
+ dict.XObject.insert(pageData.ImgObjects);
+ dict.XObject.insert(pageData.XObjects);
writer.write(dict);
PutDoc("\n");
@@ -6367,8 +6367,8 @@
PutDoc("/Resources ");
Pdf::ResourceDictionary dict;
dict.Pattern = Patterns;
- dict.XObject.unite(pageData.ImgObjects);
- dict.XObject.unite(pageData.XObjects);
+ dict.XObject.insert(pageData.ImgObjects);
+ dict.XObject.insert(pageData.XObjects);
writer.write(dict);
PutDoc("\n");
@@ -6643,8 +6643,8 @@
PutDoc("/Resources ");
Pdf::ResourceDictionary dict;
- dict.XObject.unite(pageData.ImgObjects);
- dict.XObject.unite(pageData.XObjects);
+ dict.XObject.insert(pageData.ImgObjects);
+ dict.XObject.insert(pageData.XObjects);
dict.Font = pageData.FObjects;
dict.Shading = Shadings;
dict.Pattern = Patterns;
@@ -9737,8 +9737,8 @@
PutDoc("/Resources ");
Pdf::ResourceDictionary dict;
- dict.XObject.unite(pageData.ImgObjects);
- dict.XObject.unite(pageData.XObjects);
+ dict.XObject.insert(pageData.ImgObjects);
+ dict.XObject.insert(pageData.XObjects);
dict.Font = pageData.FObjects;
writer.write(dict);
@@ -10937,8 +10937,8 @@
writer.startObj(writer.ResourcesObj);
Pdf::ResourceDictionary dict;
- dict.XObject.unite(pageData.ImgObjects);
- dict.XObject.unite(pageData.XObjects);
+ dict.XObject.insert(pageData.ImgObjects);
+ dict.XObject.insert(pageData.XObjects);
dict.Font = pageData.FObjects;
dict.Shading = Shadings;
dict.Pattern = Patterns;
Modified: trunk/Scribus/scribus/pdfoptionsio.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/pdfoptionsio.cpp
==============================================================================
--- trunk/Scribus/scribus/pdfoptionsio.cpp (original)
+++ trunk/Scribus/scribus/pdfoptionsio.cpp Sat Jan 29 20:52:40 2022
@@ -40,7 +40,7 @@
return false;
}
QTextStream ts(&f);
- ts.setCodec("UTF-8");
+ ts.setEncoding(QStringConverter::Utf8);
ts << xml;
m_includePasswords = false; // just to be paranoid
m_error.clear();
@@ -59,7 +59,7 @@
if (xml.isNull())
return false;
QTextStream ts(&outDevice);
- ts.setCodec("UTF-8");
+ ts.setEncoding(QStringConverter::Utf8);
ts << xml;
m_includePasswords = false; // just to be paranoid
m_error.clear();
Modified: trunk/Scribus/scribus/prefsfile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/prefsfile.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsfile.cpp (original)
+++ trunk/Scribus/scribus/prefsfile.cpp Sat Jan 29 20:52:40 2022
@@ -88,7 +88,7 @@
return;
QTextStream stream(&prefsXML);
- stream.setCodec("UTF-8");
+ stream.setEncoding(QStringConverter::Utf8);
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
stream << "<preferences>\n";
if (!m_contexts.empty())
Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sat Jan 29 20:52:40 2022
@@ -1960,8 +1960,8 @@
else
{
QTextStream s(&f);
- s.setCodec("UTF-8");
- s<<docu.toString();
+ s.setEncoding(QStringConverter::Utf8);
+ s << docu.toString();
if (f.error()==QFile::NoError)
result = true;
else
@@ -1982,7 +1982,7 @@
return false;
}
QTextStream ts(&f);
- ts.setCodec("UTF-8");
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int errorLine = 0;
int errorColumn = 0;
Modified: trunk/Scribus/scribus/sccolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/sccolor.cpp
==============================================================================
--- trunk/Scribus/scribus/sccolor.cpp (original)
+++ trunk/Scribus/scribus/sccolor.cpp Sat Jan 29 20:52:40 2022
@@ -23,6 +23,8 @@
#include <cassert>
+#include <QStringView>
+
#include "commonstrings.h"
#include "sccolor.h"
#include "sccolorengine.h"
@@ -367,17 +369,19 @@
bool ok;
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);
+ QStringView colorNameView(colorName);
+ int c = colorNameView.sliced(1, 2).toInt(&ok, 16);
+ int m = colorNameView.sliced(3, 2).toInt(&ok, 16);
+ int y = colorNameView.sliced(5, 2).toInt(&ok, 16);
+ int k = colorNameView.sliced(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);
+ QStringView colorNameView(colorName);
+ int r = colorNameView.sliced(1, 2).toInt(&ok, 16);
+ int g = colorNameView.sliced(3, 2).toInt(&ok, 16);
+ int b = colorNameView.sliced(5, 2).toInt(&ok, 16);
setRgbColor(r, g, b);
}
}
Modified: trunk/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scfonts.cpp
==============================================================================
--- trunk/Scribus/scribus/scfonts.cpp (original)
+++ trunk/Scribus/scribus/scfonts.cpp Sat Jan 29 20:52:40 2022
@@ -1226,7 +1226,7 @@
return;
ScCore->setSplashStatus( QObject::tr("Reading Font Cache") );
QTextStream ts(&f);
- ts.setCodec("UTF-8");
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int errorLine = 0, errorColumn = 0;
if ( !docu.setContent(ts.readAll(), &errorMsg, &errorLine, &errorColumn) )
@@ -1289,7 +1289,7 @@
if (!file.open(QIODevice::WriteOnly))
return;
QTextStream s(&file);
- s.setCodec("UTF-8");
+ s.setEncoding(QStringConverter::Utf8);
s << docu.toString();
file.close();
}
Modified: trunk/Scribus/scribus/scimagecacheproxy.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scimagecacheproxy.cpp
==============================================================================
--- trunk/Scribus/scribus/scimagecacheproxy.cpp (original)
+++ trunk/Scribus/scribus/scimagecacheproxy.cpp Sat Jan 29 20:52:40 2022
@@ -141,7 +141,7 @@
{
QXmlStreamAttributes attr = xml.attributes();
- if (xml.name() == "cache")
+ if (xml.name() == QLatin1String("cache"))
{
if (attr.hasAttribute("base"))
{
@@ -151,7 +151,7 @@
baseFound = true;
}
}
- else if (xml.name() == "metadata")
+ else if (xml.name() == QLatin1String("metadata"))
{
if (meta)
{
@@ -163,7 +163,7 @@
metaFound = true;
}
- else if (xml.name() == "modifier")
+ else if (xml.name() == QLatin1String("modifier"))
{
if (mod)
{
@@ -175,7 +175,7 @@
modFound = true;
}
- else if (xml.name() == "imginfo")
+ else if (xml.name() == QLatin1String("imginfo"))
{
if (info)
{
@@ -602,7 +602,7 @@
{
QXmlStreamAttributes attr = xml.attributes();
- if (xml.name() == "reference")
+ if (xml.name() == QLatin1String("reference"))
if (attr.hasAttribute("count"))
refcount = attr.value("count").toString().toInt(&refcountFound);
}
Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Sat Jan 29 20:52:40 2022
@@ -584,7 +584,7 @@
{
qStopColor = colorStops[ offset ]->color;
double a = colorStops[offset]->opacity;
- double r, g, b;
+ float r, g, b;
qStopColor.getRgbF(&r, &g, &b);
if (m_maskMode == 3)
a = /* 1.0 - */(0.3 * r + 0.59 * g + 0.11 * b);
@@ -679,7 +679,7 @@
cairo_set_fill_rule (m_cr, CAIRO_FILL_RULE_WINDING);
if (m_fillMode == 1)
{
- double r, g, b;
+ float r, g, b;
m_fill.getRgbF(&r, &g, &b);
if (m_maskMode > 0)
{
@@ -720,7 +720,7 @@
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_tolerance(cr, 0.5);
- double r, g, b, a;
+ float r, g, b, a;
mpat = cairo_pattern_create_mesh();
cairo_mesh_pattern_begin_patch(mpat);
cairo_mesh_pattern_move_to(mpat, p1x, p1y);
@@ -763,7 +763,7 @@
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_tolerance(cr, 0.5);
- double r, g, b, a;
+ float r, g, b, a;
QList<VColorStop*> colorStops = fill_gradient.colorStops();
QList<QColor> qStopColors;
QList<double> qStopRampPoints;
@@ -939,7 +939,7 @@
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_tolerance(cr, 0.5);
- double r, g, b, a;
+ float r, g, b, a;
mpat = cairo_pattern_create_mesh();
for (int grow = 0; grow < meshGradientArray.count()-1; grow++)
{
@@ -986,7 +986,7 @@
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_tolerance(cr, 0.5);
- double r, g, b, a;
+ float r, g, b, a;
mpat = cairo_pattern_create_mesh();
for (int col = 0; col < meshGradientPatches.count(); col++)
{
@@ -1049,7 +1049,7 @@
continue;
isFirst = false;
double a = colorStops[offset]->opacity;
- double r, g, b;
+ float r, g, b;
colorStops[ offset ]->color.getRgbF(&r, &g, &b);
cairo_pattern_add_color_stop_rgba (pat, colorStops[ offset ]->rampPoint, r, g, b, a);
lastPoint = rampPoint;
@@ -1148,12 +1148,12 @@
cairo_push_group(m_cr);
if (m_hatchUseBackground && m_hatchBackground.isValid())
{
- double r2, g2, b2;
+ float r2, g2, b2;
m_hatchBackground.getRgbF(&r2, &g2, &b2);
cairo_set_source_rgb(m_cr, r2, g2, b2);
cairo_fill_preserve(m_cr);
}
- double r, g, b;
+ float r, g, b;
m_hatchForeground.getRgbF(&r, &g, &b);
cairo_clip_preserve (m_cr);
cairo_set_line_width(m_cr, 1);
@@ -1321,7 +1321,7 @@
continue;
isFirst = false;
double a = colorStops[offset]->opacity;
- double r, g, b;
+ float r, g, b;
colorStops[ offset ]->color.getRgbF(&r, &g, &b);
cairo_pattern_add_color_stop_rgba (pat, rampPoint, r, g, b, a);
lastPoint = rampPoint;
@@ -1356,7 +1356,7 @@
}
else
{
- double r, g, b;
+ float r, g, b;
m_stroke.getRgbF(&r, &g, &b);
cairo_set_source_rgba(m_cr, r, g, b, m_stroke_trans);
setRasterOp(m_blendModeStroke);
@@ -1608,7 +1608,7 @@
double y = area.y();
double ww = 0;
double hh = 0;
- double r, g, b;
+ float r, g, b;
assert(!m_font.isNone());
Modified: trunk/Scribus/scribus/scpainterex_cairo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scpainterex_cairo.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainterex_cairo.cpp (original)
+++ trunk/Scribus/scribus/scpainterex_cairo.cpp Sat Jan 29 20:52:40 2022
@@ -452,7 +452,7 @@
cairo_set_fill_rule (m_cr, CAIRO_FILL_RULE_WINDING);
if (m_fillMode == ScPainterExBase::Solid)
{
- double r, g, b;
+ float r, g, b;
QColor fillColor = transformColor(m_fillColor, 1.0);
fillColor.getRgbF(&r, &g, &b);
if (m_maskMode > 0)
@@ -517,7 +517,7 @@
}
else
{
- double r, g, b;
+ float r, g, b;
QColor strokeColor = transformColor(m_strokeColor, 1.0);
strokeColor.getRgbF(&r, &g, &b);
cairo_set_source_rgba(m_cr, r, g, b, m_strokeTrans);
@@ -651,7 +651,7 @@
void ScPainterEx_Cairo::drawLinearGradient(VGradientEx& gradient, const QRect& rect)
{
int index = 0;
- double r, g, b;
+ float r, g, b;
QList<VColorStopEx*> colorStops = gradient.colorStops();
VColorStopEx* stop = nullptr;
QColor color;
@@ -701,7 +701,7 @@
void ScPainterEx_Cairo::drawCircularGradient(VGradientEx& gradient, const QRect& rect)
{
int offset = 0;
- double r, g, b;
+ float r, g, b;
QList<VColorStopEx*> colorStops = gradient.colorStops();
VColorStopEx* stop = nullptr;
QColor color;
@@ -770,7 +770,7 @@
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_tolerance(cr, 0.5);
- double r, g, b, a;
+ float r, g, b, a;
mpat = cairo_pattern_create_mesh();
cairo_mesh_pattern_begin_patch(mpat);
cairo_mesh_pattern_move_to(mpat, p1x, p1y);
@@ -848,7 +848,7 @@
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_tolerance(cr, 0.5);
- double r, g, b, a;
+ float r, g, b, a;
QList<VColorStopEx*> colorStops = gradient.colorStops();
QList<QColor> qStopColors;
QList<double> qStopRampPoints;
@@ -1066,7 +1066,7 @@
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_tolerance(cr, 0.5);
- double r, g, b, a;
+ float r, g, b, a;
mpat = cairo_pattern_create_mesh();
for (int grow = 0; grow < m_meshGradientArray.count()-1; grow++)
{
@@ -1144,7 +1144,7 @@
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_tolerance(cr, 0.5);
- double r, g, b, a;
+ float r, g, b, a;
mpat = cairo_pattern_create_mesh();
for (int col = 0; col < m_meshGradientPatches.count(); col++)
{
@@ -1217,7 +1217,8 @@
void ScPainterEx_Cairo::strokeLinearGradient(VGradientEx& gradient)
{
cairo_pattern_t *pat = nullptr;
- double r, g, b, lastPoint = 0.0;
+ float r, g, b;
+ double lastPoint = 0.0;
double x1 = gradient.origin().x();
double y1 = gradient.origin().y();
double x2 = gradient.vector().x();
@@ -1269,7 +1270,8 @@
void ScPainterEx_Cairo::strokeCircularGradient(VGradientEx& gradient)
{
cairo_pattern_t *pat = nullptr;
- double r, g, b, lastPoint = 0.0;
+ float r, g, b;
+ double lastPoint = 0.0;
double x1 = gradient.origin().x();
double y1 = gradient.origin().y();
double x2 = gradient.vector().x();
Modified: trunk/Scribus/scribus/scribusXml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scribusXml.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusXml.cpp (original)
+++ trunk/Scribus/scribus/scribusXml.cpp Sat Jan 29 20:52:40 2022
@@ -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 == QLatin1String("SCRIBUSELEM")) || (tName == QLatin1String("SCRIBUSELEMUTF8")))
{
QXmlStreamAttributes attrs = sReader.attributes();;
QString attx = attrs.value("XP").toString();
Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp (original)
+++ trunk/Scribus/scribus/scribusapp.cpp Sat Jan 29 20:52:40 2022
@@ -282,7 +282,7 @@
}
else
{ //argument is not a known option, but either positional parameter or invalid.
- if (arg.at(0) == "-")
+ if (arg.at(0) == '-')
{
std::cout << tr("Invalid argument: %1").arg(arg).toLocal8Bit().data() << std::endl;
std::exit(EXIT_FAILURE);
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Jan 29 20:52:40 2022
@@ -38,8 +38,9 @@
#include <QPointer>
#include <QProgressBar>
#include <QRandomGenerator>
-#include <QRegExp>
+#include <QRegularExpression>
#include <QScopedValueRollback>
+#include <QStringList>
#include <QtAlgorithms>
#include <QTime>
#include <QTransform>
@@ -4239,7 +4240,7 @@
int stop = it->isTextFrame() ? it->lastInFrame() + 1 : it->itemText.length();
for (int e = start; e < stop; ++e)
{
- uint chr = it->itemText.text(e).unicode();
+ QChar chr = it->itemText.text(e);
if ((chr == SpecialChars::PAGENUMBER) || (chr == SpecialChars::PAGECOUNT))
{
hasPageNumbers = true;
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sat Jan 29 20:52:40 2022
@@ -513,7 +513,7 @@
updateCanvas();
}
-void ScribusView::enterEvent(QEvent * e)
+void ScribusView::enterEvent(QEnterEvent* e)
{
m_canvasMode->enterEvent(e);
}
Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Sat Jan 29 20:52:40 2022
@@ -336,7 +336,7 @@
bool handleObjectImport(QMimeData* mimeData, TransactionSettings* trSettings = nullptr);
protected: // Protected methods
- void enterEvent(QEvent *) override;
+ void enterEvent(QEnterEvent *) override;
void leaveEvent(QEvent *) override;
void resizeEvent(QResizeEvent *event) override;
bool eventFilter(QObject *obj, QEvent *event) override;
Modified: trunk/Scribus/scribus/scslainforeader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scslainforeader.cpp
==============================================================================
--- trunk/Scribus/scribus/scslainforeader.cpp (original)
+++ trunk/Scribus/scribus/scslainforeader.cpp Sat Jan 29 20:52:40 2022
@@ -58,10 +58,10 @@
if (ttype == QXmlStreamReader::StartElement)
{
- QStringRef nodeName = reader.name();
+ QStringView nodeName = reader.name();
if (firstStartElement)
{
- if (nodeName == "SCRIBUS" || nodeName == "SCRIBUSUTF8" || nodeName == "SCRIBUSUTF8NEW")
+ if (nodeName == QLatin1String("SCRIBUS") || nodeName == QLatin1String("SCRIBUSUTF8") || nodeName == QLatin1String("SCRIBUSUTF8NEW"))
{
QXmlStreamAttributes attrs = reader.attributes();
m_format = attrs.value(QLatin1String("Version")).toString();
@@ -73,7 +73,7 @@
break;
}
}
- else if (nodeName == "DOCUMENT")
+ else if (nodeName == QLatin1String("DOCUMENT"))
{
QXmlStreamAttributes attrs = reader.attributes();
m_title = attrs.value(QLatin1String("TITLE")).toString();
Modified: trunk/Scribus/scribus/scxmlstreamreader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/scxmlstreamreader.cpp
==============================================================================
--- trunk/Scribus/scribus/scxmlstreamreader.cpp (original)
+++ trunk/Scribus/scribus/scxmlstreamreader.cpp Sat Jan 29 20:52:40 2022
@@ -23,7 +23,7 @@
bool ScXmlStreamAttributes::valueAsBool (const char* attrName, bool def) const
{
bool retValue = def;
- QStringRef att = value(QLatin1String(attrName));
+ QStringView att = value(QLatin1String(attrName));
if (!att.isEmpty())
{
bool success = false;
@@ -38,7 +38,7 @@
bool ScXmlStreamAttributes::valueAsBool (const QString& attrName, bool def) const
{
bool retValue = def;
- QStringRef att = value(attrName);
+ QStringView att = value(attrName);
if (!att.isEmpty())
{
bool success = false;
@@ -53,7 +53,7 @@
int ScXmlStreamAttributes::valueAsInt (const char* attrName, int def) const
{
int retValue = def;
- QStringRef att = value(QLatin1String(attrName));
+ QStringView att = value(QLatin1String(attrName));
if (!att.isEmpty())
{
bool success = false;
@@ -68,7 +68,7 @@
int ScXmlStreamAttributes::valueAsInt (const QString& attrName, int def) const
{
int retValue = def;
- QStringRef att = value(attrName);
+ QStringView att = value(attrName);
if (!att.isEmpty())
{
bool success = false;
@@ -95,7 +95,7 @@
uint ScXmlStreamAttributes::valueAsUInt (const char* attrName, uint def) const
{
uint retValue = def;
- QStringRef att = value(QLatin1String(attrName));
+ QStringView att = value(QLatin1String(attrName));
if (!att.isEmpty())
{
bool success = false;
@@ -110,7 +110,7 @@
uint ScXmlStreamAttributes::valueAsUInt (const QString& attrName, uint def) const
{
uint retValue = def;
- QStringRef att = value(attrName);
+ QStringView att = value(attrName);
if (!att.isEmpty())
{
bool success = false;
@@ -125,7 +125,7 @@
double ScXmlStreamAttributes::valueAsDouble (const char* attrName, double def) const
{
double retValue = def;
- QStringRef att = value(QLatin1String(attrName));
+ QStringView att = value(QLatin1String(attrName));
if (!att.isEmpty())
{
QString strVal = QString::fromRawData(att.constData(), att.length());
@@ -137,7 +137,7 @@
double ScXmlStreamAttributes::valueAsDouble (const QString& attrName, double def) const
{
double retValue = def;
- QStringRef att = value(attrName);
+ QStringView att = value(attrName);
if (!att.isEmpty())
{
QString strVal = QString::fromRawData(att.constData(), att.length());
@@ -149,7 +149,7 @@
QString ScXmlStreamAttributes::valueAsString (const char* attrName, const QString& def) const
{
QString retValue = def;
- QStringRef att = value(QLatin1String(attrName));
+ QStringView att = value(QLatin1String(attrName));
if (!att.isEmpty() || hasAttribute(attrName))
retValue = att.toString();
return retValue;
@@ -158,7 +158,7 @@
QString ScXmlStreamAttributes::valueAsString (const QString& attrName, const QString& def) const
{
QString retValue = def;
- QStringRef att = value(attrName);
+ QStringView att = value(attrName);
if (!att.isEmpty() || hasAttribute(attrName))
retValue = att.toString();
return retValue;
@@ -175,7 +175,7 @@
if (!isStartElement())
return;
int count = 1;
- QStringRef tagName = name();
+ QStringView tagName = name();
while (!atEnd() && !hasError())
{
readNext();
Modified: trunk/Scribus/scribus/third_party/fparser/fpoptimizer.cc
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/third_party/fparser/fpoptimizer.cc
==============================================================================
--- trunk/Scribus/scribus/third_party/fparser/fpoptimizer.cc (original)
+++ trunk/Scribus/scribus/third_party/fparser/fpoptimizer.cc Sat Jan 29 20:52:40 2022
@@ -5637,7 +5637,7 @@
#define FP_MUL_COMBINE_EXPONENTS
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && (_MSC_VER < 1920)
#include <float.h>
#define isinf(x) (!_finite(x))
#endif
Modified: trunk/Scribus/scribus/ui/about.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/about.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/about.cpp (original)
+++ trunk/Scribus/scribus/ui/about.cpp Sat Jan 29 20:52:40 2022
@@ -216,7 +216,7 @@
{
QTextStream inTS(&licenceFile);
inTS.setAutoDetectUnicode(true);
- inTS.setCodec("UTF-8");
+ inTS.setEncoding(QStringConverter::Utf8);
QString licenceText = inTS.readAll();
textViewLicence->setPlainText(licenceText);
}
@@ -349,7 +349,7 @@
if (authorsFile.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream inTS(&authorsFile);
- inTS.setCodec("UTF-8");
+ inTS.setEncoding(QStringConverter::Utf8);
inTS.setAutoDetectUnicode(true);
QString lineTS;
QStringList fieldTS;
@@ -437,7 +437,7 @@
if (translationFile.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream inTS(&translationFile);
- inTS.setCodec("UTF-8");
+ inTS.setEncoding(QStringConverter::Utf8);
inTS.setAutoDetectUnicode(true);
QString lineTS;
QStringList fieldTS;
@@ -548,7 +548,7 @@
{
result += l.value();
- QMapIterator<QString, QString> n(names);
+ QMultiMapIterator<QString, QString> n(names);
while (n.hasNext())
{
n.next();
@@ -593,7 +593,7 @@
if (linksFile.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream inTS(&linksFile);
- inTS.setCodec("UTF-8");
+ inTS.setEncoding(QStringConverter::Utf8);
inTS.setAutoDetectUnicode(true);
QString lineTS;
bool isTitle = true;
Modified: trunk/Scribus/scribus/ui/annot.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/annot.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annot.cpp (original)
+++ trunk/Scribus/scribus/ui/annot.cpp Sat Jan 29 20:52:40 2022
@@ -773,7 +773,7 @@
if (pfol.count() > 1)
{
tm2 = pfol[0].simplified();
- tm += tm2.midRef(1, tm2.length()-2);
+ tm += tm2.mid(1, tm2.length() - 2);
for (int cfx = 1; cfx < pfol.count(); ++cfx)
{
tm2 = pfol[cfx].simplified();
@@ -782,7 +782,7 @@
}
CalcFields->setText(tm);
ss = pfor.indexOf("(");
- pfo = pfor.mid(ss+1, pfor.length()-ss-3);
+ pfo = pfor.mid(ss + 1, pfor.length() - ss - 3);
pfol = pfo.split(",", Qt::SkipEmptyParts);
/* PFJ - 28/02/04 - Let's get rid of lots of ifs.... */
QString pf[] = {"\"SUM\"", "\"PRD\"", "\"AVG\"", "\"MIN\"", "\"MAX\""};
Modified: trunk/Scribus/scribus/ui/colorsandfills.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/colorsandfills.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorsandfills.cpp (original)
+++ trunk/Scribus/scribus/ui/colorsandfills.cpp Sat Jan 29 20:52:40 2022
@@ -1771,7 +1771,7 @@
return;
QDomDocument docu("scridoc");
QTextStream ts(&f);
- ts.setCodec("UTF-8");
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int errorLine = 0, errorColumn = 0;
if (!docu.setContent(ts.readAll(), &errorMsg, &errorLine, &errorColumn) )
Modified: trunk/Scribus/scribus/ui/dasheditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/dasheditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/dasheditor.cpp (original)
+++ trunk/Scribus/scribus/ui/dasheditor.cpp Sat Jan 29 20:52:40 2022
@@ -266,7 +266,7 @@
m_outside = true;
}
-void DashPreview::enterEvent(QEvent*)
+void DashPreview::enterEvent(QEnterEvent*)
{
m_outside = false;
}
Modified: trunk/Scribus/scribus/ui/dasheditor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/dasheditor.h
==============================================================================
--- trunk/Scribus/scribus/ui/dasheditor.h (original)
+++ trunk/Scribus/scribus/ui/dasheditor.h Sat Jan 29 20:52:40 2022
@@ -53,7 +53,7 @@
void mouseReleaseEvent(QMouseEvent *) override;
void mouseMoveEvent(QMouseEvent *m) override;
void leaveEvent(QEvent*) override;
- void enterEvent(QEvent*) override;
+ void enterEvent(QEnterEvent*) override;
const QVector<double>& dashValues() const { return m_dashValues; }
void setDashValues(const QVector<double>& vals);
Modified: trunk/Scribus/scribus/ui/helpbrowser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/helpbrowser.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/helpbrowser.cpp (original)
+++ trunk/Scribus/scribus/ui/helpbrowser.cpp Sat Jan 29 20:52:40 2022
@@ -50,6 +50,7 @@
#include <QProcess>
#include <QPushButton>
#include <QString>
+#include <QStringView>
#include <QStandardItem>
#include <QTextEdit>
#include <QTreeView>
@@ -81,7 +82,7 @@
QXmlStreamReader sReader(&qFile);
QXmlStreamReader::TokenType tagType;
- QStringRef tagName;
+ QStringView tagName;
while (!sReader.atEnd() && !sReader.hasError())
{
@@ -90,7 +91,7 @@
continue;
tagName = sReader.name();
- if (tagName != "item")
+ if (tagName != QLatin1String("item"))
continue;
struct histd2 his;
@@ -126,7 +127,7 @@
QXmlStreamReader sReader(&qFile);
QXmlStreamReader::TokenType tagType;
- QStringRef tagName;
+ QStringView tagName;
while (!sReader.atEnd() && !sReader.hasError())
{
@@ -135,7 +136,7 @@
continue;
tagName = sReader.name();
- if (tagName != "item")
+ if (tagName != QLatin1String("item"))
continue;
QXmlStreamAttributes attrs = sReader.attributes();
@@ -210,7 +211,7 @@
if (bookFile.open(QIODevice::WriteOnly))
{
QTextStream stream(&bookFile);
- stream.setCodec("UTF-8");
+ stream.setEncoding(QStringConverter::Utf8);
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
stream << "<bookmarks>\n";
QTreeWidgetItemIterator it(helpNav->bookmarksView);
@@ -232,7 +233,7 @@
if (histFile.open(QIODevice::WriteOnly))
{
QTextStream stream(&histFile);
- stream.setCodec("UTF-8");
+ stream.setEncoding(QStringConverter::Utf8);
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
stream << "<history>\n";
for (auto it = m_history.cbegin() ; it != m_history.cend(); ++it)
Modified: trunk/Scribus/scribus/ui/latexeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/latexeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/latexeditor.cpp (original)
+++ trunk/Scribus/scribus/ui/latexeditor.cpp Sat Jan 29 20:52:40 2022
@@ -847,7 +847,7 @@
return new XmlFontComboBox(xml);
if (tagname == QStringView(u"spinbox"))
{
- if (xml->attributes().value("type") == "double")
+ if (xml->attributes().value("type") == QStringView(u"double"))
return new XmlDoubleSpinBox(xml);
return new XmlSpinBox(xml);
}
@@ -855,7 +855,7 @@
return new XmlColorPicker(xml);
if (tagname == QStringView(u"text"))
{
- if (xml->attributes().value("type") == "long")
+ if (xml->attributes().value("type") == QStringView(u"long"))
return new XmlTextEdit(xml);
return new XmlLineEdit(xml);
}
Modified: trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_widgets.cpp (original)
+++ trunk/Scribus/scribus/ui/pagepalette_widgets.cpp Sat Jan 29 20:52:40 2022
@@ -17,6 +17,7 @@
#include <QMimeData>
#include <QMessageBox>
#include <QPainter>
+#include <QStringView>
#include "commonstrings.h"
#include "iconmanager.h"
@@ -260,8 +261,8 @@
{
int st = str.indexOf(" ");
int en = str.indexOf(" ", st + 1);
- tmp = str.mid(en+1);
- int dr = str.midRef(st, en-st).toInt();
+ tmp = str.mid(en + 1);
+ int dr = QStringView(str).sliced(st, en - st).toInt();
int a = rowAt(e->pos().y());
int b = columnAt(e->pos().x());
if ((a == -1) || (b == -1))
@@ -491,8 +492,8 @@
if (str.startsWith("2"))
{
int st = str.indexOf(" ");
- int en = str.indexOf(" ", st+1);
- emit delPageRequest(str.midRef(st, en - st).toInt());
+ int en = str.indexOf(" ", st + 1);
+ emit delPageRequest(QStringView(str).sliced(st, en - st).toInt());
}
if (str.startsWith("1"))
{
Modified: trunk/Scribus/scribus/ui/picstatus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/picstatus.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/picstatus.cpp (original)
+++ trunk/Scribus/scribus/ui/picstatus.cpp Sat Jan 29 20:52:40 2022
@@ -230,7 +230,7 @@
void PicStatus::sortByPage()
{
- QMap<int, PicItem*> sorted;
+ QMultiMap<int, PicItem*> sorted;
int num = imageViewArea->count();
if (num == 0)
@@ -241,7 +241,7 @@
{
QListWidgetItem *ite = imageViewArea->takeItem(a);
PicItem *item = (PicItem*)ite;
- sorted.insertMulti(item->PageItemObject->OwnPage, item);
+ sorted.insert(item->PageItemObject->OwnPage, item);
}
int counter = 0;
foreach (int i, sorted.uniqueKeys())
Modified: trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp Sat Jan 29 20:52:40 2022
@@ -155,7 +155,7 @@
if ( !file1.open( QIODevice::ReadOnly ) )
return;
QTextStream ts(&file1);
- ts.setCodec("UTF-8");
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int eline;
int ecol;
Modified: trunk/Scribus/scribus/ui/prefs_spelling.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/prefs_spelling.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_spelling.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_spelling.cpp Sat Jan 29 20:52:40 2022
@@ -187,7 +187,7 @@
if (!dataFile.open(QIODevice::ReadOnly))
return;
QTextStream ts(&dataFile);
- ts.setCodec(QTextCodec::codecForName("UTF-8"));
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int eline;
int ecol;
Modified: trunk/Scribus/scribus/ui/printpreview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/printpreview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/printpreview.cpp (original)
+++ trunk/Scribus/scribus/ui/printpreview.cpp Sat Jan 29 20:52:40 2022
@@ -26,7 +26,6 @@
#include <QColor>
#include <QComboBox>
#include <QCursor>
-#include <QDesktopWidget>
#include <QFile>
#include <QGroupBox>
#include <QHBoxLayout>
@@ -403,7 +402,7 @@
}
if (m_ui->enableCMYK->isChecked())
m_previewLabel->setPixmap(createPreview(m_currentPage, qRound(72 * m_scaleFactor)));
- m_previewLabel->resize(m_previewLabel->pixmap()->size());
+ m_previewLabel->resize(m_previewLabel->pixmap().size());
}
void PrintPreview::onInkTableCellDoubleClicked(int row)
@@ -417,7 +416,7 @@
if (m_ui->enableCMYK->isChecked())
m_previewLabel->setPixmap(createPreview(m_currentPage, qRound(72 * m_scaleFactor)));
- m_previewLabel->resize(m_previewLabel->pixmap()->size());
+ m_previewLabel->resize(m_previewLabel->pixmap().size());
}
void PrintPreview::onPrintLanguageChange(int /*langIndex*/)
@@ -470,7 +469,7 @@
if (m_ui->enableCMYK->isChecked())
m_previewLabel->setPixmap(createPreview(m_currentPage, qRound(72 * m_scaleFactor)));
- m_previewLabel->resize(m_previewLabel->pixmap()->size());
+ m_previewLabel->resize(m_previewLabel->pixmap().size());
}
void PrintPreview::scaleBox_valueChanged(int value)
Modified: trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_utils.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_utils.cpp Sat Jan 29 20:52:40 2022
@@ -98,8 +98,8 @@
NameWidget::NameWidget(QWidget* parent) : QLineEdit(parent)
{
setObjectName("namewidget");
- QRegExp rx( "[\\w()]+" );
- QValidator* validator = new QRegExpValidator( rx, this );
+ QRegularExpression rx( "[\\w()]+" );
+ QValidator* validator = new QRegularExpressionValidator( rx, this );
setValidator( validator );
}
Modified: trunk/Scribus/scribus/ui/resourcemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/resourcemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/resourcemanager.cpp (original)
+++ trunk/Scribus/scribus/ui/resourcemanager.cpp Sat Jan 29 20:52:40 2022
@@ -117,7 +117,7 @@
return;
QTextStream ts(&dataFile);
- ts.setCodec(QTextCodec::codecForName("UTF-8"));
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int eline;
int ecol;
@@ -175,7 +175,7 @@
return;
QTextStream ts(&dataFile);
- ts.setCodec(QTextCodec::codecForName("UTF-8"));
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int eline;
int ecol;
@@ -231,7 +231,7 @@
return;
QTextStream ts(&dataFile);
- ts.setCodec(QTextCodec::codecForName("UTF-8"));
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int eline;
int ecol;
@@ -566,7 +566,7 @@
return;
QTextStream ts(&dataFile);
- ts.setCodec(QTextCodec::codecForName("UTF-8"));
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int eline;
int ecol;
@@ -666,7 +666,7 @@
return;
QTextStream ts(&dataFile);
- ts.setCodec(QTextCodec::codecForName("UTF-8"));
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int eline;
int ecol;
Modified: trunk/Scribus/scribus/ui/scrapbookpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/ui/scrapbookpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrapbookpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/scrapbookpalette.cpp Sat Jan 29 20:52:40 2022
@@ -30,6 +30,7 @@
#include <QSet>
#include <QSignalMapper>
#include <QSpacerItem>
+#include <QStringView>
#include <QToolBox>
#include <QToolButton>
#include <QToolTip>
@@ -138,7 +139,7 @@
if (e->source() == this)
return;
QString text = e->mimeData()->text();
- int startElemPos = text.leftRef(512).indexOf("<SCRIBUSELEM");
+ int startElemPos = QStringView(text).first(512).indexOf(QStringView(u"<SCRIBUSELEM"));
if (startElemPos >= 0)
emit objDropped(text);
}
Modified: trunk/Scribus/scribus/upgradechecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/upgradechecker.cpp
==============================================================================
--- trunk/Scribus/scribus/upgradechecker.cpp (original)
+++ trunk/Scribus/scribus/upgradechecker.cpp Sat Jan 29 20:52:40 2022
@@ -120,7 +120,7 @@
if (!m_file)
return false;
QTextStream ts(m_file);
- ts.setCodec(QTextCodec::codecForName("UTF-8"));
+ ts.setEncoding(QStringConverter::Utf8);
QString errorMsg;
int eline;
int ecol;
Modified: trunk/Scribus/scribus/util.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/util.cpp
==============================================================================
--- trunk/Scribus/scribus/util.cpp (original)
+++ trunk/Scribus/scribus/util.cpp Sat Jan 29 20:52:40 2022
@@ -31,6 +31,7 @@
#include <QMessageBox>
#include <QProcess>
#include <QSignalBlocker>
+#include <QStringView>
#include "pageitem.h"
#include "pageitem_table.h"
@@ -762,8 +763,8 @@
}
else if (token.indexOf("-") != -1) // import a range of source doc pages
{
- int from = QStringRef(token.leftRef(token.indexOf("-"))).toInt();
- int to = QStringRef(token.rightRef(token.length() - token.indexOf("-") - 1)).toInt();
+ int from = QStringView(token).first(token.indexOf("-")).toInt();
+ int to = QStringView(token).last(token.length() - token.indexOf("-") - 1).toInt();
if ((from != 0) && (to != 0))
{
if (from > sourcePageCount)
Modified: trunk/Scribus/scribus/util_printer.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24834&path=/trunk/Scribus/scribus/util_printer.h
==============================================================================
--- trunk/Scribus/scribus/util_printer.h (original)
+++ trunk/Scribus/scribus/util_printer.h Sat Jan 29 20:52:40 2022
@@ -12,11 +12,10 @@
#include <QMap>
#include <QMarginsF>
#include <QSizeF>
+#include <QStringList>
#include "scribusapi.h"
#include "scribusstructs.h"
-
-class QStringList;
class SCRIBUS_API PrinterUtil
{
More information about the scribus-commit
mailing list