[Libreoffice-commits] core.git: sc/source

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 4 06:28:54 UTC 2019


 sc/source/filter/excel/xeview.cxx |    6 ++++--
 sc/source/filter/inc/xeview.hxx   |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 47aa9324e3d15fcc9d1195b9b0822b5568e6d96e
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Tue Sep 3 17:19:18 2019 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Wed Sep 4 08:28:19 2019 +0200

    tdf#127110 XLSX export: fix bad view position
    
    Update SheetView attribute topLeftCell only
    in the case of embedded OLE sheets.
    
    Regression from commit 3707e2a7b8b05617b0afb75374f866c967593861
    "tdf#122624 XLSX OLE in DOCX: export view positions".
    
    Change-Id: I9ea57ff1531d710bff34df12fb7e0bb1e3edbea5
    Reviewed-on: https://gerrit.libreoffice.org/78570
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx
index 964b7d2447b0..91a372700560 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -285,7 +285,8 @@ sal_uInt16 lclGetXclZoom( long nScZoom, sal_uInt16 nDefXclZoom )
 
 XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nScTab ) :
     XclExpRoot( rRoot ),
-    mnGridColorId( XclExpPalette::GetColorIdFromIndex( EXC_COLOR_WINDOWTEXT ) )
+    mnGridColorId( XclExpPalette::GetColorIdFromIndex( EXC_COLOR_WINDOWTEXT ) ),
+    mbHasTabSettings(false)
 {
     // *** sheet flags ***
 
@@ -304,6 +305,7 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
 
     if( const ScExtTabSettings* pTabSett = GetExtDocOptions().GetTabSettings( nScTab ) )
     {
+        mbHasTabSettings = true;
         const ScExtTabSettings& rTabSett = *pTabSett;
         XclExpAddressConverter& rAddrConv = GetAddressConverter();
 
@@ -419,7 +421,7 @@ void XclExpTabViewSettings::SaveXml( XclExpXmlStream& rStrm )
     rWorksheet->startElement(XML_sheetViews);
 
     // handle missing viewdata at embedded XLSX OLE objects
-    if (maData.mbSelected)
+    if( !mbHasTabSettings && maData.mbSelected )
     {
         SCCOL nPosLeft = rStrm.GetRoot().GetDoc().GetPosLeft();
         SCROW nPosTop = rStrm.GetRoot().GetDoc().GetPosTop();
diff --git a/sc/source/filter/inc/xeview.hxx b/sc/source/filter/inc/xeview.hxx
index 4416417ea623..8d320177d8d0 100644
--- a/sc/source/filter/inc/xeview.hxx
+++ b/sc/source/filter/inc/xeview.hxx
@@ -159,6 +159,7 @@ private:
 private:
     XclTabViewData      maData;             /// All view settings for a sheet.
     sal_uInt32          mnGridColorId;      /// Color identifier for grid color.
+    bool                mbHasTabSettings;   /// It's false for embedded OLE spreadsheets.
 };
 
 #endif


More information about the Libreoffice-commits mailing list