diff options
Diffstat (limited to 'sd/source/ui/dlg')
-rw-r--r-- | sd/source/ui/dlg/filedlg.cxx | 15 | ||||
-rw-r--r-- | sd/source/ui/dlg/present.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/dlg/sddlgfact.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/dlg/sddlgfact.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpaction.cxx | 42 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 2 |
6 files changed, 36 insertions, 41 deletions
diff --git a/sd/source/ui/dlg/filedlg.cxx b/sd/source/ui/dlg/filedlg.cxx index a80feb80e3f7..ea869cc064cc 100644 --- a/sd/source/ui/dlg/filedlg.cxx +++ b/sd/source/ui/dlg/filedlg.cxx @@ -142,7 +142,7 @@ IMPL_LINK( SdFileDialog_Imp, PlayMusicHdl, void *, EMPTYARG ) mbLabelPlaying = sal_False; } - catch( css::lang::IllegalArgumentException ) + catch(const css::lang::IllegalArgumentException&) { #ifdef DBG_UTIL OSL_FAIL( "Cannot access play button" ); @@ -161,9 +161,8 @@ IMPL_LINK( SdFileDialog_Imp, PlayMusicHdl, void *, EMPTYARG ) maUpdateTimer.SetTimeout( 100 ); maUpdateTimer.Start(); } - catch( css::uno::Exception& e ) + catch (const css::uno::Exception&) { - (void)e; mxPlayer.clear(); } @@ -176,7 +175,7 @@ IMPL_LINK( SdFileDialog_Imp, PlayMusicHdl, void *, EMPTYARG ) mbLabelPlaying = sal_True; } - catch( css::lang::IllegalArgumentException ) + catch (const css::lang::IllegalArgumentException&) { #ifdef DBG_UTIL OSL_FAIL( "Cannot access play button" ); @@ -212,7 +211,7 @@ IMPL_LINK( SdFileDialog_Imp, IsMusicStoppedHdl, void *, EMPTYARG ) String( SdResId( STR_PLAY ) ) ); mbLabelPlaying = sal_False; } - catch( css::lang::IllegalArgumentException ) + catch (const css::lang::IllegalArgumentException&) { #ifdef DBG_UTIL OSL_FAIL( "Cannot access play button" ); @@ -237,7 +236,7 @@ void SdFileDialog_Imp::CheckSelectionState() else mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, sal_True ); } - catch( css::lang::IllegalArgumentException ) + catch (const css::lang::IllegalArgumentException&) { #ifdef DBG_UTIL OSL_FAIL( "Cannot access \"selection\" checkbox" ); @@ -271,7 +270,7 @@ SdFileDialog_Imp::SdFileDialog_Imp( const short nDialogType, mxControlAccess->setLabel( css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY, String( SdResId( STR_PLAY ) ) ); } - catch( css::lang::IllegalArgumentException ) + catch (const css::lang::IllegalArgumentException&) { #ifdef DBG_UTIL OSL_FAIL( "Cannot set play button label" ); @@ -284,7 +283,7 @@ SdFileDialog_Imp::SdFileDialog_Imp( const short nDialogType, { mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, sal_False ); } - catch( css::lang::IllegalArgumentException ) + catch (const css::lang::IllegalArgumentException&) { #ifdef DBG_UTIL OSL_FAIL( "Cannot disable selection checkbox" ); diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index 192e57c21b91..a345d5827114 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -55,7 +55,7 @@ using namespace ::com::sun::star::beans; \************************************************************************/ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow, const SfxItemSet& rInAttrs, - List& rPageNames, List* pCSList ) : + const std::vector<String> &rPageNames, List* pCSList ) : ModalDialog ( pWindow, SdResId( DLG_START_PRESENTATION ) ), aGrpRange ( this, SdResId( GRP_RANGE ) ), aRbtAll ( this, SdResId( RBT_ALL ) ), @@ -119,14 +119,8 @@ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow, aTmfPause.SetAccessibleName(aRbtAuto.GetText()); // Listbox mit Seitennamen fuellen - rPageNames.First(); - for( sal_uInt16 i = 0; - i < rPageNames.Count(); - i++ ) - { - aLbDias.InsertEntry( *( String* ) rPageNames.GetCurObject() ); - rPageNames.Next(); - } + for (std::vector<String>::const_iterator pIter = rPageNames.begin(); pIter != rPageNames.end(); ++pIter) + aLbDias.InsertEntry(*pIter); if( pCustomShowList ) { diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index bb1930c43b2a..33bd1013211c 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -484,7 +484,8 @@ SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg( : // add for OutlineBulletDlg end // add for SdStartPresentationDlg begin -AbstractSdStartPresDlg * SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, List& rPageNames, List* pCSList ) +AbstractSdStartPresDlg * SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, + const std::vector<String> &rPageNames, List* pCSList ) { return new AbstractSdStartPresDlg_Impl( new SdStartPresentationDlg( pWindow, rInAttrs, rPageNames, pCSList ) ); } diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index 5ff7effcbc33..612d7878e8a6 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -273,7 +273,8 @@ public: virtual AbstractMorphDlg* CreateMorphDlg( ::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2); virtual SfxAbstractTabDialog* CreateSdOutlineBulletTabDlg ( ::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView = NULL ); virtual SfxAbstractTabDialog* CreateSdParagraphTabDlg ( ::Window* pParent, const SfxItemSet* pAttr ); - virtual AbstractSdStartPresDlg* CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, List& rPageNames, List* pCSList ); + virtual AbstractSdStartPresDlg* CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, + const std::vector<String> &rPageNames, List* pCSList ); virtual SfxAbstractTabDialog* CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, ::Window* pParent, SdResId DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ); virtual AbstractSdPresLayoutDlg* CreateSdPresLayoutDlg( ::sd::DrawDocShell* pDocShell, ::sd::ViewShell* pViewShell, ::Window* pWindow, const SfxItemSet& rInAttrs); virtual SfxAbstractTabDialog* CreateSdTabTemplateDlg( ::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ); diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index e56d98f3fddf..988b288871e0 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -170,7 +170,6 @@ SdTPAction::SdTPAction( Window* pWindow, const SfxItemSet& rInAttrs ) : SdTPAction::~SdTPAction() { - delete pCurrentActions; } // ----------------------------------------------------------------------- @@ -267,25 +266,24 @@ void SdTPAction::Construct() } } - pCurrentActions = new List; - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_NONE, LIST_APPEND); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_PREVPAGE, LIST_APPEND); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_NEXTPAGE, LIST_APPEND); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_FIRSTPAGE, LIST_APPEND); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_LASTPAGE, LIST_APPEND); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_BOOKMARK, LIST_APPEND); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_DOCUMENT, LIST_APPEND); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_SOUND, LIST_APPEND); + maCurrentActions.push_back( presentation::ClickAction_NONE ); + maCurrentActions.push_back( presentation::ClickAction_PREVPAGE ); + maCurrentActions.push_back( presentation::ClickAction_NEXTPAGE ); + maCurrentActions.push_back( presentation::ClickAction_FIRSTPAGE ); + maCurrentActions.push_back( presentation::ClickAction_LASTPAGE ); + maCurrentActions.push_back( presentation::ClickAction_BOOKMARK ); + maCurrentActions.push_back( presentation::ClickAction_DOCUMENT ); + maCurrentActions.push_back( presentation::ClickAction_SOUND ); if( bOLEAction && aLbOLEAction.GetEntryCount() ) - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_VERB, LIST_APPEND ); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_PROGRAM, LIST_APPEND); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_MACRO, LIST_APPEND); - pCurrentActions->Insert((void*)(sal_uIntPtr)presentation::ClickAction_STOPPRESENTATION, LIST_APPEND); + maCurrentActions.push_back( presentation::ClickAction_VERB ); + maCurrentActions.push_back( presentation::ClickAction_PROGRAM ); + maCurrentActions.push_back( presentation::ClickAction_MACRO ); + maCurrentActions.push_back( presentation::ClickAction_STOPPRESENTATION ); // Action-Listbox fuellen - for (sal_uLong nAction = 0; nAction < pCurrentActions->Count(); nAction++) + for (size_t nAction = 0, n = maCurrentActions.size(); nAction < n; nAction++) { - sal_uInt16 nRId = GetClickActionSdResId((presentation::ClickAction)(sal_uLong)pCurrentActions->GetObject(nAction)); + sal_uInt16 nRId = GetClickActionSdResId( maCurrentActions[ nAction ] ); aLbAction.InsertEntry( String( SdResId( nRId ) ) ); } @@ -753,8 +751,8 @@ presentation::ClickAction SdTPAction::GetActualClickAction() presentation::ClickAction eCA = presentation::ClickAction_NONE; sal_uInt16 nPos = aLbAction.GetSelectEntryPos(); - if (nPos != LISTBOX_ENTRY_NOTFOUND) - eCA = (presentation::ClickAction)(sal_uLong)pCurrentActions->GetObject((sal_uLong)nPos); + if (nPos != LISTBOX_ENTRY_NOTFOUND && nPos < maCurrentActions.size()) + eCA = maCurrentActions[ nPos ]; return( eCA ); } @@ -762,9 +760,11 @@ presentation::ClickAction SdTPAction::GetActualClickAction() void SdTPAction::SetActualClickAction( presentation::ClickAction eCA ) { - sal_uInt16 nPos = (sal_uInt16)pCurrentActions->GetPos((void*)(sal_uLong)eCA); - DBG_ASSERT(nPos != 0xffff, "unbekannte Interaktion"); - aLbAction.SelectEntryPos(nPos); + std::vector<com::sun::star::presentation::ClickAction>::const_iterator pIter = + std::find(maCurrentActions.begin(),maCurrentActions.end(),eCA); + + if ( pIter != maCurrentActions.end() ) + aLbAction.SelectEntryPos( pIter-maCurrentActions.begin() ); } //------------------------------------------------------------------------ diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 8f1c4135e3a2..1ed3d3d9b8c7 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -825,7 +825,7 @@ void SdTpOptionsMisc::UpdateCompatibilityControls (void) } while (false); // One 'loop'. } - catch (uno::Exception e) + catch (const uno::Exception&) { // When there is an exception then simply use the default value of // bIsEnabled and disable the controls. |