Files
odfstudio/cppcanvas/source/wrapper/implpolypolygon.hxx
T
Regina Henschel c3448b4bea tdf#166647 avoid duplicating slideshow user paint
When a user enables 'mouse as pen' before starting the slideshow, then
his paintings are saved as persistent shapes when he exits slideshow.
These shapes were then converted back to paintings when the user starts
the slideshow again, so that they are visible againg.

But these old paintings were treated as new paintings when the user
exits slideshow and were then saved again as shape to the page although
the page contains these shapes already. Thus with every new start and
exit of the slideshow the shapes were duplicated. Because the duplicates
are at exactly the same place as the originals, you do not notice it
immediately. But you can see the duplicates in the Navigator and notice
it in the file size.

The fix introduces a flag that is set at the paintings from the existing
shapes when the slideshow is started. This flag is then used to skip those
paintings from converting to shapes when slideshow is finished.

Change-Id: I93324d157b1b802d7b8e24858034d2fdc5d71b45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188364
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
2025-08-11 08:52:22 +02:00

75 lines
3.1 KiB
C++

/* -*- 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 <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
#include <com/sun/star/rendering/StrokeAttributes.hpp>
#include <cppcanvas/polypolygon.hxx>
#include <canvasgraphichelper.hxx>
namespace cppcanvas::internal
{
class ImplPolyPolygon : public virtual ::cppcanvas::PolyPolygon, protected CanvasGraphicHelper
{
public:
ImplPolyPolygon( const CanvasSharedPtr& rParentCanvas,
css::uno::Reference<
css::rendering::XPolyPolygon2D > xPolyPoly );
virtual ~ImplPolyPolygon() override;
virtual void setRGBAFillColor( IntSRGBA ) override;
virtual void setRGBALineColor( IntSRGBA ) override;
virtual IntSRGBA getRGBALineColor() const override;
virtual void setStrokeWidth( const double& rStrokeWidth ) override;
virtual double getStrokeWidth() const override;
virtual bool draw() const override;
virtual css::uno::Reference<
css::rendering::XPolyPolygon2D > getUNOPolyPolygon() const override;
virtual void setIsFromPreviousSlideshow(const bool& rFlag) override;
virtual bool getIsFromPreviousSlideshow() const override;
private:
ImplPolyPolygon(const ImplPolyPolygon&) = delete;
ImplPolyPolygon& operator= ( const ImplPolyPolygon& ) = delete;
const css::uno::Reference< css::rendering::XPolyPolygon2D > mxPolyPoly;
css::rendering::StrokeAttributes maStrokeAttributes;
css::uno::Sequence< double > maFillColor;
css::uno::Sequence< double > maStrokeColor;
bool mbFillColorSet;
bool mbStrokeColorSet;
bool mbIsFromPreviousSlideshow;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */