Kaydet (Commit) 7272e8df authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

tdf#95403 Add Outline button

Change-Id: I0d5187ed34539a05ab9f2ffdfb89118df0aa3511
Reviewed-on: https://gerrit.libreoffice.org/19964Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
üst 2faf5622
...@@ -222,6 +222,7 @@ ...@@ -222,6 +222,7 @@
#define FN_NUM_NUMBERING_ON (FN_EDIT + 44) /* Numerierung an */ #define FN_NUM_NUMBERING_ON (FN_EDIT + 44) /* Numerierung an */
#define FN_BUL_NUM_RULE_INDEX (FN_EDIT + 120) /* Achieving num rule index */ #define FN_BUL_NUM_RULE_INDEX (FN_EDIT + 120) /* Achieving num rule index */
#define FN_NUM_NUM_RULE_INDEX (FN_EDIT + 121) #define FN_NUM_NUM_RULE_INDEX (FN_EDIT + 121)
#define FN_OUTLINE_RULE_INDEX (FN_EDIT + 122)
#define FN_INSERT (SID_SW_START + 300) #define FN_INSERT (SID_SW_START + 300)
#define FN_DELETE_BOOKMARK (FN_INSERT + 1) #define FN_DELETE_BOOKMARK (FN_INSERT + 1)
...@@ -996,6 +997,7 @@ ...@@ -996,6 +997,7 @@
#define FN_SVX_SET_NUMBER ( SID_SVX_START + 1136 ) #define FN_SVX_SET_NUMBER ( SID_SVX_START + 1136 )
#define FN_SVX_SET_BULLET ( SID_SVX_START + 1137 ) #define FN_SVX_SET_BULLET ( SID_SVX_START + 1137 )
#define FN_SVX_SET_OUTLINE ( SID_SVX_START + 1138 )
#define SID_ATTR_BORDER_STYLES ( SID_SVX_START + 1140 ) #define SID_ATTR_BORDER_STYLES ( SID_SVX_START + 1140 )
#define SID_ATTR_BORDER_DEFAULT_WIDTH ( SID_SVX_START + 1141 ) #define SID_ATTR_BORDER_DEFAULT_WIDTH ( SID_SVX_START + 1141 )
......
...@@ -563,6 +563,17 @@ ...@@ -563,6 +563,17 @@
<value>com.sun.star.comp.svx.NumberingToolBoxControl</value> <value>com.sun.star.comp.svx.NumberingToolBoxControl</value>
</prop> </prop>
</node> </node>
<node oor:name="OutlineToolBox" oor:op="replace">
<prop oor:name="Command">
<value>.uno:SetOutline</value>
</prop>
<prop oor:name="Module">
<value/>
</prop>
<prop oor:name="Controller">
<value>com.sun.star.comp.svx.NumberingToolBoxControl</value>
</prop>
</node>
<node oor:name="ExtrusionDirectionFloater" oor:op="replace"> <node oor:name="ExtrusionDirectionFloater" oor:op="replace">
<prop oor:name="Command"> <prop oor:name="Command">
<value>.uno:ExtrusionDirectionFloater</value> <value>.uno:ExtrusionDirectionFloater</value>
......
...@@ -2405,6 +2405,14 @@ ...@@ -2405,6 +2405,14 @@
<value>15</value> <value>15</value>
</prop> </prop>
</node> </node>
<node oor:name=".uno:SetOutline" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Outline Presets</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>15</value>
</prop>
</node>
<node oor:name=".uno:BezierConvert" oor:op="replace"> <node oor:name=".uno:BezierConvert" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Convert to Curve</value> <value xml:lang="en-US">Convert to Curve</value>
......
...@@ -16444,3 +16444,50 @@ SfxVoidItem ParaspaceIncrease SID_PARASPACE_INCREASE ...@@ -16444,3 +16444,50 @@ SfxVoidItem ParaspaceIncrease SID_PARASPACE_INCREASE
ToolBoxConfig = TRUE, ToolBoxConfig = TRUE,
GroupId = GID_FORMAT; GroupId = GID_FORMAT;
] ]
SfxVoidItem SetOutline FN_SVX_SET_OUTLINE
(SfxUInt16Item SetOutline FN_SVX_SET_OUTLINE)
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_ENUMERATION;
]
SfxUInt16Item CurrentOutlineType FN_OUTLINE_RULE_INDEX
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
StatusBarConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = GID_ENUMERATION;
]
...@@ -246,6 +246,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) ...@@ -246,6 +246,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
// Outline numbering has to be painted into the virtual device // Outline numbering has to be painted into the virtual device
// to get correct lines // to get correct lines
// has to be made again // has to be made again
pVDev->SetLineColor(aBackColor);
pVDev->DrawRect(aOrgRect); pVDev->DrawRect(aOrgRect);
long nStartX = aOrgRect.TopLeft().X(); long nStartX = aOrgRect.TopLeft().X();
long nStartY = aOrgRect.TopLeft().Y(); long nStartY = aOrgRect.TopLeft().Y();
...@@ -352,6 +353,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) ...@@ -352,6 +353,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
long nLineTop = nStartY + nRectHeight * aLinesArr[2 * i + 1]/100 ; long nLineTop = nStartY + nRectHeight * aLinesArr[2 * i + 1]/100 ;
Point aLineLeft(aLeft.X(), nLineTop ); Point aLineLeft(aLeft.X(), nLineTop );
Point aLineRight(nStartX + nRectWidth * 90 /100, nLineTop ); Point aLineRight(nStartX + nRectWidth * 90 /100, nLineTop );
pVDev->SetLineColor(COL_LIGHTGRAY);
pVDev->DrawLine(aLineLeft, aLineRight); pVDev->DrawLine(aLineLeft, aLineRight);
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <com/sun/star/text/DefaultNumberingProvider.hpp> #include <com/sun/star/text/DefaultNumberingProvider.hpp>
#include <com/sun/star/text/XNumberingFormatter.hpp> #include <com/sun/star/text/XNumberingFormatter.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx>
#include <i18nlangtag/mslangid.hxx> #include <i18nlangtag/mslangid.hxx>
#include <sfx2/imagemgr.hxx> #include <sfx2/imagemgr.hxx>
#include <svtools/popupwindowcontroller.hxx> #include <svtools/popupwindowcontroller.hxx>
...@@ -25,7 +25,7 @@ class NumberingToolBoxControl; ...@@ -25,7 +25,7 @@ class NumberingToolBoxControl;
class NumberingPopup : public svtools::ToolbarMenu class NumberingPopup : public svtools::ToolbarMenu
{ {
bool mbBulletItem; NumberingPageType mePageType;
NumberingToolBoxControl& mrController; NumberingToolBoxControl& mrController;
VclPtr<SvxNumValueSet> mpValueSet; VclPtr<SvxNumValueSet> mpValueSet;
DECL_LINK_TYPED( VSSelectToolbarMenuHdl, ToolbarMenu*, void ); DECL_LINK_TYPED( VSSelectToolbarMenuHdl, ToolbarMenu*, void );
...@@ -34,7 +34,7 @@ class NumberingPopup : public svtools::ToolbarMenu ...@@ -34,7 +34,7 @@ class NumberingPopup : public svtools::ToolbarMenu
public: public:
NumberingPopup( NumberingToolBoxControl& rController, NumberingPopup( NumberingToolBoxControl& rController,
const css::uno::Reference< css::frame::XFrame >& rFrame, const css::uno::Reference< css::frame::XFrame >& rFrame,
vcl::Window* pParent, bool bBulletItem ); vcl::Window* pParent, NumberingPageType ePageType );
virtual ~NumberingPopup(); virtual ~NumberingPopup();
virtual void dispose() override; virtual void dispose() override;
...@@ -44,7 +44,7 @@ public: ...@@ -44,7 +44,7 @@ public:
class NumberingToolBoxControl : public svt::PopupWindowController class NumberingToolBoxControl : public svt::PopupWindowController
{ {
bool mbBulletItem; NumberingPageType mePageType;
public: public:
explicit NumberingToolBoxControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); explicit NumberingToolBoxControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
...@@ -71,31 +71,35 @@ public: ...@@ -71,31 +71,35 @@ public:
//class NumberingPopup //class NumberingPopup
NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController, NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController,
const css::uno::Reference< css::frame::XFrame >& rFrame, const css::uno::Reference< css::frame::XFrame >& rFrame,
vcl::Window* pParent, bool bBulletItem ) : vcl::Window* pParent, NumberingPageType ePageType ) :
ToolbarMenu( rFrame, pParent, WB_STDPOPUP ), ToolbarMenu( rFrame, pParent, WB_STDPOPUP ),
mbBulletItem( bBulletItem ), mePageType( ePageType ),
mrController( rController ) mrController( rController )
{ {
WinBits nBits = WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NO_DIRECTSELECT; WinBits nBits = WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NO_DIRECTSELECT;
mpValueSet = VclPtr<SvxNumValueSet>::Create( this, nBits ); mpValueSet = VclPtr<SvxNumValueSet>::Create( this, nBits );
mpValueSet->init( mbBulletItem ? NumberingPageType::BULLET : NumberingPageType::SINGLENUM ); mpValueSet->init( mePageType );
if ( !mbBulletItem ) if ( mePageType != NumberingPageType::BULLET )
{ {
css::uno::Reference< css::text::XDefaultNumberingProvider > xDefNum = css::text::DefaultNumberingProvider::create( comphelper::getProcessComponentContext() ); css::uno::Reference< css::text::XDefaultNumberingProvider > xDefNum = css::text::DefaultNumberingProvider::create( mrController.getContext() );
if ( xDefNum.is() ) if ( xDefNum.is() )
{ {
css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aNumberings;
css::lang::Locale aLocale = GetSettings().GetLanguageTag().getLocale(); css::lang::Locale aLocale = GetSettings().GetLanguageTag().getLocale();
try css::uno::Reference< css::text::XNumberingFormatter > xFormat( xDefNum, css::uno::UNO_QUERY );
if ( mePageType == NumberingPageType::SINGLENUM )
{ {
aNumberings = xDefNum->getDefaultContinuousNumberingLevels( aLocale ); css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aNumberings(
xDefNum->getDefaultContinuousNumberingLevels( aLocale ) );
mpValueSet->SetNumberingSettings( aNumberings, xFormat, aLocale );
}
else if ( mePageType == NumberingPageType::OUTLINE )
{
css::uno::Sequence< css::uno::Reference< css::container::XIndexAccess > > aOutline(
xDefNum->getDefaultOutlineNumberings( aLocale ) );
mpValueSet->SetOutlineNumberingSettings( aOutline, xFormat, aLocale );
} }
catch( css::uno::Exception& )
{}
css::uno::Reference< css::text::XNumberingFormatter > xFormat( xDefNum, css::uno::UNO_QUERY );
mpValueSet->SetNumberingSettings( aNumberings, xFormat, aLocale );
} }
} }
...@@ -107,19 +111,28 @@ NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController, ...@@ -107,19 +111,28 @@ NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController,
appendEntry( 0, mpValueSet ); appendEntry( 0, mpValueSet );
appendSeparator(); appendSeparator();
if ( mbBulletItem ) OUString aMoreItemText;
appendEntry( 1, SVX_RESSTR( RID_SVXSTR_MOREBULLETS ), ::GetImage( rFrame, ".uno:OutlineBullet", false ) ); if ( mePageType == NumberingPageType::BULLET )
{
aMoreItemText = SVX_RESSTR( RID_SVXSTR_MOREBULLETS );
AddStatusListener( ".uno:CurrentBulletListType" );
}
else if ( mePageType == NumberingPageType::SINGLENUM )
{
aMoreItemText = SVX_RESSTR( RID_SVXSTR_MORENUMBERING );
AddStatusListener( ".uno:CurrentNumListType" );
}
else else
appendEntry( 1, SVX_RESSTR( RID_SVXSTR_MORENUMBERING ), ::GetImage( rFrame, ".uno:OutlineBullet", false ) ); {
aMoreItemText = SVX_RESSTR( RID_SVXSTR_MORE );
AddStatusListener( ".uno:CurrentOutlineType" );
}
appendEntry( 1, aMoreItemText, ::GetImage( rFrame, ".uno:OutlineBullet", false ) );
SetOutputSizePixel( getMenuSize() ); SetOutputSizePixel( getMenuSize() );
mpValueSet->SetSelectHdl( LINK( this, NumberingPopup, VSSelectValueSetHdl ) ); mpValueSet->SetSelectHdl( LINK( this, NumberingPopup, VSSelectValueSetHdl ) );
SetSelectHdl( LINK( this, NumberingPopup, VSSelectToolbarMenuHdl ) ); SetSelectHdl( LINK( this, NumberingPopup, VSSelectToolbarMenuHdl ) );
if ( mbBulletItem )
AddStatusListener( ".uno:CurrentBulletListType" );
else
AddStatusListener( ".uno:CurrentNumListType" );
} }
NumberingPopup::~NumberingPopup() NumberingPopup::~NumberingPopup()
...@@ -160,19 +173,21 @@ void NumberingPopup::VSSelectHdl(void* pControl) ...@@ -160,19 +173,21 @@ void NumberingPopup::VSSelectHdl(void* pControl)
if ( pControl == mpValueSet ) if ( pControl == mpValueSet )
{ {
sal_uInt16 nSelItem = mpValueSet->GetSelectItemId(); sal_uInt16 nSelItem = mpValueSet->GetSelectItemId();
css::uno::Sequence< css::beans::PropertyValue > aArgs( 1 ); if ( mePageType == NumberingPageType::BULLET )
if ( mbBulletItem )
{ {
aArgs[0].Name = "SetBullet"; auto aArgs( comphelper::InitPropertySequence( { { "SetBullet", css::uno::makeAny( nSelItem ) } } ) );
aArgs[0].Value <<= sal_uInt16( nSelItem );
mrController.dispatchCommand( ".uno:SetBullet", aArgs ); mrController.dispatchCommand( ".uno:SetBullet", aArgs );
} }
else else if ( mePageType == NumberingPageType::SINGLENUM )
{ {
aArgs[0].Name = "SetNumber"; auto aArgs( comphelper::InitPropertySequence( { { "SetNumber", css::uno::makeAny( nSelItem ) } } ) );
aArgs[0].Value <<= sal_uInt16( nSelItem );
mrController.dispatchCommand( ".uno:SetNumber", aArgs ); mrController.dispatchCommand( ".uno:SetNumber", aArgs );
} }
else
{
auto aArgs( comphelper::InitPropertySequence( { { "SetOutline", css::uno::makeAny( nSelItem ) } } ) );
mrController.dispatchCommand( ".uno:SetOutline", aArgs );
}
} }
else if ( getSelectedEntryId() == 1 ) else if ( getSelectedEntryId() == 1 )
{ {
...@@ -183,9 +198,7 @@ void NumberingPopup::VSSelectHdl(void* pControl) ...@@ -183,9 +198,7 @@ void NumberingPopup::VSSelectHdl(void* pControl)
// Writer variants // Writer variants
aPageName = "options"; aPageName = "options";
css::uno::Sequence< css::beans::PropertyValue > aArgs( 1 ); auto aArgs( comphelper::InitPropertySequence( { { "Page", css::uno::makeAny( aPageName ) } } ) );
aArgs[0].Name = "Page";
aArgs[0].Value <<= aPageName;
mrController.dispatchCommand( ".uno:OutlineBullet", aArgs ); mrController.dispatchCommand( ".uno:OutlineBullet", aArgs );
} }
} }
...@@ -194,13 +207,13 @@ void NumberingPopup::VSSelectHdl(void* pControl) ...@@ -194,13 +207,13 @@ void NumberingPopup::VSSelectHdl(void* pControl)
//class NumberingToolBoxControl //class NumberingToolBoxControl
NumberingToolBoxControl::NumberingToolBoxControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext ): NumberingToolBoxControl::NumberingToolBoxControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext ):
svt::PopupWindowController( rxContext, css::uno::Reference< css::frame::XFrame >(), OUString() ), svt::PopupWindowController( rxContext, css::uno::Reference< css::frame::XFrame >(), OUString() ),
mbBulletItem( false ) mePageType( NumberingPageType::SINGLENUM )
{ {
} }
VclPtr<vcl::Window> NumberingToolBoxControl::createPopupWindow( vcl::Window* pParent ) VclPtr<vcl::Window> NumberingToolBoxControl::createPopupWindow( vcl::Window* pParent )
{ {
return VclPtr<NumberingPopup>::Create( *this, m_xFrame, pParent, mbBulletItem ); return VclPtr<NumberingPopup>::Create( *this, m_xFrame, pParent, mePageType );
} }
bool NumberingToolBoxControl::IsInImpressDraw() bool NumberingToolBoxControl::IsInImpressDraw()
...@@ -228,12 +241,16 @@ void SAL_CALL NumberingToolBoxControl::initialize( const css::uno::Sequence< css ...@@ -228,12 +241,16 @@ void SAL_CALL NumberingToolBoxControl::initialize( const css::uno::Sequence< css
{ {
svt::PopupWindowController::initialize( aArguments ); svt::PopupWindowController::initialize( aArguments );
if ( m_aCommandURL == ".uno:DefaultBullet" )
mePageType = NumberingPageType::BULLET;
else if ( m_aCommandURL == ".uno:SetOutline" )
mePageType = NumberingPageType::OUTLINE;
ToolBoxItemBits nBits = ( mePageType == NumberingPageType::OUTLINE ) ? ToolBoxItemBits::DROPDOWNONLY : ToolBoxItemBits::DROPDOWN;
ToolBox* pToolBox = nullptr; ToolBox* pToolBox = nullptr;
sal_uInt16 nId = 0; sal_uInt16 nId = 0;
if ( getToolboxId( nId, &pToolBox ) ) if ( getToolboxId( nId, &pToolBox ) )
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWN ); pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | nBits );
mbBulletItem = m_aCommandURL == ".uno:DefaultBullet";
} }
OUString SAL_CALL NumberingToolBoxControl::getImplementationName() OUString SAL_CALL NumberingToolBoxControl::getImplementationName()
......
...@@ -736,6 +736,11 @@ interface BaseText ...@@ -736,6 +736,11 @@ interface BaseText
StateMethod = GetState ; StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; 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) FN_NUMBER_BULLETS // status(final|play)
[ [
ExecMethod = ExecEnterNum ; ExecMethod = ExecEnterNum ;
...@@ -804,6 +809,11 @@ interface BaseText ...@@ -804,6 +809,11 @@ interface BaseText
ExecMethod = ExecSetNumber; ExecMethod = ExecSetNumber;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
] ]
FN_SVX_SET_OUTLINE
[
ExecMethod = ExecSetNumber;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
SID_OUTLINE_BULLET // status(final|play) SID_OUTLINE_BULLET // status(final|play)
[ [
ExecMethod = ExecEnterNum ; ExecMethod = ExecEnterNum ;
......
...@@ -1828,6 +1828,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) ...@@ -1828,6 +1828,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
case FN_BUL_NUM_RULE_INDEX: case FN_BUL_NUM_RULE_INDEX:
case FN_NUM_NUM_RULE_INDEX: case FN_NUM_NUM_RULE_INDEX:
case FN_OUTLINE_RULE_INDEX:
{ {
SwNumRule* pCurRule = const_cast<SwNumRule*>(GetShell().GetNumRuleAtCurrCrsrPos()); SwNumRule* pCurRule = const_cast<SwNumRule*>(GetShell().GetNumRuleAtCurrCrsrPos());
sal_uInt16 nActNumLvl = USHRT_MAX; sal_uInt16 nActNumLvl = USHRT_MAX;
...@@ -1860,6 +1861,17 @@ void SwTextShell::GetState( SfxItemSet &rSet ) ...@@ -1860,6 +1861,17 @@ void SwTextShell::GetState( SfxItemSet &rSet )
rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,nBulIndex)); 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; break;
......
...@@ -246,15 +246,20 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq) ...@@ -246,15 +246,20 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq)
{ {
case FN_SVX_SET_NUMBER: case FN_SVX_SET_NUMBER:
case FN_SVX_SET_BULLET: case FN_SVX_SET_BULLET:
case FN_SVX_SET_OUTLINE:
{ {
const SfxUInt16Item* pItem = rReq.GetArg<SfxUInt16Item>(nSlot); const SfxUInt16Item* pItem = rReq.GetArg<SfxUInt16Item>(nSlot);
if ( pItem != nullptr ) if ( pItem != nullptr )
{ {
const sal_uInt16 nChoosenItemIdx = pItem->GetValue(); const sal_uInt16 nChoosenItemIdx = pItem->GetValue();
svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr = sal_uInt16 nNBOType = svx::sidebar::eNBOType::BULLETS;
nSlot == FN_SVX_SET_NUMBER if ( nSlot == FN_SVX_SET_NUMBER )
? svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::NUMBERING ) nNBOType = svx::sidebar::eNBOType::NUMBERING;
: svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::BULLETS ); else if ( nSlot == FN_SVX_SET_OUTLINE )
nNBOType = svx::sidebar::eNBOType::OUTLINE;
svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr = svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( nNBOType );
if ( pNBOTypeMgr != nullptr ) if ( pNBOTypeMgr != nullptr )
{ {
const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection(); const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection();
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
<toolbar:toolbarseparator/> <toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:DefaultBullet"/> <toolbar:toolbaritem xlink:href=".uno:DefaultBullet"/>
<toolbar:toolbaritem xlink:href=".uno:DefaultNumbering"/> <toolbar:toolbaritem xlink:href=".uno:DefaultNumbering"/>
<toolbar:toolbaritem xlink:href=".uno:SetOutline" toolbar:visible="false"/>
<toolbar:toolbarseparator/> <toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio"/> <toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio"/>
<toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio"/> <toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment