diff options
author | Gulsah Kose <gulsah.1004@gmail.com> | 2018-11-04 22:06:10 +0300 |
---|---|---|
committer | Gülşah Köse <gulsah.1004@gmail.com> | 2018-11-04 22:50:02 +0100 |
commit | 7cf6cee97bc05512fae482733ee45f039e9d2160 (patch) | |
tree | e018b56ffb8fc0d4de929a99098b97abe1e27cdd /sd | |
parent | 92af2b5e36a403ff8f81d81d047b2d1dc340cef9 (diff) |
[Pardus] Make the slide change command accessible.
Allows to call uno:RenamePage from the android viewer and LibreOffice
online. This patch is sponsored by ULAKBIM/Pardus project.
Change-Id: Ife814846bd7076e9f8830bce4c2451cb6b44a15a
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/62860
Diffstat (limited to 'sd')
-rw-r--r-- | sd/sdi/sdraw.sdi | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 46 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 36 |
3 files changed, 52 insertions, 32 deletions
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi index 7a7c53bb5bed..233200c0c22f 100644 --- a/sd/sdi/sdraw.sdi +++ b/sd/sdi/sdraw.sdi @@ -3282,7 +3282,7 @@ SfxVoidItem RenameLayer SID_RENAMELAYER ] SfxVoidItem RenamePage SID_RENAMEPAGE -() +(SfxStringItem Name SID_RENAMEPAGE) [ AutoUpdate = FALSE, FastCall = FALSE, diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index d336a312ecab..0a8f11f58271 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -873,29 +873,39 @@ void SlotManager::RenameSlide(const SfxRequest& rRequest) OUString aDescr( SdResId( STR_DESC_RENAMESLIDE ) ); OUString aPageName = pSelectedPage->GetName(); - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - vcl::Window* pWin = mrSlideSorter.GetContentWindow(); - ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog( - pWin ? pWin->GetFrameWeld() : nullptr, - aPageName, aDescr)); - aNameDlg->SetText( aTitle ); - aNameDlg->SetCheckNameHdl( LINK( this, SlotManager, RenameSlideHdl ), true ); - aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE ); + if(rRequest.GetArgs()) + { + OUString aName; + aName = rRequest.GetArgs()->GetItem<const SfxStringItem>(SID_RENAMEPAGE)->GetValue(); - if( aNameDlg->Execute() == RET_OK ) + bool bResult = RenameSlideFromDrawViewShell(pSelectedPage->GetPageNum()/2, aName ); + DBG_ASSERT( bResult, "Couldn't rename slide" ); + } + else { - OUString aNewName; - aNameDlg->GetName( aNewName ); - if (aNewName != aPageName) + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + vcl::Window* pWin = mrSlideSorter.GetContentWindow(); + ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog( + pWin ? pWin->GetFrameWeld() : nullptr, + aPageName, aDescr)); + aNameDlg->SetText( aTitle ); + aNameDlg->SetCheckNameHdl( LINK( this, SlotManager, RenameSlideHdl ), true ); + aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE ); + + if( aNameDlg->Execute() == RET_OK ) { - bool bResult = - RenameSlideFromDrawViewShell( - pSelectedPage->GetPageNum()/2, aNewName ); - DBG_ASSERT( bResult, "Couldn't rename slide" ); + OUString aNewName; + aNameDlg->GetName( aNewName ); + if (aNewName != aPageName) + { + bool bResult = + RenameSlideFromDrawViewShell( + pSelectedPage->GetPageNum()/2, aNewName ); + DBG_ASSERT( bResult, "Couldn't rename slide" ); + } } + aNameDlg.disposeAndClear(); } - aNameDlg.disposeAndClear(); - // Tell the slide sorter about the name change (necessary for // accessibility.) mrSlideSorter.GetController().PageNameHasChanged( diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 90ae9fbb5896..37690eac773f 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -788,26 +788,36 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) OUString aDescr = SdResId(STR_DESC_RENAMESLIDE); const OUString& aPageName = pCurrentPage->GetName(); - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aPageName, aDescr)); - aNameDlg->SetText( aTitle ); - aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, RenameSlideHdl ), true ); - aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE ); + if(rReq.GetArgs()) + { + OUString aName; + aName = rReq.GetArgs()->GetItem<const SfxStringItem>(SID_RENAMEPAGE)->GetValue(); - if( aNameDlg->Execute() == RET_OK ) + bool bResult = RenameSlide( maTabControl->GetPageId(nPage), aName ); + DBG_ASSERT( bResult, "Couldn't rename slide" ); + } + else { - OUString aNewName; - aNameDlg->GetName( aNewName ); - if (aNewName != aPageName) + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aPageName, aDescr)); + aNameDlg->SetText( aTitle ); + aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, RenameSlideHdl ), true ); + aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE ); + + if( aNameDlg->Execute() == RET_OK ) { - bool bResult = RenameSlide( maTabControl->GetPageId(nPage), aNewName ); - DBG_ASSERT( bResult, "Couldn't rename slide" ); + OUString aNewName; + aNameDlg->GetName( aNewName ); + if (aNewName != aPageName) + { + bool bResult = RenameSlide( maTabControl->GetPageId(nPage), aNewName ); + DBG_ASSERT( bResult, "Couldn't rename slide" ); + } } } } - Cancel(); - rReq.Ignore (); + rReq.Ignore(); } break; |