summaryrefslogtreecommitdiff
path: root/filter/inc
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2018-05-10 17:49:19 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2018-05-18 20:11:35 +0200
commit3ca7be09834a26fbd1c371deabd7a58111092676 (patch)
tree560c1ee287e529b8879bbc2375b5a48f87c65a51 /filter/inc
parentc845135b7b605257b5c94b382d88627282cb05a3 (diff)
Replace SVGFilter using SVGIO
Target of this change is to get rid of the SVGFilter in current LO which is based on the standard-ODF importer using it's functionality by passing in/handing over temporary created XML-Stream-Data. First step is to alternatively import the given SVG file to a newly created Document and to strip the existing Filter-Code. Adding the first prototype of the changed import. It is capable of importing the given SVG to the created Draw/Impress document. It adds the SVG which gets imported by SVGIO as GraphicObject. It adapts sizes and positions of Page and GraphicObject to have a smooth import. Adding stripping of SVGFilter and used ressources. Done as deep as possible, hopefully all places found. Adapted now to create an Impress document. Also added needed adaptions to PageSize(s), including layout and PresObj stuff to make all MasterPages/LayoutPages work correctly. Added reaction on empty SVG. This is needed since the PageSize is adapted to the Graphic. With empty Graphic a Size(0,0) results and this goes wrong. Change-Id: Ia364a5783bee7dadcbe91e700efbabc121cf98f9 Reviewed-on: https://gerrit.libreoffice.org/54096 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'filter/inc')
-rw-r--r--filter/inc/parserfragments.hxx69
-rw-r--r--filter/inc/svgreader.hxx47
2 files changed, 0 insertions, 116 deletions
diff --git a/filter/inc/parserfragments.hxx b/filter/inc/parserfragments.hxx
deleted file mode 100644
index f8b456029892..000000000000
--- a/filter/inc/parserfragments.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-#ifndef INCLUDED_FILTER_INC_PARSERFRAGMENTS_HXX
-#define INCLUDED_FILTER_INC_PARSERFRAGMENTS_HXX
-
-#include <sal/config.h>
-#include <vector>
-#include <utility>
-#include <rtl/ustring.hxx>
-
-namespace basegfx
-{
- class B2DHomMatrix;
- class B2DRange;
-}
-namespace svgi
-{
- struct ARGBColor;
-
- /// Parse given string for one of the SVG color grammars
- bool parseColor( const char* sColor, ARGBColor& rColor );
- bool parseOpacity( const char* sOpacity, ARGBColor& rColor );
-
- /// Parse given string for one of the SVG transformation grammars
- bool parseTransform( const char* sTransform, basegfx::B2DHomMatrix& rTransform );
-
- /// Parse given string for the viewBox attribute
- bool parseViewBox( const char* sViewbox, basegfx::B2DRange& rRect );
-
- /// Parse given string for a list of double values, comma-delimited
- bool parseDashArray( const char* sDashArray, std::vector<double>& rOutputVector );
-
- /** Parse paint uri
-
- @param o_rPaintUri
- Start and end ptr for uri substring (within
- [sPaintUri,sPaintUri+strlen(sPaintUri)]
-
- @param io_rColor
- The optional paint color to use. if o_rPaintUri is empty,
- parser sets io_rColor.second to false for color="None", to
- true and keeps current io_rColor.first entry for
- "currentColor", and to true and sets io_rColor.first to parsed
- color otherwise.
-
- @param sPaintUri
- String to parse. Permitted to contain the optional paint
- stuff, like fallback color.
-
- @return true, if a paint uri was successfully parsed.
- */
- bool parsePaintUri( std::pair<const char*,const char*>& o_rPaintUri,
- std::pair<ARGBColor,bool>& io_rColor,
- const char* sPaintUri );
-
- /// Parse given string for the xlink attribute
- bool parseXlinkHref( const char* xlink, OUString& data );
-
-} // namespace svgi
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/svgreader.hxx b/filter/inc/svgreader.hxx
deleted file mode 100644
index 3149e1770158..000000000000
--- a/filter/inc/svgreader.hxx
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-#ifndef INCLUDED_FILTER_INC_SVGREADER_HXX
-#define INCLUDED_FILTER_INC_SVGREADER_HXX
-
-#include <filter/dllapi.h>
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <xmloff/xmlimp.hxx>
-
-namespace svgi
-{
-
-class SVGReader
-{
-private:
- const css::uno::Reference< css::uno::XComponentContext > m_xContext;
- const css::uno::Reference< css::io::XInputStream > m_xInputStream;
- const css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDocumentHandler;
-
- SVGReader( const css::uno::Reference<css::uno::XComponentContext>& xContext,
- const css::uno::Reference< css::io::XInputStream >& xInputStream,
- const css::uno::Reference< css::xml::sax::XDocumentHandler >& xDocumentHandler,
- SvXMLImport *pFastHandler);
-
-public:
- FILTER_DLLPUBLIC SVGReader( const css::uno::Reference<css::uno::XComponentContext>& xContext,
- const css::uno::Reference< css::io::XInputStream >& xInputStream,
- const css::uno::Reference< css::xml::sax::XDocumentHandler >& xDocumentHandler );
-
- FILTER_DLLPUBLIC bool parseAndConvert();
-};
-
-} // namespace svgi
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */