[ooo-build-commit] patches/dev300
Thorsten Behrens
thorsten at kemper.freedesktop.org
Wed Jun 10 06:32:58 PDT 2009
patches/dev300/apply | 3 +
patches/dev300/svg-import-convlength-fix.diff | 44 ++++++++++++++++++++++++++
2 files changed, 47 insertions(+)
New commits:
commit c83820aaa63620d44df2a80572858c52aca4d156
Author: Thorsten Behrens <tbehrens at novell.com>
Date: Wed Jun 10 15:30:43 2009 +0200
Fix relative size calculation for svg import
* patches/dev300/apply: added the patch
* patches/dev300/svg-import-convlength-fix.diff: added patch from
Caolan to correctly calculate relative sizes, also catching case
where parent group's size is not given
diff --git a/patches/dev300/apply b/patches/dev300/apply
index f957ee0..6faf47c 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2238,6 +2238,9 @@ svg-import-painturi-fix.diff, thorsten
# much improved text import
svg-import-textimport.diff, thorsten
+# fixing relative size calculation
+svg-import-convlength-fix.diff, cmc
+
[ NovellOnlyWin32 ]
novell-win32-msi-patchability.diff, tml
diff --git a/patches/dev300/svg-import-convlength-fix.diff b/patches/dev300/svg-import-convlength-fix.diff
new file mode 100644
index 0000000..1d0c8f5
--- /dev/null
+++ b/patches/dev300/svg-import-convlength-fix.diff
@@ -0,0 +1,44 @@
+diff -ru svg.orig/units.cxx svg/units.cxx
+--- filter.orig/source/svg/units.cxx 2009-06-09 15:39:35.000000000 +0100
++++ filter/source/svg/units.cxx 2009-06-09 15:39:46.000000000 +0100
+@@ -35,10 +35,6 @@
+
+ double convLength( double value, SvgUnit unit, const State& rState, char dir )
+ {
+- const double fBoxLen( dir=='h' ? rState.maViewBox.getWidth() :
+- (dir=='v' ? rState.maViewBox.getHeight() :
+- rState.maViewBox.getRange().getLength()));
+-
+ // convert svg unit to internal coordinates ("pixel"). Since the
+ // OOo drawing layer is still largely integer-based, the initial
+ // viewport transformation includes a certain scale factor
+@@ -55,7 +51,28 @@
+ case SVG_LENGTH_UNIT_PT: break;
+ case SVG_LENGTH_UNIT_EM: fRet *= rState.mnFontSize; break;
+ case SVG_LENGTH_UNIT_EX: fRet *= rState.mnFontSize / 2.0; break;
+- case SVG_LENGTH_UNIT_PERCENTAGE: fRet *= fBoxLen; break;
++ case SVG_LENGTH_UNIT_PERCENTAGE:
++ {
++ double fBoxLen;
++ if (rState.maViewBox.isEmpty())
++ {
++ basegfx::B2DRange aDefaultBox(0, 0,
++ convLength(210, SVG_LENGTH_UNIT_MM, rState, 'h'),
++ convLength(297, SVG_LENGTH_UNIT_MM, rState, 'v'));
++ fBoxLen = (dir=='h' ? aDefaultBox.getWidth() :
++ (dir=='v' ? aDefaultBox.getHeight() :
++ aDefaultBox.getRange().getLength()));
++ }
++ else
++ {
++ fBoxLen = (dir=='h' ? rState.maViewBox.getWidth() :
++ (dir=='v' ? rState.maViewBox.getHeight() :
++ rState.maViewBox.getRange().getLength()));
++ }
++
++ fRet *= fBoxLen/100.0;
++ }
++ break;
+ default: OSL_TRACE( "Unknown length type" ); break;
+ }
+
More information about the ooo-build-commit
mailing list