diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-20 15:03:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-21 15:18:57 +0200 |
commit | ac80f048f2bb23651ddc3c6608e9ef24635698d7 (patch) | |
tree | 925ece62dd2e859170d1267d8e7122c4f9b762e8 /basctl | |
parent | More missing GetSelectEntryPos -> GetSelectedEntryPos (diff) | |
download | core-ac80f048f2bb23651ddc3c6608e9ef24635698d7.tar.gz core-ac80f048f2bb23651ddc3c6608e9ef24635698d7.zip |
loplugin:flatten in basctl..configmgr
Change-Id: I674cad57ce30a885e126d3bcc921f8fcb53dc36d
Reviewed-on: https://gerrit.libreoffice.org/42577
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/basicrenderable.cxx | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx index 1e51245735b1..f19d16e8189a 100644 --- a/basctl/source/basicide/basicrenderable.cxx +++ b/basctl/source/basicide/basicrenderable.cxx @@ -92,24 +92,23 @@ sal_Int32 SAL_CALL Renderable::getRendererCount ( sal_Int32 nCount = 0; if( mpWindow ) { - if (VclPtr<Printer> pPrinter = getPrinter()) + VclPtr<Printer> pPrinter = getPrinter(); + if (!pPrinter) + throw lang::IllegalArgumentException(); + + nCount = mpWindow->countPages( pPrinter ); + sal_Int64 nContent = getIntValue( "PrintContent", -1 ); + if( nContent == 1 ) { - nCount = mpWindow->countPages( pPrinter ); - sal_Int64 nContent = getIntValue( "PrintContent", -1 ); - if( nContent == 1 ) + OUString aPageRange( getStringValue( "PageRange" ) ); + if( !aPageRange.isEmpty() ) { - OUString aPageRange( getStringValue( "PageRange" ) ); - if( !aPageRange.isEmpty() ) - { - StringRangeEnumerator aRangeEnum( aPageRange, 0, nCount-1 ); - sal_Int32 nSelCount = aRangeEnum.size(); - if( nSelCount >= 0 ) - nCount = nSelCount; - } + StringRangeEnumerator aRangeEnum( aPageRange, 0, nCount-1 ); + sal_Int32 nSelCount = aRangeEnum.size(); + if( nSelCount >= 0 ) + nCount = nSelCount; } } - else - throw lang::IllegalArgumentException(); } return nCount; @@ -151,31 +150,30 @@ void SAL_CALL Renderable::render ( if( mpWindow ) { - if (VclPtr<Printer> pPrinter = getPrinter()) + VclPtr<Printer> pPrinter = getPrinter(); + if (!pPrinter) + throw lang::IllegalArgumentException(); + + sal_Int64 nContent = getIntValue( "PrintContent", -1 ); + if( nContent == 1 ) { - sal_Int64 nContent = getIntValue( "PrintContent", -1 ); - if( nContent == 1 ) + OUString aPageRange( getStringValue( "PageRange" ) ); + if( !aPageRange.isEmpty() ) { - OUString aPageRange( getStringValue( "PageRange" ) ); - if( !aPageRange.isEmpty() ) - { - sal_Int32 nPageCount = mpWindow->countPages( pPrinter ); - StringRangeEnumerator aRangeEnum( aPageRange, 0, nPageCount-1 ); - StringRangeEnumerator::Iterator it = aRangeEnum.begin(); - for( ; it != aRangeEnum.end() && nRenderer; --nRenderer ) - ++it; - - sal_Int32 nPage = ( it != aRangeEnum.end() ) ? *it : nRenderer; - mpWindow->printPage( nPage, pPrinter ); - } - else - mpWindow->printPage( nRenderer, pPrinter ); + sal_Int32 nPageCount = mpWindow->countPages( pPrinter ); + StringRangeEnumerator aRangeEnum( aPageRange, 0, nPageCount-1 ); + StringRangeEnumerator::Iterator it = aRangeEnum.begin(); + for( ; it != aRangeEnum.end() && nRenderer; --nRenderer ) + ++it; + + sal_Int32 nPage = ( it != aRangeEnum.end() ) ? *it : nRenderer; + mpWindow->printPage( nPage, pPrinter ); } else mpWindow->printPage( nRenderer, pPrinter ); } else - throw lang::IllegalArgumentException(); + mpWindow->printPage( nRenderer, pPrinter ); } } |