r22500 by jghali - #15287: Bad comparison in api_imageitem.cpp
scribus-commit
scribus-commit at lists.scribus.net
Mon Apr 30 10:07:48 UTC 2018
Author: jghali
Date: Mon Apr 30 10:07:47 2018
New Revision: 22500
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22500
Log:
#15287: Bad comparison in api_imageitem.cpp
Modified:
trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp
trunk/Scribus/scribus/plugins/scripter/api_imageitem.h
Modified: trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22500&path=/trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_imageitem.cpp Mon Apr 30 10:07:47 2018
@@ -185,13 +185,8 @@
ScCore->primaryMainWindow()->doc->updatePic();
}
-void ImageAPI::scaleToFrame(bool scaletoframe, bool Proportional)
-{
- bool scaleToFrame = false;
- bool proportional = true;
-
- scaleToFrame = scaletoframe;
- proportional = Proportional;
+void ImageAPI::scaleToFrame(bool scaleToFrame, bool proportional)
+{
if (!checkHaveDocument())
RAISE("No document open.");
if (item == NULL)
@@ -203,11 +198,10 @@
}
// Set the item to scale if appropriate. ScaleType 1 is free
// scale, 0 is scale to frame.
- item->ScaleType = scaleToFrame == 0;
+ item->ScaleType = !scaleToFrame;
// Now, if the user has chosen to set the proportional mode,
// set it. 1 is proportional, 0 is free aspect.
- if (proportional != -1)
- item->AspectRatio = proportional > 0;
+ item->AspectRatio = proportional;
// Force the braindead app to notice the changes
//FIXME emit or something so we dont need this
Modified: trunk/Scribus/scribus/plugins/scripter/api_imageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22500&path=/trunk/Scribus/scribus/plugins/scripter/api_imageitem.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_imageitem.h (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_imageitem.h Mon Apr 30 10:07:47 2018
@@ -33,7 +33,7 @@
void offset(double x, double y);
void setBrightness(double n);
void setGrayscale();
- void scaleToFrame(bool scaletoframe, bool Proportional);
+ void scaleToFrame(bool scaleToFrame, bool proportional);
private:
PageItem_ImageFrame* item;
More information about the scribus-commit
mailing list