tdf#39674 Replace Quadrat

Change-Id: Icdc27fa9ab33a6c5a442760a9491e82000883ef1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110177
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/drawinglayer/inc/converters.hxx b/drawinglayer/inc/converters.hxx
index cd1fdba..5e4e8a4 100644
--- a/drawinglayer/inc/converters.hxx
+++ b/drawinglayer/inc/converters.hxx
@@ -29,7 +29,7 @@ namespace drawinglayer
        const geometry::ViewInformation2D& rViewInformation2D,
        sal_uInt32 nDiscreteWidth,
        sal_uInt32 nDiscreteHeight,
        sal_uInt32 nMaxQuadratPixels);
        sal_uInt32 nMaxSquarePixels);

} // end of namespace drawinglayer

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index dba886f..7cf4fc4 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2203,14 +2203,14 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
        const tools::Rectangle aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic));
        Size aSizePixel(aRectPixel.GetSize());
        ScopedVclPtrInstance<VirtualDevice> aBufferDevice;
        const sal_uInt32 nMaxQuadratPixels(500000);
        const sal_uInt32 nMaxSquarePixels(500000);
        const sal_uInt32 nViewVisibleArea(aSizePixel.getWidth() * aSizePixel.getHeight());
        double fReduceFactor(1.0);

        if (nViewVisibleArea > nMaxQuadratPixels)
        if (nViewVisibleArea > nMaxSquarePixels)
        {
            // reduce render size
            fReduceFactor = sqrt(double(nMaxQuadratPixels) / static_cast<double>(nViewVisibleArea));
            fReduceFactor = sqrt(double(nMaxSquarePixels) / static_cast<double>(nViewVisibleArea));
            aSizePixel = Size(
                basegfx::fround(static_cast<double>(aSizePixel.getWidth()) * fReduceFactor),
                basegfx::fround(static_cast<double>(aSizePixel.getHeight()) * fReduceFactor));
@@ -2314,7 +2314,7 @@ VclMetafileProcessor2D::CreateBufferDevice(const basegfx::B2DRange& rCandidateRa
                                           geometry::ViewInformation2D& rViewInfo,
                                           tools::Rectangle& rRectLogic, Size& rSizePixel)
{
    constexpr double fMaxQuadratPixels = 500000;
    constexpr double fMaxSquarePixels = 500000;
    basegfx::B2DRange aViewRange(rCandidateRange);
    aViewRange.transform(maCurrentTransformation);
    rRectLogic = tools::Rectangle(static_cast<tools::Long>(std::floor(aViewRange.getMinX())),
@@ -2326,10 +2326,10 @@ VclMetafileProcessor2D::CreateBufferDevice(const basegfx::B2DRange& rCandidateRa
    const double fViewVisibleArea(rSizePixel.getWidth() * rSizePixel.getHeight());
    double fReduceFactor(1.0);

    if (fViewVisibleArea > fMaxQuadratPixels)
    if (fViewVisibleArea > fMaxSquarePixels)
    {
        // reduce render size
        fReduceFactor = sqrt(fMaxQuadratPixels / fViewVisibleArea);
        fReduceFactor = sqrt(fMaxSquarePixels / fViewVisibleArea);
        rSizePixel = Size(basegfx::fround(rSizePixel.getWidth() * fReduceFactor),
                          basegfx::fround(rSizePixel.getHeight() * fReduceFactor));
    }
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index ff9b79a..e1a59d0 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -40,7 +40,7 @@ namespace drawinglayer
        const geometry::ViewInformation2D& rViewInformation2D,
        sal_uInt32 nDiscreteWidth,
        sal_uInt32 nDiscreteHeight,
        sal_uInt32 nMaxQuadratPixels)
        sal_uInt32 nMaxSquarePixels)
    {
        BitmapEx aRetval;

@@ -51,10 +51,10 @@ namespace drawinglayer
            const sal_uInt32 nViewVisibleArea(nDiscreteWidth * nDiscreteHeight);
            drawinglayer::primitive2d::Primitive2DContainer aSequence(rSeq);

            if(nViewVisibleArea > nMaxQuadratPixels)
            if(nViewVisibleArea > nMaxSquarePixels)
            {
                // reduce render size
                double fReduceFactor = sqrt(static_cast<double>(nMaxQuadratPixels) / static_cast<double>(nViewVisibleArea));
                double fReduceFactor = sqrt(static_cast<double>(nMaxSquarePixels) / static_cast<double>(nViewVisibleArea));
                nDiscreteWidth = basegfx::fround(static_cast<double>(nDiscreteWidth) * fReduceFactor);
                nDiscreteHeight = basegfx::fround(static_cast<double>(nDiscreteHeight) * fReduceFactor);