diff options
author | Kurt Zenker <kz@openoffice.org> | 2007-02-12 13:31:47 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2007-02-12 13:31:47 +0000 |
commit | 00c05c2070982741d471bb1b44c7fdc6da782e3c (patch) | |
tree | 848c2aa13f67679df3faf709fcfa60bd8437f0f1 /sd/source/ui/view/drviews7.cxx | |
parent | INTEGRATION: CWS impress117_SRC680 (1.45.18.1.4); FILE MERGED (diff) | |
download | core-00c05c2070982741d471bb1b44c7fdc6da782e3c.tar.gz core-00c05c2070982741d471bb1b44c7fdc6da782e3c.zip |
INTEGRATION: CWS impress117_SRC680 (1.71.48); FILE MERGED
2007/02/06 14:11:46 cl 1.71.48.1: #i74213# check SdrPageView for null
Diffstat (limited to 'sd/source/ui/view/drviews7.cxx')
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 87 |
1 files changed, 48 insertions, 39 deletions
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 412d8ae68f3c..24f2da2fe65d 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -4,9 +4,9 @@ * * $RCSfile: drviews7.cxx,v $ * - * $Revision: 1.71 $ + * $Revision: 1.72 $ * - * last change: $Author: kz $ $Date: 2006-12-12 19:13:11 $ + * last change: $Author: kz $ $Date: 2007-02-12 14:31:47 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -387,20 +387,23 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_EXPAND_PAGE)) { - BOOL bDisable = TRUE; - SdPage* pPage = (SdPage*) pPageView->GetPage(); - - if ( pPage->GetPageKind() == PK_STANDARD && !pPage->IsMasterPage() ) + bool bDisable = true; + if( pPageView ) { - SdrObject* pObj = pPage->GetPresObj(PRESOBJ_OUTLINE); + SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() ); - if (pObj && !pObj->IsEmptyPresObj()) + if( pPage && (pPage->GetPageKind() == PK_STANDARD) && !pPage->IsMasterPage() ) { - bDisable = FALSE; + SdrObject* pObj = pPage->GetPresObj(PRESOBJ_OUTLINE); + + if(pObj && !pObj->IsEmptyPresObj()) + { + bDisable = false; + } } } - if (bDisable) + if(bDisable) { rSet.DisableItem(SID_EXPAND_PAGE); } @@ -408,20 +411,23 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_SUMMARY_PAGE)) { - BOOL bDisable = TRUE; - SdPage* pPage = (SdPage*) pPageView->GetPage(); - - if (pPage->GetPageKind() == PK_STANDARD && !pPage->IsMasterPage() ) + bool bDisable = true; + if( pPageView ) { - SdrObject* pObj = pPage->GetPresObj(PRESOBJ_TITLE); + SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() ); - if (pObj && !pObj->IsEmptyPresObj()) + if( pPage && (pPage->GetPageKind() == PK_STANDARD) && !pPage->IsMasterPage() ) { - bDisable = FALSE; + SdrObject* pObj = pPage->GetPresObj(PRESOBJ_TITLE); + + if(pObj && !pObj->IsEmptyPresObj()) + { + bDisable = false; + } } } - if (bDisable) + if(bDisable) { rSet.DisableItem(SID_SUMMARY_PAGE); } @@ -840,36 +846,39 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) if (rSet.GetItemState(SID_TITLE_MASTERPAGE) == SFX_ITEM_AVAILABLE) { - SdPage* pMPage = (SdPage*) pPageView->GetPage(); - BOOL bCheck = FALSE; BOOL bDisable = TRUE; - USHORT i = 0; - USHORT nCount = GetDoc()->GetSdPageCount(PK_STANDARD); - - // Referenziert eine Seite mit dem AutoLayout "Titel" die - // aktuelle MasterPage? - while (i < nCount && !bCheck && bDisable) + if( pPageView ) { - SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD); + SdPage* pMPage = dynamic_cast< SdPage* >( pPageView->GetPage() ); - // Seite referenziert aktuelle MasterPage - if (pPage->GetAutoLayout() == AUTOLAYOUT_TITLE) - { - // Eine Seite hat das AutoLayout "Titel" - bDisable = FALSE; + USHORT i = 0; + USHORT nCount = GetDoc()->GetSdPageCount(PK_STANDARD); - SdPage& rRefMPage = (SdPage&)(pPage->TRG_GetMasterPage()); + // Referenziert eine Seite mit dem AutoLayout "Titel" die + // aktuelle MasterPage? + while (i < nCount && !bCheck && bDisable) + { + SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD); - if(&rRefMPage == pMPage) + // Seite referenziert aktuelle MasterPage + if (pPage->GetAutoLayout() == AUTOLAYOUT_TITLE) { - // Eine Seite mit dem AutoLayout "Titel" - // referenziert die aktuelle MasterPage - bCheck = TRUE; + // Eine Seite hat das AutoLayout "Titel" + bDisable = FALSE; + + SdPage& rRefMPage = (SdPage&)(pPage->TRG_GetMasterPage()); + + if(&rRefMPage == pMPage) + { + // Eine Seite mit dem AutoLayout "Titel" + // referenziert die aktuelle MasterPage + bCheck = TRUE; + } } - } - i++; + i++; + } } if (bCheck) |