diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-08-06 23:21:21 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-08-10 22:03:38 +0200 |
commit | bb22d405b2c5cdccf5644d1025543801463cea46 (patch) | |
tree | 70be931d8fac8abfe85b9412426b78bdaa3b063b | |
parent | d798d9980172a20834318cf3b3ade4c3441cf028 (diff) |
Use indexed getToken()
Change-Id: I102c9ea0b11144cc930b5e4d3617f6178b63218b
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 48c36b9d0cf6..e261b01d9934 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -2852,9 +2852,10 @@ void ScViewData::ReadUserData(const OUString& rData) Fraction aZoomX, aZoomY, aPageZoomX, aPageZoomY; // evaluate (all sheets?) + sal_Int32 nMainIdx {0}; sal_Int32 nIdx {0}; - OUString aZoomStr = rData.getToken(0, ';'); // Zoom/PageZoom/Mode + OUString aZoomStr = rData.getToken(0, ';', nMainIdx); // Zoom/PageZoom/Mode sal_uInt16 nNormZoom = sal::static_int_cast<sal_uInt16>(aZoomStr.getToken(0, '/', nIdx).toInt32()); if ( nNormZoom >= MINZOOM && nNormZoom <= MAXZOOM ) aZoomX = aZoomY = Fraction( nNormZoom, 100 ); // "normal" zoom (always) @@ -2866,12 +2867,13 @@ void ScViewData::ReadUserData(const OUString& rData) // SetPagebreakMode must always be called due to CalcPPT / RecalcPixPos() // sheet may have become invalid (for instance last version): - SCTAB nNewTab = static_cast<SCTAB>(rData.getToken(1, ';').toUInt32()); + SCTAB nNewTab = static_cast<SCTAB>(rData.getToken(0, ';', nMainIdx).toUInt32()); if (pDoc->HasTable( nNewTab )) SetTabNo(nNewTab); // if available, get tab bar width: - OUString aTabOpt = rData.getToken(2, ';'); + const sal_Int32 nMainIdxRef {nMainIdx}; + OUString aTabOpt = rData.getToken(0, ';', nMainIdx); OUString aRest; if (aTabOpt.startsWith(TAG_TABBARWIDTH, &aRest)) @@ -2879,12 +2881,17 @@ void ScViewData::ReadUserData(const OUString& rData) pView->SetTabBarWidth(aRest.toInt32()); nTabStart = 3; } + else + { + // Tab bar width not specified, token to be processed again + nMainIdx = nMainIdxRef; + } // per sheet SCTAB nPos = 0; while ( nCount > nPos+nTabStart ) { - aTabOpt = rData.getToken(static_cast<sal_Int32>(nPos+nTabStart), ';'); + aTabOpt = rData.getToken(0, ';', nMainIdx); EnsureTabDataSize(nPos + 1); if (!maTabData[nPos]) maTabData[nPos].reset( new ScViewDataTable ); |