/* -*- 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_CHART2_SOURCE_INC_RELATIVEPOSITIONHELPER_HXX #define INCLUDED_CHART2_SOURCE_INC_RELATIVEPOSITIONHELPER_HXX #include #include #include #include #include #include "charttoolsdllapi.hxx" namespace chart { /** */ class OOO_DLLPUBLIC_CHARTTOOLS RelativePositionHelper { public: /** returns the upper left corner of an object that has size aObjectSize and where the point indicated by aAnchor has coordinates indicated by aPoint ( e.g. if aAnchor equals BOTTOM_LEFT, aPoint describes the coordinates of the bottom left corner of an object with size aObjectSize ) */ static css::awt::Point getUpperLeftCornerOfAnchoredObject( css::awt::Point aPoint, css::awt::Size aObjectSize, css::drawing::Alignment aAnchor ); /** returns the center of an object that has size aObjectSize and where the point indicated by aAnchor has coordinates indicated by aPoint ( e.g. if aAnchor equals BOTTOM_LEFT, aPoint describes the coordinates of the bottom left corner of an object with size aObjectSize ) */ static css::awt::Point getCenterOfAnchoredObject( css::awt::Point aPoint, css::awt::Size aUnrotatedObjectSize, css::drawing::Alignment aAnchor, double fAnglePi ); /** Returns a relative position that is the same point after the anchor has been changed to the given one. The passed object size is taken into account for shifting the position. */ SAL_DLLPRIVATE static css::chart2::RelativePosition getReanchoredPosition( const css::chart2::RelativePosition & rPosition, const css::chart2::RelativeSize & rObjectSize, css::drawing::Alignment aNewAnchor ); /** grows a relative size about the given amount and shifts the given position such that the resize is relative to the former rectangle's center. The resize is only done, if after transformation, the position and size are within the bounds [0,1]. @return , if changes were applied.

That means, if the position's alignment is center, the position will not change at all.

*/ static bool centerGrow( css::chart2::RelativePosition & rInOutPosition, css::chart2::RelativeSize & rInOutSize, double fAmountX, double fAmountY ); /** shifts a relative position about the given amount The shift is only done, if after transformation, the object represented by the position rInOutPosition and its size rObjectSize the position and size are within the bounds [0,1]. @return , if changes were applied. */ static bool moveObject( css::chart2::RelativePosition & rInOutPosition, const css::chart2::RelativeSize & rObjectSize, double fAmountX, double fAmountY ); }; } //namespace chart #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ tro/collabora/cp-4.2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-04-18clang-tidy performance-unnecessary-copy-initializationNoel Grandin
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-26com::sun::star->css in xmloff/Noel Grandin
Change-Id: Iee6e21e093fb1383f19a0716dbc1c341f446b8c2 Reviewed-on: https://gerrit.libreoffice.org/20192 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I8690de2cb68dcfedc9f2239ce66cea06fd94bc16
2015-11-06loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)Stephan Bergmann
Change-Id: Ibb9372bc45a0bc0b9083ad0e405440bbbe5ef678
2015-09-29Fix typosAndrea Gelmini
Change-Id: I2cdfc4e9d8ba1acb7c2548f9394d320c6504207e Reviewed-on: https://gerrit.libreoffice.org/18997 Reviewed-by: Joren De Cuyper <jorendc@libreoffice.org> Tested-by: Joren De Cuyper <jorendc@libreoffice.org>
2015-06-25remove our custom RTTI from xmloff moduleNoel Grandin
not being used, anyhow Change-Id: I0eb0d6377efe324d9a442a70fc2046a58ed2f3c4
2015-05-24cppcheck: noExplicitConstructorCaolán McNamara
Change-Id: I8c9e970d5c5931de1a7526cbff3de626ef30bd74
2015-01-02boost::unordered_map->std::unordered_mapCaolán McNamara
you can get debug stl this way Change-Id: Ia70a3e7c7c452390e8bee34975d296c9318e4a19
2014-11-17sal: clean up public headers with include-what-you-useMichael Stahl
Sadly cannot forward declare "struct {...} TimeValue;". rtl/(u)?string.hxx still include sal/log.hxx but removing osl/diagnose.h was painful enough for now... Change-Id: Id41e17f3870c4f24c53ce7b11f2c40a3d14d1f05
2014-04-15xmloff: sal_Bool->boolNoel Grandin
Change-Id: I873c80baec8e70e3e8f642644563b92137571a30
2014-04-09Clean up function declarations and some unused functionsStephan Bergmann
Change-Id: I2ca50a15209503020047975ac848df98b74089af