diff options
author | Jennifer Liebel <jliebel94@gmail.com> | 2014-09-23 09:14:21 +0000 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-09-24 19:30:05 +0000 |
commit | e16c8534f446a7cc311d6d5026aae5457e4f8e6c (patch) | |
tree | 1f88836de838d56db0898d60bc732a751a19011e /sd/source/ui | |
parent | 16ea2665cdfa0b3d7b0d7abcdaae8d60f7654d24 (diff) |
fdo#47302: Added insert->fields->page title button
Change-Id: Iebc8298a7e6a7d423d2667eec8a46a936cc4d2cd
Reviewed-on: https://gerrit.libreoffice.org/11599
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/app/sdmod2.cxx | 27 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvs2.cxx | 5 |
4 files changed, 41 insertions, 0 deletions
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 2ad2f2b13a94..8a25098858a6 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -246,6 +246,33 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) pInfo->SetRepresentation( aRepresentation ); } + + else if( dynamic_cast< const SvxPageTitleField* >(pField) ) + { + OUString aRepresentation(" "); + + ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; + if(pViewSh == NULL) + { + ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current()); + if(pBase) + pViewSh = pBase->GetMainViewShell().get(); + } + if( !pDoc && pViewSh ) + pDoc = pViewSh->GetDoc(); + + bool bMasterView; + SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView ); + + if( pPage && pDoc && !bMasterView ) + { + aRepresentation = pPage->GetName(); + } + + pInfo->SetRepresentation( aRepresentation ); + } + else if( dynamic_cast< const SvxPagesField* >(pField) ) + OUString aRepresentation; else if( dynamic_cast< const SvxPagesField* >(pField) ) { OUString aRepresentation(" "); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 59ece90fb2d7..c6e7718021e0 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1873,6 +1873,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_INSERT_FLD_TIME_VAR: case SID_INSERT_FLD_AUTHOR: case SID_INSERT_FLD_PAGE: + case SID_INSERT_FLD_PAGE_TITLE: case SID_INSERT_FLD_PAGES: case SID_INSERT_FLD_FILE: { @@ -1915,6 +1916,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } break; + case SID_INSERT_FLD_PAGE_TITLE: + { + pFieldItem.reset(new SvxFieldItem( SvxPageTitleField(), EE_FEATURE_FIELD)); + nMul = 3; + } + break; + case SID_INSERT_FLD_PAGES: { pFieldItem.reset(new SvxFieldItem( SvxPagesField(), EE_FEATURE_FIELD )); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 67227ba524db..ccb460184933 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1114,6 +1114,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) rSet.DisableItem( SID_INSERT_FLD_TIME_VAR ); rSet.DisableItem( SID_INSERT_FLD_AUTHOR ); rSet.DisableItem( SID_INSERT_FLD_PAGE ); + rSet.DisableItem( SID_INSERT_FLD_PAGE_TITLE ); rSet.DisableItem( SID_INSERT_FLD_PAGES ); rSet.DisableItem( SID_INSERT_FLD_FILE ); diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index 249780c5177e..ca46d998eaf3 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -484,6 +484,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) case SID_INSERT_FLD_TIME_VAR: case SID_INSERT_FLD_AUTHOR: case SID_INSERT_FLD_PAGE: + case SID_INSERT_FLD_PAGE_TITLE: case SID_INSERT_FLD_PAGES: case SID_INSERT_FLD_FILE: { @@ -523,6 +524,10 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) pFieldItem.reset(new SvxFieldItem( SvxPageField(), EE_FEATURE_FIELD )); break; + case SID_INSERT_FLD_PAGE_TITLE: + pFieldItem.reset(new SvxFieldItem( SvxPageTitleField(), EE_FEATURE_FIELD)); + break; + case SID_INSERT_FLD_PAGES: pFieldItem.reset(new SvxFieldItem( SvxPagesField(), EE_FEATURE_FIELD )); break; |