diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-11-01 15:58:31 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-11-01 15:58:31 +0100 |
commit | 9dc094a6791dcba4bf5828a6c00cca04d7815edc (patch) | |
tree | 72b3a745910aa6811a59a1aeed286defabcbee6d /sc/source/ui/unoobj/docuno.cxx | |
parent | 5cb1bf1e0b4ad3d395c84bb24eb87c1a95954f8d (diff) | |
parent | 50b023a94b59bedf747e1c16e829b8a28d1842a8 (diff) |
#i10000# changes from OOO330 m13
Diffstat (limited to 'sc/source/ui/unoobj/docuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 26 |
1 files changed, 19 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 ) { |