21#include <com/sun/star/form/FormButtonType.hpp>
22#include <com/sun/star/beans/XPropertySet.hpp>
24#include <svx/svxids.hrc>
46#include <stlsheet.hxx>
47#include <drawview.hxx>
91 if(
auto pUrlField =
dynamic_cast< const SvxURLField *
>( pField ) )
93 aHLinkItem.
SetName(pUrlField->GetRepresentation());
94 aHLinkItem.
SetURL(pUrlField->GetURL());
101 if (sReturn.getLength() > 255)
102 sReturn = sReturn.copy(0, 255);
108 if (
mpDrawView->GetMarkedObjectList().GetMarkCount() > 0)
113 if( pMarkedObj && (SdrInventor::FmForm == pMarkedObj->
GetObjInventor()) )
119 uno::Reference< awt::XControlModel > xControlModel( pUnoCtrl->
GetUnoControlModel(), uno::UNO_SET_THROW );
120 uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW );
121 uno::Reference< beans::XPropertySetInfo > xPropInfo( xPropSet->getPropertySetInfo(), uno::UNO_SET_THROW );
123 form::FormButtonType eButtonType = form::FormButtonType_URL;
124 static constexpr OUStringLiteral sButtonType(
u"ButtonType" );
125 if(xPropInfo->hasPropertyByName( sButtonType ) && (xPropSet->getPropertyValue( sButtonType ) >>= eButtonType ) )
130 static constexpr OUStringLiteral sLabel(
u"Label" );
131 if(xPropInfo->hasPropertyByName(sLabel))
133 if( xPropSet->getPropertyValue(sLabel) >>= aString )
138 static constexpr OUStringLiteral sTargetURL(
u"TargetURL" );
139 if(xPropInfo->hasPropertyByName(sTargetURL))
141 if( xPropSet->getPropertyValue(sTargetURL) >>= aString )
142 aHLinkItem.
SetURL(aString);
146 static constexpr OUStringLiteral sTargetFrame(
u"TargetFrame" );
147 if(xPropInfo->hasPropertyByName(sTargetFrame) )
149 if( xPropSet->getPropertyValue(sTargetFrame) >>= aString )
157 catch( uno::Exception& )
163 if( !bFound && pMarkedObj )
166 if( pInfo && (pInfo->
meClickAction == presentation::ClickAction_DOCUMENT) )
178 if( SfxItemState::DEFAULT ==
rSet.
GetItemState( SID_OUTPUT_QUALITY_COLOR ) ||
179 SfxItemState::DEFAULT ==
rSet.
GetItemState( SID_OUTPUT_QUALITY_GRAYSCALE ) ||
180 SfxItemState::DEFAULT ==
rSet.
GetItemState( SID_OUTPUT_QUALITY_BLACKWHITE ) ||
190 if ( SfxItemState::DEFAULT ==
rSet.
GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) )
198 if (pFormShell !=
nullptr)
208 if ( !
GetView()->GetTextEditOutliner() )
273 case SID_ATTR_PARA_ADJUST_LEFT:
279 if ( eAdj == SvxAdjust::Left)
289 case SID_ATTR_PARA_ADJUST_CENTER:
295 if ( eAdj == SvxAdjust::Center)
305 case SID_ATTR_PARA_ADJUST_RIGHT:
311 if ( eAdj == SvxAdjust::Right)
321 case SID_ATTR_PARA_ADJUST_BLOCK:
327 if ( eAdj == SvxAdjust::Block)
337 case SID_ATTR_PARA_LRSPACE:
342 aLRSpace.SetWhich(SID_ATTR_PARA_LRSPACE);
348 case SID_ATTR_PARA_LINESPACE:
358 case SID_ATTR_PARA_ULSPACE:
363 aULSP.SetWhich(SID_ATTR_PARA_ULSPACE);
369 case SID_ULINE_VAL_NONE:
370 case SID_ULINE_VAL_SINGLE:
371 case SID_ULINE_VAL_DOUBLE:
372 case SID_ULINE_VAL_DOTTED:
382 case SID_ULINE_VAL_NONE:
385 case SID_ULINE_VAL_SINGLE:
388 case SID_ULINE_VAL_DOUBLE:
391 case SID_ULINE_VAL_DOTTED:
402 case SID_ATTR_FILL_STYLE:
403 case SID_ATTR_FILL_COLOR:
404 case SID_ATTR_FILL_GRADIENT:
405 case SID_ATTR_FILL_HATCH:
406 case SID_ATTR_FILL_BITMAP:
407 case SID_ATTR_FILL_SHADOW:
408 case SID_ATTR_SHADOW_COLOR:
409 case SID_ATTR_SHADOW_TRANSPARENCE:
410 case SID_ATTR_SHADOW_BLUR:
411 case SID_ATTR_SHADOW_XDISTANCE:
412 case SID_ATTR_SHADOW_YDISTANCE:
413 case SID_ATTR_FILL_USE_SLIDE_BACKGROUND:
414 case SID_ATTR_FILL_TRANSPARENCE:
415 case SID_ATTR_FILL_FLOATTRANSPARENCE:
416 case SID_ATTR_LINE_STYLE:
417 case SID_ATTR_LINE_DASH:
418 case SID_ATTR_LINE_WIDTH:
419 case SID_ATTR_LINE_COLOR:
420 case SID_ATTR_LINE_TRANSPARENCE:
421 case SID_ATTR_LINE_JOINT:
422 case SID_ATTR_LINE_CAP:
423 case SID_ATTR_TEXT_FITTOSIZE:
424 case SID_ATTR_CHAR_FONT:
425 case SID_ATTR_CHAR_FONTHEIGHT:
426 case SID_ATTR_CHAR_SHADOWED:
427 case SID_ATTR_CHAR_POSTURE:
428 case SID_ATTR_CHAR_OVERLINE:
429 case SID_ATTR_CHAR_UNDERLINE:
430 case SID_ATTR_CHAR_STRIKEOUT:
431 case SID_ATTR_CHAR_CONTOUR:
432 case SID_ATTR_CHAR_WEIGHT:
433 case SID_ATTR_CHAR_COLOR:
434 case SID_ATTR_CHAR_KERNING:
435 case SID_ATTR_CHAR_CASEMAP:
436 case SID_ATTR_GLOW_COLOR:
437 case SID_ATTR_GLOW_RADIUS:
438 case SID_ATTR_GLOW_TRANSPARENCY:
439 case SID_ATTR_SOFTEDGE_RADIUS:
440 case SID_SET_SUB_SCRIPT:
441 case SID_SET_SUPER_SCRIPT:
447 case SID_ATTR_TEXTCOLUMNS_NUMBER:
448 case SID_ATTR_TEXTCOLUMNS_SPACING:
452 const sal_uInt16 nActWhich = nSlotId == SID_ATTR_TEXTCOLUMNS_NUMBER
459 case SID_HYPHENATION:
471 case SID_STYLE_FAMILY2:
472 case SID_STYLE_FAMILY3:
473 case SID_STYLE_FAMILY5:
474 case SID_STYLE_APPLY:
479 if( nSlotId != SID_STYLE_APPLY && !
mpDrawView->AreObjectsMarked() )
482 aAllSet.
Put( aTmpItem, aTmpItem.Which() );
486 if (pStyleSheet->
GetFamily() == SfxStyleFamily::Page)
487 pStyleSheet =
static_cast<SdStyleSheet*
>(pStyleSheet)->GetPseudoStyleSheet();
493 if ((eFamily == SfxStyleFamily::Para && nSlotId == SID_STYLE_FAMILY2) ||
494 (eFamily == SfxStyleFamily::Frame && nSlotId == SID_STYLE_FAMILY3) ||
495 (eFamily == SfxStyleFamily::Pseudo && nSlotId == SID_STYLE_FAMILY5))
498 aAllSet.
Put( aTmpItem, aTmpItem.Which() );
503 aAllSet.
Put(aTmpItem,aTmpItem.Which() );
510 aAllSet.
Put( aItem, aItem.Which() );
515 case SID_SET_DEFAULT:
517 if( !
mpDrawView->GetMarkedObjectList().GetMarkCount() ||
524 case SID_REMOVE_HYPERLINK:
531 case SID_STYLE_WATERCAN:
533 std::unique_ptr<SfxUInt16Item> pFamilyItem;
535 if (pFamilyItem &&
static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo)
547 std::unique_ptr<SfxUInt16Item> pFamilyItem;
549 if (pFamilyItem &&
static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo)
556 case SID_STYLE_DRAGHIERARCHIE:
558 std::unique_ptr<SfxUInt16Item> pFamilyItem;
560 if (pFamilyItem &&
static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo)
565 case SID_STYLE_NEW_BY_EXAMPLE:
570 std::unique_ptr<SfxUInt16Item> pFamilyItem;
574 if (
static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo)
578 else if (
static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Para)
598 case SID_STYLE_UPDATE_BY_EXAMPLE:
606 case FN_BUL_NUM_RULE_INDEX:
607 case FN_NUM_NUM_RULE_INDEX:
613 aNewAttr.
Put( aEditAttr,
false );
615 std::unique_ptr<SvxNumRule> pNumRule;
618 sal_uInt16 nActNumLvl =
mpDrawView->GetSelectionLevel();
626 sal_uInt16 nMask = 1;
628 sal_uInt16 nCurLevel = sal_uInt16(0xFFFF);
629 for(sal_uInt16
i = 0;
i < pNumRule->GetLevelCount();
i++)
631 if(nActNumLvl & nMask)
643 bool bBullets =
false;
659 NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(NBOType::Bullets);
667 NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(NBOType::Numbering);
679 case FN_NUM_BULLET_ON:
680 case FN_NUM_NUMBERING_ON:
682 bool bEnable =
false;
688 if (pTextObj && pTextObj->
GetObjInventor() == SdrInventor::Default)
713 std::optional<SfxItemSet> pSet;
725 if( !(bAttr && pSet) )
747 if ( eState == SfxItemState::DONTCARE )
753 if ( eState == SfxItemState::DONTCARE )
759 if ( eState == SfxItemState::DONTCARE )
770 if ( eState == SfxItemState::DONTCARE )
779 OUString aStrSelection;
800 return aStrSelection;
805 bool bReturn =
false;
816 else if (
mpDrawView->GetMarkedObjectList().GetMarkCount() != 0)
ESelection GetSelection() const
const SvxFieldData * GetFieldAtCursor() const
OUString GetSelected() const
OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex)
void SetWordDelimiters(const OUString &rDelimiters)
OUString const & GetWordDelimiters() const
DrawModeFlags GetDrawMode() const
css::presentation::ClickAction meClickAction
Action at mouse click.
OUString GetBookmark() const
static SdAnimationInfo * GetShapeUserData(SdrObject &rObject, bool bCreate=false)
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
virtual SdrInventor GetObjInventor() const
virtual SdrObjKind GetObjIdentifier() const override
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
void SetVisibleState(sal_uInt16 nId, bool bShow)
SfxItemState QueryState(sal_uInt16 nSID, std::unique_ptr< SfxPoolItem > &rpState)
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
static bool IsWhich(sal_uInt16 nId)
SfxItemPool * GetPool() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
void InvalidateItem(sal_uInt16 nWhich)
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
SfxItemPool & GetPool() const
virtual void Invalidate(sal_uInt16 nId=0)
const OUString & GetName() const
SfxStyleFamily GetFamily() const
SfxBindings & GetBindings()
SfxItemState GetItemState(bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetName(const OUString &rName)
void SetInsertMode(SvxLinkInsertMode eNew)
void SetURL(const OUString &rURL)
void SetTargetFrame(const OUString &rTarget)
SvxNumType GetNumberingType() const
static bool IsCursorAtURLField(const EditView &pEditView)
void GetAttrState(SfxItemSet &rSet)
OUString GetSelectionText(bool bCompleteWords)
std::unique_ptr< DrawView > mpDrawView
bool HasSelection(bool bText) const
void GetCtrlState(SfxItemSet &rSet)
Set state of controller SfxSlots.
std::shared_ptr< FormShellManager > const & GetFormShellManager() const
SdDrawDocument * GetDoc() const
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
::sd::View * GetView() const
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
const SvxNumBulletItem * GetNumBulletItem(SfxItemSet &aNewAttr, TypedWhichId< SvxNumBulletItem > &nNumItemId)
::OutputDevice const * GetOutDev() const
constexpr TypedWhichId< SfxBoolItem > EE_PARA_HYPHENATE(EE_PARA_START+6)
constexpr TypedWhichId< SvxKerningItem > EE_CHAR_KERNING(EE_CHAR_START+12)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
constexpr TypedWhichId< SvxULSpaceItem > EE_PARA_ULSPACE(EE_PARA_START+14)
constexpr TypedWhichId< SvxLRSpaceItem > EE_PARA_LRSPACE(EE_PARA_START+13)
constexpr TypedWhichId< SvxLineSpacingItem > EE_PARA_SBL(EE_PARA_START+15)
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
bool IsChangeCaseMapEnabled()
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
OString stripEnd(const OString &rIn, char c)
const DrawModeFlags OUTPUT_DRAWMODE_CONTRAST
const DrawModeFlags OUTPUT_DRAWMODE_GRAYSCALE
const DrawModeFlags OUTPUT_DRAWMODE_BLACKWHITE
const DrawModeFlags OUTPUT_DRAWMODE_COLOR
constexpr TypedWhichId< SfxInt16Item > SDRATTR_TEXTCOLUMNS_NUMBER(SDRATTR_TEXTCOLUMNS_FIRST+0)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXTCOLUMNS_SPACING(SDRATTR_TEXTCOLUMNS_FIRST+1)
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
constexpr sal_uInt16 XATTR_LINE_FIRST(XATTR_START)
constexpr sal_uInt16 XATTR_LINE_LAST(XATTR_LINECAP)