[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Nov 28 21:33:54 PST 2011


 sc/source/ui/inc/preview.hxx  |    2 --
 sc/source/ui/view/preview.cxx |    7 ++-----
 sc/source/ui/view/prevwsh.cxx |    2 +-
 3 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 2f92037b08c8c08bee1cf91b2b1ccdff394445a4
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Tue Nov 29 00:27:57 2011 -0500

    fdo#32826: Fixed the print preview inconsistency.
    
    Now, the print preview should display the correct set of sheets
    based on the print settings as well as what sheets are selected.
    Previously, this was very quirky and inaccurate.

diff --git a/sc/source/ui/inc/preview.hxx b/sc/source/ui/inc/preview.hxx
index f698291..f926e1a 100644
--- a/sc/source/ui/inc/preview.hxx
+++ b/sc/source/ui/inc/preview.hxx
@@ -65,8 +65,6 @@ private:
     ScPreviewLocationData* pLocationData;   // stores table layout for accessibility API
     FmFormView*     pDrawView;
 
-    SCTAB           nCurTab;
-
                                         // intern:
     ScDocShell*     pDocShell;
     ScPreviewShell* pViewShell;
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 272be84..186205c 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -107,7 +107,6 @@ ScPreview::ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pView
     nTotalPages( 0 ),
     pLocationData( NULL ),
     pDrawView( NULL ),
-    nCurTab ( ScDocShell::GetCurTab() ),
     pDocShell( pDocSh ),
     pViewShell( pViewSh ),
     bInGetState( false ),
@@ -247,9 +246,6 @@ void ScPreview::CalcPages()
     //  but always all sheets are used (there is no selected sheet)
     ScPrintOptions aOptions = SC_MOD()->GetPrintOptions();
 
-    ScMarkData aMarkData;
-    aMarkData.SelectTable( nCurTab, true );
-
     while (nStart > static_cast<SCTAB>(nPages.size()))
         nPages.push_back(0);
     while (nStart > static_cast<SCTAB>(nFirstAttr.size()))
@@ -260,7 +256,8 @@ void ScPreview::CalcPages()
             nPages.push_back(0);
         if ( i == static_cast<SCTAB>(nFirstAttr.size()))
             nFirstAttr.push_back(0);
-        if (!aOptions.GetAllSheets() && !aMarkData.GetTableSelect( i )) {
+        if (!aOptions.GetAllSheets() && !maSelectedTabs.count(i) > 0)
+        {
             nPages[i] = 0;
             nFirstAttr[i] = 0;
             continue;
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 89fd968..ef995ba 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -159,8 +159,8 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
         ScTabViewShell* pTabViewShell = ((ScTabViewShell*)pOldSh);
         const ScViewData* pData = pTabViewShell->GetViewData();
         pData->WriteUserDataSequence( aSourceData );
-        InitStartTable( pData->GetTabNo() );
         pPreview->SetSelectedTabs(pData->GetMarkData());
+        InitStartTable( pData->GetTabNo() );
 
         //  also have to store the TabView's DesignMode state
         //  (only if draw view exists)


More information about the Libreoffice-commits mailing list