I have found a solution for the Bug that
1. increased the size of the bounding box for frame selection
2. increased the size of the bounding box for exporting the selection to a jpeg.

It appeared on rotated, custom shapes.
https://bugs.freedesktop.org/show_bug.cgi?id=35079

This patch keeps the >>hidden<< Shape elements from being included in the 
bounding box.

greetings

        - Lennard Wasserthal

>From fa61f74f1201ecdfe4548494dc056f613ce7ecc9 Mon Sep 17 00:00:00 2001
From: Lennard <wassert...@nefkom.net>
Date: Sat, 11 Aug 2012 20:29:24 +0200
Subject: [PATCH] Fixed Bug [35079]

Drawing: Fixed Custom Shape Frame-Selection Bounding box bug

Change-Id: Ia14feba446358cb195922477e0aa9576e9be2ae6
Signed-off-by: Lennard <wassert...@nefkom.net>
---
 .../source/primitive2d/baseprimitive2d.cxx         |   29 ++++++++++----------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index 964e552..9197592 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -121,25 +121,26 @@ namespace drawinglayer
         basegfx::B2DRange getB2DRangeFromPrimitive2DReference(const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation)
         {
             basegfx::B2DRange aRetval;
-
             if(rCandidate.is())
             {
-                // try to get C++ implementation base
-                const BasePrimitive2D* pCandidate(dynamic_cast< BasePrimitive2D* >(rCandidate.get()));
-
-                if(pCandidate)
-                {
-                    // use it if possible
-                    aRetval.expand(pCandidate->getB2DRange(aViewInformation));
-                }
-                else
+                if ((dynamic_cast< BasePrimitive2D*>(rCandidate.get()))->getPrimitive2DID()!=61) //Ignores auxilliary geometry that may be malpositioned
                 {
-                    // use UNO API call instead
-                    const uno::Sequence< beans::PropertyValue >& rViewParameters(aViewInformation.getViewInformationSequence());
-                    aRetval.expand(basegfx::unotools::b2DRectangleFromRealRectangle2D(rCandidate->getRange(rViewParameters)));
+                    // try to get C++ implementation base
+                    const BasePrimitive2D* pCandidate(dynamic_cast< BasePrimitive2D* >(rCandidate.get()));
+
+                    if(pCandidate)
+                    {
+                        // use it if possible
+                        aRetval.expand(pCandidate->getB2DRange(aViewInformation));
+                    }
+                    else
+                    {
+                        // use UNO API call instead
+                        const uno::Sequence< beans::PropertyValue >& rViewParameters(aViewInformation.getViewInformationSequence());
+                        aRetval.expand(basegfx::unotools::b2DRectangleFromRealRectangle2D(rCandidate->getRange(rViewParameters)));
+                    }
                 }
             }
-
             return aRetval;
         }
 
-- 
1.7.9.5

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to