r14149 by jghali - #8501: program crashes with "unknown exception" on drawing shape Does not fix the crash itself (Qt bug), but try to mitigate it by preventing some potential division by zero
scribus-commit
scribus-commit at lists.scribus.net
Tue Oct 13 00:10:21 CEST 2009
Revision: 14149
Author: jghali
Date: 2009-10-12T20:54:10.803036Z
Commit message: #8501: program crashes with "unknown exception" on drawing shape
Does not fix the crash itself (Qt bug), but try to mitigate it by preventing some potential division by zero
Changeset:
M /branches/Version133x/Scribus/scribus/scribusview.cpp
Diffs:
Index: scribus/scribusview.cpp
===================================================================
--- scribus/scribusview.cpp (revision 14148)
+++ scribus/scribusview.cpp (revision 14149)
@@ -2972,8 +2972,10 @@
//NOTE: this does not cover groups, strangely enough. Thats done in scaleGroup()
if ((currItem->itemType() == PageItem::TextFrame) && (m->state() & AltButton))
{
- double scx = currItem->width() / currItem->OldB2;
- double scy = currItem->height() / currItem->OldH2;
+ double divx = (currItem->OldB2 == 0.0) ? 1.0 : currItem->OldB2;
+ double divy = (currItem->OldH2 == 0.0) ? 1.0 : currItem->OldH2;
+ double scx = currItem->width() / divx;
+ double scy = currItem->height() / divy;
scx = scx != scy ? scx / scy : 1.0;
if (currItem->itemText.count() != 0)
{
@@ -3960,7 +3962,8 @@
ma.rotate(currItem->rotation());
ma = ma.invert();
double nX = ma.m11() * newX + ma.m21() * newY + ma.dx();
- nh = nX / currItem->OldB2 * currItem->OldH2;
+ double div = (currItem->OldB2 == 0) ? 1.0 : currItem->OldB2;
+ nh = nX / div * currItem->OldH2;
mop = QPoint(m->x(), m->y());
}
else
More information about the scribus-commit
mailing list