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

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


 sd/source/ui/view/Outliner.cxx |   24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

New commits:
commit fcc13ba6a0121cfdf70d1f39318a024777247559
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Jun 2 23:15:03 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Jun 3 07:43:02 2020 +0200

    sd: use getPDFSelection to get the search selection for LOKit
    
    This reduces code duplication.
    
    Change-Id: I0a6a44d696841d1573d23f87353ac055cc92c83a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95386
    Tested-by: Jenkins
    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 da7d0145f8b3..cb5219838ec6 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -731,26 +731,12 @@ void SdOutliner::sendLOKSearchResultCallback(std::shared_ptr<sd::ViewShell> & pV
     std::vector<::tools::Rectangle> aLogicRects;
     if (mpImpl->mbCurrentIsVectorGraphic)
     {
-        basegfx::B2DSize aPdfPageSize = mpImpl->mpVectorGraphicSearch->pageSize();
+        basegfx::B2DRectangle aSelectionHMM = getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj);
 
-        tools::Rectangle aObjectRectTwip = OutputDevice::LogicToLogic(mpObj->GetLogicRect(), MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
-        basegfx::B2DRectangle aObjectB2DRectTwip(vcl::unotools::b2DRectangleFromRectangle(aObjectRectTwip));
-
-        // Setup coordinate conversion matrix to convert the inner PDF
-        // coordinates to the page relative coordinates
-        basegfx::B2DHomMatrix aB2DMatrix;
-
-        aB2DMatrix.scale(aObjectB2DRectTwip.getWidth() / aPdfPageSize.getX(),
-                         aObjectB2DRectTwip.getHeight() / aPdfPageSize.getY());
-
-        aB2DMatrix.translate(aObjectB2DRectTwip.getMinX(), aObjectB2DRectTwip.getMinY());
-
-        for (auto const & rRectangle : mpImpl->mpVectorGraphicSearch->getTextRectangles())
-        {
-            basegfx::B2DRectangle aRectangle(rRectangle);
-            aRectangle *= aB2DMatrix;
-            aLogicRects.emplace_back(Point(aRectangle.getMinX(), aRectangle.getMinY()), Size(aRectangle.getWidth(), aRectangle.getHeight()));
-        }
+        tools::Rectangle aSelection(Point(aSelectionHMM.getMinX(), aSelectionHMM.getMinY()),
+                                    Size(aSelectionHMM.getWidth(), aSelectionHMM.getHeight()));
+        aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+        aLogicRects.push_back(aSelection);
     }
     else
     {


More information about the Libreoffice-commits mailing list