summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2019-09-03 17:19:18 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2019-09-05 12:25:49 +0200
commit09afdc89572202f100e5ab5112ae0878ae032fc1 (patch)
tree9cc63bf66a33b07411908e56c808f1396cf2ef27
parentadd68a1a3f5466ecf567df79119a1cade4058401 (diff)
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@numbertext.org> (cherry picked from commit 47aa9324e3d15fcc9d1195b9b0822b5568e6d96e) Reviewed-on: https://gerrit.libreoffice.org/78577 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
-rw-r--r--sc/source/filter/excel/xeview.cxx6
-rw-r--r--sc/source/filter/inc/xeview.hxx1
2 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx
index b83937452b1a..f6fb858dc77f 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