summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2025-03-20 14:47:02 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2025-05-13 10:00:20 +0200
commitee7ab3d4634ae916f04811d0ce033637ea22578c (patch)
treee4de0b49f2a21a75f4bf3dde6c8337f9fe4bc473 /include
parent28c2be7c1f96219d4454de36cac0a51c1be24fd3 (diff)
LOCRDT editeng,sw: yrs weak link peer cursors for editengine
Replace unreliable integer cursors with WeakRef cursors which maintain their position automatically. This requires yrs v0.23.1 with the yweak_read() function. Unfortunately this crashes currently, so hide it behind #if YRS_WEAK. https://github.com/y-crdt/y-crdt/issues/536 Change-Id: I74ec1eaa25c7cb554efd38ee632df041ac92d5c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183311 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'include')
-rw-r--r--include/editeng/editview.hxx2
-rw-r--r--include/editeng/yrs.hxx1
2 files changed, 3 insertions, 0 deletions
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 4e1ee56ef7ce..d31ee35ff81e 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -42,6 +42,7 @@ class IYrsTransactionSupplier;
typedef struct TransactionInner YTransaction;
typedef struct YTextEvent YTextEvent;
typedef struct Branch Branch;
+typedef struct YOutput YOutput;
#endif
class EditTextObject;
@@ -417,6 +418,7 @@ public:
void YrsReadEEState(YTransaction *);
void YrsApplyEEDelta(YTransaction *, YTextEvent const* pEvent);
OString GetYrsCommentId() const;
+ bool YrsWriteEECursor(YTransaction *, Branch const& rArray, YOutput const* pCurrent);
void YrsApplyEECursor(OString const& rPeerId, OUString const& rAuthor,
::std::pair<int64_t, int64_t> point,
::std::optional<::std::pair<int64_t, int64_t>> oMark);
diff --git a/include/editeng/yrs.hxx b/include/editeng/yrs.hxx
index 4842d47540c4..17f41179c3bf 100644
--- a/include/editeng/yrs.hxx
+++ b/include/editeng/yrs.hxx
@@ -9,6 +9,7 @@
#pragma once
+#define YRS_WEAK
extern "C" {
#if defined(__clang__)
#pragma clang diagnostic push