include/vcl/graph.hxx | 24 -------------- vcl/Library_vcl.mk | 1 vcl/inc/graphic/GraphicReader.hxx | 51 ++++++++++++++++++++++++++++++ vcl/source/filter/graphicfilter.cxx | 1 vcl/source/filter/igif/gifread.cxx | 1 vcl/source/filter/ixbm/xbmread.cxx | 1 vcl/source/filter/ixpm/xpmread.cxx | 1 vcl/source/filter/jpeg/JpegReader.hxx | 1 vcl/source/gdi/impgraph.cxx | 35 --------------------- vcl/source/graphic/GraphicReader.cxx | 56 ++++++++++++++++++++++++++++++++++ 10 files changed, 114 insertions(+), 58 deletions(-)
New commits: commit 9103f62a0d2bf61b2135dd017e279cb95a399032 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Mon Feb 10 18:27:23 2020 +0100 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sat Jun 6 19:22:58 2020 +0200 move GraphicReader class out of graph.hxx Change-Id: Id78995bfb8e8308a388ed542690ad85e4d19ce12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88425 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 203abaaaaa33e6631315c735f6d42ad2c088a973) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95615 Tested-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index a30b3909e899..c1fadb49d9cb 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -32,7 +32,6 @@ #include <basegfx/vector/b2dsize.hxx> #include <vcl/GraphicExternalLink.hxx> - enum class GraphicType { NONE, @@ -49,28 +48,7 @@ class GDIMetaFile; class SvStream; class ImpGraphic; class OutputDevice; -class ReaderData; - -class GraphicReader -{ -public: - virtual ~GraphicReader(); - - const OUString& GetUpperFilterName() const { return maUpperName; } - - // TODO: when incompatible changes are possible again - // the preview size hint should be redone - void DisablePreviewMode(); - void SetPreviewSize( const Size& ); - Size GetPreviewSize() const; - -protected: - OUString maUpperName; - - GraphicReader(); -private: - std::unique_ptr<ReaderData> mpReaderData; -}; +class GraphicReader; class VCL_DLLPUBLIC GraphicConversionParameters { diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 1a6fdce0d48b..a88bec146536 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -319,6 +319,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/graphic/GraphicLoader \ vcl/source/graphic/GraphicObject \ vcl/source/graphic/GraphicObject2 \ + vcl/source/graphic/GraphicReader \ vcl/source/graphic/grfattr \ vcl/source/graphic/Manager \ vcl/source/graphic/UnoGraphic \ diff --git a/vcl/inc/graphic/GraphicReader.hxx b/vcl/inc/graphic/GraphicReader.hxx new file mode 100644 index 000000000000..fe60ecf97b29 --- /dev/null +++ b/vcl/inc/graphic/GraphicReader.hxx @@ -0,0 +1,51 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <vcl/dllapi.h> +#include <rtl/ustring.hxx> +#include <tools/gen.hxx> +#include <memory> + +class ReaderData; + +class GraphicReader +{ +public: + virtual ~GraphicReader(); + + const OUString& GetUpperFilterName() const { return maUpperName; } + + // TODO: when incompatible changes are possible again + // the preview size hint should be redone + void DisablePreviewMode(); + void SetPreviewSize(const Size&); + Size GetPreviewSize() const; + +protected: + OUString maUpperName; + + GraphicReader(); + +private: + std::unique_ptr<ReaderData> mpReaderData; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index d1bd6cff4508..102e1de028b0 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -71,6 +71,7 @@ #include "graphicfilter_internal.hxx" #include <graphic/GraphicFormatDetector.hxx> +#include <graphic/GraphicReader.hxx> #define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 6bd2290f777f..a3b301d3aeed 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -23,6 +23,7 @@ #include "gifread.hxx" #include <memory> #include <bitmapwriteaccess.hxx> +#include <graphic/GraphicReader.hxx> #define NO_PENDING( rStm ) ( ( rStm ).GetError() != ERRCODE_IO_PENDING ) diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx index 6d88ec57a640..b74488e68866 100644 --- a/vcl/source/filter/ixbm/xbmread.cxx +++ b/vcl/source/filter/ixbm/xbmread.cxx @@ -23,6 +23,7 @@ #include <rtl/character.hxx> #include <bitmapwriteaccess.hxx> +#include <graphic/GraphicReader.hxx> #include "xbmread.hxx" diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx index 85a9bfd18a8e..214882543174 100644 --- a/vcl/source/filter/ixpm/xpmread.cxx +++ b/vcl/source/filter/ixpm/xpmread.cxx @@ -20,6 +20,7 @@ #include <bitmapwriteaccess.hxx> #include <vcl/graph.hxx> #include <tools/stream.hxx> +#include <graphic/GraphicReader.hxx> #include "rgbtable.hxx" #include "xpmread.hxx" #include <cstring> diff --git a/vcl/source/filter/jpeg/JpegReader.hxx b/vcl/source/filter/jpeg/JpegReader.hxx index 60d0cc85a09b..41fb0fdb5c59 100644 --- a/vcl/source/filter/jpeg/JpegReader.hxx +++ b/vcl/source/filter/jpeg/JpegReader.hxx @@ -23,6 +23,7 @@ #include <vcl/graph.hxx> #include <vcl/bitmap.hxx> #include <bitmapwriteaccess.hxx> +#include <graphic/GraphicReader.hxx> enum class GraphicFilterImportFlags; diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index e523f9acb23e..673efbe26b45 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -69,41 +69,6 @@ struct ImpSwapFile ~ImpSwapFile(); }; -class ReaderData -{ -public: - Size maPreviewSize; -}; - -GraphicReader::GraphicReader() -{ -} - -GraphicReader::~GraphicReader() -{ -} - -void GraphicReader::DisablePreviewMode() -{ - if( mpReaderData ) - mpReaderData->maPreviewSize = Size( 0, 0 ); -} - -void GraphicReader::SetPreviewSize( const Size& rSize ) -{ - if( !mpReaderData ) - mpReaderData.reset( new ReaderData ); - mpReaderData->maPreviewSize = rSize; -} - -Size GraphicReader::GetPreviewSize() const -{ - Size aSize( 0, 0 ); - if( mpReaderData ) - aSize = mpReaderData->maPreviewSize; - return aSize; -} - GraphicID::GraphicID(ImpGraphic const & rGraphic) { rGraphic.ensureAvailable(); diff --git a/vcl/source/graphic/GraphicReader.cxx b/vcl/source/graphic/GraphicReader.cxx new file mode 100644 index 000000000000..060b8e32c2ba --- /dev/null +++ b/vcl/source/graphic/GraphicReader.cxx @@ -0,0 +1,56 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <graphic/GraphicReader.hxx> + +#include <sal/config.h> +#include <sal/log.hxx> + +class ReaderData +{ +public: + Size maPreviewSize; +}; + +GraphicReader::GraphicReader() {} + +GraphicReader::~GraphicReader() {} + +void GraphicReader::DisablePreviewMode() +{ + if (mpReaderData) + mpReaderData->maPreviewSize = Size(0, 0); +} + +void GraphicReader::SetPreviewSize(const Size& rSize) +{ + if (!mpReaderData) + mpReaderData.reset(new ReaderData); + mpReaderData->maPreviewSize = rSize; +} + +Size GraphicReader::GetPreviewSize() const +{ + Size aSize(0, 0); + if (mpReaderData) + aSize = mpReaderData->maPreviewSize; + return aSize; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits