[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-2' - 88 commits - avmedia/source chart2/qa chart2/source connectivity/registry connectivity/source cui/source cui/uiconfig dbaccess/source desktop/source distro-configs/Jenkins download.lst external/curl external/libcdr external/libqxp formula/source i18npool/source include/connectivity include/oox include/sfx2 include/vcl officecfg/registry oox/source sc/source sd/qa sd/source sfx2/Library_sfx.mk sfx2/source shell/source solenv/bin sw/qa sw/source sysui/desktop vcl/inc vcl/qt5 vcl/quartz vcl/source vcl/unx writerfilter/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 5 13:47:45 UTC 2019


 avmedia/source/gstreamer/gstplayer.cxx                                    |   84 +
 avmedia/source/gstreamer/gstplayer.hxx                                    |    3 
 chart2/qa/extras/chart2dump/chart2dump.cxx                                |    1 
 chart2/qa/extras/chart2dump/data/tdf118150.xlsx                           |binary
 chart2/qa/extras/chart2dump/reference/axislabeltest/tdf118150.txt         |  216 ++
 chart2/qa/extras/chart2import.cxx                                         |   23 
 chart2/qa/extras/data/pptx/tdf122765.pptx                                 |binary
 chart2/source/view/main/ChartView.cxx                                     |    4 
 connectivity/registry/hsqldb/org/openoffice/Office/DataAccess/Drivers.xcu |    4 
 connectivity/source/commontools/TIndex.cxx                                |    4 
 connectivity/source/commontools/TKey.cxx                                  |    2 
 connectivity/source/drivers/ado/AGroup.cxx                                |    2 
 connectivity/source/drivers/ado/AIndex.cxx                                |    2 
 connectivity/source/drivers/ado/AKey.cxx                                  |    2 
 connectivity/source/drivers/ado/AUser.cxx                                 |    2 
 connectivity/source/drivers/dbase/DIndex.cxx                              |    2 
 cui/source/dialogs/about.cxx                                              |    2 
 cui/source/dialogs/cuicharmap.cxx                                         |    8 
 cui/source/inc/align.hxx                                                  |   12 
 cui/source/tabpages/align.cxx                                             |   48 
 cui/source/tabpages/autocdlg.cxx                                          |    3 
 cui/source/tabpages/transfrm.cxx                                          |    2 
 cui/uiconfig/ui/acorreplacepage.ui                                        |    5 
 dbaccess/source/core/api/TableDeco.cxx                                    |    2 
 dbaccess/source/core/dataaccess/ComponentDefinition.cxx                   |   16 
 dbaccess/source/core/dataaccess/ComponentDefinition.hxx                   |    3 
 dbaccess/source/core/inc/TableDeco.hxx                                    |    7 
 dbaccess/source/ui/misc/singledoccontroller.cxx                           |   12 
 desktop/source/app/cmdlinehelp.cxx                                        |   14 
 distro-configs/Jenkins/linux_clang_dbgutil_64                             |    1 
 distro-configs/Jenkins/linux_gcc_release_64                               |    2 
 download.lst                                                              |    4 
 external/curl/zlib.patch.0                                                |   10 
 external/libcdr/ExternalProject_libcdr.mk                                 |    1 
 external/libqxp/ExternalProject_libqxp.mk                                 |    1 
 formula/source/ui/dlg/formula.cxx                                         |    2 
 i18npool/source/localedata/data/ko_KR.xml                                 |    4 
 include/connectivity/sdbcx/VGroup.hxx                                     |    3 
 include/connectivity/sdbcx/VIndex.hxx                                     |    3 
 include/connectivity/sdbcx/VKey.hxx                                       |    3 
 include/connectivity/sdbcx/VUser.hxx                                      |    3 
 include/oox/drawingml/shape.hxx                                           |    2 
 include/oox/export/drawingml.hxx                                          |    5 
 include/sfx2/charmapcontrol.hxx                                           |    4 
 include/vcl/sysdata.hxx                                                   |    2 
 officecfg/registry/data/org/openoffice/Office/Writer.xcu                  |    3 
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs                |    4 
 oox/source/drawingml/chart/titleconverter.cxx                             |    3 
 oox/source/drawingml/diagram/diagram.cxx                                  |   53 
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx                       |  116 -
 oox/source/drawingml/diagram/layoutatomvisitors.cxx                       |   38 
 oox/source/drawingml/shape.cxx                                            |    9 
 oox/source/export/drawingml.cxx                                           |  324 ++++
 oox/source/shape/ShapeContextHandler.cxx                                  |    8 
 oox/source/token/tokens.txt                                               |    1 
 sc/source/core/tool/interpr4.cxx                                          |   27 
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx                      |   55 
 sd/qa/unit/data/pptx/group.pptx                                           |binary
 sd/qa/unit/data/pptx/smartart-background-drawingml-fallback.pptx          |binary
 sd/qa/unit/data/pptx/smartart-background.pptx                             |binary
 sd/qa/unit/data/pptx/smartart-font-size.pptx                              |binary
 sd/qa/unit/data/pptx/smartart-preserve.pptx                               |binary
 sd/qa/unit/data/pptx/smartart-vertical-block-list.pptx                    |binary
 sd/qa/unit/data/xml/n819614_0.xml                                         |   69 
 sd/qa/unit/export-tests-ooxml1.cxx                                        |    4 
 sd/qa/unit/export-tests-ooxml2.cxx                                        |   71 
 sd/qa/unit/import-tests-smartart.cxx                                      |  317 +++-
 sd/qa/unit/import-tests.cxx                                               |    7 
 sd/source/filter/eppt/epptooxml.hxx                                       |    6 
 sd/source/filter/eppt/pptx-epptooxml.cxx                                  |   14 
 sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx              |  102 -
 sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx          |    2 
 sd/source/ui/view/viewshe3.cxx                                            |    3 
 sfx2/Library_sfx.mk                                                       |    3 
 sfx2/source/appl/sfxhelp.cxx                                              |   47 
 sfx2/source/control/charmapcontrol.cxx                                    |   40 
 sfx2/source/view/viewfrm.cxx                                              |    3 
 shell/source/backends/kde5be/kde5backend.cxx                              |    2 
 solenv/bin/assemble-flatpak.sh                                            |    1 
 sw/qa/extras/htmlimport/data/tdf122789.html                               |    7 
 sw/qa/extras/htmlimport/htmlimport.cxx                                    |   11 
 sw/qa/extras/ooxmlexport/data/tdf123460.docx                              |binary
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx                                |    8 
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx                                |   14 
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx                                |   20 
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                                  |    4 
 sw/qa/extras/uiwriter/data2/tdf125310.fodt                                |   23 
 sw/qa/extras/uiwriter/data2/tdf125310b.fodt                               |   24 
 sw/qa/extras/uiwriter/uiwriter2.cxx                                       |   77 +
 sw/source/core/doc/DocumentRedlineManager.cxx                             |    4 
 sw/source/core/layout/calcmove.cxx                                        |   36 
 sw/source/core/layout/tabfrm.cxx                                          |   38 
 sw/source/filter/html/htmlgrin.cxx                                        |    4 
 sw/source/filter/ww8/docxattributeoutput.cxx                              |   34 
 sw/source/filter/ww8/docxattributeoutput.hxx                              |    3 
 sw/source/filter/ww8/docxsdrexport.cxx                                    |  275 ---
 sw/source/filter/ww8/docxsdrexport.hxx                                    |    5 
 sw/source/filter/ww8/ww8par.cxx                                           |    4 
 sysui/desktop/appstream-appdata/libreoffice-base.appdata.xml              |    1 
 sysui/desktop/appstream-appdata/libreoffice-calc.appdata.xml              |    1 
 sysui/desktop/appstream-appdata/libreoffice-draw.appdata.xml              |    1 
 sysui/desktop/appstream-appdata/libreoffice-impress.appdata.xml           |    1 
 sysui/desktop/appstream-appdata/libreoffice-writer.appdata.xml            |    1 
 vcl/inc/qt5/Qt5AccessibleWidget.hxx                                       |    1 
 vcl/inc/qt5/Qt5FilePicker.hxx                                             |  141 -
 vcl/inc/qt5/Qt5Frame.hxx                                                  |    5 
 vcl/inc/qt5/Qt5Instance.hxx                                               |    7 
 vcl/inc/qt5/Qt5Menu.hxx                                                   |    5 
 vcl/inc/qt5/Qt5Tools.hxx                                                  |    5 
 vcl/qt5/Qt5AccessibleWidget.cxx                                           |  301 ++-
 vcl/qt5/Qt5FilePicker.cxx                                                 |  352 ++--
 vcl/qt5/Qt5Frame.cxx                                                      |  150 +
 vcl/qt5/Qt5Instance.cxx                                                   |  176 ++
 vcl/qt5/Qt5Menu.cxx                                                       |   85 -
 vcl/qt5/Qt5Object.cxx                                                     |   19 
 vcl/qt5/Qt5Tools.cxx                                                      |   20 
 vcl/qt5/Qt5Widget.cxx                                                     |   42 
 vcl/quartz/salgdicommon.cxx                                               |    6 
 vcl/source/gdi/CommonSalLayout.cxx                                        |    8 
 vcl/source/window/menubarwindow.cxx                                       |   40 
 vcl/source/window/menufloatingwindow.cxx                                  |   36 
 vcl/unx/generic/desktopdetect/desktopdetector.cxx                         |   12 
 vcl/unx/gtk/gtkobject.cxx                                                 |    1 
 vcl/unx/gtk/gtksalframe.cxx                                               |   20 
 vcl/unx/gtk3/gtk3gtkframe.cxx                                             |    8 
 vcl/unx/gtk3/gtk3gtkobject.cxx                                            |    8 
 vcl/unx/kde5/KDE5FilePicker.hxx                                           |  152 --
 vcl/unx/kde5/KDE5FilePicker2.cxx                                          |  754 ----------
 vcl/unx/kde5/KDE5SalInstance.cxx                                          |   23 
 vcl/unx/kde5/KDE5SalInstance.hxx                                          |    8 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx                         |   17 
 writerfilter/source/dmapper/DomainMapper_Impl.hxx                         |    4 
 132 files changed, 2834 insertions(+), 2035 deletions(-)

New commits:
commit d93d82de8725031cbe9b47046081328674cbead4
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jun 4 18:01:24 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Jun 5 15:29:00 2019 +0200

    tdf#125685 sw: disregard footnotes in follow table on table split
    
    The first problem here is that the table isn't fully formatted; it fails
    with:
    
    warn:legacy.osl:22975:22975:sw/source/core/layout/tabfrm.cxx:2639: debug assertion: <SwTabFrame::MakeAll()> - format of table lowers suppressed by fix i44910
    
    The situation is that there is a big table split across pages; the first
    line of the table would fit onto the previous page so its follow frame
    moves backward and then the table frame tries to split again.
    
    During SwTabFrame::Split(), all the frames in the table are formatted,
    and at that point a footnote that was on the next page is moved to this
    page.
    
    A nested table frame also splits, such that it fits inside the page...
    but then the split of the outer table fails by 5 twips, because the
    moved footnote has reduced the space available for the outer table.
    
    The footnote is anchored in the inner table's follow frame, which would
    be moved to the next page anyway, taking the footnote with it.
    
    Fix this in lcl_RecalcSplitLine() by checking for footnotes that are
    anchored in the follow frame of the top-level table being split, and
    adding their height to the available space on the page.
    
    Fixing the first problem avoids the crash as well; the crash happens
    since 18765b9fa739337d2d891513f6e2fb7c3ce23b50 and it's rather hard to
    avoid it in a situation where formatting starts at the end and recurses
    into an unformatted table preceding it, which isn't supposed to happen.
    
    Change-Id: I85286583c1c4930468a1c283afc98504cd35bb71
    Reviewed-on: https://gerrit.libreoffice.org/73465
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit e37ffdd118da2d21c5e78e8c7b67252d0d1adc8c)
    Reviewed-on: https://gerrit.libreoffice.org/73536
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 1a28e325e789..75c0c7444d1e 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -47,6 +47,7 @@
 #include <cellfrm.hxx>
 #include <flyfrms.hxx>
 #include <txtfrm.hxx>
+#include <ftnfrm.hxx>
 #include <notxtfrm.hxx>
 #include <htmltbl.hxx>
 #include <sectfrm.hxx>
@@ -711,7 +712,39 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine,
     // #i26945# - include check, if objects fit
     const SwTwips nDistanceToUpperPrtBottom =
         aRectFnSet.BottomDist(rTab.getFrameArea(), aRectFnSet.GetPrtBottom(*rTab.GetUpper()));
-    if ( nDistanceToUpperPrtBottom < 0 || !rTab.DoesObjsFit() )
+    // tdf#125685 ignore footnotes that are anchored in follow-table of this
+    // table - if split is successful they move to the next page/column anyway
+    assert(rTab.GetFollow() == rFollowLine.GetUpper());
+    SwTwips nFollowFootnotes(0);
+    // actually there should always be a boss frame, except if "this" isn't
+    // connected to a page yet; not sure if that can happen
+    if (SwFootnoteBossFrame const*const pBoss = rTab.FindFootnoteBossFrame())
+    {
+        if (SwFootnoteContFrame const*const pCont = pBoss->FindFootnoteCont())
+        {
+            for (SwFootnoteFrame const* pFootnote = static_cast<SwFootnoteFrame const*>(pCont->Lower());
+                 pFootnote != nullptr;
+                 pFootnote = static_cast<SwFootnoteFrame const*>(pFootnote->GetNext()))
+            {
+                SwContentFrame const*const pAnchor = pFootnote->GetRef();
+                SwTabFrame const* pTab = pAnchor->FindTabFrame();
+                if (pTab)
+                {
+                    while (pTab->GetUpper()->IsInTab())
+                    {
+                        pTab = pTab->GetUpper()->FindTabFrame();
+                    }
+                    // TODO currently do this only for top-level tables?
+                    // otherwise would need to check rTab's follow and any upper table's follow?
+                    if (pTab == rTab.GetFollow())
+                    {
+                        nFollowFootnotes += aRectFnSet.GetHeight(pFootnote->getFrameArea());
+                    }
+                }
+            }
+        }
+    }
+    if (nDistanceToUpperPrtBottom + nFollowFootnotes < 0 || !rTab.DoesObjsFit())
         bRet = false;
 
     // 2. Check if each cell in the last line has at least one content frame.
commit ff8b31743305635b968b0a0f21c2778a29c0ce03
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Sun Jun 2 10:00:41 2019 +0800
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Wed Jun 5 14:35:01 2019 +0200

    tdf#107487 fix font fallback for non-BMP characters.
    
    Non-BMP characters use two sal_Unicodes. It is necessary
    to advnace with OUString::iterateCodePoints safely instead of
    nCharPos + 1.
    
    Change-Id: Iea1005f05421b1021a9b3ff611439357d4dcba9e
    Reviewed-on: https://gerrit.libreoffice.org/73326
    Tested-by: Jenkins
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
    (cherry picked from commit 16faad3657fad114aa984f92a14a5f212a2f8ff5)
    Reviewed-on: https://gerrit.libreoffice.org/73537
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 9a638663d1ca..763546346459 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -190,12 +190,14 @@ void GenericSalLayout::SetNeedFallback(ImplLayoutArgs& rArgs, sal_Int32 nCharPos
     //mark all glyphs as missing so the whole thing is rendered with the same
     //font
     sal_Int32 nDone;
-    sal_Int32 nGraphemeStartPos =
-        mxBreak->previousCharacters(rArgs.mrStr, nCharPos + 1, aLocale,
-            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
     sal_Int32 nGraphemeEndPos =
         mxBreak->nextCharacters(rArgs.mrStr, nCharPos, aLocale,
             i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
+    // Safely advance nCharPos in case it is a non-BMP character.
+    rArgs.mrStr.iterateCodePoints(&nCharPos);
+    sal_Int32 nGraphemeStartPos =
+        mxBreak->previousCharacters(rArgs.mrStr, nCharPos, aLocale,
+            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
 
     rArgs.NeedFallback(nGraphemeStartPos, nGraphemeEndPos, bRightToLeft);
 }
commit 60504bffca213f6d5c66d1a2de596c20533b7d9c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 29 15:42:28 2019 +0100
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Wed Jun 5 11:42:15 2019 +0200

    tdf#124694 gtk2 GtkFixed takes the max size of all its children...
    
    as its preferred size, causing it to not clip its child, but try and grow
    instead to match
    
    Change-Id: Ibea269d475a4b35a43b6cab2ab432a830d8ff1ff
    Reviewed-on: https://gerrit.libreoffice.org/73174
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index b162b5c67848..bf87ed3aba21 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -875,6 +875,23 @@ void GtkSalFrame::resizeWindow( long nWidth, long nHeight )
         window_resize(nWidth, nHeight);
 }
 
+// tdf#124694 GtkFixed takes the max size of all its children as its
+// preferred size, causing it to not clip its child, but grow instead.
+
+static void
+ooo_fixed_size_request(GtkWidget*, GtkRequisition* req)
+{
+    req->width = 0;
+    req->height = 0;
+}
+
+static void
+ooo_fixed_class_init(GtkFixedClass *klass)
+{
+    GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+    widget_class->size_request = ooo_fixed_size_request;
+}
+
 /*
  * Always use a sub-class of GtkFixed we can tag for a11y. This allows us to
  * utilize GAIL for the toplevel window and toolkit implementation incl.
@@ -892,7 +909,7 @@ ooo_fixed_get_type()
             sizeof (GtkFixedClass),
             nullptr,      /* base init */
             nullptr,  /* base finalize */
-            nullptr,     /* class init */
+            reinterpret_cast<GClassInitFunc>(ooo_fixed_class_init), /* class init */
             nullptr, /* class finalize */
             nullptr,                      /* class data */
             sizeof (GtkFixed),         /* instance size */
commit cf839dcb09fa117744380d3213cb3cf8d9f363f2
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Jun 3 21:15:18 2019 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Wed Jun 5 11:17:29 2019 +0200

    tdf#122789 sw HTML import: fix handling of images with relative sizes
    
    Relative size should have priority over image size from image headers.
    
    (cherry picked from commit a628c01e783b8970ec6d1a4499f01981c077e607)
    
    Change-Id: I80cce79ff87c7eb359cb292526859435cb85f929
    Reviewed-on: https://gerrit.libreoffice.org/73437
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/sw/qa/extras/htmlimport/data/tdf122789.html b/sw/qa/extras/htmlimport/data/tdf122789.html
new file mode 100644
index 000000000000..7ee6552013c7
--- /dev/null
+++ b/sw/qa/extras/htmlimport/data/tdf122789.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title></title>
+</head>
+<body dir="ltr" lang="en-US"><p><img src="libreoffice.jpg" name="Image1" alt="Pic" align="bottom" width="70%" border="0"/></p>
+</body></html>
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx
index 52a6a7145bc4..dd6281d9b845 100644
--- a/sw/qa/extras/htmlimport/htmlimport.cxx
+++ b/sw/qa/extras/htmlimport/htmlimport.cxx
@@ -349,6 +349,17 @@ DECLARE_HTMLIMPORT_TEST(testImageSize, "image-size.html")
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(aExpected.getHeight()), aSize.Height);
 }
 
+DECLARE_HTMLIMPORT_TEST(testTdf122789, "tdf122789.html")
+{
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+    SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+    const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rFormats.size());
+    // This failed, the image had an absolute size, not a relative one.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(70), rFormats[0]->GetAttrSet().GetFrameSize().GetWidthPercent());
+}
+
 DECLARE_HTMLIMPORT_TEST(testReqIfPageStyle, "reqif-page-style.xhtml")
 {
     // Without the accompanying fix in place, this test would have failed with
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 9527271c2f11..431099fa95f4 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -644,7 +644,9 @@ IMAGE_SETEVENT:
     bool bSetScaleImageMap = false;
     sal_uInt8 nPrcWidth = 0, nPrcHeight = 0;
 
-    if ((!nWidth || !nHeight) && allowAccessLink(*m_xDoc))
+    // bPrcWidth / bPrcHeight means we have a percent size.  If that's not the case and we have no
+    // size from nWidth / nHeight either, then inspect the image header.
+    if ((!bPrcWidth && !nWidth) && (!bPrcHeight && !nHeight) && allowAccessLink(*m_xDoc))
     {
         GraphicDescriptor aDescriptor(aGraphicURL);
         if (aDescriptor.Detect(/*bExtendedInfo=*/true))
commit 4531b32e0b58933179408fcff779aabe659e50a9
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Jun 1 13:28:36 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 4 14:21:52 2019 +0200

    tdf#125576: Empty recent characters in special characters dialog...
    
    ... for bullet customization
    
    Change-Id: Ica66dcc0d3f379886788d426941b98d170444799
    Reviewed-on: https://gerrit.libreoffice.org/73306
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit 7dc6525fddc418359eefa2cd7c7ecbbd1269e8f6)
    Reviewed-on: https://gerrit.libreoffice.org/73310
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 807b772fdbcd..4994582c250c 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -921,8 +921,12 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchCharSelectHdl, SvxShowCharSet*, void)
 
 IMPL_LINK_NOARG(SvxCharacterMap, InsertClickHdl, weld::Button&, void)
 {
-   insertCharToDoc(m_aShowChar.GetText());
-   m_xDialog->response(RET_OK);
+    OUString sChar = m_aShowChar.GetText();
+    insertCharToDoc(sChar);
+    // Need to update recent character list, when OK button does not insert
+    if(!m_xFrame.is())
+        updateRecentCharacterList(sChar, aFont.GetFamilyName());
+    m_xDialog->response(RET_OK);
 }
 
 IMPL_LINK_NOARG(SvxCharacterMap, FavSelectHdl, weld::Button&, void)
commit b6a3d0566628e2d8416708d0410193435a3b8e53
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Sat Jun 1 19:45:53 2019 +0200
Commit:     Katarina Behrens <Katarina.Behrens at cib.de>
CommitDate: Tue Jun 4 10:21:14 2019 +0200

    tdf#125506 tdf#121241: only use rObjectToDevice if needed
    
    Use same logic as in vcl/unx/generic/gdi/gdiimpl.cxx
    
    Reviewed-on: https://gerrit.libreoffice.org/73319
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    (cherry picked from commit 93477d1a963e38e3319013e43835a8ffef200972)
    Reviewed-on: https://gerrit.libreoffice.org/73328
    
    Change-Id: I7a7a8c4b3355f5621ba1603939a3757cd03e7777
    Reviewed-on: https://gerrit.libreoffice.org/73396
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 2e22d6077a2e..aaed9261064d 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -864,8 +864,10 @@ bool AquaSalGraphics::drawPolyLine(
         return false;
 #endif
 
-    // Transform to DeviceCoordinates, get DeviceLineWidth, execute PixelSnapHairline
-    const basegfx::B2DVector aLineWidths(rObjectToDevice * rLineWidths);
+    // need to check/handle LineWidth when ObjectToDevice transformation is used
+    const basegfx::B2DVector aDeviceLineWidths(rObjectToDevice * rLineWidths);
+    const bool bCorrectLineWidth(aDeviceLineWidths.getX() < 1.0 && rLineWidths.getX() >= 1.0);
+    const basegfx::B2DVector aLineWidths(bCorrectLineWidth ? rLineWidths : aDeviceLineWidths);
 
     // #i101491# Aqua does not support B2DLineJoin::NONE; return false to use
     // the fallback (own geometry preparation)
commit 901a356a4e2ce7b598fb600025baa1c09267a2bc
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Mon Jun 3 18:14:31 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Jun 4 00:56:03 2019 +0200

    tdf#120774: in 6.2, restrict workaround to kde4 vclplug only
    
    Fix of tdf#41996 is a workaround of kde4-specific condition and
    has been since disabled on OS X (as tdf#51023). kde5 comes with
    a new implementation of DnD and slide sorter in Impress now
    exhibits exactly the same symptoms as on OS X in tdf#51023
    
    Assuming that in 6.2 kde5 doesn't need this workaround anymore and
    remaining platforms -- gtk[23] and Win -- never had issues with DnD
    in slide sorter, keep it active only for kde4 vclplug.
    
    We can't kill it with fire in its entirety, because kde4 has been
    obsoleted only post-6.2
    
    Change-Id: I1fd8bb9e5142effffbd43f3a8bead417832c808c
    Reviewed-on: https://gerrit.libreoffice.org/73403
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index 4a3b066665b1..2505486e5a8a 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -61,6 +61,7 @@
 #include <sfx2/dispatch.hxx>
 #include <svx/svdpagv.hxx>
 #include <svx/svxids.hrc>
+#include <vcl/svapp.hxx>
 #include <boost/optional.hpp>
 #include <sdmod.hxx>
 
@@ -225,17 +226,12 @@ public:
     MultiSelectionModeHandler (
         SlideSorter& rSlideSorter,
         SelectionFunction& rSelectionFunction,
-#ifndef MACOSX
-        const Point& rMouseModelPosition);
-#else
         const Point& rMouseModelPosition,
-        const sal_uInt32 nEventCode);
-#endif
+        const sal_uInt32 nEventCode,
+        bool bKDE4);
     virtual ~MultiSelectionModeHandler() override;
 
-#ifndef MACOSX
     void Initialize(const sal_uInt32 nEventCode);
-#endif
 
     virtual SelectionFunction::Mode GetMode() const override;
     virtual void Abort() override;
@@ -258,6 +254,7 @@ private:
     bool mbAutoScrollInstalled;
     sal_Int32 mnAnchorIndex;
     sal_Int32 mnSecondIndex;
+    bool mbKDE4;
 
     void UpdateModelPosition (const Point& rMouseModelPosition);
     void UpdateSelection();
@@ -281,18 +278,13 @@ class DragAndDropModeHandler : public SelectionFunction::ModeHandler
 public:
     DragAndDropModeHandler (
         SlideSorter& rSlideSorter,
-#ifndef MACOSX
-        SelectionFunction& rSelectionFunction);
-#else
         SelectionFunction& rSelectionFunction,
         const Point& rMousePosition,
-        vcl::Window* pWindow);
-#endif
+        vcl::Window* pWindow,
+        bool bKDE4);
     virtual ~DragAndDropModeHandler() override;
 
-#ifndef MACOSX
     void Initialize(const Point& rMousePosition, vcl::Window* pWindow);
-#endif
 
     virtual SelectionFunction::Mode GetMode() const override;
     virtual void Abort() override;
@@ -303,6 +295,7 @@ protected:
 
 private:
     std::unique_ptr<DragAndDropContext, o3tl::default_delete<DragAndDropContext>> mpDragAndDropContext;
+    bool mbKDE4;
 };
 
 //===== SelectionFunction =====================================================
@@ -322,6 +315,7 @@ SelectionFunction::SelectionFunction (
       mnShiftKeySelectionAnchor(-1),
       mpModeHandler(new NormalModeHandler(rSlideSorter, *this))
 {
+    mbKDE4 = Application::GetToolkitName() == "kde4";
 }
 
 SelectionFunction::~SelectionFunction()
@@ -684,18 +678,21 @@ void SelectionFunction::SwitchToDragAndDropMode (const Point& rMousePosition)
 {
     if (mpModeHandler->GetMode() != DragAndDropMode)
     {
-#ifndef MACOSX
-        std::shared_ptr<DragAndDropModeHandler> handler(
-            new DragAndDropModeHandler(mrSlideSorter, *this));
-        SwitchMode(handler);
-        // Delayed initialization, only after mpModeHanler is set, otherwise DND initialization
-        // could already trigger DND events, which would recursively trigger this code again,
-        // and without mpModeHandler set it would again try to set a new handler.
-        handler->Initialize(rMousePosition, mpWindow);
-#else
-        SwitchMode(std::shared_ptr<ModeHandler>(
-            new DragAndDropModeHandler(mrSlideSorter, *this, rMousePosition, mpWindow)));
-#endif
+        if (mbKDE4)
+        {
+            std::shared_ptr<DragAndDropModeHandler> handler(
+                new DragAndDropModeHandler(mrSlideSorter, *this, rMousePosition, mpWindow, mbKDE4));
+            SwitchMode(handler);
+            // Delayed initialization, only after mpModeHanler is set, otherwise DND initialization
+            // could already trigger DND events, which would recursively trigger this code again,
+            // and without mpModeHandler set it would again try to set a new handler.
+            handler->Initialize(rMousePosition, mpWindow);
+        }
+        else
+        {
+            SwitchMode(std::shared_ptr<ModeHandler>(
+                new DragAndDropModeHandler(mrSlideSorter, *this, rMousePosition, mpWindow, mbKDE4)));
+        }
     }
 }
 
@@ -704,19 +701,22 @@ void SelectionFunction::SwitchToMultiSelectionMode (
     const sal_uInt32 nEventCode)
 {
     if (mpModeHandler->GetMode() != MultiSelectionMode)
-#ifndef MACOSX
     {
-        std::shared_ptr<MultiSelectionModeHandler> handler(
-            new MultiSelectionModeHandler(mrSlideSorter, *this, rMousePosition));
-        SwitchMode(handler);
-        // Delayed initialization, only after mpModeHanler is set, the handle ctor
-        // is non-trivial, so it could possibly recurse just like the DND handler above.
-        handler->Initialize(nEventCode);
+        if (mbKDE4)
+        {
+            std::shared_ptr<MultiSelectionModeHandler> handler(
+                new MultiSelectionModeHandler(mrSlideSorter, *this, rMousePosition, nEventCode, mbKDE4));
+            SwitchMode(handler);
+            // Delayed initialization, only after mpModeHanler is set, the handle ctor
+            // is non-trivial, so it could possibly recurse just like the DND handler above.
+            handler->Initialize(nEventCode);
+        }
+        else
+        {
+            SwitchMode(std::shared_ptr<ModeHandler>(
+                new MultiSelectionModeHandler(mrSlideSorter, *this, rMousePosition, nEventCode, mbKDE4)));
+        }
     }
-#else
-        SwitchMode(std::shared_ptr<ModeHandler>(
-            new MultiSelectionModeHandler(mrSlideSorter, *this, rMousePosition, nEventCode)));
-#endif
 }
 
 void SelectionFunction::SwitchMode (const std::shared_ptr<ModeHandler>& rpHandler)
@@ -1233,26 +1233,24 @@ void NormalModeHandler::ResetButtonDownLocation()
 MultiSelectionModeHandler::MultiSelectionModeHandler (
     SlideSorter& rSlideSorter,
     SelectionFunction& rSelectionFunction,
-#ifndef MACOSX
-    const Point& rMouseModelPosition)
-#else
     const Point& rMouseModelPosition,
-    const sal_uInt32 nEventCode)
-#endif
+    const sal_uInt32 nEventCode,
+    bool bKDE4)
     : ModeHandler(rSlideSorter, rSelectionFunction, false),
       meSelectionMode(SM_Normal),
       maSecondCorner(rMouseModelPosition),
       maSavedPointer(mrSlideSorter.GetContentWindow()->GetPointer()),
       mbAutoScrollInstalled(false),
       mnAnchorIndex(-1),
-      mnSecondIndex(-1)
+      mnSecondIndex(-1),
+      mbKDE4(bKDE4)
 {
-#ifndef MACOSX
+    if (!mbKDE4)
+        Initialize(nEventCode);
 }
 
 void MultiSelectionModeHandler::Initialize(const sal_uInt32 nEventCode)
 {
-#endif
     const Pointer aSelectionPointer (PointerStyle::Text);
     mrSlideSorter.GetContentWindow()->SetPointer(aSelectionPointer);
     SetSelectionModeFromModifier(nEventCode);
@@ -1461,21 +1459,19 @@ void MultiSelectionModeHandler::UpdateSelection()
 
 DragAndDropModeHandler::DragAndDropModeHandler (
     SlideSorter& rSlideSorter,
-#ifndef MACOSX
-    SelectionFunction& rSelectionFunction)
-#else
     SelectionFunction& rSelectionFunction,
     const Point& rMousePosition,
-    vcl::Window* pWindow)
-#endif
-    : ModeHandler(rSlideSorter, rSelectionFunction, false)
+    vcl::Window* pWindow,
+    bool bKDE4)
+    : ModeHandler(rSlideSorter, rSelectionFunction, false),
+      mbKDE4(bKDE4)
 {
-#ifndef MACOSX
+    if (!mbKDE4)
+        Initialize(rMousePosition, pWindow);
 }
 
 void DragAndDropModeHandler::Initialize(const Point& rMousePosition, vcl::Window* pWindow)
 {
-#endif
     SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag;
     if (pDragTransferable==nullptr && mrSlideSorter.GetViewShell() != nullptr)
     {
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx
index 9516e3d60bdb..0d6e03f0a02c 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx
@@ -116,6 +116,8 @@ private:
     */
     std::shared_ptr<ModeHandler> mpModeHandler;
 
+    bool mbKDE4;
+
     /** Make the slide nOffset slides away of the current one the new
         current slide.  When the new index is outside the range of valid
         page numbers it is clipped to that range.
commit e8eb9cf446ea6525284749f78fce6623170cb39b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Feb 19 10:18:16 2019 +0000
Commit:     Katarina Behrens <Katarina.Behrens at cib.de>
CommitDate: Mon Jun 3 22:28:40 2019 +0200

    gst 0.10 doesn't have gst_video_overlay_set_render_rectangle
    
    Change-Id: I499e32ce86fabd18c52ac2f99713af0933572f7c
    (cherry picked from commit abd6f2a38506f512d4846cf43a9fc9576d96ceb3)
    Reviewed-on: https://gerrit.libreoffice.org/73395
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index fb2193b3f67d..e900ed96ba47 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -515,9 +515,10 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
             if ( mnWindowID != 0 )
             {
                 gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID );
-
+#ifndef AVMEDIA_GST_0_10
                 if (maArea.Width > 0 && maArea.Height > 0)
                     gst_video_overlay_set_render_rectangle(mpXOverlay, maArea.X, maArea.Y, maArea.Width, maArea.Height);
+#endif
             }
 
             return GST_BUS_DROP;
commit 0b904a8b3ceb648cf6466cb33f07310a3c70f793
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Thu May 30 23:41:10 2019 +0200
Commit:     Katarina Behrens <Katarina.Behrens at cib.de>
CommitDate: Mon Jun 3 18:12:45 2019 +0200

    tdf#122200 Qt5AccessibleWidget: Handle special offset values
    
    Handle special values for offset in 'Qt5AccessibleWidget::attributes'
    the same way that the base class's 'QAccessibleTextWidget::attributes'
    does, s. [1].
    
    In particular, an offset matching the text length can
    be passed e.g. by "accerciser" or screen readers,
    which previously resulted in an 'IndexOutOfBoundsException'
    being thrown when the index was later checked in the
    call to 'VCLXAccessibleStatusBarItem::getCharacterAttributes'.
    
    See also 'IAccessibleText::attributes' documentation at [2] and
    the page on special offset values referenced there [3].
    
    [1] https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/accessible/qaccessiblewidgets.cpp?h=5.12.4#n791
    [2] https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/interface_i_accessible_text.html#a29e5c8f69ec13c683ed6bca53333e6a5
    [3] https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/_general_info.html#_specialOffsets
    
    Change-Id: I623995aeb689b31c5b49fb3ace8e4dd4c18927d2
    Reviewed-on: https://gerrit.libreoffice.org/73225
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit 93c81657c6111b4bb97a2bb9ec155465f9a6f523)
    Reviewed-on: https://gerrit.libreoffice.org/73379

diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx
index b76acb4a1c57..e2cc0a31765c 100644
--- a/vcl/qt5/Qt5AccessibleWidget.cxx
+++ b/vcl/qt5/Qt5AccessibleWidget.cxx
@@ -830,6 +830,22 @@ QString Qt5AccessibleWidget::attributes(int offset, int* startOffset, int* endOf
     if (!xText.is())
         return QString();
 
+    // handle special values for offset the same way base class's QAccessibleTextWidget::attributes does
+    // (as defined in IAccessible 2: -1 -> length, -2 -> cursor position)
+    if (offset == -2)
+        offset = cursorPosition(); // currently always returns 0
+
+    const int nTextLength = characterCount();
+    if (offset == -1 || offset == nTextLength)
+        offset = nTextLength - 1;
+
+    if (offset < 0 || offset > nTextLength)
+    {
+        *startOffset = -1;
+        *endOffset = -1;
+        return QString();
+    }
+
     Sequence<PropertyValue> attribs = xText->getCharacterAttributes(offset, Sequence<OUString>());
     const PropertyValue* pValues = attribs.getConstArray();
     OUString aRet;
commit 55e531de9c1fecc73b8a42e18dda34aa4de02f8b
Author:     Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
AuthorDate: Thu May 30 13:29:08 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Jun 3 14:15:55 2019 +0200

    SmartArt: more constraints used in linear algorithm
    
    * both width and height of children and space is taken from constraints
    * better handling of space between children (not lost in some cases)
    * children centered in the other axis
    
    Change-Id: I25b8360790de0292b2b5c313dfa55e58dc042193
    Reviewed-on: https://gerrit.libreoffice.org/73201
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/73259

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index e27c573b3d28..d7d6fda1e1e0 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -788,7 +788,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             const sal_Int32 nIncY = nDir==XML_fromT ? 1 : (nDir==XML_fromB ? -1 : 0);
 
             sal_Int32 nCount = rShape->getChildren().size();
-            double fSpace = 0.3;
+
+            awt::Size aSpaceSize;
 
             // Find out which constraint is relevant for which (internal) name.
             LayoutPropertyMap aProperties;
@@ -800,17 +801,25 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
                 LayoutProperty& rProperty = aProperties[rConstraint.msForName];
                 if (rConstraint.mnType == XML_w)
                     rProperty[XML_w] = rShape->getSize().Width * rConstraint.mfFactor;
+                if (rConstraint.mnType == XML_h)
+                    rProperty[XML_h] = rShape->getSize().Height * rConstraint.mfFactor;
 
                 // TODO: get values from differently named constraints as well
-                if (rConstraint.msForName == "sibTrans" && rConstraint.mnType == XML_w)
-                    fSpace = rConstraint.mfFactor;
+                if (rConstraint.msForName == "sp" || rConstraint.msForName == "space" || rConstraint.msForName == "sibTrans")
+                {
+                    if (rConstraint.mnType == XML_w)
+                        aSpaceSize.Width = rShape->getSize().Width * rConstraint.mfFactor;
+                    if (rConstraint.mnType == XML_h)
+                        aSpaceSize.Height = rShape->getSize().Height * rConstraint.mfFactor;
+                }
             }
 
+            // first approximation of children size
             awt::Size aChildSize = rShape->getSize();
             if (nDir == XML_fromL || nDir == XML_fromR)
-                aChildSize.Width /= (nCount + (nCount-1)*fSpace);
+                aChildSize.Width /= nCount;
             else if (nDir == XML_fromT || nDir == XML_fromB)
-                aChildSize.Height /= (nCount + (nCount-1)*fSpace);
+                aChildSize.Height /= nCount;
 
             awt::Point aCurrPos(0, 0);
             if (nIncX == -1)
@@ -820,51 +829,58 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
 
             // See if children requested more than 100% space in total: scale
             // down in that case.
-            sal_Int32 nTotalWidth = 0;
-            bool bSpaceFromConstraints = false;
+            awt::Size aTotalSize;
             for (auto & aCurrShape : rShape->getChildren())
             {
-                oox::OptValue<sal_Int32> oWidth
-                    = findProperty(aProperties, aCurrShape->getInternalName(), XML_w);
-
+                oox::OptValue<sal_Int32> oWidth = findProperty(aProperties, aCurrShape->getInternalName(), XML_w);
+                oox::OptValue<sal_Int32> oHeight = findProperty(aProperties, aCurrShape->getInternalName(), XML_h);
                 awt::Size aSize = aChildSize;
                 if (oWidth.has())
-                {
                     aSize.Width = oWidth.get();
-                    bSpaceFromConstraints = true;
-                }
-                if (nDir == XML_fromL || nDir == XML_fromR)
-                    nTotalWidth += aSize.Width;
+                if (oHeight.has())
+                    aSize.Height = oHeight.get();
+                aTotalSize.Width += aSize.Width;
+                aTotalSize.Height += aSize.Height;
             }
 
-            double fWidthScale = 1.0;
-            if (nTotalWidth > rShape->getSize().Width && nTotalWidth)
-            {
-                fWidthScale = rShape->getSize().Width;
-                fWidthScale /= nTotalWidth;
-            }
+            aTotalSize.Width += (nCount-1) * aSpaceSize.Width;
+            aTotalSize.Height += (nCount-1) * aSpaceSize.Height;
 
-            // Don't add automatic space if we take space from constraints.
-            if (bSpaceFromConstraints)
-                fSpace = 0;
+            double fWidthScale = 1.0;
+            double fHeightScale = 1.0;
+            if (nIncX && aTotalSize.Width > rShape->getSize().Width)
+                fWidthScale = static_cast<double>(rShape->getSize().Width) / aTotalSize.Width;
+            if (nIncY && aTotalSize.Height > rShape->getSize().Height)
+                fHeightScale = static_cast<double>(rShape->getSize().Height) / aTotalSize.Height;
+            aSpaceSize.Width *= fWidthScale;
+            aSpaceSize.Height *= fHeightScale;
 
             for (auto& aCurrShape : rShape->getChildren())
             {
                 // Extract properties relevant for this shape from constraints.
-                oox::OptValue<sal_Int32> oWidth
-                    = findProperty(aProperties, aCurrShape->getInternalName(), XML_w);
-
-                aCurrShape->setPosition(aCurrPos);
+                oox::OptValue<sal_Int32> oWidth = findProperty(aProperties, aCurrShape->getInternalName(), XML_w);
+                oox::OptValue<sal_Int32> oHeight = findProperty(aProperties, aCurrShape->getInternalName(), XML_h);
 
                 awt::Size aSize = aChildSize;
                 if (oWidth.has())
                     aSize.Width = oWidth.get();
+                if (oHeight.has())
+                    aSize.Height = oHeight.get();
                 aSize.Width *= fWidthScale;
+                aSize.Height *= fHeightScale;
                 aCurrShape->setSize(aSize);
-
                 aCurrShape->setChildSize(aSize);
-                aCurrPos.X += nIncX * (aSize.Width + fSpace*aSize.Width);
-                aCurrPos.Y += nIncY * (aChildSize.Height + fSpace*aChildSize.Height);
+
+                // center in the other axis - probably some parameter controls it
+                if (nIncX)
+                    aCurrPos.Y = (rShape->getSize().Height - aSize.Height) / 2;
+                if (nIncY)
+                    aCurrPos.X = (rShape->getSize().Width - aSize.Width) / 2;
+
+                aCurrShape->setPosition(aCurrPos);
+
+                aCurrPos.X += nIncX * (aSize.Width + aSpaceSize.Width);
+                aCurrPos.Y += nIncY * (aSize.Height + aSpaceSize.Height);
             }
             break;
         }
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index ea83eb74a782..5a0cd7679ea1 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -1054,9 +1054,9 @@ void SdImportTestSmartArt::testVerticalBlockList()
 
     // BC shape is rotated 90*, so width and height is swapped
     CPPUNIT_ASSERT_GREATER(xShapeA->getSize().Width, xShapeBC->getSize().Height);
-    CPPUNIT_ASSERT_LESSEQUAL(xShapeA->getSize().Height, xShapeBC->getSize().Width);
+    CPPUNIT_ASSERT_LESS(xShapeA->getSize().Height, xShapeBC->getSize().Width);
     CPPUNIT_ASSERT_GREATER(xShapeA->getPosition().X, xShapeBC->getPosition().X);
-    CPPUNIT_ASSERT_GREATEREQUAL(xShapeA->getPosition().Y, xShapeBC->getPosition().Y);
+    CPPUNIT_ASSERT_GREATER(xShapeA->getPosition().Y, xShapeBC->getPosition().Y);
 
     uno::Reference<drawing::XShapes> xGroup3(xGroup->getByIndex(3), uno::UNO_QUERY);
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xGroup3->getCount());
@@ -1067,7 +1067,11 @@ void SdImportTestSmartArt::testVerticalBlockList()
     CPPUNIT_ASSERT_EQUAL(xShapeA->getSize().Width, xShapeEmpty->getSize().Width);
     CPPUNIT_ASSERT_EQUAL(xShapeA->getSize().Height, xShapeEmpty->getSize().Height);
     CPPUNIT_ASSERT_EQUAL(xShapeA->getPosition().X, xShapeEmpty->getPosition().X);
-    CPPUNIT_ASSERT_GREATEREQUAL(xShapeA->getPosition().Y + 2*xShapeA->getSize().Height, xShapeEmpty->getPosition().Y);
+    CPPUNIT_ASSERT_GREATER(xShapeA->getPosition().Y + 2*xShapeA->getSize().Height, xShapeEmpty->getPosition().Y);
+
+    uno::Reference<drawing::XShape> xGroupShape(xGroup, uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(xGroupShape->getPosition().Y + xGroupShape->getSize().Height,
+                         xShapeEmpty->getPosition().Y + xShapeEmpty->getSize().Height);
 
     xDocShRef->DoClose();
 }
commit 83d101158ef3726d005ae7bd47437ab22ad2a036
Author:     Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
AuthorDate: Tue May 28 17:37:19 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Jun 3 14:15:38 2019 +0200

    SmartArt: keep parent constraints instead of merging every time
    
    currently for every node we were additionaly loading constraints from
    parent node, merging them and then deleting
    it makes more sense just to keep already loaded constraints from parent node
    
    Change-Id: I3fcd669547f24eeeac0b77876950ff7436bd5cb3
    Reviewed-on: https://gerrit.libreoffice.org/73116
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/73258

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 808960093f29..e27c573b3d28 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -499,24 +499,8 @@ void AlgAtom::accept( LayoutAtomVisitor& rVisitor )
 }
 
 void AlgAtom::layoutShape( const ShapePtr& rShape,
-                           const std::vector<Constraint>& rOwnConstraints )
+                           const std::vector<Constraint>& rConstraints )
 {
-    // Algorithm result may depend on the parent constraints as well.
-    std::vector<Constraint> aMergedConstraints;
-    const LayoutNode* pParent = getLayoutNode().getParentLayoutNode();
-    if (pParent)
-    {
-        for (const auto& pChild : pParent->getChildren())
-        {
-            auto pConstraintAtom = dynamic_cast<ConstraintAtom*>(pChild.get());
-            if (pConstraintAtom)
-                pConstraintAtom->parseConstraint(aMergedConstraints, /*bRequireForName=*/true);
-        }
-    }
-    aMergedConstraints.insert(aMergedConstraints.end(), rOwnConstraints.begin(),
-                              rOwnConstraints.end());
-    const std::vector<Constraint>& rConstraints = aMergedConstraints;
-
     switch(mnType)
     {
         case XML_composite:
@@ -629,7 +613,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             {
                 // There is no shape type "conn", replace it by an arrow based
                 // on the direction of the parent linear layout.
-                sal_Int32 nType = getConnectorType(pParent);
+                sal_Int32 nType = getConnectorType(getLayoutNode().getParentLayoutNode());
 
                 rShape->setSubType(nType);
                 rShape->getCustomShapeProperties()->setShapePresetType(nType);
@@ -759,7 +743,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             sal_Int32 nXOffset = 0;
             double fWidthScale = 1.0;
             if (mnType == XML_hierChild)
-                calculateHierChildOffsetScale(rShape, pParent, nXOffset, fWidthScale);
+                calculateHierChildOffsetScale(rShape, getLayoutNode().getParentLayoutNode(), nXOffset, fWidthScale);
 
             awt::Size aChildSize = rShape->getSize();
             if (nDir == XML_fromT)
diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx
index 602130b6b3e3..4e1a3689e3e4 100644
--- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx
+++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx
@@ -291,14 +291,18 @@ void ShapeLayoutingVisitor::visit(LayoutNode& rAtom)
     if (meLookFor != LAYOUT_NODE)
         return;
 
+    size_t nParentConstraintsNumber = maConstraints.size();
+
     // process alg atoms first, nested layout nodes afterwards
     meLookFor = CONSTRAINT;
     defaultVisit(rAtom);
     meLookFor = ALGORITHM;
     defaultVisit(rAtom);
-    maConstraints.clear();
     meLookFor = LAYOUT_NODE;
     defaultVisit(rAtom);
+
+    // delete added constraints, keep parent constraints
+    maConstraints.erase(maConstraints.begin() + nParentConstraintsNumber, maConstraints.end());
 }
 
 void ShapeLayoutingVisitor::visit(ShapeAtom& /*rAtom*/)
commit 8fce4133bd427351ac269c50e02e305d9eb34321
Author:     Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
AuthorDate: Tue May 28 13:36:59 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Jun 3 09:48:49 2019 +0200

    SmartArt: sort shapes by Z order after layout algorithms
    
    so that they are laid out in correct order
    
    Change-Id: I82baa61311197880654d09f356decc666e6fa4c7
    Reviewed-on: https://gerrit.libreoffice.org/73094
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/73255

diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index 8efefe139dbf..be49c85d40aa 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -134,6 +134,46 @@ static sal_Int32 calcDepth( const OUString& rNodeName,
     return 0;
 }
 
+static void sortChildrenByZOrder(const ShapePtr& pShape)
+{
+    std::vector<ShapePtr>& rChildren = pShape->getChildren();
+
+    // Offset the children from their default z-order stacking, if necessary.
+    for (size_t i = 0; i < rChildren.size(); ++i)
+        rChildren[i]->setZOrder(i);
+
+    for (size_t i = 0; i < rChildren.size(); ++i)
+    {
+        const ShapePtr& pChild = rChildren[i];
+        sal_Int32 nZOrderOff = pChild->getZOrderOff();
+        if (nZOrderOff <= 0)
+            continue;
+
+        // Increase my ZOrder by nZOrderOff.
+        pChild->setZOrder(pChild->getZOrder() + nZOrderOff);
+        pChild->setZOrderOff(0);
+
+        for (sal_Int32 j = 0; j < nZOrderOff; ++j)
+        {
+            size_t nIndex = i + j + 1;
+            if (nIndex >= rChildren.size())
+                break;
+
+            // Decrease the ZOrder of the next nZOrderOff elements by one.
+            const ShapePtr& pNext = rChildren[nIndex];
+            pNext->setZOrder(pNext->getZOrder() - 1);
+        }
+    }
+
+    // Now that the ZOrders are adjusted, sort the children.
+    std::sort(rChildren.begin(), rChildren.end(),
+              [](const ShapePtr& a, const ShapePtr& b) { return a->getZOrder() < b->getZOrder(); });
+
+    // Apply also for children.
+    for (auto& rChild : rChildren)
+        sortChildrenByZOrder(rChild);
+}
+
 void Diagram::build(  )
 {
     // build name-object maps
@@ -317,6 +357,8 @@ void Diagram::addTo( const ShapePtr & pParentShape )
         // layout shapes - now all shapes are created
         ShapeLayoutingVisitor aLayoutingVisitor;
         mpLayout->getNode()->accept(aLayoutingVisitor);
+
+        sortChildrenByZOrder(pParentShape);
     }
 
     ShapePtr pBackground(new Shape("com.sun.star.drawing.CustomShape"));
diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx
index a45317f9ffe4..602130b6b3e3 100644
--- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx
+++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx
@@ -187,38 +187,6 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
         std::remove_if(pCurrParent->getChildren().begin(), pCurrParent->getChildren().end(),
             [] (const ShapePtr & aChild) { return aChild->getServiceName() == "com.sun.star.drawing.GroupShape" && aChild->getChildren().empty(); }),
         pCurrParent->getChildren().end());
-
-    // Offset the children from their default z-order stacking, if necessary.
-    std::vector<ShapePtr>& rChildren = pCurrParent->getChildren();
-    for (size_t i = 0; i < rChildren.size(); ++i)
-        rChildren[i]->setZOrder(i);
-
-    for (size_t i = 0; i < rChildren.size(); ++i)
-    {
-        const ShapePtr& pChild = rChildren[i];
-        sal_Int32 nZOrderOff = pChild->getZOrderOff();
-        if (nZOrderOff <= 0)
-            continue;
-
-        // Increase my ZOrder by nZOrderOff.
-        pChild->setZOrder(pChild->getZOrder() + nZOrderOff);
-        pChild->setZOrderOff(0);
-
-        for (sal_Int32 j = 0; j < nZOrderOff; ++j)
-        {
-            size_t nIndex = i + j + 1;
-            if (nIndex >= rChildren.size())
-                break;
-
-            // Decrease the ZOrder of the next nZOrderOff elements by one.
-            const ShapePtr& pNext = rChildren[nIndex];
-            pNext->setZOrder(pNext->getZOrder() - 1);
-        }
-    }
-
-    // Now that the ZOrders are adjusted, sort the children.
-    std::sort(rChildren.begin(), rChildren.end(),
-              [](const ShapePtr& a, const ShapePtr& b) { return a->getZOrder() < b->getZOrder(); });
 }
 
 void ShapeCreationVisitor::visit(ShapeAtom& /*rAtom*/)
diff --git a/sd/qa/unit/data/pptx/smartart-vertical-block-list.pptx b/sd/qa/unit/data/pptx/smartart-vertical-block-list.pptx
new file mode 100644
index 000000000000..923f03c0ee23
Binary files /dev/null and b/sd/qa/unit/data/pptx/smartart-vertical-block-list.pptx differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 624205c5380a..ea83eb74a782 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -74,6 +74,7 @@ public:
     void testBackground();
     void testBackgroundDrawingmlFallback();
     void testFontSize();
+    void testVerticalBlockList();
 
     CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
 
@@ -110,6 +111,7 @@ public:
     CPPUNIT_TEST(testBackground);
     CPPUNIT_TEST(testBackgroundDrawingmlFallback);
     CPPUNIT_TEST(testFontSize);
+    CPPUNIT_TEST(testVerticalBlockList);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -1031,6 +1033,45 @@ void SdImportTestSmartArt::testFontSize()
     xDocShRef->DoClose();
 }
 
+void SdImportTestSmartArt::testVerticalBlockList()
+{
+    sd::DrawDocShellRef xDocShRef = loadURL(
+        m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-vertical-block-list.pptx"), PPTX);
+    uno::Reference<drawing::XShapes> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xGroup.is());
+
+    uno::Reference<drawing::XShapes> xGroup1(xGroup->getByIndex(1), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xGroup1->getCount());
+    uno::Reference<drawing::XShape> xShapeA(xGroup1->getByIndex(1), uno::UNO_QUERY);
+    uno::Reference<drawing::XShape> xShapeBC(xGroup1->getByIndex(0), uno::UNO_QUERY);
+    uno::Reference<text::XText> xTextA(xShapeA, uno::UNO_QUERY);
+    uno::Reference<text::XText> xTextBC(xShapeBC, uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("a"), xTextA->getString());
+    CPPUNIT_ASSERT_EQUAL(OUString("b\nc"), xTextBC->getString());
+
+    uno::Reference<beans::XPropertySet> xPropSetBC(xShapeBC, uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(27000), xPropSetBC->getPropertyValue("RotateAngle").get<sal_Int32>());
+
+    // BC shape is rotated 90*, so width and height is swapped
+    CPPUNIT_ASSERT_GREATER(xShapeA->getSize().Width, xShapeBC->getSize().Height);
+    CPPUNIT_ASSERT_LESSEQUAL(xShapeA->getSize().Height, xShapeBC->getSize().Width);
+    CPPUNIT_ASSERT_GREATER(xShapeA->getPosition().X, xShapeBC->getPosition().X);
+    CPPUNIT_ASSERT_GREATEREQUAL(xShapeA->getPosition().Y, xShapeBC->getPosition().Y);
+
+    uno::Reference<drawing::XShapes> xGroup3(xGroup->getByIndex(3), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xGroup3->getCount());
+    uno::Reference<drawing::XShape> xShapeEmpty(xGroup3->getByIndex(0), uno::UNO_QUERY);
+    uno::Reference<text::XText> xTextEmpty(xShapeEmpty, uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("empty"), xTextEmpty->getString());
+
+    CPPUNIT_ASSERT_EQUAL(xShapeA->getSize().Width, xShapeEmpty->getSize().Width);
+    CPPUNIT_ASSERT_EQUAL(xShapeA->getSize().Height, xShapeEmpty->getSize().Height);
+    CPPUNIT_ASSERT_EQUAL(xShapeA->getPosition().X, xShapeEmpty->getPosition().X);
+    CPPUNIT_ASSERT_GREATEREQUAL(xShapeA->getPosition().Y + 2*xShapeA->getSize().Height, xShapeEmpty->getPosition().Y);
+
+    xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 9b4cb15e41618fb1943c6c2cb150582dccc5c96c
Author:     Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
AuthorDate: Mon May 27 20:00:42 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Jun 3 09:48:01 2019 +0200

    SmartArt: adjust text size to fit shapes
    
    up to maximal size of primFontSz constraint.
    Do not override text size changed by user.
    
    Change-Id: If7ea6bbb96cb839831d877edc274a1b0eefdaf21
    Reviewed-on: https://gerrit.libreoffice.org/73050
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/73251

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index bc30ec38e219..808960093f29 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -31,6 +31,7 @@
 #include <drawingml/textrun.hxx>
 #include <drawingml/customshapeproperties.hxx>
 #include <tools/gen.hxx>
+#include <com/sun/star/drawing/TextFitToSizeType.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -1105,6 +1106,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             // adjust text alignment
 
             // Parse constraints, only self margins as a start.
+            double fFontSize = 0;
             for (const auto& rConstr : rConstraints)
             {
                 if (rConstr.mnRefType == XML_w)
@@ -1124,9 +1126,10 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
 
                     rShape->getShapeProperties().setProperty(nProperty, nValue);
                 }
+                if (rConstr.mnType == XML_primFontSz)
+                    fFontSize = rConstr.mfValue;
             }
 
-            // TODO: adjust text size to fit shape
             TextBodyPtr pTextBody = rShape->getTextBody();
             if (!pTextBody ||
                 pTextBody->getParagraphs().empty() ||
@@ -1135,6 +1138,17 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
                 break;
             }
 
+            // adjust text size to fit shape
+            if (fFontSize != 0)
+            {
+                for (auto& aParagraph : pTextBody->getParagraphs())
+                    for (auto& aRun : aParagraph->getRuns())
+                        if (!aRun->getTextCharacterProperties().moHeight.has())
+                            aRun->getTextCharacterProperties().moHeight = fFontSize * 100;
+            }
+            pTextBody->getTextProperties().maPropertyMap.setProperty(PROP_TextFitToSize, drawing::TextFitToSizeType_AUTOFIT);
+
+            // ECMA-376-1:2016 21.4.7.5 ST_AutoTextRotation (Auto Text Rotation)
             const sal_Int32 nautoTxRot = maMap.count(XML_autoTxRot) ? maMap.find(XML_autoTxRot)->second : XML_upr;
 
             switch(nautoTxRot)
diff --git a/sd/qa/unit/data/pptx/smartart-font-size.pptx b/sd/qa/unit/data/pptx/smartart-font-size.pptx
new file mode 100644
index 000000000000..253cd4c73b65
Binary files /dev/null and b/sd/qa/unit/data/pptx/smartart-font-size.pptx differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 682c775b80fe..624205c5380a 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -10,6 +10,8 @@
 #include "sdmodeltestbase.hxx"
 
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/TextFitToSizeType.hpp>
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/style/ParagraphAdjust.hpp>
 #include <com/sun/star/text/XText.hpp>
@@ -71,6 +73,7 @@ public:
     void testInteropGrabBag();
     void testBackground();
     void testBackgroundDrawingmlFallback();
+    void testFontSize();
 
     CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
 
@@ -106,6 +109,7 @@ public:
     CPPUNIT_TEST(testInteropGrabBag);
     CPPUNIT_TEST(testBackground);
     CPPUNIT_TEST(testBackgroundDrawingmlFallback);
+    CPPUNIT_TEST(testFontSize);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -997,6 +1001,36 @@ void SdImportTestSmartArt::testBackgroundDrawingmlFallback()
     xDocShRef->DoClose();
 }
 
+void SdImportTestSmartArt::testFontSize()
+{
+    sd::DrawDocShellRef xDocShRef = loadURL(
+        m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-font-size.pptx"), PPTX);
+
+    uno::Reference<drawing::XShapes> xGroup1(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xShape1(xGroup1->getByIndex(1), uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xParagraph1(getParagraphFromShape(0, xShape1));
+    uno::Reference<text::XTextRange> xRun1(getRunFromParagraph(0, xParagraph1));
+    uno::Reference<beans::XPropertySet> xPropSet1(xRun1, uno::UNO_QUERY);
+    double fFontSize1 = xPropSet1->getPropertyValue("CharHeight").get<double>();
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(65.0, fFontSize1, 0.01);
+
+    uno::Reference<drawing::XShapes> xGroup2(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xShape2(xGroup2->getByIndex(1), uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xParagraph2(getParagraphFromShape(0, xShape2));
+    uno::Reference<text::XTextRange> xRun2(getRunFromParagraph(0, xParagraph2));
+    uno::Reference<beans::XPropertySet> xPropSet2(xRun2, uno::UNO_QUERY);
+    double fFontSize2 = xPropSet2->getPropertyValue("CharHeight").get<double>();
+    CPPUNIT_ASSERT_EQUAL(32.0, fFontSize2);
+
+    uno::Reference<drawing::XShapes> xGroup3(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xShape3(xGroup3->getByIndex(1), uno::UNO_QUERY);
+    drawing::TextFitToSizeType eTextFitToSize = drawing::TextFitToSizeType_NONE;
+    xShape3->getPropertyValue("TextFitToSize") >>= eTextFitToSize;
+    CPPUNIT_ASSERT_EQUAL(drawing::TextFitToSizeType_AUTOFIT, eTextFitToSize);
+
+    xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit a36236e82c99839d327094b182a167ac53c4ea66
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 23 14:03:37 2019 +0100
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Mon Jun 3 06:04:15 2019 +0200

    Resolves: tdf#125447 mnemonic appearing in tooltip
    
    Change-Id: I570af8f19468730aad714425492f69d05c0a0cf3
    Reviewed-on: https://gerrit.libreoffice.org/72853
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx
index 73edd5dc7bc8..36e77c91c7bb 100644
--- a/sd/source/ui/view/viewshe3.cxx
+++ b/sd/source/ui/view/viewshe3.cxx
@@ -78,6 +78,7 @@
 #include <svl/aeitem.hxx>
 #include <basic/sbstar.hxx>
 #include <xmloff/autolayout.hxx>
+#include <vcl/mnemonic.hxx>
 
 using namespace ::com::sun::star;
 
@@ -168,7 +169,7 @@ void  ViewShell::GetMenuState( SfxItemSet &rSet )
                 {
                     // Set the necessary string like in
                     // sfx2/source/view/viewfrm.cxx ver 1.23 ln 1081 ff.
-                    OUString aTmp(SvtResId(STR_REDO));
+                    OUString aTmp(MnemonicGenerator::EraseAllMnemonicChars(SvtResId(STR_REDO)));
                     aTmp += pUndoManager->GetRedoActionComment();
                     rSet.Put(SfxStringItem(SID_REDO, aTmp));
                 }
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 67d0bbcd5471..814a45f42b6f 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -33,6 +33,7 @@
 #include <officecfg/Office/Common.hxx>
 #include <officecfg/Setup.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/mnemonic.hxx>
 #include <vcl/splitwin.hxx>
 #include <unotools/moduleoptions.hxx>
 #include <svl/intitem.hxx>
@@ -995,7 +996,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet )
         }
         else
         {
-            rSet.Put( SfxStringItem( SID_REDO, SvtResId(STR_REDO)+pShUndoMgr->GetRedoActionComment() ) );
+            rSet.Put( SfxStringItem( SID_REDO, MnemonicGenerator::EraseAllMnemonicChars(SvtResId(STR_REDO))+pShUndoMgr->GetRedoActionComment() ) );
         }
     }
     else
commit e5a4746378202f8b599de11632b7c8772b735ea2
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Thu May 23 18:23:31 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Sat Jun 1 20:24:17 2019 +0200

    tdf#124279: consider also functions with no arguments
    
    such as PI() or TRUE()
    
    Change-Id: I1243e6d6da7ac884d93d5d46058d94eb35f848ab
    Reviewed-on: https://gerrit.libreoffice.org/73242
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit ad2acdfa36db00678f44f5cd69d687183f02a0bd)
    Reviewed-on: https://gerrit.libreoffice.org/73295

diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index a8e0c02f1f8f..72cb0987479f 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -657,7 +657,7 @@ void FormulaDlg_Impl::MakeTree( StructPage* _pTree, SvTreeListEntry* pParent, co
             const table::CellAddress aRefPos(m_pHelper->getReferencePosition());
             const OUString aResult = m_pHelper->getFormulaParser()->printFormula( aArgs, aRefPos);
 
-            if ( nParas > 0 )
+            if ( nParas > 0 || (nParas == 0 && _pToken->IsFunction()) )
             {
                 SvTreeListEntry* pEntry;
 
commit df67a9ae9c1e9f3e21b1674deb4036f61eced05c
Author:     Takeshi Abe <tabe at fixedpoint.jp>
AuthorDate: Thu May 30 23:56:25 2019 +0900
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Sat Jun 1 19:58:36 2019 +0200

    tdf#124936 Show "(x86)" in About dialog on the 32-bit version
    
    ... installed on Windows.
    
    Change-Id: I2a4d846265b69f0e46e4c711430689ce39d60fcd
    Reviewed-on: https://gerrit.libreoffice.org/73211
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 932c1bd99f4b99705c3948d0babaa1f4160f37c3)
    Reviewed-on: https://gerrit.libreoffice.org/73313
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index a99a814d28e1..2059ac7f10c3 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -304,6 +304,8 @@ OUString AboutDialog::GetVersionString()
 
 #ifdef _WIN64
     sVersion += " (x64)";
+#elif defined(_WIN32)
+    sVersion += " (x86)";
 #endif
 
     OUString sBuildId = GetBuildId();
commit 349b02b7f21ffda1e3e9c92939fc4d77029d0086
Author:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
AuthorDate: Wed May 29 15:16:23 2019 +0200
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Sat Jun 1 04:11:34 2019 +0200

    tdf#125578 force webhelp as workaround for Safari sandboxing w/ macOS 10.14
    
    Sandboxing prevents access to files in user profile as well as to
    contents of the LibreOffice.app unless it is manually triggered by the
    user. Even a clicking a link pointing to the files on an automatically
    opened file is not enough, the user would have to copy'n'paste the
    target.
    As a workaround force online help when default browser is Safari and
    running on 10.14 or later. (other browsers don't seem to enforce
    sandboxing yet and continue to work)
    
    also fix error in the meta tag for the intermediate page (delay and URL
    are both part of the content attribute and not separate)
    
    Change-Id: I6cc50ec1b1928c2416fdfef4cf50e2196a8594ae
    Reviewed-on: https://gerrit.libreoffice.org/73163
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Tested-by: Jenkins
    Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 44893662d510c4173e55ba27af02d0258a697a5d)
    Reviewed-on: https://gerrit.libreoffice.org/73245
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 750f3b354c73..8557d763a31a 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -324,6 +324,9 @@ $(eval $(call gb_Library_add_defs,sfx,\
 endif
 
 ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_add_cxxflags,sfx,\
+    $(gb_OBJCXXFLAGS) \
+))
 $(eval $(call gb_Library_add_objcxxobjects,sfx,\
     sfx2/source/appl/shutdowniconaqua \
 ))
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index ce59b412d8ce..2d36e9ac5198 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -23,6 +23,13 @@
 #include <set>
 #include <algorithm>
 #include <cassert>
+#ifdef MACOSX
+#include <premac.h>
+#include <Foundation/NSString.h>
+#include <CoreFoundation/CFURL.h>
+#include <CoreServices/CoreServices.h>
+#include <postmac.h>
+#endif
 
 #include <sal/log.hxx>
 #include <com/sun/star/uno/Reference.h>
@@ -723,7 +730,16 @@ static bool impl_showOnlineHelp( const OUString& rURL )
 
     try
     {
+#ifdef MACOSX
+        LSOpenCFURLRef(CFURLCreateWithString(kCFAllocatorDefault,
+                           CFStringCreateWithCString(kCFAllocatorDefault,
+                               aHelpLink.toUtf8().getStr(),
+                               kCFStringEncodingUTF8),
+                           NULL),
+            NULL);
+#else
         sfx2::openUriExternally(aHelpLink, false);
+#endif
         return true;
     }
     catch (const Exception&)
@@ -903,10 +919,11 @@ bool rewriteFlatpakHelpRootUrl(OUString * helpRootUrl) {
 }
 
 #define SHTML1 "<!DOCTYPE HTML><html lang=\"en-US\"><head><meta charset=\"UTF-8\">"
-#define SHTML2 "<meta http-equiv=\"refresh\" content=\"1\" url=\""
-#define SHTML3 "\"><script type=\"text/javascript\"> window.location.href = \""
+#define SHTML2 "<meta http-equiv=\"refresh\" content=\"1; url='"
+#define SHTML3 "'\"><script type=\"text/javascript\"> window.location.href = \""
 #define SHTML4 "\";</script><title>Help Page Redirection</title></head><body></body></html>"
 
+// use a tempfile since e.g. xdg-open doesn't support URL-parameters with file:// URLs
 static bool impl_showOfflineHelp( const OUString& rURL )
 {
     OUString aBaseInstallPath = getHelpRootURL();
@@ -940,10 +957,18 @@ static bool impl_showOfflineHelp( const OUString& rURL )
     pStream->WriteUnicodeOrByteText(aTempStr);
 
     aTempFile.CloseStream();
-
     try
     {
+#ifdef MACOSX
+        LSOpenCFURLRef(CFURLCreateWithString(kCFAllocatorDefault,
+                           CFStringCreateWithCString(kCFAllocatorDefault,
+                               aTempFile.GetURL().toUtf8().getStr(),
+                               kCFStringEncodingUTF8),
+                           NULL),
+            NULL);
+#else
         sfx2::openUriExternally(aTempFile.GetURL(), false);
+#endif
         return true;
     }
     catch (const Exception&)
@@ -1055,6 +1080,22 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
         impl_showOnlineHelp( aHelpURL );
         return true;
     }
+#ifdef MACOSX
+    if (@available(macOS 10.14, *)) {
+        // Workaround: Safari sandboxing prevents it from accessing files in the LibreOffice.app folder
+        // force online-help instead if Safari is default browser.
+        CFURLRef pBrowser = LSCopyDefaultApplicationURLForURL(
+                                CFURLCreateWithString(
+                                    kCFAllocatorDefault,
+                                    (CFStringRef)@"https://www.libreoffice.org",
+                                    NULL),
+                                kLSRolesAll, NULL);
+        if([(NSString*)CFURLGetString(pBrowser) isEqualToString:@"file:///Applications/Safari.app/"]) {
+            impl_showOnlineHelp( aHelpURL );
+            return true;
+        }
+    }
+#endif
 
     // If the HTML or no help is installed, but aHelpURL nevertheless references valid help content,
     // that implies that this help content belongs to an extension (and thus would not be available
commit 7e5554ca2e1f37168444592de623f5214194b537
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Sat Jun 1 00:18:46 2019 +0200
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Sat Jun 1 04:07:39 2019 +0200

    Resolves: tdf#101473 handle volatile Add-In results without formula cell
    
    ... while temporarily interpreting from within the Function Wizard.
    
    Change-Id: I88e7e062989ed395accd50ed9bfe1b76b3b297ea
    Reviewed-on: https://gerrit.libreoffice.org/73290
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 7272b9f752cb74757d6ed504202eefccc589f804)
    Reviewed-on: https://gerrit.libreoffice.org/73300
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 57ab5aec29a2..0610e32994d3 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3025,12 +3025,21 @@ void ScInterpreter::ScExternal()
                 rArr.AddRecalcMode( ScRecalcMode::ONLOAD_LENIENT );
                 uno::Reference<sheet::XVolatileResult> xRes = aCall.GetVarRes();
                 ScAddInListener* pLis = ScAddInListener::Get( xRes );
+                // In case there is no pMyFormulaCell, i.e. while interpreting
+                // temporarily from within the Function Wizard, try to obtain a
+                // valid result from an existing listener for that volatile, or
+                // create a new and hope for an immediate result. If none
+                // available that should lead to a void result and thus #N/A.
+                bool bTemporaryListener = false;
                 if ( !pLis )
                 {
                     pLis = ScAddInListener::CreateListener( xRes, pDok );
-                    pMyFormulaCell->StartListening( *pLis );
+                    if (pMyFormulaCell)
+                        pMyFormulaCell->StartListening( *pLis );
+                    else
+                        bTemporaryListener = true;
                 }
-                else
+                else if (pMyFormulaCell)
                 {
                     pMyFormulaCell->StartListening( *pLis );
                     if ( !pLis->HasDocument( pDok ) )
@@ -3040,6 +3049,20 @@ void ScInterpreter::ScExternal()
                 }
 
                 aCall.SetResult( pLis->GetResult() );       // use result from async
+
+                if (bTemporaryListener)
+                {
+                    try
+                    {
+                        // EventObject can be any, not evaluated by
+                        // ScAddInListener::disposing()
+                        css::lang::EventObject aEvent;
+                        pLis->disposing(aEvent);    // pLis is dead hereafter
+                    }
+                    catch (const uno::Exception&)
+                    {
+                    }
+                }
             }
 
             if ( aCall.GetErrCode() != FormulaError::NONE )
commit ae5b453eb63d08f8aba471d8263bff84be80c8aa
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Wed May 29 19:01:28 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri May 31 23:28:43 2019 +0200

    tdf#124484: resize slideshow window so it spans all displays
    
    Change-Id: I55b4ab8ec5059110525c5194e1133c65bbd07fec
    Reviewed-on: https://gerrit.libreoffice.org/73183
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    Reviewed-on: https://gerrit.libreoffice.org/73257
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index 0e94657d092b..07a53972ee9b 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -81,6 +81,8 @@ class VCLPLUG_QT5_PUBLIC Qt5Frame : public QObject, public SalFrame
     bool m_bDefaultSize;
     bool m_bDefaultPos;
     bool m_bFullScreen;
+    bool m_bFullScreenSpanAll;
+    sal_uInt32 m_nRestoreScreen;
     QRect m_aRestoreGeometry;
 
     void Center();
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index f9fded67de59..27d0828539f5 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -59,6 +59,28 @@ static void SvpDamageHandler(void* handle, sal_Int32 nExtentsX, sal_Int32 nExten
     pThis->Damage(nExtentsX, nExtentsY, nExtentsWidth, nExtentsHeight);
 }
 
+namespace
+{
+sal_Int32 screenNumber(const QScreen* pScreen)
+{
+    const QList<QScreen*> screens = QApplication::screens();
+
+    sal_Int32 nScreen = 0;
+    bool bFound = false;
+    for (const QScreen* pCurScreen : screens)
+    {
+        if (pScreen == pCurScreen)
+        {
+            bFound = true;
+            break;
+        }
+        nScreen++;
+    }
+
+    return bFound ? nScreen : -1;
+}
+}
+
 Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
     : m_pTopLevel(nullptr)
     , m_bUseCairo(bUseCairo)
@@ -72,6 +94,7 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
     , m_bDefaultSize(true)
     , m_bDefaultPos(true)
     , m_bFullScreen(false)
+    , m_bFullScreenSpanAll(false)
 {
     Qt5Instance* pInst = static_cast<Qt5Instance*>(GetSalData()->m_pInstance);
     pInst->insertFrame(this);
@@ -143,6 +166,7 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
     // fake an initial geometry, gets updated via configure event or SetPosSize
     if (m_bDefaultPos || m_bDefaultSize)
     {
+        maGeometry.nDisplayScreenNumber = 0;
         Size aDefSize = CalcDefaultSize();
         maGeometry.nX = -1;
         maGeometry.nY = -1;
@@ -420,16 +444,25 @@ void Qt5Frame::Center()
 Size Qt5Frame::CalcDefaultSize()
 {
     assert(isWindow());
-    QSize qSize(0, 0);
-    QScreen* pScreen = screen();
-    if (pScreen)
-        qSize = pScreen->size();
-    else
-        qSize = QApplication::desktop()->screenGeometry(0).size();
 
-    Size aSize = toSize(qSize);
+    Size aSize;
     if (!m_bFullScreen)
-        aSize = bestmaxFrameSizeForScreenSize(aSize);
+    {
+        const QScreen* pScreen = screen();
+        aSize = bestmaxFrameSizeForScreenSize(
+            toSize(pScreen ? pScreen->size() : QApplication::desktop()->screenGeometry(0).size()));
+    }
+    else
+    {
+        if (!m_bFullScreenSpanAll)
+            aSize = toSize(
+                QApplication::desktop()->screenGeometry(maGeometry.nDisplayScreenNumber).size());
+        else
+        {
+            int nLeftScreen = QApplication::desktop()->screenNumber(QPoint(0, 0));
+            aSize = toSize(QApplication::screens()[nLeftScreen]->availableVirtualGeometry().size());
+        }
+    }
 
     return aSize;
 }
@@ -633,7 +666,11 @@ void Qt5Frame::ShowFullScreen(bool bFullScreen, sal_Int32 nScreen)
     // only top-level windows can go fullscreen
     assert(m_pTopLevel);
 
+    if (m_bFullScreen == bFullScreen)
+        return;
+
     m_bFullScreen = bFullScreen;
+    m_bFullScreenSpanAll = m_bFullScreen && (nScreen < 0);
 
     // show it if it isn't shown yet
     if (!isWindow())
@@ -642,15 +679,18 @@ void Qt5Frame::ShowFullScreen(bool bFullScreen, sal_Int32 nScreen)
     if (m_bFullScreen)
     {
         m_aRestoreGeometry = m_pTopLevel->geometry();
-        // do that before going fullscreen
-        SetScreenNumber(nScreen);
-        windowHandle()->showFullScreen();
+        m_nRestoreScreen = maGeometry.nDisplayScreenNumber;
+        SetScreenNumber(m_bFullScreenSpanAll ? m_nRestoreScreen : nScreen);
+        if (!m_bFullScreenSpanAll)
+            windowHandle()->showFullScreen();
+        else
+            windowHandle()->showNormal();
     }
     else
     {
+        SetScreenNumber(m_nRestoreScreen);
         windowHandle()->showNormal();
         m_pTopLevel->setGeometry(m_aRestoreGeometry);
-        m_aRestoreGeometry = QRect();
     }
 }
 
@@ -1081,23 +1121,25 @@ void Qt5Frame::SetScreenNumber(unsigned int nScreen)
         if (pWindow)
         {
             QList<QScreen*> screens = QApplication::screens();
-            if (static_cast<int>(nScreen) < screens.size())
+            if (static_cast<int>(nScreen) < screens.size() || m_bFullScreenSpanAll)
             {
-                bool bSpanAllScreens = (nScreen == static_cast<unsigned int>(-1));
                 QRect screenGeo;
 
-                if (!bSpanAllScreens)
+                if (!m_bFullScreenSpanAll)
                 {
                     screenGeo = QApplication::desktop()->screenGeometry(nScreen);
                     pWindow->setScreen(QApplication::screens()[nScreen]);
                 }
                 else // special case: fullscreen over all available screens
                 {
+                    assert(m_bFullScreen);
                     // left-most screen
                     int nLeftScreen = QApplication::desktop()->screenNumber(QPoint(0, 0));
                     // entire virtual desktop
                     screenGeo = QApplication::screens()[nLeftScreen]->availableVirtualGeometry();
                     pWindow->setScreen(QApplication::screens()[nLeftScreen]);
+                    pWindow->setGeometry(screenGeo);
+                    nScreen = nLeftScreen;
                 }
 
                 // setScreen by itself has no effect, explicitly move the widget to
@@ -1110,7 +1152,10 @@ void Qt5Frame::SetScreenNumber(unsigned int nScreen)
                 // index outta bounds, use primary screen
                 QScreen* primaryScreen = QApplication::primaryScreen();
                 pWindow->setScreen(primaryScreen);
+                nScreen = static_cast<sal_uInt32>(screenNumber(primaryScreen));
             }
+
+            maGeometry.nDisplayScreenNumber = nScreen;
         }
     }
 }
commit c9e0fb864850fa434c4aa5c58960fac1fb382108
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Wed May 8 14:02:37 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri May 31 23:28:31 2019 +0200

    tdf#124484: avoid crash in fullscreen slideshow spanning all displays
    
    This just stops the bleeding (crash) in a special case when screen
    number argument of SalFrame::ShowFullScreen is -1 (meaning
    'fullscreen spanning all available displays')
    
    It doesn't yet extend the fullscreen window over all screens, this
    will be done in a follow-up fix
    
    Change-Id: I2cf48096a1fe1ec33c943f10acb41c59585b325f
    Reviewed-on: https://gerrit.libreoffice.org/71965
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit 758c44f69f0a0ed4a501695de4f065824325e750)
    Reviewed-on: https://gerrit.libreoffice.org/73256
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 069fa535901c..f9fded67de59 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -1083,12 +1083,26 @@ void Qt5Frame::SetScreenNumber(unsigned int nScreen)
             QList<QScreen*> screens = QApplication::screens();
             if (static_cast<int>(nScreen) < screens.size())
             {
-                QWidget* const pWidget = m_pTopLevel ? m_pTopLevel : m_pQWidget;
-                pWindow->setScreen(QApplication::screens()[nScreen]);
+                bool bSpanAllScreens = (nScreen == static_cast<unsigned int>(-1));
+                QRect screenGeo;
+
+                if (!bSpanAllScreens)
+                {
+                    screenGeo = QApplication::desktop()->screenGeometry(nScreen);
+                    pWindow->setScreen(QApplication::screens()[nScreen]);
+                }
+                else // special case: fullscreen over all available screens
+                {
+                    // left-most screen
+                    int nLeftScreen = QApplication::desktop()->screenNumber(QPoint(0, 0));
+                    // entire virtual desktop
+                    screenGeo = QApplication::screens()[nLeftScreen]->availableVirtualGeometry();
+                    pWindow->setScreen(QApplication::screens()[nLeftScreen]);
+                }
 
                 // setScreen by itself has no effect, explicitly move the widget to
                 // the new screen
-                QRect screenGeo = QApplication::desktop()->screenGeometry(nScreen);
+                QWidget* const pWidget = m_pTopLevel ? m_pTopLevel : m_pQWidget;
                 pWidget->move(screenGeo.topLeft());
             }
             else
commit 7bd559972069055e0df726993a018f9b4d129221
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed May 29 13:18:37 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri May 31 18:07:08 2019 +0200

    connectivity: fix memory leaks caused by OConnection::acquire()
    
    Followup to 58f121ef2e680697e10453add43bab9b771d153a;
    OConnection must not be held by rtl::Reference as that creates a cycle.
    
    (regression from 497e40ad03c27837978551ba15491c3fb2a0bf53)
    
    Change-Id: Ibd56d335e3e2631c5a57ea435f1035e89868a5a6
    Reviewed-on: https://gerrit.libreoffice.org/73155
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 6bd751f9f577f25b058fb8a5479c0de7552c3ffc)
    Reviewed-on: https://gerrit.libreoffice.org/73243
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/connectivity/source/commontools/TIndex.cxx b/connectivity/source/commontools/TIndex.cxx
index 2b5be27e337a..cba83f780137 100644
--- a/connectivity/source/commontools/TIndex.cxx
+++ b/connectivity/source/commontools/TIndex.cxx
@@ -37,7 +37,7 @@ OIndexHelper::OIndexHelper( OTableHelper* _pTable) : connectivity::sdbcx::OIndex
 {
     construct();
     std::vector< OUString> aVector;
-    m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
+    m_pColumns.reset(new OIndexColumns(this,m_aMutex,aVector));
 }
 
 OIndexHelper::OIndexHelper( OTableHelper* _pTable,
@@ -93,7 +93,7 @@ void OIndexHelper::refreshColumns()
     if(m_pColumns)
         m_pColumns->reFill(aVector);
     else
-        m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
+        m_pColumns.reset(new OIndexColumns(this,m_aMutex,aVector));
 }
 
 
diff --git a/connectivity/source/commontools/TKey.cxx b/connectivity/source/commontools/TKey.cxx
index 7720adcc0a19..16910f558ef4 100644
--- a/connectivity/source/commontools/TKey.cxx
+++ b/connectivity/source/commontools/TKey.cxx
@@ -100,7 +100,7 @@ void OTableKeyHelper::refreshColumns()
     if ( m_pColumns )
         m_pColumns->reFill(aVector);
     else
-        m_pColumns = new OKeyColumnsHelper(this,m_aMutex,aVector);
+        m_pColumns.reset(new OKeyColumnsHelper(this,m_aMutex,aVector));
 }
 
 
diff --git a/connectivity/source/drivers/ado/AGroup.cxx b/connectivity/source/drivers/ado/AGroup.cxx
index e0c8b49a2d01..0b251a6f2cf3 100644
--- a/connectivity/source/drivers/ado/AGroup.cxx
+++ b/connectivity/source/drivers/ado/AGroup.cxx
@@ -78,7 +78,7 @@ void OAdoGroup::refreshUsers()
     if(m_pUsers)
         m_pUsers->reFill(aVector);
     else
-        m_pUsers = new OUsers(m_pCatalog,m_aMutex,aVector,aUsers,isCaseSensitive());
+        m_pUsers.reset(new OUsers(m_pCatalog, m_aMutex, aVector, aUsers, isCaseSensitive()));
 }
 
 Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/ado/AIndex.cxx b/connectivity/source/drivers/ado/AIndex.cxx
index 29ecf4d4d74b..0888fa1bf2b8 100644
--- a/connectivity/source/drivers/ado/AIndex.cxx
+++ b/connectivity/source/drivers/ado/AIndex.cxx
@@ -66,7 +66,7 @@ void OAdoIndex::refreshColumns()
     if ( m_pColumns )
         m_pColumns->reFill(aVector);
     else
-        m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
+        m_pColumns.reset(new OColumns(*this, m_aMutex, aVector, aColumns, isCaseSensitive(), m_pConnection));
 }
 
 
diff --git a/connectivity/source/drivers/ado/AKey.cxx b/connectivity/source/drivers/ado/AKey.cxx
index 4393666d40be..25ffeb6eece6 100644
--- a/connectivity/source/drivers/ado/AKey.cxx
+++ b/connectivity/source/drivers/ado/AKey.cxx
@@ -63,7 +63,7 @@ void OAdoKey::refreshColumns()
     if(m_pColumns)
         m_pColumns->reFill(aVector);
     else
-        m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
+        m_pColumns.reset(new OColumns(*this, m_aMutex, aVector, aColumns, isCaseSensitive(), m_pConnection));
 }
 
 Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/ado/AUser.cxx b/connectivity/source/drivers/ado/AUser.cxx
index cff7695c757d..4e595de36bac 100644
--- a/connectivity/source/drivers/ado/AUser.cxx
+++ b/connectivity/source/drivers/ado/AUser.cxx
@@ -62,7 +62,7 @@ void OAdoUser::refreshGroups()
     if(m_pGroups)
         m_pGroups->reFill(aVector);
     else
-        m_pGroups = new OGroups(m_pCatalog,m_aMutex,aVector,aGroups,isCaseSensitive());
+        m_pGroups.reset(new OGroups(m_pCatalog, m_aMutex, aVector, aGroups, isCaseSensitive()));
 }
 
 Sequence< sal_Int8 > OAdoUser::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 70e9eed51335..0e640865d700 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -100,7 +100,7 @@ void ODbaseIndex::refreshColumns()
     if(m_pColumns)
         m_pColumns->reFill(aVector);
     else
-        m_pColumns = new ODbaseIndexColumns(this,m_aMutex,aVector);
+        m_pColumns.reset(new ODbaseIndexColumns(this,m_aMutex,aVector));
 }
 
 Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelImplementationId()
diff --git a/include/connectivity/sdbcx/VGroup.hxx b/include/connectivity/sdbcx/VGroup.hxx
index 61722d234e2f..dfff84dedb39 100644
--- a/include/connectivity/sdbcx/VGroup.hxx
+++ b/include/connectivity/sdbcx/VGroup.hxx
@@ -55,7 +55,8 @@ namespace connectivity
                         public ODescriptor
         {
         protected:
-            rtl::Reference<OUsers>    m_pUsers;
+            // no Reference! see OCollection::acquire
+            std::unique_ptr<OUsers> m_pUsers;
 
             using OGroup_BASE::rBHelper;
 
diff --git a/include/connectivity/sdbcx/VIndex.hxx b/include/connectivity/sdbcx/VIndex.hxx
index 6cd36f02861f..7ffc269cf4e7 100644
--- a/include/connectivity/sdbcx/VIndex.hxx
+++ b/include/connectivity/sdbcx/VIndex.hxx
@@ -57,7 +57,8 @@ namespace connectivity
             bool            m_IsPrimaryKeyIndex;
             bool            m_IsClustered;
 
-            rtl::Reference<OCollection>    m_pColumns;
+            // no Reference! see OCollection::acquire
+            std::unique_ptr<OCollection> m_pColumns;
 
             using ODescriptor_BASE::rBHelper;
             virtual void refreshColumns() override;
diff --git a/include/connectivity/sdbcx/VKey.hxx b/include/connectivity/sdbcx/VKey.hxx
index bafab2761015..d786fb00c74a 100644
--- a/include/connectivity/sdbcx/VKey.hxx
+++ b/include/connectivity/sdbcx/VKey.hxx
@@ -69,7 +69,8 @@ namespace connectivity
         {
         protected:
             std::shared_ptr<KeyProperties>   m_aProps;
-            rtl::Reference<OCollection>      m_pColumns;
+            // no Reference! see OCollection::acquire
+            std::unique_ptr<OCollection> m_pColumns;
 
             using ODescriptor_BASE::rBHelper;
             // OPropertyArrayUsageHelper
diff --git a/include/connectivity/sdbcx/VUser.hxx b/include/connectivity/sdbcx/VUser.hxx
index 2727f167a029..c30875df873f 100644
--- a/include/connectivity/sdbcx/VUser.hxx
+++ b/include/connectivity/sdbcx/VUser.hxx
@@ -53,7 +53,8 @@ namespace connectivity
                         public ODescriptor
         {
         protected:
-            rtl::Reference<OGroups>  m_pGroups;
+            // no Reference! see OCollection::acquire
+            std::unique_ptr<OGroups> m_pGroups;
 
             using OUser_BASE::rBHelper;
 
commit 616ed2365434da0008b3be93b86fd49e0052f1aa
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed May 29 14:42:06 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 31 17:58:47 2019 +0200

    dbaccess: fix more memory leaks caused by circular Reference
    
    Followup to 96ae2a3300811897c24cccb20f8c2faf382483df; more overridden
    acquire() creating cycles in dbaccess.
    
    (regression from 2660d24a07866e083c5135ea263030f3e3a2e729)
    
    Reviewed-on: https://gerrit.libreoffice.org/73158
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 7d582d1f9767c0ebd5e319f2fd11711e60cd72fa)
    
    Change-Id: I134343b3afbcd5ee3f71212ec18e551455eaee5b
    Reviewed-on: https://gerrit.libreoffice.org/73253
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
index 41de9c5f995c..1d0d30e88542 100644
--- a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
+++ b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
@@ -157,9 +157,10 @@ Sequence< OUString > SAL_CALL OComponentDefinition::getSupportedServiceNames()
 void SAL_CALL OComponentDefinition::disposing()
 {
     OContentHelper::disposing();
-    if ( m_xColumns.is() )
-        m_xColumns->disposing();
-    m_xColumns.clear();
+    if (m_pColumns)
+    {
+        m_pColumns->disposing();
+    }
     m_xColumnPropertyListener->clear();
     m_xColumnPropertyListener.clear();
 }
@@ -194,7 +195,7 @@ Reference< XNameAccess> OComponentDefinition::getColumns()
     ::osl::MutexGuard aGuard(m_aMutex);
     ::connectivity::checkDisposed(OContentHelper::rBHelper.bDisposed);
 
-    if ( !m_xColumns.is() )
+    if (!m_pColumns)
     {
         std::vector< OUString> aNames;
 
@@ -204,10 +205,11 @@ Reference< XNameAccess> OComponentDefinition::getColumns()
         for (auto const& definition : rDefinition)
             aNames.push_back(definition.first);
 
-        m_xColumns = new OColumns( *this, m_aMutex, true, aNames, this, nullptr, true, false, false );
-        m_xColumns->setParent( *this );
+        m_pColumns.reset(new OColumns(*this, m_aMutex, true, aNames, this, nullptr, true, false, false));
+        m_pColumns->setParent(*this);
     }
-    return m_xColumns.get();
+    // see OCollection::acquire
+    return m_pColumns.get();
 }
 
 OColumn* OComponentDefinition::createColumn(const OUString& _rName) const
diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.hxx b/dbaccess/source/core/dataaccess/ComponentDefinition.hxx
index 58f78745a4bc..f87a6389958a 100644
--- a/dbaccess/source/core/dataaccess/ComponentDefinition.hxx
+++ b/dbaccess/source/core/dataaccess/ComponentDefinition.hxx
@@ -85,7 +85,8 @@ class OComponentDefinition  :public OContentHelper
                             ,public ::comphelper::OPropertyArrayUsageHelper< OComponentDefinition >
 {
 protected:
-    rtl::Reference< OColumns >     m_xColumns;
+    // no Reference! see OCollection::acquire
+    std::unique_ptr<OColumns> m_pColumns;
     rtl::Reference<OColumnPropertyListener> m_xColumnPropertyListener;
     bool                        m_bTable;
 
diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx
index 072a63eece79..089fd85b5576 100644
--- a/dbaccess/source/ui/misc/singledoccontroller.cxx
+++ b/dbaccess/source/ui/misc/singledoccontroller.cxx
@@ -41,10 +41,11 @@ namespace dbaui
     // OSingleDocumentController_Data
     struct OSingleDocumentController_Data
     {
-        rtl::Reference< UndoManager >  m_xUndoManager;
+        // no Reference! see UndoManager::acquire
+        std::unique_ptr<UndoManager> m_pUndoManager;
 
         OSingleDocumentController_Data( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
-            :m_xUndoManager( new UndoManager( i_parent, i_mutex ) )
+            : m_pUndoManager(new UndoManager(i_parent, i_mutex))
         {
         }
     };
@@ -64,7 +65,7 @@ namespace dbaui
     {
         OSingleDocumentController_Base::disposing();
         ClearUndoManager();
-        m_pData->m_xUndoManager->disposing();
+        m_pData->m_pUndoManager->disposing();
     }
 
     void OSingleDocumentController::ClearUndoManager()
@@ -74,7 +75,7 @@ namespace dbaui
 
     SfxUndoManager& OSingleDocumentController::GetUndoManager() const
     {
-        return m_pData->m_xUndoManager->GetSfxUndoManager();
+        return m_pData->m_pUndoManager->GetSfxUndoManager();
     }
 
     void OSingleDocumentController::addUndoActionAndInvalidate(std::unique_ptr<SfxUndoAction> _pAction)
@@ -92,7 +93,8 @@ namespace dbaui
 
     Reference< XUndoManager > SAL_CALL OSingleDocumentController::getUndoManager(  )
     {
-        return m_pData->m_xUndoManager.get();
+        // see UndoManager::acquire
+        return m_pData->m_pUndoManager.get();
     }
 
     FeatureState OSingleDocumentController::GetState(sal_uInt16 _nId) const
commit 3235ae697e1ae90e218f5c3bee280659d8a74a60
Author:     Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
AuthorDate: Wed May 8 21:49:34 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri May 31 16:46:22 2019 +0200

    SmartArt: support diagram background
    
    Solved by adding additional shape filling whole diagram.
    MS PowerPoint does the same when converting SmartArt to shapes.
    
    Background shape is also copied when loading from drawingML fallback,
    appearently there is no background information.
    
    Corrected SmartArt import tests, so that they are aware of extra shape.
    
    Change-Id: I6154f8e1b34e5867ab582d6fc54459c7c93edbac
    Reviewed-on: https://gerrit.libreoffice.org/72012
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/73250

diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 9e879b47bc9c..73fb85ad8dc9 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -150,6 +150,7 @@ public:
     const OUString&                 getId() { return msId; }
     void                            setHidden( bool bHidden ) { mbHidden = bHidden; }
     void                            setHiddenMasterShape( bool bHiddenMasterShape ) { mbHiddenMasterShape = bHiddenMasterShape; }
+    void                            setLocked( bool bLocked ) { mbLocked = bLocked; }
     void                            setSubType( sal_Int32 nSubType ) { mnSubType = nSubType; }
     sal_Int32                       getSubType() const { return mnSubType; }
     void                            setSubTypeIndex( sal_Int32 nSubTypeIndex ) { moSubTypeIndex = nSubTypeIndex; }
@@ -336,6 +337,7 @@ private:
     bool                            mbHiddenMasterShape; // master shapes can be hidden in layout slides
                                                          // we need separate flag because we don't want
                                                          // to propagate it when applying reference shape
+    bool                            mbLocked;
     bool mbLockedCanvas; ///< Is this shape part of a locked canvas?
     bool mbWps; ///< Is this a wps shape?
     bool mbTextBox; ///< This shape has a textbox.
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index d1de1c72f94d..8efefe139dbf 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -29,6 +29,7 @@
 #include <drawingml/textrun.hxx>
 #include <drawingml/diagram/diagram.hxx>
 #include <drawingml/fillproperties.hxx>
+#include <drawingml/customshapeproperties.hxx>
 #include <oox/ppt/pptshapegroupcontext.hxx>
 #include <oox/ppt/pptshape.hxx>
 #include <oox/token/namespaces.hxx>
@@ -317,6 +318,16 @@ void Diagram::addTo( const ShapePtr & pParentShape )
         ShapeLayoutingVisitor aLayoutingVisitor;
         mpLayout->getNode()->accept(aLayoutingVisitor);
     }
+
+    ShapePtr pBackground(new Shape("com.sun.star.drawing.CustomShape"));
+    pBackground->setSubType(XML_rect);
+    pBackground->getCustomShapeProperties()->setShapePresetType(XML_rect);
+    pBackground->setSize(pParentShape->getSize());
+    pBackground->getFillProperties() = *mpData->getFillProperties();
+    pBackground->setLocked(true);
+    auto& aChildren = pParentShape->getChildren();
+    aChildren.insert(aChildren.begin(), pBackground);
+
     pParentShape->setDiagramDoms( getDomsAsPropertyValues() );
 }
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 4848f4086e02..23e9537f4b32 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -127,6 +127,7 @@ Shape::Shape( const sal_Char* pServiceName, bool bDefaultHeight )
 , mbFlipV( false )
 , mbHidden( false )
 , mbHiddenMasterShape( false )
+, mbLocked( false )
 , mbLockedCanvas( false )
 , mbWps( false )
 , mbTextBox( false )
@@ -170,6 +171,7 @@ Shape::Shape( const ShapePtr& pSourceShape )
 , mbFlipV( pSourceShape->mbFlipV )
 , mbHidden( pSourceShape->mbHidden )
 , mbHiddenMasterShape( pSourceShape->mbHiddenMasterShape )
+, mbLocked( pSourceShape->mbLocked )
 , mbLockedCanvas( pSourceShape->mbLockedCanvas )
 , mbWps( pSourceShape->mbWps )
 , mbTextBox( pSourceShape->mbTextBox )
@@ -333,6 +335,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText )
     mbFlipH = rReferencedShape.mbFlipH;
     mbFlipV = rReferencedShape.mbFlipV;
     mbHidden = rReferencedShape.mbHidden;
+    mbLocked = rReferencedShape.mbLocked;
 }
 
 struct ActionLockGuard
@@ -858,6 +861,12 @@ Reference< XShape > const & Shape::createAndInsert(
             xSet->setPropertyValue( sPrintable, Any( false ) );
         }
 
+        if (mbLocked)
+        {
+            xSet->setPropertyValue("MoveProtect", Any(true));
+            xSet->setPropertyValue("SizeProtect", Any(true));
+        }
+
         ActionLockGuard const alg(mxShape);
 
         // sj: removing default text of placeholder objects such as SlideNumberShape or HeaderShape
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 2747572f0479..e6feaa818c69 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -428,6 +428,14 @@ ShapeContextHandler::getShape()
                     pShapePtr->setDiagramDoms(mpShape->getDiagramDoms());
                     pShapePtr->keepDiagramDrawing(*mxFilterBase, aFragmentPath);
 
+                    if (!mpShape->getChildren().empty())
+                    {
+                        // first child is diagram background - we want to keep it, as drawingML fallback doesn't contain it
+                        auto& aChildren = pShapePtr->getChildren();
+                        ShapePtr pBackground = mpShape->getChildren().front();
+                        aChildren.insert(aChildren.begin(), pBackground);
+                    }
+
                     pShapePtr->addShape( *mxFilterBase, mpThemePtr.get(), xShapes, aMatrix, pShapePtr->getFillProperties() );
                     xResult = pShapePtr->getXShape();
                 }
diff --git a/sd/qa/unit/data/pptx/smartart-background-drawingml-fallback.pptx b/sd/qa/unit/data/pptx/smartart-background-drawingml-fallback.pptx
new file mode 100644
index 000000000000..d89f28a21c02
Binary files /dev/null and b/sd/qa/unit/data/pptx/smartart-background-drawingml-fallback.pptx differ
diff --git a/sd/qa/unit/data/pptx/smartart-background.pptx b/sd/qa/unit/data/pptx/smartart-background.pptx
new file mode 100644
index 000000000000..beb862dc12d3
Binary files /dev/null and b/sd/qa/unit/data/pptx/smartart-background.pptx differ
diff --git a/sd/qa/unit/data/xml/n819614_0.xml b/sd/qa/unit/data/xml/n819614_0.xml
index fc109917c460..72e28f38c82d 100644
--- a/sd/qa/unit/data/xml/n819614_0.xml
+++ b/sd/qa/unit/data/xml/n819614_0.xml
@@ -14,8 +14,71 @@
    <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
   </Transformation>
  </XShape>
- <XShape positionX="182" positionY="2544" sizeX="25125" sizeY="16293" type="com.sun.star.drawing.GroupShape" name="Content Placeholder 4">
+ <XShape positionX="0" positionY="2328" sizeX="25399" sizeY="16509" type="com.sun.star.drawing.GroupShape" name="Content Placeholder 4">
   <XShapes>
+   <XShape positionX="0" positionY="2328" sizeX="25399" sizeY="16509" type="com.sun.star.drawing.CustomShape" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+    <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+    <FillGradient style="LINEAR" startColor="3465a4" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+    <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+    <FillBitmap width="32" height="32"/>
+    <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+    <LineStart/>
+    <LineEnd/>
+    <Transformation>
+     <Line1 column1="25400.000000" column2="0.000000" column3="0.000000"/>
+     <Line2 column1="0.000000" column2="16510.000000" column3="2328.000000"/>
+     <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+    </Transformation>
+    <CustomShapeGeometry>

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list