[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 6 commits - include/osl sw/inc sw/qa sw/source vcl/inc

Mike Kaganski mike.kaganski at collabora.com
Fri Feb 17 13:55:40 UTC 2017


 include/osl/conditn.h                          |    5 ++++-
 include/osl/conditn.hxx                        |   11 ++++++++++-
 sw/inc/SidebarWin.hxx                          |    1 +
 sw/qa/extras/tiledrendering/tiledrendering.cxx |    8 ++++++++
 sw/qa/extras/uiwriter/data/tdf104032.odt       |binary
 sw/qa/extras/uiwriter/uiwriter.cxx             |   19 +++++++++++++++++++
 sw/source/core/docnode/nodes.cxx               |    2 +-
 sw/source/core/ole/ndole.cxx                   |   13 ++++---------
 sw/source/filter/ww8/rtfexportfilter.cxx       |    4 +---
 sw/source/filter/ww8/rtfstringbuffer.cxx       |   15 +++++----------
 sw/source/uibase/docvw/PostItMgr.cxx           |    3 +++
 sw/source/uibase/docvw/SidebarWin.cxx          |   14 ++++++++++----
 vcl/inc/sft.hxx                                |    1 +
 13 files changed, 67 insertions(+), 29 deletions(-)

New commits:
commit bec45bc9f88545ec397c1f11f39f946087ee06fc
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Sat Nov 19 19:20:58 2016 +0300

    tdf#104032: use correct text length
    
    Reviewed-on: https://gerrit.libreoffice.org/30980
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 7c43cba9804e70b23b71783d362401c75f9caa54)
    
    Change-Id: I16e6af179be3d7bee947c4054ae4fa6924b298f0

diff --git a/sw/qa/extras/uiwriter/data/tdf104032.odt b/sw/qa/extras/uiwriter/data/tdf104032.odt
new file mode 100644
index 0000000..535e8ce
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf104032.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 0ba2412..aec74fa 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -217,6 +217,7 @@ public:
     void testCursorWindows();
     void testLandscape();
     void testTdf95699();
+    void testTdf104032();
     void testTdf104425();
     void testTdf104814();
     void testTdf105417();
@@ -331,6 +332,7 @@ public:
     CPPUNIT_TEST(testCursorWindows);
     CPPUNIT_TEST(testLandscape);
     CPPUNIT_TEST(testTdf95699);
+    CPPUNIT_TEST(testTdf104032);
     CPPUNIT_TEST(testTdf104425);
     CPPUNIT_TEST(testTdf104814);
     CPPUNIT_TEST(testTdf105417);
@@ -4075,6 +4077,23 @@ void SwUiWriterTest::testTdf95699()
     CPPUNIT_ASSERT_EQUAL(OUString("vnd.oasis.opendocument.field.FORMCHECKBOX"), pFieldMark->GetFieldname());
 }
 
+void SwUiWriterTest::testTdf104032()
+{
+    // Open the document with FORMCHECKBOX field, select it and copy to clipboard
+    // Go to end of document and paste it, then undo
+    // Previously that asserted in debug build.
+    SwDoc* pDoc = createDoc("tdf104032.odt");
+    sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
+    SwDoc aClipboard;
+    SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+    pWrtShell->SttDoc();
+    pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false);
+    pWrtShell->Copy(&aClipboard);
+    pWrtShell->EndDoc();
+    pWrtShell->Paste(&aClipboard);
+    rUndoManager.Undo();
+}
+
 void SwUiWriterTest::testTdf104425()
 {
     createDoc("tdf104425.odt");
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index e5846b5..1e0b282 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1479,7 +1479,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
         // move the content into the new node
         bool bOneNd = pStt->nNode == pEnd->nNode;
         const sal_Int32 nLen =
-                ( (bOneNd) ? pEnd->nContent.GetIndex() : pSrcNd->Len() )
+                ( (bOneNd) ? std::min(pEnd->nContent.GetIndex(), pSrcNd->Len()) : pSrcNd->Len() )
                 - pStt->nContent.GetIndex();
 
         if( !pEnd->nNode.GetNode().IsContentNode() )
commit 1c08313e1ef7fe3d753634fccdfcda31cc88691e
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Tue Nov 22 17:04:19 2016 -0500

    Lok: invalidate Writer comments correctly
    
    Because notifications to all views were disabled
    (to avoid moving the cursors of everyone when someone
    adds a comment) invalidation was also broken. The
    issue was observed when a comment crossed tile
    boundaries, the other tile was not redrawn.
    
    This forces invalidation so tiles are rendered
    correctly, fixing this regression.
    
    One small issue remains in that invalidating a
    comment only invalidates the text-area and not the
    complete PostIt (specifically, the author and date
    are not invalidated). This means that they can
    still get trimmed when crossing tile boundaries.
    That will be addressed separately, as it was an
    existing issue before the regression this patch
    fixes.
    
    Change-Id: Ic8173e4873d58836883b897f735fc627bb0572ee
    Reviewed-on: https://gerrit.libreoffice.org/31091
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>
    (cherry picked from commit 9d2f30911de2f9d87cebb1a360fabe0bf9c05294)

diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index 579a974..adfb47c 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -119,6 +119,7 @@ class SwSidebarWin : public vcl::Window
         void            ShowAnchorOnly(const Point &aPoint);
         void            ShowNote();
         void            HideNote();
+        void            InvalidateControl();
 
         void            ResetAttributes();
 
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 7b441d6..19a4066 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -1506,6 +1506,14 @@ void SwTiledRenderingTest::testCommentEndTextEdit()
     // of the comment.
     CPPUNIT_ASSERT(!aView1.m_bOwnCursorAtOrigin);
 
+    // Hit enter and expect invalidation.
+    Scheduler::ProcessEventsToIdle();
+    aView1.m_bTilesInvalidated = false;
+    pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
+    pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RETURN);
+    Scheduler::ProcessEventsToIdle();
+    CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
+
     mxComponent->dispose();
     mxComponent.clear();
     comphelper::LibreOfficeKit::setActive(false);
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 0cacd24..625d642 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -742,7 +742,10 @@ void SwPostItMgr::LayoutPostIts()
                                 comphelper::LibreOfficeKit::setTiledPainting(!(*i)->HasChildPathFocus());
                             (*i)->ShowNote();
                             if (!bTiledPainting)
+                            {
                                 comphelper::LibreOfficeKit::setTiledPainting(bTiledPainting);
+                                (*i)->InvalidateControl();
+                            }
                         }
                         else
                         {
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 9d8e7d6..a1a8224 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -1199,10 +1199,7 @@ void SwSidebarWin::ShowNote()
         mpAnchor->setVisible(true);
 
     // Invalidate.
-    mpSidebarTextControl->Push(PushFlags::MAPMODE);
-    lcl_translateTwips(EditWin(), *mpSidebarTextControl, nullptr);
-    mpSidebarTextControl->Invalidate();
-    mpSidebarTextControl->Pop();
+    InvalidateControl();
 }
 
 void SwSidebarWin::HideNote()
@@ -1220,6 +1217,15 @@ void SwSidebarWin::HideNote()
         mpShadow->setVisible(false);
 }
 
+void SwSidebarWin::InvalidateControl()
+{
+    // Invalidate.
+    mpSidebarTextControl->Push(PushFlags::MAPMODE);
+    lcl_translateTwips(EditWin(), *mpSidebarTextControl, nullptr);
+    mpSidebarTextControl->Invalidate();
+    mpSidebarTextControl->Pop();
+}
+
 void SwSidebarWin::ActivatePostIt()
 {
     mrMgr.AssureStdModeAtShell();
commit 9d4177da27650c963caf0a4880dc5ffb8e4468bc
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Thu Nov 24 21:40:01 2016 +0000

    osl::Condition - add deprecated markup. Use std::condition_variable.
    
    Change-Id: Id3488a46b12d41bada2711b135ca955259d6e448
    Reviewed-on: https://gerrit.libreoffice.org/31176
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit ab45b41efe1109e015ecfcb670547d44026e4764)

diff --git a/include/osl/conditn.h b/include/osl/conditn.h
index c008798..d0c56a3 100644
--- a/include/osl/conditn.h
+++ b/include/osl/conditn.h
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #ifndef INCLUDED_OSL_CONDITN_H
 #define INCLUDED_OSL_CONDITN_H
 
@@ -40,6 +39,10 @@ typedef enum {
 } oslConditionResult;
 
 /** Creates a condition.
+
+    @deprecated use C++11's std::condition_variable instead
+                for a more robust and helpful condition.
+
     The condition is in the reset-state.
     @returns 0 if condition could not be created.
 */
diff --git a/include/osl/conditn.hxx b/include/osl/conditn.hxx
index 2e91dd0..bc96e2f 100644
--- a/include/osl/conditn.hxx
+++ b/include/osl/conditn.hxx
@@ -32,6 +32,11 @@
 namespace osl
 {
     /**
+     * A deprecated condition.
+     *
+     * @deprecated use C++11's std::condition_variable instead
+     *             for a more robust and helpful condition.
+     *
      * Warning: the Condition abstraction is inadequate for any
      * situation where there may be multiple threads setting,
      * waiting, and resetting the same condition. It can only be
@@ -50,7 +55,11 @@ namespace osl
             result_timeout = osl_cond_result_timeout
         };
 
-        /* Create a condition.
+        /**
+         * Create a condition.
+         *
+         * @deprecated use C++11's std::condition_variable instead
+         *             for a more robust and helpful condition.
          */
         Condition()
         {
commit b906734764e8bc20e504c521e3097ea3a5c3192a
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Thu Nov 24 11:28:53 2016 +0000

    sw: avoid busy loop waiting for OLE objects to load.
    
    Change-Id: I7f26a88d3dcdb47260eb95f7803702d55f4a9119
    Reviewed-on: https://gerrit.libreoffice.org/31164
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 17320183bdcaca335c339eecbba1b660bcc53c96)

diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 7cb6448..8b6b2081 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -690,15 +690,10 @@ public:
 
     void waitFinished()
     {
-        while(!isFinished() && !mbKilled)
-        {
-            // need to wait until the load in progress is finished.
-            // to do so, Application::Yield() is needed since the execution
-            // here means that the SolarMutex is locked, but the
-            // WorkerThreads need it to be able to continue and finish
-            // the running import
-            Application::Yield();
-        }
+        // need to wait until the load in progress is finished.
+        // WorkerThreads need the SolarMutex to be able to continue
+        // and finish the running import.
+        SolarMutexReleaser aReleaser;
         comphelper::ThreadPool::getSharedOptimalPool().waitUntilDone(mpTag);
     }
 };
commit 48e2fb1c34e6f95ae934f46d12b13712b02ea53c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 23 09:15:14 2016 +0100

    sw: clean up redundant initializers in rtfstringbuffer
    
    Change-Id: Ie4bb6689b3b9bdfcfaab1f1c9320792672fb847a
    Reviewed-on: https://gerrit.libreoffice.org/31107
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit 6920eb20ae271b4f1cdbf574eb4beb8c796fcc6d)

diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx
index 34bdd46..8170723 100644
--- a/sw/source/filter/ww8/rtfexportfilter.cxx
+++ b/sw/source/filter/ww8/rtfexportfilter.cxx
@@ -36,9 +36,7 @@ RtfExportFilter::RtfExportFilter(const uno::Reference< uno::XComponentContext >&
 {
 }
 
-RtfExportFilter::~RtfExportFilter()
-{
-}
+RtfExportFilter::~RtfExportFilter() = default;
 
 sal_Bool RtfExportFilter::filter(const uno::Sequence< beans::PropertyValue >& aDescriptor) throw(uno::RuntimeException, std::exception)
 {
diff --git a/sw/source/filter/ww8/rtfstringbuffer.cxx b/sw/source/filter/ww8/rtfstringbuffer.cxx
index a8394d0..3d7cffc 100644
--- a/sw/source/filter/ww8/rtfstringbuffer.cxx
+++ b/sw/source/filter/ww8/rtfstringbuffer.cxx
@@ -10,15 +10,13 @@
 #include "rtfattributeoutput.hxx"
 
 RtfStringBufferValue::RtfStringBufferValue()
-    : m_aBuffer(),
-      m_pFlyFrameFormat(nullptr),
+    : m_pFlyFrameFormat(nullptr),
       m_pGrfNode(nullptr)
 {
 }
 
 RtfStringBufferValue::RtfStringBufferValue(const SwFlyFrameFormat* pFlyFrameFormat, const SwGrfNode* pGrfNode)
-    : m_aBuffer(),
-      m_pFlyFrameFormat(pFlyFrameFormat),
+    : m_pFlyFrameFormat(pFlyFrameFormat),
       m_pGrfNode(pGrfNode)
 {
 }
@@ -41,10 +39,7 @@ bool RtfStringBufferValue::isGraphic() const
     return m_pFlyFrameFormat != nullptr && m_pGrfNode != nullptr;
 }
 
-RtfStringBuffer::RtfStringBuffer()
-    : m_aValues()
-{
-}
+RtfStringBuffer::RtfStringBuffer() = default;
 
 sal_Int32 RtfStringBuffer::getLength() const
 {
@@ -73,7 +68,7 @@ OString RtfStringBuffer::makeStringAndClear()
 OStringBuffer& RtfStringBuffer::getLastBuffer()
 {
     if (m_aValues.empty() || m_aValues.back().isGraphic())
-        m_aValues.push_back(RtfStringBufferValue());
+        m_aValues.emplace_back(RtfStringBufferValue());
     return m_aValues.back().m_aBuffer;
 }
 
@@ -89,7 +84,7 @@ void RtfStringBuffer::clear()
 
 void RtfStringBuffer::append(const SwFlyFrameFormat* pFlyFrameFormat, const SwGrfNode* pGrfNode)
 {
-    m_aValues.push_back(RtfStringBufferValue(pFlyFrameFormat, pGrfNode));
+    m_aValues.emplace_back(RtfStringBufferValue(pFlyFrameFormat, pGrfNode));
 }
 
 void RtfStringBuffer::appendAndClear(RtfStringBuffer& rBuf)
commit a481971d171a5ee50251ca578284a10324c568af
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Nov 22 22:32:25 2016 -0500

    Fix my windows build.
    
    Change-Id: I0cd6213f58e8b2d3d5950dfbb12e524de2950265
    (cherry picked from commit 7637a20a622d6799ba867bd0122841a393178545)

diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index 5f65488..2efe115 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -50,6 +50,7 @@
 #include <vcl/fontcapabilities.hxx>
 
 #include <vector>
+#include <cstdint>
 
 namespace vcl
 {


More information about the Libreoffice-commits mailing list