45#include <osl/diagnose.h>
67#include <LibreOfficeKit/LibreOfficeKitEnums.h>
79 bool bDeselect =
false;
81 sal_uInt16 nSlotId = rReq.
GetSlot();
86 if (nSlotId == SID_FM_CREATE_CONTROL)
93 if (nSlotId == SID_OBJECT_SELECT &&
m_nFormSfxId == nSlotId)
97 else if (nSlotId == SID_FM_CREATE_CONTROL)
99 if (eNewFormObjKind ==
m_eFormObjKind || eNewFormObjKind == SdrObjKind::NONE)
105 else if (nSlotId == SID_FM_CREATE_FIELDCONTROL)
111 OSL_ENSURE( pDescriptorItem,
"SwView::ExecDraw(SID_FM_CREATE_FIELDCONTROL): invalid request args!" );
112 if( pDescriptorItem )
128 if(pObj->IsGroupObject())
137 m_pWrtShell->SwFEShell::InsertDrawObj( *pObj, aStartPos );
142 else if ( nSlotId == SID_FONTWORK_GALLERY_FLOATER )
154 std::shared_ptr<svx::FontWorkGalleryDialog> pDlg = std::make_shared<svx::FontWorkGalleryDialog>(rWin.
GetFrameWeld(), *pSdrView);
155 pDlg->SetSdrObjectRef(&pSdrView->
GetModel());
159 SdrObject* pObj = pDlg->GetSdrObjectRef();
179 m_pWrtShell->SwFEShell::InsertDrawObj( *pObj, aPos );
191 if( nSlotId == SID_DRAW_CS_ID )
195 if( pFuncPtr && pFuncPtr->
GetSlotId() == SID_DRAW_CS_ID )
199 const OUString& aOld = pConstCustomShape->
GetShapeType();
210 && (nSlotId != SID_DRAW_CS_ID) ) )
222 AttrChangedNotify(
nullptr);
231 std::unique_ptr<SwDrawBase> pFuncPtr;
234 bool bCreateDirectly =
false;
238 case SID_OBJECT_SELECT:
239 case SID_DRAW_SELECT:
245 case SID_LINE_ARROW_END:
246 case SID_LINE_ARROW_CIRCLE:
247 case SID_LINE_ARROW_SQUARE:
248 case SID_LINE_ARROW_START:
249 case SID_LINE_CIRCLE_ARROW:
250 case SID_LINE_SQUARE_ARROW:
251 case SID_LINE_ARROWS:
254 case SID_DRAW_MEASURELINE:
256 case SID_DRAW_ELLIPSE:
258 case SID_DRAW_TEXT_VERTICAL:
259 case SID_DRAW_TEXT_MARQUEE:
260 case SID_DRAW_CAPTION:
261 case SID_DRAW_CAPTION_VERTICAL:
268 case SID_DRAW_XPOLYGON_NOFILL:
269 case SID_DRAW_XPOLYGON:
270 case SID_DRAW_POLYGON_NOFILL:
271 case SID_DRAW_POLYGON:
272 case SID_DRAW_BEZIER_NOFILL:
273 case SID_DRAW_BEZIER_FILL:
274 case SID_DRAW_FREELINE_NOFILL:
275 case SID_DRAW_FREELINE:
283 case SID_DRAW_CIRCLECUT:
289 case SID_FM_CREATE_CONTROL:
297 case SID_DRAWTBX_CS_BASIC :
298 case SID_DRAWTBX_CS_SYMBOL :
299 case SID_DRAWTBX_CS_ARROW :
300 case SID_DRAWTBX_CS_FLOWCHART :
301 case SID_DRAWTBX_CS_CALLOUT :
302 case SID_DRAWTBX_CS_STAR :
303 case SID_DRAW_CS_ID :
310 if ( nSlotId != SID_DRAW_CS_ID )
329 bool bEndTextEdit =
true;
337 auto pTempFuncPtr = pFuncPtr.get();
339 AttrChangedNotify(
nullptr);
341 pTempFuncPtr->Activate(nSlotId);
353 pTempFuncPtr->CreateDefaultObject();
357 pTempFuncPtr->CreateDefaultObject();
358 pTempFuncPtr->Deactivate();
365 (SID_DRAW_TEXT == nSlotId || SID_DRAW_TEXT_VERTICAL == nSlotId ||
366 SID_DRAW_TEXT_MARQUEE == nSlotId ))
370 bEndTextEdit =
false;
381 if(bEndTextEdit && pSdrView && pSdrView->
IsTextEdit())
384 AttrChangedNotify(
nullptr);
402 pTest = pDispatch->
GetShell(nIdx++);
404 while( pTest && pTest !=
this && pTest !=
m_pShell);
446 const SfxBoolItem aTmp( SID_OBJECT_ROTATE,
false );
467 OSL_ENSURE( pSdrView,
"EnterDrawTextMode without DrawView?" );
469 bool bReturn =
false;
477 pObj = pSdrView->
PickObj(aDocPos, pSdrView->
getHitTolLog(), pPV, SdrSearchOptions::PICKTEXTEDIT);
483 if ( (pVirtObj &&
DynCastSdrTextObj(&pVirtObj->GetReferencedObj() ) !=
nullptr &&
508 bool bIsNewObj,
bool bSetSelectionToStart)
512 std::unique_ptr<SdrOutliner> pOutliner = ::SdrMakeOutliner(OutlinerMode::TextObject, pSdrView->
GetModel());
517 pOutliner->SetSpeller(xSpell);
518 uno::Reference<linguistic2::XHyphenator> xHyphenator(
::GetHyphenator() );
519 pOutliner->SetHyphenator( xHyphenator );
523 nCntrl |= EEControlBits::ALLOWBIGOBJS;
528 nCntrl |= EEControlBits::MARKFIELDS;
533 nCntrl |= EEControlBits::ONLINESPELLING;
537 pOutliner->SetControlWord(nCntrl);
542 pOutliner->SetVertical( SID_DRAW_TEXT_VERTICAL ==
m_nDrawSfxId ||
548 pOutliner->SetDefaultHorizontalTextDirection( aDefHoriTextDir );
560 Point aNewTextEditOffset(0, 0);
564 pToBeActivated = &
const_cast<SdrObject&
>(pVirtObj->GetReferencedObj());
565 aNewTextEditOffset = pVirtObj->GetOffset();
569 static_cast<SdrTextObj*
>(pToBeActivated)->SetTextEditOffset(aNewTextEditOffset);
571 bool bRet(pSdrView->
SdrBeginTextEdit( pToBeActivated, pPV, pWin,
true, pOutliner.
release(),
nullptr,
false,
false,
false ));
589 if (bSetSelectionToStart)
612 OSL_ENSURE( pSdrView,
"IsTextTool without DrawView?" );
618 return nInvent == SdrInventor::Default;
673 if (!
HasOnlyObj(pSdrObj, SdrInventor::FmForm))
695 for (
size_t i = 0;
i < nCnt; ++
i)
711 if (rInfo.nCommand == SpellCallbackCommand::STARTSPELLDLG)
713 else if (rInfo.nCommand == SpellCallbackCommand::AUTOCORRECT_OPTIONS)
714 GetViewFrame().GetDispatcher()->Execute( SID_AUTO_CORRECT_DLG, SfxCallMode::ASYNCHRON );
736 bool bHyphenate =
false;
sal_uInt16 GetValue() const
const OUString & GetValue() const
static OUString GetShapeTypeFromRequest(SfxRequest const &rReq)
const OUString & GetShapeType() const
virtual OutputDevice * getReferenceDevice(bool bCreate) const =0
Returns the current reference device.
void SetSelection(const ESelection &)
bool IsWrongSpelledWordAtPos(const Point &rPosPixel)
void SetBackgroundColor(const Color &rColor)
tools::Rectangle const & GetOutputArea() const
void ExecuteSpellPopup(const Point &rPosPixel, const Link< SpellCallbackInfo &, void > &rCallBack)
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long getX() const
constexpr tools::Long getY() const
void TakeCurrentObj(SdrObjKind &nIdent, SdrInventor &nInvent) const
void SetCreateMode(bool bOn=true)
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrHdl * PickHandle(const Point &rPnt) const
const SdrMarkList & GetMarkedObjectList() const
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
bool IsCreateMode() const
bool IsMarkedHit(const Point &rPnt, short nTol=-2) const
SdrObject * GetMarkedSdrObj() const
const SfxItemPool & GetItemPool() const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
const OutlinerView * GetTextEditOutlinerView() const
virtual bool IsTextEdit() const final override
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual SdrInventor GetObjInventor() const
virtual SdrObjList * GetSubList() const
bool IsGroupObject() const
virtual const tools::Rectangle & GetLogicRect() const
bool IsGroupEntered() const
sal_uInt16 GetHitTolerancePixel() const
void SetHitTolerancePixel(sal_uInt16 nVal)
SdrPageView * GetSdrPageView() const
SdrModel & GetModel() const
sal_uInt16 getHitTolLog() const
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false)
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
void SetState(const SfxItemSet &rSet)
void Update(sal_uInt16 nId)
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SfxShell * GetShell(sal_uInt16 nIdx) const
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
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
sal_uInt16 GetModifier() const
SfxItemPool & GetPool() const
const css::uno::Any & GetValue() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
SfxViewFrame & GetViewFrame() const
vcl::Window * GetWindow() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
virtual void Deactivate()
bool IsInsertForm() const
sal_uInt16 GetSlotId() const
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object.
void SetCalcFieldValueHdl(Outliner *pOutliner)
bool IsShapeDefaultHoriTextDirR2L() const
Is default horizontal text direction for selected drawing object right-to-left.
Color GetShapeBackground() const
SwFEShell::GetShapeBackground.
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
Is the frame format a text box?
bool IsOnlineSpell() const
bool IsFieldShadings() const
const SwViewOption * GetViewOptions() const
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
std::unique_ptr< SwDrawBase > m_pDrawActual
bool ExecDrwTextSpellPopup(const Point &rPt)
SAL_DLLPRIVATE bool IsDrawTextHyphenate()
void ExecDraw(const SfxRequest &)
SAL_DLLPRIVATE bool IsTextTool() const
SwWrtShell & GetWrtShell() const
bool IsBezierEditMode() const
bool BeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false)
std::unique_ptr< SwWrtShell > m_pWrtShell
virtual SdrView * GetDrawView() const override
SAL_DLLPRIVATE void HyphenateDrawText()
bool IsDrawSelMode() const
VclPtr< SwEditWin > m_pEditWin
bool AreOnlyFormsSelected() const
bool HasOnlyObj(SdrObject const *pSdrObj, SdrInventor eObjInventor) const
bool EnterShapeDrawTextMode(SdrObject *pObject)
Same as EnterDrawTextMode(), but takes an SdrObject instead of guessing it by document position.
SwDrawBase * GetDrawFuncPtr() const
void SetDrawFuncPtr(std::unique_ptr< SwDrawBase > pFuncPtr)
SdrObjKind m_eFormObjKind
bool IsDrawRotate() const
bool EnterDrawTextMode(const Point &aDocPos)
Used by the UI to modify the document model.
virtual void SetPointer(PointerStyle) override
weld::Window * GetFrameWeld() const
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
#define FN_HYPHENATE_OPT_DLG
#define FN_SPELL_GRAMMAR_DIALOG
ESelection aNewSelection(GetSelection())
#define EE_PARA_NOT_FOUND
#define EE_INDEX_NOT_FOUND
EEHorizontalTextDirection
constexpr TypedWhichId< SfxBoolItem > EE_PARA_HYPHENATE(EE_PARA_START+6)
EmbeddedObjectRef * pObject
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr sal_uInt16 KEY_MOD1
#define LINK(Instance, Class, Member)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
uno::Reference< linguistic2::XSpellChecker1 > GetSpellChecker()
uno::Reference< linguistic2::XHyphenator > GetHyphenator()
static bool lcl_isTextBox(SdrObject const *pObject)
IMPL_LINK(SwView, OnlineSpellCallback, SpellCallbackInfo &, rInfo, void)