Kaydet (Commit) 9b853ee4 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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.
üst e24a27b4
...@@ -323,6 +323,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : ...@@ -323,6 +323,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) :
bPagebreak ( false ), bPagebreak ( false ),
bSelCtrlMouseClick( false ) bSelCtrlMouseClick( false )
{ {
mpMarkData->SelectOneTable(0); // Sync with nTabNo.
SetGridMode ( sal_True ); SetGridMode ( sal_True );
SetSyntaxMode ( false ); SetSyntaxMode ( false );
...@@ -369,6 +370,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : ...@@ -369,6 +370,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) :
ScViewData::ScViewData( const ScViewData& rViewData ) : ScViewData::ScViewData( const ScViewData& rViewData ) :
maTabData( rViewData.maTabData ), maTabData( rViewData.maTabData ),
mpMarkData(new ScMarkData(*rViewData.mpMarkData)),
pDocShell ( rViewData.pDocShell ), pDocShell ( rViewData.pDocShell ),
pDoc ( rViewData.pDoc ), pDoc ( rViewData.pDoc ),
pView ( rViewData.pView ), pView ( rViewData.pView ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment