[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 34 commits - chart2/qa chart2/source dbaccess/source editeng/qa editeng/source framework/source icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_svg include/oox officecfg/registry oox/source package/source readlicense_oo/license sc/qa sc/source sd/source solenv/flatpak-manifest.in svl/source svtools/inc svx/source sw/qa sw/source vcl/inc vcl/source vcl/unx vcl/win writerfilter/source xmloff/qa xmloff/source

Eike Rathke erack at redhat.com
Mon Mar 19 09:22:24 UTC 2018


 chart2/qa/extras/chart2export.cxx                              |   11 
 chart2/qa/extras/chart2import.cxx                              |   97 
 chart2/qa/extras/data/pptx/tdf116163.pptx                      |binary
 chart2/source/view/axes/VAxisProperties.hxx                    |    2 
 chart2/source/view/axes/VCartesianAxis.cxx                     |   50 
 chart2/source/view/axes/VCartesianCoordinateSystem.cxx         |    2 
 chart2/source/view/axes/VCartesianCoordinateSystem.hxx         |    3 
 chart2/source/view/axes/VCoordinateSystem.cxx                  |    1 
 chart2/source/view/axes/VPolarCoordinateSystem.cxx             |    1 
 chart2/source/view/axes/VPolarCoordinateSystem.hxx             |    3 
 chart2/source/view/inc/VCoordinateSystem.hxx                   |    3 
 chart2/source/view/main/ChartView.cxx                          |    2 
 dbaccess/source/ui/querydesign/TableWindow.cxx                 |    1 
 editeng/qa/unit/core-test.cxx                                  |    4 
 editeng/source/editeng/impedit3.cxx                            |   13 
 framework/source/loadenv/loadenv.cxx                           |    4 
 icon-themes/sifr/links.txt                                     |   11 
 icon-themes/sifr_dark/links.txt                                |   17 
 icon-themes/sifr_svg/links.txt                                 |   17 
 include/oox/export/chartexport.hxx                             |    2 
 officecfg/registry/data/org/openoffice/Office/Accelerators.xcu |    8 
 officecfg/registry/schema/org/openoffice/Office/Common.xcs     |    4 
 officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs |    4 
 oox/source/export/chartexport.cxx                              |   20 
 package/source/manifest/ManifestExport.cxx                     |    4 
 readlicense_oo/license/CREDITS.fodt                            | 3789 +++++-----
 sc/qa/unit/subsequent_filters-test.cxx                         |    5 
 sc/source/core/data/table7.cxx                                 |    4 
 sc/source/core/tool/interpr1.cxx                               |    4 
 sc/source/filter/inc/addressconverter.hxx                      |    4 
 sc/source/filter/oox/excelfilter.cxx                           |   69 
 sc/source/filter/oox/sheetdatacontext.cxx                      |   21 
 sc/source/filter/oox/worksheethelper.cxx                       |   10 
 sc/source/ui/inc/viewdata.hxx                                  |    4 
 sc/source/ui/view/prevwsh.cxx                                  |    5 
 sc/source/ui/view/select.cxx                                   |   25 
 sc/source/ui/view/viewdata.cxx                                 |   12 
 sc/source/ui/view/viewfun2.cxx                                 |   26 
 sd/source/ui/view/drviewse.cxx                                 |    6 
 solenv/flatpak-manifest.in                                     |    6 
 svl/source/numbers/zformat.cxx                                 |    2 
 svl/source/numbers/zforscan.cxx                                |   20 
 svl/source/numbers/zforscan.hxx                                |    5 
 svtools/inc/errtxt.hrc                                         |    1 
 svx/source/dialog/srchdlg.cxx                                  |   31 
 sw/qa/core/data/html/fail/ofz6891-1.html                       |    1 
 sw/qa/core/data/rtf/fail/forcepoint-4.rtf                      | 1779 ++++
 sw/qa/core/data/rtf/fail/forcepoint-7.rtf                      |  517 +
 sw/qa/extras/ooxmlexport/data/tdf107035.docx                   |binary
 sw/qa/extras/ooxmlexport/data/tdf115861.docx                   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx                     |   31 
 sw/source/core/crsr/crstrvl.cxx                                |   12 
 sw/source/core/unocore/unotext.cxx                             |    4 
 sw/source/filter/html/htmltab.cxx                              |    8 
 sw/source/filter/ww8/ww8par.cxx                                |   17 
 sw/source/filter/ww8/ww8par.hxx                                |    2 
 sw/source/filter/ww8/ww8par6.cxx                               |   27 
 vcl/inc/regionband.hxx                                         |    3 
 vcl/source/gdi/region.cxx                                      |    8 
 vcl/source/gdi/regionband.cxx                                  |   27 
 vcl/unx/generic/printer/jobdata.cxx                            |   14 
 vcl/win/gdi/salprn.cxx                                         |    2 
 writerfilter/source/dmapper/DomainMapperTableManager.cxx       |    7 
 writerfilter/source/dmapper/DomainMapperTableManager.hxx       |    1 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx              |   11 
 writerfilter/source/dmapper/util.cxx                           |   14 
 xmloff/qa/unit/uxmloff.cxx                                     |  136 
 xmloff/source/core/xmlimp.cxx                                  |    2 
 xmloff/source/meta/xmlmetai.cxx                                |   19 
 69 files changed, 5082 insertions(+), 1893 deletions(-)

New commits:
commit 86bfe605dabf81a893b49f2c089c96816a188f82
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Mar 7 20:02:26 2018 +0100

    Resolves: tdf#116242 handle negated diacritics correctly and show checkbox
    
     This is a combination of 2 commits.
    
    Resolves: tdf#116242 handle negated diacritics correctly and show checkbox
    
    The "ignore diacritics" implementation is not only about CTL,
    whatever its names suggest. It uses an ICU
    "NFD; [:M:] Remove; NFC" transliteration that decomposes and
    removes *any* diacritic.
    
    Thus treat it as such and don't hide the checkbox if CTL is not
    enabled, but more important preset the sensitive values, and
    handle the UI vs implementation oddity correctly; UI "sensitive" /
    code "include" means to *not* *ignore*, obtain the proper negated
    value from the checkbox.
    
    Unfortunately the setting is stored in the configuration, so an
    update will still present the user with an unchecked
    Diacritics-sensitive box s/he has to enable once.
    
    The actual failure (diacritics always ignored) is a fallout from
    
        commit d4064927a2e83c974d4ee9538081e8a4fcdb1e34
        AuthorDate: Tue Oct 3 10:26:28 2017 -0800
        CommitDate: Thu Oct 26 17:24:26 2017 +0200
    
            tdf#111846 Find & Replace: Rename diacritics and kashida options
    
    (cherry picked from commit d99ae18b68d3889c999b59485006f85f7faa201c)
    
    Change IsIgnoreDiacritics_CTL default to false, tdf#116242 follow-up
    
    And adapt description to reality.
    
    (cherry picked from commit a8959a26e18237c458a853f2ca7524e875d4c1b6)
    
    ab35b74f4cbe7dc91fd0570adcc634faba96b5de
    
    Change-Id: I65f2a23b66370fdfe2d170c17c7736a3b4177192
    Reviewed-on: https://gerrit.libreoffice.org/50914
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 31f3e18d52c0cc124cd7a789a8f1fbc7c2534701)

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 6ec7ec487676..f9ea2cb3ae3a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5744,9 +5744,9 @@
         <!-- OldLocation: -->
         <!-- UIHints: Edit/Find & Replace -->
         <info>
-          <desc>Specifies search with the use of CTL option.</desc>
+          <desc>Specifies search ignores diacritics, not only CTL though.</desc>
         </info>
-        <value>true</value>
+        <value>false</value>
       </prop>
       <prop oor:name="IsIgnoreKashida_CTL" oor:type="xs:boolean" oor:nillable="false">
         <!-- OldPath: -->
diff --git a/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs b/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
index 1edab99beaff..98a581786d32 100644
--- a/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
@@ -954,9 +954,9 @@
       </prop>
       <prop oor:name="IsIgnoreDiacritics_CTL" oor:type="xs:boolean" oor:nillable="false">
         <info>
-          <desc>Specifies search with the use of CTL option.</desc>
+          <desc>Specifies search ignores diacritics, not only CTL though.</desc>
         </info>
-        <value>true</value>
+        <value>false</value>
       </prop>
       <prop oor:name="IsIgnoreKashida_CTL" oor:type="xs:boolean" oor:nillable="false">
         <info>
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 2ee79ba6b44d..3d8ae5e3000b 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -113,6 +113,10 @@ namespace
     {
         return pBox->IsEnabled() && pBox->IsChecked();
     }
+    bool GetNegatedCheckBoxValue(const CheckBox *pBox)
+    {
+        return pBox->IsEnabled() && !pBox->IsChecked();
+    }
 }
 
 struct SearchDlg_Impl
@@ -475,11 +479,15 @@ void SvxSearchDialog::Construct_Impl()
         m_pJapMatchFullHalfWidthCB->Hide();
     }
     SvtCTLOptions aCTLOptions;
+    // Do not disable and hide the m_pIncludeDiacritics button.
+    // Include Diacritics == Not Ignore Diacritics => A does not match A-Umlaut (Diaeresis).
+    // Confusingly these have negated names (following the UI) but the actual
+    // transliteration is to *ignore* diacritics if "included" (sensitive) is
+    // _not_ checked.
     if(!aCTLOptions.IsCTLFontEnabled())
     {
-        m_pIncludeDiacritics->Check( false );
-        m_pIncludeDiacritics->Hide();
-        m_pIncludeKashida->Check( false );
+        m_pIncludeDiacritics->Check( true );
+        m_pIncludeKashida->Check( true );
         m_pIncludeKashida->Hide();
     }
     //component extension - show component search buttons if the commands
@@ -719,7 +727,7 @@ void SvxSearchDialog::ShowOptionalControls_Impl()
     m_pSimilarityBox->Show();
     m_pSimilarityBtn->Show();
     m_pSelectionBtn->Show();
-    m_pIncludeDiacritics->Show(aCTLOptions.IsCTLFontEnabled());
+    m_pIncludeDiacritics->Show();
     m_pIncludeKashida->Show(aCTLOptions.IsCTLFontEnabled());
     m_pJapMatchFullHalfWidthCB->Show(aCJKOptions.IsCJKFontEnabled());
     m_pJapOptionsCB->Show(aCJKOptions.IsJapaneseFindEnabled());
@@ -799,8 +807,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
     m_pSimilarityBox->Check( pSearchItem->IsLevenshtein() );
     if( m_pJapOptionsCB->IsVisible() )
         m_pJapOptionsCB->Check( pSearchItem->IsUseAsianOptions() );
-    if (m_pIncludeDiacritics->IsVisible())
-        m_pIncludeDiacritics->Check( !aOpt.IsIgnoreDiacritics_CTL() );
+    m_pIncludeDiacritics->Check( !aOpt.IsIgnoreDiacritics_CTL() );
     if (m_pIncludeKashida->IsVisible())
         m_pIncludeKashida->Check( !aOpt.IsIgnoreKashida_CTL() );
     ApplyTransliterationFlags_Impl( pSearchItem->GetTransliterationFlags() );
@@ -1329,9 +1336,9 @@ IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn, void )
         if( !pSearchItem->IsUseAsianOptions())
             nFlags &= (TransliterationFlags::IGNORE_CASE |
                        TransliterationFlags::IGNORE_WIDTH );
-        if (!GetCheckBoxValue(m_pIncludeDiacritics))
+        if (GetNegatedCheckBoxValue(m_pIncludeDiacritics))
             nFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL;
-        if (!GetCheckBoxValue(m_pIncludeKashida))
+        if (GetNegatedCheckBoxValue(m_pIncludeKashida))
             nFlags |= TransliterationFlags::IGNORE_KASHIDA_CTL;
         pSearchItem->SetTransliterationFlags( nFlags );
 
@@ -2287,17 +2294,17 @@ void SvxSearchDialog::SaveToModule_Impl()
     pSearchItem->SetUseAsianOptions(GetCheckBoxValue(m_pJapOptionsCB));
 
     SvtSearchOptions aOpt;
-    aOpt.SetIgnoreDiacritics_CTL(!GetCheckBoxValue(m_pIncludeDiacritics));
-    aOpt.SetIgnoreKashida_CTL(!GetCheckBoxValue(m_pIncludeKashida));
+    aOpt.SetIgnoreDiacritics_CTL(GetNegatedCheckBoxValue(m_pIncludeDiacritics));
+    aOpt.SetIgnoreKashida_CTL(GetNegatedCheckBoxValue(m_pIncludeKashida));
     aOpt.Commit();
 
     TransliterationFlags nFlags = GetTransliterationFlags();
     if( !pSearchItem->IsUseAsianOptions())
         nFlags &= (TransliterationFlags::IGNORE_CASE |
                    TransliterationFlags::IGNORE_WIDTH );
-    if (!GetCheckBoxValue(m_pIncludeDiacritics))
+    if (GetNegatedCheckBoxValue(m_pIncludeDiacritics))
         nFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL;
-    if (!GetCheckBoxValue(m_pIncludeKashida))
+    if (GetNegatedCheckBoxValue(m_pIncludeKashida))
         nFlags |= TransliterationFlags::IGNORE_KASHIDA_CTL;
     pSearchItem->SetTransliterationFlags( nFlags );
 
commit f6926d2140cce74c30cf9b30fe58cd43a73399ec
Author: Luke Deller <luke at deller.id.au>
Date:   Mon Mar 5 00:14:28 2018 +1100

    tdf#107035 Fix field character style DOCX import
    
    Reinstate a call to DontExpandFormat which was removed from
    appendTextContent in commit 232ad2f2588beff50cb5c1f3b689c581ba317583
    
    This ensures that direct character formatting which ended immediately
    before the insertion point will not be expanded to cover the inserted
    content.
    
    Reviewed-on: https://gerrit.libreoffice.org/50729
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 18cbb8fe699131a234355e1d00fa917fede6ac46)
    Reviewed-on: https://gerrit.libreoffice.org/50815
    Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
    (cherry picked from commit afe0aa7fde7e4d4f9a928235e41953bf73e2ea6c)
    
    Change-Id: Ie5fa6b5c5acee4f885f9e67535e98801af23661a

diff --git a/sw/qa/extras/ooxmlexport/data/tdf107035.docx b/sw/qa/extras/ooxmlexport/data/tdf107035.docx
new file mode 100644
index 000000000000..a8ab045b61c9
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf107035.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 9f7ac20f42c9..4a2ccc41e596 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -195,6 +195,30 @@ DECLARE_OOXMLEXPORT_TEST(testTdf44832_testSectionWithDifferentHeader, "tdf44832_
     assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:headerReference", 1);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf107035, "tdf107035.docx")
+{
+    // Select the second run containing the page number field
+    auto xPgNumRun = getRun(getParagraph(1), 2, "1");
+
+    // Check that the page number field colour is set to "automatic".
+    sal_Int32 nPgNumColour = getProperty<sal_Int32>(xPgNumRun, "CharColor");
+#if 0
+    // TODO Enable this once tdf#116179 is fixed
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_AUTO), nPgNumColour);
+
+#else
+    // Meanwhile just check that the page number field colour is different
+    // from the green text before it:
+
+    // Select the first run containing the green text
+    auto xTextRun = getRun(getParagraph(1), 1);
+
+    // Check that the page number field colour is different from the green text
+    CPPUNIT_ASSERT(getProperty<sal_Int32>(xTextRun, "CharColor") != nPgNumColour);
+#endif
+
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index db3d78c9c382..6d01370e5d19 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -528,6 +528,10 @@ SwXText::insertTextContent(
         aIllegal.Message = "first parameter invalid";
         throw aIllegal;
     }
+    // Any direct formatting ending at the insert position (xRange) should not
+    // be expanded to cover the inserted content (xContent)
+    GetDoc()->DontExpandFormat( *aPam.Start() );
+
     // first test if the range is at the right position, then call
     // xContent->attach
     const SwStartNode* pOwnStartNode = GetStartNode();
commit 84023b2481348270361868ca1276867bfdfdd767
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 15 16:54:44 2018 +0000

    Resolves: tdf#115923 try a different approach to solving tdf#46637
    
    Try scrolling to the cell the mouse is over if its not fully visible already
    and this is not autofill selection. To avoid the mouse over the autofill handle
    which overflows into neighbours scrolling the neighbour cell into view before
    its truly desired to be selected when the mouse passes the center point
    
    in other words, for autofill go back to how it always was
    
    Change-Id: I6f67ad0f49c2d4087949f71f38322f06ced13c79
    Reviewed-on: https://gerrit.libreoffice.org/51392
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit d47a28723ee5b8df2f9e34449b15fac7970a1c69)

diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index f06043c79276..fcfe6eddf1c5 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -321,13 +321,28 @@ bool ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel, bool /* bDon
                                                  pEngine->GetWindow(),
                                                  nullptr, false);
 
-    bool bBottomScroll = ( aEditArea.Bottom() >= aWinSize.Height() );
-    bool bRightScroll  = ( aEditArea.Right() >= aWinSize.Width() );
+    bool bFillingSelection = pViewData->IsFillMode() || pViewData->GetFillMode() == ScFillMode::MATRIX;
+    bool bBottomScroll;
+    bool bRightScroll;
+    // for Autofill don't yet assume we want to auto-scroll to the cell under the mouse
+    // because the autofill handle extends into a cells neighbours so initial click is usually
+    // above a neighbour cell
+    if (bFillingSelection)
+    {
+        bBottomScroll = aEffPos.X() >= aWinSize.Height();
+        bRightScroll  = aEffPos.Y() >= aWinSize.Width();
+    }
+    else
+    {
+        //in the normal case make the full selected cell visible
+        bBottomScroll = aEditArea.Bottom() >= aWinSize.Height();
+        bRightScroll  = aEditArea.Right() >= aWinSize.Width();
+    }
+
     bool bScroll = bRightScroll || bBottomScroll || bLeftScroll || bTopScroll;
 
-    // for Autofill switch in the center of cell
-    // thereby don't prevent scrolling to bottom/right
-    if ( pViewData->IsFillMode() || pViewData->GetFillMode() == ScFillMode::MATRIX )
+    // for Autofill switch in the center of cell thereby don't prevent scrolling to bottom/right
+    if (bFillingSelection)
     {
         bool bLeft, bTop;
         pViewData->GetMouseQuadrant( aEffPos, GetWhich(), nPosX, nPosY, bLeft, bTop );
commit 6107250e6df5c166775339af0f33b625a5798fc9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 12 15:25:32 2018 +0000

    tdf#116277 blank frame into which document will load shown too early
    
    normally we want this to be the window that is the parent for any
    warning or password dialog. But for these (weird, see also impl_findSlotParam)
    frames dispatched with slotid arguments, they are opened before the dialog
    which will fill them is launched.
    
    Presumably in sane land the dialog would be dispatched from the menu entry,
    then on its create the frame opened with the desired contents.
    
    Change-Id: I1234b648ca1bd7fd2109cb4d3c70d5bfed9ab563
    Reviewed-on: https://gerrit.libreoffice.org/51152
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit be83e928279bf3c6ae3fd316571d02dc452b45e8)

diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 6ad9498f776f..a2cfb5e2b9f7 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -1074,7 +1074,9 @@ bool LoadEnv::impl_loadContent()
                 {"Parent", uno::Any(xWindow)}
             }));
             xHandler->initialize(aArguments);
-            impl_makeFrameWindowVisible(xWindow, false);
+            //show the frame now, unless (tdf#116277) its the labels/business cards slave frame
+            if (m_aURL.Arguments.indexOf("slot=") == -1)
+                impl_makeFrameWindowVisible(xWindow, false);
         }
     }
 
commit b87dee0394f3159c690aa2b7756ab930566fe961
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Fri Mar 2 10:39:33 2018 +0100

    tdf#116163: Limit label height in chart if needed
    
    Change-Id: Ia84fd0c3b76886bc6124dc3b59035465aa31b020
    Reviewed-on: https://gerrit.libreoffice.org/50700
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/50830
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 87d8df83efd210a322b42f590aaff3d2e8efe2bc)

diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 4b21f18f7248..9b9e75c868c2 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -102,6 +102,7 @@ public:
     void testAxisTitleRotationXLSX();
     void testAxisCrossBetweenXSLX();
     void testNumberFormatExportPPTX();
+    void testTdf116163();
 
     CPPUNIT_TEST_SUITE(Chart2ExportTest);
     CPPUNIT_TEST(testErrorBarXLSX);
@@ -168,6 +169,7 @@ public:
     CPPUNIT_TEST(testAxisTitleRotationXLSX);
     CPPUNIT_TEST(testAxisCrossBetweenXSLX);
     CPPUNIT_TEST(testNumberFormatExportPPTX);
+    CPPUNIT_TEST(testTdf116163);
     CPPUNIT_TEST_SUITE_END();
 
 protected:
@@ -1573,6 +1575,15 @@ void Chart2ExportTest::testNumberFormatExportPPTX()
     assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt", "sourceLinked", "0");
 }
 
+void Chart2ExportTest::testTdf116163()
+{
+    load("/chart2/qa/extras/data/pptx/", "tdf116163.pptx");
+    xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+    CPPUNIT_ASSERT(pXmlDoc);
+
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr", "rot", "-5400000");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/pptx/tdf116163.pptx b/chart2/qa/extras/data/pptx/tdf116163.pptx
new file mode 100644
index 000000000000..5fbee8304a52
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf116163.pptx differ
diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx
index 20f648d4fe8d..9a10c94f4719 100644
--- a/chart2/source/view/axes/VAxisProperties.hxx
+++ b/chart2/source/view/axes/VAxisProperties.hxx
@@ -137,6 +137,8 @@ struct AxisProperties final
     css::uno::Reference<css::chart2::data::XTextualDataSequence> m_xAxisTextProvider; //for categories or series names
     //<- category axes
 
+    bool                                m_bLimitSpaceForLabels;
+
     //methods:
 
     AxisProperties( const css::uno::Reference< css::chart2::XAxis >& xAxisModel
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 9493102a93c4..5e702f85dbed 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -74,6 +74,53 @@ VCartesianAxis::~VCartesianAxis()
     m_pPosHelper = nullptr;
 }
 
+void lcl_ResizeTextShapeToFitAvailableSpace( Reference< drawing::XShape >& xShape2DText,
+                                             const AxisLabelProperties& rAxisLabelProperties,
+                                             const OUString& rLabel,
+                                             const tNameSequence& rPropNames,
+                                             const tAnySequence& rPropValues )
+{
+    uno::Reference< text::XTextRange > xTextRange( xShape2DText, uno::UNO_QUERY );
+
+    if( !xTextRange.is() )
+        return;
+
+    const sal_Int32 nFullHeight = rAxisLabelProperties.m_aFontReferenceSize.Height;
+
+    if( !nFullHeight || !rLabel.getLength() )
+        return;
+
+    sal_Int32 nMaxLabelsHeight = nFullHeight - rAxisLabelProperties.m_aMaximumSpaceForLabels.Height - rAxisLabelProperties.m_aMaximumSpaceForLabels.Y;
+    const sal_Int32 nAvgCharWidth = xShape2DText->getSize().Width / rLabel.getLength();
+    const sal_Int32 nTextSize = AbstractShapeFactory::getSizeAfterRotation( xShape2DText,
+                                            rAxisLabelProperties.fRotationAngleDegree ).Height;
+
+    if( !nAvgCharWidth )
+        return;
+
+    const OUString sDots = "...";
+    const sal_Int32 nCharsToRemove = ( nTextSize - nMaxLabelsHeight ) / nAvgCharWidth + 1;
+    sal_Int32 nNewLen = rLabel.getLength() - nCharsToRemove - sDots.getLength();
+    // Prevent from showing only dots
+    if (nNewLen < 0)
+        nNewLen = ( rLabel.getLength() >= sDots.getLength() ) ? sDots.getLength() : rLabel.getLength();
+
+    bool bCrop = nCharsToRemove > 0;
+    if( bCrop )
+    {
+        OUString aNewLabel = rLabel.copy( 0, nNewLen );
+        if( nNewLen > sDots.getLength() )
+            aNewLabel += sDots;
+        xTextRange->setString( aNewLabel );
+
+        uno::Reference< beans::XPropertySet > xProp( xTextRange, uno::UNO_QUERY );
+        if( xProp.is() )
+        {
+            PropertyMapper::setMultiProperties( rPropNames, rPropValues, xProp );
+        }
+    }
+}
+
 Reference< drawing::XShape > createSingleLabel(
             const Reference< lang::XMultiServiceFactory>& xShapeFactory
           , const Reference< drawing::XShapes >& xTarget
@@ -96,6 +143,9 @@ Reference< drawing::XShape > createSingleLabel(
     Reference< drawing::XShape > xShape2DText = AbstractShapeFactory::getOrCreateShapeFactory(xShapeFactory)
                     ->createText( xTarget, aLabel, rPropNames, rPropValues, aATransformation );
 
+    if( rAxisProperties.m_bLimitSpaceForLabels )
+        lcl_ResizeTextShapeToFitAvailableSpace(xShape2DText, rAxisLabelProperties, aLabel, rPropNames, rPropValues);
+
     LabelPositionHelper::correctPositionForRotation( xShape2DText
         , rAxisProperties.maLabelAlignment.meAlignment, rAxisLabelProperties.fRotationAngleDegree, rAxisProperties.m_bComplexCategories );
 
diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
index 8e777f351bf1..d4cd7ec0cf2c 100644
--- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
@@ -93,6 +93,7 @@ void VCartesianCoordinateSystem::createVAxisList(
               const uno::Reference<chart2::XChartDocument> & xChartDoc
             , const awt::Size& rFontReferenceSize
             , const awt::Rectangle& rMaximumSpaceForLabels
+            , bool bLimitSpaceForLabels
             )
 {
     // note: using xChartDoc itself as XNumberFormatsSupplier would cause
@@ -125,6 +126,7 @@ void VCartesianCoordinateSystem::createVAxisList(
             aAxisProperties.m_nDimensionIndex = nDimensionIndex;
             aAxisProperties.m_bSwapXAndY = bSwapXAndY;
             aAxisProperties.m_bIsMainAxis = (nAxisIndex==0);
+            aAxisProperties.m_bLimitSpaceForLabels = bLimitSpaceForLabels;
             Reference< XAxis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( xAxis, m_xCooSysModel ) );
             if( xCrossingMainAxis.is() )
             {
diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.hxx b/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
index c61768f5ee5c..e959dbc5d5ef 100644
--- a/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
+++ b/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
@@ -34,7 +34,8 @@ public:
     virtual void createVAxisList(
             const css::uno::Reference< css::chart2::XChartDocument> &ChartDoc
             , const css::awt::Size& rFontReferenceSize
-            , const css::awt::Rectangle& rMaximumSpaceForLabels ) override;
+            , const css::awt::Rectangle& rMaximumSpaceForLabels
+            , bool bLimitSpaceForLabels ) override;
 
     virtual void initVAxisInList() override;
     virtual void updateScalesAndIncrementsOnAxes() override;
diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx
index 2b0830d0dfee..1099f497a850 100644
--- a/chart2/source/view/axes/VCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCoordinateSystem.cxx
@@ -343,6 +343,7 @@ void VCoordinateSystem::createVAxisList(
               const uno::Reference<chart2::XChartDocument> & /* xChartDoc */
             , const awt::Size& /* rFontReferenceSize */
             , const awt::Rectangle& /* rMaximumSpaceForLabels */
+            , bool /* bLimitSpaceForLabels */
             )
 {
 }
diff --git a/chart2/source/view/axes/VPolarCoordinateSystem.cxx b/chart2/source/view/axes/VPolarCoordinateSystem.cxx
index 49eb8763cd12..f947686c3a28 100644
--- a/chart2/source/view/axes/VPolarCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VPolarCoordinateSystem.cxx
@@ -65,6 +65,7 @@ void VPolarCoordinateSystem::createVAxisList(
               const uno::Reference<chart2::XChartDocument> & xChartDoc
             , const awt::Size& rFontReferenceSize
             , const awt::Rectangle& rMaximumSpaceForLabels
+            , bool //bLimitSpaceForLabels
             )
 {
     // note: using xChartDoc itself as XNumberFormatsSupplier would cause
diff --git a/chart2/source/view/axes/VPolarCoordinateSystem.hxx b/chart2/source/view/axes/VPolarCoordinateSystem.hxx
index e7941484e23b..4976672963c8 100644
--- a/chart2/source/view/axes/VPolarCoordinateSystem.hxx
+++ b/chart2/source/view/axes/VPolarCoordinateSystem.hxx
@@ -38,7 +38,8 @@ public:
     virtual void createVAxisList(
             const css::uno::Reference< css::chart2::XChartDocument> & xChartDoc
             , const css::awt::Size& rFontReferenceSize
-            , const css::awt::Rectangle& rMaximumSpaceForLabels ) override;
+            , const css::awt::Rectangle& rMaximumSpaceForLabels
+            , bool bLimitSpaceForLabels ) override;
 
     virtual void initVAxisInList() override;
     virtual void updateScalesAndIncrementsOnAxes() override;
diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx b/chart2/source/view/inc/VCoordinateSystem.hxx
index 6b115d3d7715..7a4a7110a2e4 100644
--- a/chart2/source/view/inc/VCoordinateSystem.hxx
+++ b/chart2/source/view/inc/VCoordinateSystem.hxx
@@ -111,7 +111,8 @@ public:
     virtual void createVAxisList(
             const css::uno::Reference< css::chart2::XChartDocument> & xChartDoc
             , const css::awt::Size& rFontReferenceSize
-            , const css::awt::Rectangle& rMaximumSpaceForLabels );
+            , const css::awt::Rectangle& rMaximumSpaceForLabels
+            , bool bLimitSpaceForLabels );
 
     virtual void initVAxisInList();
     virtual void updateScalesAndIncrementsOnAxes();
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 97a51c55c961..49c598709280 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1600,7 +1600,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
             pVCooSys->set3DWallPositions( eLeftWallPos, eBackWallPos, eBottomPos );
         }
 
-        pVCooSys->createVAxisList(xChartDoc, rPageSize, rParam.maRemainingSpace);
+        pVCooSys->createVAxisList(xChartDoc, rPageSize, rParam.maRemainingSpace, rParam.mbUseFixedInnerSize);
     }
 
     // - prepare list of all axis and how they are used
diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index e1ae1f4f0a9b..9bbf1d3e16f9 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -172,7 +172,7 @@ private:
     void exportSeriesValues(
         const css::uno::Reference< css::chart2::data::XDataSequence >& xValueSeq, sal_Int32 nValueType = XML_val );
     void exportShapeProps( const css::uno::Reference< css::beans::XPropertySet >& xPropSet );
-    void exportTextProps(const css::uno::Reference< css::beans::XPropertySet >& xPropSet);
+    void exportTextProps(const css::uno::Reference< css::beans::XPropertySet >& xPropSet, bool bAxis = false);
     void exportDataPoints(
         const css::uno::Reference< css::beans::XPropertySet >& xSeriesProperties,
         sal_Int32 nSeriesLength, sal_Int32 eChartType );
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 4e789f9b3c97..2456b6c0dca0 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2270,11 +2270,25 @@ void ChartExport::exportShapeProps( const Reference< XPropertySet >& xPropSet )
     pFS->endElement( FSNS( XML_c, XML_spPr ) );
 }
 
-void ChartExport::exportTextProps(const Reference<XPropertySet>& xPropSet)
+void ChartExport::exportTextProps(const Reference<XPropertySet>& xPropSet, bool bAxis)
 {
     FSHelperPtr pFS = GetFS();
     pFS->startElement(FSNS(XML_c, XML_txPr), FSEND);
-    pFS->singleElement( FSNS( XML_a, XML_bodyPr ), FSEND );
+
+    sal_Int32 nRotation = 0;
+    if (bAxis)
+    {
+        double fTextRotation = 0;
+        uno::Any aAny = xPropSet->getPropertyValue("TextRotation");
+        if (aAny.hasValue() && (aAny >>= fTextRotation))
+            nRotation = fTextRotation * -600.0;
+    }
+
+    if (nRotation)
+        pFS->singleElement(FSNS(XML_a, XML_bodyPr), XML_rot, I32S(nRotation), FSEND);
+    else
+        pFS->singleElement(FSNS(XML_a, XML_bodyPr), FSEND);
+
     pFS->singleElement( FSNS( XML_a, XML_lstStyle ), FSEND );
 
     pFS->startElement(FSNS(XML_a, XML_p), FSEND);
@@ -2681,7 +2695,7 @@ void ChartExport::_exportAxis(
     // shape properties
     exportShapeProps( xAxisProp );
 
-    exportTextProps(xAxisProp);
+    exportTextProps(xAxisProp, true);
 
     pFS->singleElement( FSNS( XML_c, XML_crossAx ),
             XML_val, I32S( rAxisIdPair.nCrossAx ),
commit bdc8127c4ec3c62da63e7cbafe07b76b32b58f18
Author: Xisco Fauli <xiscofauli at libreoffice.org>
Date:   Wed Mar 14 10:19:47 2018 +0100

    tdf#115539, tdf#116238: Don't display the notebookbar in presentation mode
    
    Change-Id: Ifc64d9a3b5c93b83fa238737375e7a58b2ae86db
    Reviewed-on: https://gerrit.libreoffice.org/51262
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    (cherry picked from commit 6a9326803c01f4c9bc7da855053ce4e80646fad8)
    Reviewed-on: https://gerrit.libreoffice.org/51294
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit f7db69e5302dca28c3cf5a36dc2328bd062fc0d9)

diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 99a1c34343f5..d24dbb65b4d4 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -721,12 +721,8 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
         case SID_PRESENTATION_CURRENT_SLIDE:
         case SID_REHEARSE_TIMINGS:
         {
-            sfx2::SfxNotebookBar::LockNotebookBar();
-
             slideshowhelp::ShowSlideShow(rReq, *GetDoc());
             rReq.Ignore ();
-
-            sfx2::SfxNotebookBar::UnlockNotebookBar();
         }
         break;
 
@@ -1587,6 +1583,7 @@ namespace slideshowhelp
         Reference< XPresentation2 > xPresentation( rDoc.getPresentation() );
         if( xPresentation.is() )
         {
+            sfx2::SfxNotebookBar::LockNotebookBar();
             if (SID_REHEARSE_TIMINGS == rReq.GetSlot())
                 xPresentation->rehearseTimings();
             else if (rDoc.getPresentationSettings().mbCustomShow)
@@ -1616,6 +1613,7 @@ namespace slideshowhelp
 
                 xPresentation->startWithArguments( aArguments );
             }
+            sfx2::SfxNotebookBar::UnlockNotebookBar();
         }
     }
 }
commit b1fa04fb8651e3d29f5d623b49527ee7ced6a16f
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Feb 28 22:39:30 2018 +0100

    Resolves: tdf#114555 check .xlsx col/row/tab overflow and display warning
    
     This is a combination of 2 commits.
    
    Resolves: tdf#114555 check .xlsx col/row/tab overflow and display warning
    
    Cherry-picked from 66564dac88ffcc781b4fade7ca0f4f72af6b8bca and
    backported / un-weld-ed by using the original patch set
    https://gerrit.libreoffice.org/#/c/50541/1 before weld-ing, and
    getRID_ERRCTX() instead of RID_ERRCTX.
    
    Related: tdf#114555 cater for lastcolumn+1 oddity if last is last possible
    
    Else our own saved .xlsx files raise the excess columns warning.
    
    (cherry picked from commit ccc977ba10b61108a56e00a79c0f7a1517e026cc)
    
    e1791dd026d9faf4b391ad34da43ec0c70c8de83
    
    Change-Id: I3091a890b6d4a3f27d9284fc5c0e2df3bc8ce527
    Reviewed-on: https://gerrit.libreoffice.org/50570
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
    (cherry picked from commit 621634923ab7c11ceef9757c481f92977ef863f6)

diff --git a/sc/source/filter/inc/addressconverter.hxx b/sc/source/filter/inc/addressconverter.hxx
index 57f1f33cabcd..d1d53531e0f1 100644
--- a/sc/source/filter/inc/addressconverter.hxx
+++ b/sc/source/filter/inc/addressconverter.hxx
@@ -479,6 +479,10 @@ public:
     static css::uno::Sequence<css::table::CellRangeAddress>
                         toApiSequence(const ScRangeList& orRanges);
 
+    bool                isColOverflow() const { return mbColOverflow; }
+    bool                isRowOverflow() const { return mbRowOverflow; }
+    bool                isTabOverflow() const { return mbTabOverflow; }
+
 private:
     void                initializeMaxPos(
                             sal_Int16 nMaxXlsTab, sal_Int32 nMaxXlsCol, sal_Int32 nMaxXlsRow );
diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx
index 171f5ff67cf7..55cee4841b7f 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -30,6 +30,15 @@
 #include <workbookfragment.hxx>
 #include <xestream.hxx>
 
+#include <addressconverter.hxx>
+#include <document.hxx>
+#include <docsh.hxx>
+#include <scerrors.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/vclptr.hxx>
+#include <svtools/sfxecode.hxx>
+#include <tools/urlobj.hxx>
+
 namespace oox {
 namespace xls {
 
@@ -97,9 +106,65 @@ bool ExcelFilter::importDocument()
             the class WorkbookHelper, and execute the import filter by constructing
             an instance of WorkbookFragment and loading the file. */
         WorkbookGlobalsRef xBookGlob(WorkbookHelper::constructGlobals(*this));
-        if (xBookGlob.get() && importFragment(new WorkbookFragment(*xBookGlob, aWorkbookPath)))
+        if (xBookGlob.get())
         {
-            return true;
+            rtl::Reference<FragmentHandler> xWorkbookFragment( new WorkbookFragment(*xBookGlob, aWorkbookPath));
+            bool bRet = importFragment( xWorkbookFragment);
+            if (bRet)
+            {
+                const WorkbookFragment* pWF = static_cast<const WorkbookFragment*>(xWorkbookFragment.get());
+                const AddressConverter& rAC = pWF->getAddressConverter();
+                if (rAC.isTabOverflow() || rAC.isColOverflow() || rAC.isRowOverflow())
+                {
+                    const ScDocument& rDoc = pWF->getScDocument();
+                    if (rDoc.IsUserInteractionEnabled())
+                    {
+                        // Show data loss warning.
+
+                        INetURLObject aURL( getFileUrl());
+                        SfxErrorContext aContext( ERRCTX_SFX_OPENDOC,
+                                aURL.getName( INetURLObject::LAST_SEGMENT, true,
+                                    INetURLObject::DecodeMechanism::WithCharset),
+                                nullptr, getRID_ERRCTX());
+
+                        OUString aWarning;
+                        aContext.GetString( ERRCODE_NONE.MakeWarning(), aWarning);
+                        aWarning += ":\n";
+
+                        OUString aMsg;
+                        if (rAC.isTabOverflow())
+                        {
+                            if (ErrorHandler::GetErrorString( SCWARN_IMPORT_SHEET_OVERFLOW, aMsg))
+                                aWarning += aMsg;
+                        }
+                        if (rAC.isColOverflow())
+                        {
+                            if (!aMsg.isEmpty())
+                                aWarning += "\n";
+                            if (ErrorHandler::GetErrorString( SCWARN_IMPORT_COLUMN_OVERFLOW, aMsg))
+                                aWarning += aMsg;
+                        }
+                        if (rAC.isRowOverflow())
+                        {
+                            if (!aMsg.isEmpty())
+                                aWarning += "\n";
+                            if (ErrorHandler::GetErrorString( SCWARN_IMPORT_ROW_OVERFLOW, aMsg))
+                                aWarning += aMsg;
+                        }
+
+                        /* XXX displaying a dialog here is ugly and should
+                         * rather happen at UI level instead of at the filter
+                         * level, but it seems there's no way to transport
+                         * detailed information other than returning true or
+                         * false at this point? */
+
+                        ScopedVclPtrInstance<WarningBox> pBox( ScDocShell::GetActiveDialogParent(),
+                                MessBoxStyle::Ok | MessBoxStyle::DefaultOk, aWarning);
+                        pBox->Execute();
+                    }
+                }
+            }
+            return bRet;
         }
     }
     catch (...)
diff --git a/sc/source/filter/oox/sheetdatacontext.cxx b/sc/source/filter/oox/sheetdatacontext.cxx
index b221cb16a73b..5f17d8c419b6 100644
--- a/sc/source/filter/oox/sheetdatacontext.cxx
+++ b/sc/source/filter/oox/sheetdatacontext.cxx
@@ -273,6 +273,7 @@ void SheetDataContext::importRow( const AttributeList& rAttribs )
     }
     else
         aModel.mnRow = ++mnRow;
+    mrAddressConv.checkRow( mnRow, true);
     mnCol = -1;
 
     aModel.mfHeight       = rAttribs.getDouble( XML_ht, -1.0 );
@@ -297,8 +298,14 @@ void SheetDataContext::importRow( const AttributeList& rAttribs )
         if( (0 < nSepPos) && (nSepPos + 1 < aColSpanToken.getLength()) )
         {
             // OOXML uses 1-based integer column indexes, row model expects 0-based colspans
-            sal_Int32 nLastCol = ::std::min( aColSpanToken.copy( nSepPos + 1 ).toInt32() - 1, nMaxCol );
-            aModel.insertColSpan( ValueRange( aColSpanToken.copy( 0, nSepPos ).toInt32() - 1, nLastCol ) );
+            const sal_Int32 nCol1 = aColSpanToken.copy( 0, nSepPos ).toInt32() - 1;
+            const bool bValid1 = mrAddressConv.checkCol( nCol1, true);
+            if (bValid1)
+            {
+                const sal_Int32 nCol2 = aColSpanToken.copy( nSepPos + 1 ).toInt32() - 1;
+                mrAddressConv.checkCol( nCol2, true);
+                aModel.insertColSpan( ValueRange( nCol1, ::std::min( nCol2, nMaxCol )));
+            }
         }
     }
 
@@ -314,7 +321,9 @@ bool SheetDataContext::importCell( const AttributeList& rAttribs )
     if (!p)
     {
         ++mnCol;
-        maCellData.maCellAddr = ScAddress( mnCol, mnRow, mnSheet );
+        ScAddress aAddress( mnCol, mnRow, mnSheet );
+        bValid = mrAddressConv.checkCellAddress( aAddress, true );
+        maCellData.maCellAddr = aAddress;
     }
     else
     {
@@ -374,6 +383,7 @@ void SheetDataContext::importRow( SequenceInputStream& rStrm )
     nSpanCount = rStrm.readInt32();
     maCurrPos.mnCol = 0;
 
+    mrAddressConv.checkRow( maCurrPos.mnRow, true);
     // row index is 0-based in BIFF12, but RowModel expects 1-based
     aModel.mnRow          = maCurrPos.mnRow + 1;
     // row height is in twips in BIFF12, convert to points
@@ -393,8 +403,11 @@ void SheetDataContext::importRow( SequenceInputStream& rStrm )
     {
         sal_Int32 nFirstCol, nLastCol;
         nFirstCol = rStrm.readInt32();
+        const bool bValid1 = mrAddressConv.checkCol( nFirstCol, true);
         nLastCol = rStrm.readInt32();
-        aModel.insertColSpan( ValueRange( nFirstCol, ::std::min( nLastCol, nMaxCol ) ) );
+        mrAddressConv.checkCol( nLastCol, true);
+        if (bValid1)
+            aModel.insertColSpan( ValueRange( nFirstCol, ::std::min( nLastCol, nMaxCol ) ) );
     }
 
     // set row properties in the current sheet
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 2ef765d932b5..c1cdae73e4b1 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -763,8 +763,14 @@ void WorksheetGlobals::setColumnModel( const ColumnModel& rModel )
     sal_Int32 nLastCol = rModel.maRange.mnLast - 1;
     if( getAddressConverter().checkCol( nFirstCol, true ) && (nFirstCol <= nLastCol) )
     {
-        // validate last column index
-        if( !getAddressConverter().checkCol( nLastCol, true ) )
+        // Validate last column index.
+        // If last column is equal to last possible column, Excel adds one
+        // more. We do that also in XclExpColinfo::SaveXml() and for 1024 end
+        // up with 1025 instead, which would lead to excess columns in
+        // checkCol(). Cater for this oddity.
+        if (nLastCol == mrMaxApiPos.Col() + 1)
+            --nLastCol;
+        else if( !getAddressConverter().checkCol( nLastCol, true ) )
             nLastCol = mrMaxApiPos.Col();
         // try to find entry in column model map that is able to merge with the passed model
         bool bInsertModel = true;
commit 1b7b1cf28516371640d6ae5a51f0f50f0388967d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 15 17:26:36 2018 +0000

    ofz#6827 Bad-cast
    
    Change-Id: I856d781f122c21c02a0a8cd01369d49f50b8a555
    Reviewed-on: https://gerrit.libreoffice.org/51364
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 69b4389bb41913cac3550cec8300207576df752f)

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index e448087db0f3..5aebb80ee873 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3981,7 +3981,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
     long nCpOfs = m_xPlcxMan->GetCpOfs(); // Offset for Header/Footer, Footnote
 
     WW8_CP nNext = m_xPlcxMan->Where();
-    SwTextNode* pPreviousNode = nullptr;
+    m_pPreviousNode = nullptr;
     sal_uInt8 nDropLines = 0;
     SwCharFormat* pNewSwCharFormat = nullptr;
     const SwCharFormat* pFormat = nullptr;
@@ -4013,7 +4013,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
 
         // If the previous paragraph was a dropcap then do not
         // create a new txtnode and join the two paragraphs together
-        if (bStartLine && !pPreviousNode) // Line end
+        if (bStartLine && !m_pPreviousNode) // Line end
         {
             bool bSplit = true;
             if (m_bCareFirstParaEndInToc)
@@ -4037,10 +4037,10 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
             }
         }
 
-        if (pPreviousNode && bStartLine)
+        if (m_pPreviousNode && bStartLine)
         {
             SwTextNode* pEndNd = m_pPaM->GetNode().GetTextNode();
-            const sal_Int32 nDropCapLen = pPreviousNode->GetText().getLength();
+            const sal_Int32 nDropCapLen = m_pPreviousNode->GetText().getLength();
 
             // Need to reset the font size and text position for the dropcap
             {
@@ -4067,12 +4067,12 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
             SwPosition aStart(*pEndNd);
             m_xCtrlStck->NewAttr(aStart, aDrop);
             m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_PARATR_DROP);
-            pPreviousNode = nullptr;
+            m_pPreviousNode = nullptr;
         }
         else if (m_bDropCap)
         {
             // If we have found a dropcap store the textnode
-            pPreviousNode = m_pPaM->GetNode().GetTextNode();
+            m_pPreviousNode = m_pPaM->GetNode().GetTextNode();
 
             SprmResult aDCS;
             if (m_bVer67)
@@ -4083,7 +4083,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
             if (aDCS.pSprm && aDCS.nRemainingData >= 1)
                 nDropLines = (*aDCS.pSprm) >> 3;
             else    // There is no Drop Cap Specifier hence no dropcap
-                pPreviousNode = nullptr;
+                m_pPreviousNode = nullptr;
 
             SprmResult aDistance = m_xPlcxMan->GetPapPLCF()->HasSprm(0x842F);
             if (aDistance.pSprm && aDistance.nRemainingData >= 2)
@@ -4155,6 +4155,8 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
         }
     }
 
+    m_pPreviousNode = nullptr;
+
     if (m_pPaM->GetPoint()->nContent.GetIndex())
         AppendTextNode(*m_pPaM->GetPoint());
 
@@ -4271,6 +4273,7 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage,
     , m_nEmbeddedTOXLevel(0)
     , m_bLoadingTOXHyperlink(false)
     , m_pPosAfterTOC(nullptr)
+    , m_pPreviousNode(nullptr)
     , m_bCareFirstParaEndInToc(false)
     , m_bCareLastParaEndInToc(false)
     , m_aTOXEndCps()
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 23e27a127713..11e53a5a9a05 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1356,6 +1356,8 @@ private:
     bool m_bLoadingTOXHyperlink;
     // a document position recorded the after-position of TOC section, managed by Read_F_TOX() and End_Field()
     SwPaM* m_pPosAfterTOC;
+    // used for some dropcap tweaking
+    SwTextNode* m_pPreviousNode;
 
     std::unique_ptr< SwPosition > m_pLastAnchorPos;
 
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 1d88c6fac4e8..249597032fa0 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2438,19 +2438,31 @@ bool SwWW8ImplReader::JoinNode(SwPaM &rPam, bool bStealAttr)
         if (bStealAttr)
             m_xCtrlStck->StealAttr(rPam.GetPoint()->nNode);
 
-        if (m_pLastAnchorPos.get())
+        if (m_pLastAnchorPos || m_pPreviousNode)
         {
-            //If the last anchor pos is here, then clear the anchor pos.
-            //This "last anchor pos" is only used for fixing up the
-            //positions of things anchored to page breaks and here
-            //we are removing the last paragraph of a frame, so there
-            //cannot be a page break at this point so we can
-            //safely reset m_pLastAnchorPos to avoid any dangling
-            //SwIndex's pointing into the deleted paragraph
-            SwNodeIndex aLastAnchorPos(m_pLastAnchorPos->nNode);
             SwNodeIndex aToBeJoined(aPref, 1);
-            if (aLastAnchorPos == aToBeJoined)
-                m_pLastAnchorPos.reset();
+
+            if (m_pLastAnchorPos)
+            {
+                //If the last anchor pos is here, then clear the anchor pos.
+                //This "last anchor pos" is only used for fixing up the
+                //positions of things anchored to page breaks and here
+                //we are removing the last paragraph of a frame, so there
+                //cannot be a page break at this point so we can
+                //safely reset m_pLastAnchorPos to avoid any dangling
+                //SwIndex's pointing into the deleted paragraph
+                SwNodeIndex aLastAnchorPos(m_pLastAnchorPos->nNode);
+                if (aLastAnchorPos == aToBeJoined)
+                    m_pLastAnchorPos.reset();
+            }
+
+            if (m_pPreviousNode)
+            {
+                //If the drop character start pos is here, then clear it.
+                SwNodeIndex aDropCharPos(*m_pPreviousNode);
+                if (aDropCharPos == aToBeJoined)
+                    m_pPreviousNode = nullptr;
+            }
         }
 
         pNode->JoinNext();
commit 50b592c5ae9b0147cb0f3679a826310aea6c8764
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Mar 12 20:03:34 2018 +0100

    xmloff: ODF import: improve meta:generator checks
    
    Instead of a hard-coded check for (effectively) one project name
    "LibreOffice" (which is build-time configurable), check for the string
    "LibreOffice_project", which has been produced hard-coded ever since
    LO 3.3.0.
    
    This now recognises additional downstreams "LibreOffice_Vanilla"
    and "Collabora_Office", and also historic "BrOffice".
    
    An important point here is that the build-time configurable version
    numbers of any downstream that retains the hard-coded
    "LibreOffice_project" *MUST* be the same as the upstream's at least
    in their major and minor versions (micro and further digits are
    currently not used), and that such downstreams don't backport
    changes with ODF export compatibility impact further than upstream.
    
    Add a unit test too, with a representative sample of 4372 distinct
    generators in bugzilla attachments.
    
    This revealed that StarOffice 6 and AOO 4.0.1 were falling through
    the cracks and not recognised, so fix that too.
    
    Change-Id: I8105222d3428e7b20cc4a6b8e76732c697812594
    Reviewed-on: https://gerrit.libreoffice.org/51171
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 0d6ffe118fd1d03e22fcda2f06d49b4c932d2018)
    Reviewed-on: https://gerrit.libreoffice.org/51261
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 90ea159df9b326c0d00b736abaf769062122a32b)

diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx
index bb4a15cc8852..71a1b371f006 100644
--- a/xmloff/qa/unit/uxmloff.cxx
+++ b/xmloff/qa/unit/uxmloff.cxx
@@ -10,6 +10,12 @@
 #include <sal/config.h>
 #include <test/bootstrapfixture.hxx>
 
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+#include <comphelper/genericpropertyset.hxx>
+
+#include <xmloff/xmlimp.hxx>
+#include <xmloff/xmlmetai.hxx>
 #include <xmloff/xmlexp.hxx>
 #include <xmloff/xmltoken.hxx>
 #include <xmloff/xmlaustp.hxx>
@@ -30,9 +36,11 @@ public:
     virtual void tearDown() override;
 
     void testAutoStylePool();
+    void testMetaGenerator();
 
     CPPUNIT_TEST_SUITE(Test);
     CPPUNIT_TEST(testAutoStylePool);
+    CPPUNIT_TEST(testMetaGenerator);
     CPPUNIT_TEST_SUITE_END();
 private:
     SvXMLExport *pExport;
@@ -87,6 +95,134 @@ void Test::testAutoStylePool()
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "same style not found", aName, aSameName );
 }
 
+void Test::testMetaGenerator()
+{
+    comphelper::PropertyMapEntry const aInfoMap[] = {
+        { OUString("BuildId"), 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
+        { OUString(), 0, css::uno::Type(), 0, 0 }
+    };
+    uno::Reference<beans::XPropertySet> const xInfoSet(
+        comphelper::GenericPropertySet_CreateInstance(
+            new comphelper::PropertySetInfo(aInfoMap)));
+
+    struct {
+        char const*const generator;
+        char const*const buildId;
+        sal_uInt16 const result;
+    } const tests [] = {
+        // foreign
+        { "AbiWord/2.8.6 (unix, gtk)", "", SvXMLImport::ProductVersionUnknown },
+        { "Aspose.Words for Java 13.10.0.0", "", SvXMLImport::ProductVersionUnknown },
+        { "CIB jsmerge 1.0.0", "", SvXMLImport::ProductVersionUnknown },
+        { "Calligra/2.4.3", "", SvXMLImport::ProductVersionUnknown },
+        { "CocoaODFWriter/1339", "", SvXMLImport::ProductVersionUnknown },
+        { "KOffice/1.4.1", "", SvXMLImport::ProductVersionUnknown },
+        { "KPresenter 1.3", "", SvXMLImport::ProductVersionUnknown },
+        { "KSpread 1.3.2", "", SvXMLImport::ProductVersionUnknown },
+        { "Lotus Symphony/1.2.0_20081023.1730/Win32", "", SvXMLImport::ProductVersionUnknown },
+        { "Microsoft Excel Online", "", SvXMLImport::ProductVersionUnknown },
+        { "MicrosoftOffice/12.0 MicrosoftExcel/CalculationVersion-4518", "", SvXMLImport::ProductVersionUnknown },
+        { "MicrosoftOffice/15.0 MicrosoftWord", "", SvXMLImport::ProductVersionUnknown },
+        { "ODF Converter v1.0.0", "", SvXMLImport::ProductVersionUnknown },
+        { "ODF::lpOD 1.121", "", SvXMLImport::ProductVersionUnknown },
+        { "ODFDOM/0.6.1$Build-1", "", SvXMLImport::ProductVersionUnknown },
+        { "ODFPY/0.9.6", "", SvXMLImport::ProductVersionUnknown },
+        { "OpenXML/ODF Translator Command Line Tool 3.0 2.0.0", "", SvXMLImport::ProductVersionUnknown },
+        { "Org-7.8.03/Emacs-24.0.93.1", "", SvXMLImport::ProductVersionUnknown },
+        { "TeX4ht from eqns_long.tex, options: xhtml,ooffice,refcaption", "", SvXMLImport::ProductVersionUnknown },
+        { "TextMaker", "", SvXMLImport::ProductVersionUnknown },
+        { "docbook2odf generator (http://open.comsultia.com/docbook2odf/)", "", SvXMLImport::ProductVersionUnknown },
+        { "fig2sxd", "", SvXMLImport::ProductVersionUnknown },
+        { "gnumeric/1.10.9", "", SvXMLImport::ProductVersionUnknown },
+        { "libodfgen/0.1.6", "", SvXMLImport::ProductVersionUnknown },
+
+        // OOo 1.x
+        { "StarSuite 6.0 (Linux)", "645$8687", SvXMLImport::OOo_1x },
+        { "StarOffice 6.1 (Win32)", "645$8687", SvXMLImport::OOo_1x },
+        { "OpenOffice.org 1.1.2RC3.DE (Win32)", "645$8687", SvXMLImport::OOo_1x },
+        { "OpenOffice.org 1.1.5 (Win32)", "645$8687", SvXMLImport::OOo_1x },
+        { "StarOffice 7 (Win32)", "645$8687", SvXMLImport::OOo_1x },
+
+        // OOo 2.x
+        { "Sun_ODF_Plugin_for_Microsoft_Office/1.1$Win32 OpenOffice.org_project/680m5$Build-9221", "680$9221", SvXMLImport::OOo_2x },
+        { "StarSuite/8$Win32 OpenOffice.org_project/680m6$Build-9095", "680$9095", SvXMLImport::OOo_2x },
+        { "StarOffice/8$Win32 OpenOffice.org_project/680m93$Build-8897", "680$8897", SvXMLImport::OOo_2x },
+        { "OpenOffice.org/2.0$Linux OpenOffice.org_project/680m3$Build-8968", "680$8968", SvXMLImport::OOo_2x },
+        { "OpenOffice.org/2.1$Win32 OpenOffice.org_project/680m6$Build-9095", "680$9095", SvXMLImport::OOo_2x },
+        { "OpenOffice.org/2.4$Win32 OpenOffice.org_project/680m248$Build-9274", "680$9274", SvXMLImport::OOo_2x },
+
+        // OOo 3.x
+        { "OpenOffice.org/3.0$Solaris_Sparc OpenOffice.org_project/300m9$Build-9358", "300$9358", SvXMLImport::OOo_30x },
+        { "StarSuite/9$Unix OpenOffice.org_project/300m9$Build-9358", "300$9358", SvXMLImport::OOo_30x },
+        { "StarOffice/9$Win32 OpenOffice.org_project/300m14$Build-9376", "300$9376", SvXMLImport::OOo_30x },
+        { "OpenOffice.org/3.1$Solaris_x86 OpenOffice.org_project/310m11$Build-9399", "310$9399", SvXMLImport::OOo_31x },
+        { "IBM_Lotus_Symphony/2.0$Win32 OpenOffice.org_project/310m11$Build-9399", "310$9399", SvXMLImport::OOo_31x },
+        { "BrOffice.org/3.1$Linux OpenOffice.org_project/310m11$Build-9399", "310$9399", SvXMLImport::OOo_31x },
+        { "StarOffice/9$Solaris_Sparc OpenOffice.org_project/310m19$Build-9420", "310$9420", SvXMLImport::OOo_31x },
+        { "OpenOffice.org/3.2$Linux OpenOffice.org_project/320m12$Build-9483", "320$9483", SvXMLImport::OOo_32x },
+        { "StarOffice/9$Win32 OpenOffice.org_project/320m12$Build-9483", "320$9483", SvXMLImport::OOo_32x },
+        { "OpenOffice.org/3.3$Linux OpenOffice.org_project/330m20$Build-9567", "330$9567", SvXMLImport::OOo_33x },
+        { "Oracle_Open_Office/3.3$Win32 OpenOffice.org_project/330m7$Build-9552", "330$9552", SvXMLImport::OOo_33x },
+        { "OpenOffice.org/3.4$Unix OpenOffice.org_project/340m1$Build-9590", "340$9590", SvXMLImport::OOo_34x },
+
+        // AOO versions
+        { "OpenOffice/4.0.0$Win32 OpenOffice.org_project/400m3$Build-9702", "400$9702", SvXMLImport::AOO_40x },
+        { "OpenOffice/4.0.1$Linux OpenOffice.org_project/401m4$Build-9713", "401$9713", SvXMLImport::AOO_40x },
+        { "OpenOffice/4.1.1$FreeBSD/amd64 OpenOffice.org_project/411m6$Build-9775", "411$9775", SvXMLImport::AOO_4x },
+        { "OpenOffice/4.1.2$OS/2 OpenOffice.org_project/412m3$Build-9782-bww", "412$9782-bww", SvXMLImport::AOO_4x },
+        { "OpenOffice/4.1.4$Unix OpenOffice.org_project/414m2$Build-9785", "414$9785", SvXMLImport::AOO_4x },
+
+        // LO versions
+        { "LibreOffice/3.3$Linux LibreOffice_project/330m17$Build-3", "330$3;33", SvXMLImport::LO_3x },
+        { "BrOffice/3.3$Win32 LibreOffice_project/330m19$Build-8", "330$8;33", SvXMLImport::LO_3x },
+        { "LibreOffice/3.4$Linux LibreOffice_project/340m1$Build-1206", "340$1206;34", SvXMLImport::LO_3x },
+        { "LibreOffice/3.5$Linux_X86_64 LibreOffice_project/3fa2330-e49ffd2-90d118b-705e248-051e21c", ";35", SvXMLImport::LO_3x },
+        { "LibreOffice/3.6$Windows_x86 LibreOffice_project/a9a0717-273e462-768e6e3-978247f-65e65f", ";36", SvXMLImport::LO_3x },
+        { "LibreOffice/4.0.2.2$Windows_x86 LibreOffice_project/4c82dcdd6efcd48b1d8bba66bfe1989deee49c3", ";4022", SvXMLImport::LO_41x },
+        { "LibreOffice/4.1.2.3$MacOSX_x86 LibreOffice_project/40b2d7fde7e8d2d7bc5a449dc65df4d08a7dd38", ";4123", SvXMLImport::LO_41x },
+        { "LibreOffice/4.2.8.2$Windows_x86 LibreOffice_project/48d50dbfc06349262c9d50868e5c1f630a573ebd", ";4282", SvXMLImport::LO_42x },
+        { "LibreOffice_from_Collabora_4.2-8/4.2.10.8$Linux_x86 LibreOffice_project/84584cc237b2eb93f7684d8fcd063bb37e87b5fb", ";42108", SvXMLImport::LO_42x },
+        { "LibreOffice/4.3.3.2$Linux_x86 LibreOffice_project/9bb7eadab57b6755b1265afa86e04bf45fbfc644", ";4332", SvXMLImport::LO_43x },
+        { "LibreOffice_from_Collabora_4.4-10/4.4.10.9$Linux_x86 LibreOffice_project/5600b19b88a01bbb669b0900100760758dff8c26", ";44109", SvXMLImport::LO_44x },
+        { "LibreOffice/4.3.3.2$Linux_X86_64 LibreOffice_project/430m0$Build-2", "430$2;4332", SvXMLImport::LO_43x },
+        { "LibreOffice/4.4.3.2$Linux_x86 LibreOffice_project/88805f81e9fe61362df02b9941de8e38a9b5fd16", ";4432", SvXMLImport::LO_44x },
+        { "LibreOffice/5.0.1.1$Linux_x86 LibreOffice_project/00m0$Build-1", "00$1;5011", SvXMLImport::LO_5x },
+        { "LibreOffice/5.0.3.2$Windows_X86_64 LibreOffice_project/e5f16313668ac592c1bfb310f4390624e3dbfb75", ";5032", SvXMLImport::LO_5x },
+        { "Collabora_Office/5.0.10.19$Linux_X86_64 LibreOffice_project/95060d44300d8866fa81c16fc8fe2afe22d63777", ";501019", SvXMLImport::LO_5x },
+        { "LibreOffice/5.1.6.2.0$Linux_X86_64 LibreOffice_project/10$Build-2", ";51620", SvXMLImport::LO_5x },
+        { "Collabora_Office/5.1.10.17$Linux_X86_64 LibreOffice_project/a104cbe76eefca3cf23973da68893d2225fd718b", ";511017", SvXMLImport::LO_5x },
+        { "LibreOffice/5.2.1.2$Windows_X86_64 LibreOffice_project/31dd62db80d4e60af04904455ec9c9219178d620", ";5212", SvXMLImport::LO_5x },
+        { "LibreOffice_Vanilla/5.2.3.5$MacOSX_X86_64 LibreOffice_project/83adc9c35c74e0badc710d981405858b1179a327", ";5235", SvXMLImport::LO_5x },
+        { "LibreOffice/5.3.4.2$Windows_X86_64 LibreOffice_project/f82d347ccc0be322489bf7da61d7e4ad13fe2ff3", ";5342", SvXMLImport::LO_5x },
+        { "Collabora_Office/5.3.10.27$Linux_X86_64 LibreOffice_project/7a5a5378661e338a44666c08773cc796b8d1c84a", ";531027", SvXMLImport::LO_5x },
+        { "LibreOfficeDev/5.4.7.0.0$Linux_X86_64 LibreOffice_project/ba7461fc88c08e75e315f786020a2946e56166c9", ";54700", SvXMLImport::LO_5x },
+        { "LibreOfficeDev/6.0.3.0.0$Linux_X86_64 LibreOffice_project/34442b85bfb0c451738b4db023345a7484463321", ";60300", SvXMLImport::LO_6x },
+    };
+
+    for (size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i)
+    {
+        // the DocumentInfo instance is cached so need fresh SvXMLImport
+        rtl::Reference<SvXMLImport> const pImport(new SvXMLImport(
+            comphelper::getProcessComponentContext(), "testdummy",
+            SvXMLImportFlags::ALL));
+
+        pImport->initialize(uno::Sequence<uno::Any>{ uno::Any(xInfoSet) });
+
+        SvXMLMetaDocumentContext::setBuildId(
+                OUString::createFromAscii(tests[i].generator), xInfoSet);
+        if (std::strlen(tests[i].buildId) != 0)
+        {
+            CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(tests[i].buildId),
+                    xInfoSet->getPropertyValue("BuildId").get<OUString>());
+        }
+        else
+        {
+            CPPUNIT_ASSERT(!xInfoSet->getPropertyValue("BuildId").hasValue());
+        }
+        CPPUNIT_ASSERT_EQUAL(tests[i].result, pImport->getGeneratorVersion());
+    }
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 324fbc0dd4e9..af7a0788bf02 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -222,7 +222,7 @@ public:
             {
                 mnGeneratorVersion = SvXMLImport::OOo_34x;
             }
-            else if (nUPD == 400)
+            else if (nUPD == 400 || nUPD == 401)
             {
                 mnGeneratorVersion = SvXMLImport::AOO_40x;
             }
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index ba733bd73a20..1f9a1b9604e2 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -256,6 +256,8 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno:
     {
         if (    i_rBuildId.startsWith("StarOffice 7")
             ||  i_rBuildId.startsWith("StarSuite 7")
+            ||  i_rBuildId.startsWith("StarOffice 6")
+            ||  i_rBuildId.startsWith("StarSuite 6")
             ||  i_rBuildId.startsWith("OpenOffice.org 1"))
         {
             sBuildId = "645$8687";
@@ -266,19 +268,20 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno:
         }
     }
 
-    OUString rest;
-    if (i_rBuildId.startsWith("LibreOffice/", &rest) ||
-        i_rBuildId.startsWith("LibreOfficeDev/", &rest) ||
-        i_rBuildId.startsWith("LOdev/", &rest))
+    // "LibreOffice_project" was hard-coded since LO 3.3.0
+    // see utl::DocInfoHelper::GetGeneratorString()
+    if (i_rBuildId.indexOf("LibreOffice_project/") != -1)
     {
         OUStringBuffer sNumber;
-        for (sal_Int32 i = 0; i < rest.getLength(); ++i)
+        auto const firstSlash = i_rBuildId.indexOf("/");
+        assert(firstSlash != -1);
+        for (sal_Int32 i = firstSlash + 1; i < i_rBuildId.getLength(); ++i)
         {
-            if (rtl::isAsciiDigit(rest[i]))
+            if (rtl::isAsciiDigit(i_rBuildId[i]))
             {
-                sNumber.append(rest[i]);
+                sNumber.append(i_rBuildId[i]);
             }
-            else if ('.' != rest[i])
+            else if ('.' != i_rBuildId[i])
             {
                 break;
             }
commit 43d9f1df1e042b46beff0c2da01d8dd366398ecc
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Mar 2 17:15:47 2018 +0100

    Resolves: tdf#115351 convert boolean equivalent format codes to proper Boolean
    
    Because Excel does not know a Boolean number format, BOOLEAN is
    saved to Excel as
    
    "TRUE";"TRUE";"FALSE"
    
    with implicit conditions [>0] and [<0]. This when loaded has no
    boolean property. Then saved to ODF it is loaded as
    
    [>0]"TRUE";[<0]"TRUE";"FALSE"
    
    with explicit conditions, which has identical meaning.
    
    Convert both equivalent format codes to proper BOOLEAN when
    reading. Locale dependent representations are treated the same,
    e.g. "WAHR";"WAHR";"FALSCH"
    
    Reviewed-on: https://gerrit.libreoffice.org/50642
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit ce4fc2fc08be8ea2773194e303ed42d2579e93a0)
    
    Backported.
    
     Conflicts:
            svl/source/numbers/zforscan.cxx
    
    Change-Id: I49383d71fce972fdd7ad9b19ce3bc150d02aba62
    Reviewed-on: https://gerrit.libreoffice.org/50645
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit feb3da3dc53c9b702e39ec12b037b07a67bedcbd)

diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 1a1ff8fa6452..38e348fe3785 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -441,7 +441,8 @@ void ScFiltersTest::testBooleanFormatXLSX()
     ScDocShellRef xDocSh = loadDoc("check-boolean.", FORMAT_XLSX);
     ScDocument& rDoc = xDocSh->GetDocument();
     SvNumberFormatter* pNumFormatter = rDoc.GetFormatTable();
-    const OUString aBooleanTypeStr = "\"TRUE\";\"TRUE\";\"FALSE\"";
+    // Saved as >"TRUE";"TRUE";"FALSE"< but reading converted back to >BOOLEAN<
+    const OUString aBooleanTypeStr = "BOOLEAN";
 
     CPPUNIT_ASSERT_MESSAGE("Failed to load check-boolean.xlsx", xDocSh.is());
     sal_uInt32 nNumberFormat;
@@ -451,7 +452,7 @@ void ScFiltersTest::testBooleanFormatXLSX()
         rDoc.GetNumberFormat(0, i, 0, nNumberFormat);
         const SvNumberformat* pNumberFormat = pNumFormatter->GetEntry(nNumberFormat);
         const OUString& rFormatStr = pNumberFormat->GetFormatstring();
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("Number format != boolean", rFormatStr, aBooleanTypeStr);
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("Number format != boolean", aBooleanTypeStr, rFormatStr);
     }
 
     xDocSh->DoClose();
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index d3e48317f4d0..8614c412bfd5 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -761,6 +761,8 @@ SvNumberformat::SvNumberformat(OUString& rString,
         , bAdditionalBuiltin( false )
         , bStarFlag( false )
 {
+    rScan.ReplaceBooleanEquivalent( rString);
+
     OUStringBuffer sBuff(rString);
 
     // If the group (AKA thousand) separator is a No-Break Space (French)
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 3687ebc4756b..da88794a40cf 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -553,6 +553,16 @@ void ImpSvNumberformatScan::SetDependentKeywords()
     InitSpecialKeyword( NF_KEY_TRUE );
     InitSpecialKeyword( NF_KEY_FALSE );
 
+    // Boolean equivalent format codes that are written to Excel files, may
+    // have been written to ODF as well, specifically if such loaded Excel file
+    // was saved as ODF, and shall result in proper Boolean again.
+    // "TRUE";"TRUE";"FALSE"
+    sBooleanEquivalent1 = "\"" + sKeyword[NF_KEY_TRUE] + "\";\"" +
+        sKeyword[NF_KEY_TRUE] + "\";\"" + sKeyword[NF_KEY_FALSE] + "\"";
+    // [>0]"TRUE";[<0]"TRUE";"FALSE"
+    sBooleanEquivalent2 = "[>0]\"" + sKeyword[NF_KEY_TRUE] + "\";[<0]\"" +
+        sKeyword[NF_KEY_TRUE] + "\";\"" + sKeyword[NF_KEY_FALSE] + "\"";
+
     // compatibility currency strings
     InitCompatCur();
 }
@@ -3302,4 +3312,14 @@ void ImpSvNumberformatScan::CopyInfo(ImpSvNumberformatInfo* pInfo, sal_uInt16 nC
     pInfo->nCntExp      = nCntExp;
 }
 
+void ImpSvNumberformatScan::ReplaceBooleanEquivalent( OUString& rString )
+{
+    InitKeywords();
+    /* TODO: compare case insensitive? Or rather leave as is and case not
+     * matching indicates user supplied on purpose? Written to file / generated
+     * was always uppercase. */
+    if (rString == sBooleanEquivalent1 || rString == sBooleanEquivalent2)
+        rString = GetKeywords()[NF_KEY_BOOLEAN];
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx
index e5eeab899d24..79bc6e7512d1 100644
--- a/svl/source/numbers/zforscan.hxx
+++ b/svl/source/numbers/zforscan.hxx
@@ -143,6 +143,9 @@ public:
             return sCurString;
         }
 
+    /// Replace Boolean equivalent format codes with proper Boolean format.
+    void ReplaceBooleanEquivalent( OUString& rString );
+
     void SetConvertMode(LanguageType eTmpLge, LanguageType eNewLge,
             bool bSystemToSystem = false, bool bForExcelExport = false)
     {
@@ -203,6 +206,8 @@ private: // Private section
     OUString sCurSymbol;                        // Currency symbol for compatibility format codes
     OUString sCurString;                        // Currency symbol in upper case
     OUString sCurAbbrev;                        // Currency abbreviation
+    OUString sBooleanEquivalent1;               // "TRUE";"TRUE";"FALSE"
+    OUString sBooleanEquivalent2;               // [>0]"TRUE";[<0]"TRUE";"FALSE"
     static const OUString sErrStr;              // String for error output
 
     bool bConvertMode;                          // Set in the convert mode
commit 7ae13de34a8bc7be434d2994e7dfbf9ee1e004b6
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Mar 1 22:41:50 2018 +0100

    Resolves: tdf#54197 update input line with new cell content after Ctrl+D fill
    
     This is a combination of 3 commits.
    
    Resolves: tdf#54197 update input line with new cell content after Ctrl+D fill
    
    ... and invalidate cell slots.
    
    Related: tdf#115297 copy AutoSpellData from row above if no selection
    
    Related: tdf#54197 copy AutoSpellData from adjacent if no selection
    
    62ebb3579d5c05e71ca10879ae0ade5bda3bbeba
    82223a64f5c5ec3c98dba390d88af8369a322bd7
    
    Change-Id: Icbe7784430f7ddeed8fa0bc56352269447ee8cbb
    Reviewed-on: https://gerrit.libreoffice.org/50608
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 1c354750f9e52bfa241e3edffeb6d84dd8b92e5e)

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index fb4c178e10f1..5d5457b4e088 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1264,10 +1264,36 @@ void ScViewFunc::FillSimple( FillDir eDir )
         {
             pDocSh->UpdateOle(&GetViewData());
             UpdateScrollBars();
+
             bool bDoAutoSpell = pDocSh->GetDocument().GetDocOptions().IsAutoSpell();
             if ( bDoAutoSpell )
+            {
+                // Copy AutoSpellData from above(left/right/below) if no selection.
+                switch (eDir)
+                {
+                    case FILL_TO_BOTTOM:
+                        if (aRange.aStart.Row() > 0 && aRange.aStart.Row() == aRange.aEnd.Row())
+                            aRange.aStart.IncRow(-1);
+                    break;
+                    case FILL_TO_TOP:
+                        if (aRange.aEnd.Row() < MAXROW && aRange.aStart.Row() == aRange.aEnd.Row())
+                            aRange.aEnd.IncRow(1);
+                    break;
+                    case FILL_TO_RIGHT:
+                        if (aRange.aStart.Col() > 0 && aRange.aStart.Col() == aRange.aEnd.Col())
+                            aRange.aStart.IncCol(-1);
+                    break;
+                    case FILL_TO_LEFT:
+                        if (aRange.aEnd.Col() < MAXCOL && aRange.aStart.Col() == aRange.aEnd.Col())
+                            aRange.aEnd.IncCol(1);
+                    break;
+                }
                 CopyAutoSpellData(eDir, aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row(),
                         ::std::numeric_limits<sal_uLong>::max());
+            }
+
+            // Invalidate cell slots and update input line with new content.
+            CellContentChanged();
         }
     }
     else
commit f1422c9130e06c580dc728e616cc7fd8915120bd
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Mar 2 21:38:08 2018 +0100

    Resolves: tdf#116149 handle external references in VAR* and STDEV* functions
    
    Change-Id: I644a5f8f92452ca775ee3b42a73d3f0a0ac3c623
    (cherry picked from commit 38b87bbb24c1d1cc088d3d135e7e95b3ec75d386)
    Reviewed-on: https://gerrit.libreoffice.org/50647
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit f7247d66b3376b37da403acd74ee49f59b8b18a5)

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index ca588b6a9f03..18a93676fa4a 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -3932,9 +3932,11 @@ void ScInterpreter::GetStVarParams( bool bTextAsZero, double(*VarResult)( double
                 }
             }
             break;
+            case svExternalSingleRef :
+            case svExternalDoubleRef :
             case svMatrix :
             {
-                ScMatrixRef pMat = PopMatrix();
+                ScMatrixRef pMat = GetMatrix();
                 if (pMat)
                 {
                     SCSIZE nC, nR;
commit 822005f896181a5deff7c858bf997905e0c4f709
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Tue Mar 6 11:33:16 2018 +0100

    tdf#116163 import test
    
    Change-Id: Ie4fd1142e1111e4968941a639a265d169aaa6413
    Reviewed-on: https://gerrit.libreoffice.org/50814
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/50831
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 5c9cd49df8e806d1f0bfd62f62ba057d54186ee8)

diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index a49e80e1b867..8a67b4e4349b 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -23,6 +23,9 @@
 #include <com/sun/star/chart/MissingValueTreatment.hpp>
 #include <com/sun/star/chart2/TickmarkStyle.hpp>
 #include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
+#include <iterator>
 
 #include <com/sun/star/util/Color.hpp>
 
@@ -98,6 +101,7 @@ public:
     void testTdf109858(); // Pie chart label placement settings(XLSX)
 
     void testTdf111173();
+    void testTdf116163();
 
     void testInternalDataProvider();
 
@@ -157,6 +161,7 @@ public:
     CPPUNIT_TEST(testTdf90510);
     CPPUNIT_TEST(testTdf109858);
     CPPUNIT_TEST(testTdf111173);
+    CPPUNIT_TEST(testTdf116163);
 
     CPPUNIT_TEST(testInternalDataProvider);
 
@@ -166,6 +171,31 @@ private:
 
 };
 
+uno::Reference<drawing::XShape> getShapeByName(const uno::Reference<drawing::XShapes>& rShapes,
+    const OUString& rName,
+    std::function<bool(const uno::Reference<drawing::XShape>&)> pCondition = nullptr)
+{
+    uno::Reference<container::XIndexAccess> XIndexAccess(rShapes, uno::UNO_QUERY);
+    for (sal_Int32 i = 0; i < XIndexAccess->getCount(); ++i)
+    {
+        uno::Reference<drawing::XShapes> xShapes(XIndexAccess->getByIndex(i), uno::UNO_QUERY);
+        if (xShapes.is())
+        {
+            uno::Reference<drawing::XShape> xRet = getShapeByName(xShapes, rName, pCondition);
+            if (xRet.is())
+                return xRet;
+        }
+        uno::Reference<container::XNamed> xNamedShape(XIndexAccess->getByIndex(i), uno::UNO_QUERY);
+        if (xNamedShape->getName() == rName)
+        {
+            uno::Reference<drawing::XShape> xShape(xNamedShape, uno::UNO_QUERY);
+            if (pCondition == nullptr || pCondition(xShape))
+                return xShape;
+        }
+    }
+    return uno::Reference<drawing::XShape>();
+}
+
 // error bar import
 // split method up into smaller chunks for more detailed tests
 void Chart2ImportTest::Fdo60083()
@@ -1317,6 +1347,73 @@ void Chart2ImportTest::testTdf111173()
     CPPUNIT_ASSERT_MESSAGE( "failed to load chart", xChart1Doc.is() );
 }
 
+void Chart2ImportTest::testTdf116163()
+{
+    load("/chart2/qa/extras/data/pptx/", "tdf116163.pptx");
+
+    Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xChartDoc.is());
+
+    Reference<chart2::XAxis> xHAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
+    CPPUNIT_ASSERT(xHAxis.is());
+
+    chart2::ScaleData aScaleData = xHAxis->getScaleData();
+    CPPUNIT_ASSERT(aScaleData.Categories.is());
+
+    Reference<chart2::data::XLabeledDataSequence> xLabeledDataSequence = aScaleData.Categories;
+    CPPUNIT_ASSERT(xLabeledDataSequence.is());
+
+    Reference<chart2::data::XDataSequence> xDataSequence = xLabeledDataSequence->getValues();
+    CPPUNIT_ASSERT(xDataSequence.is());
+
+    Reference<chart2::data::XTextualDataSequence> xTextualDataSequence(xDataSequence, uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xTextualDataSequence.is());
+
+    std::vector<OUString> aCategories;
+    Sequence<OUString> aTextData(xTextualDataSequence->getTextualData());
+    ::std::copy(aTextData.begin(), aTextData.end(),
+        ::std::back_inserter(aCategories));
+
+    CPPUNIT_ASSERT_EQUAL(OUString("Aaaa"), aCategories[0]);
+    CPPUNIT_ASSERT_EQUAL(OUString("Bbbbbbb"), aCategories[1]);
+    CPPUNIT_ASSERT_EQUAL(OUString("Ccc"), aCategories[2]);
+    CPPUNIT_ASSERT_EQUAL(OUString("Ddddddddddddd"), aCategories[3]);
+
+    // Check visible text
+
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+    uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xShapes.is());
+
+    const OUString sXAxisName = "CID/D=0:CS=0:Axis=0,0";
+    uno::Reference<drawing::XShape> xXAxis = getShapeByName(xShapes, sXAxisName,
+        // Axis occurs twice in chart xshape representation so need to get the one related to labels
+        [](const uno::Reference<drawing::XShape>& rXShape) -> bool
+    {
+        uno::Reference<drawing::XShapes> xAxisShapes(rXShape, uno::UNO_QUERY);
+        CPPUNIT_ASSERT(xAxisShapes.is());
+        uno::Reference<drawing::XShape> xChildShape(xAxisShapes->getByIndex(0), uno::UNO_QUERY);
+        uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xChildShape, uno::UNO_QUERY_THROW);
+        return (xShapeDescriptor->getShapeType() == "com.sun.star.drawing.TextShape");
+    });
+    CPPUNIT_ASSERT(xXAxis.is());
+
+    uno::Reference<container::XIndexAccess> xIndexAccess(xXAxis, UNO_QUERY_THROW);
+    CPPUNIT_ASSERT(xIndexAccess.is());
+
+    // Check text
+    uno::Reference<text::XTextRange> xLabel0(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("Aaaa"), xLabel0->getString());
+    uno::Reference<text::XTextRange> xLabel1(xIndexAccess->getByIndex(1), uno::UNO_QUERY);
+    // If there is space for 3 chars only then don't show "..."
+    CPPUNIT_ASSERT_EQUAL(OUString("Bbb"), xLabel1->getString());
+    uno::Reference<text::XTextRange> xLabel2(xIndexAccess->getByIndex(2), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("Ccc"), xLabel2->getString());
+    uno::Reference<text::XTextRange> xLabel3(xIndexAccess->getByIndex(3), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("Dddd..."), xLabel3->getString());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 5b86909dc2627ed12d54675da5d448224edd1512
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 14 15:03:08 2018 +0000

    tdf#116397 get bounds of full field, not start of char inside field
    
    The pSpecialPos is set for the StartTag case (#i75130#) and I surmise
    we only care about it if we are a smarttag
    
    Change-Id: Ic764bbf31a7784ab021f306f74a08473c8dd0a77
    Reviewed-on: https://gerrit.libreoffice.org/51298
    Tested-by: Jenkins <ci at libreoffice.org>
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 31ea1ebe851eff9257c7fa4acc1e04aa1c9fd32f)

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index b65ba7d8dcf3..798793238edd 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1231,7 +1231,14 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
                     if ( pField )
                     {
                         if( pFieldRect && nullptr != ( pFrame = pTextNd->getLayoutFrame( GetLayout(), &aPt ) ) )
+                        {
+                            //tdf#116397 now that we looking for the bounds of the field drop the SmartTag
+                            //index within field setting so we don't the bounds of the char within the field
+                            SwSpecialPos* pSpecialPos = aTmpState.m_pSpecialPos;
+                            aTmpState.m_pSpecialPos = nullptr;
                             pFrame->GetCharRect( *pFieldRect, aPos, &aTmpState );
+                            aTmpState.m_pSpecialPos = pSpecialPos;
+                        }
 
                         if( bSetCursor )
                         {
commit 6b7ea52a499850e7e10aad7613e2913530f2be7d
Author: Yousuf Philips <philipz85 at hotmail.com>
Date:   Sun Jan 28 19:52:42 2018 +0400

    tdf#114858 Use Ctrl+` for Formula Toggle on Mac
    
    Change-Id: I0685eb0d1f6ea7c8502bbaa22f0e90004947282d
    Reviewed-on: https://gerrit.libreoffice.org/48793
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Yousuf Philips <philipz85 at hotmail.com>
    (cherry picked from commit 532576461654eaf43120d2f693172c07a41275fa)
    Reviewed-on: https://gerrit.libreoffice.org/50971
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 036bf5c78a3ead56f48b4be4d0462e23242c80e0)

diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index 81e00c7c3137..0958f744415a 100644
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -1086,7 +1086,13 @@
         <node oor:name="QUOTELEFT_MOD1" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
-            <value xml:lang="en-US">.uno:ToggleFormula</value>
+            <value xml:lang="en-US" install:module="unxwnt">.uno:ToggleFormula</value>
+          </prop>
+        </node>
+        <node oor:name="QUOTELEFT_MOD3" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+            <value xml:lang="en-US" install:module="macosx">.uno:ToggleFormula</value>
           </prop>
         </node>
         <node oor:name="QUOTERIGHT_MOD1" oor:op="replace">
commit d4b657a85fa9fa3a26a57d3592142d2ff6c2d70d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 12 09:25:09 2018 +0000

    missing error description for ERRCODE_SFX_FORMAT_ROWCOL
    
    Reviewed-on: https://gerrit.libreoffice.org/51116
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-by: Sophie Gautier <gautier.sophie at gmail.com>
    (cherry picked from commit 9e96d2ceeec43dae867b98b90d73cfc3380bb2f0)
    
    Change-Id: Ia616486011f92ccfdd743e46f1b583b99b087eb5

diff --git a/svtools/inc/errtxt.hrc b/svtools/inc/errtxt.hrc
index d6e2c0008a1c..d341a91ee503 100644
--- a/svtools/inc/errtxt.hrc
+++ b/svtools/inc/errtxt.hrc
@@ -130,6 +130,7 @@ const ErrMsgCode RID_ERRHDL[] =
     { NC_("RID_ERRHDL", "Wrong checksum.") , ERRCODE_IO_BADCRC },
     { NC_("RID_ERRHDL", "Function not possible: write protected.") , ERRCODE_IO_WRITEPROTECTED },
     { NC_("RID_ERRHDL", "The password of a shared spreadsheet cannot be set or changed.\nDeactivate sharing mode first."), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE },
+    { NC_("RID_ERRHDL", "File format error found at $(ARG1)(row,col)."), ERRCODE_SFX_FORMAT_ROWCOL },
     { NC_("RID_ERRHDL", "The filter for this file format is disabled in configuration. Please contact your systems administrator."), ERRCODE_IO_FILTERDISABLED },
     { nullptr, ERRCODE_NONE }
 };
commit ccf9b735238f390db882cf88f45b7ab72ed88970
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Mar 5 22:09:39 2018 +0100

    tdf#115861 DOCX import: avoid last-paragraph removal when discarding footer
    
    Discarding header/footer is necessary when the document or section
    settings request to ignore first or even headers/footers. In the bugdoc
    case settings.xml didn't opt-in for different even/odd footers, but
    there was an even footer to be ignored.
    
    Handle this state at two more places, so we don't end up in a situation
    where we ignore the footer but not its "remove last (empty) paragraph at
    the end of the footer" action.
    
    Also make the debug dumper for text ranges more robust to have a working
    token dump when we try to get the string for a table.
    
    (cherry picked from commit 49cf733effc56c09c5e2eb023120c2d3532b5b3d)
    
    Change-Id: I6395f37aa40c42304e2c918d87dadecb21e9d378
    Reviewed-on: https://gerrit.libreoffice.org/50884
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 0edb7585c7bdf5f01dcf31f106477c959f107a84)

diff --git a/sw/qa/extras/ooxmlexport/data/tdf115861.docx b/sw/qa/extras/ooxmlexport/data/tdf115861.docx
new file mode 100644
index 000000000000..f42a7bad2cfa
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf115861.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 86fd39ab3bf7..9f7ac20f42c9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -81,6 +81,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112694, "tdf112694.docx")
     CPPUNIT_ASSERT(!getProperty<bool>(aPageStyle, "HeaderIsOn"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf115861, "tdf115861.docx")
+{
+    // Second item in the paragraph enumeration was a table, 2nd paragraph was
+    // lost.
+    CPPUNIT_ASSERT_EQUAL(OUString("(k)"), getParagraph(2)->getString());
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD, "mailmerge.docx")
 {
     uno::Reference<beans::XPropertySet> xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 2), "TextField");
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 13f8c4313894..b5ec69a98304 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -388,6 +388,9 @@ void DomainMapper_Impl::AddDummyParaForTableInSection()
 
 void DomainMapper_Impl::RemoveLastParagraph( )
 {
+    if (m_bDiscardHeaderFooter)
+        return;
+
     if (m_aTextAppendStack.empty())
         return;
     uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
@@ -1061,6 +1064,9 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
 
 void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap )
 {
+    if (m_bDiscardHeaderFooter)
+        return;
+
 #ifdef DEBUG_WRITERFILTER
     TagLogger::getInstance().startElement("finishParagraph");
 #endif
diff --git a/writerfilter/source/dmapper/util.cxx b/writerfilter/source/dmapper/util.cxx
index e721d6cecb9b..378e30b08a9d 100644
--- a/writerfilter/source/dmapper/util.cxx
+++ b/writerfilter/source/dmapper/util.cxx
@@ -34,7 +34,19 @@ std::string XTextRangeToString(uno::Reference< text::XTextRange > const & textRa
 #ifdef DEBUG_WRITERFILTER
     if (textRange.get())
     {
-        OUString aOUStr = textRange->getString();
+        OUString aOUStr;
+
+        try
+        {
+            aOUStr = textRange->getString();
+        }
+        catch (const uno::Exception& rException)
+        {
+            result += "(exception: ";
+            result += rException.Message.toUtf8().getStr();
+            result += ")";
+        }
+
         OString aOStr(aOUStr.getStr(), aOUStr.getLength(),  RTL_TEXTENCODING_ASCII_US );
 
         result = aOStr.getStr();
commit f67e3d1893d6515657c6ea0f675be32aa64d3d7c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Feb 22 22:43:35 2018 +0100

    copy multiple single row cond formats correctly, tdf#115835
    
    Change-Id: Ic20cc27f03edf3dbd27975f99c788bf5bffd4c48
    Reviewed-on: https://gerrit.libreoffice.org/50211
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit c557889748292d25996ea8f587d7564c74e6f121)
    Reviewed-on: https://gerrit.libreoffice.org/50292
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 15443038c4b8d4c1e7d1aa32df72f41ba93b5b8b)

diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index 6fe30a795fa7..47bcfbd5117f 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -130,10 +130,10 @@ void ScTable::CopyOneCellFromClip(
         assert(nColOffset >= 0);
         aCol[nCol].CopyOneCellFromClip(rCxt, nRow1, nRow2, nColOffset);
 
-        if ((rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB) && (nColOffset == 0))
+        if (rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB)
         {
             for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
-                CopyConditionalFormat(nCol, nRow, nCol + nSrcColSize - 1, nRow, nCol - aSrcRange.aStart.Col(),
+                CopyConditionalFormat(nCol, nRow, nCol, nRow, nCol - aSrcRange.aStart.Col() - nColOffset,
                         nRow - nSrcRow, pSrcTab);
         }
     }
commit 83123c663ac1dee5a3f5595dc62ae5d9e92b5b33
Author: Matthias Freund <matti_lx at secure.mailbox.org>
Date:   Sun Mar 11 16:00:34 2018 +0100

    tdf#75256 Sifr update fix for not showing up epub export icon
    
    Change-Id: Ifa85cb2d99e049295903408bb990e8e37d1f5021
    Reviewed-on: https://gerrit.libreoffice.org/51080
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Matthias Freund <matti_lx at secure.mailbox.org>
    (cherry picked from commit 745998f778c22568c3bd691ffc24e80982e2db44)
    Reviewed-on: https://gerrit.libreoffice.org/51092
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit 31be192f9a6aee02cf05394dfdb4f18b40413bdc)

diff --git a/icon-themes/sifr/links.txt b/icon-themes/sifr/links.txt
index e2dae945a9ca..555f7242f40f 100644
--- a/icon-themes/sifr/links.txt
+++ b/icon-themes/sifr/links.txt
@@ -58,9 +58,6 @@ sc/res/table.png cmd/sc_inserttable.png
 cmd/lc_thesaurusdialog.png cmd/lc_thesaurus.png
 cmd/sc_thesaurusdialog.png cmd/sc_thesaurus.png
 
-# File Menu
-cmd/sc_exporttopdf.png cmd/sc_exportdirecttopdf.png
-
 # Print Preview Toolbar
 cmd/lc_showsinglepage.png cmd/lc_adddirect.png
 cmd/sc_showsinglepage.png cmd/sc_adddirect.png
@@ -209,9 +206,11 @@ cmd/sc_objectforwardone.png cmd/sc_forward.png
 cmd/lc_objectbackone.png cmd/lc_backward.png
 cmd/sc_objectbackone.png cmd/sc_backward.png
 
-# writer epub export
-cmd/lc_exportdirecttoepub.png cmd/lc_exportdirecttopdf.png
-cmd/sc_exportdirecttoepub.png cmd/sc_exportdirecttopdf.png
+# writer pdf and epub export
+cmd/lc_exporttopdf.png cmd/lc_exportdirecttopdf.png
+cmd/sc_exporttopdf.png cmd/sc_exportdirecttopdf.png
+cmd/lc_exporttoepub.png cmd/lc_exportdirecttoepub.png
+cmd/sc_exporttoepub.png cmd/sc_exportdirecttoepub.png
 
 # writer formatting style toolbar
 cmd/lc_bulletliststyle.png cmd/lc_defaultbullet.png
diff --git a/icon-themes/sifr_dark/links.txt b/icon-themes/sifr_dark/links.txt
index 58d9a65f5852..555f7242f40f 100644
--- a/icon-themes/sifr_dark/links.txt
+++ b/icon-themes/sifr_dark/links.txt
@@ -58,12 +58,11 @@ sc/res/table.png cmd/sc_inserttable.png
 cmd/lc_thesaurusdialog.png cmd/lc_thesaurus.png
 cmd/sc_thesaurusdialog.png cmd/sc_thesaurus.png
 
-# File Menu
-cmd/sc_exporttopdf.png cmd/sc_exportdirecttopdf.png
-
 # Print Preview Toolbar
 cmd/lc_showsinglepage.png cmd/lc_adddirect.png
 cmd/sc_showsinglepage.png cmd/sc_adddirect.png
+cmd/lc_closepreview.png cmd/lc_exitsearch.png
+cmd/sc_closepreview.png cmd/sc_exitsearch.png
 
 # Horizontal Text Alignment (align* is in calc and *para is used in writer)
 #cmd/lc_alignleft.png cmd/lc_leftpara.png
@@ -207,12 +206,18 @@ cmd/sc_objectforwardone.png cmd/sc_forward.png
 cmd/lc_objectbackone.png cmd/lc_backward.png
 cmd/sc_objectbackone.png cmd/sc_backward.png
 
-# writer epub export
-cmd/lc_exportdirecttoepub.png cmd/lc_exportdirecttopdf.png
-cmd/sc_exportdirecttoepub.png cmd/sc_exportdirecttopdf.png
+# writer pdf and epub export
+cmd/lc_exporttopdf.png cmd/lc_exportdirecttopdf.png
+cmd/sc_exporttopdf.png cmd/sc_exportdirecttopdf.png
+cmd/lc_exporttoepub.png cmd/lc_exportdirecttoepub.png
+cmd/sc_exporttoepub.png cmd/sc_exportdirecttoepub.png
 
 # writer formatting style toolbar
 cmd/lc_bulletliststyle.png cmd/lc_defaultbullet.png
 cmd/sc_bulletliststyle.png cmd/sc_defaultbullet.png
 cmd/lc_numberliststyle.png cmd/lc_defaultnumbering.png
 cmd/sc_numberliststyle.png cmd/sc_defaultnumbering.png
+
+# view menu
+cmd/lc_viewsidebarstyles.png cmd/lc_designerdialog.png
+cmd/sc_viewsidebarstyles.png cmd/sc_designerdialog.png
diff --git a/icon-themes/sifr_svg/links.txt b/icon-themes/sifr_svg/links.txt
index 58d9a65f5852..555f7242f40f 100644
--- a/icon-themes/sifr_svg/links.txt
+++ b/icon-themes/sifr_svg/links.txt
@@ -58,12 +58,11 @@ sc/res/table.png cmd/sc_inserttable.png
 cmd/lc_thesaurusdialog.png cmd/lc_thesaurus.png
 cmd/sc_thesaurusdialog.png cmd/sc_thesaurus.png
 
-# File Menu
-cmd/sc_exporttopdf.png cmd/sc_exportdirecttopdf.png
-
 # Print Preview Toolbar
 cmd/lc_showsinglepage.png cmd/lc_adddirect.png
 cmd/sc_showsinglepage.png cmd/sc_adddirect.png
+cmd/lc_closepreview.png cmd/lc_exitsearch.png
+cmd/sc_closepreview.png cmd/sc_exitsearch.png
 
 # Horizontal Text Alignment (align* is in calc and *para is used in writer)
 #cmd/lc_alignleft.png cmd/lc_leftpara.png
@@ -207,12 +206,18 @@ cmd/sc_objectforwardone.png cmd/sc_forward.png
 cmd/lc_objectbackone.png cmd/lc_backward.png
 cmd/sc_objectbackone.png cmd/sc_backward.png
 
-# writer epub export
-cmd/lc_exportdirecttoepub.png cmd/lc_exportdirecttopdf.png
-cmd/sc_exportdirecttoepub.png cmd/sc_exportdirecttopdf.png
+# writer pdf and epub export
+cmd/lc_exporttopdf.png cmd/lc_exportdirecttopdf.png
+cmd/sc_exporttopdf.png cmd/sc_exportdirecttopdf.png
+cmd/lc_exporttoepub.png cmd/lc_exportdirecttoepub.png
+cmd/sc_exporttoepub.png cmd/sc_exportdirecttoepub.png
 
 # writer formatting style toolbar
 cmd/lc_bulletliststyle.png cmd/lc_defaultbullet.png
 cmd/sc_bulletliststyle.png cmd/sc_defaultbullet.png
 cmd/lc_numberliststyle.png cmd/lc_defaultnumbering.png
 cmd/sc_numberliststyle.png cmd/sc_defaultnumbering.png
+
+# view menu
+cmd/lc_viewsidebarstyles.png cmd/lc_designerdialog.png
+cmd/sc_viewsidebarstyles.png cmd/sc_designerdialog.png
commit 1841b05a4e17434cfa7ef41a38fee957beba4e42
Author: himajin100000 <himajin100000 at gmail.com>
Date:   Mon Mar 12 04:52:30 2018 +0900

    tdf#116351: fix re-use of AttributeList on PGP manifest
    
    multiple attributes of the same name on the same element,
    because AttributeList was wrongly re-used
    
    Change-Id: I29b2317ce3d836d7349fa0474709726bed2c5ad4
    Reviewed-on: https://gerrit.libreoffice.org/51087
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 32f42d093d4408666151d03f04823e2bb39e46cd)
    Reviewed-on: https://gerrit.libreoffice.org/51250
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit ce5d2cd0d9fe0c04fde50ba54fb4ca154f2bdf12)

diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx
index 5cf87334ca62..d8c00cf5f9a0 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -231,8 +231,6 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
         {
             // yeah, so that goes directly below the manifest:manifest
             // element
-            ::comphelper::AttributeList * pNewAttrList = new ::comphelper::AttributeList;
-            uno::Reference < xml::sax::XAttributeList > xNewAttrList (pNewAttrList);
             OUStringBuffer aBuffer;
 
             xHandler->ignorableWhitespace ( sWhiteSpace );
@@ -267,6 +265,8 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
                     xHandler->startElement( sEncryptedKeyElement, nullptr );
                     xHandler->ignorableWhitespace ( sWhiteSpace );
 
+                    ::comphelper::AttributeList * pNewAttrList = new ::comphelper::AttributeList;
+                    uno::Reference < xml::sax::XAttributeList > xNewAttrList (pNewAttrList);
                     // TODO: the algorithm should rather be configurable
                     pNewAttrList->AddAttribute ( sAlgorithmAttribute, sCdataAttribute,
                                                  "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" );
commit 5674140ad6e6eb2218ab03d2c3cd9e9c2c270170
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 13 14:19:46 2018 +0000

    ofz#6891 empty vector access
    
    Change-Id: Ic36d03d2646ebd90bea5fa91bc4dac3596a55d4a
    Reviewed-on: https://gerrit.libreoffice.org/51229
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 29d3d6735a98b80dd9fc0dbdb5274639883d08d9)

diff --git a/sw/qa/core/data/html/fail/ofz6891-1.html b/sw/qa/core/data/html/fail/ofz6891-1.html
new file mode 100644
index 000000000000..7d767d72a135
--- /dev/null
+++ b/sw/qa/core/data/html/fail/ofz6891-1.html
@@ -0,0 +1 @@
+<table align=left><td><table><S STYLE="position:absolute;width: 6">
\ No newline at end of file
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index f3a96c5e9278..4df09634005f 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2599,7 +2599,11 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail,
     // Only tables with relative width or without width should be modified
     m_pLayoutInfo->SetMustResize( m_bPrcWidth || !m_nWidth );
 
-    m_pLayoutInfo->SetWidths();
+    SwTableLine *pLine1 = (m_pSwTable->GetTabLines())[0];
+    if (!pLine1->GetTabBoxes().empty())
+        m_pLayoutInfo->SetWidths();
+    else
+        SAL_WARN("sw.html", "no table box");
 
     const_cast<SwTable *>(m_pSwTable)->SetHTMLTableLayout( m_pLayoutInfo );
 
@@ -3990,6 +3994,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
         while( m_aContexts.size() > m_nContextStAttrMin )
         {
             HTMLAttrContext *pCntxt = PopContext();
+            if (!pCntxt)
+                break;
             ClearContext( pCntxt );
             delete pCntxt;
         }
commit cd61c0cd9e5c66c99987c56d7514b254ff3d6623
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Mar 2 15:13:09 2018 +0200

    tdf#115998 base: crash on delete relationship
    
    Change-Id: Ida8cc9ef0b812254990ac808f78ae183ae28a1c0
    Reviewed-on: https://gerrit.libreoffice.org/50633
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit 46b32a022ee3679721e410e470c57b6a0b91ecb0)
    Reviewed-on: https://gerrit.libreoffice.org/50769
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    (cherry picked from commit 63bd3beb23e1d8975cea209501c63d4c84396e26)

diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx
index 7e372a0c848a..1ee977f3cb1b 100644
--- a/dbaccess/source/ui/querydesign/TableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindow.cxx
@@ -490,6 +490,7 @@ void OTableWindow::Remove()
 {
     // Delete the window
     OJoinTableView* pTabWinCont = getTableView();
+    VclPtr<OTableWindow> aHoldSelf(this); // keep ourselves alive during the RemoveTabWin process
     pTabWinCont->RemoveTabWin( this );
     pTabWinCont->Invalidate();
 }
commit 9e52bf28afc3e27576f6794ff3681c0cb705e06b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 15 12:32:30 2018 +0100

    Adapt solenv/flatpak-manifest.in to recent download.lst changes
    
    (cherry picked from commit bca14a7126a8cea12eecd248ae84e3d07db9609b)
    Conflicts:
            solenv/flatpak-manifest.in
    
    Change-Id: Id9a41e528e45d60a5429be4c51d58badff200f0a

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list