diff options
author | Niklas Nebel <nn@openoffice.org> | 2010-10-27 17:08:35 +0200 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2010-10-27 17:08:35 +0200 |
commit | beb032bc52ad5fe35db63493ec3a553f45951443 (patch) | |
tree | 12dd8dd17809c62d6fe7eb15dd7584940aeef8fc /sfx2 | |
parent | ba640a3477213a4d2f179f188fe80029969ef1bb (diff) |
calc61: #i115266# handle multiple selection for printing, return valid settings for invalid selection, catch exception from getRenderer
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 4ed0173be8e1..72a85258e9c3 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -143,18 +143,26 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete, aRenderOptions[1].Value = i_rViewProp; aRenderOptions[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) ); aRenderOptions[2].Value <<= sal_True; - Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) ); - int nProps = aRenderParms.getLength(); - for( int i = 0; i < nProps; i++ ) + try { - if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) ) + Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) ); + int nProps = aRenderParms.getLength(); + for( int i = 0; i < nProps; i++ ) { - Sequence< beans::PropertyValue > aUIProps; - aRenderParms[i].Value >>= aUIProps; - setUIOptions( aUIProps ); - break; + if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) ) + { + Sequence< beans::PropertyValue > aUIProps; + aRenderParms[i].Value >>= aUIProps; + setUIOptions( aUIProps ); + break; + } } } + catch( lang::IllegalArgumentException& ) + { + // the first renderer should always be available for the UI options, + // but catch the exception to be safe + } } // set some job parameters @@ -234,7 +242,13 @@ Sequence< beans::PropertyValue > SfxPrinterController::getPageParameters( int i_ if( mxRenderable.is() && pPrinter ) { Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() ); - aResult = mxRenderable->getRenderer( i_nPage, getSelectionObject(), aJobOptions ); + try + { + aResult = mxRenderable->getRenderer( i_nPage, getSelectionObject(), aJobOptions ); + } + catch( lang::IllegalArgumentException& ) + { + } } return aResult; } |