[Libreoffice-commits] core.git: android/source

2023-11-08 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 560cb9c53e7c6d6b8164cdd92e897d3c99b850d2
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 18:11:56 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:56:07 2023 +0100

android: Drop obsolete TODO comment

This comment was originally for the code
underneath, that has already been separated
into a separate method in gecko-dev commit [1]

commit 60ed20fee4095523ee498579c71fc17032d1004b
Author: Patrick Walton 
Date:   Mon Feb 13 12:27:09 2012 -0800

Split out Java compositor shader program activation and 
deactivation into separate functions

, but the comment was left behind.

[1] 
https://github.com/mozilla/gecko-dev/commit/60ed20fee4095523ee498579c71fc17032d1004b

Change-Id: Ied0a4aaec4d8228665748b834026b54c8e9615bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159184
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
index 792cb0422eb2..6f013612384e 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -184,9 +184,6 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 GLES20.glEnableVertexAttribArray(mTextureHandle);
 
 GLES20.glUniform1i(mSampleHandle, 0);
-
-// TODO: Move these calls into a separate deactivate() call that is 
called after the
-// underlay and overlay are rendered.
 }
 
 // Deactivates the shader program. This must be done to avoid crashes 
after returning to the


[Libreoffice-commits] core.git: 2 commits - android/source

2023-11-08 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/GLController.java   |   
13 --
 android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java |
4 +--
 2 files changed, 3 insertions(+), 14 deletions(-)

New commits:
commit f4358578251e35f92115ece0998c132ca3b402de
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 17:56:34 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:55:53 2023 +0100

android: Drop unused GLController#checkForLostContext

Change-Id: Ia9f313a1937d4d491b76e9e5d6e4689eeb20431b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159183
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java 
b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
index d31d84a51da9..45600e9f1e7c 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
@@ -99,17 +99,6 @@ public class GLController {
 return mEGL.eglSwapBuffers(mEGLDisplay, mEGLSurface);
 }
 
-public boolean checkForLostContext() {
-if (mEGL.eglGetError() != EGL11.EGL_CONTEXT_LOST) {
-return false;
-}
-
-mEGLDisplay = null;
-mEGLConfig = null;
-mEGLContext = null;
-mEGLSurface = null;
-return true;
-}
 public synchronized int getWidth() {
 return mWidth;
 }
commit 46c0c489904b2037a3ce381be95998fd7f6cdefb
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 17:40:57 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:55:44 2023 +0100

android: Cast to GL10 in getter, not callers

Better have a clear method signature than callers
relying on implementation details.

Change-Id: I4532f67aee8f8eac723401e43d3b6856ba37b346
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159182
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java 
b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
index 57ec2589b857..d31d84a51da9 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
@@ -84,7 +84,7 @@ public class GLController {
 }
 }
 
-public GL getGL()   { return mEGLContext.getGL(); }
+public GL10 getGL() { return (GL10) mEGLContext.getGL(); }
 public EGLDisplay getEGLDisplay()   { return mEGLDisplay; }
 public EGLConfig getEGLConfig() { return mEGLConfig;  }
 public EGLContext getEGLContext()   { return mEGLContext; }
diff --git 
a/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java 
b/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java
index a5b2ed79cbd3..5c74d56a004b 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java
@@ -110,7 +110,7 @@ public class RenderControllerThread extends Thread 
implements LayerView.Listener
 }
 GLSurfaceView.Renderer renderer = getRenderer();
 if (renderer != null) {
-renderer.onDrawFrame((GL10) controller.getGL());
+renderer.onDrawFrame(controller.getGL());
 }
 controller.swapBuffers();
 }
@@ -118,7 +118,7 @@ public class RenderControllerThread extends Thread 
implements LayerView.Listener
 private void doSizeChanged() {
 GLSurfaceView.Renderer renderer = getRenderer();
 if (renderer != null) {
-renderer.onSurfaceChanged((GL10) controller.getGL(), width, 
height);
+renderer.onSurfaceChanged(controller.getGL(), width, height);
 }
 }
 


[Libreoffice-commits] core.git: 2 commits - android/source

2023-11-08 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/GLController.java  |   18 
+++---
 android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java |9 ++---
 2 files changed, 10 insertions(+), 17 deletions(-)

New commits:
commit b6e5a8d60b8c63983000b41711941dc1c5b38102
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 17:37:06 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:55:32 2023 +0100

android: Use local var instead of 'mGL' member

It's never used except where it's also previously
assigned, so use a local variable instead.

Even the getter `GLController#getGL` gets
it from the EGLContext instead of using the
member.

Change-Id: Icec909f6e3e508a16fb455e81474bb336dc09362
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159181
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java 
b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
index 2c503ab8b302..57ec2589b857 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
@@ -28,8 +28,6 @@ public class GLController {
 private EGLContext mEGLContext;
 private EGLSurface mEGLSurface;
 
-private GL mGL;
-
 private static final int LOCAL_EGL_OPENGL_ES2_BIT = 4;
 
 private static final int[] CONFIG_SPEC = {
@@ -82,7 +80,6 @@ public class GLController {
 getEGLError());
 }
 
-mGL = null;
 mEGLContext = null;
 }
 }
@@ -111,7 +108,6 @@ public class GLController {
 mEGLConfig = null;
 mEGLContext = null;
 mEGLSurface = null;
-mGL = null;
 return true;
 }
 public synchronized int getWidth() {
@@ -159,11 +155,10 @@ public class GLController {
 getEGLError());
 }
 
-mGL = mEGLContext.getGL();
-
 if (mView.getRenderer() != null) {
-mView.getRenderer().onSurfaceCreated((GL10)mGL, mEGLConfig);
-mView.getRenderer().onSurfaceChanged((GL10)mGL, mWidth, mHeight);
+GL10 gl = (GL10) mEGLContext.getGL();
+mView.getRenderer().onSurfaceCreated(gl, mEGLConfig);
+mView.getRenderer().onSurfaceChanged(gl, mWidth, mHeight);
 }
 }
 
@@ -208,11 +203,10 @@ public class GLController {
 "surface! " + getEGLError());
 }
 
-mGL = mEGLContext.getGL();
-
 if (mView.getRenderer() != null) {
-mView.getRenderer().onSurfaceCreated((GL10)mGL, mEGLConfig);
-mView.getRenderer().onSurfaceChanged((GL10)mGL, mView.getWidth(), 
mView.getHeight());
+GL10 gl = (GL10) mEGLContext.getGL();
+mView.getRenderer().onSurfaceCreated(gl, mEGLConfig);
+mView.getRenderer().onSurfaceChanged(gl, mView.getWidth(), 
mView.getHeight());
 }
 }
 
commit e4a56c1996aeba2b7a8b022833198f2a6086eb17
Author:     Michael Weghorn 
AuthorDate: Wed Nov 8 17:24:38 2023 +0100
Commit:     Michael Weghorn 
CommitDate: Thu Nov 9 07:55:18 2023 +0100

android: Use local var instead of class member

It's only used in this one place.

Change-Id: Ia11ebc2ea60c4015698ac00bbec6711a20c0a22e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159168
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
index 875b3fddd756..792cb0422eb2 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -48,7 +48,6 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
 private FloatBuffer mCoordBuffer;
 private RenderContext mLastPageContext;
 private int mMaxTextureSize;
-private int mBackgroundColor;
 
 private CopyOnWriteArrayList mExtraLayers = new 
CopyOnWriteArrayList();
 
@@ -384,14 +383,14 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
 
 /* Update background color. */
-mBackgroundColor = Color.WHITE;
+final int backgroundColor = Color.WHITE;
 
 /* Clear to the page background colour. The bits set here need to
  * match up with those used in 
gfx/layers/opengl/LayerManagerOGL.cpp.
  */
-GLES20.glClearColor(((mBackgroundColor>>16)&0xFF) / 255.0f,
-((mBackgroundColor>>8)&0xFF) / 255.0f,
-(mBackgroundColor&0xFF) / 255.0f,
+GLES20.glClearColor(((backgroundColor >> 16) & 0xFF) / 255.0f,
+ 

[Libreoffice-commits] core.git: 2 commits - android/source

2023-11-08 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java |   43 
--
 1 file changed, 43 deletions(-)

New commits:
commit 3cedd0780e590cdfab9f2b7657187bea1627
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 17:20:13 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:55:09 2023 +0100

android: Drop unused LayerRenderer#Frame#getMaskForLayer

Unused since

commit 96a498b44c0a0ca48ac9938d9414191850d47d18
Date:   Fri Dec 19 16:24:02 2014 +0900

android: remove screenshot layer

Change-Id: I3b83596bb854cb4bdfc6281ca487c8be15bc61d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159167
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
index 26fbfc79a895..875b3fddd756 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -380,45 +380,6 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 mUpdated &= layer.update(mPageContext); // called on 
compositor thread
 }
 
-/** Retrieves the bounds for the layer, rounded in such a way that it
- * can be used as a mask for something that will render underneath it.
- * This will round the bounds inwards, but stretch the mask towards any
- * near page edge, where near is considered to be 'within 2 pixels'.
- * Returns null if the given layer is null.
- */
-private Rect getMaskForLayer(Layer layer) {
-if (layer == null) {
-return null;
-}
-
-RectF bounds = RectUtils.contract(layer.getBounds(mPageContext), 
1.0f, 1.0f);
-Rect mask = RectUtils.roundIn(bounds);
-
-// If the mask is within two pixels of any page edge, stretch it 
over
-// that edge. This is to avoid drawing thin slivers when masking
-// layers.
-if (mask.top <= 2) {
-mask.top = -1;
-}
-if (mask.left <= 2) {
-mask.left = -1;
-}
-
-// Because we're drawing relative to the page-rect, we only need to
-// take into account its width and height (and not its origin)
-int pageRight = mPageRect.width();
-int pageBottom = mPageRect.height();
-
-if (mask.right >= pageRight - 2) {
-mask.right = pageRight + 1;
-}
-if (mask.bottom >= pageBottom - 2) {
-mask.bottom = pageBottom + 1;
-}
-
-return mask;
-}
-
 public void drawBackground() {
 GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
 
commit 61bfc27f0495ab0427453e6d6078c3abe4777f56
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 17:15:59 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:55:01 2023 +0100

android: Drop LayerRenderer#Frame#mFrameStartTime

The member is assigned a value that is never used, so just drop it.

Might have been more useful before

commit 8734422b0b85b54c3fccc2b678171ed174c2b8bd
Date:   Mon Feb 23 20:53:35 2015 +0900

android: remove DrawTimingQueue and PanningPerfAPI

Change-Id: Ieec958c0d5a75fc47af467c73b218d6150ceaab4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159166
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
index b9d27291f1b3..26fbfc79a895 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -304,8 +304,6 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 }
 
 public class Frame {
-// The timestamp recording the start of this frame.
-private long mFrameStartTime;
 // A fixed snapshot of the viewport metrics that this frame is using 
to render content.
 private ImmutableViewportMetrics mFrameMetrics;
 // A rendering context for page-positioned layers, and one for 
screen-positioned layers.
@@ -348,8 +346,6 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 }
 
 public void beginDrawing() {
-mFrameStartTime = SystemClock.uptimeMillis();
-
 TextureReaper.get().reap();
 TextureGenerator.get().fill();
 


[Libreoffice-commits] core.git: 2 commits - android/source

2023-11-08 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java |9 
-
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 120e76b45b3ded439f8be0e6dc4d1e306b231e30
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 17:11:49 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:54:53 2023 +0100

android: Inline LayerRenderer#createFrame

No need for an extra method just to call the ctor,
and which is only used once.

Change-Id: Ide909ad81c78dc822a721771ee068e0240750089
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159165
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
index d7c2e7506548..b9d27291f1b3 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -223,7 +223,7 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
  */
 @Override
 public void onDrawFrame(GL10 gl) {
-Frame frame = createFrame(mView.getLayerClient().getViewportMetrics());
+Frame frame = new Frame(mView.getLayerClient().getViewportMetrics());
 synchronized (mView.getLayerClient()) {
 frame.beginDrawing();
 frame.drawBackground();
@@ -267,10 +267,6 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 return shader;
 }
 
-public Frame createFrame(ImmutableViewportMetrics metrics) {
-return new Frame(metrics);
-}
-
 class FadeRunnable implements Runnable {
 private boolean mStarted;
 private long mRunAt;
commit 8b3f0a66b4bf40eedc8c8a601b625c050388a29b
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 15:45:46 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:54:44 2023 +0100

android: Add "@Override"

... to make clear that these are overriden methods from
the `GLSurfaceView.Renderer` interface.

Change-Id: I7ffc47ee8a7ca4b481f7d28c0a5084c89d9c7ae8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159164
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
index b4834d081583..d7c2e7506548 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -146,6 +146,7 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 mVertScrollLayer.destroy();
 }
 
+@Override
 public void onSurfaceCreated(GL10 gl, EGLConfig config) {
 createDefaultProgram();
 activateDefaultProgram();
@@ -220,6 +221,7 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 /**
  * Called whenever a new frame is about to be drawn.
  */
+@Override
 public void onDrawFrame(GL10 gl) {
 Frame frame = createFrame(mView.getLayerClient().getViewportMetrics());
 synchronized (mView.getLayerClient()) {
@@ -249,6 +251,7 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
  mCoordBuffer);
 }
 
+@Override
 public void onSurfaceChanged(GL10 gl, final int width, final int height) {
 GLES20.glViewport(0, 0, width, height);
 }


[Libreoffice-commits] core.git: 2 commits - android/source

2023-11-08 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java |4 --
 android/source/src/java/org/mozilla/gecko/gfx/LayerView.java |   15 
--
 2 files changed, 1 insertion(+), 18 deletions(-)

New commits:
commit ae61af836428c3ccb5606e2697ce8eab19ac9860
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 15:36:48 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:54:34 2023 +0100

android: Drop misleading comments wrt methods invoked via JNI

These methods are not invoked via JNI for LibreOffice Viewer.
It might have been true for Fennec/Gecko, but isn't here, so
drop the misleading comments.

Change-Id: Ib3187b129f076f42706b3097f9535a7cca7ad55f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159163
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
index b1aea3616d6c..b4834d081583 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -348,7 +348,6 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 return pageRect;
 }
 
-/** This function is invoked via JNI; be careful when modifying 
signature. */
 public void beginDrawing() {
 mFrameStartTime = SystemClock.uptimeMillis();
 
@@ -425,7 +424,6 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 return mask;
 }
 
-/** This function is invoked via JNI; be careful when modifying 
signature. */
 public void drawBackground() {
 GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
 
@@ -474,7 +472,6 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 rootLayer.draw(mPageContext);
 }
 
-/** This function is invoked via JNI; be careful when modifying 
signature. */
 public void drawForeground() {
 /* Draw any extra layers that were added (likely plugins) */
 if (mExtraLayers.size() > 0) {
@@ -498,7 +495,6 @@ public class LayerRenderer implements 
GLSurfaceView.Renderer {
 mHorizScrollLayer.draw(mPageContext);
 }
 
-/** This function is invoked via JNI; be careful when modifying 
signature. */
 public void endDrawing() {
 // If a layer update requires further work, schedule another redraw
 if (!mUpdated)
commit 30a981cc2061b374361bbf8862ec3889b06acf88
Author:     Michael Weghorn 
AuthorDate: Wed Nov 8 15:31:38 2023 +0100
Commit:     Michael Weghorn 
CommitDate: Thu Nov 9 07:54:24 2023 +0100

android: Drop unused LayerView#registerCxxCompositor

The comment saying it's called via JNI is not true
for LibreOffice Viewer, is probably from Gecko/Fennec
days like the ones for previously dropped methods.

Now that the method is gone, `mContext` no longer
needs to be static, so make it non-static and drop
the corresponding TODO comment.

Change-Id: I32db3728234715bc29af1ad757c715003c70ca4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159162
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
index 5429d09cbb1d..7c2dda766d0a 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
@@ -53,8 +53,7 @@ public class LayerView extends FrameLayout {
 
 private Listener mListener;
 private OnInterceptTouchListener mTouchIntercepter;
-//TODO static because of registerCxxCompositor() function, should be fixed 
in the future
-private static LibreOfficeMainActivity mContext;
+private LibreOfficeMainActivity mContext;
 
 public LayerView(Context context, AttributeSet attrs) {
 super(context, attrs);
@@ -267,18 +266,6 @@ public class LayerView extends FrameLayout {
 return mSurfaceView.getHolder();
 }
 
-/** This function is invoked by Gecko (compositor thread) via JNI; be 
careful when modifying signature. */
-public static GLController registerCxxCompositor() {
-try {
-LayerView layerView = mContext.getLayerClient().getView();
-layerView.mListener.compositorCreated();
-return layerView.getGLController();
-} catch (Exception e) {
-Log.e(LOGTAG, "Error registering compositor!", e);
-return null;
-}
-}
-
 public interface Listener {
 void compositorCreated();
 void renderRequested();


[Libreoffice-commits] core.git: 2 commits - android/source

2023-11-08 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/GLController.java |   17 
 android/source/src/java/org/mozilla/gecko/gfx/LayerView.java|   21 
--
 2 files changed, 38 deletions(-)

New commits:
commit d088e3cfc582beeabb26257f689c7e4e83e7e731
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 15:27:48 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:54:16 2023 +0100

android: Drop unused LayerView#{g,s}etPaintState

... and the now also unused `mPaintState` member and
related constants.

Change-Id: Iefd40ca4a72d32807b136830833e88e250f8f38b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159161
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
index 955bcde316f9..5429d09cbb1d 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
@@ -47,8 +47,6 @@ public class LayerView extends FrameLayout {
 private InputConnectionHandler mInputConnectionHandler;
 private LayerRenderer mRenderer;
 
-/* Must be a PAINT_xxx constant */
-private int mPaintState = PAINT_NONE;
 private boolean mFullScreen = false;
 
 private SurfaceView mSurfaceView;
@@ -58,12 +56,6 @@ public class LayerView extends FrameLayout {
 //TODO static because of registerCxxCompositor() function, should be fixed 
in the future
 private static LibreOfficeMainActivity mContext;
 
-/* Flags used to determine when to show the painted surface. The integer
- * order must correspond to the order in which these states occur. */
-public static final int PAINT_NONE = 0;
-public static final int PAINT_BEFORE_FIRST = 1;
-public static final int PAINT_AFTER_FIRST = 2;
-
 public LayerView(Context context, AttributeSet attrs) {
 super(context, attrs);
 mContext = (LibreOfficeMainActivity) context;
@@ -217,19 +209,6 @@ public class LayerView extends FrameLayout {
 return mRenderer;
 }
 
-/* paintState must be a PAINT_xxx constant. The state will only be changed
- * if paintState represents a state that occurs after the current state. */
-public void setPaintState(int paintState) {
-if (paintState > mPaintState) {
-Log.d(LOGTAG, "LayerView paint state set to " + paintState);
-mPaintState = paintState;
-}
-}
-
-public int getPaintState() {
-return mPaintState;
-}
-
 public LayerRenderer getRenderer() {
 return mRenderer;
 }
commit 0a5bf928d936443bf1ff84118a9790a9b334801c
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 15:19:48 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:54:08 2023 +0100

android: Drop unused GLController#waitForValidSurface

The method is unused, so drop it, and also the now never
read `mSurfaceValid` member.

Likely, the comment that the method is invoked via JNI
was never valid for LibreOffice Viewer, but is from Gecko/Fennec
days, similar to the case in the previous commit,

Change-Id I54dd33a2ce30ebdc375a7c1fefacca6e99d2f571
    Author: Michael Weghorn 
Date:   Wed Nov 8 15:10:19 2023 +0100

android: Drop unused GLController#resumeCompositorIfValid etc.

Change-Id: I165d2c7ebf5b9ce940b608d738d9a10d5bef69ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159160
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java 
b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
index 76af0e78fc4d..2c503ab8b302 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
@@ -20,7 +20,6 @@ public class GLController {
 
 private LayerView mView;
 private int mGLVersion;
-private boolean mSurfaceValid;
 private int mWidth, mHeight;
 
 private EGL10 mEGL;
@@ -45,7 +44,6 @@ public class GLController {
 public GLController(LayerView view) {
 mView = view;
 mGLVersion = 2;
-mSurfaceValid = false;
 }
 
 public void setGLVersion(int version) {
@@ -116,19 +114,6 @@ public class GLController {
 mGL = null;
 return true;
 }
-
-// Wait until we are allowed to use EGL functions on the Surface backing
-// this window. This function is invoked by JNI
-public synchronized void waitForValidSurface() {
-while (!mSurfaceValid) {
-try {
-wait();
-} catch (InterruptedException e) {
-throw new RuntimeException(e);
-}
-}
-}
-
 public synchronized int getWidth() {
 return mWidth;
 }
@@ -138,14 +123,12 @@ public class

[Libreoffice-commits] core.git: 2 commits - android/source

2023-11-08 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/GLController.java   |   
27 --
 android/source/src/java/org/mozilla/gecko/gfx/LayerView.java  |
1 
 android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java |
5 -
 3 files changed, 33 deletions(-)

New commits:
commit 32423989263e17b8fdd1b8952180e025c50ed1bd
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 15:10:19 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:54:01 2023 +0100

android: Drop unused GLController#resumeCompositorIfValid etc.

The comment claiming that this function is invoked
by JNI was true when the method was added upstream
in Fennec/Gecko in commit [1]

commit ae9420729da323d02a3f2f02d5a4b3043a619007
Author: Kartikaya Gupta 
Date:   Fri Jul 13 10:19:46 2012 -0400

Bug 769269 - Update the graphics code to be able to deal with 
blowing away the layer controller, client, and view and creating them afresh. 
r=ajuma

, but it's not true for the copy here in
Android Viewer, so drop the unused method
and `RenderControllerThread#compositionResumeRequested`
that would only have been called from there and wouldn't
have done anything anyway.

[1] 
https://github.com/mozilla/gecko-dev/commit/ae9420729da323d02a3f2f02d5a4b3043a619007

Change-Id: I54dd33a2ce30ebdc375a7c1fefacca6e99d2f571
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159159
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java 
b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
index 533980979683..76af0e78fc4d 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
@@ -117,13 +117,6 @@ public class GLController {
 return true;
 }
 
-// This function is invoked by JNI
-public synchronized void resumeCompositorIfValid() {
-if (mSurfaceValid) {
-mView.getListener().compositionResumeRequested(mWidth, mHeight);
-}
-}
-
 // Wait until we are allowed to use EGL functions on the Surface backing
 // this window. This function is invoked by JNI
 public synchronized void waitForValidSurface() {
diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
index c3f639ddf7d1..955bcde316f9 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
@@ -304,7 +304,6 @@ public class LayerView extends FrameLayout {
 void compositorCreated();
 void renderRequested();
 void compositionPauseRequested();
-void compositionResumeRequested(int width, int height);
 void surfaceChanged(int width, int height);
 }
 
diff --git 
a/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java 
b/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java
index 06f82f158366..a5b2ed79cbd3 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java
@@ -81,11 +81,6 @@ public class RenderControllerThread extends Thread 
implements LayerView.Listener
 queue.add(RenderCommand.SURFACE_DESTROYED);
 }
 
-@Override
-public void compositionResumeRequested(int width, int height) {
-
-}
-
 @Override
 public void surfaceChanged(int width, int height) {
 this.width = width;
commit 9032551306bfac623984bed0031cbd6b8bfe54fb
Author: Michael Weghorn 
AuthorDate: Wed Nov 8 14:11:54 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 9 07:53:52 2023 +0100

android: Drop unused GLController#provideEGLSurface

It was already unused when added in

commit a6ecd8b2a9f0f3eaa66388861a6dcc6260ec72b9
Date:   Thu Jun 26 11:22:21 2014 +0200

LOAndroid3: ant/make for building, Bootstrap project

The method looks similar to the first half of
`GLController#provideEGLSurface` and is unused,
so drop  it.

Change-Id: I0cabfddefcdcca97048cb6f494590afdde5c1dc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159158
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java 
b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
index e296f4760f68..533980979683 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
@@ -240,26 +240,6 @@ public class GLController {
 }
 }
 
-/**
- * Provides an EGLSurface without assuming ownership of this surface.
- * This class does not keep

[Libreoffice-commits] core.git: android/source

2023-11-07 Thread Michael Weghorn (via logerrit)
 android/source/build.gradle |1 -
 1 file changed, 1 deletion(-)

New commits:
commit ff3fb42b48c70ba5788507a6177bf0a9f3b50fdb
Author: Michael Weghorn 
AuthorDate: Tue Nov 7 17:27:49 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 7 22:17:35 2023 +0100

android: Don't add "-editing" suffix to version/vendor

Don't append "-editing" to the version string, which
would then end up to be something like
"24.2.0.0.alpha0+/7763190f7ec2/The Document Foundation-editing"
when the build was configured with
`--with-vendor="The Document Foundation"` and would result
in the "About" dialog/widget saying
"This release was supplied by The Document Foundation-editing."
(s. `AboutDialogFragment#onCreateDialog`).

While it's useful to have the different build flavors
(with or without the experimental editing support), I see no need
to have the build config reflected in the version string.
(Whether experimental editing support was enabled during the
build can easily be seen by checking whether the "Experimental
Mode" option is available in the settings.)

Change-Id: I48ddb3a842b9db4fc1f435683ed9d8e8e85898ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159079
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/build.gradle b/android/source/build.gradle
index f4f74338284c..f207ddedf267 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -82,7 +82,6 @@ android {
 strippedUIEditing {
 dimension "default"
 buildConfigField 'boolean', 'ALLOW_EDITING', 'true'
-versionNameSuffix "-editing"
 }
 fullUI.dimension "default"
 }


[Libreoffice-commits] core.git: vcl/unx

2023-11-06 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx |   35 ++-
 1 file changed, 34 insertions(+), 1 deletion(-)

New commits:
commit 285c309ad7d92f6b92b5bdf1dd8f490fbdf59d56
Author: Michael Weghorn 
AuthorDate: Mon Nov 6 17:48:08 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 7 07:59:55 2023 +0100

gtk4 a11y: Map states to corresponding GtkAccessibleState

Set those states that Gtk handles as `GtkAccessibleState`,
see documentation at [1].

For the LO a11y states, the Gtk 4 a11y API differentiates
between three different enums/ways of handling those:

* `AccessibleProperty`, for which handling was added in the
  previous commit, Change-Id Ic033e66dd89021defca449bbe2251102bbd61015,
  "gtk4 a11y: Map states to corresponding gtk a11y properties"
* `GtkAccessibleState`, for which this commit implements
   the handling
* `GtkAccessiblePlatformState`, for which handling
   was implemented in `lo_accessible_get_platform_state` in

commit 341ff232aec77c2b46325389da933315613b6f2d
Author: Caolán McNamara 
Date:   Mon Mar 20 20:37:15 2023 +

gtk4: get a11y to say hello world

  already.

[1] https://docs.gtk.org/gtk4/enum.AccessibleState.html

Change-Id: If22725dc2ccab5f73518e4171209a80a9c4df6d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159006
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index fc148d41c199..b60e3d0676de 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -474,7 +474,10 @@ lo_accessible_new(GdkDisplay* pDisplay, GtkAccessible* 
pParent,
 ret->uno_accessible->getAccessibleContext());
 assert(xContext.is() && "No accessible context");
 
-// set state properties
+// handle states
+// Gtk differentiates between GtkAccessibleState and GtkAccessibleProperty
+// (both handled here) and GtkAccessiblePlatformState (handled in
+// 'lo_accessible_get_platform_state')
 const sal_Int64 nStates = xContext->getAccessibleStateSet();
 gtk_accessible_update_property(
 GTK_ACCESSIBLE(ret), GTK_ACCESSIBLE_PROPERTY_MODAL,
@@ -496,6 +499,36 @@ lo_accessible_new(GdkDisplay* pDisplay, GtkAccessible* 
pParent,
GTK_ORIENTATION_VERTICAL, -1);
 }
 
+gtk_accessible_update_state(
+GTK_ACCESSIBLE(ret), GTK_ACCESSIBLE_STATE_BUSY,
+bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::BUSY),
+GTK_ACCESSIBLE_STATE_DISABLED,
+bool(!(nStates & 
com::sun::star::accessibility::AccessibleStateType::ENABLED)),
+GTK_ACCESSIBLE_STATE_EXPANDED,
+bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::EXPANDED),
+GTK_ACCESSIBLE_STATE_SELECTED,
+bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::SELECTED), -1);
+
+const sal_Int16 nRole = xContext->getAccessibleRole();
+if (nRole == com::sun::star::accessibility::AccessibleRole::CHECK_BOX)
+{
+GtkAccessibleTristate eState = GTK_ACCESSIBLE_TRISTATE_FALSE;
+if (nStates & 
com::sun::star::accessibility::AccessibleStateType::INDETERMINATE)
+eState = GTK_ACCESSIBLE_TRISTATE_MIXED;
+else if (nStates & 
com::sun::star::accessibility::AccessibleStateType::CHECKED)
+eState = GTK_ACCESSIBLE_TRISTATE_TRUE;
+gtk_accessible_update_state(GTK_ACCESSIBLE(ret), 
GTK_ACCESSIBLE_STATE_CHECKED, eState, -1);
+}
+else if (nRole == 
com::sun::star::accessibility::AccessibleRole::TOGGLE_BUTTON)
+{
+GtkAccessibleTristate eState = GTK_ACCESSIBLE_TRISTATE_FALSE;
+if (nStates & 
com::sun::star::accessibility::AccessibleStateType::INDETERMINATE)
+eState = GTK_ACCESSIBLE_TRISTATE_MIXED;
+else if (nStates & 
com::sun::star::accessibility::AccessibleStateType::PRESSED)
+eState = GTK_ACCESSIBLE_TRISTATE_TRUE;
+gtk_accessible_update_state(GTK_ACCESSIBLE(ret), 
GTK_ACCESSIBLE_STATE_PRESSED, eState, -1);
+}
+
 // set values from XAccessibleValue interface if that's implemented
 css::uno::Reference 
xAccessibleValue(xContext,

css::uno::UNO_QUERY);


[Libreoffice-commits] core.git: vcl/unx

2023-11-06 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx |   26 +-
 1 file changed, 25 insertions(+), 1 deletion(-)

New commits:
commit a5c84405caf6f3dc51919fd937dfe21c3d6d53d1
Author: Michael Weghorn 
AuthorDate: Mon Nov 6 16:59:36 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 7 07:59:28 2023 +0100

gtk4 a11y: Map states to corresponding gtk a11y properties

For those states in
`com::sun::star::accessibility::AccessibleStateType::EDITABLE`
that have a corresponding `GTK_ACCESSIBLE_PROPERTY_*`, set
that property when creating a new `LoAccessible`.

This e.g. makes Accerciser show the "multiline" and "multi selectable"
AT-SPI states for a Writer paragraph when using the gtk4 VCL plugin.

State updates are not handled yet, since a11y event handling is
currently not implemented in the gtk4 VCL plugin yet.

Change-Id: Ic033e66dd89021defca449bbe2251102bbd61015
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159005
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 2aae5bdefae6..fc148d41c199 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -470,9 +470,33 @@ lo_accessible_new(GdkDisplay* pDisplay, GtkAccessible* 
pParent,
 ret->parent = pParent;
 ret->uno_accessible = rAccessible;
 
-// set values from XAccessibleValue interface if that's implemented
 css::uno::Reference xContext(
 ret->uno_accessible->getAccessibleContext());
+assert(xContext.is() && "No accessible context");
+
+// set state properties
+const sal_Int64 nStates = xContext->getAccessibleStateSet();
+gtk_accessible_update_property(
+GTK_ACCESSIBLE(ret), GTK_ACCESSIBLE_PROPERTY_MODAL,
+bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::MODAL),
+GTK_ACCESSIBLE_PROPERTY_MULTI_LINE,
+bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::MULTI_LINE),
+GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE,
+bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::MULTI_SELECTABLE),
+GTK_ACCESSIBLE_PROPERTY_READ_ONLY,
+bool(!(nStates & 
com::sun::star::accessibility::AccessibleStateType::EDITABLE)), -1);
+if (nStates & 
com::sun::star::accessibility::AccessibleStateType::HORIZONTAL)
+{
+gtk_accessible_update_property(GTK_ACCESSIBLE(ret), 
GTK_ACCESSIBLE_PROPERTY_ORIENTATION,
+   GTK_ORIENTATION_HORIZONTAL, -1);
+}
+else if ((nStates & 
com::sun::star::accessibility::AccessibleStateType::VERTICAL))
+{
+gtk_accessible_update_property(GTK_ACCESSIBLE(ret), 
GTK_ACCESSIBLE_PROPERTY_ORIENTATION,
+   GTK_ORIENTATION_VERTICAL, -1);
+}
+
+// set values from XAccessibleValue interface if that's implemented
 css::uno::Reference 
xAccessibleValue(xContext,

css::uno::UNO_QUERY);
 if (xAccessibleValue.is())


[Libreoffice-commits] core.git: vcl/qt5

2023-11-06 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtAccessibleWidget.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a182f283dabf5753e857a66386ef32226be47f49
Author: Michael Weghorn 
AuthorDate: Mon Nov 6 16:16:24 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 7 07:58:28 2023 +0100

qt a11y: Map AccessibleStateType::INDETERMINATE to Qt equivalent

`QAccessible::State` has a `checkStateMixed` state flag [1]
that matches what `AccessibleStateType::INDETERMINATE` is for,
and Qt's AT-SPI adapter maps that to the AT-SPI equivalent,
`ATSPI_STATE_INDETERMINATE`, so add the corresponding
mapping.

[1] https://doc.qt.io/qt-6/qaccessible-state.html
[2] 
https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/accessible/linux/qspi_constant_mappings.cpp?id=c5d9e4a7a78b82ed31e5225c169de4718dfe4f05#n41

Change-Id: Ic16f50344040f3d4ff7ad4ef0002abf5a7ae3dcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159004
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index cbd750a4da38..47eb08b7e8c7 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -606,7 +606,7 @@ void lcl_addState(QAccessible::State* state, sal_Int64 
nState)
 // No match
 break;
 case AccessibleStateType::INDETERMINATE:
-// No match
+state->checkStateMixed = true;
 break;
 case AccessibleStateType::MANAGES_DESCENDANTS:
 // No match


[Libreoffice-commits] core.git: vcl/qt5

2023-11-06 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtAccessibleWidget.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 66fa5aeec5dbeba978f70fe464fbc87c3aba8ed2
Author: Michael Weghorn 
AuthorDate: Mon Nov 6 11:06:16 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 7 07:57:58 2023 +0100

qt a11y: Set passwordEdit state for PASSWORD_TEXT

The Qt API doesn't have a separate role to distinguish password edits
from other text edits, but has a `passwordEdit` state.

Set that state for objects that have role
`AccessibleRole::PASSWORD_TEXT`.

With this in place, password entries,
e.g. the one in the "Tools" -> "Options" -> "Security"
-> "Password for Web Connections" -> "Master Password" dialog,
are exposed via the `ATSPI_ROLE_PASSWORD_TEXT` role with the
qt6 VCL plugin on Linux, because Qt's AT-SPI adapter takes
the `passwordEdit` state into account when mapping the
Qt a11y roles to AT-SPI ones. [1]

[1] 
https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/accessible/linux/atspiadaptor.cpp?id=c5d9e4a7a78b82ed31e5225c169de4718dfe4f05#n1637

Change-Id: Icb3f0935e703e2786c5704007cad7eea9070f8a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158987
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index cba67bc60cc8..cbd750a4da38 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -465,6 +465,8 @@ QAccessible::Role QtAccessibleWidget::role() const
 case AccessibleRole::BLOCK_QUOTE:
 return QAccessible::Paragraph;
 case AccessibleRole::PASSWORD_TEXT:
+// Qt API doesn't have a separate role to distinguish password 
edits,
+// but a 'passwordEdit' state
 return QAccessible::EditableText;
 case AccessibleRole::POPUP_MENU:
 return QAccessible::PopupMenu;
@@ -687,6 +689,9 @@ QAccessible::State QtAccessibleWidget::state() const
 lcl_addState(, nState);
 }
 
+if (xAc->getAccessibleRole() == AccessibleRole::PASSWORD_TEXT)
+state.passwordEdit = true;
+
 return state;
 }
 


[Libreoffice-commits] core.git: vcl/unx

2023-11-06 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e510da3b0379c63e6ecfefeb7358251591226701
Author: Michael Weghorn 
AuthorDate: Mon Nov 6 10:47:23 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 7 07:57:34 2023 +0100

gtk4 a11y: Map PASSWORD_TEXT role to gtk text box role

This is in line with what the `GtkPasswordEntry` doc [1]
says:

> `GtkPasswordEntry` uses the `GTK_ACCESSIBLE_ROLE_TEXT_BOX` role.

Note however, that gtk's AT-SPI bridge has specific code to map
that to AT-SPI's `ATSPI_ROLE_PASSWORD_TEXT` for `GtkPasswordEntry` [2],
which won't apply for any custom LO widgets.

Currently, LO uses `GtkEntry` for password entries for gtk4
as well, e.g. the one in the "Tools" -> "Options" -> "Security"
-> "Password for Web Connections" -> "Master Password" dialog,
so those currently have an AT-SPI role of
`ATSPI_ROLE_TEXT` for gtk4, while it is
`ATSPI_ROLE_PASSWORD_TEXT` for gtk3.
(That's independent of this change, since a native `GtkEntry` is
used there. Changing this to use `GtkPasswordEntry` instead of
`GtkEntry` for the gtk4 case should cause that to use
`ATSPI_ROLE_PASSWORD_TEXT` as well.)

[1] https://docs.gtk.org/gtk4/class.PasswordEntry.html#accessibility
[2] 
https://gitlab.gnome.org/GNOME/gtk/-/blob/fe4b7a5159e8cc3e4918ad1829d71ff39edd5ba7/gtk/a11y/gtkatspiutils.c#L308-310

Change-Id: Iec6c8685f017b565553fbc63b4403484be20ed1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158984
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index fcd9cb6fb949..2aae5bdefae6 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -184,6 +184,7 @@ map_accessible_role(const 
css::uno::Reference&
 eRole = GTK_ACCESSIBLE_ROLE_SPIN_BUTTON;
 break;
 case css::accessibility::AccessibleRole::TEXT:
+case css::accessibility::AccessibleRole::PASSWORD_TEXT:
 eRole = GTK_ACCESSIBLE_ROLE_TEXT_BOX;
 break;
 case css::accessibility::AccessibleRole::TOOL_TIP:


[Libreoffice-commits] core.git: 2 commits - include/svx svx/source vcl/unx

2023-11-06 Thread Michael Weghorn (via logerrit)
 include/svx/AccessibleTextHelper.hxx  |   12 
 include/svx/weldeditview.hxx  |2 +-
 svx/source/accessibility/AccessibleTextHelper.cxx |   15 +++
 svx/source/dialog/weldeditview.cxx|   14 ++
 vcl/unx/gtk3/a11y/atkwrapper.cxx  |2 ++
 5 files changed, 44 insertions(+), 1 deletion(-)

New commits:
commit dff76b069e26a6d3487f74c5784d6f6cf273a19e
Author: Michael Weghorn 
AuthorDate: Mon Nov 6 13:07:35 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 7 07:51:37 2023 +0100

tdf#135236 a11y: Notify a11y layer of WeldEditView sel change

Extend `WeldEditView::EditViewSelectionChange` to not only
invalidate the view, but also notify the `AccessibleTextHelper`
of the selection update, so the corresponding events are sent
on the a11y layer.

This e.g. causes the `CARET_CHANGED` events to be sent as
needed when moving the cursor/caret using the arrow keys in the
"Not in dictionary" text edit in Writer's spelling dialog
("Tools" -> "Spelling"), so the Orca screen reader on Linux
with the gtk3 or qt6 VCL plugin announces the new caret position,
which was no longer the case since the spelling dialog was welded
in

commit 243b5b392906042ab03800e0b5765e6f3513372c
Date:   Fri Jun 14 21:56:44 2019 +0100

weld SpellDialog

The newly added `AccessibleTextHelper::UpdateSelection` is a
simplified version of `AccessibleTextHelper::UpdateChildren`.

Change-Id: I5f0898c3ccb9fd527a6ff672be49157cb6e518b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158992
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/svx/AccessibleTextHelper.hxx 
b/include/svx/AccessibleTextHelper.hxx
index 724cb0c8a7e6..963ae41e5b30 100644
--- a/include/svx/AccessibleTextHelper.hxx
+++ b/include/svx/AccessibleTextHelper.hxx
@@ -276,6 +276,18 @@ public:
 */
 void UpdateChildren();
 
+/** Update the selection.
+
+@attention Might fire state change events, therefore,
+don't hold any mutex except solar mutex, which you are
+required to lock before. This method should only be called
+from the main office thread.
+
+Call this method if the selection has changed and the
+the AccessibleTextHelper isn't notified internally.
+*/
+void UpdateSelection();
+
 /** Drop all references and enter disposed state
 
 This method drops all references to external objects (also
diff --git a/include/svx/weldeditview.hxx b/include/svx/weldeditview.hxx
index 004be7b609fb..43002a95e58c 100644
--- a/include/svx/weldeditview.hxx
+++ b/include/svx/weldeditview.hxx
@@ -87,7 +87,7 @@ protected:
 
 virtual void EditViewInvalidate(const tools::Rectangle& rRect) override { 
Invalidate(rRect); }
 
-virtual void EditViewSelectionChange() override { Invalidate(); }
+virtual void EditViewSelectionChange() override;
 
 virtual OutputDevice& EditViewOutputDevice() const override
 {
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx 
b/svx/source/accessibility/AccessibleTextHelper.cxx
index d836f2ee4970..f12281793b78 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -1672,6 +1672,21 @@ namespace accessibility
 
 mpImpl->UpdateSelection();
 
+#ifdef DBG_UTIL
+mpImpl->CheckInvariants();
+#endif
+}
+
+void AccessibleTextHelper::UpdateSelection()
+{
+#ifdef DBG_UTIL
+// precondition: solar mutex locked
+DBG_TESTSOLARMUTEX();
+mpImpl->CheckInvariants();
+#endif
+
+mpImpl->UpdateSelection();
+
 #ifdef DBG_UTIL
 mpImpl->CheckInvariants();
 #endif
diff --git a/svx/source/dialog/weldeditview.cxx 
b/svx/source/dialog/weldeditview.cxx
index 415e9e7d109d..46ab95eb9a18 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -1669,6 +1669,20 @@ 
css::uno::Reference WeldEditView::GetC
 return weld::CustomWidgetController::GetClipboard();
 }
 
+void WeldEditView::EditViewSelectionChange()
+{
+Invalidate();
+
+#if !ENABLE_WASM_STRIP_ACCESSIBILITY
+if (m_xAccessible.is())
+{
+::accessibility::AccessibleTextHelper* pHelper = 
m_xAccessible->GetTextHelper();
+if (pHelper)
+pHelper->UpdateSelection();
+}
+#endif
+}
+
 namespace
 {
 class WeldEditViewUIObject final : public DrawingAreaUIObject
commit 0769e5e698a9cff77a815118dad82bc763520679
Author: Michael Weghorn 
AuthorDate: Mon Nov 6 12:02:22 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 7 07:51:30 2023 +0100

tdf#135236 gtk3 a11y: Restore AtkObject's focus_event

After

commit 14e6a810e14e28ab82fe65d66e604ce562016845
Date:   Mon Aug 15 13:14:08 2022 

[Libreoffice-commits] core.git: sw/source

2023-11-03 Thread Michael Weghorn (via logerrit)
 sw/source/core/access/accpara.cxx |   39 --
 1 file changed, 39 deletions(-)

New commits:
commit a2e0b39b62129d9dbae438ec6b12fca210bbcbb5
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 16:04:51 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Nov 3 07:31:37 2023 +0100

sw a11y: No longer report underline for misspelling

No longer report a red wavy underline for misspelled
words in Writer.

The underline isn't really a character/text attribute, since
it's not part of the actual formatting of the text, but is
just shown visually.

Each platform a11y API has a better way to explicitly
report misspelling.

commit ec2e02cfa41510c3d30b118cbf7595c84a046d03
Author: Michael Weghorn 
Date:   Tue Oct 17 14:36:58 2023 +0200

tdf#157696 a11y: Report spelling error via IA2 "invalid:spelling" 
attr

and

commit 2bf88c172c9c9d159344b95fb96073f4891a6c30
    Author: Michael Weghorn 
Date:   Wed Oct 18 13:44:42 2023 +0200

tdf#157696 wina11y: Switch from custom to IA2 text attributes

added the implementation for Windows and
the Qt-based VCL plugins on Linux.

On macOS (`NSAccessibilityMarkedMisspelledTextAttribute`/
`NSAccessibilityMisspelledTextAttribute`) and for gtk3/ATK,
the corresponding attributes were already used before.

Therefore, reporting an underline as a workaround is no
longer needed.

Orca on Linux, NVDA on Windows (with [1] in place)
and CrossOver on macOS all make use of the specific
character attribute to announce spelling errors, not
the underline. If any assistive technology should stop
reporting spelling errors due to this change, it should
be fixed to handle the proper text attribute as well.

After switching to text attributes according to the
IAccessible2 specification on Windows (i.e. with,
the above-mentioned commits and the NVDA commit
to switch to IAccessible2 text attributes for LO [1]),
NVDA was starting to announce not only that a word is
misspelled, but an underline in addition, which is
no more the case now that the underlining is no more
reported.

[1] 
https://github.com/nvaccess/nvda/commit/de4e8814f39ab6ae9fbc5330b007494ef6888cd3

Change-Id: Ifa29e0080a4a039c5a119dd0debe5e924fa546ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158847
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 7fb728f68fbc..62db53567a3e 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1905,7 +1905,6 @@ void SwAccessibleParagraph::_correctValues( const 
sal_Int32 nIndex,
 pos = pFrame->MapViewToModel(nCorePos + TextFrameIndex(1)); // try 
this one instead
 assert(pos.first->Len() != pos.second);
 }
-const SwTextNode *const pTextNode(pos.first);
 
 sal_Int32 nValues = rValues.size();
 for (sal_Int32 i = 0;  i < nValues;  ++i)
@@ -1962,47 +1961,9 @@ void SwAccessibleParagraph::_correctValues( const 
sal_Int32 nIndex,
 continue;
 }
 
-// UnderLine
-if (rValue.Name == UNO_NAME_CHAR_UNDERLINE)
-{
-//misspelled word
-SwCursorShell* pCursorShell = GetCursorShell();
-if( pCursorShell != nullptr && pCursorShell->GetViewOptions() && 
pCursorShell->GetViewOptions()->IsOnlineSpell())
-{
-const SwWrongList* pWrongList = pTextNode->GetWrong();
-if( nullptr != pWrongList )
-{
-sal_Int32 nBegin = pos.second;
-sal_Int32 nLen = 1;
-if (pWrongList->InWrongWord(nBegin, nLen) && 
!pTextNode->IsSymbolAt(nBegin))
-{
-rValue.Value <<= sal_uInt16(LINESTYLE_WAVE);
-}
-}
-}
-continue;
-}
-
 // UnderLineColor
 if (rValue.Name == UNO_NAME_CHAR_UNDERLINE_COLOR)
 {
-//misspelled word
-SwCursorShell* pCursorShell = GetCursorShell();
-if( pCursorShell != nullptr && pCursorShell->GetViewOptions() && 
pCursorShell->GetViewOptions()->IsOnlineSpell())
-{
-const SwWrongList* pWrongList = pTextNode->GetWrong();
-if( nullptr != pWrongList )
-{
-sal_Int32 nBegin = pos.second;
-sal_Int32 nLen = 1;
-if (pWrongList->InWrongWord(nBegin, nLen) && 
!pTextNode->IsSymbolAt(nBegin))
-{
-rValue.Value <<= sal_Int32(0x00ff);
-   

[Libreoffice-commits] core.git: vcl/osx

2023-11-03 Thread Michael Weghorn (via logerrit)
 vcl/osx/a11ytextattributeswrapper.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e6d34f00a5c408d64168d84c718ae5071feea4fd
Author: Michael Weghorn 
AuthorDate: Thu Nov 2 17:10:52 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Nov 3 07:30:39 2023 +0100

macOS a11y: Drop obsolete TODO to implement spelling error attr

Handling for `NSAccessibilityMisspelledTextAttribute` and the newer
`NSAccessibilityMarkedMisspelledTextAttribute` [1] has been added in

commit db0fa92637a1b2edf26da9917c9dce050ebc8a78
Author: Boris Dušek 
Date:   Sun Aug 11 16:37:48 2013 +0200

fdo#67980 - VoiceOver does not inform about misspelled text

and VoiceOver announces misspelled Writer text as such, so drop the
obsolete TODO.

[1] 
https://developer.apple.com/documentation/appkit/nsaccessibilitymarkedmisspelledtextattribute

Change-Id: Id8ae1ee660e87c06ac7f559b5cdf1b31e22aef90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158840
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/osx/a11ytextattributeswrapper.mm 
b/vcl/osx/a11ytextattributeswrapper.mm
index 8a8afe9a154b..4404dc646365 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -199,7 +199,7 @@ using namespace ::com::sun::star::uno;
 bool underlineHasColor = false;
 // add attributes to string
 for ( const PropertyValue& property : attributes ) {
-// TODO: NSAccessibilityMisspelledTextAttribute, 
NSAccessibilityAttachmentTextAttribute, NSAccessibilityLinkTextAttribute
+// TODO: NSAccessibilityAttachmentTextAttribute, 
NSAccessibilityLinkTextAttribute
 // NSAccessibilityStrikethroughColorTextAttribute is unsupported by 
UNP-API
 if ( property.Value.hasValue() ) {
 if ( property.Name == "CharUnderline" ) {


[Libreoffice-commits] core.git: accessibility/source

2023-11-02 Thread Michael Weghorn (via logerrit)
 accessibility/source/standard/vclxaccessiblebutton.cxx |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 97c9b0ccedeecf37c565adffb9f3823558013848
Author: Michael Weghorn 
AuthorDate: Thu Nov 2 13:28:22 2023 +0100
Commit: Michael Weghorn 
CommitDate: Thu Nov 2 15:54:24 2023 +0100

tdf#112661 tdf#112662 a11y: Fix toggling button via a11y action

`PushButton::Click does not` toggle a `PushButton`
that is a toggle button. Therefore, call
`PushButton::Check` and `PushButton::Toggle` instead
when the acessible "press" action is performed on
a toggle button, which makes this work as expected.

The same is already done in the UITest code, see
`ButtonUIObject::execute`.

The originally rerported issue in tdf#112661 and
tdf#112662 was that there was no action available
for the "Templates" and "Recent Documents" toggle
buttons in the start center via the NSAccessibility
API on macOS at all. By now, the "press" action was
available, but performing the action (e.g. using
the Ctrl+CapsLock+Space keyboard shortcut for
VoiceOver) didn't have any effect.
The same was true when performing the action via
Accerciser using the AT-SPI Action interface when
using the qt6 VCL plugin on Linux.

With this change in place, toggling between
showing the templates and the recently used
documents in the start center works using that
action, just as it does when clicking on one
of the toggle buttons in the UI using the mouse.

For gtk3, which is using native GtkToggleButtons,
this was already working without this change in place.

Change-Id: Ie3f02ec914239e0718ca1bfb4ba701f0831bb16a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158807
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/source/standard/vclxaccessiblebutton.cxx 
b/accessibility/source/standard/vclxaccessiblebutton.cxx
index 52153a0c22b9..31c8188b99ab 100644
--- a/accessibility/source/standard/vclxaccessiblebutton.cxx
+++ b/accessibility/source/standard/vclxaccessiblebutton.cxx
@@ -167,7 +167,18 @@ sal_Bool VCLXAccessibleButton::doAccessibleAction ( 
sal_Int32 nIndex )
 
 VclPtr< PushButton > pButton = GetAs< PushButton >();
 if ( pButton )
-pButton->Click();
+{
+if (pButton->isToggleButton())
+{
+// PushButton::Click doesn't toggle when it's a toggle button
+pButton->Check(!pButton->IsChecked());
+pButton->Toggle();
+}
+else
+{
+pButton->Click();
+}
+}
 
 return true;
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - svx/source

2023-11-02 Thread Michael Weghorn (via logerrit)
 svx/source/svdraw/svdhdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 46bbc6ff0f99f664ec4957cd29943b0627cbf2ba
Author: Michael Weghorn 
AuthorDate: Thu Oct 12 18:57:57 2023 +0200
Commit: Xisco Fauli 
CommitDate: Thu Nov 2 11:12:28 2023 +0100

tdf#141828 svx: Use pointing hand for custom shape handles

Use the *pointing* hand cursor (`PointerStyle::RefHand`)
instead of the hand symbol cursor (`PointerStyle::Hand`)
for handles for custom shape interaction.
(S. how `SdrHdlKind::CustomShape1` is only specified in
`SdrObjCustomShape::AddToHdlList`, except for read-only
switch/cases elsewhere).

As mentioned in tdf#141828, this has the advantage that
the user can see where the handle is being moved.

For gtk3, this doesn't make any difference in practice,
because it's using the same cursor type for both,
`PointerStyle::RefHand` and `PointerStyle::Hand`
(s. `GtkSalDisplay::getCursor`, but the Qt-based VCL
plugins (`QtData::getCursor`) and macOS
(s. `AquaSalFrame::getCurrentCursor`) make a
distinction between them.

Change-Id: I5d35481e5c5edc1895a7c4a973315ee6b187b983
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157891
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 3d1cd490ac0366245c4b55d711611c21149a76e9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158032
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 379b3ed3f73e..64f29976f5ca 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1011,7 +1011,7 @@ PointerStyle SdrHdl::GetPointer() const
 case SdrHdlKind::Ref2 : ePtr=PointerStyle::RefHand;   break;
 case SdrHdlKind::BezierWeight : 
ePtr=PointerStyle::MoveBezierWeight; break;
 case SdrHdlKind::Glue : ePtr=PointerStyle::MovePoint; break;
-case SdrHdlKind::CustomShape1 : ePtr=PointerStyle::Hand; break;
+case SdrHdlKind::CustomShape1 : ePtr=PointerStyle::RefHand; 
break;
 default:
 break;
 }


[Libreoffice-commits] core.git: vcl/osx

2023-11-01 Thread Michael Weghorn (via logerrit)
 vcl/osx/a11ywrapper.mm |8 
 1 file changed, 8 insertions(+)

New commits:
commit 64d7bb1917c38ad8e256a482778df647904f5502
Author: Michael Weghorn 
AuthorDate: Tue Oct 31 17:45:57 2023 +0100
Commit: Michael Weghorn 
CommitDate: Wed Nov 1 21:21:01 2023 +0100

macOS a11y: Don't report (non-)expanded state when not expandable

When the a11y object is not expandable, also don't
report a true/false value for the expanded state on
macOS.

Otherwise, the CrossOver screen reader on macOS
will explicitly announce "collapsed" for these
objects, e.g. when moving focus between paragraphs
in Writer (as reported on the a11y mailing list [1])
or between toolbar butons, since
`isAccessibilityExpanded` gets called and
returns false, so it is assumed that this
is an expandable item that is currently
not expanded, i.e. it is collapsed.

Quoting from the NSAccessibilityProtocol doc [2]:

> You can control which accessor methods the assistive app can
> use by overriding isAccessibilitySelectorAllowed(_:).
> Return true if the assistive app can call the selector;
> otherwise, return false."

[1] https://listarchives.libreoffice.org/global/accessibility/msg01068.html
[2] 
https://developer.apple.com/documentation/appkit/nsaccessibilityprotocol:

Change-Id: Iac9027a598e5793d6bd0da79212d7b07448a4c34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158733
Tested-by: Jenkins
Reviewed-by: Patrick Luby 
Reviewed-by: Michael Weghorn 

diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 887ea024ca44..df1d3690df6d 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -1575,6 +1575,14 @@ static Reference < XAccessibleContext > hitTestRunner ( 
css::awt::Point point,
 if ( ! aSelector )
 return NO;
 
+// don't explicitly report (non-)expanded state when not expandable
+if (aSelector == @selector(isAccessibilityExpanded))
+{
+const sal_Int64 nStateSet = [ self accessibleContext ] -> 
getAccessibleStateSet();
+if (!( nStateSet & AccessibleStateType::EXPANDABLE))
+return false;
+}
+
 if ( [ self respondsToSelector: aSelector ] ) {
 // Ignore actions if action is not supported
 NSAccessibilityActionName pActionName = [ AquaA11yActionWrapper 
actionNameForSelector: aSelector ];


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2023-10-31 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |   51 ---
 1 file changed, 40 insertions(+), 11 deletions(-)

New commits:
commit bd159d4f4f827821782926cc13f8b5c4c8a63a3d
Author: Michael Weghorn 
AuthorDate: Mon Oct 30 15:32:30 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Oct 31 07:05:51 2023 +0100

qtcreator: Add Obj-C++ files to project

Extend gbuild-to-ide to also take into account
Objective-C++ files that are set with the
`OBJCXXOBJECTS` key in the json files.

Extend the Qt Creator IDE integration target
(`make qtcreator-ide-integration`) to make use
of that information to find the corresponding
headers as well, and set sources and headers
in the `OBJECTIVE_SOURCES` [1] and
`OBJECTIVE_HEADERS` [2] qmake veriables.

This way, those files are part of the project
and the Clang Code Model works as expected,
which makes features like code completion and
showing issues work correctly for such files
(like e.g. vcl/osx/a11ywrapper.mm) as well.

[1] https://doc.qt.io/qt-6/qmake-variable-reference.html#objective-sources
[2] https://doc.qt.io/qt-6/qmake-variable-reference.html#objective-headers

Change-Id: I2c1cf5bdfdc64300ec3eb77e42de1ae2cd4223f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158665
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 82ff9e6fc631..fb1b84bcc52e 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -26,9 +26,9 @@ import collections
 import urllib.parse
 
 class GbuildLinkTarget:
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
-(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.cflags, self.linked_libs) = 
(
-name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
+(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.objcxxobjects, self.cflags, 
self.linked_libs) = (
+name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, objcxxobjects, cflags, linked_libs)
 
 def short_name(self):
 return self.name
@@ -43,8 +43,8 @@ class GbuildLinkTarget:
 
 
 class GbuildLib(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
 
 def short_name(self):
 """Return the short name of target based on the Library_* makefile 
name"""
@@ -57,8 +57,8 @@ class GbuildLib(GbuildLinkTarget):
 return self.name
 
 class GbuildTest(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
 
 def short_name(self):
 """Return the short name of target based n the CppunitTest_* makefile 
names"""
@@ -68,8 +68,8 @@ class GbuildTest(GbuildLinkTarget):
 return 'CppunitTest_%s' % self.name
 
 class GbuildExe(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, cflags, linked_libs):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, cflags, linked_libs)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
 
 def short_name(self):
 """Return the short name of target based on the Executable_* makefile 
name"""
@@ -111,7 +111,7 @@ clas

[Libreoffice-commits] core.git: 2 commits - bin/gbuild-to-ide

2023-10-31 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 0779066f4788ec01daee6b452cde02b9139019aa
Author: Michael Weghorn 
AuthorDate: Mon Oct 30 15:30:18 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Oct 31 07:05:41 2023 +0100

bin/gbuild-to-ide: Drop trailing whitespace

Change-Id: I3142080721db11f75631accd3a5e403027a63110
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158664
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index ce72f4ae2e53..82ff9e6fc631 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -304,7 +304,7 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 
 
 
-""" 
+"""
 
 for module in self.gbuildparser.modulenamelist:
 tempxml = []
@@ -329,7 +329,7 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 macrokey = macroskeyvalue[0]
 macrovalue = macroskeyvalue[1]
 if macrovalue[-1:] == "\n":
-macrovalue = macrovalue[:-1] 
+macrovalue = macrovalue[:-1]
 templine = "%s%s\n" 
%(macrokey, macrovalue)
 tempxml.insert(-13, templine)
 tempxml="".join(tempxml)
@@ -344,7 +344,7 @@ class 
EclipseCDTIntegrationGenerator(IdeIntegrationGenerator):
 def emit(self):
 self.create_include_paths()
 self.create_macros()
-self.create_settings_file() 
+self.create_settings_file()
 
 class CodeliteIntegrationGenerator(IdeIntegrationGenerator):
 
commit 303899b811f8cf3dd72caacb0d9a4f59d245b02d
Author: Michael Weghorn 
AuthorDate: Mon Oct 30 11:45:30 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Oct 31 07:05:34 2023 +0100

qtcreator: Set correct soffice path on macOS

The soffice path is different on macOS than it is on
Linux or Windows. Let gbuild-to-ide take that into
account when generating the QtCreator IDE integration
(`make qtcreator-ide-integration`), so the autogenerated
run/debug target works.

Change-Id: Ibdd4cf32bddadfe67608b06b7b3ce58c2a9dd518
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158653
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index f428f451e990..ce72f4ae2e53 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1472,9 +1472,10 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 
 def generate_run_configs(self, lib_folder):
 
-# If we use 'soffice', it's ok only for "Run", not for "Debug".
-# So we put "soffice.bin" that is ok for both.
-loexec = "%s/instdir/program/soffice.bin" % self.base_folder
+if platform == 'darwin':
+loexec = "%s/instdir/LibreOfficeDev.app/Contents/MacOS/soffice" % 
self.base_folder
+else:
+loexec = "%s/instdir/program/soffice.bin" % self.base_folder
 xml = QtCreatorIntegrationGenerator.run_configs_template % {
 'loexec': loexec,
 'workdir': self.base_folder


[Libreoffice-commits] core.git: 2 commits - offapi/com sw/source test/source vcl/osx vcl/qa vcl/qt5 vcl/source vcl/unx winaccessibility/inc winaccessibility/source

2023-10-27 Thread Michael Weghorn (via logerrit)
 offapi/com/sun/star/accessibility/AccessibleRole.idl|8 +
 offapi/com/sun/star/text/AccessibleParagraphView.idl|5 +--
 sw/source/core/access/accmap.cxx|   12 +--
 sw/source/core/access/accpara.cxx   |   25 
 sw/source/core/access/accpara.hxx   |2 +
 sw/source/core/access/acctextframe.cxx  |3 +
 test/source/a11y/AccessibilityTools.cxx |2 +
 vcl/osx/a11yrolehelper.mm   |2 +
 vcl/qa/cppunit/a11y/atspi2/atspi2.cxx   |1 
 vcl/qt5/QtAccessibleWidget.cxx  |1 
 vcl/source/window/builder.cxx   |2 -
 vcl/unx/gtk3/a11y/atkwrapper.cxx|2 +
 vcl/unx/gtk4/a11y.cxx   |1 
 winaccessibility/inc/AccParagraphEventListener.hxx  |4 +-
 winaccessibility/source/service/AccObject.cxx   |6 +++
 winaccessibility/source/service/AccObjectWinManager.cxx |1 
 16 files changed, 60 insertions(+), 17 deletions(-)

New commits:
commit b7d2a9c824aca1a4dfd1b857a3620e73ade6bc0d
Author: Michael Weghorn 
AuthorDate: Fri Oct 27 17:55:59 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sat Oct 28 05:45:25 2023 +0200

tdf#135586 sw a11y: Use BLOCK_QUOTE role for "Block Quotation" para

If a paragraph is using the "Block Quotation" paragraph style,
report the newly introduced BLOCK_QUOTE a11y role for it instead
of the PARAGRAPH role.

This is similar to how the HEADING role is reported when
one of the paragraph styles for headings is used
(s. `SwAccessibleParagraph::GetRealHeadingLevel`).

This is also in line with what is documented for mapping
LO elements to tagged PDF elements in
sw/inc/EnhancedPDFExportHelper.hxx:

> * Mapping of OOo elements to tagged pdf elements:
> *
> * OOo element  tagged pdf element
> * ---  --
> * [...]
> * SwFormat Quotations   BlockQuote

This makes the Orca screen reader with the gtk3 VCL plugin on Linux
and the NVDA screen reader on Windows explicitly announce a paragraph
as block quote when moving there with the cursor.

Adapt some places that have specific handling for the
PARAGRAPH role to take into account the BLOCK_QUOTE
role as well.

Change-Id: I4a89625c2a3f07d37df09e68cb7045a59cfff633
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158574
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/offapi/com/sun/star/text/AccessibleParagraphView.idl 
b/offapi/com/sun/star/text/AccessibleParagraphView.idl
index 4b5a9d23e457..108faedd0fd2 100644
--- a/offapi/com/sun/star/text/AccessibleParagraphView.idl
+++ b/offapi/com/sun/star/text/AccessibleParagraphView.idl
@@ -49,9 +49,10 @@ service AccessibleParagraphView
 children of the paragraph fragment but of the document view
 itself.
 The role is either
-::com::sun::star::accessibility::AccessibleRole::PARAGRAPH or
+::com::sun::star::accessibility::AccessibleRole::PARAGRAPH,
+::com::sun::star::accessibility::AccessibleRole::BLOCK_QUOTE or
 ::com::sun::star::accessibility::AccessibleRole::HEADING.
-The later one is returned
+The latter is returned
 if the paragraph's style is contained in the chapter
 numbering of a text document.
 The name is "paragraph" or "heading" (or the equivalent term
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 9b3ac84876eb..0df41e3a2814 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -899,7 +899,8 @@ void SwAccessibleMap::FireEvent( const 
SwAccessibleEvent_Impl& rEvent )
 if( aIter != mpFrameMap->end() )
 {
 rtl::Reference < SwAccessibleContext > xContext( 
(*aIter).second.get() );
-if (xContext.is() && xContext->getAccessibleRole() == 
AccessibleRole::PARAGRAPH)
+if (xContext.is() && (xContext->getAccessibleRole() == 
AccessibleRole::PARAGRAPH
+  || xContext->getAccessibleRole() == 
AccessibleRole::BLOCK_QUOTE))
 {
 xAccImpl = xContext.get();
 }
@@ -1333,7 +1334,8 @@ void SwAccessibleMap::InvalidateShapeInParaSelection()
 if (xAccParent.is())
 {
 uno::Reference< XAccessibleContext > 
xAccContext = xAccParent->getAccessibleContext();
-

[Libreoffice-commits] core.git: 2 commits - vcl/unx winaccessibility/source

2023-10-27 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx |   80 ++
 winaccessibility/source/service/AccObject.cxx |  301 +-
 2 files changed, 273 insertions(+), 108 deletions(-)

New commits:
commit 33061be5a7538409839dcca3116b9fa72629013f
Author: Michael Weghorn 
AuthorDate: Fri Oct 27 15:24:46 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sat Oct 28 05:45:06 2023 +0200

tdf#135586 wina11y: Make role mapping more explicit

The previous `ROLE_TABLE` looked like it might
explicitly map the UNO role on the left-hand side
to the IAccessible2 role on the right-hand side,
and the comment also said so.

In reality, the UNO role on the left hand side was
not really accessed, but the assumption was that
the index of each entry would correspond to the
sal_Int16 value of the UNO role
(`css::accessibility::AccessibleRole`).

Make that mapping more explicit by replacing
it with a helper function
`lcl_mapToIAccessible2Role` and slightly
simplify `AccObject::UpdateRole`.

Change-Id: Id02553c4df042982f92fce3338077e95db687a83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158572
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index 98c6bba9392f..ad0f65d8cc09 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -26,6 +26,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -51,102 +52,199 @@ using namespace com::sun::star::accessibility;
 using namespace com::sun::star::accessibility::AccessibleRole;
 using namespace com::sun::star::accessibility::AccessibleStateType;
 
-//Role mapping table,left side is UNO role, right side is MSAA role
-const short ROLE_TABLE[][2] =
+namespace {
+
+/**
+ * Map a UNO accessible role to an IAccessible2 role.
+ * @param nUnoRole The UNO role (css::accessiblity::AccessibleRole).
+ * @return IAccessible2 role.
+ */
+short lcl_mapToIAccessible2Role(sal_Int16 nUnoRole)
+{
+switch(nUnoRole)
 {
-{UNKNOWN,  IA2_ROLE_UNKNOWN},
-{ALERT ,   ROLE_SYSTEM_DIALOG},
-{COLUMN_HEADER ,   ROLE_SYSTEM_COLUMNHEADER},
-//{CANVAS ,  ROLE_SYSTEM_CLIENT},
-{CANVAS ,  IA2_ROLE_CANVAS},
-{CHECK_BOX ,   ROLE_SYSTEM_CHECKBUTTON},
-{CHECK_MENU_ITEM , IA2_ROLE_CHECK_MENU_ITEM},
-{COLOR_CHOOSER,IA2_ROLE_COLOR_CHOOSER},
-{COMBO_BOX ,   ROLE_SYSTEM_COMBOBOX},
-{DATE_EDITOR , IA2_ROLE_DATE_EDITOR},
-{DESKTOP_ICON ,IA2_ROLE_DESKTOP_ICON},
-{DESKTOP_PANE, IA2_ROLE_DESKTOP_PANE},
-{DIRECTORY_PANE,   IA2_ROLE_DIRECTORY_PANE},
-{DIALOG,   ROLE_SYSTEM_DIALOG},
-{DOCUMENT, ROLE_SYSTEM_DOCUMENT},
-{EMBEDDED_OBJECT , IA2_ROLE_EMBEDDED_OBJECT },
-{END_NOTE ,IA2_ROLE_ENDNOTE },
-{FILE_CHOOSER ,IA2_ROLE_FILE_CHOOSER },
-{FILLER,   ROLE_SYSTEM_WHITESPACE},
-{FONT_CHOOSER, IA2_ROLE_FONT_CHOOSER},
-{FOOTER,   IA2_ROLE_FOOTER},
-{FOOTNOTE, IA2_ROLE_FOOTNOTE},
-{FRAME,IA2_ROLE_FRAME},
-{GLASS_PANE ,  IA2_ROLE_GLASS_PANE},
-{GRAPHIC , ROLE_SYSTEM_GRAPHIC},
-{GROUP_BOX,ROLE_SYSTEM_GROUPING},
-{HEADER ,  IA2_ROLE_HEADER},
-{HEADING , IA2_ROLE_HEADING},
-{HYPER_LINK ,  ROLE_SYSTEM_TEXT},
-{ICON ,IA2_ROLE_ICON},
-{INTERNAL_FRAME,   IA2_ROLE_INTERNAL_FRAME},
-{LABEL,ROLE_SYSTEM_STATICTEXT},
-{LAYERED_PANE ,IA2_ROLE_LAYERED_PANE},
-{LIST ,ROLE_SYSTEM_LIST},
-{LIST_ITEM ,   ROLE_SYSTEM_LISTITEM},
-//{MENU ,ROLE_SYSTEM_MENUPOPUP},
-{MENU,ROLE_SYSTEM_MENUITEM},
-{MENU_BAR, ROLE_SYSTEM_MENUBAR},
-{MENU_ITEM,ROLE_SYSTEM_MENUITEM},
-{OPTION_PANE , IA2_ROLE_OPTION_PANE},
-{PAGE_TAB, ROLE_SYSTEM_PAGETAB},
-{PAGE_TAB_LIST,ROLE_SYSTEM_PAGETABLIST},
-{PANEL,IA2_ROLE_OPTION_PANE},
-{PARAGRAPH,IA2_ROLE_PARAGRAPH},
-{PASSWORD_TEXT,ROLE_SYSTEM_TEXT},
-{POPUP_MENU,   ROLE_SYSTEM_MENUPOPUP},
-{PUSH_BUTTON,  ROLE_SYSTEM_PUSHBUTTON},
-{PROGRESS_BAR, ROLE_SYSTEM_PROGRESSBAR},
-{RADIO_BUTTON

[Libreoffice-commits] core.git: vcl/unx

2023-10-27 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx |  147 +-
 1 file changed, 146 insertions(+), 1 deletion(-)

New commits:
commit 2186fd52d1ef909d4398e84408f76c8357718e1e
Author: Michael Weghorn 
AuthorDate: Fri Oct 27 11:13:55 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Oct 27 16:45:17 2023 +0200

gtk4 a11y: Implement GtkAccessibleRange iface

Implement the `GtkAccessibleRange` range interface [1]
added in gtk 4.10, which is bridged to the AT-SPI Value
interface on Linux inside gtk.

Also set the related properties to their values retrieved
from the `XAccessibleValue` interface. (Those already
existed before gtk 4.10.)

The GType handling for implementing the interface only
if the `XAccessibleContext` of the underlying LO a11y
object implements `XAccessibleValue` is mostly copied
over from the gtk3 a11y implementation
(in vcl/unx/gtk3/a11y/atkwrapper.cxx) and adapted
a bit.

Let `lo_accessible_range_set_current_value` always return
true independent of whether the given value was actually
set, since LibreOffice (together with Accerciser)  otherwise
crashes due to no proper DBus reply being sent, when
trying to set a new value via AT-SPI API, s.a. [2] and [3].

When setting a new value, take the type of the current
value into account, as done for gtk3 in

commit a0b7b47e3ec843d8012a7526c1e8e72d67cc41b1
Author: Michael Weghorn 
Date:   Tue Oct 24 12:29:54 2023 +0200

gtk3 a11y: Take current type into account when setting new value

With this change in place, the AT-SPI Value interface
is now shown as available for a checkbox form control
in a Writer doc when selecting the corresponding a11y
object in Accerciser's tree view of the LO a11y hierarchy.
When changing the value via Accerciser, the checkbox in
LibreOffice gets (un)checked as expected. (Setting the
value to 1.0 causes the checkbox to be checked, 0.0 to
become unchecked.).

The initial values (current value, min and max value)
are set properly. However, when querying the current
value after changing it, the initial value is still
returned. This likely needs to be addressed by
bridging the corresponding `AccessibleEventId::VALUE_CHANGED`
event to Gtk/AT-SPI by calling
`gtk_accessible_update_property` with the new value.
However, there's currently no implementation for
handling a11y events in the gtk4 VCL plugin yet, so
leave that for later.

More interfaces to expose more functionality
to the a11y layer will likely be implemented in
upcoming gtk versions (like an interface for Text [4])
and bridging those should presumably be possible in a
similar way.

[1] https://docs.gtk.org/gtk4/iface.AccessibleRange.html
[2] https://gitlab.gnome.org/GNOME/gtk/-/issues/6150
[3] 
https://gitlab.gnome.org/GNOME/gtk/-/commit/0dbd2bd09eff8c9233e45338a05daf2a835529ab
[4] https://gitlab.gnome.org/GNOME/gtk/-/issues/5912

Change-Id: I84136fd80361d21cf4f79ab17118bb14079ab785
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158556
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index cbc2f853feaf..bf149f2ac083 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -183,6 +184,80 @@ struct LoAccessibleClass
 GObjectClass parent_class;
 };
 
+#if GTK_CHECK_VERSION(4, 10, 0)
+static void lo_accessible_range_init(GtkAccessibleRangeInterface* iface);
+static gboolean lo_accessible_range_set_current_value(GtkAccessibleRange* 
self, double fNewValue);
+#endif
+
+extern "C" {
+typedef GType (*GetGIfaceType)();
+}
+const struct
+{
+const char* name;
+GInterfaceInitFunc const aInit;
+GetGIfaceType const aGetGIfaceType;
+const css::uno::Type& (*aGetUnoType)();
+} TYPE_TABLE[] = {
+#if GTK_CHECK_VERSION(4, 10, 0)
+{ "Value", reinterpret_cast(lo_accessible_range_init),
+  gtk_accessible_range_get_type, 
cppu::UnoType::get }
+#endif
+};
+
+static bool isOfType(css::uno::XInterface* xInterface, const css::uno::Type& 
rType)
+{
+if (!xInterface)
+return false;
+
+try
+{
+css::uno::Any aRet = xInterface->queryInterface(rType);
+const bool bIs = (typelib_TypeClass_INTERFACE == 
aRet.pType->eTypeClass)
+ && (aRet.pReserved != nullptr);
+return bIs;
+}
+catch (const css::uno::Exception&)
+{
+return false;
+}
+}
+
+static GType ensureTypeFor(css::uno::XInterface* xAccessible)
+{
+OStringBuffer aTypeNameBuf("OOoGtkAccessibleObj");
+std::vector bTypes(std::size(TYPE_TABLE), fals

[Libreoffice-commits] core.git: vcl/unx

2023-10-26 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 69b50eee1cf103229d4d774fd54b46d0ff767472
Author: Michael Weghorn 
AuthorDate: Thu Oct 26 14:24:43 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Oct 26 18:10:10 2023 +0200

gtk4 a11y: Map checkbox role to gtk equivalent

This makes a checkbox form control in a Writer document
show up with the proper role in Accerciser, no longer
as a filler.

Change-Id: I5566d27ecfbe9ec54dcfbf20693899b72d3af738
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158505
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 418037027f48..cbc2f853feaf 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -77,6 +77,9 @@ map_accessible_role(const 
css::uno::Reference&
 case css::accessibility::AccessibleRole::SEPARATOR:
 eRole = GTK_ACCESSIBLE_ROLE_SEPARATOR;
 break;
+case css::accessibility::AccessibleRole::CHECK_BOX:
+eRole = GTK_ACCESSIBLE_ROLE_CHECKBOX;
+break;
 case css::accessibility::AccessibleRole::CHECK_MENU_ITEM:
 eRole = GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX;
 break;


[Libreoffice-commits] core.git: download.lst external/IAccessible2 external/Module_external.mk Makefile.fetch winaccessibility/CustomTarget_ia2_idl.mk winaccessibility/source

2023-10-25 Thread Michael Weghorn (via logerrit)
 Makefile.fetch|1 
 download.lst  |5 
 external/IAccessible2/ExternalProject_IAccessible2.mk |   26 
 external/IAccessible2/Module_IAccessible2.mk  |   17 
 external/IAccessible2/README  |5 
 external/IAccessible2/UnpackedTarball_IAccessible2.mk |   14 
 external/Module_external.mk   |1 
 winaccessibility/CustomTarget_ia2_idl.mk  |   21 
 winaccessibility/source/UAccCOMIDL/ia2_api_all.idl| 5476 --
 9 files changed, 90 insertions(+), 5476 deletions(-)

New commits:
commit 809409ca845ff1269d3d8f516678048404d8fea8
Author: Michael Weghorn 
AuthorDate: Wed Oct 25 16:19:33 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Oct 25 20:48:07 2023 +0200

tdf#135586 a11y: Make IAccessible2 an external and update it

So far, there was an internal copy of the IAccessible2
IDL file added in 2013, and never updated since then
(except for cosmetic changes like formatting and typo
fixes), and therefore it e.g. doesn't have the
`IA2_ROLE_BLOCK_QUOTE` role needed for tdf#135586.

Drop the outdated internal copy and integrate an up to
date upstream version (current git master) instead.

Instead of duplicating things in an internal copy,
switch to using the usual mechanism for externals.

The IAccessible2 source contains separate .idl files
for the different interfaces, while the previous
interal copy was already the merged IDL file.

Call the IAccessible2 `./concatidl.sh` script to generate
the merged `ia2_api_all.idl`
(s. external/IAccessible2/ExternalProject_IAccessible2.mk)
and adapt the winaccessibility make files to use that
version instead of the internal copy.
(Add a dependency to the target that generates
`ia2_api_all.idl`.)

The tarball was generated from the master branch of the
IAccessible2 git repo [1] as of

commit 3d8c7f0b833453f761ded6b12d8be431507bfe0b (HEAD -> master, 
origin/master, origin/HEAD, mygithub/master)
Author: Michael Weghorn 
Date:   Fri Oct 13 04:16:03 2023 +0300

Update no longer working links (#26)

* Update link to Linux Foundation Trademark Policy
* Update link to Object Attributes specification

Signed-off-by: Michael Weghorn 

using this command:

$ git archive -o ../IAccessible2-1.3+git20231013.3d8c7f0.tar.gz 
--prefix=IAccessible2-1.3+git20231013.3d8c7f0/ master

Andrea Gelmini's typo fixes have been upstreamed in [2].

[1] https://github.com/LinuxA11y/IAccessible2
[2] https://github.com/LinuxA11y/IAccessible2/pull/21

Change-Id: I9f19ff55694da5d3a9a8750be8de387cbf6da785
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158427
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/Makefile.fetch b/Makefile.fetch
index 41d6a85d13c0..8cd2c543891f 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -134,6 +134,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk 
$(SRCDIR)/download.lst $(S
$(call fetch_Optional,HSQLDB,HSQLDB_TARBALL) \
$(call fetch_Optional,HUNSPELL,HUNSPELL_TARBALL) \
$(call fetch_Optional,HYPHEN,HYPHEN_TARBALL) \
+   $(if $(filter WNT,$(OS)),IACCESSIBLE2_TARBALL) \
$(call fetch_Optional,ICU,ICU_TARBALL) \
$(call fetch_Optional,ICU,ICU_DATA_TARBALL) \
$(call fetch_Optional,JAVA_WEBSOCKET,JAVA_WEBSOCKET_TARBALL) \
diff --git a/download.lst b/download.lst
index 5aeeb74a6cdc..f1f1ed87e036 100644
--- a/download.lst
+++ b/download.lst
@@ -307,6 +307,11 @@ HYPHEN_TARBALL := 
5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-2.8.8.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
+IACCESSIBLE2_SHA256SUM := 
0e279003f5199f80031c6dcd08f79d6f65a0505139160e7df0d09b226bff4023
+IACCESSIBLE2_TARBALL := IAccessible2-1.3+git20231013.3d8c7f0.tar.gz
+# three static lines
+# so that git cherry-pick
+# will not run into conflicts
 ICU_SHA256SUM := 
818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1
 ICU_TARBALL := icu4c-73_2-src.tgz
 ICU_DATA_SHA256SUM := 
ca1ee076163b438461e484421a7679fc33a64cd0a54f9d4b401893fa1eb42701
diff --git a/external/IAccessible2/ExternalProject_IAccessible2.mk 
b/external/IAccessible2/ExternalProject_IAccessible2.mk
new file mode 100644
index ..0ef6c8fc6014
--- /dev/null
+++ b/external/IAccessible2/ExternalProject_IAccessible2.mk
@@ -0,0 +1,26 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at h

Re: Request for tarball upload (IAccessible2)

2023-10-25 Thread Michael Weghorn

On 2023-10-25 17:44, Stephan Bergmann wrote:

On 10/25/23 16:40, Michael Weghorn wrote:

Could someone please upload the following tarball to
dev-www.libreoffice.org?

https://nextcloud.documentfoundation.org/s/tpKW89gmd5zLzNH/download/IAccessible2-1.3+git20231013.3d8c7f0.tar.gz


done,


Thanks a lot, Stephan!


$ sha256sum IAccessible2-1.3+git20231013.3d8c7f0.tar.gz
0e279003f5199f80031c6dcd08f79d6f65a0505139160e7df0d09b226bff4023  
IAccessible2-1.3+git20231013.3d8c7f0.tar.gz


That's the correct checksum.


OpenPGP_signature.asc
Description: OpenPGP digital signature


Request for tarball upload (IAccessible2)

2023-10-25 Thread Michael Weghorn

Could someone please upload the following tarball to
dev-www.libreoffice.org?

https://nextcloud.documentfoundation.org/s/tpKW89gmd5zLzNH/download/IAccessible2-1.3+git20231013.3d8c7f0.tar.gz

(needed for https://gerrit.libreoffice.org/c/core/+/158427
"tdf#135586 a11y: Make IAccessible2 an external and update it";
tarball generated from current IAccessible2 git master as described in 
the commit message)


OpenPGP_signature.asc
Description: OpenPGP digital signature


[Libreoffice-commits] core.git: vcl/unx

2023-10-24 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/a11y/atkvalue.cxx |   18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit a0b7b47e3ec843d8012a7526c1e8e72d67cc41b1
Author: Michael Weghorn 
AuthorDate: Tue Oct 24 12:29:54 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 24 14:55:55 2023 +0200

gtk3 a11y: Take current type into account when setting new value

This is the gtk3 variant of

Change-Id I8674fc37798491fd0b57543acb491edbd4a5a056
qt a11y: Take current type into account when setting new value

See that change's commit message for more details.

Change-Id: I597220253fa0ca61252706915ad009b8846bbd42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158383
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk3/a11y/atkvalue.cxx b/vcl/unx/gtk3/a11y/atkvalue.cxx
index f5e45d3b2556..014164da2027 100644
--- a/vcl/unx/gtk3/a11y/atkvalue.cxx
+++ b/vcl/unx/gtk3/a11y/atkvalue.cxx
@@ -21,6 +21,7 @@
 
 #include 
 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -110,8 +111,23 @@ value_wrapper_set_current_value( AtkValue *value,
 = getValue( value );
 if( pValue.is() )
 {
-// FIXME - this needs expanding
 double aDouble = g_value_get_double( gval );
+
+// Different types of numerical values for XAccessibleValue are 
possible.
+// If current value has an integer type, also use that for the new 
value, to make
+// sure underlying implementations expecting that can handle the 
value properly.
+const css::uno::Any aCurrentValue = pValue->getCurrentValue();
+if (aCurrentValue.getValueTypeClass() == 
css::uno::TypeClass::TypeClass_LONG)
+{
+const sal_Int32 nValue = std::round(aDouble);
+return pValue->setCurrentValue(css::uno::Any(nValue));
+}
+else if (aCurrentValue.getValueTypeClass() == 
css::uno::TypeClass::TypeClass_HYPER)
+{
+const sal_Int64 nValue = std::round(aDouble);
+return pValue->setCurrentValue(css::uno::Any(nValue));
+}
+
 return pValue->setCurrentValue( uno::Any(aDouble) );
 }
 }


[Libreoffice-commits] core.git: vcl/qt5

2023-10-24 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtAccessibleWidget.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit d2daaedf2e3b30ff28f4a9a33b6b70738273f9e3
Author: Michael Weghorn 
AuthorDate: Tue Oct 24 12:01:05 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 24 14:55:24 2023 +0200

qt a11y: Take current type into account when setting new value

As the `XAccessibleValue` documentation [1] describes,
the underlying implementations can used different types
of numerical values.

Qt's `QAccessibleValueInterface` uses `QVariant`, so could
in theory also support different numerical types.

The AT-SPI Value interface however always uses double. [2]

So far, `QtAccessibleWidget::setCurrentValue` was also always
extracting a double value from the `QVariant` param and
creating an `Any` from that.

This however would result in any `XAccessibleValue::setCurrentValue`
implementations assuming to be passed an integer would fail to
extract a proper new value from the Any.

As an example, selecting a currently checked checkbox
(e.g. the "Automatic" checkbox in Writer's "Paragraph"
formatting dialog, "Indents & Spacing" tab) in Accerciser's
treeview of LO's a11y hierarchy woul result in the checkbox
to be unchecked, because Accerciser reads the current and then
sets the same value again when selecting an item with its
"Interface View" tab active.

Prevent that from happening by passing a `sal_Int32`/`sal_Int64`
value again if the current value is also using that type.

[1] offapi/com/sun/star/accessibility/XAccessibleValue.idl
[2] 
https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/7cc4cee53ddbd22631fd110f0e5ce045dec2e411/xml/Value.xml

Change-Id: I8674fc37798491fd0b57543acb491edbd4a5a056
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158380
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index 3407eb574d5c..cec049340f07 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -1282,7 +1282,17 @@ void QtAccessibleWidget::setCurrentValue(const QVariant& 
value)
 Reference xValue(xAc, UNO_QUERY);
 if (!xValue.is())
 return;
-xValue->setCurrentValue(Any(value.toDouble()));
+
+// Different types of numerical values for XAccessibleValue are possible.
+// If current value has an integer type, also use that for the new value, 
to make
+// sure underlying implementations expecting that can handle the value 
properly.
+const Any aCurrentValue = xValue->getCurrentValue();
+if (aCurrentValue.getValueTypeClass() == 
css::uno::TypeClass::TypeClass_LONG)
+xValue->setCurrentValue(Any(static_cast(value.toInt(;
+else if (aCurrentValue.getValueTypeClass() == 
css::uno::TypeClass::TypeClass_HYPER)
+
xValue->setCurrentValue(Any(static_cast(value.toLongLong(;
+else
+xValue->setCurrentValue(Any(value.toDouble()));
 }
 
 // QAccessibleTableInterface


[Libreoffice-commits] core.git: accessibility/source vcl/source

2023-10-24 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/accessiblelistboxentry.cxx |   17 +++
 vcl/source/treelist/svimpbox.cxx |8 +++
 2 files changed, 25 insertions(+)

New commits:
commit eafef8fd195654f0e7dbd007bcc7fa0f6d29b599
Author: Michael Weghorn 
AuthorDate: Tue Oct 24 10:03:44 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 24 12:58:14 2023 +0200

tdf#135921 a11y Send event when toggling listbox checkbox

When toggling the state of the checkbox in a listbox/
treelist entry using the mouse or the keyboard, emit
a `VclEventId::CheckboxToggle` event and process
that in the a11y class that's used for the case
where there's just a single checkbox (like in the
spelling options dialog), `AccessibleListBoxEntry`
by sending a corresponding STATE_CHANGED event
on the a11y layer.

This makes Orca with the qt6 VCL plugin and NVDA on Windows
announce the new value when toggling a checkbox in the
Spelling options dialog using either the mouse or the
keyboard.

As mentioned in the previous commit,

   Change-Id Ic78f9052d166be0da17a76261a09da02b8a11cd7
   tdf#135921 a11y: Toggle listbox item checkbox on space

, the case where a listbox entry has multiple checkboxes
(like the autocorrect options dialog in Writer)
uses different a11y classes and toggling a checkbox there
still doesn't result in the new value being announced.

Change-Id: I36a2b0a3fa3154279fb06af023fdb96f699fac2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158375
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx 
b/accessibility/source/extended/accessiblelistboxentry.cxx
index 69feac418805..10433d882730 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -84,6 +85,22 @@ namespace accessibility
 
 switch ( rEvent.GetId() )
 {
+case VclEventId::CheckboxToggle:
+{
+// assert this object is represented as a checkbox on a11y 
layer (LABEL role is used for
+// SvButtonState::Tristate, s. 
AccessibleListBoxEntry::getAccessibleRole)
+assert(getAccessibleRole() == AccessibleRole::CHECK_BOX
+   || getAccessibleRole() == AccessibleRole::LABEL);
+Any aOldValue;
+Any aNewValue;
+if (getAccessibleStateSet() & AccessibleStateType::CHECKED)
+aNewValue <<= AccessibleStateType::CHECKED;
+else
+aOldValue <<= AccessibleStateType::CHECKED;
+
+NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, 
aOldValue, aNewValue);
+break;
+}
 case  VclEventId::ObjectDying :
 {
 if ( m_pTreeListBox )
diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index 559882560a12..0deea8f69820 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -1849,7 +1849,12 @@ bool SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& 
rMEvt )
 m_pActiveButton->SetStateHilighted( false );
 tools::Long nMouseX = rMEvt.GetPosPixel().X();
 if (pEntry == m_pActiveEntry && m_pView->GetItem(m_pActiveEntry, 
nMouseX) == m_pActiveButton)
+{
+const bool bChecked = m_pActiveButton->IsStateChecked();
 m_pActiveButton->ClickHdl(m_pActiveEntry);
+if (m_pActiveButton->IsStateChecked() != bChecked)
+CallEventListeners(VclEventId::CheckboxToggle, m_pActiveEntry);
+}
 InvalidateEntry(m_pActiveEntry);
 if (m_pCursor == m_pActiveEntry)
 ShowCursor(true);
@@ -2333,8 +2338,11 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
 if (pButtonItem)
 {
 SvLBoxButton* pButton = 
static_cast(pButtonItem);
+const bool bChecked = pButton->IsStateChecked();
 pButton->ClickHdl(m_pCursor);
 InvalidateEntry(m_pCursor);
+if (pButton->IsStateChecked() != bChecked)
+CallEventListeners(VclEventId::CheckboxToggle, 
m_pActiveEntry);
 }
 else
 bKeyUsed = false;


[Libreoffice-commits] core.git: vcl/source

2023-10-24 Thread Michael Weghorn (via logerrit)
 vcl/source/treelist/svimpbox.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 6974c10901cc052bce23295ddff25530137e94c8
Author: Michael Weghorn 
AuthorDate: Tue Oct 24 09:49:32 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 24 12:57:32 2023 +0200

tdf#135921 a11y: Toggle listbox item checkbox on space

Allow toggling the state of the checkbox in a listbox/
treelist entry using the space key if the entry is currently
selected.

This aligns it with the behavior for "plain" checkboxes.

On the a11y layer, these listbox entries are
even exposed just as a checkbox when there's only
a single checkbox for the entry
(s. `AccessibleListBoxEntry::getAccessibleRole`),
like in the Spelling options dialog ("Tools" -> "Spelling",
then press the "Options..." button).

For the case where there are multiple checkboxes
(like in the Writer autocorrect options dialog),
the first checkbox will be toggled.
Making it possible to toggle any of the checkboxes
for that case would need further work, s.a. the
the related tdf#135585.
(For gtk3, it's possible to use the arrow keys
to switch the column, then use the space key
to toggle the checkbox.)
That scenario also uses a different approach
for the a11y layer, not a single
`AccessibleListBoxEntry` object as is the case
for the tdf#135921 scenario.

This change makes it possible to toggle the checkbox,
but so far, the new state is not yet announced
when a screen reader is running, neither when
using the keyboard nor when using the mouse
(which was possible without this change already).
The event handling that's required for this will
be added in a separate commit.

Change-Id: Ic78f9052d166be0da17a76261a09da02b8a11cd7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158374
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index f0fa1938a8a9..559882560a12 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -2326,13 +2326,24 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
 // toggle selection
 m_pView->Select( m_pCursor, !m_pView->IsSelected( 
m_pCursor ) );
 }
-else if ( !m_pView->IsSelected( m_pCursor ) )
+else if (m_pView->IsSelected(m_pCursor))
+{
+// trigger button
+SvLBoxItem* pButtonItem = 
m_pCursor->GetFirstItem(SvLBoxItemType::Button);
+if (pButtonItem)
+{
+SvLBoxButton* pButton = 
static_cast(pButtonItem);
+pButton->ClickHdl(m_pCursor);
+InvalidateEntry(m_pCursor);
+}
+else
+bKeyUsed = false;
+}
+else
 {
 SelAllDestrAnch( false );
 m_pView->Select( m_pCursor );
 }
-else
-bKeyUsed = false;
 }
 else
 bKeyUsed = false;


[Libreoffice-commits] core.git: offapi/com

2023-10-23 Thread Michael Weghorn (via logerrit)
 offapi/com/sun/star/accessibility/XAccessibleValue.idl |   21 -
 1 file changed, 10 insertions(+), 11 deletions(-)

New commits:
commit a8cfd280fbb5aff27ef90cee45daa185e24ea5c7
Author: Michael Weghorn 
AuthorDate: Mon Oct 23 13:41:54 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Oct 23 20:36:07 2023 +0200

a11y: Make XAccessibleValue doc more consistent

* Align the method names in the documentation
  to what the acual methods are called
  (e.g. `getMaximumValue`, not `getMaximumAccessibleValue`).

* Use "minimum" and "maximum" consistently, not "minimal"
  and "maximal" in some places.

Change-Id: Idf4f36dca118a614b04a4b958e97d225f70dde0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158347
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/offapi/com/sun/star/accessibility/XAccessibleValue.idl 
b/offapi/com/sun/star/accessibility/XAccessibleValue.idl
index 842f8776ae25..ff4149489e3d 100644
--- a/offapi/com/sun/star/accessibility/XAccessibleValue.idl
+++ b/offapi/com/sun/star/accessibility/XAccessibleValue.idl
@@ -44,8 +44,7 @@ interface XAccessibleValue : ::com::sun::star::uno::XInterface
 
 The argument is clipped to the valid interval whose upper and
 lower bounds are returned by the methods
-getMaximumAccessibleValue() and
-getMinimumAccessibleValue(), i.e. if it is lower than
+getMaximumValue() and getMinimumValue(), i.e. if it is lower than
 the minimum value the new value will be the minimum and if it is
 greater than the maximum then the new value will be the maximum.
 
@@ -59,41 +58,41 @@ interface XAccessibleValue : 
::com::sun::star::uno::XInterface
 */
 boolean setCurrentValue ([in] any aNumber);
 
-/** Returns the maximal value that can be represented by this object.
+/** Returns the maximum value that can be represented by this object.
 
 The type of the returned value is implementation dependent.  It
 does not have to be the same type as that returned by
-getCurrentAccessibleValue().
+getCurrentValue().
 
 @return
-Returns the maximal value in an implementation dependent type.
+Returns the maximum value in an implementation dependent type.
 If this object has no upper bound then an empty object is
 returned.
 */
 any getMaximumValue ();
 
-/** Returns the minimal value that can be represented by this object.
+/** Returns the minimum value that can be represented by this object.
 
 The type of the returned value is implementation dependent.  It
 does not have to be the same type as that returned by
-getCurrentAccessibleValue().
+getCurrentValue().
 
 @return
-Returns the minimal value in an implementation dependent type.
+Returns the mimimum value in an implementation dependent type.
 If this object has no lower bound then an empty object is
 returned.
 */
 any getMinimumValue ();
 
-/** Returns the minimal increment by which the value represented by this
+/** Returns the minimum increment by which the value represented by this
 object can be adjusted.
 
 The type of the returned value is implementation dependent. It
 does not have to be the same type as that returned by
-getCurrentAccessibleValue().
+getCurrentValue().
 
 @return
-Returns the minimal increment value in an implementation dependent 
type.
+Returns the minium increment value in an implementation dependent 
type.
 If this object has no minimum increment value, then an empty 
object is
 returned.
 


[Libreoffice-commits] core.git: accessibility/inc accessibility/source

2023-10-23 Thread Michael Weghorn (via logerrit)
 accessibility/inc/extended/accessiblelistboxentry.hxx|2 +
 accessibility/source/extended/accessiblelistboxentry.cxx |   28 +--
 2 files changed, 12 insertions(+), 18 deletions(-)

New commits:
commit f1dbbfe278c8673d98e2eb3d8ad460b9f7364642
Author: Michael Weghorn 
AuthorDate: Mon Oct 23 12:04:54 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Oct 23 20:35:52 2023 +0200

a11y: Don't throw exception on valid list box entry action index

`checkActionIndex_Impl` was previously throwing
an IndexOutOfBoundsException for any index other than 0.

The

// only three actions

comment in there was only adding to the confusion...

Convert that helper function to a method of the class
and take the actual count of actions into account.

Also drop the misleading `ACCESSIBLE_ACTION_COUNT`
define altogether, and just return 1 at the only
remaining place using it.

This fixes a crash seen with the qt6 VCL plugin
and Orca running when opening the spelling options
dialog ("Tools" -> "Spelling", then press the
"Options..." button).

1  __pthread_kill_implementation
 pthread_kill.c 44   0x7f29908a80fc
2  __pthread_kill_internal  
 pthread_kill.c 78   0x7f29908a815f
3  __GI_raise   
 raise.c26   0x7f299085a472
4  __GI_abort   
 abort.c79   0x7f29908444b2
5  ??   
 0x7f29904a09db
6  ??   
 0x7f29904affaa
7  std::terminate() 
 0x7f29904b0015
8  __cxa_throw  
 0x7f29904b0268
9  (anonymous namespace)::checkActionIndex_Impl 
 accessiblelistboxentry.cxx 49   0x7f29562aeb82
10 
accessibility::AccessibleListBoxEntry::getAccessibleActionDescription 
accessiblelistboxentry.cxx 770  0x7f29562b2b9b
11 QtAccessibleWidget::actionNames  
 QtAccessibleWidget.cxx 805  0x7f297c84a8d7
12 QAccessibleBridgeUtils::effectiveActionNames 
 qaccessiblebridgeutils.cpp 25   0x7f297b6c90a5
13 AtSpiAdaptor::actionInterface
 atspiadaptor.cpp   1862 0x7f297b6e2cc0
14 AtSpiAdaptor::handleMessage  
 atspiadaptor.cpp   1438 0x7f297b6de432
15 QDBusConnectionPrivate::activateObject   
 qdbusintegrator.cpp1438 0x7f2979ec0ecb
16 QDBusActivateObjectEvent::placeMetaCall  
 qdbusintegrator.cpp1594 0x7f2979ec1bb0
17 QObject::event   
 qobject.cpp1446 0x7f297c02116e
18 QApplicationPrivate::notify_helper   
 qapplication.cpp   3295 0x7f297a59d714
19 QApplication::notify 
 qapplication.cpp   3246 0x7f297a59d524
20 QCoreApplication::notifyInternal2
 qcoreapplication.cpp   1131 0x7f297bfa23ba
21 QCoreApplication::sendEvent  
 qcoreapplication.cpp   1572 0x7f297bfa2ead
22 QCoreApplicationPrivate::sendPostedEvents
 qcoreapplication.cpp   1937 0x7f297bfa3ea6
23 QCoreApplication::sendPostedEvents   
 qcoreapplication.cpp   1794 0x7f297bfa37ae
24 postEventSourceDispatch  
 qeventdispatcher_glib.cpp  244  0x7f297c3b9108
25 ??   
 0x7f29835111b4
26 ??   
 0x7f29835142d7
27 g_main_context_iteration 
 0x7f29835148f0
28 QEventDispatcherGlib::processEvents  
 qeventdispatcher_glib.cpp  394  0x7f297c3b999d
29 QXcbGlibEventDispatcher::processEvents   
 qxcbeventdispatcher.cpp96   0x7f2979c67036
30 QtInstance::ImplYield   

[Libreoffice-commits] core.git: winaccessibility/source

2023-10-21 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/MAccessible.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 701563366c717c21ffa0588de6be1005df92a779
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 13:43:56 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sat Oct 21 13:49:32 2023 +0200

tdf#135922 wina11y: Report text-related IA2 obj attrs

Extend `CMAccessible::get_attributes` so that
it also reports the text-related IAccessible2
object attributes, since what is meant to be
reported as a text attribute and what is meant
to be reported as an object attribute differs
between the IAccessible2 specificiation and what
LibreOffice does on the UNO level, s. the commit message
in this previous change for more details:

Change-Id Ief7c840d3c5274714a914ca0e56df0c5eaffb06d
tdf#135922 a11y: Prepare reporting text attrs as IA2 obj attrs

Just use a character offset of 0 when querying via the
`XAccessibleText` interface here. The exct offset used
used shouldn't make any difference for paragraph-specific
attributes.

With this and the NVDA pull request [1] to evaluate attributes
according to the IAccessible2 text attributes and
IAccessible2 object attributes specifications, NVDA
now reports the alignment of paragraphs in Writer, e.g.
says "align center" since the corresponding attribute is
now reported for the paragraph object, as can also
be seen by querying the IAccessible2 interface manually
in NVDA's Python console:

>>> focus.IAccessibleObject.attributes
'heading-level:;level:;text-align:center;'

("text-align:center;" was not yet reported without
this change in place.)

[1] https://github.com/nvaccess/nvda/pull/15649

Change-Id: I5723797232f89db6a2b74d4a601344f2078ee630
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158260
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 30e9b043b0fb..e4b17fa43826 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2735,6 +2736,17 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_attributes(/*[out]*/ BSTR *p
 sAttributes += val;
 }
 
+// some text-specific IAccessible2 object attributes (like text 
alignment
+// of a paragraph) are handled as text attributes in LibreOffice
+Reference xText(pRContext, UNO_QUERY);
+if (xText.is())
+{
+sal_Int32 nStartOffset = 0;
+sal_Int32 nEndOffset = 0;
+sAttributes += 
AccessibleTextAttributeHelper::GetIAccessible2TextAttributes(
+xText, IA2AttributeType::ObjectAttributes, 0, nStartOffset, 
nEndOffset);
+}
+
 if (*pAttr)
 SysFreeString(*pAttr);
 *pAttr = SysAllocString(o3tl::toW(sAttributes.getStr()));


[Libreoffice-commits] core.git: offapi/com

2023-10-21 Thread Michael Weghorn (via logerrit)
 offapi/com/sun/star/accessibility/XAccessibleExtendedAttributes.idl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cfaa52ed74278aab0e44f7cc9a66afe1c4166715
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 13:22:16 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sat Oct 21 13:48:59 2023 +0200

a11y: Improve XAccessibleExtendedAttributes doc

The existing

// MT: I guess it's not formula only?

comment was justified.

`XAccessibleExtendedAttributes::getExtendedAttributes`,
is not only used to report formulae, but e.g. used to
report a heading level by Writer paragraphs
(s. `SwAccessibleParagraph::getExtendedAttributes`),
so adjust the documentation and align it with
the `IAcccessible2::attributes` one [1] that also
uses the cell formula as an example.

[1] 
https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/interface_i_accessible2.html#a0d51b0c189a000ee3b6ddf7f68da2009

Change-Id: I2d6f38911c3802edb55f9426a35b8986dd6e399a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158259
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git 
a/offapi/com/sun/star/accessibility/XAccessibleExtendedAttributes.idl 
b/offapi/com/sun/star/accessibility/XAccessibleExtendedAttributes.idl
index ec5f2f7176a9..3ba748f9f574 100644
--- a/offapi/com/sun/star/accessibility/XAccessibleExtendedAttributes.idl
+++ b/offapi/com/sun/star/accessibility/XAccessibleExtendedAttributes.idl
@@ -21,7 +21,7 @@ module com { module sun { module star { module accessibility {
 
 interface XAccessibleExtendedAttributes : ::com::sun::star::uno::XInterface
 {
-/* Returns the attribute of this object' formula */ // MT: I guess it's 
not formula only?
+/** Returns the attributes specific to this object, like a cell's formula. 
*/
 any getExtendedAttributes() raises 
(::com::sun::star::lang::IndexOutOfBoundsException);
 };
 


[Libreoffice-commits] core.git: 2 commits - winaccessibility/source

2023-10-21 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/MAccessible.cxx |   43 
 1 file changed, 22 insertions(+), 21 deletions(-)

New commits:
commit a8e75a8ac93c18a7e955e448bfd120d0ed9ef0b0
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 12:56:39 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sat Oct 21 13:48:50 2023 +0200

wina11y: Just return empty attr string when none present

If the `XAccessibleExtendedAttributes` interface
isn't implemented, just return an empty string
for the attributes instead of an error code.

(This seems like a totally valid case to me,
no need to report an error.)

Change-Id: I986f030bc7a01da0fdd92a5aa2b4cf3c0d6a9200
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158258
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 98f15fdf230b..30e9b043b0fb 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2721,10 +2721,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_attributes(/*[out]*/ BSTR *p
 {
 return E_FAIL;
 }
+
+OUString sAttributes;
 Reference pRXI(pRContext,UNO_QUERY);
-if( !pRXI.is() )
-return E_FAIL;
-else
+if (pRXI.is())
 {
 
css::uno::Reference pRXAttr;
 pRXAttr = pRXI.get();
@@ -2732,13 +2732,14 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_attributes(/*[out]*/ BSTR *p
 
 OUString val;
 anyVal >>= val;
+sAttributes += val;
+}
 
-if(*pAttr)
-SysFreeString(*pAttr);
-*pAttr = SysAllocString(o3tl::toW(val.getStr()));
+if (*pAttr)
+SysFreeString(*pAttr);
+*pAttr = SysAllocString(o3tl::toW(sAttributes.getStr()));
 
-return S_OK;
-}
+return S_OK;
 } catch(...) { return E_FAIL; }
 }
 
commit eff3e9b8a576863c01f4244a5628cda64f48a363
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 12:52:03 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sat Oct 21 13:48:42 2023 +0200

wina11y: Indent try block

Change-Id: I89a4ed514e1c24e683b081d04f72cd62ede80065
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158257
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index e8f29c8192d2..98f15fdf230b 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2711,34 +2711,34 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_attributes(/*[out]*/ BSTR *p
 SolarMutexGuard g;
 
 try {
-if (m_isDestroy) return S_FALSE;
+if (m_isDestroy) return S_FALSE;
 
-if (!m_xAccessible.is())
-return E_FAIL;
+if (!m_xAccessible.is())
+return E_FAIL;
 
-Reference pRContext = 
m_xAccessible->getAccessibleContext();
-if( !pRContext.is() )
-{
-return E_FAIL;
-}
-Reference pRXI(pRContext,UNO_QUERY);
-if( !pRXI.is() )
-return E_FAIL;
-else
-{
-css::uno::Reference 
pRXAttr;
-pRXAttr = pRXI.get();
-css::uno::Any  anyVal = pRXAttr->getExtendedAttributes();
+Reference pRContext = 
m_xAccessible->getAccessibleContext();
+if( !pRContext.is() )
+{
+return E_FAIL;
+}
+Reference pRXI(pRContext,UNO_QUERY);
+if( !pRXI.is() )
+return E_FAIL;
+else
+{
+
css::uno::Reference pRXAttr;
+pRXAttr = pRXI.get();
+css::uno::Any  anyVal = pRXAttr->getExtendedAttributes();
 
-OUString val;
-anyVal >>= val;
+OUString val;
+anyVal >>= val;
 
-if(*pAttr)
-SysFreeString(*pAttr);
-*pAttr = SysAllocString(o3tl::toW(val.getStr()));
+if(*pAttr)
+SysFreeString(*pAttr);
+*pAttr = SysAllocString(o3tl::toW(val.getStr()));
 
-return S_OK;
-}
+return S_OK;
+}
 } catch(...) { return E_FAIL; }
 }
 


[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/qt5 vcl/source winaccessibility/source

2023-10-21 Thread Michael Weghorn (via logerrit)
 include/vcl/accessibility/AccessibleTextAttributeHelper.hxx |   32 ++
 vcl/qt5/QtAccessibleWidget.cxx  |6 
 vcl/source/accessibility/AccessibleTextAttributeHelper.cxx  |  158 +++-
 winaccessibility/source/UAccCOM/AccTextBase.cxx |4 
 4 files changed, 135 insertions(+), 65 deletions(-)

New commits:
commit b0bf4043d320f69d1cf9dfcbcd6a8eac4df94015
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 13:09:39 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sat Oct 21 13:48:31 2023 +0200

tdf#135922 a11y: Report IA2 "text-align" attr

Map the "ParaAlign" UNO text attribute to the
IAccessibl2 *object* attribute "text-align",
as specified in the IAccessible2 object
attributes specification. [1]

This causes the corresponding "justification" AT-SPI text
attribute to be reported when using the qt6 VCL
plugin on Linux.

For Windows, bridging this to the platform a11y
will be implemented in an upcoming change.

See the commmit message of the previous change

Change-Id Ief7c840d3c5274714a914ca0e56df0c5eaffb06d
tdf#135922 a11y: Prepare reporting text attrs as IA2 obj attrs

for more details.

[1] 
https://wiki.linuxfoundation.org/accessibility/iaccessible2/objectattributes

Change-Id: I6a0478a4ac37f69393e995602ed698b5a78488e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158256
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx 
b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
index ebce733fa491..5647dc972ba5 100644
--- a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
+++ b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -219,6 +220,25 @@ OUString lcl_ConvertColor(Color aColor)
+ OUString::number(aColor.GetGreen()) + u"\\," + 
OUString::number(aColor.GetBlue())
+ u")";
 }
+
+OUString lcl_ConvertParagraphAdjust(css::style::ParagraphAdjust eParaAdjust)
+{
+switch (eParaAdjust)
+{
+case css::style::ParagraphAdjust_LEFT:
+return u"left"_ustr;
+case css::style::ParagraphAdjust_RIGHT:
+return u"right"_ustr;
+case css::style::ParagraphAdjust_BLOCK:
+case css::style::ParagraphAdjust_STRETCH:
+return u"justify"_ustr;
+case css::style::ParagraphAdjust_CENTER:
+return u"center"_ustr;
+default:
+assert(false && "Unhandled ParagraphAdjust value");
+return u""_ustr;
+}
+}
 }
 
 OUString AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes(
@@ -297,6 +317,17 @@ OUString 
AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes(
 }
 }
 
+// so far, "ParaAdjust" is the only UNO text attribute that
+// maps to an object attribute for IAccessible2 ("text-align")
+if (sAttribute.isEmpty() && (eAttributeType & 
IA2AttributeType::ObjectAttributes)
+&& prop.Name == "ParaAdjust")
+{
+sAttribute = "text-align";
+const css::style::ParagraphAdjust eParaAdjust
+= 
static_cast(*o3tl::doAccess(prop.Value));
+sValue = lcl_ConvertParagraphAdjust(eParaAdjust);
+    }
+
 if (!sAttribute.isEmpty() && !sValue.isEmpty())
     aRet += sAttribute + ":" + sValue + ";";
 }
commit 9362766b94a4627db0d8adfac4285388970d1fba
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 12:41:15 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sat Oct 21 13:48:22 2023 +0200

tdf#135922 a11y: Prepare reporting text attrs as IA2 obj attrs

According to the IAccessible2 specification, some
of the attributes that LibreOffice handles as text
attributes are mapped to IAccessible2 text attributes
as well [1], but others should be reported as object
attributes [2], e.g. text alignment
is reported via the "text-align" object attribute on
the paragraph object.

So far, `AccessibleTextAttributeHelper` was only handling
attributes that are mapped to IAccessible2 text attributes.

Prepare for reporting object attributes as well, which
will be required to report text alignment on Windows
in a compliant way (s. tdf#135922).

On the other hand, Qt also expects
`QAccessibleTextInterface::attributes` to return
text formatting using the attributes specified in the
IAccessible2 attribute specifications and maps that to the
platform-specific attributes (AT-SPI text attributes
  

[Libreoffice-commits] core.git: external/lxml

2023-10-20 Thread Michael Weghorn (via logerrit)
 external/lxml/UnpackedTarball_lxml.mk   |2 -
 external/lxml/replace-setuptools-with-distutils.patch.0 |   11 --
 external/lxml/replace-setuptools-with-distutils.patch.1 |   29 
 3 files changed, 30 insertions(+), 12 deletions(-)

New commits:
commit c920605dd4c4520ab8ee80f9fb4746287835918c
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 10:37:35 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Oct 20 13:19:57 2023 +0200

external/lxml: Fix --enable-python=fully-internal build

After

commit a4b4a90557f9fc1839fc0eb297f4c6a4e94c761a
Date:   Sun Jul 2 14:54:23 2023 +0900

lxml: upgrade to release 4.9.2

, my `--enable-python=fully-internal` build started
to fail with

Building lxml version 4.9.2.
Building without Cython.
Building against libxml2 2.9.14 and libxslt 1.1.35
Traceback (most recent call last):
  File "setup.py", line 207, in 
setup(
  File 
".../libreoffice/instdir/program/python-core-3.8.18/lib/distutils/core.py", 
line 108, in setup
_setup_distribution = dist = klass(attrs)
  File 
".../libreoffice/instdir/program/python-core-3.8.18/lib/distutils/dist.py", 
line 274, in __init__
warnings.warn(msg)
UserWarning: Unknown distribution option: 'project_urls'
make[1]: *** [.../libreoffice/external/lxml/ExternalProject_lxml.mk:26: 
.../libreoffice/workdir/ExternalProject/lxml/build] Error 1
make[1]: *** Waiting for unfinished jobs
make: *** [Makefile:289: build] Error 2

and Julien reports the same in [1].

The above commit includes a patch to switch from
setuptools to distutils.
Possibly the distutils variant of the `setup` function
doesn't know about the "project_urls" keyword argument
(at least in our bundled Python version),
so extend the patch to drop that from the
`setup.py`.

[1] https://gerrit.libreoffice.org/c/core/+/153863

Change-Id: Icfac9fb0a3c62d3b30c12bc23ddbc0f9b088d788
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158230
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/external/lxml/UnpackedTarball_lxml.mk 
b/external/lxml/UnpackedTarball_lxml.mk
index 8d032e70dd90..1b19b6fd1680 100644
--- a/external/lxml/UnpackedTarball_lxml.mk
+++ b/external/lxml/UnpackedTarball_lxml.mk
@@ -13,7 +13,7 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,lxml,$(LXML_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_add_patches,lxml, \

external/lxml/0001-Make-regexp-string-raw-to-correct-its-escape-sequenc.patch.1 
\
-   external/lxml/replace-setuptools-with-distutils.patch.0 \
+   external/lxml/replace-setuptools-with-distutils.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/lxml/replace-setuptools-with-distutils.patch.0 
b/external/lxml/replace-setuptools-with-distutils.patch.0
deleted file mode 100644
index 92494befa0f7..
--- a/external/lxml/replace-setuptools-with-distutils.patch.0
+++ /dev/null
@@ -1,11 +0,0 @@
 setupinfo.py
-+++ setupinfo.py
-@@ -4,7 +4,7 @@
- import os.path
- import subprocess
- 
--from setuptools.command.build_ext import build_ext as _build_ext
-+from distutils.command.build_ext import build_ext as _build_ext
- from distutils.core import Extension
- from distutils.errors import CompileError, DistutilsOptionError
- from versioninfo import get_base_dir
diff --git a/external/lxml/replace-setuptools-with-distutils.patch.1 
b/external/lxml/replace-setuptools-with-distutils.patch.1
new file mode 100644
index ..5275e40312c8
--- /dev/null
+++ b/external/lxml/replace-setuptools-with-distutils.patch.1
@@ -0,0 +1,29 @@
+diff -ur lxml.org/setupinfo.py lxml/setupinfo.py
+--- lxml.org/setupinfo.py  2023-10-20 10:32:17.921500435 +0200
 lxml/setupinfo.py  2023-10-20 10:33:40.303323572 +0200
+@@ -4,7 +4,7 @@
+ import os.path
+ import subprocess
+ 
+-from setuptools.command.build_ext import build_ext as _build_ext
++from distutils.command.build_ext import build_ext as _build_ext
+ from distutils.core import Extension
+ from distutils.errors import CompileError, DistutilsOptionError
+ from versioninfo import get_base_dir
+diff -ur lxml.org/setup.py lxml/setup.py
+--- lxml.org/setup.py  2023-10-20 10:32:17.949501053 +0200
 lxml/setup.py  2023-10-20 10:33:09.082631759 +0200
+@@ -217,9 +217,10 @@
+ # `Unknown distribution option: 'bugtrack_url'`
+ # which distract folks from real causes of problems when troubleshooting
+ # bugtrack_url="https://bugs.launchpad.net/lxml;,
+-project_urls={
+-"Source": "https://github.com/lxml/lxml;,
+-},
++# same as for bugtrack_urls also for project_urls when using distutils 
instead of setuptools
++#project_urls={
++#"Sou

[Libreoffice-commits] core.git: winaccessibility/source

2023-10-19 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/MAccessible.cxx |  196 
 winaccessibility/source/UAccCOM/MAccessible.h   |5 
 2 files changed, 201 deletions(-)

New commits:
commit fc06de1b23df9c80445c99def36beab6efa755cb
Author: Michael Weghorn 
AuthorDate: Thu Oct 19 16:42:58 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Oct 20 05:47:47 2023 +0200

wina11y: Drop now unused CMAccessible::get_String4Numbering etc.

`CMAccessible::get_String4Numbering` is unused since

commit 2bf88c172c9c9d159344b95fb96073f4891a6c30
Author: Michael Weghorn 
Date:   Wed Oct 18 13:44:42 2023 +0200

tdf#157696 wina11y: Switch from custom to IA2 text attributes

, so drop it.
This means that `CMAccessible::get_StringFromAny` is then
also unused, so drop it as well.

Change-Id: I35abc94b2fc2ecec1789918fbf4ed6707a96c974
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158195
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index eff02d6ade31..e8f29c8192d2 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2439,202 +2439,6 @@ IAccessible* 
CMAccessible::get_IAccessibleFromXAccessible(XAccessible* pXAcc)
 return nullptr;
 }
 
-OUString CMAccessible::get_StringFromAny(Any const & pAny)
-{
-switch(pAny.getValueTypeClass())
-{
-case TypeClass_CHAR:
-{
-sal_Int8 val;
-pAny >>= val;
-return OUString::number(val);
-}
-case TypeClass_BOOLEAN:
-{
-bool val;
-pAny >>= val;
-return OUString::number(int(val));
-}
-case TypeClass_BYTE:
-{
-sal_Int8 val;
-pAny >>= val;
-return OUString::number(val);
-}
-case TypeClass_SHORT:
-{
-sal_Int16 val;
-pAny >>= val;
-return OUString::number(val);
-}
-case TypeClass_UNSIGNED_SHORT:
-{
-sal_uInt16 val;
-pAny >>= val;
-return OUString::number(val);
-}
-case TypeClass_LONG:
-{
-sal_Int32 val;
-pAny >>= val;
-return OUString::number(val);
-}
-case TypeClass_UNSIGNED_LONG:
-{
-sal_uInt32 val;
-pAny >>= val;
-return OUString::number(val);
-}
-case TypeClass_FLOAT:
-{
-float val;
-pAny >>= val;
-return OUString::number(val);
-}
-case TypeClass_DOUBLE:
-{
-double val;
-pAny >>= val;
-return OUString::number(val);
-}
-case TypeClass_STRING:
-{
-OUString val;
-pAny >>= val;
-return val;
-}
-case TypeClass_SEQUENCE:
-{
-if(pAny.getValueType() == cppu::UnoType>::get())
-{
-Sequence < OUString > val;
-pAny >>= val;
-
-OUStringBuffer pString;
-
-for (const OUString& rElem : val)
-pString.append(rElem);
-
-return pString.makeStringAndClear();
-}
-else if (pAny.getValueType() == cppu::UnoType>::get())
-{
-Sequence < css::style::TabStop > val;
-pAny >>= val;
-
-OUStringBuffer buf;
-for (const css::style::TabStop& rSingleVal : val)
-{
-buf.append(
-"Position=" + OUString::number(rSingleVal.Position) + 
",TabAlign="
-+ OUString::number(sal_Int32(rSingleVal.Alignment)) + 
",DecimalChar=");
-if (rSingleVal.DecimalChar==';' || rSingleVal.DecimalChar 
== ':' || rSingleVal.DecimalChar == ',' ||
-rSingleVal.DecimalChar == '=' || 
rSingleVal.DecimalChar == '\\')
-buf.append('\\');
-buf.append(OUStringChar(rSingleVal.DecimalChar) + 
",FillChar=");
-if (rSingleVal.FillChar==';' || rSingleVal.FillChar == ':' 
|| rSingleVal.FillChar == ',' ||
-rSingleVal.FillChar == '=' || rSingleVal.FillChar == 
'\\')
-buf.append('\\');
-buf.append(OUStringChar(rSingleVal.FillChar) + ",");
-}
-return buf.makeStringAndClear();
-}
-break;
-}
-case TypeClass_ENUM:
-{
-if (pAny.getValueType() == 
cppu::UnoType::get())
-{
-css::awt::FontSla

[Libreoffice-commits] core.git: winaccessibility/source

2023-10-19 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/AccTextBase.cxx |   90 
 1 file changed, 3 insertions(+), 87 deletions(-)

New commits:
commit 2bf88c172c9c9d159344b95fb96073f4891a6c30
Author: Michael Weghorn 
AuthorDate: Wed Oct 18 13:44:42 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Oct 19 10:11:23 2023 +0200

tdf#157696 wina11y: Switch from custom to IA2 text attributes

So far, reporting text attributes on the a11y layer on
Windows did not follow any standard/specification, but
LibreOffice's custom attribute values were mostly reported
as is (i.e. using the LibreOffice-internal attribute names
and values), and assistive tooling had to interpret those in order
to support reporting them to the user in a useful way.

For example, NVDA has custom code in the LibreOffice-specific
app module to do so. [1]

Stop using our custom attributes and switch to the
use of attributes according to the IAccessible2 text
attributes specification [2] instead, which is the applicable
specification for `IAccessibleText::get_attributes` that
is implemented here.

This implies that by reporting more IAccessible2 text attributes,
those should "automatically" work if assistive tooling handles
those, as is e.g. the case for NVDA and the the "invalid:spelling;"
attribute for spelling errors, for which bridging to IA2 has
been iplemented in

Change-Id I54e5bcbb4bef4c73068243f91a3ee69c10326460
tdf#157696 a11y: Report spelling error via IA2 "invalid:spelling" attr

(See also the other tdf#135922 commits preparing for this
change.)

A change in NVDA is still needed in addition to switch from only
handling the custom values for LO to use the existing code
path for handling IA2 text attrs instead.
Pending pull request that implents this: [3]

[1] 
https://github.com/nvaccess/nvda/blob/9878248c217156de4defe244d2df797d6b3bd0ca/source/appModules/soffice.py#L35-L137
[2] 
https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes
[3] https://github.com/nvaccess/nvda/pull/15649

Change-Id: I11492bb5d09d64fd153db1b73d97a331a98ee535
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158090
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx 
b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index 37eb1d6fcf70..858504395a6f 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -26,6 +26,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -140,97 +141,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_attributes(long offset, long
 if (offset < 0 || offset > pRXText->getCharacterCount() )
 return E_FAIL;
 
-OUStringBuffer strAttrs("Version:1;");
 
-Sequence  pValues = 
pRXText->getCharacterAttributes(offset, Sequence());
-int nCount = pValues.getLength();
-
-sal_Int16 numberingLevel = 0;
-OUString numberingPrefix;
-Any anyNumRule;
-bool bHaveNumberingPrefixAttr = false;
-bool bHaveNumberingLevel = false;
-bool bHaveNumberingRules = false;
-for(int i =0; i>= numberingLevel;
-else
-numberingLevel = -1;
-bHaveNumberingLevel = true;
-continue;
-}
-if(pValue.Name == "NumberingPrefix")
-{
-pValue.Value >>=numberingPrefix;
-bHaveNumberingPrefixAttr = true;
-continue;
-}
-if(pValue.Name == "NumberingRules")
-{
-bHaveNumberingRules = true;
-anyNumRule = pValue.Value;
-continue;
-}
-if (bHaveNumberingLevel && bHaveNumberingRules && 
bHaveNumberingPrefixAttr)
-{
-strAttrs.append(';');
-numberingPrefix = numberingPrefix.replaceAll(u"\\", u"")
-  .replaceAll(u";", u"\\;")
-  .replaceAll(u"=", u"\\=")
-  .replaceAll(u",", u"\\,")
-  .replaceAll(u":", u"\\:");
-
-
strAttrs.append(CMAccessible::get_String4Numbering(anyNumRule,numberingLevel,numberingPrefix));
-bHaveNumberingLevel = false;
-bHaveNumberingRules = false;
-}
-if( (bHaveNumberingPrefixAttr && i > 1 ) ||
-(!bHaveNumberingPrefixAttr && i > 0 ) ) //element 0 is 
NumberingPrefix, not write alone
-{
-strAttrs.append(';');
-}
-strAttrs.append(pValue.Name + ":");
-
-if (pValue.Name == "CharBackColor" ||
-  

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sw/source

2023-10-18 Thread Michael Weghorn (via logerrit)
 sw/source/uibase/uiview/view2.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 16940dc248068133363153a1c2d41cd2d0102460
Author: Michael Weghorn 
AuthorDate: Wed Oct 18 10:59:33 2023 +0200
Commit: Caolán McNamara 
CommitDate: Wed Oct 18 22:26:15 2023 +0200

tdf#156033 sw: Don't capture mouse when executing file dlg

When the mouse is captured in
`SwView::InsertGraphicDlg`, temporarily
release it while executing the file dialog,
so the user can use the mouse to interact with
the file dialog.

At least with qt5/qt6/kf5, this would otherwise
not work in the file dialog shown after clicking
on a previously inserted Picture Content Control,
because `QWidget::grabMouse()`'s "other widgets
get no mouse events at all" [1] apparently applies
for the file dialog and other running applications
as well.

[1] https://doc.qt.io/qt-6/qwidget.html#grabMouse

Change-Id: I80a81c57c80debc716a1b111a9c07eef0c005c65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158109
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 680ae3e989c3b665b29f536c2e30dd86bbc3edac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158045
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index f7cfb6563803..585f38b7cae1 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -441,11 +441,22 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
 
 const SfxStringItem* pName = 
rReq.GetArg(SID_INSERT_GRAPHIC);
 bool bShowError = !pName;
-if( pName
+
+bool bHaveName = pName != nullptr;
 #if HAVE_FEATURE_DESKTOP
-|| (!Application::IsHeadlessModeEnabled() && ERRCODE_NONE == 
pFileDlg->Execute())
+if (!bHaveName && !Application::IsHeadlessModeEnabled())
+{
+// execute file dialog, without capturing mouse (tdf#156033)
+vcl::Window* pWin = GetWindow();
+const bool bMouseCaptured = pWin && pWin->IsMouseCaptured();
+if (bMouseCaptured)
+pWin->ReleaseMouse();
+bHaveName =  ERRCODE_NONE == pFileDlg->Execute();
+if (bMouseCaptured)
+pWin->CaptureMouse();
+}
 #endif
-)
+if (bHaveName)
 {
 
 OUString aFileName, aFilterName;


[Libreoffice-commits] core.git: sw/source

2023-10-18 Thread Michael Weghorn (via logerrit)
 sw/source/uibase/uiview/view2.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 680ae3e989c3b665b29f536c2e30dd86bbc3edac
Author: Michael Weghorn 
AuthorDate: Wed Oct 18 10:59:33 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Oct 18 13:47:35 2023 +0200

tdf#156033 sw: Don't capture mouse when executing file dlg

When the mouse is captured in
`SwView::InsertGraphicDlg`, temporarily
release it while executing the file dialog,
so the user can use the mouse to interact with
the file dialog.

At least with qt5/qt6/kf5, this would otherwise
not work in the file dialog shown after clicking
on a previously inserted Picture Content Control,
because `QWidget::grabMouse()`'s "other widgets
get no mouse events at all" [1] apparently applies
for the file dialog and other running applications
as well.

[1] https://doc.qt.io/qt-6/qwidget.html#grabMouse

Change-Id: I80a81c57c80debc716a1b111a9c07eef0c005c65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158109
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 143472a83042..8d6239497eb6 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -441,11 +441,22 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
 
 const SfxStringItem* pName = 
rReq.GetArg(SID_INSERT_GRAPHIC);
 bool bShowError = !pName;
-if( pName
+
+bool bHaveName = pName != nullptr;
 #if HAVE_FEATURE_DESKTOP
-|| (!Application::IsHeadlessModeEnabled() && ERRCODE_NONE == 
pFileDlg->Execute())
+if (!bHaveName && !Application::IsHeadlessModeEnabled())
+{
+// execute file dialog, without capturing mouse (tdf#156033)
+vcl::Window* pWin = GetWindow();
+const bool bMouseCaptured = pWin && pWin->IsMouseCaptured();
+if (bMouseCaptured)
+pWin->ReleaseMouse();
+bHaveName =  ERRCODE_NONE == pFileDlg->Execute();
+if (bMouseCaptured)
+pWin->CaptureMouse();
+}
 #endif
-)
+if (bHaveName)
 {
 
 OUString aFileName, aFilterName;


[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/qt5 vcl/source

2023-10-18 Thread Michael Weghorn (via logerrit)
 include/vcl/accessibility/AccessibleTextAttributeHelper.hxx |   14 ++
 vcl/qt5/QtAccessibleWidget.cxx  |   11 --
 vcl/source/accessibility/AccessibleTextAttributeHelper.cxx  |   61 
 3 files changed, 77 insertions(+), 9 deletions(-)

New commits:
commit ec2e02cfa41510c3d30b118cbf7595c84a046d03
Author: Michael Weghorn 
AuthorDate: Tue Oct 17 14:36:58 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Oct 18 12:48:57 2023 +0200

tdf#157696 a11y: Report spelling error via IA2 "invalid:spelling" attr

Let `AccessibleTextAttributeHelper::GetIAccessible2TextAttributes`
also report spelling errors as a text attribute, since the
"invalid:" text attribute with a value of "spelling" is specified
for that in the IAccessible2 tex attributes specification [1].

In order to adapt the start/end index for the attribute run,
iterate over all of the text markups that can be retrieved from
the `XAccessibleTextMarkup` interface instead of just deterining
whether the offset itself lies within a range of misspelled text
via `XAccessibleTextMarkup::getTextMarkupAtIndex`.
(This is strongly inspired by how the gtk3 a11y implementation
does it, s. `handle_text_markup_as_run_attribute` in
vcl/unx/gtk3/a11y/atktext.cxx.)

When using the qt6 VCL plugin on Linux, the attribute shows up as
expected in Accerciser and the Orca screen reader announces
"misspelled" when moving the cursor in front of a misspelled
word using the Arrow_Right key.

Announcement by NVDA works once winaccessibility and NVDA
have been switched over to use IAccessible2 text attributes
instead of custom LibreOffice ones.

[1] 
https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes

Change-Id: I54e5bcbb4bef4c73068243f91a3ee69c10326460
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158089
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx 
b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
index 5862b96a86c6..f69b7483d9e5 100644
--- a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
+++ b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
@@ -20,10 +20,12 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -303,13 +305,53 @@ OUString 
AccessibleTextAttributeHelper::GetIAccessible2TextAttributes(
 
 const css::uno::Sequence attribs
 = xText->getCharacterAttributes(nOffset, 
css::uno::Sequence());
-const OUString sAttributes = 
ConvertUnoToIAccessible2TextAttributes(attribs);
+OUString sAttributes = ConvertUnoToIAccessible2TextAttributes(attribs);
 
 css::accessibility::TextSegment aAttributeRun
 = xText->getTextAtIndex(nOffset, 
css::accessibility::AccessibleTextType::ATTRIBUTE_RUN);
 rStartOffset = aAttributeRun.SegmentStart;
 rEndOffset = aAttributeRun.SegmentEnd;
 
+// report spelling error as "invalid:spelling;" IA2 text attribute and
+// adapt start/end index as necessary
+css::uno::Reference 
xTextMarkup(xText,
+   
css::uno::UNO_QUERY);
+if (xTextMarkup.is())
+{
+bool bInvalidSpelling = false;
+const sal_Int32 nMarkupCount(
+
xTextMarkup->getTextMarkupCount(css::text::TextMarkupType::SPELLCHECK));
+for (sal_Int32 nMarkupIndex = 0; nMarkupIndex < nMarkupCount; 
++nMarkupIndex)
+{
+const css::accessibility::TextSegment aTextSegment
+= xTextMarkup->getTextMarkup(nMarkupIndex, 
css::text::TextMarkupType::SPELLCHECK);
+const sal_Int32 nStartOffsetTextMarkup = aTextSegment.SegmentStart;
+const sal_Int32 nEndOffsetTextMarkup = aTextSegment.SegmentEnd;
+if (nStartOffsetTextMarkup <= nOffset)
+{
+if (nOffset < nEndOffsetTextMarkup)
+{
+// offset is inside invalid spelling
+rStartOffset = ::std::max(rStartOffset, 
nStartOffsetTextMarkup);
+rEndOffset = ::std::min(rEndOffset, nEndOffsetTextMarkup);
+bInvalidSpelling = true;
+break;
+}
+else
+{
+rStartOffset = ::std::max(rStartOffset, 
nEndOffsetTextMarkup);
+}
+}
+else
+{
+rEndOffset = ::std::min(rEndOffset, nStartOffsetTextMarkup);
+}
+}
+
+if (bInvalidSpelling)
+sAttributes += u"invalid:spelling;"_ustr;
+}
+
 return sAttributes;
 }
 
commit 15a6e23c4fc160c50a316da3d18980a02fc10ce8
Author:     Michael Weghorn 
AuthorDate

[Libreoffice-commits] core.git: config_host/config_vclplug.h.in configure.ac vcl/inc vcl/qt5

2023-10-18 Thread Michael Weghorn (via logerrit)
 config_host/config_vclplug.h.in |1 
 configure.ac|7 ---
 vcl/inc/qt5/QtFrame.hxx |2 -
 vcl/inc/qt5/QtX11Support.hxx|8 
 vcl/qt5/QtFrame.cxx |   23 ---
 vcl/qt5/QtX11Support.cxx|   79 
 6 files changed, 120 deletions(-)

New commits:
commit 35ea75e9c2be75a70298a3f4e7d703c1d0f9497e
Author: Michael Weghorn 
AuthorDate: Wed Oct 18 08:23:35 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Oct 18 11:00:12 2023 +0200

qt: Drop now obsolete workaround for Qt < 5.12

This workaround was only applied for Qt < 5.12 and
is no longer needed now that support for Qt < 5.15 has
been dropped in

commit afb4c96d271958ced3175dfc2cf8bb9e8b0a9d3b
    Author: Michael Weghorn 
Date:   Thu Aug 3 21:30:22 2023 +0200

qt: Drop code for Qt < 5.15

Commit originally adding the workaround:

commit fe2baf9e84e0ca9aeaa683e37076f57fa3f38dca
Author: Jan-Marek Glogowski 
Date:   Tue Dec 3 08:32:58 2019 +0100

Qt5 fix missing XCB_ICCCM_WM_HINT_WINDOW_GROUP

This is the application level equivalent of the Qt5 fix for bug
QTBUG-46626 / commit 0de4b32 ("xcb: fix issue with dialogs hidden
by other windows"), which was broken since Qt 5.4 and is just
fixed since Qt 5.12.

It is needed for some window managers, which don't know about the
WM_CLIENT_LEADER property. Both settings are the same, but just
the latter is set by older Qt5 releases. This probably isn't a
real problem, as GNOME or XFCE would use the gtk VCL plugin, but
since I already wrote the code when debugging tdf#129071, there
is also no reason to drop it (except: more code, more bugs...).

This fix is optional and needs development headers for xcb-icccm,
which can actually be compiled into Qt5. If missing configure will
just print a warning, since it's a runtime requirement and we
explicitly drop the linked Qt version symbol, so the potential
build Qt version won't matter.

Change-Id: Ifc5a8f8a40ee13779a911efb53e8b8b868614d0b
Reviewed-on: https://gerrit.libreoffice.org/84299
Tested-by: Jenkins
        Reviewed-by: Michael Weghorn 
Reviewed-by: Jan-Marek Glogowski 

Change-Id: I56b708449cf686f787f55256c76673be604d31e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158102
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/config_host/config_vclplug.h.in b/config_host/config_vclplug.h.in
index 63dacb1bc10e..2334288cd49d 100644
--- a/config_host/config_vclplug.h.in
+++ b/config_host/config_vclplug.h.in
@@ -31,7 +31,6 @@ Settings about which desktops have support enabled.
 #define ENABLE_GSTREAMER_1_0 0
 #define QT5_HAVE_GOBJECT 0
 #define QT5_USING_X11 0
-#define QT5_HAVE_XCB_ICCCM 0
 #define QT6_USING_X11 0
 
 #endif
diff --git a/configure.ac b/configure.ac
index 39857bb25f6f..999ab64289e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13119,13 +13119,6 @@ then
 
 if test "$USING_X11" = TRUE; then
 PKG_CHECK_MODULES(QT5_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which 
is needed for correct app grouping in X11.])])
-PKG_CHECK_MODULES(QT5_XCB_ICCCM,[xcb-icccm],[
-QT5_HAVE_XCB_ICCCM=1
-AC_DEFINE(QT5_HAVE_XCB_ICCCM)
-],[
-AC_MSG_WARN([XCB ICCCM not found, which is needed for old Qt 
versions (< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)])
-add_warning "XCB ICCCM not found, which is needed for Qt versions 
(< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)"
-])
 QT5_CFLAGS="$QT5_CFLAGS $QT5_XCB_CFLAGS $QT5_XCB_ICCCM_CFLAGS"
 QT5_LIBS="$QT5_LIBS $QT5_XCB_LIBS $QT5_XCB_ICCCM_LIBS -lQt5X11Extras"
 QT5_USING_X11=1
diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index b5ae7508a506..b80818687c0e 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -132,8 +132,6 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public 
SalFrame
 bool isMaximized() const;
 void SetWindowStateImpl(Qt::WindowStates eState);
 
-void fixICCCMwindowGroup();
-
 private Q_SLOTS:
 void screenChanged(QScreen*);
 
diff --git a/vcl/inc/qt5/QtX11Support.hxx b/vcl/inc/qt5/QtX11Support.hxx
index 2931e82e4d1a..17696a89529d 100644
--- a/vcl/inc/qt5/QtX11Support.hxx
+++ b/vcl/inc/qt5/QtX11Support.hxx
@@ -15,15 +15,7 @@
 
 class QtX11Support final
 {
-static constexpr const char* m_sWindowGroupName = "WM_CLIENT_LEADER\0";
-static xcb_atom_t m_nWindowGroupAtom;
-static bool m_bDidAtomLookups;
-
-static xcb_atom_t lookupAtom

[Libreoffice-commits] core.git: configure.ac vcl/qt5

2023-10-18 Thread Michael Weghorn (via logerrit)
 configure.ac   |2 +-
 vcl/qt5/QtAccessibleWidget.cxx |4 
 vcl/qt5/QtFrame.cxx|   28 +---
 vcl/qt5/QtGraphics_GDI.cxx |7 ---
 vcl/qt5/QtSvpGraphics.cxx  |7 ---
 vcl/qt5/QtWidget.cxx   |4 
 6 files changed, 2 insertions(+), 50 deletions(-)

New commits:
commit afb4c96d271958ced3175dfc2cf8bb9e8b0a9d3b
Author: Michael Weghorn 
AuthorDate: Thu Aug 3 21:30:22 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Oct 18 08:04:32 2023 +0200

qt: Drop code for Qt < 5.15

Our new AlmaLinux 8 baseline provides Qt 5.15.3,
so require 5.15 and drop the code for older, now
unsupported Qt versions.

Change-Id: I512ade1ba503fc7a86527a45142f37f043db6784
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155325
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/configure.ac b/configure.ac
index 189ef4a55222..39857bb25f6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13039,7 +13039,7 @@ then
 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root 
of your Qt5 installation by exporting QT5DIR before running "configure".])
 fi
 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
-qt5_minimal_minor="6"
+qt5_minimal_minor="15"
 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
 AC_MSG_ERROR([The minimal supported Qt5 version is 
5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version 
$qmake5_test_ver.])
 else
diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index d6112bdf8223..cd50af4aed9f 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -452,11 +452,7 @@ QAccessible::Role QtAccessibleWidget::role() const
 case AccessibleRole::MENU_ITEM:
 return QAccessible::MenuItem;
 case AccessibleRole::NOTIFICATION:
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 5)
 return QAccessible::Notification;
-#else
-return QAccessible::StaticText;
-#endif
 case AccessibleRole::OPTION_PANE:
 return QAccessible::Pane;
 case AccessibleRole::PAGE_TAB:
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index f3cc0facfe8a..7a9b5f3861f8 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -50,9 +50,6 @@
 #include 
 #include 
 #include 
-#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
-#include 
-#endif
 #include 
 #include 
 #if CHECK_QT5_USING_X11
@@ -341,18 +338,7 @@ QWindow* QtFrame::windowHandle() const
 return pChild->windowHandle();
 }
 
-QScreen* QtFrame::screen() const
-{
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
-return asChild()->screen();
-#else
-// QWidget::screen only available from Qt 5.14 on, call windowHandle(),
-// with the indirect result that mouse move events on Wayland will not be
-// emitted reliably, s. QTBUG-75766
-QWindow* const pWindow = windowHandle();
-return pWindow ? pWindow->screen() : nullptr;
-#endif
-}
+QScreen* QtFrame::screen() const { return asChild()->screen(); }
 
 bool QtFrame::GetUseDarkMode() const
 {
@@ -515,13 +501,7 @@ Size QtFrame::CalcDefaultSize()
 }
 else
 {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
 QScreen* pScreen = QGuiApplication::screenAt(QPoint(0, 0));
-#else
-// QGuiApplication::screenAt was added in Qt 5.10, use deprecated 
QDesktopWidget
-int nLeftScreen = QApplication::desktop()->screenNumber(QPoint(0, 
0));
-QScreen* pScreen = QGuiApplication::screens()[nLeftScreen];
-#endif
 aSize = toSize(pScreen->availableVirtualGeometry().size());
 }
 }
@@ -1321,13 +1301,7 @@ void QtFrame::SetScreenNumber(unsigned int nScreen)
 {
 assert(m_bFullScreen);
 // left-most screen
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
 QScreen* pScreen = QGuiApplication::screenAt(QPoint(0, 0));
-#else
-// QGuiApplication::screenAt was added in Qt 5.10, use deprecated 
QDesktopWidget
-int nLeftScreen = QApplication::desktop()->screenNumber(QPoint(0, 
0));
-QScreen* pScreen = QGuiApplication::screens()[nLeftScreen];
-#endif
 // entire virtual desktop
 screenGeo = pScreen->availableVirtualGeometry();
 pWindow->setScreen(pScreen);
diff --git a/vcl/qt5/QtGraphics_GDI.cxx b/vcl/qt5/QtGraphics_GDI.cxx
index a8ec20f60080..2005de80f7ba 100644
--- a/vcl/qt5/QtGraphics_GDI.cxx
+++ b/vcl/qt5/QtGraphics_GDI.cxx
@@ -702,14 +702,7 @@ void QtGraphics::GetResolution(sal_Int32& rDPIX, 
sal_Int32& rDPIY)
 if (!m_pFrame)
 return;
 
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
 QScreen* pScreen = m_pFrame->GetQWidget()->screen();
-#else
- 

[Libreoffice-commits] core.git: configure.ac README.md

2023-10-17 Thread Michael Weghorn (via logerrit)
 README.md|4 +---
 configure.ac |   10 +-
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit d6d4cae126cf8e8fc73b54b852d75c8b0a0db65e
Author: Michael Weghorn 
AuthorDate: Fri Aug 18 09:58:09 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 17 13:45:59 2023 +0200

Bump Java build baseline from JDK 9 to 17

As discussed in the ESC call on 2023-08-10 [1],
bump the Java build baseline to 17.
This should not affect the Java runtime requirement,
since the target version is explicitly specified
already.

[1] 
https://lists.freedesktop.org/archives/libreoffice/2023-August/090759.html

Change-Id: I18251151392ca5edec8ca3d5cffd192d5f9f38b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155827
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/README.md b/README.md
index 6afb8000b0e1..f529e48d4714 100644
--- a/README.md
+++ b/README.md
@@ -57,9 +57,7 @@ Java is required for building many parts of LibreOffice. In 
TDF Wiki article
 [Development/Java](https://wiki.documentfoundation.org/Development/Java), the
 exact modules that depend on Java are listed.
 
-The baseline for Java is Java Development Kit (JDK) Version 17 or later. It is
-possible to build LibreOffice with JDK version 9, but it is no longer supported
-by the JDK vendors, thus it should be avoided.
+The baseline for Java is Java Development Kit (JDK) Version 17 or later.
 
 If you want to use Clang with the LibreOffice compiler plugins, the minimal
 version of Clang is 12.0.1. Since Xcode doesn't provide the compiler plugin
diff --git a/configure.ac b/configure.ac
index 32c2eecfbc7a..189ef4a55222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2548,7 +2548,7 @@ AC_ARG_WITH(linker-hash-style,
 
 AC_ARG_WITH(jdk-home,
 AS_HELP_STRING([--with-jdk-home=],
-[If you have installed JDK 9 or later on your system please supply the
+[If you have installed JDK 17 or later on your system please supply the
  path here. Note that this is not the location of the java command but 
the
  location of the entire distribution. In case of cross-compiling, this
  is the JDK of the host os. Use --with-build-platform-configure-options
@@ -8580,7 +8580,7 @@ if test "$ENABLE_JAVA" != ""; then
 fi
 
 if ! test -f "$with_jdk_home/lib/jvm.lib" -a -f 
"$with_jdk_home/bin/java.exe"; then
-AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option (or 
fix the path) pointing to a $WIN_HOST_BITS-bit JDK >= 9])
+AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option (or 
fix the path) pointing to a $WIN_HOST_BITS-bit JDK >= 17])
 fi
 fi
 
@@ -8665,8 +8665,8 @@ if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != 
"yes"; then
 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' 
| $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 
+ $3;}'`
 
-if test "$_jdk_ver" -lt 9; then
-AC_MSG_ERROR([JDK is too old, you need at least 9 ($_jdk_ver < 
9)])
+if test "$_jdk_ver" -lt 17; then
+AC_MSG_ERROR([JDK is too old, you need at least 17 ($_jdk_ver 
< 17)])
 fi
 dnl TODO: Presumably, the Security Manager will not merely be 
disallowed, but be
 dnl completely removed in some Java version > 18 (see
@@ -8687,7 +8687,7 @@ if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != 
"yes"; then
 JAVACFLAGS=-J-Xmx128M
 fi
 else
-AC_MSG_ERROR([Java not found. You need at least JDK 9])
+AC_MSG_ERROR([Java not found. You need at least JDK 17])
 fi
 else
 if test -z "$ENABLE_JAVA"; then


[Libreoffice-commits] core.git: vcl/CppunitTest_vcl_gtk3_a11y.mk

2023-10-16 Thread Michael Weghorn (via logerrit)
 vcl/CppunitTest_vcl_gtk3_a11y.mk |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ca01deadcbc480b6e79618b227a2b73a61ecb7ff
Author: Michael Weghorn 
AuthorDate: Mon Oct 16 11:03:46 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 17 07:50:37 2023 +0200

gtk3 a11y test: Let xvfb-run auto-determine free server num

As the xvfb-run manpage says, it uses a default server number of 99:

>  -n servernumber, --server-num=servernumber
> Use servernumber as the server number (but see the -a, 
--auto-servernum option above).  The default is 99.

The gtk3 a11y tests use xvfb-run. Running the test multiple
times in parallel (e.g. when doing two separate builds with
tests, as happens on CI) would fall like this on Debian testing:

$ make CppunitTest_vcl_gtk3_a11y
make -j 12 -rs -f 
/home/michi/development/git/libreoffice/Makefile.gbuild 
CppunitTest_vcl_gtk3_a11y
[CUT] vcl_gtk3_a11y
xvfb-run: error: Xvfb failed to start
Hint: You are currently not seeing messages from other users and the 
system.
  Users in groups 'adm', 'systemd-journal' can see all messages.
  Pass -q to turn off this notice.
No coredumps found.

Error: a unit test failed, please do one of:

make CppunitTest_vcl_gtk3_a11y CPPUNITTRACE="gdb --args"
# for interactive debugging on Linux
make CppunitTest_vcl_gtk3_a11y VALGRIND=memcheck
# for memory checking
make CppunitTest_vcl_gtk3_a11y DEBUGCPPUNIT=TRUE
# for exception catching

You can limit the execution to just one particular test by:

make CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params...

However, it behaves differently on Alma Linux 8, where it
looks like xvfb-run seems then to reuse the existing
Xfvb session, causing the tests to potentially find
the LibreOffice instance from another test run, and
then inspecting the wrong one, leading to failures
like the one in [1]:

equality assertion failed
- Expected: ecclectic.fodt — LibreOfficeDev Writer
- Actual  : ecclectic.fodt — LibreOfficeDev Writer 24.2 
[9bc2aede99017ed0338e97b21b4735919b705b47]

The fact that the second instance of xvfb-run
reuses the session of the firs one and finds the
LibreOffice there can also be reproduced on Alma Linux 8
by just running these 2 commands in parallel:

1) start LO in xfvb-run session:

$ xvfb-run dbus-launch libreoffice

2) run below Python script that lists the
   running applications:

$ xvfb-run dbus-launch python3 /home/vagrant/atspi-list-apps.py
start
[application | soffice]
end
/usr/bin/xvfb-run: line 186: kill: (27078) - No such process

This *should not* list the applications from
the other xfvb-run.

It works as expected when passing `--auto-servernum`:

$ xvfb-run --auto-servernum dbus-launch python3 
/home/vagrant/atspi-list-apps.py
start
end

Therefore, pass the `--auto-servernum` arg to xvfb-run, so that it
automatically determines a free server number instead.

>  -a, --auto-servernum
> Try to get a free server number, starting at 99, or the 
argument to --server-num.

Python script mentioned above used for testing:

$ cat atspi-list-apps.py
#!/usr/bin/python3

import pyatspi

registry = pyatspi.registry.Registry()
apps = list(registry.getDesktop(0))

print('start')

for app in apps:
print(f'{app}')

print('end')

[1] 
https://ci.libreoffice.org/job/gerrit_linux_gcc_release/151750/consoleFull#-1985341263d893063f-7f3d-4b7e-b56f-4e0f225817cd

Change-Id: I0673212fb8fed5c9698c9f797b7bf49ba51033b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158021
Tested-by: Jenkins
Reviewed-by: Colomban Wendling 
Reviewed-by: Michael Weghorn 

diff --git a/vcl/CppunitTest_vcl_gtk3_a11y.mk b/vcl/CppunitTest_vcl_gtk3_a11y.mk
index 19adbabd4d14..476f80334442 100644
--- a/vcl/CppunitTest_vcl_gtk3_a11y.mk
+++ b/vcl/CppunitTest_vcl_gtk3_a11y.mk
@@ -13,7 +13,7 @@ $(call gb_CppunitTest_get_target,vcl_gtk3_a11y) : 
gb_TEST_ENV_VARS += SAL_USE_VC
 $(call gb_CppunitTest_get_target,vcl_gtk3_a11y) : gb_TEST_ENV_VARS += 
GDK_BACKEND=x11
 ifeq (,$(VCL_GTK3_TESTS_NO_XVFB))
 $(call gb_CppunitTest_get_target,vcl_gtk3_a11y) : \
-   ICECREAM_RUN += $(XVFB_RUN) $(DBUS_LAUNCH) --exit-with-session
+   ICECREAM_RUN += $(XVFB_RUN) --auto-servernum $(DBUS_LAUNCH) 
--exit-with-session
 endif
 
 $(eval $(call gb_CppunitTest_CppunitTest,vcl_gtk3_a11y))


[Libreoffice-commits] core.git: bin/gbuild-to-ide

2023-10-16 Thread Michael Weghorn (via logerrit)
 bin/gbuild-to-ide |   21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

New commits:
commit f8be1b73847514bb8e2054dc6d8a62e00682ab78
Author: Michael Weghorn 
AuthorDate: Mon Oct 16 14:39:42 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Oct 16 18:29:23 2023 +0200

qtcreator: Specify C++ std version using CONFIG qmake var

Extract the C++ standard version to use that is specified
by a `-std=` or `-std:` compiler flag,
and set that via "CONFIG += " in the .pro files
used by Qt Creator.

This makes the Clang Code Model use the correct mode
and no longer complain about `char8_t` after the
switch to C++20 in my Windows development setup
in Qt Creator:

> accessibletabbarpagelist.hxx:22:10: In included file: use of undeclared 
identifier 'char8_t'
> stringutils.hxx:252:31: error occurred here

The previous way of specifying this via
`QMAKE_CXXFLAGS` as introduced in

commit 92c03d9bf644b0f10de52ce0da09f97056e46247
    Author: Michael Weghorn 
Date:   Fri Jun 7 21:44:03 2019 +0200

qtcreator: Take over '-std=...' from CXXFLAGS

appears to not (no longer?) work at least with Qt Creator 11.0.3
on Windows.

On the contrary however, setting only `CONFIG` and
not `QMAKE_CXXFLAGS` causes the exact same problem
in my Linux setup.

Therefore, set both qmake variables.

Note that there is a specific set of accepted values
for the the `CONFIG` variable in .pro files [1],
but at least "c++20" and "c++latest" are accepted
and have the expected meaning, so that should be
fine for now.

[1] https://doc.qt.io/qt-6/qmake-variable-reference.html#config

Change-Id: Idc75b74300c7bdd0f6193fcfc1758b536728b887
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158053
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index b56cff8585ea..f428f451e990 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1718,11 +1718,11 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 if path:
 headers_list.append(lopath(path))
 
-cxxflags_list = []
+cxxstdversionflag = ''
 for cxxflag in lib.cxxflags:
 # extract flag for C++ standard version
 if cxxflag.startswith('-std'):
-cxxflags_list.append(cxxflag)
+cxxstdversionflag = cxxflag
 
 # List all include paths
 for hdir in (lib.include + lib.include_sys):
@@ -1749,14 +1749,14 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 if lib_folder in self.data_libs:
 self.data_libs[lib_folder]['sources'] |= set(sources_list)
 self.data_libs[lib_folder]['headers'] |= set(headers_list)
-self.data_libs[lib_folder]['cxxflags'] |= set(cxxflags_list)
+self.data_libs[lib_folder]['cxxstdversionflag'] = 
cxxstdversionflag
 self.data_libs[lib_folder]['includepath'] |= 
set(includepath_list)
 self.data_libs[lib_folder]['defines'] |= set(defines_list)
 else:
 self.data_libs[lib_folder] = {
 'sources': set(sources_list),
 'headers': set(headers_list),
-'cxxflags': set(cxxflags_list),
+'cxxstdversionflag': cxxstdversionflag,
 'includepath': set(includepath_list),
 'defines': set(defines_list),
 'loc': lib.location,
@@ -1779,7 +1779,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 for lib_folder in subdirs_list:
 sources_list = sorted(self.data_libs[lib_folder]['sources'])
 headers_list = sorted(self.data_libs[lib_folder]['headers'])
-cxxflags_list = sorted(self.data_libs[lib_folder]['cxxflags'])
+cxxstdversionflag = self.data_libs[lib_folder]['cxxstdversionflag']
 includepath_list = 
sorted(self.data_libs[lib_folder]['includepath'])
 defines_list = sorted(self.data_libs[lib_folder]['defines'])
 lib_loc = self.data_libs[lib_folder]['loc']
@@ -1787,16 +1787,18 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 
 sources = " \\\n".join(sources_list)
 headers = " \\\n".join(headers_list)
-cxxflags = " \\\n".join(cxxflags_list)
 includepath = " \\\n".join(includepath_list)
 defines = " \\\n".join(defines_list)
+# strip '-std=' or '-std:' prefix
+assert(isinstance(cxxstdversionflag, str) and 
cxxstdversionflag.startswith('-std'))
+cxxstdversion = cxxstdversionfl

[Libreoffice-commits] core.git: accessibility/inc accessibility/source

2023-10-14 Thread Michael Weghorn (via logerrit)
 accessibility/inc/extended/accessibletabbarpagelist.hxx|4 +---
 accessibility/source/extended/accessibletabbarpagelist.cxx |1 -
 2 files changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 2a3023bc91d6f16133b5c869a1159342f9223228
Author: Michael Weghorn 
AuthorDate: Sat Oct 14 20:49:53 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sun Oct 15 00:10:37 2023 +0200

a11y: Add include to fix clang-cl build

Without this, my clang-cl build on windows would fail
like this:

In file included from 
C:/tools/cygwin/home/user/development/git/libreoffice/accessibility/source/extended/accessibletabbarbase.cxx:20:
In file included from 
C:/tools/cygwin/home/user/development/git/libreoffice/accessibility/inc\extended/accessibletabbarbase.hxx:24:
In file included from 
C:/tools/cygwin/home/user/development/git/libreoffice/include\vcl/vclptr.hxx:25:

C:/tools/cygwin/home/user/development/git/libreoffice/include\rtl/ref.hxx(129,20):
 error: member access into incomplete type 'accessibility::AccessibleTabBarPage'
  129 | m_pBody->release();
  |^

C:/PROGRA~1/MICROS~2/2022/COMMUN~1/VC/Tools/MSVC/1437~1.328/Include\xmemory(321,21):
 note: in instantiation of member function 
'rtl::Reference::~Reference' requested here
  321 | _Location->~_Ty();
  | ^

C:/tools/cygwin/home/user/development/git/libreoffice/accessibility/inc\extended/accessibletabbarpagelist.hxx(32,11):
 note: forward declaration of 'accessibility::AccessibleTabBarPage'
   32 | class AccessibleTabBarPage;
  |   ^
1 error generated.
make[1]: *** 
[C:/tools/cygwin/home/user/development/git/libreoffice/solenv/gbuild/LinkTarget.mk:340:
 
C:/tools/cygwin/home/user/development/git/libreoffice/workdir/CxxObject/accessibility/source/extended/accessibletabbarbase.o]
 Error 1
make: *** [Makefile:121: accessibility] Error 2

Change-Id: I3961fb95602b96667f33ea0b087e1df5375faf19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157982
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/inc/extended/accessibletabbarpagelist.hxx 
b/accessibility/inc/extended/accessibletabbarpagelist.hxx
index d3f3d56f317d..b3045aa77c6f 100644
--- a/accessibility/inc/extended/accessibletabbarpagelist.hxx
+++ b/accessibility/inc/extended/accessibletabbarpagelist.hxx
@@ -24,14 +24,12 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
 namespace accessibility
 {
-class AccessibleTabBarPage;
-
-
 class AccessibleTabBarPageList final : public cppu::ImplInheritanceHelper<
AccessibleTabBarBase,
css::accessibility::XAccessible,
diff --git a/accessibility/source/extended/accessibletabbarpagelist.cxx 
b/accessibility/source/extended/accessibletabbarpagelist.cxx
index 5faaed6846e2..8ad6b168ebaf 100644
--- a/accessibility/source/extended/accessibletabbarpagelist.cxx
+++ b/accessibility/source/extended/accessibletabbarpagelist.cxx
@@ -19,7 +19,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 


[Libreoffice-commits] core.git: vcl/source

2023-10-13 Thread Michael Weghorn (via logerrit)
 vcl/source/accessibility/AccessibleTextAttributeHelper.cxx |   53 +
 1 file changed, 53 insertions(+)

New commits:
commit c0a284541fad2c4609d418a5002550f6f9581d51
Author: Michael Weghorn 
AuthorDate: Fri Oct 13 15:51:56 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Oct 13 21:09:15 2023 +0200

tdf#157696 a11y Translate "CharStrikeout" to IA2 equivalents

The IAccessible2 text attributes specification [1]
has several different "text-line-through-*"
attributes for indicating strikethrough.

With this change in place, NVDA on Windows (with the WIP branches
to switch both LO's winaccessibility and NVDA to the
IAccessible2 text attributes) announces the striked out
text in the tdf#157696 sample document as expected.

For the qt6 VCL plugin on Linux, this is not the
case yet, because Qt's AT-SPI adaptor does not support
the attributes yet; s.a. QTBUG-118106 [2].

Pending qtbase change implementing that: [3]

While the gtk3 VCL plugin reports 2 attributes, e.g.
"strikethrough: single" and "text-decoration: line-through",
the ATK text attribute specification [4] only mentions a
`ATK_TEXT_ATTR_STRIKETHROUGH` that can be either
"true" or "false", and that is also what e.g.
the gtk4-demo "Text View" -> "Markup" example does,
so the suggested Qt change also does this, which means
that just "strikethrough: true" will be reported when
any kind of strikethrough is in place with the qt6 VCL
plugin and both, this LibreOffice change and the
pending Qt Gerrit change applied.

[1] 
https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes
[2] https://bugreports.qt.io/browse/QTBUG-118106
[3] https://codereview.qt-project.org/c/qt/qtbase/+/511758
[4] https://gnome.pages.gitlab.gnome.org/atk/AtkText.html#AtkTextAttribute

Change-Id: Ib4ebba183be233aacfcf33a4fff29b27711d2e1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157939
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx 
b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
index d8ffa5161930..ccd900e9edc1 100644
--- a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
+++ b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -37,6 +38,53 @@ OUString lcl_ConvertCharEscapement(sal_Int16 nEscapement)
 return "baseline";
 }
 
+OUString lcl_ConverCharStrikeout(sal_Int16 nStrikeout)
+{
+OUString sTextLineThroughStyle;
+OUString sTextLineThroughText;
+OUString sTextLineThroughType;
+OUString sTextLineThroughWidth;
+
+switch (nStrikeout)
+{
+case css::awt::FontStrikeout::BOLD:
+sTextLineThroughType = "single";
+sTextLineThroughWidth = "bold";
+break;
+case css::awt::FontStrikeout::DONTKNOW:
+break;
+case css::awt::FontStrikeout::DOUBLE:
+sTextLineThroughType = "double";
+break;
+case css::awt::FontStrikeout::NONE:
+sTextLineThroughStyle = "none";
+break;
+case css::awt::FontStrikeout::SINGLE:
+sTextLineThroughType = "single";
+break;
+case css::awt::FontStrikeout::SLASH:
+sTextLineThroughText = u"/"_ustr;
+break;
+case css::awt::FontStrikeout::X:
+sTextLineThroughText = u"X"_ustr;
+break;
+default:
+assert(false && "Unhandled strikeout type");
+}
+
+OUString sResult;
+if (!sTextLineThroughStyle.isEmpty())
+sResult += u"text-line-through-style:"_ustr + sTextLineThroughStyle + 
";";
+if (!sTextLineThroughText.isEmpty())
+sResult += u"text-line-through-text:"_ustr + sTextLineThroughText + 
";";
+if (!sTextLineThroughType.isEmpty())
+sResult += u"text-line-through-type:"_ustr + sTextLineThroughType + 
";";
+if (!sTextLineThroughWidth.isEmpty())
+sResult += u"text-line-through-width:"_ustr + sTextLineThroughWidth + 
";";
+
+return sResult;
+}
+
 OUString lcl_convertFontWeight(double fontWeight)
 {
 if (fontWeight == css::awt::FontWeight::THIN || fontWeight == 
css::awt::FontWeight::ULTRALIGHT)
@@ -212,6 +260,11 @@ OUString 
AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes(
 const css::awt::FontSlant eFontSlant = 
*o3tl::doAccess(prop.Value);
 sValue = lcl_ConvertFontSlant(eFontSlant);
 }
+else if (prop.Name == "CharStrikeout")
+{
+const sal_Int16 nStrikeout = 
*o3tl::doAccess(prop.Value);
+aRet += lcl_ConverCharStrikeout(nStrikeout);
+}
 else if (prop.Name == "CharUnderline")
 {
 OUString sUnderlineStyle;


[Libreoffice-commits] core.git: vcl/source

2023-10-12 Thread Michael Weghorn (via logerrit)
 vcl/source/accessibility/AccessibleTextAttributeHelper.cxx |   16 +
 1 file changed, 16 insertions(+)

New commits:
commit 807b0507563b1c54822dd302b210931297acde23
Author: Michael Weghorn 
AuthorDate: Thu Oct 12 14:54:46 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Oct 12 22:14:18 2023 +0200

tdf#157696 a11y: Map "CharEscapement" text attr to IA2 "text-position"

While the gtk3 implementation (see `Escapement2VerticalAlign`
in `vcl/unx/gtk3/a11y/atktextattributes.cxx`) bridges numeric
values to ATK/AT-SPI, the IAccessible2 text attribute specification [1]
only allows the 3 values "baseline", "super" and "sub".

With this in place, Orca with the qt6 VCL plugin on Linux
and NVDA on Windows (with the WIP branches to switch both
LO's winaccessibility and NVDA to the IAccessible2 text
attributes) announce the subscript and superscript text
in the tdf#157696 sample document as expected.
(For Orca, announcement of the "vertical-align" text
attribute is off by default, so that first needs to be enabled
in the "Text Attributes" section of the Orca configuration
dialog.)

[1] http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-vertical-align

Change-Id: I1e4ea014cf818fefd009089be183615abf67aada
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157867
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx 
b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
index d3c77b9a6233..d8ffa5161930 100644
--- a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
+++ b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
@@ -27,6 +27,16 @@
 
 namespace
 {
+OUString lcl_ConvertCharEscapement(sal_Int16 nEscapement)
+{
+if (nEscapement > 0)
+return "super";
+if (nEscapement < 0)
+return "sub";
+
+return "baseline";
+}
+
 OUString lcl_convertFontWeight(double fontWeight)
 {
 if (fontWeight == css::awt::FontWeight::THIN || fontWeight == 
css::awt::FontWeight::ULTRALIGHT)
@@ -180,6 +190,12 @@ OUString 
AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes(
 sValue = lcl_ConvertColor(
 Color(ColorTransparency, 
*o3tl::doAccess(prop.Value)));
 }
+else if (prop.Name == "CharEscapement")
+{
+sAttribute = "text-position";
+const sal_Int16 nEscapement = 
*o3tl::doAccess(prop.Value);
+sValue = lcl_ConvertCharEscapement(nEscapement);
+}
 else if (prop.Name == "CharFontName")
 {
 sAttribute = "font-family";


[Libreoffice-commits] core.git: svx/source

2023-10-12 Thread Michael Weghorn (via logerrit)
 svx/source/svdraw/svdhdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3d1cd490ac0366245c4b55d711611c21149a76e9
Author: Michael Weghorn 
AuthorDate: Thu Oct 12 18:57:57 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Oct 12 21:10:06 2023 +0200

tdf#141828 svx: Use pointing hand for custom shape handles

Use the *pointing* hand cursor (`PointerStyle::RefHand`)
instead of the hand symbol cursor (`PointerStyle::Hand`)
for handles for custom shape interaction.
(S. how `SdrHdlKind::CustomShape1` is only specified in
`SdrObjCustomShape::AddToHdlList`, except for read-only
switch/cases elsewhere).

As mentioned in tdf#141828, this has the advantage that
the user can see where the handle is being moved.

For gtk3, this doesn't make any difference in practice,
because it's using the same cursor type for both,
`PointerStyle::RefHand` and `PointerStyle::Hand`
(s. `GtkSalDisplay::getCursor`, but the Qt-based VCL
plugins (`QtData::getCursor`) and macOS
(s. `AquaSalFrame::getCurrentCursor`) make a
distinction between them.

Change-Id: I5d35481e5c5edc1895a7c4a973315ee6b187b983
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157891
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index deb8da05d9d5..867534e9a08f 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1011,7 +1011,7 @@ PointerStyle SdrHdl::GetPointer() const
 case SdrHdlKind::Ref2 : ePtr=PointerStyle::RefHand;   break;
 case SdrHdlKind::BezierWeight : 
ePtr=PointerStyle::MoveBezierWeight; break;
 case SdrHdlKind::Glue : ePtr=PointerStyle::MovePoint; break;
-case SdrHdlKind::CustomShape1 : ePtr=PointerStyle::Hand; break;
+case SdrHdlKind::CustomShape1 : ePtr=PointerStyle::RefHand; 
break;
 default:
 break;
 }


[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/Library_vcl.mk vcl/qt5 vcl/source

2023-10-12 Thread Michael Weghorn (via logerrit)
 include/vcl/accessibility/AccessibleTextAttributeHelper.hxx |   39 ++
 vcl/Library_vcl.mk  |1 
 vcl/qt5/QtAccessibleWidget.cxx  |  198 --
 vcl/source/accessibility/AccessibleTextAttributeHelper.cxx  |  228 
 4 files changed, 271 insertions(+), 195 deletions(-)

New commits:
commit c2a90307d507817a4cc7741a1a7ade062fdb390b
Author: Michael Weghorn 
AuthorDate: Wed Oct 11 17:31:42 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Oct 12 12:19:15 2023 +0200

tdf#157696 a11y: Escape commas in IAccessible2 color text attribute

The IAccessible2 text attribute specification [1] says:

> These characters need to be escaped with a backslash:
> backslash, colon, comma, equals, and semicolon.

So adhere to this. Otherwise, the NVDA screen reader
is unable to announce the text foreground or background
color properly in local WIP branches of both LO and NVDA
to use IAccessible2 text attributes on Windows as well.

With this change in place, the backslashes are also
contained in the corresponding AT-SPI attributes when using
the qt6 VCL plugin on Linux.
That seems undesirable there (s. e.g. the ATK text
attribute spec [2] and how the Gtk variant of LO
and also the gtk4-demo "Hypertext" example" expose it),
but I think this should rather be handled in Qt's
AT-SPI adaptor's mapping of the IAccessible2 attributes
to the AT-SPI ones.
Pending Qt Gerrit change implementing this: [3]

(At least Orca still announces the colors just fine
with the additional backslash in place, so having
an extra platform-specific handling here doesn't
seem to be urgent for now.)

[1] 
https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes#formatting
[2] https://gnome.pages.gitlab.gnome.org/atk/AtkText.html#AtkTextAttribute
[3] https://codereview.qt-project.org/c/qt/qtbase/+/511132

Change-Id: I51780f44930089249a769522d7130e97ac5446b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157845
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx 
b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
index d60ce2ff1d18..d3c77b9a6233 100644
--- a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
+++ b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx
@@ -154,8 +154,9 @@ void lcl_ConvertFontUnderline(sal_Int16 nFontUnderline, 
OUString& rUnderlineStyl
 /** Converts Color to "rgb(r,g,b)" as specified in 
https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes. */
 OUString lcl_ConvertColor(Color aColor)
 {
-return u"rgb(" + OUString::number(aColor.GetRed()) + u"," + 
OUString::number(aColor.GetGreen())
-   + u"," + OUString::number(aColor.GetBlue()) + u")";
+return u"rgb(" + OUString::number(aColor.GetRed()) + u"\\,"
+   + OUString::number(aColor.GetGreen()) + u"\\," + 
OUString::number(aColor.GetBlue())
+   + u")";
 }
 }
 
commit b9b3d49dfe2de62612cdebbc465c8322acf410b1
Author: Michael Weghorn 
AuthorDate: Wed Oct 11 08:38:55 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Oct 12 12:19:05 2023 +0200

tdf#157696 vcl a11y: Move qt's translation to IA2 text attrs for reuse

Qt expects the text attributes to be reported as IAccessible2
attributes. Therefore, there is a translation/conversion
from the LO-internal text attributes to IAccessible2 text
attributes in `QtAccessibleWidget::attributes`.

Move the logic from the qt-VCL-specific code into a new
VCL helper class `AccessibleTextAttributeHelper`, so
it can be reused in winaccessibility in following commits.

Change-Id: I434481faa53c74bae95cae5b2c9f0907b87fb1bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157804
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx 
b/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx
new file mode 100644
index ..6f8ef6dab66e
--- /dev/null
+++ b/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE fil

[Libreoffice-commits] core.git: 2 commits - winaccessibility/source

2023-10-10 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/AccTextBase.cxx |   59 +++-
 winaccessibility/source/UAccCOM/AccTextBase.h   |2 
 2 files changed, 28 insertions(+), 33 deletions(-)

New commits:
commit 3b6366773389c55c127f097d5d82d27d5efaa69a
Author: Michael Weghorn 
AuthorDate: Tue Oct 10 12:52:49 2023 +0100
Commit: Michael Weghorn 
CommitDate: Wed Oct 11 07:20:21 2023 +0200

wina11y: Drop CAccTextBase::GetXInterface

Just use the private `pRXText` member directly. The separate
getter doesn't really help regarding readability,
in particular since the typical usage pattern
involved first checking the member directly, then
using the getter, making it less obvious that this
was about the same object/reference e.g.

if(!pRXText.is())
{
return E_FAIL;
}

if( offset < 0 || offset > GetXInterface()->getCharacterCount() )
return E_FAIL;

Change-Id: Iaf786220b94a37e79a46985f58e0586252846f56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157766
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx 
b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index 131d001b27df..37eb1d6fcf70 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -108,7 +108,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_addSelection(long startOffse
 }
 else
 {
-GetXInterface()->setSelection(startOffset, endOffset);
+pRXText->setSelection(startOffset, endOffset);
 return S_OK;
 }
 
@@ -137,12 +137,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_attributes(long offset, long
 return E_FAIL;
 }
 
-if( offset < 0 || offset > GetXInterface()->getCharacterCount() )
+if (offset < 0 || offset > pRXText->getCharacterCount() )
 return E_FAIL;
 
 OUStringBuffer strAttrs("Version:1;");
 
-Sequence< css::beans::PropertyValue > pValues = 
GetXInterface()->getCharacterAttributes(offset, Sequence< OUString >());
+Sequence  pValues = 
pRXText->getCharacterAttributes(offset, Sequence());
 int nCount = pValues.getLength();
 
 sal_Int16 numberingLevel = 0;
@@ -220,9 +220,9 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_attributes(long offset, long
 SysFreeString(*textAttributes);
 *textAttributes = 
SysAllocString(o3tl::toW(strAttrs.makeStringAndClear().getStr()));
 
-if( offset < GetXInterface()->getCharacterCount() )
+if (offset < pRXText->getCharacterCount())
 {
-TextSegment textSeg = GetXInterface()->getTextAtIndex(offset, 
AccessibleTextType::ATTRIBUTE_RUN);
+TextSegment textSeg = pRXText->getTextAtIndex(offset, 
AccessibleTextType::ATTRIBUTE_RUN);
 *startOffset = textSeg.SegmentStart;
 *endOffset = textSeg.SegmentEnd;
 }
@@ -257,7 +257,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_caretOffset(long * offset)
 return S_OK;
 }
 
-*offset = GetXInterface()->getCaretPosition();
+*offset = pRXText->getCaretPosition();
 return S_OK;
 
 } catch(...) { return E_FAIL; }
@@ -283,7 +283,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_characterCount(long * nChara
 return S_OK;
 }
 
-*nCharacters = GetXInterface()->getCharacterCount();
+*nCharacters = pRXText->getCharacterCount();
 return S_OK;
 
 } catch(...) { return E_FAIL; }
@@ -310,11 +310,11 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_characterExtents(long offset
 if(!pRXText.is())
 return E_FAIL;
 
-if(offset < 0 || offset > GetXInterface()->getCharacterCount() )
+if (offset < 0 || offset > pRXText->getCharacterCount())
 return E_FAIL;
 
 css::awt::Rectangle rectangle;
-rectangle = GetXInterface()->getCharacterBounds(offset);
+rectangle = pRXText->getCharacterBounds(offset);
 
 //IA2Point aPoint;
 css::awt::Point aPoint;
@@ -346,10 +346,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_characterExtents(long offset
 *x = rectangle.X;
 *y = rectangle.Y;
 
-// GetXInterface()->getCharacterBounds() have different implement in 
different acc component
+// pRXText->getCharacterBounds() have different implement in different acc 
component
 // But we need return the width/height == 1 for every component when 
offset == text length.
-// So we ignore the return result of GetXInterface()->getCharacterBounds() 
when offset == text length.
-if( offset == GetXInterface()->getCharacterCount() )
+// So we ignore the return result of pRXText->getCharacterBounds() when 
offset == text length.
+if (offset == pRXText->getCharacterCount())
 {
 *width = 1;
 *h

[Libreoffice-commits] core.git: vcl/unx

2023-10-10 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/a11y/atktext.cxx |   99 --
 1 file changed, 48 insertions(+), 51 deletions(-)

New commits:
commit 9fc43f19615161d5db39db7ee4d1e214c1da8e57
Author: Michael Weghorn 
AuthorDate: Tue Oct 10 14:10:48 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 10 16:34:11 2023 +0200

gtk3 a11y: Drop unnecessary check before looping

If `nTextMarkupCount` is <= 0 here, the loop condition
isn't met, so the body is never entered anyway, so no
need to check this explicitly.

Drop the extra nesting level.
(Use `git show -w` to ignore whitespace change.)

Change-Id: Ib472da039d7b0a02ae3206b350c3feb6d42b914b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157759
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk3/a11y/atktext.cxx b/vcl/unx/gtk3/a11y/atktext.cxx
index e8ceab3bb657..8b1ab674227d 100644
--- a/vcl/unx/gtk3/a11y/atktext.cxx
+++ b/vcl/unx/gtk3/a11y/atktext.cxx
@@ -438,68 +438,65 @@ handle_text_markup_as_run_attribute( 
css::uno::ReferencegetTextMarkupCount( 
nTextMarkupType ) );
-if ( nTextMarkupCount > 0 )
+for ( gint nTextMarkupIndex = 0;
+  nTextMarkupIndex < nTextMarkupCount;
+  ++nTextMarkupIndex )
 {
-for ( gint nTextMarkupIndex = 0;
-  nTextMarkupIndex < nTextMarkupCount;
-  ++nTextMarkupIndex )
+accessibility::TextSegment aTextSegment =
+pTextMarkup->getTextMarkup( nTextMarkupIndex, nTextMarkupType );
+const gint nStartOffsetTextMarkup = aTextSegment.SegmentStart;
+const gint nEndOffsetTextMarkup = aTextSegment.SegmentEnd;
+if ( nStartOffsetTextMarkup <= offset )
 {
-accessibility::TextSegment aTextSegment =
-pTextMarkup->getTextMarkup( nTextMarkupIndex, nTextMarkupType 
);
-const gint nStartOffsetTextMarkup = aTextSegment.SegmentStart;
-const gint nEndOffsetTextMarkup = aTextSegment.SegmentEnd;
-if ( nStartOffsetTextMarkup <= offset )
+if ( offset < nEndOffsetTextMarkup )
 {
-if ( offset < nEndOffsetTextMarkup )
+// text markup at 
+*start_offset = ::std::max( *start_offset,
+nStartOffsetTextMarkup );
+*end_offset = ::std::min( *end_offset,
+  nEndOffsetTextMarkup );
+switch ( nTextMarkupType )
 {
-// text markup at 
-*start_offset = ::std::max( *start_offset,
-nStartOffsetTextMarkup );
-*end_offset = ::std::min( *end_offset,
-  nEndOffsetTextMarkup );
-switch ( nTextMarkupType )
+case css::text::TextMarkupType::SPELLCHECK:
 {
-case css::text::TextMarkupType::SPELLCHECK:
-{
-pSet = attribute_set_prepend_misspelled( pSet );
-}
-break;
-case css::text::TextMarkupType::TRACK_CHANGE_INSERTION:
-{
-pSet = 
attribute_set_prepend_tracked_change_insertion( pSet );
-}
-break;
-case css::text::TextMarkupType::TRACK_CHANGE_DELETION:
-{
-pSet = 
attribute_set_prepend_tracked_change_deletion( pSet );
-}
-break;
-case 
css::text::TextMarkupType::TRACK_CHANGE_FORMATCHANGE:
-{
-pSet = 
attribute_set_prepend_tracked_change_formatchange( pSet );
-}
-break;
-default:
-{
-OSL_ASSERT( false );
-}
+pSet = attribute_set_prepend_misspelled( pSet );
+}
+break;
+case css::text::TextMarkupType::TRACK_CHANGE_INSERTION:
+{
+pSet = attribute_set_prepend_tracked_change_insertion( 
pSet );
+}
+break;
+case css::text::TextMarkupType::TRACK_CHANGE_DELETION:
+{
+pSet = attribute_set_prepend_tracked_change_deletion( 
pSet );
+}
+break;
+case css::text::TextMarkupType::TRACK_CHANGE_FORMATCHANGE:
+{
+pSet = 
attribute_set_prepend_tra

[Libreoffice-commits] core.git: sw/uiconfig

2023-10-09 Thread Michael Weghorn (via logerrit)
 sw/uiconfig/swriter/ui/wordcount.ui |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 0ac6dc3568a40799200fe368bbad781f284f40e1
Author: Michael Weghorn 
AuthorDate: Fri Oct 6 12:48:40 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Oct 9 09:31:25 2023 +0200

tdf#157633 a11y: Drop a11y description in Word Count dialog

Drop the accessible description for the Word Count
dialog since, as pointed out on the a11 mailing list [1],
having that whole text read out each time by the
screen reader isn't really the desired behavior.

For dialogs, NVDA on Windows only reads the a11y description
and not the dialog content if the a11y description
is set (s. [2]).
In case of this dialog, there's also no way to have
the text read out by moving focus (there are only
2 buttons at the bottom of the dialog), but only
by having the whole dialog read out by pressing
a screenreader-specific keyboard shortcut, in which
case NVDA would announce the description of the
dialog again first of all, before announcing the
actual content.

There's a help button right in the dialog that can be
used to get the same information easily, so drop
the a11y description.

This also implies that this text is no longer shown
as tooltip on mouse hover when extended tips are enabled
in the settings, since that feature makes use of the
a11y description.

[1] https://listarchives.libreoffice.org/global/accessibility/msg01055.html
[2] 
https://github.com/nvaccess/nvda/blob/a380b6a76a0a29df32e57c1bd974b11a895ac0c8/source/NVDAObjects/behaviors.py#L151-L156

Change-Id: I9d4ceb20534fd87a8c1a3fa3ad5848bf0f4a0f29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157638
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 
Reviewed-by: Michael Weghorn 

diff --git a/sw/uiconfig/swriter/ui/wordcount.ui 
b/sw/uiconfig/swriter/ui/wordcount.ui
index 71a08f9936c4..c42d8fbb30ad 100644
--- a/sw/uiconfig/swriter/ui/wordcount.ui
+++ b/sw/uiconfig/swriter/ui/wordcount.ui
@@ -354,11 +354,6 @@
   close
   help
 
-
-  
-Counts the words and 
characters, with or without spaces, in the current selection and in the whole 
document. The count is kept up to date as you type or change the 
selection.
-  
-
   
   
 True


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source

2023-10-07 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleCell.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit dc85ff37bf4265884d7d0ec5974557ead1cc5cfe
Author: Michael Weghorn 
AuthorDate: Tue Sep 26 10:30:27 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sun Oct 8 06:39:36 2023 +0200

tdf#157299 sc a11y: Limit amount of reported cell relations

For the cells referenced in formulae, the a11y `CONTROLLED_BY`
relation is reported.

Since formulae can reference a large amount of cells, creating
the a11y objects for each of these cells can result in Calc freezing,
e.g. for the tdf#157299 `SUMIF` example that was referencing a whole
column (containing 1048576 cells).

Prevent that by limiting the maximimum amount of cells to handle
here to 1000, and just printing a warning to the log otherwise
and ignore cell ranges having more cells.

If there's a need to increase the limit, that should be possible
within certain bounds. My test with a modified SUMIF that just
uses 999 cells wasn't causing any noticeable delay and the
relations were shown in Accerciser as expected.

From a quick look at the Orca and NVDA source code,
they currently don't seem to make use of the
`CONTROLLED_BY` relation for LibreOffice at all.

Change-Id: Ia74e0e88d9dbd7650832664b9c027262367b428e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157265
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit c2d6ae1781ad4be5f9acefecce7e1504df02cf8f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157225
Reviewed-by: Patrick Luby 

diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx 
b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 96020a08ef63..bb1a22117cc4 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -455,6 +455,15 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange,
 const sal_uInt32 nCount(static_cast(rRange.aEnd.Col() -
 rRange.aStart.Col() + 1) * (rRange.aEnd.Row() -
 rRange.aStart.Row() + 1));
+
+// tdf#157299 avoid handling a large amount of cells for performance 
reasons
+if (nCount > 1000)
+{
+SAL_WARN("sc", "ScAccessibleCell::AddRelation: Not setting relations "
+   "for cell range with more than 1000 cells for 
performance reasons.");
+return;
+}
+
 uno::Sequence < uno::Reference < uno::XInterface > > aTargetSet( nCount );
 uno::Reference < uno::XInterface >* pTargetSet = aTargetSet.getArray();
 sal_uInt32 nPos(0);


[Libreoffice-commits] core.git: sw/uiconfig

2023-10-06 Thread Michael Weghorn (via logerrit)
 sw/uiconfig/swriter/ui/wordcount.ui |   10 --
 1 file changed, 10 deletions(-)

New commits:
commit 9e3da252c361b3e2b04a2df7a3ae2a5177b37713
Author: Michael Weghorn 
AuthorDate: Fri Oct 6 09:58:51 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sat Oct 7 00:26:38 2023 +0200

tdf#157633 a11y: Don't duplicate dialog description for its buttons

This accessible description does not describe what the
buttons are for, but what the dialog does, and it was
previously set for the dialog and each of the two buttons
in the word count dialog in Writer ("Tools" -> "Word Count").
As a consequence, NVDA would read the description, both,
when the dialog opens (as the a11y description of the dialog)
and whenever moving focus between the buttons, e.g. using the
Tab key.

In addition, it would be read three times when reading out the
whole dialog (NVDA+B), once at the beginning (for the dialog),
and then when each button is announced.

Drop the accessible descriptions from the buttons.

Change-Id: I878f1ec14439f78e60a8b95024e9966bc821042e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157637
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/sw/uiconfig/swriter/ui/wordcount.ui 
b/sw/uiconfig/swriter/ui/wordcount.ui
index 91aebe9ac551..71a08f9936c4 100644
--- a/sw/uiconfig/swriter/ui/wordcount.ui
+++ b/sw/uiconfig/swriter/ui/wordcount.ui
@@ -29,11 +29,6 @@
 True
 True
 True
-
-  
-Counts the words and 
characters, with or without spaces, in the current selection and in the whole 
document. The count is kept up to date as you type or change the 
selection.
-  
-
   
   
 False
@@ -48,11 +43,6 @@
 True
 True
 True
-
-  
-Counts the words and 
characters, with or without spaces, in the current selection and in the whole 
document. The count is kept up to date as you type or change the 
selection.
-  
-
   
   
 False


[Libreoffice-commits] core.git: vcl/source

2023-10-06 Thread Michael Weghorn (via logerrit)
 vcl/source/window/builder.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f8e16f26a037a71349dc1a197b5ace204acb123b
Author: Michael Weghorn 
AuthorDate: Fri Oct 6 17:27:40 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sat Oct 7 00:05:43 2023 +0200

tdf#157639 a11y: Set proper role for status bar

Set `css::accessibility::AccessibleRole::STATUS_BAR`
as role for the `VclHBox`/`VclVBox` instances created
for `GtkStatusBar` nodes in .ui files, so that they
are properly exposed to the accessibility layer.

This is e.g. required to make NVDA's feature to announce
the status bar content (when pressing NVDA+End) work.

An additional change on NVDA side is needed to make the
announcement work. Pending PR:
https://github.com/nvaccess/nvda/pull/15592

Change-Id: Iac587be96ec941afd7625ee363949f5da0cbc873
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157659
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 6974cdce9ccd..3825c9674fb1 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1679,6 +1679,9 @@ VclPtr VclBuilder::makeObject(vcl::Window 
*pParent, const OUString
 xWindow = VclPtr::Create(pParent);
 else
 xWindow = VclPtr::Create(pParent);
+
+if (name == "GtkStatusbar")
+
xWindow->SetAccessibleRole(css::accessibility::AccessibleRole::STATUS_BAR);
 }
 else if (name == "GtkPaned")
 {


[Libreoffice-commits] core.git: winaccessibility/source

2023-10-06 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/service/AccObject.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit dd0a0ecb839df1289693d4b2f862e3942a80345d
Author: Michael Weghorn 
AuthorDate: Fri Oct 6 16:01:03 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sat Oct 7 00:05:22 2023 +0200

wina11y: Map FRAME a11y role to IAccessible2 equivalent

The description of the UNO API role (s.
`offapi/com/sun/star/accessibility/AccessibleRole.idl`)
and the IAccessible2 role  `IA2_ROLE_FRAME`
(s. `winaccessibility/source/UAccCOMIDL/ia2_api_all.idl`)
match. (The first sentence is even identical.). Therefore, map
them accordingly instead of mapping to `ROLE_SYSTEM_DIALOG`,
which is not really the same.

It's not clear why this "perfect match" was commented
ever since

commit a18bdb3bc05e761704cc345a66a9d642bc4f4a0a
Author: Steve Yin
Date:   Thu Nov 14 08:18:05 2013 +

Integrate branch of IAccessible2

I noticed this because announcement of the status bar in
Writer by NVDA as implemented in NVDA commit [1]
didn't work any more after

  commit 2cd1408dd7d6688357257f4a58a8b467628b1884
  Author: Michael Weghorn
  Date:   Thu Aug 17 13:15:46 2023 +0100

  tdf#156561 a11y: Create VCLXTopWindow peer for border win frame

as the DIALOG role was used instead of the WINDOW role
after this, and NVDA doesn't consider that yet when
looking for the status bar.

It also doesn't take `IA2_ROLE_FRAME` into account yet,
but this NVDA PR makes NVDA to consider both,
`ROLE_SYSTEM_DIALOG` and `IA2_ROLE_FRAME` as well: [2]

Just mapping to `ROLE_SYSTEM_WINDOW` instead would
still be a better match than the previous
`ROLE_SYSTEM_DIALOG` and would make that
NVDA scenario work again without further
changes to NVDA, but would rather be a workaround
than the proper solution.

[1] 
https://github.com/nvaccess/nvda/commit/62536a97cd29019c7055c927746da72435d12b95
[2] https://github.com/nvaccess/nvda/pull/15592

Change-Id: Ide39222d2525cb64106c878e8b0a11174bcb16ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157658
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index d84e684b012b..98c6bba9392f 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -76,8 +76,7 @@ const short ROLE_TABLE[][2] =
 {FONT_CHOOSER, IA2_ROLE_FONT_CHOOSER},
 {FOOTER,   IA2_ROLE_FOOTER},
 {FOOTNOTE, IA2_ROLE_FOOTNOTE},
-//{FRAME,  IA2_ROLE_FRAME},
-{FRAME,ROLE_SYSTEM_DIALOG},
+{FRAME,IA2_ROLE_FRAME},
 {GLASS_PANE ,  IA2_ROLE_GLASS_PANE},
 {GRAPHIC , ROLE_SYSTEM_GRAPHIC},
 {GROUP_BOX,ROLE_SYSTEM_GROUPING},


[Libreoffice-commits] core.git: vcl/unx

2023-09-27 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 1215e1bcb149791ce293c0bcb235fcd9548136c7
Author: Michael Weghorn 
AuthorDate: Wed Sep 27 14:37:56 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Sep 27 16:00:29 2023 +0200

gtk4 a11y: Map paragraph role to Gtk equivalent

Map `css::accessibility::AccessibleRole::PARAGRAPH`
to the new `GTK_ACCESSIBLE_ROLE_PARAGRAPH` role newly
added to Gtk in commit [1]

commit 9f078bd5c975f33d832b6da71cba2923450d3127
Author: Michael Weghorn 
Date:   Mon Sep 25 10:41:42 2023 +0200

a11y: Add paragraph role

Add new GTK_ACCESSIBLE_ROLE_PARAGRAPH role
for paragraphs.

ARIA has a paragraph role as well.

The paragraph role is used e.g. in document editors
like LibreOffice or web browsers like Firefox.

According to the ARIA spec [1], naming paragraphs
is forbidden (§ 5.2.8.6), and the superclass role
is section.

This role will be more useful once a way to expose
the textual data via the AT-SPI Text interface is
also available (s. issue #5912 [2]).

[1] https://www.w3.org/TR/wai-aria-1.2/
[2] https://gitlab.gnome.org/GNOME/gtk/-/issues/5912

With this in place, a Writer paragraph reports the
proper role to AT-SPI.

There's however currently no way to expose the
paragraph text via the AT-SPI Text interface since
Gtk 4 currently lacks the required API for that (s. [2]).

Without this change in place, the paragraph text was
exposed as the accessible name of the a11y object
(see the "for now set GTK_ACCESSIBLE_PROPERTY_LABEL
as a proof of concept" comment in
`lo_accessible_get_property`), but since ARIA does not
allow naming paragraphs and Gtk 4 follows ARIA, this
is no longer the case with the new mapping in place.

But then, I don't see how to have proper a11y
without supporting the Text interface, so that
will be needed at some point anyway.

[1] 
https://gitlab.gnome.org/GNOME/gtk/-/commit/9f078bd5c975f33d832b6da71cba2923450d3127
[2] https://gitlab.gnome.org/GNOME/gtk/-/issues/5912

Change-Id: I44315754a6376ecc06bee01d16eedb8a769c3d4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157241
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 1b9b04e86e01..418037027f48 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -93,7 +93,11 @@ map_accessible_role(const 
css::uno::Reference&
 eRole = GTK_ACCESSIBLE_ROLE_WIDGET;
 break;
 case css::accessibility::AccessibleRole::PARAGRAPH:
+#if GTK_CHECK_VERSION(4, 13, 1)
+eRole = GTK_ACCESSIBLE_ROLE_PARAGRAPH;
+#else
 eRole = GTK_ACCESSIBLE_ROLE_GROUP;
+#endif
 break;
 case css::accessibility::AccessibleRole::FILLER:
 eRole = GTK_ACCESSIBLE_ROLE_GENERIC;


[Libreoffice-commits] core.git: sc/source

2023-09-26 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleCell.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit c2d6ae1781ad4be5f9acefecce7e1504df02cf8f
Author: Michael Weghorn 
AuthorDate: Tue Sep 26 10:30:27 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Sep 26 12:05:59 2023 +0200

tdf#157299 sc a11y: Limit amount of reported cell relations

For the cells referenced in formulae, the a11y `CONTROLLED_BY`
relation is reported.

Since formulae can reference a large amount of cells, creating
the a11y objects for each of these cells can result in Calc freezing,
e.g. for the tdf#157299 `SUMIF` example that was referencing a whole
column (containing 1048576 cells).

Prevent that by limiting the maximimum amount of cells to handle
here to 1000, and just printing a warning to the log otherwise
and ignore cell ranges having more cells.

If there's a need to increase the limit, that should be possible
within certain bounds. My test with a modified SUMIF that just
uses 999 cells wasn't causing any noticeable delay and the
relations were shown in Accerciser as expected.

From a quick look at the Orca and NVDA source code,
they currently don't seem to make use of the
`CONTROLLED_BY` relation for LibreOffice at all.

Change-Id: Ia74e0e88d9dbd7650832664b9c027262367b428e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157265
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx 
b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 855bdf957546..27ac67611585 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -455,6 +455,15 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange,
 const sal_uInt32 nCount(static_cast(rRange.aEnd.Col() -
 rRange.aStart.Col() + 1) * (rRange.aEnd.Row() -
 rRange.aStart.Row() + 1));
+
+// tdf#157299 avoid handling a large amount of cells for performance 
reasons
+if (nCount > 1000)
+{
+SAL_WARN("sc", "ScAccessibleCell::AddRelation: Not setting relations "
+   "for cell range with more than 1000 cells for 
performance reasons.");
+return;
+}
+
 uno::Sequence < uno::Reference < uno::XInterface > > aTargetSet( nCount );
 uno::Reference < uno::XInterface >* pTargetSet = aTargetSet.getArray();
 sal_uInt32 nPos(0);


Re: New tests: GTK3 platform accessibility

2023-09-23 Thread Michael Weghorn

On 2023-09-13 23:56, Michael Weghorn wrote:
Or, if you're also attending LibreOffice 
conference next week in person, we could also take a look at it together 
then for example.


Colomban and I analyzed this a bit further yesterday, without coming up 
with an actual solution yet.


We noticed that at-spi2-core itself is using a similar approach to run 
its CI tests, which also fails when run in a Fedora 38 GNOME session.


Colomban found this existing issue about running tests using dbus-broker 
on which I've commented now, hoping to get input from upstream:

https://gitlab.gnome.org/GNOME/at-spi2-core/-/issues/49


OpenPGP_signature.asc
Description: OpenPGP digital signature


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/svtools

2023-09-19 Thread Michael Weghorn (via logerrit)
 include/svtools/editbrowsebox.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 59a1402455bd03a9839df9133306974a354b6367
Author: Michael Weghorn 
AuthorDate: Mon Sep 18 14:29:29 2023 +0300
Commit: Xisco Fauli 
CommitDate: Tue Sep 19 12:10:38 2023 +0200

tdf#157304 Use normalized selection indices as string indices

The start index of the selection can be larger than the
end index.
Take that into account when using these indices to
calculate the index and character count to copy
the relevant substring using `OUString::copy`.

Without this, running the tdf#157304 macro would trigger
an assert due to invalid indices being used.

Backtrace:

soffice.bin: .../libreoffice/sal/rtl/strtmpl.hxx:890: void 
rtl::str::newfromsubstring(rtl_tstring**, const rtl_tstring*, sal_int32, 
sal_int32) [with rtl_tstring = _rtl_ustring; sal_int32 = int]: assertion 
`false' failed.

Thread 1 "soffice.bin" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x778a814f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7785a462 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x778444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x778443d5 in __assert_fail_base
(fmt=0x779b8dc8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
assertion=assertion@entry=0x77f6f2ec "false", 
file=file@entry=0x77f6be70 ".../libreoffice/sal/rtl/strtmpl.hxx", 
line=line@entry=890, function=function@entry=0x77f6f260 "void 
rtl::str::newFromSubString(rtl_tString**, const rtl_tString*, sal_Int32, 
sal_Int32) [with rtl_tString = _rtl_uString; sal_Int32 = int]") at 
./assert/assert.c:92
#5  0x778533a2 in __assert_fail
(assertion=0x77f6f2ec "false", file=0x77f6be70 
".../libreoffice/sal/rtl/strtmpl.hxx", line=890, function=0x77f6f260 "void 
rtl::str::newFromSubString(rtl_tString**, const rtl_tString*, sal_Int32, 
sal_Int32) [with rtl_tString = _rtl_uString; sal_Int32 = int]") at 
./assert/assert.c:101
#6  0x77eee8b7 in 
rtl::str::newFromSubString<_rtl_uString>(_rtl_uString**, _rtl_uString const*, 
int, int) (ppThis=0x7fffae40, pFrom=0x5e7af450, beginIndex=6, count=-6)
at .../libreoffice/sal/rtl/strtmpl.hxx:890
#7  0x77ee91ca in rtl_uString_newFromSubString(rtl_uString**, 
rtl_uString const*, sal_Int32, sal_Int32) (ppThis=0x7fffae40, 
pFrom=0x5e7af450, beginIndex=6, count=-6)
at .../libreoffice/sal/rtl/ustring.cxx:1219
#8  0x71697b52 in rtl::OUString::copy(int, int) const 
(this=0x7fffae88, beginIndex=6, count=-6) at 
.../libreoffice/include/rtl/ustring.hxx:2229
#9  0x71814180 in 
svt::EntryImplementation::GetSelected(LineEnd) const (this=0x5ed5e660) at 
.../libreoffice/include/svtools/editbrowsebox.hxx:371
#10 0x7180d61b in FmXEditCell::getSelectedText() 
(this=0x5ed5d500) at .../libreoffice/svx/source/fmcomp/gridcell.cxx:3739
#11 0x7fffdc1496f5 in gcc3::callVirtualMethod(void*, unsigned int, 
void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, double*)
(pThis=0x5ed5d600, nVtableIndex=8, 
pRegisterReturn=0x7fffb2f0, pReturnTypeRef=0x55743db0, 
bSimpleReturn=false, pStack=0x7fffb020, nStack=0, pGPR=0x7fffb180, 
pFPR=0x7fffb1b0)
at 
.../libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:75
#12 0x7fffdc1481a0 in 
cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, 
bridges::cpp_uno::shared::VtableSlot, typelib_TypeDescriptionReference*, 
sal_Int32, typelib_MethodParameter*, void*, void**, uno_Any**)
(pThis=0x5e7b0490, aVtableSlot=..., 
pReturnTypeRef=0x55743db0, nParams=0, pParams=0x0, 
pUnoReturn=0x7fffb2f0, pUnoArgs=0x7fffb2e0, ppUnoExc=0x7fffb3d0)
at 
.../libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233
#13 0x7fffdc148cdd in 
bridges::cpp_uno::shared::unoInterfaceProxyDispatch(uno_Interface*, 
typelib_TypeDescription const*, void*, void**, uno_Any**)
(pUnoI=0x5e7b0490, pMemberDescr=0x5cc0, 
pReturn=0x7fffb2f0, pArgs=0x7fffb2e0, ppException=0x7fffb3d0) at 
.../libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413
#14 0x7fff5beb45f2 in stoc_corefl::(anonymous 
namespace)

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - comphelper/source include/comphelper

2023-09-19 Thread Michael Weghorn (via logerrit)
 comphelper/source/misc/accessiblewrapper.cxx |   25 +++--
 include/comphelper/accessiblewrapper.hxx |5 -
 2 files changed, 23 insertions(+), 7 deletions(-)

New commits:
commit ed86b56c0e0baf99ca65800eb83de1558f162734
Author: Michael Weghorn 
AuthorDate: Wed Sep 6 15:26:09 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 19 12:10:00 2023 +0200

tdf#156683 a11y: Handle both disposing variants in context wrapper

commit db0044242a897e447988169630ff74e4c8bfecf9
Author: Michael Weghorn 
Date:   Wed Sep 6 09:12:23 2023 +0200

tdf#156683 a11y: Forward when wrapped a11y context is disposing

switched from overriding `disposing()` to overriding
`disposing(const css::lang::EventObject&)` in
`OAccessibleContextWrapperHelper` in order to
make sure that the corresponding entry in the
`AccessibleEventNotifier` client map is removed and
event listeners for the wrapper get notified
(via `AccessibleEventNotifier::revokeClientNotifyDisposing`)
when the wrapped object is disposing.

As Noel points out in [1], the `disposing()`
case should probably still be overriden/handled
and make sure that the wrapped object etc. get
disposed, so disposing one object via the other
works both ways.
(If the wrapped object is disposed, so is the
wrapper. If the wrapper gets disposed, so is
the wrapped object.)

Therefore, add back `OAccessibleContextWrapper::disposing()`
and extract the logic to a separate helper method
that is called from both `disposing` variants.

[1] 
https://gerrit.libreoffice.org/c/core/+/156592/comments/bb7c24bc_94033649

Change-Id: If15fd1839b222ad94fcbc569842dc43b517d3574
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156620
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit d9e31f3c82082226dbc5afa697d0f0ac7e4214a2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156602
Reviewed-by: Xisco Fauli 

diff --git a/comphelper/source/misc/accessiblewrapper.cxx 
b/comphelper/source/misc/accessiblewrapper.cxx
index a199d82cc5de..3d7c8574e2c6 100644
--- a/comphelper/source/misc/accessiblewrapper.cxx
+++ b/comphelper/source/misc/accessiblewrapper.cxx
@@ -585,12 +585,8 @@ namespace comphelper
 }
 
 
-void SAL_CALL OAccessibleContextWrapper::disposing(const 
css::lang::EventObject& rEvent)
+void OAccessibleContextWrapper::implDisposing(const 
css::lang::EventObject* pEvent)
 {
-assert(rEvent.Source == Reference(m_xInnerContext, 
UNO_QUERY)
-   && "OAccessibleContextWrapper::disposing called with event 
source that's not the "
-  "wrapped a11y context");
-
 AccessibleEventNotifier::TClientId nClientId( 0 );
 
 // ---  -
@@ -607,12 +603,29 @@ namespace comphelper
 // ---  -
 
 // let the base class do
-OAccessibleContextWrapperHelper::disposing(rEvent);
+if (pEvent)
+OAccessibleContextWrapperHelper::disposing(*pEvent);
+else
+OAccessibleContextWrapperHelper::dispose();
 
 // notify the disposal
 if ( nClientId )
 AccessibleEventNotifier::revokeClientNotifyDisposing( nClientId, 
*this );
 }
+
+void SAL_CALL OAccessibleContextWrapper::disposing()
+{
+implDisposing(nullptr);
+}
+
+void SAL_CALL OAccessibleContextWrapper::disposing(const 
css::lang::EventObject& rEvent)
+{
+assert(rEvent.Source == Reference(m_xInnerContext, 
UNO_QUERY)
+   && "OAccessibleContextWrapper::disposing called with event 
source that's not the "
+  "wrapped a11y context");
+
+implDisposing();
+}
 }   // namespace accessibility
 
 
diff --git a/include/comphelper/accessiblewrapper.hxx 
b/include/comphelper/accessiblewrapper.hxx
index c2ababe40e1a..089c143b971f 100644
--- a/include/comphelper/accessiblewrapper.hxx
+++ b/include/comphelper/accessiblewrapper.hxx
@@ -297,8 +297,11 @@ namespace comphelper
 // OAccessibleContextWrapper
 virtual void notifyTranslatedEvent( const 
css::accessibility::AccessibleEventObject& _rEvent ) override;
 
+// helper method for both 'disposing' methods
+void implDisposing(const css::lang::EventObject* pEvent);
+
 // OComponentHelper
-using cppu::WeakComponentImplHelperBase::disposing;
+void SAL_CALL disposing() override;
 
 // XAccessibleEventListener
 virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent) 
override;


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - comphelper/source include/comphelper

2023-09-19 Thread Michael Weghorn (via logerrit)
 comphelper/source/misc/accessiblewrapper.cxx |8 ++--
 include/comphelper/accessiblewrapper.hxx |6 --
 2 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 2f1181629a0a11ecc1c6eb5d6a5f09421b14a7c3
Author: Michael Weghorn 
AuthorDate: Wed Sep 6 09:12:23 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 19 12:09:42 2023 +0200

tdf#156683 a11y: Forward when wrapped a11y context is disposing

`OAccessibleContextWrapper` wraps an `XAccessibleContext`
held in the `m_xInnerContext` member and forwards
calls to its own methods to that one.

The lifecycle of the wrapper should match that of
the wrapped context, so handle when the
wrapped context is disposing by overriding
`XAccessibleContext::disposing` (that takes
a `css::lang::EventObject&` parameter) instead of
overriding `WeakComponentImplHelperBase::disposing`
 (the `disposing` method not taking a param)
that's meant to be called when/right before the
object itself gets disposed (but wasn't called
at all e.g. for the `OToolBoxWindowItemContext`
case in tdf#156683).

This makes sure that the corresponding entry in the
`AccessibleEventNotifier` client map is removed and
event listeners for the wrapper get notified
(via `AccessibleEventNotifier::revokeClientNotifyDisposing`)
when the wrapped object is disposing and fixes the tdf#156683
crash on exit with gtk3 observed in the libreoffice-7-6 branch:

/usr/include/c++/13/debug/vector:450:
In function:
std::debug::vector<_Tp, _Allocator>::const_reference std::
debug::vector<_Tp, _Allocator>::operator[](size_type) const [with 
_Tp =

com::sun::star::uno::Reference;
_Allocator =

std::allocator
>; const_reference = const

com::sun::star::uno::Reference&;
size_type = long unsigned int]

Error: attempt to subscript container with out-of-bounds index 0, but
container only holds 0 elements.

Objects involved in the operation:
sequence "this" @ 0x561465d8e510 {
  type = 
std::debug::vector,
 
std::allocator
 > >;
}
warn:desktop:197113:197113:desktop/source/app/crashreport.cxx:61: 
minidump generated: 
/home/michi/development/git/libreoffice-WORKTREE/instdir/program/../program/../crash//e338ad13-2338-4cd0-8d5c069d-c28f5cf5.dmp

Backtrace:

1   
comphelper::OInterfaceContainerHelper4::disposeAndClear
 interfacecontainer4.hxx 397  
0x7f2c39915cdc
2   comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing

 accessibleeventnotifier.cxx 204  0x7f2c39913c75
3   comphelper::OAccessibleContextWrapper::disposing

 accessiblewrapper.cxx   610  0x7f2c3992f033
4   cppu::WeakComponentImplHelperBase::dispose  

 implbase.cxx104  0x7f2c3947491b
5   
cppu::PartialWeakComponentImplHelper::dispose compbase.hxx   
 90   0x7f2bf8b31c70
6   cppu::WeakComponentImplHelperBase::release  

 implbase.cxx79   0x7f2c39474664
7   
cppu::PartialWeakComponentImplHelper::release compbase.hxx   
 86   0x7f2c3993133c
8   comphelper::OAccessibleContextWrapper::release  

 accessiblewrapper.cxx   475  0x7f2c3992e536
9   
com::sun::star::uno::Reference::clear
 
Reference.hxx   231  0x7f2c26929685
10  atk_object_wrapper_dispose  

 atkwrapper.cxx  1074 0x7f2c26928a2e
11  atk_object_wrapper_finalize 

 atkwrapper.cxx  670  0x7f2c26927677
12  g_object_unref  

  0x7f2c3418c48c
13  AtkListener::~AtkListener   
  

[Libreoffice-commits] core.git: vcl/source

2023-09-18 Thread Michael Weghorn (via logerrit)
 vcl/source/control/edit.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b2b43e83ccc41c37bad32a4dcf07ca86bf2f8a15
Author: Michael Weghorn 
AuthorDate: Thu Sep 7 15:42:57 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Sep 18 17:04:17 2023 +0200

a11y: Call base class impl at beginning of Edit::GetFocus

Call the base class implementation `Control::GetFocus()`
(which currently is just `Window::GetFocus`) before doing
anything else, not at the end. This ensures that
a focused event is sent to the a11y layer before e.g.
adapting text selection. Assistive tooling
handles the currently focused object with
special interest (and announces events on that
object much more likely than for any other objects).

This e.g. makes Orca announce the labels for the
spinboxes (like "Width", "Height", "Left", "Right")
in Writer's "Format" -> "Page Style" dialog -> "Page"
page when using the qt6 VCL plugin.

Previously, only the current value
of the spinboxes was announced without the label
when moving focus into one of them
using the Tab key.

The following 2 Orca commits [1] [2] in the
LibreOffice-specific Orca code look related:

commit c4c5d11656ec7221e4aa4b980e51c010dcc62674
Author: Joanmarie Diggs 
Date:   Mon Aug 7 13:53:41 2017 -0400

Work around event-ordering issue in LibreOffice

commit 38b995d9bacc55bb455c4464b01c82b885ed5549
Author: Joanmarie Diggs 
Date:   Fri Feb 15 09:40:07 2019 -0500

Don't present locusOfFocus changes due to text-selection-changed 
events

(The first one makes the object sending a
text-selection-changed event the focus object in Orca,
the second one then causes this implicit focus object
to no longer be announced. And when LO itself sends
the focused event for the object, the object is already
considered as the focus object, i.e. not announced
either because the assumption is that the focus hasn't
changed.)

If the new event order causes any issues elsewhere because
other places depend on the previous order, that will have to
be looked into individually, s.a. the discussion in the
Gerrit change for some thoughts on that [3].

[1] 
https://gitlab.gnome.org/GNOME/orca/-/commit/c4c5d11656ec7221e4aa4b980e51c010dcc62674
[2] 
https://gitlab.gnome.org/GNOME/orca/-/commit/38b995d9bacc55bb455c4464b01c82b885ed5549
[3] https://gerrit.libreoffice.org/c/core/+/156679

Change-Id: Ib0188fe206a49c9052ec9694bafd451586ff0b9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156679
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 92c03118727c..0e75dc36b91c 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1839,6 +1839,8 @@ void Edit::ImplInvalidateOutermostBorder( vcl::Window* 
pWin )
 
 void Edit::GetFocus()
 {
+Control::GetFocus();
+
 if ( mpSubEdit )
 mpSubEdit->ImplGrabFocus( GetGetFocusFlags() );
 else if ( !mbActivePopup )
@@ -1882,8 +1884,6 @@ void Edit::GetFocus()
 
 SetInputContext( InputContext( GetFont(), !IsReadOnly() ? 
InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) 
);
 }
-
-Control::GetFocus();
 }
 
 void Edit::LoseFocus()


[Libreoffice-commits] core.git: include/svtools

2023-09-18 Thread Michael Weghorn (via logerrit)
 include/svtools/editbrowsebox.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 489985a6fbba71f74ea343c4162d599eacb9c7d0
Author: Michael Weghorn 
AuthorDate: Mon Sep 18 14:29:29 2023 +0300
Commit: Michael Weghorn 
CommitDate: Mon Sep 18 17:03:44 2023 +0200

tdf#157304 Use normalized selection indices as string indices

The start index of the selection can be larger than the
end index.
Take that into account when using these indices to
calculate the index and character count to copy
the relevant substring using `OUString::copy`.

Without this, running the tdf#157304 macro would trigger
an assert due to invalid indices being used.

Backtrace:

soffice.bin: .../libreoffice/sal/rtl/strtmpl.hxx:890: void 
rtl::str::newfromsubstring(rtl_tstring**, const rtl_tstring*, sal_int32, 
sal_int32) [with rtl_tstring = _rtl_ustring; sal_int32 = int]: assertion 
`false' failed.

Thread 1 "soffice.bin" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x778a814f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7785a462 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x778444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x778443d5 in __assert_fail_base
(fmt=0x779b8dc8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
assertion=assertion@entry=0x77f6f2ec "false", 
file=file@entry=0x77f6be70 ".../libreoffice/sal/rtl/strtmpl.hxx", 
line=line@entry=890, function=function@entry=0x77f6f260 "void 
rtl::str::newFromSubString(rtl_tString**, const rtl_tString*, sal_Int32, 
sal_Int32) [with rtl_tString = _rtl_uString; sal_Int32 = int]") at 
./assert/assert.c:92
#5  0x778533a2 in __assert_fail
(assertion=0x77f6f2ec "false", file=0x77f6be70 
".../libreoffice/sal/rtl/strtmpl.hxx", line=890, function=0x77f6f260 "void 
rtl::str::newFromSubString(rtl_tString**, const rtl_tString*, sal_Int32, 
sal_Int32) [with rtl_tString = _rtl_uString; sal_Int32 = int]") at 
./assert/assert.c:101
#6  0x77eee8b7 in 
rtl::str::newFromSubString<_rtl_uString>(_rtl_uString**, _rtl_uString const*, 
int, int) (ppThis=0x7fffae40, pFrom=0x5e7af450, beginIndex=6, count=-6)
at .../libreoffice/sal/rtl/strtmpl.hxx:890
#7  0x77ee91ca in rtl_uString_newFromSubString(rtl_uString**, 
rtl_uString const*, sal_Int32, sal_Int32) (ppThis=0x7fffae40, 
pFrom=0x5e7af450, beginIndex=6, count=-6)
at .../libreoffice/sal/rtl/ustring.cxx:1219
#8  0x71697b52 in rtl::OUString::copy(int, int) const 
(this=0x7fffae88, beginIndex=6, count=-6) at 
.../libreoffice/include/rtl/ustring.hxx:2229
#9  0x71814180 in 
svt::EntryImplementation::GetSelected(LineEnd) const (this=0x5ed5e660) at 
.../libreoffice/include/svtools/editbrowsebox.hxx:371
#10 0x7180d61b in FmXEditCell::getSelectedText() 
(this=0x5ed5d500) at .../libreoffice/svx/source/fmcomp/gridcell.cxx:3739
#11 0x7fffdc1496f5 in gcc3::callVirtualMethod(void*, unsigned int, 
void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, double*)
(pThis=0x5ed5d600, nVtableIndex=8, 
pRegisterReturn=0x7fffb2f0, pReturnTypeRef=0x55743db0, 
bSimpleReturn=false, pStack=0x7fffb020, nStack=0, pGPR=0x7fffb180, 
pFPR=0x7fffb1b0)
at 
.../libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:75
#12 0x7fffdc1481a0 in 
cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, 
bridges::cpp_uno::shared::VtableSlot, typelib_TypeDescriptionReference*, 
sal_Int32, typelib_MethodParameter*, void*, void**, uno_Any**)
(pThis=0x5e7b0490, aVtableSlot=..., 
pReturnTypeRef=0x55743db0, nParams=0, pParams=0x0, 
pUnoReturn=0x7fffb2f0, pUnoArgs=0x7fffb2e0, ppUnoExc=0x7fffb3d0)
at 
.../libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233
#13 0x7fffdc148cdd in 
bridges::cpp_uno::shared::unoInterfaceProxyDispatch(uno_Interface*, 
typelib_TypeDescription const*, void*, void**, uno_Any**)
(pUnoI=0x5e7b0490, pMemberDescr=0x5cc0, 
pReturn=0x7fffb2f0, pArgs=0x7fffb2e0, ppException=0x7fffb3d0) at 
.../libreoffice/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413
#14 0x7fff5beb45f2 in stoc_corefl::(anonymous 
names

Re: New tests: GTK3 platform accessibility

2023-09-18 Thread Michael Weghorn

On 2023-09-14 11:05, Colomban Wendling wrote:
I'm on vacation this week, but could give this another try in my 
Fedora VM sometime afterwards. Or, if you're also attending 
LibreOffice conference next week in person, we could also take a look 
at it together then for example.


I'll be there, we can indeed try and pull some hairs together on this 
then :)


Great! :)


OpenPGP_signature.asc
Description: OpenPGP digital signature


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 2 commits - accessibility/inc accessibility/source

2023-09-14 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessiblelist.hxx|2 -
 accessibility/source/standard/vclxaccessiblelist.cxx |   28 ++-
 2 files changed, 16 insertions(+), 14 deletions(-)

New commits:
commit 5587c422fa0f8f93849cb2eabbf5594e11819b50
Author: Michael Weghorn 
AuthorDate: Mon Sep 4 17:19:03 2023 +0200
Commit: Michael Stahl 
CommitDate: Thu Sep 14 18:23:19 2023 +0200

tdf#157088 a11y: Dispose list items with list

Don't only clear, but also dispose the
list items when the `VCLXAccessibleList`
gets disposed.

Interestingly, there was already a comment
saying

// Dispose all items in the list.

, but that wasn't done so far...

Fixes a crash on exit with the below backtrace
after using the font color toolbox item with
the qt6 VCL plugin and Orca running:

1  __pthread_kill_implementation  pthread_kill.c  44  0x7fe2a2ea80fc
2  __pthread_kill_internalpthread_kill.c  78  0x7fe2a2ea815f
3  __GI_raise raise.c 26  0x7fe2a2e5a472
4  __GI_abort abort.c 79  0x7fe2a2e444b2
5  __assert_fail_base assert.c92  0x7fe2a2e443d5
6  __assert_fail  assert.c101 0x7fe2a2e533a2
7  (anonymous namespace)::implLookupClient
accessibleeventnotifier.cxx 140 0x7fe2a21138a4
8  comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing   
accessibleeventnotifier.cxx 185 0x7fe2a2113bb8
9  VCLXAccessibleListItem::disposing  vclxaccessiblelistitem.cxx  164 
0x7fe26870cb58
10 cppu::WeakAggComponentImplHelperBase::dispose  implbase.cxx230 
0x7fe2a1c755e3
11 cppu::WeakAggComponentImplHelperBase::release  implbase.cxx204 
0x7fe2a1c75312
12 
cppu::WeakAggComponentImplHelper6::release compbase6.hxx   142 0x7fe26870fc0c
13 
com::sun::star::uno::Reference::~Reference
 Reference.hxx   114 0x7fe28f2428a7
14 QtAccessibleWidget::~QtAccessibleWidgetQtAccessibleWidget.hxx  
39  0x7fe28f262cf9
15 QtAccessibleWidget::~QtAccessibleWidgetQtAccessibleWidget.hxx  
39  0x7fe28f262dd0
16 QAccessibleCache::deleteInterface  qaccessiblecache.cpp173 
0x7fe28e0c8e4b
17 QAccessibleCache::~QAccessibleCacheqaccessiblecache.cpp31  
0x7fe28e0c845c
18 QAccessibleCache::~QAccessibleCacheqaccessiblecache.cpp32  
0x7fe28e0c84e2
19 cleanupAccessibleCache qaccessiblecache.cpp24  0x7fe28e0c83c8
20 qt_call_post_routines  qcoreapplication.cpp327 0x7fe28e9a4593
21 QApplication::~QApplicationqapplication.cpp663 0x7fe28cf9dff6
22 QApplication::~QApplicationqapplication.cpp717 0x7fe28cf9e2f4
23 std::default_delete::operator()  unique_ptr.h99  
0x7fe28f2cf3ae
24 std::__uniq_ptr_impl>::reset   unique_ptr.h211 0x7fe28f2cf7f6
25 std::unique_ptr>::resetunique_ptr.h509 0x7fe28f2cd72d
26 QtInstance::~QtInstanceQtInstance.cxx  273 0x7fe28f2c614f
27 QtInstance::~QtInstanceQtInstance.cxx  274 0x7fe28f2c6226
28 DestroySalInstance salplug.cxx 389 0x7fe299a62611
29 DeInitVCL  svmain.cxx  600 0x7fe299b41226
30 ImplSVMain svmain.cxx  229 0x7fe299b3f9f7
31 SVMain svmain.cxx  236 0x7fe299b3fa53
32 soffice_main   sofficemain.cxx 94  0x7fe2a30a1b5d
33 sal_main   main.c  51  0x55c86565c9d4
34 main   main.c  49  0x55c86565c9ba

Change-Id: I42ddcf5501ddfb363aeae10a86f1c38251e6793b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156522
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 51de048ae97cbd371457dbc07120e30db9ee4187)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156537
Reviewed-by: Michael Stahl 

diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index 57f9b1eabcb3..101c5815c0ac 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -107,6 +108,8 @@ void SAL_CALL VCLXAccessibleList::disposing()
 VCLXAccessibleComponent::disposing();
 
 // Dispose all items in the list.
+for (Reference& rxChild : m_aAccessibleChildren)
+comphelper::disposeComponent(rxChild);
 
 m_aAccessibleChildren.clear();
 
commit f1df57c29aacdd7f56ecd33976c8a6bf6858b918
Author:     Michael Weghorn 
AuthorDate: Mon Sep 4 17:03:47 2023 +0200
Commit: Michael Stahl 
CommitDate: Thu Sep 14 18:23:08 2023 +0200

tdf#157088 a11y: No need to use WeakReference for list children

`VCLXAccessibleList` is the owner of the
`VCLXAccessibleListItem`s held in that vector,
so I see no reason to hold them by weak reference,
which according to the doc in
`udkapi/com/sun/star/uno/XWeak.idl` is to avoid
   

Re: New tests: GTK3 platform accessibility

2023-09-13 Thread Michael Weghorn

On 2023-09-12 10:49, Colomban Wendling wrote:

All that is a bit confusing to me, but let me try ton understand:
- On a system using dbus-broker, when logged in under GNOME, test fails?
- On *the same system*, but logging-in through SSH works!??


Yes, that's what I've observed in a Fedora 38 VM.

That's worrying, as it suggests the running environment has too much 
influence on the test run, which is not good.


However, IIUC you suggest it might be a dbus/dbus-borken conflict 
somehow?


That's what it looked like to me during first analysis.

What might be happening is that at-spi-bus-launcher detects a systemd 
environment that makes it think running dbus-broker should work, but 
something about the systemd/D-Bus environment in the virtual X session 
provided by xfvb-run and dbus-launch doesn't match what's expected/required.


See also this comment in the at-spi-bus-launcher source code [1]:

  /* This detects whether we are running under systemd. We only try to
   * use dbus-broker if we are running under systemd because D-Bus
   * service activation won't work otherwise.
   */

The following sample program, based on the at-spi-bus-launcher-code, 
could explain why the SSH case works: The "systemd, use dbus-broker" 
case is triggered for me on Debian testing in a KDE Plasma X11 session 
(and probably the same way for a Fedora 38 GNOME session), but not in an 
SSH session ("no systemd, don't use dbus-broker").



---

// build: g++ -o test test.cxx -lsystemd

#include 
#include 
#include 

int main()
{

// s. 
https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/e7310f8a57cf9d9744f68059fad451cb3acd116a/bus/at-spi-bus-launcher.c#L453-460

char* unit;
if (sd_pid_get_user_unit (getpid (), ) >= 0)
std::cout << "systemd, use dbus-broker" << std::endl;
else
std::cout << "no systemd, don't use dbus-broker" << std::endl;
}

---

What if we try `dbus-broker-launch` (assuming it's compatible) 
instead of `dbus-launch` if the former is available? 
Would that help?



As Stephan mentioned already, it's not compatible as a drop-in-replacement.

Maybe this more complicated way mentioned in the Github discussion I 
mentioned earlier could work:


Question [2]:

"What is the recommended way to run a nested dbus session, if not by 
using dbus-run-session? I mostly use it to run debug instances of GNOME 
Shell, as well as the for the CI pipeline when running inside Docker."

Answer (next comment):

"We don't have a recommended way to do that. If that functionality is
needed, it should be straightforward to achieve by just invoking your
private instance of `dbus-broker-launch`. Socket-activation for the
listener-socket is mandatory, though. So I would imagine creating
`dbus-broker@.socket` and `dbus-broker@.service` as systemd template
units, which take a path as template-argument where to place the socket.
It should then be as simple as `systemctl start
dbus-broker@foobar.service` to get it up and running.

If, however, you intend to integrate it into a test-suite, I would
rather expect the test-suite to create the listener manually and pass it
through `execve(2)` to `dbus-broker-launch`."

I don't have any system to test this with yet, and it might take some 
time before I can have a F38 VM up and running with a LO build setup, 
but I'll try and see to this soon if it's a concern.


I'm on vacation this week, but could give this another try in my Fedora 
VM sometime afterwards. Or, if you're also attending LibreOffice 
conference next week in person, we could also take a look at it together 
then for example.



[1] 
https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/e7310f8a57cf9d9744f68059fad451cb3acd116a/bus/at-spi-bus-launcher.c#L453-460

[2] https://github.com/bus1/dbus-broker/issues/145#issuecomment-437874214


OpenPGP_signature.asc
Description: OpenPGP digital signature


[Libreoffice-commits] core.git: svtools/source

2023-09-09 Thread Michael Weghorn (via logerrit)
 svtools/source/control/valueacc.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7737dab14baea000810965c572f06a10a94f73df
Author: Michael Weghorn 
AuthorDate: Sat Sep 9 22:22:09 2023 +0300
Commit: Michael Weghorn 
CommitDate: Sun Sep 10 07:09:14 2023 +0200

tdf#157160 a11y: Don't assert ValueSetAcc parent on add/remove

After

commit 2f5e7a07775690e57d639eeca7a1e41733fa93a9
Author: Michael Weghorn 
Date:   Thu Sep 7 08:09:31 2023 +0200

tdf#157092 a11y Let only drawing area dispose its ValueSet acc

had fixed a crash when using the search feature with the Qt-based
VCL plugins, the previous `DBG_ASSERT` that got promoted to a
real assert with the above commit got triggered now that a11y CHILD
events for removed children are handled since

commit be8b031d8b3c66b223ea2478f1129427f3a362bd
Author: Michael Weghorn 
Date:   Thu Sep 7 09:51:38 2023 +0200

qt a11y: Forward CHILD event for removed child

, s. the backtrace in tdf#157160.

Since the ValueSet isn't needed for this, and at least removing
a listener after the ValueSet has been dropped even seems logical if it's
a valid use case to delete the ValueSet before e.g. hiding the
window (s.a. comment in above-mentioned
2f5e7a07775690e57d639eeca7a1e41733fa93a9), don't check for it,
but only that the object hasn't been disposed yet
(as was effectively the case before
2f5e7a07775690e57d639eeca7a1e41733fa93a9, when
only a SAL_WARN would have been triggered).

Change-Id: I5be0a44decbe4508f4a419ec3dca9f8aaf85e951
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156782
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 2f897ae015ce..57c1777d4800 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -632,7 +632,7 @@ lang::Locale SAL_CALL ValueSetAcc::getLocale()
 
 void SAL_CALL ValueSetAcc::addAccessibleEventListener( const uno::Reference< 
accessibility::XAccessibleEventListener >& rxListener )
 {
-ThrowIfDisposed();
+ThrowIfDisposed(false);
 std::unique_lock aGuard (m_aMutex);
 
 if( !rxListener.is() )
@@ -656,7 +656,7 @@ void SAL_CALL ValueSetAcc::addAccessibleEventListener( 
const uno::Reference< acc
 
 void SAL_CALL ValueSetAcc::removeAccessibleEventListener( const 
uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
 {
-ThrowIfDisposed();
+ThrowIfDisposed(false);
 std::unique_lock aGuard (m_aMutex);
 
 if( rxListener.is() )


[Libreoffice-commits] core.git: Branch 'feature/cib_contract891c' - 3 commits - configure.ac solenv/bin sysui/CustomTarget_deb.mk sysui/CustomTarget_rpm.mk sysui/CustomTarget_solaris.mk

2023-09-08 Thread Michael Weghorn (via logerrit)
 configure.ac  |9 ++
 solenv/bin/modules/installer/download.pm  |   37 +-
 solenv/bin/modules/installer/epmfile.pm   |   19 ++---
 solenv/bin/modules/installer/simplepackage.pm |   10 ++-
 sysui/CustomTarget_deb.mk |7 ++--
 sysui/CustomTarget_rpm.mk |2 -
 sysui/CustomTarget_solaris.mk |2 -
 7 files changed, 35 insertions(+), 51 deletions(-)

New commits:
commit 55200cee2ff3229bc32323eb74501b62b370b419
Author: Michael Weghorn 
AuthorDate: Thu Feb 15 16:37:23 2018 +0100
Commit: Vasily Melenchuk 
CommitDate: Fri Sep 8 12:06:04 2023 +0300

tdf#115554: Fix ownership in desktop-integration tars

Use fakeroot to call tar when creating the tar.gz archives
holding the desktop-integration parts to have root:root
as owner of the files inside those.

Change-Id: Idcdcb4dd398f330773671266dafb354711b0f093
Reviewed-on: https://gerrit.libreoffice.org/49827
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 
Reviewed-by: Thorsten Behrens 

diff --git a/sysui/CustomTarget_deb.mk b/sysui/CustomTarget_deb.mk
index dd75ee913c62..92cda34a3bfe 100644
--- a/sysui/CustomTarget_deb.mk
+++ b/sysui/CustomTarget_deb.mk
@@ -25,7 +25,7 @@ $(foreach product,$(PRODUCTLIST),\
 ))
 
 $(deb_WORKDIR)/%-desktop-integration.tar.gz: 
$(deb_WORKDIR)/%$(PKGVERSIONSHORT)-debian-menus_$(PKGVERSION)-$(LIBO_VERSION_PATCH)_all.deb
-   $(GNUTAR) -C $(deb_WORKDIR) -cf - $(notdir $<) | gzip > $@
+   fakeroot $(GNUTAR) -C $(deb_WORKDIR) -cf - $(notdir $<) | gzip > $@
 
 $(deb_WORKDIR)/%/DEBIAN/postrm: $(deb_SRCDIR)/postrm
cat $< | tr -d "\015" | \
diff --git a/sysui/CustomTarget_rpm.mk b/sysui/CustomTarget_rpm.mk
index 8cc56ed80e34..a76b4161e2af 100644
--- a/sysui/CustomTarget_rpm.mk
+++ b/sysui/CustomTarget_rpm.mk
@@ -54,6 +54,6 @@ $(foreach product,$(PRODUCTLIST),\
 ))
 
 $(rpm_WORKDIR)/%-desktop-integration.tar.gz:
-   $(GNUTAR) -C $(rpm_WORKDIR)/$* -cf - $(foreach 
distro,$(RPMDISTROS),$*$(PKGVERSIONSHORT)-$(distro)-menus-$(PKGVERSION)-$(LIBO_VERSION_PATCH).noarch.rpm)
 | gzip > $@
+   fakeroot $(GNUTAR) -C $(rpm_WORKDIR)/$* -cf - $(foreach 
distro,$(RPMDISTROS),$*$(PKGVERSIONSHORT)-$(distro)-menus-$(PKGVERSION)-$(LIBO_VERSION_PATCH).noarch.rpm)
 | gzip > $@
 
 # vim: set noet sw=4 ts=4:
diff --git a/sysui/CustomTarget_solaris.mk b/sysui/CustomTarget_solaris.mk
index ed264fe95960..306a30429174 100644
--- a/sysui/CustomTarget_solaris.mk
+++ b/sysui/CustomTarget_solaris.mk
@@ -50,6 +50,6 @@ $(solaris_WORKDIR)/%/prototype: $(solaris_SRCDIR)/prototype
 
 $(solaris_WORKDIR)/%-desktop-integration.tar.gz: 
$(solaris_WORKDIR)/%/copyright $(solaris_WORKDIR)/%/pkginfo 
$(solaris_WORKDIR)/%/depend $(solaris_WORKDIR)/%/mailcap 
$(solaris_WORKDIR)/%/postinstall $(solaris_WORKDIR)/%/postremove 
$(solaris_WORKDIR)/%/prototype $(call 
gb_CustomTarget_get_workdir,sysui/share)/%/openoffice.org.xml
 #  pkgmk -l 1073741824 -r $(solaris_WORKDIR) -f 
$(solaris_WORKDIR)/$*/prototype -o -d $(solaris_WORKDIR) ARCH=all 
VERSION=$(PKGVERSION.$*)
-   $(GNUTAR) -cf - -C $(solaris_WORKDIR) $*$(LIBO_MAJOR) -desktop-int | 
gzip > $@
+   fakeroot $(GNUTAR) -cf - -C $(solaris_WORKDIR) $*$(LIBO_MAJOR) 
-desktop-int | gzip > $@
 
 # vim: set noet sw=4 ts=4:
commit 4debe1fe558ae23e13a65dc79ef78ae600a231a5
Author: Michael Weghorn 
AuthorDate: Tue Feb 13 20:29:10 2018 +0100
Commit: Vasily Melenchuk 
CommitDate: Fri Sep 8 12:04:05 2023 +0300

tdf#115554:  Create tar archives using 'fakeroot'

'tar' must be run as root or faked to be run as root,
to make sure that file ownerships and permissions inside
the created tar archives are as desired (root:root).

Have fakeroot take care about creating an appropriate
environment rather than using the custom "libgetuid",
to no longer have to care about tar internals by ourselves.

This fixes the problem that file ownerships are incorrect
when tar version >= 1.24 is used for

* tar archives holding all the generated deb/rpm packages
  (created in 'download.pm')
* tar archives created by using the
  '--with-pacakage-format=archive' autogen option
  (created in 'simplepackage.pm')

Change-Id: Id20ccce4d002ff95c75292eda8080ca299eee3a5
Reviewed-on: https://gerrit.libreoffice.org/49682
Reviewed-by: Michael Stahl 
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/configure.ac b/configure.ac
index 94a65c0c0d9a..d81ed648bae7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4457,6 +4457,15 @@ msi - Windows .msi
 ;;
 esac
 done
+# fakeroot is needed to ensure correct file ownerships/permissions
+# inside deb packages and tar archives created on Linux and Solaris.
+if test "$OS" = "LINUX" ||

[Libreoffice-commits] core.git: accessibility/source

2023-09-07 Thread Michael Weghorn (via logerrit)
 accessibility/source/standard/vclxaccessiblelist.cxx |   28 +--
 1 file changed, 20 insertions(+), 8 deletions(-)

New commits:
commit f6a6b1454c7c765c0fc2ef9dc3e6111509a88307
Author: Michael Weghorn 
AuthorDate: Thu Sep 7 14:08:57 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Sep 7 21:02:48 2023 +0200

tdf#157137 a11y: Don't report active descendant when not focused

Since an active descendant is the UI element with keyboard focus,
only send an `ACTIVE_DESCENDANT_CHANGED` event in `VCLXAccessibleList`
if the listbox/combobox actually has focus, not when the selection
changed otherwise, e.g. because the value was changed programmatically
because it depends on another UI control (like the paper size
in the print dialog depends on the selected printer.

Change-Id: I008e742ccf3b81c70832707b2f3a6551827a0706
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/15
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index 67061aac3ab0..62ac35a82aff 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -251,6 +251,12 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
 }
 }
 
+// since an active descendant is the UI element with keyboard focus, only 
send
+// ACTIVE_DESCENDANT_CHANGED if the listbox/combobox has focus
+vcl::Window* pWindow = GetWindow();
+assert(pWindow);
+const bool bFocused = pWindow->HasChildPathFocus();
+
 if (m_aBoxType == COMBOBOX)
 {
 //VCLXAccessibleDropDownComboBox
@@ -259,10 +265,13 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
 {
 if ( aNewValue.hasValue() || aOldValue.hasValue() )
 {
-NotifyAccessibleEvent(
-AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
-aOldValue,
-aNewValue );
+if (bFocused)
+{
+NotifyAccessibleEvent(
+AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+aOldValue,
+aNewValue );
+}
 
 NotifyListItem(aNewValue);
 }
@@ -277,10 +286,13 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
 {
 if ( aNewValue.hasValue() || aOldValue.hasValue() )
 {
-NotifyAccessibleEvent(
-AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
-aOldValue,
-aNewValue );
+if (bFocused)
+{
+NotifyAccessibleEvent(
+AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+aOldValue,
+aNewValue );
+}
 
 NotifyListItem(aNewValue);
 }


[Libreoffice-commits] core.git: vcl/qt5

2023-09-07 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtAccessibleEventListener.cxx |   12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit be8b031d8b3c66b223ea2478f1129427f3a362bd
Author: Michael Weghorn 
AuthorDate: Thu Sep 7 09:51:38 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Sep 7 13:24:08 2023 +0200

qt a11y: Forward CHILD event for removed child

No longer comment out the code to send a
`QAccessible::ObjectDestroyed` event when
receiving an `AccessibleEventId::CHILD` event with
its `OldValue` set.

The underlying issues causing crashes previously seem
to be fixed, I can no longer reproduce these on Debian
testing with Orca 44.1-2 when using the font color
popup as described in

commit 734d10ed3612d75edcee145475ddd0b0165efeac
Author: Michael Weghorn 
Date:   Fri Apr 14 16:57:09 2023 +0300

qt a11y: Send QAccessible::ObjectCreated event for correct object

> Adapting this for the case where a child has
> been removed (bridged to Qt as `QAccessible::ObjectDestroyed`
> event) would currently results in crashes when closing the
> application e.g. after using the character font color popup in
> the Writer toolbar. This needs further investigation, so don't
> send the event for now, but add a `SAL_WARN`.

Change-Id: Ib8f21850dd56645cf64a74be0e1ff8242615b928
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156647
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtAccessibleEventListener.cxx 
b/vcl/qt5/QtAccessibleEventListener.cxx
index 951286a6c1c1..c5d64d4650ed 100644
--- a/vcl/qt5/QtAccessibleEventListener.cxx
+++ b/vcl/qt5/QtAccessibleEventListener.cxx
@@ -216,16 +216,8 @@ void QtAccessibleEventListener::notifyEvent(const 
css::accessibility::Accessible
 }
 if (aEvent.OldValue >>= xChild)
 {
-// Forwarding as QAccessible::ObjectDestroyed event currently 
results in crashes on close
-// e.g. after using the character font color popup in the 
Writer toolbar, which
-// needs further investigation, so don't send the event for 
now.
-/*
-QAccessible::updateAccessibility(
-new 
QAccessibleEvent(QtAccessibleRegistry::getQObject(xChild), 
QAccessible::ObjectDestroyed));
-*/
-SAL_WARN("vcl.qt",
- "Not forwarding AccessibleEventId::CHILD event for 
removed child "
- "since it may cause crashes.");
+QAccessible::updateAccessibility(new QAccessibleEvent(
+QtAccessibleRegistry::getQObject(xChild), 
QAccessible::ObjectDestroyed));
 return;
 }
 SAL_WARN("vcl.qt",


[Libreoffice-commits] core.git: svtools/source

2023-09-07 Thread Michael Weghorn (via logerrit)
 svtools/source/control/valueacc.cxx |   20 
 svtools/source/control/valueimp.hxx |8 +++-
 svtools/source/control/valueset.cxx |2 +-
 3 files changed, 20 insertions(+), 10 deletions(-)

New commits:
commit 2f5e7a07775690e57d639eeca7a1e41733fa93a9
Author: Michael Weghorn 
AuthorDate: Thu Sep 7 08:09:31 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Sep 7 13:13:18 2023 +0200

tdf#157092 a11y Let only drawing area dispose its ValueSet acc

Don't dispose the a11y object in the `ValueSet` dtor, because it
doesn't own its a11y object, but it is owned by the `weld::DrawingArea`
of the `CustomWeld` that the `ValueSet` (as a sub-class of
`CustomWidgetController`) belongs to.

The `CustomWeld` ctor passes the a11y ref retrieved by
`CustomWidgetController::createAccessible` to `weld_drawing_area`,
which takes ownership and disposes the object.
(For Gtk, see  `GtkInstanceDrawingArea::~GtkInstanceDrawingArea`.
For non-Gtk, see how the `SalInstanceDrawingArea` ctor
passes the reference to `VclInstanceDrawingArea::SetAccessible`/
`vcl::Window::SetAccessible`, so it gets disposed when that
`VclInstanceDrawingArea` gets disposed, s. `vcl::Window::dispose`.)

Other classes derived from `CustomWidgetController`
also don't dispose the a11y object themselves.

Still reset the `ValueSet` pointer in `ValueSetAcc` to
nullptr when the `ValueSet` gets destroyed and turn the
check for a valid pointer from just an `OSL_ASSERT`
to a real assert and throwing a `RuntimeException`.
But still allow getting the a11y context when only
the ValueSet has been deleted but the object has not
been disposed yet.

Fixes a crash due to a `com::sun::star::lang::DisposedException`
being thrown when using the new search feature in the "Tools" ->
"Options" dialog (or when just switching to the "LibreOfficeDev
Writer/Web" -> "Background" page with the qt6 VCL plugin or
on Windows when the NVDA screen reader is running.

This happens when the drawing area is hidden and the a11y layer
is meant to be notified about this (so the a11y object can be
removed).

It still seems a bit odd that the `ValueSet` gets destroyed
(in `SvxColorTabPage::~SvxColorTabPage`, frame 20 in below backtrace)
before the corresponding `vcl::Window` gets hidden (in the base
class dtor, `SfxTabPage::~SfxTabPage`, s. frame 19 in the backtrace).

Backtrace for how the exception gets thrown:

1   com::sun::star::lang::DisposedException::DisposedException  
 DisposedException.hpp   40   0x7fa385fd9ca9
2   ValueSetAcc::ThrowIfDisposed
 valueacc.cxx956  0x7fa385fd9342
3   ValueSetAcc::getAccessibleContext   
 valueacc.cxx473  0x7fa385fd69fa
4   VCLXAccessibleComponent::ProcessWindowChildEvent
 vclxaccessiblecomponent.cxx 186  0x7fa3853dc905
5   VCLXAccessibleComponent::WindowChildEventListener   
 vclxaccessiblecomponent.cxx 124  0x7fa3853dc51d
6   VCLXAccessibleComponent::LinkStubWindowChildEventListener   
 vclxaccessiblecomponent.cxx 114  0x7fa3853dc43f
7   Link::Call   
 link.hxx111  0x7fa382c56ccf
8   vcl::Window::CallEventListeners 
 event.cxx   296  0x7fa382c53e5b
9   vcl::Window::ImplResetReallyVisible 
 stacking.cxx719  0x7fa382b51a49
10  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
11  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
12  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
13  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
14  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
15  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
16  vcl::Window::Show   
 window.cxx  2234 0x7fa382d94f7c
17  vcl::Window::Hide   
 window.hxx  880  0x7fa382b23600
18  SalInstanceContainer::move  
 salvtables.cxx  1352 0x7f

[Libreoffice-commits] core.git: comphelper/source include/comphelper

2023-09-06 Thread Michael Weghorn (via logerrit)
 comphelper/source/misc/accessiblewrapper.cxx |   25 +++--
 include/comphelper/accessiblewrapper.hxx |5 -
 2 files changed, 23 insertions(+), 7 deletions(-)

New commits:
commit d9e31f3c82082226dbc5afa697d0f0ac7e4214a2
Author: Michael Weghorn 
AuthorDate: Wed Sep 6 15:26:09 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 6 20:24:16 2023 +0200

tdf#156683 a11y: Handle both disposing variants in context wrapper

commit db0044242a897e447988169630ff74e4c8bfecf9
Author: Michael Weghorn 
Date:   Wed Sep 6 09:12:23 2023 +0200

tdf#156683 a11y: Forward when wrapped a11y context is disposing

switched from overriding `disposing()` to overriding
`disposing(const css::lang::EventObject&)` in
`OAccessibleContextWrapperHelper` in order to
make sure that the corresponding entry in the
`AccessibleEventNotifier` client map is removed and
event listeners for the wrapper get notified
(via `AccessibleEventNotifier::revokeClientNotifyDisposing`)
when the wrapped object is disposing.

As Noel points out in [1], the `disposing()`
case should probably still be overriden/handled
and make sure that the wrapped object etc. get
disposed, so disposing one object via the other
works both ways.
(If the wrapped object is disposed, so is the
wrapper. If the wrapper gets disposed, so is
the wrapped object.)

Therefore, add back `OAccessibleContextWrapper::disposing()`
and extract the logic to a separate helper method
that is called from both `disposing` variants.

[1] 
https://gerrit.libreoffice.org/c/core/+/156592/comments/bb7c24bc_94033649

Change-Id: If15fd1839b222ad94fcbc569842dc43b517d3574
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156620
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/comphelper/source/misc/accessiblewrapper.cxx 
b/comphelper/source/misc/accessiblewrapper.cxx
index bd66b7534d46..3e356f434faa 100644
--- a/comphelper/source/misc/accessiblewrapper.cxx
+++ b/comphelper/source/misc/accessiblewrapper.cxx
@@ -585,12 +585,8 @@ namespace comphelper
 }
 
 
-void SAL_CALL OAccessibleContextWrapper::disposing(const 
css::lang::EventObject& rEvent)
+void OAccessibleContextWrapper::implDisposing(const 
css::lang::EventObject* pEvent)
 {
-assert(rEvent.Source == Reference(m_xInnerContext, 
UNO_QUERY)
-   && "OAccessibleContextWrapper::disposing called with event 
source that's not the "
-  "wrapped a11y context");
-
 AccessibleEventNotifier::TClientId nClientId( 0 );
 
 // ---  -
@@ -607,12 +603,29 @@ namespace comphelper
 // ---  -
 
 // let the base class do
-OAccessibleContextWrapperHelper::disposing(rEvent);
+if (pEvent)
+OAccessibleContextWrapperHelper::disposing(*pEvent);
+else
+OAccessibleContextWrapperHelper::dispose();
 
 // notify the disposal
 if ( nClientId )
 AccessibleEventNotifier::revokeClientNotifyDisposing( nClientId, 
*this );
 }
+
+void SAL_CALL OAccessibleContextWrapper::disposing()
+{
+implDisposing(nullptr);
+}
+
+void SAL_CALL OAccessibleContextWrapper::disposing(const 
css::lang::EventObject& rEvent)
+{
+assert(rEvent.Source == Reference(m_xInnerContext, 
UNO_QUERY)
+   && "OAccessibleContextWrapper::disposing called with event 
source that's not the "
+  "wrapped a11y context");
+
+implDisposing();
+}
 }   // namespace accessibility
 
 
diff --git a/include/comphelper/accessiblewrapper.hxx 
b/include/comphelper/accessiblewrapper.hxx
index c2ababe40e1a..089c143b971f 100644
--- a/include/comphelper/accessiblewrapper.hxx
+++ b/include/comphelper/accessiblewrapper.hxx
@@ -297,8 +297,11 @@ namespace comphelper
 // OAccessibleContextWrapper
 virtual void notifyTranslatedEvent( const 
css::accessibility::AccessibleEventObject& _rEvent ) override;
 
+// helper method for both 'disposing' methods
+void implDisposing(const css::lang::EventObject* pEvent);
+
 // OComponentHelper
-using cppu::WeakComponentImplHelperBase::disposing;
+void SAL_CALL disposing() override;
 
 // XAccessibleEventListener
 virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent) 
override;


[Libreoffice-commits] core.git: comphelper/source include/comphelper

2023-09-06 Thread Michael Weghorn (via logerrit)
 comphelper/source/misc/accessiblewrapper.cxx |8 ++--
 include/comphelper/accessiblewrapper.hxx |6 --
 2 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit db0044242a897e447988169630ff74e4c8bfecf9
Author: Michael Weghorn 
AuthorDate: Wed Sep 6 09:12:23 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Sep 6 10:57:49 2023 +0200

tdf#156683 a11y: Forward when wrapped a11y context is disposing

`OAccessibleContextWrapper` wraps an `XAccessibleContext`
held in the `m_xInnerContext` member and forwards
calls to its own methods to that one.

The lifecycle of the wrapper should match that of
the wrapped context, so handle when the
wrapped context is disposing by overriding
`XAccessibleContext::disposing` (that takes
a `css::lang::EventObject&` parameter) instead of
overriding `WeakComponentImplHelperBase::disposing`
 (the `disposing` method not taking a param)
that's meant to be called when/right before the
object itself gets disposed (but wasn't called
at all e.g. for the `OToolBoxWindowItemContext`
case in tdf#156683).

This makes sure that the corresponding entry in the
`AccessibleEventNotifier` client map is removed and
event listeners for the wrapper get notified
(via `AccessibleEventNotifier::revokeClientNotifyDisposing`)
when the wrapped object is disposing and fixes the tdf#156683
crash on exit with gtk3 observed in the libreoffice-7-6 branch:

/usr/include/c++/13/debug/vector:450:
In function:
std::debug::vector<_Tp, _Allocator>::const_reference std::
debug::vector<_Tp, _Allocator>::operator[](size_type) const [with 
_Tp =

com::sun::star::uno::Reference;
_Allocator =

std::allocator
>; const_reference = const

com::sun::star::uno::Reference&;
size_type = long unsigned int]

Error: attempt to subscript container with out-of-bounds index 0, but
container only holds 0 elements.

Objects involved in the operation:
sequence "this" @ 0x561465d8e510 {
  type = 
std::debug::vector,
 
std::allocator
 > >;
}
warn:desktop:197113:197113:desktop/source/app/crashreport.cxx:61: 
minidump generated: 
/home/michi/development/git/libreoffice-WORKTREE/instdir/program/../program/../crash//e338ad13-2338-4cd0-8d5c069d-c28f5cf5.dmp

Backtrace:

1   
comphelper::OInterfaceContainerHelper4::disposeAndClear
 interfacecontainer4.hxx 397  
0x7f2c39915cdc
2   comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing

 accessibleeventnotifier.cxx 204  0x7f2c39913c75
3   comphelper::OAccessibleContextWrapper::disposing

 accessiblewrapper.cxx   610  0x7f2c3992f033
4   cppu::WeakComponentImplHelperBase::dispose  

 implbase.cxx104  0x7f2c3947491b
5   
cppu::PartialWeakComponentImplHelper::dispose compbase.hxx   
 90   0x7f2bf8b31c70
6   cppu::WeakComponentImplHelperBase::release  

 implbase.cxx79   0x7f2c39474664
7   
cppu::PartialWeakComponentImplHelper::release compbase.hxx   
 86   0x7f2c3993133c
8   comphelper::OAccessibleContextWrapper::release  

 accessiblewrapper.cxx   475  0x7f2c3992e536
9   
com::sun::star::uno::Reference::clear
 
Reference.hxx   231  0x7f2c26929685
10  atk_object_wrapper_dispose  

 atkwrapper.cxx  1074 0x7f2c26928a2e
11  atk_object_wrapper_finalize 

 atkwrapper.cxx  670  0x7f2c26927677
12  g_object_unref  

  0x7f2c3418c48c
13  AtkListener::~AtkListener   
  

[Libreoffice-commits] core.git: comphelper/source

2023-09-05 Thread Michael Weghorn (via logerrit)
 comphelper/source/misc/accessiblewrapper.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7aa758b9f4c5153673cdbedd558289df8b0cbd14
Author: Michael Weghorn 
AuthorDate: Tue Sep 5 22:28:39 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Sep 6 07:50:52 2023 +0200

a11y: Just use std::map::clear

... instead of creating an empty map and calling
`std::map::swap`.

Change-Id: Ieb53cc1a75d1e52452987ad234562d175f762ad0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156582
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/comphelper/source/misc/accessiblewrapper.cxx 
b/comphelper/source/misc/accessiblewrapper.cxx
index af5cd50a378b..4c8d98977cd3 100644
--- a/comphelper/source/misc/accessiblewrapper.cxx
+++ b/comphelper/source/misc/accessiblewrapper.cxx
@@ -79,7 +79,7 @@ namespace comphelper
 xComp->removeEventListener( this );
 }
 // clear the map
-AccessibleMap().swap(m_aChildrenMap);
+m_aChildrenMap.clear();
 }
 
 
@@ -147,7 +147,7 @@ namespace comphelper
 }
 
 // clear our children
-AccessibleMap().swap(m_aChildrenMap);
+m_aChildrenMap.clear();
 }
 
 


[Libreoffice-commits] core.git: accessibility/source

2023-09-05 Thread Michael Weghorn (via logerrit)
 accessibility/source/standard/vclxaccessibletoolbox.cxx |   41 +++-
 1 file changed, 8 insertions(+), 33 deletions(-)

New commits:
commit e151ea63b0fb1d099410dab141953621a2d67328
Author: Michael Weghorn 
AuthorDate: Tue Sep 5 15:12:43 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Sep 6 07:50:08 2023 +0200

a11y: Drop unnecessary casting/code for toolbox items

All (top-level) toolbox items have always been
`VCLXAccessibleToolBoxItem` ever since

commit f7da8972336b8ce3e0fb71b0c50464508837a5f3
Author: Jens-Heiner Rechtien 
Date:   Wed Jun 27 14:41:59 2007 +

INTEGRATION: CWS a11ysep (1.1.2); FILE ADDED
2007/02/28 07:29:13 fs 1.1.2.4: #i1#
2006/10/05 08:20:15 fs 1.1.2.3: MANUAL RESYNC m130->m185:
file had been modified in MWS, but moved herein in CWS
2005/09/28 11:35:38 fs 1.1.2.2: manual resync (files have been 
moved herein from another location): licence change
2005/03/07 08:29:10 fs 1.1.2.1: #i44293# moved implementations 
herein from toolkit module

, so the dynamic_cast to check whether an item is a
`OToolBoxWindowItem` is unnecessary and misleading
when reading the code.

This is even easier to see now after

commit af08e6c2f46a6d99b2e18fe176c15ec2b6edb2fd
Author: Noel Grandin 
Date:   Wed Aug 30 14:02:11 2023 +0200

use concrete type for ToolBoxItemsMap

`OToolBoxWindowItem`s are only set as children
for the `VCLXAccessibleToolBoxItem`s, s.
`VCLXAccessibleToolBox::getAccessibleChild`.

Also drop now unused
`OToolBoxWindowItem::getIndexInParent` and
`OToolBoxWindowItem::setIndexInParent`.

Change-Id: I7dcef304942ed25b77918f01cf9b679b6be6e23c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156566
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx 
b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index a3ea0ec99d72..acb1d2547133 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -83,10 +83,6 @@ namespace
 private:
 sal_Int32 m_nIndexInParent;
 
-public:
-sal_Int32getIndexInParent() const{ return 
m_nIndexInParent; }
-void setIndexInParent( sal_Int32 _nNewIndex ){ 
m_nIndexInParent = _nNewIndex; }
-
 public:
 OToolBoxWindowItem(sal_Int32 _nIndexInParent,
 const css::uno::Reference< css::uno::XComponentContext >& 
_rxContext,
@@ -253,26 +249,17 @@ void VCLXAccessibleToolBox::UpdateIndeterminate_Impl( 
ToolBox::ImplToolItems::si
 void VCLXAccessibleToolBox::implReleaseToolboxItem( ToolBoxItemsMap::iterator 
const & _rMapPos,
 bool _bNotifyRemoval )
 {
-Reference< XAccessible > xItemAcc( _rMapPos->second );
+rtl::Reference xItemAcc(_rMapPos->second);
 if ( !xItemAcc.is() )
 return;
 
 if ( _bNotifyRemoval )
 {
-NotifyAccessibleEvent( AccessibleEventId::CHILD, Any( xItemAcc ), 
Any() );
+NotifyAccessibleEvent(AccessibleEventId::CHILD, 
Any(Reference(xItemAcc)), Any());
 }
 
-auto pWindowItem = dynamic_cast(xItemAcc.get());
-if ( !pWindowItem )
-{
-static_cast< VCLXAccessibleToolBoxItem* >( xItemAcc.get() 
)->ReleaseToolBox();
-::comphelper::disposeComponent( xItemAcc );
-}
-else
-{
-Reference< XAccessibleContext > xContext( 
pWindowItem->getContextNoCreate() );
-::comphelper::disposeComponent( xContext );
-}
+xItemAcc->ReleaseToolBox();
+xItemAcc->dispose();
 }
 
 void VCLXAccessibleToolBox::UpdateItem_Impl( ToolBox::ImplToolItems::size_type 
_nPos)
@@ -292,24 +279,12 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( 
ToolBox::ImplToolItems::size_type _
 //TODO: ToolBox::ImplToolItems::size_type -> sal_Int32!
 while ( m_aAccessibleChildren.end() != aIndexAdjust )
 {
-Reference< XAccessible > xItemAcc( aIndexAdjust->second );
-
-auto pWindowItem = dynamic_cast(xItemAcc.get());
-if ( !pWindowItem )
-{
-VCLXAccessibleToolBoxItem* pItem = static_cast< 
VCLXAccessibleToolBoxItem* >( xItemAcc.get() );
-if ( pItem )
-{
-sal_Int32 nIndex = pItem->getIndexInParent( );
-nIndex++;
-pItem->setIndexInParent( nIndex );
-}
-}
-else
+rtl::Reference xItem(aIndexAdjust->second);
+if (xItem.is())
 {
-sal_Int32 nIndex = pWindowItem->getIndexInParent( );
+sal_Int32 nIndex = xItem->getIndexInParent();
 nIndex++;
-pWindowItem->setIndexInParent( nIndex );
+xItem->setIndexInParent(nIndex);
 }
 
 ++aIndexAdjust;


[Libreoffice-commits] core.git: accessibility/inc accessibility/source

2023-09-04 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessiblelist.hxx|7 +-
 accessibility/source/standard/vclxaccessiblelist.cxx |   53 +--
 2 files changed, 30 insertions(+), 30 deletions(-)

New commits:
commit 410632ac4b8a280e0993e665ffa9cfede8326b49
Author: Michael Weghorn 
AuthorDate: Mon Sep 4 19:09:18 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Sep 4 21:43:22 2023 +0200

a11y: Hold list items by rtl::Reference

Use a vector of `rtl::Reference`
for the children instead of a vector of
`css::uno::Reference`
and casting in various places.

Change-Id: I1d0e72a7c844a685d762069002d747cf5e7d02dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156525
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/inc/standard/vclxaccessiblelist.hxx 
b/accessibility/inc/standard/vclxaccessiblelist.hxx
index eb1cdc6f9d53..f668e75d7cda 100644
--- a/accessibility/inc/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelist.hxx
@@ -25,6 +25,8 @@
 #include 
 #include 
 
+class VCLXAccessibleListItem;
+
 namespace accessibility
 {
 class IComboListBoxHelper;
@@ -114,7 +116,7 @@ public:
 private:
 BoxType m_aBoxType;
 std::unique_ptr<::accessibility::IComboListBoxHelper> m_pListBoxHelper;
-std::vector> 
m_aAccessibleChildren;
+std::vector> m_aAccessibleChildren;
 sal_Int32   m_nVisibleLineCount;
 /// Index in parent.  This is settable from the outside.
 sal_Int32   m_nIndexInParent;
@@ -144,8 +146,7 @@ private:
 /** Create the specified child and insert it into the list of children.
 Sets the child's states.
 */
-css::uno::Reference< css::accessibility::XAccessible >
-CreateChild (sal_Int32 i);
+rtl::Reference CreateChild (sal_Int32 i);
 
 /** Call this method when the item list has been changed, i.e. items
 have been deleted or inserted.
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index 14f6cddc504b..67061aac3ab0 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -108,8 +108,11 @@ void SAL_CALL VCLXAccessibleList::disposing()
 VCLXAccessibleComponent::disposing();
 
 // Dispose all items in the list.
-for (Reference& rxChild : m_aAccessibleChildren)
-comphelper::disposeComponent(rxChild);
+for (rtl::Reference& rxChild : 
m_aAccessibleChildren)
+{
+if (rxChild.is())
+rxChild->dispose();
+}
 
 m_aAccessibleChildren.clear();
 
@@ -159,18 +162,17 @@ void VCLXAccessibleList::notifyVisibleStates(bool 
_bSetNew )
 // adjust the index inside the VCLXAccessibleListItem
 for ( ; aIter != m_aAccessibleChildren.end(); )
 {
-Reference xChild = *aIter;
+rtl::Reference xChild = *aIter;
 if (!xChild.is())
 {
 aIter = m_aAccessibleChildren.erase(aIter);
 }
 else
 {
-VCLXAccessibleListItem* pItem = 
static_cast(xChild.get());
 const sal_Int32 nTopEntry = m_pListBoxHelper ? 
m_pListBoxHelper->GetTopEntry() : 0;
 const sal_Int32 nPos = static_cast(aIter - 
m_aAccessibleChildren.begin());
 bool bVisible = ( nPos>=nTopEntry && nPos<( nTopEntry + 
m_nVisibleLineCount ) );
-pItem->SetVisible( m_bVisible && bVisible );
+xChild->SetVisible(m_bVisible && bVisible);
 ++aIter;
 }
 
@@ -209,25 +211,24 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
 {
 sal_Int32 i=0;
 m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
-for (const Reference& rxChild : m_aAccessibleChildren)
+for (const rtl::Reference& rxChild : 
m_aAccessibleChildren)
 {
 if (rxChild.is())
 {
-VCLXAccessibleListItem* pItem = static_cast< 
VCLXAccessibleListItem* >(rxChild.get() );
 // Retrieve the item's index from the list entry.
 bool bNowSelected = m_pListBoxHelper->IsEntryPosSelected 
(i);
 if (bNowSelected)
 m_nCurSelectedPos = i;
 
-if ( bNowSelected && !pItem->IsSelected() )
+if (bNowSelected && !rxChild->IsSelected())
 {
 xNewAcc = rxChild;
 aNewValue <<= xNewAcc;
 }
-else if ( pItem->IsSelected() )
+else if (rxChild->IsSelected())
 m_nLastSelectedPos = i;
 
-pItem->SetSelected( bNowSelected );
+rxChild->SetSelected(bNowSelected);

[Libreoffice-commits] core.git: accessibility/inc accessibility/source

2023-09-04 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessiblelist.hxx|5 +
 accessibility/source/standard/vclxaccessiblelist.cxx |2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 307b9af2420d649b2e50817e38f8cb63687abf8b
Author: Michael Weghorn 
AuthorDate: Mon Sep 4 17:29:57 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Sep 4 21:41:40 2023 +0200

a11y: Drop ListItems typdef

Change-Id: Ie8d62b769c44ab74a21fadd9ab395fe0f908ee76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156524
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/inc/standard/vclxaccessiblelist.hxx 
b/accessibility/inc/standard/vclxaccessiblelist.hxx
index 57d43d2c11de..eb1cdc6f9d53 100644
--- a/accessibility/inc/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelist.hxx
@@ -25,9 +25,6 @@
 #include 
 #include 
 
-typedef std::vector>
-ListItems;
-
 namespace accessibility
 {
 class IComboListBoxHelper;
@@ -117,7 +114,7 @@ public:
 private:
 BoxType m_aBoxType;
 std::unique_ptr<::accessibility::IComboListBoxHelper> m_pListBoxHelper;
-ListItems   m_aAccessibleChildren;
+std::vector> 
m_aAccessibleChildren;
 sal_Int32   m_nVisibleLineCount;
 /// Index in parent.  This is settable from the outside.
 sal_Int32   m_nIndexInParent;
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index 101c5815c0ac..14f6cddc504b 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -154,7 +154,7 @@ void VCLXAccessibleList::notifyVisibleStates(bool _bSetNew )
 (_bSetNew ? aNewValue : aOldValue ) <<= AccessibleStateType::SHOWING;
 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, 
aNewValue );
 
-ListItems::iterator aIter = m_aAccessibleChildren.begin();
+auto aIter = m_aAccessibleChildren.begin();
 UpdateVisibleLineCount();
 // adjust the index inside the VCLXAccessibleListItem
 for ( ; aIter != m_aAccessibleChildren.end(); )


[Libreoffice-commits] core.git: accessibility/source

2023-09-04 Thread Michael Weghorn (via logerrit)
 accessibility/source/standard/vclxaccessiblelist.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 51de048ae97cbd371457dbc07120e30db9ee4187
Author: Michael Weghorn 
AuthorDate: Mon Sep 4 17:19:03 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Sep 4 21:41:21 2023 +0200

tdf#157088 a11y: Dispose list items with list

Don't only clear, but also dispose the
list items when the `VCLXAccessibleList`
gets disposed.

Interestingly, there was already a comment
saying

// Dispose all items in the list.

, but that wasn't done so far...

Fixes a crash on exit with the below backtrace
after using the font color toolbox item with
the qt6 VCL plugin and Orca running:

1  __pthread_kill_implementation  pthread_kill.c  44  0x7fe2a2ea80fc
2  __pthread_kill_internalpthread_kill.c  78  0x7fe2a2ea815f
3  __GI_raise raise.c 26  0x7fe2a2e5a472
4  __GI_abort abort.c 79  0x7fe2a2e444b2
5  __assert_fail_base assert.c92  0x7fe2a2e443d5
6  __assert_fail  assert.c101 0x7fe2a2e533a2
7  (anonymous namespace)::implLookupClient
accessibleeventnotifier.cxx 140 0x7fe2a21138a4
8  comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing   
accessibleeventnotifier.cxx 185 0x7fe2a2113bb8
9  VCLXAccessibleListItem::disposing  vclxaccessiblelistitem.cxx  164 
0x7fe26870cb58
10 cppu::WeakAggComponentImplHelperBase::dispose  implbase.cxx230 
0x7fe2a1c755e3
11 cppu::WeakAggComponentImplHelperBase::release  implbase.cxx204 
0x7fe2a1c75312
12 
cppu::WeakAggComponentImplHelper6::release compbase6.hxx   142 0x7fe26870fc0c
13 
com::sun::star::uno::Reference::~Reference
 Reference.hxx   114 0x7fe28f2428a7
14 QtAccessibleWidget::~QtAccessibleWidgetQtAccessibleWidget.hxx  
39  0x7fe28f262cf9
15 QtAccessibleWidget::~QtAccessibleWidgetQtAccessibleWidget.hxx  
39  0x7fe28f262dd0
16 QAccessibleCache::deleteInterface  qaccessiblecache.cpp173 
0x7fe28e0c8e4b
17 QAccessibleCache::~QAccessibleCacheqaccessiblecache.cpp31  
0x7fe28e0c845c
18 QAccessibleCache::~QAccessibleCacheqaccessiblecache.cpp32  
0x7fe28e0c84e2
19 cleanupAccessibleCache qaccessiblecache.cpp24  0x7fe28e0c83c8
20 qt_call_post_routines  qcoreapplication.cpp327 0x7fe28e9a4593
21 QApplication::~QApplicationqapplication.cpp663 0x7fe28cf9dff6
22 QApplication::~QApplicationqapplication.cpp717 0x7fe28cf9e2f4
23 std::default_delete::operator()  unique_ptr.h99  
0x7fe28f2cf3ae
24 std::__uniq_ptr_impl>::reset   unique_ptr.h211 0x7fe28f2cf7f6
25 std::unique_ptr>::resetunique_ptr.h509 0x7fe28f2cd72d
26 QtInstance::~QtInstanceQtInstance.cxx  273 0x7fe28f2c614f
27 QtInstance::~QtInstanceQtInstance.cxx  274 0x7fe28f2c6226
28 DestroySalInstance salplug.cxx 389 0x7fe299a62611
29 DeInitVCL  svmain.cxx  600 0x7fe299b41226
30 ImplSVMain svmain.cxx  229 0x7fe299b3f9f7
31 SVMain svmain.cxx  236 0x7fe299b3fa53
32 soffice_main   sofficemain.cxx 94  0x7fe2a30a1b5d
33 sal_main   main.c  51  0x55c86565c9d4
34 main   main.c  49  0x55c86565c9ba

Change-Id: I42ddcf5501ddfb363aeae10a86f1c38251e6793b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156522
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index 57f9b1eabcb3..101c5815c0ac 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -107,6 +108,8 @@ void SAL_CALL VCLXAccessibleList::disposing()
 VCLXAccessibleComponent::disposing();
 
 // Dispose all items in the list.
+for (Reference& rxChild : m_aAccessibleChildren)
+comphelper::disposeComponent(rxChild);
 
 m_aAccessibleChildren.clear();
 


[Libreoffice-commits] core.git: accessibility/inc accessibility/source

2023-09-04 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessiblelist.hxx|2 -
 accessibility/source/standard/vclxaccessiblelist.cxx |   25 +--
 2 files changed, 13 insertions(+), 14 deletions(-)

New commits:
commit bfa9d01920e7e042a83627d7fa4e78c70bc7ece5
Author: Michael Weghorn 
AuthorDate: Mon Sep 4 17:03:47 2023 +0200
Commit: Michael Weghorn 
CommitDate: Mon Sep 4 21:41:00 2023 +0200

tdf#157088 a11y: No need to use WeakReference for list children

`VCLXAccessibleList` is the owner of the
`VCLXAccessibleListItem`s held in that vector,
so I see no reason to hold them by weak reference,
which according to the doc in
`udkapi/com/sun/star/uno/XWeak.idl` is to avoid
affecting the lifetime of the objects:

> The sense of weak references is to hold a reference to an object
> without affecting the lifetime of the object. That means that a weak
> reference may become invalid, at any time, if the referenced object dies.
> 

Quite the contrary, it is actually responsible for the
lifecycle of the list item a11y objects and should dispose
them when itself gets disposed, which will be added
in a subsequent commit.

Change-Id: I57fe3367f1199cd0c24f006f6e25a1e9c930c154
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156521
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/inc/standard/vclxaccessiblelist.hxx 
b/accessibility/inc/standard/vclxaccessiblelist.hxx
index bab8b649fa07..57d43d2c11de 100644
--- a/accessibility/inc/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelist.hxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-typedef std::vector< css::uno::WeakReference< css::accessibility::XAccessible 
> >
+typedef std::vector>
 ListItems;
 
 namespace accessibility
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index c38240e3b4e7..57f9b1eabcb3 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -107,6 +107,7 @@ void SAL_CALL VCLXAccessibleList::disposing()
 VCLXAccessibleComponent::disposing();
 
 // Dispose all items in the list.
+
 m_aAccessibleChildren.clear();
 
 m_pListBoxHelper.reset();
@@ -155,14 +156,14 @@ void VCLXAccessibleList::notifyVisibleStates(bool 
_bSetNew )
 // adjust the index inside the VCLXAccessibleListItem
 for ( ; aIter != m_aAccessibleChildren.end(); )
 {
-Reference< XAccessible > xHold = *aIter;
-if (!xHold.is())
+Reference xChild = *aIter;
+if (!xChild.is())
 {
 aIter = m_aAccessibleChildren.erase(aIter);
 }
 else
 {
-VCLXAccessibleListItem* pItem = 
static_cast(xHold.get());
+VCLXAccessibleListItem* pItem = 
static_cast(xChild.get());
 const sal_Int32 nTopEntry = m_pListBoxHelper ? 
m_pListBoxHelper->GetTopEntry() : 0;
 const sal_Int32 nPos = static_cast(aIter - 
m_aAccessibleChildren.begin());
 bool bVisible = ( nPos>=nTopEntry && nPos<( nTopEntry + 
m_nVisibleLineCount ) );
@@ -205,12 +206,11 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
 {
 sal_Int32 i=0;
 m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
-for ( const auto& rChild : m_aAccessibleChildren )
+for (const Reference& rxChild : m_aAccessibleChildren)
 {
-Reference< XAccessible > xHold = rChild;
-if ( xHold.is() )
+if (rxChild.is())
 {
-VCLXAccessibleListItem* pItem = static_cast< 
VCLXAccessibleListItem* >( xHold.get() );
+VCLXAccessibleListItem* pItem = static_cast< 
VCLXAccessibleListItem* >(rxChild.get() );
 // Retrieve the item's index from the list entry.
 bool bNowSelected = m_pListBoxHelper->IsEntryPosSelected 
(i);
 if (bNowSelected)
@@ -218,7 +218,7 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
 
 if ( bNowSelected && !pItem->IsSelected() )
 {
-xNewAcc = rChild;
+xNewAcc = rxChild;
 aNewValue <<= xNewAcc;
 }
 else if ( pItem->IsSelected() )
@@ -663,12 +663,11 @@ void VCLXAccessibleList::UpdateSelection_Impl(sal_Int32)
 {
 sal_Int32 i=0;
 m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
-for ( const auto& rChild : m_aAccessibleChildren )
+for (const Reference& rxChild : m_aAccessibleChildren 
)
 {
-

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/qt5

2023-09-02 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtFrame.hxx |1 +
 vcl/qt5/QtFrame.cxx |   20 +++-
 2 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 19b8bac2aa59d02968c33ac6f83c66907d5ab94c
Author: Michael Weghorn 
AuthorDate: Sat Sep 2 10:37:47 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sat Sep 2 15:42:44 2023 +0200

tdf#149611 qt: Make auto-selection of dark app colors work

Rename the newly introduced method
`QtFrame::isUsingDarkColorScheme` to detect whether
a dark color scheme is in use from

Change-Id I8f347c6e7f775cc55377c5c84481de3051c3cf24
tdf#156894 qt: Prefer dark icon theme in dark mode

and let it override `SalFrame::GetUseDarkMode`.

This gets used (via `MiscSettings::GetUseDarkMode`)
in `ColorConfig::GetDefaultColor` to determine what
application colors to use.

With this, setting "Tools" -> "Options" -> "LibreOfficeDev"
-> "Application Colors" -> "Automatic" to "System Theme"
will now automatically switch to dark application colors
(like a dark doc background instead of white) for kf5/qt6
when a dark global theme is active (e.g. because "Breeze Dark"
has been selected in Plasma system settings).

Change-Id: I151e7eb35a94a9c525452a7d90b24283f6226904
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156467
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index ecedc3ae2e29..b5ae7508a506 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -128,7 +128,6 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public 
SalFrame
 bool isWindow() const;
 QWindow* windowHandle() const;
 QScreen* screen() const;
-static bool isUsingDarkColorScheme();
 bool isMinimized() const;
 bool isMaximized() const;
 void SetWindowStateImpl(Qt::WindowStates eState);
@@ -215,6 +214,7 @@ public:
 virtual void SetScreenNumber(unsigned int) override;
 virtual void SetApplicationID(const OUString&) override;
 virtual void ResolveWindowHandle(SystemEnvData& rData) const override;
+virtual bool GetUseDarkMode() const override;
 virtual bool GetUseReducedAnimation() const override;
 
 inline bool CallCallback(SalEvent nEvent, const void* pEvent) const;
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index ff7edb9fd7b2..49d542a64909 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -354,7 +354,7 @@ QScreen* QtFrame::screen() const
 #endif
 }
 
-bool QtFrame::isUsingDarkColorScheme()
+bool QtFrame::GetUseDarkMode() const
 {
 #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
 const QStyleHints* pStyleHints = QApplication::styleHints();
@@ -1234,7 +1234,7 @@ void QtFrame::UpdateSettings(AllSettings& rSettings)
 style.SetMenuFont(aFont);
 
 // Icon theme
-const bool bPreferDarkTheme = isUsingDarkColorScheme();
+const bool bPreferDarkTheme = GetUseDarkMode();
 style.SetPreferredIconTheme(toOUString(QIcon::themeName()), 
bPreferDarkTheme);
 
     // Scroll bar size
commit 73d0d205c43a9848acd313ff1845ebafe63e807c
Author: Michael Weghorn 
AuthorDate: Sat Sep 2 10:12:54 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sat Sep 2 15:42:37 2023 +0200

tdf#156894 qt: Prefer dark icon theme in dark mode

When in dark mode, pass the param to prefer a dark
icon theme to
`StyleSettings::SetPreferredIconTheme`.

For Qt >= 6.5 use `QStyleHints::colorScheme`
introduced in Qt 6.5 to get the color scheme.
For older Qt versions, use the same algorithm based
on the gray value of the window background as
xdg-desktop-portal-kde does for evaluating whether
a light or dark color scheme is preferred [1].

On my Debian testing, the Breeze dark icon theme is
now used as expected with kf5 or qt6 when setting
the Global KDE Plasma theme to "Breeze Dark" and
manually setting the Icon theme to "GNOME" afterwards.
Previously, this would not use a dark icon theme and
icons would be hard to see.

Without manually setting the icon theme to "GNOME",
the Breeze Dark icon theme would already be used
before, because selecting "Breeze Dark" as the
global KDE Plasma theme also selects the "Breeze Dark"
icon theme by default, and therefore "breeze-dark"
was already passed as the first param to
`StyleSettings::SetPreferredIconTheme` and since
that icon theme is present, the `bPreferDarkTheme`
wouldn't be evaluated at all; it's only used
when determining the fallback icon theme when
the specified icon theme is not present.

(Likewise, by enabling the "Breeze Dark" global theme
and then manually setting the icon theme to "Breeze"
in Plasma Syste

[Libreoffice-commits] core.git: android/source

2023-09-01 Thread Michael Weghorn (via logerrit)
 android/source/build.gradle |2 +-
 android/source/gradle.properties|3 +++
 android/source/gradle/wrapper/gradle-wrapper.properties |4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 443e72497e5ae55facad8ad24ae10c82d6c25f4d
Author: Michael Weghorn 
AuthorDate: Fri Aug 4 22:29:00 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Sep 1 20:39:35 2023 +0200

android: Update Android Gradle Plugin to 8.1.0

... and gradle to 8.0, as suggested by Android Studio.
Also, as suggested, let the upgrade assistant set the following properties
to keep the previous behavior for these for now instead of applying the new
default behavior:

android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false

Those may be revisited in a follow-up step.
See the Android Gradle Plugin release notes [1]
for more details on the properties.

[1] 
https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes

Change-Id: Iec2f5766c0888e0f38438290b8fd814494afd837
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155376
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 99365f08f2d4..f4f74338284c 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -21,7 +21,7 @@ buildscript {
 google()
 }
 dependencies {
-classpath 'com.android.tools.build:gradle:7.4.2'
+classpath 'com.android.tools.build:gradle:8.1.0'
 }
 }
 
diff --git a/android/source/gradle.properties b/android/source/gradle.properties
index fe72551bf894..76578d6146a5 100644
--- a/android/source/gradle.properties
+++ b/android/source/gradle.properties
@@ -1,2 +1,5 @@
+android.defaults.buildfeatures.buildconfig=true
+android.nonFinalResIds=false
+android.nonTransitiveRClass=false
 android.useAndroidX=true
 org.gradle.jvmargs=-Xmx3072m
diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties 
b/android/source/gradle/wrapper/gradle-wrapper.properties
index ef80eb5051f2..b22661d9bfd2 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionSha256Sum=97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
+distributionSha256Sum=f30b29580fe11719087d698da23f3b0f0d04031d8995f7dd8275a31f7674dc01
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists


[Libreoffice-commits] core.git: vcl/qt5

2023-09-01 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtFrame.cxx |   42 ++
 1 file changed, 26 insertions(+), 16 deletions(-)

New commits:
commit 4f60660bca1796184a4fe079b5ecdd562a36aa32
Author: Michael Weghorn 
AuthorDate: Fri Sep 1 17:50:19 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Sep 1 20:29:02 2023 +0200

qt: Set window title etc. in main thread

These QWidget methods need to be called
in the main thread.

Otherwise, opening the Update dialog
("Help" -> "Check for Updates", enabled
by `--enable-online-update` autogen switch)
triggers asserts like the one below with
a self-compiled Qt 6 development build
(qtbase dev branch as of
c802a9e987c9e38c01580f467eab92a651b3e033).

ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to 
objects owned by a different thread. Current thread 0x0x7fff780160e0. Receiver 
'' (of type 'QtWidget') was created in thread 0x0x555fcd30", file 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp, 
line 537

Thread 40 "InitUpdateCheck" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff76c0 (LWP 1516868)]
__pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x778a815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7785a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x778444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7fffe32eb45a in qAbort() () at 
/home/michi/development/git/qt5/qtbase/src/corelib/global/qglobal.cpp:161
#5  0x7fffe32f9ee5 in qt_message_fatal(QtMsgType, 
QMessageLogContext const&, QString const&) (context=..., message=...) at 
/home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:2057
#6  0x7fffe32f620c in QMessageLogger::fatal(char const*, ...) const 
(this=0x7fff7fffb980, msg=0x7fffe37fd9a0 "ASSERT failure in %s: \"%s\", file 
%s, line %d")
at 
/home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:938
#7  0x7fffe32e9d54 in qt_assert_x(char const*, char const*, char 
const*, int)
(where=0x7fffe38131e9 "QCoreApplication::sendEvent", 
what=0x7fff78180110 "Cannot send events to objects owned by a different thread. 
Current thread 0x0x7fff780160e0. Receiver '' (of type 'QtWidget') was created 
in thread 0x0x555fcd30", file=0x7fffe3812e18 
"/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp",
 line=537) at 
/home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:77
#8  0x7fffe33a4d74 in 
QCoreApplicationPrivate::checkReceiverThread(QObject*) 
(receiver=0x5d27d5d0) at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:537
#9  0x7fffe19a3a81 in QApplication::notify(QObject*, QEvent*) 
(this=0x555fcb80, receiver=0x5d27d5d0, e=0x7fff7fffc0b0) at 
/home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2584
#10 0x7fffe33a5ed0 in QCoreApplication::notifyInternal2(QObject*, 
QEvent*) (receiver=0x5d27d5d0, event=0x7fff7fffc0b0) at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1125
#11 0x7fffe33a6991 in QCoreApplication::sendEvent(QObject*, 
QEvent*) (receiver=0x5d27d5d0, event=0x7fff7fffc0b0) at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1559
#12 0x7fffe1a279b4 in QWidget::setWindowTitle(QString const&) 
(this=0x5d27d5d0, title=...) at 
/home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:6119
#13 0x7fffe3c9d4c4 in QtFrame::SetTitle(rtl::OUString const&) 
(this=0x55619d20, rTitle="Check for Updates") at 
/home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtFrame.cxx:365
#14 0x7fffedd98d44 in vcl::Window::SetText(rtl::OUString const&) 
(this=0x7fff7803cd90, rStr="Check for Updates") at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:3042
#15 0x7fffedd311c9 in SystemWindow::SetText(rtl::OUString const&) 
(this=0x7fff7803cd90, rStr="Check for Updates") at 
/home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:1048
#16 0x7048bd6b in VCLXWindow::setProperty(rtl::OUString const&, 
com::sun::star::uno::Any const&) (this=0x7fff7804ac00, PropertyName="Title", 
Value=uno::Any("string": "Check for 

[Libreoffice-commits] core.git: distro-configs/Jenkins distro-configs/LibreOfficeFlatpak.conf

2023-09-01 Thread Michael Weghorn (via logerrit)
 distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf |2 +-
 distro-configs/Jenkins/Linux_bisect |2 +-
 distro-configs/Jenkins/Linux_dev_master.conf|2 +-
 distro-configs/Jenkins/Linux_rel_master.conf|2 +-
 distro-configs/Jenkins/Linux_ubsan_master.conf  |2 +-
 distro-configs/Jenkins/PerfSuite_Linux.conf |2 +-
 distro-configs/Jenkins/android_common.conf  |2 +-
 distro-configs/Jenkins/linux_clang_dbgutil_64   |2 +-
 distro-configs/Jenkins/linux_gcc_release_64 |2 +-
 distro-configs/Jenkins/linux_random.conf|2 +-
 distro-configs/Jenkins/screenshot_linux.conf|2 +-
 distro-configs/LibreOfficeFlatpak.conf  |2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 63b44ef7685c9a8e4a55584790521c75f7cc2628
Author: Michael Weghorn 
AuthorDate: Fri Aug 18 10:22:44 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Sep 1 17:21:51 2023 +0200

distro-configs: Switch from JDK 11 to 17

... to prepare for the upcoming
Change-Id I18251151392ca5edec8ca3d5cffd192d5f9f38b1
("Bump Java build baseline from JDK 11 to 17").

Change-Id: I3bedc42fd8e05c1e5c61e0b2c9e8eefce31d0fae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155377
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf 
b/distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf
index 03f39c46cde8..29c6303a1448 100644
--- a/distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf
+++ b/distro-configs/Jenkins/LibreOfficeLinuxUpdater.conf
@@ -33,5 +33,5 @@
 --with-lang=de es fr ar zh-CN
 --with-package-format=archive
 --with-update-config=~/updater.ini
---with-jdk-home=/etc/alternatives/java_sdk_11
+--with-jdk-home=/etc/alternatives/java_sdk_17
 --enable-odk
diff --git a/distro-configs/Jenkins/Linux_bisect 
b/distro-configs/Jenkins/Linux_bisect
index 92678cfdea8f..106704cb6712 100644
--- a/distro-configs/Jenkins/Linux_bisect
+++ b/distro-configs/Jenkins/Linux_bisect
@@ -1,4 +1,4 @@
 --disable-werror
 --disable-odk
---with-jdk-home=/etc/alternatives/java_sdk_11
+--with-jdk-home=/etc/alternatives/java_sdk_17
 --enable-kf5
diff --git a/distro-configs/Jenkins/Linux_dev_master.conf 
b/distro-configs/Jenkins/Linux_dev_master.conf
index d4b221fe0c06..0cc2c8381270 100644
--- a/distro-configs/Jenkins/Linux_dev_master.conf
+++ b/distro-configs/Jenkins/Linux_dev_master.conf
@@ -1,4 +1,4 @@
 --enable-dbgutil
 --enable-kf5
---with-jdk-home=/etc/alternatives/java_sdk_11
+--with-jdk-home=/etc/alternatives/java_sdk_17
 --enable-odk
diff --git a/distro-configs/Jenkins/Linux_rel_master.conf 
b/distro-configs/Jenkins/Linux_rel_master.conf
index 5e280bbf4aa8..fddc95b0ec67 100644
--- a/distro-configs/Jenkins/Linux_rel_master.conf
+++ b/distro-configs/Jenkins/Linux_rel_master.conf
@@ -1,3 +1,3 @@
 --enable-kf5
---with-jdk-home=/etc/alternatives/java_sdk_11
+--with-jdk-home=/etc/alternatives/java_sdk_17
 --enable-odk
diff --git a/distro-configs/Jenkins/Linux_ubsan_master.conf 
b/distro-configs/Jenkins/Linux_ubsan_master.conf
index 8acd56a29302..b1b928e7e41e 100644
--- a/distro-configs/Jenkins/Linux_ubsan_master.conf
+++ b/distro-configs/Jenkins/Linux_ubsan_master.conf
@@ -22,5 +22,5 @@
 --with-system-cairo
 --disable-compiler-plugins
 --disable-gtk3
---with-jdk-home=/etc/alternatives/java_sdk_11
+--with-jdk-home=/etc/alternatives/java_sdk_17
 --enable-odk
diff --git a/distro-configs/Jenkins/PerfSuite_Linux.conf 
b/distro-configs/Jenkins/PerfSuite_Linux.conf
index e75a8fcc4653..f4c1f462f71d 100644
--- a/distro-configs/Jenkins/PerfSuite_Linux.conf
+++ b/distro-configs/Jenkins/PerfSuite_Linux.conf
@@ -6,7 +6,7 @@
 --disable-ccache
 --enable-symbols
 --enable-mergelibs
---with-jdk-home=/etc/alternatives/java_sdk_11
+--with-jdk-home=/etc/alternatives/java_sdk_17
 --enable-python=fully-internal
 --enable-odk
 --with-privacy-policy-url=dummyvalue-only-used-for-ci
diff --git a/distro-configs/Jenkins/android_common.conf 
b/distro-configs/Jenkins/android_common.conf
index 51ae8e255ee5..5d3e57ede557 100644
--- a/distro-configs/Jenkins/android_common.conf
+++ b/distro-configs/Jenkins/android_common.conf
@@ -1,5 +1,5 @@
 --with-android-sdk=$HOME/Android/Sdk
 --with-android-ndk=$HOME/Android/Sdk/ndk/25.1.8937393
---with-jdk-home=/etc/alternatives/java_sdk_11
+--with-jdk-home=/etc/alternatives/java_sdk_17
 --enable-android-editing
 --enable-odk
diff --git a/distro-configs/Jenkins/linux_clang_dbgutil_64 
b/distro-configs/Jenkins/linux_clang_dbgutil_64
index 3409189e151c..5fa90d44c223 100644
--- a/distro-configs/Jenkins/linux_clang_dbgutil_64
+++ b/distro-configs/Jenkins/linux_clang_dbgutil_64
@@ -4,7 +4,7 @@
 --disable-compiler-plugins-analyzer-pch
 --disable-dependency-tracking
 --disable-split-debug
---with-jdk-home=/etc/alternatives/java_sdk_11
+--with-jdk-home=/etc/alternatives/java_sdk_17
 --enable-odk
 --disable-dconf
 --ena

[Libreoffice-commits] core.git: accessibility/inc accessibility/source

2023-09-01 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessibletextcomponent.hxx|3 +++
 accessibility/source/standard/vclxaccessibletextcomponent.cxx |8 
 2 files changed, 11 insertions(+)

New commits:
commit a5593114bb409c93c7cf79a3abac0c60a8aebb18
Author: Michael Weghorn 
AuthorDate: Fri Sep 1 13:48:50 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Sep 1 16:13:40 2023 +0200

tdf#104833 a11y Send name changed event for text controls

The text is at least often used for the accessible name of
text controls (e.g. the MultiLineEdit case in tdf#104833).

Therefore, also check whether the a11y name has changed
from the previously remembered one in
`VCLXAccessibleTextComponent::SetText` and send
a NAME_CHANGED event if it has.

This e.g. makes sure that the a11y name for the multi line
edit in the update dialog is updated on Windows
and NVDA properly announces it when it receives focus.
 (It now correctly announces "LibreOfficeDev 24.2 is up to date."
instead of the obsolete cached name "Checking...").

Also see how `VCLXAccessibleTextComponent::ProcessWindowEvent`
calls `VCLXAccessibleTextComponent::SetText` when processing
`VclEventId::WindowFrameTitleChanged` and this comment in
`Window::SetText` mentions that `VclEventId::WindowFrameTitleChanged`
is used to notify about a11y name changes:

// #107247# needed for accessibility
// The VclEventId::WindowFrameTitleChanged is (mis)used to notify 
accessible name changes.
// Therefore a window, which is labeled by this window, must also 
notify an accessible
// name change.

Change-Id: I2f15fe78324b14c3bbeae943cb87384007e21618
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156411
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/inc/standard/vclxaccessibletextcomponent.hxx 
b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx
index cb2e20694663..3585dd778574 100644
--- a/accessibility/inc/standard/vclxaccessibletextcomponent.hxx
+++ b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx
@@ -34,6 +34,9 @@ class VCLXAccessibleTextComponent : public 
cppu::ImplInheritanceHelper<
 {
 OUStringm_sText;
 
+// accessible name the object had when SetText was called last time
+OUString m_sOldName;
+
 protected:
 voidSetText( const OUString& sText );
 
diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx 
b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
index ef3cbed4b1ec..f876f0b9ed38 100644
--- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx
+++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
@@ -61,6 +61,14 @@ void VCLXAccessibleTextComponent::SetText( const OUString& 
sText )
 m_sText = sText;
 NotifyAccessibleEvent( AccessibleEventId::TEXT_CHANGED, aOldValue, 
aNewValue );
 }
+
+// check whether accessible name has also changed, since text is (often) 
used as name as well
+const OUString sName = getAccessibleName();
+if (sName != m_sOldName)
+{
+NotifyAccessibleEvent(AccessibleEventId::NAME_CHANGED, 
Any(m_sOldName), Any(sName));
+m_sOldName = sName;
+}
 }
 
 


[Libreoffice-commits] core.git: 3 commits - accessibility/inc accessibility/source include/toolkit toolkit/inc toolkit/source

2023-09-01 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessibleedit.hxx|3 +
 accessibility/source/helper/acc_factory.cxx  |7 ++
 accessibility/source/standard/vclxaccessibleedit.cxx |   52 ++---
 include/toolkit/awt/vclxwindows.hxx  |   57 +++
 include/toolkit/helper/accessiblefactory.hxx |6 ++
 toolkit/inc/awt/vclxwindows.hxx  |   55 --
 toolkit/source/awt/vclxwindows.cxx   |5 +
 toolkit/source/helper/accessibilityclient.cxx|5 +
 8 files changed, 115 insertions(+), 75 deletions(-)

New commits:
commit a766f7555c55c73e2dfd167e66f1bf32c75de6df
Author: Michael Weghorn 
AuthorDate: Fri Sep 1 10:59:31 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Sep 1 16:13:31 2023 +0200

tdf#104833 a11y: Use VCLXAccessibleEdit for VCLXMultiLineEdit

Instead of the generic `VCLXAccessibleComponent`,
use `VCLXAccessibleEdit` as a11y class for
`VCLXMultiLineEdit` (the component interface
class for MultiLineEdit) as well, not just for `VCLXEdit`.

With the preparatory changes from

Change-Id I8218db61feb07605f6ea5309f26eebd38312458a
tdf#104833 a11y: Don't use VCLXEdit in VCLXAccessibleEdit

in place, it behaves as expected when interacting
with the multi line edit from the sample dialog in
attachment 189287 in tdf#104833 using Accerciser and
the qt6 or gtk3 VCL plugin (and the text can also be
edited when removing the readonly flag from the control)
or the update dialog (which uses UNO controls,
`UnoControlEditModel` for the panes that were not
announced, s. extensions/source/update/check/updatehdl.cxx ).

In particular, the a11y text interface is supported by
the multi line edit on the a11y layer, which makes
Orca with the gtk3 VCL plugin announce the text content
when the control gets focused.

NVDA on Windows still announces "Checking..." instead
of using the actual text that would be retrievable via
the IAccessibleText interface now. This is probably
because "Checking..." is the (outdated) accessible name,
as can be seen by interacting with the object in NVDA's
Python console:

>>> focus.name
'Checking...'
>>> txt = focus.IAccessibleTextObject
>>> txt.text(0, txt.nCharacters)
'LibreOfficeDev 24.2 is up to date.'

For both, gtk3 and qt6, the a11y object does have the
new text as a11y name as well, as can be verified in
Accerciser:

In [10]: acc.name
Out[10]: 'LibreOfficeDev 24.2 is up to date.'
In [11]: txt = acc.queryText()
In [12]: txt.getTextAtOffset(0,3)
Out[12]: ('LibreOfficeDev 24.2 is up to date.', 0, 34)

Change-Id: Id80e191cdd5342b3215fdb9d2ad3847470366337
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156402
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/source/helper/acc_factory.cxx 
b/accessibility/source/helper/acc_factory.cxx
index fb0468fe6d65..4dcc63e4ab12 100644
--- a/accessibility/source/helper/acc_factory.cxx
+++ b/accessibility/source/helper/acc_factory.cxx
@@ -102,6 +102,8 @@ public:
 createAccessibleContext( VCLXScrollBar* _pXWindow ) override;
 virtual css::uno::Reference< css::accessibility::XAccessibleContext >
 createAccessibleContext( VCLXEdit* _pXWindow ) override;
+virtual css::uno::Reference< css::accessibility::XAccessibleContext >
+createAccessibleContext( VCLXMultiLineEdit* _pXWindow ) override;
 virtual css::uno::Reference< css::accessibility::XAccessibleContext >
 createAccessibleContext( VCLXComboBox* _pXWindow ) override;
 virtual css::uno::Reference< css::accessibility::XAccessibleContext >
@@ -280,6 +282,11 @@ Reference< XAccessibleContext > 
AccessibleFactory::createAccessibleContext( VCLX
 return new VCLXAccessibleEdit( _pXWindow );
 }
 
+Reference< XAccessibleContext > AccessibleFactory::createAccessibleContext( 
VCLXMultiLineEdit* _pXWindow )
+{
+return new VCLXAccessibleEdit( _pXWindow );
+}
+
 Reference< XAccessibleContext > AccessibleFactory::createAccessibleContext( 
VCLXComboBox* _pXWindow )
 {
 bool bIsDropDownBox = false;
diff --git a/include/toolkit/awt/vclxwindows.hxx 
b/include/toolkit/awt/vclxwindows.hxx
index 3a86cdecdfef..b6d74a3f 100644
--- a/include/toolkit/awt/vclxwindows.hxx
+++ b/include/toolkit/awt/vclxwindows.hxx
@@ -461,6 +461,9 @@ public:
 
 static void ImplGetPropertyIds( std::vector< sal_uInt16 >  );
 virtual voidGetPropertyIds( std::vector< sal_uInt16 >  ) override 
{ return ImplGetPropertyIds( aIds ); }
+
+protected:
+virtual css::uno::Reference 
CreateAccessibleContext() override;
 };
 
 //  class VCLXSpinField
diff --git a/include/toolkit/helper/a

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - vcl/source

2023-09-01 Thread Michael Weghorn (via logerrit)
 vcl/source/treelist/svtabbx.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 5f8c9245a2d4d6387fe702fafe24c79139436401
Author: Michael Weghorn 
AuthorDate: Tue Aug 29 18:41:32 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri Sep 1 13:36:19 2023 +0200

tdf#156683 a11y: Dispose a11y cells with tab list box header

When disposing the `SvHeaderTabListBox`, also dispose
the a11y objects for its header cells and clear
the vector.

This fixes a crash on exit that could e.g. be triggered
as follows when using the qt6 VCL plugin on Linux:

1) start accerciser
2) start Writer with qt6 VCL plugin
3) press Alt+F12 to open the options dialog
4) enable "LibreOfficeDev" -> "Advanced" (i.e. Java Options dialog)
5) in Accerciser, click through LO a11y hierarchy, in particular on all of 
the cells of the JRE table
6) close the dialog and LO

Backtrace:

~"#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44\n"
>~"#1  0x7f0f296a815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78\n"
>~"#2  0x7f0f2965a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26\n"
>~"#3  0x7f0f296444b2 in __GI_abort () at ./stdlib/abort.c:79\n"
>~"#4  0x7f0f296443d5 in __assert_fail_base (fmt=0x7f0f297b8dc8 
\"%s%s%s:%u: %s%sAssertion `%s' failed.\\n%n\", 
assertion=assertion@entry=0x7f0f28b376a0 \"rClients.end() != rPos && 
\\\"AccessibleEventNotifier::implLookupClient: invalid client id \\\" \\\"(did 
you register your client?)!\\\"\", file=file@entry=0x7f0f28b37478 
\".../comphelper/source/misc/accessibleeventnotifier.cxx\", 
line=line@entry=140, function=function@entry=0x7f0f28b375b0 \"bool 
{anonymous}::implLookupClient(comphelper::AccessibleEventNotifier::TClientId, 
std::__debug::unordered_map
 >::iterator&)\") at ./assert/assert.c:92\n"
>~"#5  0x7f0f296533a2 in __assert_fail (assertion=0x7f0f28b376a0 
\"rClients.end() != rPos && \\\"AccessibleEventNotifier::implLookupClient: 
invalid client id \\\" \\\"(did you register your client?)!\\\"\", 
file=0x7f0f28b37478 \".../comphelper/source/misc/accessibleeventnotifier.cxx\", 
line=140, function=0x7f0f28b375b0 \"bool 
{anonymous}::implLookupClient(comphelper::AccessibleEventNotifier::TClientId, 
std::__debug::unordered_map
 >::iterator&)\") at ./assert/assert.c:101\n"
>~"#6  0x7f0f28913886 in (anonymous 
namespace)::implLookupClient(comphelper::AccessibleEventNotifier::TClientId, 
std::__debug::unordered_map,
 std::hash, std::equal_to, 
std::allocator
 > > >::iterator&) (nClient=218, rPos=...) at 
.../comphelper/source/misc/accessibleeventnotifier.cxx:140\n"

>~"#7  0x7f0f28913b9a in 
comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, 
com::sun::star::uno::Reference const&) 
(_nClient=218, _rxEventSource=uno::Reference to 
(accessibility::AccessibleBrowseBoxHeaderCell *) 0x55fb25c8b3d0) at 
.../comphelper/source/misc/accessibleeventnotifier.cxx:185\n"
>~"#8  0x7f0eef073244 in 
accessibility::AccessibleBrowseBoxBase::disposing() (this=0x55fb25c8b3d0) at 
.../accessibility/source/extended/AccessibleBrowseBoxBase.cxx:113\n"
>~"#9  0x7f0f28474aeb in 
cppu::WeakComponentImplHelperBase::dispose() (this=0x55fb25c8b3d0) at 
.../cppuhelper/source/implbase.cxx:104\n"
>~"#10 0x7f0eef0712c2 in 
cppu::PartialWeakComponentImplHelper::dispose() (this=0x55fb25c8b3d0) at 
.../include/cppuhelper/compbase.hxx:90\n"
>~"#11 0x7f0f28474834 in 
cppu::WeakComponentImplHelperBase::release() (this=0x55fb25c8b3d0) at 
.../cppuhelper/source/implbase.cxx:79\n"
>~"#12 0x7f0eef072124 in 
cppu::PartialWeakComponentImplHelper::release() (this=0x55fb25c8b3d0) at 
.../include/cppuhelper/compbase.hxx:86\n"
>~"#13 0x7f0eef07544a in 
accessibility::BrowseBoxAccessibleElement::release() (this=0x55fb25c8b3d0) at 
.../accessibility/source/extended/AccessibleBrowseBoxBase.cxx:518\n"
>~"#14 0x7f0f15842747 in 
com::sun::star::uno::Reference::~Reference()
 (this=0x7f0f0c0246e0, __in_chrg=) at 
.../include/com/sun/star/uno/Reference.hxx:114\n"

>~"#15 0x7f0f15862b9f in QtAccessibleWidget::~QtAccessibleWidget() 
(this=0x7f0f0c0246a0, __in_chrg=) at 
.../vcl/inc/qt6/../qt5/QtAccessibleWidget.hxx:39\n"
>~"#16 0x7f0f15862c76 in QtAccessibleWidget::~QtAccessibleWidget() 
(this=0x7f0f0c0246a0, __in_chrg=) at 
.../vcl/i

[Libreoffice-commits] core.git: accessibility/source

2023-08-31 Thread Michael Weghorn (via logerrit)
 accessibility/source/standard/vclxaccessibletabcontrol.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit bbd1eaeb4f8a923d861aae15264b2d4138590642
Author: Michael Weghorn 
AuthorDate: Thu Aug 31 14:47:06 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Aug 31 17:00:23 2023 +0200

a11y: Re-add check for empty reference in VCLXAccessibleTabControl

It got lost with

commit a3f77a61c03340b79930e89d5c4045d814b93edf
Date:   Wed Aug 30 14:43:18 2023 +0200

use concrete type for 
VCLXAccessibleTabControl::m_aAccessibleChildren

and resulted in a crash when e.g. doing the following
with the qt6 VCL plugin on Linux:

1) open attachment 189287 from tdf#104833
2) "Tools" -> "Macros" -> "Organize Dialogs"
3) select the dialog from the doc
4) select "Edit"

Change-Id: I2c4aea951976738c575943a64d01eaac2766fdd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156343
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/source/standard/vclxaccessibletabcontrol.cxx 
b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
index 0855b0f177aa..a0990d51febd 100644
--- a/accessibility/source/standard/vclxaccessibletabcontrol.cxx
+++ b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
@@ -218,7 +218,10 @@ void VCLXAccessibleTabControl::ProcessWindowEvent( const 
VclWindowEvent& rVclWin
 
 // dispose all tab pages
 for (const rtl::Reference& i : 
m_aAccessibleChildren)
-i->dispose();
+{
+if (i.is())
+i->dispose();
+}
 m_aAccessibleChildren.clear();
 }
 


[Libreoffice-commits] core.git: accessibility/inc accessibility/source

2023-08-30 Thread Michael Weghorn (via logerrit)
 accessibility/inc/extended/accessiblelistbox.hxx|2 -
 accessibility/source/extended/accessiblelistbox.cxx |   22 
 2 files changed, 10 insertions(+), 14 deletions(-)

New commits:
commit efd357d70438b905c5349c304a43347fd293ee6a
Author: Michael Weghorn 
AuthorDate: Wed Aug 30 11:48:58 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Aug 30 13:31:09 2023 +0200

a11y: Hold focused list box entry by rtl::Reference

Use an `rtl::Reference` for the
currently focused entry instead of using a
`css::uno::Reference`
and casting almost every time that it's used.

Change-Id: Ia3aeca18e61d82b127bf19dd0902d781168b93d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156281
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/inc/extended/accessiblelistbox.hxx 
b/accessibility/inc/extended/accessiblelistbox.hxx
index 5eeaf92d672c..55112facacbc 100644
--- a/accessibility/inc/extended/accessiblelistbox.hxx
+++ b/accessibility/inc/extended/accessiblelistbox.hxx
@@ -105,7 +105,7 @@ namespace accessibility
 typedef std::unordered_map> MAP_ENTRY;
 MAP_ENTRY m_mapEntry;
 
-css::uno::Reference< css::accessibility::XAccessible > m_xFocusedChild;
+rtl::Reference m_xFocusedEntry;
 
 accessibility::AccessibleListBoxEntry* GetCurEventEntry( const 
VclWindowEvent& rVclWindowEvent );
 
diff --git a/accessibility/source/extended/accessiblelistbox.cxx 
b/accessibility/source/extended/accessiblelistbox.cxx
index f0651f05354f..31330c845448 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -102,10 +102,9 @@ namespace accessibility
 {
 if ( getListBox() && getListBox()->HasFocus() )
 {
-AccessibleListBoxEntry* pEntry =static_cast< 
AccessibleListBoxEntry* >(m_xFocusedChild.get());
-if (pEntry)
+if (m_xFocusedEntry.is())
 {
-pEntry->NotifyAccessibleEvent( 
AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+
m_xFocusedEntry->NotifyAccessibleEvent(AccessibleEventId::SELECTION_CHANGED, 
Any(), Any());
 }
 }
 }
@@ -119,20 +118,18 @@ namespace accessibility
 SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( 
rVclWindowEvent.GetData() );
 if ( pEntry )
 {
-AccessibleListBoxEntry* pEntryFocus =static_cast< 
AccessibleListBoxEntry* >(m_xFocusedChild.get());
-if (pEntryFocus && pEntryFocus->GetSvLBoxEntry() == 
pEntry)
+if (m_xFocusedEntry.is() && 
m_xFocusedEntry->GetSvLBoxEntry() == pEntry)
 {
-aNewValue <<= m_xFocusedChild;
+aNewValue <<= 
uno::Reference(m_xFocusedEntry);;
 NotifyAccessibleEvent( 
AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, uno::Any(), aNewValue );
 return ;
 }
-
 uno::Any aOldValue;
-aOldValue <<= m_xFocusedChild;
+aOldValue <<= 
uno::Reference(m_xFocusedEntry);;
 
-m_xFocusedChild.set(implGetAccessible(*pEntry));
+m_xFocusedEntry = implGetAccessible(*pEntry);
 
-aNewValue <<= m_xFocusedChild;
+aNewValue <<= 
uno::Reference(m_xFocusedEntry);
 NotifyAccessibleEvent( 
AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
 }
 else
@@ -202,8 +199,7 @@ namespace accessibility
 if ( !pEntry )
 pEntry = getListBox()->GetCurEntry();
 
-AccessibleListBoxEntry* pEntryFocus =static_cast< 
AccessibleListBoxEntry* >(m_xFocusedChild.get());
-if (pEntryFocus && pEntry && pEntry != pEntryFocus->GetSvLBoxEntry())
+if (m_xFocusedEntry.is() && pEntry && pEntry != 
m_xFocusedEntry->GetSvLBoxEntry())
 {
 AccessibleListBoxEntry *const pAccCurOptionEntry = 
implGetAccessible(*pEntry).get();
 uno::Any aNewValue;
@@ -214,7 +210,7 @@ namespace accessibility
 }
 else
 {
-return pEntryFocus;
+return m_xFocusedEntry.get();
 }
 }
 


[Libreoffice-commits] core.git: vcl/source

2023-08-30 Thread Michael Weghorn (via logerrit)
 vcl/source/treelist/svtabbx.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 978cce0001ef9f37fb5fa5037a876f31ec558166
Author: Michael Weghorn 
AuthorDate: Tue Aug 29 18:41:32 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Aug 30 11:56:47 2023 +0200

tdf#156683 a11y: Dispose a11y cells with tab list box header

When disposing the `SvHeaderTabListBox`, also dispose
the a11y objects for its header cells and clear
the vector.

This fixes a crash on exit that could e.g. be triggered
as follows when using the qt6 VCL plugin on Linux:

1) start accerciser
2) start Writer with qt6 VCL plugin
3) press Alt+F12 to open the options dialog
4) enable "LibreOfficeDev" -> "Advanced" (i.e. Java Options dialog)
5) in Accerciser, click through LO a11y hierarchy, in particular on all of 
the cells of the JRE table
6) close the dialog and LO

Backtrace:

~"#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44\n"
>~"#1  0x7f0f296a815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78\n"
>~"#2  0x7f0f2965a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26\n"
>~"#3  0x7f0f296444b2 in __GI_abort () at ./stdlib/abort.c:79\n"
>~"#4  0x7f0f296443d5 in __assert_fail_base (fmt=0x7f0f297b8dc8 
\"%s%s%s:%u: %s%sAssertion `%s' failed.\\n%n\", 
assertion=assertion@entry=0x7f0f28b376a0 \"rClients.end() != rPos && 
\\\"AccessibleEventNotifier::implLookupClient: invalid client id \\\" \\\"(did 
you register your client?)!\\\"\", file=file@entry=0x7f0f28b37478 
\".../comphelper/source/misc/accessibleeventnotifier.cxx\", 
line=line@entry=140, function=function@entry=0x7f0f28b375b0 \"bool 
{anonymous}::implLookupClient(comphelper::AccessibleEventNotifier::TClientId, 
std::__debug::unordered_map
 >::iterator&)\") at ./assert/assert.c:92\n"
>~"#5  0x7f0f296533a2 in __assert_fail (assertion=0x7f0f28b376a0 
\"rClients.end() != rPos && \\\"AccessibleEventNotifier::implLookupClient: 
invalid client id \\\" \\\"(did you register your client?)!\\\"\", 
file=0x7f0f28b37478 \".../comphelper/source/misc/accessibleeventnotifier.cxx\", 
line=140, function=0x7f0f28b375b0 \"bool 
{anonymous}::implLookupClient(comphelper::AccessibleEventNotifier::TClientId, 
std::__debug::unordered_map
 >::iterator&)\") at ./assert/assert.c:101\n"
>~"#6  0x7f0f28913886 in (anonymous 
namespace)::implLookupClient(comphelper::AccessibleEventNotifier::TClientId, 
std::__debug::unordered_map,
 std::hash, std::equal_to, 
std::allocator
 > > >::iterator&) (nClient=218, rPos=...) at 
.../comphelper/source/misc/accessibleeventnotifier.cxx:140\n"

>~"#7  0x7f0f28913b9a in 
comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, 
com::sun::star::uno::Reference const&) 
(_nClient=218, _rxEventSource=uno::Reference to 
(accessibility::AccessibleBrowseBoxHeaderCell *) 0x55fb25c8b3d0) at 
.../comphelper/source/misc/accessibleeventnotifier.cxx:185\n"
>~"#8  0x7f0eef073244 in 
accessibility::AccessibleBrowseBoxBase::disposing() (this=0x55fb25c8b3d0) at 
.../accessibility/source/extended/AccessibleBrowseBoxBase.cxx:113\n"
>~"#9  0x7f0f28474aeb in 
cppu::WeakComponentImplHelperBase::dispose() (this=0x55fb25c8b3d0) at 
.../cppuhelper/source/implbase.cxx:104\n"
>~"#10 0x7f0eef0712c2 in 
cppu::PartialWeakComponentImplHelper::dispose() (this=0x55fb25c8b3d0) at 
.../include/cppuhelper/compbase.hxx:90\n"
>~"#11 0x7f0f28474834 in 
cppu::WeakComponentImplHelperBase::release() (this=0x55fb25c8b3d0) at 
.../cppuhelper/source/implbase.cxx:79\n"
>~"#12 0x7f0eef072124 in 
cppu::PartialWeakComponentImplHelper::release() (this=0x55fb25c8b3d0) at 
.../include/cppuhelper/compbase.hxx:86\n"
>~"#13 0x7f0eef07544a in 
accessibility::BrowseBoxAccessibleElement::release() (this=0x55fb25c8b3d0) at 
.../accessibility/source/extended/AccessibleBrowseBoxBase.cxx:518\n"
>~"#14 0x7f0f15842747 in 
com::sun::star::uno::Reference::~Reference()
 (this=0x7f0f0c0246e0, __in_chrg=) at 
.../include/com/sun/star/uno/Reference.hxx:114\n"

>~"#15 0x7f0f15862b9f in QtAccessibleWidget::~QtAccessibleWidget() 
(this=0x7f0f0c0246a0, __in_chrg=) at 
.../vcl/inc/qt6/../qt5/QtAccessibleWidget.hxx:39\n"
>~"#16 0x7f0f15862c76 in QtAccessibleWidget::~QtAccessibleWidget() 
(this=0x7f0f0c0246a0, __in_chrg=) at

[Libreoffice-commits] core.git: include/vcl

2023-08-30 Thread Michael Weghorn (via logerrit)
 include/vcl/toolkit/svtabbx.hxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit c2b621b6d9f41d269b4d1aafc5e8911dde51d607
Author: Michael Weghorn 
AuthorDate: Tue Aug 29 18:17:40 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Aug 30 09:25:24 2023 +0200

a11y: Drop AccessibleChildren typedef

It's only used a single time anyway.

Change-Id: Icef8bb635b9cf2cb2d244619fb9b63eb395213d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156258
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/vcl/toolkit/svtabbx.hxx b/include/vcl/toolkit/svtabbx.hxx
index c154969678b9..1fd7b8b16e12 100644
--- a/include/vcl/toolkit/svtabbx.hxx
+++ b/include/vcl/toolkit/svtabbx.hxx
@@ -93,12 +93,10 @@ namespace vcl {
 class VCL_DLLPUBLIC SvHeaderTabListBox : public SvTabListBox, public 
vcl::IAccessibleTableProvider
 {
 private:
-typedef ::std::vector< css::uno::Reference< 
css::accessibility::XAccessible > > AccessibleChildren;
-
 boolm_bFirstPaint;
 std::unique_ptr<::vcl::SvHeaderTabListBoxImpl>  m_pImpl;
 ::vcl::IAccessibleTabListBox*   m_pAccessible;
-AccessibleChildren  m_aAccessibleChildren;
+std::vector> 
m_aAccessibleChildren;
 
 DECL_DLLPRIVATE_LINK( ScrollHdl_Impl, SvTreeListBox*, void );
 DECL_DLLPRIVATE_LINK( CreateAccessibleHdl_Impl, HeaderBar*, void );


Re: New tests: GTK3 platform accessibility

2023-08-29 Thread Michael Weghorn

On 2023-08-28 19:54, Stephan Bergmann wrote:

Otherwise: Does the test work when run in an X11 session instead?


no; guess I need to install some piece of software that is missing from 
my machine


I can reproduce in a GNOME session in a Fedora 38 VM.

It seems to be related to GNOME and dbus-broker being used by default on 
Fedora, together with the gtk3 a11y test suite using xvfb and dbus-launch.


It works just fine for me with the same VM in an SSH or OpenBox session 
instead of the GNOME one.


The error can also be triggered with a simple sample program instead 
(based on what the gtk3 a11y test does):



// to build:
// g++ -g $(pkg-config --cflags atspi-2) -o atspi-sample-app 
atspi-sample-app.cxx $(pkg-config --libs atspi-2)


#include 
#include 

#include 

int main()
{
const int nDesktops = atspi_get_desktop_count();
for (int desktopId = 0; desktopId < nDesktops; desktopId++)
{
AtspiAccessible* pAcc = atspi_get_desktop(desktopId);
GError* pError = nullptr;
gint nChildCount = atspi_accessible_get_child_count(pAcc, );
std::cout << "pAcc: " << pAcc << ", childCount: " << 
nChildCount << ", error: " << pError

  << std::endl;
assert(nChildCount >= 0);
}
};


When running that app as follows, it fails the same way in the Fedora 38 
GNOME session:



$ xvfb-run dbus-launch --exit-with-session ./atspi-sample-app

(process:4584): dbind-WARNING **: 12:01:39.097: Couldn't get application list: 
Could not activate remote peer: unit failed.

(process:4584): GLib-GObject-CRITICAL **: 12:01:39.097: g_object_unref: 
assertion 'G_IS_OBJECT (object)' failed

(process:4584): dbind-WARNING **: 12:01:39.099: AT-SPI: Error in GetItems, 
sender=org.freedesktop.DBus, error=Could not activate remote peer: unit failed.
pAcc: 0xd0d500, childCount: -1, error: 0
atspi-sample-app: atspi-sample-app.cxx:19: int main(): Assertion `nChildCount 
>= 0' failed.
/usr/bin/xvfb-run: line 181:  4584 Aborted  



Running the same with dbus-run-session (hopefully doesn't affect the 
relevant behavior and) gives additional output:



$ xvfb-run dbus-run-session ./atspi-sample-app
dbus-daemon[4713]: [session uid=1000 pid=4713] Activating service name='org.a11y.Bus' requested by 
':1.0' (uid=1000 pid=4714 comm="./atspi-sample-app" label="kernel")
dbus-daemon[4713]: [session uid=1000 pid=4713] Successfully activated service 
'org.a11y.Bus'
Policy to allow eavesdropping in /usr/share/defaults/at-spi2/accessibility.conf 
+15: Eavesdropping is deprecated and ignored
Policy to allow eavesdropping in /usr/share/defaults/at-spi2/accessibility.conf 
+17: Eavesdropping is deprecated and ignored
dbus-daemon[4713]: [session uid=1000 pid=4713] Activating service name='org.freedesktop.systemd1' 
requested by ':1.2' (uid=1000 pid=4722 comm="/usr/bin/dbus-broker-launch 
--config-file=/usr/sha" label="kernel")
dbus-daemon[4713]: [session uid=1000 pid=4713] Activated service 
'org.freedesktop.systemd1' failed: Process org.freedesktop.systemd1 exited with 
status 1
dbus-daemon[4713]: [session uid=1000 pid=4713] Activating service name='org.freedesktop.systemd1' 
requested by ':1.2' (uid=1000 pid=4722 comm="/usr/bin/dbus-broker-launch 
--config-file=/usr/sha" label="kernel")
dbus-daemon[4713]: [session uid=1000 pid=4713] Activated service 
'org.freedesktop.systemd1' failed: Process org.freedesktop.systemd1 exited with 
status 1

(process:4714): dbind-WARNING **: 12:03:53.467: Couldn't get application list: 
Could not activate remote peer: unit failed.

(process:4714): GLib-GObject-CRITICAL **: 12:03:53.467: g_object_unref: 
assertion 'G_IS_OBJECT (object)' failed
dbus-daemon[4713]: [session uid=1000 pid=4713] Activating service name='org.freedesktop.systemd1' 
requested by ':1.2' (uid=1000 pid=4722 comm="/usr/bin/dbus-broker-launch 
--config-file=/usr/sha" label="kernel")
dbus-daemon[4713]: [session uid=1000 pid=4713] Activated service 
'org.freedesktop.systemd1' failed: Process org.freedesktop.systemd1 exited with 
status 1

(process:4714): dbind-WARNING **: 12:03:53.469: AT-SPI: Error in GetItems, 
sender=org.freedesktop.DBus, error=Could not activate remote peer: unit failed.
pAcc: 0x15fa500, childCount: -1, error: 0
atspi-sample-app: atspi-sample-app.cxx:19: int main(): Assertion `nChildCount 
>= 0' failed.


This shows that there is an attempt to start a dbus session using 
dbus-broker-launch. This seems surprising at first, since 
dbus-run-session (and dbus-launch) use dbus-daemon in $PATH by default.


But then, there's an at-spi-bus-launcher involved for running a separate 
bus for AT-SPI/a11y, and the README [1] mentions that that is a separate 
instance of dbus-daemon or dbus-broker. From a first look into the 
source code [2], it looks like it prefers dbus-broker-launch when built 
with the corresponding option and running under systemd, but that 
apparently fails at that stage.



I currently can't come with any idea how to fix/avoid that on our end, 
suggestions welcome.

[Libreoffice-commits] core.git: vcl/CppunitTest_vcl_gtk3_a11y.mk

2023-08-26 Thread Michael Weghorn (via logerrit)
 vcl/CppunitTest_vcl_gtk3_a11y.mk |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 3ebd1371cbcfc03ca525146c680f076066ceb361
Author: Michael Weghorn 
AuthorDate: Fri Aug 25 08:52:19 2023 +0200
Commit: Michael Weghorn 
CommitDate: Sat Aug 26 14:55:07 2023 +0200

gtk3 a11y: Force running a11y tests with X11 GDK backend

On Debian testing, tunning the gtk3 a11y tests with

make CppunitTest_vcl_gtk3_a11y

in a Wayland session resulted in a visible
Writer window popping up (while that should not be
the case and isn't when run in an X11 session instead,
as the application is meant to run in a virtual
X server environment via xvfb-run)
and a test failed like this:

.../vcl/qa/cppunit/a11y/atspi2/atspi2.cxx:432:Test1::TestBody
equality assertion failed
- Expected: ATSPI_ROLE_PANEL
- Actual  : ATSPI_ROLE_FILLER

warn:sw.core:15950:15950:sw/source/core/attr/calbck.cxx:196: a 
16SwTextFormatColl client added as listener to a 16SwTextFormatColl during 
client iteration.
warn:sw.core:15950:15950:sw/source/core/attr/calbck.cxx:196: a 
16SwLineNumberInfo client added as listener to a 12SwCharFormat during client 
iteration.
Test1::TestBody finished in: 56011ms
atspi2.cxx:432:Assertion
Test name: Test1::TestBody
equality assertion failed
- Expected: ATSPI_ROLE_PANEL
- Actual  : ATSPI_ROLE_FILLER

Failures !!!
Run: 1   Failure total: 1   Failures: 1   Errors: 0

Force use of the X11 GDK backend by setting env
var `GDK_BACKEND=x11`, which makes that scenario
work as expected.

Change-Id: I7de03593998ffa3bc18d487cb92e00ae75427598
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156086
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/CppunitTest_vcl_gtk3_a11y.mk b/vcl/CppunitTest_vcl_gtk3_a11y.mk
index 0981a21857d2..19adbabd4d14 100644
--- a/vcl/CppunitTest_vcl_gtk3_a11y.mk
+++ b/vcl/CppunitTest_vcl_gtk3_a11y.mk
@@ -9,6 +9,8 @@
 
 # hack plugging into the CppunitTest machinery yet using a xvfb-wrapper GTK3 
run
 $(call gb_CppunitTest_get_target,vcl_gtk3_a11y) : gb_TEST_ENV_VARS += 
SAL_USE_VCLPLUGIN=gtk3
+# force running with the X11 Gdk backend also when running on Wayland
+$(call gb_CppunitTest_get_target,vcl_gtk3_a11y) : gb_TEST_ENV_VARS += 
GDK_BACKEND=x11
 ifeq (,$(VCL_GTK3_TESTS_NO_XVFB))
 $(call gb_CppunitTest_get_target,vcl_gtk3_a11y) : \
ICECREAM_RUN += $(XVFB_RUN) $(DBUS_LAUNCH) --exit-with-session


Re: New tests: GTK3 platform accessibility

2023-08-25 Thread Michael Weghorn

On 2023-08-24 13:38, Stephan Bergmann wrote:
When I --enable-atspi-tests (which passes configure) on my local Fedora 
38 Linux machine, CppunitTest_vcl_gtk3_a11y fails the



    assert(m_pAtspiApp);


in Atspi2TestBase::setUp 
(vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx), apparently because



    Atspi::Accessible desktop(atspi_get_desktop(desktopId));


in Atspi2TestBase::getApp 
(vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx) produces


** (cppunittester:1641471): WARNING **: 12:56:34.251: AT-SPI: Could 
not obtain desktop path or name



(cppunittester:1641471): dbind-WARNING **: 12:56:34.251: Couldn't get 
application list: Could not activate remote peer: unit failed.


(cppunittester:1641471): GLib-GObject-CRITICAL **: 12:56:34.251: 
g_object_unref: assertion 'G_IS_OBJECT (object)' failed


on stderr but returns an empty Atspi::Accessible with no children to 
iterate over.


Is there perhaps anything I would need to additionally install or to 
enable to make this work?  Or does it just not work on Wayland?


In my test, it failed differently on Wayland, and forcing the X11 Gdk 
backend makes that work:

https://gerrit.libreoffice.org/c/core/+/156086

Does that fix your case as well?
Otherwise: Does the test work when run in an X11 session instead?


OpenPGP_signature.asc
Description: OpenPGP digital signature


<    1   2   3   4   5   6   7   8   9   10   >