diff -Naur sd/inc/drawdoc.hxx sd_new/inc/drawdoc.hxx --- sd/inc/drawdoc.hxx 2009-09-16 22:55:36.305490000 +0800 +++ sd_new/inc/drawdoc.hxx 2010-02-08 20:43:02.679969000 +0800 @@ -371,7 +371,8 @@ const sd::PresentationSettings& getPresentationSettings() const { return maPresentationSettings; } sd::PresentationSettings& getPresentationSettings() { return maPresentationSettings; } - + BOOL IsCustomShow(){ return maPresentationSettings.mbCustomShow;}//add by yujinliang + BOOL IsCanStartCustomShow();//add by yujinliang const ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 >& getPresentation() const; void SetSummationOfParagraphs( BOOL bOn = TRUE ) { mbSummationOfParagraphs = bOn; } diff -Naur sd/source/core/drawdoc.cxx sd_new/source/core/drawdoc.cxx --- sd/source/core/drawdoc.cxx 2009-09-17 20:26:03.415253000 +0800 +++ sd_new/source/core/drawdoc.cxx 2010-02-08 21:13:18.331970000 +0800 @@ -382,7 +382,34 @@ } +//add by yujinliang +BOOL SdDrawDocument::IsCanStartCustomShow() +{ + if( !IsCustomShow() ) return FALSE; + SdCustomShow* pCustomShow = NULL; + List* pCustomShowList = GetCustomShowList(); + BOOL bAllPagesHidden = TRUE; + if ( pCustomShowList ) + { + pCustomShow = (SdCustomShow*)pCustomShowList->GetCurObject(); + void* pCustomSlide = NULL; + if( pCustomShow ) + { + for( pCustomSlide = pCustomShow->First(); pCustomSlide; pCustomSlide = pCustomShow->Next()) + { + if( !( ((SdPage*)pCustomSlide)->IsExcluded() )) + { + bAllPagesHidden = FALSE; + break; + } + } + } + + } + return !bAllPagesHidden; + +} /************************************************************************* |* |* Destruktor diff -Naur sd/source/ui/slidesorter/controller/SlsSlotManager.cxx sd_new/source/ui/slidesorter/controller/SlsSlotManager.cxx --- sd/source/ui/slidesorter/controller/SlsSlotManager.cxx 2009-09-18 19:15:03.661735000 +0800 +++ sd_new/source/ui/slidesorter/controller/SlsSlotManager.cxx 2010-02-08 20:43:59.443099000 +0800 @@ -635,7 +635,7 @@ if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PRESENTATION ) || SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_REHEARSE_TIMINGS ) ) { - BOOL bDisable = TRUE; + BOOL bDisable = FALSE; model::PageEnumeration aAllPages ( model::PageEnumerationProvider::CreateAllPagesEnumeration(mrSlideSorter.GetModel())); while (aAllPages.HasMoreElements()) @@ -645,6 +645,9 @@ if( !pPage->IsExcluded() ) bDisable = FALSE; } + //add by yujinliang + SdDrawDocument* pSdDoc = mrSlideSorter.GetModel().GetDocument(); + if( pSdDoc && pSdDoc->IsCustomShow() && !pSdDoc->IsCanStartCustomShow() ) bDisable = TRUE; if( bDisable || pDocShell->IsPreview()) { rSet.DisableItem( SID_PRESENTATION ); diff -Naur sd/source/ui/view/drviews7.cxx sd_new/source/ui/view/drviews7.cxx --- sd/source/ui/view/drviews7.cxx 2009-09-18 19:15:03.661735000 +0800 +++ sd_new/source/ui/view/drviews7.cxx 2010-02-08 20:43:02.684469000 +0800 @@ -371,7 +371,8 @@ if( !pPage->IsExcluded() ) bDisable = FALSE; } - + //add by yujinliang + if( GetDoc()->IsCustomShow() && !GetDoc()->IsCanStartCustomShow() ) bDisable = TRUE; if( bDisable || GetDocSh()->IsPreview()) { rSet.DisableItem( SID_PRESENTATION ); diff -Naur sd/source/ui/view/outlnvsh.cxx sd_new/source/ui/view/outlnvsh.cxx --- sd/source/ui/view/outlnvsh.cxx 2009-09-18 19:15:03.661735000 +0800 +++ sd_new/source/ui/view/outlnvsh.cxx 2010-02-08 20:43:02.684469000 +0800 @@ -1120,6 +1120,8 @@ if( !pPage->IsExcluded() ) bDisable = FALSE; } + //add by yujinliang + if( GetDoc()->IsCustomShow() && !GetDoc()->IsCanStartCustomShow() ) bDisable = TRUE; if( bDisable || GetDocSh()->IsPreview()) { rSet.DisableItem( SID_PRESENTATION );