2015-07-12 16:08:41 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "../Length.h"
|
|
|
|
#include "../LyXRC.h"
|
|
|
|
#include "../support/debug.h"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
|
|
using namespace lyx;
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
void test_inPixels()
|
|
|
|
{
|
|
|
|
// want to see non-zero SP
|
2016-10-29 08:28:34 +00:00
|
|
|
lyxrc.currentZoom = 100000;
|
2015-07-12 16:08:41 +00:00
|
|
|
lyxrc.dpi = 72;
|
|
|
|
for (int i = Length::BP; i <= Length::UNIT_NONE; ++i) {
|
|
|
|
Length const l(2342, static_cast<Length::UNIT>(i));
|
2017-04-10 07:57:40 +00:00
|
|
|
cout << l.inPixels(250) << " pix(250) = " << l.asString() << endl;
|
2015-07-12 16:08:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void test_inBP()
|
|
|
|
{
|
|
|
|
for (int i = Length::BP; i <= Length::UNIT_NONE; ++i) {
|
|
|
|
Length const l(2342, static_cast<Length::UNIT>(i));
|
2017-04-10 07:57:40 +00:00
|
|
|
cout << l.inBP() << " BP = " << l.asString() << endl;
|
2015-07-12 16:08:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(int, char **)
|
|
|
|
{
|
|
|
|
// Connect lyxerr with cout instead of cerr to catch error output
|
|
|
|
lyx::lyxerr.setStream(cout);
|
|
|
|
test_inPixels();
|
|
|
|
test_inBP();
|
|
|
|
}
|