Squash a warning by fixing the code.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8710 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2004-04-29 14:47:09 +00:00
parent 119b50c7c5
commit bb8f3fc98f
4 changed files with 16 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2004-04-29 Angus Leeming <leeming@lyx.org>
* QGraphics.C (apply): Remove a #warning statement by
fixing the code.
2004-04-28 Angus Leeming <leeming@lyx.org>
* QLToolbar.[Ch]: rewrite code to derive from a single Toolbar or

View File

@ -373,11 +373,9 @@ void QGraphics::apply()
igp.lyxscale = strToInt(fromqstr(dialog_->displayscale->text()));
igp.rotateAngle = strToDbl(fromqstr(dialog_->angle->text()));
#warning Guess what happens if the user enters '1e30' here?
while (igp.rotateAngle < -360.0)
igp.rotateAngle += 360.0;
while (igp.rotateAngle > 360.0)
igp.rotateAngle -= 360.0;
if (std::abs(igp.rotateAngle) > 360.0)
igp.rotateAngle -= 360.0 * floor(igp.rotateAngle / 360.0);
// save the latex name for the origin. If it is the default
// then origin_ltx returns ""

View File

@ -1,3 +1,8 @@
2004-04-29 Angus Leeming <leeming@lyx.org>
* FormGraphics.C (apply): don't get caught in a loop when mapping
the angle into -360 -> 360 degrees.
2004-04-28 Angus Leeming <leeming@lyx.org>
* LayoutEngine.C (updateMetrics): respect the visible() flag when

View File

@ -401,12 +401,9 @@ void FormGraphics::apply()
igp.rotateAngle = strToDbl(getString(extra_->input_rotate_angle));
// map angle into -360 (clock-wise) to +360 (counter clock-wise)
while (igp.rotateAngle <= -360.0) {
igp.rotateAngle += 360.0;
}
while (igp.rotateAngle >= 360.0) {
igp.rotateAngle -= 360.0;
}
if (std::abs(igp.rotateAngle) > 360.0)
igp.rotateAngle -= 360.0 * floor(igp.rotateAngle / 360.0);
fl_set_input(extra_->input_rotate_angle, tostr(igp.rotateAngle).c_str());
int const origin_pos = fl_get_choice(extra_->choice_origin);