diff options
author | Andre Fischer <af@openoffice.org> | 2002-11-14 14:01:00 +0000 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2002-11-14 14:01:00 +0000 |
commit | 5208a00b76f714e58590164ce84917571041ce28 (patch) | |
tree | 3549144fe5e0b8c014d41ae691da0f8746188e30 /sd/source/ui/dlg/sdtreelb.cxx | |
parent | e9d017a8e9c7777f6e4b8524afe67cf8932e3394 (diff) |
#105025# Pages not belonging to the current show are grayed out.
Diffstat (limited to 'sd/source/ui/dlg/sdtreelb.cxx')
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 4faf280cc798..a93702fb89c7 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdtreelb.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: iha $ $Date: 2002-09-26 10:01:42 $ + * last change: $Author: af $ $Date: 2002-11-14 15:01:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,6 +84,9 @@ #ifndef _SVDOOLE2_HXX //autogen #include <svx/svdoole2.hxx> #endif +#ifndef _SD_CUSSHOW_HXX +#include "cusshow.hxx" +#endif #include "strmname.h" #include "sdtreelb.hxx" @@ -319,6 +322,9 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, BOOL bAllPages, { BOOL bPageExluded = pPage->IsExcluded(); + bool bPageBelongsToShow = PageBelongsToCurrentShow (pPage); + bPageExluded |= !bPageBelongsToShow; + pEntry = InsertEntry( pPage->GetName(), bPageExluded ? aImgPageExcl : aImgPage, bPageExluded ? aImgPageExcl : aImgPage ); @@ -1014,3 +1020,34 @@ IMPL_STATIC_LINK(SdPageObjsTLB, ExecDragHdl, void*, EMPTYARG) } +bool SdPageObjsTLB::PageBelongsToCurrentShow (const SdPage* pPage) const +{ + // Return <TRUE/> as default when there is no custom show or when none + // is used. The page does then belong to the standard show. + bool bBelongsToShow = true; + + if (pDoc->IsCustomShow()) + { + // Get the current custom show. + SdCustomShow* pCustomShow = NULL; + List* pShowList = const_cast<SdDrawDocument*>(pDoc)->GetCustomShowList(); + if (pShowList != NULL) + { + ULONG nCurrentShowIndex = pShowList->GetCurPos(); + void* pObject = pShowList->GetObject(nCurrentShowIndex); + pCustomShow = static_cast<SdCustomShow*>(pObject); + } + + // Check whether the given page is part of that custom show. + if (pCustomShow != NULL) + { + bBelongsToShow = false; + ULONG nPageCount = pCustomShow->Count(); + for (USHORT i=0; i<nPageCount && !bBelongsToShow; i++) + if (pPage == static_cast<SdPage*>(pCustomShow->GetObject (i))) + bBelongsToShow = true; + } + } + + return bBelongsToShow; +} |