[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - include/svx sd/inc sd/source svx/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 8 14:19:25 UTC 2020


 include/svx/svdmrkv.hxx        |    2 
 sd/inc/Outliner.hxx            |    6 
 sd/source/ui/view/Outliner.cxx |   11 
 svx/source/svdraw/svdmrkv.cxx  |  499 ++++++++++++++++++++---------------------
 4 files changed, 260 insertions(+), 258 deletions(-)

New commits:
commit b61ed3d735eedc24f81d18783673a8cb361897bf
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat May 16 19:49:40 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Jun 8 16:19:07 2020 +0200

    svx: move LOKit specifics out of SetMarkHandles into own method
    
    The SdrMarkView::SetMarkHandles method is too big because it
    also hosts the LOKit sending of callbacks, so move that into
    it's own method. Would be a good idea to split even more and
    move into own class in a future commit.
    
    Change-Id: I7e6389bfa98f22c44863c6eddc840692a7f22605
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94728
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit 3f14671b5f0cf11dc2e0e5ae11700afcef63ce81)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95799
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index cb5660018260..b62749f41335 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -141,6 +141,8 @@ private:
     SVX_DLLPRIVATE void ImpSetPointsRects() const;
     void UndirtyMrkPnt() const;
 
+    void SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxViewShell* pOtherShell);
+
 protected:
     virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
     virtual void ModelHasChanged() override; // Is called by the PaintView
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 4b6780120045..937464b85571 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -674,6 +674,258 @@ OUString lcl_getDragParameterString( const OUString& rCID )
 }
 } // anonymous namespace
 
+void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxViewShell* pOtherShell)
+{
+    SfxViewShell* pViewShell = GetSfxViewShell();
+
+    tools::Rectangle aSelection(rRect);
+    bool bIsChart = false;
+
+    if (!rRect.IsEmpty())
+    {
+        sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
+        if (nTotalPaintWindows == 1)
+        {
+            const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice());
+            if (pWin && pWin->IsChart())
+            {
+                bIsChart = true;
+                const vcl::Window* pViewShellWindow = GetSfxViewShell()->GetEditWindowForActiveOLEObj();
+                if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin))
+                {
+                    Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow);
+                    Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
+                    aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY());
+                }
+            }
+        }
+    }
+
+    if (!aSelection.IsEmpty())
+    {
+        // In case the map mode is in 100th MM, then need to convert the coordinates over to twips for LOK.
+        if (mpMarkedPV)
+        {
+            if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
+            {
+                if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+                    aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+            }
+        }
+
+        // hide the text selection too
+        pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, "");
+    }
+
+    {
+        OString sSelectionText;
+        boost::property_tree::ptree aTableJsonTree;
+        bool bTableSelection = false;
+
+        if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_TABLE)
+        {
+            auto& rTableObject = dynamic_cast<sdr::table::SdrTableObj&>(*mpMarkedObj);
+            bTableSelection = rTableObject.createTableEdgesJson(aTableJsonTree);
+        }
+        if (GetMarkedObjectCount())
+        {
+            SdrMark* pM = GetSdrMarkByIndex(0);
+            SdrObject* pO = pM->GetMarkedSdrObj();
+            long nRotAngle = pO->GetRotateAngle();
+            // true if we are dealing with a RotGrfFlyFrame
+            // (SwVirtFlyDrawObj with a SwGrfNode)
+            bool bWriterGraphic = pO->HasLimitedRotation();
+
+            if (bWriterGraphic)
+            {
+                nRotAngle *= 10;
+            }
+
+            OStringBuffer aExtraInfo;
+
+            aExtraInfo.append("{\"id\":\"");
+            aExtraInfo.append(OString::number(reinterpret_cast<sal_IntPtr>(pO)));
+            aExtraInfo.append("\",\"type\":");
+            aExtraInfo.append(OString::number(pO->GetObjIdentifier()));
+
+            if (bWriterGraphic)
+            {
+                aExtraInfo.append(", \"isWriterGraphic\": true");
+            }
+            else if (bIsChart)
+            {
+                LokChartHelper aChartHelper(pViewShell);
+                css::uno::Reference<css::frame::XController>& xChartController = aChartHelper.GetXController();
+                css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier( xChartController, uno::UNO_QUERY);
+                if (xSelectionSupplier.is())
+                {
+                    uno::Any aSel = xSelectionSupplier->getSelection();
+                    OUString aValue;
+                    if (aSel >>= aValue)
+                    {
+                        OString aObjectCID(aValue.getStr(), aValue.getLength(), osl_getThreadTextEncoding());
+                        const std::vector<OString> aProps{"Draggable", "Resizable", "Rotatable"};
+                        for (const auto& rProp: aProps)
+                        {
+                            sal_Int32 nPos = aObjectCID.indexOf(rProp);
+                            if (nPos == -1) continue;
+                            nPos += rProp.getLength() + 1; // '='
+                            if (aExtraInfo.getLength() > 2) // != "{ "
+                                aExtraInfo.append(", ");
+                            aExtraInfo.append("\"is");
+                            aExtraInfo.append(rProp);
+                            aExtraInfo.append("\": ");
+                            aExtraInfo.append(OString::boolean(aObjectCID[nPos] == '1'));
+                        }
+
+                        OUString sDragMethod = lcl_getDragMethodServiceName(aValue);
+                        if (sDragMethod == "PieSegmentDragging")
+                        {
+                            // old initial offset inside the CID returned by xSelectionSupplier->getSelection()
+                            // after a pie segment dragging; using SdrObject::GetName for getting a CID with the updated offset
+                            aValue = pO->GetName();
+                            OUString sDragParameters = lcl_getDragParameterString(aValue);
+                            if (!sDragParameters.isEmpty())
+                            {
+                                aExtraInfo.append(", \"dragInfo\": { ");
+                                aExtraInfo.append("\"dragMethod\": \"");
+                                aExtraInfo.append(sDragMethod.toUtf8());
+                                aExtraInfo.append("\"");
+
+                                OUString sParam;
+                                sal_Int32 nStartIndex = 0;
+                                std::array<int, 5> aDragParameters;
+                                for (auto& rParam : aDragParameters)
+                                {
+                                    sParam = sDragParameters.getToken(0, ',', nStartIndex);
+                                    if (sParam.isEmpty())
+                                        break;
+                                    rParam = sParam.toInt32();
+                                }
+
+                                // initial offset in %
+                                if (aDragParameters[0] < 0)
+                                    aDragParameters[0] = 0;
+                                else if (aDragParameters[0] > 100)
+                                    aDragParameters[0] = 100;
+
+                                aExtraInfo.append(", \"initialOffset\": ");
+                                aExtraInfo.append(OString::number(aDragParameters[0]));
+
+                                // drag direction constraint
+                                Point aMinPos(aDragParameters[1], aDragParameters[2]);
+                                Point aMaxPos(aDragParameters[3], aDragParameters[4]);
+                                Point aDragDirection = aMaxPos - aMinPos;
+                                aDragDirection = OutputDevice::LogicToLogic(aDragDirection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+
+                                aExtraInfo.append(", \"dragDirection\": [");
+                                aExtraInfo.append(aDragDirection.toString());
+                                aExtraInfo.append("]");
+
+                                // polygon approximating the pie segment or donut segment
+                                if (pO->GetObjIdentifier() == OBJ_PATHFILL)
+                                {
+                                    const basegfx::B2DPolyPolygon aPolyPolygon(pO->TakeXorPoly());
+                                    if (aPolyPolygon.count() == 1)
+                                    {
+                                        const basegfx::B2DPolygon aPolygon = aPolyPolygon.getB2DPolygon(0);
+                                        if (sal_uInt32 nPolySize = aPolygon.count())
+                                        {
+                                            const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice());
+                                            const vcl::Window* pViewShellWindow = pViewShell->GetEditWindowForActiveOLEObj();
+                                            if (pWin && pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin))
+                                            {
+                                                // in the following code escaping sequences used inside raw literal strings
+                                                // are for making them understandable by the JSON parser
+
+                                                Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow);
+                                                Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
+                                                OString sPolygonElem("<polygon points=\\\"");
+                                                for (sal_uInt32 nIndex = 0; nIndex < nPolySize; ++nIndex)
+                                                {
+                                                    const basegfx::B2DPoint aB2Point = aPolygon.getB2DPoint(nIndex);
+                                                    Point aPoint(aB2Point.getX(), aB2Point.getY());
+                                                    aPoint.Move(aLogicOffset.getX(), aLogicOffset.getY());
+                                                    if (nIndex > 0)
+                                                        sPolygonElem += " ";
+                                                    sPolygonElem += aPoint.toString();
+                                                }
+                                                sPolygonElem += R"elem(\" style=\"stroke: none; fill: rgb(114,159,207); fill-opacity: 0.8\"/>)elem";
+
+                                                aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM));
+
+                                                OString sSVGElem = R"elem(<svg version=\"1.2\" width=\")elem" +
+                                                    OString::number(aSelection.GetWidth() / 100.0) +
+                                                    R"elem(mm\" height=\")elem" +
+                                                    OString::number(aSelection.GetHeight() / 100.0) +
+                                                    R"elem(mm\" viewBox=\")elem" +
+                                                    aSelection.toString() +
+                                                    R"elem(\" preserveAspectRatio=\"xMidYMid\" xmlns=\"http://www.w3.org/2000/svg\">)elem";
+
+                                                aExtraInfo.append(", \"svg\": \"");
+                                                aExtraInfo.append(sSVGElem);
+                                                aExtraInfo.append("\\n  ");
+                                                aExtraInfo.append(sPolygonElem);
+                                                aExtraInfo.append("\\n</svg>");
+                                                aExtraInfo.append("\""); // svg
+                                            }
+                                        }
+                                    }
+                                }
+                                aExtraInfo.append("}"); // dragInfo
+                            }
+                        }
+                    }
+                }
+            }
+            aExtraInfo.append("}");
+
+            sSelectionText = aSelection.toString() +
+                ", " + OString::number(nRotAngle);
+            if (!aExtraInfo.isEmpty())
+            {
+                sSelectionText += ", " + aExtraInfo.makeStringAndClear();
+            }
+        }
+
+        if (sSelectionText.isEmpty())
+            sSelectionText = "EMPTY";
+
+        if (bTableSelection)
+        {
+            boost::property_tree::ptree aTableRectangle;
+            aTableRectangle.put("x", aSelection.Left());
+            aTableRectangle.put("y", aSelection.Top());
+            aTableRectangle.put("width", aSelection.GetWidth());
+            aTableRectangle.put("height", aSelection.GetHeight());
+            aTableJsonTree.push_back(std::make_pair("rectangle", aTableRectangle));
+
+            std::stringstream aStream;
+            boost::property_tree::write_json(aStream, aTableJsonTree);
+            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, aStream.str().c_str());
+        }
+        else
+        {
+            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, "{}");
+        }
+
+        if (pOtherShell)
+        {
+            // Another shell wants to know about our existing
+            // selection.
+            if (pViewShell != pOtherShell)
+                SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionText);
+        }
+        else
+        {
+            // We have a new selection, so both pViewShell and the
+            // other views want to know about it.
+            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelectionText.getStr());
+            SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionText);
+        }
+    }
+}
+
 void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
 {
     // remember old focus handle values to search for it again
@@ -783,252 +1035,7 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
 
     if (bTiledRendering && pViewShell)
     {
-        tools::Rectangle aSelection(aRect);
-        bool bIsChart = false;
-
-        if (!aRect.IsEmpty())
-        {
-            sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
-            if (nTotalPaintWindows == 1)
-            {
-                const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice());
-                if (pWin && pWin->IsChart())
-                {
-                    bIsChart = true;
-                    const vcl::Window* pViewShellWindow = GetSfxViewShell()->GetEditWindowForActiveOLEObj();
-                    if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin))
-                    {
-                        Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow);
-                        Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
-                        aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY());
-                    }
-                }
-            }
-        }
-
-        if (!aSelection.IsEmpty())
-        {
-            // In case the map mode is in 100th MM, then need to convert the coordinates over to twips for LOK.
-            if (mpMarkedPV)
-            {
-                if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
-                {
-                    if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
-                        aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
-                }
-            }
-
-            // hide the text selection too
-            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, "");
-        }
-
-        {
-            OString sSelectionText;
-            boost::property_tree::ptree aTableJsonTree;
-            bool bTableSelection = false;
-
-            if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_TABLE)
-            {
-                auto& rTableObject = dynamic_cast<sdr::table::SdrTableObj&>(*mpMarkedObj);
-                bTableSelection = rTableObject.createTableEdgesJson(aTableJsonTree);
-            }
-            if (GetMarkedObjectCount())
-            {
-                SdrMark* pM = GetSdrMarkByIndex(0);
-                SdrObject* pO = pM->GetMarkedSdrObj();
-                long nRotAngle = pO->GetRotateAngle();
-                // true if we are dealing with a RotGrfFlyFrame
-                // (SwVirtFlyDrawObj with a SwGrfNode)
-                bool bWriterGraphic = pO->HasLimitedRotation();
-
-                if (bWriterGraphic)
-                {
-                    nRotAngle *= 10;
-                }
-
-                OStringBuffer aExtraInfo;
-
-                aExtraInfo.append("{\"id\":\"");
-                aExtraInfo.append(OString::number(reinterpret_cast<sal_IntPtr>(pO)));
-                aExtraInfo.append("\",\"type\":");
-                aExtraInfo.append(OString::number(pO->GetObjIdentifier()));
-
-                if (bWriterGraphic)
-                {
-                    aExtraInfo.append(", \"isWriterGraphic\": true");
-                }
-                else if (bIsChart)
-                {
-                    LokChartHelper aChartHelper(pViewShell);
-                    css::uno::Reference<css::frame::XController>& xChartController = aChartHelper.GetXController();
-                    css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier( xChartController, uno::UNO_QUERY);
-                    if (xSelectionSupplier.is())
-                    {
-                        uno::Any aSel = xSelectionSupplier->getSelection();
-                        OUString aValue;
-                        if (aSel >>= aValue)
-                        {
-                            OString aObjectCID(aValue.getStr(), aValue.getLength(), osl_getThreadTextEncoding());
-                            const std::vector<OString> aProps{"Draggable", "Resizable", "Rotatable"};
-                            for (const auto& rProp: aProps)
-                            {
-                                sal_Int32 nPos = aObjectCID.indexOf(rProp);
-                                if (nPos == -1) continue;
-                                nPos += rProp.getLength() + 1; // '='
-                                if (aExtraInfo.getLength() > 2) // != "{ "
-                                    aExtraInfo.append(", ");
-                                aExtraInfo.append("\"is");
-                                aExtraInfo.append(rProp);
-                                aExtraInfo.append("\": ");
-                                aExtraInfo.append(OString::boolean(aObjectCID[nPos] == '1'));
-                            }
-
-                            OUString sDragMethod = lcl_getDragMethodServiceName(aValue);
-                            if (sDragMethod == "PieSegmentDragging")
-                            {
-                                // old initial offset inside the CID returned by xSelectionSupplier->getSelection()
-                                // after a pie segment dragging; using SdrObject::GetName for getting a CID with the updated offset
-                                aValue = pO->GetName();
-                                OUString sDragParameters = lcl_getDragParameterString(aValue);
-                                if (!sDragParameters.isEmpty())
-                                {
-                                    aExtraInfo.append(", \"dragInfo\": { ");
-                                    aExtraInfo.append("\"dragMethod\": \"");
-                                    aExtraInfo.append(sDragMethod.toUtf8());
-                                    aExtraInfo.append("\"");
-
-                                    OUString sParam;
-                                    sal_Int32 nStartIndex = 0;
-                                    std::array<int, 5> aDragParameters;
-                                    for (auto& rParam : aDragParameters)
-                                    {
-                                        sParam = sDragParameters.getToken(0, ',', nStartIndex);
-                                        if (sParam.isEmpty())
-                                            break;
-                                        rParam = sParam.toInt32();
-                                    }
-
-                                    // initial offset in %
-                                    if (aDragParameters[0] < 0)
-                                        aDragParameters[0] = 0;
-                                    else if (aDragParameters[0] > 100)
-                                        aDragParameters[0] = 100;
-
-                                    aExtraInfo.append(", \"initialOffset\": ");
-                                    aExtraInfo.append(OString::number(aDragParameters[0]));
-
-                                    // drag direction constraint
-                                    Point aMinPos(aDragParameters[1], aDragParameters[2]);
-                                    Point aMaxPos(aDragParameters[3], aDragParameters[4]);
-                                    Point aDragDirection = aMaxPos - aMinPos;
-                                    aDragDirection = OutputDevice::LogicToLogic(aDragDirection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
-
-                                    aExtraInfo.append(", \"dragDirection\": [");
-                                    aExtraInfo.append(aDragDirection.toString());
-                                    aExtraInfo.append("]");
-
-                                    // polygon approximating the pie segment or donut segment
-                                    if (pO->GetObjIdentifier() == OBJ_PATHFILL)
-                                    {
-                                        const basegfx::B2DPolyPolygon aPolyPolygon(pO->TakeXorPoly());
-                                        if (aPolyPolygon.count() == 1)
-                                        {
-                                            const basegfx::B2DPolygon aPolygon = aPolyPolygon.getB2DPolygon(0);
-                                            if (sal_uInt32 nPolySize = aPolygon.count())
-                                            {
-                                                const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice());
-                                                const vcl::Window* pViewShellWindow = pViewShell->GetEditWindowForActiveOLEObj();
-                                                if (pWin && pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin))
-                                                {
-                                                    // in the following code escaping sequences used inside raw literal strings
-                                                    // are for making them understandable by the JSON parser
-
-                                                    Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow);
-                                                    Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
-                                                    OString sPolygonElem("<polygon points=\\\"");
-                                                    for (sal_uInt32 nIndex = 0; nIndex < nPolySize; ++nIndex)
-                                                    {
-                                                        const basegfx::B2DPoint aB2Point = aPolygon.getB2DPoint(nIndex);
-                                                        Point aPoint(aB2Point.getX(), aB2Point.getY());
-                                                        aPoint.Move(aLogicOffset.getX(), aLogicOffset.getY());
-                                                        if (nIndex > 0)
-                                                            sPolygonElem += " ";
-                                                        sPolygonElem += aPoint.toString();
-                                                    }
-                                                    sPolygonElem += R"elem(\" style=\"stroke: none; fill: rgb(114,159,207); fill-opacity: 0.8\"/>)elem";
-
-                                                    aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM));
-
-                                                    OString sSVGElem = R"elem(<svg version=\"1.2\" width=\")elem" +
-                                                        OString::number(aSelection.GetWidth() / 100.0) +
-                                                        R"elem(mm\" height=\")elem" +
-                                                        OString::number(aSelection.GetHeight() / 100.0) +
-                                                        R"elem(mm\" viewBox=\")elem" +
-                                                        aSelection.toString() +
-                                                        R"elem(\" preserveAspectRatio=\"xMidYMid\" xmlns=\"http://www.w3.org/2000/svg\">)elem";
-
-                                                    aExtraInfo.append(", \"svg\": \"");
-                                                    aExtraInfo.append(sSVGElem);
-                                                    aExtraInfo.append("\\n  ");
-                                                    aExtraInfo.append(sPolygonElem);
-                                                    aExtraInfo.append("\\n</svg>");
-                                                    aExtraInfo.append("\""); // svg
-                                                }
-                                            }
-                                        }
-                                    }
-                                    aExtraInfo.append("}"); // dragInfo
-                                }
-                            }
-                        }
-                    }
-                }
-                aExtraInfo.append("}");
-
-                sSelectionText = aSelection.toString() +
-                    ", " + OString::number(nRotAngle);
-                if (!aExtraInfo.isEmpty())
-                {
-                    sSelectionText += ", " + aExtraInfo.makeStringAndClear();
-                }
-            }
-
-            if (sSelectionText.isEmpty())
-                sSelectionText = "EMPTY";
-
-            if (bTableSelection)
-            {
-                boost::property_tree::ptree aTableRectangle;
-                aTableRectangle.put("x", aSelection.Left());
-                aTableRectangle.put("y", aSelection.Top());
-                aTableRectangle.put("width", aSelection.GetWidth());
-                aTableRectangle.put("height", aSelection.GetHeight());
-                aTableJsonTree.push_back(std::make_pair("rectangle", aTableRectangle));
-
-                std::stringstream aStream;
-                boost::property_tree::write_json(aStream, aTableJsonTree);
-                pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, aStream.str().c_str());
-            }
-            else
-            {
-                pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, "{}");
-            }
-
-            if (pOtherShell)
-            {
-                // Another shell wants to know about our existing
-                // selection.
-                if (pViewShell != pOtherShell)
-                    SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionText);
-            }
-            else
-            {
-                // We have a new selection, so both pViewShell and the
-                // other views want to know about it.
-                pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelectionText.getStr());
-                SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionText);
-            }
-        }
+        SetMarkHandlesForLOKit(aRect, pOtherShell);
     }
 
     if (bFrmHdl)
commit 1f48b99b218d3ef78b60e1006fea095d77c35c0d
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat May 23 16:52:09 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Jun 8 16:18:53 2020 +0200

    sd: move SearchSelection constructor to header file
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94727
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit beacca27ecc1b1463477c644e36a7e5815053433)
    
    Change-Id: I71d7986044208b6c733c1d46db7bf84bc6254915
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95798
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 27ec4d80127d..d935d6f1d6a8 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -51,7 +51,11 @@ struct SearchSelection
      */
     OString const m_aRectangles;
 
-    SearchSelection(int nPage, const OString& rRectangles);
+    SearchSelection(int nPage, const OString& rRectangles)
+        : m_nPage(nPage)
+        , m_aRectangles(rRectangles)
+    {
+    }
 
     bool operator==(const SearchSelection& rOther) const
     {
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index e67d823e9a11..e7f676f43e4e 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -66,17 +66,6 @@ using namespace ::com::sun::star::linguistic2;
 
 class SfxStyleSheetPool;
 
-namespace sd {
-
-SearchSelection::SearchSelection(int nPage, const OString& rRectangles)
-    : m_nPage(nPage),
-    m_aRectangles(rRectangles)
-{
-}
-
-} // end of namespace sd
-
-
 class SdOutliner::Implementation
 {
 public:


More information about the Libreoffice-commits mailing list