[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Jan 10 19:30:54 PST 2012


 sc/source/ui/view/viewdata.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit a78260fb65c2542566215bb5bdd6060c164584ab
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Tue Jan 10 22:25:06 2012 -0500

    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.

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 691b651..26c6346 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -322,6 +322,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) :
         bPagebreak  ( false ),
         bSelCtrlMouseClick( false )
 {
+    mpMarkData->SelectOneTable(0); // Sync with nTabNo.
 
     SetGridMode     ( sal_True );
     SetSyntaxMode   ( false );
@@ -368,6 +369,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 ),


More information about the Libreoffice-commits mailing list