r25072 by craig - Code cleanup

scribus-commit scribus-commit at lists.scribus.net
Wed Mar 30 20:21:58 UTC 2022


Author: craig
Date: Wed Mar 30 20:21:58 2022
New Revision: 25072

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

Modified:
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/ui/cmykfw.cpp
    trunk/Scribus/scribus/util_color.cpp
    trunk/Scribus/scribus/util_color.h

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25072&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode.cpp	Wed Mar 30 20:21:58 2022
@@ -218,7 +218,7 @@
 
 void CanvasMode::drawSelectionHandles(QPainter *psx, QRectF selectionRect, bool background, bool insideGroup, double sx, double sy)
 {
-	m_pen["handle"]		= QPen(PrefsManager::instance().appPrefs.displayPrefs.frameColor, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["handle"]	= QPen(PrefsManager::instance().appPrefs.displayPrefs.frameColor, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	m_pen["handle"].setCosmetic(true);
 	m_pen["selection-group-inside"] = QPen(PrefsManager::instance().appPrefs.displayPrefs.frameGroupColor, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	m_pen["selection-group-inside"].setCosmetic(true);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25072&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	Wed Mar 30 20:21:58 2022
@@ -754,7 +754,6 @@
 
 void Scribus150Format::writeGradients(ScXmlStreamWriter& docu, bool part)
 {
-	QHash<QString, VGradient>::Iterator itGrad;
 	QHash<QString, VGradient> gradMap;
 	if (part)
 		m_Doc->getUsedGradients(gradMap);

Modified: trunk/Scribus/scribus/ui/cmykfw.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25072&path=/trunk/Scribus/scribus/ui/cmykfw.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cmykfw.cpp	(original)
+++ trunk/Scribus/scribus/ui/cmykfw.cpp	Wed Mar 30 20:21:58 2022
@@ -65,11 +65,11 @@
 	imageA = QPixmap(50,50);
 	imageA.fill( ScColorEngine::getDisplayColor(orig, m_doc));
 	if ( ScColorEngine::isOutOfGamut(orig, m_doc))
-		paintAlert(alertIcon,imageA, 2, 2, false);
+		paintAlert(alertIcon,imageA, 2, 2);
 	imageN = QPixmap(50,50);
 	imageN.fill( ScColorEngine::getDisplayColor(orig, m_doc));
 	if ( ScColorEngine::isOutOfGamut(orig, m_doc))
-		paintAlert(alertIcon, imageN, 2, 2, false);
+		paintAlert(alertIcon, imageN, 2, 2);
 
 	resize( 498, 306 );
 	setWindowTitle( tr( "Edit Color" ));
@@ -496,7 +496,6 @@
 {
 	QImage image0 = QImage(255, 10, QImage::Format_ARGB32);
 	QPainter p;
-	int val = 255;
 	p.begin(&image0);
 	p.setPen(Qt::NoPen);
 	int c, m, y, k;
@@ -510,7 +509,6 @@
 		else
 			p.setBrush( ScColorEngine::getDisplayColorGC(ScColor(0, 0, 0, x), m_doc));
 		p.drawRect(x, 0, 5, 10);
-		val -= 5;
 	}
 	p.end();
 	QPalette pal;
@@ -822,7 +820,7 @@
 	}
 	imageN.fill( ScColorEngine::getDisplayColor(Farbe, m_doc));
 	if (ScColorEngine::isOutOfGamut(Farbe, m_doc))
-		paintAlert(alertIcon, imageN, 2, 2, false);
+		paintAlert(alertIcon, imageN, 2, 2);
 	NewC->setPixmap( imageN );
 	NewC->setToolTip( "<qt>" + tr( "If color management is enabled, an exclamation mark indicates that the color may be outside of the color gamut of the current printer profile selected. What this means is the color may not print exactly as indicated on screen. More hints about gamut warnings are in the online help under Color Management." ) + "</qt>");
 	OldC->setToolTip( "<qt>" + tr( "If color management is enabled, an exclamation mark indicates that the color may be outside of the color gamut of the current printer profile selected. What this means is the color may not print exactly as indicated on screen. More hints about gamut warnings are in the online help under Color Management." ) + "</qt>");
@@ -942,7 +940,7 @@
 	}
 	imageN.fill(ScColorEngine::getDisplayColor(tmp, m_doc));
 	if ( ScColorEngine::isOutOfGamut(tmp, m_doc))
-		paintAlert(alertIcon, imageN, 2, 2, false);
+		paintAlert(alertIcon, imageN, 2, 2);
 	NewC->setPixmap( imageN );
 }
 
@@ -974,7 +972,7 @@
 	}
 	imageN.fill( ScColorEngine::getDisplayColor(tmp, m_doc));
 	if (ScColorEngine::isOutOfGamut(tmp, m_doc))
-		paintAlert(alertIcon, imageN, 2, 2, false);
+		paintAlert(alertIcon, imageN, 2, 2);
 	NewC->setPixmap( imageN );
 	Farbe = tmp;
 	if (ende)
@@ -1012,7 +1010,7 @@
 	}
 	imageN.fill( ScColorEngine::getDisplayColor(tmp, m_doc));
 	if ( ScColorEngine::isOutOfGamut(tmp, m_doc))
-		paintAlert(alertIcon, imageN, 2, 2, false);
+		paintAlert(alertIcon, imageN, 2, 2);
 	NewC->setPixmap( imageN );
 	Farbe = tmp;
 	setValues();

Modified: trunk/Scribus/scribus/util_color.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25072&path=/trunk/Scribus/scribus/util_color.cpp
==============================================================================
--- trunk/Scribus/scribus/util_color.cpp	(original)
+++ trunk/Scribus/scribus/util_color.cpp	Wed Mar 30 20:21:58 2022
@@ -278,29 +278,11 @@
 }
 
 
-void paintAlert(const QPixmap &toPaint, QPixmap &target, int x, int y, bool useMask)
-{
-	// there is no alpha mask in the beginning
-//	if (useMask)
-//	{
-//		if (target.mask().isNull())
-//			target.setMask(QBitmap(target.width(), target.height(), useMask));
-//	}
+void paintAlert(const QPixmap &toPaint, QPixmap &target, int x, int y)
+{
 	QPainter p;
 	p.begin(&target);
 	p.drawPixmap(x, y, toPaint);
-	if (useMask)
-	{
-// Qt4 FIXME: Qt4 can use better alpha setting. see colorlistbox.cpp
-// 		QPainter alpha; // transparency handling
-// 		alpha.begin(target.mask());
-// 		alpha.setBrush(Qt::color1);
-// 		alpha.setPen(Qt::color1);
-// 		alpha.drawRect(x, y, 15, 15);
-// 		if (!toPaint.mask().isNull())
-// 			alpha.drawPixmap(x, y, toPaint.mask());
-// 		alpha.end();
-	}
 	p.end();
 }
 

Modified: trunk/Scribus/scribus/util_color.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25072&path=/trunk/Scribus/scribus/util_color.h
==============================================================================
--- trunk/Scribus/scribus/util_color.h	(original)
+++ trunk/Scribus/scribus/util_color.h	Wed Mar 30 20:21:58 2022
@@ -40,7 +40,7 @@
 \param y coordinate
 \param useMask unused now
  */
-void SCRIBUS_API paintAlert(const QPixmap &toPaint, QPixmap &target, int x = 0, int y = 0, bool useMask = true);
+void SCRIBUS_API paintAlert(const QPixmap &toPaint, QPixmap &target, int x = 0, int y = 0);
 QImage SCRIBUS_API ProofImage(QImage *Im, ScribusDoc* doc);
 
 /*! \brief Associate a color shade to a document color according to pre-1.3.4cvs rgb shade calculation method, 




More information about the scribus-commit mailing list