/* -*- 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/. *
*/
// for compatibility, still set StartColor/EndColor // NOTE: All code after adapting to multi color gradients works // using the ColorSteps, so in principle Start/EndColor might // be either // (a) ignored consequently everywhere or // (b) be set/added consequently everywhere // since this is - in principle - redundant data. // Be aware that e.g. cases like DrawingML::EqualGradients // and others would have to be identified and adapted (!) // Since awt::Gradient2 is UNO API data there might // be cases where just awt::Gradient is transferred, so (b) // is far better backwards compatible and thus more safe, so // all changes will make use of additionally using/setting // these additionally, but will only make use of the given // ColorSteps if these are not empty, assuming that these // already contain Start/EndColor. // In principle that redundancy and that it is conflict-free // could even be checked and asserted, but consequently using // (b) methodically should be safe. const basegfx::BColorStops& rColorStops = rGradient.GetColorStops();
aGradient2.StartColor = static_cast<sal_Int32>(::Color(rColorStops.front().getStopColor()));
aGradient2.EndColor = static_cast<sal_Int32>(::Color(rColorStops.back().getStopColor()));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.