/* -*- 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 #include namespace svgio::svgreader { enum class NumberType { xcoordinate, ycoordinate, length }; class InfoProvider { public: virtual ~InfoProvider() {} virtual basegfx::B2DRange getCurrentViewPort() const = 0; /// return font size of node inherited from parents virtual double getCurrentFontSizeInherited() const = 0; /// return xheight of node inherited from parents virtual double getCurrentXHeightInherited() const = 0; }; enum class SvgUnit { em = 0, // relative to current font size ex, // relative to current x-height px, // 'user unit' pt, // points, 1/72 in pc, // 1/6 in cm, mm, in, percent, // relative to range none // for stroke-miterlimit, which has no unit }; class SvgNumber { private: double mfNumber; SvgUnit meUnit; bool mbSet : 1; public: SvgNumber() : mfNumber(0.0), meUnit(SvgUnit::px), mbSet(false) { } SvgNumber(double fNum, SvgUnit aSvgUnit = SvgUnit::px, bool bSet = true) : mfNumber(fNum), meUnit(aSvgUnit), mbSet(bSet) { } double getNumber() const { return mfNumber; } SvgUnit getUnit() const { return meUnit; } bool isSet() const { return mbSet; } bool isPositive() const { return basegfx::fTools::moreOrEqual(mfNumber, 0.0); } // Only usable in cases, when the unit is not SvgUnit::percent, otherwise use method solve double solveNonPercentage(const InfoProvider& rInfoProvider) const; double solve(const InfoProvider& rInfoProvider, NumberType aNumberType = NumberType::length) const; }; typedef std::vector SvgNumberVector; } // end of namespace svgio::svgreader /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /collabora/co-24.04.3'>distro/collabora/co-24.04.3 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/sdext
AgeCommit message (Expand)Author
2023-04-02Avoid conversions between OUString and OString in VCLMike Kaganski
2023-03-30loplugin:stringadd in sd/sdextNoel Grandin
2023-03-16XmlTestTools: factor out common codeXisco Fauli
2023-03-06BaseMutex->std::mutex in PDFIRawAdaptorNoel Grandin
2023-03-06BaseMutex->std::mutex in PDFDetectorNoel Grandin
2023-02-16Drop 'using namespace ::std' in dirs s*Gabor Kelemen
2023-01-26cid#1520592 Logically dead codeCaolán McNamara
2023-01-24pdfimport: refactor pdf and hybrid format detection codeTomaž Vajngerl
2023-01-21move presenter console from sdext/ to sd/Noel Grandin
2023-01-05Revert all the recent loplugin:unocast changesStephan Bergmann
2022-12-23loplugin:unocast (sdext::presenter::CachablePresenterView)Stephan Bergmann
2022-12-17cid#1517773 silence Wrapper object use after freeCaolán McNamara
2022-12-16loplugin:unocast (SvXMLImport)Stephan Bergmann
2022-12-16Use unotoosl::WeakReference to avoid a dynamic_castStephan Bergmann
2022-12-14loplugin:unocast (sdext::presenter::PresenterNotesView)Stephan Bergmann
2022-12-08Removed useless semicolonAndrea Gelmini
2022-12-07loplugin:unusedmethodsNoel Grandin
2022-12-07loplugin:unusedfieldsNoel Grandin
2022-12-07stray fprintfCaolán McNamara
2022-12-07loplugin:singlevalfieldsNoel Grandin
2022-12-07sdext: move the include of XComponentContext.hpp to where it is usedKevin Suo
2022-12-06weld InformationDialog info dialogCaolán McNamara
2022-12-06InformationDialog is a misleading nameCaolán McNamara
2022-12-06add Assistant::set_page_side_imageCaolán McNamara
2022-12-06Resolves: tdf#121297 weld Presentation MinimizerCaolán McNamara
2022-12-06"using namespace com::sun::star" -> css in header fileKevin Suo
2022-12-04tdf#152083: sdext Pre-reverse the text for RTL in Writer pdfimport as wellKevin Suo
2022-12-04tdf#147246 sdext: font name returned by font descriptor may be...Kevin Suo
2022-12-04tdf#152083 related: make the isComplex check block as a separate functionKevin Suo
2022-12-03tdf#147246 sdext.pdfimport: "font-family-asia" -> "font-family-asian"Kevin Suo
2022-12-01tdf#92717 Presenter screen on one monitorDaniel Lohmann
2022-11-30tdf#104597 related: restore the mirroring of Bidi_Mirrored charactersKevin Suo
2022-11-29New loplugin:crosscastStephan Bergmann
2022-11-27cid#982469 Unchecked dynamic_castCaolán McNamara
2022-11-25CppunitTest_sdext_pdfimport: move it to 'qa' folderXisco Fauli
2022-11-25sdext: remove unused documentXisco Fauli
2022-11-25Resolves tdf#152083: Ligatures are incorrectly reversed in Draw pdf importKevin Suo
2022-11-20sdext.pdfimport: Use string() in xpath for testTdf104597_textrunKevin Suo
2022-11-18Related tdf#104597, tdf#151546: Introduce comphelper::string::reverseCodePointsStephan Bergmann
2022-11-17tdf#33495: Allow presenter console in windowed modeDaniel Lohmann
2022-11-08sdext.pdfimport - Wirter: add handling for continuous space charactersKevin Suo