diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-12-08 17:37:17 +0100 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-12-08 17:37:17 +0100 |
commit | 4d256d26b3d99149c3dafe8b1acbc161c69c171d (patch) | |
tree | 1b3efaee1399f53e45379ac9b5cbcf37a4a1c206 | |
parent | 8c30146af0e6d4fbdb731eae01dbf47661e788ae (diff) |
masterfix: #i10000# crash in sc fixed
Notes
Notes:
split repo tag: calc_ooo/DEV300_m67
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 80 |
1 files changed, 61 insertions, 19 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index c3c096a6a666..c23eb73e1f59 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -612,16 +612,26 @@ void ScViewData::SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs ) if ( !bAll ) // create associated table data CreateTabData( tabs ); - std::vector< SCTAB >::iterator it_end = tabs.end(); - std::vector< SCTAB >::iterator it = tabs.begin(); - for ( SCTAB i = ( bAll ? 0 : *it ); ( bAll ? i <= MAXTAB : it != it_end ); ++i , ++it ) - { - if ( pTabData[i] ) - pTabData[i]->eZoomType = eNew; - } - if ( bAll ) + { + for ( SCTAB i = 0; i <= MAXTAB; ++i ) + { + if ( pTabData[i] ) + pTabData[i]->eZoomType = eNew; + } eDefZoomType = eNew; + } + else + { + std::vector< SCTAB >::iterator it_end = tabs.end(); + std::vector< SCTAB >::iterator it = tabs.begin(); + for ( ; it != it_end; ++it ) + { + SCTAB i = *it; + if ( pTabData[i] ) + pTabData[i]->eZoomType = eNew; + } + } } void ScViewData::SetZoomType( SvxZoomType eNew, BOOL bAll ) @@ -659,22 +669,54 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vec if (aValidY>aFrac400) aValidY = aFrac400; - std::vector< SCTAB >::iterator it_end = tabs.end(); - std::vector< SCTAB >::iterator it = tabs.begin(); - - for ( SCTAB i = ( bAll ? 0 : *it ); ( bAll ? i <= MAXTAB : it != it_end ); ++i , ++it ) + if ( bAll ) { - if ( pTabData[i] ) + for ( SCTAB i = 0; i <= MAXTAB; ++i ) { - if ( bPagebreak ) + if ( pTabData[i] ) { - pTabData[i]->aPageZoomX = aValidX; - pTabData[i]->aPageZoomY = aValidY; + if ( bPagebreak ) + { + pTabData[i]->aPageZoomX = aValidX; + pTabData[i]->aPageZoomY = aValidY; + } + else + { + pTabData[i]->aZoomX = aValidX; + pTabData[i]->aZoomY = aValidY; + } } - else + } + if ( bPagebreak ) + { + aDefPageZoomX = aValidX; + aDefPageZoomY = aValidY; + } + else + { + aDefZoomX = aValidX; + aDefZoomY = aValidY; + } + } + else + { + std::vector< SCTAB >::iterator it_end = tabs.end(); + std::vector< SCTAB >::iterator it = tabs.begin(); + for ( ; it != it_end; ++it ) + { + SCTAB i = *it; + if ( pTabData[i] ) { - pTabData[i]->aZoomX = aValidX; - pTabData[i]->aZoomY = aValidY; + if ( bPagebreak ) + { + pTabData[i]->aPageZoomX = aValidX; + pTabData[i]->aPageZoomY = aValidY; + } + else + { + pTabData[i]->aZoomX = aValidX; + pTabData[i]->aZoomY = aValidY; + } } } } |