diff options
Diffstat (limited to 'sd/source/ui/view')
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/view/DocumentRenderer.cxx | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/view/DocumentRenderer.src | 1 | ||||
-rwxr-xr-x | sd/source/ui/view/viewoverlaymanager.cxx | 60 |
3 files changed, 41 insertions, 28 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index a23d8b2ad908..0689dc0e3851 100644..100755 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -122,7 +122,7 @@ namespace { sal_Int32 GetHandoutPageCount (void) const { - sal_uInt32 nIndex = static_cast<sal_Int32>(mrProperties.getIntValue("SlidesPerPage", sal_Int32(4))); + sal_uInt32 nIndex = static_cast<sal_Int32>(mrProperties.getIntValue("SlidesPerPage", sal_Int32(0))); if (nIndex<maSlidesPerPage.size()) return maSlidesPerPage[nIndex]; else if ( ! maSlidesPerPage.empty()) @@ -464,7 +464,7 @@ namespace { CreateChoice(_STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES_HELP), OUString( RTL_CONSTASCII_USTRINGPARAM( "SlidesPerPage" ) ), GetSlidesPerPageSequence(), - 4, + 0, OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ), aContentOpt ) @@ -672,7 +672,8 @@ namespace { const Sequence<rtl::OUString> aChoice ( CreateChoice(_STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES)); maSlidesPerPage.clear(); - for (sal_Int32 nIndex=0,nCount=aChoice.getLength(); nIndex<nCount; ++nIndex) + maSlidesPerPage.push_back(0); // first is using the default + for (sal_Int32 nIndex=1,nCount=aChoice.getLength(); nIndex<nCount; ++nIndex) maSlidesPerPage.push_back(aChoice[nIndex].toInt32()); return aChoice; } @@ -1528,6 +1529,7 @@ private: AutoLayout eLayout = AUTOLAYOUT_HANDOUT6; switch (nSlidesPerHandout) { + case 0: eLayout = AUTOLAYOUT_NONE; break; // AUTOLAYOUT_HANDOUT1; break; case 1: eLayout = AUTOLAYOUT_HANDOUT1; break; case 2: eLayout = AUTOLAYOUT_HANDOUT2; break; case 3: eLayout = AUTOLAYOUT_HANDOUT3; break; diff --git a/sd/source/ui/view/DocumentRenderer.src b/sd/source/ui/view/DocumentRenderer.src index 6419cb5c4e90..abd82ea0d397 100644..100755 --- a/sd/source/ui/view/DocumentRenderer.src +++ b/sd/source/ui/view/DocumentRenderer.src @@ -72,6 +72,7 @@ Resource _STR_IMPRESS_PRINT_UI_OPTIONS { ItemList [ en-US ] = { + < "Default" ; > ; < "1" ; > ; < "2" ; > ; < "3" ; > ; diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index ab165eea600b..447f50ec2222 100755 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -45,6 +45,7 @@ #include <vcl/help.hxx> #include <vcl/imagerepository.hxx> +#include <vcl/lazydelete.hxx> #include <svx/sdrpagewindow.hxx> #include <svx/sdrpaintwindow.hxx> @@ -79,9 +80,6 @@ class ImageButtonHdl; // -------------------------------------------------------------------- -BitmapEx ViewOverlayManager::maSmallButtonImages[BMP_PLACEHOLDER_SMALL_END - BMP_PLACEHOLDER_SMALL_START]; -BitmapEx ViewOverlayManager::maLargeButtonImages[BMP_PLACEHOLDER_LARGE_END - BMP_PLACEHOLDER_LARGE_START]; - static USHORT gButtonSlots[] = { SID_INSERT_TABLE, SID_INSERT_DIAGRAM, SID_INSERT_GRAPHIC, SID_INSERT_AVMEDIA }; static USHORT gButtonToolTips[] = { STR_INSERT_TABLE, STR_INSERT_CHART, STR_INSERT_PICTURE, STR_INSERT_MOVIE }; @@ -97,6 +95,32 @@ static BitmapEx loadImageResource( USHORT nId ) // -------------------------------------------------------------------- +static BitmapEx* getButtonImage( int index, bool large ) +{ + static vcl::DeleteOnDeinit< BitmapEx > gSmallButtonImages[BMP_PLACEHOLDER_SMALL_END - BMP_PLACEHOLDER_SMALL_START] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + static vcl::DeleteOnDeinit< BitmapEx > gLargeButtonImages[BMP_PLACEHOLDER_LARGE_END - BMP_PLACEHOLDER_LARGE_START] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + if( !gSmallButtonImages[0].get() ) + { + for( sal_uInt16 i = 0; i < (BMP_PLACEHOLDER_SMALL_END-BMP_PLACEHOLDER_SMALL_START); i++ ) + { + gSmallButtonImages[i].set( new BitmapEx( loadImageResource( BMP_PLACEHOLDER_SMALL_START + i ) ) ); + gLargeButtonImages[i].set( new BitmapEx( loadImageResource( BMP_PLACEHOLDER_LARGE_START + i ) ) ); + } + } + + if( large ) + { + return gLargeButtonImages[index].get(); + } + else + { + return gSmallButtonImages[index].get(); + } +} + +// -------------------------------------------------------------------- + const sal_uInt32 SMART_TAG_HDL_NUM = SAL_MAX_UINT32; class ChangePlaceholderTag : public SmartTag @@ -374,20 +398,20 @@ BitmapEx ChangePlaceholderTag::createOverlayImage( int nHighlight ) Size aShapeSizePix = pDev->LogicToPixel(rSnapRect.GetSize()); long nShapeSizePix = std::min(aShapeSizePix.Width(),aShapeSizePix.Height()); - BitmapEx* pImages = (nShapeSizePix > 250) ? &ViewOverlayManager::maLargeButtonImages[0] : &ViewOverlayManager::maSmallButtonImages[0]; + bool bLarge = nShapeSizePix > 250; - Size aSize( pImages->GetSizePixel() ); + Size aSize( getButtonImage( 0, bLarge )->GetSizePixel() ); aRet.SetSizePixel( Size( aSize.Width() << 1, aSize.Height() << 1 ) ); const Rectangle aRectSrc( Point( 0, 0 ), aSize ); - aRet = pImages[(nHighlight == 0) ? 4 : 0]; + aRet = *(getButtonImage((nHighlight == 0) ? 4 : 0, bLarge)); aRet.Expand( aSize.Width(), aSize.Height(), NULL, TRUE ); - aRet.CopyPixel( Rectangle( Point( aSize.Width(), 0 ), aSize ), aRectSrc, &pImages[(nHighlight == 1) ? 5 : 1] ); - aRet.CopyPixel( Rectangle( Point( 0, aSize.Height() ), aSize ), aRectSrc, &pImages[(nHighlight == 2) ? 6 : 2] ); - aRet.CopyPixel( Rectangle( Point( aSize.Width(), aSize.Height() ), aSize ), aRectSrc, &pImages[(nHighlight == 3) ? 7 : 3] ); + aRet.CopyPixel( Rectangle( Point( aSize.Width(), 0 ), aSize ), aRectSrc, getButtonImage((nHighlight == 1) ? 5 : 1, bLarge) ); + aRet.CopyPixel( Rectangle( Point( 0, aSize.Height() ), aSize ), aRectSrc, getButtonImage((nHighlight == 2) ? 6 : 2, bLarge) ); + aRet.CopyPixel( Rectangle( Point( aSize.Width(), aSize.Height() ), aSize ), aRectSrc, getButtonImage((nHighlight == 3) ? 7 : 3, bLarge) ); } return aRet; @@ -411,9 +435,9 @@ void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList ) if( 50 > nShapeSizePix ) return; - BitmapEx* pImages = (nShapeSizePix > 250) ? &ViewOverlayManager::maLargeButtonImages[0] : &ViewOverlayManager::maSmallButtonImages[0]; + bool bLarge = nShapeSizePix > 250; - Size aButtonSize( pDev->PixelToLogic(pImages[0].GetSizePixel()) ); + Size aButtonSize( pDev->PixelToLogic( getButtonImage(0, bLarge )->GetSizePixel()) ); const int nColumns = 2; const int nRows = 2; @@ -490,17 +514,6 @@ ViewOverlayManager::~ViewOverlayManager() // -------------------------------------------------------------------- -void ViewOverlayManager::UpdateImages() -{ - for( sal_uInt16 i = 0; i < (BMP_PLACEHOLDER_SMALL_END-BMP_PLACEHOLDER_SMALL_START); i++ ) - { - maSmallButtonImages[i] = loadImageResource( BMP_PLACEHOLDER_SMALL_START + i ); - maLargeButtonImages[i] = loadImageResource( BMP_PLACEHOLDER_LARGE_START + i ); - } -} - -// -------------------------------------------------------------------- - void ViewOverlayManager::Notify(SfxBroadcaster&, const SfxHint& rHint) { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); @@ -548,9 +561,6 @@ bool ViewOverlayManager::CreateTags() if( pPage ) { - if( !maSmallButtonImages[0] ) - UpdateImages(); - const std::list< SdrObject* >& rShapes = pPage->GetPresentationShapeList().getList(); for( std::list< SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); iter++ ) |