From fbb5ab3e0ecb862fa5c48ef4640859c4aeb77984 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 23 Oct 2023 10:58:51 +0200 Subject: tdf#156525 Save as > HTML loses drawing object as invalid gif This patch is specifically for the 7-6 branch, other changes meant that master received a simpler fix. This reverts the following patches commit f22c23e71d4ae628e9e90ee98d22d1fc8fca1619 Author: Noel Grandin Date: Wed Aug 2 15:26:06 2023 +0200 tdf#156525 Save as > HTML loses drawing object as invalid gif commit 04f02cfecfae481f256b6c98a1940fc5235a921a Author: Noel Grandin Date: Wed May 10 14:06:49 2023 +0200 AlphaMask::BlendWith wants an AlphaMask parameter commit 8270eb5d5600cc84dbf5f0e339f90c4519ef88bb Author: Noel Grandin Date: Fri May 19 13:35:31 2023 +0200 loplugin:unusedmethods Change-Id: I2146557b6401079061474d5d83082f75d6f1974f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158340 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basegfx/test/B2DPolyPolygonTest.cxx | 1 + basegfx/test/boxclipper.cxx | 9 +++++++++ basegfx/test/boxclipper.hxx | 31 +++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 basegfx/test/boxclipper.hxx (limited to 'basegfx') diff --git a/basegfx/test/B2DPolyPolygonTest.cxx b/basegfx/test/B2DPolyPolygonTest.cxx index 5319e6b46967..f51d396b8578 100644 --- a/basegfx/test/B2DPolyPolygonTest.cxx +++ b/basegfx/test/B2DPolyPolygonTest.cxx @@ -24,6 +24,7 @@ #include #include +#include "boxclipper.hxx" #include namespace basegfx diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx index d58806cb739e..b65f25bae425 100644 --- a/basegfx/test/boxclipper.cxx +++ b/basegfx/test/boxclipper.cxx @@ -31,10 +31,19 @@ #include #include +#include "boxclipper.hxx" + using namespace ::basegfx; namespace basegfx2d { +/// Gets a random ordinal [0,n) +double getRandomOrdinal( const std::size_t n ) +{ + // use this one when displaying polygons in OOo, which still sucks + // great rocks when trying to import non-integer svg:d attributes + return comphelper::rng::uniform_size_distribution(0, n-1); +} static bool compare(const B2DPoint& left, const B2DPoint& right) { diff --git a/basegfx/test/boxclipper.hxx b/basegfx/test/boxclipper.hxx new file mode 100644 index 000000000000..03aad0d2ba74 --- /dev/null +++ b/basegfx/test/boxclipper.hxx @@ -0,0 +1,31 @@ +/* -*- 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 basegfx2d +{ +double getRandomOrdinal(const std::size_t n); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit