diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-05-18 18:11:14 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-05-18 19:35:43 +0200 |
commit | 90d0efb524b2cdd8d65808d18713bfd6b1d117ea (patch) | |
tree | 199c4656b6cef342232bbab4a06f1c3e25fd0cc4 /sc | |
parent | 1472935fd74c289717cd7783d99bc99d82d7866d (diff) |
Revert 4 commits related to fdo#45987
Revert "and another wae ( that I missed )"
This reverts commit a1faa06b415f54c0e8ff8a8f1e580e8a57b9296a.
Revert "fix wae"
This reverts commit 2f5885765445d8a8f50037da3420dbcd19d5634f.
Revert "attempt to prevent illegal maTabData access(s)"
This reverts commit 8352eb5a1af1eb44550a9d60d31e6c2fb2dc43b9.
Conflicts:
sc/source/ui/view/viewdata.cxx
Revert "fix bad stl access fdo#45987"
This reverts commit 8b1d29bc9b00bc2730738a990023a65ab6e0219b.
Conflicts:
sc/source/ui/view/viewdata.cxx
Change-Id: Idba6ec8ab448332ec349f23b10a2cce8b313ff19
33c437c8b9f005c43f03518863e151a6f0fc9589
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 028ab832fa73..b7de81a244a4 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -486,14 +486,11 @@ void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets ) void ScViewData::DeleteTab( SCTAB nTab ) { - if ( nTab < static_cast<SCTAB>(maTabData.size()) ) - { - delete maTabData.at(nTab); - if ( nTab == static_cast<SCTAB>(maTabData.size()) - 1 ) - maTabData.erase(maTabData.begin() + nTab); - UpdateCurrentTab(); - mpMarkData->DeleteTab( nTab ); - } + delete maTabData.at(nTab); + + maTabData.erase(maTabData.begin() + nTab); + UpdateCurrentTab(); + mpMarkData->DeleteTab( nTab ); } void ScViewData::DeleteTabs( SCTAB nTab, SCTAB nSheets ) @@ -503,8 +500,8 @@ void ScViewData::DeleteTabs( SCTAB nTab, SCTAB nSheets ) mpMarkData->DeleteTab( nTab + i ); delete maTabData.at(nTab + i); } - if ( ( nTab + nSheets ) == static_cast<SCTAB>( maTabData.size() - 1 ) ) - maTabData.erase(maTabData.begin() + nTab, maTabData.begin()+ nTab+nSheets); + + maTabData.erase(maTabData.begin() + nTab, maTabData.begin()+ nTab+nSheets); UpdateCurrentTab(); } @@ -541,8 +538,7 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab ) if (nSrcTab < static_cast<SCTAB>(maTabData.size())) { pTab = maTabData[nSrcTab]; - if ( nSrcTab == static_cast<SCTAB>( maTabData.size() - 1 ) ) - maTabData.erase( maTabData.begin() + nSrcTab ); + maTabData.erase( maTabData.begin() + nSrcTab ); } if (nDestTab < static_cast<SCTAB>(maTabData.size())) @@ -663,18 +659,15 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vec SCTAB i = *it; if ( i < static_cast<SCTAB>(maTabData.size()) && maTabData[i] ) { - if ( maTabData[i] ) + if ( bPagebreak ) { - if ( bPagebreak ) - { - maTabData[i]->aPageZoomX = aValidX; - maTabData[i]->aPageZoomY = aValidY; - } - else - { - maTabData[i]->aZoomX = aValidX; - maTabData[i]->aZoomY = aValidY; - } + maTabData[i]->aPageZoomX = aValidX; + maTabData[i]->aPageZoomY = aValidY; + } + else + { + maTabData[i]->aZoomX = aValidX; + maTabData[i]->aZoomY = aValidY; } } } @@ -696,8 +689,7 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, sal_Bool void ScViewData::SetShowGrid( bool bShow ) { CreateSelectedTabData(); - if ( maTabData[nTabNo] ) - maTabData[nTabNo]->bShowGrid = bShow; + maTabData[nTabNo]->bShowGrid = bShow; } void ScViewData::RefreshZoom() @@ -2954,7 +2946,7 @@ sal_Bool ScViewData::UpdateFixX( SCTAB nTab ) // sal_True = Wert g if (!ValidTab(nTab)) // Default nTab=nTabNo; // akuelle Tabelle - if (!maTabData[nTab] || !pView || maTabData[nTab]->eHSplitMode != SC_SPLIT_FIX) + if (!pView || maTabData[nTab]->eHSplitMode != SC_SPLIT_FIX) return false; ScDocument* pLocalDoc = GetDocument(); @@ -2989,7 +2981,7 @@ sal_Bool ScViewData::UpdateFixY( SCTAB nTab ) // sal_True = Wert g if (!ValidTab(nTab)) // Default nTab=nTabNo; // akuelle Tabelle - if (!maTabData[nTab] || !pView || maTabData[nTab]->eVSplitMode != SC_SPLIT_FIX) + if (!pView || maTabData[nTab]->eVSplitMode != SC_SPLIT_FIX) return false; ScDocument* pLocalDoc = GetDocument(); |