[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - sd/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 2 21:18:12 UTC 2020


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

New commits:
commit 0cd0b02790964a2c37dab352c4cecfc6c3370036
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Jun 2 23:15:03 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Jun 2 23:15:03 2020 +0200

    sd: use getPDFSelection to get the search selection for LOKit
    
    This reduces code duplication.
    
    Change-Id: I0a6a44d696841d1573d23f87353ac055cc92c83a

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 5308de563a08..f8cec9464896 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(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