summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/svgread.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-11-06 12:12:33 +0000
committerMichael Meeks <michael.meeks@suse.com>2012-11-12 11:46:43 +0000
commit2b4fd2c89a38ccac13c72f2e94501a8702e7da4b (patch)
tree8d1da4778021a1e753ca4d01d7cc8ff2e21b0d5d /vcl/source/gdi/svgread.cxx
parent08894f7c7def58431be699c3e59ef7bbc0c725a4 (diff)
re-base on ALv2 code. Includes:
Patches contributed by Pedro Giffuni: Avoid some uses of non portable #!/bin/bash in shell scripts. http://svn.apache.org/viewvc?view=revision&revision=1235297 Reduce the dependencies on non standard GNU copy. http://svn.apache.org/viewvc?view=revision&revision=1238684 Correct /usr/bin/env path. http://svn.apache.org/viewvc?view=revision&revision=1235619 Complex Toolbar Controls Extension from the SDK Patches contributed by Ariel Constenla-Haile http://svn.apache.org/viewvc?view=revision&revision=1190390 i118615 - make epm more verbose http://svn.apache.org/viewvc?view=revision&revision=1204288 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 Patches contributed by Juergen Schmidt: jsc341: i117327: take care if no dependency node in current description exists, create one http://svn.apache.org/viewvc?view=revision&revision=1172101 jsc341: i117327: add extra extension dependency check http://svn.apache.org/viewvc?view=revision&revision=1172098 make initial branding changes http://svn.apache.org/viewvc?view=revision&revision=1231878 Patches contributed by Ingo Schmidt native373: #i117733# no linux jre installation on 64 bit systems http://svn.apache.org/viewvc?view=revision&revision=1167536 native373: ##164464# improve debian support http://svn.apache.org/viewvc?view=revision&revision=1167537 Patch contribtued by Armin Le-Grand: Changed various aspects concerning usages of old vendor names http://svn.apache.org/viewvc?view=revision&revision=1293313 fix for neon webdav, remove coinmp bits, improve odk script, cleanup & remove OS/2 conditionals, system ucpp fixes, remove OS/2 conditionals, restore our license filenames.
Diffstat (limited to 'vcl/source/gdi/svgread.cxx')
-rw-r--r--vcl/source/gdi/svgread.cxx143
1 files changed, 0 insertions, 143 deletions
diff --git a/vcl/source/gdi/svgread.cxx b/vcl/source/gdi/svgread.cxx
deleted file mode 100644
index a74cfd23d6fb..000000000000
--- a/vcl/source/gdi/svgread.cxx
+++ /dev/null
@@ -1,143 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/stream.hxx>
-#include <vcl/svgread.hxx>
-#include <vcl/gdimtf.hxx>
-#include <vcl/metaact.hxx>
-#include <vcl/rendergraphicrasterizer.hxx>
-
-// -----------
-// - Defines -
-// -----------
-
-namespace vcl
-{
- // -----------------
- // - SVGReaderImpl -
- // -----------------
-
- class SVGReaderImpl
- {
- public:
-
- SVGReaderImpl( SvStream& rStm );
- ~SVGReaderImpl();
-
- GDIMetaFile& ImplRead( GDIMetaFile& rSVGMtf );
- vcl::RenderGraphic ImplGetRenderGraphic();
-
- private:
-
- SvStream& mrStm;
- };
-
- // ------------------------------------------------------------------------------
-
- SVGReaderImpl::SVGReaderImpl( SvStream& rStm ) :
- mrStm( rStm )
- {
- }
-
- // ------------------------------------------------------------------------
-
- SVGReaderImpl::~SVGReaderImpl()
- {
- }
-
- // ------------------------------------------------------------------------
-
- GDIMetaFile& SVGReaderImpl::ImplRead( GDIMetaFile& rSVGMtf )
- {
- vcl::RenderGraphic aSVGGraphic = ImplGetRenderGraphic();
-
- if( !mrStm.GetError() )
- {
- const vcl::RenderGraphicRasterizer aRasterizer( aSVGGraphic );
- const Size aDefaultSizePixel( aRasterizer.GetDefaultSizePixel() );
-
- if( aDefaultSizePixel.Width() && aDefaultSizePixel.Height() )
- {
- const Point aPos;
- const Size aPrefSize( aRasterizer.GetPrefSize() );
-
- rSVGMtf.SetPrefMapMode( aRasterizer.GetPrefMapMode() );
- rSVGMtf.SetPrefSize( aPrefSize );
- rSVGMtf.AddAction( new MetaRenderGraphicAction( aPos, aPrefSize, aSVGGraphic ) );
- rSVGMtf.WindStart();
- }
- }
-
- return( rSVGMtf );
- }
-
- vcl::RenderGraphic SVGReaderImpl::ImplGetRenderGraphic()
- {
- const sal_uInt32 nStmPos = mrStm.Tell();
- const sal_uInt32 nStmLen = mrStm.Seek( STREAM_SEEK_TO_END ) - nStmPos;
-
- vcl::RenderGraphic aSVGGraphic( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/svg+xml")), nStmLen );
- mrStm.Seek( nStmPos );
- mrStm.Read( aSVGGraphic.GetGraphicData().get(), nStmLen );
-
- return( aSVGGraphic );
- }
-
-
- // -------------
- // - SVGReader -
- // -------------
-
- SVGReader::SVGReader( SvStream& rIStm ) :
- mapImpl( new ::vcl::SVGReaderImpl( rIStm ) )
- {
- }
-
- // ------------------------------------------------------------------------
-
- SVGReader::~SVGReader()
- {
- }
-
- // ------------------------------------------------------------------------
-
- GDIMetaFile& SVGReader::Read( GDIMetaFile& rSVGMtf )
- {
- rSVGMtf = GDIMetaFile();
-
- return( mapImpl.get() ? mapImpl->ImplRead( rSVGMtf ) : rSVGMtf );
- }
-
- vcl::RenderGraphic SVGReader::GetRenderGraphic()
- {
- return( mapImpl->ImplGetRenderGraphic() );
- }
-
-} // namespace vcl
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */