[Libreoffice-commits] core.git: sd/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 3 05:42:09 UTC 2020


 sd/source/ui/view/Outliner.cxx |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

New commits:
commit beb0fc465163e5edc0b7f978ad46c6ad0cd9e2de
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 29 08:36:34 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Jun 3 07:41:29 2020 +0200

    sd: use b2DRectangleFromRectangle from canvastools.hxx
    
    Change-Id: I8604b80f887a2c3a1143b8a9bc70f429576512f1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95350
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 9e81a826bfb9..f1ff9742ec1c 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -26,6 +26,7 @@
 #include <svl/srchitem.hxx>
 #include <svl/intitem.hxx>
 #include <editeng/editstat.hxx>
+#include <vcl/canvastools.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/weld.hxx>
 #include <sfx2/dispatch.hxx>
@@ -683,15 +684,6 @@ bool SdOutliner::SearchAndReplaceAll()
 
 namespace
 {
-basegfx::B2DRange b2DRectangleFromRectangle( const ::tools::Rectangle& rRect )
-{
-    if (rRect.IsWidthEmpty() && rRect.IsHeightEmpty())
-        return basegfx::B2DRange(basegfx::B2DTuple(rRect.Left(), rRect.Top()));
-    return basegfx::B2DRectangle(rRect.Left(),
-                                 rRect.Top(),
-                                 rRect.IsWidthEmpty() ? rRect.Left() : rRect.Right(),
-                                 rRect.IsHeightEmpty() ? rRect.Top() : rRect.Bottom());
-}
 
 basegfx::B2DRectangle getPDFSelection(std::unique_ptr<VectorGraphicSearch> & rVectorGraphicSearch,
                                        SdrObject* pObject)
@@ -704,7 +696,7 @@ basegfx::B2DRectangle getPDFSelection(std::unique_ptr<VectorGraphicSearch> & rVe
 
     basegfx::B2DSize aPdfPageSizeHMM = rVectorGraphicSearch->pageSize();
 
-    basegfx::B2DRectangle aObjectB2DRectHMM(b2DRectangleFromRectangle(pObject->GetLogicRect()));
+    basegfx::B2DRectangle aObjectB2DRectHMM(vcl::unotools::b2DRectangleFromRectangle(pObject->GetLogicRect()));
 
     // Setup coordinate conversion matrix to convert the inner PDF
     // coordinates to the page relative coordinates
@@ -742,7 +734,7 @@ void SdOutliner::sendLOKSearchResultCallback(std::shared_ptr<sd::ViewShell> & pV
         basegfx::B2DSize aPdfPageSize = mpImpl->mpVectorGraphicSearch->pageSize();
 
         tools::Rectangle aObjectRectTwip = OutputDevice::LogicToLogic(mpObj->GetLogicRect(), MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
-        basegfx::B2DRectangle aObjectB2DRectTwip(b2DRectangleFromRectangle(aObjectRectTwip));
+        basegfx::B2DRectangle aObjectB2DRectTwip(vcl::unotools::b2DRectangleFromRectangle(aObjectRectTwip));
 
         // Setup coordinate conversion matrix to convert the inner PDF
         // coordinates to the page relative coordinates


More information about the Libreoffice-commits mailing list