[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 3 commits - desktop/source include/sfx2 include/vcl sfx2/source sw/inc sw/source vcl/source

Pranav Kant pranavk at collabora.co.uk
Thu Nov 16 09:16:59 UTC 2017


 desktop/source/lib/init.cxx       |   52 ++++++++++++++++++--------------------
 include/sfx2/lokhelper.hxx        |    5 ++-
 include/vcl/IDialogRenderable.hxx |    6 +++-
 include/vcl/dialog.hxx            |    1 
 sfx2/source/view/lokhelper.cxx    |   14 ++++++++--
 sw/inc/unotxdoc.hxx               |    4 ++
 sw/source/uibase/uno/unotxdoc.cxx |    6 ++--
 vcl/source/control/edit.cxx       |   41 +++++++++++++++++++++++++++++
 vcl/source/window/dialog.cxx      |   20 ++++++++++++--
 9 files changed, 111 insertions(+), 38 deletions(-)

New commits:
commit 9c2a2aff948cf8b14e4f35a5637ae07c2a2f687c
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Nov 14 18:45:02 2017 +0530

    lokdialog: Expose cursor visible status
    
    Change the notifyDialog API a bit. Use a std::vector to keep track of
    each payload item that needs to be fed to the resulting JSON.
    
    Change-Id: If3229a88d2df5368e14290a0e80ebe6206780639
    Reviewed-on: https://gerrit.libreoffice.org/44722
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 01d519173c2a..a98c65cc02a2 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -10,6 +10,7 @@
 #ifndef INCLUDED_SFX2_LOKHELPER_HXX
 #define INCLUDED_SFX2_LOKHELPER_HXX
 
+#include <vcl/IDialogRenderable.hxx>
 #include <sfx2/dllapi.h>
 #include <sfx2/viewsh.hxx>
 #include <cstddef>
@@ -41,7 +42,9 @@ public:
     /// Same as notifyOtherViews(), but works on a selected "other" view, not on all of them.
     static void notifyOtherView(SfxViewShell* pThisView, SfxViewShell* pOtherView, int nType, const OString& rKey, const OString& rPayload);
     /// Emits a LOK_CALLBACK_DIALOG
-    static void notifyDialog(const OUString& rPayload, const OUString& rAction, const Rectangle* rRect);
+    static void notifyDialog(const OUString& rDialogId,
+                             const OUString& rAction,
+                             const std::vector<vcl::LOKPayloadItem>& rPayload);
     /// Emits a LOK_CALLBACK_DIALOG_CHILD
     static void notifyDialogChild(const OUString& rDialogID, const OUString& rAction, const Point& rPos);
     /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed.
diff --git a/include/vcl/IDialogRenderable.hxx b/include/vcl/IDialogRenderable.hxx
index 357926b40446..b02a701c01b7 100644
--- a/include/vcl/IDialogRenderable.hxx
+++ b/include/vcl/IDialogRenderable.hxx
@@ -23,6 +23,8 @@
 namespace vcl
 {
 
+typedef std::pair<const OString, const OString> LOKPayloadItem;
+
 typedef OUString DialogID;
 
 class VCL_DLLPUBLIC IDialogRenderable
@@ -47,7 +49,9 @@ public:
                                            int nCount, int nButtons, int nModifier) = 0;
 
     // Callbacks
-    virtual void notifyDialog(const DialogID& rDialogID, const OUString& rAction, const Rectangle* rRect) = 0;
+    virtual void notifyDialog(const DialogID& rDialogID,
+                              const OUString& rAction,
+                              const std::vector<LOKPayloadItem>& rPayload = std::vector<LOKPayloadItem>()) = 0;
 
     virtual void notifyDialogChild(const DialogID& rDialogID, const OUString& rAction, const Point& rPos) = 0;
 };
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index e1cb91d1dac1..74e5323c4996 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -87,7 +87,7 @@ public:
 
     void LOKKeyInput(const KeyEvent& rKeyEvent);
     void LOKKeyUp(const KeyEvent& rKeyEvent);
-    void LOKCursorInvalidate(const Rectangle& rRect);
+    void LOKCursor(const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload);
 
 protected:
     explicit        Dialog( WindowType nType );
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 7e43b7ff0ce6..d24e0a7a3db6 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -132,7 +132,9 @@ void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const OS
     }
 }
 
-void SfxLokHelper::notifyDialog(const OUString& rDialogID, const OUString& rAction, const Rectangle* rRect)
+void SfxLokHelper::notifyDialog(const OUString& rDialogID,
+                                const OUString& rAction,
+                                const std::vector<vcl::LOKPayloadItem>& rPayload)
 {
     if (SfxLokHelper::getViewsCount() <= 0 || rDialogID.isEmpty())
         return;
@@ -140,9 +142,15 @@ void SfxLokHelper::notifyDialog(const OUString& rDialogID, const OUString& rActi
     SfxViewShell* pViewShell = SfxViewShell::GetFirst();
     OString aPayload = OString("{ \"dialogId\": \"") + OUStringToOString(rDialogID, RTL_TEXTENCODING_UTF8).getStr() + OString("\"");
     aPayload += OString(", \"action\": \"") + OUStringToOString(rAction, RTL_TEXTENCODING_UTF8).getStr() + OString("\"");
-    if (!rAction.isEmpty() && rRect && !rRect->IsEmpty())
-        aPayload += OString(", \"rectangle\": \"") + rRect->toString() + OString("\"");
 
+    for (const auto& rItem: rPayload)
+    {
+        if (!rItem.first.isEmpty() && !rItem.second.isEmpty())
+        {
+            aPayload += OString(", \"") + rItem.first + OString("\": \"") +
+                rItem.second + OString("\"");
+        }
+    }
     aPayload += "}";
 
     while (pViewShell)
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 00b2887e60c6..90b5cb315a05 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -464,7 +464,9 @@ public:
     void postDialogChildMouseEvent(const vcl::DialogID& rDialogID, int nType, int nX, int nY,
                                    int nCount, int nButtons, int nModifier) override;
 
-    void notifyDialog(const vcl::DialogID& rDialogID, const OUString& rAction, const Rectangle* rRect) override;
+    void notifyDialog(const vcl::DialogID& rDialogID,
+                      const OUString& rAction,
+                      const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>()) override;
 
     void notifyDialogChild(const vcl::DialogID& rDialogID, const OUString& rAction, const Point& rPos) override;
 
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 45e905646ed0..33a9aeda0a0b 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3873,9 +3873,11 @@ void SwXTextDocument::postDialogChildMouseEvent(const vcl::DialogID& rDialogID,
     }
 }
 
-void SwXTextDocument::notifyDialog(const vcl::DialogID& rDialogID, const OUString& rAction, const Rectangle* rRect)
+void SwXTextDocument::notifyDialog(const vcl::DialogID& rDialogID,
+                                   const OUString& rAction,
+                                   const std::vector<vcl::LOKPayloadItem>& rPayload)
 {
-    SfxLokHelper::notifyDialog(rDialogID, rAction, rRect);
+    SfxLokHelper::notifyDialog(rDialogID, rAction, rPayload);
 }
 
 void SwXTextDocument::notifyDialogChild(const vcl::DialogID& rDialogID, const OUString& rAction, const Point& rPos)
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 6f8dd26a2ba3..afba61a662db 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -20,6 +20,7 @@
 #include <tools/rc.h>
 #include <comphelper/lok.hxx>
 
+#include <vcl/IDialogRenderable.hxx>
 #include <vcl/decoview.hxx>
 #include <vcl/event.hxx>
 #include <vcl/cursor.hxx>
@@ -1156,18 +1157,23 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible )
         pCursor->SetPos( Point( nCursorPosX, nCursorPosY ) );
         pCursor->SetSize( Size( nCursorWidth, nTextHeight ) );
         pCursor->Show();
-    }
 
-    if (comphelper::LibreOfficeKit::isActive())
-    {
-        const long X = GetOutOffXPixel() + pCursor->GetPos().X();
-        const long Y = GetOutOffYPixel() + pCursor->GetPos().Y();
-        if (nCursorWidth == 0)
-            nCursorWidth = 2;
-        const Rectangle aRect(Point(X, Y), Size(nCursorWidth, pCursor->GetHeight()));
-        Dialog* pParentDlg = GetParentDialog();
-        if (pParentDlg)
-            pParentDlg->LOKCursorInvalidate(aRect);
+        if (comphelper::LibreOfficeKit::isActive())
+        {
+            const long X = GetOutOffXPixel() + pCursor->GetPos().X();
+            const long Y = GetOutOffYPixel() + pCursor->GetPos().Y();
+
+            if (nCursorWidth == 0)
+                nCursorWidth = 2;
+            const Rectangle aRect(Point(X, Y), Size(nCursorWidth, pCursor->GetHeight()));
+
+            std::vector<vcl::LOKPayloadItem> aPayload;
+            aPayload.push_back(std::make_pair("rectangle", aRect.toString()));
+
+            Dialog* pParentDlg = GetParentDialog();
+            if (pParentDlg)
+                pParentDlg->LOKCursor("cursor_invalidate", aPayload);
+        }
     }
 }
 
@@ -1906,6 +1912,16 @@ void Edit::GetFocus()
         SetInputContext( InputContext( GetFont(), !IsReadOnly() ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) );
     }
 
+    // notify dialog's cursor visible status
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        std::vector<vcl::LOKPayloadItem> aPayload;
+        aPayload.push_back(std::make_pair(OString("visible"), OString("true")));
+        Dialog* pParentDlg = GetParentDialog();
+        if (pParentDlg)
+            pParentDlg->LOKCursor("cursor_visible", aPayload);
+    }
+
     Control::GetFocus();
 }
 
@@ -1933,6 +1949,17 @@ void Edit::LoseFocus()
             ImplInvalidateOrRepaint();    // Selektion malen
     }
 
+
+    // notify dialog's cursor visible status
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        std::vector<vcl::LOKPayloadItem> aPayload;
+        aPayload.push_back(std::make_pair(OString("visible"), OString("false")));
+        Dialog* pParentDlg = GetParentDialog();
+        if (pParentDlg)
+            pParentDlg->LOKCursor("cursor_visible", aPayload);
+    }
+
     Control::LoseFocus();
 }
 
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 0137b0950a3b..d15072cce7f6 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -596,7 +596,7 @@ void Dialog::dispose()
 
     if (comphelper::LibreOfficeKit::isActive() && mpDialogRenderable)
     {
-        mpDialogRenderable->notifyDialog(maID, "close", nullptr);
+        mpDialogRenderable->notifyDialog(maID, "close");
     }
 
     SystemWindow::dispose();
@@ -974,7 +974,11 @@ void Dialog::LogicInvalidate(const Rectangle* pRectangle)
 {
     if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty())
     {
-        mpDialogRenderable->notifyDialog(maID, "invalidate", pRectangle);
+        std::vector<vcl::LOKPayloadItem> aPayload;
+        if (pRectangle)
+            aPayload.push_back(std::make_pair(OString("rectangle"), pRectangle->toString()));
+
+        mpDialogRenderable->notifyDialog(maID, "invalidate", aPayload);
     }
 }
 
@@ -1016,13 +1020,13 @@ void Dialog::LOKKeyUp(const KeyEvent& rKeyEvent)
     ImplWindowFrameProc(this, SalEvent::ExternalKeyUp, &rKeyEvent);
 }
 
-void Dialog::LOKCursorInvalidate(const Rectangle& aRect)
+void Dialog::LOKCursor(const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload)
 {
     assert(comphelper::LibreOfficeKit::isActive());
 
     if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty())
     {
-        mpDialogRenderable->notifyDialog(maID, "cursor_invalidate", &aRect);
+        mpDialogRenderable->notifyDialog(maID, rAction, rPayload);
     }
 }
 
@@ -1353,7 +1357,7 @@ void Dialog::Resize()
     // inform LOK clients
     if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty())
     {
-        mpDialogRenderable->notifyDialog(maID, "invalidate", nullptr);
+        mpDialogRenderable->notifyDialog(maID, "invalidate");
     }
 }
 
commit 135b86cee45d20fbd8b1253954443be07d7f4abc
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Nov 14 16:00:57 2017 +0530

    lokdialog: Callback for dialog cursor invalidation
    
    Change-Id: Iecadb68737ed7b1a425d9ea633976fb24d1055c6
    Reviewed-on: https://gerrit.libreoffice.org/44721
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: pranavk <pranavk at collabora.co.uk>

diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 9048d0e41dbe..e1cb91d1dac1 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -87,6 +87,7 @@ public:
 
     void LOKKeyInput(const KeyEvent& rKeyEvent);
     void LOKKeyUp(const KeyEvent& rKeyEvent);
+    void LOKCursorInvalidate(const Rectangle& rRect);
 
 protected:
     explicit        Dialog( WindowType nType );
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index fe7f6f976ffc..6f8dd26a2ba3 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -18,6 +18,8 @@
  */
 
 #include <tools/rc.h>
+#include <comphelper/lok.hxx>
+
 #include <vcl/decoview.hxx>
 #include <vcl/event.hxx>
 #include <vcl/cursor.hxx>
@@ -1155,6 +1157,18 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible )
         pCursor->SetSize( Size( nCursorWidth, nTextHeight ) );
         pCursor->Show();
     }
+
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        const long X = GetOutOffXPixel() + pCursor->GetPos().X();
+        const long Y = GetOutOffYPixel() + pCursor->GetPos().Y();
+        if (nCursorWidth == 0)
+            nCursorWidth = 2;
+        const Rectangle aRect(Point(X, Y), Size(nCursorWidth, pCursor->GetHeight()));
+        Dialog* pParentDlg = GetParentDialog();
+        if (pParentDlg)
+            pParentDlg->LOKCursorInvalidate(aRect);
+    }
 }
 
 void Edit::ImplAlign()
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 73674200d914..0137b0950a3b 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1016,6 +1016,16 @@ void Dialog::LOKKeyUp(const KeyEvent& rKeyEvent)
     ImplWindowFrameProc(this, SalEvent::ExternalKeyUp, &rKeyEvent);
 }
 
+void Dialog::LOKCursorInvalidate(const Rectangle& aRect)
+{
+    assert(comphelper::LibreOfficeKit::isActive());
+
+    if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty())
+    {
+        mpDialogRenderable->notifyDialog(maID, "cursor_invalidate", &aRect);
+    }
+}
+
 void Dialog::ensureRepaint()
 {
     // ensure repaint
commit b4b8c72b4aab34c62ceccb2075720226da485870
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Fri Nov 10 17:12:40 2017 +0530

    Upgrade these SAL_WARNs to INFO
    
    These are very common occurrences. Let's not flood the warning output.
    
    Also ressurrect some helpful looking commented out SAL_INFOs
    
    Change-Id: I3368fb46b27b72edd8ba1f52e2a145a661c40477

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 88d5201ea123..e1b83ccc8afb 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -748,7 +748,7 @@ void CallbackFlushHandler::callback(const int type, const char* payload, void* d
 void CallbackFlushHandler::queue(const int type, const char* data)
 {
     std::string payload(data ? data : "(nil)");
-    //SAL_WARN("lok", "Queue: " << type << " : " << payload);
+    SAL_INFO("lok", "Queue: " << type << " : " << payload);
 
     if (m_bPartTilePainting)
     {
@@ -766,7 +766,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
             type != LOK_CALLBACK_VIEW_CURSOR_VISIBLE &&
             type != LOK_CALLBACK_TEXT_SELECTION)
         {
-            SAL_WARN("lok", "Skipping while painting [" << type << "]: [" << payload << "].");
+            SAL_INFO("lok", "Skipping while painting [" << type << "]: [" << payload << "].");
             return;
         }
 
@@ -783,7 +783,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
         // issuing it, instead of the absolute one that we expect.
         // This is temporary however, and, once the control is created and initialized
         // correctly, it eventually emits the correct absolute coordinates.
-        SAL_WARN("lok", "Skipping invalid event [" << type << "]: [" << payload << "].");
+        SAL_INFO("lok", "Skipping invalid event [" << type << "]: [" << payload << "].");
         return;
     }
 
@@ -817,7 +817,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
 
             if (pos != m_queue.rend() && pos->second == payload)
             {
-                //SAL_WARN("lok", "Skipping queue duplicate [" << type << + "]: [" << payload << "].");
+                SAL_INFO("lok", "Skipping queue duplicate [" << type << + "]: [" << payload << "].");
                 return;
             }
         }
@@ -848,7 +848,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
             case LOK_CALLBACK_GRAPHIC_SELECTION:
             case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
             case LOK_CALLBACK_INVALIDATE_TILES:
-                //SAL_WARN("lok", "Removing dups of [" << type << "]: [" << payload << "].");
+                SAL_INFO("lok", "Removing dups of [" << type << "]: [" << payload << "].");
                 removeAll([type] (const queue_type::value_type& elem) { return (elem.first == type); });
             break;
         }
@@ -907,10 +907,9 @@ void CallbackFlushHandler::queue(const int type, const char* data)
             case LOK_CALLBACK_INVALIDATE_TILES:
             {
                 RectangleAndPart rcNew = RectangleAndPart::Create(payload);
-                //SAL_WARN("lok", "New: " << rcNew.toString());
                 if (rcNew.isEmpty())
                 {
-                    SAL_WARN("lok", "Skipping invalid event [" << type << "]: [" << payload << "].");
+                    SAL_INFO("lok", "Skipping invalid event [" << type << "]: [" << payload << "].");
                     return;
                 }
 
@@ -923,7 +922,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
                     RectangleAndPart rcOld = RectangleAndPart::Create(pos->second);
                     if (rcOld.isInfinite() && (rcOld.m_nPart == -1 || rcOld.m_nPart == rcNew.m_nPart))
                     {
-                        SAL_WARN("lok", "Skipping queue [" << type << "]: [" << payload << "] since all tiles need to be invalidated.");
+                        SAL_INFO("lok", "Skipping queue [" << type << "]: [" << payload << "] since all tiles need to be invalidated.");
                         return;
                     }
 
@@ -932,7 +931,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
                         // If fully overlapping.
                         if (rcOld.m_aRectangle.IsInside(rcNew.m_aRectangle))
                         {
-                            SAL_WARN("lok", "Skipping queue [" << type << "]: [" << payload << "] since overlaps existing all-parts.");
+                            SAL_INFO("lok", "Skipping queue [" << type << "]: [" << payload << "] since overlaps existing all-parts.");
                             return;
                         }
                     }
@@ -940,7 +939,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
 
                 if (rcNew.isInfinite())
                 {
-                    SAL_WARN("lok", "Have Empty [" << type << "]: [" << payload << "] so removing all with part " << rcNew.m_nPart << ".");
+                    SAL_INFO("lok", "Have Empty [" << type << "]: [" << payload << "] so removing all with part " << rcNew.m_nPart << ".");
                     removeAll(
                         [&rcNew] (const queue_type::value_type& elem) {
                             if (elem.first == LOK_CALLBACK_INVALIDATE_TILES)
@@ -959,7 +958,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
                 {
                     const auto rcOrig = rcNew;
 
-                    SAL_WARN("lok", "Have [" << type << "]: [" << payload << "] so merging overlapping.");
+                    SAL_INFO("lok", "Have [" << type << "]: [" << payload << "] so merging overlapping.");
                     removeAll(
                         [&rcNew] (const queue_type::value_type& elem) {
                             if (elem.first == LOK_CALLBACK_INVALIDATE_TILES)
@@ -967,27 +966,27 @@ void CallbackFlushHandler::queue(const int type, const char* data)
                                 const RectangleAndPart rcOld = RectangleAndPart::Create(elem.second);
                                 if (rcNew.m_nPart != -1 && rcOld.m_nPart != -1 && rcOld.m_nPart != rcNew.m_nPart)
                                 {
-                                    SAL_WARN("lok", "Nothing to merge between new: " << rcNew.toString() << ", and old: " << rcOld.toString());
+                                    SAL_INFO("lok", "Nothing to merge between new: " << rcNew.toString() << ", and old: " << rcOld.toString());
                                     return false;
                                 }
 
                                 if (rcNew.m_nPart == -1)
                                 {
                                     // Don't merge unless fully overlaped.
-                                    SAL_WARN("lok", "New " << rcNew.toString() << " has " << rcOld.toString() << "?");
+                                    SAL_INFO("lok", "New " << rcNew.toString() << " has " << rcOld.toString() << "?");
                                     if (rcNew.m_aRectangle.IsInside(rcOld.m_aRectangle))
                                     {
-                                        SAL_WARN("lok", "New " << rcNew.toString() << " engulfs old " << rcOld.toString() << ".");
+                                        SAL_INFO("lok", "New " << rcNew.toString() << " engulfs old " << rcOld.toString() << ".");
                                         return true;
                                     }
                                 }
                                 else if (rcOld.m_nPart == -1)
                                 {
                                     // Don't merge unless fully overlaped.
-                                    SAL_WARN("lok", "Old " << rcOld.toString() << " has " << rcNew.toString() << "?");
+                                    SAL_INFO("lok", "Old " << rcOld.toString() << " has " << rcNew.toString() << "?");
                                     if (rcOld.m_aRectangle.IsInside(rcNew.m_aRectangle))
                                     {
-                                        SAL_WARN("lok", "New " << rcNew.toString() << " engulfs old " << rcOld.toString() << ".");
+                                        SAL_INFO("lok", "New " << rcNew.toString() << " engulfs old " << rcOld.toString() << ".");
                                         return true;
                                     }
                                 }
@@ -995,12 +994,12 @@ void CallbackFlushHandler::queue(const int type, const char* data)
                                 {
                                     const Rectangle rcOverlap = rcNew.m_aRectangle.GetIntersection(rcOld.m_aRectangle);
                                     const bool bOverlap = !rcOverlap.IsEmpty();
-                                    SAL_WARN("lok", "Merging " << rcNew.toString() << " & " << rcOld.toString() << " => " <<
+                                    SAL_INFO("lok", "Merging " << rcNew.toString() << " & " << rcOld.toString() << " => " <<
                                             rcOverlap.toString() << " Overlap: " << bOverlap);
                                     if (bOverlap)
                                     {
                                         rcNew.m_aRectangle.Union(rcOld.m_aRectangle);
-                                        SAL_WARN("lok", "Merged: " << rcNew.toString());
+                                        SAL_INFO("lok", "Merged: " << rcNew.toString());
                                         return true;
                                     }
                                 }
@@ -1013,7 +1012,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
 
                     if (rcNew.m_aRectangle != rcOrig.m_aRectangle)
                     {
-                        SAL_WARN("lok", "Replacing: " << rcOrig.toString() << " by " << rcNew.toString());
+                        SAL_INFO("lok", "Replacing: " << rcOrig.toString() << " by " << rcNew.toString());
                         if (rcNew.m_aRectangle.GetWidth() < rcOrig.m_aRectangle.GetWidth() ||
                             rcNew.m_aRectangle.GetHeight() < rcOrig.m_aRectangle.GetHeight())
                         {
@@ -1180,7 +1179,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
     }
 
     m_queue.emplace_back(type, payload);
-    SAL_WARN("lok", "Queued #" << (m_queue.size() - 1) <<
+    SAL_INFO("lok", "Queued #" << (m_queue.size() - 1) <<
              " [" << type << "]: [" << payload << "] to have " << m_queue.size() << " entries.");
 
     lock.unlock();
@@ -1196,7 +1195,7 @@ void CallbackFlushHandler::Invoke()
     {
         std::unique_lock<std::mutex> lock(m_mutex);
 
-        //SAL_WARN("lok", "Flushing " << m_queue.size() << " elements.");
+        SAL_INFO("lok", "Flushing " << m_queue.size() << " elements.");
         for (auto& pair : m_queue)
         {
             const int type = pair.first;
@@ -1211,7 +1210,7 @@ void CallbackFlushHandler::Invoke()
                     // If the state didn't change, it's safe to ignore.
                     if (stateIt->second == payload)
                     {
-                        //SAL_WARN("lok", "Skipping duplicate [" << type << "]: [" << payload << "].");
+                        SAL_INFO("lok", "Skipping duplicate [" << type << "]: [" << payload << "].");
                         continue;
                     }
 
@@ -1230,26 +1229,25 @@ void CallbackFlushHandler::Invoke()
                         // If the state didn't change, it's safe to ignore.
                         if (stateIt->second == payload)
                         {
-                            //SAL_WARN("lok", "Skipping view duplicate [" << type << ',' << viewId << "]: [" << payload << "].");
+                            SAL_INFO("lok", "Skipping view duplicate [" << type << ',' << viewId << "]: [" << payload << "].");
                             continue;
                         }
 
+                        SAL_INFO("lok", "Replacing an element in view states [" << type << ',' << viewId << "]: [" << payload << "].");
                         stateIt->second = payload;
-                        //SAL_WARN("lok", "Replacing an element in view states [" << type << ',' << viewId << "]: [" << payload << "].");
                     }
                     else
                     {
+                        SAL_INFO("lok", "Inserted a new element in view states: [" << type << ',' << viewId << "]: [" << payload << "]");
                         states.emplace(type, payload);
-                        //SAL_WARN("lok", "Inserted a new element in view states: [" << type << ',' << viewId << "]: [" << payload << "]");
+
                     }
                 }
             }
 
-            //SAL_WARN("lok", "Emitting [" << type << "]: [" << payload << "].");
             m_pCallback(type, payload.c_str(), m_pData);
         }
 
-        //SAL_WARN("lok", "Done flushing.");
         m_queue.clear();
     }
 }


More information about the Libreoffice-commits mailing list