[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 11 commits - sc/qa sc/source sd/source solenv/gbuild svl/source svx/source sw/source vcl/unx

Noel Grandin noel.grandin at collabora.co.uk
Mon Jun 11 13:17:49 UTC 2018


 sc/qa/unit/subsequent_export-test.cxx  |   16 ++++++++++++
 sc/source/core/data/table2.cxx         |    3 ++
 sc/source/core/tool/compiler.cxx       |    9 ++++++-
 sc/source/filter/html/htmlimp.cxx      |    2 +
 sd/source/ui/view/drviews2.cxx         |    2 +
 solenv/gbuild/platform/com_GCC_defs.mk |   11 ++++++++
 svl/source/numbers/zforscan.cxx        |   42 +++++++++++++++++++++++++--------
 svl/source/numbers/zforscan.hxx        |   11 +++++++-
 svx/source/dialog/charmap.cxx          |    3 +-
 svx/source/tbxctrls/tbcontrl.cxx       |    8 +++++-
 sw/source/core/layout/trvlfrm.cxx      |    6 +++-
 sw/source/uibase/dbui/dbmgr.cxx        |   20 +++++++++++++++
 vcl/unx/generic/gdi/salgdi.cxx         |    3 ++
 13 files changed, 119 insertions(+), 17 deletions(-)

New commits:
commit e555c7ca78e3ea4d0abcbe8ca7bdc0dba7b464b1
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jun 11 08:47:47 2018 +0200

    tdf#102907 selection indicator missing on vertical text
    
    regression from
    
        commit 79800559268c636740fec69018b1f99f047c3f93
        convert MT_ constants to scoped enum
    
    The original code used bit-wise operations and some clever constant
    values, which I did not convert correctly
    
    Change-Id: I2fcd9e2584638d4a690773ef3f178415153b8b19
    Reviewed-on: https://gerrit.libreoffice.org/55596
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit 16b1d80070142e2ffecaba64b62dbe836daafb4f)
    Reviewed-on: https://gerrit.libreoffice.org/55599
    (cherry picked from commit 97cac82274698cc48b20d010983803e385264a85)

diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 2b9cd10d1111..cb9093daeddf 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2245,7 +2245,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
             Sub( aRegion, aTmp );
 
             // The next statement means neither ruby nor rotate(90):
-            if( MultiPortionType::RUBY != pEnd2Pos->nMultiType )
+            if( MultiPortionType::RUBY != pEnd2Pos->nMultiType && MultiPortionType::ROT_90 != pEnd2Pos->nMultiType )
             {
                 SwTwips nTmp = fnRectX.GetTop(pEnd2Pos->aLine);
                 if( fnRectX.GetTop(aEndRect) != nTmp )
@@ -2340,7 +2340,9 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
     if( pStartFrame == pEndFrame )
     {
         bool bSameRotatedOrBidi = pSt2Pos && pEnd2Pos &&
-            ( MultiPortionType::BIDI == pSt2Pos->nMultiType ) &&
+            ( MultiPortionType::BIDI == pSt2Pos->nMultiType  ||
+              MultiPortionType::ROT_270 == pSt2Pos->nMultiType ||
+              MultiPortionType::ROT_90  == pSt2Pos->nMultiType ) &&
             pSt2Pos->aPortion == pEnd2Pos->aPortion;
         //case 1: (Same frame and same row)
         if( bSameRotatedOrBidi ||
commit fdf33e7f00e8d7e90183a89de54e36c4ec615f90
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 6 12:59:58 2018 +0100

    tdf#117824 switch embedded database storage away from doc on revoke
    
    otherwise the database document still has the embedded storage
    open when the attempt to remove the storage is made
    
    Change-Id: Ie313923b969bdbc53b27b00e379ac20240ffb6e3
    Reviewed-on: https://gerrit.libreoffice.org/55388
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit a432a2e481baffa77e6f25584efbfbb3b68bc9a6)
    Reviewed-on: https://gerrit.libreoffice.org/55407
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 9ae93085c90bdd00bcbf796ab399154bb7ab9e39)

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index a5269e241dd4..861504c28031 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -100,6 +100,7 @@
 #include <com/sun/star/mail/MailAttachment.hpp>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/property.hxx>
+#include <comphelper/storagehelper.hxx>
 #include <comphelper/string.hxx>
 #include <comphelper/types.hxx>
 #include <mailmergehelper.hxx>
@@ -2916,11 +2917,30 @@ OUString SwDBManager::LoadAndRegisterDataSource(const OUString &rURI, const OUSt
     return LoadAndRegisterDataSource_Impl( DBConnURIType::UNKNOWN, nullptr, INetURLObject(rURI), nullptr, pDestDir, nullptr );
 }
 
+namespace
+{
+    // tdf#117824 switch the embedded database away from using its current storage and point it to temporary storage
+    // which allows the original storage to be deleted
+    void switchEmbeddedDatabaseStorage(uno::Reference<sdb::XDatabaseContext>& rDatabaseContext, const OUString& rName)
+    {
+        uno::Reference<sdb::XDocumentDataSource> xDS(rDatabaseContext->getByName(rName), uno::UNO_QUERY);
+        if (!xDS)
+            return;
+        uno::Reference<document::XStorageBasedDocument> xStorageDoc(xDS->getDatabaseDocument(), uno::UNO_QUERY);
+        if (!xStorageDoc)
+            return;
+        xStorageDoc->switchToStorage(comphelper::OStorageHelper::GetTemporaryStorage());
+    }
+}
+
 void SwDBManager::RevokeDataSource(const OUString& rName)
 {
     uno::Reference<sdb::XDatabaseContext> xDatabaseContext = sdb::DatabaseContext::create(comphelper::getProcessComponentContext());
     if (xDatabaseContext->hasByName(rName))
+    {
+        switchEmbeddedDatabaseStorage(xDatabaseContext, rName);
         xDatabaseContext->revokeObject(rName);
+    }
 }
 
 void SwDBManager::LoadAndRegisterEmbeddedDataSource(const SwDBData& rData, const SwDocShell& rDocShell)
commit 92f0922f320d7cb1cb1e735d2c20dd4f1ec0705d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 5 10:59:23 2018 +0100

    tdf#117940 setting resize shape while text edit active not recorded in undo
    
    Change-Id: I0887a1caea96f3efe897c304cde0520d59da6c59
    Reviewed-on: https://gerrit.libreoffice.org/55326
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 66b4e7ee179cba8ec2f1229ebc6eb48343fae72a)

diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 5229738d1b65..ce5f339326e7 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1650,6 +1650,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
         case SID_TEXTATTR_DLG:
         {
+            if (mpDrawView->IsTextEdit())
+                mpDrawView->SdrEndTextEdit();
             SetCurrentFunction( FuTextAttrDlg::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
             Cancel();
             rReq.Ignore ();
commit 5d2b21e9473fa6ca88eb126a5c22f62fe5207e07
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 5 16:49:11 2018 +0100

    Resolves: tdf#116876 don't reselect index on resize if it wouldn't change
    
    selecting the index sets it as active and updates the previews, so if its an
    inactive index and resize happens, leave it as inactive but selected
    
    Change-Id: If823f6b3e8f2ee4e77ba5e5d0202d72893ed614c
    Reviewed-on: https://gerrit.libreoffice.org/55346
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 63e1546668ac464d1ba0b02ba5e76fb064e63100)

diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 9fc4f3f66a8b..7a57199e2d87 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -758,7 +758,8 @@ void SvxShowCharSet::RecalculateFont(vcl::RenderContext& rRenderContext)
 
     // restore last selected unicode
     int nMapIndex = mxFontCharMap->GetIndexFromChar(getSelectedChar());
-    SelectIndex(nMapIndex);
+    if (nMapIndex != nSelectedIndex)
+        SelectIndex(nMapIndex);
 
     aVscrollSB->Show();
 
commit 478d0f5c2349fe32bf2221cd83b6f6ea3dd02fd5
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Jun 4 20:06:49 2018 +0200

    Handle English vs locale's General keyword, tdf#33689 follow-up, tdf#107867
    
    Caller of ImpSvNumberformatScan::GetKeyWord() needs to know if
    English or locale's keyword was found and act on it.
    
    Pointed out by an assert when attempting to copy "STANDARD" length
    characters (8) from "General" (7), which doesn't harm because when
    not in debug it copied the terminating 0-character. However, the
    keyword name also needs to be replaced for the locale's resulting
    format code.
    
    Change-Id: Ia5211b307ea44c1ba9c2b86786368355c570d4a2
    Reviewed-on: https://gerrit.libreoffice.org/55293
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit bfe6e9ecb18e8a3d9da368a1eb48e807ab9041cf)
    Reviewed-on: https://gerrit.libreoffice.org/55298
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit b203abbc50e57105bca654d024b30f7fff129456)

diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index da88794a40cf..0b2fe7ecca28 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -680,17 +680,21 @@ Color* ImpSvNumberformatScan::GetColor(OUString& sStr)
     return pResult;
 }
 
-short ImpSvNumberformatScan::GetKeyWord( const OUString& sSymbol, sal_Int32 nPos ) const
+short ImpSvNumberformatScan::GetKeyWord( const OUString& sSymbol, sal_Int32 nPos, bool& rbFoundEnglish ) const
 {
     OUString sString = pFormatter->GetCharClass()->uppercase( sSymbol, nPos, sSymbol.getLength() - nPos );
     const NfKeywordTable & rKeyword = GetKeywords();
     // #77026# for the Xcl perverts: the GENERAL keyword is recognized anywhere
-    if ( sString.startsWith( rKeyword[NF_KEY_GENERAL] ) ||
-            ((meKeywordLocalization == KeywordLocalization::AllowEnglish) &&
-             sString.startsWith( sEnglishKeyword[NF_KEY_GENERAL])))
+    if (sString.startsWith( rKeyword[NF_KEY_GENERAL] ))
     {
         return NF_KEY_GENERAL;
     }
+    if ((meKeywordLocalization == KeywordLocalization::AllowEnglish) &&
+            sString.startsWith( sEnglishKeyword[NF_KEY_GENERAL]))
+    {
+        rbFoundEnglish = true;
+        return NF_KEY_GENERAL;
+    }
     //! MUST be a reverse search to find longer strings first
     short i = NF_KEYWORD_ENTRIES_COUNT-1;
     bool bFound = false;
@@ -746,6 +750,7 @@ short ImpSvNumberformatScan::GetKeyWord( const OUString& sSymbol, sal_Int32 nPos
                 }
                 if ( j && sEnglishKeyword[j].getLength() > sEnglishKeyword[i].getLength() )
                 {
+                    rbFoundEnglish = true;
                     return j;
                 }
             }
@@ -911,7 +916,8 @@ short ImpSvNumberformatScan::Next_Symbol( const OUString& rStr,
                 }
                 else if ( pChrCls->isLetter( rStr, nPos-1 ) )
                 {
-                    short nTmpType = GetKeyWord( rStr, nPos-1 );
+                    bool bFoundEnglish = false;
+                    short nTmpType = GetKeyWord( rStr, nPos-1, bFoundEnglish);
                     if ( nTmpType )
                     {
                         bool bCurrency = false;
@@ -919,7 +925,7 @@ short ImpSvNumberformatScan::Next_Symbol( const OUString& rStr,
                         // like "R" (Rand) and 'R' (era)
                         if ( nCurrPos >= 0 &&
                              nPos-1 + sCurString.getLength() <= rStr.getLength() &&
-                             sCurString.startsWith( sKeyword[nTmpType] ) )
+                             sCurString.startsWith( bFoundEnglish ? sEnglishKeyword[nTmpType] : sKeyword[nTmpType]))
                         {
                             OUString aTest = pChrCls->uppercase( rStr.copy( nPos-1, sCurString.getLength() ) );
                             if ( aTest == sCurString )
@@ -935,8 +941,22 @@ short ImpSvNumberformatScan::Next_Symbol( const OUString& rStr,
                         else
                         {
                             eType = nTmpType;
-                            sal_Int32 nLen = sKeyword[eType].getLength();
-                            sSymbol = rStr.copy( nPos-1, nLen );
+                            // The code to be advanced is the detected keyword,
+                            // not necessarily the locale's keyword, but the
+                            // symbol is to be the locale's keyword.
+                            sal_Int32 nLen;
+                            if (bFoundEnglish)
+                            {
+                                nLen = sEnglishKeyword[eType].getLength();
+                                // Use the locale's General keyword name, not uppercase.
+                                sSymbol = (eType == NF_KEY_GENERAL ? sNameStandardFormat : sKeyword[eType]);
+                            }
+                            else
+                            {
+                                nLen = sKeyword[eType].getLength();
+                                // Preserve a locale's keyword's case as entered.
+                                sSymbol = rStr.copy( nPos-1, nLen);
+                            }
                             if ((eType == NF_KEY_E || IsAmbiguousE(eType)) && nPos < rStr.getLength())
                             {
                                 sal_Unicode cNext = rStr[nPos];
@@ -988,7 +1008,8 @@ short ImpSvNumberformatScan::Next_Symbol( const OUString& rStr,
         case SsGetWord:
             if ( pChrCls->isLetter( rStr, nPos-1 ) )
             {
-                short nTmpType = GetKeyWord( rStr, nPos-1 );
+                bool bFoundEnglish = false;
+                short nTmpType = GetKeyWord( rStr, nPos-1, bFoundEnglish);
                 if ( nTmpType )
                 {
                     // beginning of keyword, stop scan and put back
@@ -3083,7 +3104,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
                 sal_Int32 nLen = rStr.getLength();
                 for ( sal_Int32 j = 0; j < nLen; j++ )
                 {
-                    if ( (j == 0 || rStr[j - 1] != '\\') && GetKeyWord( rStr, j ) )
+                    bool bFoundEnglish = false;
+                    if ( (j == 0 || rStr[j - 1] != '\\') && GetKeyWord( rStr, j, bFoundEnglish) )
                     {
                         rStr = "\"" + rStr + "\"";
                         break; // for
diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx
index 79bc6e7512d1..8ef0e0a7c80f 100644
--- a/svl/source/numbers/zforscan.hxx
+++ b/svl/source/numbers/zforscan.hxx
@@ -245,8 +245,15 @@ private: // Private section
     short PreviousType( sal_uInt16 i ) const;   // Returns type before position skips EMPTY
     bool IsLastBlankBeforeFrac(sal_uInt16 i) const; // True <=> there won't be a ' ' until the '/'
     void Reset();                               // Reset all variables before starting the analysis
-    short GetKeyWord( const OUString& sSymbol,  // Determine keyword at nPos
-                      sal_Int32 nPos ) const;   // Return 0 <=> not found
+
+    /** Determine keyword at nPos.
+        @param  rbFoundEnglish set if English instead of locale's keyword
+                found, never cleared, thus init with false.
+        @return 0 if not found, else keyword enumeration.
+     */
+    short GetKeyWord( const OUString& sSymbol,
+                      sal_Int32 nPos,
+                      bool& rbFoundEnglish ) const;
 
     bool IsAmbiguousE( short nKey ) const  // whether nKey is ambiguous E of NF_KEY_E/NF_KEY_EC
         {
commit bfb912a5d9c0292c4c8b9571ebb58a96085d2391
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 1 13:02:04 2018 +0100

    Resolves: tdf#101798 ResetClipRegion needs to affect cairo drawing too
    
    regression since...
    
    commit cb382034b061b4acd4f0fd490f42af34517a7b8d
    Date:   Fri Jul 1 14:00:00 2016 +0200
    
        tdf#50613 speedup fat line drawing on linux using cairo
    
    Change-Id: I2f1a70f102786228d52199df9960336218c6f9f9
    Reviewed-on: https://gerrit.libreoffice.org/55182
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 77230756187d8642f08e6b4bb937d279f3483533)

diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 1ac940050077..78a08bf59960 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -349,6 +349,9 @@ long X11SalGraphics::GetGraphicsWidth() const
 
 void X11SalGraphics::ResetClipRegion()
 {
+#if ENABLE_CAIRO_CANVAS
+    maClipRegion.SetNull();
+#endif
     mxImpl->ResetClipRegion();
 }
 
commit 8986c227a87bd29ab96b41df250e086e1f4b099b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu May 31 13:49:40 2018 +0100

    tdf#117537 block rentry to CheckAndMarkUnknownFont
    
    Change-Id: I70e75a39d13e93e929c7aef5407b1100bb2a7c12
    Reviewed-on: https://gerrit.libreoffice.org/55131
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit c6c82096301180cfa7942dd9fb9d1cb66c7ecc04)

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 997520fd5e32..c5c19346ce3f 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -192,6 +192,7 @@ private:
     Reference< XDispatchProvider > m_xDispatchProvider;
     Reference< XFrame >            m_xFrame;
     bool            mbEndPreview;
+    bool            mbCheckingUnknownFont;
 
     void            ReleaseFocus_Impl();
     void            EnableControls_Impl();
@@ -970,7 +971,8 @@ SvxFontNameBox_Impl::SvxFontNameBox_Impl( vcl::Window* pParent, const Reference<
     bRelease           ( true ),
     m_xDispatchProvider( rDispatchProvider ),
     m_xFrame (_xFrame),
-    mbEndPreview(false)
+    mbEndPreview(false),
+    mbCheckingUnknownFont(false)
 {
     SetOptimalSize();
     EnableControls_Impl();
@@ -1002,6 +1004,9 @@ IMPL_LINK( SvxFontNameBox_Impl, CheckAndMarkUnknownFont, VclWindowEvent&, event,
 {
     if( event.GetId() != VclEventId::EditModify )
         return;
+    if (mbCheckingUnknownFont) //tdf#117537 block rentry
+        return;
+    mbCheckingUnknownFont = true;
     OUString fontname = GetSubEdit()->GetText();
     lcl_GetDocFontList( &pFontList, this );
     // If the font is unknown, show it in italic.
@@ -1024,6 +1029,7 @@ IMPL_LINK( SvxFontNameBox_Impl, CheckAndMarkUnknownFont, VclWindowEvent&, event,
             SetQuickHelpText( SvxResId( RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE ));
         }
     }
+    mbCheckingUnknownFont = false;
 }
 
 void SvxFontNameBox_Impl::Update( const css::awt::FontDescriptor* pFontDesc )
commit 81768981c714d7165b7526a21142aaf41c992510
Author: Michael Stahl <Michael.Stahl at cib.de>
Date:   Sun May 20 23:45:12 2018 +0200

    gbuild: suppress -Werror on new GCC 8 warnings for release branch
    
    Change-Id: I0db765096b6b1a6595057f253884afc2e3fb0178
    Reviewed-on: https://gerrit.libreoffice.org/54608
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 1d3a436ddb62065145b696635b4ec5fb4c9be12a)

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 11b7871a3e6f..1466cf17d3ad 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -96,6 +96,17 @@ gb_CXXFLAGS_COMMON += \
     -Wunused-const-variable=1
 endif
 
+ifeq ($(shell expr '$(GCC_VERSION)' '>=' 800),1)
+gb_CXXFLAGS_COMMON += \
+	-Wno-error=cast-function-type \
+	-Wno-error=sizeof-pointer-memaccess \
+	-Wno-error=class-memaccess \
+	-Wno-error=parentheses \
+	-Wno-error=implicit-fallthrough \
+	-Wno-error=ignored-qualifiers \
+
+endif
+
 ifeq ($(COM_IS_CLANG),TRUE)
 gb_CXXFLAGS_COMMON += -Wimplicit-fallthrough
 endif
commit 9cd4ab815bada1431074f1c2b67b1c92ac436cf3
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu May 10 10:56:27 2018 +0200

    tdf#117522 Calc Column Width after Insert Columns
    
    regression from
        commit d6fb5ca5661195520ca7a7ca2d0145a1e11be099
        dyncolcontainer: use ScCompressedArray for pColWidth
    
    Change-Id: I65d1197c0c638216e063f74def4efb98bfbb9aad
    Reviewed-on: https://gerrit.libreoffice.org/54067
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit a111a7ba4067dc11070c4b1ab6eb24cc89263770)
    Reviewed-on: https://gerrit.libreoffice.org/55119
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit c30963b8b4bbbe42a24b97aafa161eff9d7ccdd4)

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index daf20bfb5406..f18bb9ed8ce5 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -284,6 +284,9 @@ void ScTable::InsertCol(
         if (mpColWidth && mpColFlags)
         {
             mpColWidth->InsertPreservingSize(nStartCol, nSize, STD_COL_WIDTH);
+            // The inserted columns have the same widths as the columns, which were selected for insert.
+            for (SCSIZE i=0; i < std::min(MAXCOL-nSize-nStartCol, nSize); ++i)
+                mpColWidth->SetValue(nStartCol + i, mpColWidth->GetValue(nStartCol+i+nSize));
             mpColFlags->InsertPreservingSize(nStartCol, nSize, CRFlags::NONE);
         }
         if (pOutlineTable)
commit 4aaef034ba3d2697602d8adb9f919e2bf5677995
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Jun 4 23:05:59 2018 +0200

    Resolves: tdf#117879 preserve formula after inline array error
    
    Use FormulaError::NestedArray for now to be able to backport
    without new string resources. Introduce a more specific error in
    another change.
    
    Change-Id: I49bf731f0b17c81dc6a125718bf104e218e508cc
    Reviewed-on: https://gerrit.libreoffice.org/55300
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit 2d330a5c48fd200db10fba7c40688221185c2dec)
    Reviewed-on: https://gerrit.libreoffice.org/55308
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit 2f923aa12e2cbb759e504e06dd3efdfd9e552d34)

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index cf1a5b0eb01a..9e9edb77dc7a 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4577,7 +4577,14 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
             }
         }
         FormulaToken* pNewToken = static_cast<ScTokenArray*>(pArr)->Add( maRawToken.CreateToken());
-        if (!pNewToken)
+        if (!pNewToken && eOp == ocArrayClose && pArr->OpCodeBefore( pArr->GetLen()) == ocArrayClose)
+        {
+            // Nested inline array or non-value/non-string in array. The
+            // original tokens are still in the ScTokenArray and not merged
+            // into an ScMatrixToken. Set error but keep on tokenizing.
+            SetError( FormulaError::NestedArray);
+        }
+        else if (!pNewToken)
         {
             SetError(FormulaError::CodeOverflow);
             break;
commit 654e6eb3025394ac28907784ff48273a3494542f
Author: Justin Luth <justin.luth at collabora.com>
Date:   Wed May 23 08:36:54 2018 +0300

    tdf#114487 sc htmlimp: rangeNames should be 3D
    
    Without a visible sheet name, these absolute ranges
    become relative after a round-trip.
    
    Another way to handle this would be to ensure that ODS
    (and other text-based formats) export Absolute in a
    way that can be properly imported. But handling
    it on import is safer and ensures UI consistency.
    
    The InitRange default is for !IsFlag3D and !IsTabRel().
    Since the range already imports as absolute, just add
    the appropriate 3D flags.
    
    Change-Id: Ia664e6f87e235096e1c2e5b702e18505e375e2ad
    Reviewed-on: https://gerrit.libreoffice.org/54725
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit c42b1cf2464924b125aeae15968fb79cf795bc81)
    Reviewed-on: https://gerrit.libreoffice.org/55272
    (cherry picked from commit cd51f388c96cafdf81303722c43c6025d9f0073e)

diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 7672b96a9850..6e0aac4be3e2 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -176,6 +176,7 @@ public:
 #if !defined _WIN32
     void testSupBookVirtualPathXLS();
 #endif
+    void testAbsNamedRangeHTML();
     void testSheetLocalRangeNameXLS();
     void testSheetTextBoxHyperlinkXLSX();
     void testFontSizeXLSX();
@@ -282,6 +283,7 @@ public:
     CPPUNIT_TEST(testImageWithSpecialID);
     CPPUNIT_TEST(testPreserveTextWhitespaceXLSX);
     CPPUNIT_TEST(testPreserveTextWhitespace2XLSX);
+    CPPUNIT_TEST(testAbsNamedRangeHTML);
     CPPUNIT_TEST(testSheetLocalRangeNameXLS);
     CPPUNIT_TEST(testSheetTextBoxHyperlinkXLSX);
     CPPUNIT_TEST(testFontSizeXLSX);
@@ -3328,6 +3330,20 @@ void ScExportTest::testImageWithSpecialID()
     }
 }
 
+void ScExportTest::testAbsNamedRangeHTML()
+{
+    ScDocShellRef xDocSh = loadDoc("numberformat.", FORMAT_HTML);
+    xDocSh->DoHardRecalc();
+    ScDocShellRef xDocSh2 = saveAndReload(xDocSh.get(), FORMAT_ODS);
+    xDocSh->DoClose();
+    xDocSh2->DoHardRecalc();
+
+    ScDocument& rDoc = xDocSh2->GetDocument();
+    ScRangeData* pRangeData = rDoc.GetRangeName()->findByUpperName(OUString("HTML_1"));
+    ScSingleRefData* pRef = pRangeData->GetCode()->FirstToken()->GetSingleRef();
+    CPPUNIT_ASSERT_MESSAGE("HTML_1 is an absolute reference",!pRef->IsTabRel());
+}
+
 void ScExportTest::testSheetLocalRangeNameXLS()
 {
     ScDocShellRef xDocSh = loadDoc("named-ranges-local.", FORMAT_XLS);
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index 72d56b4d9126..f601903bfde9 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -102,6 +102,8 @@ void ScHTMLImport::InsertRangeName( ScDocument* pDoc, const OUString& rName, con
 {
     ScComplexRefData aRefData;
     aRefData.InitRange( rRange );
+    aRefData.Ref1.SetFlag3D( true );
+    aRefData.Ref2.SetFlag3D( aRefData.Ref2.Tab() != aRefData.Ref1.Tab() );
     ScTokenArray aTokArray;
     aTokArray.AddDoubleReference( aRefData );
     ScRangeData* pRangeData = new ScRangeData( pDoc, rName, aTokArray );


More information about the Libreoffice-commits mailing list