[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 23 commits - basic/source chart2/source configure.ac cui/source drawinglayer/source include/svl include/vcl l10ntools/source scp2/source sc/qa sc/source solenv/inc svl/source svtools/source svx/source svx/uiconfig sw/inc sw/qa sw/source sysui/desktop sysui/productlist.mk vcl/inc vcl/Module_vcl.mk vcl/osx vcl/qa vcl/source vcl/unx

Stephan Bergmann sbergman at redhat.com
Fri Jun 1 18:48:54 UTC 2018


 basic/source/comp/scanner.cxx                           |    2 
 chart2/source/controller/main/ChartController_Tools.cxx |    3 
 chart2/source/controller/sidebar/ChartSeriesPanel.cxx   |    4 
 configure.ac                                            |    2 
 cui/source/options/optgdlg.cxx                          |    9 
 cui/source/options/optgdlg.hxx                          |    1 
 drawinglayer/source/texture/texture3d.cxx               |   11 
 include/svl/zformat.hxx                                 |    1 
 include/vcl/pdfextoutdevdata.hxx                        |    2 
 l10ntools/source/ulfconv/msi-encodinglist.txt           |    1 
 sc/qa/unit/data/xls/forcepoint-pivot-1.xls              |binary
 sc/source/filter/excel/xipivot.cxx                      |    8 
 sc/source/ui/view/output.cxx                            |   21 +
 scp2/source/ooo/module_langpack.ulf                     |    6 
 solenv/inc/langlist.mk                                  |    1 
 svl/source/numbers/zformat.cxx                          |   31 +-
 svtools/source/misc/embedhlp.cxx                        |   12 
 svx/source/core/graphichelper.cxx                       |    7 
 svx/uiconfig/ui/convertmenu.ui                          |    2 
 sw/inc/accmap.hxx                                       |    3 
 sw/qa/extras/odfimport/data/tdf116195.odt               |binary
 sw/qa/extras/odfimport/odfimport.cxx                    |    8 
 sw/qa/extras/rtfexport/data/tdf117505.odt               |binary
 sw/qa/extras/rtfexport/rtfexport3.cxx                   |   11 
 sw/source/core/access/acccontext.cxx                    |    6 
 sw/source/core/access/accmap.cxx                        |   11 
 sw/source/filter/ww8/rtfattributeoutput.cxx             |    9 
 sw/source/filter/ww8/rtfexport.cxx                      |    3 
 sw/source/filter/ww8/rtfexport.hxx                      |    4 
 sw/source/filter/xml/xmlimp.cxx                         |    2 
 sw/source/ui/fldui/fldvar.cxx                           |    2 
 sysui/desktop/apparmor/program.soffice.bin              |    2 
 sysui/productlist.mk                                    |    2 
 vcl/Module_vcl.mk                                       |    6 
 vcl/inc/unx/salobj.h                                    |    1 
 vcl/osx/vclnsapp.mm                                     |    3 
 vcl/qa/cppunit/pdfexport/data/tdf106702.odt             |binary
 vcl/qa/cppunit/pdfexport/data/tdf113143.odp             |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx                  |  228 +++++++++++-----
 vcl/source/gdi/pdfextoutdevdata.cxx                     |   27 +
 vcl/source/gdi/pdfwriter_impl2.cxx                      |    2 
 vcl/unx/generic/window/salobj.cxx                       |   12 
 42 files changed, 355 insertions(+), 111 deletions(-)

New commits:
commit 1924660a90e82fc0eac77f2777412c0a04e03a46
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 31 14:14:48 2018 +0200

    --enable-gio also for --disable-gtk --enable-gtk3
    
    ...as is used by the Flatpak build.  Other settings only checked in that block
    controlled by ENABLE_GTK, and thus potentially erronously left empty for
    --disable-gtk --enable-gtk3 builds, are GTHREAD- and GTK_PRINT-related settings.
    GTHREAD_LIBS is explicitly used in vcl/Library_vclplug_gtk3.mk even, but it
    being empty apparently has no negative effects, so leave it at that for now.
    On the GTK_PRINT-related settings, Caolan commented on IRC:  "ENABLE_GTK_PRINT
    is probably best removed entirely I guess, it didn't work out and they're
    redoing the dialog in upstream gtk again I'm told."
    
    Change-Id: I7e026c0ac9b23e7ace2c2e92390bdcc3be7d39a3
    Reviewed-on: https://gerrit.libreoffice.org/55127
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit b5dd045bf533a2ba4d1c98debe5a2acba4c8b486)
    Reviewed-on: https://gerrit.libreoffice.org/55164
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit a560bcbea943cb317e96c15c608c5e2f66e5698f)

diff --git a/configure.ac b/configure.ac
index bdfe52a494d7..4209ed882167 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9892,7 +9892,9 @@ if test  "$test_gtk" = "yes"; then
         GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
         FilterLibs "${GTK_PRINT_LIBS}"
         GTK_PRINT_LIBS="${filteredlibs}"
+    fi
 
+    if test "$ENABLE_GTK" = "TRUE" || test "$ENABLE_GTK3" = "TRUE"; then
         AC_MSG_CHECKING([whether to enable GIO support])
         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
             dnl Need at least 2.26 for the dbus support.
commit f85d19ba32dd58220405eea9ac390596b923729c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu May 31 14:22:18 2018 +0100

    Resolves: tdf#116268 use on/off data, not pos to determine which is which
    
    Change-Id: I73127bc6ea78daaf1e79596067c1cdeb692e1566
    Reviewed-on: https://gerrit.libreoffice.org/55134
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit a828a0fe795fb44e1daa0ece9c994973b3975fce)

diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index cf3434c42e80..2594567d3c6e 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -531,7 +531,7 @@ void SwFieldVarPage::SubTypeHdl(ListBox const * pBox)
                 if (IsFieldEdit() || pBox)    // only when interacting via mouse
                     m_pNameED->SetText(OUString());
 
-                if (nSelPos != 0 && nSelPos != LISTBOX_ENTRY_NOTFOUND)
+                if (nSelData != 0 && nSelData != SIZE_MAX)
                 {
                     bValue = true;      // SubType OFF - knows no Offset
                     if (GetCurField() && IsFieldEdit())
commit d63582783439cfd1df5c355805566197cb7d7292
Author: Patrick Jaap <patrick.jaap at tu-dresden.de>
Date:   Tue Apr 10 15:29:56 2018 +0200

    tdf#116195 swap a compatibility value
    
    There was a minor bug in the compat flag, leading
    to a regression from commit 8d62b79f168180c6992eb483ec864d473050635f
    
    Change-Id: I1e468e665a583ef15b6e474c3adb32f1dcf98f46
    Reviewed-on: https://gerrit.libreoffice.org/52674
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit fe3d5766fa3c42f6cf8d1ea47af820e0b1c1cf48)
    Reviewed-on: https://gerrit.libreoffice.org/55120
    Reviewed-by: Patrick Jaap <patrick.jaap at tu-dresden.de>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit 39f2125c4952063f4bdc36d9abba18daaee72d68)

diff --git a/sw/qa/extras/odfimport/data/tdf116195.odt b/sw/qa/extras/odfimport/data/tdf116195.odt
new file mode 100644
index 000000000000..21a601f69d66
Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf116195.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 175fa31c888e..8c57b5b2ffc7 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -902,5 +902,13 @@ DECLARE_ODFIMPORT_TEST(testTdf108482, "tdf108482.odt")
     );
 }
 
+DECLARE_ODFIMPORT_TEST(testTdf116195, "tdf116195.odt")
+{
+    // The image was set to zero height due to a regression
+    CPPUNIT_ASSERT_EQUAL(
+        sal_Int32(12960), parseDump("/root/page/anchored/fly/notxt/infos/bounds", "height").toInt32()
+    );
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index ff9aaf182fe2..76e33d572772 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1425,7 +1425,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
     if (!bSubtractFlysAnchoredAtFlys)
         xProps->setPropertyValue("SubtractFlysAnchoredAtFlys", makeAny(true));
 
-    if ( !bDisableOffPagePositioning )
+    if ( bDisableOffPagePositioning )
         xProps->setPropertyValue("DisableOffPagePositioning", makeAny(true));
 
     SwDoc *pDoc = getDoc();
commit c632ba5c76708aa454d1199d09f58bbbb9a9150f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 30 13:57:02 2018 +0100

    tdf#117864 TransferableHelper::GetSystemClipboard requires a focus window
    
    Change-Id: Ibd9b9218cf12e80db1fc9a70bdbab38d3df950f7
    Reviewed-on: https://gerrit.libreoffice.org/55075
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit d4c1975fc0411cdd30ea96fa188ac77c099bd58e)

diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index d06524480847..ae1d02a106fa 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -522,7 +522,8 @@ void ChartController::executeDispatch_Copy()
             }
             if ( xTransferable.is() )
             {
-                Reference< datatransfer::clipboard::XClipboard > xClipboard( TransferableHelper::GetSystemClipboard() );
+                SolarMutexGuard aSolarGuard;
+                Reference<datatransfer::clipboard::XClipboard> xClipboard(GetChartWindow()->GetClipboard());
                 if ( xClipboard.is() )
                 {
                     xClipboard->setContents( xTransferable, Reference< datatransfer::clipboard::XClipboardOwner >() );
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index 023f548b485a..fb64cb64b5ac 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -267,6 +267,10 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
 
     OUString aCID;
     aAny >>= aCID;
+
+    if (aCID.isEmpty())
+        return OUString();
+
 #ifdef DBG_UTIL
     ObjectType eType = ObjectIdentifier::getObjectType(aCID);
     assert(eType == OBJECTTYPE_DATA_SERIES);
commit 940fc00c6a7f69e18b57eaead8840de576629e18
Author: Eike Rathke <erack at redhat.com>
Date:   Tue May 29 23:40:44 2018 +0200

    Resolves: tdf#117819 append trailing '0' as needed before separator insertion
    
    To insert separators, literal strings between digits and other,
    the formatter operates backwards on the string obtained from
    doubleToUString() cleaned of the decimal separator. The number of
    decimals returned by doubleToUString() may be less than the
    decimals of the number format as entered by the user, which lead
    to separators inserted at wrong positions. This wrong behavior was
    triggered respectively made more obvious by
    
        commit 0f6203edf74832f84d8263d7a544d679203a4efc
        CommitDate: Wed Jan 13 14:47:57 2016 +0100
    
            tdf#96918 display accurate integer double values up to (2^53)-1
    
    which for integer values returns at most 15 decimals ('0' in this
    case).
    
    Before operating on the decimals' part ensure that the number of
    decimals matches the digits requested, and if shorter append
    trailing '0' characters for the required amount so the separators
    (and other strings) are inserted at the correct positions.
    
    Change-Id: Ic02652699ea7d6fae3b2b3348f6f7d183319e043
    Reviewed-on: https://gerrit.libreoffice.org/55039
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit 8b43f58891d4b422a8934050d839b0c2c1e3a18a)
    Reviewed-on: https://gerrit.libreoffice.org/55060
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit 2e0c3c88865b64b04b6160f9f5955a3a9548d48c)

diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 9077e45d92ff..2ef1b4ac034f 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -628,6 +628,7 @@ private:
 
     SVL_DLLPRIVATE bool ImpDecimalFill( OUStringBuffer& sStr,
                                  double& rNumber,
+                                 sal_Int32 nDecPos,
                                  sal_uInt16 j,
                                  sal_uInt16 nIx,
                                  bool bInteger );
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 8614c412bfd5..ee42209f4363 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2523,6 +2523,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber,
     OUStringBuffer ExpStr;
     short nExpSign = 1;
     sal_Int32 nExPos = sStr.indexOf('E');
+    sal_Int32 nDecPos = -1;
 
     if ( nExPos >= 0 )
     {
@@ -2581,6 +2582,8 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber,
 
         while((index = sStr.indexOf('.', index)) >= 0)
         {
+            if (nDecPos < 0)
+                nDecPos = index;
             sStr.remove(index, 1);
         }
     }
@@ -2630,7 +2633,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber,
     }
     else
     {
-        bRes |= ImpDecimalFill(sStr, fNumber, j, nIx, false);
+        bRes |= ImpDecimalFill(sStr, fNumber, nDecPos, j, nIx, false);
     }
 
     if (bSign)
@@ -4104,6 +4107,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber,
         }
     }
     sal_uInt16 i, j;
+    sal_Int32 nDecPos = -1;
     bool bInteger = false;
     if ( rInfo.nThousand != FLAG_STANDARD_IN_FORMAT )
     {
@@ -4155,17 +4159,17 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber,
             sStr = ::rtl::math::doubleToUString( fNumber, rtl_math_StringFormat_F, 0, '.');
             sStr.stripStart('0'); // Strip leading zeros
         }
-        sal_Int32 nPoint = sStr.indexOf('.' );
-        if ( nPoint >= 0)
+        nDecPos = sStr.indexOf('.' );
+        if ( nDecPos >= 0)
         {
-            const sal_Unicode* p = sStr.getStr() + nPoint;
+            const sal_Unicode* p = sStr.getStr() + nDecPos;
             while ( *++p == '0' )
                 ;
             if ( !*p )
             {
                 bInteger = true;
             }
-            sStr.remove( nPoint, 1 ); //  Remove .
+            sStr.remove( nDecPos, 1 ); //  Remove .
         }
         if (bSign && (sStr.isEmpty() ||
                       comphelper::string::getTokenCount(sStr.toString(), '0') == sStr.getLength()+1))   // Only 00000
@@ -4177,7 +4181,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber,
                                         // Edit backwards:
     j = NumFor[nIx].GetCount()-1;       // Last symbol
                                         // Decimal places:
-    bRes |= ImpDecimalFill( sStr, fNumber, j, nIx, bInteger );
+    bRes |= ImpDecimalFill( sStr, fNumber, nDecPos, j, nIx, bInteger );
     if (bSign)
     {
         sStr.insert(0, '-');
@@ -4188,6 +4192,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber,
 
 bool SvNumberformat::ImpDecimalFill( OUStringBuffer& sStr,  // number string
                                    double& rNumber,       // number
+                                   sal_Int32 nDecPos,     // decimals start
                                    sal_uInt16 j,          // symbol index within format code
                                    sal_uInt16 nIx,        // subformat index
                                    bool bInteger)         // is integer
@@ -4232,6 +4237,20 @@ bool SvNumberformat::ImpDecimalFill( OUStringBuffer& sStr,  // number string
                 const OUString& rStr = rInfo.sStrArray[j];
                 const sal_Unicode* p1 = rStr.getStr();
                 const sal_Unicode* p = p1 + rStr.getLength();
+                // In case the number of decimals passed are less than the
+                // "digits" given, append trailing '0' characters, which here
+                // means insert them because literal strings may have been
+                // appended already. If they weren't to be '0' characters
+                // they'll be changed below, as if decimals with trailing zeros
+                // were passed.
+                if (nDecPos >= 0 && nDecPos <= k)
+                {
+                    sal_Int32 nAppend = rStr.getLength() - (k - nDecPos);
+                    while (nAppend-- > 0)
+                    {
+                        sStr.insert( k++, '0');
+                    }
+                }
                 while (k && p1 < p--)
                 {
                     const sal_Unicode c = *p;
commit 8b7ede03c732eeb4da41faa810343a387f2d8c62
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 29 13:12:12 2018 +0100

    forcepoint#43 endless update ole2 preview recursion
    
    Change-Id: I7a6a52d2ea63f840a8a1800fdf7039b1e7b24cdc
    Reviewed-on: https://gerrit.libreoffice.org/55004
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 1663a364c80fde2ac8396dd2fbcbee4240231271)

diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 45beb0d17853..10cfeff47d23 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -228,6 +228,7 @@ struct EmbeddedObjectRef_Impl
     sal_Int64                                   nViewAspect;
     bool                                        bIsLocked:1;
     bool                                        bNeedUpdate:1;
+    bool                                        bUpdating:1;
 
     // #i104867#
     sal_uInt32                                  mnGraphicVersion;
@@ -239,6 +240,7 @@ struct EmbeddedObjectRef_Impl
         nViewAspect(embed::Aspects::MSOLE_CONTENT),
         bIsLocked(false),
         bNeedUpdate(false),
+        bUpdating(false),
         mnGraphicVersion(0),
         aDefaultSizeForChart_In_100TH_MM(awt::Size(8000,7000))
     {}
@@ -252,6 +254,7 @@ struct EmbeddedObjectRef_Impl
         nViewAspect(r.nViewAspect),
         bIsLocked(r.bIsLocked),
         bNeedUpdate(r.bNeedUpdate),
+        bUpdating(r.bUpdating),
         mnGraphicVersion(0),
         aDefaultSizeForChart_In_100TH_MM(r.aDefaultSizeForChart_In_100TH_MM)
     {
@@ -805,7 +808,14 @@ bool EmbeddedObjectRef::IsGLChart(const css::uno::Reference < css::embed::XEmbed
 
 void EmbeddedObjectRef::UpdateReplacement()
 {
-    GetReplacement( true );
+    if (mpImpl->bUpdating)
+    {
+        SAL_WARN("svtools.misc", "UpdateReplacement called while UpdateReplacement already underway");
+        return;
+    }
+    mpImpl->bUpdating = true;
+    GetReplacement(true);
+    mpImpl->bUpdating = false;
 }
 
 void EmbeddedObjectRef::UpdateReplacementOnDemand()
commit a5c249aa4fa37f6ad7ddc891e6c84f68265c99ab
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon May 28 14:41:20 2018 +0300

    tdf#117850: Just call _Exit() in our applicationWillTerminate:
    
    Sure, it is just a workaround, but a very effective workaround.
    
    Change-Id: Id0daff048a27dae5cf8fb5e0e949c5b21e03fc86
    Reviewed-on: https://gerrit.libreoffice.org/54924
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit aa81a086bd3dcd7d6b830951619f310bd0aff30c)
    Reviewed-on: https://gerrit.libreoffice.org/54995
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit b1eeeaccc3337510df93b147f5905fca3416fc48)

diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index 09c3a8001f2d..61dac67b5d77 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -22,6 +22,8 @@
 
 #include <vector>
 
+#include <stdlib.h>
+
 #include <sal/main.h>
 #include <vcl/commandevent.hxx>
 #include <vcl/ImageTree.hxx>
@@ -314,6 +316,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 {
     (void)aNotification;
     sal_detail_deinitialize();
+    _Exit(0);
 }
 
 -(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app
commit 046959f9806a228f303d47daafe5873d733b585a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu May 24 17:29:13 2018 +0200

    tdf#113143 PDF export: fix mis-scaled JPGs on Impress note pages
    
    This is really similar to commit
    4c2172a3e973bc6351107a3a1b554c77b40b75dd (tdf#106702 PDF export: fix
    missing images from Writer headers/footers, 2018-05-22) just this one is
    about the size of the output rectangle for JPG content, while the
    previous problem was about the position of them.
    
    Also extract PdfExportTest::exportAndParse() from the last two tests to
    avoid duplication.
    
    (cherry picked from commit 89dc667cebfec5315f0c0361e49d759e88458689)
    
    Change-Id: I9812924d505e9fdaca2a95b4990e7aaa5e44fd7f
    Reviewed-on: https://gerrit.libreoffice.org/54989
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 257014ce03dee29506e8e70c204e912c4ed33172)

diff --git a/vcl/qa/cppunit/pdfexport/data/tdf113143.odp b/vcl/qa/cppunit/pdfexport/data/tdf113143.odp
new file mode 100644
index 000000000000..5f8a1b10e2e5
Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf113143.odp differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 9e6924f2e66a..da3da74fc63d 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -40,8 +40,13 @@ class PdfExportTest : public test::BootstrapFixture, public unotest::MacrosTest
     uno::Reference<lang::XComponent> mxComponent;
     FPDF_PAGE mpPdfPage = nullptr;
     FPDF_DOCUMENT mpPdfDocument = nullptr;
+    utl::TempFile maTempFile;
+    SvMemoryStream maMemory;
+    // Export the document as PDF, then parse it with PDFium.
+    void exportAndParse(const OUString& rURL, const utl::MediaDescriptor& rDescriptor);
 
 public:
+    PdfExportTest();
     virtual void setUp() override;
     virtual void tearDown() override;
     void load(const OUString& rFile, vcl::filter::PDFDocument& rDocument);
@@ -77,6 +82,7 @@ public:
     void testTdf109143();
     void testTdf105954();
     void testTdf106702();
+    void testTdf113143();
 
     CPPUNIT_TEST_SUITE(PdfExportTest);
     CPPUNIT_TEST(testTdf106059);
@@ -102,9 +108,32 @@ public:
     CPPUNIT_TEST(testTdf109143);
     CPPUNIT_TEST(testTdf105954);
     CPPUNIT_TEST(testTdf106702);
+    CPPUNIT_TEST(testTdf113143);
     CPPUNIT_TEST_SUITE_END();
 };
 
+PdfExportTest::PdfExportTest()
+{
+    maTempFile.EnableKillingFile();
+}
+
+void PdfExportTest::exportAndParse(const OUString& rURL, const utl::MediaDescriptor& rDescriptor)
+{
+    // Import the bugdoc and export as PDF.
+    mxComponent = loadFromDesktop(rURL);
+    CPPUNIT_ASSERT(mxComponent.is());
+
+    uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+    xStorable->storeToURL(maTempFile.GetURL(), rDescriptor.getAsConstPropertyValueList());
+
+    // Parse the export result with pdfium.
+    SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
+    maMemory.WriteStream(aFile);
+    mpPdfDocument
+        = FPDF_LoadMemDocument(maMemory.GetData(), maMemory.GetSize(), /*password=*/nullptr);
+    CPPUNIT_ASSERT(mpPdfDocument);
+}
+
 void PdfExportTest::setUp()
 {
     test::BootstrapFixture::setUp();
@@ -142,14 +171,12 @@ void PdfExportTest::load(const OUString& rFile, vcl::filter::PDFDocument& rDocum
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result.
-    SvFileStream aStream(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
     CPPUNIT_ASSERT(rDocument.Read(aStream));
 }
 
@@ -161,8 +188,6 @@ void PdfExportTest::testTdf106059()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
     // Explicitly enable the usage of the reference XObject markup.
@@ -170,11 +195,11 @@ void PdfExportTest::testTdf106059()
         {"UseReferenceXObject", uno::Any(true) }
     }));
     aMediaDescriptor["FilterData"] <<= aFilterData;
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result.
     vcl::filter::PDFDocument aDocument;
-    SvFileStream aStream(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
     CPPUNIT_ASSERT(aDocument.Read(aStream));
 
     // Assert that the XObject in the page resources dictionary is a reference XObject.
@@ -241,14 +266,12 @@ void PdfExportTest::testTdf105461()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result with pdfium.
-    SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
     SvMemoryStream aMemory;
     aMemory.WriteStream(aFile);
     mpPdfDocument = FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr);
@@ -289,19 +312,17 @@ void PdfExportTest::testTdf107868()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     uno::Reference<view::XPrintable> xPrintable(mxComponent, uno::UNO_QUERY);
     CPPUNIT_ASSERT(xPrintable.is());
     uno::Sequence<beans::PropertyValue> aOptions(comphelper::InitPropertySequence(
     {
-        {"FileName", uno::makeAny(aTempFile.GetURL())},
+        {"FileName", uno::makeAny(maTempFile.GetURL())},
         {"Wait", uno::makeAny(true)}
     }));
     xPrintable->print(aOptions);
 
     // Parse the export result with pdfium.
-    SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
     SvMemoryStream aMemory;
     aMemory.WriteStream(aFile);
     mpPdfDocument = FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr);
@@ -376,15 +397,13 @@ void PdfExportTest::testTdf106206()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result.
     vcl::filter::PDFDocument aDocument;
-    SvFileStream aStream(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
     CPPUNIT_ASSERT(aDocument.Read(aStream));
 
     // The document has one page.
@@ -427,15 +446,13 @@ void PdfExportTest::testTdf109143()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result.
     vcl::filter::PDFDocument aDocument;
-    SvFileStream aStream(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
     CPPUNIT_ASSERT(aDocument.Read(aStream));
 
     // The document has one page.
@@ -467,15 +484,13 @@ void PdfExportTest::testTdf106972()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result.
     vcl::filter::PDFDocument aDocument;
-    SvFileStream aStream(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
     CPPUNIT_ASSERT(aDocument.Read(aStream));
 
     // Get access to the only form object on the only page.
@@ -513,15 +528,13 @@ void PdfExportTest::testTdf106972Pdf17()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result.
     vcl::filter::PDFDocument aDocument;
-    SvFileStream aStream(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
     CPPUNIT_ASSERT(aDocument.Read(aStream));
 
     // Get access to the only image on the only page.
@@ -734,14 +747,12 @@ void PdfExportTest::testTdf108963()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result with pdfium.
-    SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
     SvMemoryStream aMemory;
     aMemory.WriteStream(aFile);
     mpPdfDocument = FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr);
@@ -932,14 +943,12 @@ void PdfExportTest::testTdf115117_1a()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result with pdfium.
-    SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
     SvMemoryStream aMemory;
     aMemory.WriteStream(aFile);
     mpPdfDocument = FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr);
@@ -977,14 +986,12 @@ void PdfExportTest::testTdf115117_2a()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result with pdfium.
-    SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
     SvMemoryStream aMemory;
     aMemory.WriteStream(aFile);
     mpPdfDocument = FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr);
@@ -1018,18 +1025,16 @@ void PdfExportTest::testTdf105954()
     CPPUNIT_ASSERT(mxComponent.is());
 
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
     uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence(
         { { "ReduceImageResolution", uno::Any(true) },
           { "MaxImageResolution", uno::Any(static_cast<sal_Int32>(300)) } }));
     aMediaDescriptor["FilterData"] <<= aFilterData;
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+    xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
 
     // Parse the export result with pdfium.
-    SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
+    SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
     SvMemoryStream aMemory;
     aMemory.WriteStream(aFile);
     mpPdfDocument
@@ -1058,23 +1063,9 @@ void PdfExportTest::testTdf106702()
 {
     // Import the bugdoc and export as PDF.
     OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf106702.odt";
-    mxComponent = loadFromDesktop(aURL);
-    CPPUNIT_ASSERT(mxComponent.is());
-
-    uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
     utl::MediaDescriptor aMediaDescriptor;
     aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
-
-    // Parse the export result with pdfium.
-    SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
-    SvMemoryStream aMemory;
-    aMemory.WriteStream(aFile);
-    mpPdfDocument
-        = FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr);
-    CPPUNIT_ASSERT(mpPdfDocument);
+    exportAndParse(aURL, aMediaDescriptor);
 
     // The document has two pages.
     CPPUNIT_ASSERT_EQUAL(2, FPDF_GetPageCount(mpPdfDocument));
@@ -1119,6 +1110,62 @@ void PdfExportTest::testTdf106702()
     CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
 }
 
+void PdfExportTest::testTdf113143()
+{
+    OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf113143.odp";
+    utl::MediaDescriptor aMediaDescriptor;
+    aMediaDescriptor["FilterName"] <<= OUString("impress_pdf_Export");
+    uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({
+        { "ExportNotesPages", uno::Any(true) },
+        // ReduceImageResolution is on by default and that hides the bug we
+        // want to test.
+        { "ReduceImageResolution", uno::Any(false) },
+    }));
+    aMediaDescriptor["FilterData"] <<= aFilterData;
+    exportAndParse(aURL, aMediaDescriptor);
+
+    // The document has two pages.
+    CPPUNIT_ASSERT_EQUAL(2, FPDF_GetPageCount(mpPdfDocument));
+
+    // First has the original (larger) image.
+    mpPdfPage = FPDF_LoadPage(mpPdfDocument, /*page_index=*/0);
+    CPPUNIT_ASSERT(mpPdfPage);
+    int nLarger = 0;
+    int nPageObjectCount = FPDFPage_CountObjects(mpPdfPage);
+    for (int i = 0; i < nPageObjectCount; ++i)
+    {
+        FPDF_PAGEOBJECT pPageObject = FPDFPage_GetObject(mpPdfPage, i);
+        if (FPDFPageObj_GetType(pPageObject) != FPDF_PAGEOBJ_IMAGE)
+            continue;
+
+        float fLeft = 0, fBottom = 0, fRight = 0, fTop = 0;
+        FPDFPageObj_GetBounds(pPageObject, &fLeft, &fBottom, &fRight, &fTop);
+        nLarger = fRight - fLeft;
+        break;
+    }
+
+    // Second page has the scaled (smaller) image.
+    FPDF_ClosePage(mpPdfPage);
+    mpPdfPage = FPDF_LoadPage(mpPdfDocument, /*page_index=*/1);
+    CPPUNIT_ASSERT(mpPdfPage);
+    int nSmaller = 0;
+    nPageObjectCount = FPDFPage_CountObjects(mpPdfPage);
+    for (int i = 0; i < nPageObjectCount; ++i)
+    {
+        FPDF_PAGEOBJECT pPageObject = FPDFPage_GetObject(mpPdfPage, i);
+        if (FPDFPageObj_GetType(pPageObject) != FPDF_PAGEOBJ_IMAGE)
+            continue;
+
+        float fLeft = 0, fBottom = 0, fRight = 0, fTop = 0;
+        FPDFPageObj_GetBounds(pPageObject, &fLeft, &fBottom, &fRight, &fTop);
+        nSmaller = fRight - fLeft;
+        break;
+    }
+
+    // This failed, both were 319, now nSmaller is 169.
+    CPPUNIT_ASSERT_LESS(nLarger, nSmaller);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(PdfExportTest);
 
 }
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index a31a7d568201..8543da75db9a 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -467,8 +467,9 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc
 
                             // Look up the output rectangle from the previous
                             // bitmap scale action if possible. This has the
-                            // correct position for images repeated in
-                            // Writer headers/footers for non-first pages.
+                            // correct position and size for images with a
+                            // custom translation (Writer header) or scaling
+                            // (Impress notes page).
                             if (rCurGDIMtfAction > 0)
                             {
                                 const MetaAction* pAction = rMtf.GetAction(rCurGDIMtfAction - 1);
@@ -477,6 +478,7 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc
                                     const MetaBmpScaleAction* pA
                                         = static_cast<const MetaBmpScaleAction*>(pAction);
                                     aOutputRect.SetPos(pA->GetPoint());
+                                    aOutputRect.SetSize(pA->GetSize());
                                 }
                             }
 
commit 6c7615023eedd8a574e3a051bc2e4768900a24c5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 28 21:51:01 2018 +0100

    forcepoint#42 check available str length
    
    Change-Id: Ie476968ddaa4c3e5475ae9aa6133e7aba38d5975
    Reviewed-on: https://gerrit.libreoffice.org/54978
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 15ea1cda0b3c37ff944ad9a239b7ed453e8b0591)

diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 67177b7d9f44..89f4140a7a60 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -607,7 +607,7 @@ bool SbiScanner::NextSym()
             case '>': if( *pLine == '=' ) n = 2; break;
             case ':': if( *pLine == '=' ) n = 2; break;
         }
-        aSym = aLine.copy( nCol, n );
+        aSym = aLine.copy(nCol, std::min(n, aLine.getLength() - nCol));
         pLine += n-1; nCol = nCol + n;
     }
 
commit 166fb85a421cc0de1331b5ba3f4e2a89bf631a07
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 28 21:36:16 2018 +0100

    forcepoint#41 null deref
    
    Change-Id: I16e9e083811c6e14861da1ba1df7d46e8c8771d7
    Reviewed-on: https://gerrit.libreoffice.org/54974
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 0a2035492c66bc323d84ad6c2c4cbc0dc3c9d9aa)

diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index 2120b8f04280..91604803f8eb 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -74,8 +74,6 @@ namespace drawinglayer
         {
             // #121194# Todo: use alpha channel, too (for 3d)
             maBitmap = maBitmapEx.GetBitmap();
-            mpReadBitmap = Bitmap::ScopedReadAccess(maBitmap);
-            OSL_ENSURE(mpReadBitmap, "GeoTexSvxBitmapEx: Got no read access to Bitmap (!)");
 
             if(mbIsTransparent)
             {
@@ -92,8 +90,13 @@ namespace drawinglayer
                 mpReadTransparence = Bitmap::ScopedReadAccess(maTransparence);
             }
 
-            mfMulX = (double)mpReadBitmap->Width() / maSize.getX();
-            mfMulY = (double)mpReadBitmap->Height() / maSize.getY();
+            mpReadBitmap = Bitmap::ScopedReadAccess(maBitmap);
+            SAL_WARN_IF(!mpReadBitmap, "drawinglayer", "GeoTexSvxBitmapEx: Got no read access to Bitmap");
+            if (mpReadBitmap)
+            {
+                mfMulX = static_cast<double>(mpReadBitmap->Width()) / maSize.getX();
+                mfMulY = static_cast<double>(mpReadBitmap->Height()) / maSize.getY();
+            }
 
             if(maSize.getX() <= 1.0)
             {
commit fb8253f09342ae62a659c9528b3ea65bd3dec4dd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 28 21:22:56 2018 +0100

    forcepoint#40 null deref
    
    presumably since
    
    commit 0098bee792c3e208ea4f6ef1c676958d3f4cd207
    Date:   Thu Sep 21 06:48:09 2017 +0200
    
        tdf#112501: Pivot table: popupbuttons are placed on wrong cells
    
    Change-Id: I5413c0ba06fca25cb22256a20ef9640767dd9e50
    Reviewed-on: https://gerrit.libreoffice.org/54970
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 69c5be9b26cf1a45e220d69f65b1bb0fa2aedaf6)

diff --git a/sc/qa/unit/data/xls/forcepoint-pivot-1.xls b/sc/qa/unit/data/xls/forcepoint-pivot-1.xls
new file mode 100644
index 000000000000..12919922666b
Binary files /dev/null and b/sc/qa/unit/data/xls/forcepoint-pivot-1.xls differ
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index e63db6cdb1ab..669d6262cc2d 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1566,13 +1566,13 @@ void XclImpPivotTable::ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveD
         itr    = aFieldBtns.begin();
         itrEnd = aFieldBtns.end();
         vector<const ScDPSaveDimension*>::const_iterator itDim = aFieldDims.begin();
-        for (; itr != itrEnd; ++itr, ++itDim)
+        for (; itr != itrEnd; ++itr)
         {
             ScMF nMFlag = ScMF::Button;
-            const ScDPSaveDimension* pDim = *itDim;
-            if (pDim->HasInvisibleMember())
+            const ScDPSaveDimension* pDim = itDim != aFieldDims.end() ? *itDim++ : nullptr;
+            if (pDim && pDim->HasInvisibleMember())
                 nMFlag |= ScMF::HiddenMember;
-            if (!pDim->IsDataLayout())
+            if (!pDim || !pDim->IsDataLayout())
                 nMFlag |= ScMF::ButtonPopup;
             rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag);
         }
commit 2ca9d8c05443edf17b39a6b4fb4efc55478ff014
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 28 10:48:32 2018 +0100

    tdf#117628 crash after closing media player with X11 backend
    
    Change-Id: I812da5ddf7343573f93ea64e592442edb31cad2d
    Reviewed-on: https://gerrit.libreoffice.org/54912
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit d9c5e7f4aef8da58b2b59e3259d1704296648cbf)

diff --git a/vcl/inc/unx/salobj.h b/vcl/inc/unx/salobj.h
index 8eb91b917efe..4a0535507dc2 100644
--- a/vcl/inc/unx/salobj.h
+++ b/vcl/inc/unx/salobj.h
@@ -56,6 +56,7 @@ class VCLPLUG_GEN_PUBLIC X11SalObject : public SalObject
 public:
     SystemEnvData maSystemChildData;
     SalFrame*       mpParent;
+    ::Window        maParentWin;
     ::Window        maPrimary;
     ::Window        maSecondary;
     Colormap        maColormap;
diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx
index 9d0833094c1d..de41bc8bf8cb 100644
--- a/vcl/unx/generic/window/salobj.cxx
+++ b/vcl/unx/generic/window/salobj.cxx
@@ -62,7 +62,8 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
     SalDisplay* pSalDisp        = vcl_sal::getSalDisplay(GetGenericUnixSalData());
     const SystemEnvData* pEnv   = pParent->GetSystemData();
     Display* pDisp              = pSalDisp->GetDisplay();
-    ::Window aObjectParent      = (::Window)pEnv->aWindow;
+    ::Window aObjectParent      = static_cast<::Window>(pEnv->aWindow);
+    pObject->maParentWin = aObjectParent;
 
     // find out on which screen that window is
     XWindowAttributes aParentAttr;
@@ -235,8 +236,7 @@ X11SalObject::~X11SalObject()
     rObjects.remove( this );
 
     GetGenericUnixSalData()->ErrorTrapPush();
-    const SystemEnvData* pEnv   = mpParent->GetSystemData();
-    ::Window aObjectParent      = (::Window)pEnv->aWindow;
+    ::Window aObjectParent = maParentWin;
     XSetWindowBackgroundPixmap(static_cast<Display*>(maSystemChildData.pDisplay), aObjectParent, None);
     if ( maSecondary )
         XDestroyWindow( static_cast<Display*>(maSystemChildData.pDisplay), maSecondary );
@@ -400,12 +400,11 @@ bool X11SalObject::Dispatch( XEvent* pEvent )
                )
             {
                 SalMouseEvent aEvt;
-                const SystemEnvData* pParentData = pObject->mpParent->GetSystemData();
                 int dest_x, dest_y;
                 ::Window aChild = None;
                 XTranslateCoordinates( pEvent->xbutton.display,
                                        pEvent->xbutton.root,
-                                       pParentData->aWindow,
+                                       pObject->maParentWin,
                                        pEvent->xbutton.x_root,
                                        pEvent->xbutton.y_root,
                                        &dest_x, &dest_y,
@@ -466,9 +465,8 @@ bool X11SalObject::Dispatch( XEvent* pEvent )
 void X11SalObject::SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& rLeaveArgs, const css::uno::Sequence<css::uno::Any>& rEnterArgs)
 {
     SalDisplay* pSalDisp        = vcl_sal::getSalDisplay(GetGenericUnixSalData());
-    const SystemEnvData* pEnv   = mpParent->GetSystemData();
     Display* pDisp              = pSalDisp->GetDisplay();
-    ::Window aObjectParent      = (::Window)pEnv->aWindow;
+    ::Window aObjectParent      = maParentWin;
 
     bool bFreePixmap = false;
     Pixmap aPixmap = None;
commit a973dd377e096f17f6c4a3d21ebc16ad4af03b57
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date:   Thu Apr 19 18:56:55 2018 +0200

    tdf#115582 Correct coordinate usage for sc's ::Array
    
    In ScOutputData::SetCellRotations() eventually existing
    CellRotations are added to the svx::frame::Array data
    that gets created for repaint. This used the wrong coordinate
    calculation, thus in some cases the repaint of rotated
    Cells failed.
    
    Change-Id: Ib5df8576e8c9404d717d5dcc5662aa04b82cf959
    Reviewed-on: https://gerrit.libreoffice.org/53171
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Armin Le Grand <Armin.Le.Grand at cib.de>
    (cherry picked from commit 0185e65bcd73dbad2205a39369e1e06b33a2ca51)
    Reviewed-on: https://gerrit.libreoffice.org/54922
    (cherry picked from commit 08e45e11a0e74cdb4a17ec29df9d03ad03b7f7c0)

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 5093f947eebf..29738f46ee57 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -658,13 +658,22 @@ void ScOutputData::SetCellRotations()
                         // Needed for CellInfo internal decisions (bg fill, ...)
                         pInfo->nRotateDir = nDir;
 
-                        // add rotation info to Array information
-                        const long nAttrRotate(pPattern->GetRotateVal(pCondSet));
-                        const SvxRotateMode eRotMode(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue());
-                        const double fOrient((bLayoutRTL ? -1.0 : 1.0) * nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
-                        svx::frame::Array& rArray = mrTabInfo.maArray;
+                        // create target coordinates
+                        const SCCOL nTargetX(nX - nVisX1 + 1);
+                        const SCROW nTargetY(nY - nVisY1 + 1);
 
-                        rArray.SetCellRotation(nX+1, nY+1, eRotMode, fOrient);
+                        // Check for values - below in SetCellRotation these will
+                        // be converted to size_t and thus may not be negative
+                        if(nTargetX >= 0 && nTargetY >= 0)
+                        {
+                            // add rotation info to Array information
+                            const long nAttrRotate(pPattern->GetRotateVal(pCondSet));
+                            const SvxRotateMode eRotMode(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue());
+                            const double fOrient((bLayoutRTL ? -1.0 : 1.0) * nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
+                            svx::frame::Array& rArray = mrTabInfo.maArray;
+
+                            rArray.SetCellRotation(nTargetX, nTargetY, eRotMode, fOrient);
+                        }
                     }
                 }
             }
commit bdc36e33cb2ab3b9c2a75a78e25c8c0e878b69cf
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Tue May 15 11:13:05 2018 +0200

    tdf#117172 - Image context menu Save fails to do anything
    
    Change-Id: I5c0980d85ef5ed050bfafbc368576c5ad72a80a7
    Reviewed-on: https://gerrit.libreoffice.org/54359
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 796bee47e90efee7c076f6acdc2a95004ed081d0)
    Reviewed-on: https://gerrit.libreoffice.org/54931
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit b582ec97fbcce88fa1a39bc7fe2a2ae084f30e35)

diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index 9e8f3dfceab8..6ec0b53fb70d 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -331,6 +331,13 @@ OUString GraphicHelper::ExportGraphic(const vcl::Window* pParent, const Graphic&
                     return sPath;
                 }
             }
+            else
+            {
+                XOutBitmap::WriteGraphic( rGraphic, sPath, aFilter,
+                                            XOutFlags::DontExpandFilename |
+                                            XOutFlags::DontAddExtension |
+                                            XOutFlags::UseNativeIfPossible );
+            }
         }
     }
     return OUString();
commit 6fd6fd43f94e9bc824384876aaa9b91ef6abba80
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Wed May 23 11:12:23 2018 +0200

    tdf#117729 add Frisian (fy) UI langauge
    
    Change-Id: I46f75e969b1252a95118888507c116f44578dfbd
    Reviewed-on: https://gerrit.libreoffice.org/54699
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit f8fb04d0af7b1d21b8638e92922d0965e507c5d9)
    (cherry picked from commit 9bf385b15439f25b89fe7c53a967a0941440226e)

diff --git a/l10ntools/source/ulfconv/msi-encodinglist.txt b/l10ntools/source/ulfconv/msi-encodinglist.txt
index 9670f9ea0af6..44d7f91b2650 100644
--- a/l10ntools/source/ulfconv/msi-encodinglist.txt
+++ b/l10ntools/source/ulfconv/msi-encodinglist.txt
@@ -58,6 +58,7 @@ fi       0  1035
 fo       0  1080   # Faroese
 fr       0  1036
 fr-CA    0  3084
+fy       0  1122   # Frisian
 fur      0  1585
 ga       0  2108   # Irish
 gd       0  1084   # Gaelic (Scotland)
diff --git a/scp2/source/ooo/module_langpack.ulf b/scp2/source/ooo/module_langpack.ulf
index 113f01906c5a..ca1c40b2a7db 100644
--- a/scp2/source/ooo/module_langpack.ulf
+++ b/scp2/source/ooo/module_langpack.ulf
@@ -40,6 +40,12 @@ en-US = "French"
 [STR_DESC_MODULE_LANGPACK_FR]
 en-US = "Installs the French user interface"
 
+[STR_NAME_MODULE_LANGPACK_FY]
+en-US = "Frisian"
+
+[STR_DESC_MODULE_LANGPACK_FY]
+en-US = "Installs the Frisian user interface"
+
 [STR_NAME_MODULE_LANGPACK_IT]
 en-US = "Italian"
 
diff --git a/solenv/inc/langlist.mk b/solenv/inc/langlist.mk
index 41b557a420c4..d0c5cb5cba78 100644
--- a/solenv/inc/langlist.mk
+++ b/solenv/inc/langlist.mk
@@ -49,6 +49,7 @@ eu \
 fa \
 fi \
 fr \
+fy \
 ga \
 gd \
 gl \
commit 8b949c8a4dbdb3db6454e1c400835d9c814a15ca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 25 14:37:03 2018 +0100

    tdf#117601 a11y crash after merging cells
    
    this is similar to tdf#87199, in this case the accessibiles for the merged
    cells are not visible so not removed when their frame is deleted, but remain
    in the cache pointing to invalid frames.
    
    Change-Id: Ibc5b9f27541683b8f3604839fa3d1431380a4039
    Reviewed-on: https://gerrit.libreoffice.org/54903
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit bab7384c005921768a9499550c1525d211aeddf9)

diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 2739b1a78a01..8582e2354347 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -292,6 +292,9 @@ public:
     Point PixelToCore (const Point& rPoint) const;
     tools::Rectangle CoreToPixel (const tools::Rectangle& rRect) const;
 
+    // is there a known accessibility impl cached for the frame
+    bool Contains(const SwFrame *pFrame) const;
+
 private:
     /** get mapping mode for LogicToPixel and PixelToLogic conversions
 
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 46e0be9ce220..176358fd4907 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -402,8 +402,12 @@ void SwAccessibleContext::DisposeChildren(const SwFrame *pFrame,
         if( pLower )
         {
             ::rtl::Reference< SwAccessibleContext > xAccImpl;
-            if( rLower.IsAccessible( GetShell()->IsPreview() ) )
+            if (rLower.IsAccessible(GetShell()->IsPreview())
+                       // tdf#117601 dispose the darn thing if it ever was accessible
+                    || GetMap()->Contains(pLower))
+            {
                 xAccImpl = GetMap()->GetContextImpl( pLower, false );
+            }
             if( xAccImpl.is() )
                 xAccImpl->Dispose( bRecursive );
             else
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 98a50e784b5b..7047b4ddce47 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2162,6 +2162,11 @@ void SwAccessibleMap::RemoveContext( const SdrObject *pObj )
     }
 }
 
+bool SwAccessibleMap::Contains(const SwFrame *pFrame) const
+{
+    return (pFrame && mpFrameMap && mpFrameMap->find(pFrame) != mpFrameMap->end());
+}
+
 void SwAccessibleMap::A11yDispose( const SwFrame *pFrame,
                                    const SdrObject *pObj,
                                    vcl::Window* pWindow,
@@ -2177,9 +2182,9 @@ void SwAccessibleMap::A11yDispose( const SwFrame *pFrame,
     OSL_ENSURE( !aFrameOrObj.GetSwFrame() || aFrameOrObj.GetSwFrame()->IsAccessibleFrame(),
             "non accessible frame should be disposed" );
 
-    if (aFrameOrObj.IsAccessible( GetShell()->IsPreview() )
-            // fdo#87199 dispose the darn thing if it ever was accessible
-        || (pFrame && mpFrameMap && mpFrameMap->find(pFrame) != mpFrameMap->end()))
+    if (aFrameOrObj.IsAccessible(GetShell()->IsPreview())
+               // fdo#87199 dispose the darn thing if it ever was accessible
+            || Contains(pFrame))
     {
         ::rtl::Reference< SwAccessibleContext > xAccImpl;
         ::rtl::Reference< SwAccessibleContext > xParentAccImpl;
commit 4052526b0a3e843b0c4d4c57facdcc195b728844
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed May 23 17:54:37 2018 +0200

    tdf#104086 cui: enable OpenGL when ignoring its blacklist
    
    "Ignore OpenGL blacklist" is called "force OpenGL" in the code, so it
    make sense that OpenGLHelper::isVCLOpenGLEnabled() returns true in that
    case. But the UI suggested that enabling ignore doesn't enable OpenGL
    itself.
    
    Fix this by auto-checking the parent UI widget when enabling the
    blacklist.
    
    (cherry picked from commit 8118a5d2eb1524768784adc0b143b8cc1b9f3f61)
    
    Conflicts:
            cui/source/options/optgdlg.cxx
    
    Change-Id: I16bec69aebd645858260850f15ea8e687566fd0e
    Reviewed-on: https://gerrit.libreoffice.org/54763
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 6e37f748096a7fd7d7a3a07b2393c5f8960cfeb5)

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 1c90931c7afb..38acc1d22b4f 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -663,6 +663,8 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
 
 #endif
 
+    m_pForceOpenGL->SetToggleHdl(LINK(this, OfaViewTabPage, OnForceOpenGLToggled));
+
     // Set known icon themes
     OUString sAutoStr( m_pIconStyleLB->GetEntry( 0 ) );
     m_pIconStyleLB->Clear();
@@ -739,6 +741,13 @@ IMPL_LINK_NOARG( OfaViewTabPage, OnAntialiasingToggled, CheckBox&, void )
 }
 #endif
 
+IMPL_LINK_NOARG(OfaViewTabPage, OnForceOpenGLToggled, CheckBox&, void)
+{
+    if (m_pForceOpenGL->IsChecked())
+        // Ignoring the opengl blacklist implies that opengl is on.
+        m_pUseOpenGL->Check();
+}
+
 VclPtr<SfxTabPage> OfaViewTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
 {
     return VclPtr<OfaViewTabPage>::Create(pParent, *rAttrSet);
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index ceba711ede24..b7e47e722edc 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -121,6 +121,7 @@ private:
 #if defined( UNX )
     DECL_LINK( OnAntialiasingToggled, CheckBox&, void );
 #endif
+    DECL_LINK(OnForceOpenGLToggled, CheckBox&, void);
     void UpdateOGLStatus();
 
 public:
commit 4dbc7929474d23c143a1be9618c64019cb48c038
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue May 22 16:20:18 2018 +0200

    tdf#106702 PDF export: fix missing images from Writer headers/footers
    
    Position of an image is determined by the relevant bitmap scale metafile
    action when recompressing images.
    
    The same position was determined by PDFExtOutDevData "meta" info when
    not recompressing images. This second rectangle was never correct for
    images repeated in Writer headers/footers on non-first pages: the
    position was relative to the page, while PDF export sets the map mode
    (origin) of the output device during export, so such positions are
    expected to be absolute ones.
    
    The root of the problem seems to be that header images in Writer are
    both repeated (as the user sees it) and unrepeated (as the doc model
    sees it), and by the time we want to get its position, we only see the
    unrepeated SdrObject.
    
    Fix the problem by using the correct position from the scale action and
    not from PDFExtOutDevData if possible.
    
    (Also give up on running CppunitTest_vcl_pdfexport in the non-pdfium
    case, most of the tests there do require pdfium anyway, and the growing
    ifdef forest in that file just made it hard to read the code.)
    
    (cherry picked from commit 4c2172a3e973bc6351107a3a1b554c77b40b75dd)
    
    Conflicts:
            vcl/Module_vcl.mk
            vcl/qa/cppunit/pdfexport/pdfexport.cxx
    
    Change-Id: I31c14d4bd223b2804859982542ebd6d5f9abd312
    Reviewed-on: https://gerrit.libreoffice.org/54690
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 327c7ee43fbe53df63693d020356ddf4df56d7f1)

diff --git a/include/vcl/pdfextoutdevdata.hxx b/include/vcl/pdfextoutdevdata.hxx
index 22079323580c..b8bbe589d491 100644
--- a/include/vcl/pdfextoutdevdata.hxx
+++ b/include/vcl/pdfextoutdevdata.hxx
@@ -97,7 +97,7 @@ public:
     PDFExtOutDevData( const OutputDevice& rOutDev );
     virtual ~PDFExtOutDevData() override;
 
-    bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction );
+    bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const GDIMetaFile& rMtf );
     void ResetSyncData();
 
     void PlayGlobalActions( PDFWriter& rWriter );
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index e27b4db56ab9..40fee27321b4 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -173,10 +173,14 @@ $(eval $(call gb_Module_add_check_targets,vcl,\
 	CppunitTest_vcl_app_test \
 	CppunitTest_vcl_jpeg_read_write_test \
 	CppunitTest_vcl_svm_test \
-	CppunitTest_vcl_pdfexport \
     CppunitTest_vcl_errorhandler \
 ))
 
+ifneq (,$(filter PDFIUM,$(BUILD_TYPE)))
+$(eval $(call gb_Module_add_check_targets,vcl,\
+	CppunitTest_vcl_pdfexport \
+))
+endif
 
 ifeq ($(USING_X11),TRUE)
 $(eval $(call gb_Module_add_check_targets,vcl,\
diff --git a/vcl/qa/cppunit/pdfexport/data/tdf106702.odt b/vcl/qa/cppunit/pdfexport/data/tdf106702.odt
new file mode 100644
index 000000000000..da3b7e81456e
Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf106702.odt differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index b2ebb23cf6cd..9e6924f2e66a 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -24,11 +24,9 @@
 #include <unotools/tempfile.hxx>
 #include <vcl/filter/pdfdocument.hxx>
 #include <tools/zcodec.hxx>
-#if HAVE_FEATURE_PDFIUM
 #include <fpdf_edit.h>
 #include <fpdf_text.h>
 #include <fpdfview.h>
-#endif
 
 using namespace ::com::sun::star;
 
@@ -40,15 +38,12 @@ class PdfExportTest : public test::BootstrapFixture, public unotest::MacrosTest
 {
     uno::Reference<uno::XComponentContext> mxComponentContext;
     uno::Reference<lang::XComponent> mxComponent;
-#if HAVE_FEATURE_PDFIUM
     FPDF_PAGE mpPdfPage = nullptr;
     FPDF_DOCUMENT mpPdfDocument = nullptr;
-#endif
 
 public:
     virtual void setUp() override;
     virtual void tearDown() override;
-#if HAVE_FEATURE_PDFIUM
     void load(const OUString& rFile, vcl::filter::PDFDocument& rDocument);
     /// Tests that a pdf image is roundtripped back to PDF as a vector format.
     void testTdf106059();
@@ -79,12 +74,11 @@ public:
     /// Text extracting RTL text with ligatures.
     void testTdf115117_2a();
 #endif
-    void testTdf105954();
-#endif
     void testTdf109143();
+    void testTdf105954();
+    void testTdf106702();
 
     CPPUNIT_TEST_SUITE(PdfExportTest);
-#if HAVE_FEATURE_PDFIUM
     CPPUNIT_TEST(testTdf106059);
     CPPUNIT_TEST(testTdf105461);
     CPPUNIT_TEST(testTdf107868);
@@ -105,9 +99,9 @@ public:
     CPPUNIT_TEST(testTdf115117_2);
     CPPUNIT_TEST(testTdf115117_2a);
 #endif
-    CPPUNIT_TEST(testTdf105954);
-#endif
     CPPUNIT_TEST(testTdf109143);
+    CPPUNIT_TEST(testTdf105954);
+    CPPUNIT_TEST(testTdf106702);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -118,23 +112,19 @@ void PdfExportTest::setUp()
     mxComponentContext.set(comphelper::getComponentContext(getMultiServiceFactory()));
     mxDesktop.set(frame::Desktop::create(mxComponentContext));
 
-#if HAVE_FEATURE_PDFIUM
     FPDF_LIBRARY_CONFIG config;
     config.version = 2;
     config.m_pUserFontPaths = nullptr;
     config.m_pIsolate = nullptr;
     config.m_v8EmbedderSlot = 0;
     FPDF_InitLibraryWithConfig(&config);
-#endif
 }
 
 void PdfExportTest::tearDown()
 {
-#if HAVE_FEATURE_PDFIUM
     FPDF_ClosePage(mpPdfPage);
     FPDF_CloseDocument(mpPdfDocument);
     FPDF_DestroyLibrary();
-#endif
 
     if (mxComponent.is())
         mxComponent->dispose();
@@ -142,8 +132,6 @@ void PdfExportTest::tearDown()
     test::BootstrapFixture::tearDown();
 }
 
-#if HAVE_FEATURE_PDFIUM
-
 char const DATA_DIRECTORY[] = "/vcl/qa/cppunit/pdfexport/data/";
 
 void PdfExportTest::load(const OUString& rFile, vcl::filter::PDFDocument& rDocument)
@@ -1066,7 +1054,70 @@ void PdfExportTest::testTdf105954()
     CPPUNIT_ASSERT_LESS(static_cast<unsigned int>(250), aMeta.width);
 }
 
-#endif
+void PdfExportTest::testTdf106702()
+{
+    // Import the bugdoc and export as PDF.
+    OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf106702.odt";
+    mxComponent = loadFromDesktop(aURL);
+    CPPUNIT_ASSERT(mxComponent.is());
+
+    uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+    utl::TempFile aTempFile;
+    aTempFile.EnableKillingFile();
+    utl::MediaDescriptor aMediaDescriptor;
+    aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+    xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+
+    // Parse the export result with pdfium.
+    SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
+    SvMemoryStream aMemory;
+    aMemory.WriteStream(aFile);
+    mpPdfDocument
+        = FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr);
+    CPPUNIT_ASSERT(mpPdfDocument);
+
+    // The document has two pages.
+    CPPUNIT_ASSERT_EQUAL(2, FPDF_GetPageCount(mpPdfDocument));
+
+    // First page already has the correct image position.
+    mpPdfPage = FPDF_LoadPage(mpPdfDocument, /*page_index=*/0);
+    CPPUNIT_ASSERT(mpPdfPage);
+    int nExpected = 0;
+    int nPageObjectCount = FPDFPage_CountObjects(mpPdfPage);
+    for (int i = 0; i < nPageObjectCount; ++i)
+    {
+        FPDF_PAGEOBJECT pPageObject = FPDFPage_GetObject(mpPdfPage, i);
+        if (FPDFPageObj_GetType(pPageObject) != FPDF_PAGEOBJ_IMAGE)
+            continue;
+
+        float fLeft = 0, fBottom = 0, fRight = 0, fTop = 0;
+        FPDFPageObj_GetBounds(pPageObject, &fLeft, &fBottom, &fRight, &fTop);
+        nExpected = fTop;
+        break;
+    }
+
+    // Second page had an incorrect image position.
+    FPDF_ClosePage(mpPdfPage);
+    mpPdfPage = FPDF_LoadPage(mpPdfDocument, /*page_index=*/1);
+    CPPUNIT_ASSERT(mpPdfPage);
+    int nActual = 0;
+    nPageObjectCount = FPDFPage_CountObjects(mpPdfPage);
+    for (int i = 0; i < nPageObjectCount; ++i)
+    {
+        FPDF_PAGEOBJECT pPageObject = FPDFPage_GetObject(mpPdfPage, i);
+        if (FPDFPageObj_GetType(pPageObject) != FPDF_PAGEOBJ_IMAGE)
+            continue;
+
+        float fLeft = 0, fBottom = 0, fRight = 0, fTop = 0;
+        FPDFPageObj_GetBounds(pPageObject, &fLeft, &fBottom, &fRight, &fTop);
+        nActual = fTop;
+        break;
+    }
+
+    // This failed, vertical pos is 818 points, was 1674 (outside visible page
+    // bounds).
+    CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
+}
 
 CPPUNIT_TEST_SUITE_REGISTRATION(PdfExportTest);
 
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 3c689c3ccce0..a31a7d568201 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -22,6 +22,7 @@
 #include <vcl/outdev.hxx>
 #include <vcl/gfxlink.hxx>
 #include <vcl/dllapi.h>
+#include <vcl/metaact.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
 
@@ -301,7 +302,7 @@ struct PageSyncData
     { mpGlobalData = pGlobal; }
 
     void PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDataSync::Action eAct );
-    bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const PDFExtOutDevData& rOutDevData );
+    bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const GDIMetaFile& rMtf, const PDFExtOutDevData& rOutDevData );
 };
 
 void PageSyncData::PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDataSync::Action eAct )
@@ -317,7 +318,7 @@ void PageSyncData::PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDa
         aSync.nIdx = 0x7fffffff;    // sync not possible
     mActions.push_back( aSync );
 }
-bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const PDFExtOutDevData& rOutDevData )
+bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const GDIMetaFile& rMtf, const PDFExtOutDevData& rOutDevData )
 {
     bool bRet = false;
     if ( mActions.size() && ( mActions.front().nIdx == rCurGDIMtfAction ) )
@@ -463,6 +464,22 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc
                         if( pData && nBytes )
                         {
                             aTmp.WriteBytes( pData, nBytes );
+
+                            // Look up the output rectangle from the previous
+                            // bitmap scale action if possible. This has the
+                            // correct position for images repeated in
+                            // Writer headers/footers for non-first pages.
+                            if (rCurGDIMtfAction > 0)
+                            {
+                                const MetaAction* pAction = rMtf.GetAction(rCurGDIMtfAction - 1);
+                                if (pAction && pAction->GetType() == MetaActionType::BMPSCALE)
+                                {
+                                    const MetaBmpScaleAction* pA
+                                        = static_cast<const MetaBmpScaleAction*>(pAction);
+                                    aOutputRect.SetPos(pA->GetPoint());
+                                }
+                            }
+
                             rWriter.DrawJPGBitmap( aTmp, aGraphic.GetBitmap().GetBitCount() > 8, aGraphic.GetSizePixel(), aOutputRect, aMask, aGraphic );
                         }
 
@@ -584,9 +601,9 @@ void PDFExtOutDevData::ResetSyncData()
 {
     *mpPageSyncData = PageSyncData( mpGlobalSyncData );
 }
-bool PDFExtOutDevData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rIdx )
+bool PDFExtOutDevData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rIdx, const GDIMetaFile& rMtf )
 {
-    return mpPageSyncData->PlaySyncPageAct( rWriter, rIdx, *this );
+    return mpPageSyncData->PlaySyncPageAct( rWriter, rIdx, rMtf, *this );
 }
 void PDFExtOutDevData::PlayGlobalActions( PDFWriter& rWriter )
 {
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 9bc58989a46c..e4f567d6bfd9 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -267,7 +267,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
 
     for( sal_uInt32 i = 0, nCount = aMtf.GetActionSize(); i < nCount; )
     {
-        if ( !i_pOutDevData || !i_pOutDevData->PlaySyncPageAct( m_rOuterFace, i ) )
+        if ( !i_pOutDevData || !i_pOutDevData->PlaySyncPageAct( m_rOuterFace, i, aMtf ) )
         {
             const MetaAction*    pAction = aMtf.GetAction( i );
             const MetaActionType nType = pAction->GetType();
commit d8e63f23c28023cdd42860be354189bbe1e4efdc
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue May 22 22:05:24 2018 +0200

    tdf#117505 RTF export: fix incorrect header distance for first/follow pages
    
    In case the first and the follow page format has different header
    distances, the DOC and DOCX import work with the distance from the first
    page format when they take the last item from the MSWordSections
    container at the end of the export.
    
    RTF writes section info before the document content, and in case there
    are separate first and follow page formats, then we work with the follow
    format since commit 20a53cb9e9c7b797c091fe6ac6a34dfb28c61304
    (INTEGRATION: CWS limerickfilterteam08 (1.16.32); FILE MERGED,
    2003-09-01) as a fix for i#13107.
    
    There is no perfect solution here, the sw doc model can store different
    header distances for first and follow pages, while Word works with a
    single distance. But RTF/DOCX/DOC import puts the relevant header
    distance to the first page format and DOCX/DOC export reads the distance
    from there, so be consistent and do the same in the RTF export as well.
    
    This means the DOCX import -> RTF export -> RTF import sequence from the
    bugreport will result in a correct header distance.
    
    (cherry picked from commit 5956828c88501ef1366e60010b05053a8e1e642e)
    
    Change-Id: I3f1fe3080360702c41d680b8785cc3602e74685e
    Reviewed-on: https://gerrit.libreoffice.org/54697
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 8e4a9db1e62871878155207c2c4d252b3705c307)

diff --git a/sw/qa/extras/rtfexport/data/tdf117505.odt b/sw/qa/extras/rtfexport/data/tdf117505.odt
new file mode 100644
index 000000000000..91bde8f92393
Binary files /dev/null and b/sw/qa/extras/rtfexport/data/tdf117505.odt differ
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index e0be1d0c01ae..1ad5b9242426 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -141,6 +141,17 @@ DECLARE_RTFEXPORT_TEST(testTdf117268, "tdf117268.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextRangeCompare->compareRegionStarts(xAnchorCell, xCell));
 }
 
+DECLARE_RTFEXPORT_TEST(testTdf117505, "tdf117505.odt")
+{
+    uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles"));
+    uno::Reference<beans::XPropertySet> xFirstPage(xPageStyles->getByName("First Page"),
+                                                   uno::UNO_QUERY);
+    // This was 499, small header height resulted in visible whitespace from
+    // remaining top margin -> header content moved down.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1499),
+                         getProperty<sal_Int32>(xFirstPage, "HeaderHeight"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 07f57320db08..ca1097eccb12 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3084,7 +3084,14 @@ void RtfAttributeOutput::FormatULSpace(const SvxULSpaceItem& rULSpace)
             if (!m_rExport.GetCurItemSet())
                 return;
 
-            sw::util::HdFtDistanceGlue aDistances(*m_rExport.GetCurItemSet());
+            // If we export a follow page format, then our doc model has
+            // separate header/footer distances for the first page and the
+            // follow pages, but Word can have only a single distance. In case
+            // the two values differ, work with the value from the first page
+            // format to be in sync with the import.
+            sw::util::HdFtDistanceGlue aDistances(m_rExport.GetFirstPageItemSet()
+                                                      ? *m_rExport.GetFirstPageItemSet()
+                                                      : *m_rExport.GetCurItemSet());
 
             if (aDistances.dyaTop)
             {
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 779719756a85..586dd01f23bd 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -1336,7 +1336,10 @@ void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirst
 
     const SwFormat* pFormat = &m_pAktPageDesc->GetMaster(); //GetLeft();
     m_bOutPageDescs = true;
+    if (m_pAktPageDesc != &rPgDsc)
+        m_pFirstPageItemSet = &rPgDsc.GetMaster().GetAttrSet();
     OutputFormat(*pFormat, true, false);
+    m_pFirstPageItemSet = nullptr;
     m_bOutPageDescs = false;
 
     // normal header / footer (without a style)
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index 50ba510f4a7d..869a888e9b25 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -188,6 +188,8 @@ public:
     void InsStyle(sal_uInt16 nId, const OString& rStyle);
     OString* GetStyle(sal_uInt16 nId);
 
+    const SfxItemSet* GetFirstPageItemSet() { return m_pFirstPageItemSet; }
+
 private:
     void WriteFonts();
     void WriteStyles();
@@ -213,6 +215,8 @@ private:
     std::map<OUString, sal_uInt16> m_aRedlineTable;
     /// If set, then Strm() returns this tream, instead of m_pWriter's stream.
     std::unique_ptr<SvMemoryStream> m_pStream;
+    /// Item set of the first page during export of a follow page format.
+    const SfxItemSet* m_pFirstPageItemSet = nullptr;
 };
 
 #endif // INCLUDED_SW_SOURCE_FILTER_WW8_RTFEXPORT_HXX
commit 60929b2a2dc41d0ce008d4faa9b12a5718acaad8
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat May 26 21:30:09 2018 +0200

    tdf#117821: fix copy-paste wrong control type
    
    Since 5ad8376d1698026ccab0634605fdb17ea3c59f3a
    Resolves: tdf#111080 framework user of convert menu needs action names set
    2017-08-08
    
    Change-Id: I2ec8358005e335941bd1c2530f30ce696d3e808f
    Reviewed-on: https://gerrit.libreoffice.org/54865
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 1e9e01dff0a8d65bb10d5a886cca7899b43979da)
    Reviewed-on: https://gerrit.libreoffice.org/54871
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit 694e18cffd8cadc70e76c2b18b614b5ccceafefd)

diff --git a/svx/uiconfig/ui/convertmenu.ui b/svx/uiconfig/ui/convertmenu.ui
index 89d5f953a178..c55f201ecfa6 100644
--- a/svx/uiconfig/ui/convertmenu.ui
+++ b/svx/uiconfig/ui/convertmenu.ui
@@ -80,7 +80,7 @@
     <child>
       <object class="GtkMenuItem" id="ConvertToImageBtn">
         <property name="visible">True</property>
-        <property name="action_name">.uno:ConvertToCombo</property>
+        <property name="action_name">.uno:ConvertToImageBtn</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes" context="convertmenu|ConvertToImageBtn">I_mage Button</property>
         <property name="use_underline">True</property>
commit bc127d5373cea243848befb8004d978d7cf70543
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Dec 6 19:16:19 2017 +0100

    fix variable name
    
    (cherry picked from commit 8978fdf58a403aa62e04d47e65cd799740e6b909)
    Reviewed-on: https://gerrit.libreoffice.org/54807
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit f4f21e3a3bae06bd13bd7cc221502d9373e55994)
    
    Change-Id: Ie3eef59c934f5fe4146a911e4ee652457b94edd8

diff --git a/sysui/productlist.mk b/sysui/productlist.mk
index 8422e3e02731..11bce214e0be 100644
--- a/sysui/productlist.mk
+++ b/sysui/productlist.mk
@@ -11,7 +11,7 @@ PRODUCTLIST := libreoffice libreofficedev collaboraoffice
 PKGVERSION := $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO)
 PKGVERSIONSHORT := $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR)
 PRODUCTNAME.libreoffice := LibreOffice
-PRODUCTNAME.libreofficeodev := LibreOfficeDev
+PRODUCTNAME.libreofficedev := LibreOfficeDev
 PRODUCTNAME.collaboraoffice := CollaboraOffice
 UNIXFILENAME.libreoffice := libreoffice$(PKGVERSIONSHORT)
 UNIXFILENAME.libreofficedev := libreofficedev$(PKGVERSIONSHORT)
commit 4d82d8cc85ee8324be7190a74616e1d26fbab560
Author: Rene Engelhard <rene at debian.org>
Date:   Thu May 24 11:47:55 2018 +0200

    apparmor: allow also /usr/lib{,32,64}/jvm/**/bin/java
    
    since /usr/lib{,32,64}/jvm/**/jre/bin/java doesn't exist since OpenJDK 9
    
    Change-Id: Ic9c052a756ba4a93595595da98148ff22169d333
    Reviewed-on: https://gerrit.libreoffice.org/54754
    Reviewed-by: Rene Engelhard <rene at debian.org>
    Tested-by: Rene Engelhard <rene at debian.org>
    (cherry picked from commit 6739a70d1af250814fe134c8752a058df433afc3)

diff --git a/sysui/desktop/apparmor/program.soffice.bin b/sysui/desktop/apparmor/program.soffice.bin
index 24ff2fa854ac..87f6dff1d7c2 100644
--- a/sysui/desktop/apparmor/program.soffice.bin
+++ b/sysui/desktop/apparmor/program.soffice.bin
@@ -142,6 +142,7 @@ profile libreoffice-soffice INSTDIR-program/soffice.bin {
   /usr/lib{,32,64}/jvm/                         r,
   /usr/lib{,32,64}/jvm/**                       r,
   /usr/lib{,32,64}/jvm/**/jre/bin/java          mix,
+  /usr/lib{,32,64}/jvm/**/bin/java              mix,
   INSTDIR-**                        rw,
   INSTDIR-**.so                     m,
   INSTDIR-program/soffice.bin       mix,
commit 8b655db7dee19bba0dccc78ba24a0709102675dc
Author: Rene Engelhard <rene at rene-engelhard.de>
Date:   Wed May 23 21:12:30 2018 +0200

    deb#899380 apparmor: fix gpg encryption hang trying to lock random_seed
    
    Change-Id: Ib9fb7652922dcc8364567953d17d7cae8ad170a7
    Reviewed-on: https://gerrit.libreoffice.org/54726
    Reviewed-by: Rene Engelhard <rene at debian.org>
    Tested-by: Rene Engelhard <rene at debian.org>
    (cherry picked from commit 8615efe611abe8654e643e1ccbc0dc8f52d2e0b0)
    Reviewed-on: https://gerrit.libreoffice.org/54731
    (cherry picked from commit ed985043a18dca99acca4861ebeb1e7010bba6fe)

diff --git a/sysui/desktop/apparmor/program.soffice.bin b/sysui/desktop/apparmor/program.soffice.bin
index 1f3ac9ae0971..24ff2fa854ac 100644
--- a/sysui/desktop/apparmor/program.soffice.bin
+++ b/sysui/desktop/apparmor/program.soffice.bin
@@ -190,5 +190,6 @@ profile libreoffice-soffice INSTDIR-program/soffice.bin {
    /usr/bin/gpgsm rm,
 
     owner @{HOME}/.gnupg/* r,
+    owner @{HOME}/.gnupg/random_seed rk,
   }
 }


More information about the Libreoffice-commits mailing list