25 #include <osl/diagnose.h>
49 case FN_NUM_NUMBERING_ON:
59 if ( bMode != (
GetShell().SelectionHasNumber()) )
68 if (bNewResult!=bMode) {
72 SfxBoolItem aNewItem(FN_NUM_NUMBERING_ON,bNewResult);
78 case FN_NUM_BULLET_ON:
88 if ( bMode != (
GetShell().SelectionHasBullet()) )
97 if (bNewResult!=bMode) {
121 case SID_OUTLINE_BULLET:
124 SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL> aSet(
GetPool() );
126 const bool bHtml =
dynamic_cast<SwWebDocShell*
>( pDocSh ) !=
nullptr;
128 if ( pNumRuleAtCurrentSelection !=
nullptr )
145 aRule.
SetFeatureFlag(SvxNumRuleFlags::ENABLE_EMBEDDED_BMP,
false);
149 "<SwTextShell::ExecEnterNum()> - numbered node without valid list level. Serious defect." );
153 nLevel = 1 << nLevel;
154 aSet.Put(
SfxUInt16Item( SID_PARAM_CUR_NUM_LEVEL, nLevel ) );
165 if ( bHtml || bRightToLeft )
179 aFormat.SetNumAdjust( SvxAdjust::Right );
183 aSvxRule.
SetFeatureFlag(SvxNumRuleFlags::ENABLE_EMBEDDED_BMP,
false);
188 aSet.Put(
SfxBoolItem( SID_PARAM_NUM_PRESET,
false ));
198 pDlg->SetCurPageId(
OUStringToOString( pPageItem->GetValue(), RTL_TEXTENCODING_UTF8 ) );
200 auto pRequest = std::make_shared<SfxRequest>(rReq);
203 pDlg->StartExecuteAsync([aSet, pDlg, pNumRuleAtCurrentSelection, pRequest,
this](sal_Int32 nResult){
206 const SvxNumBulletItem* pBulletItem = pDlg->GetOutputItemSet()->GetItemIfSet(SID_ATTR_NUMBERING_RULE,
false);
209 pRequest->AppendItem(*pBulletItem);
213 SwNumRule aSetRule(pNumRuleAtCurrentSelection !=
nullptr
214 ? pNumRuleAtCurrentSelection->
GetName()
218 aSetRule.SetAutoRule(
true);
221 const bool bCreateList = (pNumRuleAtCurrentSelection ==
nullptr);
226 else if (pNumRuleAtCurrentSelection ==
nullptr
227 && (pBulletItem = aSet.GetItemIfSet(SID_ATTR_NUMBERING_RULE,
false)))
229 pRequest->AppendItem(*pBulletItem);
249 OSL_FAIL(
"wrong dispatcher");
257 const sal_uInt16 nSlot = rReq.
GetSlot();
260 case FN_SVX_SET_NUMBER:
261 case FN_SVX_SET_BULLET:
262 case FN_SVX_SET_OUTLINE:
265 if ( pItem !=
nullptr )
267 const sal_uInt16 nChosenItemIdx = pItem->
GetValue();
269 if ( nSlot == FN_SVX_SET_NUMBER )
271 else if ( nSlot == FN_SVX_SET_OUTLINE )
276 if ( pNBOTypeMgr !=
nullptr )
279 sal_uInt16 nActNumLvl = USHRT_MAX;
280 if ( pNumRuleAtCurrentSelection !=
nullptr )
285 nActNumLvl = 1 << nLevel;
291 SvxNumRule aNewSvxNumRule = pNumRuleAtCurrentSelection !=
nullptr
293 : aNewNumRule.MakeSvxNumRule();
295 OUString aNumCharFormat, aBulletCharFormat;
305 pNBOTypeMgr->
ApplyNumRule( aNewSvxNumRule, nChosenItemIdx - 1, nActNumLvl );
307 aNewNumRule.SetSvxRule( aNewSvxNumRule,
GetShell().GetDoc() );
308 aNewNumRule.SetAutoRule(
true );
309 const bool bCreateNewList = ( pNumRuleAtCurrentSelection == nullptr );
317 OSL_ENSURE(
false,
"wrong Dispatcher");
SfxViewFrame * GetViewFrame() const
void SetState(const SfxItemSet &rSet)
void SetAutoRule(bool bFlag)
OUString GetUniqueNumRuleName() const
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
const SvxNumberFormat * Get(sal_uInt16 nLevel) const
sal_uInt16 GetValue() const
constexpr sal_uInt8 MAXLEVEL
bool SelectionHasNumber() const
const OUString & GetName() const
void Done(bool bRemove=false)
void PutItem(const SfxPoolItem &rItem)
sal_uInt8 GetNumLevel() const
void SetCurNumRule(const SwNumRule &, const bool bCreateNewList, const OUString &sContinuedListId=OUString(), const bool bResetIndentAttrs=false)
Optional parameter (default value false).
#define FN_NUMBER_BULLETS
#define FN_NUM_BULLET_OFF
virtual VclPtr< SfxAbstractTabDialog > CreateSvxNumBulletTabDialog(weld::Window *pParent, const SfxItemSet *pSwItemSet, SwWrtShell &)=0
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
void DelNumRules()
Delete, split enumeration list.
SfxItemPool & GetPool() const
SvxNumRule MakeSvxNumRule() const
void SetFeatureFlag(SvxNumRuleFlags nFlag, bool bSet=true)
bool IsInRightToLeftText() const
const SvxNumRule & GetNumRule() const
void ExecEnterNum(SfxRequest &)
SfxBindings & GetBindings()
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
const T * GetArg(sal_uInt16 nSlotId) const
const SvxNumberFormat & GetLevel(sal_uInt16 nLevel) const
sal_uInt16 GetLevelCount() const
static SwAbstractDialogFactory * Create()
SwDocShell * GetDocShell()
const SwNumRule * GetNumRuleAtCurrentSelection() const
Returns the numbering rule found at the paragraphs of the current selection, if all paragraphs of the...
bool SelectionHasBullet() const
const OUString & GetGraphicLink() const
weld::Window * GetFrameWeld() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
void SetSvxRule(const SvxNumRule &, SwDoc *pDoc)
void ExecSetNumber(SfxRequest const &)
void AppendItem(const SfxPoolItem &)
void StartAllAction()
For all views of this document.
void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat &rFmt, bool bIsValid=true)