[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 10 commits - cui/source drawinglayer/source include/svx sc/source sfx2/uiconfig svx/source sw/inc sw/PythonTest_sw_python.mk sw/qa sw/source vcl/inc vcl/qt5 vcl/unx

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 9 09:59:07 UTC 2020


 cui/source/options/optaboutconfig.cxx                |    4 +
 drawinglayer/source/primitive2d/textlayoutdevice.cxx |   14 ------
 include/svx/ctredlin.hxx                             |    1 
 sc/source/ui/dialogs/searchresults.cxx               |    4 +
 sc/source/ui/miscdlgs/acredlin.cxx                   |    7 +--
 sfx2/uiconfig/ui/autoredactdialog.ui                 |   42 +++++++++---------
 svx/source/dialog/ctredlin.cxx                       |    4 +
 sw/PythonTest_sw_python.mk                           |    1 
 sw/inc/node.hxx                                      |    2 
 sw/qa/python/check_drawpage.py                       |   44 +++++++++++++++++++
 sw/source/core/docnode/ndsect.cxx                    |    3 -
 sw/source/core/docnode/nodes.cxx                     |    7 ++-
 sw/source/core/draw/dcontact.cxx                     |    3 +
 sw/source/core/layout/frmtool.cxx                    |   10 +++-
 sw/source/core/unocore/unodraw.cxx                   |    2 
 sw/source/ui/misc/bookmark.cxx                       |    4 +
 sw/source/uibase/misc/redlndlg.cxx                   |    4 +
 vcl/inc/qt5/Qt5AccessibleWidget.hxx                  |    4 +
 vcl/qt5/Qt5AccessibleWidget.cxx                      |    9 ++-
 vcl/unx/generic/fontmanager/fontconfig.cxx           |    2 
 20 files changed, 119 insertions(+), 52 deletions(-)

New commits:
commit 74ea175e630d6ef42db3a49f6200fe5a022e9baf
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Mon Sep 7 20:08:57 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:58:30 2020 +0200

    tdf#136323 qt5: Remember accessible object
    
    'QAccessibleCache::insert' from the Qt library has a
    'Q_ASSERT' checking that the corresponding 'QObject' for
    which the 'QAccessibleInterface' provides information
    is actually the same as the object passed as a parameter:
    
        QAccessible::Id QAccessibleCache::insert(QObject *object, QAccessibleInterface *iface) const
        {
            // ...
            QObject *obj = iface->object();
    ->      Q_ASSERT(object == obj);
    
    However, 'Qt5AccessibleWidget::object' so far was always returning
    'nullptr', triggering this assert when using a Qt version
    not built with 'QT_NO_DEBUG'.
    
    To fix this, remember and return the object as needed.
    
    Change-Id: I4015b4c37aa8a073b02465df580a7235884e6cf3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102196
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
    (cherry picked from commit 4461d49c6cfce22c2c96185b0a1d07bfe9709268)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102126
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/inc/qt5/Qt5AccessibleWidget.hxx b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
index 6b0d71cba9f5..0f62d2a8a5b8 100644
--- a/vcl/inc/qt5/Qt5AccessibleWidget.hxx
+++ b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
@@ -41,7 +41,8 @@ class VCLPLUG_QT5_PUBLIC Qt5AccessibleWidget : public QObject,
     Q_OBJECT
 
 public:
-    Qt5AccessibleWidget(const css::uno::Reference<css::accessibility::XAccessible> xAccessible);
+    Qt5AccessibleWidget(const css::uno::Reference<css::accessibility::XAccessible> xAccessible,
+                        QObject* pObject);
     QWindow* window() const override;
     int childCount() const override;
     int indexOfChild(const QAccessibleInterface* child) const override;
@@ -137,6 +138,7 @@ public:
 private:
     css::uno::Reference<css::accessibility::XAccessible> m_xAccessible;
     css::uno::Reference<css::accessibility::XAccessibleContext> getAccessibleContextImpl() const;
+    QObject* m_pObject;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx
index 6a828865036e..7136e0823790 100644
--- a/vcl/qt5/Qt5AccessibleWidget.cxx
+++ b/vcl/qt5/Qt5AccessibleWidget.cxx
@@ -58,8 +58,9 @@ using namespace css::accessibility;
 using namespace css::beans;
 using namespace css::uno;
 
-Qt5AccessibleWidget::Qt5AccessibleWidget(const Reference<XAccessible> xAccessible)
+Qt5AccessibleWidget::Qt5AccessibleWidget(const Reference<XAccessible> xAccessible, QObject* pObject)
     : m_xAccessible(xAccessible)
+    , m_pObject(pObject)
 {
     Reference<XAccessibleContext> xContext = xAccessible->getAccessibleContext();
     Reference<XAccessibleEventBroadcaster> xBroadcaster(xContext, UNO_QUERY);
@@ -698,7 +699,7 @@ bool Qt5AccessibleWidget::isValid() const
     return xAc.is();
 }
 
-QObject* Qt5AccessibleWidget::object() const { return nullptr; }
+QObject* Qt5AccessibleWidget::object() const { return m_pObject; }
 
 void Qt5AccessibleWidget::setText(QAccessible::Text /* t */, const QString& /* text */) {}
 
@@ -721,13 +722,13 @@ QAccessibleInterface* Qt5AccessibleWidget::customFactory(const QString& classnam
         vcl::Window* pWindow = pWidget->frame().GetWindow();
 
         if (pWindow)
-            return new Qt5AccessibleWidget(pWindow->GetAccessible());
+            return new Qt5AccessibleWidget(pWindow->GetAccessible(), object);
     }
     if (classname == QLatin1String("Qt5XAccessible") && object)
     {
         Qt5XAccessible* pXAccessible = dynamic_cast<Qt5XAccessible*>(object);
         if (pXAccessible && pXAccessible->m_xAccessible.is())
-            return new Qt5AccessibleWidget(pXAccessible->m_xAccessible);
+            return new Qt5AccessibleWidget(pXAccessible->m_xAccessible, object);
     }
 
     return nullptr;
commit a7edf89360c26c5db755c146193063cbd7792d33
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Sep 4 19:38:52 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:58:25 2020 +0200

    rhbz#1875377 if sort order is equivalent keep order fontconfig presents
    
    there are two fonts in fedora 32/33 for regular Cantarell
    
    /usr/share/fonts/cantarell/Cantarell-Regular.otf
    and
    /usr/share/fonts/cantarell/Cantarell-VF.otf
    
    where VF is the Variable Font version. The Cantarell-Regular
    ones has a CFF table and export to pdf creates a font subset
    that works perfectly fine. The VF one does not have a CFF
    table and the fallback case doesn't work for pdf export.
    
    Both have the same version, use a stable sort to retain
    their relative order that fontconfig presents so we use
    the Cantarell-Regular version we would see if we didn't
    sort by version at all.
    
    Change-Id: I750006b980810fc59e0a152d42ae17f29f46e3b3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101971
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
index 75343a41b771..94bf77a85428 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -212,7 +212,7 @@ FcFontSet* FontCfgWrapper::getFontSet()
         addFontSet( FcSetSystem );
         addFontSet( FcSetApplication );
 
-        ::std::sort(m_pFontSet->fonts,m_pFontSet->fonts+m_pFontSet->nfont,SortFont());
+        std::stable_sort(m_pFontSet->fonts,m_pFontSet->fonts+m_pFontSet->nfont,SortFont());
     }
 
     return m_pFontSet;
commit e63d875ee87728cb5b3f0739072e719b80f64427
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 31 11:47:49 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:58:20 2020 +0200

    Resolves: tdf#136189 don't try and sort until treeview is filled
    
    Change-Id: Ic5ac71d88bab7627e14220912f4b9c935f2f1f26
    
    and...
    
    Related: tdf#136189 don't assert on unsetting non-existing previous sort column
    
    Change-Id: If2330cc83ace9ec0133b99eec8c2f0be3919013e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101710
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    (cherry picked from commit c52ac477beefc46802148033adbca9edb9970ac1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101967
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index a5adf7638c8d..217b0bc5308f 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -181,7 +181,9 @@ IMPL_LINK(CuiAboutConfigTabPage, HeaderBarClick, int, nColumn, void)
     }
     else
     {
-        m_xPrefBox->set_sort_indicator(TRISTATE_INDET, m_xPrefBox->get_sort_column());
+        int nOldSortColumn = m_xPrefBox->get_sort_column();
+        if (nOldSortColumn != -1)
+            m_xPrefBox->set_sort_indicator(TRISTATE_INDET, nOldSortColumn);
         m_xPrefBox->set_sort_column(nColumn);
     }
 
diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index 55462c9dce28..08538bf18b02 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -104,6 +104,7 @@ public:
     void set_size_request(int nWidth, int nHeight);
 
     weld::TreeView& GetWidget() { return *pTreeView; }
+    bool IsSorted() const { return bSorted; }
 
     ~SvxRedlinTable();
 
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx
index 3604e1599a16..e78f91d5b458 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -181,7 +181,9 @@ IMPL_LINK(SearchResultsDlg, HeaderBarClick, int, nColumn, void)
     }
     else
     {
-        mxList->set_sort_indicator(TRISTATE_INDET, mxList->get_sort_column());
+        int nOldSortColumn = mxList->get_sort_column();
+        if (nOldSortColumn != -1)
+            mxList->set_sort_indicator(TRISTATE_INDET, nOldSortColumn);
         mxList->set_sort_column(nColumn);
     }
 
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 15155c6c6edc..f3243e0d1b4c 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -113,7 +113,9 @@ IMPL_LINK(SvxRedlinTable, HeaderBarClick, int, nColumn, void)
     }
     else
     {
-        pTreeView->set_sort_indicator(TRISTATE_INDET, pTreeView->get_sort_column());
+        int nOldSortColumn = pTreeView->get_sort_column();
+        if (nOldSortColumn != -1)
+            pTreeView->set_sort_indicator(TRISTATE_INDET, nOldSortColumn);
         pTreeView->set_sort_column(nColumn);
     }
 
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index f49b15d81d52..cf872d5465f3 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -362,7 +362,9 @@ IMPL_LINK(SwInsertBookmarkDlg, HeaderBarClick, int, nColumn, void)
     }
     else
     {
-        m_xBookmarksBox->set_sort_indicator(TRISTATE_INDET, m_xBookmarksBox->get_sort_column());
+        int nOldSortColumn = m_xBookmarksBox->get_sort_column();
+        if (nOldSortColumn != -1)
+            m_xBookmarksBox->set_sort_indicator(TRISTATE_INDET, nOldSortColumn);
         m_xBookmarksBox->set_sort_column(nColumn);
     }
 
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 1fc7a359bbf6..807fa1633a2e 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -716,6 +716,8 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli
         pCurrRedline = nullptr;
 
     rTreeView.freeze();
+    if (m_pTable->IsSorted())
+        rTreeView.make_unsorted();
     for (SwRedlineTable::size_type i = nStart; i <= nEnd; i++)
     {
         const SwRangeRedline& rRedln = pSh->GetRedline(i);
@@ -762,6 +764,8 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli
         InsertChildren(pRedlineParent, rRedln, bHasRedlineAutoFormat);
     }
     rTreeView.thaw();
+    if (m_pTable->IsSorted())
+        rTreeView.make_sorted();
 }
 
 void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept )
commit fa0c7cef6a712932d0eabc11da33fb52993dd898
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Mon Aug 24 22:18:55 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:58:15 2020 +0200

    tdf#136062 Don't use 'Reject (All)/Clear formatting' buttons in Calc
    
    Since formatting changes are not tracked in Calc
    
    Change-Id: Ib1b50d248f1ba75aad22cd04af86d15cc2813e36
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101293
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 894fddc5edf5aad6fc6d0e18a6c934bfa7f001e4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101453
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 120e696653a25a2560f8c60b08a6a86fda5c10fc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101965

diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 4e08bc7506cf..f68080a336bd 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -109,10 +109,9 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Windo
     pTPFilter = m_xAcceptChgCtr->GetFilterPage();
     pTPView = m_xAcceptChgCtr->GetViewPage();
 
-    // set wider window for the optional extending button labels
-    // eg. "Reject/Clear formatting" instead of "Reject"
-    pTPView->EnableClearFormat(true);
-    pTPView->EnableClearFormatAll(true);
+    // tdf#136062 Don't use "Reject/Clear formatting" instead of "Reject" buttons in Calc
+    pTPView->EnableClearFormat(false);
+    pTPView->EnableClearFormatAll(false);
 
     pTheView = pTPView->GetTableControl();
     pTheView->SetCalcView();
commit 4ad224f396ab04372c46e126d13da15623e4def4
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Wed Aug 19 06:05:46 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:58:09 2020 +0200

    tdf#127471 Remove font width scaling hack
    
    Which causes distorted fonts in certain cases (see bug report).
    
    Fix was suggested by Ilhan Yesil at https://bugs.documentfoundation.org/show_bug.cgi?id=127471#c6
    
    Change-Id: Ie644f56f0835ffad9230f981d2927d6b4c17453d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100970
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit 8891a2fc2a4bf86add68691b7ac167a07a8add84)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101960
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index aa8faeaf47a1..299fea5d90a3 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -409,20 +409,6 @@ namespace drawinglayer
             aRetval.SetPitch(rFontAttribute.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
             aRetval.SetLanguage(LanguageTag::convertToLanguageType( rLocale, false));
 
-#ifdef _WIN32
-            // for WIN32 systems, correct the FontWidth if FontScaling is used
-            if(bFontIsScaled && nHeight > 0)
-            {
-                const FontMetric aUnscaledFontMetric(Application::GetDefaultDevice()->GetFontMetric(aRetval));
-
-                if(aUnscaledFontMetric.GetAverageFontWidth() > 0)
-                {
-                    const double fScaleFactor(static_cast<double>(nWidth) / static_cast<double>(nHeight));
-                    const sal_uInt32 nScaledWidth(basegfx::fround(static_cast<double>(aUnscaledFontMetric.GetAverageFontWidth()) * fScaleFactor));
-                    aRetval.SetAverageFontWidth(nScaledWidth);
-                }
-            }
-#endif
             // handle FontRotation (if defined)
             if(!basegfx::fTools::equalZero(fFontRotation))
             {
commit 14168b9f09a359b3500dd74f504c347b6268470e
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Sep 1 12:51:09 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:58:04 2020 +0200

    tdf#136423 make SwXDrawPage::group work with a single shape
    
    No reason this should not work (and the implementation in Draw/Impress/Calc
    also works this way)
    
    Change-Id: Ic5bc7420e9025b45ed848dccf68b112c0c6c2cd5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101842
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit 3eb5318ed9ae8cf02804fbdc584a5f4b046db0ae)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101956
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/PythonTest_sw_python.mk b/sw/PythonTest_sw_python.mk
index 6e699f5caa1d..2aa3fd01ef77 100644
--- a/sw/PythonTest_sw_python.mk
+++ b/sw/PythonTest_sw_python.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_PythonTest_set_defs,sw_python,\
 $(eval $(call gb_PythonTest_add_modules,sw_python,$(SRCDIR)/sw/qa/python,\
 	check_bookmarks \
 	check_change_color \
+	check_drawpage \
 	check_index \
 	check_flies \
 	check_fields \
diff --git a/sw/qa/python/check_drawpage.py b/sw/qa/python/check_drawpage.py
new file mode 100644
index 000000000000..ef28490ce224
--- /dev/null
+++ b/sw/qa/python/check_drawpage.py
@@ -0,0 +1,44 @@
+#! /usr/bin/env python
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+import unittest
+from org.libreoffice.unotest import UnoInProcess
+
+from com.sun.star.text.TextContentAnchorType import AT_PARAGRAPH
+
+class CheckDrawPage(unittest.TestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls._uno = UnoInProcess()
+        cls._uno.setUp()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls._uno.tearDown()
+
+    """
+    Test that grouping shapes also works with a single shape.
+    """
+    def test_group_single_shape(self):
+        xDoc = self.__class__._uno.openEmptyWriterDoc()
+        page = xDoc.DrawPage
+        collection = self.__class__._uno.xContext.ServiceManager.createInstance( 'com.sun.star.drawing.ShapeCollection' )
+        shape = xDoc.createInstance('com.sun.star.drawing.TextShape')
+        shape.AnchorType = AT_PARAGRAPH
+        page.add(shape)
+        collection.add(shape)
+        shapegroup = page.group(collection)
+
+        self.assertEqual(shapegroup.Count, 1)
+
+        xDoc.close(True)
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index c3d6057c0b39..fed0e4a55d6a 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -752,7 +752,7 @@ uno::Reference< drawing::XShapeGroup >  SwXDrawPage::group(const uno::Reference<
         {
             // mark and return MarkList
             const SdrMarkList& rMarkList = pPage->PreGroup(xShapes);
-            if ( rMarkList.GetMarkCount() > 1 )
+            if ( rMarkList.GetMarkCount() > 0 )
             {
                 for (size_t i = 0; i < rMarkList.GetMarkCount(); ++i)
                 {
commit b012d4105ab3e8390ebba7a1cea1ae78836da450
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Aug 31 17:57:26 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:57:58 2020 +0200

    tdf#135056 sw_redlinehide: when moving sections to undo nodes-array,
    
    ... delete frames with utmost prejudice - the code that was checking
    for empty frames or cells was going into infinite loop because
    first the *outer* section is moved to the undo nodes array, then when
    the *inner* (index header) section is moved, its section node's
    m_pStartOfSection points to the section node that is already in
    undo nodes array and so SwNodes::GoPrevSection() goes very wrong
    and CheckNodesRange() is called with positions in 2 different arrays.
    
    (regression from a60dd9ef1361c5925803acaa5292e99277d1faf3)
    
    Change-Id: I5682ebc2081ffc7dc49a9c43e613f72c26e93673
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101755
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 1d6e919046ed353a9d9d86bb9f0332da2e9dea4d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101683
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 36ce909cb7cf..d12e06d3e950 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -551,7 +551,7 @@ public:
 
     /** Method deletes all views of document for the node. The
      content frames are removed from the respective layout. */
-    void DelFrames(SwRootFrame const* pLayout = nullptr);
+    void DelFrames(SwRootFrame const* pLayout = nullptr, bool bForce = false);
 
     /** Method creates all views of document for the previous node.
        The content frames created are put into the respective layout. */
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 11c6237f5f15..8c2efee0eb7e 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -1156,7 +1156,7 @@ void SwSectionNode::MakeOwnFrames(SwNodeIndex* pIdxBehind, SwNodeIndex* pEndIdx)
     }
 }
 
-void SwSectionNode::DelFrames(SwRootFrame const*const /*FIXME TODO*/)
+void SwSectionNode::DelFrames(SwRootFrame const*const /*FIXME TODO*/, bool const bForce)
 {
     sal_uLong nStt = GetIndex()+1, nEnd = EndOfSectionIndex();
     if( nStt >= nEnd )
@@ -1173,6 +1173,7 @@ void SwSectionNode::DelFrames(SwRootFrame const*const /*FIXME TODO*/)
     // If the Area is within a Fly or TableBox, we can only hide it if
     // there is more Content which has Frames.
     // Or else the Fly/TableBox Frame does not have a Lower!
+    if (!bForce)
     {
         SwNodeIndex aIdx( *this );
         if( !SwNodes::GoPrevSection( &aIdx, true, false ) ||
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 10f4ba61be03..2a2bef4f4488 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -634,7 +634,12 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
 
                     SwSectionNode* pSctNd = pSttNd->GetSectionNode();
                     if( bNewFrames && pSctNd )
-                        pSctNd->DelFrames();
+                    {   // tdf#135056 skip over code in DelFrames() that moves
+                        // SwNodeIndex around because in case of nested
+                        // sections, m_pStartOfSection will point between
+                        // undo nodes-array and doc nodes-array
+                        pSctNd->DelFrames(nullptr, true);
+                    }
 
                     RemoveNode( aRg.aEnd.GetIndex(), 1, false ); // delete EndNode
                     sal_uLong nSttPos = pSttNd->GetIndex();
commit 12cb847c5006c7008bf77b48b18aecd720f4eb10
Author:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
AuthorDate: Thu Jul 23 06:30:04 2020 -0500
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:57:53 2020 +0200

    tdf#130862 Remove wrong size values from individual buttons; use HIG spacing
    
    Change-Id: I2dd1a796d94aa33d4dcbf676d0f66d6d256969bf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99294
    Tested-by: Jenkins
    Reviewed-by: Andreas Kainz <kainz.a at gmail.com>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sfx2/uiconfig/ui/autoredactdialog.ui b/sfx2/uiconfig/ui/autoredactdialog.ui
index e6602d51c40f..9b40e80dc588 100644
--- a/sfx2/uiconfig/ui/autoredactdialog.ui
+++ b/sfx2/uiconfig/ui/autoredactdialog.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.36.0 -->
 <interface domain="sfx">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkTreeStore" id="liststore1">
@@ -24,9 +24,6 @@
     <property name="title" translatable="yes" context="autoredactdialog|AutoRedactDialog">Automatic Redaction</property>
     <property name="modal">True</property>
     <property name="type_hint">dialog</property>
-    <child>
-      <placeholder/>
-    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
@@ -93,6 +90,8 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="hexpand">True</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">12</property>
             <child>
               <object class="GtkScrolledWindow">
                 <property name="visible">True</property>
@@ -214,10 +213,8 @@
               <object class="GtkButtonBox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="margin_left">6</property>
-                <property name="margin_right">6</property>
                 <property name="orientation">vertical</property>
-                <property name="homogeneous">True</property>
+                <property name="spacing">6</property>
                 <property name="layout_style">start</property>
                 <child>
                   <object class="GtkButton" id="btnLoadTargets">
@@ -225,12 +222,10 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
-                    <property name="margin_bottom">1</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
+                    <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="padding">5</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
@@ -242,25 +237,35 @@
                     <property name="receives_default">True</property>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
+                    <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="padding">5</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkSeparator" id="separator">
+                    <property name="visible">True</property>
+                    <property name="sensitive">False</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">2</property>
+                    <property name="non_homogeneous">True</property>
+                  </packing>
+                </child>
                 <child>
                   <object class="GtkButton" id="add">
                     <property name="label" translatable="yes" context="autoredactdialog|add">Add Target</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
-                    <property name="margin_top">6</property>
-                    <property name="margin_bottom">1</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
+                    <property name="fill">True</property>
+                    <property name="position">3</property>
                   </packing>
                 </child>
                 <child>
@@ -269,12 +274,11 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
-                    <property name="margin_bottom">1</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">3</property>
+                    <property name="position">4</property>
                   </packing>
                 </child>
                 <child>
@@ -287,7 +291,7 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">4</property>
+                    <property name="position">5</property>
                   </packing>
                 </child>
               </object>
commit a0ef2e51d7adf86497c08134a95e212bca0d7483
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Aug 31 15:24:48 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:57:47 2020 +0200

    tdf#135661 sw: fix Undo of text deletion of SdrObject
    
    This creates a non-working SwXShape without m_pFormat initialised:
    
    0  SwXShape::SwXShape(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&, SwDoc const*) (this=0x278de80, xShape=uno::Reference to (SvxCustomShape *) 0x73ec840, pDoc=0x0) at sw/source/core/unocore/unodraw.cxx:889
    1  SwFmDrawPage::CreateShape(SdrObject*) const (this=0x637a980, pObj=0x6409410) at sw/source/core/unocore/unodraw.cxx:372
    2  SdrObject::getUnoShape() (this=0x6409410) at svx/source/svdraw/svdobj.cxx:2836
    3  GetXShapeForSdrObject(SdrObject*) (pObj=0x6409410) at svx/source/unodraw/unoshape.cxx:3928
    4  SdrObjCustomShape::GetCustomShapeEngine() const (this=0x6409410) at svx/source/svdraw/svdoashp.cxx:381
    5  SdrObjCustomShape::GetTextBounds(tools::Rectangle&) const (this=0x6409410, rTextBound=...) at svx/source/svdraw/svdoashp.cxx:534
    6  SdrObjCustomShape::AdaptTextMinSize() (this=0x6409410) at svx/source/svdraw/svdoashp.cxx:1397
    7  SdrObjCustomShape::NbcSetSnapRect(tools::Rectangle const&) (this=0x6409410, rRect=...) at svx/source/svdraw/svdoashp.cxx:1421
    8  SdrObjCustomShape::handlePageChange(SdrPage*, SdrPage*) (this=0x6409410, pOldPage=0x0, pNewPage=0x627fc80) at svx/source/svdraw/svdoashp.cxx:2855
    9  SdrObject::setParentOfSdrObject(SdrObjList*) (this=0x6409410, pNewObjList=0x627fc80) at svx/source/svdraw/svdobj.cxx:294
    10 SetParentAtSdrObjectFromSdrObjList(SdrObject&, SdrObjList*) (rSdrObject=..., pNew=0x627fc80) at svx/source/svdraw/svdpage.cxx:65
    11 SdrObjList::NbcInsertObject(SdrObject*, unsigned long) (this=0x627fc80, pObj=0x6409410, nPos=0) at svx/source/svdraw/svdpage.cxx:305
    12 SdrObjList::InsertObject(SdrObject*, unsigned long) (this=0x627fc80, pObj=0x6409410, nPos=0) at svx/source/svdraw/svdpage.cxx:358
    13 FmFormPage::InsertObject(SdrObject*, unsigned long) (this=0x627fc80, pObj=0x6409410, nPos=0) at svx/source/form/fmpage.cxx:79
    14 SwDrawContact::InsertMasterIntoDrawPage() (this=0x640d6b0) at sw/source/core/draw/dcontact.cxx:1909
    15 SwDrawContact::SwClientNotify(SwModify const&, SfxHint const&) (this=0x640d6b0, rMod=..., rHint=...) at sw/source/core/draw/dcontact.cxx:1457
    16 SwModify::CallSwClientNotify(SfxHint const&) const (this=0x640d090, rHint=...) at sw/source/core/attr/calbck.cxx:373
    17 sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const (this=0x640d090, rHint=...) at sw/source/core/attr/calbck.cxx:378
    18 SwUndoFlyBase::InsFly(sw::UndoRedoContext&, bool) (this=0x78cdfd0, rContext=..., bShowSelFrame=false) at sw/source/core/undo/undobj1.cxx:97
    19 SwUndoDelLayFormat::UndoImpl(sw::UndoRedoContext&) (this=0x78cdfd0, rContext=...) at sw/source/core/undo/undobj1.cxx:440
    20 SwHistoryTextFlyCnt::SetInDoc(SwDoc*, bool) (this=0x60d14c0, pDoc=0x625aa30) at sw/source/core/undo/rolbck.cxx:581
    
    Whereas if the shape is selected and deleted that way, a completely
    different Undo is created, which doesn't have this problem:
    
    0  SwXShape::SetFrameFormat(SwFrameFormat*) (this=0x2497d50, pFormat=0x564b470) at sw/inc/unodraw.hxx:206
    1  SwXShape::AddExistingShapeToFormat(SdrObject const&) (_rObj=...) at sw/source/core/unocore/unodraw.cxx:945
    2  SwDrawContact::SwDrawContact(SwFrameFormat*, SdrObject*) (this=0x6bad330, pToRegisterIn=0x564b470, pObj=0x5647880) at sw/source/core/draw/dcontact.cxx:709
    3  SwUndoDrawDelete::UndoImpl(sw::UndoRedoContext&) (this=0x56ebcd0, rContext=...) at sw/source/core/undo/undraw.cxx:501
    
    In SwUndoDelLayFormat, the SdrObject is apparently removed from SdrPage
    and the SwDrawContact remains, whereas in SwUndoDrawDelete, the
    SdrObject remains on SdrPage but is moved to invisible layer, and
    SwDrawContact is destroyed (presumably).
    
    Include obligatory rant why sw has 2 undos doing the same thing here.
    
    (reportedly regression from 2d89b9929e85bede4c72684a12e7508751875f0e
     but probably this can be triggered before, at least since
     91b2325808a75174f284c48c8b8afc118fad74e4)
    
    Change-Id: I4fbb3620bfe1ac07f47e4441625797db7a87cecd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101740
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit a609bc9cc03a0a23c8f20fee808cc6cc2887170d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101681
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 5ffe5728fd49..9d057bcabc7d 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1456,6 +1456,9 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
                 // #i40845# - follow-up of #i35635#
                 // move object to visible layer
                 MoveObjToVisibleLayer(GetMaster());
+                // tdf#135661 InsertMasterIntoDrawPage may have created a new
+                // SwXShape with null m_pFormat; fix that
+                SwXShape::AddExistingShapeToFormat(*GetMaster());
                 break;
             case sw::DrawFrameFormatHintId::PREP_DELETE_FLY:
                 RemoveMasterFromDrawPage();
commit 35219dc787eee11135e81a7169d36a931c4bb271
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Aug 28 22:05:06 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 11:57:42 2020 +0200

    tdf#135001 sw_redlinehide: fix IsShown() for AT_PARA flys
    
    There is one merged text frame from node 102 to node 328 with no
    extents, and of course a shape anchored at node 271 should not be
    visible at all.
    
    This crashes because the shape was removed from the layout during
    CheckParaRedlineMerge() but then moved to the visible heaven layer
    again via sw::AddRemoveFlysAnchoredToFrameStartingAtNode() and the
    layer determines if it's visible as far as Sdr* is concerned;
    it lacks a connection to a SwFrame though.
    
    warn:legacy.osl:3547848:3547848:sw/source/core/layout/paintfrm.cxx:3861: <SwFlyFrame::IsPaint(..)> - paint of drawing object without anchor frame!?
    
    (regression from 6aaae44da382f4bc3eafc287b4a21734b740cf21)
    
    Change-Id: Ia20449b3a7d251f0c049eb979c88df1e80cd7d5f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101584
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 586750da40c5b332d2442ef24ae121795e88e903)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101673
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 7aed05b0bdce..f839d0b946b4 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1052,7 +1052,15 @@ static bool IsShown(sal_uLong const nIndex,
     {
         return false;
     }
-    if (pIter && rAnch.GetAnchorId() != RndStdIds::FLY_AT_PARA)
+    if (rAnch.GetAnchorId() == RndStdIds::FLY_AT_PARA)
+    {
+        return pIter == nullptr // not merged
+            || pIter != pEnd    // at least one char visible in node
+            || !IsSelectFrameAnchoredAtPara(rAnchor,
+                    SwPosition(const_cast<SwTextNode&>(*pFirstNode), 0),
+                    SwPosition(const_cast<SwTextNode&>(*pLastNode), pLastNode->Len()));
+    }
+    if (pIter)
     {
         // note: frames are not sorted by anchor position.
         assert(pEnd);


More information about the Libreoffice-commits mailing list