[ooo-build-commit] .: patches/dev300

Fridrich Strba fridrich at kemper.freedesktop.org
Tue Sep 14 01:06:42 PDT 2010


 patches/dev300/apply                              |   34 
 patches/dev300/svg-import-boost.diff              |   79 
 patches/dev300/svg-import-convlength-fix.diff     |   57 
 patches/dev300/svg-import-eh-fix.diff             |   55 
 patches/dev300/svg-import-empty-gradient-fix.diff |   48 
 patches/dev300/svg-import-filter-gfxfilter.diff   |  926 ---
 patches/dev300/svg-import-filter.diff             | 5323 ----------------------
 patches/dev300/svg-import-opacity-fix.diff        |  154 
 patches/dev300/svg-import-painturi-fix.diff       |  263 -
 patches/dev300/svg-import-textimport.diff         |  302 -
 patches/dev300/svg-import-viewbox-fix.diff        |   39 
 11 files changed, 1 insertion(+), 7279 deletions(-)

New commits:
commit 02334d94e509edb60012a53431d472d6bf11f5dd
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Tue Sep 14 10:05:26 2010 +0200

    Migrate SVGImport section to git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 0e91ba7..a440408 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -15,7 +15,7 @@ Common : PreprocessPatches, BuildBits, TemporaryHacks, FixesNotForUpstream, \
 	 Icons, Branding, CalcFixes, WriterFixes, EasterEgg, \
 	 GStreamer, CWSBackports, WPG, Cleanups, WMF, GnomeVFS, WebDAV, \
 	 Layout, VBABits, VBAObjects, CalcErrors, CJK, GCJ, Lwp, WPS, \
-	 OOXML, OOXMLExportDevel, OOXMLExport, SVGImport, FrameworkFeature, UnitTesting, \
+	 OOXML, OOXMLExportDevel, OOXMLExport, FrameworkFeature, UnitTesting, \
 	 PopupRemoval, InternalCairo, \
 	 FedoraCommonFixes, InternalMesaHeaders, LayoutDialogs, Fuzz, \
 	 CalcRowLimit, Gcc44, Gcc45, BuildFix, WriterDocComparison, \
@@ -2194,38 +2194,6 @@ sled10-splash.diff, i#123456, pmladek
 [ SUSE112 ]
 xulrunner-1.9.1.diff, ccheney
 
-[ SVGImport ]
-# A bit less partial implementation of SVG import
-# Work in progress, but fairly usable already
-svg-import-filter.diff, thorsten
-
-# like svg-import-filter.diff, but adds a graphic filter for SVG
-svg-import-filter-gfxfilter.diff, thorsten
-
-# fixes some nastiness with viewbox
-svg-import-viewbox-fix.diff, thorsten
-
-# improves parsing of paint fragments
-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
-
-# fixing handling of opacity attribute
-svg-import-opacity-fix.diff, thorsten
-
-# guard against empty gradient stops
-svg-import-empty-gradient-fix.diff, n#560255, thorsten
-
-# eat exceptions before they reach unaware code
-svg-import-eh-fix.diff, cmc
-
-# deliver requrired boost headers when building with internal boost
-svg-import-boost.diff, fridrich
-
 [ NovellLikeOnlyWin32 ]
 novell-win32-msi-patchability.diff, tml
 
diff --git a/patches/dev300/svg-import-boost.diff b/patches/dev300/svg-import-boost.diff
deleted file mode 100644
index 6e665c0..0000000
--- a/patches/dev300/svg-import-boost.diff
+++ /dev/null
@@ -1,79 +0,0 @@
-diff -urEbwB boost/makefile.mk boost/makefile.mk
---- boost/makefile.mk	2010-06-18 10:31:52.000000000 +0200
-+++ boost/makefile.mk	2010-07-15 22:26:24.000000000 +0200
-@@ -80,6 +80,7 @@
-     @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/*.h $(INCCOM)$/$(PRJNAME)
-     @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/*.hpp $(INCCOM)$/$(PRJNAME)
-     @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/bind $(INCCOM)$/$(PRJNAME)
-+    @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/concept $(INCCOM)$/$(PRJNAME)
-     @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/config $(INCCOM)$/$(PRJNAME)
-     @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/detail $(INCCOM)$/$(PRJNAME)
-     @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/boost$/exception $(INCCOM)$/$(PRJNAME)
-diff -urEbwB boost/prj/d.lst boost/prj/d.lst
---- boost/prj/d.lst	2010-06-18 10:31:52.000000000 +0200
-+++ boost/prj/d.lst	2010-07-15 22:49:57.000000000 +0200
-@@ -1,5 +1,7 @@
- mkdir: %_DEST%\inc%_EXT%\boost
- mkdir: %_DEST%\inc%_EXT%\boost\bind
-+mkdir: %_DEST%\inc%_EXT%\boost\concept
-+mkdir: %_DEST%\inc%_EXT%\boost\concept\detail
- mkdir: %_DEST%\inc%_EXT%\boost\config
- mkdir: %_DEST%\inc%_EXT%\boost\config\compiler
- mkdir: %_DEST%\inc%_EXT%\boost\config\no_tr1
-@@ -110,8 +112,12 @@
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\actor
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\actor\impl
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\attribute
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\attribute\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\debug
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\debug\impl
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\dynamic
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\dynamic\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\meta
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\meta\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\core
-@@ -128,6 +134,10 @@
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\error_handling\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\iterator
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\iterator\impl
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\phoenix
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\phoenix\impl
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\symbols
-+mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\symbols\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\utility
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\utility\impl
- mkdir: %_DEST%\inc%_EXT%\boost\spirit\home\classic\utility\impl\chset
-@@ -157,6 +167,8 @@
- 
- ..\%__SRC%\inc\boost\* %_DEST%\inc%_EXT%\boost
- ..\%__SRC%\inc\boost\bind\* %_DEST%\inc%_EXT%\boost\bind
-+..\%__SRC%\inc\boost\concept\* %_DEST%\inc%_EXT%\boost\concept
-+..\%__SRC%\inc\boost\concept\detail\* %_DEST%\inc%_EXT%\boost\concept\detail
- ..\%__SRC%\inc\boost\config\* %_DEST%\inc%_EXT%\boost\config
- ..\%__SRC%\inc\boost\config\compiler\* %_DEST%\inc%_EXT%\boost\config\compiler
- ..\%__SRC%\inc\boost\config\no_tr1\* %_DEST%\inc%_EXT%\boost\config\no_tr1
-@@ -266,8 +278,12 @@
- ..\%__SRC%\inc\boost\spirit\home\classic\* %_DEST%\inc%_EXT%\boost\spirit\home\classic
- ..\%__SRC%\inc\boost\spirit\home\classic\actor\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\actor
- ..\%__SRC%\inc\boost\spirit\home\classic\actor\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\actor\impl
-+..\%__SRC%\inc\boost\spirit\home\classic\attribute\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\attribute
-+..\%__SRC%\inc\boost\spirit\home\classic\attribute\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\attribute\impl
- ..\%__SRC%\inc\boost\spirit\home\classic\debug\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\debug
- ..\%__SRC%\inc\boost\spirit\home\classic\debug\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\debug\impl
-+..\%__SRC%\inc\boost\spirit\home\classic\dynamic\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\dynamic
-+..\%__SRC%\inc\boost\spirit\home\classic\dynamic\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\dynamic\impl
- ..\%__SRC%\inc\boost\spirit\home\classic\meta\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\meta
- ..\%__SRC%\inc\boost\spirit\home\classic\meta\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\meta\impl
- ..\%__SRC%\inc\boost\spirit\home\classic\core\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\core
-@@ -284,6 +300,10 @@
- ..\%__SRC%\inc\boost\spirit\home\classic\error_handling\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\error_handling\impl
- ..\%__SRC%\inc\boost\spirit\home\classic\iterator\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\iterator
- ..\%__SRC%\inc\boost\spirit\home\classic\iterator\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\iterator\impl
-+..\%__SRC%\inc\boost\spirit\home\classic\phoenix\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\phoenix
-+..\%__SRC%\inc\boost\spirit\home\classic\phoenix\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\phoenix\impl
-+..\%__SRC%\inc\boost\spirit\home\classic\symbols\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\symbols
-+..\%__SRC%\inc\boost\spirit\home\classic\symbols\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\symbols\impl
- ..\%__SRC%\inc\boost\spirit\home\classic\utility\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\utility
- ..\%__SRC%\inc\boost\spirit\home\classic\utility\impl\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\utility\impl
- ..\%__SRC%\inc\boost\spirit\home\classic\utility\impl\chset\* %_DEST%\inc%_EXT%\boost\spirit\home\classic\utility\impl\chset
diff --git a/patches/dev300/svg-import-convlength-fix.diff b/patches/dev300/svg-import-convlength-fix.diff
deleted file mode 100644
index 08420a1..0000000
--- a/patches/dev300/svg-import-convlength-fix.diff
+++ /dev/null
@@ -1,57 +0,0 @@
-From 1f5e961bed515a41736719e1c1cc01d27f4967dd Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:02:02 +0200
-Subject: [PATCH 423/768] svg-import-convlength-fix.diff
-
----
- filter/source/svg/units.cxx |   27 ++++++++++++++++++++++-----
- 1 files changed, 22 insertions(+), 5 deletions(-)
-
-diff --git filter/source/svg/units.cxx filter/source/svg/units.cxx
-index 1e2ac89..db94634 100644
---- filter/source/svg/units.cxx
-+++ filter/source/svg/units.cxx
-@@ -35,10 +35,6 @@ namespace svgi
- 
- 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 @@ double convLength( double value, SvgUnit unit, const State& rState, char dir )
-         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;
-     }
- 
--- 
-1.7.0.1
-
diff --git a/patches/dev300/svg-import-eh-fix.diff b/patches/dev300/svg-import-eh-fix.diff
deleted file mode 100644
index 5746221..0000000
--- a/patches/dev300/svg-import-eh-fix.diff
+++ /dev/null
@@ -1,55 +0,0 @@
-From 16ee64700a2ac4fa77e94b894221ae55fc6ccab3 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:02:05 +0200
-Subject: [PATCH 426/768] svg-import-eh-fix.diff
-
----
- filter/source/svg/svgfilter.cxx |    9 ++++++++-
- filter/source/svg/svgreader.cxx |    4 ++--
- 2 files changed, 10 insertions(+), 3 deletions(-)
-
-diff --git filter/source/svg/svgfilter.cxx filter/source/svg/svgfilter.cxx
-index 1975c0a..248a92f 100644
---- filter/source/svg/svgfilter.cxx
-+++ filter/source/svg/svgfilter.cxx
-@@ -208,7 +208,14 @@ rtl::OUString SAL_CALL SVGFilter::detect( Sequence< PropertyValue >& io_rDescrip
- class FilterConfigItem;
- extern "C" SAL_DLLPUBLIC_EXPORT BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
- {
--    return importSvg( rStream, rGraphic );
-+    BOOL bRet = FALSE;
-+    try
-+    {
-+        bRet = importSvg( rStream, rGraphic );
-+    }
-+    catch (const uno::Exception&) {
-+    }
-+    return bRet;
- }
- 
- // -----------------------------------------------------------------------------
-diff --git filter/source/svg/svgreader.cxx filter/source/svg/svgreader.cxx
-index b674c0c..ce061a7 100644
---- filter/source/svg/svgreader.cxx
-+++ filter/source/svg/svgreader.cxx
-@@ -1803,7 +1803,7 @@ sal_Bool SVGReader::parseAndConvert()
- {
-     uno::Reference<xml::dom::XDocumentBuilder> xDomBuilder(
-         m_xServiceFactory->createInstance(
--            rtl::OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), uno::UNO_QUERY );
-+            rtl::OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), uno::UNO_QUERY_THROW );
- 
-     uno::Reference<xml::dom::XDocument> xDom(
-         xDomBuilder->parse(m_xInputStream),
-@@ -2710,7 +2710,7 @@ bool importSvg(SvStream & rStream, Graphic & rGraphic )
-     uno::Reference<xml::dom::XDocumentBuilder> xDomBuilder(
-         xServiceFactory->createInstance(
-             rtl::OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")),
--        uno::UNO_QUERY );
-+        uno::UNO_QUERY_THROW );
- 
-     uno::Reference<io::XInputStream> xStream(
-         new utl::OInputStreamWrapper(rStream) );
--- 
-1.7.0.1
-
diff --git a/patches/dev300/svg-import-empty-gradient-fix.diff b/patches/dev300/svg-import-empty-gradient-fix.diff
deleted file mode 100644
index 41809c5..0000000
--- a/patches/dev300/svg-import-empty-gradient-fix.diff
+++ /dev/null
@@ -1,48 +0,0 @@
-From 6c84c1eee584d8922cc941818410b83b26de4a7d Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:02:04 +0200
-Subject: [PATCH 425/768] svg-import-empty-gradient-fix.diff
-
----
- filter/source/svg/svgreader.cxx |   18 ++++++++++--------
- 1 files changed, 10 insertions(+), 8 deletions(-)
-
-diff --git filter/source/svg/svgreader.cxx filter/source/svg/svgreader.cxx
-index 4fe718b..b674c0c 100644
---- filter/source/svg/svgreader.cxx
-+++ filter/source/svg/svgreader.cxx
-@@ -308,10 +308,11 @@ struct AnnotatingVisitor
-     bool hasGradientOpacity( const Gradient& rGradient )
-     {
-         return
--            maGradientStopVector[
--                rGradient.maStops[0]].maStopColor.a != 1.0 ||
--            maGradientStopVector[
--                rGradient.maStops[1]].maStopColor.a != 1.0;
-+            !rGradient.maStops.empty() &&
-+            (maGradientStopVector[
-+                 rGradient.maStops[0]].maStopColor.a != 1.0 ||
-+             maGradientStopVector[
-+                 rGradient.maStops[1]].maStopColor.a != 1.0);
-     }
- 
-     struct StopSorter
-@@ -2464,10 +2465,11 @@ struct ShapeRenderingVisitor
-     bool hasGradientOpacity( const Gradient& rGradient )
-     {
-         return
--            mrGradientStopVector[
--                rGradient.maStops[0]].maStopColor.a != 1.0 ||
--            mrGradientStopVector[
--                rGradient.maStops[1]].maStopColor.a != 1.0;
-+            !rGradient.maStops.empty() &&
-+            (mrGradientStopVector[
-+                 rGradient.maStops[0]].maStopColor.a != 1.0 ||
-+             mrGradientStopVector[
-+                 rGradient.maStops[1]].maStopColor.a != 1.0);
-     }
- 
-     sal_Int8 toByteColor( double val )
--- 
-1.7.0.1
-
diff --git a/patches/dev300/svg-import-filter-gfxfilter.diff b/patches/dev300/svg-import-filter-gfxfilter.diff
deleted file mode 100644
index 4d4a6cb..0000000
--- a/patches/dev300/svg-import-filter-gfxfilter.diff
+++ /dev/null
@@ -1,926 +0,0 @@
-From 073c5ce0ed5bbaea95cb75b53bd2df91ebfdae5f Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:01:58 +0200
-Subject: [PATCH 419/768] svg-import-filter-gfxfilter.diff
-
----
- .../config/fragments/fcfg_internalgraphics.mk      |    1 +
- .../internalgraphicfilters/svg_Import.xcu          |   10 +
- filter/source/svg/exports.map                      |   10 +
- filter/source/svg/makefile.mk                      |    3 +-
- filter/source/svg/svgfilter.cxx                    |    8 +
- filter/source/svg/svgfilter.hxx                    |    7 +
- filter/source/svg/svgreader.cxx                    |  756 +++++++++++++++++++-
- filter/source/svg/test/makefile.mk                 |    1 +
- 8 files changed, 791 insertions(+), 5 deletions(-)
- create mode 100644 filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu
- create mode 100644 filter/source/svg/exports.map
-
-diff --git filter/source/config/fragments/fcfg_internalgraphics.mk filter/source/config/fragments/fcfg_internalgraphics.mk
-index ae978f0..d1f628a 100644
---- filter/source/config/fragments/fcfg_internalgraphics.mk
-+++ filter/source/config/fragments/fcfg_internalgraphics.mk
-@@ -68,6 +68,7 @@ F4_INTERNALGRAPHICS = \
-     sgf_Import \
-     sgv_Import \
-     svg_Export \
-+    svg_Import \
-     svm_Export \
-     svm_Import \
-     tga_Import \
-diff --git filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu
-new file mode 100644
-index 0000000..3393237
---- /dev/null
-+++ filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu
-@@ -0,0 +1,10 @@
-+    <node oor:name="svg_Import" oor:op="replace"  >
-+        <prop oor:name="Type"><value>svg_Scalable_Vector_Graphics</value></prop>
-+        <prop oor:name="FormatName"><value>svgfilter</value></prop>
-+        <prop oor:name="RealFilterName"/>
-+        <prop oor:name="UIComponent"/>
-+        <prop oor:name="UIName">
-+            <value xml:lang="en-US">SVG - Scalable Vector Graphics</value>
-+        </prop>
-+        <prop oor:name="Flags"><value>IMPORT</value></prop>
-+    </node>
-diff --git filter/source/svg/exports.map filter/source/svg/exports.map
-new file mode 100644
-index 0000000..185b5aa
---- /dev/null
-+++ filter/source/svg/exports.map
-@@ -0,0 +1,10 @@
-+UDK_3_0_0 {
-+        global:
-+                component_getImplementationEnvironment;
-+                component_getFactory;
-+                component_writeInfo;
-+                GraphicImport;
-+
-+        local:
-+                *;
-+};
-diff --git filter/source/svg/makefile.mk filter/source/svg/makefile.mk
-index c9f8e09..715ed82 100644
---- filter/source/svg/makefile.mk
-+++ filter/source/svg/makefile.mk
-@@ -74,6 +74,7 @@ SHL1STDLIBS=\
-     $(UNOTOOLSLIB)		\
-     $(TOOLSLIB)			\
-     $(COMPHELPERLIB)	\
-+    $(SVTOOLLIB)	    \
-     $(CPPUHELPERLIB)	\
-     $(CPPULIB)			\
-     $(SALLIB)			\
-@@ -82,7 +83,7 @@ SHL1STDLIBS=\
- SHL1DEPN=
- SHL1IMPLIB=	i$(SHL1TARGET)
- SHL1LIBS=	$(SLB)$/$(TARGET).lib
--SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-+SHL1VERSIONMAP=exports.map
- SHL1DEF=	$(MISC)$/$(SHL1TARGET).def
- 
- DEF1NAME=$(SHL1TARGET)
-diff --git filter/source/svg/svgfilter.cxx filter/source/svg/svgfilter.cxx
-index ec4fcc1..1975c0a 100644
---- filter/source/svg/svgfilter.cxx
-+++ filter/source/svg/svgfilter.cxx
-@@ -205,6 +205,14 @@ rtl::OUString SAL_CALL SVGFilter::detect( Sequence< PropertyValue >& io_rDescrip
- 
- // -----------------------------------------------------------------------------
- 
-+class FilterConfigItem;
-+extern "C" SAL_DLLPUBLIC_EXPORT BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
-+{
-+    return importSvg( rStream, rGraphic );
-+}
-+
-+// -----------------------------------------------------------------------------
-+
- namespace sdecl = comphelper::service_decl;
-  sdecl::class_<SVGFilter> serviceImpl;
-  const sdecl::ServiceDecl svgFilter(
-diff --git filter/source/svg/svgfilter.hxx filter/source/svg/svgfilter.hxx
-index 2200f31..36405f2 100644
---- filter/source/svg/svgfilter.hxx
-+++ filter/source/svg/svgfilter.hxx
-@@ -268,4 +268,11 @@ sal_Bool SAL_CALL SVGFilter_supportsService( const ::rtl::OUString& ServiceName
- SAL_CALL SVGFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
-     throw ( ::com::sun::star::uno::Exception );
- 
-+// -----------------------------------------------------------------------------
-+
-+class SvStream;
-+class Graphic;
-+
-+bool importSvg(SvStream & rStream, Graphic & rGraphic );
-+
- #endif // SVGFILTER_HXX
-diff --git filter/source/svg/svgreader.cxx filter/source/svg/svgreader.cxx
-index a566ff2..0edcce8 100644
---- filter/source/svg/svgreader.cxx
-+++ filter/source/svg/svgreader.cxx
-@@ -7,6 +7,7 @@
-  *      Thorsten Behrens <tbehrens at novell.com>
-  *
-  *      Copyright (C) 2008, Novell Inc.
-+ *      Parts copyright 2005 by Sun Microsystems, Inc.
-  *
-  *   The Contents of this file are made available subject to
-  *   the terms of GNU Lesser General Public License Version 2.1.
-@@ -41,6 +42,17 @@
- #include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
- #include <com/sun/star/xml/dom/NodeType.hpp>
- 
-+#include <comphelper/processfactory.hxx>
-+#include <basegfx/polygon/b2dpolygoncutandtouch.hxx>
-+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
-+#include <unotools/streamwrap.hxx>
-+#include <xmloff/xmluconv.hxx>
-+#include <vcl/graph.hxx>
-+#include <vcl/virdev.hxx>
-+#include <vcl/gradient.hxx>
-+#include <svtools/filter.hxx>
-+#include <tools/zcodec.hxx>
-+
- #include <boost/bind.hpp>
- #include <hash_set>
- #include <map>
-@@ -424,6 +436,9 @@ struct AnnotatingVisitor
-         // start&end color)
-         optimizeGradientStops(rState.maFillGradient);
- 
-+        if( !mxDocumentHandler.is() )
-+            return true; // cannot write style, svm import case
-+
-         // do we have a gradient fill? then write out gradient as well
-         if( rState.meFillType == GRADIENT && rState.maFillGradient.maStops.size() > 1 )
-         {
-@@ -1505,10 +1520,12 @@ struct ShapeWritingVisitor
-             for( sal_uInt32 i=0; i<rPoly.count(); ++i )
-             {
-                 aPolys.push_back(
--                    basegfx::tools::createAreaGeometryForPolygon(
--                        rPoly.getB2DPolygon(i),
--                        aState.mnStrokeWidth/2.0,
--                        aState.meLineJoin));
-+                    basegfx::tools::stripNeutralPolygons(
-+                        basegfx::tools::prepareForPolygonOperation(
-+                            basegfx::tools::createAreaGeometry(
-+                                rPoly.getB2DPolygon(i),
-+                                aState.mnStrokeWidth/2.0,
-+                                aState.meLineJoin))));
-                 // TODO(F2): line ends
-             }
- 
-@@ -1873,4 +1890,735 @@ sal_Bool SVGReader::parseAndConvert()
-     return sal_True;
- }
- 
-+///////////////////////////////////////////////////////////////
-+
-+struct ShapeRenderingVisitor
-+{
-+    ShapeRenderingVisitor(StatePool&    /*rStatePool*/,
-+                          StateMap&     rStateMap,
-+                          OutputDevice& rOutDev,
-+                          const std::vector< Gradient >& rGradientVector,
-+                          const std::vector< GradientStop >& rGradientStopVector) :
-+        mrStateMap(rStateMap),
-+        mrOutDev(rOutDev),
-+        mrGradientVector(rGradientVector),
-+        mrGradientStopVector(rGradientStopVector)
-+    {}
-+
-+    void operator()( const uno::Reference<xml::dom::XElement>& )
-+    {
-+    }
-+
-+    void operator()( const uno::Reference<xml::dom::XElement>&      xElem,
-+                     const uno::Reference<xml::dom::XNamedNodeMap>& xAttributes )
-+    {
-+        sal_Int32 nDummyIndex(0);
-+        rtl::OUString sStyleId(
-+            xElem->getAttribute(
-+                USTR("internal-style-ref")).getToken(
-+                    0,'$',nDummyIndex));
-+        StateMap::iterator pOrigState=mrStateMap.find(
-+            sStyleId.toInt32());
-+
-+        if( pOrigState == mrStateMap.end() )
-+            return; // non-exportable element, e.g. linearGradient
-+
-+        maCurrState = pOrigState->second;
-+
-+        const sal_Int32 nTokenId(getTokenId(xElem->getNodeName()));
-+        switch(nTokenId)
-+        {
-+            case XML_LINE:
-+            {
-+                // collect attributes
-+                const sal_Int32 nNumAttrs( xAttributes->getLength() );
-+                rtl::OUString sAttributeValue;
-+                double x1=0.0,y1=0.0,x2=0.0,y2=0.0;
-+                for( sal_Int32 i=0; i<nNumAttrs; ++i )
-+                {
-+                    sAttributeValue = xAttributes->item(i)->getNodeValue();
-+                    const sal_Int32 nAttribId(
-+                        getTokenId(xAttributes->item(i)->getNodeName()));
-+                    switch(nAttribId)
-+                    {
-+                        case XML_X1:
-+                            x1= convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_X2:
-+                            x2 = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_Y1:
-+                            y1 = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        case XML_Y2:
-+                            y2 = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        default:
-+                            // skip
-+                            break;
-+                    }
-+                }
-+
-+                basegfx::B2DPolygon aPoly;
-+                aPoly.append(basegfx::B2DPoint(x1,y1));
-+                aPoly.append(basegfx::B2DPoint(x2,y2));
-+
-+                renderPathShape(basegfx::B2DPolyPolygon(aPoly));
-+                break;
-+            }
-+            case XML_POLYGON:
-+            case XML_POLYLINE:
-+            {
-+                rtl::OUString sPoints = xElem->hasAttribute(USTR("points")) ? xElem->getAttribute(USTR("points")) : USTR("");
-+                basegfx::B2DPolygon aPoly;
-+                basegfx::tools::importFromSvgPoints(aPoly, sPoints);
-+                if( nTokenId == XML_POLYGON || maCurrState.meFillType != NONE )
-+                    aPoly.setClosed(true);
-+
-+                renderPathShape(basegfx::B2DPolyPolygon(aPoly));
-+                break;
-+            }
-+            case XML_RECT:
-+            {
-+                // collect attributes
-+                const sal_Int32 nNumAttrs( xAttributes->getLength() );
-+                rtl::OUString sAttributeValue;
-+                bool bRxSeen=false, bRySeen=false;
-+                double x=0.0,y=0.0,width=0.0,height=0.0,rx=0.0,ry=0.0;
-+                for( sal_Int32 i=0; i<nNumAttrs; ++i )
-+                {
-+                    sAttributeValue = xAttributes->item(i)->getNodeValue();
-+                    const sal_Int32 nAttribId(
-+                        getTokenId(xAttributes->item(i)->getNodeName()));
-+                    switch(nAttribId)
-+                    {
-+                        case XML_X:
-+                            x = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_Y:
-+                            y = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        case XML_WIDTH:
-+                            width = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_HEIGHT:
-+                            height = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        case XML_RX:
-+                            rx = convLength(sAttributeValue,maCurrState,'h');
-+                            bRxSeen=true;
-+                            break;
-+                        case XML_RY:
-+                            ry = convLength(sAttributeValue,maCurrState,'v');
-+                            bRySeen=true;
-+                            break;
-+                        default:
-+                            // skip
-+                            break;
-+                    }
-+                }
-+
-+                if( bRxSeen && !bRySeen )
-+                    ry = rx;
-+                else if( bRySeen && !bRxSeen )
-+                    rx = ry;
-+
-+                basegfx::B2DPolygon aPoly;
-+                aPoly = basegfx::tools::createPolygonFromRect(
-+                    basegfx::B2DRange(x,y,x+width,y+height),
-+                    rx, ry );
-+
-+                renderPathShape(basegfx::B2DPolyPolygon(aPoly));
-+                break;
-+            }
-+            case XML_PATH:
-+            {
-+                rtl::OUString sPath = xElem->hasAttribute(USTR("d")) ? xElem->getAttribute(USTR("d")) : USTR("");
-+                basegfx::B2DPolyPolygon aPoly;
-+                basegfx::tools::importFromSvgD(aPoly, sPath);
-+
-+                renderPathShape(aPoly);
-+                break;
-+            }
-+            case XML_CIRCLE:
-+            {
-+                // collect attributes
-+                const sal_Int32 nNumAttrs( xAttributes->getLength() );
-+                rtl::OUString sAttributeValue;
-+                double cx=0.0,cy=0.0,r=0.0;
-+                for( sal_Int32 i=0; i<nNumAttrs; ++i )
-+                {
-+                    sAttributeValue = xAttributes->item(i)->getNodeValue();
-+                    const sal_Int32 nAttribId(
-+                        getTokenId(xAttributes->item(i)->getNodeName()));
-+                    switch(nAttribId)
-+                    {
-+                        case XML_CX:
-+                            cx = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_CY:
-+                            cy = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        case XML_R:
-+                            r = convLength(sAttributeValue,maCurrState,'o');
-+                        default:
-+                            // skip
-+                            break;
-+                    }
-+                }
-+
-+                basegfx::B2DEllipse aEllipse(basegfx::B2DPoint(cx, cy), basegfx::B2DTuple(r,r));
-+                basegfx::B2DPolygon aPoly = basegfx::tools::createPolygonFromEllipse(
-+                    aEllipse.getB2DEllipseCenter(),
-+                    aEllipse.getB2DEllipseRadius().getX(),
-+                    aEllipse.getB2DEllipseRadius().getY());
-+
-+                renderPathShape(basegfx::B2DPolyPolygon(aPoly));
-+                break;
-+            }
-+            case XML_ELLIPSE:
-+            {
-+                // collect attributes
-+                const sal_Int32 nNumAttrs( xAttributes->getLength() );
-+                rtl::OUString sAttributeValue;
-+                double cx=0.0,cy=0.0,rx=0.0, ry=0.0;
-+                for( sal_Int32 i=0; i<nNumAttrs; ++i )
-+                {
-+                    sAttributeValue = xAttributes->item(i)->getNodeValue();
-+                    const sal_Int32 nAttribId(
-+                        getTokenId(xAttributes->item(i)->getNodeName()));
-+                    switch(nAttribId)
-+                    {
-+                        case XML_CX:
-+                            cx = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_CY:
-+                            cy = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        case XML_RX:
-+                            rx = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_RY:
-+                            ry = convLength(sAttributeValue,maCurrState,'v');
-+                        default:
-+                            // skip
-+                            break;
-+                    }
-+                }
-+
-+                basegfx::B2DEllipse aEllipse(basegfx::B2DPoint(cx, cy), basegfx::B2DTuple(rx,ry));
-+                basegfx::B2DPolygon aPoly = basegfx::tools::createPolygonFromEllipse(
-+                    aEllipse.getB2DEllipseCenter(),
-+                    aEllipse.getB2DEllipseRadius().getX(),
-+                    aEllipse.getB2DEllipseRadius().getY());
-+
-+                renderPathShape(basegfx::B2DPolyPolygon(aPoly));
-+                break;
-+            }
-+            case XML_IMAGE:
-+            {
-+                // collect attributes
-+                const sal_Int32 nNumAttrs( xAttributes->getLength() );
-+                rtl::OUString sAttributeValue;
-+                double x=0.0,y=0.0,width=0.0,height=0.0;
-+                for( sal_Int32 i=0; i<nNumAttrs; ++i )
-+                {
-+                    sAttributeValue = xAttributes->item(i)->getNodeValue();
-+                    const sal_Int32 nAttribId(
-+                        getTokenId(xAttributes->item(i)->getNodeName()));
-+                    switch(nAttribId)
-+                    {
-+                        case XML_X:
-+                            x = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_Y:
-+                            y = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        case XML_WIDTH:
-+                            width = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_HEIGHT:
-+                            height = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        default:
-+                            // skip
-+                            break;
-+                    }
-+                }
-+
-+                rtl::OUString sValue = xElem->hasAttribute(USTR("href")) ? xElem->getAttribute(USTR("href")) : USTR("");
-+                rtl::OString aValueUtf8( sValue.getStr(), sValue.getLength(), RTL_TEXTENCODING_UTF8 );
-+                std::string sLinkValue;
-+                parseXlinkHref(aValueUtf8.getStr(), sLinkValue);
-+
-+                if (!sLinkValue.empty())
-+                {
-+                    // <- blatant copy from svx/source/xml/xmlgrhlp.cxx
-+                    Graphic aGraphic;
-+
-+                    uno::Sequence<sal_Int8> aData;
-+                    SvXMLUnitConverter::decodeBase64(aData,
-+                                                     rtl::OUString::createFromAscii(sLinkValue.c_str()));
-+                    SvMemoryStream aSrc(aData.getArray(),
-+                                        aData.getLength(),
-+                                        STREAM_READ);
-+                    USHORT nFormat = GRFILTER_FORMAT_DONTKNOW;
-+                    USHORT pDeterminedFormat = GRFILTER_FORMAT_DONTKNOW;
-+                    GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), aSrc ,nFormat,&pDeterminedFormat );
-+
-+                    if (pDeterminedFormat == GRFILTER_FORMAT_DONTKNOW)
-+                    {
-+                        //Read the first two byte to check whether it is a gzipped stream, is so it may be in wmz or emz format
-+                        //unzip them and try again
-+
-+                        BYTE    sFirstBytes[ 2 ];
-+
-+                        aSrc.Seek( STREAM_SEEK_TO_END );
-+                        ULONG nStreamLen = aSrc.Tell();
-+                        aSrc.Seek( 0 );
-+
-+                        if ( !nStreamLen )
-+                        {
-+                            SvLockBytes* pLockBytes = aSrc.GetLockBytes();
-+                            if ( pLockBytes  )
-+                                pLockBytes->SetSynchronMode( TRUE );
-+
-+                            aSrc.Seek( STREAM_SEEK_TO_END );
-+                            nStreamLen = aSrc.Tell();
-+                            aSrc.Seek( 0 );
-+                        }
-+                        if( nStreamLen >= 2 )
-+                        {
-+                            //read two byte
-+                            aSrc.Read( sFirstBytes, 2 );
-+
-+                            if( sFirstBytes[0] == 0x1f && sFirstBytes[1] == 0x8b )
-+                            {
-+                                SvMemoryStream* pDest = new SvMemoryStream;
-+                                ZCodec aZCodec( 0x8000, 0x8000 );
-+                                aZCodec.BeginCompression(ZCODEC_GZ_LIB);
-+                                aSrc.Seek( 0 );
-+                                aZCodec.Decompress( aSrc, *pDest );
-+
-+                                if (aZCodec.EndCompression() && pDest )
-+                                {
-+                                    pDest->Seek( STREAM_SEEK_TO_END );
-+                                    ULONG nStreamLen_ = pDest->Tell();
-+                                    if (nStreamLen_)
-+                                    {
-+                                        pDest->Seek(0L);
-+                                        GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), *pDest ,nFormat,&pDeterminedFormat );
-+                                    }
-+                                }
-+                                delete pDest;
-+                            }
-+                        }
-+                    }
-+                    // -> blatant copy from svx/source/xml/xmlgrhlp.cxx
-+
-+                    const Rectangle aBounds(
-+                        Point(basegfx::fround(pt100thmm(x)),
-+                              basegfx::fround(pt100thmm(y))),
-+                        Size(basegfx::fround(pt100thmm(width)),
-+                             basegfx::fround(pt100thmm(height))));
-+                    aGraphic.Draw(&mrOutDev,
-+                                  aBounds.TopLeft(),
-+                                  aBounds.GetSize());
-+                    maBounds.Union(aBounds);
-+                }
-+                break;
-+            }
-+            case XML_TEXT:
-+            {
-+                // collect text from all TEXT_NODE children into sText
-+                rtl::OUStringBuffer sText;
-+                visitChildren(boost::bind(
-+                                  (rtl::OUStringBuffer& (rtl::OUStringBuffer::*)(const sal_Unicode* str))&rtl::OUStringBuffer::append,
-+                                  boost::ref(sText),
-+                                  boost::bind(&xml::dom::XNode::getNodeValue,
-+                                              _1)),
-+                              xElem,
-+                              xml::dom::NodeType_TEXT_NODE);
-+
-+                // collect attributes
-+                const sal_Int32 nNumAttrs( xAttributes->getLength() );
-+                rtl::OUString sAttributeValue;
-+                double x=0.0,y=0.0,width=0.0,height=0.0;
-+                for( sal_Int32 i=0; i<nNumAttrs; ++i )
-+                {
-+                    sAttributeValue = xAttributes->item(i)->getNodeValue();
-+                    const sal_Int32 nAttribId(
-+                        getTokenId(xAttributes->item(i)->getNodeName()));
-+                    switch(nAttribId)
-+                    {
-+                        case XML_X:
-+                            x = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_Y:
-+                            y = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        case XML_WIDTH:
-+                            width = convLength(sAttributeValue,maCurrState,'h');
-+                            break;
-+                        case XML_HEIGHT:
-+                            height = convLength(sAttributeValue,maCurrState,'v');
-+                            break;
-+                        default:
-+                            // skip
-+                            break;
-+                    }
-+                }
-+
-+                // actually export text
-+                Font aFont(maCurrState.maFontFamily,
-+                           Size(0,
-+                                basegfx::fround(pt100thmm(maCurrState.mnFontSize))));
-+
-+                // extract basic transformations out of CTM
-+                basegfx::B2DTuple aScale, aTranslate;
-+                double fRotate, fShearX;
-+                ::rtl::OUString sTransformValue;
-+                if (maCurrState.maCTM.decompose(aScale, aTranslate, fRotate, fShearX))
-+                {
-+                    rtl::OUString sTransform;
-+                    x += aTranslate.getX();
-+                    y += aTranslate.getY();
-+
-+                    aFont.SetSize(
-+                        Size(basegfx::fround(aFont.GetWidth()*aScale.getX()),
-+                             basegfx::fround(aFont.GetHeight()*aScale.getY())));
-+
-+                    if( fRotate )
-+                        aFont.SetOrientation(basegfx::fround(fRotate*1800.0/M_PI));
-+                }
-+
-+                // TODO(F2): update bounds
-+                mrOutDev.SetFont(aFont);
-+                mrOutDev.DrawText(Point(basegfx::fround(pt100thmm(x)),
-+                                        basegfx::fround(pt100thmm(y))),
-+                                  sText.makeStringAndClear());
-+                break;
-+            }
-+        }
-+    }
-+
-+    void push()
-+    {
-+    }
-+
-+    void pop()
-+    {
-+    }
-+
-+    bool hasGradientOpacity( const Gradient& rGradient )
-+    {
-+        return
-+            mrGradientStopVector[
-+                rGradient.maStops[0]].maStopColor.a != 1.0 ||
-+            mrGradientStopVector[
-+                rGradient.maStops[1]].maStopColor.a != 1.0;
-+    }
-+
-+    sal_Int8 toByteColor( double val )
-+    {
-+        // TODO(Q3): duplicated from vcl::unotools
-+        return sal::static_int_cast<sal_Int8>(
-+            basegfx::fround(val*255.0));
-+    }
-+
-+    ::Color getVclColor( const ARGBColor& rColor )
-+    {
-+        const sal_uInt8 nRed  ( toByteColor(rColor.r)   );
-+        const sal_uInt8 nGreen( toByteColor(rColor.g) );
-+        const sal_uInt8 nBlue ( toByteColor(rColor.b)  );
-+
-+        return ::Color(nRed,nGreen,nBlue);
-+    }
-+
-+    void renderPathShape(const basegfx::B2DPolyPolygon& rPoly)
-+    {
-+        // we might need to split up polypolygon into multiple path
-+        // shapes (e.g. when emulating line stroking)
-+        State aState = maCurrState;
-+
-+        // bring polygon from pt coordinate system to 100th millimeter
-+        aState.maCTM.scale(2540.0/72.0,2540.0/72.0);
-+
-+        basegfx::B2DPolyPolygon aPoly(rPoly);
-+        aPoly.transform(aState.maCTM);
-+
-+        const basegfx::B2DRange aBounds=basegfx::tools::getRange(aPoly);
-+        maBounds.Union(
-+            Rectangle(
-+                basegfx::fround(aBounds.getMinX()),
-+                basegfx::fround(aBounds.getMinY()),
-+                basegfx::fround(aBounds.getMaxX()),
-+                basegfx::fround(aBounds.getMaxY())));
-+
-+        // fill first
-+        mrOutDev.SetLineColor();
-+
-+        // do we have a gradient fill?
-+        if( aState.meFillType == GRADIENT && aState.maFillGradient.maStops.size() > 1 )
-+        {
-+            ::Gradient aGradient;
-+
-+            if( aState.maFillGradient.meType == Gradient::LINEAR )
-+            {
-+                // should the optimizeGradientStops method decide that
-+                // this is a three-color gradient, it prolly wanted us
-+                // to take axial instead
-+                aGradient = ::Gradient( aState.maFillGradient.maStops.size() == 3 ?
-+                                        GRADIENT_AXIAL :
-+                                        GRADIENT_LINEAR );
-+            }
-+            else
-+            {
-+                aGradient = ::Gradient( GRADIENT_ELLIPTICAL );
-+            }
-+
-+            basegfx::B2DTuple rScale, rTranslate;
-+            double rRotate, rShearX;
-+            if( aState.maFillGradient.maTransform.decompose(rScale, rTranslate, rRotate, rShearX) )
-+                aGradient.SetAngle( basegfx::fround(rRotate*1800.0/M_PI) );
-+            aGradient.SetStartColor( getVclColor(
-+                                         mrGradientStopVector[
-+                                             aState.maFillGradient.maStops[0]].maStopColor) );
-+            aGradient.SetEndColor( getVclColor(
-+                                       mrGradientStopVector[
-+                                           aState.maFillGradient.maStops[1]].maStopColor) );
-+
-+            if( hasGradientOpacity(aState.maFillGradient) )
-+            {
-+                ::Gradient aTransparencyGradient=aGradient;
-+
-+                const BYTE	cTransStart( 255-
-+                    basegfx::fround(mrGradientStopVector[
-+                                        aState.maFillGradient.maStops[1]].maStopColor.a*
-+                                    aState.mnFillOpacity*255.0));
-+                const Color aTransStart( cTransStart, cTransStart, cTransStart );
-+
-+                const BYTE	cTransEnd( 255-
-+                    basegfx::fround(mrGradientStopVector[
-+                                        aState.maFillGradient.maStops[0]].maStopColor.a*
-+                                    aState.mnFillOpacity*255.0));
-+                const Color aTransEnd( cTransEnd, cTransEnd, cTransEnd );
-+
-+                // modulate gradient opacity with overall fill opacity
-+                aTransparencyGradient.SetStartColor(aTransStart);
-+                aTransparencyGradient.SetEndColor(aTransEnd);
-+
-+                VirtualDevice	aVDev;
-+                GDIMetaFile		aMtf;
-+
-+                aVDev.EnableOutput( FALSE );
-+                aVDev.SetMapMode( mrOutDev.GetMapMode() );
-+                aMtf.Record( &aVDev );
-+
-+                aVDev.SetLineColor();
-+                aVDev.SetFillColor();
-+                aVDev.DrawGradient(::PolyPolygon(aPoly),aGradient);
-+
-+                const Rectangle aMtfBounds(
-+                    basegfx::fround(aBounds.getMinX()),
-+                    basegfx::fround(aBounds.getMinY()),
-+                    basegfx::fround(aBounds.getMaxX()),
-+                    basegfx::fround(aBounds.getMaxY()));
-+
-+                MapMode aMap(mrOutDev.GetMapMode());
-+                aMtf.Stop();
-+                aMtf.WindStart();
-+                aMap.SetOrigin( aMtfBounds.TopLeft() );
-+                aMtf.SetPrefMapMode( aMap );
-+                aMtf.SetPrefSize( aMtfBounds.GetSize() );
-+
-+                mrOutDev.DrawTransparent(aMtf,
-+                                         aMtfBounds.TopLeft(),
-+                                         aMtfBounds.GetSize(),
-+                                         aTransparencyGradient);
-+            }
-+            else
-+            {
-+                mrOutDev.DrawGradient(::PolyPolygon(aPoly),aGradient);
-+            }
-+        }
-+        else
-+        {
-+            if( aState.meFillType == NONE )
-+                mrOutDev.SetFillColor();
-+            else
-+                mrOutDev.SetFillColor(getVclColor(aState.maFillColor));
-+
-+            if( aState.mnFillOpacity != 1.0 )
-+                mrOutDev.DrawTransparent(::PolyPolygon(aPoly),
-+                                         basegfx::fround(
-+                                             (1.0-aState.mnFillOpacity)*100.0));
-+            else
-+                mrOutDev.DrawPolyPolygon(::PolyPolygon(aPoly));
-+        }
-+
-+        // Stroking now
-+        mrOutDev.SetFillColor();
-+
-+        if( aState.meStrokeType != NONE &&
-+            (aState.maDashArray.size() ||
-+             aState.mnStrokeWidth != 1.0) )
-+        {
-+            // vcl thick lines are severly borked - generate filled
-+            // polygon instead
-+            std::vector<basegfx::B2DPolyPolygon> aPolys;
-+            aPoly = rPoly;
-+            if( !aState.maDashArray.empty() )
-+            {
-+                aPoly.clear();
-+                basegfx::B2DPolyPolygon aSegment;
-+                for( sal_uInt32 i=0; i<rPoly.count(); ++i )
-+                {
-+                    basegfx::tools::applyLineDashing(rPoly,
-+                                                     aState.maDashArray,
-+                                                     &aSegment);
-+                    aPoly.append(aSegment);
-+                }
-+            }
-+
-+            // applied line dashing to original rPoly above, to get
-+            // correctly transformed lengths - need to transform
-+            // again, now
-+            aPoly.transform(aState.maCTM);
-+
-+            for( sal_uInt32 i=0; i<aPoly.count(); ++i )
-+            {
-+                // ugly. convert to integer-based tools polygon
-+                // first, and only _then_ remove intersections (we
-+                // might get new ones from the rounding)
-+                aPolys.push_back(
-+                    basegfx::tools::stripNeutralPolygons(
-+                        basegfx::tools::prepareForPolygonOperation(
-+                            ::PolyPolygon(
-+                                basegfx::tools::createAreaGeometry(
-+                                    aPoly.getB2DPolygon(i),
-+                                    pt100thmm(aState.mnStrokeWidth/2.0),
-+                                    aState.meLineJoin)).getB2DPolyPolygon())));
-+                // TODO(F2): line ends
-+            }
-+
-+            mrOutDev.SetLineColor();
-+            mrOutDev.SetFillColor(getVclColor(aState.maStrokeColor));
-+
-+            for( sal_uInt32 i=0; i<aPolys.size(); ++i )
-+            {
-+                if( aState.mnStrokeOpacity != 1.0 )
-+                    mrOutDev.DrawTransparent(::PolyPolygon(aPolys[i]),
-+                                             basegfx::fround(
-+                                                 (1.0-aState.mnStrokeOpacity)*100.0));
-+                else
-+                    mrOutDev.DrawPolyPolygon(::PolyPolygon(aPolys[i]));
-+
-+                const basegfx::B2DRange aStrokeBounds=basegfx::tools::getRange(aPolys[i]);
-+                maBounds.Union(
-+                    Rectangle(
-+                        basegfx::fround(aStrokeBounds.getMinX()),
-+                        basegfx::fround(aStrokeBounds.getMinY()),
-+                        basegfx::fround(aStrokeBounds.getMaxX()),
-+                        basegfx::fround(aStrokeBounds.getMaxY())));
-+            }
-+        }
-+        else
-+        {
-+            if( aState.meStrokeType == NONE )
-+                mrOutDev.SetLineColor();
-+            else
-+                mrOutDev.SetLineColor(getVclColor(aState.maStrokeColor));
-+
-+            if( aState.mnStrokeOpacity != 1.0 )
-+                mrOutDev.DrawTransparent(::PolyPolygon(aPoly),
-+                                         basegfx::fround(
-+                                             (1.0-aState.mnStrokeOpacity)*100.0));
-+            else
-+                mrOutDev.DrawPolyPolygon(::PolyPolygon(aPoly));
-+        }
-+    }
-+
-+    State                                      maCurrState;
-+    StateMap&                                  mrStateMap;
-+    OutputDevice&                               mrOutDev;
-+    const std::vector< Gradient >&             mrGradientVector;
-+    const std::vector< GradientStop >&         mrGradientStopVector;
-+    Rectangle                                   maBounds;
-+};
-+
- } // namespace svgi
-+
-+bool importSvg(SvStream & rStream, Graphic & rGraphic )
-+{
-+    const uno::Reference<lang::XMultiServiceFactory> xServiceFactory(
-+        ::comphelper::getProcessServiceFactory());
-+
-+    uno::Reference<xml::dom::XDocumentBuilder> xDomBuilder(
-+        xServiceFactory->createInstance(
-+            rtl::OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")),
-+        uno::UNO_QUERY );
-+
-+    uno::Reference<io::XInputStream> xStream(
-+        new utl::OInputStreamWrapper(rStream) );
-+
-+    uno::Reference<xml::dom::XDocument> xDom(
-+        xDomBuilder->parse(xStream),
-+        uno::UNO_QUERY_THROW );
-+
-+    uno::Reference<xml::dom::XElement> xDocElem( xDom->getDocumentElement(),
-+                                                 uno::UNO_QUERY_THROW );
-+
-+    VirtualDevice	aVDev;
-+    GDIMetaFile		aMtf;
-+
-+    aVDev.EnableOutput( FALSE );
-+    aMtf.Record( &aVDev );
-+
-+    // parse styles and fill state stack
-+    svgi::State      aInitialState;
-+    svgi::StatePool aStatePool;
-+    svgi::StateMap  aStateMap;
-+    svgi::AnnotatingVisitor aVisitor(aStatePool,
-+                                     aStateMap,
-+                                     aInitialState,
-+                                     uno::Reference<xml::sax::XDocumentHandler>());
-+    svgi::visitElements(aVisitor, xDocElem);
-+
-+#ifdef VERBOSE
-+    dumpTree(xDocElem);
-+#endif
-+
-+    // render all shapes to mtf
-+    svgi::ShapeRenderingVisitor aRenderer(aStatePool,aStateMap,aVDev,
-+                                         aVisitor.maGradientVector,
-+                                         aVisitor.maGradientStopVector);
-+    svgi::visitElements(aRenderer, xDocElem);
-+
-+    aMtf.Stop();
-+
-+    aMtf.WindStart();
-+    aMtf.SetPrefMapMode( MAP_100TH_MM );
-+
-+    // get the document dimensions
-+
-+    // if the "width" and "height" attributes are missing, inkscape fakes
-+    // A4 portrait for. Let's do the same.
-+    if (!xDocElem->hasAttribute(USTR("width")))
-+        xDocElem->setAttribute(USTR("width"), USTR("210mm"));
-+    if (!xDocElem->hasAttribute(USTR("height")))
-+        xDocElem->setAttribute(USTR("height"), USTR("297mm"));
-+
-+    aMtf.SetPrefSize(
-+        Size(
-+            std::max(
-+                sal_Int32(aRenderer.maBounds.Right()),
-+                basegfx::fround( svgi::pt100thmm(svgi::convLength(xDocElem->getAttribute(USTR("width")),aInitialState,'h')) )),
-+            std::max(
-+                sal_Int32(aRenderer.maBounds.Bottom()),
-+                basegfx::fround( svgi::pt100thmm(svgi::convLength(xDocElem->getAttribute(USTR("height")),aInitialState,'v')) ))));
-+
-+    rGraphic = aMtf;
-+
-+    return sal_True;
-+}
-diff --git filter/source/svg/test/makefile.mk filter/source/svg/test/makefile.mk
-index bff1c08..01df371 100644
---- filter/source/svg/test/makefile.mk
-+++ filter/source/svg/test/makefile.mk
-@@ -41,6 +41,7 @@ SHL1STDLIBS= 	        \
-     $(UNOTOOLSLIB)		\
-     $(TOOLSLIB)			\
-     $(COMPHELPERLIB)	\
-+    $(SVTOOLLIB)	    \
-     $(CPPUHELPERLIB)	\
-     $(CPPULIB)			\
-     $(SALLIB)			\
--- 
-1.7.0.1
-
diff --git a/patches/dev300/svg-import-filter.diff b/patches/dev300/svg-import-filter.diff
deleted file mode 100644
index 0a3c8c7..0000000
--- a/patches/dev300/svg-import-filter.diff
+++ /dev/null
@@ -1,5323 +0,0 @@
-From 3b6cb401977e2bfa539acfbeabb5dde210f29099 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:01:57 +0200
-Subject: [PATCH 418/768] svg-import-filter.diff
-
----
- .../source/config/fragments/fcfg_drawgraphics.mk   |    1 +
- .../filters/SVG___Scalable_Vector_Graphics.xcu     |   13 +
- .../types/svg_Scalable_Vector_Graphics.xcu         |    6 +-
- filter/source/svg/b2dellipse.cxx                   |  139 ++
- filter/source/svg/b2dellipse.hxx                   |   77 +
- filter/source/svg/gentoken.pl                      |   58 +
- filter/source/svg/gfxtypes.hxx                     |  356 ++++
- filter/source/svg/makefile.mk                      |   52 +-
- filter/source/svg/parserfragments.cxx              |  553 ++++++
- filter/source/svg/parserfragments.hxx              |   50 +
- filter/source/svg/spirit_supplements.hxx           |  115 ++
- filter/source/svg/svgfilter.cxx                    |  107 +-
- filter/source/svg/svgfilter.hxx                    |   39 +-
- filter/source/svg/svgimport.cxx                    |  191 +--
- filter/source/svg/svgreader.cxx                    | 1876 ++++++++++++++++++++
- filter/source/svg/svgreader.hxx                    |   43 +
- filter/source/svg/test/makefile.mk                 |  114 ++
- filter/source/svg/test/odfserializer.cxx           |  140 ++
- filter/source/svg/test/odfserializer.hxx           |   31 +
- filter/source/svg/test/parsertest.cxx              |  209 +++
- filter/source/svg/test/svg2odf.cxx                 |  124 ++
- filter/source/svg/tokenmap.cxx                     |   62 +
- filter/source/svg/tokenmap.hxx                     |   32 +
- filter/source/svg/tokens.txt                       |  403 +++++
- filter/source/svg/units.cxx                        |   99 +
- filter/source/svg/units.hxx                        |   60 +
- 26 files changed, 4695 insertions(+), 255 deletions(-)
- create mode 100644 filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu
- create mode 100644 filter/source/svg/b2dellipse.cxx
- create mode 100644 filter/source/svg/b2dellipse.hxx
- create mode 100644 filter/source/svg/gentoken.pl
- create mode 100644 filter/source/svg/gfxtypes.hxx
- create mode 100644 filter/source/svg/parserfragments.cxx
- create mode 100644 filter/source/svg/parserfragments.hxx
- create mode 100644 filter/source/svg/spirit_supplements.hxx
- create mode 100644 filter/source/svg/svgreader.cxx
- create mode 100644 filter/source/svg/svgreader.hxx
- create mode 100644 filter/source/svg/test/makefile.mk
- create mode 100644 filter/source/svg/test/odfserializer.cxx
- create mode 100644 filter/source/svg/test/odfserializer.hxx
- create mode 100644 filter/source/svg/test/parsertest.cxx
- create mode 100644 filter/source/svg/test/svg2odf.cxx
- create mode 100644 filter/source/svg/tokenmap.cxx
- create mode 100644 filter/source/svg/tokenmap.hxx
- create mode 100644 filter/source/svg/tokens.txt
- create mode 100644 filter/source/svg/units.cxx
- create mode 100644 filter/source/svg/units.hxx
-
-diff --git filter/source/config/fragments/fcfg_drawgraphics.mk filter/source/config/fragments/fcfg_drawgraphics.mk
-index 7038e27..41a4625 100644
---- filter/source/config/fragments/fcfg_drawgraphics.mk
-+++ filter/source/config/fragments/fcfg_drawgraphics.mk
-@@ -54,6 +54,7 @@ F4_DRAWGRAPHICS = \
-     SGF___StarOffice_Writer_SGF \
-     SGV___StarDraw_2_0 \
-     SVM___StarView_Metafile \
-+    SVG___Scalable_Vector_Graphics \
-     TGA___Truevision_TARGA \
-     TIF___Tag_Image_File \
-     WMF___MS_Windows_Metafile \
-diff --git filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu
-new file mode 100644
-index 0000000..1212e05
---- /dev/null
-+++ filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu
-@@ -0,0 +1,13 @@
-+    <node oor:name="SVG - Scalable Vector Graphics" oor:op="replace">
-+        <prop oor:name="Flags"><value>IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED</value></prop>
-+        <prop oor:name="UIComponent"/>
-+        <prop oor:name="FilterService"><value>com.sun.star.comp.Draw.SVGFilter</value></prop>
-+        <prop oor:name="UserData"><value></value></prop>
-+        <prop oor:name="UIName">
-+            <value xml:lang="x-default">SVG - Scalable Vector Graphics</value>
-+        </prop>
-+        <prop oor:name="FileFormatVersion"><value>0</value></prop>
-+        <prop oor:name="Type"><value>svg_Scalable_Vector_Graphics</value></prop>
-+        <prop oor:name="TemplateName"/>
-+        <prop oor:name="DocumentService"><value>com.sun.star.drawing.DrawingDocument</value></prop>
-+    </node>
-diff --git filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu
-index 37643df..8865dee 100644
---- filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu
-+++ filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu
-@@ -1,10 +1,10 @@
-     <node oor:name="svg_Scalable_Vector_Graphics" oor:op="replace" >
--        <prop oor:name="DetectService"/>
-+        <prop oor:name="DetectService"><value>com.sun.star.comp.Draw.SVGFilter</value></prop>
-         <prop oor:name="URLPattern"/>
-         <prop oor:name="Extensions"><value>svg</value></prop>
-         <prop oor:name="MediaType"><value>image/svg+xml</value></prop>
--        <prop oor:name="Preferred"><value>false</value></prop>
--        <prop oor:name="PreferredFilter"/>
-+        <prop oor:name="Preferred"><value>true</value></prop>
-+        <prop oor:name="PreferredFilter"><value>SVG - Scalable Vector Graphics</value></prop>
-         <prop oor:name="UIName">
-             <value>SVG - Scalable Vector Graphics</value>
-         </prop>
-diff --git filter/source/svg/b2dellipse.cxx filter/source/svg/b2dellipse.cxx
-new file mode 100644
-index 0000000..a8ec0e5
---- /dev/null
-+++ filter/source/svg/b2dellipse.cxx
-@@ -0,0 +1,139 @@
-+/*************************************************************************
-+ *
-+ *    OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *    Author:
-+ *      Fridrich Strba  <fridrich.strba at bluewin.ch>
-+ *      Thorsten Behrens <tbehrens at novell.com>
-+ *
-+ *      Copyright (C) 2008, Novell Inc.
-+ *
-+ *   The Contents of this file are made available subject to
-+ *   the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ ************************************************************************/
-+
-+#include "b2dellipse.hxx"
-+
-+#include <osl/diagnose.h>
-+
-+#include <basegfx/point/b2dpoint.hxx>
-+
-+#include <basegfx/matrix/b2dhommatrix.hxx>
-+
-+#include <rtl/instance.hxx>
-+
-+#include <boost/scoped_ptr.hpp>
-+#include <vector>
-+#include <algorithm>
-+
-+class ImplB2DEllipse
-+{
-+     basegfx::B2DPoint maCenter;
-+     basegfx::B2DTuple maRadius;
-+
-+public:
-+    ImplB2DEllipse()
-+    :	maCenter(0.0f, 0.0f),
-+        maRadius(0.0f, 0.0f)
-+    {}
-+
-+    ImplB2DEllipse(const ImplB2DEllipse& rToBeCopied)
-+    :	maCenter(rToBeCopied.maCenter),
-+        maRadius(rToBeCopied.maRadius)
-+    {}
-+
-+    ImplB2DEllipse& operator=( const ImplB2DEllipse& rToBeCopied )
-+    {
-+        maCenter = rToBeCopied.maCenter;
-+        maRadius = rToBeCopied.maRadius;
-+
-+        return *this;
-+    }
-+
-+    bool isEqual(const ImplB2DEllipse& rCandidate) const
-+    {
-+        return (maCenter == rCandidate.maCenter)
-+            && (maRadius == rCandidate.maRadius);
-+    }
-+
-+    basegfx::B2DPoint getCenter() const
-+    {
-+        return maCenter;
-+    }
-+
-+    void setCenter(const basegfx::B2DPoint& rCenter)
-+    {
-+        maCenter = rCenter;
-+    }
-+
-+    basegfx::B2DTuple getRadius() const
-+    {
-+        return maRadius;
-+    }
-+
-+    void setRadius(const basegfx::B2DTuple& rRadius)
-+    {
-+        maRadius = rRadius;
-+    }
-+
-+
-+    void transform(const basegfx::B2DHomMatrix& /* rMatrix */)
-+    {
-+    }
-+};
-+
-+//////////////////////////////////////////////////////////////////////////////
-+
-+namespace basegfx
-+{
-+
-+    B2DEllipse::B2DEllipse()
-+    {}
-+
-+    B2DEllipse::B2DEllipse(const basegfx::B2DPoint& rCenter, const basegfx::B2DTuple& rRadius)
-+    :	maCenter(rCenter), maRadius(rRadius)
-+    {
-+    }
-+
-+    B2DEllipse::~B2DEllipse()
-+    {
-+    }
-+
-+    bool B2DEllipse::operator==(const B2DEllipse& rEllipse) const
-+    {
-+        return (maCenter == rEllipse.maCenter) && (maRadius == rEllipse.maRadius);
-+    }
-+
-+    bool B2DEllipse::operator!=(const B2DEllipse& rEllipse) const
-+    {
-+        return !(*this == rEllipse);
-+    }
-+
-+    basegfx::B2DPoint B2DEllipse::getB2DEllipseCenter() const
-+    {
-+        return maCenter;
-+    }
-+
-+    void B2DEllipse::setB2DEllipseCenter(const basegfx::B2DPoint& rCenter)
-+    {
-+        maCenter = rCenter;
-+    }
-+
-+    basegfx::B2DTuple B2DEllipse::getB2DEllipseRadius() const
-+    {
-+        return maRadius;
-+    }
-+
-+    void B2DEllipse::setB2DEllipseRadius(const basegfx::B2DTuple& rRadius)
-+    {
-+        maRadius = rRadius;
-+    }
-+
-+    void B2DEllipse::transform(const basegfx::B2DHomMatrix& /* rMatrix */)
-+    {
-+    }
-+} // end of namespace basegfx
-+
-+//////////////////////////////////////////////////////////////////////////////
-+// eof
-diff --git filter/source/svg/b2dellipse.hxx filter/source/svg/b2dellipse.hxx
-new file mode 100644
-index 0000000..f1b2845
---- /dev/null
-+++ filter/source/svg/b2dellipse.hxx
-@@ -0,0 +1,77 @@
-+/*************************************************************************
-+ *
-+ *    OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *    Author:
-+ *      Fridrich Strba  <fridrich.strba at bluewin.ch>
-+ *      Thorsten Behrens <tbehrens at novell.com>
-+ *
-+ *      Copyright (C) 2008, Novell Inc.
-+ *
-+ *   The Contents of this file are made available subject to
-+ *   the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ ************************************************************************/
-+
-+#ifndef _BASEGFX_B2DELLIPSE_HXX
-+#define _BASEGFX_B2DELLIPSE_HXX
-+
-+#include <sal/types.h>
-+
-+#include <o3tl/cow_wrapper.hxx>
-+
-+#include <basegfx/point/b2dpoint.hxx>
-+
-+#include <basegfx/tuple/b2dtuple.hxx>
-+
-+#include <basegfx/vector/b2enums.hxx>
-+
-+//////////////////////////////////////////////////////////////////////////////
-+// predeclarations
-+class ImplB2DEllipse;
-+
-+namespace basegfx
-+{
-+    class B2DPoint;
-+    class B2DVector;
-+    class B2DHomMatrix;
-+} // end of namespace basegfx
-+
-+//////////////////////////////////////////////////////////////////////////////
-+
-+namespace basegfx
-+{
-+    class B2DEllipse
-+    {
-+    private:
-+     basegfx::B2DPoint maCenter;
-+     basegfx::B2DTuple maRadius;
-+
-+    public:
-+        B2DEllipse();
-+        B2DEllipse(const B2DEllipse& rEllipse);
-+        B2DEllipse(const basegfx::B2DPoint& rCenter, const basegfx::B2DTuple& rRadius);
-+        ~B2DEllipse();
-+
-+        // assignment operator
-+        B2DEllipse& operator=(const B2DEllipse& rEllipse);
-+
-+        // compare operators
-+        bool operator==(const B2DEllipse& rEllipse) const;
-+        bool operator!=(const B2DEllipse& rEllipse) const;
-+
-+        // Coordinate interface
-+        basegfx::B2DPoint getB2DEllipseCenter() const;
-+        void setB2DEllipseCenter(const basegfx::B2DPoint& rCenter);
-+
-+        basegfx::B2DTuple getB2DEllipseRadius() const;
-+        void setB2DEllipseRadius(const basegfx::B2DTuple& rRadius);
-+
-+        // apply transformation given in matrix form to the Ellipse
-+        void transform(const basegfx::B2DHomMatrix& rMatrix);
-+    };
-+} // end of namespace basegfx
-+
-+//////////////////////////////////////////////////////////////////////////////
-+
-+#endif /* _BASEGFX_B2DELLIPSE_HXX */
-diff --git filter/source/svg/gentoken.pl filter/source/svg/gentoken.pl
-new file mode 100644
-index 0000000..75bb1e2
---- /dev/null
-+++ filter/source/svg/gentoken.pl
-@@ -0,0 +1,58 @@
-+# from oox/source/token - should really put this into solenv
-+
-+$ARGV0 = shift @ARGV;
-+$ARGV1 = shift @ARGV;
-+$ARGV2 = shift @ARGV;
-+
-+open ( TOKENS, $ARGV0 ) || die "can't open token file: $!";
-+my %tokens;
-+
-+while ( defined ($line = <TOKENS>) )
-+{
-+    if( !($line =~ /^#/) )
-+    {
-+        chomp($line);
-+        @token = split(/\s+/,$line);
-+        if ( not defined ($token[1]) )
-+        {
-+            $token[1] = "XML_".$token[0];
-+            $token[1] =~ tr/\-\.\:/___/;
-+            $token[1] =~ s/\+/PLUS/g;
-+            $token[1] =~ s/\-/MINUS/g;
-+        }
-+
-+        $tokens{$token[0]} = uc($token[1]);
-+    }
-+}
-+close ( TOKENS );
-+
-+open ( HXX, ">$ARGV1" ) || die "can't open tokens.hxx file: $!";
-+open ( GPERF, ">$ARGV2" ) || die "can't open tokens.gperf file: $!";
-+
-+print ( GPERF "%language=C++\n" );
-+print ( GPERF "%global-table\n" );
-+print ( GPERF "%null-strings\n" );
-+print ( GPERF "%struct-type\n" );
-+print ( GPERF "struct xmltoken\n" );
-+print ( GPERF "{\n" );
-+print ( GPERF "  const sal_Char *name; sal_Int32 nToken; \n" );
-+print ( GPERF "};\n" );
-+print ( GPERF "%%\n" );
-+
-+print ( HXX "#ifndef INCLUDED_AUTOGEN_TOKEN_HXX\n" );
-+print ( HXX "#define INCLUDED_AUTOGEN_TOKEN_HXX\n\n" );
-+print ( HXX "#include <sal/types.h>\n\n" );
-+
-+$i = 0;
-+foreach( sort(keys(%tokens)) )
-+{
-+    print( HXX "const sal_Int32 $tokens{$_} = $i;\n" );
-+    print( GPERF "$_,$tokens{$_}\n" );
-+    $i = $i + 1;
-+}
-+print ( GPERF "%%\n" );
-+print ( HXX "const sal_Int32 XML_TOKEN_COUNT = $i;\n" );
-+print ( HXX "const sal_Int32 XML_TOKEN_INVALID = -1;\n\n" );
-+print ( HXX "#endif\n" );
-+close ( HXX );
-+close ( GPERF );
-diff --git filter/source/svg/gfxtypes.hxx filter/source/svg/gfxtypes.hxx
-new file mode 100644
-index 0000000..9eae095
---- /dev/null
-+++ filter/source/svg/gfxtypes.hxx
-@@ -0,0 +1,356 @@
-+/*************************************************************************
-+ *
-+ *    OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *    Author:
-+ *      Fridrich Strba  <fridrich.strba at bluewin.ch>
-+ *      Thorsten Behrens <tbehrens at novell.com>
-+ *
-+ *      Copyright (C) 2008, Novell Inc.
-+ *
-+ *   The Contents of this file are made available subject to
-+ *   the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ ************************************************************************/
-+
-+#ifndef INCLUDED_GFXTYPES_HXX
-+#define INCLUDED_GFXTYPES_HXX
-+
-+#include <basegfx/range/b2drange.hxx>
-+#include <basegfx/matrix/b2dhommatrix.hxx>
-+#include <basegfx/polygon/b2dlinegeometry.hxx>
-+
-+#include <hash_set>
-+#include <hash_map>
-+#include <rtl/ustring.hxx>
-+
-+namespace svgi
-+{
-+
-+struct ARGBColor
-+{
-+    double toDoubleColor( sal_uInt8 val ) { return val/255.0; }
-+
-+    ARGBColor() : a(1.0), r(0.0), g(0.0), b(0.0)
-+    {}
-+    explicit ARGBColor(double fGrey) : a(1.0), r(fGrey), g(fGrey), b(fGrey)
-+    {}
-+    ARGBColor( double r_, double g_, double b_ ) :
-+        a(1.0), r(r_), g(g_), b(b_)
-+    {}
-+    ARGBColor( double a_, double r_, double g_, double b_ ) :
-+        a(a_), r(r_), g(g_), b(b_)
-+    {}
-+    ARGBColor( int r_, int g_, int b_ ) :
-+        a(1.0),
-+        r(toDoubleColor(sal::static_int_cast<sal_uInt8>(r_))),
-+        g(toDoubleColor(sal::static_int_cast<sal_uInt8>(g_))),
-+        b(toDoubleColor(sal::static_int_cast<sal_uInt8>(b_)))
-+    {}
-+    ARGBColor( int a_, int r_, int g_, int b_ ) :
-+        a(toDoubleColor(sal::static_int_cast<sal_uInt8>(a_))),
-+        r(toDoubleColor(sal::static_int_cast<sal_uInt8>(r_))),
-+        g(toDoubleColor(sal::static_int_cast<sal_uInt8>(g_))),
-+        b(toDoubleColor(sal::static_int_cast<sal_uInt8>(b_)))
-+    {}
-+    double a;
-+    double r;
-+    double g;
-+    double b;
-+};
-+inline bool operator==( const ARGBColor& rLHS, const ARGBColor& rRHS )
-+{ return rLHS.a==rRHS.a && rLHS.r==rRHS.r && rLHS.g==rRHS.g && rLHS.b==rRHS.b; }
-+inline bool operator!=( const ARGBColor& rLHS, const ARGBColor& rRHS )
-+{ return !(rLHS==rRHS); }
-+
-+struct GradientStop
-+{
-+    GradientStop() : maStopColor(), mnStopPosition(0.0)
-+    {}
-+    ARGBColor     maStopColor;
-+    double        mnStopPosition;
-+};
-+inline bool operator==( const GradientStop& rLHS, const GradientStop& rRHS )
-+{ return rLHS.mnStopPosition==rRHS.mnStopPosition && rLHS.maStopColor==rRHS.maStopColor; }
-+
-+struct Gradient
-+{
-+    enum GradientType { LINEAR, RADIAL};
-+    std::vector<sal_Size> maStops;
-+    basegfx::B2DHomMatrix maTransform;
-+    GradientType          meType;
-+    union
-+    {
-+        double test;
-+        struct
-+        {
-+            double                mfX1;
-+            double                mfX2;
-+            double                mfY1;
-+            double                mfY2;
-+        } linear;
-+        struct
-+        {
-+            double                mfCX;
-+            double                mfCY;
-+            double                mfFX;
-+            double                mfFY;
-+            double                mfR;
-+        } radial;
-+    } maCoords;
-+    sal_Int32             mnId;
-+    bool                  mbBoundingBoxUnits;
-+    bool                  mbLinearBoundingBoxUnits;
-+
-+//    explicit Gradient(GradientType eType) : maStops(), maTransform(), meType(eType), maCoords.mfCX(0.0), maCoords.mfCY(0.0), maCoords.mfFX(0.0), maCoords.mfFY(0.0), maCoords.mfR(0.0), mnId(0), mbBoundingBoxUnits(false)
-+    explicit Gradient(GradientType eType) : maStops(), maTransform(), meType(eType), mnId(0), mbBoundingBoxUnits(false)
-+    {
-+        maCoords.radial.mfCX = 0.0;
-+        maCoords.radial.mfCY = 0.0;
-+        maCoords.radial.mfFX = 0.0;
-+        maCoords.radial.mfFY = 0.0;
-+        maCoords.radial.mfR  = 0.0;
-+    }
-+};
-+
-+inline bool operator==( const Gradient& rLHS, const Gradient& rRHS )
-+{
-+    if( rLHS.meType != rRHS.meType )
-+        return false;
-+    if( rLHS.meType == Gradient::LINEAR )
-+        return rLHS.mbBoundingBoxUnits==rRHS.mbBoundingBoxUnits && rLHS.maStops==rRHS.maStops &&
-+            rLHS.maCoords.linear.mfX1 == rRHS.maCoords.linear.mfX1 && rLHS.maCoords.linear.mfX2 == rRHS.maCoords.linear.mfX2 &&
-+            rLHS.maCoords.linear.mfY1 == rRHS.maCoords.linear.mfY1 && rLHS.maCoords.linear.mfY2 == rRHS.maCoords.linear.mfY2;
-+    else
-+        return rLHS.mbBoundingBoxUnits==rRHS.mbBoundingBoxUnits && rLHS.maStops==rRHS.maStops &&
-+            rLHS.maCoords.radial.mfCX == rRHS.maCoords.radial.mfCX && rLHS.maCoords.radial.mfCY == rRHS.maCoords.radial.mfCY &&
-+            rLHS.maCoords.radial.mfFX == rRHS.maCoords.radial.mfFX && rLHS.maCoords.radial.mfFY == rRHS.maCoords.radial.mfFY &&
-+            rLHS.maCoords.radial.mfR == rRHS.maCoords.radial.mfR;
-+}
-+
-+enum PaintType
-+{
-+    NONE,
-+    SOLID,
-+    GRADIENT
-+};
-+
-+enum FillRule
-+{
-+    NON_ZERO,
-+    EVEN_ODD
-+};
-+
-+enum TextAlign
-+{
-+    BEFORE,
-+    CENTER,
-+    AFTER
-+};
-+
-+enum CapStyle
-+{
-+    BUTT,
-+    RECT,
-+    ROUND
-+};
-+
-+enum FontStyle
-+{
-+    STYLE_NORMAL,
-+    STYLE_OBLIQUE,
-+    STYLE_ITALIC
-+};
-+
-+enum FontVariant
-+{
-+    VARIANT_NORMAL,
-+    VARIANT_SMALLCAPS
-+};
-+
-+struct State
-+{
-+    State() :
-+        maCTM(),
-+        maTransform(),
-+        maViewport(),
-+        maViewBox(),
-+        maFontFamily(), // app-default
-+        mnFontSize(12.0),
-+        meFontStyle(STYLE_NORMAL),
-+        meFontVariant(VARIANT_NORMAL),
-+        mnFontWeight(400.0),
-+        meTextAnchor(BEFORE),
-+        meTextDisplayAlign(BEFORE),
-+        mnTextLineIncrement(0.0),
-+        maCurrentColor(1.0),
-+        mbVisibility(true),
-+        meFillType(SOLID),
-+        mnFillOpacity(1.0),
-+        meStrokeType(NONE),
-+        mnStrokeOpacity(1.0),
-+        meViewportFillType(NONE),
-+        mnViewportFillOpacity(1.0),
-+        maFillColor(0.0),
-+        maFillGradient(Gradient::LINEAR),
-+        meFillRule(NON_ZERO),
-+        maStrokeColor(0.0),
-+        maStrokeGradient(Gradient::LINEAR),
-+        maDashArray(),
-+        mnDashOffset(0.0),
-+        meLineCap(BUTT),
-+        meLineJoin(basegfx::B2DLINEJOIN_MITER),
-+        mnMiterLimit(4.0),
-+        mnStrokeWidth(1.0),
-+        maViewportFillColor(1.0),
-+        maViewportFillGradient(Gradient::LINEAR),
-+        mnStyleId(0)
-+    {}
-+
-+    basegfx::B2DHomMatrix       maCTM;
-+    basegfx::B2DHomMatrix       maTransform;
-+    basegfx::B2DRange           maViewport;
-+    basegfx::B2DRange           maViewBox;
-+
-+    rtl::OUString               maFontFamily;
-+    /** Absolute: xx-small=6.94 | x-small=8.33 | small=10 | medium=12 | large=14.4 | x-large=17.28 | xx-large=20.736
-+
-+        Relative(to parent): larger (enlarge by 1.2)
-+                             smaller (shrink by 1.2)
-+
-+     */
-+    double                      mnFontSize;
-+    FontStyle                   meFontStyle;
-+    FontVariant                 meFontVariant;
-+    double                      mnFontWeight;
-+
-+    TextAlign                   meTextAnchor; // text-anchor
-+    TextAlign                   meTextDisplayAlign; // display-align
-+    double                      mnTextLineIncrement; // 0.0 means auto
-+
-+    ARGBColor                   maCurrentColor;
-+    bool                        mbVisibility;
-+
-+    PaintType                   meFillType;
-+    double                      mnFillOpacity;
-+    PaintType                   meStrokeType;
-+    double                      mnStrokeOpacity;
-+    PaintType                   meViewportFillType;
-+    double                      mnViewportFillOpacity;
-+
-+    ARGBColor                   maFillColor;
-+    Gradient                    maFillGradient;
-+    FillRule                    meFillRule;
-+
-+    ARGBColor                   maStrokeColor;
-+    Gradient                    maStrokeGradient;
-+    std::vector<double>         maDashArray;
-+    double                      mnDashOffset;
-+    CapStyle                    meLineCap;
-+    basegfx::B2DLineJoin        meLineJoin;
-+    double                      mnMiterLimit;
-+    double                      mnStrokeWidth;
-+
-+    ARGBColor                   maViewportFillColor;
-+    Gradient                    maViewportFillGradient;
-+
-+    sal_Int32                   mnStyleId;
-+};
-+
-+inline bool operator==(const State& rLHS, const State& rRHS )
-+{
-+    return rLHS.maCTM==rRHS.maCTM &&
-+        rLHS.maTransform==rRHS.maTransform &&
-+        rLHS.maViewport==rRHS.maViewport &&
-+        rLHS.maViewBox==rRHS.maViewBox &&
-+        rLHS.maFontFamily==rRHS.maFontFamily &&
-+        rLHS.mnFontSize==rRHS.mnFontSize &&
-+        rLHS.meFontStyle==rRHS.meFontStyle &&
-+        rLHS.meFontVariant==rRHS.meFontVariant &&
-+        rLHS.mnFontWeight==rRHS.mnFontWeight &&
-+        rLHS.meTextAnchor==rRHS.meTextAnchor &&
-+        rLHS.meTextDisplayAlign==rRHS.meTextDisplayAlign &&
-+        rLHS.mnTextLineIncrement==rRHS.mnTextLineIncrement &&
-+        rLHS.maCurrentColor==rRHS.maCurrentColor &&
-+        rLHS.mbVisibility==rRHS.mbVisibility &&
-+        rLHS.meFillType==rRHS.meFillType &&
-+        rLHS.mnFillOpacity==rRHS.mnFillOpacity &&
-+        rLHS.meStrokeType==rRHS.meStrokeType &&
-+        rLHS.mnStrokeOpacity==rRHS.mnStrokeOpacity &&
-+        rLHS.meViewportFillType==rRHS.meViewportFillType &&
-+        rLHS.mnViewportFillOpacity==rRHS.mnViewportFillOpacity &&
-+        rLHS.maFillColor==rRHS.maFillColor &&
-+        rLHS.maFillGradient==rRHS.maFillGradient &&
-+        rLHS.meFillRule==rRHS.meFillRule &&
-+        rLHS.maStrokeColor==rRHS.maStrokeColor &&
-+        rLHS.maStrokeGradient==rRHS.maStrokeGradient &&
-+        rLHS.maDashArray==rRHS.maDashArray &&
-+        rLHS.mnDashOffset==rRHS.mnDashOffset &&
-+        rLHS.meLineCap==rRHS.meLineCap &&
-+        rLHS.meLineJoin==rRHS.meLineJoin &&
-+        rLHS.mnMiterLimit==rRHS.mnMiterLimit &&
-+        rLHS.mnStrokeWidth==rRHS.mnStrokeWidth &&
-+        rLHS.maViewportFillColor==rRHS.maViewportFillColor &&
-+        rLHS.maViewportFillGradient==rRHS.maViewportFillGradient;
-+}
-+
-+struct StateHash
-+{
-+    size_t operator()(const State& rState ) const
-+    {
-+        return size_t(rState.maCTM.get( 0, 0 ))
-+            ^  size_t(rState.maCTM.get( 1, 0 ))
-+            ^  size_t(rState.maCTM.get( 0, 1 ))
-+            ^  size_t(rState.maCTM.get( 1, 1 ))
-+            ^  size_t(rState.maCTM.get( 0, 2 ))
-+            ^  size_t(rState.maCTM.get( 1, 2 ))
-+            ^  size_t(rState.maViewport.getWidth())
-+            ^  size_t(rState.maViewport.getHeight())
-+            ^  size_t(rState.maViewBox.getWidth())
-+            ^  size_t(rState.maViewBox.getHeight())
-+            ^  size_t(rState.maFontFamily.hashCode())
-+            ^  size_t(rState.mnFontSize)
-+            ^  size_t(rState.meFontStyle)
-+            ^  size_t(rState.meFontVariant)
-+            ^  size_t(rState.mnFontWeight)
-+            ^  size_t(rState.meTextAnchor)
-+            ^  size_t(rState.meTextDisplayAlign)
-+            ^  size_t(rState.mnTextLineIncrement)
-+            ^  size_t(rState.mbVisibility)
-+            ^  size_t(rState.meFillType)
-+            ^  size_t(rState.mnFillOpacity)
-+            ^  size_t(rState.meStrokeType)
-+            ^  size_t(rState.mnStrokeOpacity)
-+            ^  size_t(rState.meViewportFillType)
-+            ^  size_t(rState.mnViewportFillOpacity)
-+            ^  size_t(rState.maFillColor.a)
-+            ^  size_t(rState.maFillColor.r)
-+            ^  size_t(rState.maFillColor.g)
-+            ^  size_t(rState.maFillColor.b)
-+            ^  size_t(rState.maFillGradient.maStops.size())
-+            ^  size_t(rState.meFillRule)
-+            ^  size_t(rState.maStrokeColor.a)
-+            ^  size_t(rState.maStrokeColor.r)
-+            ^  size_t(rState.maStrokeColor.g)
-+            ^  size_t(rState.maStrokeColor.b)
-+            ^  size_t(rState.maStrokeGradient.maStops.size())
-+            ^  size_t(rState.maDashArray.size())
-+            ^  size_t(rState.mnDashOffset)
-+            ^  size_t(rState.meLineCap)
-+            ^  size_t(rState.meLineJoin)
-+            ^  size_t(rState.mnMiterLimit)
-+            ^  size_t(rState.mnStrokeWidth)
-+            ^  size_t(rState.maViewportFillColor.a)
-+            ^  size_t(rState.maViewportFillColor.r)
-+            ^  size_t(rState.maViewportFillColor.g)
-+            ^  size_t(rState.maViewportFillColor.b)
-+            ^  size_t(rState.maViewportFillGradient.maStops.size());
-+    }
-+};
-+
-+typedef std::hash_set<State, StateHash> StatePool;
-+typedef std::hash_map<sal_Int32, State> StateMap;
-+
-+} // namespace svgi
-+
-+#endif
-diff --git filter/source/svg/makefile.mk filter/source/svg/makefile.mk
-index 12c1210..c9f8e09 100644
---- filter/source/svg/makefile.mk
-+++ filter/source/svg/makefile.mk
-@@ -26,25 +26,38 @@
- #*************************************************************************
- 
- PRJ=..$/..
-+
- PRJNAME=filter
- TARGET=svgfilter
--
- ENABLE_EXCEPTIONS=TRUE
- VISIBILITY_HIDDEN=TRUE
- 
- # --- Settings ----------------------------------
- 
--.INCLUDE :  	settings.mk
-+.INCLUDE :  settings.mk
-+.INCLUDE :	libs.mk
- 
- # --- Types -------------------------------------
- 
--SLOFILES=	$(SLO)$/svguno.obj			\
--            $(SLO)$/svgfilter.obj		\
-+SLOFILES= \
-+            $(SLO)$/b2dellipse.obj	\
-+            $(SLO)$/parserfragments.obj \
-             $(SLO)$/svgexport.obj		\
-+            $(SLO)$/svgfilter.obj		\
-             $(SLO)$/svgfontexport.obj	\
--            $(SLO)$/svgwriter.obj	
--.IF "$(SOLAR_JAVA)"!=""
--SLOFILES+=		$(SLO)$/svgimport.obj
-+            $(SLO)$/svgimport.obj		\
-+            $(SLO)$/svgreader.obj		\
-+            $(SLO)$/svgwriter.obj		\
-+            $(SLO)$/tokenmap.obj        \
-+            $(SLO)$/units.obj
-+
-+.IF "$(COMID)"=="gcc3"
-+.IF "$(CCNUMVER)">="000400000000" || "$(SYSTEM_BOOST)"=="YES"
-+CFLAGS+=-DUSE_MODERN_SPIRIT
-+.ENDIF
-+.ENDIF
-+.IF "$(SYSTEM_BOOST)"=="NO"
-+CFLAGS+=-DUSE_MODERN_SPIRIT
- .ENDIF
- 
- # --- Library -----------------------------------
-@@ -54,21 +67,17 @@ SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
- SHL1STDLIBS=\
-     $(EDITENGLIB)			\
-     $(SVXCORELIB)			\
-+    $(BASEGFXLIB)		\
-     $(XMLOFFLIB)		\
--    $(SVTOOLLIB)		\
-+    $(SVTOOLLIB)	    \
-     $(VCLLIB)			\
-     $(UNOTOOLSLIB)		\
-     $(TOOLSLIB)			\
-     $(COMPHELPERLIB)	\
-     $(CPPUHELPERLIB)	\
-     $(CPPULIB)			\
--    $(SALLIB) 
--
--.IF "$(SOLAR_JAVA)"!=""
--SHL1STDLIBS+=\
--    $(JVMACCESSLIB)
--.ENDIF
--
-+    $(SALLIB)			\
-+    $(LIBXML)
- 
- SHL1DEPN=
- SHL1IMPLIB=	i$(SHL1TARGET)
-@@ -81,3 +90,16 @@ DEF1NAME=$(SHL1TARGET)
- # --- Targets ----------------------------------
- 
- .INCLUDE : target.mk
-+
-+# Generate gperf files - from oox/source/token
-+$(INCCOM)$/tokens.hxx $(MISC)$/tokens.gperf : tokens.txt gentoken.pl
-+        $(PERL) gentoken.pl tokens.txt $(INCCOM)$/tokens.hxx $(MISC)$/tokens.gperf
-+
-+$(INCCOM)$/tokens.cxx : $(MISC)$/tokens.gperf makefile.mk
-+        gperf --compare-strncmp -C -m 20 $(MISC)$/tokens.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" >$(INCCOM)$/tokens.cxx
-+
-+$(SLO)$/tokenmap.obj : $(INCCOM)$/tokens.cxx $(INCCOM)$/tokens.hxx
-+
-+$(SLO)$/parserfragments.obj : $(INCCOM)$/tokens.cxx $(INCCOM)$/tokens.hxx
-+
-+$(SLO)$/svgreader.obj : $(INCCOM)$/tokens.cxx $(INCCOM)$/tokens.hxx
-diff --git filter/source/svg/parserfragments.cxx filter/source/svg/parserfragments.cxx
-new file mode 100644
-index 0000000..996f912
---- /dev/null
-+++ filter/source/svg/parserfragments.cxx
-@@ -0,0 +1,553 @@
-+/*************************************************************************
-+ *
-+ *    OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *    Author:
-+ *      Fridrich Strba  <fridrich.strba at bluewin.ch>
-+ *      Thorsten Behrens <tbehrens at novell.com>
-+ *
-+ *      Copyright (C) 2008, Novell Inc.
-+ *
-+ *   The Contents of this file are made available subject to
-+ *   the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ ************************************************************************/
-+
-+// MARKER(update_precomp.py): autogen include statement, do not remove
-+#include "precompiled_filter.hxx"
-+
-+#include "parserfragments.hxx"
-+#include "spirit_supplements.hxx"
-+#include "gfxtypes.hxx"
-+
-+#include <basegfx/tools/canvastools.hxx>
-+#include <com/sun/star/geometry/AffineMatrix2D.hpp>
-+
-+#include <string.h>
-+#include <limits.h>
-+#include <boost/bind.hpp>
-+#include <boost/spirit.hpp>
-+#include <boost/spirit/dynamic/while.hpp>
-+#include <numeric>
-+#include <algorithm>
-+
-+#include "units.hxx"
-+#include "tokenmap.hxx"
-+
-+using namespace ::com::sun::star;
-+
-+namespace svgi
-+{
-+
-+inline sal_uInt8 hex2int( char val )
-+{
-+    return val <= '9' ? val-'0' : (val < 'a' ? val+10-'A' : val+10-'a');
-+}
-+
-+void setFourBitColor( double& rChannel, char nChar )
-+{
-+    const sal_uInt8 nVal(hex2int(nChar));
-+    OSL_TRACE( "setFourBitCOlor %d color", nVal );
-+    rChannel = (nVal*16+nVal)/255.0;
-+}
-+
-+void setEightBitColor( double& rChannel, const char* pStart, const char* )
-+{
-+    const sal_uInt8 nVal0(hex2int(pStart[0]));
-+    const sal_uInt8 nVal1(hex2int(pStart[1]));
-+    OSL_TRACE( "setEightbitCOlor %d, %d color", nVal0, nVal1 );
-+    rChannel = (nVal0*16+nVal1)/255.0;
-+}
-+
-+void setIntColor( double& rChannel, sal_uInt8 nVal )
-+{
-+    OSL_TRACE( "setIntColor %d color", nVal );
-+    rChannel = nVal/255.0;
-+}
-+
-+void calcRotation(std::vector<geometry::AffineMatrix2D>& rTransforms,
-+                  geometry::AffineMatrix2D&              rCurrTransform,
-+                  double                                 fRotationAngle)
-+{
-+    ::basegfx::B2DHomMatrix aCurr;
-+    aCurr.translate(-rCurrTransform.m02,-rCurrTransform.m12);
-+    aCurr.rotate(fRotationAngle*M_PI/180);
-+    aCurr.translate(rCurrTransform.m02,rCurrTransform.m12);
-+
-+    OSL_TRACE("calcRotation - fRotationAngle - %f", fRotationAngle);
-+    rTransforms.push_back(
-+        basegfx::unotools::affineMatrixFromHomMatrix(
-+            rCurrTransform,
-+            aCurr));
-+}
-+
-+void calcSkewX(std::vector<geometry::AffineMatrix2D>& rTransforms,
-+               double                                 fSkewAngle)
-+{
-+    geometry::AffineMatrix2D aMat(1.0,0.0,0.0,
-+                                  tan(fSkewAngle*M_PI/180),1.0,0.0);
-+    rTransforms.push_back(aMat);
-+}
-+
-+void calcSkewY(std::vector<geometry::AffineMatrix2D>& rTransforms,
-+               double                                 fSkewAngle)
-+{
-+    geometry::AffineMatrix2D aMat(1.0,tan(fSkewAngle*M_PI/180),0.0,
-+                                  0.0,1.0,0.0);
-+    rTransforms.push_back(aMat);
-+}
-+
-+void assign_twice(double& r_oVal1, double& r_oVal2, const double& rInVal )
-+{
-+    r_oVal1 = r_oVal2 = rInVal;
-+}
-+
-+geometry::AffineMatrix2D multiplyMatrix( const geometry::AffineMatrix2D& rLHS,
-+                                         const geometry::AffineMatrix2D& rRHS )
-+{
-+    basegfx::B2DHomMatrix aLHS;
-+    basegfx::B2DHomMatrix aRHS;
-+
-+    basegfx::unotools::homMatrixFromAffineMatrix(aLHS,rLHS);
-+    basegfx::unotools::homMatrixFromAffineMatrix(aRHS,rRHS);
-+
-+    aRHS*=aLHS;
-+
-+    geometry::AffineMatrix2D aRet;
-+    return basegfx::unotools::affineMatrixFromHomMatrix(aRet,aRHS);
-+}
-+
-+bool parseColor( const char* sColor, ARGBColor& rColor  )
-+{
-+    using namespace ::boost::spirit;
-+
-+    int_parser<sal_uInt8,10,1,3> byte_p;
-+
-+    if( parse(sColor,
-+            //  Begin grammar
-+            (
-+                // the #rrggbb form
-+                ('#' >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor,
-+                                                           boost::ref(rColor.r),_1,_2)]
-+                     >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor,
-+                                                           boost::ref(rColor.g),_1,_2)]
-+                     >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor,
-+                                                           boost::ref(rColor.b),_1,_2)])
-+              |
-+                // the #rgb form
-+                ('#' >> xdigit_p[boost::bind(&setFourBitColor,
-+                                             boost::ref(rColor.r),_1)]
-+                     >> xdigit_p[boost::bind(&setFourBitColor,
-+                                             boost::ref(rColor.g),_1)]
-+                     >> xdigit_p[boost::bind(&setFourBitColor,
-+                                             boost::ref(rColor.b),_1)])
-+              |
-+                // rgb() form
-+                (str_p("rgb")
-+                 >> '(' >>
-+                     (
-+                             // rgb(int,int,int)
-+                             (byte_p[boost::bind(&setIntColor,
-+                                                 boost::ref(rColor.r),_1)] >> ',' >>
-+                              byte_p[boost::bind(&setIntColor,
-+                                                 boost::ref(rColor.g),_1)] >> ',' >>
-+                              byte_p[boost::bind(&setIntColor,
-+                                                 boost::ref(rColor.b),_1)])
-+                           |
-+                             // rgb(double,double,double)
-+                             (real_p[assign_a(rColor.r)] >> ',' >>
-+                              real_p[assign_a(rColor.g)] >> ',' >>
-+                              real_p[assign_a(rColor.b)])
-+                     )
-+                 >> ')')
-+            ) >> end_p,
-+            //  End grammar
-+            space_p).full )
-+    {
-+        // free-form color found & parsed
-+        return true;
-+    }
-+
-+    // no free-form color - maybe a color name?
-+    // trim white space before
-+    while( *sColor &&
-+           (*sColor==' ' || *sColor=='\t' || *sColor=='\r' || *sColor=='\n') )
-+        ++sColor;
-+    // trim white space after
-+    int nLen=strlen(sColor)-1;
-+    while( nLen &&
-+           (sColor[nLen]==' ' || sColor[nLen]=='\t' || sColor[nLen]=='\r' || sColor[nLen]=='\n') )
-+        --nLen;
-+    switch (getTokenId(sColor, nLen+1))
-+    {
-+        case XML_ALICEBLUE: rColor = ARGBColor(240,248,255); return true;
-+        case XML_ANTIQUEWHITE: rColor = ARGBColor(250,235,215); return true;
-+        case XML_AQUA: rColor = ARGBColor(0,255,255); return true;
-+        case XML_AQUAMARINE: rColor = ARGBColor(127,255,212); return true;
-+        case XML_AZURE: rColor = ARGBColor(240,255,255); return true;
-+        case XML_BEIGE: rColor = ARGBColor(245,245,220); return true;
-+        case XML_BISQUE: rColor = ARGBColor(255,228,196); return true;
-+        case XML_BLACK: rColor = ARGBColor(0,0,0); return true;
-+        case XML_BLANCHEDALMOND: rColor = ARGBColor(255,235,205); return true;
-+        case XML_BLUE: rColor = ARGBColor(0,0,255); return true;
-+        case XML_BLUEVIOLET: rColor = ARGBColor(138,43,226); return true;
-+        case XML_BROWN: rColor = ARGBColor(165,42,42); return true;
-+        case XML_BURLYWOOD: rColor = ARGBColor(222,184,135); return true;
-+        case XML_CADETBLUE: rColor = ARGBColor(95,158,160); return true;
-+        case XML_CHARTREUSE: rColor = ARGBColor(127,255,0); return true;
-+        case XML_CHOCOLATE: rColor = ARGBColor(210,105,30); return true;
-+        case XML_CORAL: rColor = ARGBColor(255,127,80); return true;
-+        case XML_CORNFLOWERBLUE: rColor = ARGBColor(100,149,237); return true;
-+        case XML_CORNSILK: rColor = ARGBColor(255,248,220); return true;
-+        case XML_CRIMSON: rColor = ARGBColor(220,20,60); return true;
-+        case XML_CYAN: rColor = ARGBColor(0,255,255); return true;
-+        case XML_DARKBLUE: rColor = ARGBColor(0,0,139); return true;
-+        case XML_DARKCYAN: rColor = ARGBColor(0,139,139); return true;
-+        case XML_DARKGOLDENROD: rColor = ARGBColor(184,134,11); return true;
-+        case XML_DARKGRAY: rColor = ARGBColor(169,169,169); return true;
-+        case XML_DARKGREEN: rColor = ARGBColor(0,100,0); return true;
-+        case XML_DARKGREY: rColor = ARGBColor(169,169,169); return true;
-+        case XML_DARKKHAKI: rColor = ARGBColor(189,183,107); return true;
-+        case XML_DARKMAGENTA: rColor = ARGBColor(139,0,139); return true;
-+        case XML_DARKOLIVEGREEN: rColor = ARGBColor(85,107,47); return true;
-+        case XML_DARKORANGE: rColor = ARGBColor(255,140,0); return true;
-+        case XML_DARKORCHID: rColor = ARGBColor(153,50,204); return true;
-+        case XML_DARKRED: rColor = ARGBColor(139,0,0); return true;
-+        case XML_DARKSALMON: rColor = ARGBColor(233,150,122); return true;
-+        case XML_DARKSEAGREEN: rColor = ARGBColor(143,188,143); return true;
-+        case XML_DARKSLATEBLUE: rColor = ARGBColor(72,61,139); return true;
-+        case XML_DARKSLATEGRAY: rColor = ARGBColor(47,79,79); return true;
-+        case XML_DARKSLATEGREY: rColor = ARGBColor(47,79,79); return true;
-+        case XML_DARKTURQUOISE: rColor = ARGBColor(0,206,209); return true;
-+        case XML_DARKVIOLET: rColor = ARGBColor(148,0,211); return true;
-+        case XML_DEEPPINK: rColor = ARGBColor(255,20,147); return true;
-+        case XML_DEEPSKYBLUE: rColor = ARGBColor(0,191,255); return true;
-+        case XML_DIMGRAY: rColor = ARGBColor(105,105,105); return true;
-+        case XML_DIMGREY: rColor = ARGBColor(105,105,105); return true;
-+        case XML_DODGERBLUE: rColor = ARGBColor(30,144,255); return true;
-+        case XML_FIREBRICK: rColor = ARGBColor(178,34,34); return true;
-+        case XML_FLORALWHITE: rColor = ARGBColor(255,250,240); return true;
-+        case XML_FORESTGREEN: rColor = ARGBColor(34,139,34); return true;
-+        case XML_FUCHSIA: rColor = ARGBColor(255,0,255); return true;
-+        case XML_GAINSBORO: rColor = ARGBColor(220,220,220); return true;
-+        case XML_GHOSTWHITE: rColor = ARGBColor(248,248,255); return true;
-+        case XML_GOLD: rColor = ARGBColor(255,215,0); return true;
-+        case XML_GOLDENROD: rColor = ARGBColor(218,165,32); return true;
-+        case XML_GRAY: rColor = ARGBColor(128,128,128); return true;
-+        case XML_GREY: rColor = ARGBColor(128,128,128); return true;
-+        case XML_GREEN: rColor = ARGBColor(0,128,0); return true;
-+        case XML_GREENYELLOW: rColor = ARGBColor(173,255,47); return true;
-+        case XML_HONEYDEW: rColor = ARGBColor(240,255,240); return true;
-+        case XML_HOTPINK: rColor = ARGBColor(255,105,180); return true;
-+        case XML_INDIANRED: rColor = ARGBColor(205,92,92); return true;
-+        case XML_INDIGO: rColor = ARGBColor(75,0,130); return true;
-+        case XML_IVORY: rColor = ARGBColor(255,255,240); return true;
-+        case XML_KHAKI: rColor = ARGBColor(240,230,140); return true;
-+        case XML_LAVENDER: rColor = ARGBColor(230,230,250); return true;
-+        case XML_LAVENDERBLUSH: rColor = ARGBColor(255,240,245); return true;
-+        case XML_LAWNGREEN: rColor = ARGBColor(124,252,0); return true;
-+        case XML_LEMONCHIFFON: rColor = ARGBColor(255,250,205); return true;
-+        case XML_LIGHTBLUE: rColor = ARGBColor(173,216,230); return true;
-+        case XML_LIGHTCORAL: rColor = ARGBColor(240,128,128); return true;
-+        case XML_LIGHTCYAN: rColor = ARGBColor(224,255,255); return true;
-+        case XML_LIGHTGOLDENRODYELLOW: rColor = ARGBColor(250,250,210); return true;
-+        case XML_LIGHTGRAY: rColor = ARGBColor(211,211,211); return true;
-+        case XML_LIGHTGREEN: rColor = ARGBColor(144,238,144); return true;
-+        case XML_LIGHTGREY: rColor = ARGBColor(211,211,211); return true;
-+        case XML_LIGHTPINK: rColor = ARGBColor(255,182,193); return true;
-+        case XML_LIGHTSALMON: rColor = ARGBColor(255,160,122); return true;
-+        case XML_LIGHTSEAGREEN: rColor = ARGBColor(32,178,170); return true;
-+        case XML_LIGHTSKYBLUE: rColor = ARGBColor(135,206,250); return true;
-+        case XML_LIGHTSLATEGRAY: rColor = ARGBColor(119,136,153); return true;
-+        case XML_LIGHTSLATEGREY: rColor = ARGBColor(119,136,153); return true;
-+        case XML_LIGHTSTEELBLUE: rColor = ARGBColor(176,196,222); return true;
-+        case XML_LIGHTYELLOW: rColor = ARGBColor(255,255,224); return true;
-+        case XML_LIME: rColor = ARGBColor(0,255,0); return true;
-+        case XML_LIMEGREEN: rColor = ARGBColor(50,205,50); return true;
-+        case XML_LINEN: rColor = ARGBColor(250,240,230); return true;
-+        case XML_MAGENTA: rColor = ARGBColor(255,0,255); return true;
-+        case XML_MAROON: rColor = ARGBColor(128,0,0); return true;
-+        case XML_MEDIUMAQUAMARINE: rColor = ARGBColor(102,205,170); return true;
-+        case XML_MEDIUMBLUE: rColor = ARGBColor(0,0,205); return true;
-+        case XML_MEDIUMORCHID: rColor = ARGBColor(186,85,211); return true;
-+        case XML_MEDIUMPURPLE: rColor = ARGBColor(147,112,219); return true;
-+        case XML_MEDIUMSEAGREEN: rColor = ARGBColor(60,179,113); return true;
-+        case XML_MEDIUMSLATEBLUE: rColor = ARGBColor(123,104,238); return true;
-+        case XML_MEDIUMSPRINGGREEN: rColor = ARGBColor(0,250,154); return true;
-+        case XML_MEDIUMTURQUOISE: rColor = ARGBColor(72,209,204); return true;
-+        case XML_MEDIUMVIOLETRED: rColor = ARGBColor(199,21,133); return true;
-+        case XML_MIDNIGHTBLUE: rColor = ARGBColor(25,25,112); return true;
-+        case XML_MINTCREAM: rColor = ARGBColor(245,255,250); return true;
-+        case XML_MISTYROSE: rColor = ARGBColor(255,228,225); return true;
-+        case XML_MOCCASIN: rColor = ARGBColor(255,228,181); return true;
-+        case XML_NAVAJOWHITE: rColor = ARGBColor(255,222,173); return true;
-+        case XML_NAVY: rColor = ARGBColor(0,0,128); return true;
-+        case XML_OLDLACE: rColor = ARGBColor(253,245,230); return true;
-+        case XML_OLIVE: rColor = ARGBColor(128,128,0); return true;
-+        case XML_OLIVEDRAB: rColor = ARGBColor(107,142,35); return true;
-+        case XML_ORANGE: rColor = ARGBColor(255,165,0); return true;
-+        case XML_ORANGERED: rColor = ARGBColor(255,69,0); return true;
-+        case XML_ORCHID: rColor = ARGBColor(218,112,214); return true;
-+        case XML_PALEGOLDENROD: rColor = ARGBColor(238,232,170); return true;
-+        case XML_PALEGREEN: rColor = ARGBColor(152,251,152); return true;
-+        case XML_PALETURQUOISE: rColor = ARGBColor(175,238,238); return true;
-+        case XML_PALEVIOLETRED: rColor = ARGBColor(219,112,147); return true;
-+        case XML_PAPAYAWHIP: rColor = ARGBColor(255,239,213); return true;
-+        case XML_PEACHPUFF: rColor = ARGBColor(255,218,185); return true;
-+        case XML_PERU: rColor = ARGBColor(205,133,63); return true;
-+        case XML_PINK: rColor = ARGBColor(255,192,203); return true;
-+        case XML_PLUM: rColor = ARGBColor(221,160,221); return true;

... etc. - the rest is truncated


More information about the ooo-build-commit mailing list