28#include <osl/diagnose.h>
45 struct SearchOptions2;
131 bool bMoveTable =
false;
132 std::optional<SwPosition> oStartPos;
133 std::optional<SwPosition> oEndPos;
140 if (!bHasWholeTabSelection)
147 oStartPos.emplace( *pTmpCursor->
GetPoint() );
148 oEndPos.emplace( *pTmpCursor->
GetMark() );
155 GoStart(
true, &bMoveTable,
false, !bIsFullSel);
163 GoEnd(
true, &bMoveTable);
171 if (bNeedsExtendedSelectAll && bIsCursorInTable)
172 bNeedsExtendedSelectAll = bHasWholeTabSelection;
174 if (bNeedsExtendedSelectAll)
199 if( ( *pTmpCursor->
GetPoint() < *oEndPos ||
200 ( *oStartPos == *pTmpCursor->
GetMark() &&
201 *oEndPos == *pTmpCursor->
GetPoint() ) ) && !bNeedsExtendedSelectAll)
219 bool bCancel =
false;
220 sal_Int32 nRet =
Find_Text(rSearchOpt, bSearchInNotes, eStt, eEnd, bCancel, eFlags, bReplace);
233 FindRanges eFlags,
const OUString* pReplTempl )
243 bool bCancel =
false;
245 eStt,eEnd, bCancel, eFlags, pReplaceColl);
266 bool bCancel =
false;
267 sal_Int32 nRet =
FindAttrs(rFindSet, bNoColls, eStart, eEnd, bCancel, eFlags, pSearchOpt, pReplaceSet);
326 Point aPt(LONG_MIN, LONG_MIN);
412 aDescription.
aParameters = {{
"START_POS", aSelStart}, {
"END_POS", aSelEnd}};
413 aDescription.
aAction =
"SELECT";
414 aDescription.
aID =
"writer_edit";
415 aDescription.
aKeyWord =
"SwEditWinUIObject";
416 aDescription.
aParent =
"MainWindow";
468 bool bMoveCursor =
true, bToTop =
false;
475 case -1: bToTop =
false;
break;
476 case 1: bToTop =
true;
break;
477 default: bMoveCursor =
false;
break;
736 OSL_ENSURE(pFormat,
"no frame format");
739 if(rFormatMac.
HasMacro(SvMacroItemId::SwObjectSelect))
742 if( IsFrameSelected() )
743 m_bLayoutMode =
true;
882 if( !cPrev || !cNext ||
892 if (cPrev && cNext &&
957 bool bCreateXSelection =
false;
961 if ( bFrameSelected )
968 bCreateXSelection =
true;
970 else if( bFrameSelected )
973 bCreateXSelection =
true;
979 bCreateXSelection =
true;
982 if( bCreateXSelection )
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
void SetState(const SfxItemSet &rSet)
void Invalidate(sal_uInt16 nId)
SfxBindings & GetBindings()
SfxChildWindow * GetChildWindow(sal_uInt16)
SfxViewFrame * GetViewFrame() const
const SvxMacro & GetMacro(SvMacroItemId nEvent) const
bool HasMacro(SvMacroItemId nEvent) const
Class for automated call of Start- and EndAction().
static void SetFrameMode(FlyMode eMode, SwWrtShell *pShell)
A helper class to save cursor state (position).
void ExtendedSelectAll(bool bFootnotes=true)
bool Pop(PopMode, ::std::optional< SwCallLink > &roLink)
void Push()
store a copy of the current cursor on the cursor stack
void SetOverwriteCursor(bool bFlag)
const SwTableNode * IsCursorInTable() const
bool GoPrevCursor()
go to the previous SSelection
bool IsStartSentence() const
void BlockCursorToCursor()
bool SelectNxtPrvHyperlink(bool bNext)
SwShellCursor * GetCursor_()
const SwRect & GetCharRect() const
const Link< LinkParamNone *, void > & GetChgLnk() const
bool IsInWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
int SetCursor(const Point &rPt, bool bOnlyText=false, bool bBlock=true)
bool HasSelection() const
Does the current cursor create a selection?
bool SttEndDoc(bool bStt)
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
int CompareCursorStackMkCurrPt() const
bool IsSelTableCells() const
void TableCursorToCursor()
enter block mode, change normal cursor into block cursor
bool GoNextCursor()
go to the next SSelection
void CursorToBlockCursor()
leave block mode, change block cursor into normal cursor
void Combine()
Combine two cursors.
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
void EndAction(const bool bIdleEnd=false)
sal_Int32 FindFormat(const SwTextFormatColl &rFormatColl, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, const SwTextFormatColl *pReplFormat)
bool TestCurrPam(const Point &rPt, bool bTstHit=false)
Search in the selected area for a Selection that covers the given point.
void UnsetEnhancedTableSelection()
bool SelectWord(const Point *pPt)
bool Right(sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual=false)
sal_Int32 Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, bool bReplace=false)
bool StartsWithTable()
If document body starts with a table.
sal_Int32 FindAttrs(const SfxItemSet &rSet, bool bNoCollections, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, const i18nutil::SearchOptions2 *pSearchOpt, const SfxItemSet *rReplSet)
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
SwTable::SearchType GetEnhancedTableSelection() const
bool Left(sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual=false)
bool IsCursorPtAtEnd() const
bool IsStartWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
bool IsEndSentence() const
sal_Unicode GetChar(bool bEnd=true, tools::Long nOffset=0)
get the nth character of the current SSelection
void RestoreSavePos()
Restore cursor state to the one saved by SwCursorSaveState.
void SetSplitVerticalByDefault(bool value)
bool IsSplitVerticalByDefault() const
sal_uInt16 GetCntType() const
Determine form of content. Return Type at CurrentCursor->SPoint.
bool Delete(bool isArtificialSelection=false)
Delete content of all ranges.
void SetRedlineFlags(RedlineFlags eMode)
SwTextFormatColl & GetDfltTextFormatColl() const
void Undo(sal_uInt16 const nCount=1, sal_uInt16 nOffset=0)
void Drag(const Point *pPt, bool bProp)
bool IsFrameSelected() const
bool HasWholeTabSelection() const
bool SelTableRowCol(const Point &rPt, const Point *pEnd, bool bRowDrag)
pEnd will be used during MouseMove
size_t IsObjSelected() const
bool SelectObj(const Point &rSelPt, sal_uInt8 nFlag=0, SdrObject *pObj=nullptr)
If an object has been given, exactly this object is selected (instead of searching over position).
void BeginDrag(const Point *pPt, bool bProp)
Class for automated call of Start- and EndCursorMove().
const SwPosition * GetMark() const
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Represents the current text cursor of one opened edit window.
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
Represents the style of a paragraph.
static void ClearSelection(const SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
static void CreateSelection(SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
bool IsViewLocked() const
Used by the UI to modify the document model.
bool IsSelFrameMode() const
SAL_DLLPRIVATE tools::Long SetCursorKillSel(const Point *, bool bProp)
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
bool IsRetainSelection() const
SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp)
SAL_DLLPRIVATE void SttLeaveSelect()
void SetSplitVerticalByDefault(bool value)
sal_Int32 SearchAttr(const SfxItemSet &rFindSet, bool bNoColls, SwDocPositions eStart, SwDocPositions eEnd, FindRanges eFlags=FindRanges::InBody, const i18nutil::SearchOptions2 *pSearchOpt=nullptr, const SfxItemSet *pReplaceSet=nullptr)
SAL_DLLPRIVATE bool GoStart(bool KeepArea, bool *, bool bSelect, bool bDontMoveRegion=false)
SAL_DLLPRIVATE void LeaveExtSel()
SAL_DLLPRIVATE void BeginFrameDrag(const Point *, bool bProp)
bool PrvWrd(bool bSelect=false)
bool Left(SwCursorSkipMode nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false)
void SelectNextPrevHyperlink(bool bNext)
sal_Int32 SearchTempl(const OUString &rTempl, SwDocPositions eStart, SwDocPositions eEnd, FindRanges eFlags=FindRanges::InBody, const OUString *pReplTempl=nullptr)
bool IsSplitVerticalByDefault() const
void SetInsMode(bool bOn=true)
struct SwWrtShell::ModeStack * m_pModeStack
SAL_DLLPRIVATE void ExtSelWrd(const Point *, bool bProp)
SAL_DLLPRIVATE void AddLeaveSelect()
void SelPara(const Point *)
void SelSentence(const Point *)
SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp)
SAL_DLLPRIVATE bool GoEnd(bool KeepArea=false, const bool *=nullptr)
int IntelligentCut(SelectionType nSelectionType, bool bCut=true)
sal_Int32 SearchPattern(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnd, FindRanges eFlags=FindRanges::InBody, bool bReplace=false)
Link< SwWrtShell &, void > m_aSelTableLink
SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp)
void SetRedlineFlagsAndCheckInsMode(RedlineFlags eMode)
SwTextFormatColl * GetParaStyle(const OUString &rCollName, GetStyle eCreate=GETSTYLE_NOCREATE)
tools::Long ResetSelect(const Point *, bool)
bool SelWrd(const Point *=nullptr)
SAL_DLLPRIVATE void DefaultDrag(const Point *, bool bProp)
SAL_DLLPRIVATE void UpdateLayoutFrame(const Point *, bool bProp)
bool SelectTableRowCol(const Point &rPt, const Point *pEnd=nullptr, bool bRowDrag=false)
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
const SwView & GetView() const
SAL_DLLPRIVATE void ExtSelLn(const Point *, bool bProp)
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
@ InSel
Find in selections.
#define CH_TXTATR_BREAKWORD
CharClass & GetAppCharClass()
bool GoCurrPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
bool GoCurrSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnParaStart
SwMoveFnCollection const & fnSectionEnd
SwMoveFnCollection const & fnParaEnd
SwMoveFnCollection const & fnSectionStart
static tools::Long nStartDragX
static tools::Long nStartDragY
IMPL_LINK(SwWrtShell, ExecFlyMac, const SwFlyFrameFormat *, pFlyFormat, void)
std::map< OUString, OUString > aParameters
sal_Int32 GetContentIndex() const