configure.ac                                                |    2 
 dev/null                                                    |binary
 download.lst                                                |    4 
 external/python3/UnpackedTarball_python3.mk                 |    1 
 external/python3/python-3.5.7-c99.patch.1                   |   62 +++++++++++
 i18npool/source/calendar/calendar_gregorian.cxx             |    9 -
 i18npool/source/localedata/data/ja_JP.xml                   |    5 
 sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx |    3 
 svl/source/numbers/zformat.cxx                              |    3 
 sw/qa/extras/ooxmlexport/data/tdf121456.docx                |binary
 sw/qa/extras/ooxmlexport/data/tdf123705.docx                |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx                  |   10 +
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx                   |    4 
 sw/qa/extras/uiwriter/uiwriter.cxx                          |   28 -----
 sw/source/core/doc/notxtfrm.cxx                             |   29 ++++-
 sw/source/core/layout/findfrm.cxx                           |    8 -
 sw/source/core/layout/flowfrm.cxx                           |    9 -
 sw/source/core/layout/tabfrm.cxx                            |   67 +++---------
 sw/source/core/unocore/unostyle.cxx                         |    3 
 sw/source/filter/ww8/docxattributeoutput.cxx                |    3 
 toolkit/source/controls/tabpagemodel.cxx                    |    5 
 vcl/qa/cppunit/pdfexport/data/tdf121615.odt                 |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx                      |   58 ++++++++++
 vcl/source/app/salvtables.cxx                               |    7 +
 vcl/source/edit/textundo.cxx                                |   11 +
 vcl/source/filter/jpeg/JpegWriter.cxx                       |    5 
 vcl/source/gdi/bitmapex.cxx                                 |    2 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx           |    3 
 28 files changed, 230 insertions(+), 111 deletions(-)

New commits:
commit c4cb662635b22433e67a31eb75b75a7ac77ba7da
Merge: de89c8169cfb f15146021b72
Author:     Thorsten Behrens <thorsten.behr...@cib.de>
AuthorDate: Fri Apr 5 16:17:02 2019 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Fri Apr 5 16:17:02 2019 +0200

    Merge branch 'libreoffice-6-1'
    
    into distro/lhm/libreoffice-6-1+backports
    
    Change-Id: Id362bc8f781d752e6e14032fee8d9c7100e208ad

commit f15146021b722dda0cf10cb08de6e0a3c525168a
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Mar 26 00:48:12 2019 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Apr 5 15:42:32 2019 +0200

    tdf#114306: Revert commits fixing this issue ( 6.1 only )
    
    Revert "tdf#114306 fix crash caused by special document 2"
    
    This reverts commit d30eefb677b446886f7b5bab6de93d489ba63529.
    
    Revert "tdf#114306 fix crash caused by special document"
    
    This reverts commit e4400f4c4e267f8528df3a7d5a09623c888bd10c.
    
    Revert "tdf#114306 fix unexpected page break in row-spanned table"
    
    This reverts commit 18765b9fa739337d2d891513f6e2fb7c3ce23b50
    
    Change-Id: Ifff799616f12ee428a3f923f6510b20059f5bc71
    Reviewed-on: https://gerrit.libreoffice.org/69848
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>

diff --git a/sw/qa/extras/uiwriter/data/fdo114306.odt 
b/sw/qa/extras/uiwriter/data/fdo114306.odt
deleted file mode 100755
index 5a7d2f9ca864..000000000000
Binary files a/sw/qa/extras/uiwriter/data/fdo114306.odt and /dev/null differ
diff --git a/sw/qa/extras/uiwriter/data/fdo114306_2.odt 
b/sw/qa/extras/uiwriter/data/fdo114306_2.odt
deleted file mode 100755
index b4bebc58add5..000000000000
Binary files a/sw/qa/extras/uiwriter/data/fdo114306_2.odt and /dev/null differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 6d1f2c51c684..8d0e194d7a65 100755
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -332,8 +332,6 @@ public:
     void testTdf112448();
     void testTdf113790();
     void testTdf108048();
-    void testTdf114306();
-    void testTdf114306_2();
     void testTdf113481();
     void testTdf115013();
     void testTdf114536();
@@ -528,8 +526,6 @@ public:
     CPPUNIT_TEST(testTdf112448);
     CPPUNIT_TEST(testTdf113790);
     CPPUNIT_TEST(testTdf108048);
-    CPPUNIT_TEST(testTdf114306);
-    CPPUNIT_TEST(testTdf114306_2);
     CPPUNIT_TEST(testTdf113481);
     CPPUNIT_TEST(testTdf115013);
     CPPUNIT_TEST(testTdf114536);
@@ -5482,30 +5478,6 @@ void SwUiWriterTest::testTdf72942()
     CPPUNIT_ASSERT_EQUAL(OUString("Liberation Sans"), 
getProperty<OUString>(xRun4, "CharFontName"));
 }
 
-void SwUiWriterTest::testTdf114306()
-{
-    load(DATA_DIRECTORY, "fdo114306.odt");
-    xmlDocPtr pXmlDoc = parseLayoutDump();
-
-    // There are 2 long paragraphs in cell A1.
-    // A part of paragraph 2 should flow over to the second page but
-    // *not* the whole paragraph. There should be 2 paragraphs on
-    // page 1 and 1 paragraph on page 2.
-    assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt", 2);
-    assertXPath(pXmlDoc, "/root/page[2]/body/tab[1]/row[1]/cell[1]/txt", 1);
-}
-
-void SwUiWriterTest::testTdf114306_2()
-{
-    // tdf#114306 fix unexpected page break in row-spanned table
-    // load regression document without writer crash
-    load(DATA_DIRECTORY, "fdo114306_2.odt");
-
-    // correct number of pages
-    CPPUNIT_ASSERT_EQUAL(4, getPages());
-}
-
-
 // During insert of the document with list inside into the main document 
inside the list
 // we should merge both lists into one, when they have the same list properties
 void SwUiWriterTest::testTdf113877()
diff --git a/sw/source/core/layout/findfrm.cxx 
b/sw/source/core/layout/findfrm.cxx
index b720d9936a45..c327ebfcab2c 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1340,14 +1340,8 @@ bool SwFrame::IsMoveable( const SwLayoutFrame* 
_pLayoutFrame ) const
                   _pLayoutFrame->IsInDocBody() ||
                   _pLayoutFrame->IsInFootnote() )
         {
-            // If IsMovable() is called before a MoveFwd() the method
-            // may return false if there is no NextCellLeaf. If
-            // IsMovable() is called before a MoveBwd() the method may
-            // return false if there is no PrevCellLeaf.
             if ( _pLayoutFrame->IsInTab() && !IsTabFrame() &&
-                 ( !IsContentFrame() || 
(!const_cast<SwFrame*>(this)->GetNextCellLeaf()
-                                      && 
!const_cast<SwFrame*>(this)->GetPrevCellLeaf()) )
-                )
+                 ( !IsContentFrame() || 
!const_cast<SwFrame*>(this)->GetNextCellLeaf() ) )
             {
                 bRetVal = false;
             }
diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 4366c98af710..34a3258e68b4 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2041,19 +2041,14 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat )
         const SwLayoutFrame* pUpperFrame = m_rThis.GetUpper();
         while ( pUpperFrame )
         {
-            if ( pUpperFrame->IsTabFrame() || pUpperFrame->IsRowFrame() )
+            if ( pUpperFrame->IsTabFrame() )
             {
                 return false;
             }
             // If the text frame is a follow-section-in-table, that can move
             // backward as well.
             bool bIsFollowSection = pUpperFrame->IsSctFrame() && 
static_cast<const SwSectionFrame*>(pUpperFrame)->GetPrecede();
-
-            // If the text frame is a follow-in-table, that can move
-            // backward as well.
-            bool bIsFollow = 
const_cast<SwLayoutFrame*>(pUpperFrame)->GetPrevCellLeaf();
-
-            if ( ( pUpperFrame->IsColumnFrame() && pUpperFrame->IsInSct() ) || 
bIsFollowSection || bIsFollow )
+            if ( ( pUpperFrame->IsColumnFrame() && pUpperFrame->IsInSct() ) || 
bIsFollowSection )
             {
                 break;
             }
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 8e3d9b1d93c3..d50e8211f492 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -164,7 +164,7 @@ void SwTabFrame::RegistFlys()
 }
 
 void SwInvalidateAll( SwFrame *pFrame, long nBottom );
-static bool lcl_RecalcRow( SwRowFrame* pRow, long nBottom );
+static void lcl_RecalcRow( SwRowFrame& rRow, long nBottom );
 static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva );
 // #i26945# - add parameter <_bOnlyRowsAndCells> to control
 // that only row and cell frames are formatted.
@@ -290,7 +290,7 @@ static void lcl_InvalidateLowerObjs( SwLayoutFrame& 
_rLayoutFrame,
     }
 }
 
-// Local helper function to shrink all lowers of pRow to 0 height
+// Local helper function to shrink all lowers of rRow to 0 height
 static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow )
 {
     SwCellFrame* pCurrMasterCell = static_cast<SwCellFrame*>(rRow.Lower());
@@ -682,7 +682,7 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, 
SwRowFrame& rFollowLine,
     rLastLine.SetInSplit();
 
     // Do the recalculation
-    lcl_RecalcRow( &rLastLine, LONG_MAX );
+    lcl_RecalcRow( rLastLine, LONG_MAX );
     // #115759# - force a format of the last line in order to
     // get the correct height.
     rLastLine.InvalidateSize();
@@ -1567,8 +1567,7 @@ static bool lcl_InnerCalcLayout( SwFrame *pFrame,
     return bRet;
 }
 
-// returns false if pRow is invalid
-static bool lcl_RecalcRow( SwRowFrame* pRow, long nBottom )
+static void lcl_RecalcRow( SwRowFrame& rRow, long nBottom )
 {
     // FME 2007-08-30 #i81146# new loop control
     int nLoopControlRuns_1 = 0;
@@ -1582,14 +1581,14 @@ static bool lcl_RecalcRow( SwRowFrame* pRow, long 
nBottom )
         int nLoopControlRuns_2 = 0;
         sal_uInt16 nLoopControlStage_2 = 0;
 
-        while( lcl_InnerCalcLayout( pRow, nBottom ) )
+        while( lcl_InnerCalcLayout( &rRow, nBottom ) )
         {
             if ( ++nLoopControlRuns_2 > nLoopControlMax )
             {
                 SAL_WARN_IF(nLoopControlStage_2 == 0, "sw.layout", 
"LoopControl_2 in lcl_RecalcRow: Stage 1!");
                 SAL_WARN_IF(nLoopControlStage_2 == 1, "sw.layout", 
"LoopControl_2 in lcl_RecalcRow: Stage 2!!");
                 SAL_WARN_IF(nLoopControlStage_2 >= 2, "sw.layout", 
"LoopControl_2 in lcl_RecalcRow: Stage 3!!!");
-                pRow->ValidateThisAndAllLowers( nLoopControlStage_2++ );
+                rRow.ValidateThisAndAllLowers( nLoopControlStage_2++ );
                 nLoopControlRuns_2 = 0;
                 if( nLoopControlStage_2 > 2 )
                     break;
@@ -1602,39 +1601,14 @@ static bool lcl_RecalcRow( SwRowFrame* pRow, long 
nBottom )
         {
             // #115759# - force another format of the
             // lowers, if at least one of it was invalid.
-
-            // tdf#114306 writer may crash because pRow points to a deleted 
SwRowFrame
-            SwRowFrame* pOriginalRow = pRow;
-            OSL_ENSURE(pOriginalRow->GetUpper() && 
pOriginalRow->GetUpper()->IsTabFrame(), "No table");
-            SwTabFrame* pOriginalTab = 
static_cast<SwTabFrame*>(pRow->GetUpper());
-
-            bCheck = SwContentFrame::CalcLowers( pRow, pRow->GetUpper(), 
nBottom, true );
-
-            bool bRowStillExists = false;
-            SwFrame* pTestRow = pOriginalTab->Lower();
-
-            while (pTestRow)
-            {
-                if (pTestRow == pRow)
-                {
-                    bRowStillExists = true;
-                    break;
-                }
-                pTestRow = pTestRow->GetNext();
-            }
-
-            if (!bRowStillExists)
-            {
-                SAL_WARN("sw.layout", "no row anymore at " << pRow);
-                return false;
-            }
+            bCheck = SwContentFrame::CalcLowers( &rRow, rRow.GetUpper(), 
nBottom, true );
 
             // NEW TABLES
             // First we calculate the cells with row span of < 1, afterwards
             // all cells with row span of > 1:
             for ( int i = 0; i < 2; ++i )
             {
-                SwCellFrame* pCellFrame = 
static_cast<SwCellFrame*>(pRow->Lower());
+                SwCellFrame* pCellFrame = 
static_cast<SwCellFrame*>(rRow.Lower());
                 while ( pCellFrame )
                 {
                     const bool bCalc = 0 == i ?
@@ -1660,7 +1634,7 @@ static bool lcl_RecalcRow( SwRowFrame* pRow, long nBottom 
)
                     SAL_WARN_IF(nLoopControlStage_1 == 0, "sw.layout", 
"LoopControl_1 in lcl_RecalcRow: Stage 1!");
                     SAL_WARN_IF(nLoopControlStage_1 == 1, "sw.layout", 
"LoopControl_1 in lcl_RecalcRow: Stage 2!!");
                     SAL_WARN_IF(nLoopControlStage_1 >= 2, "sw.layout", 
"LoopControl_1 in lcl_RecalcRow: Stage 3!!!");
-                    pRow->ValidateThisAndAllLowers( nLoopControlStage_1++ );
+                    rRow.ValidateThisAndAllLowers( nLoopControlStage_1++ );
                     nLoopControlRuns_1 = 0;
                     if( nLoopControlStage_1 > 2 )
                         break;
@@ -1670,8 +1644,7 @@ static bool lcl_RecalcRow( SwRowFrame* pRow, long nBottom 
)
             }
         }
         break;
-    } while (true);
-    return true;
+    } while( true );
 }
 
 static void lcl_RecalcTable( SwTabFrame& rTab,
@@ -1686,7 +1659,7 @@ static void lcl_RecalcTable( SwTabFrame& rTab,
             rNotify.SetLowersComplete( true );
         }
         ::SwInvalidatePositions( pFirstRow, LONG_MAX );
-        lcl_RecalcRow( static_cast<SwRowFrame*>(pFirstRow), LONG_MAX );
+        lcl_RecalcRow( static_cast<SwRowFrame&>(*pFirstRow), LONG_MAX );
     }
 }
 
@@ -2152,7 +2125,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
                             {
                                 ::SwInvalidateAll( pLastLine, LONG_MAX );
                                 SetRebuildLastLine( true );
-                                lcl_RecalcRow( 
static_cast<SwRowFrame*>(pLastLine), LONG_MAX );
+                                lcl_RecalcRow( 
static_cast<SwRowFrame&>(*pLastLine), LONG_MAX );
                                 SetRebuildLastLine( false );
                             }
 
@@ -2278,7 +2251,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
                 }
                 else if (m_bONECalcLowers)
                 {
-                    lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), LONG_MAX 
);
+                    lcl_RecalcRow( static_cast<SwRowFrame&>(*Lower()), 
LONG_MAX );
                     m_bONECalcLowers = false;
                 }
             }
@@ -2301,7 +2274,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
             }
             else if (m_bONECalcLowers)
             {
-                lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), LONG_MAX );
+                lcl_RecalcRow( static_cast<SwRowFrame&>(*Lower()), LONG_MAX );
                 m_bONECalcLowers = false;
             }
 
@@ -2358,7 +2331,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 
             // 1. Try: bTryToSplit = true  => Try to split the row.
             // 2. Try: bTryToSplit = false => Split the table between the rows.
-            if ((pFirstNonHeadlineRow && pFirstNonHeadlineRow->GetNext()) || 
bTryToSplit )
+            if ( pFirstNonHeadlineRow->GetNext() || bTryToSplit )
             {
                 SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper());
                 if( IsInSct() || GetUpper()->IsInTab() ) // TABLE IN TABLE)
@@ -2367,11 +2340,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 
                 {
                     SetInRecalcLowerRow( true );
-                    SwRowFrame* pRow = static_cast<SwRowFrame*>(Lower());
-                    if (!lcl_RecalcRow(pRow, nDeadLine))
-                    {
-                        pFirstNonHeadlineRow = GetFirstNonHeadlineRow();
-                    }
+                    ::lcl_RecalcRow( static_cast<SwRowFrame&>(*Lower()), 
nDeadLine );
                     SetInRecalcLowerRow( false );
                 }
                 m_bLowersFormatted = true;
@@ -2471,7 +2440,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
                     // to nDeadLine may not be enough.
                     if ( bSplitError && bTryToSplit ) // no restart if we did 
not try to split: i72847, i79426
                     {
-                        lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), 
LONG_MAX );
+                        lcl_RecalcRow( static_cast<SwRowFrame&>(*Lower()), 
LONG_MAX );
                         setFrameAreaPositionValid(false);
                         bTryToSplit = false;
                         continue;
@@ -2512,7 +2481,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
                             // its content.
                             const bool bOldJoinLock =  
GetFollow()->IsJoinLocked();
                             GetFollow()->LockJoin();
-                            ::lcl_RecalcRow( 
static_cast<SwRowFrame*>(GetFollow()->Lower()),
+                            ::lcl_RecalcRow( 
static_cast<SwRowFrame&>(*GetFollow()->Lower()),
                                              
fnRectX.GetBottom(GetFollow()->GetUpper()->getFrameArea()) );
                             // #i43913#
                             // #i63632# Do not unlock the
commit b8412f1d8b70ee097f8cf00bf159514bd443ea07
Author:     Vasily Melenchuk <vasily.melenc...@cib.de>
AuthorDate: Wed Feb 6 00:41:25 2019 +0300
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Thu Apr 4 15:02:17 2019 +0200

    basic: fix for UnoControlTabPageModel get/set properties
    
    The userformscontainers is required property to pass checks in
    getter/setter, but returning true instead of actual type is
    not a best idea. So let's return actually expected dummy empty
    container.
    
    Change-Id: I5cc3e5462ed82f6f2f8e5a45d9fc2d9f9ce1c76f
    Reviewed-on: https://gerrit.libreoffice.org/67431
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 24e7d98219191ccdab3673ac96fa866c449cac5f)
    Reviewed-on: https://gerrit.libreoffice.org/70235
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/toolkit/source/controls/tabpagemodel.cxx 
b/toolkit/source/controls/tabpagemodel.cxx
index 044da501575e..5ddbe3d0f8ef 100644
--- a/toolkit/source/controls/tabpagemodel.cxx
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -87,9 +87,10 @@ Any UnoControlTabPageModel::ImplGetDefaultValue( sal_uInt16 
nPropId ) const
             break;
         case BASEPROPERTY_USERFORMCONTAINEES:
         {
-            // We do not have here any usercontainers (yet?), but let's return 
something back
+            // We do not have here any usercontainers (yet?), but let's return 
empty container back
             // so normal properties could be set without triggering 
UnknownPropertyException
-            return makeAny(true);
+            aAny <<= uno::Reference< XNameContainer >();
+            break;
         }
         default:
             aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
commit a072b91c03f7e24cc5fe99e4b7462d37ef8d703b
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Wed Apr 3 11:03:17 2019 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Thu Apr 4 01:26:49 2019 +0200

    python3: upgrade to release 3.5.7
    
    Fixes CVE-2019-9636 CVE-2019-5010 CVE-2018-14647
    
    Change-Id: If0a115960aed1ee90b63e6716c844669f0ec91e5
    Reviewed-on: https://gerrit.libreoffice.org/70182
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 3c7354a85a9bd47a2676aadaad2f6622fe2d959c)
    Reviewed-on: https://gerrit.libreoffice.org/70194
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/configure.ac b/configure.ac
index f895e3ba1177..1f4b41603e93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8289,7 +8289,7 @@ internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
     PYTHON_VERSION_MINOR=5
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.6
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.7
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
     fi
diff --git a/download.lst b/download.lst
index d1c494eddecf..4149c8fea800 100644
--- a/download.lst
+++ b/download.lst
@@ -210,8 +210,8 @@ export POPPLER_SHA256SUM := 
92e09fd3302567fd36146b36bb707db43ce436e8841219025a82
 export POPPLER_TARBALL := poppler-0.74.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461
 export POSTGRESQL_TARBALL := 
c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
-export PYTHON_SHA256SUM := 
f55cde04f521f273c7cba08912921cc5642cfc15ca7b22d5829f0aff4371155f
-export PYTHON_TARBALL := Python-3.5.6.tar.xz
+export PYTHON_SHA256SUM := 
285892899bf4d5737fd08482aa6171c6b2564a45b9102dfacfb72826aebdc7dc
+export PYTHON_TARBALL := Python-3.5.7.tar.xz
 export QXP_SHA256SUM := 
8c257f6184ff94aefa7c9fa1cfae82083d55a49247266905c71c53e013f95c73
 export QXP_TARBALL := libqxp-0.0.1.tar.xz
 export RAPTOR_SHA256SUM := 
ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed
diff --git a/external/python3/UnpackedTarball_python3.mk 
b/external/python3/UnpackedTarball_python3.mk
index ec1bdabe4fdd..66a82955e440 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
        external/python3/ubsan.patch.0 \
        external/python3/python-3.5.tweak.strip.soabi.patch \
        
external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1
 \
+       external/python3/python-3.5.7-c99.patch.1 \
 ))
 
 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),)
diff --git a/external/python3/python-3.5.7-c99.patch.1 
b/external/python3/python-3.5.7-c99.patch.1
new file mode 100644
index 000000000000..558166d9953f
--- /dev/null
+++ b/external/python3/python-3.5.7-c99.patch.1
@@ -0,0 +1,62 @@
+remove C99 which isn't suppored by all compilers yet
+
+--- python3/Modules/_pickle.c.orig     2019-04-03 16:34:01.380124314 +0200
++++ python3/Modules/_pickle.c  2019-04-03 16:35:18.579005171 +0200
+@@ -674,9 +674,12 @@
+         PyErr_NoMemory();
+         return NULL;
+     }
+-    for (size_t i = 0; i < self->mt_allocated; i++) {
++    {
++    size_t i;
++    for (i = 0; i < self->mt_allocated; i++) {
+         Py_XINCREF(self->mt_table[i].me_key);
+     }
++    }
+     memcpy(new->mt_table, self->mt_table,
+            sizeof(PyMemoEntry) * self->mt_allocated);
+ 
+@@ -4204,7 +4207,9 @@
+         return NULL;
+ 
+     memo = self->pickler->memo;
+-    for (size_t i = 0; i < memo->mt_allocated; ++i) {
++    {
++    size_t i;
++    for (i = 0; i < memo->mt_allocated; ++i) {
+         PyMemoEntry entry = memo->mt_table[i];
+         if (entry.me_key != NULL) {
+             int status;
+@@ -4225,6 +4230,7 @@
+                 goto error;
+         }
+     }
++    }
+     return new_memo;
+ 
+   error:
+@@ -6791,10 +6797,13 @@
+         if (new_memo == NULL)
+             return -1;
+ 
+-        for (size_t i = 0; i < new_memo_size; i++) {
++        {
++        size_t i;
++        for (i = 0; i < new_memo_size; i++) {
+             Py_XINCREF(unpickler->memo[i]);
+             new_memo[i] = unpickler->memo[i];
+         }
++        }
+     }
+     else if (PyDict_Check(obj)) {
+         Py_ssize_t i = 0;
+@@ -6839,7 +6848,8 @@
+ 
+   error:
+     if (new_memo_size) {
+-        for (size_t i = new_memo_size - 1; i != SIZE_MAX; i--) {
++        size_t i;
++        for (i = new_memo_size - 1; i != SIZE_MAX; i--) {
+             Py_XDECREF(new_memo[i]);
+         }
+         PyMem_FREE(new_memo);
commit 39de7d73fdab86a1531f19076ab1d07fcff97b55
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Thu Jul 26 20:46:23 2018 +0200
Commit:     Xisco Faulí <xiscofa...@libreoffice.org>
CommitDate: Wed Apr 3 14:41:20 2019 +0200

    Introduce next Japanese gengou era 'Reiwa'
    
    Prepare for "Japan's Y2K" Gengou calendar era switch after 2019-04-30
    
    The emperor Akihito will abdicate on 2019-04-30. The next emperor
    will be Naruhito, but so far neither the new era name (Heisei for
    Akihito) nor its abbreviation or a Unicode character are
    determined. At least introduce the new era with some dummy names
    (Naruhito,Na,N).
    
    Change-Id: I8c0af390ca0408ac259e47e7eaf2e49b5889c9ba
    Reviewed-on: https://gerrit.libreoffice.org/58142
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    
    Introduce next Japanese gengou era 'Reiwa'
    
    starting from 2019-05-01, which has been announced officially.
    
    This fills the provisional slot acknowledged at
    cacbb0faef77ae8462de9ff5c7307a6a2e28b2bb.
    
    Change-Id: Ifb12e6afaad4c66d455f664b46ec946e80324e87
    Reviewed-on: https://gerrit.libreoffice.org/70157
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    Reviewed-on: https://gerrit.libreoffice.org/70185

diff --git a/i18npool/source/calendar/calendar_gregorian.cxx 
b/i18npool/source/calendar/calendar_gregorian.cxx
index a4ac0acfe53d..7abef52e748b 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -205,10 +205,11 @@ Calendar_hanja::loadCalendar( const OUString& 
/*uniqueID*/, const css::lang::Loc
 }
 
 static const Era gengou_eraArray[] = {
-    {1868,  1,  1, 0},
-    {1912,  7, 30, 0},
-    {1926, 12, 25, 0},
-    {1989,  1,  8, 0},
+    {1868,  1,  1, 0},  // Meiji
+    {1912,  7, 30, 0},  // Taisho
+    {1926, 12, 25, 0},  // Showa
+    {1989,  1,  8, 0},  // Heisei
+    {2019,  5,  1, 0},  // Reiwa
     {0, 0, 0, 0}
 };
 Calendar_gengou::Calendar_gengou() : Calendar_gregorian(gengou_eraArray)
diff --git a/i18npool/source/localedata/data/ja_JP.xml 
b/i18npool/source/localedata/data/ja_JP.xml
index 7d7526062799..c15c665f2eab 100644
--- a/i18npool/source/localedata/data/ja_JP.xml
+++ b/i18npool/source/localedata/data/ja_JP.xml
@@ -480,6 +480,11 @@
           <DefaultAbbrvName>平</DefaultAbbrvName>
           <DefaultFullName>平成</DefaultFullName>
         </Era>
+        <Era>
+          <EraID>Reiwa</EraID>
+          <DefaultAbbrvName>令</DefaultAbbrvName>
+          <DefaultFullName>令和</DefaultFullName>
+        </Era>
       </Eras>
       <StartDayOfWeek>
         <DayID>sun</DayID>
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index c9bd3d814e90..e14413ce3fa7 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3409,6 +3409,9 @@ void SvNumberformat::ImpAppendEraG( OUStringBuffer& 
OutString,
         case 4:
             cEra = 'H';
             break;
+        case 5:
+            cEra = 'R';
+            break;
         default:
             cEra = '?';
             break;
commit c2ae30b19d8145271f1189c9757d59d43de391c7
Author:     Armin Le Grand <armin.le.gr...@me.com>
AuthorDate: Tue Apr 2 17:59:40 2019 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Wed Apr 3 12:32:38 2019 +0200

    tdf#124272 use ClipRegion's geometry if not a rectangle
    
    By error the ClipRegion's geometry was replaced by it's
    BoundRect expanded to PixelBounds. If the ClipRegion
    is not a rectangle, this will create wrong results. To
    do both - extend to PixelBounds and have the original
    geometry included - use the PolyPolygon topology as
    needed (see comment in code for details)
    
    Reviewed-on: https://gerrit.libreoffice.org/70146
    Tested-by: Jenkins
    Reviewed-by: Armin Le Grand <armin.le.gr...@me.com>
    (cherry picked from commit 362c1cf2bd580f6dc8bf27bdcd79174111bc1b5c)
    
    Conflicts:
            sw/source/core/doc/notxtfrm.cxx
    
    Change-Id: If3f75223144eba8eb23909a7c701ad544346099b
    Reviewed-on: https://gerrit.libreoffice.org/70158
    Tested-by: Xisco Faulí <xiscofa...@libreoffice.org>
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 6dd910fab9ee..6055384ac8a7 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -988,9 +988,34 @@ void paintGraphicUsingPrimitivesHelper(
                     ceil(aClipRange.getMaxX() + aSinglePixelXY.getX()),
                     ceil(aClipRange.getMaxY() + aSinglePixelXY.getY()));
 
+                // create the enclosing rectangle as polygon
+                basegfx::B2DPolyPolygon 
aTarget(basegfx::utils::createPolygonFromRect(aExpandedClipRange));
+
+                // tdf#124272 the fix above (tdf#114076) was too rough - the
+                // clip region used may be a PolyPolygon. In that case that
+                // PolyPolygon would have to be scaled to mentioned 
PixelBounds.
+                // Since that is not really possible geometrically (would need
+                // more some 'grow in outside direction' but with unequal grow
+                // values in all directions - just maaany problems
+                // involved), use a graphical trick: The topology of the
+                // PolyPolygon uses the stndard FillRule, so adding the now
+                // guaranteed to be bigger or equal bounding (enclosing)
+                // rectangle twice as polygon will expand the BoundRange, but
+                // not change the geometry visualization at all
+                if(!rOutputDevice.GetClipRegion().IsRectangle())
+                {
+                    // double the outer rectangle range polygon to have it
+                    // included twice
+                    aTarget.append(aTarget.getB2DPolygon(0));
+
+                    // add the original clip 'inside' (due to being smaller
+                    // or equal). That PolyPolygon may have an unknown number
+                    // of polygons (>=1)
+                    aTarget.append(aClip);
+                }
+
                 aContent[0] = new drawinglayer::primitive2d::MaskPrimitive2D(
-                    basegfx::B2DPolyPolygon(
-                        
basegfx::utils::createPolygonFromRect(aExpandedClipRange)),
+                    aTarget,
                     aContent);
             }
         }
commit 1dc8088162a66a99217dae3258711cbfa8f9bc28
Author:     Jaromir Wysoglad <jaromirwysog...@gmail.com>
AuthorDate: Thu Mar 28 19:55:23 2019 +0100
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Wed Apr 3 11:18:55 2019 +0200

    tdf#121103 ANOVA sum of squares formula correction
    
    The ANOVA sum of squares is now hardcoded to use '$Sheet?' in the
    source cell addless every time.
    
    Change-Id: I215b719be11ecfc2ae20c5df8e86876bc22d50f0
    Reviewed-on: https://gerrit.libreoffice.org/69899
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <er...@redhat.com>
    (cherry picked from commit 66c08a0d308fd6119460546a906434bbc9d23c2e)
    Reviewed-on: https://gerrit.libreoffice.org/70155
    Reviewed-by: vyzigold <jaromirwysog...@gmail.com>

diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx 
b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index c31fc9fb4c09..14662c18b3b0 100644
--- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
@@ -67,7 +67,7 @@ OUString lclCreateMultiParameterFormula(
     OUString aResult;
     for (size_t i = 0; i < aRangeList.size(); i++)
     {
-        OUString aRangeString(aRangeList[i].Format(ScRefFlags::RANGE_ABS, 
pDocument, aAddressDetails));
+        OUString aRangeString(aRangeList[i].Format(ScRefFlags::RANGE_ABS_3D, 
pDocument, aAddressDetails));
         OUString aFormulaString = aFormulaTemplate.replaceAll(aWildcard, 
aRangeString);
         aResult += aFormulaString;
         if(i != aRangeList.size() - 1) // Not Last
@@ -260,7 +260,6 @@ void 
ScAnalysisOfVarianceDialog::AnovaSingleFactor(AddressWalkerWriter& output,
         output.nextColumn();
 
         // Sum of Squares
-
         
aTemplate.setTemplate("=SUMPRODUCT(%SUM_RANGE%;%MEAN_RANGE%)-SUM(%SUM_RANGE%)^2/SUM(%COUNT_RANGE%)");
         aTemplate.autoReplaceAddress("%BETWEEN_SS%", output.current());
         output.writeFormula(aTemplate.getTemplate());
commit a1e44657ef62488076b0f4cfd271d0a73cbff7d3
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Tue Feb 26 19:06:59 2019 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Apr 2 09:08:32 2019 +0200

    tdf#123705: avoid duplicate themeColor
    
    See http://bugs.documentfoundation.org/attachment.cgi?id=149585
    + https://bugs.documentfoundation.org/show_bug.cgi?id=123705#c4
    
    Change-Id: I3c6fb0a1ac46a62c75bb9daeaded1633889416eb
    Reviewed-on: https://gerrit.libreoffice.org/68398
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    (cherry picked from commit 42398e3860aafd6468688eda6c0da942323b7f82)
    Reviewed-on: https://gerrit.libreoffice.org/68614
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf123705.docx 
b/sw/qa/extras/ooxmlexport/data/tdf123705.docx
new file mode 100644
index 000000000000..46e053fd464e
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf123705.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 66e2228fb368..34a95b685d89 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -992,6 +992,10 @@ DECLARE_OOXMLEXPORT_TEST(testN830205, "n830205.docx")
     getParagraph(1, "XXX");
 }
 
+DECLARE_OOXMLEXPORT_TEST(tdf123705, "tdf123705.docx")
+{
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTableAutoColumnFixedSize, 
"table-auto-column-fixed-size.docx")
 {
     uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, 
uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index e332bee8d747..366670f86974 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2753,6 +2753,8 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
                     // we are done exporting the redline attributes.
                     rtl::Reference<sax_fastparser::FastAttributeList> 
pFontsAttrList_Original(m_pFontsAttrList);
                     m_pFontsAttrList.clear();
+                    rtl::Reference<sax_fastparser::FastAttributeList> 
pColorAttrList_Original(m_pColorAttrList);
+                    m_pColorAttrList.clear();
                     rtl::Reference<sax_fastparser::FastAttributeList> 
pEastAsianLayoutAttrList_Original(m_pEastAsianLayoutAttrList);
                     m_pEastAsianLayoutAttrList.clear();
                     rtl::Reference<sax_fastparser::FastAttributeList> 
pCharLangAttrList_Original(m_pCharLangAttrList);
@@ -2766,6 +2768,7 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
 
                     // Revert back the original values that were stored in 
'm_pFontsAttrList', 'm_pEastAsianLayoutAttrList', 'm_pCharLangAttrList'
                     m_pFontsAttrList = pFontsAttrList_Original;
+                    m_pColorAttrList = pColorAttrList_Original;
                     m_pEastAsianLayoutAttrList = 
pEastAsianLayoutAttrList_Original;
                     m_pCharLangAttrList = pCharLangAttrList_Original;
 
commit b3b23df6ffdfefab7b2369c8330ed7fd8ac85424
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Apr 1 12:09:43 2019 +0100
Commit:     Xisco Faulí <xiscofa...@libreoffice.org>
CommitDate: Mon Apr 1 23:35:52 2019 +0200

    Resolves: tdf#124440 nospin has no subedit
    
    Change-Id: I4e801ec234e86be935a79c9e29f0e5091904f12e
    Reviewed-on: https://gerrit.libreoffice.org/70055
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 20198f7f556d..88258f1a76dc 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1656,7 +1656,10 @@ public:
         m_xButton->SetLoseFocusHdl(LINK(this, SalInstanceSpinButton, 
LoseFocusHdl));
         m_xButton->SetOutputHdl(LINK(this, SalInstanceSpinButton, OutputHdl));
         m_xButton->SetInputHdl(LINK(this, SalInstanceSpinButton, InputHdl));
-        m_xButton->GetSubEdit()->SetActivateHdl(LINK(this, 
SalInstanceSpinButton, ActivateHdl));
+        if (Edit* pEdit = m_xButton->GetSubEdit())
+            pEdit->SetActivateHdl(LINK(this, SalInstanceSpinButton, 
ActivateHdl));
+        else
+            m_xButton->SetActivateHdl(LINK(this, SalInstanceSpinButton, 
ActivateHdl));
     }
 
     virtual int get_value() const override
@@ -1713,6 +1716,8 @@ public:
     {
         if (Edit* pEdit = m_xButton->GetSubEdit())
             pEdit->SetActivateHdl(Link<Edit&, void>());
+        else
+            m_xButton->SetActivateHdl(Link<Edit&, void>());
         m_xButton->SetInputHdl(Link<sal_Int64*, TriState>());
         m_xButton->SetOutputHdl(Link<Edit&, bool>());
         m_xButton->SetLoseFocusHdl(Link<Control&, void>());
commit e10083d6daef5fadc53734ef3dc85f4cce563640
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Apr 1 14:38:01 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Apr 1 22:20:40 2019 +0200

    tdf#124413 Crash on undo / redo in Basic IDE
    
    regression from
        commit 3a9d3f271c445641bebd057c4c91279f9b3cd7d5
        Date:   Mon Apr 23 09:38:41 2018 +0200
        loplugin:useuniqueptr in TextDoc
    
    Change-Id: I51ab5de7571e4ec358442e54d590adf88fbeb12d
    Reviewed-on: https://gerrit.libreoffice.org/70061
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 3ebdb97a305ada182af045ea6438432adfe74e80)
    Reviewed-on: https://gerrit.libreoffice.org/70072
    Reviewed-by: Michael Stahl <michael.st...@cib.de>

diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx
index e5b3d0165517..5c99f30d94b0 100644
--- a/vcl/source/edit/textundo.cxx
+++ b/vcl/source/edit/textundo.cxx
@@ -162,14 +162,19 @@ void TextUndoDelPara::Undo()
 
 void TextUndoDelPara::Redo()
 {
+    auto & rDocNodes = GetDoc()->GetNodes();
     // pNode is not valid anymore in case an Undo joined paragraphs
-    mpNode = GetDoc()->GetNodes()[ mnPara ].get();
+    mpNode = rDocNodes[ mnPara ].get();
 
     GetTEParaPortions()->Remove( mnPara );
 
     // do not delete Node because of Undo!
-    GetDoc()->GetNodes().erase( ::std::find_if( GetDoc()->GetNodes().begin(), 
GetDoc()->GetNodes().end(),
-                                                [&] (std::unique_ptr<TextNode> 
const & p) { return p.get() == mpNode; } ) );
+    auto it = ::std::find_if( rDocNodes.begin(), rDocNodes.end(),
+                              [&] (std::unique_ptr<TextNode> const & p) { 
return p.get() == mpNode; } );
+    assert(it != rDocNodes.end());
+    it->release();
+    GetDoc()->GetNodes().erase( it );
+
     GetTextEngine()->ImpParagraphRemoved( mnPara );
 
     mbDelObject = true; // belongs again to the Undo
commit bc5d04dfe4e53880bab21eff5a2071b368d918c1
Author:     Serge Krot <serge.k...@cib.de>
AuthorDate: Wed Mar 27 14:02:51 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Fri Mar 29 11:24:49 2019 +0100

    tdf#121456 sw: DOCX: fix loading of empty TOC title
    
    Change-Id: Ib241edd07e4c6781d80db274f73146bda310d8c0
    Reviewed-on: https://gerrit.libreoffice.org/69827
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    (cherry picked from commit e47a5543f4b8c9e317d1e43af8c0e5a732e461fd)
    Reviewed-on: https://gerrit.libreoffice.org/69903

diff --git a/sw/qa/extras/ooxmlexport/data/tdf121456.docx 
b/sw/qa/extras/ooxmlexport/data/tdf121456.docx
new file mode 100644
index 000000000000..a65870a9b719
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121456.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index bcc136d31ef2..961d14eab848 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -93,6 +93,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121561_tocTitle, 
"tdf121456_tabsOffset.odt")
     assertXPath(pXmlDoc, 
"/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartUnique", 1);
 }
 
+// Related issue tdf#121561: w:sdt/w:sdtContent around TOC
+DECLARE_OOXMLEXPORT_TEST(testTdf124106, "tdf121456.docx")
+{
+    uno::Reference<text::XTextDocument> textDocument(mxComponent, 
uno::UNO_QUERY);
+    uno::Reference<text::XText> text(textDocument->getText(), uno::UNO_QUERY);
+    // -1 if the 'Y' character does not occur
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), text->getString().indexOf('Y'));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), text->getString().indexOf('y'));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf121561_tocTitleDocx, 
"tdf121456_tabsOffset.odt")
 {
     xmlDocPtr pXmlDoc = parseExport();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 1ee7cc8600de..ecb73bb038f4 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3663,6 +3663,9 @@ void DomainMapper_Impl::handleToc
     {
         if (aTocTitle.isEmpty() || bTableOfFigures)
         {
+            // reset marker of the TOC title
+            m_xStdEntryStart = uno::Reference< text::XTextRange >();
+
             xTOC.set(
                     m_xTextFactory->createInstance
                     ( bTableOfFigures ?
commit 57e6e1e1cec5465b81450bcbabac43beaee7ea74
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Wed Mar 13 17:35:27 2019 +0100
Commit:     Xisco Faulí <xiscofa...@libreoffice.org>
CommitDate: Thu Mar 28 14:50:06 2019 +0100

    fix grayscale jpeg writing in pdfexport (tdf#121615)
    
    If the bitmap to be written is non-8bit, e.g. in case of using OpenGL
    (on Linux the test requires "SAL_FORCEGL=1 SAL_USE_VCLPLUGIN=gen",
    on Windows it's probably the default case), then the bitmap is not
    in native format for 8bit. This was done correctly by 45e8e0fbee40f
    that introduced it but somehow it got lost later (I can't even find
    where).
    
    Reviewed-on: https://gerrit.libreoffice.org/69213
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>
    (cherry picked from commit 4b48f5c2fd2d0d6de1e1df4c13ceba47b1da7b5e)
    
    Change-Id: Ib1810cb9cf12e373c1cb41da40fa28e96ad7db28
    Reviewed-on: https://gerrit.libreoffice.org/69851
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>

diff --git a/vcl/qa/cppunit/pdfexport/data/tdf121615.odt 
b/vcl/qa/cppunit/pdfexport/data/tdf121615.odt
new file mode 100644
index 000000000000..7d2a87cf0e40
Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf121615.odt differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 78cec0a881d7..5c4b4a8c7141 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -21,6 +21,7 @@
 #include <unotest/macros_test.hxx>
 #include <unotools/mediadescriptor.hxx>
 #include <unotools/tempfile.hxx>
+#include <vcl/graphicfilter.hxx>
 #include <vcl/filter/pdfdocument.hxx>
 #include <tools/zcodec.hxx>
 #include <fpdf_edit.h>
@@ -29,6 +30,15 @@
 
 using namespace ::com::sun::star;
 
+static std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
+{
+    rStrm << "Color: R:" << static_cast<int>(rColor.GetRed())
+          << " G:" << static_cast<int>(rColor.GetGreen())
+          << " B:" << static_cast<int>(rColor.GetBlue())
+          << " A:" << static_cast<int>(rColor.GetTransparency());
+    return rStrm;
+}
+
 namespace
 {
 
@@ -90,6 +100,7 @@ public:
     void testTdf105954();
     void testTdf106702();
     void testTdf113143();
+    void testTdf121615();
 
     CPPUNIT_TEST_SUITE(PdfExportTest);
     CPPUNIT_TEST(testTdf106059);
@@ -120,6 +131,7 @@ public:
     CPPUNIT_TEST(testTdf105954);
     CPPUNIT_TEST(testTdf106702);
     CPPUNIT_TEST(testTdf113143);
+    CPPUNIT_TEST(testTdf121615);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -1465,6 +1477,52 @@ void PdfExportTest::testForcePoint71()
     topdf("forcepoint71.key");
 }
 
+void PdfExportTest::testTdf121615()
+{
+    vcl::filter::PDFDocument aDocument;
+    load("tdf121615.odt", aDocument);
+
+    // The document has one page.
+    std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages();
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
+
+    // Get access to the only image on the only page.
+    vcl::filter::PDFObjectElement* pResources = 
aPages[0]->LookupObject("Resources");
+    CPPUNIT_ASSERT(pResources);
+    auto pXObjects = 
dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
+    CPPUNIT_ASSERT(pXObjects);
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
+    vcl::filter::PDFObjectElement* pXObject = 
pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
+    CPPUNIT_ASSERT(pXObject);
+    vcl::filter::PDFStreamElement* pStream = pXObject->GetStream();
+    CPPUNIT_ASSERT(pStream);
+    SvMemoryStream& rObjectStream = pStream->GetMemory();
+
+    // Load the embedded image.
+    rObjectStream.Seek( 0 );
+    GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
+    Graphic aGraphic;
+    sal_uInt16 format;
+    ErrCode bResult = rFilter.ImportGraphic(aGraphic, OUString( "import" ), 
rObjectStream,
+        GRFILTER_FORMAT_DONTKNOW, &format);
+    CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, bResult);
+
+    // The image should be grayscale 8bit JPEG.
+    sal_uInt16 jpegFormat = rFilter.GetImportFormatNumberForShortName( 
JPG_SHORTNAME );
+    CPPUNIT_ASSERT( jpegFormat != GRFILTER_FORMAT_NOTFOUND );
+    CPPUNIT_ASSERT_EQUAL( jpegFormat, format );
+    BitmapEx aBitmap = aGraphic.GetBitmapEx();
+    CPPUNIT_ASSERT_EQUAL( 200L, aBitmap.GetSizePixel().Width());
+    CPPUNIT_ASSERT_EQUAL( 300L, aBitmap.GetSizePixel().Height());
+    CPPUNIT_ASSERT_EQUAL( 8, int(aBitmap.GetBitCount()));
+    // tdf#121615 was caused by broken handling of data width with 8bit color,
+    // so the test image has some black in the bottomright corner, check it's 
there
+    CPPUNIT_ASSERT_EQUAL( COL_WHITE, aBitmap.GetPixelColor( 0, 0 ));
+    CPPUNIT_ASSERT_EQUAL( COL_WHITE, aBitmap.GetPixelColor( 0, 299 ));
+    CPPUNIT_ASSERT_EQUAL( COL_WHITE, aBitmap.GetPixelColor( 199, 0 ));
+    CPPUNIT_ASSERT_EQUAL( COL_BLACK, aBitmap.GetPixelColor( 199, 299 ));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(PdfExportTest);
 
 }
diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx 
b/vcl/source/filter/jpeg/JpegWriter.cxx
index f6787145eabf..c7a476a84de6 100644
--- a/vcl/source/filter/jpeg/JpegWriter.cxx
+++ b/vcl/source/filter/jpeg/JpegWriter.cxx
@@ -223,7 +223,10 @@ bool JPEGWriter::Write( const Graphic& rGraphic )
         if( mpExpWasGrey )
             *mpExpWasGrey = mbGreys;
 
-        mbNative = ( mpReadAccess->GetScanlineFormat() == 
ScanlineFormat::N24BitTcRgb );
+        if ( mbGreys )
+            mbNative = ( mpReadAccess->GetScanlineFormat() == 
ScanlineFormat::N8BitPal );
+        else
+            mbNative = ( mpReadAccess->GetScanlineFormat() == 
ScanlineFormat::N24BitTcRgb );
 
         if( !mbNative )
             mpBuffer = new sal_uInt8[ AlignedWidth4Bytes( mbGreys ? 
mpReadAccess->Width() * 8L : mpReadAccess->Width() * 24L ) ];
commit e051b74e274c78d91ce69b37d896861816f5b6ea
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Wed Mar 13 17:23:42 2019 +0100
Commit:     Xisco Faulí <xiscofa...@libreoffice.org>
CommitDate: Thu Mar 28 14:49:41 2019 +0100

    fix transparency handling in BitmapEx::GetPixelColor()
    
    Apparently the Color class uses transparency as the opposite
    of the normally used meaning of opacity, so transparency 255
    means transparent.
    
    Change-Id: I3a76c2c93d98ad3c850017d3fd569b04dc6c19c8
    Reviewed-on: https://gerrit.libreoffice.org/69211
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/69884
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>

diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index c81b8b0fd446..5642beba0c4d 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -762,7 +762,7 @@ Color BitmapEx::GetPixelColor(sal_Int32 nX, sal_Int32 nY) 
const
             aColor.SetTransparency( pAlphaReadAccess->GetPixel( nY, nX 
).GetIndex() );
         }
         else
-            aColor.SetTransparency(255);
+            aColor.SetTransparency(0);
         return aColor;
 }
 
commit cdef6e5f4053adf5413781a9282285eab3923373
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Mar 25 12:06:20 2019 +0000
Commit:     Xisco Faulí <xiscofa...@libreoffice.org>
CommitDate: Wed Mar 27 16:33:31 2019 +0100

    Resolves: tdf#124142 don't deref nullptr
    
    Change-Id: Ie14600e9f9a1e1c4e99c7a872f5d677453481888
    Reviewed-on: https://gerrit.libreoffice.org/69666
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit ac7ce7a64ef903bad1476f5635a7b2a1e951a7a3)
    Reviewed-on: https://gerrit.libreoffice.org/69694
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 6fe6857b72d1..dc619361a7e7 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -195,7 +195,8 @@ namespace sw
             , m_pBasePool(pDocShell->GetStyleSheetPool())
             , m_pDocShell(pDocShell)
         {
-            StartListening(*m_pBasePool);
+            if (m_pBasePool) //tdf#124142 html docs can have no styles
+                StartListening(*m_pBasePool);
         }
 
         //XIndexAccess
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to