[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 27 commits - configure.ac desktop/source filter/source forms/source icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_svg include/svtools include/vcl sc/source sd/source sd/uiconfig solenv/bin solenv/gcc-wrappers starmath/qa starmath/source svtools/source svx/source sw/qa sw/source ucb/source vcl/quartz vcl/source writerfilter/source

Caolán McNamara caolanm at redhat.com
Fri Feb 24 11:25:14 UTC 2017


 configure.ac                                         |   13 ++++++
 desktop/source/app/app.cxx                           |    2 +
 filter/source/graphicfilter/itiff/itiff.cxx          |   24 ++++++++++--
 forms/source/misc/InterfaceContainer.cxx             |    4 +-
 icon-themes/breeze/cmd/32/exportdirecttopdf.png      |binary
 icon-themes/breeze/cmd/lc_exportdirecttopdf.png      |binary
 icon-themes/breeze/cmd/sc_exportdirecttopdf.png      |binary
 icon-themes/breeze_dark/cmd/32/exportdirecttopdf.png |binary
 icon-themes/breeze_svg/cmd/32/exportdirecttopdf.svg  |   28 +++++---------
 include/svtools/brwbox.hxx                           |    2 -
 include/vcl/outdev.hxx                               |    2 +
 sc/source/ui/drawfunc/fuins2.cxx                     |   17 +++++++-
 sc/source/ui/undo/undoblk3.cxx                       |    8 +++-
 sd/source/ui/sidebar/SlideBackground.cxx             |    9 +++-
 sd/source/ui/view/drviews7.cxx                       |   17 +++++++-
 sd/uiconfig/simpress/ui/sidebarslidebackground.ui    |   17 +++++++-
 solenv/bin/macosx-codesign-app-bundle                |   31 +++++++++++-----
 solenv/gcc-wrappers/wrapper.cxx                      |   20 ++++++----
 starmath/qa/cppunit/test_starmath.cxx                |    8 ++++
 starmath/source/edit.cxx                             |   36 +++++--------------
 svtools/source/brwbox/brwbox1.cxx                    |   10 ++---
 svtools/source/brwbox/editbrowsebox.cxx              |   14 +++++--
 svx/source/svdraw/svdmark.cxx                        |    3 +
 sw/qa/extras/ooxmlexport/data/tdf106001.docx         |binary
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx            |    6 +++
 sw/qa/extras/rtfexport/data/fdo82006.rtf             |    2 -
 sw/qa/extras/rtfexport/data/tdf104081.rtf            |    4 ++
 sw/qa/extras/rtfexport/rtfexport.cxx                 |    7 +++
 sw/qa/extras/rtfimport/data/hexcrlf.rtf              |    4 ++
 sw/qa/extras/rtfimport/rtfimport.cxx                 |   10 +++++
 sw/qa/extras/ww8export/data/ooo92948-1.doc           |binary
 sw/qa/extras/ww8export/ww8export.cxx                 |   19 ++++++++++
 sw/source/core/doc/docbm.cxx                         |    6 ++-
 sw/source/core/txtnode/fntcache.cxx                  |   34 +++++++++++++----
 sw/source/filter/ww8/ww8par2.cxx                     |    6 ++-
 ucb/source/ucp/webdav/webdavcontent.cxx              |    3 +
 ucb/source/ucp/webdav/webdavresponseparser.cxx       |    1 
 vcl/quartz/ctfonts.cxx                               |   17 +++++++-
 vcl/source/outdev/text.cxx                           |    5 ++
 writerfilter/source/dmapper/DomainMapper.cxx         |   13 +++++-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx    |    2 -
 writerfilter/source/dmapper/SettingsTable.cxx        |    7 ++-
 writerfilter/source/dmapper/SettingsTable.hxx        |    2 -
 writerfilter/source/rtftok/rtfdispatchflag.cxx       |    3 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx       |   14 ++++++-
 45 files changed, 314 insertions(+), 116 deletions(-)

New commits:
commit 0c585046836a71943a322b45b71b45b5bc141205
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 16 11:18:41 2017 +0000

    assert on export of ooo59665-1.sxw to odt
    
    rSecondStart.nContent in this case has no m_pIndexReg
    
    just move on with our lives wrt this sorting
    
    Change-Id: I9642c5d345dabd02f3feea83bc2ffbf3f7adb082
    Reviewed-on: https://gerrit.libreoffice.org/34336
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 5d6b5bb57bb82a0dc480ca2ea17da5396f598af7)
    Reviewed-on: https://gerrit.libreoffice.org/34593
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit b8a0289f89cda6b816c710f687f4a4735e0f2bf4)

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 4fd53d0..f75dd0e 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -84,9 +84,11 @@ namespace
         {
             return rFirstStart.nNode < rSecondStart.nNode;
         }
-        if (rFirstStart.nContent != 0 || rSecondStart.nContent != 0)
+        const sal_Int32 nFirstContent = rFirstStart.nContent.GetIndex();
+        const sal_Int32 nSecondContent = rSecondStart.nContent.GetIndex();
+        if (nFirstContent != 0 || nSecondContent != 0)
         {
-            return rFirstStart.nContent < rSecondStart.nContent;
+            return nFirstContent < nSecondContent;
         }
         auto *const pCRFirst (dynamic_cast<::sw::mark::CrossRefBookmark const*>(rpFirst.get()));
         auto *const pCRSecond(dynamic_cast<::sw::mark::CrossRefBookmark const*>(rpSecond.get()));
commit 8d283f4a171862a65062140abeb81cb017f9207a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Feb 23 15:33:55 2017 +0100

    writerfilter: RTF import: hex-escaped \r and \n create paragraph break
    
    ... in Word 2010, while the spec doesn't say what they do.
    So just handle \'0d and \'0a like \par.
    
    This fixes an assert failure on importing lp556169-2.rtf, where
    insertTextPortion was called with a string containing "\r", which split
    the paragraph and that messed up the SwPaM.
    
    Change-Id: Iee8b5b47e15d18232de841adfbc9c6498727c384
    (cherry picked from commit 10e733908038407791f9c14af2a86417cc4a653c)
    Reviewed-on: https://gerrit.libreoffice.org/34584
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 7a26194b05029f68e58ff71285c7be1c5b4c2c42)

diff --git a/sw/qa/extras/rtfimport/data/hexcrlf.rtf b/sw/qa/extras/rtfimport/data/hexcrlf.rtf
new file mode 100644
index 0000000..7c7ed1a
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/hexcrlf.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+foo\'0dba
+r\'0abaz\'0d\'0aquux
+\par }
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index c860f3d..54e4758 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1099,6 +1099,16 @@ DECLARE_RTFIMPORT_TEST(testFdo59419, "fdo59419.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
 }
 
+DECLARE_RTFIMPORT_TEST(testHexCRLF, "hexcrlf.rtf")
+{
+    // hex-escaped \r and \n should create a paragraph break
+    getParagraph(1, "foo");
+    getParagraph(2, "bar");
+    getParagraph(3, "baz");
+    getParagraph(4, "");
+    getParagraph(5, "quux");
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo58076_2, "fdo58076-2.rtf")
 {
     // Position of the picture wasn't correct.
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2264493..19bc159 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1114,7 +1114,19 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
     if (m_aStates.top().nInternalState == RTFInternalState::HEX && m_aStates.top().eDestination != Destination::LEVELNUMBERS)
     {
         if (!bSkipped)
-            m_aHexBuffer.append(ch);
+        {
+            // note: apparently \'0d\'0a is interpreted as 2 breaks, not 1
+            if (m_aStates.top().eDestination != Destination::DOCCOMM
+                && (ch == '\r' || ch == '\n'))
+            {
+                checkUnicode(/*bUnicode =*/ false, /*bHex =*/ true);
+                dispatchSymbol(RTF_PAR);
+            }
+            else
+            {
+                m_aHexBuffer.append(ch);
+            }
+        }
         return RTFError::OK;
     }
 
commit 8ccb70131e67d9badcef25044fec4026120f9590
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 20 16:51:17 2017 +0000

    Resolves: tdf#97731 allow status bar to adapt to its own preferred size
    
    Change-Id: I4390f61a21eef21371ce7399bf746e60234b8db8
    (cherry picked from commit 917d5b8b26a7428f7b7dd495a8db14a3ce16aa55)
    Reviewed-on: https://gerrit.libreoffice.org/34484
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 95eff15aa6e02ab875bd898f6be4f23343ba6b9b)

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 6a97897..ae38810 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -523,7 +523,7 @@ public:
     void            RowInserted( long nRow, long nNumRows = 1, bool bDoPaint = true, bool bKeepSelection = false );
 
     // miscellaneous
-    void            ReserveControlArea( sal_uInt16 nWidth = USHRT_MAX );
+    bool            ReserveControlArea(sal_uInt16 nWidth = USHRT_MAX);
     Rectangle       GetControlArea() const;
     bool            ProcessKey( const KeyEvent& rEvt );
     void            Dispatch( sal_uInt16 nId );
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 8a7b1fa..bd6b16b 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -2091,19 +2091,18 @@ sal_uInt16 BrowseBox::GetColumnAtXPosPixel( long nX, bool ) const
     return BROWSER_INVALIDID;
 }
 
-
-void BrowseBox::ReserveControlArea( sal_uInt16 nWidth )
+bool BrowseBox::ReserveControlArea(sal_uInt16 nWidth)
 {
-
-    if ( nWidth != nControlAreaWidth )
+    if (nWidth != nControlAreaWidth)
     {
         OSL_ENSURE(nWidth,"Control area of 0 is not allowed, Use USHRT_MAX instead!");
         nControlAreaWidth = nWidth;
         UpdateScrollbars();
+        return true;
     }
+    return false;
 }
 
-
 Rectangle BrowseBox::GetControlArea() const
 {
 
@@ -2113,7 +2112,6 @@ Rectangle BrowseBox::GetControlArea() const
              aHScroll->GetSizePixel().Height() ) );
 }
 
-
 void BrowseBox::SetMode( BrowserMode nMode )
 {
 
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index df1df08..9299102 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -1103,7 +1103,6 @@ namespace svt
         return nId;
     }
 
-
     void EditBrowseBox::Resize()
     {
         BrowseBox::Resize();
@@ -1122,15 +1121,22 @@ namespace svt
 
         if (!nX)
             nX = USHRT_MAX;
-        ReserveControlArea((sal_uInt16)nX);
-    }
 
+        bool bChanged = ReserveControlArea(nX);
+
+        //tdf#97731 if the reserved area changed size, give the controls a
+        //chance to adapt to the new size
+        if (bChanged)
+        {
+            nX = (sal_uInt16)aPoint.X();
+            ArrangeControls(nX, (sal_uInt16)aPoint.Y());
+        }
+    }
 
     void EditBrowseBox::ArrangeControls(sal_uInt16&, sal_uInt16)
     {
     }
 
-
     CellController* EditBrowseBox::GetController(long, sal_uInt16)
     {
         return nullptr;
commit f32cfbc05eec644e2f37aac38410ad3f8c944ef5
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 24 09:28:19 2017 +0200

    tdf#103830 Form field names not update in python macro
    
    regression from commit 5f15cc01b31ccaed0c6482a36556dece084ce302
    "new loplugin: use more efficient find() methods"
    
    Regression found by Aron Budea.
    
    Change-Id: I0e84376dfd754738de97882979058f86c2476bd6
    Reviewed-on: https://gerrit.libreoffice.org/34600
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 3a404ea870f1eed86f9765447ce0a364d39ae8f8)
    Reviewed-on: https://gerrit.libreoffice.org/34601
    (cherry picked from commit 81e5ba515c66bc23520f3d9c06c54c63d927e467)

diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index e8973e7..cf64c97 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -661,9 +661,9 @@ throw (css::uno::RuntimeException, std::exception) {
     {
         ::osl::MutexGuard aGuard( m_rMutex );
         OInterfaceMap::iterator i = m_aMap.find(::comphelper::getString(evt.OldValue));
-        if (i != m_aMap.end() && (*i).second != evt.Source)
+        if (i != m_aMap.end() && i->second == evt.Source)
         {
-            css::uno::Reference<css::uno::XInterface>  xCorrectType((*i).second);
+            css::uno::Reference<css::uno::XInterface>  xCorrectType(i->second);
             m_aMap.erase(i);
             m_aMap.insert(::std::pair<const OUString, css::uno::Reference<css::uno::XInterface> >(::comphelper::getString(evt.NewValue),xCorrectType));
         }
commit 16400f7f1ab81720b0c3a742b4e699ce7d7792e6
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Sun Feb 12 21:56:18 2017 +0100

    tdf#99908: Ensure non-empty unique gradient names
    
    for user-defined (!preset) gradients. ODF doesn't cope with nameless
    gradients so well ...
    
    Change-Id: I7a4ca32ccf58b22fc55ceeac8778029cd6d5cea3
    Reviewed-on: https://gerrit.libreoffice.org/34001
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit 529162307e9d6191fe43d50597504474b2c1a5ba)
    Reviewed-on: https://gerrit.libreoffice.org/34335
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit e28fd26d69553733778a86c84cd74e284a079e15)

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 07e43ed..854929f 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -816,7 +816,9 @@ IMPL_LINK_NOARG(SlideBackground, FillColorHdl, SvxColorListBox&, void)
             aGradient.SetStartColor(mpFillLB->GetSelectEntryColor());
             aGradient.SetEndColor(mpFillGrad->GetSelectEntryColor());
 
-            XFillGradientItem aItem(aGradient);
+            // the name doesn't really matter, it'll be converted to unique one eventually,
+            // but it has to be non-empty
+            XFillGradientItem aItem("gradient", aGradient);
             GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_GRADIENT, SfxCallMode::RECORD, { &aItem });
         }
         break;
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index f8570a4..6539152 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1675,8 +1675,8 @@ void DrawViewShell::GetPageProperties( SfxItemSet &rSet )
 
             case (drawing::FillStyle_GRADIENT):
             {
-                const XGradient& xGradient =  static_cast<const XFillGradientItem*>( rPageAttr.GetItem( XATTR_FILLGRADIENT ) )->GetGradientValue();
-                XFillGradientItem aFillGradientItem( OUString(), xGradient, SID_ATTR_PAGE_GRADIENT  );
+                const XFillGradientItem *pGradient =  static_cast<const XFillGradientItem*>( rPageAttr.GetItem( XATTR_FILLGRADIENT ) );
+                XFillGradientItem aFillGradientItem( pGradient->GetName(), pGradient->GetGradientValue(), SID_ATTR_PAGE_GRADIENT );
                 rSet.Put( aFillGradientItem );
             }
             break;
@@ -1716,6 +1716,9 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
         if ( ( nSlotId >= SID_ATTR_PAGE_COLOR ) && ( nSlotId <= SID_ATTR_PAGE_FILLSTYLE ) )
         {
             SdrPageProperties& rPageProperties = pPage->getSdrPageProperties();
+            const SfxItemSet &aPageItemSet = rPageProperties.GetItemSet();
+            SfxItemSet *pTempSet = aPageItemSet.Clone(false, &mpDrawView->GetModel()->GetItemPool());
+
             rPageProperties.ClearItem(XATTR_FILLSTYLE);
             rPageProperties.ClearItem(XATTR_FILLGRADIENT);
             rPageProperties.ClearItem(XATTR_FILLHATCH);
@@ -1744,8 +1747,14 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
                 case(SID_ATTR_PAGE_GRADIENT):
                 {
                     XFillGradientItem aGradientItem( static_cast<const XFillGradientItem&>(pArgs->Get( XATTR_FILLGRADIENT )) );
+
+                    // MigrateItemSet guarantees unique gradient names
+                    SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), XATTR_FILLGRADIENT, XATTR_FILLGRADIENT );
+                    aMigrateSet.Put( aGradientItem );
+                    SdrModel::MigrateItemSet( &aMigrateSet, pTempSet, mpDrawView->GetModel() );
+
+                    rPageProperties.PutItemSet( *pTempSet );
                     rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
-                    rPageProperties.PutItem( XFillGradientItem( aGradientItem ) );
                 }
                 break;
 
@@ -1769,6 +1778,8 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
                 break;
             }
 
+            delete pTempSet;
+
             rReq.Done();
         }
     }
commit 173c193f8bf1677d86d247935ecfe2df7ed08524
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 23 12:02:06 2017 +0000

    Resolves: ofz#668 check for massive row lengths before trying to allocate them
    
    Change-Id: I7b3f1abf5dcf457e8ff7d04a7cf48ffee70817a2
    Reviewed-on: https://gerrit.libreoffice.org/34574
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 86efcdb9279a72408063653f1e99855bf0ca00c4)

diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index df21268..96c7f0c 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -67,7 +67,7 @@ private:
     sal_uLong               nSubFile;
     sal_Int32               nImageWidth;                // picture width in pixels
     sal_Int32               nImageLength;               // picture height in pixels
-    sal_uLong               nBitsPerSample;             // bits per pixel per layer
+    sal_uInt32              nBitsPerSample;             // bits per pixel per layer
     sal_uLong               nCompression;               // kind of compression
     sal_uLong               nPhotometricInterpretation;
     sal_uLong               nThresholding;
@@ -77,7 +77,7 @@ private:
     sal_uLong*              pStripOffsets;              // field of offsets to the Bitmap-Data-"Strips"
     sal_uLong               nNumStripOffsets;           // size of the field above
     sal_uLong               nOrientation;
-    sal_uLong               nSamplesPerPixel;           // number of layers
+    sal_uInt32              nSamplesPerPixel;           // number of layers
     sal_uLong               nRowsPerStrip;              // if it's not compressed: number of rows per Strip
     sal_uLong*              pStripByteCounts;           // if compressed (in a certain way): size of the strips
     sal_uLong               nNumStripByteCounts;        // number of entries in the field above
@@ -93,9 +93,9 @@ private:
     sal_uLong*              pColorMap;                  // color palette
     sal_uLong               nNumColors;                 // number of colors within the color palette
 
-    sal_uLong               nPlanes;                    // number of layers within the Tiff file
+    sal_uInt32              nPlanes;                    // number of layers within the Tiff file
     sal_uLong               nStripsPerPlane;            // number of Strips per layer
-    sal_uLong               nBytesPerRow;               // Bytes per line per Layer in the Tiff file ( uncompressed )
+    sal_uInt32              nBytesPerRow;               // Bytes per line per Layer in the Tiff file ( uncompressed )
     sal_uInt8*              pMap[ 4 ];                  // temporary Scanline
 
 
@@ -1368,8 +1368,18 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
 
                     if (bStatus)
                     {
-                        nBytesPerRow = ( nImageWidth * nSamplesPerPixel / nPlanes * nBitsPerSample + 7 ) >> 3;
+                        sal_uInt64 nRowSize = (static_cast<sal_uInt64>(nImageWidth) * nSamplesPerPixel / nPlanes * nBitsPerSample + 7) >> 3;
+                        if (nRowSize > SAL_MAX_INT32 / SAL_N_ELEMENTS(pMap))
+                        {
+                            SAL_WARN("filter.tiff", "Ludicrous row size of: " << nRowSize << " required");
+                            bStatus = false;
+                        }
+                        else
+                            nBytesPerRow = nRowSize;
+                    }
 
+                    if (bStatus)
+                    {
                         for (sal_uInt8*& j : pMap)
                         {
                             try
commit 32cf835e95ad4df2d70fcd658f19630972b7f7ad
Author: Mark Hung <marklh9 at gmail.com>
Date:   Thu Feb 23 07:48:02 2017 +0800

    solenv(gcc-wrappers): remove trailing space of includepath
    
    Change-Id: Ic14140f197a2c5e1632fd27cfae38ca4eff9bd8c
    Reviewed-on: https://gerrit.libreoffice.org/34562
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit baf043318e83e768abe4ed7ae1c45bb75c0197e3)
    Reviewed-on: https://gerrit.libreoffice.org/34577
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit a3f963ddbd5f5a4cd2575ec024a19ddea49bb88c)

diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index cc31272..6e3fe13 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -49,7 +49,7 @@ void setupccenv() {
     }
 
     // Set-up include path
-    string includepath="INCLUDE=.;";
+    string includepath="INCLUDE=.";
     char* incbuf;
     size_t inclen;
     _dupenv_s(&incbuf,&inclen,"SOLARINC");
@@ -61,16 +61,20 @@ void setupccenv() {
     free(incbuf);
 
     // 3 = strlen(" -I")
-    for(size_t pos=0; pos != string::npos;) {
-        size_t endpos=inctmp.find(" -I",pos+3);
-        size_t len=endpos-pos-3;
+    for(size_t pos=0,len=0;pos<inctmp.length();) {
+        size_t endpos=inctmp.find(" -I",pos+1);
         if(endpos==string::npos)
-            includepath.append(inctmp,pos+3,endpos);
-        else if(len>0) {
-            includepath.append(inctmp,pos+3,len);
+            endpos=inctmp.length();
+        len=endpos-pos;
+
+        while(len>0&&inctmp[pos+len-1]==' ')
+            --len;
+
+        if(len>3) {
             includepath.append(";");
+            includepath.append(inctmp,pos+3,len-3);
         }
-        pos=inctmp.find(" -I",pos+len);
+        pos=endpos;
     }
     if(_putenv(includepath.c_str())<0) {
         cerr << "Error: could not export INCLUDE" << endl;
commit 1d05310eb005e3de976f63588dad73025a3d5274
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue Feb 21 12:48:33 2017 +0900

    tdf#106116 "Previous Marker" changes selection only when needed
    
    This fixes a hang caused by repeated Shift+F4. Although it seems
    a regression from 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8,
    the original code of SmEditWindow::SelPrevMark() had been doomed
    due to conditional loop depending on obscure signed/unsigned
    conversion.
    
    Change-Id: I61f630eec44b285dc1f1c27097acde4b48ed2991
    Reviewed-on: https://gerrit.libreoffice.org/34503
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>
    (cherry picked from commit 3efdd925e0ae1c080fbef3f1f79865eb6e172c68)
    Reviewed-on: https://gerrit.libreoffice.org/34504
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit eac1221ff124186887b23a2f7e7b57038bd08a43)

diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index 05cddc5..f7f608c 100644
--- a/starmath/qa/cppunit/test_starmath.cxx
+++ b/starmath/qa/cppunit/test_starmath.cxx
@@ -133,6 +133,14 @@ void Test::editMarker()
         m_pEditWindow->Delete();
         m_pEditWindow->InsertText("b");
 
+        // tdf#106116: should be safe i.e. do nothing
+        m_pEditWindow->SelPrevMark();
+        auto aSelection = m_pEditWindow->GetSelection();
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nStartPara);
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aSelection.nStartPos);
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nEndPara);
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aSelection.nEndPos);
+
         m_pEditWindow->Flush();
         OUString sFinalText = m_pEditWindow->GetText();
         CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be a under b under c", sTargetText, sFinalText);
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 43fc755..ff473f9 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -878,36 +878,20 @@ void SmEditWindow::SelPrevMark()
     if (pEditEngine  &&  pEditView)
     {
         ESelection eSelection = pEditView->GetSelection();
-        sal_Int32 nPos = -1;
+        sal_Int32 nPara = eSelection.nStartPara;
         sal_Int32 nMax = eSelection.nStartPos;
-        OUString aText(pEditEngine->GetText(eSelection.nStartPara));
-        OUString aMark("<?>");
-        sal_Int32 nCounts = pEditEngine->GetParagraphCount();
-
-        do
-        {
-            sal_Int32 nMarkIndex = aText.indexOf(aMark);
-            while ((nMarkIndex < nMax) && (nMarkIndex != -1))
-            {
-                nPos = nMarkIndex;
-                nMarkIndex = aText.indexOf(aMark, nMarkIndex + 1);
-            }
-
-            if (nPos == -1)
-            {
-                eSelection.nStartPara--;
-                aText = pEditEngine->GetText(eSelection.nStartPara);
-                nMax = aText.getLength();
-            }
-        }
-        while ((eSelection.nStartPara < nCounts) &&
-            (nPos == -1));
+        OUString aText(pEditEngine->GetText(nPara));
+        const OUString aMark("<?>");
+        sal_Int32 nPos;
 
-        if (nPos != -1)
+        while ( (nPos = aText.lastIndexOf(aMark, nMax)) < 0 )
         {
-            pEditView->SetSelection(ESelection(
-                eSelection.nStartPara, nPos, eSelection.nStartPara, nPos + 3));
+            if (--nPara < 0)
+                return;
+            aText = pEditEngine->GetText(nPara);
+            nMax = aText.getLength();
         }
+        pEditView->SetSelection(ESelection(nPara, nPos, nPara, nPos + 3));
     }
 }
 
commit 43c1a470b27481be71ba3ad25d1eff3f80e644c0
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Wed Feb 22 23:56:19 2017 +0200

    tdf#104509: Fix GetGlyphBoundRect on Mac
    
    The rectangle top and bottom were mixed up! I tried to fix this in
    8cef9b4dbafdebc0566d6d7f715f27f978ddfe5b, but it was not the right fix.
    
    Change-Id: Ia033ff2823bfd641e830d748d413d7791bfee5b8
    Reviewed-on: https://gerrit.libreoffice.org/34557
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
    (cherry picked from commit 04d086531ff4a3ab24b704489270c7c23792bd20)
    Reviewed-on: https://gerrit.libreoffice.org/34559
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 659a38ba7678c7a62ba0872f390c59329daadb90)

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index d962855..dd64b7a 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -184,9 +184,9 @@ bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect )
         aCGRect = CGRectApplyAffineTransform(aCGRect, CGAffineTransformMakeRotation(mfFontRotation));
 
     rRect.Left()   = lrint( aCGRect.origin.x );
-    rRect.Top()    = lrint(-aCGRect.origin.y );
+    rRect.Top()    = lrint(-aCGRect.origin.y - aCGRect.size.height );
     rRect.Right()  = lrint( aCGRect.origin.x + aCGRect.size.width );
-    rRect.Bottom() = lrint( aCGRect.origin.y - aCGRect.size.height );
+    rRect.Bottom() = lrint(-aCGRect.origin.y );
     return true;
 }
 
commit c4fff9ac4593873595dbdbbdc997dbae1dcfe442
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Mon Dec 12 14:51:32 2016 +0200

    Don’t return false for blank glyphs
    
    CTFontCreatePathForGlyph() will return NULL for blank glyphs causing
    CoreTextStyle::GetGlyphOutline() to return false which propagated as
    error all the way to OutputDevice::GetTextOutlines() causing it to
    needlessly enter into fallback code. Other implementations just return
    true and an empty polygon here.
    
    Change-Id: Ib20ebff00f7cb3aae22f1c6b4c3a0e9d7a429987
    Reviewed-on: https://gerrit.libreoffice.org/31902
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
    (cherry picked from commit 04a77bfa9c5a3da6d99ee6ad8d4802638b7d76fa)
    Reviewed-on: https://gerrit.libreoffice.org/34558
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 0a0b98ae530c7f27c2f790a889f3edbfc98858bd)

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 20f5414..d962855 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -249,6 +249,19 @@ bool CoreTextStyle::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolyg
     CGGlyph nCGGlyph = aGlyphId & GF_IDXMASK;
     // XXX: this is broken if the glyph came from fallback font
     CTFontRef pCTFont = static_cast<CTFontRef>(CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName ));
+
+    SAL_WNODEPRECATED_DECLARATIONS_PUSH
+    const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation;
+    SAL_WNODEPRECATED_DECLARATIONS_POP
+    CGRect aCGRect = CTFontGetBoundingRectsForGlyphs(pCTFont, aFontOrientation, &nCGGlyph, nullptr, 1);
+
+    if (!CGRectIsNull(aCGRect) && CGRectIsEmpty(aCGRect))
+    {
+        // CTFontCreatePathForGlyph returns NULL for blank glyphs, but we want
+        // to return true for them.
+        return true;
+    }
+
     CGPathRef xPath = CTFontCreatePathForGlyph( pCTFont, nCGGlyph, nullptr );
     if (!xPath)
     {
commit 710098a9ef069a5b08f36a21f2797aaba51eaf7d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Jan 5 22:35:52 2017 +0100

    add the locale info to the crashreporter metadata
    
    We have a few crashes that seem locale dependent. Especially the font
    related problems.
    
    Change-Id: I0cc977413dc2328ea705c96c2d4048e4f3c58bbc
    Reviewed-on: https://gerrit.libreoffice.org/32764
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-on: https://gerrit.libreoffice.org/34561
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 4cc2f2f683ee7144823503008a6216d1c01e7852)

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ea49fd2..8793697 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -2161,6 +2161,8 @@ void Desktop::OpenClients()
     }
 #if HAVE_FEATURE_BREAKPAD
     CrashReporter::writeCommonInfo();
+    // write this information here to avoid depending on vcl in the crash reporter lib
+    CrashReporter::AddKeyValue("Language", Application::GetSettings().GetLanguageTag().getBcp47());
 #endif
 
     RequestHandler::EnableRequests();
commit ceb767d56d9c4ab1bf3f895f39784938abc9827f
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Feb 17 23:54:21 2017 +0100

    Resolves: tdf#105667 forget target area's caption pointer in Merge Undo
    
    It's the same that was copied to the Undo document, so don't delete the
    caption.
    
    Change-Id: Ib89870ed6e392c4271de2f416c78d42135922609
    (cherry picked from commit a627c44026fcf883918f84bddd1c3b745e1f898c)
    Reviewed-on: https://gerrit.libreoffice.org/34384
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 4ecdb497d540e69590476919f4cb1d02a8025c2e)

diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 7d1f2d9..56a2b41 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -701,7 +701,13 @@ void ScUndoMerge::DoChange( bool bUndo ) const
         // undo -> copy back deleted contents
         if (bUndo && mpUndoDoc)
         {
-            rDoc.DeleteAreaTab( aRange, InsertDeleteFlags::CONTENTS|InsertDeleteFlags::NOCAPTIONS );
+            // If there are note captions to be deleted during Undo they were
+            // kept or moved during the merge and copied to the Undo document
+            // without cloning the caption. Forget the target area's caption
+            // pointer that is identical to the one in the Undo document
+            // instead of deleting it.
+            rDoc.DeleteAreaTab( aRange,
+                    InsertDeleteFlags::CONTENTS | InsertDeleteFlags::NOCAPTIONS | InsertDeleteFlags::FORGETCAPTIONS );
             mpUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL|InsertDeleteFlags::NOCAPTIONS, false, rDoc);
         }
 
commit 5a4c6d028caa41c22752258f83cb21f1e0958a9e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Feb 22 21:36:51 2017 +0100

    sw: fix import of table in ooo44732-2.doc
    
    The problem is that the first call to SwWW8ImplReader::TestApo()
    from WW8TabDesc::WW8TabDesc() wrongly uses style 1 to construct the
    Apo, when the actual style on the first cell of the 2nd row is 4.
    
    Here style 1 contains PDxaWidth and PWHeightAbs sprms, which are
    both overridden by the 1st paragraph, 1st cell, 1st row to 0.
    
    The reason is that during the WW8TabDesc, apparently nothing actually
    updates m_nAktColl, so it's always the style of the 1st cell, 1st row.
    
    Clearly when called from WW8TabDesc this should not be using m_nAktColl,
    but it's not clear to me if calling GetColl() here always works.
    
    Change-Id: I3e3ac0c243112154d40d99684149e1c5f0e51129
    (cherry picked from commit 33a3a5a7eb52ed6a883216cbba83f620f00f61b1)
    Reviewed-on: https://gerrit.libreoffice.org/34556
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit a7377b9c3df9a2c964d1832d9636d1410f49a29c)

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 41e0657..146d226 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -488,8 +488,9 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd,
     ApoTestResults aRet;
     // Frame in Style Definition (word appears to ignore them if inside an
     // text autoshape)
-    if (!m_bTxbxFlySection && m_nAktColl < m_vColl.size())
-        aRet.mpStyleApo = StyleExists(m_nAktColl) ? m_vColl[m_nAktColl].m_xWWFly.get() : nullptr;
+    sal_uInt16 const nStyle(m_pPlcxMan->GetColl());
+    if (!m_bTxbxFlySection && nStyle < m_vColl.size())
+        aRet.mpStyleApo = StyleExists(nStyle) ? m_vColl[nStyle].m_xWWFly.get() : nullptr;
 
     /*
     #i1140#
commit 39bbbe0cab4eb1b987683d9396b67d836acbd2d2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Feb 21 09:06:20 2017 +0100

    tdf#104081 RTF import: handle \htmautsp
    
    It's the opposite of OOXML's <w:doNotUseHTMLParagraphAutoSpacing/>, so
    the default is different.
    
    Also adapt the fdo82006 bugdoc where the original bugdoc contained this
    flag, but the testcase did not.
    
    (cherry picked from commit 291c9122b23ce7aa619e828b895b08dcd21bf025)
    
    Change-Id: I2fd757a8f95be9b1bee63570c9f587c17d3b22bc
    Reviewed-on: https://gerrit.libreoffice.org/34568
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit af9d9f274ff26b462048746069a5bb38493ff115)

diff --git a/sw/qa/extras/rtfexport/data/fdo82006.rtf b/sw/qa/extras/rtfexport/data/fdo82006.rtf
index 0f5ee43..e108d4c 100644
--- a/sw/qa/extras/rtfexport/data/fdo82006.rtf
+++ b/sw/qa/extras/rtfexport/data/fdo82006.rtf
@@ -1,4 +1,4 @@
-{\rtf1
+{\rtf1\htmautsp
 \pard\plain
 \ql \sb100\sa100\sbauto1\saauto1 hello\par
 }
diff --git a/sw/qa/extras/rtfexport/data/tdf104081.rtf b/sw/qa/extras/rtfexport/data/tdf104081.rtf
new file mode 100644
index 0000000..0f5ee43
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf104081.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\pard\plain
+\ql \sb100\sa100\sbauto1\saauto1 hello\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 18a2a0e..19b3235 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -891,6 +891,13 @@ DECLARE_RTFEXPORT_TEST(testFdo82006, "fdo82006.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin"));
 }
 
+DECLARE_RTFEXPORT_TEST(testTdf104081, "tdf104081.rtf")
+{
+    // These were 494 (280 twips), as \htmautsp was ignored.
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(100)), getProperty<sal_Int32>(getParagraph(1), "ParaTopMargin"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(100)), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin"));
+}
+
 DECLARE_RTFEXPORT_TEST(testTdf88583, "tdf88583.odt")
 {
     // This was FillStyle_NONE, as background color was missing from the color table during export.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 9e4ca9a..8540dd1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -596,7 +596,7 @@ public:
     SettingsTablePtr const & GetSettingsTable()
     {
         if( !m_pSettingsTable )
-            m_pSettingsTable.reset( new SettingsTable );
+            m_pSettingsTable.reset(new SettingsTable(m_rDMapper));
         return m_pSettingsTable;
     }
 
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index 8d7bace..9a52c41 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -30,6 +30,7 @@
 #include <comphelper/sequence.hxx>
 #include <ooxml/resourceids.hxx>
 #include <ConversionHelper.hxx>
+#include <DomainMapper.hxx>
 #include "util.hxx"
 
 using namespace com::sun::star;
@@ -99,12 +100,14 @@ struct SettingsTable_Impl
 
 };
 
-SettingsTable::SettingsTable()
+SettingsTable::SettingsTable(const DomainMapper& rDomainMapper)
 : LoggedProperties("SettingsTable")
 , LoggedTable("SettingsTable")
 , m_pImpl( new SettingsTable_Impl )
 {
-
+    // HTML paragraph auto-spacing is opt-in for RTF, opt-out for OOXML.
+    if (rDomainMapper.IsRTFImport())
+        m_pImpl->m_bDoNotUseHTMLParagraphAutoSpacing = true;
 }
 
 SettingsTable::~SettingsTable()
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
index 6ef0a30..75c0d76 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -45,7 +45,7 @@ class SettingsTable : public LoggedProperties, public LoggedTable
     std::unique_ptr<SettingsTable_Impl> m_pImpl;
 
  public:
-    SettingsTable();
+    SettingsTable(const DomainMapper& rDomainMapper);
     virtual ~SettingsTable() override;
 
     //returns default TabStop in 1/100th mm
diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx
index b99876e..18eac50 100644
--- a/writerfilter/source/rtftok/rtfdispatchflag.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx
@@ -1069,6 +1069,9 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
         putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgNumType, NS_ooxml::LN_CT_PageNumber_fmt, pIntValue);
     }
     break;
+    case RTF_HTMAUTSP:
+        m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Compat_doNotUseHTMLParagraphAutoSpacing, std::make_shared<RTFValue>(0));
+    break;
     default:
     {
         SAL_INFO("writerfilter", "TODO handle flag '" << keywordToString(nKeyword) << "'");
commit 148ce37c2977fa71dbd0d10bf57332fc2d02b259
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Feb 23 00:32:12 2017 +0100

    fix crash in the sidebar code
    
    The check should be for xPanel and not xPanels.
    
    See
    http://crashreport.libreoffice.org/stats/signature/sfx2::sidebar::Panel::GetTitleBar()
    
    Change-Id: I745d6d8abbfc68e86ed812460faa551867ddec43
    Reviewed-on: https://gerrit.libreoffice.org/34560
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit 0407200401358d3d565438800f55b61fc1a61794)
    Reviewed-on: https://gerrit.libreoffice.org/34563
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit ed8b8f59e1a85b455a2f8daebd2c1f6fb59faeaa)

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 9e060eb..07e43ed 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -298,7 +298,7 @@ void SlideBackground::SetPanelTitle( const OUString& rTitle )
         return;
 
     Reference<ui::XPanel> xPanel ( xPanels->getByName("SlideBackgroundPanel"), uno::UNO_QUERY);
-    if ( !xPanels.is() )
+    if ( !xPanel.is() )
         return;
 
     xPanel->setTitle( rTitle );
commit 9fb4f949ffab173bf81bf54134193cf4841d6de5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 22 20:39:13 2017 +0000

    ofz: don't read data that isn't there
    
    Change-Id: I9f730c321755cde169d940b49fc93bbe057ead57
    (cherry picked from commit c5b1a01ddfa54156b4fa8e542d6936908257ca93)
    (cherry picked from commit 3106e9eb06eafb82f77c7076d792fc45c8038d37)

diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index f795631..df21268 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -927,12 +927,16 @@ bool TIFFReader::ConvertScanline(sal_Int32 nY)
         {
             sal_uLong nMinMax = ( ( 1 << nDstBitsPerPixel ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
             sal_uInt8* pt = pMap[ 0 ];
+            sal_uInt8* ptend = pt + nBytesPerRow;
             sal_uInt8 nShift;
 
             switch ( nDstBitsPerPixel )
             {
                 case 8 :
                 {
+                    if (pt + nImageWidth > ptend)
+                        return false;
+
                     if ( bByteSwap )
                     {
                         if ( nPredictor == 2 )
commit 324a6d86a33506b2fca11fd566baffbdc7f07ca8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 22 14:59:58 2017 +0000

    don't lock sidebar size due to long master slide names
    
    Change-Id: I90cbae1cbdea10d5c9bb6678535f73e8419bf8cb
    (cherry picked from commit ea1b27b3b579fd2896c5e054422e909c6739ad86)
    
    and...
    
    let content widgets of sidebar slide bg fill available space
    
    so if its expanded more of the master slide name can be shown
    
    Change-Id: I7dcb28e1958edf8ab7fcc03fb77c4b6a9f461ad1
    (cherry picked from commit 8fcb253f706d0543e1c2eeb816f74d96cafdc6e2)
    Reviewed-on: https://gerrit.libreoffice.org/34548
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit 26b8ac1fddd43af3e864c7bcc3414074e54a7bf2)

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 71d2541..9e060eb 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -118,6 +118,9 @@ SlideBackground::SlideBackground(
     get(mpPaperSizeBox,"paperformat");
     get(mpPaperOrientation, "orientation");
     get(mpMasterSlide, "masterslide");
+    //let the listbox shrink to any size so the sidebar isn't forced to grow to
+    //the size of the longest master slide name in the document
+    mpMasterSlide->set_width_request(0);
     get(mpFillAttr, "fillattr1");
     get(mpFillGrad, "fillattr2");
     get(mpFillStyle, "fillstyle");
diff --git a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
index 5025ede..b3e3010 100644
--- a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
+++ b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
@@ -1,19 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.0 -->
 <interface>
   <requires lib="gtk+" version="3.0"/>
   <requires lib="LibreOffice" version="1.0"/>
   <object class="GtkGrid" id="SlideBackgroundPanel">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
     <child>
       <object class="GtkGrid" id="grid1">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="halign">center</property>
         <property name="valign">start</property>
         <property name="margin_left">9</property>
         <property name="margin_right">15</property>
+        <property name="hexpand">True</property>
         <property name="border_width">6</property>
         <property name="row_spacing">6</property>
         <property name="column_spacing">6</property>
@@ -46,6 +47,7 @@
           <object class="GtkComboBoxText" id="orientation">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
             <items>
               <item translatable="yes">Landscape</item>
               <item translatable="yes">Portrait</item>
@@ -60,6 +62,7 @@
           <object class="svxlo-SvxFillTypeBox" id="fillstyle">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -71,6 +74,7 @@
             <property name="width_request">150</property>
             <property name="can_focus">False</property>
             <property name="has_tooltip">True</property>
+            <property name="hexpand">True</property>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -84,6 +88,7 @@
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">False</property>
+            <property name="hexpand">True</property>
             <property name="xalign">0</property>
             <property name="draw_indicator">True</property>
           </object>
@@ -96,6 +101,7 @@
           <object class="GtkComboBoxText" id="masterslide">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -107,7 +113,6 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="halign">end</property>
-            <property name="hexpand">True</property>
             <property name="ellipsize">end</property>
           </object>
           <packing>
@@ -121,6 +126,7 @@
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">True</property>
+            <property name="hexpand">True</property>
             <property name="action_name">.uno:SelectBackground</property>
           </object>
           <packing>
@@ -133,6 +139,7 @@
             <property name="width_request">150</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -144,6 +151,7 @@
             <property name="width_request">150</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -156,6 +164,7 @@
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">False</property>
+            <property name="hexpand">True</property>
             <property name="xalign">0</property>
             <property name="draw_indicator">True</property>
           </object>
@@ -168,6 +177,7 @@
           <object class="svxcorelo-PaperSizeListBox" id="paperformat">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -190,6 +200,7 @@
           <object class="GtkBox" id="box1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
             <property name="homogeneous">True</property>
             <child>
               <object class="GtkButton" id="masterslidebutton">
commit f8606335feaf5a41687c5099cb1a8c17b128b513
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Feb 22 12:57:46 2017 +0200

    Improve error handling and fix some problems
    
    Use the -e and -o pipefail bash option to make the script fail more
    reliably if some command inside a pipeline fails. Use the -u option to
    catch mistyped variable names.
    
    Move the signing of executables in the bundle's Contents/MacOS after
    signing bundled frameworks.
    
    (cherry picked from commit b06edd5a07f18b0999adc0084b8133eb6481f867)
    
    Change-Id: I21d441bcb2dbfc19b0cb5718b76402b1686d2239
    Reviewed-on: https://gerrit.libreoffice.org/34549
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit 977e439e4d2ae4c95a6a8d948a98267941628a59)

diff --git a/solenv/bin/macosx-codesign-app-bundle b/solenv/bin/macosx-codesign-app-bundle
index a05bf05..1149e70 100755
--- a/solenv/bin/macosx-codesign-app-bundle
+++ b/solenv/bin/macosx-codesign-app-bundle
@@ -1,5 +1,12 @@
 #!/bin/bash
 
+# Exit on errors
+set -e
+# Use of unset variable is an error
+set -u
+# If any part of a pipeline of commands fails, the whole pipeline fails
+set -o pipefail
+
 # Script to sign executables, dylibs and frameworks in an app bundle
 # plus the bundle itself. Called from
 # the test-install target in Makefile.in
@@ -58,18 +65,10 @@ while read file; do
     codesign --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$file" || exit 1
 done
 
-# Sign executables
-
-find "$APP_BUNDLE/Contents/MacOS" -type f |
-while read file; do
-    id=`echo ${file#${APP_BUNDLE}/Contents/} | sed -e 's,/,.,g'`
-    codesign --force --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$file" || exit 1
-done
-
 # Sign included bundles. First .app ones (i.e. the Python.app inside
 # the LibreOfficePython.framework. Be generic for kicks...)
 
-find "$APP_BUNDLE" -name '*.app' -type d |
+find "$APP_BUNDLE"/Contents -name '*.app' -type d |
 while read app; do
     fn=`basename "$app"`
     fn=${fn%.*}
@@ -100,6 +99,20 @@ while read bundle; do
     codesign --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" "$bundle" || exit 1
 done
 
+# Sign executables
+
+find "$APP_BUNDLE/Contents/MacOS" -type f |
+while read file; do
+    case "$file" in
+	*/soffice)
+	    ;;
+	*)
+	    id=`echo ${file#${APP_BUNDLE}/Contents/} | sed -e 's,/,.,g'`
+	    codesign --force --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$file" || exit 1
+	    ;;
+    esac
+done
+
 # Sign the app bundle as a whole which means (re-)signing the
 # CFBundleExecutable from Info.plist, i.e. soffice, plus the contents
 # of the Resources tree (which unless you used
commit 81f258fc424a1e6890bd8393fcaa5fbd30707071
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Feb 22 09:39:57 2017 +0200

    Add --with-package-version option, mainly for non-TDF product macOS builds
    
    For macOS, the "package" version is included in files generated by the
    build (the Info.plist), so we need to be able to set that at build
    time, in order to be able to produce differently identified builds
    from upstream sources with the same upstream package versions.
    
    Change-Id: Ieb6b6c07788178b629d6cff0630e30224f6e7ccd
    (cherry picked from commit b514a0ecdf368e39033c53f312bee7c5e86939e0)
    Reviewed-on: https://gerrit.libreoffice.org/34540
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit 26079f5d5993ce289f83eee5f1521be0ecb5c59a)

diff --git a/configure.ac b/configure.ac
index e6f9a7b..b5149b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -169,7 +169,13 @@ dnl ===================================================================
 dnl Our version is defined by the AC_INIT() at the top of this script.
 dnl ===================================================================
 
-set `echo AC_PACKAGE_VERSION | sed "s/\./ /g"`
+AC_MSG_CHECKING([for package version])
+if test -n "$with_package_version" -a "$with_package_version" != no; then
+    PACKAGE_VERSION="$with_package_version"
+fi
+AC_MSG_RESULT([$PACKAGE_VERSION])
+
+set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
 
 LIBO_VERSION_MAJOR=$1
 LIBO_VERSION_MINOR=$2
@@ -1417,6 +1423,11 @@ AC_ARG_WITH(product-name,
         [Define the product name. Default is AC_PACKAGE_NAME.]),
 ,with_product_name=$PRODUCTNAME)
 
+AC_ARG_WITH(package-version,
+    AS_HELP_STRING([--with-package-version='3.1.4.5'],
+        [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
+,)
+
 AC_ARG_ENABLE(ios-simulator,
     AS_HELP_STRING([--enable-ios-simulator],
         [Build for the iOS Simulator, not iOS device.]),
commit 0e3a3c4626ca535bb72db81463ad73607d9a5025
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Feb 16 18:17:53 2017 +0100

    i#92948 sw: WW8 import: fix table in Apo in header
    
    The document contains a table inside of a frame anchored in the header.
    
    In WW8TabDesc::WW8TabDesc() the update to nOrigPos makes a mess of
    things because the new nOrigPos value contains the value of nCpOfs (93)
    already, so later on when SwWW8ImplReader::TestApo() calls
    WW8PLCFxDesc::Save() / WW8PLCFxDesc::Restore(), the call to SeekPos()
    positions it on CP 325 instead of 232 and the subsequent call to
    GetSprms() finds nothing on the wrong position; thus TestApo() concludes
    that the paragraph has different Apo properties than the previous one
    and a new fly frame is created.
    
    (regression from 4bd341e2c8a1f3a4f4677eb879a60a4ffc3369db)
    
    (cherry picked from commit d4620d535bd5a8e73bdb9d556933b9ae22800a7d)
    
    sw: use the stupid line-ends for WNT
    (cherry picked from commit d1a8ca4951c076c605a47aadf6bdcac79d2bee8e)
    
    Change-Id: I697c4526c7c3a12119947ff5659c11ea9ee7fff8
    Reviewed-on: https://gerrit.libreoffice.org/34360
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 31cd8dbada7527629c559a6ff50014a3959c01ef)

diff --git a/sw/qa/extras/ww8export/data/ooo92948-1.doc b/sw/qa/extras/ww8export/data/ooo92948-1.doc
new file mode 100644
index 0000000..f355eaa
Binary files /dev/null and b/sw/qa/extras/ww8export/data/ooo92948-1.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index f5fffee..8af8713 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -328,6 +328,25 @@ DECLARE_WW8EXPORT_TEST(testListNolevel, "list-nolevel.doc")
     CPPUNIT_ASSERT_EQUAL(OUString("1."), aText);
 }
 
+DECLARE_WW8EXPORT_TEST(testHeaderApoTable, "ooo92948-1.doc")
+{
+    // the problem was that a table anchored in the header was split across
+    // 3 text frames and quite messed up
+
+    uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+    uno::Reference<text::XText> xFrame(xIndexAccess->getByIndex(1), uno::UNO_QUERY);
+
+    uno::Reference<text::XTextContent> xTable(getParagraphOrTable(1, xFrame));
+    getCell(xTable, "A1", "Aan" SAL_NEWLINE_STRING "Recipient" SAL_NEWLINE_STRING "Recipient" SAL_NEWLINE_STRING);
+    getCell(xTable, "A2", "Kopie aan" SAL_NEWLINE_STRING);
+    getCell(xTable, "A3", "Datum" SAL_NEWLINE_STRING "31 juli 2008");
+    getCell(xTable, "A4", "Locatie" SAL_NEWLINE_STRING "Locationr");
+    getCell(xTable, "A5", "Van" SAL_NEWLINE_STRING "Sender  ");
+    getCell(xTable, "A6", "Directie" SAL_NEWLINE_STRING "Department");
+    getCell(xTable, "A7", "Telefoon" SAL_NEWLINE_STRING "Phone");
+}
+
 DECLARE_WW8EXPORT_TEST(testBnc821208, "bnc821208.doc")
 {
     // WW8Num1z0 earned a Symbol font, turning numbers into rectangles.
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 1ec8199..41e0657 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2020,6 +2020,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
         // PlcxMan currently points too far ahead so we need to bring
         // it back to where we are trying to make a table
         m_pIo->m_pPlcxMan->GetPap()->nOrigStartPos = aRes.nStartPos;
+        m_pIo->m_pPlcxMan->GetPap()->nCpOfs = aRes.nCpOfs;
         if (!(pPap->SeekPos(aRes.nStartPos)))
         {
             aRes.nEndPos = WW8_CP_MAX;
commit a42f99595389a47ebe173aac9c341765552ab924
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sun Feb 19 22:21:40 2017 +0200

    Fix visible space on Mac with the new layout engine
    
    This is not an issue on master since the alternative Mac code path is
    gone, but we need to skip it in 5.3 when the old layout engine is not
    used as well.
    
    Change-Id: Ib0c8fcf072229c59e15877815c9d88aed94672f0
    Reviewed-on: https://gerrit.libreoffice.org/34433
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 4f8edca85216b46b266fc5dba3103da57e5975be)

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index ed94364..d002607 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1172,6 +1172,8 @@ public:
                                               vcl::TextLayoutCache const* = nullptr) const;
     std::shared_ptr<vcl::TextLayoutCache> CreateTextLayoutCache(OUString const&) const;
 
+    static bool                 UseCommonLayout();
+
 private:
     SAL_DLLPRIVATE void         ImplInitTextColor();
 
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index a92fb87..70be938 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1384,10 +1384,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
     {
         const OUString* pStr = &rInf.GetText();
 
-#if !defined(MACOSX) && !defined(IOS)
         OUString aStr;
         OUString aBulletOverlay;
-#endif
+
         bool bBullet = rInf.GetBullet();
         if( m_bSymbol )
             bBullet = false;
@@ -1492,8 +1491,11 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
 
         nScrPos = pScrArray[ 0 ];
 
-#if !defined(MACOSX) && !defined(IOS)
-        if( bBullet )
+        if( bBullet
+#if defined(MACOSX) || defined(IOS)
+            && OutputDevice::UseCommonLayout()
+#endif
+          )
         {
             // !!! HACK !!!
             // The Arabic layout engine requires some context of the string
@@ -1532,7 +1534,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                     aBulletOverlay = aBulletOverlay.replaceAt(i, 1, OUString(CH_BLANK));
                 }
         }
-#endif
+
         sal_Int32 nCnt = rInf.GetText().getLength();
         if ( nCnt < rInf.GetIdx() )
             nCnt = 0;
@@ -1557,14 +1559,21 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                 rInf.GetFrame()->SwitchHorizontalToVertical( aTextOriginPos );
 
 #if defined(MACOSX) || defined(IOS)
-            rInf.GetOut().DrawTextArray( aTextOriginPos, rInf.GetText(),
+            if (!OutputDevice::UseCommonLayout())
+            {
+                rInf.GetOut().DrawTextArray( aTextOriginPos, rInf.GetText(),
                                          pKernArray, rInf.GetIdx(), 1, bBullet ? SalLayoutFlags::DrawBullet : SalLayoutFlags::NONE );
-#else
+            }
+            else
+            {
+#endif
             rInf.GetOut().DrawTextArray( aTextOriginPos, rInf.GetText(),
                                          pKernArray, rInf.GetIdx(), 1 );
             if( bBullet )
                 rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray,
                                              rInf.GetIdx() ? 1 : 0, 1 );
+#if defined(MACOSX) || defined(IOS)
+            }
 #endif
         }
         else
@@ -1747,9 +1756,14 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                     rInf.GetFrame()->SwitchHorizontalToVertical( aTextOriginPos );
 
 #if defined(MACOSX) || defined(IOS)
-                rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray + nOffs,
+                if (!OutputDevice::UseCommonLayout())
+                {
+                        rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray + nOffs,
                                              rInf.GetIdx() + nOffs , nLen - nOffs, bBullet ? SalLayoutFlags::DrawBullet : SalLayoutFlags::NONE );
-#else
+                }
+                else
+                {
+#endif
                 // If we paint bullets instead of spaces, we use a copy of
                 // the paragraph string. For the layout engine, the copy
                 // of the string has to be an environment of the range which
@@ -1804,6 +1818,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                     pTmpFont->SetStrikeout(aPreviousStrikeout);
                     rInf.GetOut().Pop();
                 }
+#if defined(MACOSX) || defined(IOS)
+                }
 #endif
             }
         }
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 0506280..60917ce 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -2903,4 +2903,9 @@ bool OutputDevice::GetTextOutline( tools::PolyPolygon& rPolyPoly, const OUString
     return true;
 }
 
+bool OutputDevice::UseCommonLayout()
+{
+    return SalLayout::UseCommonLayout();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit d12204e92196e85098b2f943fd8adac7b90b858d
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Dec 12 16:57:15 2016 +0200

    -Werror,-Wimplicit-fallthrough
    
    Change-Id: I7ea9c1af7568ce37f29df14f8dc4345031c20eb8
    (cherry picked from commit dfafaeb989c16792d722d2a256a621f58f8e81fc)
    Reviewed-on: https://gerrit.libreoffice.org/34527
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit d48f30590a54000287ebdc3453d61e40d6fdfde7)

diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index ca71b3b..741363a 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -2822,6 +2822,7 @@ void Content::transfer(
                         Environment );
                     // Unreachable
                 }
+                SAL_FALLTHROUGH;
 
                 case ucb::NameClash::OVERWRITE:
                     break;
diff --git a/ucb/source/ucp/webdav/webdavresponseparser.cxx b/ucb/source/ucp/webdav/webdavresponseparser.cxx
index f666d86..66b73f1 100644
--- a/ucb/source/ucp/webdav/webdavresponseparser.cxx
+++ b/ucb/source/ucp/webdav/webdavresponseparser.cxx
@@ -716,6 +716,7 @@ namespace
                                 maLock.Scope = maLockScope;
                                 maResult_Lock.push_back(maLock);
                             }
+                            SAL_FALLTHROUGH; // I hope intentional?
                             case WebDAVName_propstat:
                             {
                                 // propstat end, check status
commit f66e3708827806247539a7cc43a862332b0c9737
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 5 15:10:32 2016 +0000

    fix the generally unused non-neon webdav MapDAVException
    
    Change-Id: I82caa1686a8855c484050f129d5095f95eab7ece
    (cherry picked from commit e100bb57d884d21c6a0e498317fa93b0202dcb64)
    Reviewed-on: https://gerrit.libreoffice.org/34526
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit c68347040462ae6c000c0f7564c42553c8c18f98)

diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index 6a07cd3..ca71b3b 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -2028,7 +2028,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
             aNewTitle.clear();
 
             // Set error .
-            aRet[ nTitlePos ] <<= MapDAVException( e, true );
+            aRet[ nTitlePos ] = MapDAVException( e, true );
         }
     }
 
commit f678dd85a0271af604e6591e8ef87e16cd6c1d50
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Feb 20 22:26:40 2017 +0100

    Resolves: tdf#106089 generate range string with current address convention
    
     This is a combination of 2 commits.
    
    Resolves: tdf#106089 catch legal IllegalArgumentException on bad range string
    
    ... that for example doesn't match the document's current address convention.
    Further work is need to make that actually fly, but at least don't terminate
    the application but come up with a default Chart instead where the range can be
    edited.
    
    (cherry picked from commit 0200677891c6d592a12343f0d6f82c569cd7a9e0)
    
    Related: tdf#106089 generate range string with current address convention
    
    ... so subsequent parsing actually works.
    
    (cherry picked from commit 3ec3d7ead0f2e47a4e24ba0d6953fea0f49815ed)
    
    47d661d24552104b56827248b4c5e6a6617c5d63
    
    Change-Id: I6cb6400c56c896dac7ab949b8a986c784690dfd3
    Reviewed-on: https://gerrit.libreoffice.org/34496
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 69bc288b0aac0672cf560dec2c4c946e9620ea62)

diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 41610a0..9a9e132 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -114,7 +114,7 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
                 pDoc->LimitChartArea( nTab1, nCol1,nRow1, nCol2,nRow2 );
 
                 ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
-                aRangeString = aRange.Format(ScRefFlags::RANGE_ABS_3D, &rScDoc);
+                aRangeString = aRange.Format(ScRefFlags::RANGE_ABS_3D, &rScDoc, rScDoc.GetAddressConvention());
             }
         }
     }
@@ -186,7 +186,20 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
             aArgs[3] = beans::PropertyValue(
                 OUString("DataRowSource"), -1,
                 uno::makeAny( eDataRowSource ), beans::PropertyState_DIRECT_VALUE );
-            xReceiver->setArguments( aArgs );
+
+            try
+            {
+                xReceiver->setArguments( aArgs );
+            }
+            catch (const lang::IllegalArgumentException& e)
+            {
+                // Can happen for invalid aRangeString, in which case a Chart
+                // will be created nevertheless and the range string can be
+                // edited.
+                SAL_WARN("sc.ui",
+                        "lcl_ChartInit - caught IllegalArgumentException with message \"" << e.Message << "\","
+                        " might be due to aRangeString: " << aRangeString);
+            }
 
             // don't create chart listener here (range may be modified in chart dialog)
         }
commit 8a8cd0986633b78b4f240285ac803f45d00da4b3
Author: Aron Budea <aron.budea at collabora.com>
Date:   Thu Feb 16 19:36:54 2017 +0100

    tdf#106001: Treat CharScaleWidth outliers as 100 in DOCX import
    
    Spec limit is [1..600], sometimes documents contain 0,
    which, similar to other values outside the limit should be
    treated as 100.
    
    Change-Id: I04aec25b638762392de3f9881cd72588f2753e71
    Reviewed-on: https://gerrit.libreoffice.org/34341
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 6e3a84023b46f6be632b43d2f5713d8d4bb2ba62)
    Reviewed-on: https://gerrit.libreoffice.org/34368
    (cherry picked from commit 06c81a3e61e2d5743ffd8a50d85e5ecee989e46b)

diff --git a/sw/qa/extras/ooxmlexport/data/tdf106001.docx b/sw/qa/extras/ooxmlexport/data/tdf106001.docx
new file mode 100644
index 0000000..efe4104
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf106001.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 4dd08ae..ef278f2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -201,6 +201,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103976, "tdf103976.docx")
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(60)), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf106001, "tdf106001.docx")
+{
+    // This was 0 (1 on UI), while Word treats outliers as 100 (outlier = not in [1..600])
+    CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int16>( 100 ), getProperty<sal_Int16>(getRun(getParagraph(1), 1), "CharScaleWidth" ));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 823640c..fe7b9a9 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1694,8 +1694,17 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
         rContext->Insert(PROP_CHAR_AUTO_KERNING, uno::makeAny( nIntValue != 0 ) );
         break;
     case NS_ooxml::LN_EG_RPrBase_w:
-        rContext->Insert(PROP_CHAR_SCALE_WIDTH,
-                         uno::makeAny( sal_Int16(nIntValue) ));
+        // ST_TextScale must fall between 1% and 600% according to spec, otherwise resets to 100% according to experience
+        if ((1 <= nIntValue) && (nIntValue <= 600))
+        {
+            rContext->Insert(PROP_CHAR_SCALE_WIDTH,
+                             uno::makeAny( sal_Int16(nIntValue) ));
+        }
+        else
+        {
+            rContext->Insert(PROP_CHAR_SCALE_WIDTH,
+                             uno::makeAny( sal_Int16(100) ));
+        }
         break;
     case NS_ooxml::LN_EG_RPrBase_imprint:
         // FontRelief: NONE, EMBOSSED, ENGRAVED
commit 75cd5b0a5d9e088df4510a070794fcae6c5a7477
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 20 14:52:52 2017 +0000

    Resolves: tdf#106105 duplicate marks not merged when they are at the start
    
    i.e. initial mark isn't compared which goes on to crash under some circumstances
    
    regression from...
    
    commit aa11e7bae89fe691f914abb27d1c4a03d27a7ee5
    Date:   Tue Aug 14 16:31:53 2012 +0200
    
        Convert maList in SdrMarkList from Container to std::vector
    
    Change-Id: Ib3e9b02aad91c14971656af171d48154507da127
    (cherry picked from commit 35bb22c1a834b306c910cb065bc006818c9fa9b3)
    Reviewed-on: https://gerrit.libreoffice.org/34477
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 213c129049f0bfa36a843f59be8614e4fc5fc362)

diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index 66e5f6e..6cf64c9 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -179,8 +179,9 @@ void SdrMarkList::ImpForceSort()
             if(maList.size() > 1)
             {
                 SdrMark* pAkt = maList.back();
-                for (size_t i = maList.size() - 2; i; --i)
+                for (size_t count = maList.size() - 1; count; --count)
                 {
+                    size_t i = count - 1;
                     SdrMark* pCmp = maList[i];
                     if(pAkt->GetMarkedSdrObj() == pCmp->GetMarkedSdrObj() && pAkt->GetMarkedSdrObj())
                     {
commit 109a500aa91bbfab1bdcf1b0c2f510a54f9d0190
Author: andreas kainz <kainz.a at gmail.com>
Date:   Sun Feb 19 02:14:06 2017 +0100

    Breeze-icons: make the pdf icons monochrome
    
    Change-Id: Ie61590a92cf08a77328a7439a630b72393d6d1ee
    Reviewed-on: https://gerrit.libreoffice.org/34421
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit 6a97c409f7244324a4a17f76497337514ad4f0fb)
    Reviewed-on: https://gerrit.libreoffice.org/34499
    (cherry picked from commit 4524d3fa3dcbcbba2a9e8111e27e6301d33de5d2)

diff --git a/icon-themes/breeze/cmd/32/exportdirecttopdf.png b/icon-themes/breeze/cmd/32/exportdirecttopdf.png
index a713329..b53c5e2 100644
Binary files a/icon-themes/breeze/cmd/32/exportdirecttopdf.png and b/icon-themes/breeze/cmd/32/exportdirecttopdf.png differ
diff --git a/icon-themes/breeze/cmd/lc_exportdirecttopdf.png b/icon-themes/breeze/cmd/lc_exportdirecttopdf.png
index 2132218..91677b6 100644
Binary files a/icon-themes/breeze/cmd/lc_exportdirecttopdf.png and b/icon-themes/breeze/cmd/lc_exportdirecttopdf.png differ
diff --git a/icon-themes/breeze/cmd/sc_exportdirecttopdf.png b/icon-themes/breeze/cmd/sc_exportdirecttopdf.png
index e6c09af..36d97bb 100644
Binary files a/icon-themes/breeze/cmd/sc_exportdirecttopdf.png and b/icon-themes/breeze/cmd/sc_exportdirecttopdf.png differ
diff --git a/icon-themes/breeze_dark/cmd/32/exportdirecttopdf.png b/icon-themes/breeze_dark/cmd/32/exportdirecttopdf.png
index 792cf3d..ca2c2fc 100644
Binary files a/icon-themes/breeze_dark/cmd/32/exportdirecttopdf.png and b/icon-themes/breeze_dark/cmd/32/exportdirecttopdf.png differ
diff --git a/icon-themes/breeze_svg/cmd/32/exportdirecttopdf.svg b/icon-themes/breeze_svg/cmd/32/exportdirecttopdf.svg
index 98d7e1e..d3847a1 100644
--- a/icon-themes/breeze_svg/cmd/32/exportdirecttopdf.svg
+++ b/icon-themes/breeze_svg/cmd/32/exportdirecttopdf.svg
@@ -14,7 +14,7 @@
    id="svg5453"
    version="1.1"
    inkscape:version="0.91 r13725"
-   sodipodi:docname="acrobat.svg"
+   sodipodi:docname="exportdirecttopdf.svg"
    viewBox="0 0 32 32">
   <defs
      id="defs5455" />
@@ -26,7 +26,7 @@
      inkscape:pageopacity="0"
      inkscape:pageshadow="2"
      inkscape:zoom="16.33333"
-     inkscape:cx="12.516075"
+     inkscape:cx="3.2405629"
      inkscape:cy="14.027362"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
@@ -35,10 +35,10 @@
      fit-margin-left="0"
      fit-margin-right="0"
      fit-margin-bottom="0"
-     inkscape:window-width="1920"
-     inkscape:window-height="957"
-     inkscape:window-x="-4"
-     inkscape:window-y="0"
+     inkscape:window-width="2560"
+     inkscape:window-height="1375"
+     inkscape:window-x="0"
+     inkscape:window-y="36"
      inkscape:window-maximized="1"
      inkscape:showpageshadow="false"
      borderlayer="true"
@@ -74,7 +74,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -84,17 +84,9 @@
      id="layer1"
      transform="translate(-384.57143,-515.798)">
     <path
-       style="fill:#d24d57;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none"
-       d="m 16,4 0,1 9,0 0,15 -7,0 0,7 -11,0 0,-8 -1,0 0,8 0,1 13,0 7,-7 0,-17 z"
+       style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 6 4 L 6 18 L 10.5 15 L 15 18 L 15 4 L 6 4 z M 16 4 L 16 5 L 25 5 L 25 20 L 18 20 L 18 27 L 7 27 L 7 19 L 6 19 L 6 27 L 6 28 L 19 28 L 26 21 L 26 4 L 16 4 z M 13 8 C 12.07973 10.36079 10.19098 11.4428 8 13 C 8.83315 8.50641 9.4 8 13 8 z "
        transform="translate(384.57143,515.798)"
-       id="rect4177"
-       inkscape:connector-curvature="0"
-       sodipodi:nodetypes="ccccccccccccccc" />
-    <path
-       style="fill:#d24d57;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none"
-       d="m 390.57143,519.798 0,14 4.5,-3 4.5,3 0,-14 z m 7,4 c -0.92027,2.36079 -2.80902,3.4428 -5,5 0.83315,-4.49359 1.4,-5 5,-5 z"
-       id="rect4182"
-       inkscape:connector-curvature="0"
-       sodipodi:nodetypes="ccccccccc" />
+       id="rect4177" />
   </g>
 </svg>


More information about the Libreoffice-commits mailing list