From 9b853ee45050b78a8e623269c3c7db5c63c2716e Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 10 Jan 2012 22:25:06 -0500 Subject: fdo#44147: Sheet 0 is selected by default. ScViewData's default ctor sets current sheet to 0, but its selected sheet data didn't have it selected which meant that the two data were out-of-sync when created. This affected entering data into cell when the sheet was embedded (because no sheet was "selected"). In reality at least one sheet is selected at all times. The above bug was present before, but was masked by a hack in ScTabView which always selected sheet 0 when activated. I removed that because it was interfering with syncing the sheet selection data before and after print preview. And removing that hack exposed this. This commit is the right fix. --- sc/source/ui/view/viewdata.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sc') diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 176a8497d259..8a9640392316 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -323,6 +323,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : bPagebreak ( false ), bSelCtrlMouseClick( false ) { + mpMarkData->SelectOneTable(0); // Sync with nTabNo. SetGridMode ( sal_True ); SetSyntaxMode ( false ); @@ -369,6 +370,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : ScViewData::ScViewData( const ScViewData& rViewData ) : maTabData( rViewData.maTabData ), + mpMarkData(new ScMarkData(*rViewData.mpMarkData)), pDocShell ( rViewData.pDocShell ), pDoc ( rViewData.pDoc ), pView ( rViewData.pView ), -- cgit