summaryrefslogtreecommitdiff
path: root/sw/inc/crsrsh.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/inc/crsrsh.hxx')
-rw-r--r--sw/inc/crsrsh.hxx37
1 files changed, 23 insertions, 14 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 23b3753dd938..cfeac8305f82 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -26,6 +26,9 @@
#include <vcl/keycod.hxx>
#include <o3tl/typed_flags_set.hxx>
+#ifdef SW_DLLIMPLEMENTATION
+#include <TextFrameIndex.hxx>
+#endif
#include "IShellCursorSupplier.hxx"
#include "swdllapi.h"
#include "docary.hxx"
@@ -42,6 +45,7 @@
class SfxItemSet;
class SfxPoolItem;
+class SwCallLink;
class SwContentFrame;
class SwUnoCursor;
class SwFormatField;
@@ -256,7 +260,7 @@ private:
SAL_DLLPRIVATE bool LRMargin( bool, bool bAPI = false );
SAL_DLLPRIVATE bool IsAtLRMargin( bool, bool bAPI = false ) const;
- SAL_DLLPRIVATE bool isInHiddenTextFrame(SwShellCursor* pShellCursor);
+ SAL_DLLPRIVATE bool isInHiddenFrame(SwShellCursor* pShellCursor);
SAL_DLLPRIVATE bool GoStartWordImpl();
SAL_DLLPRIVATE bool GoEndWordImpl();
@@ -322,9 +326,10 @@ public:
// only for usage in special cases allowed!
void ExtendedSelectAll(bool bFootnotes = true);
/// If ExtendedSelectAll() was called and selection didn't change since then.
- bool ExtendedSelectedAll();
- /// If document body starts with a table.
- bool StartsWithTable();
+ ::std::optional<::std::pair<SwNode const*, ::std::vector<SwTableNode*>>> ExtendedSelectedAll() const;
+ enum class StartsWith { None, Table, HiddenPara, HiddenSection };
+ /// If document body starts with a table or starts/ends with hidden paragraph.
+ StartsWith StartsWith_();
SwPaM* GetCursor( bool bMakeTableCursor = true ) const;
inline SwCursor* GetSwCursor() const;
@@ -434,6 +439,7 @@ public:
* stack
* @return <true> if there was one on the stack, <false> otherwise
*/
+ bool Pop(PopMode, ::std::unique_ptr<SwCallLink> pLink);
bool Pop(PopMode);
/*
* Combine 2 Cursors.
@@ -472,7 +478,8 @@ public:
// Cursor is placed in something that is protected or selection contains
// something that is protected.
- bool HasReadonlySel() const;
+ bool HasReadonlySel(bool isReplace = false) const;
+ bool HasHiddenSections() const;
// Can the cursor be set to read only ranges?
bool IsReadOnlyAvailable() const { return m_bSetCursorInReadOnly; }
@@ -579,8 +586,11 @@ public:
// fields etc.
OUString GetSelText() const;
- // Check of SPoint or Mark of current cursor are placed within a table.
- inline const SwTableNode* IsCursorInTable() const;
+ /// Check if Point of current cursor is placed within a table.
+ const SwTableNode* IsCursorInTable() const;
+ bool MoveOutOfTable();
+ bool TrySelectOuterTable();
+ bool MoveStartText();
bool IsCursorInFootnote() const;
@@ -792,8 +802,12 @@ public:
bool GotoINetAttr( const SwTextINetFormat& rAttr );
const SwFormatINetFormat* FindINetAttr( const OUString& rName ) const;
- bool SelectText( const sal_Int32 nStart,
- const sal_Int32 nEnd );
+ bool SelectTextModel(sal_Int32 nStart, sal_Int32 nEnd);
+#ifdef SW_DLLIMPLEMENTATION
+ bool SelectTextView(TextFrameIndex nStart, TextFrameIndex nEnd);
+ // result is only valid while cursor isn't moved!
+ TextFrameIndex GetCursorPointAsViewIndex() const;
+#endif
bool CheckTableBoxContent( const SwPosition* pPos = nullptr );
void SaveTableBoxContent( const SwPosition* pPos = nullptr );
@@ -890,11 +904,6 @@ inline bool SwCursorShell::IsMultiSelection() const
return m_pCurrentCursor->GetNext() != m_pCurrentCursor;
}
-inline const SwTableNode* SwCursorShell::IsCursorInTable() const
-{
- return m_pCurrentCursor->GetNode().FindTableNode();
-}
-
inline bool SwCursorShell::IsCursorPtAtEnd() const
{
return m_pCurrentCursor->End() == m_pCurrentCursor->GetPoint();