r25064 by jghali - Code cleanup

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 27 13:49:47 UTC 2022


Author: jghali
Date: Sun Mar 27 13:49:46 2022
New Revision: 25064

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25064
Log:
Code cleanup

Modified:
    trunk/Scribus/scribus/scpageoutput.cpp
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/scpainter.h
    trunk/Scribus/scribus/scpainterexbase.h
    trunk/Scribus/scribus/scribusXml.cpp
    trunk/Scribus/scribus/scribusapp.cpp
    trunk/Scribus/scribus/scribuscore.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scstreamfilter.cpp
    trunk/Scribus/scribus/scstreamfilter.h
    trunk/Scribus/scribus/scstreamfilter_ascii85.h
    trunk/Scribus/scribus/scstreamfilter_flate.cpp
    trunk/Scribus/scribus/scstreamfilter_flate.h
    trunk/Scribus/scribus/scstreamfilter_jpeg.cpp
    trunk/Scribus/scribus/scstreamfilter_jpeg.h
    trunk/Scribus/scribus/scstreamfilter_rc4.cpp
    trunk/Scribus/scribus/scstreamfilter_rc4.h
    trunk/Scribus/scribus/selectionrubberband.cpp
    trunk/Scribus/scribus/selectionrubberband.h
    trunk/Scribus/scribus/text/screenpainter.cpp
    trunk/Scribus/scribus/text/screenpainter.h
    trunk/Scribus/scribus/text/shapedtext.cpp
    trunk/Scribus/scribus/text/shapedtext.h
    trunk/Scribus/scribus/ui/colorcombo.cpp
    trunk/Scribus/scribus/ui/colorcombo.h
    trunk/Scribus/scribus/ui/scresizecursor.cpp
    trunk/Scribus/scribus/ui/scresizecursor.h
    trunk/Scribus/scribus/ui/scrspinbox.cpp
    trunk/Scribus/scribus/ui/scrspinbox.h
    trunk/Scribus/scribus/ui/sctablewidget.cpp
    trunk/Scribus/scribus/ui/sctablewidget.h
    trunk/Scribus/scribus/ui/search.cpp
    trunk/Scribus/scribus/ui/search.h
    trunk/Scribus/scribus/ui/selectobjects.cpp
    trunk/Scribus/scribus/ui/selectobjects.h
    trunk/Scribus/scribus/ui/shadebutton.cpp
    trunk/Scribus/scribus/ui/shadebutton.h
    trunk/Scribus/scribus/ui/shortcutwidget.cpp
    trunk/Scribus/scribus/ui/shortcutwidget.h
    trunk/Scribus/scribus/ui/smcellstylewidget.cpp
    trunk/Scribus/scribus/ui/smcellstylewidget.h
    trunk/Scribus/scribus/ui/smshadebutton.cpp
    trunk/Scribus/scribus/ui/stylecombos.cpp
    trunk/Scribus/scribus/ui/stylecombos.h
    trunk/Scribus/scribus/upgradechecker.cpp
    trunk/Scribus/scribus/upgradechecker.h

Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp	(original)
+++ trunk/Scribus/scribus/scpageoutput.cpp	Sun Mar 27 13:49:46 2022
@@ -100,14 +100,14 @@
 		return;
 	if (!layer.isViewable || !layer.isPrintable)
 		return;
-	ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[page->masterPageName()]);
+	ScPage* masterPage = m_doc->MasterPages.at(m_doc->MasterNames[page->masterPageName()]);
 	int pageFromMasterCount = page->FromMaster.count();
 	for (int i = 0; i < pageFromMasterCount; ++i)
 	{
 		currItem = page->FromMaster.at(i);
 		if (currItem->m_layerID != layer.ID)
 			continue;
-		if ((currItem->OwnPage != -1) && (currItem->OwnPage != static_cast<int>(Mp->pageNr())))
+		if ((currItem->OwnPage != -1) && (currItem->OwnPage != masterPage->pageNr()))
 			continue;
 		if (!currItem->printEnabled())
 			continue;
@@ -119,9 +119,9 @@
 		currItem->OwnPage = page->pageNr();
 		if (!currItem->ChangedMasterItem)
 		{
-			currItem->moveBy(-Mp->xOffset() + page->xOffset(), -Mp->yOffset() + page->yOffset(), true);
-			currItem->BoundingX = OldBX - Mp->xOffset() + page->xOffset();
-			currItem->BoundingY = OldBY - Mp->yOffset() + page->yOffset();
+			currItem->moveBy(-masterPage->xOffset() + page->xOffset(), -masterPage->yOffset() + page->yOffset(), true);
+			currItem->BoundingX = OldBX - masterPage->xOffset() + page->xOffset();
+			currItem->BoundingY = OldBY - masterPage->yOffset() + page->yOffset();
 		}
 		QRectF oldR(currItem->getBoundingRect().adjusted(0.0, 0.0, 1.0, 1.0));
 		if (clip.intersects(oldR.toRect()))

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp	(original)
+++ trunk/Scribus/scribus/scpainter.cpp	Sun Mar 27 13:49:46 2022
@@ -170,7 +170,7 @@
 	return m_cr;
 }
 
-const QTransform ScPainter::worldMatrix()
+QTransform ScPainter::worldMatrix()
 {
 	cairo_matrix_t matrix;
 	cairo_get_matrix(m_cr, &matrix);
@@ -636,14 +636,14 @@
 					s++;
 				}
 			}
-			m_imageMask = cairo_image_surface_create_for_data ((uchar*)m_imageQ.bits(), CAIRO_FORMAT_ARGB32, w, h, w * 4);
+			m_imageMask = cairo_image_surface_create_for_data (m_imageQ.bits(), CAIRO_FORMAT_ARGB32, w, h, w * 4);
 		}
 		else
 		{
 			m_imageQ = m_maskPattern->pattern.copy();
 			if (m_maskMode == 6)
 				m_imageQ.invertPixels(QImage::InvertRgba);
-			m_imageMask = cairo_image_surface_create_for_data ((uchar*)m_imageQ.bits(), CAIRO_FORMAT_ARGB32, m_maskPattern->getPattern()->width(), m_maskPattern->getPattern()->height(), m_maskPattern->getPattern()->width() * 4);
+			m_imageMask = cairo_image_surface_create_for_data (m_imageQ.bits(), CAIRO_FORMAT_ARGB32, m_maskPattern->getPattern()->width(), m_maskPattern->getPattern()->height(), m_maskPattern->getPattern()->width() * 4);
 		}
 		pat = cairo_pattern_create_for_surface(m_imageMask);
 		cairo_pattern_set_extend(pat, CAIRO_EXTEND_REPEAT);
@@ -872,12 +872,12 @@
 					cairo_mesh_pattern_line_to(mpat, e1.x2(), e1.y2());
 					cairo_mesh_pattern_line_to(mpat, e2.x2(), e2.y2());
 					cairo_mesh_pattern_line_to(mpat, e2s.x2(), e2s.y2());
-					qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
+					qStopColors[offset - 1].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
 					qStopColors[offset].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
-					qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
+					qStopColors[offset - 1].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
 					cairo_mesh_pattern_end_patch(mpat);
 					cairo_mesh_pattern_begin_patch(mpat);
@@ -885,12 +885,12 @@
 					cairo_mesh_pattern_line_to(mpat, e2.x2(), e2.y2());
 					cairo_mesh_pattern_line_to(mpat, e3.x2(), e3.y2());
 					cairo_mesh_pattern_line_to(mpat, e3s.x2(), e3s.y2());
-					qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
+					qStopColors[offset - 1].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
 					qStopColors[offset].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
-					qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
+					qStopColors[offset - 1].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
 					cairo_mesh_pattern_end_patch(mpat);
 					cairo_mesh_pattern_begin_patch(mpat);
@@ -898,12 +898,12 @@
 					cairo_mesh_pattern_line_to(mpat, e3.x2(), e3.y2());
 					cairo_mesh_pattern_line_to(mpat, e4.x2(), e4.y2());
 					cairo_mesh_pattern_line_to(mpat, e4s.x2(), e4s.y2());
-					qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
+					qStopColors[offset - 1].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
 					qStopColors[offset].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
-					qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
+					qStopColors[offset - 1].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
 					cairo_mesh_pattern_end_patch(mpat);
 					cairo_mesh_pattern_begin_patch(mpat);
@@ -911,12 +911,12 @@
 					cairo_mesh_pattern_line_to(mpat, e4.x2(), e4.y2());
 					cairo_mesh_pattern_line_to(mpat, e1.x2(), e1.y2());
 					cairo_mesh_pattern_line_to(mpat, e1s.x2(), e1s.y2());
-					qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
+					qStopColors[offset - 1].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
 					qStopColors[offset].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
-					qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
+					qStopColors[offset - 1].getRgbF(&r, &g, &b, &a);
 					cairo_mesh_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
 					cairo_mesh_pattern_end_patch(mpat);
 				}
@@ -944,9 +944,9 @@
 				for (int gcol = 0; gcol < meshGradientArray[grow].count()-1; gcol++)
 				{
 					MeshPoint mp1 = meshGradientArray[grow][gcol];
-					MeshPoint mp2 = meshGradientArray[grow][gcol+1];
-					MeshPoint mp3 = meshGradientArray[grow+1][gcol+1];
-					MeshPoint mp4 = meshGradientArray[grow+1][gcol];
+					MeshPoint mp2 = meshGradientArray[grow][gcol + 1];
+					MeshPoint mp3 = meshGradientArray[grow + 1][gcol + 1];
+					MeshPoint mp4 = meshGradientArray[grow + 1][gcol];
 					cairo_mesh_pattern_begin_patch(mpat);
 					cairo_mesh_pattern_move_to(mpat, mp1.gridPoint.x(), mp1.gridPoint.y());
 					cairo_mesh_pattern_curve_to(mpat, mp1.controlRight.x(), mp1.controlRight.y(), mp2.controlLeft.x(), mp2.controlLeft.y(), mp2.gridPoint.x(), mp2.gridPoint.y());
@@ -1101,7 +1101,7 @@
 	else if (m_fillMode == 3)
 	{
 		cairo_set_antialias(m_cr, CAIRO_ANTIALIAS_NONE);
-		cairo_surface_t *image2 = cairo_image_surface_create_for_data ((uchar*)m_pattern->getPattern()->bits(), CAIRO_FORMAT_ARGB32, m_pattern->getPattern()->width(), m_pattern->getPattern()->height(), m_pattern->getPattern()->width() * 4);
+		cairo_surface_t *image2 = cairo_image_surface_create_for_data (m_pattern->getPattern()->bits(), CAIRO_FORMAT_ARGB32, m_pattern->getPattern()->width(), m_pattern->getPattern()->height(), m_pattern->getPattern()->width() * 4);
 		cairo_pattern_t *m_pat = cairo_pattern_create_for_surface(image2);
 		cairo_pattern_set_extend(m_pat, CAIRO_EXTEND_REPEAT);
 		cairo_pattern_set_filter(m_pat, CAIRO_FILTER_GOOD);
@@ -1262,7 +1262,7 @@
 	{
 		cairo_push_group(m_cr);
 		cairo_set_antialias(m_cr, CAIRO_ANTIALIAS_NONE);
-		cairo_surface_t *image2 = cairo_image_surface_create_for_data ((uchar*)m_pattern->getPattern()->bits(), CAIRO_FORMAT_ARGB32, m_pattern->getPattern()->width(), m_pattern->getPattern()->height(), m_pattern->getPattern()->width() * 4);
+		cairo_surface_t *image2 = cairo_image_surface_create_for_data (m_pattern->getPattern()->bits(), CAIRO_FORMAT_ARGB32, m_pattern->getPattern()->width(), m_pattern->getPattern()->height(), m_pattern->getPattern()->width() * 4);
 		cairo_pattern_t *m_pat = cairo_pattern_create_for_surface(image2);
 		cairo_pattern_set_extend(m_pat, CAIRO_EXTEND_REPEAT);
 		cairo_pattern_set_filter(m_pat, CAIRO_FILTER_GOOD);
@@ -1383,8 +1383,8 @@
 	cairo_push_group(m_cr);
 	cairo_set_operator(m_cr, CAIRO_OPERATOR_OVER);
 	cairo_set_fill_rule(m_cr, cairo_get_fill_rule(m_cr));
-	cairo_surface_t *image2  = cairo_image_surface_create_for_data ((uchar*)image->bits(), CAIRO_FORMAT_RGB24, image->width(), image->height(), image->width() * 4);
-	cairo_surface_t *image3 = cairo_image_surface_create_for_data ((uchar*)image->bits(), CAIRO_FORMAT_ARGB32, image->width(), image->height(), image->width() * 4);
+	cairo_surface_t *image2  = cairo_image_surface_create_for_data (image->bits(), CAIRO_FORMAT_RGB24, image->width(), image->height(), image->width() * 4);
+	cairo_surface_t *image3 = cairo_image_surface_create_for_data (image->bits(), CAIRO_FORMAT_ARGB32, image->width(), image->height(), image->width() * 4);
 	cairo_set_source_surface (m_cr, image2, 0, 0);
 	cairo_pattern_set_filter(cairo_get_source(m_cr), CAIRO_FILTER_GOOD);
 	cairo_mask_surface (m_cr, image3, 0, 0);
@@ -1888,15 +1888,15 @@
 	QRgb *pix = (QRgb*)cairo_image_surface_get_data(data);
 	int w   = cairo_image_surface_get_width(data);
 	int h   = cairo_image_surface_get_height(data);
-	int wm  = w-1;
-	int hm  = h-1;
-	int wh  = w*h;
+	int wm  = w - 1;
+	int hm  = h - 1;
+	int wh  = w * h;
 	int div = radius+radius+1;
 	int *a = new int[wh];
 	int asum, x, y, i, yp, yi, yw;
 	QRgb p;
-	int *vmin = new int[qMax(w,h)];
-	int divsum = (div+1)>>1;
+	int *vmin = new int[qMax(w, h)];
+	int divsum = (div + 1)>>1;
 	divsum *= divsum;
 	int *dv = new int[256 * (size_t) divsum];
 	for (i = 0; i < 256 * divsum; ++i)
@@ -1921,11 +1921,11 @@
 		ainsum = aoutsum = asum = 0;
 		for (i = -radius; i <= radius; ++i)
 		{
-			p = pix[yi+qMin(wm,qMax(i,0))];
-			sir = stack[i+radius];
+			p = pix[yi + qMin(wm, qMax(i, 0))];
+			sir = stack[i + radius];
 			sir[0] = qAlpha(p);
-			rbs = r1-abs(i);
-			asum += sir[0]*rbs;
+			rbs = r1 - abs(i);
+			asum += sir[0] * rbs;
 			if (i > 0)
 				ainsum += sir[0];
 			else
@@ -1936,7 +1936,7 @@
 		{
 			a[yi] = dv[asum];
 			asum -= aoutsum;
-			stackstart = stackpointer-radius+div;
+			stackstart = stackpointer - radius + div;
 			sir = stack[stackstart % div];
 			aoutsum -= sir[0];
 			if (y == 0)

Modified: trunk/Scribus/scribus/scpainter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scpainter.h
==============================================================================
--- trunk/Scribus/scribus/scpainter.h	(original)
+++ trunk/Scribus/scribus/scpainter.h	Sun Mar 27 13:49:46 2022
@@ -49,7 +49,7 @@
 
 	// matrix manipulation
 	virtual void setWorldMatrix(const QTransform &);
-	virtual const QTransform worldMatrix();
+	virtual QTransform worldMatrix();
 	virtual void setZoomFactor(double);
 	virtual double zoomFactor() { return m_zoomFactor; }
 	virtual void translate(double, double);

Modified: trunk/Scribus/scribus/scpainterexbase.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scpainterexbase.h
==============================================================================
--- trunk/Scribus/scribus/scpainterexbase.h	(original)
+++ trunk/Scribus/scribus/scpainterexbase.h	Sun Mar 27 13:49:46 2022
@@ -139,8 +139,8 @@
 	VGradientEx  m_fillGradient { VGradientEx::linear };
 	VGradientEx  m_strokeGradient { VGradientEx::linear };
 	VGradientEx  m_maskGradient;
-	ScPattern*   m_pattern;
-	ScPattern*   m_maskPattern;
+	ScPattern*   m_pattern { nullptr };
+	ScPattern*   m_maskPattern { nullptr };
 	QTransform   m_patternTransform;
 
 protected:

Modified: trunk/Scribus/scribus/scribusXml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scribusXml.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusXml.cpp	(original)
+++ trunk/Scribus/scribus/scribusXml.cpp	Sun Mar 27 13:49:46 2022
@@ -188,7 +188,7 @@
 		selectionHeight = hp = qMax(maxy, y2) - yp;
 	}
 	double scaleI = 50.0 / qMax(selectionWidth, selectionHeight);
-	QImage retImg = QImage(50, 50, QImage::Format_ARGB32_Premultiplied);
+	QImage retImg(50, 50, QImage::Format_ARGB32_Premultiplied);
 	retImg.fill( qRgba(0, 0, 0, 0) );
 	ScPainter *painter = new ScPainter(&retImg, retImg.width(), retImg.height(), 1, 0);
 	painter->setZoomFactor(scaleI);

Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp	(original)
+++ trunk/Scribus/scribus/scribusapp.cpp	Sun Mar 27 13:49:46 2022
@@ -181,7 +181,7 @@
 			}
 			break;
 		}
-		if ((arg == ARG_LANG || arg == ARG_LANG_SHORT))
+		if (arg == ARG_LANG || arg == ARG_LANG_SHORT)
 		{
 			if  (++argi < argsc)
 				m_lang = args[argi];

Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp	(original)
+++ trunk/Scribus/scribus/scribuscore.cpp	Sun Mar 27 13:49:46 2022
@@ -94,15 +94,15 @@
 	auto* scribus = new ScribusMainWindow();
 	Q_CHECK_PTR(scribus);
 	if (!scribus)
-		return(EXIT_FAILURE);
+		return EXIT_FAILURE;
 	m_ScMWList.append(scribus);
 	int retVal=initScribusCore(showSplash, showFontInfo, showProfileInfo, newGuiLanguage);
 	if (retVal == EXIT_FAILURE)
-		return(EXIT_FAILURE);
+		return EXIT_FAILURE;
 	
 	retVal = scribus->initScMW(true);
 	if (retVal == EXIT_FAILURE)
-		return(EXIT_FAILURE);
+		return EXIT_FAILURE;
 	
 	closeSplash();
 	m_scribusInitialized = true;
@@ -161,7 +161,7 @@
 	if (!haveFonts)
 		return EXIT_FAILURE;
 	m_prefsManager.initDefaults();
-	m_prefsManager.initDefaultGUIFont(qApp->font());
+	m_prefsManager.initDefaultGUIFont(QApplication::font());
 	m_prefsManager.initArrowStyles();
 	m_undoManager = UndoManager::instance();
 	fileWatcher = new FileWatcher(this);
@@ -211,7 +211,7 @@
 	if (!showSplash)
 		return;
 
-	QScreen* primaryScreeen = qApp->primaryScreen();
+	QScreen* primaryScreeen = QApplication::primaryScreen();
 	double pixelRatio = primaryScreeen ? primaryScreeen->devicePixelRatio() : 1.0;
 	QPixmap pix = IconManager::instance().loadPixmap("scribus_splash.png", true);
 	if (pixelRatio != 1.0)

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Sun Mar 27 13:49:46 2022
@@ -136,11 +136,12 @@
  */
 class DocUpdater : public Observer<ScPage*>, public Observer<PageItem*>
 {
-	ScribusDoc* doc;
-	int  m_updateEnabled;
-	bool m_docChangeNeeded;
+	ScribusDoc* doc { nullptr };
+	int  m_updateEnabled { 0 };
+	bool m_docChangeNeeded { false };
+
 public:
-	DocUpdater(ScribusDoc* d) : doc(d), m_updateEnabled(0), m_docChangeNeeded(false) {}
+	DocUpdater(ScribusDoc* d) : doc(d) {}
 
 	bool inUpdateSession() const
 	{ 
@@ -318,7 +319,7 @@
 	m_docPrefsData.pdfPrefs.useDocBleeds = true;
 	m_docPrefsData.pdfPrefs.bleeds = m_docPrefsData.docSetupPrefs.bleeds;
 
-	AddFont(m_appPrefsData.itemToolPrefs.textFont);//, prefsData.AvailFonts[prefsData.itemToolPrefs.textFont]->Font);
+	AddFont(m_appPrefsData.itemToolPrefs.textFont);
 	//FIXME: aren't we doing this now anyway with prefs struct copy?
 	m_docPrefsData.itemToolPrefs.textFont = m_appPrefsData.itemToolPrefs.textFont;
 	m_docPrefsData.itemToolPrefs.textSize = m_appPrefsData.itemToolPrefs.textSize;
@@ -466,7 +467,7 @@
 	if (autoSave() && ScCore->usingGUI())
 		autoSaveTimer->start(autoSaveTime());
 	//Do this after all the collections have been created and cleared!
-	m_masterPageMode = true; // quick hack to force the change of pointers in setMasterPageMode();
+	m_masterPageMode = true; // quick hack to force the change of pointers in setMasterPageMode()
 	setMasterPageMode(false);
 	addSymbols();
 	//for loading old documents where default notes style is not saved
@@ -961,7 +962,7 @@
 	m_ScMW->mainWindowProgressBar->reset();
 	int progressBarCount = PageColors.count() + MasterItems.count() + DocItems.count() + FrameItems.count();
 	m_ScMW->mainWindowProgressBar->setMaximum(progressBarCount);
-	qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
+	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 	bool oldCM = m_docPrefsData.colorPrefs.DCMSset.CMSinUse;
 	bool newCM = enable;
 	CloseCMSProfiles();
@@ -999,7 +1000,7 @@
 		HasCMS = false;
 	}
 	m_ScMW->mainWindowProgressBar->setValue(progressBarCount);
-	qApp->restoreOverrideCursor();
+	QApplication::restoreOverrideCursor();
 	m_ScMW->setStatusBarInfoText("");
 	m_ScMW->mainWindowProgressBar->reset();
 }
@@ -2361,8 +2362,8 @@
 {
 	QStringList nameList;
 
-	auto itemAttrs = itemAttributes();
-	for (ObjAttrVector::Iterator it = itemAttrs.begin(); it!= itemAttrs.end(); ++it)
+	const auto& itemAttrs = itemAttributes();
+	for (auto it = itemAttrs.cbegin(); it!= itemAttrs.cend(); ++it)
 		nameList.append((*it).name);
 	return nameList;
 }
@@ -2834,7 +2835,7 @@
 	if (sourceSelection.count() != 0)
 	{
 		ScriXmlDoc ss;
-		QString dataS = ss.writeElem(this, &sourceSelection);
+		QString dataS = ScriXmlDoc::writeElem(this, &sourceSelection);
 		ss.readElemToLayer(dataS, this, Pages->at(0)->xOffset(), Pages->at(0)->yOffset(), false, true, whereToInsert);
 	}
 	sourceSelection.clear();
@@ -4712,10 +4713,10 @@
 	if (isUndo)
 	{
 		int destLocation=extPage + 1;
-		if (whereTo==0)
+		if (whereTo == 0)
 			--destLocation;
-		else if (whereTo==2)
-			destLocation=DocPages.count();
+		else if (whereTo == 2)
+			destLocation = DocPages.count();
 		for (int i = 0; i < copyCount; ++i)
 		{
 			m_ScMW->deletePage(destLocation, destLocation);
@@ -5403,8 +5404,8 @@
 					currItem->EmbeddedProfile.clear();
 					currItem->ImageProfile = m_docPrefsData.colorPrefs.DCMSset.DefaultImageRGBProfile;
 					currItem->ImageIntent = m_docPrefsData.colorPrefs.DCMSset.DefaultIntentImages;
-					qApp->setOverrideCursor( QCursor(Qt::WaitCursor) );
-					qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+					QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) );
+					QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 					loadPict(iafData.source, currItem, false, true);
 					if (iafData.sizeType==3) //Frame is size of imported image
 					{
@@ -5414,8 +5415,8 @@
 						currItem->OldH2 = currItem->height();
 						currItem->updateClip();
 					}
-					qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
-					qApp->restoreOverrideCursor();
+					QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+					QApplication::restoreOverrideCursor();
 				}
 			}
 			if (iafData.frameType==PageItem::TextFrame)
@@ -5786,16 +5787,16 @@
 	{
 		int docPageCount = Pages->count();
 		MarginStruct pageBleeds;
-		for (int a = 0; a < docPageCount; ++a)
-		{
-			getBleeds(a, pageBleeds);
-			int x = static_cast<int>(Pages->at(a)->xOffset() - pageBleeds.left());
-			int y = static_cast<int>(Pages->at(a)->yOffset() - pageBleeds.top());
-			int w = static_cast<int>(Pages->at(a)->width() + pageBleeds.left() + pageBleeds.right());
-			int h = static_cast<int>(Pages->at(a)->height() + pageBleeds.bottom() + pageBleeds.top());
+		for (int i = 0; i < docPageCount; ++i)
+		{
+			getBleeds(i, pageBleeds);
+			int x = static_cast<int>(Pages->at(i)->xOffset() - pageBleeds.left());
+			int y = static_cast<int>(Pages->at(i)->yOffset() - pageBleeds.top());
+			int w = static_cast<int>(Pages->at(i)->width() + pageBleeds.left() + pageBleeds.right());
+			int h = static_cast<int>(Pages->at(i)->height() + pageBleeds.bottom() + pageBleeds.top());
 			if (QRect(x, y, w, h).contains(qRound(x2), qRound(y2)))
 			{
-				retw = static_cast<int>(a);
+				retw = i;
 				break;
 			}
 		}
@@ -5817,7 +5818,7 @@
 
 	if (masterPageMode())
 	{
-		ScPage* currPage = m_currentPage;
+		const ScPage* currPage = m_currentPage;
 		double x1 = currPage->xOffset() - m_docPrefsData.docSetupPrefs.bleeds.left();
 		double y1 = currPage->yOffset() - m_docPrefsData.docSetupPrefs.bleeds.top();
 		double w1 = currPage->width() + m_docPrefsData.docSetupPrefs.bleeds.left() + m_docPrefsData.docSetupPrefs.bleeds.right();
@@ -5830,17 +5831,17 @@
 	{
 		MarginStruct pageBleeds;
 		int docPageCount = Pages->count();
-		for (int a = 0; a < docPageCount; ++a)
-		{
-			getBleeds(a, pageBleeds);
-			double x1 = Pages->at(a)->xOffset() - pageBleeds.left();
-			double y1 = Pages->at(a)->yOffset() - pageBleeds.top();
-			double w1 = Pages->at(a)->width() + pageBleeds.left() + pageBleeds.right();
-			double h1 = Pages->at(a)->height() + pageBleeds.bottom() + pageBleeds.top();
+		for (int i = 0; i < docPageCount; ++i)
+		{
+			getBleeds(i, pageBleeds);
+			double x1 = Pages->at(i)->xOffset() - pageBleeds.left();
+			double y1 = Pages->at(i)->yOffset() - pageBleeds.top();
+			double w1 = Pages->at(i)->width() + pageBleeds.left() + pageBleeds.right();
+			double h1 = Pages->at(i)->height() + pageBleeds.bottom() + pageBleeds.top();
 			QRectF pageRect(x1, y1, w1, h1);
 			if (itemRect.intersects(pageRect))
 			{
-				retw = static_cast<int>(a);
+				retw = i;
 				break;
 			}
 		}
@@ -6012,15 +6013,16 @@
 	struct oldPageVar oldPg;
 	int counter = pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].FirstPage;
 	int rowcounter = 0;
-	double maxYPos=0.0, maxXPos=0.0;
-	double currentXPos=m_docPrefsData.displayPrefs.scratch.left();
-	double currentYPos=m_docPrefsData.displayPrefs.scratch.top();
-	double lastYPos=Pages->at(0)->initialHeight();
+	double maxXPos = 0.0;
+	double maxYPos = 0.0;
+	double currentXPos = m_docPrefsData.displayPrefs.scratch.left();
+	double currentYPos = m_docPrefsData.displayPrefs.scratch.top();
+	double lastYPos = Pages->at(0)->initialHeight();
 //	currentXPos += (pageWidth+pageSets[currentPageLayout].GapHorizontal) * counter;
 	currentXPos += (m_docPrefsData.docSetupPrefs.pageWidth+m_docPrefsData.displayPrefs.pageGapHorizontal) * counter;
 
 	ScPage* page;
-	int docPageCount=Pages->count();
+	int docPageCount = Pages->count();
 	for (int i = 0; i < docPageCount; ++i)
 	{
 		page = Pages->at(i);
@@ -6866,11 +6868,11 @@
 }
 
 
-const QString ScribusDoc::getSectionPageNumberForPageIndex(uint pageIndex) const
+QString ScribusDoc::getSectionPageNumberForPageIndex(uint pageIndex) const
 {
 	QString retVal;
-	int key=getSectionKeyForPageIndex(pageIndex);
-	if (key==-1)
+	int key = getSectionKeyForPageIndex(pageIndex);
+	if (key == -1)
 		return retVal;
 	//If a section is inactive, there's no page numbers printed
 	if (!m_docPrefsData.docSectionMap[key].active)
@@ -7195,8 +7197,8 @@
 
 void ScribusDoc::setLocationBasedPageLRMargins(uint pageIndex)
 {
-	int setcol=pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].Columns;
-	if (setcol==1)
+	int setcol = pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].Columns;
+	if (setcol == 1)
 	{
 		ScPage* pageToAdjust=DocPages.at(pageIndex);
 		pageToAdjust->Margins.setLeft(pageToAdjust->initialMargins.left());
@@ -7204,9 +7206,9 @@
 		return;
 	}
 
-	ScPage* pageToAdjust=DocPages.at(pageIndex);
-	PageLocation pageLoc=locationOfPage(pageIndex);
-	if (pageLoc==LeftPage) //Left hand page
+	ScPage* pageToAdjust = DocPages.at(pageIndex);
+	PageLocation pageLoc = locationOfPage(pageIndex);
+	if (pageLoc == LeftPage) //Left hand page
 	{
 		pageToAdjust->Margins.setLeft(pageToAdjust->initialMargins.right());
 		pageToAdjust->Margins.setRight(pageToAdjust->initialMargins.left());
@@ -7226,10 +7228,10 @@
 
 PageLocation ScribusDoc::locationOfPage(int pageIndex) const
 {
-	int myCol=columnOfPage(pageIndex);
-	if (myCol==0) //Left hand page
+	int myCol = columnOfPage(pageIndex);
+	if (myCol == 0) //Left hand page
 		return LeftPage;
-	if (myCol>= pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].Columns-1) // Right hand page
+	if (myCol >= pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].Columns - 1) // Right hand page
 		return RightPage;
 	//Middle pages
 	return MiddlePage;
@@ -7237,7 +7239,7 @@
 
 int ScribusDoc::columnOfPage(int pageIndex) const
 {
-	int setcol=pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].Columns;
+	int setcol = pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].Columns;
 	return ((pageIndex % setcol) + pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].FirstPage) % setcol;
 }
 
@@ -7341,7 +7343,7 @@
 {
 	if (PageColors.contains(name))
 		return;
-	ScColor tmp = ScColor(static_cast<int>(255 * c), static_cast<int>(255 * m), static_cast<int>(255 * y), static_cast<int>(255 * k));
+	ScColor tmp(static_cast<int>(255 * c), static_cast<int>(255 * m), static_cast<int>(255 * y), static_cast<int>(255 * k));
 	PageColors.insert(name, tmp);
 }
 
@@ -10068,7 +10070,7 @@
 		currItem->adjustPictScale();
 		progress++;
 		m_ScMW->mainWindowProgressBar->setValue(progress);
-		qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+		QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 		if (!docPtr) return;
 	}
 
@@ -10104,7 +10106,7 @@
 		currItem->adjustPictScale();
 		progress++;
 		m_ScMW->mainWindowProgressBar->setValue(progress);
-		qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+		QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 		if (!docPtr) return;
 	}
 
@@ -10140,7 +10142,7 @@
 		currItem->adjustPictScale();
 		progress++;
 		m_ScMW->mainWindowProgressBar->setValue(progress);
-		qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+		QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 		if (!docPtr) return;
 	}
 
@@ -10182,7 +10184,7 @@
 			currItem->adjustPictScale();
 			progress++;
 			m_ScMW->mainWindowProgressBar->setValue(progress);
-			qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+			QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 			if (!docPtr) return;
 		}
 		PageItem *ite = pa.items.at(0);
@@ -11814,7 +11816,7 @@
 	}
 	
 	QString targetTooltip;
-	if (m_Selection->count() <= (int) Um::ItemsInvolvedLimit)
+	if (m_Selection->count() <= Um::ItemsInvolvedLimit)
 	{
 		targetTooltip = Um::ItemsInvolved + "\n";
 		for (int i = 0; i < m_Selection->count(); ++i)
@@ -14122,7 +14124,6 @@
 	if (currItem->locked())
 		return;
 	QRectF oldR = currItem->getBoundingRect();
-//	if ((Doc->RotMode != 0) && (m_MouseButtonPressed))
 	if (m_rotMode != 0)
 	{
 		QTransform ma;
@@ -14494,7 +14495,7 @@
 	PageItem* currItem;
 	double gx, gy, gw, gh;
 	itemSelection->getGroupRect(&gx, &gy, &gw, &gh);
-	QRectF oldRect = QRectF(gx, gy, gw, gh);
+	QRectF oldRect(gx, gy, gw, gh);
 	QList<PageItem*> weldL;
 	for (int i = 0; i < selectedItemCount; ++i)
 	{
@@ -16164,7 +16165,7 @@
 			m_ScMW->mainWindowProgressBar->reset();
 			int cc = PageColors.count() + MasterItems.count() + DocItems.count() + FrameItems.count();
 			m_ScMW->mainWindowProgressBar->setMaximum(cc);
-			qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
+			QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 			bool newCM  = m_docPrefsData.colorPrefs.DCMSset.CMSinUse;
 			bool updCol = false;
 			m_docPrefsData.colorPrefs.DCMSset.CMSinUse = oldPrefsData.colorPrefs.DCMSset.CMSinUse;
@@ -16206,7 +16207,7 @@
 				RecalcPictures(&ScCore->InputProfiles, &ScCore->InputProfilesCMYK, m_ScMW->mainWindowProgressBar);
 			}
 			m_ScMW->mainWindowProgressBar->setValue(cc);
-			qApp->restoreOverrideCursor();
+			QApplication::restoreOverrideCursor();
 			m_ScMW->setStatusBarInfoText("");
 			m_ScMW->mainWindowProgressBar->reset();
 		}

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Sun Mar 27 13:49:46 2022
@@ -1008,7 +1008,7 @@
 	 * @brief Gets the page number to be printed based on the section it is in.
 	 * Returns QString() on failure to find the pageIndex
 	 */
-	const QString getSectionPageNumberForPageIndex(uint) const;
+	QString getSectionPageNumberForPageIndex(uint) const;
 	/**
 	 * @brief Gets the page number fill character to be printed based on the section it is in.
 	 * Returns QString() on failure to find the pageIndex

Modified: trunk/Scribus/scribus/scstreamfilter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scstreamfilter.cpp
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter.cpp	(original)
+++ trunk/Scribus/scribus/scstreamfilter.cpp	Sun Mar 27 13:49:46 2022
@@ -13,21 +13,17 @@
 using namespace std;
 
 ScStreamFilter::ScStreamFilter(QDataStream* stream)
+              : m_filterMode (FilterToStream), 
+                m_dataStream(stream)
 {
-	assert(stream != nullptr);
-	m_dataStream = stream;
-	m_filter     = nullptr;
-	m_filterMode = FilterToStream;
-	m_writtenToStream = 0;
+	assert(m_dataStream != nullptr);
 }
 
 ScStreamFilter::ScStreamFilter(ScStreamFilter* filter)
+              : m_filterMode(FilterToFilter),
+                m_filter(filter)
 {
-	assert(filter != nullptr);
-	m_dataStream = nullptr;
-	m_filter     = filter;
-	m_filterMode = FilterToFilter;
-	m_writtenToStream = 0;
+	assert(m_filter != nullptr);
 }
 
 bool ScStreamFilter::writeDataInternal(const char* data, int dataLen)

Modified: trunk/Scribus/scribus/scstreamfilter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scstreamfilter.h
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter.h	(original)
+++ trunk/Scribus/scribus/scstreamfilter.h	Sun Mar 27 13:49:46 2022
@@ -13,26 +13,11 @@
 
 class ScStreamFilter
 {
-protected:
-
-	typedef enum
-	{
-		FilterToStream = 0,
-		FilterToFilter = 1
-	} FilterMode;
-
-	int             m_writtenToStream;
-	FilterMode      m_filterMode;
-	QDataStream*    m_dataStream;
-	ScStreamFilter* m_filter;
-
-	bool writeDataInternal(const char* data, int dataLen);
 
 public:
-
 	ScStreamFilter(QDataStream* stream);
 	ScStreamFilter(ScStreamFilter* filter);
-	virtual ~ScStreamFilter() {};
+	virtual ~ScStreamFilter() = default;
 
 	virtual bool openFilter();
 	virtual bool closeFilter();
@@ -41,6 +26,20 @@
 	virtual bool writeData(const char* data, int dataLen) = 0;
 
 	int writtenToStream();
+
+protected:
+	enum FilterMode
+	{
+		FilterToStream = 0,
+		FilterToFilter = 1
+	};
+
+	int             m_writtenToStream { 0 };
+	FilterMode      m_filterMode;
+	QDataStream*    m_dataStream { nullptr };
+	ScStreamFilter* m_filter { nullptr };
+
+	bool writeDataInternal(const char* data, int dataLen);
 };
 
 class ScNullEncodeFilter : public ScStreamFilter
@@ -49,7 +48,7 @@
 	ScNullEncodeFilter(QDataStream* stream) : ScStreamFilter(stream) {};
 	ScNullEncodeFilter(ScStreamFilter* filter) : ScStreamFilter(filter) {};
 
-	virtual bool writeData(const char* data, int dataLen) { return writeDataInternal(data, dataLen); }
+	bool writeData(const char* data, int dataLen) override { return writeDataInternal(data, dataLen); }
 };
 
 #endif

Modified: trunk/Scribus/scribus/scstreamfilter_ascii85.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scstreamfilter_ascii85.h
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter_ascii85.h	(original)
+++ trunk/Scribus/scribus/scstreamfilter_ascii85.h	Sun Mar 27 13:49:46 2022
@@ -15,21 +15,20 @@
 class ScASCII85EncodeFilter : public ScStreamFilter
 {
 protected:
+	QByteArray     m_buffer;
+	int            m_buffer_pending { 0 };
 
-	QByteArray     m_buffer;
-	int            m_buffer_pending;
-
-	unsigned char  m_four_tuple[4];
-	int            m_four_tuple_pending;
+	unsigned char  m_four_tuple[4] { 0 };
+	int            m_four_tuple_pending { 0 };
 
 public:
 	ScASCII85EncodeFilter(QDataStream* stream);
 	ScASCII85EncodeFilter(ScStreamFilter* filter);
 
-	virtual bool openFilter ();
-	virtual bool closeFilter();
+	bool openFilter () override;
+	bool closeFilter() override;
 
-	virtual bool writeData(const char* data, int dataLen);
+	bool writeData(const char* data, int dataLen) override;
 };
 
 #endif

Modified: trunk/Scribus/scribus/scstreamfilter_flate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scstreamfilter_flate.cpp
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter_flate.cpp	(original)
+++ trunk/Scribus/scribus/scstreamfilter_flate.cpp	Sun Mar 27 13:49:46 2022
@@ -18,29 +18,27 @@
 #define BUFFER_SIZE 16384
 struct  ScFlateEncodeFilterData
 {
-    z_stream      zlib_stream;
-    unsigned char input_buffer [BUFFER_SIZE];
-    unsigned char output_buffer[BUFFER_SIZE];
+	z_stream      zlib_stream;
+	unsigned char input_buffer [BUFFER_SIZE];
+	unsigned char output_buffer[BUFFER_SIZE];
 };
 
 ScFlateEncodeFilter::ScFlateEncodeFilter(QDataStream* stream)
 				   : ScStreamFilter(stream)
 {
-	m_filterData   = nullptr;
-	m_openedFilter = false;
+
 }
 
 ScFlateEncodeFilter::ScFlateEncodeFilter(ScStreamFilter* filter)
 				   : ScStreamFilter(filter)
 {
-	m_filterData   = nullptr;
-	m_openedFilter = false;
+
 }
 
 ScFlateEncodeFilter::~ScFlateEncodeFilter()
 {
 	if (m_filterData && m_openedFilter)
-		closeFilter();
+		ScFlateEncodeFilter::closeFilter();
 	freeData();
 }
 
@@ -70,17 +68,18 @@
 	}
 
 	m_filterData->zlib_stream.next_in   = m_filterData->input_buffer;
-    m_filterData->zlib_stream.avail_in  = 0;
-    m_filterData->zlib_stream.next_out  = m_filterData->output_buffer;
-    m_filterData->zlib_stream.avail_out = BUFFER_SIZE;
+	m_filterData->zlib_stream.avail_in  = 0;
+	m_filterData->zlib_stream.next_out  = m_filterData->output_buffer;
+	m_filterData->zlib_stream.avail_out = BUFFER_SIZE;
 
 	m_openedFilter = ScStreamFilter::openFilter();
 	return m_openedFilter;
 }
+
 bool ScFlateEncodeFilter::closeFilter()
 {
 	bool closeSucceed = writeDeflate(true);
-    deflateEnd (&m_filterData->zlib_stream);
+	deflateEnd (&m_filterData->zlib_stream);
 	m_openedFilter = false;
 	closeSucceed  &= ScStreamFilter::closeFilter();
 	return closeSucceed;
@@ -95,17 +94,18 @@
 	if (!m_filterData)
 		return false;
 
-    while (dataLen) {
-        count = dataLen;
-        if (count > BUFFER_SIZE - m_filterData->zlib_stream.avail_in)
-            count = BUFFER_SIZE - m_filterData->zlib_stream.avail_in;
-        memcpy (m_filterData->input_buffer + m_filterData->zlib_stream.avail_in, p, count);
-        p += count;
-        m_filterData->zlib_stream.avail_in += count;
-        dataLen -= count;
+	while (dataLen)
+	{
+		count = dataLen;
+		if (count > BUFFER_SIZE - m_filterData->zlib_stream.avail_in)
+			count = BUFFER_SIZE - m_filterData->zlib_stream.avail_in;
+		memcpy (m_filterData->input_buffer + m_filterData->zlib_stream.avail_in, p, count);
+		p += count;
+		m_filterData->zlib_stream.avail_in += count;
+		dataLen -= count;
 
-        if (m_filterData->zlib_stream.avail_in == BUFFER_SIZE)
-            deflateSuccess &= writeDeflate(false);
+		if (m_filterData->zlib_stream.avail_in == BUFFER_SIZE)
+			deflateSuccess &= writeDeflate(false);
     }
 
 	return deflateSuccess;
@@ -115,25 +115,26 @@
 {
 	int  ret;
 	bool deflateSuccess = true;
-    bool finished;
+	bool finished;
 	
-	do {
+	do
+	{
 		ret = deflate (&m_filterData->zlib_stream, flush ? Z_FINISH : Z_NO_FLUSH);
-        if (flush || m_filterData->zlib_stream.avail_out == 0)
-        {
+		if (flush || m_filterData->zlib_stream.avail_out == 0)
+		{
 			deflateSuccess &= writeDataInternal((const char*) m_filterData->output_buffer, BUFFER_SIZE - m_filterData->zlib_stream.avail_out);
-            m_filterData->zlib_stream.next_out  = m_filterData->output_buffer;
-            m_filterData->zlib_stream.avail_out = BUFFER_SIZE;
-        }
+			m_filterData->zlib_stream.next_out  = m_filterData->output_buffer;
+			m_filterData->zlib_stream.avail_out = BUFFER_SIZE;
+		}
 
-        finished = true;
-        if (m_filterData->zlib_stream.avail_in != 0)
-            finished = false;
-        if (flush && ret != Z_STREAM_END)
-            finished = false;
+		finished = true;
+		if (m_filterData->zlib_stream.avail_in != 0)
+			finished = false;
+		if (flush && ret != Z_STREAM_END)
+			finished = false;
 
-    } while (!finished);
+	} while (!finished);
 
-    m_filterData->zlib_stream.next_in = m_filterData->input_buffer;
+	m_filterData->zlib_stream.next_in = m_filterData->input_buffer;
 	return deflateSuccess;
 }

Modified: trunk/Scribus/scribus/scstreamfilter_flate.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scstreamfilter_flate.h
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter_flate.h	(original)
+++ trunk/Scribus/scribus/scstreamfilter_flate.h	Sun Mar 27 13:49:46 2022
@@ -15,23 +15,22 @@
 class ScFlateEncodeFilter : public ScStreamFilter
 {
 protected:
-
-	ScFlateEncodeFilterData* m_filterData;
+	bool m_openedFilter { false };
+	ScFlateEncodeFilterData* m_filterData { nullptr };
 
 	void freeData();
-	bool m_openedFilter;
 
 	bool writeDeflate(bool flush);
 
 public:
 	ScFlateEncodeFilter(QDataStream* stream);
 	ScFlateEncodeFilter(ScStreamFilter* filter);
-	~ScFlateEncodeFilter();
+	~ScFlateEncodeFilter() override;
 
-	virtual bool openFilter ();
-	virtual bool closeFilter();
+	bool openFilter () override;
+	bool closeFilter() override;
 
-	virtual bool writeData(const char* data, int dataLen);
+	bool writeData(const char* data, int dataLen) override;
 };
 
 #endif

Modified: trunk/Scribus/scribus/scstreamfilter_jpeg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scstreamfilter_jpeg.cpp
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter_jpeg.cpp	(original)
+++ trunk/Scribus/scribus/scstreamfilter_jpeg.cpp	Sun Mar 27 13:49:46 2022
@@ -46,11 +46,11 @@
 
 struct ScJpegDestinationMgr : public jpeg_destination_mgr 
 {
-    ScJpegEncodeFilter *filter;
-    JOCTET buffer[BUFFER_SIZE];
+	ScJpegEncodeFilter* filter { nullptr };
+	JOCTET buffer[BUFFER_SIZE];
 
 public:
-    ScJpegDestinationMgr(ScJpegEncodeFilter *);
+	ScJpegDestinationMgr(ScJpegEncodeFilter *);
 
 	static boolean jpegEmptyBuffer(j_compress_ptr cinfo);
 	static void    jpegDestinationInit(j_compress_ptr);
@@ -63,49 +63,49 @@
 
 boolean ScJpegDestinationMgr::jpegEmptyBuffer(j_compress_ptr cinfo)
 {
-    ScJpegDestinationMgr* dest = (ScJpegDestinationMgr*) cinfo->dest;
-
-    bool written = dest->filter->writeDataInternal((const char*) dest->buffer, BUFFER_SIZE);
-    if (!written)
-        (*cinfo->err->error_exit)((j_common_ptr) cinfo);
-
-    dest->next_output_byte = dest->buffer;
-    dest->free_in_buffer   = BUFFER_SIZE;
-
-    return boolean(true);
+	ScJpegDestinationMgr* dest = (ScJpegDestinationMgr*) cinfo->dest;
+
+	bool written = dest->filter->writeDataInternal((const char*) dest->buffer, BUFFER_SIZE);
+	if (!written)
+		(*cinfo->err->error_exit)((j_common_ptr) cinfo);
+
+	dest->next_output_byte = dest->buffer;
+	dest->free_in_buffer   = BUFFER_SIZE;
+
+	return boolean(true);
 }
 
 void ScJpegDestinationMgr::jpegDestinationTerm(j_compress_ptr cinfo)
 {
-    ScJpegDestinationMgr* dest = (ScJpegDestinationMgr*) cinfo->dest;
-    int n = BUFFER_SIZE - dest->free_in_buffer;
-
-    bool written = dest->filter->writeDataInternal((const char*) dest->buffer, n);
-    if (!written)
-        (*cinfo->err->error_exit)((j_common_ptr)cinfo);
+	ScJpegDestinationMgr* dest = (ScJpegDestinationMgr*) cinfo->dest;
+	int n = BUFFER_SIZE - dest->free_in_buffer;
+
+	bool written = dest->filter->writeDataInternal((const char*) dest->buffer, n);
+	if (!written)
+		(*cinfo->err->error_exit)((j_common_ptr)cinfo);
 }
 
 ScJpegDestinationMgr::ScJpegDestinationMgr(ScJpegEncodeFilter *filter)
 {
 	jpeg_destination_mgr::empty_output_buffer = jpegEmptyBuffer;
-    jpeg_destination_mgr::init_destination    = jpegDestinationInit;
-    jpeg_destination_mgr::term_destination    = jpegDestinationTerm;
-    this->filter     = filter;
-    next_output_byte = buffer;
-    free_in_buffer   = BUFFER_SIZE;
+	jpeg_destination_mgr::init_destination    = jpegDestinationInit;
+	jpeg_destination_mgr::term_destination    = jpegDestinationTerm;
+	this->filter     = filter;
+	next_output_byte = buffer;
+	free_in_buffer   = BUFFER_SIZE;
 }
 
 struct ScJpegEncodeFilterData
 {
 	struct   jpeg_compress_struct  cinfo;
-	struct   ScJpegDestinationMgr* cdest;
+	struct   ScJpegDestinationMgr* cdest { nullptr };
 	JSAMPROW row_pointer[1];
 
 	ScJpegEncodeFilterData();
 	~ScJpegEncodeFilterData();
 };
 
-ScJpegEncodeFilterData::ScJpegEncodeFilterData() : cdest(nullptr)
+ScJpegEncodeFilterData::ScJpegEncodeFilterData()
 {
 	row_pointer[0] = nullptr;
 }
@@ -119,24 +119,22 @@
 
 ScJpegEncodeFilter::ScJpegEncodeFilter(QDataStream* stream, unsigned int imgWidth, unsigned int imgHeight, 
 		            ScJpegEncodeFilter::Color color) : ScStreamFilter(stream), m_width(imgWidth), m_height(imgHeight),
-					m_quality(75), m_color(color)
-{
-	m_filterData = nullptr;
-	m_openedFilter = false;
+					m_color(color)
+{
+
 }
 
 ScJpegEncodeFilter::ScJpegEncodeFilter(ScStreamFilter* filter, unsigned int imgWidth, unsigned int imgHeight, 
 					ScJpegEncodeFilter::Color color) : ScStreamFilter(filter), m_width(imgWidth), m_height(imgHeight),
-					m_quality(75), m_color(color)
-{
-	m_filterData = nullptr;
-	m_openedFilter = false;
+					m_color(color)
+{
+
 }
 
 ScJpegEncodeFilter::~ScJpegEncodeFilter()
 {
 	if (m_filterData && m_openedFilter)
-		closeFilter();
+		ScJpegEncodeFilter::closeFilter();
 	freeData();
 }
 

Modified: trunk/Scribus/scribus/scstreamfilter_jpeg.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scstreamfilter_jpeg.h
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter_jpeg.h	(original)
+++ trunk/Scribus/scribus/scstreamfilter_jpeg.h	Sun Mar 27 13:49:46 2022
@@ -18,34 +18,33 @@
 	friend struct ScJpegDestinationMgr;
 
 public:
-
-	typedef enum  {
+	enum Color
+	{
 		RGB,
 		CMYK,
 		GRAY
-	} Color;
+	};
 
 	ScJpegEncodeFilter(QDataStream* stream, unsigned int imgWidth, unsigned int imgHeight, ScJpegEncodeFilter::Color color);
 	ScJpegEncodeFilter(ScStreamFilter* filter, unsigned int imgWidth, unsigned int imgHeight, ScJpegEncodeFilter::Color color);
-	~ScJpegEncodeFilter();
+	~ScJpegEncodeFilter() override;
 
-	virtual bool openFilter ();
-	virtual bool closeFilter();
+	bool openFilter () override;
+	bool closeFilter() override;
 
-	virtual bool writeData(const char* data, int dataLen);
+	bool writeData(const char* data, int dataLen) override;
 
 	void setQuality(int quality) { m_quality = qMin(qMax(0, quality), 100); }
 
 protected:
-
-	ScJpegEncodeFilterData* m_filterData;
+	bool  m_openedFilter { false };
+	ScJpegEncodeFilterData* m_filterData { nullptr };
 
 	void  freeData();
-	bool  m_openedFilter;
 
-	unsigned int m_width;
-	unsigned int m_height;
-	int          m_quality;
+	unsigned int m_width { 0 };
+	unsigned int m_height { 0 };
+	int          m_quality { 75 };
 	Color        m_color;
 };
 

Modified: trunk/Scribus/scribus/scstreamfilter_rc4.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scstreamfilter_rc4.cpp
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter_rc4.cpp	(original)
+++ trunk/Scribus/scribus/scstreamfilter_rc4.cpp	Sun Mar 27 13:49:46 2022
@@ -22,21 +22,19 @@
 ScRC4EncodeFilter::ScRC4EncodeFilter(QDataStream* stream, const char* key, unsigned int keyLen)
 				 : ScStreamFilter(stream), m_key(key, keyLen)
 {
-	m_filterData = nullptr;
-	m_openedFilter = false;
+
 }
 
 ScRC4EncodeFilter::ScRC4EncodeFilter(ScStreamFilter* filter, const char* key, unsigned int keyLen)
 				 : ScStreamFilter(filter), m_key(key, keyLen)
 {
-	m_filterData = nullptr;
-	m_openedFilter = false;
+
 }
 
 ScRC4EncodeFilter::~ScRC4EncodeFilter()
 {
 	if (m_filterData && m_openedFilter)
-		closeFilter();
+		ScRC4EncodeFilter::closeFilter();
 	freeData();
 }
 
@@ -77,28 +75,29 @@
 bool ScRC4EncodeFilter::writeData(const char* data, int dataLen)
 {
 	bool rc4Success = true;
-    unsigned int count;
-    const unsigned char *p = (const unsigned char *) data;
+	unsigned int count;
+	const unsigned char *p = (const unsigned char *) data;
 
 	if (!m_filterData)
 		return false;
 
-    while (dataLen) {
-        count = dataLen;
-        if (count > BUFFER_SIZE - m_filterData->available_in)
-            count = BUFFER_SIZE - m_filterData->available_in;
-        memcpy (m_filterData->input_buffer + m_filterData->available_in, p, count);
-        p += count;
-        m_filterData->available_in += count;
-        dataLen -= count;
+	while (dataLen)
+	{
+		count = dataLen;
+		if (count > BUFFER_SIZE - m_filterData->available_in)
+			count = BUFFER_SIZE - m_filterData->available_in;
+		memcpy (m_filterData->input_buffer + m_filterData->available_in, p, count);
+		p += count;
+		m_filterData->available_in += count;
+		dataLen -= count;
 
-        if (m_filterData->available_in == BUFFER_SIZE)
+		if (m_filterData->available_in == BUFFER_SIZE)
 		{
 			rc4_encrypt(&m_filterData->rc4_context, m_filterData->input_buffer, m_filterData->output_buffer, m_filterData->available_in);
 			rc4Success &= writeDataInternal((const char*) m_filterData->output_buffer, m_filterData->available_in);
 			m_filterData->available_in = 0;
 		}
-    }
+	}
 
 	return rc4Success;
 }

Modified: trunk/Scribus/scribus/scstreamfilter_rc4.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/scstreamfilter_rc4.h
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter_rc4.h	(original)
+++ trunk/Scribus/scribus/scstreamfilter_rc4.h	Sun Mar 27 13:49:46 2022
@@ -18,21 +18,21 @@
 {
 protected:
 
-	ScRC4EncodeFilterData* m_filterData;
+	bool m_openedFilter { false };
+	ScRC4EncodeFilterData* m_filterData { nullptr };
 	QByteArray             m_key;
 
 	void freeData(void);
-	bool m_openedFilter;
 
 public:
 	ScRC4EncodeFilter(QDataStream* stream, const char* key, unsigned int keyLen);
 	ScRC4EncodeFilter(ScStreamFilter* filter, const char* key, unsigned int keyLen);
-	~ScRC4EncodeFilter();
+	~ScRC4EncodeFilter() override;
 
-	virtual bool openFilter ();
-	virtual bool closeFilter();
+	bool openFilter () override;
+	bool closeFilter() override;
 
-	virtual bool writeData(const char* data, int dataLen);
+	bool writeData(const char* data, int dataLen) override;
 };
 
 #endif

Modified: trunk/Scribus/scribus/selectionrubberband.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/selectionrubberband.cpp
==============================================================================
--- trunk/Scribus/scribus/selectionrubberband.cpp	(original)
+++ trunk/Scribus/scribus/selectionrubberband.cpp	Sun Mar 27 13:49:46 2022
@@ -9,13 +9,9 @@
 {
 }
 
-SelectionRubberBand::~SelectionRubberBand()
-{
-}
-
 void SelectionRubberBand::paintEvent(QPaintEvent *p)
 {
-	QColor drawColor = qApp->palette().color(QPalette::Active, QPalette::Highlight);
+	QColor drawColor = QApplication::palette().color(QPalette::Active, QPalette::Highlight);
 	QPen pen(drawColor, 2, Qt::DashLine, Qt::FlatCap, Qt::MiterJoin);
 	pen.setStyle(Qt::DashLine);
 

Modified: trunk/Scribus/scribus/selectionrubberband.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/selectionrubberband.h
==============================================================================
--- trunk/Scribus/scribus/selectionrubberband.h	(original)
+++ trunk/Scribus/scribus/selectionrubberband.h	Sun Mar 27 13:49:46 2022
@@ -11,9 +11,10 @@
 	Q_OBJECT
 	public:
 		SelectionRubberBand(QRubberBand::Shape s, QWidget * p = 0);
-		~SelectionRubberBand();
+		~SelectionRubberBand() = default;
 
-		virtual void paintEvent(QPaintEvent *p);
+	protected:
+		void paintEvent(QPaintEvent *p) override;
 
 };
 

Modified: trunk/Scribus/scribus/text/screenpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/text/screenpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/text/screenpainter.cpp	(original)
+++ trunk/Scribus/scribus/text/screenpainter.cpp	Sun Mar 27 13:49:46 2022
@@ -23,8 +23,6 @@
 	, m_item(item)
 	, m_fillColor("", -1)
 	, m_strokeColor("", -1)
-	, m_cairoFace(nullptr)
-	, m_faceIndex(-10) // ScFace::faceIndex() defaults to -1, we need a different value
 {
 	m_painter->save();
 
@@ -354,7 +352,7 @@
 	m_painter->restore();
 }
 
-void ScreenPainter::clip(QRectF rect)
+void ScreenPainter::clip(const QRectF& rect)
 {
 	m_painter->newPath();
 	m_painter->moveTo(rect.x() + x(), y());
@@ -380,14 +378,14 @@
 	if (selected() && rect)
 	{
 		// we are drawing a selection rect
-		QColor color = qApp->palette().color(QPalette::Active, QPalette::Highlight);
+		QColor color = QApplication::palette().color(QPalette::Active, QPalette::Highlight);
 		m_painter->setBrush(color);
 		m_painter->setPen(color, strokeWidth(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	}
 	else if (selected())
 	{
 		// we are drawing selected text
-		QColor color = qApp->palette().color(QPalette::Active, QPalette::HighlightedText);
+		QColor color = QApplication::palette().color(QPalette::Active, QPalette::HighlightedText);
 		m_painter->setBrush(color);
 		m_painter->setPen(color, strokeWidth(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	}

Modified: trunk/Scribus/scribus/text/screenpainter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/text/screenpainter.h
==============================================================================
--- trunk/Scribus/scribus/text/screenpainter.h	(original)
+++ trunk/Scribus/scribus/text/screenpainter.h	Sun Mar 27 13:49:46 2022
@@ -27,22 +27,22 @@
 	void drawRect(const QRectF& rect) override;
 	void drawObject(PageItem* embedded) override;
 
-	void clip(QRectF rect);
+	void clip(const QRectF& rect);
 	void saveState();
 	void restoreState();
 
 private:
 	void setupState(bool rect);
 
-	ScPainter *m_painter;
-	PageItem *m_item;
+	ScPainter *m_painter { nullptr };
+	PageItem *m_item { nullptr };
 	TextLayoutColor m_fillColor;
 	TextLayoutColor m_strokeColor;
 	QColor m_fillQColor;
 	QColor m_fillStrokeQColor;
-	cairo_font_face_t *m_cairoFace;
+	cairo_font_face_t *m_cairoFace { nullptr };
 	QString m_fontPath;
-	int m_faceIndex;
+	int m_faceIndex { -10 }; // ScFace::faceIndex() defaults to -1, we need a different value
 };
 
 #endif // SCREENPAINTER_H

Modified: trunk/Scribus/scribus/text/shapedtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/text/shapedtext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/shapedtext.cpp	(original)
+++ trunk/Scribus/scribus/text/shapedtext.cpp	Sun Mar 27 13:49:46 2022
@@ -14,7 +14,7 @@
 {
 	
 public:
-	ShapedTextImplementation(ITextSource* src, int firstChar, int lastChar, ITextContext* ctx) : m_needsContext(false), m_source(src), m_context(ctx)
+	ShapedTextImplementation(const ITextSource* src, int firstChar, int lastChar, const ITextContext* ctx) : m_source(src), m_context(ctx)
 	{
 		m_firstChar = firstChar;
 		m_lastChar = lastChar < 0? src->length() - 1 : lastChar;
@@ -24,9 +24,9 @@
 	{}
 	
 	
-	bool m_needsContext;
-	const ITextSource* m_source;
-	const ITextContext* m_context;
+	bool m_needsContext { false };
+	const ITextSource* m_source { nullptr };
+	const ITextContext* m_context { nullptr };
 	int m_firstChar;
 	int m_lastChar;
 	QList<GlyphCluster> m_glyphs;
@@ -47,7 +47,7 @@
 		result->m_firstChar = charPos;
 		result->m_glyphs.erase(result->m_glyphs.begin(), result->m_glyphs.begin() + pos);
 		return ShapedText(result);
-}
+	}
 	
 	/** only possible if they are adjacent pieces of the same text source */
 	bool canCombine(const QSharedPointer<ShapedTextImplementation>  other) const
@@ -87,7 +87,7 @@
 
 
 ShapedText::ShapedText(ShapedTextImplementation* my_p_impl) : p_impl(my_p_impl) {}
-ShapedText::ShapedText(ITextSource* src, int firstChar, int lastChar, ITextContext* ctx) : p_impl(new ShapedTextImplementation(src,firstChar,lastChar,ctx)) {}
+ShapedText::ShapedText(const ITextSource* src, int firstChar, int lastChar, const ITextContext* ctx) : p_impl(new ShapedTextImplementation(src, firstChar, lastChar, ctx)) {}
 ShapedText::ShapedText(const ShapedText& other) : p_impl(other.p_impl) {}
 	
 bool ShapedText::needsContext() const { return p_impl->m_needsContext; }
@@ -101,5 +101,5 @@
 bool ShapedText::canSplit(int pos) const { return p_impl->canSplit(pos); }
 ShapedText ShapedText::split(int pos) { return p_impl->split(pos); }
 bool ShapedText::canCombine(const ShapedText& other) const { return p_impl->canCombine(other.p_impl); }
-void ShapedText::combine(ShapedText& other) { p_impl->combine(other.p_impl); }
+void ShapedText::combine(const ShapedText& other) { p_impl->combine(other.p_impl); }
 

Modified: trunk/Scribus/scribus/text/shapedtext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/text/shapedtext.h
==============================================================================
--- trunk/Scribus/scribus/text/shapedtext.h	(original)
+++ trunk/Scribus/scribus/text/shapedtext.h	Sun Mar 27 13:49:46 2022
@@ -34,13 +34,13 @@
  */
 class ShapedText 
 {
-    QSharedPointer<ShapedTextImplementation> p_impl;
+	QSharedPointer<ShapedTextImplementation> p_impl;
 	ShapedText(ShapedTextImplementation* p_impl);
 	
 	friend class ShapedTextImplementation;
 
 public:
-	ShapedText(ITextSource* src, int firstChar, int lastChar, ITextContext* ctx = nullptr);
+	ShapedText(const ITextSource* src, int firstChar, int lastChar, const ITextContext* ctx = nullptr);
 	ShapedText(const ShapedText& other);
 	
 	static ShapedText Invalid;
@@ -63,7 +63,7 @@
 	ShapedText split(int charPos);
 	/** only possible if they are adjacent pieces of the same text source */
 	bool canCombine(const ShapedText& other) const;
-	void combine(ShapedText& other);
+	void combine(const ShapedText& other);
 };
 
 

Modified: trunk/Scribus/scribus/ui/colorcombo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/colorcombo.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorcombo.cpp	(original)
+++ trunk/Scribus/scribus/ui/colorcombo.cpp	Sun Mar 27 13:49:46 2022
@@ -56,7 +56,7 @@
 	return colorName;
 }
 
-void ColorCombo::setColors(ColorList& list, bool insertNone)
+void ColorCombo::setColors(const ColorList& list, bool insertNone)
 {
 	ColorListBox* clb = qobject_cast<ColorListBox*>(view());
 	if (!clb)

Modified: trunk/Scribus/scribus/ui/colorcombo.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/colorcombo.h
==============================================================================
--- trunk/Scribus/scribus/ui/colorcombo.h	(original)
+++ trunk/Scribus/scribus/ui/colorcombo.h	Sun Mar 27 13:49:46 2022
@@ -49,7 +49,7 @@
 
 	QString currentColor() const;
 
-	void setColors(ColorList& list, bool insertNone = true);
+	void setColors(const ColorList& list, bool insertNone = true);
 	void setCurrentColor(QString colorName);
 	void setPixmapType(ColorCombo::PixmapType type);
 

Modified: trunk/Scribus/scribus/ui/scresizecursor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/scresizecursor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scresizecursor.cpp	(original)
+++ trunk/Scribus/scribus/ui/scresizecursor.cpp	Sun Mar 27 13:49:46 2022
@@ -23,7 +23,6 @@
 
 ScResizeCursor::ScResizeCursor()
 {
-	m_currIndex = 0;
 	initCursorDb(m_currIndex);
 }
 
@@ -38,7 +37,7 @@
 	initCursorDb(m_currIndex);
 }
 
-ScResizeCursor::operator const QCursor &()
+ScResizeCursor::operator const QCursor &() const
 {
 	return m_cursors[m_currIndex];
 }

Modified: trunk/Scribus/scribus/ui/scresizecursor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/scresizecursor.h
==============================================================================
--- trunk/Scribus/scribus/ui/scresizecursor.h	(original)
+++ trunk/Scribus/scribus/ui/scresizecursor.h	Sun Mar 27 13:49:46 2022
@@ -41,14 +41,14 @@
 	*/
 	ScResizeCursor();
 	ScResizeCursor(double rotation);
-	~ScResizeCursor() {}
+	~ScResizeCursor() = default;
 		
-	operator const QCursor& ();
+	operator const QCursor& () const;
 
 private:
 	void initCursorDb(int idx);
 	static QMap<unsigned int, QCursor> m_cursors;
-	int m_currIndex;
+	int m_currIndex { 0 };
 };
 
 #endif // SCCURSOR_H

Modified: trunk/Scribus/scribus/ui/scrspinbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/scrspinbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.cpp	(original)
+++ trunk/Scribus/scribus/ui/scrspinbox.cpp	Sun Mar 27 13:49:46 2022
@@ -25,12 +25,12 @@
 
 static const QString FinishTag("\xA0");
 
-ScrSpinBox::ScrSpinBox(QWidget *parent, int unitIndex) : QDoubleSpinBox(parent), m_constants(nullptr)
+ScrSpinBox::ScrSpinBox(QWidget *parent, int unitIndex) : QDoubleSpinBox(parent)
 {
 	init(unitIndex);
 }
 
-ScrSpinBox::ScrSpinBox(double minValue, double maxValue, QWidget *pa, int unitIndex) : QDoubleSpinBox(pa), m_constants(nullptr)
+ScrSpinBox::ScrSpinBox(double minValue, double maxValue, QWidget *pa, int unitIndex) : QDoubleSpinBox(pa)
 {
 	init(unitIndex);
 	setMinimum(minValue);

Modified: trunk/Scribus/scribus/ui/scrspinbox.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/scrspinbox.h
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.h	(original)
+++ trunk/Scribus/scribus/ui/scrspinbox.h	Sun Mar 27 13:49:46 2022
@@ -55,7 +55,7 @@
 	
 	protected:
 		uint m_unitIndex { 0 };
-		const QMap<QString, double>* m_constants;
+		const QMap<QString, double>* m_constants { nullptr };
 
 		void setParameters(int s);
 		bool eventFilter ( QObject * watched, QEvent * event ) override;

Modified: trunk/Scribus/scribus/ui/sctablewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/sctablewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/sctablewidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/sctablewidget.cpp	Sun Mar 27 13:49:46 2022
@@ -17,10 +17,6 @@
 }
 
 ScTableWidget::ScTableWidget( int rows, int columns, QWidget *parent) : QTableWidget(rows, columns, parent)
-{
-}
-
-ScTableWidget::~ScTableWidget()
 {
 }
 

Modified: trunk/Scribus/scribus/ui/sctablewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/sctablewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/sctablewidget.h	(original)
+++ trunk/Scribus/scribus/ui/sctablewidget.h	Sun Mar 27 13:49:46 2022
@@ -20,9 +20,11 @@
 	public:
 		ScTableWidget ( QWidget* parent = nullptr );
 		ScTableWidget ( int rows, int columns, QWidget* parent = nullptr );
-		~ScTableWidget ();
+		~ScTableWidget () = default;
+
 		void setCellWidget ( int row, int column, QWidget * widget );
 		void removeCellWidget ( int row, int column );
+
 	protected:
 		bool eventFilter(QObject *obj, QEvent *event);
 

Modified: trunk/Scribus/scribus/ui/search.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/search.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/search.cpp	(original)
+++ trunk/Scribus/scribus/ui/search.cpp	Sun Mar 27 13:49:46 2022
@@ -5,6 +5,8 @@
 for which a new license (GPL+exception) is in place.
 */
 #include "search.h"
+
+#include <array>
 
 #include <QCheckBox>
 #include <QComboBox>
@@ -112,10 +114,9 @@
 	SearchLayout->addWidget( searchStyleValue, 1, 1 );
 	searchAlignValue = new QComboBox( searchGroupBox );
 	searchAlignValue->setEditable(false);
-	QString tmp_sty[] = { tr("Left"), tr("Center"), tr("Right"), tr("Block"), tr("Forced")};
-	size_t ar_sty = sizeof(tmp_sty) / sizeof(*tmp_sty);
-	for (uint a = 0; a < ar_sty; ++a)
-		searchAlignValue->addItem( tmp_sty[a] );
+	std::array<QString, 5> tmp_sty = { tr("Left"), tr("Center"), tr("Right"), tr("Block"), tr("Forced") };
+	for (size_t i = 0; i < tmp_sty.size(); ++i)
+		searchAlignValue->addItem( tmp_sty[i] );
 	tmpView = qobject_cast<QListView*>(searchAlignValue->view()); Q_ASSERT(tmpView);
 	tmpWidth = tmpView->sizeHintForColumn(0);
 	if (tmpWidth > 0)
@@ -211,8 +212,8 @@
 	ReplaceLayout->addWidget( replaceStyleValue, 1, 1 );
 	replaceAlignValue = new QComboBox( replaceGroupBox );
 	replaceAlignValue->setEditable(false);
-	for (uint a = 0; a < ar_sty; ++a)
-		replaceAlignValue->addItem(tmp_sty[a]);
+	for (uint i = 0; i < tmp_sty.size(); ++i)
+		replaceAlignValue->addItem(tmp_sty[i]);
 	tmpView = qobject_cast<QListView*>(replaceAlignValue->view()); Q_ASSERT(tmpView);
 	tmpWidth = tmpView->sizeHintForColumn(0);
 	if (tmpWidth > 0)
@@ -592,8 +593,9 @@
 
 		QTextCursor cursor = storyTextEdit->textCursor();
 		int position  = cursor.position();
-		StoryText& styledText = storyTextEdit->StyledText;
-		int firstChar = -1, lastChar = styledText.length();
+		const StoryText& styledText = storyTextEdit->StyledText;
+		int firstChar = -1;
+		int lastChar = styledText.length();
 		if (searchTextCheckBox->isChecked())
 		{
 			Qt::CaseSensitivity cs = Qt::CaseSensitive;
@@ -872,7 +874,7 @@
 	doSearch();
 }
 
-int SearchReplace::firstMatchCursorPosition()
+int SearchReplace::firstMatchCursorPosition() const
 {
 	return m_firstMatchPosition;
 }
@@ -918,13 +920,8 @@
 	if (m_found)
 		return;
 
-//	if (m_itemMode)
-//		ScMessageBox::information(this, tr("Search/Replace"), tr("Search finished));
-//	else
-//	{
 	ScMessageBox::information(this, tr("Search/Replace"), tr("Search finished. ") + tr("%n match(es) found", "", m_matchesFound));
 	m_matchesFound = 0;
-//	}
 }
 
 void SearchReplace::enableTxSearch()

Modified: trunk/Scribus/scribus/ui/search.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/search.h
==============================================================================
--- trunk/Scribus/scribus/ui/search.h	(original)
+++ trunk/Scribus/scribus/ui/search.h	Sun Mar 27 13:49:46 2022
@@ -36,7 +36,7 @@
 	SearchReplace(QWidget* parent, ScribusDoc *doc, PageItem* item, bool mode = true );
 	~SearchReplace() {};
 
-	int firstMatchCursorPosition();
+	int firstMatchCursorPosition() const;
 	void setSearchedText(const QString& text);
 
 	ColorCombo* replaceFillValue;

Modified: trunk/Scribus/scribus/ui/selectobjects.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/selectobjects.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/selectobjects.cpp	(original)
+++ trunk/Scribus/scribus/ui/selectobjects.cpp	Sun Mar 27 13:49:46 2022
@@ -28,7 +28,7 @@
 #include "commonstrings.h"
 #include "iconmanager.h"
 
-selectDialog::selectDialog(QWidget* parent, ColorList &availableColors, int unitIndex) : QDialog(parent)
+selectDialog::selectDialog(QWidget* parent, const ColorList &availableColors, int unitIndex) : QDialog(parent)
 {
 	setupUi(this);
 	setModal(true);
@@ -42,7 +42,7 @@
 	lineWidthSpin->setMaximum(1000);
 }
 
-int selectDialog::getSelectionRange()
+int selectDialog::getSelectionRange() const
 {
 	int retval = 0;
 	if (buttonCurrentPage->isChecked())
@@ -54,7 +54,7 @@
 	return retval;
 }
 
-bool selectDialog::useAttributes()
+bool selectDialog::useAttributes() const
 {
 	return attributeGroup->isChecked();
 }

Modified: trunk/Scribus/scribus/ui/selectobjects.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/selectobjects.h
==============================================================================
--- trunk/Scribus/scribus/ui/selectobjects.h	(original)
+++ trunk/Scribus/scribus/ui/selectobjects.h	Sun Mar 27 13:49:46 2022
@@ -37,10 +37,11 @@
 	Q_OBJECT
 
 public:
-	selectDialog(QWidget* parent, ColorList &availableColors, int unitIndex);
+	selectDialog(QWidget* parent, const ColorList &availableColors, int unitIndex);
 	~selectDialog() {};
-	int getSelectionRange();
-	bool useAttributes();
+
+	int getSelectionRange() const;
+	bool useAttributes() const;
 	void getUsedAttributes(bool &Type, bool &Fill, bool &Line, bool &LWidth, bool &Print, bool &Locked, bool &Resize);
 	void getUsedAttributesValues(int &Type, QString &Fill, QString &Line, double &LWidth, bool &Print, bool &Locked, bool &Resize);
 };

Modified: trunk/Scribus/scribus/ui/shadebutton.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/shadebutton.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/shadebutton.cpp	(original)
+++ trunk/Scribus/scribus/ui/shadebutton.cpp	Sun Mar 27 13:49:46 2022
@@ -4,31 +4,31 @@
 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 <array>
+
 #include "shadebutton.h"
 #include "query.h"
 
-
 ShadeButton::ShadeButton(QWidget* parent) : QToolButton(parent)
 {
-	QString tmp[] = {"0 %", "10 %", "20 %", "30 %", "40 %", "50 %", "60 %", "70 %", "80 %", "90 %", "100 %"};
-	size_t array = sizeof(tmp) / sizeof(*tmp);
-	FillSh = new QMenu();
-	FillSh->addAction( tr("Other..."))->setCheckable(true);
-	for (uint i = 0; i < array; ++i)
-		FillSh->addAction(tmp[i])->setCheckable(true);
-	setMenu(FillSh);
+	std::array<QString, 11> tmp = {"0 %", "10 %", "20 %", "30 %", "40 %", "50 %", "60 %", "70 %", "80 %", "90 %", "100 %"};
+	fillShadeMenu = new QMenu();
+	fillShadeMenu->addAction( tr("Other..."))->setCheckable(true);
+	for (size_t i = 0; i < tmp.size(); ++i)
+		fillShadeMenu->addAction(tmp[i])->setCheckable(true);
+	setMenu(fillShadeMenu);
 	setPopupMode(QToolButton::InstantPopup);
 	setText("100 %");
-	FillSh->actions().at(11)->setChecked(true);
-	connect( FillSh, SIGNAL(triggered(QAction *)), this, SLOT(setShade(QAction *)));
+	fillShadeMenu->actions().at(11)->setChecked(true);
+	connect( fillShadeMenu, SIGNAL(triggered(QAction *)), this, SLOT(setShade(QAction *)));
 }
 
 void ShadeButton::setShade(QAction *act)
 {
-	for (int i = 0; i < FillSh->actions().count(); ++i)
-		FillSh->actions().at(i)->setChecked(false);
+	for (int i = 0; i < fillShadeMenu->actions().count(); ++i)
+		fillShadeMenu->actions().at(i)->setChecked(false);
 	act->setChecked(true);
-	QList<QAction*> actList = FillSh->actions();
+	QList<QAction*> actList = fillShadeMenu->actions();
 	int b = 100;
 	int c = actList.indexOf(act);
 	if (c < 0)
@@ -56,7 +56,7 @@
 	emit clicked();
 }
 
-int ShadeButton::getValue()
+int ShadeButton::getValue() const
 {
 	int l = text().length();
 	QString tx(text().remove(l-2, 2));
@@ -65,7 +65,7 @@
 
 void ShadeButton::setValue(int val)
 {
-	QList<QAction*> fillActions = FillSh->actions();
+	QList<QAction*> fillActions = fillShadeMenu->actions();
 	for (int i = 0; i < fillActions.count(); ++i)
 		fillActions[i]->setChecked(false);
 	if ((val % 10) == 0)

Modified: trunk/Scribus/scribus/ui/shadebutton.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/shadebutton.h
==============================================================================
--- trunk/Scribus/scribus/ui/shadebutton.h	(original)
+++ trunk/Scribus/scribus/ui/shadebutton.h	Sun Mar 27 13:49:46 2022
@@ -18,11 +18,12 @@
 	public:
 		ShadeButton(QWidget* parent);
 		~ShadeButton() {};
-		int getValue();
+
+		int getValue() const;
 		void setValue(int val);
 
 	protected:
-		QMenu *FillSh;
+		QMenu *fillShadeMenu { nullptr };
 
 	private slots:
 		virtual void setShade(QAction *act);

Modified: trunk/Scribus/scribus/ui/shortcutwidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/shortcutwidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/shortcutwidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/shortcutwidget.cpp	Sun Mar 27 13:49:46 2022
@@ -18,14 +18,7 @@
 {
 	setupUi(this);
 
-	Part0 = "";
-	Part1 = "";
-	Part2 = "";
-	Part3 = "";
-	keyCode = 0;
 	setKeyButton->setCheckable(true);
-	requiredModifiers=0;
-	allowedModifiers=0;
 
 	languageChange();
 
@@ -35,8 +28,8 @@
 
 void ShortcutWidget::setAllowedModifiers(int allowed, int required)
 {
-	allowedModifiers=allowed;
-	requiredModifiers=required;
+	allowedModifiers = allowed;
+	requiredModifiers = required;
 }
 
 void ShortcutWidget::changeEvent(QEvent *e)
@@ -74,45 +67,45 @@
 		if (!keyDisplay->text().isEmpty())
 		{
 			tl = keyDisplay->text().split("+", Qt::SkipEmptyParts);
-			Part4 = tl.last();
-			if (Part4 == tr("Alt") || Part4 == tr("Ctrl") || Part4 == tr("Shift") || Part4 == tr("Meta"))
-				Part4 = "";
+			m_part4 = tl.last();
+			if (m_part4 == tr("Alt") || m_part4 == tr("Ctrl") || m_part4 == tr("Shift") || m_part4 == tr("Meta"))
+				m_part4.clear();
 		}
 		else
-			Part4 = "";
+			m_part4.clear();
 		switch (k->key())
 		{
 			case Qt::Key_Meta:
 				if ((allowedModifiers&Qt::META)==Qt::META)
 				{
-					Part0 = tr("Meta+");
-					keyCode |= Qt::META;
+					m_part0 = tr("Meta+");
+					m_keyCode |= Qt::META;
 				}
 				break;
 			case Qt::Key_Shift:
 				if ((allowedModifiers&Qt::SHIFT)==Qt::SHIFT)
 				{
-					Part3 = tr("Shift+");
-					keyCode |= Qt::SHIFT;
+					m_part3 = tr("Shift+");
+					m_keyCode |= Qt::SHIFT;
 				}
 				break;
 			case Qt::Key_Alt:
 				if ((allowedModifiers&Qt::ALT)==Qt::ALT)
 				{
-					Part2 = tr("Alt+");
-					keyCode |= Qt::ALT;
+					m_part2 = tr("Alt+");
+					m_keyCode |= Qt::ALT;
 				}
 				break;
 			case Qt::Key_Control:
 				if ((allowedModifiers&Qt::CTRL)==Qt::CTRL)
 				{
-					Part1 = tr("Ctrl+");
-					keyCode |= Qt::CTRL;
+					m_part1 = tr("Ctrl+");
+					m_keyCode |= Qt::CTRL;
 				}
 				break;
 			default:
-				keyCode |= k->key();
-				keyDisplay->setText(getKeyText(keyCode));
+				m_keyCode |= k->key();
+				keyDisplay->setText(getKeyText(m_keyCode));
 				setKeyButton->setChecked(false);
 				userDef->setChecked(true);
 				releaseKeyboard();
@@ -121,7 +114,7 @@
 	}
 	if (setKeyButton->isChecked())
 	{
-		keyDisplay->setText(Part0+Part1+Part2+Part3+Part4);
+		keyDisplay->setText(m_part0 + m_part1 + m_part2 + m_part3 + m_part4);
 	}
 }
 
@@ -133,33 +126,33 @@
 		{
 			QStringList tl;
 			tl = keyDisplay->text().split("+", Qt::SkipEmptyParts);
-			Part4 = tl.last();
-			if (Part4 == tr("Alt") || Part4 == tr("Ctrl") || Part4 == tr("Shift") || Part4 == tr("Meta"))
-				Part4 = "";
+			m_part4 = tl.last();
+			if (m_part4 == tr("Alt") || m_part4 == tr("Ctrl") || m_part4 == tr("Shift") || m_part4 == tr("Meta"))
+				m_part4.clear();
 		}
 		else
-			Part4 = "";
+			m_part4.clear();
 		if (k->key() == Qt::Key_Meta)
 		{
-			Part0 = "";
-			keyCode &= ~Qt::META;
+			m_part0.clear();
+			m_keyCode &= ~Qt::META;
 		}
 		if (k->key() == Qt::Key_Shift)
 		{
-			Part3 = "";
-			keyCode &= ~Qt::SHIFT;
+			m_part3.clear();
+			m_keyCode &= ~Qt::SHIFT;
 		}
 		if (k->key() == Qt::Key_Alt)
 		{
-			Part2 = "";
-			keyCode &= ~Qt::ALT;
+			m_part2.clear();
+			m_keyCode &= ~Qt::ALT;
 		}
 		if (k->key() == Qt::Key_Control)
 		{
-			Part1 = "";
-			keyCode &= ~Qt::CTRL;
-		}
-		keyDisplay->setText(Part0+Part1+Part2+Part3+Part4);
+			m_part1.clear();
+			m_keyCode &= ~Qt::CTRL;
+		}
+		keyDisplay->setText(m_part0 + m_part1 + m_part2 + m_part3 + m_part4);
 	}
 }
 
@@ -185,12 +178,12 @@
 {
 	if (setKeyButton->isChecked())
 	{
-		keyCode = 0;
-		Part0 = "";
-		Part1 = "";
-		Part2 = "";
-		Part3 = "";
-		Part4 = "";
+		m_keyCode = 0;
+		m_part0.clear();
+		m_part1.clear();
+		m_part2.clear();
+		m_part3.clear();
+		m_part4.clear();
 		grabKeyboard();
 	}
 	else

Modified: trunk/Scribus/scribus/ui/shortcutwidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/shortcutwidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/shortcutwidget.h	(original)
+++ trunk/Scribus/scribus/ui/shortcutwidget.h	Sun Mar 27 13:49:46 2022
@@ -36,14 +36,14 @@
 	void setNoKey();
 
 protected:
-	int keyCode;
-	QString Part0;
-	QString Part1;
-	QString Part2;
-	QString Part3;
-	QString Part4;
-	int requiredModifiers;
-	int allowedModifiers;
+	int m_keyCode { 0 };
+	QString m_part0;
+	QString m_part1;
+	QString m_part2;
+	QString m_part3;
+	QString m_part4;
+	int requiredModifiers { 0 };
+	int allowedModifiers { 0 };
 
 	void changeEvent(QEvent *e) override;
 	

Modified: trunk/Scribus/scribus/ui/smcellstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/smcellstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcellstylewidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/smcellstylewidget.cpp	Sun Mar 27 13:49:46 2022
@@ -168,7 +168,7 @@
 		fillColor->setCurrentText(s);
 }
 
-void SMCellStyleWidget::fillFillColorCombo(ColorList &colors)
+void SMCellStyleWidget::fillFillColorCombo(const ColorList &colors)
 {
 	fillColor->clear();
 

Modified: trunk/Scribus/scribus/ui/smcellstylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/smcellstylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smcellstylewidget.h	(original)
+++ trunk/Scribus/scribus/ui/smcellstylewidget.h	Sun Mar 27 13:49:46 2022
@@ -64,7 +64,7 @@
 	 *
 	 * @param colors list of colors to populate the combo with.
 	 */
-	void fillFillColorCombo(ColorList &colors);
+	void fillFillColorCombo(const ColorList &colors);
 	void showColors(const QList<CellStyle*> &cellStyles);
 
 protected:

Modified: trunk/Scribus/scribus/ui/smshadebutton.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/smshadebutton.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smshadebutton.cpp	(original)
+++ trunk/Scribus/scribus/ui/smshadebutton.cpp	Sun Mar 27 13:49:46 2022
@@ -47,9 +47,9 @@
 	if (ret)
 	{
 		setValue(m_pValue, true);
-		QList<QAction*> actList = FillSh->actions();
+		QList<QAction*> actList = fillShadeMenu->actions();
 		if (actList.last()->text() == useParentValueText())
-			FillSh->removeAction(actList.last());
+			fillShadeMenu->removeAction(actList.last());
 	}
 
 	return ret;
@@ -65,7 +65,7 @@
 {
 	QFont f(font());
 	f.setBold(wantBold);
-	FillSh->setFont(f);
+	fillShadeMenu->setFont(f);
 	ShadeButton::setFont(f);
 }
 
@@ -75,17 +75,17 @@
 	{
 		setFont(true);
 		QString upv = useParentValueText();
-		QList<QAction*> actList = FillSh->actions();
+		QList<QAction*> actList = fillShadeMenu->actions();
 		if (actList.last()->text() != upv)
-			FillSh->addAction(upv, this, SLOT(slotUseParent()));
+			fillShadeMenu->addAction(upv, this, SLOT(slotUseParent()));
 	}
 }
 
 void SMShadeButton::slotUseParent()
 {
 	m_useParentValue = true;
-	QList<QAction*> actList = FillSh->actions();
+	QList<QAction*> actList = fillShadeMenu->actions();
 	if (actList.last()->text() == useParentValueText())
-		FillSh->removeAction(actList.last());
+		fillShadeMenu->removeAction(actList.last());
 	emit clicked();
 }

Modified: trunk/Scribus/scribus/ui/stylecombos.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/stylecombos.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/stylecombos.cpp	(original)
+++ trunk/Scribus/scribus/ui/stylecombos.cpp	Sun Mar 27 13:49:46 2022
@@ -51,7 +51,7 @@
 	return currStyleName;
 }
 
-QString ParaStyleComboBox::firstItemString()
+QString ParaStyleComboBox::firstItemString() const
 {
 	QString itemString;
 	if (m_defaultStyle.isEmpty() || m_defaultStyle == CommonStrings::DefaultParagraphStyle)
@@ -182,7 +182,7 @@
 	return currStyleName;
 }
 
-QString CharStyleComboBox::firstItemString()
+QString CharStyleComboBox::firstItemString() const
 {
 	QString itemString;
 	if (m_defaultStyle.isEmpty() || m_defaultStyle == CommonStrings::DefaultCharacterStyle)
@@ -313,7 +313,7 @@
 	return currStyleName;
 }
 
-QString CellStyleComboBox::firstItemString()
+QString CellStyleComboBox::firstItemString() const
 {
 	QString itemString;
 	if (m_defaultStyle.isEmpty() || m_defaultStyle == CommonStrings::DefaultCellStyle)
@@ -445,7 +445,7 @@
 	return currStyleName;
 }
 
-QString TableStyleComboBox::firstItemString()
+QString TableStyleComboBox::firstItemString() const
 {
 	QString itemString;
 	if (m_defaultStyle.isEmpty() || m_defaultStyle == CommonStrings::DefaultTableStyle)

Modified: trunk/Scribus/scribus/ui/stylecombos.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/ui/stylecombos.h
==============================================================================
--- trunk/Scribus/scribus/ui/stylecombos.h	(original)
+++ trunk/Scribus/scribus/ui/stylecombos.h	Sun Mar 27 13:49:46 2022
@@ -57,7 +57,7 @@
 	ScribusDoc *m_doc { nullptr };
 	QString m_defaultStyle;
 
-	QString firstItemString();
+	QString firstItemString() const;
 
 	void changeEvent(QEvent *e) override;
 	void languageChange();
@@ -91,7 +91,7 @@
 	ScribusDoc *m_doc { nullptr };
 	QString m_defaultStyle;
 
-	QString firstItemString();
+	QString firstItemString() const;
 
 	void changeEvent(QEvent *e) override;
 	void languageChange();
@@ -125,7 +125,7 @@
 	ScribusDoc *m_doc { nullptr };
 	QString m_defaultStyle;
 
-	QString firstItemString();
+	QString firstItemString() const;
 
 	void changeEvent(QEvent *e) override;
 	void languageChange();
@@ -159,7 +159,7 @@
 	ScribusDoc *m_doc { nullptr };
 	QString m_defaultStyle;
 
-	QString firstItemString();
+	QString firstItemString() const;
 
 	void changeEvent(QEvent *e) override;
 	void languageChange();

Modified: trunk/Scribus/scribus/upgradechecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/upgradechecker.cpp
==============================================================================
--- trunk/Scribus/scribus/upgradechecker.cpp	(original)
+++ trunk/Scribus/scribus/upgradechecker.cpp	Sun Mar 27 13:49:46 2022
@@ -42,10 +42,6 @@
 #endif
 }
 
-UpgradeChecker::~UpgradeChecker()
-{
-}
-
 void UpgradeChecker::fetch()
 {
 	QString filename("scribusversions.xml");
@@ -58,7 +54,7 @@
 	if (m_networkManager != nullptr && m_file != nullptr)
 	{
 		outputText( tr("No data on your computer will be sent to an external location"));
-		qApp->processEvents();
+		QApplication::processEvents();
 		if (m_file->open(QIODevice::ReadWrite))
 		{
 			QString hostname("services.scribus.net");
@@ -80,7 +76,7 @@
 				if (m_writeToConsole)
 					std::cout << ". " << std::flush;
 				outputText( ".", true );
-				qApp->processEvents();
+				QApplication::processEvents();
 			}
 			if (m_writeToConsole)
 				std::cout << std::endl;
@@ -193,7 +189,7 @@
 	return true;
 }
 
-QStringList UpgradeChecker::upgradeData( )
+QStringList UpgradeChecker::upgradeData() const
 {
 	return m_updates;
 }
@@ -244,12 +240,8 @@
 
 UpgradeCheckerGUI::UpgradeCheckerGUI(QTextBrowser *tb) : UpgradeChecker()
 {
-	m_outputWidget=tb;
-	m_writeToConsole=false;
-}
-
-UpgradeCheckerGUI::~UpgradeCheckerGUI()
-{
+	m_outputWidget = tb;
+	m_writeToConsole = false;
 }
 
 void UpgradeCheckerGUI::outputText(const QString& text, bool noLineFeed)

Modified: trunk/Scribus/scribus/upgradechecker.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25064&path=/trunk/Scribus/scribus/upgradechecker.h
==============================================================================
--- trunk/Scribus/scribus/upgradechecker.h	(original)
+++ trunk/Scribus/scribus/upgradechecker.h	Sun Mar 27 13:49:46 2022
@@ -24,12 +24,12 @@
 	
 public:
 	UpgradeChecker();
-	~UpgradeChecker();
+	~UpgradeChecker() = default;
 	
 	void fetch();
 	bool process();
 	void show(bool error);
-	QStringList upgradeData();
+	QStringList upgradeData() const;
 	
 private slots:
 	void downloadFinished();
@@ -60,11 +60,11 @@
 	
 public:
 	UpgradeCheckerGUI(QTextBrowser *tb=0);
-	~UpgradeCheckerGUI();
+	~UpgradeCheckerGUI() = default;
 	
 protected:
-	virtual void outputText(const QString& text, bool noLineFeed=false);
-	QTextBrowser *m_outputWidget;
+	void outputText(const QString& text, bool noLineFeed = false) override;
+	QTextBrowser *m_outputWidget { nullptr };
 };
 
 




More information about the scribus-commit mailing list