29 #include <strings.hrc>
36 #include <tmplctrl.hxx>
55 if (SfxItemState::DEFAULT == eState && (pItem = dynamic_cast<const SfxStringItem*>(pState)))
74 if ( rCEvt.
GetCommand() != CommandEventId::ContextMenu ||
81 if (
nullptr != pWrtShell &&
82 !pWrtShell->SwCursorShell::HasSelection()&&
83 !pWrtShell->IsSelFrameMode() &&
84 !pWrtShell->IsObjSelected())
89 if (xIter->Count() > 1)
92 std::unique_ptr<weld::Menu> xPopup(xBuilder->weld_menu(
"menu"));
98 xPopup->append(OUString::number(++nCount), pStyle->
GetName());
99 pStyle = xIter->Next();
104 OString sResult = xPopup->popup_at_rect(pParent, aRect);
105 if (!sResult.isEmpty())
107 sal_uInt32 nCurrId = sResult.toUInt32();
109 pStyle = xIter->operator[]( nCurrId - 1 );
111 pWrtShell->GetView().GetViewFrame()->GetDispatcher()->ExecuteList(
113 SfxCallMode::SLOT|SfxCallMode::RECORD,
SwTemplateControl(sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb)
virtual std::unique_ptr< SfxStyleSheetIterator > CreateIterator(SfxStyleFamily, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
#define FN_SET_PAGE_STYLE
const OUString & GetItemText(sal_uInt16 nItemId) const
virtual ~SwTemplateControl() override
SFX_IMPL_STATUSBAR_CONTROL(SwTemplateControl, SfxStringItem)
void SetItemText(sal_uInt16 nItemId, const OUString &rText, int nCharsWidth=-1)
static weld::Builder * CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false)
Used by the UI to modify the document model.
const OUString & GetName() const
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
const OUString & GetValue() const
CommandEventId GetCommand() const
virtual void Paint(const UserDrawEvent &rEvt) override
OUString SwResId(const char *pId)
SwDocShell * GetDocShell()
const Point & GetMousePosPixel() const
void SetQuickHelpText(sal_uInt16 nItemId, const OUString &rText)
SwWrtShell * GetWrtShellPtr() const
StatusBar & GetStatusBar() const
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
virtual void Command(const CommandEvent &rCEvt) override