diff options
author | obo <obo@openoffice.org> | 2010-10-28 10:55:51 +0200 |
---|---|---|
committer | obo <obo@openoffice.org> | 2010-10-28 10:55:51 +0200 |
commit | 2a75245b7f40a23fc5d866912aa8dacd3637448f (patch) | |
tree | 83c649d799591275e442ea799ebbf06628befa14 | |
parent | c26e034840bb7bde528e0636395577cc98133db7 (diff) | |
parent | c929d0319d72247a9fb3db00aac412a3ef836589 (diff) |
CWS-TOOLING: integrate CWS calc61ooo/OOO330_m13
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 26 | ||||
-rw-r--r-- | sc/source/ui/view/pfuncache.cxx | 2 |
2 files changed, 21 insertions, 7 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index ccf3ddf14..bbfd90644 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -815,6 +815,16 @@ BOOL ScModelObj::FillRenderMarkData( const uno::Any& aSelection, rMark.MarkFromRangeList( rRanges, FALSE ); rMark.MarkToSimple(); + if ( rMark.IsMultiMarked() ) + { + // #i115266# copy behavior of old printing: + // treat multiple selection like a single selection with the enclosing range + ScRange aMultiMarkArea; + rMark.GetMultiMarkArea( aMultiMarkArea ); + rMark.ResetMark(); + rMark.SetMarkArea( aMultiMarkArea ); + } + if ( rMark.IsMarked() && !rMark.IsMultiMarked() ) { // a sheet object is treated like an empty selection: print the used area of the sheet @@ -974,15 +984,17 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32 ScMarkData aMark; ScPrintSelectionStatus aStatus; String aPagesStr; - if ( !FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) ) - throw lang::IllegalArgumentException(); - - if ( !pPrintFuncCache || !pPrintFuncCache->IsSameSelection( aStatus ) ) + // #i115266# if FillRenderMarkData fails, keep nTotalPages at 0, but still handle getRenderer(0) below + long nTotalPages = 0; + if ( FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) ) { - delete pPrintFuncCache; - pPrintFuncCache = new ScPrintFuncCache( pDocShell, aMark, aStatus ); + if ( !pPrintFuncCache || !pPrintFuncCache->IsSameSelection( aStatus ) ) + { + delete pPrintFuncCache; + pPrintFuncCache = new ScPrintFuncCache( pDocShell, aMark, aStatus ); + } + nTotalPages = pPrintFuncCache->GetPageCount(); } - long nTotalPages = pPrintFuncCache->GetPageCount(); sal_Int32 nRenderer = lcl_GetRendererNum( nSelRenderer, aPagesStr, nTotalPages ); if ( nRenderer >= nTotalPages ) { diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx index a15d607e6..4db10a23e 100644 --- a/sc/source/ui/view/pfuncache.cxx +++ b/sc/source/ui/view/pfuncache.cxx @@ -72,6 +72,8 @@ ScPrintFuncCache::ScPrintFuncCache( ScDocShell* pD, const ScMarkData& rMark, long nThisTab = 0; if ( rMark.GetTableSelect( nTab ) ) { + pDoc->InvalidatePageBreaks( nTab ); // user print area (selection) may be different + ScPrintFunc aFunc( pDocSh, pPrinter, nTab, nAttrPage, 0, pSelRange, &aSelection.GetOptions() ); nThisTab = aFunc.GetTotalPages(); nFirstAttr[nTab] = aFunc.GetFirstPageNo(); // from page style or previous sheet |