[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - bundled/include kit/ChildSession.cpp kit/ChildSession.hpp kit/DummyLibreOfficeKit.cpp loleaflet/src wsd/ClientSession.cpp wsd/protocol.txt

Jan Holesovsky kendy at collabora.com
Wed Nov 29 14:10:10 UTC 2017


 bundled/include/LibreOfficeKit/LibreOfficeKit.h   |    3 --
 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx |   13 --------
 kit/ChildSession.cpp                              |   33 ----------------------
 kit/ChildSession.hpp                              |    1 
 kit/DummyLibreOfficeKit.cpp                       |   11 -------
 loleaflet/src/control/Control.Header.js           |   16 ++++++----
 wsd/ClientSession.cpp                             |    1 
 wsd/protocol.txt                                  |    6 ----
 8 files changed, 9 insertions(+), 75 deletions(-)

New commits:
commit 39911df4be3df98737fb8ee2ffa5ffba06619db5
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Nov 29 16:09:16 2017 +0200

    Revert "calc: set outline state"
    
    This reverts commit 63dd187a7f5ad11a6536a8beb68c694abbadac57.
    
    Change-Id: I7e1a70bc1a26a7efc429081adc476dee1530213f
    Reviewed-on: https://gerrit.libreoffice.org/45505
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index 02e8e50e..14824821 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -227,9 +227,6 @@ struct _LibreOfficeKitDocumentClass
     /// @see lok::Document::setVisibleArea).
     void (*setClientVisibleArea) (LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight);
 
-    /// @see lok::Document::setOutlineState).
-    void (*setOutlineState) (LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden);
-
     /// @see lok::Document::createView().
     int (*createView) (LibreOfficeKitDocument* pThis);
     /// @see lok::Document::destroyView().
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
index 1c4fcd03..19e121fe 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -465,19 +465,6 @@ public:
     }
 
     /**
-     * Show/Hide a single row/column header outline for Calc dosuments.
-     *
-     * @param bColumn - if we are dealing with a column or row group
-     * @param nLevel - the level to which the group belongs
-     * @param nIndex - the group entry index
-     * @param bHidden - the new group state (collapsed/expanded)
-     */
-    void setOutlineState(bool bColumn, int nLevel, int nIndex, bool bHidden)
-    {
-        mpDoc->pClass->setOutlineState(mpDoc, bColumn, nLevel, nIndex, bHidden);
-    }
-
-    /**
      * Create a new view for an existing document.
      * By default a loaded document has 1 view.
      * @return the ID of the new view.
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index ca4c855e..b540febe 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -217,7 +217,6 @@ bool ChildSession::_handleInput(const char *buffer, int length)
 
         assert(tokens[0] == "clientzoom" ||
                tokens[0] == "clientvisiblearea" ||
-               tokens[0] == "outlinestate" ||
                tokens[0] == "downloadas" ||
                tokens[0] == "getchildid" ||
                tokens[0] == "gettextselection" ||
@@ -244,10 +243,6 @@ bool ChildSession::_handleInput(const char *buffer, int length)
         {
             return clientVisibleArea(buffer, length, tokens);
         }
-        else if (tokens[0] == "outlinestate")
-        {
-            return outlineState(buffer, length, tokens);
-        }
         else if (tokens[0] == "downloadas")
         {
             return downloadAs(buffer, length, tokens);
@@ -597,34 +592,6 @@ bool ChildSession::clientVisibleArea(const char* /*buffer*/, int /*length*/, con
     return true;
 }
 
-bool ChildSession::outlineState(const char* /*buffer*/, int /*length*/, const std::vector<std::string>& tokens)
-{
-    std::string type, state;
-    int level, index;
-
-    if (tokens.size() != 5 ||
-        !getTokenString(tokens[1], "type", type) ||
-        (type != "column" && type != "row") ||
-        !getTokenInteger(tokens[2], "level", level) ||
-        !getTokenInteger(tokens[3], "index", index) ||
-        !getTokenString(tokens[4], "state", state) ||
-        (state != "visible" && state != "hidden"))
-    {
-        sendTextFrame("error: cmd=outlinestate kind=syntax");
-        return false;
-    }
-
-    bool column = type == "column";
-    bool hidden = state == "hidden";
-
-    std::unique_lock<std::mutex> lock(_docManager.getDocumentMutex());
-
-    getLOKitDocument()->setView(_viewId);
-
-    getLOKitDocument()->setOutlineState(column, level, index, hidden);
-    return true;
-}
-
 bool ChildSession::downloadAs(const char* /*buffer*/, int /*length*/, const std::vector<std::string>& tokens)
 {
     std::string name, id, format, filterOptions;
diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp
index ad9486a2..b5b9209c 100644
--- a/kit/ChildSession.hpp
+++ b/kit/ChildSession.hpp
@@ -182,7 +182,6 @@ private:
 
     bool clientZoom(const char* buffer, int length, const std::vector<std::string>& tokens);
     bool clientVisibleArea(const char* buffer, int length, const std::vector<std::string>& tokens);
-    bool outlineState(const char* buffer, int length, const std::vector<std::string>& tokens);
     bool downloadAs(const char* buffer, int length, const std::vector<std::string>& tokens);
     bool getChildId();
     bool getTextSelection(const char* buffer, int length, const std::vector<std::string>& tokens);
diff --git a/kit/DummyLibreOfficeKit.cpp b/kit/DummyLibreOfficeKit.cpp
index 55f4e0ce..891ac6ed 100644
--- a/kit/DummyLibreOfficeKit.cpp
+++ b/kit/DummyLibreOfficeKit.cpp
@@ -106,7 +106,6 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis,
                                     int nTileTwipWidth,
                                     int nTileTwipHeight);
 static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight);
-static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden);
 static int doc_createView(LibreOfficeKitDocument* pThis);
 static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId);
 static void doc_setView(LibreOfficeKitDocument* pThis, int nId);
@@ -154,7 +153,6 @@ LibLODocument_Impl::LibLODocument_Impl()
         m_pDocumentClass->getCommandValues = doc_getCommandValues;
         m_pDocumentClass->setClientZoom = doc_setClientZoom;
         m_pDocumentClass->setClientVisibleArea = doc_setClientVisibleArea;
-        m_pDocumentClass->setOutlineState = doc_setOutlineState;
 
         m_pDocumentClass->createView = doc_createView;
         m_pDocumentClass->destroyView = doc_destroyView;
@@ -466,15 +464,6 @@ static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int
     (void) nHeight;
 }
 
-static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden)
-{
-    (void) pThis;
-    (void) bColumn;
-    (void) nLevel;
-    (void) nIndex;
-    (void) bHidden;
-}
-
 static int doc_createView(LibreOfficeKitDocument* /*pThis*/)
 {
     return 1;
diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js
index 3da83248..6dac7330 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -382,13 +382,15 @@ L.Control.Header = L.Control.extend({
 	},
 
 	_updateOutlineState: function (column, group) {
-		if (!group)
-			return;
-
-		var type = column ? 'column' : 'row';
-		var state = group.hidden ? 'visible' : 'hidden'; // we have to send the new state
-		var payload = 'outlinestate type='+ type + ' level=' + group.level + ' index=' + group.index + ' state=' + state;
-		this._map._socket.sendMessage(payload);
+		var e = {
+			x: this._map._getTopLeftPoint().x,
+			y: this._map._getTopLeftPoint().y,
+			offset: {x: undefined, y: undefined},
+			outline: {column: column, level: group.level, index: group.index, hidden: !group.hidden}
+		};
+		this._map.fire('updaterowcolumnheaders', e);
+		// TODO do we need this ?
+		//this._map._socket.sendMessage('commandvalues command=.uno:ViewAnnotationsPosition');
 	},
 
 	_onMouseDown: function (e) {
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 663a55fc..d7f6f1fc 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -126,7 +126,6 @@ bool ClientSession::_handleInput(const char *buffer, int length)
     else if (tokens[0] != "canceltiles" &&
              tokens[0] != "clientzoom" &&
              tokens[0] != "clientvisiblearea" &&
-             tokens[0] != "outlinestate" &&
              tokens[0] != "commandvalues" &&
              tokens[0] != "closedocument" &&
              tokens[0] != "downloadas" &&
diff --git a/wsd/protocol.txt b/wsd/protocol.txt
index bb871d81..3af10f64 100644
--- a/wsd/protocol.txt
+++ b/wsd/protocol.txt
@@ -177,12 +177,6 @@ clientvisiblearea x=<x> y=<y> width=<width> height=<height>
 
     Invokes lok::Document::setClientVisibleArea().
 
-outlinestate type=<type> level=<level> index=<index> state=<state>
-
-    <type> is 'column' or 'row', <level> and <index> are numbers, <state> is 'visible' or 'hidden'.
-
-    Invokes  lok::Document::setOutlineState().
-
 useractive
 
     Sent when the user regains focus or clicks within the active area to


More information about the Libreoffice-commits mailing list