r20967 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Wed Feb 10 21:09:56 UTC 2016


Author: jghali
Date: Wed Feb 10 21:09:56 2016
New Revision: 20967

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20967
Log:
fix not quite correct usage of QObject::blockSignals() in pp image tab

Modified:
    trunk/Scribus/scribus/ui/propertiespalette_image.cpp

Modified: trunk/Scribus/scribus/ui/propertiespalette_image.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20967&path=/trunk/Scribus/scribus/ui/propertiespalette_image.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_image.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_image.cpp	Wed Feb 10 21:09:56 2016
@@ -343,8 +343,8 @@
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	keepImageWHRatioButton->blockSignals(true);
-	keepImageDPIRatioButton->blockSignals(true);
+	bool whRatioBlocked = keepImageWHRatioButton->blockSignals(true);
+	bool dpiRatioBlocked = keepImageDPIRatioButton->blockSignals(true);
 	if (fabs(scx - scy) > 0.0002)
 	{
 		keepImageWHRatioButton->setChecked(false);
@@ -368,8 +368,8 @@
 		imgDpiX->showValue(72);
 		imgDpiY->showValue(72);
 	}
-	keepImageWHRatioButton->blockSignals(false);
-	keepImageDPIRatioButton->blockSignals(false);
+	keepImageWHRatioButton->blockSignals(whRatioBlocked);
+	keepImageDPIRatioButton->blockSignals(dpiRatioBlocked);
 }
 
 void PropertiesPalette_Image::handleSelectionChanged()
@@ -636,54 +636,54 @@
 
 void PropertiesPalette_Image::handleXScale()
 {
-	imageXScaleSpinBox->blockSignals(true);
-	imageYScaleSpinBox->blockSignals(true);
+	bool xscaleBlocked = imageXScaleSpinBox->blockSignals(true);
+	bool yscaleBlocked = imageYScaleSpinBox->blockSignals(true);
 	if (keepImageWHRatioButton->isChecked())
 		imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
 	handleLocalScale();
-	imageXScaleSpinBox->blockSignals(false);
-	imageYScaleSpinBox->blockSignals(false);
+	imageXScaleSpinBox->blockSignals(xscaleBlocked);
+	imageYScaleSpinBox->blockSignals(yscaleBlocked);
 }
 
 void PropertiesPalette_Image::handleYScale()
 {
-	imageXScaleSpinBox->blockSignals(true);
-	imageYScaleSpinBox->blockSignals(true);
+	bool xscaleBlocked = imageXScaleSpinBox->blockSignals(true);
+	bool yscaleBlocked = imageYScaleSpinBox->blockSignals(true);
 	if (keepImageWHRatioButton->isChecked())
 		imageXScaleSpinBox->setValue(imageYScaleSpinBox->value());
 	handleLocalScale();
-	imageXScaleSpinBox->blockSignals(false);
-	imageYScaleSpinBox->blockSignals(false);
+	imageXScaleSpinBox->blockSignals(xscaleBlocked);
+	imageYScaleSpinBox->blockSignals(yscaleBlocked);
 }
 
 void PropertiesPalette_Image::handleDpiX()
 {
-	imgDpiX->blockSignals(true);
-	imgDpiY->blockSignals(true);
+	bool dpiXBlocked = imgDpiX->blockSignals(true);
+	bool dpiYBlocked = imgDpiY->blockSignals(true);
 	if (keepImageDPIRatioButton->isChecked())
 		imgDpiY->setValue(imgDpiX->value());
 	handleLocalDpi();
-	imgDpiX->blockSignals(false);
-	imgDpiY->blockSignals(false);
+	imgDpiX->blockSignals(dpiXBlocked);
+	imgDpiY->blockSignals(dpiYBlocked);
 }
 
 void PropertiesPalette_Image::handleDpiY()
 {
-	imgDpiX->blockSignals(true);
-	imgDpiY->blockSignals(true);
+	bool dpiXBlocked = imgDpiX->blockSignals(true);
+	bool dpiYBlocked = imgDpiY->blockSignals(true);
 	if (keepImageDPIRatioButton->isChecked())
 		imgDpiX->setValue(imgDpiY->value());
 	handleLocalDpi();
-	imgDpiX->blockSignals(false);
-	imgDpiY->blockSignals(false);
+	imgDpiX->blockSignals(dpiXBlocked);
+	imgDpiY->blockSignals(dpiYBlocked);
 }
 
 void PropertiesPalette_Image::handleImageDPIRatio()
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	imgDpiX->blockSignals(true);
-	imgDpiY->blockSignals(true);
+	bool dpiXBlocked = imgDpiX->blockSignals(true);
+	bool dpiYBlocked = imgDpiY->blockSignals(true);
 	if (keepImageDPIRatioButton->isChecked())
 	{
 		double minXY = qMin(imgDpiX->value(), imgDpiY->value());
@@ -698,16 +698,16 @@
 		keepImageWHRatioButton->setChecked(false);
 		cbProportional->setChecked(false);
 	}
-	imgDpiX->blockSignals(false);
-	imgDpiY->blockSignals(false);
+	imgDpiX->blockSignals(dpiXBlocked);
+	imgDpiY->blockSignals(dpiYBlocked);
 }
 
 void PropertiesPalette_Image::handleImageWHRatio()
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	imageXScaleSpinBox->blockSignals(true);
-	imageYScaleSpinBox->blockSignals(true);
+	bool xscaleBlocked = imageXScaleSpinBox->blockSignals(true);
+	bool yscaleBlocked = imageYScaleSpinBox->blockSignals(true);
 	if (keepImageWHRatioButton->isChecked())
 	{
 		double maxXY = qMax(imageXScaleSpinBox->value(), imageYScaleSpinBox->value());
@@ -722,8 +722,8 @@
 		keepImageDPIRatioButton->setChecked(false);
 		cbProportional->setChecked(false);
 	}
-	imageXScaleSpinBox->blockSignals(false);
-	imageYScaleSpinBox->blockSignals(false);
+	imageXScaleSpinBox->blockSignals(xscaleBlocked);
+	imageYScaleSpinBox->blockSignals(yscaleBlocked);
 }
 
 void PropertiesPalette_Image::handleImageEffects()




More information about the scribus-commit mailing list