/* -*- 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 . */ #ifndef INCLUDED_VCL_VECTORGRAPHICDATA_HXX #define INCLUDED_VCL_VECTORGRAPHICDATA_HXX #include #include #include #include #include #include namespace com { namespace sun { namespace star { namespace graphic { class XPrimitive2D; } } } } struct WmfExternal; typedef css::uno::Sequence VectorGraphicDataArray; // helper to convert any Primitive2DSequence to a good quality BitmapEx, // using default parameters and graphic::XPrimitive2DRenderer BitmapEx VCL_DLLPUBLIC convertPrimitive2DSequenceToBitmapEx( const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > >& rSequence, const basegfx::B2DRange& rTargetRange, const sal_uInt32 nMaximumQuadraticPixels = 500000); enum class VectorGraphicDataType { Svg = 0, Emf = 1, Wmf = 2 }; class VCL_DLLPUBLIC VectorGraphicData { private: // the file and length VectorGraphicDataArray maVectorGraphicDataArray; // The absolute Path if available OUString const maPath; // on demand created content bool mbSequenceCreated; basegfx::B2DRange maRange; std::deque< css::uno::Reference< css::graphic::XPrimitive2D > > maSequence; BitmapEx maReplacement; size_t mNestedBitmapSize; VectorGraphicDataType const meVectorGraphicDataType; // extra: std::unique_ptr mpExternalHeader; // on demand creators void ensureReplacement(); void ensureSequenceAndRange(); VectorGraphicData(const VectorGraphicData&) = delete; VectorGraphicData& operator=(const VectorGraphicData&) = delete; public: VectorGraphicData( const VectorGraphicDataArray& rVectorGraphicDataArray, const OUString& rPath, VectorGraphicDataType eVectorDataType); VectorGraphicData( const OUString& rPath, VectorGraphicDataType eVectorDataType); ~VectorGraphicData(); /// compare op bool operator==(const VectorGraphicData& rCandidate) const; /// special: needed for emf/wmf, maybe replaced by scaling the result later (?) void setWmfExternalHeader(const WmfExternal& aExtHeader); /// data read const VectorGraphicDataArray& getVectorGraphicDataArray() const { return maVectorGraphicDataArray; } sal_uInt32 getVectorGraphicDataArrayLength() const { return maVectorGraphicDataArray.getLength(); } enum class State { UNPARSED, PARSED }; std::pair getSizeBytes(); const OUString& getPath() const { return maPath; } const VectorGraphicDataType& getVectorGraphicDataType() const { return meVectorGraphicDataType; } /// data read and evtl. on demand creation const basegfx::B2DRange& getRange() const; const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > >& getPrimitive2DSequence() const; const BitmapEx& getReplacement() const; BitmapChecksum GetChecksum() const; }; typedef std::shared_ptr< VectorGraphicData > VectorGraphicDataPtr; #endif // INCLUDED_VCL_VECTORGRAPHICDATA_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ option value='distro/collabora/cp-6.0-29'>distro/collabora/cp-6.0-29 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-01-25Change some #define to constexprStephan Bergmann
...plus loplugin:unnecessaryparen fallout in sw/source/uibase/docvw/edtwin.cxx. Each of the files contained at least one #define that would have caused warnings with upcoming loplugin:unsignedcompare. For consistency, I changed all #defines in those files (using a variable of a specific type if the original #define used a cast to that type, otherwise using 'auto'). Change-Id: I66f71b2d83394c9dc6952ae19df774cdd4d0b76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87374 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-19loplugin:unusedfieldsNoel Grandin
Change-Id: I7dd5fc3d53df63fd2ee2caa71586f0f5e13f187e Reviewed-on: https://gerrit.libreoffice.org/81078 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-13weld ConditionalFormattingDialogCaolán McNamara
Change-Id: I87c03555c5555b12a1be997e368a96d9b07d2b63 Reviewed-on: https://gerrit.libreoffice.org/80689 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-12More loplugin:cstylecast: reportdesignStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I690ddd7eeb5fbac979292a382074e9b29c065416
2017-07-21migrate to boost::gettextCaolán McNamara
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2016-11-08loplugin:expandablemethods in reportdesignNoel Grandin
which led to discovering some unused parameters Change-Id: Ie8f67a47aa9ec409637da32ef9bc457952397772 Reviewed-on: https://gerrit.libreoffice.org/30681 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>