[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 16 commits - basic/source extras/source filter/source icon-themes/elementary icon-themes/galaxy icon-themes/hicontrast icon-themes/sifr jvmfwk/plugins sc/source svx/source sw/source vcl/inc vcl/source vcl/unx

Marco A.G.Pinto marcoagpinto at mail.telepac.pt
Fri Mar 24 11:40:18 UTC 2017


 basic/source/comp/exprtree.cxx                   |    5 -
 dev/null                                         |binary
 extras/source/autocorr/lang/pt/DocumentList.xml  |   11 ++++
 filter/source/msfilter/svdfppt.cxx               |   41 ++++++++++----
 icon-themes/elementary/svx/res/frmsel.png        |binary
 icon-themes/elementary/vcl/res/checkmono.png     |binary
 icon-themes/elementary/vcl/res/radiomono.png     |binary
 icon-themes/galaxy/svx/res/frmsel.png            |binary
 icon-themes/galaxy/vcl/res/checkmono.png         |binary
 icon-themes/galaxy/vcl/res/radiomono.png         |binary
 icon-themes/sifr/cmd/lc_editheaderandfooter.png  |binary
 icon-themes/sifr/cmd/sc_editheaderandfooter.png  |binary
 icon-themes/sifr/res/savemodified_small.png      |binary
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |    6 +-
 sc/source/ui/cctrl/checklistmenu.cxx             |    8 +-
 sc/source/ui/vba/vbarange.cxx                    |   16 +++++
 svx/source/dialog/ctredlin.cxx                   |    4 -
 svx/source/dialog/frmsel.src                     |    2 
 sw/source/core/doc/docbm.cxx                     |   20 +++----
 vcl/inc/CommonSalLayout.hxx                      |    2 
 vcl/source/gdi/CommonSalLayout.cxx               |   63 ++++++++++++++++-------
 vcl/source/src/images.src                        |    4 -
 vcl/unx/gtk/gtksalframe.cxx                      |    1 
 vcl/unx/gtk/gtksalmenu.cxx                       |   11 ++--
 vcl/unx/gtk3/gtk3gtkframe.cxx                    |    1 
 25 files changed, 131 insertions(+), 64 deletions(-)

New commits:
commit d8b6c5ef9093347ce19e561d28530685a5ce10e1
Author: Marco A.G.Pinto <marcoagpinto at mail.telepac.pt>
Date:   Tue Mar 14 14:02:58 2017 +0000

    [pt_PT] Added 11 new words to autocorrect.
    
    Change-Id: Id14a6da3959006a541e26e6e84d6a4eb0b070651
    Reviewed-on: https://gerrit.libreoffice.org/35187
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit dbd0877e127de88996a13c32683b65ef9f65da17)
    Reviewed-on: https://gerrit.libreoffice.org/35610
    (cherry picked from commit 5deeac3fb6911cbdef5b4a12cc37c5625a495d22)

diff --git a/extras/source/autocorr/lang/pt/DocumentList.xml b/extras/source/autocorr/lang/pt/DocumentList.xml
index c06b9dda393d..9e89c094cbb0 100644
--- a/extras/source/autocorr/lang/pt/DocumentList.xml
+++ b/extras/source/autocorr/lang/pt/DocumentList.xml
@@ -182,6 +182,8 @@
 <block-list:block block-list:abbreviated-name="area" block-list:name="área"/>
 <block-list:block block-list:abbreviated-name="areas" block-list:name="áreas"/>
 <block-list:block block-list:abbreviated-name="arpovação" block-list:name="aprovação"/>
+<block-list:block block-list:abbreviated-name="arquetipo" block-list:name="arquétipo"/>
+<block-list:block block-list:abbreviated-name="arquetipos" block-list:name="arquétipos"/>
 <block-list:block block-list:abbreviated-name="as mos" block-list:name="as mãos"/>
 <block-list:block block-list:abbreviated-name="ás" block-list:name="às"/>
 <block-list:block block-list:abbreviated-name="asacina" block-list:name="assassina"/>
@@ -199,6 +201,7 @@
 <block-list:block block-list:abbreviated-name="assacinas" block-list:name="assassinas"/>
 <block-list:block block-list:abbreviated-name="assacino" block-list:name="assassino"/>
 <block-list:block block-list:abbreviated-name="assacinos" block-list:name="assassinos"/>
+<block-list:block block-list:abbreviated-name="assambarcar" block-list:name="açambarcar"/>
 <block-list:block block-list:abbreviated-name="assenção" block-list:name="ascensão"/>
 <block-list:block block-list:abbreviated-name="assesor" block-list:name="assessor"/>
 <block-list:block block-list:abbreviated-name="assesores" block-list:name="assessores"/>
@@ -208,9 +211,13 @@
 <block-list:block block-list:abbreviated-name="assin" block-list:name="assim"/>
 <block-list:block block-list:abbreviated-name="assougue" block-list:name="açougue"/>
 <block-list:block block-list:abbreviated-name="asssim" block-list:name="assim"/>
+<block-list:block block-list:abbreviated-name="assúcar" block-list:name="açúcar"/>
+<block-list:block block-list:abbreviated-name="assúcares" block-list:name="açúcares"/>
 <block-list:block block-list:abbreviated-name="assuntoi" block-list:name="assunto"/>
 <block-list:block block-list:abbreviated-name="asterístico" block-list:name="asterisco"/>
 <block-list:block block-list:abbreviated-name="atè" block-list:name="até"/>
+<block-list:block block-list:abbreviated-name="atléctico" block-list:name="atlético"/>
+<block-list:block block-list:abbreviated-name="atlécticos" block-list:name="atléticos"/>
 <block-list:block block-list:abbreviated-name="atráves" block-list:name="através"/>
 <block-list:block block-list:abbreviated-name="atrazamos" block-list:name="atrasamos"/>
 <block-list:block block-list:abbreviated-name="atrazar" block-list:name="atrasar"/>
@@ -239,6 +246,7 @@
 <block-list:block block-list:abbreviated-name="auguma" block-list:name="alguma"/>
 <block-list:block block-list:abbreviated-name="augumas" block-list:name="algumas"/>
 <block-list:block block-list:abbreviated-name="augun" block-list:name="algum"/>
+<block-list:block block-list:abbreviated-name="auje" block-list:name="auge"/>
 <block-list:block block-list:abbreviated-name="autodromo" block-list:name="autódromo"/>
 <block-list:block block-list:abbreviated-name="autodromos" block-list:name="autódromos"/>
 <block-list:block block-list:abbreviated-name="automátcio" block-list:name="automático"/>
@@ -430,6 +438,7 @@
 <block-list:block block-list:abbreviated-name="concerteza" block-list:name="com certeza"/>
 <block-list:block block-list:abbreviated-name="congreço" block-list:name="congresso"/>
 <block-list:block block-list:abbreviated-name="congreso" block-list:name="congresso"/>
+<block-list:block block-list:abbreviated-name="conhecessemos" block-list:name="conhecêssemos"/>
 <block-list:block block-list:abbreviated-name="conhecidência" block-list:name="coincidência"/>
 <block-list:block block-list:abbreviated-name="conhecidências" block-list:name="coincidências"/>
 <block-list:block block-list:abbreviated-name="conhesse" block-list:name="conhece"/>
@@ -1472,6 +1481,8 @@
 <block-list:block block-list:abbreviated-name="paralizo" block-list:name="paraliso"/>
 <block-list:block block-list:abbreviated-name="paralizou" block-list:name="paralisou"/>
 <block-list:block block-list:abbreviated-name="parelisia" block-list:name="paralisia"/>
+<block-list:block block-list:abbreviated-name="pârametro" block-list:name="parâmetro"/>
+<block-list:block block-list:abbreviated-name="pârametros" block-list:name="parâmetros"/>
 <block-list:block block-list:abbreviated-name="parentese" block-list:name="parêntese"/>
 <block-list:block block-list:abbreviated-name="parenteses" block-list:name="parênteses"/>
 <block-list:block block-list:abbreviated-name="paresa" block-list:name="pareça"/>
commit 97fb1b67e5d07ae3be3918baa51cbaebab06c26b
Author: Vitaliy Anderson <vanderson at smartru.com>
Date:   Thu Mar 9 23:18:09 2017 -0800

    tdf#106047 Fix case-insensitive search in autofilter
    
    Change-Id: I67899789b0a51a3a04c2085cbab8c0ed62903413
    (cherry picked from commit b0240bf12a94e71d1e2ebe3922afc1a3de5cd933)
    Reviewed-on: https://gerrit.libreoffice.org/35544
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 7dc991097833b0dc60941b388ac60c909529e239)

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index fd56093da389..226f029c6633 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1215,7 +1215,7 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, TriStateHdl, Button*, void)
 IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, Edit&, void)
 {
     OUString aSearchText = maEdSearch->GetText();
-    aSearchText = aSearchText.toAsciiLowerCase();
+    aSearchText = ScGlobal::pCharClass->lowercase( aSearchText );
     bool bSearchTextEmpty = aSearchText.isEmpty();
     size_t n = maMembers.size();
     size_t nSelCount = 0;
@@ -1234,10 +1234,10 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, Edit&, void)
         if ( !bSearchTextEmpty )
         {
             if ( !bIsDate )
-                bPartialMatch = ( aLabelDisp.toAsciiLowerCase().indexOf( aSearchText ) != -1 );
+                bPartialMatch = ( ScGlobal::pCharClass->lowercase( aLabelDisp ).indexOf( aSearchText ) != -1 );
             else if ( maMembers[i].meDatePartType == ScCheckListMember::DAY ) // Match with both numerical and text version of month
-                bPartialMatch = bPartialMatch || ( OUString( maMembers[i].maRealName + maMembers[i].maDateParts[1] )
-                                                   .toAsciiLowerCase().indexOf( aSearchText ) != -1 );
+                bPartialMatch = bPartialMatch || ( ScGlobal::pCharClass->lowercase( OUString( maMembers[i].maRealName + maMembers[i].maDateParts[1] ) )
+                                                   .indexOf( aSearchText ) != -1 );
             else
                 continue;
         }
commit c926e9caec0042b65817240eb451cae6da5a6da9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 4 18:33:36 2017 +0000

    Resolves: tdf#105463 convert bmps to png
    
    because bmps aren't seen since...
    
    commit c3043a3072465c489d3b20991b17d222771305eb
    Date:   Mon Oct 31 13:28:26 2016 +0100
    
        tdf#103591 icon theme name resolving, ui fixes, prioritize png
    
        - Prefer "png" over "svg" because for Tango theme we include both
    
    (cherry picked from commit a3c4f39868226151b4b01906cbcf1b6d40740a28)
    
    convert from bmp to png
    
    (cherry picked from commit 1b7d1d16e3a6826433271b3eed4a2d542585961b)
    
    Change-Id: I93755ac95c170c457b32adac07557ed48ad8beee
    7fe47f47f19b93eab5d0cef0afde63e6f61c21b4
    Reviewed-on: https://gerrit.libreoffice.org/35534
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    
    (cherry picked from commit 2fd3d2256096b6cb3565fbeeb9342c9b983a4018)

diff --git a/icon-themes/elementary/sc/res/sidebar/morebutton.bmp b/icon-themes/elementary/sc/res/sidebar/morebutton.bmp
deleted file mode 100644
index c665b3e866a8..000000000000
Binary files a/icon-themes/elementary/sc/res/sidebar/morebutton.bmp and /dev/null differ
diff --git a/icon-themes/elementary/svx/res/frmsel.bmp b/icon-themes/elementary/svx/res/frmsel.bmp
deleted file mode 100644
index fd22f2b0c6a6..000000000000
Binary files a/icon-themes/elementary/svx/res/frmsel.bmp and /dev/null differ
diff --git a/icon-themes/elementary/svx/res/frmsel.png b/icon-themes/elementary/svx/res/frmsel.png
new file mode 100644
index 000000000000..7f0319496c29
Binary files /dev/null and b/icon-themes/elementary/svx/res/frmsel.png differ
diff --git a/icon-themes/elementary/vcl/res/checkmono.bmp b/icon-themes/elementary/vcl/res/checkmono.bmp
deleted file mode 100644
index 7e0610d5e9d8..000000000000
Binary files a/icon-themes/elementary/vcl/res/checkmono.bmp and /dev/null differ
diff --git a/icon-themes/elementary/vcl/res/checkmono.png b/icon-themes/elementary/vcl/res/checkmono.png
new file mode 100644
index 000000000000..69c89139bf49
Binary files /dev/null and b/icon-themes/elementary/vcl/res/checkmono.png differ
diff --git a/icon-themes/elementary/vcl/res/radiomono.bmp b/icon-themes/elementary/vcl/res/radiomono.bmp
deleted file mode 100644
index 6c757c34bac8..000000000000
Binary files a/icon-themes/elementary/vcl/res/radiomono.bmp and /dev/null differ
diff --git a/icon-themes/elementary/vcl/res/radiomono.png b/icon-themes/elementary/vcl/res/radiomono.png
new file mode 100644
index 000000000000..d9e447102afd
Binary files /dev/null and b/icon-themes/elementary/vcl/res/radiomono.png differ
diff --git a/icon-themes/galaxy/sc/res/sidebar/morebutton.bmp b/icon-themes/galaxy/sc/res/sidebar/morebutton.bmp
deleted file mode 100644
index c665b3e866a8..000000000000
Binary files a/icon-themes/galaxy/sc/res/sidebar/morebutton.bmp and /dev/null differ
diff --git a/icon-themes/galaxy/svx/res/frmsel.bmp b/icon-themes/galaxy/svx/res/frmsel.bmp
deleted file mode 100644
index fd22f2b0c6a6..000000000000
Binary files a/icon-themes/galaxy/svx/res/frmsel.bmp and /dev/null differ
diff --git a/icon-themes/galaxy/svx/res/frmsel.png b/icon-themes/galaxy/svx/res/frmsel.png
new file mode 100644
index 000000000000..7f0319496c29
Binary files /dev/null and b/icon-themes/galaxy/svx/res/frmsel.png differ
diff --git a/icon-themes/galaxy/vcl/res/checkmono.bmp b/icon-themes/galaxy/vcl/res/checkmono.bmp
deleted file mode 100644
index 7e0610d5e9d8..000000000000
Binary files a/icon-themes/galaxy/vcl/res/checkmono.bmp and /dev/null differ
diff --git a/icon-themes/galaxy/vcl/res/checkmono.png b/icon-themes/galaxy/vcl/res/checkmono.png
new file mode 100644
index 000000000000..4cabe1284025
Binary files /dev/null and b/icon-themes/galaxy/vcl/res/checkmono.png differ
diff --git a/icon-themes/galaxy/vcl/res/radiomono.bmp b/icon-themes/galaxy/vcl/res/radiomono.bmp
deleted file mode 100644
index 6c757c34bac8..000000000000
Binary files a/icon-themes/galaxy/vcl/res/radiomono.bmp and /dev/null differ
diff --git a/icon-themes/galaxy/vcl/res/radiomono.png b/icon-themes/galaxy/vcl/res/radiomono.png
new file mode 100644
index 000000000000..aba237e266d2
Binary files /dev/null and b/icon-themes/galaxy/vcl/res/radiomono.png differ
diff --git a/icon-themes/hicontrast/sc/res/sidebar/morebutton.bmp b/icon-themes/hicontrast/sc/res/sidebar/morebutton.bmp
deleted file mode 100644
index c665b3e866a8..000000000000
Binary files a/icon-themes/hicontrast/sc/res/sidebar/morebutton.bmp and /dev/null differ
diff --git a/svx/source/dialog/frmsel.src b/svx/source/dialog/frmsel.src
index 3001d3222865..5018d9283d70 100644
--- a/svx/source/dialog/frmsel.src
+++ b/svx/source/dialog/frmsel.src
@@ -53,7 +53,7 @@ Resource RID_SVXSTR_BORDER_CONTROL
         };
     };
 
-    Bitmap BMP_FRMSEL_ARROWS { File = "frmsel.bmp"; };
+    Bitmap BMP_FRMSEL_ARROWS { File = "frmsel.png"; };
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src
index 77cfb392831a..3bc9ab52dc64 100644
--- a/vcl/source/src/images.src
+++ b/vcl/source/src/images.src
@@ -26,7 +26,7 @@ Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_STDOFFSET)
 
 Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MONOOFFSET)
 {
-    File = "checkmono.bmp";
+    File = "checkmono.png";
 };
 
 Bitmap (SV_RESID_BITMAP_SCROLLBMP)
@@ -46,7 +46,7 @@ Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_STDOFFSET)
 
 Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET)
 {
-    File = "radiomono.bmp";
+    File = "radiomono.png";
 };
 
 Bitmap SV_RESID_BITMAP_MSGBOX
commit 0891ca2847931983590b39e512e3170ee34c18a3
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 22 00:35:19 2017 +0100

    jvmfwk: fix JVM detection on 64-bit Windows
    
    _WIN32 is also defined on 64-bit Windows so reorder these ifdefs.
    
    Should i be surprised that this breaks several dbaccess tests
    for me but all tinderboxes are green?
    
    (regression from 9143dd4ebe37b608e43d04434cf831624bf55b65)
    
    Change-Id: Id917952d3135768355af711688ff70bf6c019a6e
    (cherry picked from commit 2aa20cfb7a11dd8d86372af4065a5887a0b752ca)
    Reviewed-on: https://gerrit.libreoffice.org/35530
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit c78d39066ace32e0324365bcf10882aa6e976a03)

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index ef9da176ebc4..27b3ddcd7422 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -215,10 +215,10 @@ bool VendorBase::isValidArch() const
     // It is not defined what the exact values are.
     // Oracle JRE 8 has "x86" and "amd64", the others were found at http://lopica.sourceforge.net/os.html .
     // There might still be missing some options; we need to extend the check once we find out.
-#if defined _WIN32
-    return m_sArch == "x86" || m_sArch == "i386" || m_sArch == "i686";
-#elif defined _WIN64
+#if defined _WIN64
     return m_sArch == "amd64" || m_sArch == "x86_64";
+#elif defined _WIN32
+    return m_sArch == "x86" || m_sArch == "i386" || m_sArch == "i686";
 #else
     (void)this;
     return true;
commit b92ff2106432c45c05b3078dd56540ce6920a3df
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Mar 16 18:55:42 2017 -0400

    tdf#104383: prevent crash during file load.
    
    Apparently xView may be null sometimes.
    
    Change-Id: Icef81159eeaf5c9bdb0a91e036019b820952d20b
    (cherry picked from commit 273d7cec114ace96c5d891fdb24ddc36be3a2376)
    Reviewed-on: https://gerrit.libreoffice.org/35520
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit 5112b09445069015de6f82524ea9247a1d73f35e)

diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index f68d5495a9d8..af3a4e6c48e1 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4215,8 +4215,20 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC
         }
     }
 
-    uno::Reference< sheet::XSpreadsheetView > xView( getCurrentExcelDoc(xContext)->getCurrentController(), uno::UNO_QUERY );
-    uno::Reference< table::XCellRange > xSheetRange( xView->getActiveSheet(), uno::UNO_QUERY_THROW );
+    uno::Reference<table::XCellRange> xSheetRange;
+
+    try
+    {
+        uno::Reference<sheet::XSpreadsheetView> xView(
+            getCurrentExcelDoc(xContext)->getCurrentController(), uno::UNO_QUERY_THROW);
+
+        xSheetRange.set(xView->getActiveSheet(), uno::UNO_QUERY_THROW);
+    }
+    catch (const uno::Exception&)
+    {
+        return uno::Reference<excel::XRange>();
+    }
+
     ScVbaRange* pRange = new ScVbaRange( excel::getUnoSheetModuleObj( xSheetRange ), xContext, xSheetRange );
     uno::Reference< excel::XRange > xVbSheetRange( pRange );
     return pRange->Range( Cell1, Cell2, true );
commit 76cd0b23f0dc78a73a67a5dddbda0fa229811271
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Feb 3 16:48:02 2017 +0100

    tdf#104447 sw: make lcl_DebugMarks output more readable, pos. at the start
    
    (cherry picked from commit f6596a35c2d9a8c365bb78e1256a2def57ee1a36)
    
    The pass-by-value is also fixed here which is a surprisingly expensive
    performance regression.
    
    Change-Id: If9c151faefa3d109af2df7933a275c667880fb75
    Reviewed-on: https://gerrit.libreoffice.org/35492
    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 4c7775247fbbf38cd397fd7649bf10810f27a0b4)

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index f75dd0e2c5de..1604d7ccf35c 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -288,28 +288,28 @@ namespace
             [&rName] (IDocumentMarkAccess::pMark_t const& rpMark) { return rpMark->GetName() == rName; } );
     }
 
-    void lcl_DebugMarks(IDocumentMarkAccess::container_t vMarks)
+    void lcl_DebugMarks(IDocumentMarkAccess::container_t const& rMarks)
     {
 #if OSL_DEBUG_LEVEL > 0
-        SAL_INFO("sw.core", vMarks.size() << " Marks");
-        for(IDocumentMarkAccess::iterator_t ppMark = vMarks.begin();
-            ppMark != vMarks.end();
-            ppMark++)
+        SAL_INFO("sw.core", rMarks.size() << " Marks");
+        for (IDocumentMarkAccess::const_iterator_t ppMark = rMarks.begin();
+             ppMark != rMarks.end();
+             ++ppMark)
         {
             IMark* pMark = ppMark->get();
             const SwPosition* const pStPos = &pMark->GetMarkStart();
             const SwPosition* const pEndPos = &pMark->GetMarkEnd();
             SAL_INFO("sw.core",
-                typeid(*pMark).name() << " " <<
-                pMark->GetName() << " " <<
                 pStPos->nNode.GetIndex() << "," <<
                 pStPos->nContent.GetIndex() << " " <<
                 pEndPos->nNode.GetIndex() << "," <<
-                pEndPos->nContent.GetIndex());
+                pEndPos->nContent.GetIndex() << " " <<
+                typeid(*pMark).name() << " " <<
+                pMark->GetName());
         }
 #endif
-        assert(std::is_sorted(vMarks.begin(), vMarks.end(), lcl_MarkOrderingByStart));
-        (void) vMarks;
+        assert(std::is_sorted(rMarks.begin(), rMarks.end(), lcl_MarkOrderingByStart));
+        (void) rMarks;
     };
 }
 
commit b3ad7676e2989992ac17691b3e111fd4050b5e0b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 16 09:53:19 2017 +0000

    ofz#875 limit depth to max legal depth
    
    Change-Id: Icbe9339148dc4aeb31c160e976385e3bcaef75b6
    (cherry picked from commit 30e2b7203963af215c9aaaec12383e0d5e1f6a7f)
    Reviewed-on: https://gerrit.libreoffice.org/35259
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 3f9500481902f11349ce8fee523824abe445cc04)

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 27b38ad536c1..f7f9c18117ee 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -5899,6 +5899,14 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, TSS_Ty
 
     bool bIsHardAttribute = ( ( pParaSet->mnAttrSet & nMask ) != 0 );
 
+    sal_uInt16 nDepth = pParaSet->mnDepth;
+
+    if (nDepth >= nMaxPPTLevels)
+    {
+        SAL_WARN("filter.ms", "Para Style Sheet depth " << nDepth << " but " << nMaxPPTLevels - 1 << " is max possible");
+        nDepth = nMaxPPTLevels - 1;
+    }
+
     if ( bIsHardAttribute )
     {
         if ( nAttr == PPT_ParaAttr_BulletColor )
@@ -5907,7 +5915,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, TSS_Ty
             if ( pParaSet->mnAttrSet & ( 1 << PPT_ParaAttr_BuHardColor ) )
                 bHardBulletColor = pParaSet->mpArry[ PPT_ParaAttr_BuHardColor ] != 0;
             else
-                bHardBulletColor = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ].mnBuFlags
+                bHardBulletColor = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[nDepth].mnBuFlags
                                         & ( 1 << PPT_ParaAttr_BuHardColor ) ) != 0;
             if ( bHardBulletColor )
                 rRetValue = pParaSet->mnBulletColor;
@@ -5923,7 +5931,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, TSS_Ty
                     }
                     else
                     {
-                        rRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor;
+                        rRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[nDepth].mnFontColor;
                     }
                 }
             }
@@ -5934,7 +5942,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, TSS_Ty
             if ( pParaSet->mnAttrSet & ( 1 << PPT_ParaAttr_BuHardFont ) )
                 bHardBuFont = pParaSet->mpArry[ PPT_ParaAttr_BuHardFont ] != 0;
             else
-                bHardBuFont = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ].mnBuFlags
+                bHardBuFont = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[nDepth].mnBuFlags
                                         & ( 1 << PPT_ParaAttr_BuHardFont ) ) != 0;
             if ( bHardBuFont )
                 rRetValue = pParaSet->mpArry[ PPT_ParaAttr_BulletFont ];
@@ -5951,7 +5959,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, TSS_Ty
                     }
                     else
                     {
-                        rRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFont;
+                        rRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[nDepth].mnFont;
                     }
                 }
             }
@@ -5961,14 +5969,14 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, TSS_Ty
     }
     else
     {
-        const PPTParaLevel& rParaLevel = mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ];
+        const PPTParaLevel& rParaLevel = mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[nDepth];
 
         PPTParaLevel* pParaLevel = nullptr;
         if ( ( nDestinationInstance == TSS_Type::Unknown )
-            || ( pParaSet->mnDepth && ( ( mnInstance == TSS_Type::Subtitle ) || ( mnInstance == TSS_Type::TextInShape ) ) ) )
+            || ( nDepth && ( ( mnInstance == TSS_Type::Subtitle ) || ( mnInstance == TSS_Type::TextInShape ) ) ) )
             bIsHardAttribute = true;
         else if ( nDestinationInstance != mnInstance )
-            pParaLevel = &mrStyleSheet.mpParaSheet[ nDestinationInstance ]->maParaLevel[ pParaSet->mnDepth ];
+            pParaLevel = &mrStyleSheet.mpParaSheet[ nDestinationInstance ]->maParaLevel[nDepth];
         switch ( nAttr )
         {
             case PPT_ParaAttr_BulletOn :
@@ -6016,7 +6024,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, TSS_Ty
                     }
                     else
                     {
-                        rRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFont;
+                        rRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[nDepth].mnFont;
                         bIsHardAttribute = true;
                     }
                 }
@@ -6052,7 +6060,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, TSS_Ty
                             if( rPortion.mbHardHylinkOrigColor )
                                 rRetValue = rPortion.mnHylinkOrigColor;
                             else
-                                rRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor;
+                                rRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[nDepth].mnFontColor;
                             bIsHardAttribute = true;
                         }
                         else
@@ -6062,7 +6070,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, TSS_Ty
                     }
                     else
                     {
-                        rRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor;
+                        rRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[nDepth].mnFontColor;
                         bIsHardAttribute = true;
                     }
                 }
commit 15520e1f56ee6dee0ab45fff764b3352e819f7af
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Mon Mar 20 20:48:40 2017 +0530

    tdf#106382 - Fix incorrectly shown change tracking comments in dialog
    
    First item in the array is treated as the number of fields followed by
    their widths. There are only 4 such fields in case of writer, not 5.
    
    Change-Id: Iff6f21b54b73d4395d64d83f2acf1de2a19a251e
    Reviewed-on: https://gerrit.libreoffice.org/35484
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    (cherry picked from commit 551e86ff278d4608a54d311f387ca57ef4732000)
    Reviewed-on: https://gerrit.libreoffice.org/35502
    (cherry picked from commit 181cbe104b9f8f0d0812db082d68f4d5e1bc281b)

diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 26dd99617aeb..105aaebf3d05 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -431,7 +431,7 @@ void SvxTPView::dispose()
 
 void SvxTPView::InsertWriterHeader()
 {
-    const long pTabs[] = { 5, 10, 20, 70, 120, 170 };
+    const long pTabs[] = { 4 /* Length of rest of the array */, 10, 20, 70, 120 };
     m_pViewData->SetTabs(pTabs);
 
     OUString aStrTab('\t');
@@ -448,7 +448,7 @@ void SvxTPView::InsertWriterHeader()
 
 void SvxTPView::InsertCalcHeader()
 {
-    const long pTabs[] = { 5, 10, 65, 120, 170, 220 };
+    const long pTabs[] = { 5 /* Length of rest of the array */, 10, 65, 120, 170, 220 };
     m_pViewData->SetTabs(pTabs);
 
     OUString aStrTab('\t');
commit af264a481eea8bd0e70e7623ca6628408d436963
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 16 21:22:36 2017 +0000

    ofz: use after free
    
    Change-Id: I6d3f9108b02149165b020fc9c6677880456a1ef4
    Reviewed-on: https://gerrit.libreoffice.org/35299
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 958280a0332d1f9b3e702c79df6cb9b35eeb350c)

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 4195188fe2be..27b38ad536c1 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2905,7 +2905,18 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
                             // obsolete here, too.
                             pRet->getSdrPageProperties().ClearItem();
                             pRet->getSdrPageProperties().PutItemSet(rSlidePersist.pBObj->GetMergedItemSet());
-                            SdrObject::Free( rSlidePersist.pBObj );
+                            if (rSlidePersist.pSolverContainer)
+                            {
+                                for (SvxMSDffConnectorRule* pPtr : rSlidePersist.pSolverContainer->aCList)
+                                {
+                                    // check connections to the group object
+                                    if (pPtr->pAObj == rSlidePersist.pBObj)
+                                        pPtr->pAObj = nullptr;
+                                    if (pPtr->pBObj == rSlidePersist.pBObj)
+                                        pPtr->pBObj = nullptr;
+                                }
+                            }
+                            SdrObject::Free(rSlidePersist.pBObj);
                         }
                     }
                 }
commit aa571125a45cbd2586b2992d35a216d32b1ccf75
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Fri Mar 17 15:12:32 2017 +0100

    tdf#106529: Revert "tdf#80731 Closing parenthesis is now detected"
    
    This reverts commit 65e294e221e0ad1d37c6667eecb995817ace870d, which
    breaks several widely used Basic extensions and hundreds of anonymous
    macros that miss closing parenthesis here and there
    
    Change-Id: I5d27e6d4e7c8aea3f0762c41ede46e35a5a24aaa
    Reviewed-on: https://gerrit.libreoffice.org/35340
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit 660e394b893a045a077ccded263f94a1be03fcf9)

diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 008976f1a7d6..e7a2210ada0c 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -1055,11 +1055,6 @@ SbiExprListPtr SbiExprList::ParseParameters( SbiParser* pParser, bool bStandalon
         {
             if( ( pExprList->bBracket && eTok == RPAREN ) || SbiTokenizer::IsEoln( eTok ) )
             {
-                if ( SbiTokenizer::IsEoln( eTok ) && pExprList->bBracket)
-                {
-                    pParser->Error( ERRCODE_BASIC_EXPECTED, RPAREN );
-                    pExprList->bError = true;
-                }
                 break;
             }
             pParser->Error( pExprList->bBracket ? ERRCODE_BASIC_BAD_BRACKETS : ERRCODE_BASIC_EXPECTED, COMMA );
commit 2d920ace6945357084b9179c0649548551733600
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Mar 10 02:42:56 2017 +0200

    Keep menubar hidden after Unity registrar activated
    
    ... if it was hidden before. Otherwise it becomes
    out of sync with MenuBar::mbDisplayable.
    
    Change-Id: I03c551ee70131a50fa694b7009c24833ac391990
    Reviewed-on: https://gerrit.libreoffice.org/35487
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 6d4844558268ec03da863175e1dc8d571c05ec46)

diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 7590a711279b..cfc6f4548f8c 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -724,7 +724,6 @@ void on_registrar_available( GDBusConnection * /*connection*/,
     {
         GtkSalMenu* pGtkSalMenu = static_cast<GtkSalMenu*>(pSalMenu);
         pGtkSalMenu->EnableUnity(true);
-        pGtkSalMenu->UpdateFull();
     }
 }
 
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 756cca26a498..e3d5b4cbe2de 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -1159,14 +1159,19 @@ void GtkSalMenu::EnableUnity(bool bEnable)
     bUnityMode = bEnable;
 
     MenuBar* pMenuBar(static_cast<MenuBar*>(mpVCLMenu.get()));
+    bool bDisplayable(pMenuBar->IsDisplayable());
 
     if (bEnable)
+    {
         DestroyMenuBarWidget();
+        UpdateFull();
+        if (!bDisplayable)
+            ShowMenuBar(false);
+    }
     else
     {
         Update();
-        if (pMenuBar->IsDisplayable())
-            CreateMenuBarWidget();
+        ShowMenuBar(bDisplayable);
     }
 
     pMenuBar->LayoutChanged();
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 2752fc75e172..1a4823eb3eb5 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -739,7 +739,6 @@ void on_registrar_available( GDBusConnection * /*connection*/,
     {
         GtkSalMenu* pGtkSalMenu = static_cast<GtkSalMenu*>(pSalMenu);
         pGtkSalMenu->EnableUnity(true);
-        pGtkSalMenu->UpdateFull();
     }
 }
 
commit ff8988ba0ad8688f5415d7deb2590e6ce5e68125
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Mar 10 01:12:08 2017 +0200

    gtk3: Keep menubar hidden after customization
    
    ... if it was hidden before. Otherwise it becomes
    out of sync with MenuBar::mbDisplayable.
    
    Change-Id: I4957f5cef916abfa54add2901b330463364d3dba
    Reviewed-on: https://gerrit.libreoffice.org/35486
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 519254aa32b5ad8a3ae8544d89f76884ab2f6afb)

diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 807470ab1066..756cca26a498 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -847,7 +847,7 @@ void GtkSalMenu::SetFrame(const SalFrame* pFrame)
     g_lo_menu_insert_section( pMenuModel, 0, nullptr, mpMenuModel );
 
 #if GTK_CHECK_VERSION(3,0,0)
-    if (!bUnityMode)
+    if (!bUnityMode && static_cast<MenuBar*>(mpVCLMenu.get())->IsDisplayable())
     {
         DestroyMenuBarWidget();
         CreateMenuBarWidget();
commit 8c8d8683848bfe82d0ea509f5611ff39e90c1203
Author: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
Date:   Mon Mar 20 23:27:19 2017 -0600

    tdf#106284 Sifr icon accidentally included an opaque background
    
    Change-Id: I0c101765eb3a8bde3cf63e8d9653143e56786063
    (cherry picked from commit 0a8612f8b893b9510e083dbb9f01077d0ba1c017)
    Reviewed-on: https://gerrit.libreoffice.org/35497
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit d7500b1e563c9d15a784e6ee834bab3210d5faaa)

diff --git a/icon-themes/sifr/res/savemodified_small.png b/icon-themes/sifr/res/savemodified_small.png
index 3fb98f93c7eb..cc1d5bed6036 100644
Binary files a/icon-themes/sifr/res/savemodified_small.png and b/icon-themes/sifr/res/savemodified_small.png differ
commit eab541b9b9837ca1a8f1251e6172f0346f31faad
Author: Matthias Freund <matti_lx at secure.mailbox.org>
Date:   Sun Mar 19 22:38:56 2017 +0100

    tdf#75256 Sifr icon update
    
    new icons
    
    Change-Id: I966c962f56608371d8b8127f60e2526d4ea626a9
    Reviewed-on: https://gerrit.libreoffice.org/35445
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit d724eaa4a3a9dcd3ac25fcf6481514fe10fce5a6)

diff --git a/icon-themes/sifr/cmd/lc_editheaderandfooter.png b/icon-themes/sifr/cmd/lc_editheaderandfooter.png
new file mode 100644
index 000000000000..0c01f11c4aac
Binary files /dev/null and b/icon-themes/sifr/cmd/lc_editheaderandfooter.png differ
diff --git a/icon-themes/sifr/cmd/sc_editheaderandfooter.png b/icon-themes/sifr/cmd/sc_editheaderandfooter.png
new file mode 100644
index 000000000000..d2774adc7858
Binary files /dev/null and b/icon-themes/sifr/cmd/sc_editheaderandfooter.png differ
commit 08ceb0ca8f7498c42dd202674f88276c29280d03
Author: Mark Hung <marklh9 at gmail.com>
Date:   Fri Mar 17 20:00:03 2017 +0800

    tdf#106295 fix vertical orientation for fullwidth colon and semicolon.
    
    Chinese users would expect fullwidth colon (U+FF1A) and semi-colon (U+FF1B)
    to be Tu( transformed upright ) instead of Tr ( Transformed rotated ) in
    vertical writing mode. Make them exceptions of UTR50 when language is zh.
    
    Change-Id: If7d01199973d73136a621bf2f32377da76ccb22a
    Reviewed-on: https://gerrit.libreoffice.org/34980
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/35382
    (cherry picked from commit 465da7d95e17367e615ec5ef65f368d89c8d7f5d)

diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index df2849828df7..4d8d65f9501c 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -330,8 +330,12 @@ namespace vcl {
 
     #include "VerticalOrientationData.cxx"
 
-    VerticalOrientation GetVerticalOrientation(sal_UCS4 cCh)
+    VerticalOrientation GetVerticalOrientation(sal_UCS4 cCh, const LanguageTag& rTag)
     {
+        // Override fullwidth colon and semi-colon orientation. Tu is preferred.
+        if ((cCh == 0xff1a || cCh == 0xff1b) && rTag.getLanguage() == "zh")
+            return VerticalOrientation::TransformedUpright;
+
         uint8_t nRet = 1;
 
         if (cCh < 0x10000)
@@ -524,7 +528,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
                 {
                     sal_Int32 nPrevIdx = nIdx;
                     sal_UCS4 aChar = rArgs.mrStr.iterateCodePoints(&nIdx);
-                    VerticalOrientation aVo = vcl::GetVerticalOrientation(aChar);
+                    VerticalOrientation aVo = vcl::GetVerticalOrientation(aChar, rArgs.maLanguageTag);
 
                     sal_UCS4 aVariationSelector = 0;
                     if (nIdx < nEndRunPos)
commit 92093e4589da859990d384c13818a038c3b16c4b
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sun Mar 5 00:04:35 2017 +0200

    Handle Tr vertical orientation before shaping
    
    See https://github.com/behdad/harfbuzz/issues/355
    
    (cherry picked from commit 5c617a811724a45dd8688869eeafac4c44f6a8aa)
    
    Change-Id: Ic82d74046980fae3e7a973fee90fe5bb4f2b8588
    Reviewed-on: https://gerrit.libreoffice.org/35387
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mark Hung <marklh9 at gmail.com>
    (cherry picked from commit 49eadd40b5f0de6fa97498d89f20118b996385d2)

diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx
index 58cba16e63d4..496d17125835 100644
--- a/vcl/inc/CommonSalLayout.hxx
+++ b/vcl/inc/CommonSalLayout.hxx
@@ -60,7 +60,7 @@ class CommonSalLayout : public GenericSalLayout
     void                    getScale(double* nXScale, double* nYScale);
 
     hb_set_t*               mpVertGlyphs;
-    bool                    IsVerticalAlternate(hb_codepoint_t nGlyphIndex);
+    bool                    HasVerticalAlternate(sal_UCS4 aChar, sal_UCS4 aNextChar);
 
 public:
 #if defined(_WIN32)
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index a6ca683c15f5..df2849828df7 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -409,12 +409,16 @@ void CommonSalLayout::DrawText(SalGraphics& rSalGraphics) const
     rSalGraphics.DrawSalLayout( *this );
 }
 
-// Find if the given glyph index can result from applying “vert” feature.
+// Find if the nominal glyph of the character is an input to “vert” feature.
 // We don’t check for a specific script or language as it shouldn’t matter
 // here; if the glyph would be the result from applying “vert” for any
 // script/language then we want to always treat it as upright glyph.
-bool CommonSalLayout::IsVerticalAlternate(hb_codepoint_t nGlyphIndex)
+bool CommonSalLayout::HasVerticalAlternate(sal_UCS4 aChar, sal_UCS4 aVariationSelector)
 {
+    hb_codepoint_t nGlyphIndex = 0;
+    if (!hb_font_get_glyph(mpHbFont, aChar, aVariationSelector, &nGlyphIndex))
+        return false;
+
     if (!mpVertGlyphs)
     {
         hb_face_t* pHbFace = hb_font_get_face(mpHbFont);
@@ -432,7 +436,11 @@ bool CommonSalLayout::IsVerticalAlternate(hb_codepoint_t nGlyphIndex)
             while (hb_set_next(pLookups, &nIdx))
             {
                 hb_set_t* pGlyphs = hb_set_create();
-                hb_ot_layout_lookup_collect_glyphs(pHbFace, HB_OT_TAG_GSUB, nIdx, nullptr, nullptr, nullptr, pGlyphs);
+                hb_ot_layout_lookup_collect_glyphs(pHbFace, HB_OT_TAG_GSUB, nIdx,
+                        nullptr,  // glyphs before
+                        pGlyphs,  // glyphs input
+                        nullptr,  // glyphs after
+                        nullptr); // glyphs out
                 hb_set_union(mpVertGlyphs, pGlyphs);
             }
         }
@@ -516,16 +524,37 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
                 {
                     sal_Int32 nPrevIdx = nIdx;
                     sal_UCS4 aChar = rArgs.mrStr.iterateCodePoints(&nIdx);
-                    switch (vcl::GetVerticalOrientation(aChar))
+                    VerticalOrientation aVo = vcl::GetVerticalOrientation(aChar);
+
+                    sal_UCS4 aVariationSelector = 0;
+                    if (nIdx < nEndRunPos)
+                    {
+                        sal_Int32 nNextIdx = nIdx;
+                        sal_UCS4 aNextChar = rArgs.mrStr.iterateCodePoints(&nNextIdx);
+                        if (u_hasBinaryProperty(aNextChar, UCHAR_VARIATION_SELECTOR))
+                        {
+                            nIdx = nNextIdx;
+                            aVariationSelector = aNextChar;
+                        }
+                    }
+
+                    // Charters with U and Tu vertical orientation should
+                    // be shaped in vertical direction. But characters
+                    // with Tr should be shaped in vertical direction
+                    // only if they have vertical alternates, otherwise
+                    // they should be shaped in horizontal direction
+                    // and then rotated.
+                    // See http://unicode.org/reports/tr50/#vo
+                    if (aVo == VerticalOrientation::Upright ||
+                        aVo == VerticalOrientation::TransformedUpright ||
+                        (aVo == VerticalOrientation::TransformedRotated &&
+                         HasVerticalAlternate(aChar, aVariationSelector)))
                     {
-                    case VerticalOrientation::Upright:
-                    case VerticalOrientation::TransformedUpright:
-                    case VerticalOrientation::TransformedRotated:
                         aDirection = HB_DIRECTION_TTB;
-                        break;
-                    default:
+                    }
+                    else
+                    {
                         aDirection = bRightToLeft ? HB_DIRECTION_RTL : HB_DIRECTION_LTR;
-                        break;
                     }
 
                     if (aSubRuns.empty() || aSubRuns.back().maDirection != aDirection)
@@ -635,13 +664,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
                 DeviceCoordinate nAdvance, nXOffset, nYOffset;
                 if (aSubRun.maDirection == HB_DIRECTION_TTB)
                 {
-                    // If the vertical orientation is Tr, then we need to
-                    // consider the glyph upright only if it was a vertical
-                    // alternate (i.e. transformed).
-                    // See http://unicode.org/reports/tr50/#vo
-                    if (vcl::GetVerticalOrientation(aChar) != VerticalOrientation::TransformedRotated
-                    || IsVerticalAlternate(pHbGlyphInfos[i].codepoint))
-                        nGlyphIndex |= GF_ROTL;
+                    nGlyphIndex |= GF_ROTL;
 
                     nAdvance = -pHbPositions[i].y_advance;
                     nXOffset =  pHbPositions[i].y_offset;


More information about the Libreoffice-commits mailing list