desktop/source/lib/init.cxx                  |    1 
 include/LibreOfficeKit/LibreOfficeKitEnums.h |    9 ----
 include/svx/svdmrkv.hxx                      |    2 
 libreofficekit/source/gtk/lokdocview.cxx     |    1 
 svx/source/svdraw/svdedxv.cxx                |   10 ----
 svx/source/svdraw/svdmrkv.cxx                |   56 ++++++++-------------------
 6 files changed, 18 insertions(+), 61 deletions(-)

New commits:
commit 9f04d96ba8c851cbbdb4e74b2435f9f5135fb09e
Author:     Andras Timar <[email protected]>
AuthorDate: Thu Apr 18 14:41:17 2024 +0200
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri Apr 19 16:03:59 2024 +0200

    Revert "LOK: send inner text boundry information of shapes/textbox on 
change"
    
    This reverts commit 42547334938118511d1052678cbd612160db1b5c.
    Reason of revert: we reverted the online part earlier, because we
    found it risky in the stable branch.
    
    Change-Id: I2ec20a3c035956bbec126932b7c15e5331f950ec
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166251
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 32523ab22784..ea3159ae80f6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1852,7 +1852,6 @@ void CallbackFlushHandler::queue(const int type, 
CallbackData& aCallbackData)
             case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED:
             case LOK_CALLBACK_COLOR_PALETTES:
             case LOK_CALLBACK_TOOLTIP:
-            case LOK_CALLBACK_SHAPE_INNER_TEXT:
             {
                 if (removeAll(type))
                     SAL_INFO("lok", "Removed dups of [" << type << "]: [" << 
aCallbackData.getPayload() << "].");
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 80bb82dc32c7..a894bd473ad9 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -1045,13 +1045,6 @@ typedef enum
      */
     LOK_CALLBACK_TOOLTIP = 71,
 
-    /**
-     * Used for sending the rectangle for text inside a shape/textbox
-     *
-     *  Payload contains the rectangle details
-     */
-    LOK_CALLBACK_SHAPE_INNER_TEXT = 72,
-
 }
 LibreOfficeKitCallbackType;
 
@@ -1224,8 +1217,6 @@ static inline const char* lokCallbackTypeToString(int 
nType)
         return "LOK_CALLBACK_CORE_LOG";
     case LOK_CALLBACK_TOOLTIP:
         return "LOK_CALLBACK_TOOLTIP";
-    case LOK_CALLBACK_SHAPE_INNER_TEXT:
-        return "LOK_CALLBACK_SHAPE_INNER_TEXT";
     }
 
     assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 6421b51b0dba..162581fc5def 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -150,7 +150,6 @@ private:
     void UndirtyMrkPnt() const;
 
     void SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const 
SfxViewShell* pOtherShell);
-    OString CreateInnerTextRectString() const;
     bool dumpGluePointsToJSON(boost::property_tree::ptree& rTree);
 
 protected:
@@ -247,7 +246,6 @@ public:
     /// whether all x coordinates in use are negated or not
     void SetNegativeX(bool bOn) { mbNegativeX = bOn; }
     bool IsNegativeX() const { return mbNegativeX; }
-    void SetInnerTextAreaForLOKit() const;
 
 // migrate selections
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 60c3435ac28d..f025cf99a140 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1498,7 +1498,6 @@ callback (gpointer pData)
     case LOK_CALLBACK_A11Y_SELECTION_CHANGED:
     case LOK_CALLBACK_CORE_LOG:
     case LOK_CALLBACK_TOOLTIP:
-    case LOK_CALLBACK_SHAPE_INNER_TEXT:
     {
         // TODO: Implement me
         break;
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 083f0f1e932b..42be2aff97fb 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1972,10 +1972,7 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, 
vcl::Window* pWin)
             if (mpModel)
             {
                 if (mpTextEditOutliner && mpTextEditOutliner->IsModified())
-                {
                     mpModel->SetChanged();
-                    SetInnerTextAreaForLOKit();
-                }
             }
 
             /* Start chaining processing */
@@ -2167,10 +2164,7 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, 
vcl::Window* pWin)
                 // It could execute CommandEventId::ExtTextInput, while 
SdrObjEditView::KeyInput
                 // isn't called
                 if (mpTextEditOutliner && mpTextEditOutliner->IsModified())
-                {
                     mpModel->SetChanged();
-                    SetInnerTextAreaForLOKit();
-                }
             }
             return true;
         }
@@ -2434,10 +2428,8 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& 
rSet, bool bReplaceAll)
             mpTextEditOutlinerView->SetAttribs(rSet);
 
             Outliner* pTEOutliner = mpTextEditOutlinerView->GetOutliner();
-            if (mpModel && pTEOutliner && pTEOutliner->IsModified()) {
+            if (mpModel && pTEOutliner && pTEOutliner->IsModified())
                 mpModel->SetChanged();
-                SetInnerTextAreaForLOKit();
-            }
 
             ImpMakeTextCursorAreaVisible();
         }
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 0636dc28ed64..139f9e8ae2a7 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -791,42 +791,6 @@ namespace
     };
 }
 
-OString SdrMarkView::CreateInnerTextRectString() const
-{
-    if (!mpMarkedObj)
-        return OString();
-
-    SdrPageView* pPageView = GetSdrPageView();
-    const sdr::contact::ViewObjectContact& rVOC = 
mpMarkedObj->GetViewContact().GetViewObjectContact(
-        pPageView->GetPageWindow(0)->GetObjectContact());
-
-    sdr::contact::DisplayInfo aDisplayInfo;
-    TextBoundsExtractor 
aTextBoundsExtractor(rVOC.GetObjectContact().getViewInformation2D());
-    basegfx::B2DRange aRange = aTextBoundsExtractor.getTextBounds(rVOC, 
aDisplayInfo);
-    if (!aRange.isEmpty()) {
-        tools::Rectangle rect(aRange.getMinX(), aRange.getMinY(), 
aRange.getMaxX(), aRange.getMaxY());
-        tools::Rectangle aRangeTWIP = o3tl::convert(rect, o3tl::Length::mm100, 
o3tl::Length::twip);
-        OString innerTextInfo = "\"innerTextRect\":[" +
-            OString::number(aRangeTWIP.getX()) + "," +
-            OString::number(aRangeTWIP.getY()) + "," +
-            OString::number(aRangeTWIP.GetWidth()) + "," +
-            OString::number(aRangeTWIP.GetHeight()) + "]";
-        return innerTextInfo;
-    }
-
-    return OString();
-}
-
-void SdrMarkView::SetInnerTextAreaForLOKit() const
-{
-    if (!comphelper::LibreOfficeKit::isActive())
-        return;
-    SfxViewShell* pViewShell = GetSfxViewShell();
-    OString sRectString = CreateInnerTextRectString();
-    if (pViewShell && !sRectString.isEmpty())
-        pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SHAPE_INNER_TEXT, 
sRectString.getStr());
-}
-
 void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const 
SfxViewShell* pOtherShell)
 {
     SfxViewShell* pViewShell = GetSfxViewShell();
@@ -925,9 +889,23 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 
             if (mpMarkedObj && !pOtherShell)
             {
-                OString innerTextInfo = CreateInnerTextRectString();
-                if (!innerTextInfo.isEmpty())
-                    aExtraInfo.append("," + innerTextInfo);
+                const sdr::contact::ViewObjectContact& rVOC = 
mpMarkedObj->GetViewContact().GetViewObjectContact(
+                    pPageView->GetPageWindow(0)->GetObjectContact());
+
+                sdr::contact::DisplayInfo aDisplayInfo;
+                TextBoundsExtractor 
aTextBoundsExtractor(rVOC.GetObjectContact().getViewInformation2D());
+                basegfx::B2DRange aRange = 
aTextBoundsExtractor.getTextBounds(rVOC, aDisplayInfo);
+                if (!aRange.isEmpty()) {
+                    tools::Rectangle rect(aRange.getMinX(), aRange.getMinY(), 
aRange.getMaxX(), aRange.getMaxY());
+                    tools::Rectangle aRangeTWIP = o3tl::convert(rect, 
o3tl::Length::mm100, o3tl::Length::twip);
+                    OString innerTextInfo = ",\"innerTextRect\":[" +
+                        OString::number(aRangeTWIP.getX()) + "," +
+                        OString::number(aRangeTWIP.getY()) + "," +
+                        OString::number(aRangeTWIP.GetWidth()) + "," +
+                        OString::number(aRangeTWIP.GetHeight()) + "]";
+
+                    aExtraInfo.append(innerTextInfo);
+                }
             }
 
             // In core, the gridOffset is calculated based on the LogicRect's 
TopLeft coordinate

Reply via email to