Herbert's work-around to xforms image width for xforms <= 0.89.6.

Use boost::tie now that I've upgraded my compiler ;-)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4568 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-07-09 13:39:46 +00:00
parent 55907ce853
commit e3978fd3ee
4 changed files with 26 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2002-07-09 Angus Leeming <leeming@lyx.org>
* xformsImage.C (scale): use boost::tie.
(statusCB): fudge to fix bug in image width for xforms <= 0.89.6.
2002-07-08 Angus Leeming <leeming@lyx.org>
* forms/fdfix.sh: whitespace.

View File

@ -30,6 +30,8 @@
# endif
#endif
#include <boost/tuple/tuple.hpp>
using std::find_if;
namespace {
@ -150,7 +152,14 @@ unsigned int xformsImage::getWidth() const
{
if (!image_)
return 0;
#if FL_VERSION == 0 && FL_REVISION == 89 && FL_FIXLEVEL <= 6
// Used to fix a bug in xforms <= 0.89.6 which
// crops the image unnecessarily.
return image_->w + 5;
#else
return image_->w;
#endif
}
@ -305,11 +314,9 @@ void xformsImage::scale(Params const & params)
if (!image_)
return;
// boost::tie produces horrible compilation errors on my machine
// Angus 25 Feb 2002
std::pair<unsigned int, unsigned int> d = getScaledDimensions(params);
unsigned int const width = d.first;
unsigned int const height = d.second;
unsigned int width;
unsigned int height;
boost::tie(width, height) = getScaledDimensions(params);
if (width == getWidth() && height == getHeight())
// No scaling needed

View File

@ -1,4 +1,4 @@
2002-07-08 Angus Leeming <leeming@lyx.org>
2002-07-09 Angus Leeming <leeming@lyx.org>
* PreviewLoader.C: Further refactoring of the code. Should now be
pretty clean.
@ -7,6 +7,8 @@
past its sell-by date. The code to read the metrics file is now found
as a helper function in PreviewLoader.C.
* GraphicsImageXPM.C (scale): use boost::tie.
2002-07-08 Herbert Voss <voss@lyx.org>
* PreviewLoader.C: use of preview_size_factor to get the right

View File

@ -24,6 +24,8 @@
#include <cmath> // cos, sin
#include <cstdlib> // malloc, free
#include <boost/tuple/tuple.hpp>
#include FORMS_H_LOCATION
#ifndef CXX_GLOBAL_CSTD
@ -356,11 +358,10 @@ void ImageXPM::scale(Params const & params)
typedef unsigned int dimension;
// boost::tie produces horrible compilation errors on my machine
// Angus 25 Feb 2002
std::pair<dimension, dimension> d = getScaledDimensions(params);
dimension const new_width = d.first;
dimension const new_height = d.second;
dimension new_width;
dimension new_height;
boost::tie(new_width, new_height) = getScaledDimensions(params);
if (new_width == getWidth() && new_height == getHeight())
// No scaling needed
return;