1 diff -ru svg.orig/units.cxx svg/units.cxx
2 --- filter.orig/source/svg/units.cxx 2009-06-09 15:39:35.000000000 +0100
3 +++ filter/source/svg/units.cxx 2009-06-09 15:39:46.000000000 +0100
6 double convLength( double value, SvgUnit unit, const State& rState, char dir )
8 - const double fBoxLen( dir=='h' ? rState.maViewBox.getWidth() :
9 - (dir=='v' ? rState.maViewBox.getHeight() :
10 - rState.maViewBox.getRange().getLength()));
12 // convert svg unit to internal coordinates ("pixel"). Since the
13 // OOo drawing layer is still largely integer-based, the initial
14 // viewport transformation includes a certain scale factor
16 case SVG_LENGTH_UNIT_PT: break;
17 case SVG_LENGTH_UNIT_EM: fRet *= rState.mnFontSize; break;
18 case SVG_LENGTH_UNIT_EX: fRet *= rState.mnFontSize / 2.0; break;
19 - case SVG_LENGTH_UNIT_PERCENTAGE: fRet *= fBoxLen; break;
20 + case SVG_LENGTH_UNIT_PERCENTAGE:
23 + if (rState.maViewBox.isEmpty())
25 + basegfx::B2DRange aDefaultBox(0, 0,
26 + convLength(210, SVG_LENGTH_UNIT_MM, rState, 'h'),
27 + convLength(297, SVG_LENGTH_UNIT_MM, rState, 'v'));
28 + fBoxLen = (dir=='h' ? aDefaultBox.getWidth() :
29 + (dir=='v' ? aDefaultBox.getHeight() :
30 + aDefaultBox.getRange().getLength()));
34 + fBoxLen = (dir=='h' ? rState.maViewBox.getWidth() :
35 + (dir=='v' ? rState.maViewBox.getHeight() :
36 + rState.maViewBox.getRange().getLength()));
39 + fRet *= fBoxLen/100.0;
42 default: OSL_TRACE( "Unknown length type" ); break;