RepositoryExternal.mk                                             |   12 +++
 config_host.mk.in                                                 |    2 
 configure.ac                                                      |   34 
+++++++++-
 distro-configs/LibreOfficeCoverity.conf                           |    2 
 wizards/com/sun/star/wizards/form/StyleApplier.java               |    4 -
 wizards/com/sun/star/wizards/report/ReportTextImplementation.java |    6 -
 wizards/com/sun/star/wizards/text/TextDocument.java               |    6 +
 7 files changed, 57 insertions(+), 9 deletions(-)

New commits:
commit 3de3f660af5afad6f4a78cc021ed20dada936bbd
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Sep 20 12:25:11 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Sep 20 17:43:42 2024 +0200

    add a --with-system-java-websocket
    
    there was a system Java-WebSocket in Fedora 35, f.e. but unaware
    if this is actively packaged standalone in contemporary distros,
    but useful for the coverity build case.
    
    Change-Id: Id6393dbfb1c449b75391752a8bb5e5ea4481a084
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173725
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 2d35152eb0b8..4a421d6f08e6 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3967,7 +3967,15 @@ endef
 
 endif # SYSTEM_JFREEREPORT
 
-# no known distro packaged Java-Websocket at present
+# As a guide, Java-Websocket was packaged for Fedora 35
+# https://src.fedoraproject.org/rpms/Java-WebSocket/tree/f35
+ifneq ($(SYSTEM_JAVA_WEBSOCKET),)
+
+define gb_Jar__use_java_websocket
+$(call gb_Jar_use_system_jar,$(1),$(JAVA_WEBSOCKET_JAR))
+endef
+
+else # !SYSTEM_JAVA_WEBSOCKET
 
 ifeq ($(ENABLE_JAVA),TRUE)
 $(eval $(call gb_Helper_register_jars_for_install,URE,ure, \
@@ -3979,6 +3987,8 @@ define gb_Jar__use_java_websocket
 $(call gb_Jar_use_jar,$(1),java_websocket)
 endef
 
+endif # SYSTEM_JAVA_WEBSOCKET
+
 # Executables
 
 define gb_Executable__register_bestreversemap
diff --git a/config_host.mk.in b/config_host.mk.in
index 315642b8dd35..fcc5a8b904a1 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -386,6 +386,7 @@ export KF5_LIBS=$(gb_SPACE)@KF5_LIBS@
 export KF6_CFLAGS=$(gb_SPACE)@KF6_CFLAGS@
 export KF6_LIBS=$(gb_SPACE)@KF6_LIBS@
 export KRB5_LIBS=@KRB5_LIBS@
+export JAVA_WEBSOCKET_JAR=@JAVA_WEBSOCKET_JAR@
 export LCMS2_CFLAGS=$(gb_SPACE)@LCMS2_CFLAGS@
 export LCMS2_LIBS=$(gb_SPACE)@LCMS2_LIBS@
 export LD=@LD@
@@ -677,6 +678,7 @@ SYSTEM_EBOOK=@SYSTEM_EBOOK@
 SYSTEM_ETONYEK=@SYSTEM_ETONYEK@
 SYSTEM_EPUBGEN=@SYSTEM_EPUBGEN@
 SYSTEM_FREEHAND=@SYSTEM_FREEHAND@
+SYSTEM_JAVA_WEBSOCKET=@SYSTEM_JAVA_WEBSOCKET@
 SYSTEM_LIBATOMIC_OPS=@SYSTEM_LIBATOMIC_OPS@
 SYSTEM_LIBEOT=@SYSTEM_LIBEOT@
 SYSTEM_LIBEXTTEXTCAT=@SYSTEM_LIBEXTTEXTCAT@
diff --git a/configure.ac b/configure.ac
index 25324da03940..698fadaf1940 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13155,17 +13155,47 @@ AC_SUBST(LIBASSUAN_LIBS)
 AC_SUBST(GPGMEPP_CFLAGS)
 AC_SUBST(GPGMEPP_LIBS)
 
+AC_ARG_WITH(system-java-websocket,
+    AS_HELP_STRING([--with-system-java-websocket],
+        [Use Java-WebSocket already on system.]),,
+    [with_system_java_websocket="$with_system_jars"])
+
+AC_ARG_WITH(java-websocket-jar,
+    AS_HELP_STRING([--with-java-websocket-jar=JARFILE],
+        [Specify path to jarfile manually.]),
+    JAVA_WEBSOCKET_JAR=$withval)
+
 AC_MSG_CHECKING([whether to build Java Websocket for the UNO remote websocket 
client])
 if test "$with_java" != "no"; then
     AC_MSG_RESULT([yes])
     ENABLE_JAVA_WEBSOCKET=TRUE
-    BUILD_TYPE="$BUILD_TYPE JAVA_WEBSOCKET"
-    NEED_ANT=TRUE
+
+    dnl ===================================================================
+    dnl Check for system Java-WebSocket
+    dnl ===================================================================
+    AC_MSG_CHECKING([which Java-WebSocket to use])
+    if test "$with_system_java_websocket" = "yes"; then
+        AC_MSG_RESULT([external])
+        SYSTEM_JAVA_WEBSOCKET=TRUE
+        if test -z $JAVA_WEBSOCKET_JAR; then
+            
JAVA_WEBSOCKET_JAR=/usr/share/java/Java-WebSocket/Java-WebSocket.jar
+        fi
+        if ! test -f $JAVA_WEBSOCKET_JAR; then
+            AC_MSG_ERROR(Java-WebSocket.jar not found.)
+        fi
+    else
+        AC_MSG_RESULT([internal])
+        SYSTEM_JAVA_WEBSOCKET=
+        BUILD_TYPE="$BUILD_TYPE JAVA_WEBSOCKET"
+        NEED_ANT=TRUE
+    fi
 else
     AC_MSG_RESULT([no])
     ENABLE_JAVA_WEBSOCKET=
 fi
 AC_SUBST(ENABLE_JAVA_WEBSOCKET)
+AC_SUBST(SYSTEM_JAVA_WEBSOCKET)
+AC_SUBST(JAVA_WEBSOCKET_JAR)
 
 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
 if test "x$enable_ext_wiki_publisher" = "xyes" -a 
"x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
diff --git a/distro-configs/LibreOfficeCoverity.conf 
b/distro-configs/LibreOfficeCoverity.conf
index 29959e007812..4133558a89e2 100644
--- a/distro-configs/LibreOfficeCoverity.conf
+++ b/distro-configs/LibreOfficeCoverity.conf
@@ -29,5 +29,7 @@
 --with-hsqldb-jar=/home/coverity/hsqldb.jar
 --with-system-rhino
 --with-rhino-jar=/home/coverity/js.jar
+--with-system-java-websocket
+--with-java-websocket-jar=/home/coverity/Java-WebSocket.jar
 --with-system-lockfile
 --enable-odk
commit 74774c101eab155106b176a1f77a3131a4fc3ac9
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Sep 20 09:41:54 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Sep 20 17:43:34 2024 +0200

    cid#1606721 PA: Public Attribute
    
    Change-Id: I7f67264abf3ab6e52fe74c3e0bbac86a363b45c5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173724
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/wizards/com/sun/star/wizards/form/StyleApplier.java 
b/wizards/com/sun/star/wizards/form/StyleApplier.java
index 508773d1018e..bfd0328db4af 100644
--- a/wizards/com/sun/star/wizards/form/StyleApplier.java
+++ b/wizards/com/sun/star/wizards/form/StyleApplier.java
@@ -66,7 +66,7 @@ public class StyleApplier
             this.curFormDocument = _curFormDocument;
             xMSF = curFormDocument.xMSF;
 
-            TextStyleHandler oTextStyleHandler = new 
TextStyleHandler(curFormDocument.xTextDocument);
+            TextStyleHandler oTextStyleHandler = new 
TextStyleHandler(curFormDocument.getTextDocument());
             xPageStylePropertySet = 
oTextStyleHandler.getStyleByName("PageStyles", "Standard");
             short curtabindex = (short) (FormWizard.SOSTYLE_PAGE * 100);
             Integer IStyleStep = Integer.valueOf(FormWizard.SOSTYLE_PAGE);
@@ -239,7 +239,7 @@ public class StyleApplier
     {
         try
         {
-            curFormDocument.xTextDocument.lockControllers();
+            curFormDocument.getTextDocument().lockControllers();
 
             if (optNoBorder.getState())
             {
diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java 
b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
index 29d3d25c64b0..107b9bf08129 100644
--- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
+++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
@@ -141,7 +141,7 @@ public class ReportTextImplementation extends 
ReportImplementationHelper impleme
     private void addTextSectionCopies()
     {
         m_aDoc.setLayoutSectionsVisible(false);
-        XTextCursor xTextCursor = 
ReportTextDocument.createTextCursor(m_aDoc.xTextDocument.getText());
+        XTextCursor xTextCursor = 
ReportTextDocument.createTextCursor(m_aDoc.getTextDocument().getText());
         xTextCursor.gotoStart(false);
         for (int i = 0; i < getRecordParser().getGroupFieldNames().length; i++)
         {
@@ -334,8 +334,8 @@ public class ReportTextImplementation extends 
ReportImplementationHelper impleme
             int FieldCount = getRecordParser().FieldColumns.length;
             Object[] OldGroupFieldValues = new Object[GroupFieldCount];
             int RecordFieldCount = FieldCount - GroupFieldCount;
-            XTextDocument xTextDocument = getDoc().xTextDocument;
-            XTextCursor xTextCursor = 
ReportTextDocument.createTextCursor(getDoc().xTextDocument.getText());
+            XTextDocument xTextDocument = getDoc().getTextDocument();
+            XTextCursor xTextCursor = 
ReportTextDocument.createTextCursor(getDoc().getTextDocument().getText());
             xTextDocument.lockControllers();
 
             if (getRecordParser().getResultSet().next())
diff --git a/wizards/com/sun/star/wizards/text/TextDocument.java 
b/wizards/com/sun/star/wizards/text/TextDocument.java
index 74a24eb7f3cd..710c73a9b494 100644
--- a/wizards/com/sun/star/wizards/text/TextDocument.java
+++ b/wizards/com/sun/star/wizards/text/TextDocument.java
@@ -49,7 +49,7 @@ public class TextDocument
 {
 
     public XComponent xComponent;
-    public com.sun.star.text.XTextDocument xTextDocument;
+    protected com.sun.star.text.XTextDocument xTextDocument;
     public com.sun.star.task.XStatusIndicator xProgressBar;
     public com.sun.star.frame.XFrame xFrame;
     public XText xText;
@@ -225,7 +225,11 @@ public class TextDocument
         myFieldHandler.updateDocInfoFields();
 
         return xTextDocument;
+    }
 
+    public com.sun.star.text.XTextDocument getTextDocument()
+    {
+        return xTextDocument;
     }
 
     private Size getPageSize()

Reply via email to