40 #include <osl/diagnose.h>
66 sal_uInt16 nWhich = rReq.
GetSlot();
92 SvxEscapement::Superscript:
93 SvxEscapement::Subscript;
96 eEscape = SvxEscapement::Off;
110 SvxEscapement::Superscript:
111 SvxEscapement::Subscript;
114 eEscape = SvxEscapement::Off;
118 if(eEscape == SvxEscapement::Superscript)
120 else if(eEscape == SvxEscapement::Subscript)
136 if (eTmpCaseMap == SvxCaseMap::SmallCaps)
137 eCaseMap = SvxCaseMap::NotMapped;
144 eCaseMap = SvxCaseMap::NotMapped;
159 case SID_ULINE_VAL_NONE:
168 case SID_ULINE_VAL_SINGLE:
169 case SID_ULINE_VAL_DOUBLE:
170 case SID_ULINE_VAL_DOTTED:
177 case SID_ULINE_VAL_SINGLE:
180 case SID_ULINE_VAL_DOUBLE:
183 case SID_ULINE_VAL_DOTTED:
199 OSL_FAIL(
"wrong dispatcher");
206 sal_uInt16 nSlot = rReq.
GetSlot();
208 bool bArgs = pArgs !=
nullptr && pArgs->
Count() > 0;
220 sal_uInt16 nWhich = rPool.
GetWhich( nSlot );
232 OSL_ENSURE(
false,
"<SwTextShell::ExecCharAttrArgs(..)> - unexpected visited character format ID at hyperlink attribute" );
239 OSL_ENSURE(
false,
"<SwTextShell::ExecCharAttrArgs(..)> - unexpected unvisited character format ID at hyperlink attribute" );
258 SfxItemSet aAttrSet( rPool, aSetItem.GetItemSet().GetRanges() );
263 std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> vItems;
270 vItems.emplace_back( pSize, std::make_unique<SwPaM>( *(pPaM->
GetMark()), *(pPaM->
GetPoint())) );
276 for( std::pair<
const SfxPoolItem*, std::unique_ptr<SwPaM> >& iPair : vItems )
278 std::unique_ptr<SwPaM> pPaM = std::move(iPair.second);
280 aSetItem.GetItemSet().ClearItem();
281 rWrtSh.
GetPaMAttr( pPaM.get(), aSetItem.GetItemSet() );
282 aAttrSet.SetRanges( aSetItem.GetItemSet().GetRanges() );
298 aAttrSet.Put( aSetItem.GetItemSet() );
311 OSL_FAIL(
"wrong dispatcher");
327 sal_uInt16 nSlot = rReq.
GetSlot();
330 case SID_ATTR_PARA_ADJUST:
332 if( pArgs && SfxItemState::SET == pArgs->
GetItemState(RES_PARATR_ADJUST) )
336 if ( rAdj.
GetAdjust() == SvxAdjust::Block )
346 case SID_ATTR_PARA_ADJUST_LEFT: eAdjst = SvxAdjust::Left;
goto SET_ADJUST;
347 case SID_ATTR_PARA_ADJUST_RIGHT: eAdjst = SvxAdjust::Right;
goto SET_ADJUST;
348 case SID_ATTR_PARA_ADJUST_CENTER: eAdjst = SvxAdjust::Center;
goto SET_ADJUST;
349 case SID_ATTR_PARA_ADJUST_BLOCK: eAdjst = SvxAdjust::Block;
goto SET_ADJUST;
357 case SID_ATTR_PARA_LINESPACE:
362 aSet.Put( aLineSpace );
365 case SID_ATTR_PARA_LINESPACE_10: ePropL = 100;
goto SET_LINESPACE;
366 case SID_ATTR_PARA_LINESPACE_15: ePropL = 150;
goto SET_LINESPACE;
367 case SID_ATTR_PARA_LINESPACE_115: ePropL = 115;
goto SET_LINESPACE;
368 case SID_ATTR_PARA_LINESPACE_20: ePropL = 200;
goto SET_LINESPACE;
379 aSet.Put( aLineSpacing );
383 case SID_ATTR_PARA_LEFT_TO_RIGHT :
384 case SID_ATTR_PARA_RIGHT_TO_LEFT :
388 bool bChgAdjust =
false;
390 if(eAdjustState >= SfxItemState::DEFAULT)
393 aAdjustSet.
Get(RES_PARATR_ADJUST).GetAdjust();
394 bChgAdjust = (SvxAdjust::Left == eAdjust && SID_ATTR_PARA_RIGHT_TO_LEFT == nSlot) ||
395 (SvxAdjust::Right == eAdjust && SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot);
401 (SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot) ?
402 SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB;
407 SvxAdjust eAdjust = (SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot) ?
408 SvxAdjust::Left : SvxAdjust::Right;
411 aAdjust.SetWhich(SID_ATTR_PARA_ADJUST);
422 if(SvxAdjust::Left == aFormat.GetNumAdjust())
425 else if(SvxAdjust::Right == aFormat.GetNumAdjust())
426 aFormat.SetNumAdjust( SvxAdjust::Left );
433 aSetRule.SetAutoRule(
true );
442 OSL_FAIL(
"wrong dispatcher");
462 sal_uInt16 nSlot = rReq.
GetSlot();
475 if(!sCharStyleName.isEmpty())
477 aDropItem.SetCharFormat( pFormat );
496 if (pDlg->Execute() ==
RET_OK)
500 if (
const SfxStringItem* pHintItem = aSet.GetItemIfSet(HINT_END,
false) )
502 if ( !pHintItem->GetValue().isEmpty() )
508 rReq.
Done(*pDlg->GetOutputItemSet());
513 case SID_ATTR_PARA_PAGEBREAK:
520 case SID_ATTR_PARA_MODEL:
525 SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL> aCoreSet(
GetPool() );
526 aCoreSet.Put(*pItem);
535 OSL_FAIL(
"wrong dispatcher");
555 bool bAdjustGood =
false;
558 if( SfxItemState::DEFAULT == eState )
560 if( SfxItemState::DEFAULT <= eState )
562 eAdjust =
static_cast<const SvxAdjustItem*
>( pItem)->GetAdjust();
568 if( SfxItemState::DEFAULT == eState )
570 if( eState >= SfxItemState::DEFAULT )
573 sal_uInt16 nLineSpace = 0;
575 if( SfxItemState::DEFAULT == eState )
577 if( SfxItemState::DEFAULT <= eState &&
578 static_cast<const SvxLineSpacingItem* >(pItem)->GetLineSpaceRule() == SvxLineSpaceRule::Auto )
580 if(SvxInterLineSpaceRule::Off ==
581 static_cast<const SvxLineSpacingItem* >(pItem)->GetInterLineSpaceRule())
589 if (eState == SfxItemState::DEFAULT)
591 if (eState >= SfxItemState::DEFAULT)
605 bFlag = eCaseMap == SvxCaseMap::SmallCaps;
607 case SID_ATTR_PARA_ADJUST_LEFT:
614 bFlag = SvxAdjust::Left == eAdjust;
616 case SID_ATTR_PARA_ADJUST_RIGHT:
623 bFlag = SvxAdjust::Right == eAdjust;
625 case SID_ATTR_PARA_ADJUST_CENTER:
632 bFlag = SvxAdjust::Center == eAdjust;
634 case SID_ATTR_PARA_ADJUST_BLOCK:
643 bFlag = SvxAdjust::Block == eAdjust;
653 case SID_ATTR_PARA_LINESPACE_10:
654 bFlag = nLineSpace == 100;
656 case SID_ATTR_PARA_LINESPACE_115:
657 bFlag = nLineSpace == 115;
659 case SID_ATTR_PARA_LINESPACE_15:
660 bFlag = nLineSpace == 150;
662 case SID_ATTR_PARA_LINESPACE_20:
663 bFlag = nLineSpace == 200;
670 aSetItem.GetItemSet().Put( aCoreSet,
false );
684 std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >>
686 for (
const std::pair<
const SfxPoolItem*, std::unique_ptr<SwPaM>>& aIt : vFontHeight )
705 case SID_ULINE_VAL_NONE:
706 case SID_ULINE_VAL_SINGLE:
707 case SID_ULINE_VAL_DOUBLE:
708 case SID_ULINE_VAL_DOTTED:
711 if( eState >= SfxItemState::DEFAULT )
717 case SID_ULINE_VAL_NONE:
720 case SID_ULINE_VAL_SINGLE:
723 case SID_ULINE_VAL_DOUBLE:
726 case SID_ULINE_VAL_DOTTED:
736 case SID_ATTR_PARA_ADJUST:
743 case SID_ATTR_PARA_LRSPACE:
744 case SID_ATTR_PARA_LEFTSPACE:
745 case SID_ATTR_PARA_RIGHTSPACE:
746 case SID_ATTR_PARA_FIRSTLINESPACE:
749 if( eState >= SfxItemState::DEFAULT )
761 case SID_ATTR_PARA_LEFT_TO_RIGHT :
762 case SID_ATTR_PARA_RIGHT_TO_LEFT :
764 if ( !
SW_MOD()->GetCTLOptions().IsCTLFontEnabled() )
778 if (SvxFrameDirection::Environment == eFrameDir)
781 SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB;
783 bFlag = (SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot &&
784 SvxFrameDirection::Horizontal_LR_TB == eFrameDir) ||
785 (SID_ATTR_PARA_RIGHT_TO_LEFT == nSlot &&
786 SvxFrameDirection::Horizontal_RL_TB == eFrameDir);
797 case SID_ATTR_CHAR_LANGUAGE:
798 case SID_ATTR_CHAR_KERNING:
805 case SID_ATTR_PARA_MODEL:
809 SID_ATTR_PARA_MODEL,SID_ATTR_PARA_MODEL> aTemp(
GetPool());
812 rSet.
Put(aTemp.Get(SID_ATTR_PARA_MODEL));
836 rSet.
Put( aFlagItem );
841 rSet.
Put(aCoreSet,
false);
SfxViewFrame * GetViewFrame() const
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
SwTextFormatColl * GetCurTextFormatColl() const
Get the named paragraph format of the current selection.
Represents the style of a paragraph.
WhichRangesContainer const aTextFormatCollSetRange(svl::Items< RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, RES_PARATR_LIST_LEVEL, RES_PARATR_LIST_LEVEL, RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, XATTR_FILL_FIRST, XATTR_FILL_LAST >)
void PutItemForScriptType(SvtScriptType nScriptType, const SfxPoolItem &rItem)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
SvxAdjust GetAdjust() const
#define FN_SET_SUPER_SCRIPT
void SetState(const SfxItemSet &rSet)
void ExecParaAttrArgs(SfxRequest &)
const SwNumRule * GetNumRuleAtCurrCursorPos() const
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
const SwPosition * GetMark() const
void SetAttrSet(const SfxItemSet &, SetAttrMode nFlags=SetAttrMode::DEFAULT, SwPaM *pCursor=nullptr, const bool bParagraphSetting=false)
const SvxNumberFormat * Get(sal_uInt16 nLevel) const
void SetHeight(sal_uInt32 nNewHeight, const sal_uInt16 nNewProp=100, MapUnit eUnit=MapUnit::MapRelative)
void InvalidateItem(sal_uInt16 nWhich)
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
const OUString & GetName() const
bool IsSelFullPara() const
void Done(bool bRemove=false)
void ExecParaAttr(SfxRequest &)
#define DFLT_ESC_AUTO_SUB
void GetAttrState(SfxItemSet &)
void AutoUpdatePara(SwTextFormatColl *pColl, const SfxItemSet &rStyleSet, SwPaM *pPaM=nullptr)
const SfxItemSet * GetArgs() const
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
void SetLineSpaceRule(SvxLineSpaceRule e)
#define FN_UPDATE_STYLE_BY_EXAMPLE
SvxAdjust GetOneWord() const
void SetLastBlock(const SvxAdjust eType)
void SetCurNumRule(const SwNumRule &, const bool bCreateNewList, const OUString &sContinuedListId=OUString(), const bool bResetIndentAttrs=false)
Optional parameter (default value false).
Used by the UI to modify the document model.
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
const SwView & GetView() const
void SetPropLineSpace(const sal_uInt16 nProp)
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
#define DFLT_ESC_AUTO_SUPER
#define FN_SHRINK_FONT_SIZE
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
SfxItemPool & GetPool() const
SvxNumRule MakeSvxNumRule() const
virtual VclPtr< SfxAbstractDialog > CreateSwDropCapsDialog(weld::Window *pParent, const SfxItemSet &rSet)=0
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
PaM is Point and Mark: a selection of the document model.
void ExecCharAttr(SfxRequest &)
const sal_uInt32 nFontInc
#define FN_SET_SUB_SCRIPT
bool IsInRightToLeftText() const
const sal_uInt32 nFontMaxSz
SvtScriptType GetScriptType() const
returns the script type of the selection
bool HasSelection() const
SwCharFormat * FindCharFormatByName(const OUString &rName) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SwPosition * GetPoint() const
void ExecCharAttrArgs(SfxRequest &)
SfxBindings & GetBindings()
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
bool DontExpandFormat()
If Cursor is at the end of a character style in which the DontExpand-flag is not yet set...
SvxAdjust GetLastBlock() const
const SvxNumberFormat & GetLevel(sal_uInt16 nLevel) const
sal_uInt16 GetLevelCount() const
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
static SwAbstractDialogFactory * Create()
bool HasReadonlySel() const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
void SetValue(bool const bTheValue)
SwDocShell * GetDocShell()
std::vector< std::pair< const SfxPoolItem *, std::unique_ptr< SwPaM > > > GetItemWithPaM(sal_uInt16 nWhich)
Get RES_CHRATR_* items of one type in the current selection.
bool GetPaMAttr(SwPaM *pPaM, SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Apply / remove attributes.
constexpr TypedWhichId< SfxStringItem > HINT_END(RES_TBX_DUMMY)
#define FN_SET_SMALL_CAPS
#define FN_DROP_CHAR_STYLE_NAME
const SwNumFormat & Get(sal_uInt16 i) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
void SetInterLineSpaceRule(SvxInterLineSpaceRule e)
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
sal_uInt32 GetHeight() const
void DisableItem(sal_uInt16 nWhich)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
void SetWhich(sal_uInt16 nId)
void SetSvxRule(const SvxNumRule &, SwDoc *pDoc)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
constexpr sal_uInt16 RES_CHRATR_END(46)
#define FN_GROW_FONT_SIZE
void AppendItem(const SfxPoolItem &)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
void ReplaceDropText(const OUString &rStr, SwPaM *pPaM=nullptr)
void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat &rFmt, bool bIsValid=true)
const SfxPoolItem * GetItemOfScript(SvtScriptType nScript) const
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
sal_Int16 GetCaseMap(sal_Int32 nToken)
#define FN_REMOVE_DIRECT_CHAR_FORMATS
#define FN_FORMAT_DROPCAPS
void EndAction(const bool bIdleEnd=false)