README.yrs                                  |    5 +++--
 sfx2/source/view/frmload.cxx                |    4 +++-
 sw/source/core/doc/DocumentStateManager.cxx |    2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit d3235480c5d68839f9ab1e6f85bddaafc2f354fb
Author:     Michael Stahl <[email protected]>
AuthorDate: Wed May 14 14:09:23 2025 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Tue May 20 09:42:22 2025 +0200

    LOCRDT sfx2: only connect with env var YRSCONNECT
    
    Change-Id: Icf5d5d0c647260febd2b3c8cee626ca50833aefe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185330
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/README.yrs b/README.yrs
index 55a99e2a3de0..080a40a41792 100644
--- a/README.yrs
+++ b/README.yrs
@@ -29,8 +29,9 @@ Currently, communication happens over a hard-coded pipe:
   (you can also create a new Writer document but that will be boring if all
   you can do is insert comments into empty doc)
 
-* start another soffice with a different user profile, create new Writer
-  document, and it will connect and load the document from the other side
+* start another soffice YRSCONNECT=1 with a different user profile, create
+  new Writer document, and it will connect and load the document from the
+  other side
 
 All sorts of paragraph and character formattings should work inside comments.
 
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 16e390c836a1..f100a94f463c 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -634,7 +634,9 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const 
Sequence< PropertyValue >& rA
 
 #if ENABLE_YRS
     uno::Reference<connection::XConnection> xConnection;
-    if (!xModel.is() && aDescriptor.getOrDefault(u"URL"_ustr, OUString()) == 
"private:factory/swriter" && !getenv("YRSACCEPT"))
+    if (!xModel.is()
+        && aDescriptor.getOrDefault(u"URL"_ustr, OUString()) == 
"private:factory/swriter"
+        && getenv("YRSCONNECT"))
     {
         SAL_INFO("sfx.yrs", "YRS connect sfx2");
 
diff --git a/sw/source/core/doc/DocumentStateManager.cxx 
b/sw/source/core/doc/DocumentStateManager.cxx
index 4d40d0eacf24..7c02b968d809 100644
--- a/sw/source/core/doc/DocumentStateManager.cxx
+++ b/sw/source/core/doc/DocumentStateManager.cxx
@@ -1586,7 +1586,7 @@ void DocumentStateManager::SetModified()
 #if ENABLE_YRS
 void DocumentStateManager::YrsCommitModified()
 {
-    if (m_pYrsSupplier->CommitTransaction())
+    if (m_pYrsSupplier->CommitTransaction() && m_pYrsReader.is())
     {
         uno::Sequence<sal_Int8> buf(5);
         sal_Int8 * it{buf.getArray()};

Reply via email to