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> 2002-07-08 Angus Leeming <leeming@lyx.org>
* forms/fdfix.sh: whitespace. * forms/fdfix.sh: whitespace.

View File

@ -30,6 +30,8 @@
# endif # endif
#endif #endif
#include <boost/tuple/tuple.hpp>
using std::find_if; using std::find_if;
namespace { namespace {
@ -150,7 +152,14 @@ unsigned int xformsImage::getWidth() const
{ {
if (!image_) if (!image_)
return 0; 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; return image_->w;
#endif
} }
@ -305,11 +314,9 @@ void xformsImage::scale(Params const & params)
if (!image_) if (!image_)
return; return;
// boost::tie produces horrible compilation errors on my machine unsigned int width;
// Angus 25 Feb 2002 unsigned int height;
std::pair<unsigned int, unsigned int> d = getScaledDimensions(params); boost::tie(width, height) = getScaledDimensions(params);
unsigned int const width = d.first;
unsigned int const height = d.second;
if (width == getWidth() && height == getHeight()) if (width == getWidth() && height == getHeight())
// No scaling needed // 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 * PreviewLoader.C: Further refactoring of the code. Should now be
pretty clean. pretty clean.
@ -7,6 +7,8 @@
past its sell-by date. The code to read the metrics file is now found past its sell-by date. The code to read the metrics file is now found
as a helper function in PreviewLoader.C. as a helper function in PreviewLoader.C.
* GraphicsImageXPM.C (scale): use boost::tie.
2002-07-08 Herbert Voss <voss@lyx.org> 2002-07-08 Herbert Voss <voss@lyx.org>
* PreviewLoader.C: use of preview_size_factor to get the right * PreviewLoader.C: use of preview_size_factor to get the right

View File

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