[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - 14 commits - basctl/source configure.ac filter/source forms/source hwpfilter/source sc/source svl/source svx/source sw/source vcl/source

Andras Timar andras.timar at collabora.com
Mon Feb 27 10:26:10 UTC 2017


 basctl/source/basicide/moduldlg.cxx         |    4 -
 configure.ac                                |    2 
 filter/source/graphicfilter/itiff/itiff.cxx |   20 +++--
 forms/source/misc/InterfaceContainer.cxx    |   16 ++--
 hwpfilter/source/hiodev.cxx                 |    8 +-
 sc/source/core/data/dpoutput.cxx            |  112 +++++++++++++++++-----------
 sc/source/ui/navipi/navipi.cxx              |   28 +++++--
 svl/source/numbers/zformat.cxx              |   11 ++
 svx/source/accessibility/charmapacc.cxx     |   29 ++++---
 svx/source/inc/charmapacc.hxx               |    1 
 sw/source/filter/ww8/ww8graf2.cxx           |   27 +++++-
 sw/source/uibase/docvw/PostItMgr.cxx        |    2 
 vcl/source/window/dialog.cxx                |    2 
 vcl/source/window/menu.cxx                  |    2 
 14 files changed, 178 insertions(+), 86 deletions(-)

New commits:
commit 496438dbe45c4ef94c57a6bbc1d4fa286182efee
Author: Andras Timar <andras.timar at collabora.com>
Date:   Mon Feb 27 11:25:40 2017 +0100

    Bump version to 5.1-20
    
    Change-Id: I0d8c1307cd17871da3c23a2a5092b2c6fe2a820a

diff --git a/configure.ac b/configure.ac
index a9ff02b..b1b6ee0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
 
-AC_INIT([Collabora Office],[5.1.10.19],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[5.1.10.20],[],[],[https://collaboraoffice.com/])
 
 AC_PREREQ([2.59])
 
commit ae9a093683fc5176a0b6dfd848bcd2901a45b601
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 24 11:24:46 2017 +0200

    better fix for tdf#103830
    
    the first fix in commit 3a404ea870f1eed86f9765447ce0a364d39ae8f8
    did not take into account that this a multimap, not a map.
    
    Thanks to Aron Budea for spotting that.
    
    Change-Id: I86d2d2a9d6cb08fd3cee3965a5b787d5691f0352
    Reviewed-on: https://gerrit.libreoffice.org/34604
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit e146741ec96292ef092c6eebfd7fe18fa5ca3cc0)
    Reviewed-on: https://gerrit.libreoffice.org/34606
    (cherry picked from commit 46885644fe87a6e9f86a79b7fd1eafbe3ea0e5a6)
    Reviewed-on: https://gerrit.libreoffice.org/34611
    (cherry picked from commit 1f3ce5a00b2a85374204f3f05433d3cfd3292fe7)

diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index 383030b..2a679be 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -679,13 +679,15 @@ throw (css::uno::RuntimeException, std::exception) {
     if (evt.PropertyName == PROPERTY_NAME)
     {
         ::osl::MutexGuard aGuard( m_rMutex );
-        OInterfaceMap::iterator i = m_aMap.find(::comphelper::getString(evt.OldValue));
-        if (i != m_aMap.end() && i->second == evt.Source)
-        {
-            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));
-        }
+        auto range = m_aMap.equal_range(::comphelper::getString(evt.OldValue));
+        for (auto it = range.first; it != range.second; ++it)
+            if (it->second == evt.Source)
+            {
+                css::uno::Reference<css::uno::XInterface>  xCorrectType(it->second);
+                m_aMap.erase(it);
+                m_aMap.insert(::std::pair<const OUString, css::uno::Reference<css::uno::XInterface> >(::comphelper::getString(evt.NewValue),xCorrectType));
+                break;
+            }
     }
 }
 
commit 3196278cb0dba5d6cee22ffac86d00c6e96949c0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 23 12:17:33 2017 +0000

    ofz: don't loop endlessly on failed skip
    
    (cherry picked from commit a438651d2b94f14a2a0e54024f69280917df37b5)
    
    Change-Id: Ibc105d8156e1b1ddf22948fb02165f8d03b4cfd5
    Reviewed-on: https://gerrit.libreoffice.org/34608
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 0215845ddae1d0bb060a44d2cac0cf0f723024a5)

diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx
index b6195f0..74936b2 100644
--- a/hwpfilter/source/hiodev.cxx
+++ b/hwpfilter/source/hiodev.cxx
@@ -248,8 +248,12 @@ int HStreamIODev::skipBlock(int size)
           else{
                 int remain = size;
                 while(remain){
-                     if( remain > BUFSIZE )
-                          remain -= GZREAD(rBuf, BUFSIZE);
+                     if( remain > BUFSIZE ) {
+                          int read = GZREAD(rBuf, BUFSIZE);
+                          remain -= read;
+                          if (read != BUFSIZE)
+                              break;
+                     }
                      else{
                           remain -= GZREAD(rBuf, remain);
                           break;
commit 39bd07d63f9ca3a0bcff96051dd234e9fe6af381
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/34602
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit 858aa013061fb179e68c90a9dce6341a352b17c1)

diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index 63aee56..383030b 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -680,9 +680,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 2df0902dc403d7c01c0a7e571c8dfe102887e9c0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 23 11:01:00 2017 +0000

    ofz: don't read data that isn't there
    
    Change-Id: I7fdcb78bde8f650c1a57d34177d8993a6d8a0a2f
    (cherry picked from commit ee619fb344c7e8f491e09bd256df7f8567af9bef)
    
    improve scoping
    
    Change-Id: Ic79d46da4e322a0f52981c3a3df65f7f0294fdd8
    (cherry picked from commit 840ad0a88045021c58644404a099a3678a371020)
    
    make this a little clearer
    
    no logic change intended
    
    Change-Id: Ibfc46d0aba9e220be54270734e0cdfbc123be9a5
    (cherry picked from commit 46b1b5dd2a5368663fd56434160fa126f1a54d84)
    Reviewed-on: https://gerrit.libreoffice.org/34573
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 4c9383e1354be0954c5f7cf8906f334ae079baeb)

diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 4ba2db7..0e78457 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -788,7 +788,7 @@ sal_uLong TIFFReader::GetBits( const sal_uInt8 * pSrc, sal_uLong nBitsPos, sal_u
 
 bool TIFFReader::ConvertScanline(sal_Int32 nY)
 {
-    sal_uInt32  nRed, nGreen, nBlue, ns, nVal, nByteCount;
+    sal_uInt32  nRed, nGreen, nBlue, ns, nVal;
     sal_uInt8   nByteVal;
 
     if ( nDstBitsPerPixel == 24 )
@@ -999,11 +999,18 @@ bool TIFFReader::ConvertScanline(sal_Int32 nY)
 
                 case 1 :
                 {
+                    sal_uInt32 nByteCount = nImageWidth >> 3;
+
+                    sal_uInt32 nBytesNeeded = nByteCount;
+                    if (nImageWidth & 7)
+                        ++nBytesNeeded;
+                    if (pt + nBytesNeeded > ptend)
+                        return false;
+
                     if ( bByteSwap )
                     {
                         sal_Int32 nx = 0;
-                        nByteCount = ( nImageWidth >> 3 ) + 1;
-                        while ( --nByteCount )
+                        while (nByteCount--)
                         {
                             nByteVal = *pt++;
                             pAcc->SetPixelIndex( nY, nx++, nByteVal & 1 );
@@ -1035,8 +1042,7 @@ bool TIFFReader::ConvertScanline(sal_Int32 nY)
                     else
                     {
                         sal_Int32 nx = 7;
-                        nByteCount = ( nImageWidth >> 3 ) + 1;
-                        while ( --nByteCount )
+                        while (nByteCount--)
                         {
                             nByteVal = *pt++;
                             pAcc->SetPixelIndex( nY, nx, nByteVal & 1 );
commit 42097cef4095107a0e157ce04a04c0f0c22df6b2
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 2166fd06156c8f31948e755b5893911d93fcb6a2)

diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index aae8b86..4ba2db7 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -929,12 +929,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 672e74e57afc25c4733debf2d9b9379aa8fe9bf4
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Feb 17 14:10:37 2017 +0100

    Resolves: tdf#105858 check SC_DPOUT_MAXLEVELS to prevent crash
    
    Backported.
    
    This is a combination of 2 commits.
    
    Resolves: tdf#105858 check nDataCount<SC_DPOUT_MAXLEVELS to prevent crash
    
    (cherry picked from commit 9bdf971b0202c6d55d88e61861b251459de9586b)
    
    more counts<SC_DPOUT_MAXLEVELS to check, tdf#105858 related
    
    Also for row, column and page field arrays.
    
    (cherry picked from commit 7fbdd8b7d3741d55b229977f9e6d6213af5fa542)
    
    1dccdf139af778a2c0dc550be0b573c984256a2d
    
    Change-Id: If9084543a0a191d08da37b5b8a187bce46440871
    Reviewed-on: https://gerrit.libreoffice.org/34370
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit cbba64225a2abfdd8b2437e8a06925b15fb15d26)

diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index f11964f..de9066a 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -344,9 +344,10 @@ void lcl_FillNumberFormats( sal_uInt32*& rFormats, long& rCount,
 
     OUString aDataNames[SC_DPOUT_MAXLEVELS];
     sal_uInt32 nDataFormats[SC_DPOUT_MAXLEVELS];
-    long nDataCount = 0;
-    long nDimCount = xDims->getCount();
-    for (long nDim=0; nDim<nDimCount; nDim++)
+    size_t nDataCount = 0;
+    sal_Int32 nDimCount = xDims->getCount();
+    sal_Int32 nDim = 0;
+    for ( ; nDim < nDimCount && nDataCount < SC_DPOUT_MAXLEVELS; nDim++)
     {
         uno::Reference<uno::XInterface> xDim =
                 ScUnoHelpFunctions::AnyToInterface( xDims->getByIndex(nDim) );
@@ -369,6 +370,8 @@ void lcl_FillNumberFormats( sal_uInt32*& rFormats, long& rCount,
             }
         }
     }
+    SAL_WARN_IF( nDim < nDimCount && nDataCount == SC_DPOUT_MAXLEVELS, "sc.core",
+            "lcl_FillNumberFormats - may have lost an output level due to SC_DPOUT_MAXLEVELS=" << SC_DPOUT_MAXLEVELS);
 
     if (!nDataCount)
         return;
@@ -394,7 +397,7 @@ void lcl_FillNumberFormats( sal_uInt32*& rFormats, long& rCount,
                 aName = pArray[nPos].Name;
 
             sal_uInt32 nFormat = 0;
-            for (long i=0; i<nDataCount; i++)
+            for (size_t i=0; i<nDataCount; i++)
                 if (aName == aDataNames[i])         //TODO: search more efficiently?
                 {
                     nFormat = nDataFormats[i];
@@ -606,50 +609,71 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
                                 switch ( eDimOrient )
                                 {
                                     case sheet::DataPilotFieldOrientation_COLUMN:
-                                        pColFields[nColFieldCount].nDim    = nDim;
-                                        pColFields[nColFieldCount].nHier   = nHierarchy;
-                                        pColFields[nColFieldCount].nLevel  = nLev;
-                                        pColFields[nColFieldCount].nDimPos = nDimPos;
-                                        pColFields[nColFieldCount].aResult = xLevRes->getResults();
-                                        pColFields[nColFieldCount].mnSrcNumFmt = nNumFmt;
-                                        pColFields[nColFieldCount].maName  = aName;
-                                        pColFields[nColFieldCount].maCaption= aCaption;
-                                        pColFields[nColFieldCount].mbHasHiddenMember = bHasHiddenMember;
-                                        pColFields[nColFieldCount].mbDataLayout = bIsDataLayout;
-                                        if (!lcl_MemberEmpty(pColFields[nColFieldCount].aResult))
-                                            ++nColFieldCount;
-                                        break;
+                                        if (nColFieldCount < SC_DPOUT_MAXLEVELS)
+                                        {
+                                            pColFields[nColFieldCount].nDim    = nDim;
+                                            pColFields[nColFieldCount].nHier   = nHierarchy;
+                                            pColFields[nColFieldCount].nLevel  = nLev;
+                                            pColFields[nColFieldCount].nDimPos = nDimPos;
+                                            pColFields[nColFieldCount].aResult = xLevRes->getResults();
+                                            pColFields[nColFieldCount].mnSrcNumFmt = nNumFmt;
+                                            pColFields[nColFieldCount].maName  = aName;
+                                            pColFields[nColFieldCount].maCaption= aCaption;
+                                            pColFields[nColFieldCount].mbHasHiddenMember = bHasHiddenMember;
+                                            pColFields[nColFieldCount].mbDataLayout = bIsDataLayout;
+                                            if (!lcl_MemberEmpty(pColFields[nColFieldCount].aResult))
+                                                ++nColFieldCount;
+                                        }
+                                        else
+                                        {
+                                            SAL_WARN("sc.core","ScDPOutput - nColFieldCount already at SC_DPOUT_MAXLEVELS=" << SC_DPOUT_MAXLEVELS);
+                                        }
+                                    break;
                                     case sheet::DataPilotFieldOrientation_ROW:
-                                        pRowFields[nRowFieldCount].nDim    = nDim;
-                                        pRowFields[nRowFieldCount].nHier   = nHierarchy;
-                                        pRowFields[nRowFieldCount].nLevel  = nLev;
-                                        pRowFields[nRowFieldCount].nDimPos = nDimPos;
-                                        pRowFields[nRowFieldCount].aResult = xLevRes->getResults();
-                                        pRowFields[nRowFieldCount].mnSrcNumFmt = nNumFmt;
-                                        pRowFields[nRowFieldCount].maName  = aName;
-                                        pRowFields[nRowFieldCount].maCaption= aCaption;
-                                        pRowFields[nRowFieldCount].mbHasHiddenMember = bHasHiddenMember;
-                                        pRowFields[nRowFieldCount].mbDataLayout = bIsDataLayout;
-                                        if (!lcl_MemberEmpty(pRowFields[nRowFieldCount].aResult))
+                                        if (nRowFieldCount < SC_DPOUT_MAXLEVELS)
                                         {
-                                            ++nRowFieldCount;
-                                            bRowFieldHasMember = true;
+                                            pRowFields[nRowFieldCount].nDim    = nDim;
+                                            pRowFields[nRowFieldCount].nHier   = nHierarchy;
+                                            pRowFields[nRowFieldCount].nLevel  = nLev;
+                                            pRowFields[nRowFieldCount].nDimPos = nDimPos;
+                                            pRowFields[nRowFieldCount].aResult = xLevRes->getResults();
+                                            pRowFields[nRowFieldCount].mnSrcNumFmt = nNumFmt;
+                                            pRowFields[nRowFieldCount].maName  = aName;
+                                            pRowFields[nRowFieldCount].maCaption= aCaption;
+                                            pRowFields[nRowFieldCount].mbHasHiddenMember = bHasHiddenMember;
+                                            pRowFields[nRowFieldCount].mbDataLayout = bIsDataLayout;
+                                            if (!lcl_MemberEmpty(pRowFields[nRowFieldCount].aResult))
+                                            {
+                                                ++nRowFieldCount;
+                                                bRowFieldHasMember = true;
+                                            }
                                         }
-                                        break;
+                                        else
+                                        {
+                                            SAL_WARN("sc.core","ScDPOutput - nRowFieldCount already at SC_DPOUT_MAXLEVELS=" << SC_DPOUT_MAXLEVELS);
+                                        }
+                                    break;
                                     case sheet::DataPilotFieldOrientation_PAGE:
-                                        pPageFields[nPageFieldCount].nDim    = nDim;
-                                        pPageFields[nPageFieldCount].nHier   = nHierarchy;
-                                        pPageFields[nPageFieldCount].nLevel  = nLev;
-                                        pPageFields[nPageFieldCount].nDimPos = nDimPos;
-                                        pPageFields[nPageFieldCount].aResult = getVisiblePageMembersAsResults(xLevel);
-                                        pPageFields[nPageFieldCount].mnSrcNumFmt = nNumFmt;
-                                        pPageFields[nPageFieldCount].maName  = aName;
-                                        pPageFields[nPageFieldCount].maCaption= aCaption;
-                                        pPageFields[nPageFieldCount].mbHasHiddenMember = bHasHiddenMember;
-                                        pPageFields[nPageFieldCount].mbPageDim = true;
-                                        // no check on results for page fields
-                                        ++nPageFieldCount;
-                                        break;
+                                        if (nPageFieldCount < SC_DPOUT_MAXLEVELS)
+                                        {
+                                            pPageFields[nPageFieldCount].nDim    = nDim;
+                                            pPageFields[nPageFieldCount].nHier   = nHierarchy;
+                                            pPageFields[nPageFieldCount].nLevel  = nLev;
+                                            pPageFields[nPageFieldCount].nDimPos = nDimPos;
+                                            pPageFields[nPageFieldCount].aResult = getVisiblePageMembersAsResults(xLevel);
+                                            pPageFields[nPageFieldCount].mnSrcNumFmt = nNumFmt;
+                                            pPageFields[nPageFieldCount].maName  = aName;
+                                            pPageFields[nPageFieldCount].maCaption= aCaption;
+                                            pPageFields[nPageFieldCount].mbHasHiddenMember = bHasHiddenMember;
+                                            pPageFields[nPageFieldCount].mbPageDim = true;
+                                            // no check on results for page fields
+                                            ++nPageFieldCount;
+                                        }
+                                        else
+                                        {
+                                            SAL_WARN("sc.core","ScDPOutput - nPageFieldCount already at SC_DPOUT_MAXLEVELS=" << SC_DPOUT_MAXLEVELS);
+                                        }
+                                    break;
                                     default:
                                     {
                                         // added to avoid warnings
commit 94deed90a02430d7c0c9f1a55976c379a66a99ce
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 15 14:28:55 2017 +0000

    Resolves: tdf#101000 ensure unique image names in .docs
    
    (cherry picked from commit 432f605e3287269d1a20383f4eeebf012ee3679d)
    
    Change-Id: Id4f93638ad366b66968e6946a835239beee16942
    Reviewed-on: https://gerrit.libreoffice.org/34303
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 94037ee2e6b85006373d1c4cecfcb32f4c82bb9e)

diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 2359989..73b4e4e 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -30,8 +30,9 @@
 #include <sfx2/docfile.hxx>
 #include <sfx2/fcontnr.hxx>
 #include <grfatr.hxx>
-#include <fmtflcnt.hxx>
 #include <fmtanchr.hxx>
+#include <fmtcntnt.hxx>
+#include <fmtflcnt.hxx>
 #include <frmfmt.hxx>
 #include <fltshell.hxx>
 #include <pam.hxx>
@@ -456,6 +457,19 @@ void SwWW8ImplReader::PicRead(SvStream *pDataStream, WW8_PIC *pPic,
         pDataStream->SeekRel(2);  //cProps
 }
 
+namespace
+{
+    sal_uInt8 GetNodeType(SwFrameFormat &rSource)
+    {
+        const SwNodeIndex* pNodeIndex = rSource.GetContent().GetContentIdx();
+        if (!pNodeIndex)
+            return 0;
+        const SwNode& rCSttNd = pNodeIndex->GetNode();
+        SwNodeRange aRg(rCSttNd, 1, *rCSttNd.EndOfSectionNode());
+        return aRg.aStart.GetNode().GetNodeType();
+    }
+}
+
 SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
     SwFrameFormat* pOldFlyFormat)
 {
@@ -672,12 +686,11 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
                     if (pRecord)
                         SetAttributesAtGrfNode(pRecord, pRet, nullptr);
 
-                    // #i68101#
-                    // removed pObject->HasSetName() usage since always returned
-                    // true, also removed else-part and wrote an informing mail
-                    // to Henning Brinkmann about this to clarify.
-                    pRet->SetName(pObject->GetName());
-
+                    OUString aObjectName(pObject->GetName());
+                    if (aObjectName.isEmpty() || !m_rDoc.FindFlyByName(aObjectName, GetNodeType(*pRet)))
+                        pRet->SetName(aObjectName);
+                    else
+                        m_aGrfNameGenerator.SetUniqueGraphName(pRet, aObjectName);
 
                     // determine the pointer to the new object and update
                     // Z-order-list accordingly (or delete entry)
commit d566d2a32fe6514c15c3c74d635c70c1015cb187
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Feb 15 22:01:51 2017 +0100

    Resolves: tdf#105968 handle engineering notation rounded into next magnitude
    
    Change-Id: Ie31ab88543994f0e8aeef8152c230c05e071ef8e
    (cherry picked from commit 63bc2b13cb344cce99348496838d7d2c2f690211)
    Reviewed-on: https://gerrit.libreoffice.org/34322
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 1e026b88662494df52e4c3eb372ee29e9f30c4f4)

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 6050716..2078b2c 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2376,11 +2376,22 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber,
                 nExpSign = 1;
             }
             ExpStr = OUString::number( nExp );
+            const sal_Unicode cFirstDigit = sStr[0];
             // rescale mantissa
             sStr = ::rtl::math::doubleToUString( fNumber,
                                          rtl_math_StringFormat_E,
                                          nRescale + rInfo.nCntPost, '.' );
+
+            // sStr now may contain a rounded-up value shifted into the next
+            // magnitude, for example 1.000E+02 (4 digits) for fNumber 99.995
+            // (9.9995E+02 rounded to 3 decimals) but we want the final result
+            // to be 100.00E+00 (5 digits), so for the following fill routines
+            // below to work correctly append a zero decimal.
+            /* TODO: this is awkward, could an engineering notation mode be
+             * introduced to rtl_math_doubleToUString()? */
             sStr.truncate( sStr.indexOf('E') );
+            if (sStr[0] == '1' && cFirstDigit != '1')
+                sStr.append('0');
         }
 
         // cut any decimal delimiter
commit 7e6d7a4474feeeff5fb406e1e3caf6113f31205b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 15 16:52:53 2017 +0000

    Related: tdf#105712 inconsistency with num of a11y children in special char
    
    with no visible scrollbar it claims 1 child, but trying to get child at
    index 0 throws
    
    (cherry picked from commit b3098d239f46c8d5965754f275bc62216dcb4f4f)
    
    Change-Id: Icf1a0afc4a6f6090e3f14f30b4380db477955561
    Reviewed-on: https://gerrit.libreoffice.org/34314
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 2247313b0aec80306e7f67926810cf004d5b4d1d)

diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx
index 3e5ec9e..e38a4ac 100644
--- a/svx/source/accessibility/charmapacc.cxx
+++ b/svx/source/accessibility/charmapacc.cxx
@@ -73,11 +73,16 @@ void SAL_CALL SvxShowCharSetVirtualAcc::fireEvent(
         m_pTable->fireEvent(_nEventId,_rOldValue,_rNewValue);
 }
 
-sal_Int32 SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChildCount(  ) throw (RuntimeException, std::exception)
+sal_Int32 SvxShowCharSetVirtualAcc::getImplAccessibleChildCount() const
+{
+    return mpParent->getScrollBar().IsVisible() ? 2 : 1;
+}
+
+sal_Int32 SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChildCount() throw (RuntimeException, std::exception)
 {
     OExternalLockGuard aGuard( this );
     ensureAlive();
-    return ( mpParent->getScrollBar().IsVisible() ) ? 2 : 1;
+    return getImplAccessibleChildCount();
 }
 
 uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleAtPoint( const awt::Point& aPoint )
@@ -119,18 +124,20 @@ Reference< XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChild(
 {
     OExternalLockGuard aGuard( this );
     ensureAlive();
-    if ( mpParent->getScrollBar().IsVisible() && i == 0 )
+
+    sal_Int32 nCount = getImplAccessibleChildCount();
+    if (i >= nCount)
+        throw IndexOutOfBoundsException();
+
+    if (i == 0 && mpParent->getScrollBar().IsVisible())
         return mpParent->getScrollBar().GetAccessible();
-    else if ( i == 1 )
+
+    if ( !m_xAcc.is() )
     {
-        if ( !m_xAcc.is() )
-        {
-            m_pTable = new SvxShowCharSetAcc(this);
-            m_xAcc = m_pTable;
-        }
+        m_pTable = new SvxShowCharSetAcc(this);
+        m_xAcc = m_pTable;
     }
-    else
-        throw IndexOutOfBoundsException();
+
     return m_xAcc;
 }
 
diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx
index 2169e96..bfb4fb7 100644
--- a/svx/source/inc/charmapacc.hxx
+++ b/svx/source/inc/charmapacc.hxx
@@ -44,6 +44,7 @@ namespace svx
         VclPtr<SvxShowCharSet>     mpParent; // the vcl control
         SvxShowCharSetAcc*  m_pTable; // the table, which holds the characters shown by the vcl control
         css::uno::Reference< css::accessibility::XAccessible > m_xAcc; // the ref to the table
+        sal_Int32 getImplAccessibleChildCount() const;
     protected:
         virtual ~SvxShowCharSetVirtualAcc();
 
commit a4e318ba7b4245e2047f5702c8c2d646375e27d1
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue Feb 14 21:00:45 2017 +0100

    tdf#105386: crash with macro organizer
    
    bt part:
    0  SvTreeList::GetParent (this=0x560670dd2e40, pEntry=pEntry at entry=0x0) at /home/julien/lo/libreoffice/svtools/source/contnr/treelist.cxx:1693
    1  0x00007fd90573298c in SvTreeListBox::GetParent (this=this at entry=0x560670dd0d60, pEntry=pEntry at entry=0x0)
        at /home/julien/lo/libreoffice/svtools/source/contnr/treelistbox.cxx:779
    2  0x00007fd8dfc3b4d8 in basctl::ExtTreeListBox::NotifyAcceptDrop (this=0x560670dd0d60, pEntry=0x560670e90b20)
        at /home/julien/lo/libreoffice/basctl/source/basicide/moduldlg.cxx:180
    
    Change-Id: I033440c1fcc50e2c7a0bb1eed0efa4559c514126
    Reviewed-on: https://gerrit.libreoffice.org/34280
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 18be4782ad4a98041d9680f8d76a213b8fd49362)
    Reviewed-on: https://gerrit.libreoffice.org/34287
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit effeccd268305a2d3537cc89e4e35f682505afcb)
    Reviewed-on: https://gerrit.libreoffice.org/34292
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 31d786ecd6a4e5d56ac96b33085b3ba7dcf42439)

diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 894613d..56c07f7 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -184,7 +184,9 @@ bool ExtTreeListBox::NotifyAcceptDrop( SvTreeListEntry* pEntry )
 
     // don't drop in the same library
     SvTreeListEntry* pSelected = FirstSelected();
-    if ( ( nDepth == 1 ) && ( pEntry == GetParent( pSelected ) ) )
+    if (!pSelected)
+        bValid = false;
+    else if ( ( nDepth == 1 ) && ( pEntry == GetParent( pSelected ) ) )
         bValid = false;
     else if ( ( nDepth == 2 ) && ( GetParent( pEntry ) == GetParent( pSelected ) ) )
         bValid = false;
commit 2929edb35c11be93c733755955f200f95c7aecb4
Author: sll <trtle at yahoo.com>
Date:   Tue Sep 6 18:18:02 2016 +0200

    tdf#98493 UI : "SCENARIO SELECTION IN NAVIGATOR (sheet group)"
    
    Change-Id: I71071ba71ce05487273ce66e64f930cd2ec7b8d0
    Reviewed-on: https://gerrit.libreoffice.org/28697
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit 1eebbd48fabbefaa52f5f223649c8d591915a884)
    Reviewed-on: https://gerrit.libreoffice.org/33953
    Reviewed-by: Jean-Sébastien B. <realitix at gmail.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 95c1c7d3b085541735f964ac3c1fff9d286baa16)

diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index bc9e495..004ab04 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -958,16 +958,32 @@ void ScNavigatorDlg::SetCurrentTableStr( const OUString& rName )
     if (!GetViewData()) return;
 
     ScDocument* pDoc = pViewData->GetDocument();
-    SCTAB nCount     = pDoc->GetTableCount();
+    SCTAB nCount = pDoc->GetTableCount();
     OUString aTabName;
+    SCTAB nLastSheet = 0;
 
-    for ( SCTAB i=0; i<nCount; i++ )
+    for (SCTAB i = 0; i<nCount; i++)
     {
-        pDoc->GetName( i, aTabName );
-        if ( aTabName.equals(rName) )
+        pDoc->GetName(i, aTabName);
+        if (aTabName.equals(rName))
         {
-            SetCurrentTable( i );
-            return;
+            // Check if this is a Scenario sheet and if so select the sheet
+            // where it belongs to, which is the previous non-Scenario sheet.
+            if (pDoc->IsScenario(i))
+            {
+                SetCurrentTable(nLastSheet);
+                return;
+            }
+            else
+            {
+                SetCurrentTable(i);
+                return;
+            }
+        }
+        else
+        {
+            if (!pDoc->IsScenario(i))
+                nLastSheet = i;
         }
     }
 }
commit 97383ea5abc6d312984647a2ce2094b208454032
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Feb 9 21:33:24 2017 +0100

    tdf#91596 sw: make Format All Comments persistent
    
    Change-Id: I8f9a20084d2dc8abd7699f64307b81321699498c
    (cherry picked from commit bd269f902b86ecb5dde0043838be14c867ee8bec)
    Reviewed-on: https://gerrit.libreoffice.org/34106
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 3d507dbcd08e07af3ae6e7f5f0962e5422187087)

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 4509bee..2ef2e58 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1478,6 +1478,8 @@ void SwPostItMgr::FormatAll(const SfxItemSet &rNewAttr)
         pOLV->SetAttribs(rNewAttr);
         //restore old selection
         pOLV->SetSelection(aOrigSel);
+        // tdf#91596 store updated formatting in SwField
+        (*i)->pPostIt->UpdateData();
     }
 
     mpWrtShell->EndUndo();
commit 6082d5ca8f398e9de07ed2329c4b6e728d2b7d7a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 9 10:26:05 2017 +0000

    Resolves: tdf#101972 skip invalidating labels on alt if autoaccel is disabled
    
    so no Invalidate will be called if auto accelerators are not enabled
    so there should be no blinking under windows
    
    (cherry picked from commit f67dc04cfdd9e63a45ec6c8bc00829bce8f17d4b)
    
    Change-Id: Iccc5dad7af41f39ac02d3be93e935f2d926a82a6
    Reviewed-on: https://gerrit.libreoffice.org/34077
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 0d8746c091ce3e70340c431da8d35d453d2b3b2c)

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 8b70c2e..c01b237 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -599,7 +599,7 @@ IMPL_LINK_NOARG_TYPED(Dialog, ImplAsyncCloseHdl, void*, void)
 
 bool Dialog::ImplHandleCmdEvent( const CommandEvent& rCEvent )
 {
-    if (rCEvent.GetCommand() == CommandEventId::ModKeyChange)
+    if (rCEvent.GetCommand() == CommandEventId::ModKeyChange && ImplGetSVData()->maNWFData.mbAutoAccel)
     {
         const CommandModKeyData *pCData = rCEvent.GetModKeyData ();
         bool bShowAccel =  pCData && pCData->IsMod2();
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 89593b5..da7213e 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2632,7 +2632,7 @@ bool MenuBar::ImplHandleCmdEvent( const CommandEvent& rCEvent )
     MenuBarWindow* pWin = static_cast<MenuBarWindow*>(ImplGetWindow());
     if ( pWin && pWin->IsEnabled() && pWin->IsInputEnabled()  && ! pWin->IsInModalMode() )
     {
-        if (rCEvent.GetCommand() == CommandEventId::ModKeyChange)
+        if (rCEvent.GetCommand() == CommandEventId::ModKeyChange && ImplGetSVData()->maNWFData.mbAutoAccel)
         {
             const CommandModKeyData* pCData = rCEvent.GetModKeyData ();
             if (pWin->nHighlightedItem == ITEMPOS_INVALID)


More information about the Libreoffice-commits mailing list