r24967 by craig - Qt6: Remove many unnecessary QRegExp includes. Clean up some use of

scribus-commit scribus-commit at lists.scribus.net
Wed Feb 23 20:31:49 UTC 2022


Author: craig
Date: Wed Feb 23 20:31:49 2022
New Revision: 24967

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24967
Log:
Qt6: Remove many unnecessary QRegExp includes. Clean up some use of
QRegExp. Make the 1.5.0 file loader also load 1.7.0 files for now.

Modified:
    trunk/Scribus/scribus/fileloader.cpp
    trunk/Scribus/scribus/filesearch.cpp
    trunk/Scribus/scribus/fonts/scfontmetrics.cpp
    trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pict.cpp
    trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
    trunk/Scribus/scribus/latexhelpers.h
    trunk/Scribus/scribus/loadsaveplugin.h
    trunk/Scribus/scribus/old/mspinbox.cpp
    trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp
    trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/import/ai/importai.cpp
    trunk/Scribus/scribus/plugins/import/cdr/importcdr.cpp
    trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
    trunk/Scribus/scribus/plugins/import/cvg/importcvg.cpp
    trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
    trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
    trunk/Scribus/scribus/plugins/import/fh/importfh.cpp
    trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
    trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
    trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
    trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
    trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
    trunk/Scribus/scribus/plugins/import/pm/importpm.cpp
    trunk/Scribus/scribus/plugins/import/ps/importps.cpp
    trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
    trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
    trunk/Scribus/scribus/plugins/import/shape/importshape.cpp
    trunk/Scribus/scribus/plugins/import/sml/importsml.cpp
    trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
    trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
    trunk/Scribus/scribus/plugins/import/uniconvertor/uniconvplugin.cpp
    trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
    trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp
    trunk/Scribus/scribus/plugins/import/wmf/wmfimport.cpp
    trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
    trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
    trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
    trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
    trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
    trunk/Scribus/scribus/plugins/import/zmf/importzmf.cpp
    trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
    trunk/Scribus/scribus/scfonts.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusXml.cpp
    trunk/Scribus/scribus/scribus_pch.h
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/storyloader.cpp
    trunk/Scribus/scribus/styles/styleset.h
    trunk/Scribus/scribus/ui/javadocs.cpp
    trunk/Scribus/scribus/ui/pagepalette_pages.cpp
    trunk/Scribus/scribus/ui/pageselector.cpp
    trunk/Scribus/scribus/ui/propertiespalette_group.cpp
    trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
    trunk/Scribus/scribus/ui/query.cpp
    trunk/Scribus/scribus/ui/smlinestyle.cpp

Modified: trunk/Scribus/scribus/fileloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/fileloader.cpp
==============================================================================
--- trunk/Scribus/scribus/fileloader.cpp	(original)
+++ trunk/Scribus/scribus/fileloader.cpp	Wed Feb 23 20:31:49 2022
@@ -9,7 +9,6 @@
 #include <QFileInfo>
 #include <QtAlgorithms>
 #include <QCursor>
-#include <QRegExp>
 #include <QDir>
 #include <QTextCodec>
 #include <QCheckBox>

Modified: trunk/Scribus/scribus/filesearch.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/filesearch.cpp
==============================================================================
--- trunk/Scribus/scribus/filesearch.cpp	(original)
+++ trunk/Scribus/scribus/filesearch.cpp	Wed Feb 23 20:31:49 2022
@@ -6,7 +6,7 @@
 */
 #include "filesearch.h"
 #include <QTimer>
-#include <QRegExp>
+#include <QRegularExpression>
 
 
 enum FileSearchStatus
@@ -157,11 +157,12 @@
 	else
 	{
 		// unix only, resp. no meaning in windows
-		QRegExp r(m_fileName, Qt::CaseInsensitive, QRegExp::Wildcard);
+		QRegularExpression r(m_fileName, QRegularExpression::CaseInsensitiveOption);
 		while (it.hasNext())
 		{
 			fi = it.next();
-			if (r.exactMatch(fi.fileName()))
+			QRegularExpressionMatch match = r.match(fi.fileName());
+			if (match.hasMatch())
 				m_matchingFiles.push_back(fi.absoluteFilePath());
 		}
 // Qt4

Modified: trunk/Scribus/scribus/fonts/scfontmetrics.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/fonts/scfontmetrics.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scfontmetrics.cpp	(original)
+++ trunk/Scribus/scribus/fonts/scfontmetrics.cpp	Wed Feb 23 20:31:49 2022
@@ -9,7 +9,6 @@
 #include <QMap>
 #include <QPainter>
 #include <QPixmap>
-#include <QRegExp>
 #include <QStringList>
 #include <QTransform>
 

Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pict.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pict.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pict.cpp	(original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pict.cpp	Wed Feb 23 20:31:49 2022
@@ -11,7 +11,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QTextCodec>
 #include <QStack>
 #include <QDebug>

Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp	(original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp	Wed Feb 23 20:31:49 2022
@@ -9,7 +9,6 @@
 #include <QDebug>
 #include <QFile>
 #include <QFileInfo>
-#include <QRegExp>
 #include <QStringView>
 
 #include "cmsettings.h"

Modified: trunk/Scribus/scribus/latexhelpers.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/latexhelpers.h
==============================================================================
--- trunk/Scribus/scribus/latexhelpers.h	(original)
+++ trunk/Scribus/scribus/latexhelpers.h	Wed Feb 23 20:31:49 2022
@@ -27,7 +27,6 @@
 #include <QPointer>
 #include <QRegularExpression>
 #include <QString>
-#include <QStringRef>
 #include <QStringView>
 #include <QSyntaxHighlighter>
 #include <QXmlStreamReader>

Modified: trunk/Scribus/scribus/loadsaveplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/loadsaveplugin.h
==============================================================================
--- trunk/Scribus/scribus/loadsaveplugin.h	(original)
+++ trunk/Scribus/scribus/loadsaveplugin.h	Wed Feb 23 20:31:49 2022
@@ -10,7 +10,6 @@
 #include "scplugin.h"
 
 #include <QString>
-#include <QRegExp>
 #include <QIODevice>
 #include <QProgressBar>
 #include <QStringList>
@@ -250,8 +249,6 @@
 		// A filter in the format used by QFileDialog that should be used to
 		// select for this format.
 		QString filter;
-		// Regexp to match filenames for this format
-	//	QRegExp nameMatch;
 		// MIME type(s) that should be matched by this format.
 		QStringList mimeTypes;
 		// Extension list supported by format

Modified: trunk/Scribus/scribus/old/mspinbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/old/mspinbox.cpp
==============================================================================
--- trunk/Scribus/scribus/old/mspinbox.cpp	(original)
+++ trunk/Scribus/scribus/old/mspinbox.cpp	Wed Feb 23 20:31:49 2022
@@ -26,7 +26,6 @@
 #include <QApplication>
 #include <QLineEdit>
 #include <QRegExp>
-//Added by qt3to4:
 #include <QWheelEvent>
 #include <QKeyEvent>
 #include <QEvent>

Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp	(original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp	Wed Feb 23 20:31:49 2022
@@ -4,6 +4,8 @@
 a copyright and/or license notice that predates the release of Scribus 1.3.2
 for which a new license (GPL+exception) is in place.
 */
+
+#include <QRegularExpression>
 
 #include "barcode.h"
 #include "barcodegenerator.h"
@@ -58,9 +60,10 @@
 		QTextStream ts(&f);
 		QString bwipp = ts.read(150);
 		f.close();
-		QRegExp rx("\\n% Barcode Writer in Pure PostScript - Version ([\\d-]+)\\n");
-		if (rx.indexIn(bwipp) >= 0)
-			about->version = "Backend: " + rx.cap(1);
+		QRegularExpression rx("\\n% Barcode Writer in Pure PostScript - Version ([\\d-]+)\\n");
+		QRegularExpressionMatch match = rx.match(bwipp);
+		if (match.hasMatch())
+			about->version = "Backend: " + match.captured(1);
 		else
 			about->version = "Backend: Unknown";
 	}

Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	(original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	Wed Feb 23 20:31:49 2022
@@ -87,20 +87,21 @@
 
 		if (restype=="ENCODER")
 		{
-			QRegExp rxhead(
+			QRegularExpression rxhead(
 						"% --REQUIRES (.*)--[\\r\\n]+"
 						"% --DESC:(.*)[\\r\\n]+"
 						"% --EXAM:(.*)[\\r\\n]+"
 						"% --EXOP:(.*)[\\r\\n]+"
 						"% --RNDR:(.*)[\\r\\n]+"
 						);
-			if (rxhead.indexIn(reshead) >= 0)
+			QRegularExpressionMatch match = rxhead.match(reshead);
+			if (match.hasMatch())
 			{
-				resreqs[resname] = rxhead.cap(1).trimmed();
-				resdescs[resname] = rxhead.cap(2).trimmed();
-				resexams[resname] = rxhead.cap(3).trimmed();
-				resexops[resname] = rxhead.cap(4).trimmed();
-				resrndrs[resname] = rxhead.cap(5).trimmed();
+				resreqs[resname] = match.captured(1).trimmed();
+				resdescs[resname] = match.captured(2).trimmed();
+				resexams[resname] = match.captured(3).trimmed();
+				resexops[resname] = match.captured(4).trimmed();
+				resrndrs[resname] = match.captured(5).trimmed();
 				encoderlist.append(resname);
 			}
 		}

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	Wed Feb 23 20:31:49 2022
@@ -139,16 +139,14 @@
 		loadRawBytes(fileName, docBytes, 1024);
 	}
 
-	QRegExp regExp134("Version=\"1.3.[4-9]");
-	QRegExp regExp140("Version=\"1.4.[0-9]");
 	int startElemPos = docBytes.left(512).indexOf("<SCRIBUSUTF8NEW ");
-	if (startElemPos >= 0)
-	{
-		bool is134 = (regExp134.indexIn(docBytes.mid(startElemPos, 64)) >= 0);
-		bool is140 = (regExp140.indexIn(docBytes.mid(startElemPos, 64)) >= 0);
-		return (is134 || is140);
-	}
-	return false;
+	if (startElemPos < 0)
+		return false;
+	QRegularExpression regExp134("Version=\"1.3.[4-9]");
+	QRegularExpression regExp140("Version=\"1.4.[0-9]");
+	QRegularExpressionMatch match134 = regExp134.match(docBytes.mid(startElemPos, 64));
+	QRegularExpressionMatch match140 = regExp140.match(docBytes.mid(startElemPos, 64));
+	return match134.hasMatch() || match140.hasMatch();
 }
 
 QIODevice* Scribus134Format::slaReader(const QString & fileName)

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	Wed Feb 23 20:31:49 2022
@@ -146,14 +146,14 @@
 		loadRawBytes(fileName, docBytes, 1024);
 	}
 
-	QRegExp regExp150("Version=\"1.5.[0-9]");
 	int startElemPos = docBytes.left(512).indexOf("<SCRIBUSUTF8NEW ");
-	if (startElemPos >= 0)
-	{
-		bool is150 = (regExp150.indexIn(docBytes.mid(startElemPos, 64)) >= 0);
-		return is150;
-	}
-	return false;
+	if (startElemPos < 0)
+		return false;
+	QRegularExpression regExp150("Version=\"1.5.[0-9]");
+	QRegularExpression regExp170("Version=\"1.7.[0-9]");
+	QRegularExpressionMatch match150 = regExp150.match(docBytes.mid(startElemPos, 64));
+	QRegularExpressionMatch match170 = regExp170.match(docBytes.mid(startElemPos, 64));
+	return match150.hasMatch() | match170.hasMatch();
 }
 
 bool Scribus150Format::paletteSupported(QIODevice* /* file */, const QString & fileName) const
@@ -182,14 +182,12 @@
 
 bool Scribus150Format::storySupported(const QByteArray& storyData) const
 {
-	QRegExp regExp150("Version=\"1.5.[0-9]");
 	int startElemPos = storyData.left(512).indexOf("<ScribusStory ");
-	if (startElemPos >= 0)
-	{
-		bool is150 = (regExp150.indexIn(storyData.mid(startElemPos, 64)) >= 0);
-		return is150;
-	}
-	return false;
+	if (startElemPos < 0)
+		return false;
+	QRegularExpression regExp150("Version=\"1.5.[0-9]");
+	QRegularExpressionMatch match = regExp150.match(storyData.mid(startElemPos, 64));
+	return match.hasMatch();
 }
 
 QIODevice* Scribus150Format::slaReader(const QString & fileName)

Modified: trunk/Scribus/scribus/plugins/import/ai/importai.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importai.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/ai/importai.cpp	Wed Feb 23 20:31:49 2022
@@ -12,7 +12,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QScopedPointer>
 #include <QStack>
 #include <QStringView>

Modified: trunk/Scribus/scribus/plugins/import/cdr/importcdr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/cdr/importcdr.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cdr/importcdr.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/cdr/importcdr.cpp	Wed Feb 23 20:31:49 2022
@@ -12,7 +12,6 @@
 #include <QList>
 #include <QMessageBox>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp	Wed Feb 23 20:31:49 2022
@@ -18,7 +18,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/cvg/importcvg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/cvg/importcvg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cvg/importcvg.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/cvg/importcvg.cpp	Wed Feb 23 20:31:49 2022
@@ -11,7 +11,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp	Wed Feb 23 20:31:49 2022
@@ -18,7 +18,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/emf/importemf.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/emf/importemf.cpp	Wed Feb 23 20:31:49 2022
@@ -19,7 +19,6 @@
 #include <QList>
 #include <QMimeData>
 #include <QRawFont>
-#include <QRegExp>
 #include <QScopedPointer>
 #include <QTextCodec>
 #include <QUuid>

Modified: trunk/Scribus/scribus/plugins/import/fh/importfh.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/fh/importfh.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/fh/importfh.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/fh/importfh.cpp	Wed Feb 23 20:31:49 2022
@@ -12,7 +12,6 @@
 #include <QList>
 #include <QMessageBox>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/idml/importidml.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/idml/importidml.cpp	Wed Feb 23 20:31:49 2022
@@ -18,7 +18,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QScopedPointer>
 #include <QStack>
 #include <QUrl>

Modified: trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/odg/importodg.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/odg/importodg.cpp	Wed Feb 23 20:31:49 2022
@@ -18,7 +18,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QUrl>
 

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp	Wed Feb 23 20:31:49 2022
@@ -13,7 +13,6 @@
 #include <QMessageBox>
 #include <QMimeData>
 #include <QString>
-#include <QRegExp>
 #include <QWidget>
 
 #include "oodrawimp.h"

Modified: trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pages/importpages.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pages/importpages.cpp	Wed Feb 23 20:31:49 2022
@@ -20,7 +20,6 @@
 #include <QList>
 #include <QMessageBox>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 
@@ -418,7 +417,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QUrl>
 #include <QDebug>

Modified: trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pct/importpct.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pct/importpct.cpp	Wed Feb 23 20:31:49 2022
@@ -11,7 +11,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QTextCodec>
 #include <QStack>
 #include <QDebug>

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp	Wed Feb 23 20:31:49 2022
@@ -16,7 +16,6 @@
 #include <QInputDialog>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 
 #include <poppler/ErrorCodes.h>

Modified: trunk/Scribus/scribus/plugins/import/pm/importpm.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/pm/importpm.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pm/importpm.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pm/importpm.cpp	Wed Feb 23 20:31:49 2022
@@ -12,7 +12,6 @@
 #include <QList>
 #include <QMessageBox>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/ps/importps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/ps/importps.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ps/importps.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/ps/importps.cpp	Wed Feb 23 20:31:49 2022
@@ -13,14 +13,11 @@
 #include <QList>
 #include <QMessageBox>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 
 #include <cstdlib>
 
 #include "importps.h"
-
-
 #include "commonstrings.h"
 #include "loadsaveplugin.h"
 #include "prefscontext.h"

Modified: trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pub/importpub.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pub/importpub.cpp	Wed Feb 23 20:31:49 2022
@@ -12,7 +12,6 @@
 #include <QList>
 #include <QMessageBox>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QTextDocument>
 #include <QDebug>

Modified: trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp	Wed Feb 23 20:31:49 2022
@@ -11,7 +11,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QTextDocument>
 #include <QDebug>

Modified: trunk/Scribus/scribus/plugins/import/shape/importshape.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/shape/importshape.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/shape/importshape.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/shape/importshape.cpp	Wed Feb 23 20:31:49 2022
@@ -11,7 +11,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/sml/importsml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/sml/importsml.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/sml/importsml.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/sml/importsml.cpp	Wed Feb 23 20:31:49 2022
@@ -11,7 +11,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp	Wed Feb 23 20:31:49 2022
@@ -13,7 +13,6 @@
 #include <QMessageBox>
 #include <QMimeData>
 #include <QPainterPath>
-#include <QRegExp>
 #include <QStack>
 #include <QTemporaryFile>
 

Modified: trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp	Wed Feb 23 20:31:49 2022
@@ -18,7 +18,6 @@
 #include <QList>
 #include <QMimeData>
 #include <QRawFont>
-#include <QRegExp>
 #include <QTextCodec>
 #include <QUuid>
 #include <QDebug>

Modified: trunk/Scribus/scribus/plugins/import/uniconvertor/uniconvplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/uniconvertor/uniconvplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/uniconvertor/uniconvplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/uniconvertor/uniconvplugin.cpp	Wed Feb 23 20:31:49 2022
@@ -23,7 +23,6 @@
 #include <QList>
 #include <QMimeData>
 #include <QPainterPath>
-#include <QRegExp>
 #include <cmath>
 
 #include "commonstrings.h"

Modified: trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/viva/importviva.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/viva/importviva.cpp	Wed Feb 23 20:31:49 2022
@@ -17,7 +17,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QUrl>
 #include <QDebug>

Modified: trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/vsd/importvsd.cpp	Wed Feb 23 20:31:49 2022
@@ -12,7 +12,6 @@
 #include <QList>
 #include <QMessageBox>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QTextDocument>
 #include <QDebug>

Modified: trunk/Scribus/scribus/plugins/import/wmf/wmfimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/wmf/wmfimport.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/wmf/wmfimport.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/wmf/wmfimport.cpp	Wed Feb 23 20:31:49 2022
@@ -17,7 +17,6 @@
 #include <QFile>
 #include <QMimeData>
 #include <QPainterPath>
-#include <QRegExp>
 
 #include "commonstrings.h"
 #include "fpointarray.h"

Modified: trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp	Wed Feb 23 20:31:49 2022
@@ -10,7 +10,6 @@
 #include <QCursor>
 #include <QFile>
 #include <QMessageBox>
-#include <QRegExp>
 
 #include "ui/customfdialog.h"
 

Modified: trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp	Wed Feb 23 20:31:49 2022
@@ -11,7 +11,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xar/importxar.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/xar/importxar.cpp	Wed Feb 23 20:31:49 2022
@@ -17,7 +17,6 @@
 #include <QDrag>
 #include <QFile>
 #include <QMimeData>
-#include <QRegExp>
 #include <QTextCodec>
 #include <QDebug>
 #include "qtiocompressor.h"

Modified: trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp	Wed Feb 23 20:31:49 2022
@@ -13,7 +13,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xps/importxps.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/xps/importxps.cpp	Wed Feb 23 20:31:49 2022
@@ -17,7 +17,6 @@
 #include <QFile>
 #include <QList>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QUrl>
 #include <QDebug>

Modified: trunk/Scribus/scribus/plugins/import/zmf/importzmf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/import/zmf/importzmf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/zmf/importzmf.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/zmf/importzmf.cpp	Wed Feb 23 20:31:49 2022
@@ -12,7 +12,6 @@
 #include <QList>
 #include <QMessageBox>
 #include <QMimeData>
-#include <QRegExp>
 #include <QStack>
 #include <QDebug>
 

Modified: trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp	(original)
+++ trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp	Wed Feb 23 20:31:49 2022
@@ -19,6 +19,7 @@
 #include <algorithm>
 
 #include <QPainter>
+#include <QRegExp>
 #include <QUrl>
 
 #include "previewimage.h"

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp	Wed Feb 23 20:31:49 2022
@@ -63,7 +63,6 @@
 #include <QApplication>
 #include <QMessageBox>
 #include <QTextCodec>
-#include <QRegExp>
 #include <QPixmap>
 #include <QWidget>
 #include <QString>

Modified: trunk/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/scfonts.cpp
==============================================================================
--- trunk/Scribus/scribus/scfonts.cpp	(original)
+++ trunk/Scribus/scribus/scfonts.cpp	Wed Feb 23 20:31:49 2022
@@ -24,7 +24,6 @@
 #include <QGlobalStatic>
 #include <QHash>
 #include <QMap>
-#include <QRegExp>
 #include <QRawFont>
 #ifdef Q_OS_WIN32
 #include <QSet>

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Wed Feb 23 20:31:49 2022
@@ -53,14 +53,6 @@
 #include <QPixmap>
 #include <QProgressBar>
 #include <QPushButton>
-//<<QML testing
-//#include <QQuickView>
-//#include <QQmlEngine>
-//#include <QQmlComponent>
-//#include <QQuickItem>
-//#include <QQmlProperty>
-//>>
-#include <QRegExp>
 #include <QScopedPointer>
 #include <QScreen>
 #include <QStyleFactory>

Modified: trunk/Scribus/scribus/scribusXml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/scribusXml.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusXml.cpp	(original)
+++ trunk/Scribus/scribus/scribusXml.cpp	Wed Feb 23 20:31:49 2022
@@ -20,7 +20,6 @@
 #include <QCursor>
 #include <QDir>
 #include <QFile>
-#include <QRegExp>
 #include <QTextCodec>
 #include <QTextStream>
 #include <QXmlStreamReader>

Modified: trunk/Scribus/scribus/scribus_pch.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/scribus_pch.h
==============================================================================
--- trunk/Scribus/scribus/scribus_pch.h	(original)
+++ trunk/Scribus/scribus/scribus_pch.h	Wed Feb 23 20:31:49 2022
@@ -66,7 +66,6 @@
 #include <qlist.h>
 #include <qvariant.h>  // All moc generated code has this include
 #include <qobject.h>
-#include <qregexp.h>
 #include <qstring.h>
 #include <qstringlist.h>
 #include <qtextcodec.h>

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Wed Feb 23 20:31:49 2022
@@ -3729,17 +3729,17 @@
 	// both the number and the text leading up to it sans brackets.
 	//     Copy of fred (5)
 	//     ^^^^^^^^^^^^  ^   (where ^ means captured)
-	QRegExp rx("^(.*)\\s+\\((\\d+)\\)$");
-	int numMatches = rx.lastIndexIn(originalName);
+	QRegularExpression rx("^(.*)\\s+\\((\\d+)\\)$");
+	QRegularExpressionMatch match = rx.match(originalName);
 	// Add a (number) suffix to the end of the name. We start at the
 	// old suffix's value if there was one, or at 2 if there was not.
 	int suffixNum = 1;
 	QString prefix(newName);
-	if (numMatches != -1)
+	if (match.hasMatch())
 	{
 		// Already had a suffix; use the name w/o suffix for prefix and
 		// grab the old suffix value as a starting point.
-		QStringList matches = rx.capturedTexts();
+		QStringList matches = match.capturedTexts();
 		prefix = matches[1];
 		suffixNum = matches[2].toInt();
 	}

Modified: trunk/Scribus/scribus/storyloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/storyloader.cpp
==============================================================================
--- trunk/Scribus/scribus/storyloader.cpp	(original)
+++ trunk/Scribus/scribus/storyloader.cpp	Wed Feb 23 20:31:49 2022
@@ -17,7 +17,6 @@
 #include <QList>
 #include <QMessageBox>
 #include <QProgressBar>
-#include <QRegExp>
 #include <QtAlgorithms>
 #include <QTextCodec>
 #include <QTextStream>

Modified: trunk/Scribus/scribus/styles/styleset.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/styles/styleset.h
==============================================================================
--- trunk/Scribus/scribus/styles/styleset.h	(original)
+++ trunk/Scribus/scribus/styles/styleset.h	Wed Feb 23 20:31:49 2022
@@ -4,7 +4,7 @@
 #define STYLESET_H
 
 #include <QList>
-#include <QRegExp>
+#include <QRegularExpression>
 
 #include <assert.h>
 #include "style.h"
@@ -194,17 +194,17 @@
 	// both the number and the text leading up to it sans brackets.
 	//     Copy of fred (5)
 	//     ^^^^^^^^^^^^  ^   (where ^ means captured)
-	static QRegExp rx("^(.*)\\s+\\((\\d+)\\)$");
-	int numMatches = rx.lastIndexIn(originalName);
+	static QRegularExpression rx("^(.*)\\s+\\((\\d+)\\)$");
+	QRegularExpressionMatch match = rx.match(originalName);
 	// Add a (number) suffix to the end of the name. We start at the
 	// old suffix's value if there was one, or at 2 if there was not.
 	int suffixNum = 1;
 	QString prefix(newName);
-	if (numMatches != -1)
+	if (match.hasMatch())
 	{
 		// Already had a suffix; use the name w/o suffix for prefix and
 		// grab the old suffix value as a starting point.
-		QStringList matches = rx.capturedTexts();
+		QStringList matches = match.capturedTexts();
 		prefix = matches[1];
 		suffixNum = matches[2].toInt();
 	}

Modified: trunk/Scribus/scribus/ui/javadocs.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/ui/javadocs.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/javadocs.cpp	(original)
+++ trunk/Scribus/scribus/ui/javadocs.cpp	Wed Feb 23 20:31:49 2022
@@ -14,7 +14,6 @@
 #include <QMessageBox>
 #include <QPixmap>
 #include <QPushButton>
-#include <QRegExp>
 #include <QTextEdit>
 #include <QToolTip>
 

Modified: trunk/Scribus/scribus/ui/pagepalette_pages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/ui/pagepalette_pages.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_pages.cpp	(original)
+++ trunk/Scribus/scribus/ui/pagepalette_pages.cpp	Wed Feb 23 20:31:49 2022
@@ -19,6 +19,7 @@
 #include <QMimeData>
 #include <QMessageBox>
 #include <QPainter>
+#include <QRegularExpression>
 
 #include "commonstrings.h"
 #include "iconmanager.h"
@@ -394,9 +395,10 @@
 	QString tmp(currView->m_doc->getSectionPageNumberForPageIndex(number));
 	if (tmp.isEmpty())
 		tmp = tmp.setNum(number + 1);
-	QRegExp regExp ("([A-Z]*[0-9]*)( *[\\.|\\-|_] *)(.*)");
-	if (regExp.indexIn(masterPage) != -1)
-		masterPage = regExp.cap(1);
+	QRegularExpression regExp ("([A-Z]*[0-9]*)( *[\\.|\\-|_] *)(.*)");
+	QRegularExpressionMatch match = regExp.match(masterPage);
+	if (match.hasMatch())
+		masterPage = match.captured(1);
 	QRect rect(0, 0, pixin.width(), pixin.height());
 	p.setRenderHint(QPainter::TextAntialiasing, true);
 	p.setFont(QFont("Helvetica", 7, QFont::Normal));

Modified: trunk/Scribus/scribus/ui/pageselector.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/ui/pageselector.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pageselector.cpp	(original)
+++ trunk/Scribus/scribus/ui/pageselector.cpp	Wed Feb 23 20:31:49 2022
@@ -15,7 +15,6 @@
 #include <QLineEdit>
 #include <QPixmap>
 #include <QPushButton>
-#include <QRegExp>
 #include <QSignalBlocker>
 #include <QToolTip>
 #include <QValidator>

Modified: trunk/Scribus/scribus/ui/propertiespalette_group.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/ui/propertiespalette_group.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_group.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_group.cpp	Wed Feb 23 20:31:49 2022
@@ -29,7 +29,6 @@
 #include <QPoint>
 #include <QPushButton>
 #include <QRadioButton>
-#include <QRegExp>
 #include <QSpacerItem>
 #include <QSpinBox>
 #include <QStackedWidget>

Modified: trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_utils.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_utils.cpp	Wed Feb 23 20:31:49 2022
@@ -18,7 +18,6 @@
 #include <QListView>
 #include <QMenu>
 #include <QObject>
-#include <QRegExp>
 #include <QToolTip>
 #include <QValidator>
 #include <QWidget>

Modified: trunk/Scribus/scribus/ui/query.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/ui/query.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/query.cpp	(original)
+++ trunk/Scribus/scribus/ui/query.cpp	Wed Feb 23 20:31:49 2022
@@ -11,7 +11,6 @@
 #include <QLineEdit>
 #include <QPushButton>
 #include <QMessageBox>
-#include <QRegExp>
 #include <QValidator>
 #include <QRegularExpressionValidator>
 

Modified: trunk/Scribus/scribus/ui/smlinestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24967&path=/trunk/Scribus/scribus/ui/smlinestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.cpp	(original)
+++ trunk/Scribus/scribus/ui/smlinestyle.cpp	Wed Feb 23 20:31:49 2022
@@ -6,7 +6,7 @@
 */
 
 #include <QEvent>
-#include <QRegExp>
+#include <QRegularExpression>
 
 #include "colorcombo.h"
 #include "smlinestyle.h"
@@ -216,17 +216,17 @@
 	// both the number and the text leading up to it sans brackets.
 	//     Copy of fred (5)
 	//     ^^^^^^^^^^^^  ^   (where ^ means captured)
-	static QRegExp rx("^(.*)\\s+\\((\\d+)\\)$");
-	int numMatches = rx.lastIndexIn(name);
+	static QRegularExpression rx("^(.*)\\s+\\((\\d+)\\)$");
+	QRegularExpressionMatch match = rx.match(name);
 	// Add a (number) suffix to the end of the name. We start at the
 	// old suffix's value if there was one, or at 2 if there was not.
 	int suffixNum = 1;
 	QString prefix(newName);
-	if (numMatches != -1)
+	if (match.hasMatch())
 	{
 		// Already had a suffix; use the name w/o suffix for prefix and
 		// grab the old suffix value as a starting point.
-		QStringList matches = rx.capturedTexts();
+		QStringList matches = match.capturedTexts();
 		prefix = matches[1];
 		suffixNum = matches[2].toInt();
 	}




More information about the scribus-commit mailing list