diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2015-11-14 23:34:37 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-11-14 23:02:47 +0000 |
commit | 7272e8df62a12d6172b297d7a82a0265cd1bc44a (patch) | |
tree | c7d457a98fdaf19f90bd97558badc38ad9e61032 /sw | |
parent | 2faf5622664c322f0516dd2484fc154ae504049a (diff) |
tdf#95403 Add Outline button
Change-Id: I0d5187ed34539a05ab9f2ffdfb89118df0aa3511
Reviewed-on: https://gerrit.libreoffice.org/19964
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/sdi/_textsh.sdi | 10 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/shells/txtnum.cxx | 13 | ||||
-rw-r--r-- | sw/uiconfig/swriter/toolbar/textobjectbar.xml | 1 |
4 files changed, 32 insertions, 4 deletions
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 3cd6d8f795a7..d27eae2981f5 100644 --- a/sw/sdi/_textsh.sdi +++ b/sw/sdi/_textsh.sdi @@ -736,6 +736,11 @@ interface BaseText StateMethod = GetState ; DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; ] + FN_OUTLINE_RULE_INDEX // status(final|play) + [ + StateMethod = GetState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] FN_NUMBER_BULLETS // status(final|play) [ ExecMethod = ExecEnterNum ; @@ -804,6 +809,11 @@ interface BaseText ExecMethod = ExecSetNumber; DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; ] + FN_SVX_SET_OUTLINE + [ + ExecMethod = ExecSetNumber; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] SID_OUTLINE_BULLET // status(final|play) [ ExecMethod = ExecEnterNum ; diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 3e3e2e3b1ba6..18656e218b45 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1828,6 +1828,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) case FN_BUL_NUM_RULE_INDEX: case FN_NUM_NUM_RULE_INDEX: + case FN_OUTLINE_RULE_INDEX: { SwNumRule* pCurRule = const_cast<SwNumRule*>(GetShell().GetNumRuleAtCurrCrsrPos()); sal_uInt16 nActNumLvl = USHRT_MAX; @@ -1860,6 +1861,17 @@ void SwTextShell::GetState( SfxItemSet &rSet ) rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,nBulIndex)); } } + + if ( nWhich == FN_OUTLINE_RULE_INDEX ) + { + rSet.Put(SfxUInt16Item(FN_OUTLINE_RULE_INDEX, USHRT_MAX)); + NBOTypeMgrBase* pOutline = NBOutlineTypeMgrFact::CreateInstance(eNBOType::OUTLINE); + if ( pOutline ) + { + const sal_uInt16 nIndex = pOutline->GetNBOIndexForNumRule(aSvxRule,nActNumLvl); + rSet.Put(SfxUInt16Item(FN_OUTLINE_RULE_INDEX,nIndex)); + } + } } } break; diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index acebe2535ad3..bf159472b88d 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -246,15 +246,20 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq) { case FN_SVX_SET_NUMBER: case FN_SVX_SET_BULLET: + case FN_SVX_SET_OUTLINE: { const SfxUInt16Item* pItem = rReq.GetArg<SfxUInt16Item>(nSlot); if ( pItem != nullptr ) { const sal_uInt16 nChoosenItemIdx = pItem->GetValue(); - svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr = - nSlot == FN_SVX_SET_NUMBER - ? svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::NUMBERING ) - : svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::BULLETS ); + sal_uInt16 nNBOType = svx::sidebar::eNBOType::BULLETS; + if ( nSlot == FN_SVX_SET_NUMBER ) + nNBOType = svx::sidebar::eNBOType::NUMBERING; + else if ( nSlot == FN_SVX_SET_OUTLINE ) + nNBOType = svx::sidebar::eNBOType::OUTLINE; + + svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr = svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( nNBOType ); + if ( pNBOTypeMgr != nullptr ) { const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection(); diff --git a/sw/uiconfig/swriter/toolbar/textobjectbar.xml b/sw/uiconfig/swriter/toolbar/textobjectbar.xml index 9b9ef6234cd4..24b5be46d54d 100644 --- a/sw/uiconfig/swriter/toolbar/textobjectbar.xml +++ b/sw/uiconfig/swriter/toolbar/textobjectbar.xml @@ -51,6 +51,7 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:DefaultBullet"/> <toolbar:toolbaritem xlink:href=".uno:DefaultNumbering"/> + <toolbar:toolbaritem xlink:href=".uno:SetOutline" toolbar:visible="false"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio"/> <toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio"/> |