diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-29 00:27:57 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-29 00:27:57 -0500 |
commit | 2f92037b08c8c08bee1cf91b2b1ccdff394445a4 (patch) | |
tree | bbe5cd5a3247b77b3a066dedebe3d01d4f0a1c61 /sc/source/ui/view | |
parent | 6a4bb3e17c79d1ce8b2528a4b9c22456be911f32 (diff) |
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.
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/preview.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 272be8412a90..186205cd7409 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 89fd96891685..ef995ba5e29d 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) |