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 | 50b023a94b59bedf747e1c16e829b8a28d1842a8 (patch) | |
tree | 6eedfab8601e54ceffb2aeb7f48f3da7e5511e3a /sc/source | |
parent | 327536918dc596e12908ec21acd2667f3d717e76 (diff) | |
parent | 2b0596f11bbd306efb30e20aadcab561279ec348 (diff) |
CWS-TOOLING: integrate CWS calc61
Notes
Notes:
split repo tag: calc_ooo/OOO330_m13
Diffstat (limited to 'sc/source')
-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 3d3f0f479601..c92525b8ca57 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 6a206ef3eb13..b503d3a73fb7 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 |