summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
authorJonathan Pryor <jpryor@novell.com>2010-09-15 12:01:56 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2010-09-15 14:09:37 +0200
commit7e905a8c791eee19d905f6655e4d5f0eeded38a2 (patch)
tree61303556c1e39694ad952f33f865c1e13312d2cc /sc/source/ui/view
parent833272e9bb6220b63e6d1674283855cd12311bee (diff)
sc-print-selected-sheets.diff: Make Print Preview consistent with Print output
n#335684, i#45497
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/preview.cxx10
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx5
2 files changed, 15 insertions, 0 deletions
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 83fdab9000e6..3ab6dc140484 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -109,6 +109,7 @@ ScPreview::ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pView
bLocationValid( FALSE ),
pLocationData( NULL ),
pDrawView( NULL ),
+ nCurTab ( ScDocShell::GetCurTab() ),
bInPaint( FALSE ),
bInGetState( FALSE ),
pDocShell( pDocSh ),
@@ -249,8 +250,17 @@ void ScPreview::CalcPages( SCTAB /*nToWhichTab*/ )
// but always all sheets are used (there is no selected sheet)
ScPrintOptions aOptions = SC_MOD()->GetPrintOptions();
+ ScMarkData aMarkData;
+ aMarkData.SelectTable( nCurTab, TRUE );
+
for (SCTAB i=nStart; i<nAnz; i++)
{
+ if (!aOptions.GetAllSheets() && !aMarkData.GetTableSelect( i )) {
+ nPages[i] = 0;
+ nFirstAttr[i] = 0;
+ continue;
+ }
+
long nAttrPage = i > 0 ? nFirstAttr[i-1] : 1;
long nThisStart = nTotalPages;
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index ed09ec85ee8c..55f6e9c2f796 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1189,8 +1189,13 @@ PrintDialog* __EXPORT ScTabViewShell::CreatePrintDialog( Window *pParent )
// instead of a separate progress for each sheet from ScPrintFunc
pDocShell->UpdatePendingRowHeights( MAXTAB, true );
+ ScMarkData aMarkData;
+ aMarkData.SelectTable( GetViewData()->GetTabNo(), TRUE );
+
for ( SCTAB i=0; i<nTabCount; i++ )
{
+ if ( !bAllTabs && !aMarkData.GetTableSelect( i ) )
+ continue;
ScPrintFunc aPrintFunc( pDocShell, pPrinter, i );
nDocPageMax += aPrintFunc.GetTotalPages();
}