/trunk/Scribus/scribus/gtmeasure.cpp |
---|
26,16 → 26,16 |
{ |
switch (u) |
{ |
case PT: |
case SC_PT: |
ratio = 1.0; |
break; |
case MM: |
case SC_MM: |
ratio = 25.4/72; |
break; |
case IN: |
case SC_IN: |
ratio = 1.0 / 72.0; |
break; |
case P: |
case SC_P: |
ratio = 1.0 / 12.0; |
break; |
} |
67,26 → 67,26 |
QString dbl = "0.0"; |
if (lowerValue.find("pt") != -1) |
{ |
init(PT); |
init(SC_PT); |
dbl = lowerValue.remove("pt"); |
} |
else if (lowerValue.find("mm") != -1) |
{ |
init(MM); |
init(SC_MM); |
dbl = lowerValue.remove("mm"); |
} |
else if (lowerValue.find("in") != -1) |
{ |
init(IN); |
init(SC_IN); |
dbl = lowerValue.remove("in"); |
} |
else if (lowerValue.find("p") != -1) |
{ |
init(P); |
init(SC_P); |
dbl = lowerValue.remove("p"); |
} |
else |
init(PT); |
init(SC_PT); |
dbl = dbl.stripWhiteSpace(); |
return dbl.toDouble(); |
/trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp |
---|
649,29 → 649,29 |
if (lowerValue.find("pt") != -1) |
{ |
dbl = lowerValue.remove("pt"); |
ret = gtMeasure::d2d(dbl.toDouble(), PT); |
ret = gtMeasure::d2d(dbl.toDouble(), SC_PT); |
} |
else if (lowerValue.find("mm") != -1) |
{ |
dbl = lowerValue.remove("mm"); |
ret = gtMeasure::d2d(dbl.toDouble(), MM); |
ret = gtMeasure::d2d(dbl.toDouble(), SC_MM); |
} |
else if (lowerValue.find("cm") != -1) |
{ |
dbl = lowerValue.remove("cm"); |
ret = gtMeasure::d2d(dbl.toDouble() * 10, MM); |
ret = gtMeasure::d2d(dbl.toDouble() * 10, SC_MM); |
} |
else if (lowerValue.find("in") != -1) |
{ |
dbl = lowerValue.remove("inch"); |
dbl = lowerValue.remove("in"); |
ret = gtMeasure::d2d(dbl.toDouble(), IN); |
ret = gtMeasure::d2d(dbl.toDouble(), SC_IN); |
} |
else if (lowerValue.find("pi") != -1) |
{ |
dbl = lowerValue.remove("pica"); |
dbl = lowerValue.remove("pi"); |
ret = gtMeasure::d2d(dbl.toDouble(), P); |
ret = gtMeasure::d2d(dbl.toDouble(), SC_P); |
} |
else if (lowerValue.find("%") != -1) |
{ |
/trunk/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp |
---|
98,7 → 98,7 |
pstylecode->getFont()->setName("Courier Regular"); |
pstylecode->setName("HTML_code"); |
pstylep = new gtParagraphStyle(*pstyle); |
pstylep->setSpaceBelow(gtMeasure::i2d(5, MM)); |
pstylep->setSpaceBelow(gtMeasure::i2d(5, SC_MM)); |
pstylep->setName("HTML_p"); |
pstylepre = new gtParagraphStyle(*pstyle); |
pstylepre->setName("HTML_pre"); |
/trunk/Scribus/scribus/plugins/gettext/odtim/stylereader.cpp |
---|
708,29 → 708,29 |
if (lowerValue.find("pt") != -1) |
{ |
dbl = lowerValue.remove("pt"); |
ret = gtMeasure::d2d(dbl.toDouble(), PT); |
ret = gtMeasure::d2d(dbl.toDouble(), SC_PT); |
} |
else if (lowerValue.find("mm") != -1) |
{ |
dbl = lowerValue.remove("mm"); |
ret = gtMeasure::d2d(dbl.toDouble(), MM); |
ret = gtMeasure::d2d(dbl.toDouble(), SC_MM); |
} |
else if (lowerValue.find("cm") != -1) |
{ |
dbl = lowerValue.remove("cm"); |
ret = gtMeasure::d2d(dbl.toDouble() * 10, MM); |
ret = gtMeasure::d2d(dbl.toDouble() * 10, SC_MM); |
} |
else if (lowerValue.find("in") != -1) |
{ |
dbl = lowerValue.remove("inch"); |
dbl = lowerValue.remove("in"); |
ret = gtMeasure::d2d(dbl.toDouble(), IN); |
ret = gtMeasure::d2d(dbl.toDouble(), SC_IN); |
} |
else if (lowerValue.find("pi") != -1) |
{ |
dbl = lowerValue.remove("pica"); |
dbl = lowerValue.remove("pi"); |
ret = gtMeasure::d2d(dbl.toDouble(), P); |
ret = gtMeasure::d2d(dbl.toDouble(), SC_P); |
} |
else if (lowerValue.find("%") != -1) |
{ |
/trunk/Scribus/scribus/gtmeasure.h |
---|
24,14 → 24,14 |
#include <qstring.h> |
enum Unit { |
POINTS = 0, |
PT = 0, |
MILLIMETERS = 1, |
MM = 1, |
INCHES = 2, |
IN = 2, |
PICAS = 3, |
P = 3 |
SC_POINTS = 0, |
SC_PT = 0, |
SC_MILLIMETERS = 1, |
SC_MM = 1, |
SC_INCHES = 2, |
SC_IN = 2, |
SC_PICAS = 3, |
SC_P = 3 |
}; |
class gtMeasure |
46,11 → 46,11 |
static double convert2(int value); |
static double parse(const QString& value); |
public: |
static double convert(double value, Unit from, Unit to = PT); |
static double convert(int value, Unit from, Unit to = PT); |
static double d2d(double value, Unit from, Unit to = PT); |
static double i2d(int value, Unit from, Unit to = PT); |
static double qs2d(const QString& value, Unit to = PT); |
static double convert(double value, Unit from, Unit to = SC_PT); |
static double convert(int value, Unit from, Unit to = SC_PT); |
static double d2d(double value, Unit from, Unit to = SC_PT); |
static double i2d(int value, Unit from, Unit to = SC_PT); |
static double qs2d(const QString& value, Unit to = SC_PT); |
}; |
#endif // GTMEASURE_H |