#include "lyxlength.h"
#include "lengthcommon.h"
#include "lyxrc.h"
-#include "BufferView.h"
-#include "lyxtext.h"
#include "Lsstream.h"
ostringstream buffer;
switch(unit_) {
case PW:
+ buffer << abs(static_cast<int>(val_/100)) << "."
+ << abs(static_cast<int>(val_)%100) << "\\textwidth";
+ break;
case PE:
buffer << abs(static_cast<int>(val_/100)) << "."
<< abs(static_cast<int>(val_)%100) << "\\columnwidth";
break;
case PP:
buffer << abs(static_cast<int>(val_/100)) << "."
- << abs(static_cast<int>(val_)%100) << "\\pagewidth";
+ << abs(static_cast<int>(val_)%100) << "\\paperwidth";
break;
case PL:
buffer << abs(static_cast<int>(val_/100)) << "."
}
-int LyXLength::inPixels(BufferView const * bv) const
+int LyXLength::inPixels(int default_width, int default_height) const
{
- // Height of a normal line in pixels (zoom factor considered)
- int height = bv->text->defaultHeight(); // [pixels]
- int default_width = bv->workWidth();
-
// Zoom factor specified by user in percent
double const zoom = lyxrc.zoom / 100.0; // [percent]
break;
case LyXLength::EX:
// Ex: The height of an "x"
- result = zoom * val_ * height / 2; // what to / width?
+ result = zoom * val_ * default_height / 2; // what to / width?
break;
case LyXLength::EM: // what to / width?
// Em: The width of an "m"
- result = zoom * val_ * height / 2; // Why 2?
+ result = zoom * val_ * default_height / 2; // Why 2?
break;
case LyXLength::MU: // This is probably only allowed in
// math mode
- result = zoom * val_ * height;
+ result = zoom * val_ * default_height;
break;
case LyXLength::PW: // Always % of workarea
case LyXLength::PE: