summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-12-08 17:37:17 +0100
committerKurt Zenker <kz@openoffice.org>2009-12-08 17:37:17 +0100
commitd90bbfeabe782e839d5e443c80c6ed470acd5b7d (patch)
treed168b4c7cb16d23bf1908b34c2d2b37894c3150b
parent670a70fb30c08dbb2b1b2d7289ecccd7141c4a7b (diff)
masterfix: #i10000# crash in sc fixedooo/DEV300_m67
-rw-r--r--sc/source/ui/view/viewdata.cxx80
1 files changed, 61 insertions, 19 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 2e6df9f51..fcb76680c 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;
+ }
}
}
}