core.git: vcl/qt5

2024-07-24 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtAccessibleWidget.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 84929c43df529ad9fcb6382349015b3d9aa2e202
Author: Michael Weghorn 
AuthorDate: Wed Jul 24 11:24:13 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 18:20:52 2024 +0200

tdf#155447 qt a11y: Map TEXT_FRAME role to QAccessible::Pane

This makes the "sentence" drawing area from the spelling
dialog (cui/uiconfig/ui/spellingdialog.ui) show up with
role panel instead of "unknown" in Accerciser when using
the qt6 VCL plugin.

This is the same as with gtk3, where the `TEXT_FRAME` role
is mapped to `ATK_ROLE_PANEL`.

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

diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index 21c5f1477fb3..fc2846fc34f3 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -516,7 +516,7 @@ QAccessible::Role QtAccessibleWidget::role() const
 case AccessibleRole::TEXT:
 return QAccessible::EditableText;
 case AccessibleRole::TEXT_FRAME:
-return QAccessible::UserRole;
+return QAccessible::Pane;
 case AccessibleRole::TOGGLE_BUTTON:
 return QAccessible::Button;
 case AccessibleRole::TOOL_BAR:


core.git: 3 commits - include/vcl vcl/source

2024-07-24 Thread Michael Weghorn (via logerrit)
 include/vcl/toolkit/ivctrl.hxx  |2 --
 vcl/source/control/imivctl1.cxx |   35 ++-
 vcl/source/control/ivctrl.cxx   |2 +-
 3 files changed, 15 insertions(+), 24 deletions(-)

New commits:
commit f3d7d24b99fec4a26afb7b53dded069649fa8fab
Author: Michael Weghorn 
AuthorDate: Wed Jul 24 08:10:40 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 14:45:01 2024 +0200

tdf#161501 icon choice ctrl: Actually set text colors for non-selection

commit 24103bdf3fa3d6962efcc6fb6ee5c95b62e29cc4
Author: Michael Weghorn 
Date:   Thu Jul 18 08:58:10 2024 +0200

tdf#161501 icon choice ctrl: Use tab text colors

Instead of using the generic window or highlight
text color, use the specific text colors for tabs
when painting entries of the vertical tab control,
similar to how it's done for the non-vertical
tab control (see `TabControl::ImplDrawItem`).

(...)

had added code to set the font color for the different
states of a vertical tab control item, but as this
was in the `if (bSelected)` block, only the one
for selection was actually used, so the other cases
were consequently removed in

commit a4befb29f325d4800b3408abb6e6df608a97ecf9
Author: Caolán McNamara 
Date:   Sat Jul 20 19:20:13 2024 +0100

cid#1610738 Logically dead code

again.

Thanks to Chris Sherlock for pointing this out!

Reintroduce setting colors, but drop the `bSelected`
condition altogether. Drop explicitly setting a fill
color, which the implementation for the non-vertical
tab control in `TabControl::ImplDrawItem` also doesn't
do and which would e.g. result in an odd grey background
for non-selected entries when used unconditionally with
the gen VCL plugin.

I see no visual difference with or without this commit
in place on Windows or for the gen VCL plugin or the kf5 VCL
plugin with the Breeze style on Linux, but other theming/styles
could depend on according colors being set.

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 8a6ace9c6adb..0d24e0b25c45 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -997,22 +997,16 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 
 const bool bMouseHovered = pEntry == pCurHighlightFrame;
 const bool bSelected = pEntry->IsSelected();
-if (bSelected)
-{
-const StyleSettings& rSettings = 
rRenderContext.GetSettings().GetStyleSettings();
-vcl::Font aNewFont(rRenderContext.GetFont());
-
-// font fill colors that are attributed "hard" need corresponding 
"hard"
-// attributed highlight colors
-if (pView->HasFocus())
-aNewFont.SetFillColor(rSettings.GetHighlightColor());
-else
-aNewFont.SetFillColor(rSettings.GetDeactiveColor());
 
+const StyleSettings& rSettings = 
rRenderContext.GetSettings().GetStyleSettings();
+vcl::Font aNewFont(rRenderContext.GetFont());
+if (bSelected)
 aNewFont.SetColor(rSettings.GetTabHighlightTextColor());
-
-rRenderContext.SetFont(aNewFont);
-}
+else if (bMouseHovered)
+aNewFont.SetColor(rSettings.GetTabRolloverTextColor());
+else
+aNewFont.SetColor(rSettings.GetTabTextColor());
+rRenderContext.SetFont(aNewFont);
 
 bool bResetClipRegion = false;
 if (!rRenderContext.IsClipRegion() && (aVerSBar->IsVisible() || 
aHorSBar->IsVisible()))
commit 87671a72505603a4cf9b3118c867654e788086da
Author: Michael Weghorn 
AuthorDate: Wed Jul 24 06:51:35 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 14:44:54 2024 +0200

tdf#161501 icon choice ctrl: Stop hover-highlight when mouse leaves

When the mouse leaves the vertical tab bar,
unset the entry to highlight as mouse-hovered,
as the previously one no longer is when the
mouse is outside the area of the tab bar.

This fixes the issue of the previously
mouse-hovered entry still being painted
with mouse-hover feedback when slowly moving the
mouse to the right away from an entry in the
"Insert" -> "Page Style" dialog with gen or kf5
at least, as shown in attachment 195467
of tdf#161501.

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index ed4c2faa8abe..8a6ace9c6adb 100644
--- a/vcl/source/control/imivctl1.cxx
+++ 

core.git: vcl/inc vcl/Library_vclplug_qt5.mk vcl/Library_vclplug_qt6.mk vcl/qt5 vcl/qt6

2024-07-24 Thread Michael Weghorn (via logerrit)
 vcl/Library_vclplug_qt5.mk |1 +
 vcl/Library_vclplug_qt6.mk |1 +
 vcl/inc/qt5/QtGraphicsBase.hxx |7 +++
 vcl/qt5/QtGraphics.cxx |5 +
 vcl/qt5/QtGraphicsBase.cxx |   33 +
 vcl/qt5/QtGraphics_GDI.cxx |   20 
 vcl/qt5/QtSvpGraphics.cxx  |   16 +---
 vcl/qt6/QtGraphicsBase.cxx |   12 
 8 files changed, 60 insertions(+), 35 deletions(-)

New commits:
commit 52f2edaa596159828b95313e55d8df3bb289aaee
Author: Michael Weghorn 
AuthorDate: Wed Jul 24 08:59:36 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 10:10:34 2024 +0200

qt: Move resolution calc to static helper method

Instead of duplicating the same code in both,
`QtGraphics::GetResolution` and
`QtSvpGraphics::GetResolution`, create a static
helper method `QtGraphicsBase::ImplGetResolution`
in their base class and call that.

While at it, also move `QtGraphics::GetResolution`
to the source file where all of the other
`QtGraphics` methods are implemented.

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

diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index f29090d9dd9d..14782ca89dc3 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -87,6 +87,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
 vcl/qt5/QtFontFace \
 vcl/qt5/QtFrame \
 vcl/qt5/QtGraphics \
+vcl/qt5/QtGraphicsBase \
 vcl/qt5/QtGraphics_Controls \
 vcl/qt5/QtGraphics_GDI \
 vcl/qt5/QtGraphics_Text \
diff --git a/vcl/Library_vclplug_qt6.mk b/vcl/Library_vclplug_qt6.mk
index f8a2c38bb836..bf5c05eac189 100644
--- a/vcl/Library_vclplug_qt6.mk
+++ b/vcl/Library_vclplug_qt6.mk
@@ -86,6 +86,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt6,\
 vcl/qt6/QtFontFace \
 vcl/qt6/QtFrame \
 vcl/qt6/QtGraphics \
+vcl/qt6/QtGraphicsBase \
 vcl/qt6/QtGraphics_Controls \
 vcl/qt6/QtGraphics_GDI \
 vcl/qt6/QtGraphics_Text \
diff --git a/vcl/inc/qt5/QtGraphicsBase.hxx b/vcl/inc/qt5/QtGraphicsBase.hxx
index 73c39fb5ba80..573f086439e3 100644
--- a/vcl/inc/qt5/QtGraphicsBase.hxx
+++ b/vcl/inc/qt5/QtGraphicsBase.hxx
@@ -9,8 +9,12 @@
 
 #pragma once
 
+#include "QtFrame.hxx"
+
 #include 
 
+#include 
+
 class QtGraphicsBase
 {
 qreal m_fDPR;
@@ -24,6 +28,9 @@ public:
 void setDevicePixelRatioF(qreal fDPR) { m_fDPR = fDPR; }
 
 qreal devicePixelRatioF() const { return m_fDPR; }
+
+protected:
+static void ImplGetResolution(QtFrame* pFrame, sal_Int32& rDPIX, 
sal_Int32& rDPIY);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/QtGraphics.cxx b/vcl/qt5/QtGraphics.cxx
index d809556ce219..5e2d3d38f46f 100644
--- a/vcl/qt5/QtGraphics.cxx
+++ b/vcl/qt5/QtGraphics.cxx
@@ -103,4 +103,9 @@ void QtGraphics::handleDamage(const tools::Rectangle& 
rDamagedRegion)
 aPainter.update(toQRect(rDamagedRegion));
 }
 
+void QtGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
+{
+QtGraphicsBase::ImplGetResolution(m_pFrame, rDPIX, rDPIY);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/QtGraphicsBase.cxx b/vcl/qt5/QtGraphicsBase.cxx
new file mode 100644
index ..dcaf84fe2eb9
--- /dev/null
+++ b/vcl/qt5/QtGraphicsBase.cxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#include 
+
+#include 
+
+#include 
+
+void QtGraphicsBase::ImplGetResolution(QtFrame* pFrame, sal_Int32& rDPIX, 
sal_Int32& rDPIY)
+{
+char* pForceDpi;
+if ((pForceDpi = getenv("SAL_FORCEDPI")))
+{
+rDPIX = rDPIY = o3tl::toInt32(std::string_view(pForceDpi));
+return;
+}
+
+if (!pFrame)
+return;
+
+QScreen* pScreen = pFrame->GetQWidget()->screen();
+rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5;
+rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/QtGraphics_GDI.cxx b/vcl/qt5/QtGraphics_GDI.cxx
index 87c7fb85725b..bbfde8e1f22e 100644
--- a/vcl/qt5/QtGraphics_GDI.cxx
+++ b/vcl/qt5/QtGraphics_GDI.cxx
@@ -25,9 +25,6 @@
 #include 
 
 #include 
-#include 
-#include 
-#include 
 
 #include 
 #include 
@@ -690,21 +687,4 @@ bool 
QtGraphicsBackend::supportsOperation(OutDevSupportType eType) const
 }
 }
 
-void QtGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
-{
-char* pForceDpi;
-if ((pForceDpi = 

core.git: vcl/inc vcl/qt5

2024-07-24 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtInstanceWidget.hxx |4 ++--
 vcl/qt5/QtInstanceWidget.cxx |   24 
 2 files changed, 22 insertions(+), 6 deletions(-)

New commits:
commit 7de061883ddd185e5f36fe39cab0326d8a73b947
Author: Michael Weghorn 
AuthorDate: Tue Jul 23 17:14:10 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 08:27:12 2024 +0200

tdf#130857 qt weld a11y: Implement getting/setting a11y name/desc

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

diff --git a/vcl/inc/qt5/QtInstanceWidget.hxx b/vcl/inc/qt5/QtInstanceWidget.hxx
index f5038ee5ad66..0e8ff5ccafc9 100644
--- a/vcl/inc/qt5/QtInstanceWidget.hxx
+++ b/vcl/inc/qt5/QtInstanceWidget.hxx
@@ -106,9 +106,9 @@ public:
 
 virtual int get_margin_end() const override;
 
-virtual void set_accessible_name(const OUString&) override;
+virtual void set_accessible_name(const OUString& rName) override;
 
-virtual void set_accessible_description(const OUString&) override;
+virtual void set_accessible_description(const OUString& rDescription) 
override;
 
 virtual OUString get_accessible_name() const override;
 
diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx
index 9c17ebe6cb1d..9c5c8864fd4b 100644
--- a/vcl/qt5/QtInstanceWidget.cxx
+++ b/vcl/qt5/QtInstanceWidget.cxx
@@ -93,13 +93,29 @@ int QtInstanceWidget::get_margin_start() const { return 1; }
 
 int QtInstanceWidget::get_margin_end() const { return 1; }
 
-void QtInstanceWidget::set_accessible_name(const OUString&) {}
+void QtInstanceWidget::set_accessible_name(const OUString& rName)
+{
+assert(m_pWidget);
+m_pWidget->setAccessibleName(toQString(rName));
+}
 
-void QtInstanceWidget::set_accessible_description(const OUString&) {}
+void QtInstanceWidget::set_accessible_description(const OUString& rDescription)
+{
+assert(m_pWidget);
+m_pWidget->setAccessibleDescription(toQString(rDescription));
+}
 
-OUString QtInstanceWidget::get_accessible_name() const { return OUString(); }
+OUString QtInstanceWidget::get_accessible_name() const
+{
+assert(m_pWidget);
+return toOUString(m_pWidget->accessibleName());
+}
 
-OUString QtInstanceWidget::get_accessible_description() const { return 
OUString(); }
+OUString QtInstanceWidget::get_accessible_description() const
+{
+assert(m_pWidget);
+return toOUString(m_pWidget->accessibleDescription());
+}
 
 void QtInstanceWidget::set_accessible_relation_labeled_by(weld::Widget*) {}
 


core.git: vcl/source

2024-07-23 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6ca02ef177df62edb124881248a1ebcd9876ff4c
Author: Michael Weghorn 
AuthorDate: Tue Jul 23 13:15:36 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:52:28 2024 +0200

icon choice ctrl: Drop unnecessary cast

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 6061f83b2773..22e41a967470 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1853,7 +1853,7 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const 
HelpEvent& rHEvt )
 sHelpText = sQuickHelpText;
 else
 sHelpText = aEntryText;
-Help::ShowQuickHelp( static_cast(pView), aOptTextRect, 
sHelpText, QuickHelpFlags::Left | QuickHelpFlags::VCenter );
+Help::ShowQuickHelp(pView, aOptTextRect, sHelpText, 
QuickHelpFlags::Left | QuickHelpFlags::VCenter);
 }
 
 return true;


core.git: vcl/source

2024-07-23 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl.hxx  |1 -
 vcl/source/control/imivctl1.cxx |   17 -
 2 files changed, 18 deletions(-)

New commits:
commit aebf3d38201521905f6b6739b723f04bb4e93c22
Author: Michael Weghorn 
AuthorDate: Tue Jul 23 11:48:53 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:45:34 2024 +0200

tdf#161501 icon choice ctrl: Don't modify bound rect to center content

Don't modify the bound rect of tab items used used e.g.
for drawing the focus/selection/mouse-hover rectangles/indicators
in order to center the content horizontally and vertically.

Making the bound rect smaller in vertical direction
in `SvxIconChoiceCtrl_Impl::Center` resulted in margins
between entries for the non-native drawing path (e.g. the
gen VCL plugin on Linux) for the text-only case
(e.g. "Format" -> "Page Style" dialog in Writer).

Making sure that the content is centered should rather
happen in the drawing routine.

Horizontally centering already happens for the icon-case
anyway, as the `PAINTFLAG_VER_CENTERED` gets passed as flag
to the `PaintItem` call for the `WB_ICON` case in
`SvxIconChoiceCtrl_Impl::PaintEntry` anyway.

And for text-only mode, which was apparently the only one
for which centering vertically in `SvxIconChoiceCtrl_Impl::Center`
had an effect, vertically drawing text was implemented in the drawing
code path in

commit 180f0c1ec8e195043b5f4298737a219026a8b944
Author: Rafael Lima 
Date:   Tue Jul 16 20:52:28 2024 +0200

tdf#161501 Improve visuals of selected entries in Vertical tabs

. This commit addresses the

>   For the gen VCL plugin, there's still a small gap between
>   text-only items (e.g. in the "Format" -> "Page Style" dialog
>   which has a different cause and will be addressed in a separate
>   commit.

aspect mentioned in earlier commit

Change-Id: Iac34098ef8d0f90f1ac0844df63839a6a99b83a7
Author: Michael Weghorn 
Date:   Mon Jul 22 11:39:48 2024 +0200

tdf#161501 icon choice ctrl: Drop extra space between items

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

diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index ae767baf4e50..9388208c0574 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -165,7 +165,6 @@ class SvxIconChoiceCtrl_Impl
 }
 voidInitScrollBarBox();
 voidDeselectAllBut( SvxIconChoiceCtrlEntry const * );
-voidCenter( SvxIconChoiceCtrlEntry* pEntry ) const;
 
 tools::Rectangle   CalcMaxTextRect( const SvxIconChoiceCtrlEntry* 
pEntry ) const;
 
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index f5f1767ba019..6061f83b2773 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1265,7 +1265,6 @@ void SvxIconChoiceCtrl_Impl::FindBoundingRect( 
SvxIconChoiceCtrlEntry* pEntry )
 
 tools::Rectangle aGridRect(aPos, Size(nGridDX, nGridDY));
 pEntry->aRect = aGridRect;
-Center( pEntry );
 AdjustVirtSize( pEntry->aRect );
 pGridMap->OccupyGrids( pEntry );
 }
@@ -1634,22 +1633,6 @@ void SvxIconChoiceCtrl_Impl::SetDefaultTextSize()
 aDefaultTextSize = Size(nDX, nDY);
 }
 
-
-void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const
-{
-Size aSize( CalcBoundingSize() );
-if( nWinBits & WB_ICON )
-{
-// center horizontally
-tools::Long nBorder = pEntry->aRect.GetWidth() - aSize.Width();
-pEntry->aRect.AdjustLeft(nBorder / 2 );
-pEntry->aRect.AdjustRight( -(nBorder / 2) );
-}
-// center vertically
-pEntry->aRect.SetBottom( pEntry->aRect.Top() + aSize.Height() );
-}
-
-
 // The deltas are the offsets by which the view is moved on the document.
 // left, up: offsets < 0
 // right, down: offsets > 0


core.git: 2 commits - include/vcl vcl/source

2024-07-23 Thread Michael Weghorn (via logerrit)
 include/vcl/toolkit/ivctrl.hxx  |1 -
 vcl/source/control/imivctl.hxx  |2 --
 vcl/source/control/imivctl1.cxx |   24 
 3 files changed, 4 insertions(+), 23 deletions(-)

New commits:
commit 7b645998e691c3a6279f5e5a7452981d77d29e20
Author: Michael Weghorn 
AuthorDate: Tue Jul 23 11:29:40 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:45:13 2024 +0200

tdf#161501 icon choice ctrl: Use a single member for entry rect

`SvxIconChoiceCtrlEntry` has two members for maintaining
the bound rect:

* `aRect`, used almost everywhere
* `aGridRect`, used very rarely

`SvxIconChoiceCtrl_Impl::FindBoundingRect` calculates
a new bounding rect and assigns it to `pEntry->aGridRect`,
then calls `SvxIconChoiceCtrl_Impl::Center`, which
at first assigns the same value to `pEntry->aRect`,
so both are the same there.

The other place using the `aGridRect` member is
`SvxIconChoiceCtrl_Impl::CalcMaxTextRect` where
it's used as a fallback if `aRect` has not been
assigned a proper value yet.

However, since `aGridRect` is never assigned a
useful value apart from `aRect`, there doesn't
seem to be much value in doing that, so use
`aRect` there, too, and drop the `aGridRect`
member altogether and assign directly to `aRect` in
`SvxIconChoiceCtrl_Impl::FindBoundingRect` instead.

Instead of falling back to `aGridRect` in
`SvxIconChoiceCtrl_Impl::CalcMaxTextRect`,
add an assert that `aRect` is valid instead,
which never triggered in my tests with the
"Insert" -> "Hyperlink" and "Format" -> "Page Style"
dialogs, so should presumably be fine already.

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

diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx
index 0944ce5001a8..9d0822fa4d6c 100644
--- a/include/vcl/toolkit/ivctrl.hxx
+++ b/include/vcl/toolkit/ivctrl.hxx
@@ -64,7 +64,6 @@ class SvxIconChoiceCtrlEntry
 friend class IcnGridMap_Impl;
 
 tools::Rectangle   aRect;  // Bounding-Rectangle 
of the entry
-tools::Rectangle   aGridRect;  // Only valid in 
Grid-mode
 
 SvxIconChoiceCtrlTextMode   eTextMode;
 sal_uInt16  nX,nY;  // for keyboard control
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 8046dc54caf8..f5f1767ba019 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1264,7 +1264,7 @@ void SvxIconChoiceCtrl_Impl::FindBoundingRect( 
SvxIconChoiceCtrlEntry* pEntry )
 Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid()).TopLeft());
 
 tools::Rectangle aGridRect(aPos, Size(nGridDX, nGridDY));
-pEntry->aGridRect = aGridRect;
+pEntry->aRect = aGridRect;
 Center( pEntry );
 AdjustVirtSize( pEntry->aRect );
 pGridMap->OccupyGrids( pEntry );
@@ -1574,12 +1574,8 @@ void SvxIconChoiceCtrl_Impl::SetGrid( const Size& rSize )
 
 tools::Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const 
SvxIconChoiceCtrlEntry* pEntry ) const
 {
-tools::Rectangle aBoundRect;
-// avoid infinite recursion: don't calculate the bounding rectangle here
-if( IsBoundingRectValid( pEntry->aRect ) )
-aBoundRect = pEntry->aRect;
-else
-aBoundRect = pEntry->aGridRect;
+assert(IsBoundingRectValid(pEntry->aRect) && "Bounding rect for entry 
hasn't been calculated yet.");
+tools::Rectangle aBoundRect = pEntry->aRect;
 
 tools::Rectangle aBmpRect( 
const_cast(this)->CalcBmpRect(
 const_cast(pEntry) ) );
@@ -1641,12 +1637,11 @@ void SvxIconChoiceCtrl_Impl::SetDefaultTextSize()
 
 void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const
 {
-pEntry->aRect = pEntry->aGridRect;
 Size aSize( CalcBoundingSize() );
 if( nWinBits & WB_ICON )
 {
 // center horizontally
-tools::Long nBorder = pEntry->aGridRect.GetWidth() - aSize.Width();
+tools::Long nBorder = pEntry->aRect.GetWidth() - aSize.Width();
 pEntry->aRect.AdjustLeft(nBorder / 2 );
 pEntry->aRect.AdjustRight( -(nBorder / 2) );
 }
commit 14e1f10793d1ec994ab70f928feeecdb384a307e
Author: Michael Weghorn 
AuthorDate: Tue Jul 23 11:09:21 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:45:04 2024 +0200

tdf#161501 Drop unused SvxIconChoiceCtrl_Impl::InvalidateEntry

Unused since:

Change-Id: If309f84fcd9a99337bc5896ce5c3238333427da5
Author: Michael Weghorn 
Date:   Tue Jul 23 11:00:42 2024 +0200

tdf#161501 icon choice ctrl: Drop debug-only mode switch feature

Drop code that allows switching the text mode of
the currently selected tab item in a vertical tab
  

core.git: 2 commits - vcl/source

2024-07-23 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl.hxx  |7 ---
 vcl/source/control/imivctl1.cxx |   31 ---
 2 files changed, 38 deletions(-)

New commits:
commit c8234947b60d320565fe0ca843e095858eb9975a
Author: Michael Weghorn 
AuthorDate: Tue Jul 23 11:00:42 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:44:55 2024 +0200

tdf#161501 icon choice ctrl: Drop debug-only mode switch feature

Drop code that allows switching the text mode of
the currently selected tab item in a vertical tab
bar using Shift+F10 or Ctrl+F10, which is only
available in dbgutil builds, and was therefore
likely meant to be used for debugging purposes
only.

As related code will be changed in a follow-up
commit, this would have to be adjusted to keep
it working. Instead of spending time on that,
just drop it. Testing how using another mode is still
possible e.g. by locally changing the value assigned
to `SvxIconChoiceCtrlEntry::eTextMode` in the
`SvxIconChoiceCtrlEntry` ctor instead.

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

diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index 6eed1911ce6e..505f32d3e960 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -277,12 +277,6 @@ public:
 bool bInScrollBarEvent=false
 );
 
-#ifdef DBG_UTIL
-voidSetEntryTextMode(
-SvxIconChoiceCtrlTextMode,
-SvxIconChoiceCtrlEntry& rEntry
-);
-#endif
 size_t  GetEntryCount() const { return maEntries.size(); }
 SvxIconChoiceCtrlEntry* GetEntry( size_t nPos )
 {
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index a61e6cd357ab..eb1b576e044f 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -623,22 +623,6 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& 
rKEvt )
 
 case KEY_SPACE:
 break;
-
-#ifdef DBG_UTIL
-case KEY_F10:
-if( rKEvt.GetKeyCode().IsShift() )
-{
-if( pCursor )
-SetEntryTextMode(SvxIconChoiceCtrlTextMode::Full, 
*pCursor);
-}
-if( rKEvt.GetKeyCode().IsMod1() )
-{
-if( pCursor )
-SetEntryTextMode(SvxIconChoiceCtrlTextMode::Short, 
*pCursor);
-}
-break;
-#endif
-
 case KEY_ADD:
 case KEY_DIVIDE :
 case KEY_A:
@@ -1715,19 +1699,6 @@ IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, 
DocRectChangedHdl, Timer *, void)
 aDocRectChangedIdle.Stop();
 }
 
-#ifdef DBG_UTIL
-void SvxIconChoiceCtrl_Impl::SetEntryTextMode(SvxIconChoiceCtrlTextMode eMode, 
SvxIconChoiceCtrlEntry& rEntry)
-{
-if (rEntry.eTextMode != eMode)
-{
-rEntry.eTextMode = eMode;
-InvalidateEntry( );
-pView->Invalidate(GetEntryBoundRect());
-AdjustVirtSize(rEntry.aRect);
-}
-}
-#endif
-
 // Draw my own focusrect, because the focusrect of the outputdevice has got 
the inverted color
 // of the background. But what will we see, if the backgroundcolor is gray ? - 
We will see
 // a gray focusrect on a gray background !!!
commit efd060187aadb768f12a5b5e510db9e6e7687e23
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 11:39:48 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:44:42 2024 +0200

tdf#161501 icon choice ctrl: Drop extra space between items

Drop the extra spacing between vertical tab bar items, which
became quite noticeable as extra white area between the otherwise
light-grey entries when using the Breeze (light) style and the
kf5 VCL plugin for the "Insert" -> "Hyperlink" dialog now that
the tab items are drawn natively since

Change-Id: Ie0c8ba1b56f6bb76ece6761253b93a109bb3a3f4
Author: Michael Weghorn 
Date:   Mon Jul 22 11:05:30 2024 +0200

tdf#161501 icon choice ctrl: Draw whole entry natively

and which is also more visible for non-natively drawn items
since

Change-Id: I578755a8a82ea811765b2e0dc3815fb47f67863c
Author: Michael Weghorn 
Date:   Tue Jul 23 10:41:16 2024 +0200

tdf#161501 icon choice ctrl: Draw selection within item bounds

With this in place, the extra margin between entries
in tab items with icons in the "Insert" -> "Hyperlink"
dialog in Writer is gone for both, the gen VCL plugin
and the kf5 one (tested with the Breeze style).

For the gen VCL plugin, there's still a small gap between
text-only items (e.g. in the "Format" -> "Page Style" dialog
which has a different 

core.git: 2 commits - vcl/source

2024-07-23 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl.hxx  |4 ++--
 vcl/source/control/imivctl1.cxx |   35 +++
 2 files changed, 9 insertions(+), 30 deletions(-)

New commits:
commit 42024245c72d44104ebd26bae3c601de7a876eea
Author: Michael Weghorn 
AuthorDate: Tue Jul 23 10:41:16 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:43:52 2024 +0200

tdf#161501 icon choice ctrl: Draw selection within item bounds

In the same way that the calculated focus rect of an item
is used for drawing selection and focus indicators, use
it for mouse-hover highlighting as well, instead of
drawing a rectangle that reaches beyond the bounds
of the item itself for the non-native drawing path
of vertical tab bar items.

With this in place, hovering over an entry other than
the selected/focused one now shows a rectangle of the same
size as that for the focused entry, which is more
consistent and also aligns this with the case
where the native drawing API for drawing the item is used,
e.g. on Windows or with the kf5 VCL plugin on Linux.

This also means that a small gap can now be seen
between selected item and mouse-hovered item when
hovering over an item next to the currently selected
one for the gen VCL plugin as well, just as was
already the case before for the kf5 VCL plugin.
(Dropping that extra margin will happen in a
separate commit.)

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

diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index d114d66f74e9..d02b0299cd6e 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -299,7 +299,7 @@ public:
 tools::Rectangle   GetOutputRect() const;
 
 voidSetEntryHighlightFrame(SvxIconChoiceCtrlEntry* pEntry);
-voidDrawHighlightFrame(vcl::RenderContext& rRenderContext, 
const tools::Rectangle& rBmpRect);
+static void DrawHighlightFrame(vcl::RenderContext& rRenderContext, 
const tools::Rectangle& rRect);
 
 voidCallEventListeners( VclEventId nEvent, void* pData );
 
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 83e12b812b23..8ecf9cf16656 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1923,19 +1923,11 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const 
HelpEvent& rHEvt )
 return true;
 }
 
-void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& 
rRenderContext, const tools::Rectangle& rBmpRect)
+void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& 
rRenderContext,
+const tools::Rectangle& rRect)
 {
-tools::Rectangle aBmpRect(rBmpRect);
-tools::Long nBorder = 2;
-if (aImageSize.Width() < 32)
-nBorder = 1;
-aBmpRect.AdjustRight(nBorder );
-aBmpRect.AdjustLeft( -nBorder );
-aBmpRect.AdjustBottom(nBorder );
-aBmpRect.AdjustTop( -nBorder );
-
 DecorationView aDecoView();
-aDecoView.DrawHighlightFrame(aBmpRect, DrawHighlightFrameStyle::Out);
+aDecoView.DrawHighlightFrame(rRect, DrawHighlightFrameStyle::Out);
 }
 
 void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame(SvxIconChoiceCtrlEntry* 
pEntry)
commit 22a2ddcb77ea33fb5df0e62849a60d15cfe6e8fa
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 11:31:44 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:43:44 2024 +0200

tdf#161501 icon choice ctrl: Consistently use bound rect

In `SvxIconChoiceCtrl_Impl::MakeEntryVisible`, always use
the bound rect as the area to make visible.

I see no reason to not do so when an entry is clicked
(s `SvxIconChoiceCtrl_Impl::MouseButtonDown`, which is
the only case that didn't do it yet.

Drop the `bBound` param accordingly.

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

diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index e693136fb7fa..d114d66f74e9 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -233,7 +233,7 @@ public:
 
 SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos );
 
-voidMakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, bool 
bBound = true );
+voidMakeEntryVisible(SvxIconChoiceCtrlEntry* pEntry);
 
 voidArrange(tools::Long nSetMaxVirtHeight);
 
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index af354bc5ba59..83e12b812b23 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -463,7 +463,7 @@ bool 

core.git: 2 commits - vcl/source

2024-07-23 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl1.cxx |   81 ++--
 1 file changed, 29 insertions(+), 52 deletions(-)

New commits:
commit 766417d8d7de5fe3b082add4094781eadcaab072
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 11:22:42 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:43:35 2024 +0200

tdf#161501 icon choice ctrl: OSL_FAIL -> assert

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 6b5216d5ff14..af354bc5ba59 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1161,7 +1161,7 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcBmpRect( 
SvxIconChoiceCtrlEntry* pE
 return tools::Rectangle( aPos, aImageSize );
 
 default:
-OSL_FAIL("IconView: Viewmode not set");
+assert(false && "IconView: Viewmode not set");
 return aBound;
 }
 }
commit c59730b46b4d7dd0af0c49ecbc852cda2871a5a0
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 11:05:30 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:43:27 2024 +0200

tdf#161501 icon choice ctrl: Draw whole entry natively

When native drawing of tab items is supported,
natively draw the whole (vertical) tab item (except for the
text) in `SvxIconChoiceCtrl_Impl::PaintEntry`,
instead of using native drawing API only for highlighting
the mouse-hovered entry, as originally introduced in

commit 8708e8cf90d0ac0acbbce34b82f10ef7352d5062
Author: Michael Weghorn 
Date:   Thu Jul 11 10:47:50 2024 +0200

tdf#161026 tdf#161355 tdf#161501 icon choice ctrl: Natively draw 
mouse-hover

... feedback.

Set the corresponding state flags for selected and
focused entry, so that the native drawing routine
can take care of drawing the selected/focused
entry accordingly instead of using the native drawing
API to draw a `ControlType::WindowBackground` for that
purpose.

With this commit in place, all entries (not just the
mouse-hovered, focused or selected) entry are now
drawn using the native drawing API.

For the kf5 VCL plugin with the Breeze style, this
makes them look similar to the entries for the
non-vertical tabbar used elsewhere in LibreOffice,
or actual native `QTabBar`s.

Due to

Change-Id: Idf1e41d3bc309d152a4a36d14e8617bd6429940c
Author: Michael Weghorn 
Date:   Mon Jul 22 08:25:32 2024 +0200

tdf#161501 vcl: Make TabitemValue position-aware

, the selection indicator is drawn vertically as expected
when using the Breeze style.

Restrict manually drawing entries (including focus
and selection indicator) to the case where native drawing
is not implemented (e.g. the gen VCL plugin).

Further tweaking the visual appearance (e.g.
getting rid of extra white margins and space between the
entries for the variant where icons are used,
like the "Insert" -> "Hyperlink" dialog in Writer) can be
done in separate commits.

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index f32af05ac19c..6b5216d5ff14 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1048,68 +1048,45 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 nBmpPaintFlags |= PAINTFLAG_HOR_CENTERED;
 sal_uInt16 nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : 
PAINTFLAG_VER_CENTERED;
 
-// Background of selected entry
 tools::Rectangle aFocusRect(CalcFocusRect(pEntry));
-bool bNativeSelection = 
rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, 
ControlPart::Entire);
-if (bSelected)
-{
-if (bNativeSelection)
-{
-ControlState nState = ControlState::ENABLED;
-ImplControlValue aControlValue(0);
-bNativeSelection = 
rRenderContext.DrawNativeControl(ControlType::WindowBackground, 
ControlPart::Entire,
-aFocusRect, 
nState, aControlValue, OUString());
-}
 
-if (bNativeSelection)
-{
-// If a native control was drawn, then draw a mark at the left 
side of the selected tab
-aFocusRect.setWidth(TAB_MARK_WIDTH);
-Color aOldFillColor(rRenderContext.GetFillColor());
-Color aOldLineColor(rRenderContext.GetLineColor());
-Color 

core.git: 2 commits - vcl/source

2024-07-23 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl.hxx  |8 +---
 vcl/source/control/imivctl1.cxx |   34 ++
 2 files changed, 15 insertions(+), 27 deletions(-)

New commits:
commit 72408ffd0673894da48ae344653af3b5c6c93775
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 09:49:38 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:43:19 2024 +0200

tdf#161501 icon choice ctrl: Merge two methods

Merge `SetBoundingRect_Impl` into
`SvxIconChoiceCtrl_Impl::FindBoundingRect` as that is the
only caller.

`SvxIconChoiceCtrl_Impl::SetBoundingRect_Impl` was ignoring
the bounding size being passed.
To be sure, still call `CalcBoundingSize` at the beginning
even though the return value itself is not used,
as the call to `SvxIconChoiceCtrl_Impl::CalcBoundingHeight`
that it does can result in class members like
`nMaxBoundHeight` getting updated.

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

diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index 9bd81e4fda5a..e693136fb7fa 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -248,11 +248,6 @@ public:
 tools::LongCalcBoundingHeight() const;
 SizeCalcBoundingSize() const;
 voidFindBoundingRect( SvxIconChoiceCtrlEntry* pEntry );
-voidSetBoundingRect_Impl(
-SvxIconChoiceCtrlEntry* pEntry,
-const Point& rPos,
-const Size& rBoundingSize
-);
 // recalculates all invalid BoundRects
 voidRecalcAllBoundingRectsSmart();
 const tools::Rectangle&GetEntryBoundRect( SvxIconChoiceCtrlEntry* );
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index d3e91f194a3f..f32af05ac19c 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1312,15 +1312,10 @@ void 
SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart()
 
 void SvxIconChoiceCtrl_Impl::FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry )
 {
-Size aSize( CalcBoundingSize() );
+CalcBoundingSize();
 Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid()).TopLeft());
-SetBoundingRect_Impl( pEntry, aPos, aSize );
-}
 
-void SvxIconChoiceCtrl_Impl::SetBoundingRect_Impl( SvxIconChoiceCtrlEntry* 
pEntry, const Point& rPos,
-const Size& /*rBoundingSize*/ )
-{
-tools::Rectangle aGridRect( rPos, Size(nGridDX, nGridDY) );
+tools::Rectangle aGridRect(aPos, Size(nGridDX, nGridDY));
 pEntry->aGridRect = aGridRect;
 Center( pEntry );
 AdjustVirtSize( pEntry->aRect );
commit 3f1c3a0faa6e0023e326f88d1bd9b84aef386a7e
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 09:21:28 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:43:10 2024 +0200

tdf#161501 Drop bSelected param for SvxIconChoiceCtrl_Impl::PaintEmphasis

The method doesn't do anything for `bSelected = true`,
so drop the param, and only call it for the `bSelected = false`
case in `SvxIconChoiceCtrl_Impl::PaintEntry` instead.

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

diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index e616215bc7ef..9bd81e4fda5a 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -263,8 +263,7 @@ public:
 }
 static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { 
return ( rRect.Right() != LONG_MAX ); }
 
-static void PaintEmphasis(const tools::Rectangle& rRect1, bool 
bSelected,
-  vcl::RenderContext& rRenderContext );
+static void PaintEmphasis(const tools::Rectangle& rRect1, 
vcl::RenderContext& rRenderContext);
 
 voidPaintItem(const tools::Rectangle& rRect, 
IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry,
 sal_uInt16 nPaintFlags, vcl::RenderContext& 
rRenderContext);
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 5a79779e4dd2..d3e91f194a3f 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -959,20 +959,17 @@ void SvxIconChoiceCtrl_Impl::LoseFocus()
 }
 
 // priorities of the emphasis:  bSelected
-void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect, 
bool bSelected,
+void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect,
vcl::RenderContext& rRenderContext)
 {
-if (!bSelected)
-{
-Color 

core.git: 2 commits - vcl/source

2024-07-23 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl1.cxx |   20 
 1 file changed, 4 insertions(+), 16 deletions(-)

New commits:
commit 9288e66770adc0cb5eda2dc3e242da1472172def
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 09:13:00 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:43:02 2024 +0200

tdf#161501 icon choice ctrl: Simplify and drop extra local variable

No need to have a `bSolidTextRect` variable here,
just do the relevant call right away.

That also means that there's no need to save
and restore the previous fill color for the
`bSelected = true` case (it never gets changed),
so move that into the if block as well.

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index a7abd0af7743..5a79779e4dd2 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -962,25 +962,17 @@ void SvxIconChoiceCtrl_Impl::LoseFocus()
 void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect, 
bool bSelected,
vcl::RenderContext& rRenderContext)
 {
-Color aOldFillColor(rRenderContext.GetFillColor());
-
-bool bSolidTextRect = false;
-
 if (!bSelected)
 {
+Color aOldFillColor(rRenderContext.GetFillColor());
 const Color& rFillColor = rRenderContext.GetFont().GetFillColor();
 rRenderContext.SetFillColor(rFillColor);
+// draw text rectangle
 if (rFillColor != COL_TRANSPARENT)
-bSolidTextRect = true;
-}
+rRenderContext.DrawRect(rTextRect);
 
-// draw text rectangle
-if (bSolidTextRect)
-{
-rRenderContext.DrawRect(rTextRect);
+rRenderContext.SetFillColor(aOldFillColor);
 }
-
-rRenderContext.SetFillColor(aOldFillColor);
 }
 
 
commit 3720078422b2c44faf8c4cbb53f4aa09875ad0bc
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 08:59:14 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:42:53 2024 +0200

tdf#161501 icon choice ctrl: Drop extra drawing of entry bg

Drop extra drawing of a rectangle with the background
color just for selected entries.

It's unclear why that is done, and why it's done
only for selected entries, since the background
color used here is unrelated to actual selection
(e.g. is just white when using the gen VCL plugin
or kf5 with the light Breeze theme).

Drawing of the actual selection background
happens further down.
Therefore, drop drawing that extra rectangle
to simplify code and having one place less
to care about when switching to using native
drawing for the whole entry in an upcoming
commit.

I see no visual difference with or without
this commit in place with either gen or kf5
with either the "Insert -> "Hyperlink" or the
"Format" -> "Page Style" vertical tab pages
dialogs in Writer.

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 7dec9e192ec7..a7abd0af7743 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1040,10 +1040,6 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 aNewFont.SetColor(rSettings.GetTabHighlightTextColor());
 
 rRenderContext.SetFont(aNewFont);
-
-rRenderContext.SetFillColor(rRenderContext.GetBackground().GetColor());
-rRenderContext.DrawRect(CalcFocusRect(pEntry));
-rRenderContext.SetFillColor();
 }
 
 bool bResetClipRegion = false;


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

2024-07-23 Thread Michael Weghorn (via logerrit)
 include/vcl/salnativewidgets.hxx |   13 -
 vcl/qt5/QtGraphics_Controls.cxx  |   20 
 vcl/source/control/imivctl1.cxx  |8 +++-
 vcl/source/control/tabctrl.cxx   |   12 +++-
 4 files changed, 42 insertions(+), 11 deletions(-)

New commits:
commit a82e98f60e37d1b1d507df6645588e19a82dc72e
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 08:28:56 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:42:43 2024 +0200

tdf#161501 icon choice ctrl: Drop handling for WB_NOHIDESELECTION

`WB_NOHIDESELECTION` never gets set for `SvxIconChoiceCtrl_Impl`,
which is only used by `SvtIconChoiceCtrl` to implement
the vertical tab bar.
Therefore, drop handling for that flag to simplify code.

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index ec1e5cd6772d..7dec9e192ec7 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1023,8 +1023,6 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 tools::Rectangle aTextRect(CalcTextRect(pEntry, ));
 tools::Rectangle aBmpRect(CalcBmpRect(pEntry, ));
 
-bool bActiveSelection = (0 != (nWinBits & WB_NOHIDESELECTION)) || 
pView->HasFocus();
-
 const bool bMouseHovered = pEntry == pCurHighlightFrame;
 const bool bSelected = pEntry->IsSelected();
 if (bSelected)
@@ -1034,7 +1032,7 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 
 // font fill colors that are attributed "hard" need corresponding 
"hard"
 // attributed highlight colors
-if ((nWinBits & WB_NOHIDESELECTION) || pView->HasFocus())
+if (pView->HasFocus())
 aNewFont.SetFillColor(rSettings.GetHighlightColor());
 else
 aNewFont.SetFillColor(rSettings.GetDeactiveColor());
@@ -1096,7 +1094,7 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 else
 {
 vcl::RenderTools::DrawSelectionBackground(rRenderContext, *pView, 
aFocusRect,
-  bActiveSelection ? 1 : 
2, false, false, false);
+  pView->HasFocus() ? 1 : 
2, false, false, false);
 }
 }
 
commit 92454bca2045b9e9ca636d086cb8520ccf03be22
Author: Michael Weghorn 
AuthorDate: Mon Jul 22 08:25:32 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 24 05:42:34 2024 +0200

tdf#161501 vcl: Make TabitemValue position-aware

Add a new `TabBarPosition` enum that describes whether
a tab bar is at the top, left, right, or bottom
(relative to the tab page content) and make use of
that for the new `meTabBarPosition` member for
`TabitemValue` that gets used for drawing tab items
via the native rendering API.

Set the position accordingly for both the vertical
tab control (`TabControl`) and `SvxIconChoiceCtrl_Impl`,
which implements the tab bar for `VerticalTabControl`.

For Qt-based VCL plugins, implement mapping to
the corresponding `QTabBar::Shape`. [1]

At least the Breeze Qt style uses that shape to decide
whether on what side of the tab item to draw the
selection/focus indicator.

This change by itself doesn't yet make any visual
difference for the Breeze style, as the "Top" value/
`QTabBar::RoundedNorth` is the default anyway, and
`SvxIconChoiceCtrl_Impl` doesn't yet use the
native drawing API for drawing focus/selection, but
only for mousehover feedback.
The plan is to implement that in a follow-up change.

[1] https://doc.qt.io/qt-6/qtabbar.html#Shape-enum

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

diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
index aa856a16c35d..68fae745e757 100644
--- a/include/vcl/salnativewidgets.hxx
+++ b/include/vcl/salnativewidgets.hxx
@@ -384,16 +384,27 @@ namespace o3tl
 template<> struct typed_flags : is_typed_flags {};
 }
 
+/* Tab bar position (relative to content on the tab page). */
+enum class TabBarPosition
+{
+Top,
+Left,
+Right,
+Bottom
+};
+
 class SAL_DLLPUBLIC_RTTI TabitemValue final : public ImplControlValue
 {
 public:
 TabitemFlagsmnAlignment;
 tools::Rectangle   maContentRect;
+TabBarPosition meTabBarPosition;
 
-TabitemValue(const tools::Rectangle )
+TabitemValue(const tools::Rectangle , TabBarPosition 
eTabBarPosition)
 : ImplControlValue( ControlType::TabItem, 0 )
 , 

core.git: Branch 'libreoffice-24-8' - android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/LOKitTileProvider.java |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 6190fbff58d847bb2759c928966677df304ba371
Author: Michael Weghorn 
AuthorDate: Wed Jul 17 09:40:13 2024 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Jul 20 06:00:46 2024 +0200

android: Handle cursor keys

In Android Viewer, forward the left/right/up/down keys
as such by adding the corresponding mapping to
`LOKitTileProvider#getKeyCode`.

This allows navigating through the document using those
keys e.g. on a hardware keyboard.

This addresses this comment from a Google Play Review:

> Editing, the cursor doesn't respond to the cursor keys

Change-Id: I688e5d0cc1db4f9315f9c9cb2139c22117a210e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170605
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 053d9feec432ca4dff4d85593d9cad0d975388b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170561
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java 
b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index c8a055206dd0..bbdc9456cf4c 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -11,7 +11,6 @@ package org.libreoffice;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.PointF;
-import android.os.Build;
 import android.print.PrintAttributes;
 import android.print.PrintDocumentAdapter;
 import android.print.PrintManager;
@@ -630,6 +629,14 @@ class LOKitTileProvider implements TileProvider {
 switch (keyEvent.getKeyCode()) {
 case KeyEvent.KEYCODE_DEL:
 return com.sun.star.awt.Key.BACKSPACE;
+case KeyEvent.KEYCODE_DPAD_DOWN:
+return com.sun.star.awt.Key.DOWN;
+case KeyEvent.KEYCODE_DPAD_LEFT:
+return com.sun.star.awt.Key.LEFT;
+case KeyEvent.KEYCODE_DPAD_RIGHT:
+return com.sun.star.awt.Key.RIGHT;
+case KeyEvent.KEYCODE_DPAD_UP:
+return com.sun.star.awt.Key.UP;
 case KeyEvent.KEYCODE_ENTER:
 return com.sun.star.awt.Key.RETURN;
 }


core.git: Branch 'libreoffice-24-2' - android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/LOKitTileProvider.java |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 58a533ee6bab11a157184aec47a39588ec63add2
Author: Michael Weghorn 
AuthorDate: Wed Jul 17 09:40:13 2024 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Jul 20 06:00:55 2024 +0200

android: Handle cursor keys

In Android Viewer, forward the left/right/up/down keys
as such by adding the corresponding mapping to
`LOKitTileProvider#getKeyCode`.

This allows navigating through the document using those
keys e.g. on a hardware keyboard.

This addresses this comment from a Google Play Review:

> Editing, the cursor doesn't respond to the cursor keys

Change-Id: I688e5d0cc1db4f9315f9c9cb2139c22117a210e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170605
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 053d9feec432ca4dff4d85593d9cad0d975388b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170562
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java 
b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index 5d1cf12209dc..627bd906d0e6 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -11,7 +11,6 @@ package org.libreoffice;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.PointF;
-import android.os.Build;
 import android.print.PrintAttributes;
 import android.print.PrintDocumentAdapter;
 import android.print.PrintManager;
@@ -629,6 +628,14 @@ class LOKitTileProvider implements TileProvider {
 switch (keyEvent.getKeyCode()) {
 case KeyEvent.KEYCODE_DEL:
 return com.sun.star.awt.Key.BACKSPACE;
+case KeyEvent.KEYCODE_DPAD_DOWN:
+return com.sun.star.awt.Key.DOWN;
+case KeyEvent.KEYCODE_DPAD_LEFT:
+return com.sun.star.awt.Key.LEFT;
+case KeyEvent.KEYCODE_DPAD_RIGHT:
+return com.sun.star.awt.Key.RIGHT;
+case KeyEvent.KEYCODE_DPAD_UP:
+return com.sun.star.awt.Key.UP;
 case KeyEvent.KEYCODE_ENTER:
 return com.sun.star.awt.Key.RETURN;
 }


core.git: android/Bootstrap

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 9a3018ee0bbf6e4a1c99f622fa9920d5bdb1ed46
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:35:06 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 18:32:15 2024 +0200

android: Drop unused import

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

diff --git a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java 
b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
index f7597c29a86c..2ccf4a9f9c5d 100644
--- a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
+++ b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
@@ -14,7 +14,6 @@ import android.content.pm.ApplicationInfo;
 import android.content.res.AssetManager;
 import android.util.Log;
 
-import java.io.InputStream;
 import java.nio.ByteBuffer;
 
 // Native methods in this class are all implemented in


core.git: 3 commits - android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/TextLayer.java   |   69 ---
 android/source/src/java/org/mozilla/gecko/gfx/TileLayer.java   |2 
 android/source/src/java/org/mozilla/gecko/gfx/ViewportMetrics.java |  173 
--
 3 files changed, 1 insertion(+), 243 deletions(-)

New commits:
commit 2546dd1b28855c97fde9994925cf4279371de672
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:32:28 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 18:32:09 2024 +0200

android: Drop unused ViewportMetrics class

There's still the `ImmutableViewportMetrics` class that
actually gets used.

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

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/ViewportMetrics.java 
b/android/source/src/java/org/mozilla/gecko/gfx/ViewportMetrics.java
deleted file mode 100644
index f8b5c2e055dc..
--- a/android/source/src/java/org/mozilla/gecko/gfx/ViewportMetrics.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * 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/. */
-
-package org.mozilla.gecko.gfx;
-
-import android.graphics.PointF;
-import android.graphics.RectF;
-import android.util.DisplayMetrics;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * ViewportMetrics manages state and contains some utility functions related to
- * the page viewport for the Gecko layer client to use.
- */
-public class ViewportMetrics {
-private static final String LOGTAG = "GeckoViewportMetrics";
-
-private RectF mPageRect;
-private RectF mCssPageRect;
-private RectF mViewportRect;
-private float mZoomFactor;
-
-public ViewportMetrics(DisplayMetrics metrics) {
-mPageRect = new RectF(0, 0, metrics.widthPixels, metrics.heightPixels);
-mCssPageRect = new RectF(0, 0, metrics.widthPixels, 
metrics.heightPixels);
-mViewportRect = new RectF(0, 0, metrics.widthPixels, 
metrics.heightPixels);
-mZoomFactor = 1.0f;
-}
-
-public ViewportMetrics(ViewportMetrics viewport) {
-mPageRect = new RectF(viewport.getPageRect());
-mCssPageRect = new RectF(viewport.getCssPageRect());
-mViewportRect = new RectF(viewport.getViewport());
-mZoomFactor = viewport.getZoomFactor();
-}
-
-public ViewportMetrics(ImmutableViewportMetrics viewport) {
-mPageRect = new RectF(viewport.pageRectLeft,
-viewport.pageRectTop,
-viewport.pageRectRight,
-viewport.pageRectBottom);
-mCssPageRect = new RectF(viewport.cssPageRectLeft,
-viewport.cssPageRectTop,
-viewport.cssPageRectRight,
-viewport.cssPageRectBottom);
-mViewportRect = new RectF(viewport.viewportRectLeft,
-viewport.viewportRectTop,
-viewport.viewportRectRight,
-viewport.viewportRectBottom);
-mZoomFactor = viewport.zoomFactor;
-}
-
-public ViewportMetrics(JSONObject json) throws JSONException {
-float x = (float)json.getDouble("x");
-float y = (float)json.getDouble("y");
-float width = (float)json.getDouble("width");
-float height = (float)json.getDouble("height");
-float pageLeft = (float)json.getDouble("pageLeft");
-float pageTop = (float)json.getDouble("pageTop");
-float pageRight = (float)json.getDouble("pageRight");
-float pageBottom = (float)json.getDouble("pageBottom");
-float cssPageLeft = (float)json.getDouble("cssPageLeft");
-float cssPageTop = (float)json.getDouble("cssPageTop");
-float cssPageRight = (float)json.getDouble("cssPageRight");
-float cssPageBottom = (float)json.getDouble("cssPageBottom");
-float zoom = (float)json.getDouble("zoom");
-
-mPageRect = new RectF(pageLeft, pageTop, pageRight, pageBottom);
-mCssPageRect = new RectF(cssPageLeft, cssPageTop, cssPageRight, 
cssPageBottom);
-mViewportRect = new RectF(x, y, x + width, y + height);
-mZoomFactor = zoom;
-}
-
-public ViewportMetrics(float x, float y, float width, float height,
-   float pageLeft, float pageTop, float pageRight, 
float pageBottom,
-   float cssPageLeft, float cssPageTop, float 
cssPageRight, float cssPageBottom,
-   float zoom) {
-mPageRect = new RectF(pageLeft, pageTop, pageRight, pageBottom);
-mCssPageRect = new RectF(cssPageLeft, cssPageTop, cssPageRight, 
cssPageBottom);
-mViewportRect = new RectF(x, y, x + width, y + height);
-

core.git: 3 commits - android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/IntSize.java|
4 
 android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java  |
1 -
 android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java  |
1 -
 android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java |
2 --
 android/source/src/java/org/mozilla/gecko/gfx/SubTile.java|
2 --
 5 files changed, 10 deletions(-)

New commits:
commit 74d1b4e2d6183d641300653c9ba6786de12ae470
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:26:41 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 18:31:48 2024 +0200

android: Drop unused local var

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

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/SubTile.java 
b/android/source/src/java/org/mozilla/gecko/gfx/SubTile.java
index bdad37195d90..d2b0bf9e8114 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/SubTile.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/SubTile.java
@@ -169,8 +169,6 @@ public class SubTile extends Layer {
 
 bindAndSetGLParameters();
 
-IntSize bufferSize = mImage.getSize();
-
 GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, glInfo.internalFormat,
 mSize.width, mSize.height, 0, glInfo.format, glInfo.type, 
imageBuffer);
 
commit d8f08430c1b416fc57fd613def060b13f905a591
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:23:16 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 18:31:43 2024 +0200

android: Drop unused imports

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

diff --git 
a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java 
b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
index b20d602a21cb..063975abf947 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
@@ -7,7 +7,6 @@ package org.mozilla.gecko.gfx;
 
 import android.graphics.PointF;
 import android.graphics.RectF;
-import android.os.Build;
 import android.util.Log;
 import android.view.GestureDetector;
 import android.view.InputDevice;
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 6ea7dd0edc10..be8f22c5348f 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -20,7 +20,6 @@ import org.mozilla.gecko.gfx.Layer.RenderContext;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
 import java.util.concurrent.CopyOnWriteArrayList;
 
 import javax.microedition.khronos.egl.EGLConfig;
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 5c74d56a004b..4a205123ed4b 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java
@@ -4,8 +4,6 @@ import android.opengl.GLSurfaceView;
 
 import java.util.concurrent.LinkedBlockingQueue;
 
-import javax.microedition.khronos.opengles.GL10;
-
 /**
  * Thread which controls the rendering to OpenGL context. Render commands are 
queued and
  * processed and delegated by this thread.
commit f9f1e215cb61aea91d3e22cb5b91603a5d78c203
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:22:10 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 18:31:37 2024 +0200

android: Drop unused IntSize#nextPowerOfTwo(float)

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

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/IntSize.java 
b/android/source/src/java/org/mozilla/gecko/gfx/IntSize.java
index b0741d2f68d6..72fa6ad51c2d 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/IntSize.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/IntSize.java
@@ -62,10 +62,6 @@ public class IntSize {
 return value + 1;
 }
 
-public static int nextPowerOfTwo(float value) {
-return nextPowerOfTwo((int) value);
-}
-
 public IntSize nextPowerOfTwo() {
 return new IntSize(nextPowerOfTwo(width), nextPowerOfTwo(height));
 }


core.git: include/LibreOfficeKit

2024-07-19 Thread Michael Weghorn (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitGtk.h |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ed984edae683d82132af6b12e1328a8e3cd67c93
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 09:54:43 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 13:27:16 2024 +0200

libreofficekitgtk: Add include for SAL_DLLPUBLIC_EXPORT

`SAL_DLLPUBLIC_EXPORT` is defined in `include/sal/types.h`,
so add a corresponding include in
`include/LibreOfficeKit/LibreOfficeKitGtk.h` before using it.

Without this, Qt Creator's Clang code model would'nt find it,
resulting in errors like


.../libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx:15: 
error: In included file: unknown type name 'SAL_DLLPUBLIC_EXPORT'

being shown when editing the file
`libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx`
in Qt Creator.

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

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 26b1178c2667..3365fd10e47f 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -17,6 +17,7 @@
 
  // Avoid "error C2375: 'foo': redefinition; different linkage" on MSVC
 #if defined LOK_DOC_VIEW_IMPLEMENTATION
+#include 
 #define LOK_DOC_VIEW_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
 #else
 #define LOK_DOC_VIEW_DLLPUBLIC


core.git: android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/GLController.java |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 435b4d01e1b8e42dd57d9e6d3c64c93c20b69ea9
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:21:35 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:57:24 2024 +0200

android: Drop unused imports

Change-Id: Ie26eb3ee5e068b75912d0392ca81c966972e72bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170717
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 6a43dd6a87db..83ae5d77b7c9 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java
@@ -6,12 +6,10 @@
 package org.mozilla.gecko.gfx;
 
 import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGL11;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.egl.EGLContext;
 import javax.microedition.khronos.egl.EGLDisplay;
 import javax.microedition.khronos.egl.EGLSurface;
-import javax.microedition.khronos.opengles.GL;
 import javax.microedition.khronos.opengles.GL10;
 
 public class GLController {


core.git: 2 commits - android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/mozilla/gecko/gfx/CairoImage.java |1 
 android/source/src/java/org/mozilla/gecko/gfx/DisplayPortMetrics.java |   11 
--
 2 files changed, 12 deletions(-)

New commits:
commit 9cd74570a1d85396db039f14e9c58394e328874b
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:20:09 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:57:14 2024 +0200

android: Drop unused DisplayMentrics#toJSON

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

diff --git 
a/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortMetrics.java 
b/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortMetrics.java
index f622c44ff912..6c16bcea3a02 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortMetrics.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortMetrics.java
@@ -47,17 +47,6 @@ public final class DisplayPortMetrics {
 && FloatUtils.fuzzyEquals(mResolution, metrics.mResolution);
 }
 
-public String toJSON() {
-StringBuffer sb = new StringBuffer(256);
-sb.append("{ \"left\": ").append(mPosition.left)
-  .append(", \"top\": ").append(mPosition.top)
-  .append(", \"right\": ").append(mPosition.right)
-  .append(", \"bottom\": ").append(mPosition.bottom)
-  .append(", \"resolution\": ").append(mResolution)
-  .append('}');
-return sb.toString();
-}
-
 @Override
 public String toString() {
 return "DisplayPortMetrics v=(" + mPosition.left + ","
commit a91464d10f53c4b203ffcae308a5f6fd76220c7b
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:18:41 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:57:05 2024 +0200

android: Drop unused CairoImage.FORMAT_INVALID

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

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/CairoImage.java 
b/android/source/src/java/org/mozilla/gecko/gfx/CairoImage.java
index 5a18a4bb1995..5f77e14b6c52 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/CairoImage.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/CairoImage.java
@@ -18,7 +18,6 @@ public abstract class CairoImage {
 public abstract IntSize getSize();
 public abstract int getFormat();
 
-public static final int FORMAT_INVALID = -1;
 public static final int FORMAT_ARGB32 = 0;
 public static final int FORMAT_RGB24 = 1;
 public static final int FORMAT_A8 = 2;


core.git: android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/SettingsActivity.java |1 -
 android/source/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java |2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 3ed11168c5a778d0f54de19a341f96f6e55767be
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:15:53 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:56:54 2024 +0200

android: Make constant final

Addresses this warning/suggestion shown in Android Studio:

> Field 'LOGTAG' may be 'final'

And: Drop an unused import.

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

diff --git a/android/source/src/java/org/libreoffice/SettingsActivity.java 
b/android/source/src/java/org/libreoffice/SettingsActivity.java
index 39102aee5a0f..db715cf8b0cc 100644
--- a/android/source/src/java/org/libreoffice/SettingsActivity.java
+++ b/android/source/src/java/org/libreoffice/SettingsActivity.java
@@ -8,7 +8,6 @@
  */
 package org.libreoffice;
 
-import android.content.SharedPreferences;
 import android.os.Bundle;
 import androidx.fragment.app.FragmentActivity;
 import androidx.preference.PreferenceFragmentCompat;
diff --git 
a/android/source/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java 
b/android/source/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java
index a616fcc4da43..6900532515e0 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java
@@ -17,7 +17,7 @@ import java.nio.ByteBuffer;
  * A Cairo image that simply saves a buffer of pixel data.
  */
 public class BufferedCairoImage extends CairoImage {
-private static String LOGTAG = "GeckoBufferedCairoImage";
+private static final String LOGTAG = "GeckoBufferedCairoImage";
 private ByteBuffer mBuffer;
 private IntSize mSize;
 private int mFormat;


core.git: 2 commits - android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/LOEvent.java|7 ---
 android/source/src/java/org/libreoffice/PDFDocumentAdapter.java |4 +---
 2 files changed, 1 insertion(+), 10 deletions(-)

New commits:
commit f70a8cc859b2300c7f450dfd21a689dbcaca3ccf
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:13:00 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:56:41 2024 +0200

android: Drop obsolete '@TargetApi(19)'

Obsolete since:

commit c2fc2c8c7c63ca4e43bca6e8c9b82c50418422d2
Author: Michael Weghorn 
Date:   Tue Dec 5 09:57:22 2023 +0100

android: Bump minSdkVersion to 21 (Android 5.0)

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

diff --git a/android/source/src/java/org/libreoffice/PDFDocumentAdapter.java 
b/android/source/src/java/org/libreoffice/PDFDocumentAdapter.java
index 2ce167ce3a32..cee01c198eca 100644
--- a/android/source/src/java/org/libreoffice/PDFDocumentAdapter.java
+++ b/android/source/src/java/org/libreoffice/PDFDocumentAdapter.java
@@ -1,6 +1,5 @@
 package org.libreoffice;
 
-import android.annotation.TargetApi;
 import android.content.Context;
 import android.os.Bundle;
 import android.os.CancellationSignal;
@@ -17,7 +16,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
-@TargetApi(19)
 public class PDFDocumentAdapter extends PrintDocumentAdapter{
 Context mContext;
 String pdfFile;
@@ -83,4 +81,4 @@ public class PDFDocumentAdapter extends PrintDocumentAdapter{
 }
 
 }
-}
\ No newline at end of file
+}
commit 45eb67728fdf587531cce460c88fa45f60318f9f
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:10:13 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:56:25 2024 +0200

android: Drop unused Event#getTypeString

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

diff --git a/android/source/src/java/org/libreoffice/LOEvent.java 
b/android/source/src/java/org/libreoffice/LOEvent.java
index d1170eee12ad..624579254f02 100644
--- a/android/source/src/java/org/libreoffice/LOEvent.java
+++ b/android/source/src/java/org/libreoffice/LOEvent.java
@@ -160,13 +160,6 @@ public class LOEvent implements Comparable {
 mPageHeight = pageHeight;
 }
 
-public String getTypeString() {
-if (mTypeString == null) {
-return "Event type: " + mType;
-}
-return mTypeString;
-}
-
 @Override
 public int compareTo(LOEvent another) {
 return mPriority - another.mPriority;


core.git: 2 commits - android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/AboutDialogFragment.java |2 +-
 android/source/src/java/org/libreoffice/FormattingController.java|2 --
 android/source/src/java/org/libreoffice/LibreOfficeApplication.java  |1 -
 android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java |2 --
 4 files changed, 1 insertion(+), 6 deletions(-)

New commits:
commit 9e8db6126180c9aff2309c91546e1033f2d3c84d
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:07:20 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:56:17 2024 +0200

android: Drop unused imports

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

diff --git a/android/source/src/java/org/libreoffice/FormattingController.java 
b/android/source/src/java/org/libreoffice/FormattingController.java
index 378a3ecb87bc..f142b808e09b 100644
--- a/android/source/src/java/org/libreoffice/FormattingController.java
+++ b/android/source/src/java/org/libreoffice/FormattingController.java
@@ -5,7 +5,6 @@ import android.app.AlertDialog;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.net.Uri;
@@ -29,7 +28,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.util.Date;
-import java.util.List;
 import java.util.Locale;
 
 import static org.libreoffice.SearchController.addProperty;
diff --git 
a/android/source/src/java/org/libreoffice/LibreOfficeApplication.java 
b/android/source/src/java/org/libreoffice/LibreOfficeApplication.java
index 77f1af493b0e..67655c7689cd 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeApplication.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeApplication.java
@@ -11,7 +11,6 @@
 package org.libreoffice;
 
 import android.app.Application;
-import android.content.Context;
 import android.os.Handler;
 
 public class LibreOfficeApplication extends Application {
diff --git 
a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java 
b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 9f4424f93dab..505c886c4403 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -1,8 +1,6 @@
 package org.libreoffice;
 
 import android.app.AlertDialog;
-import android.content.ClipData;
-import android.content.ClipboardManager;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.DialogInterface;
commit 938d4ceea55d13851234af108c3018c8b19584e1
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 07:05:39 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:56:05 2024 +0200

android: Use String.equals for string comparison

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

diff --git a/android/source/src/java/org/libreoffice/AboutDialogFragment.java 
b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
index 0d9fc45856ef..e3b24b8daf2f 100644
--- a/android/source/src/java/org/libreoffice/AboutDialogFragment.java
+++ b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
@@ -81,7 +81,7 @@ public class AboutDialogFragment extends DialogFragment {
 // when privacy policy URL is set (via 
'--with-privacy-policy-url=' autogen option),
 // add button to open that URL
 final String privacyUrl = BuildConfig.PRIVACY_POLICY_URL;
-if (!privacyUrl.isEmpty() && privacyUrl != "undefined") {
+if (!privacyUrl.isEmpty() && !privacyUrl.equals("undefined")) {
 builder.setNeutralButton(R.string.about_privacy_policy, 
(DialogInterface dialog, int id) -> {
 Intent openPrivacyUrlIntent = new Intent(Intent.ACTION_VIEW, 
Uri.parse(privacyUrl));
 startActivity(openPrivacyUrlIntent);


core.git: 2 commits - android/source

2024-07-19 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/canvas/Cursor.java |   
 1 -
 android/source/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java |   
 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit aa7605571c62ed333af79aa7414277b6e6d50d39
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 06:54:10 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:55:54 2024 +0200

android: Make constant static

Makes this warning/suggestion disappear in Android Studio:

> Field can be converted to a local variable

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

diff --git 
a/android/source/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java 
b/android/source/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
index 68b445af6f9f..05c0dfac4dcf 100644
--- a/android/source/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
+++ b/android/source/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
@@ -23,7 +23,7 @@ public class GraphicSelectionHandle extends 
CommonCanvasElement {
 /**
  * The factor used to inflate the hit area.
  */
-private final float HIT_AREA_INFLATE_FACTOR = 1.75f;
+private static final float HIT_AREA_INFLATE_FACTOR = 1.75f;
 
 private final HandlePosition mHandlePosition;
 public PointF mPosition = new PointF();
@@ -143,4 +143,4 @@ public class GraphicSelectionHandle extends 
CommonCanvasElement {
 }
 }
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 55a62bbfc2f39d673fc802840e4121355dcf1469
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 06:53:13 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 12:55:39 2024 +0200

android: Drop unused mAlpha member from Cursor

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

diff --git a/android/source/src/java/org/libreoffice/canvas/Cursor.java 
b/android/source/src/java/org/libreoffice/canvas/Cursor.java
index 1cd30edb7549..42875f992b5f 100644
--- a/android/source/src/java/org/libreoffice/canvas/Cursor.java
+++ b/android/source/src/java/org/libreoffice/canvas/Cursor.java
@@ -13,7 +13,6 @@ public class Cursor extends CommonCanvasElement {
 private final Paint mCursorPaint = new Paint();
 public RectF mPosition = new RectF();
 public RectF mScaledPosition = new RectF();
-public int mAlpha = 0;
 
 /**
  * Construct the cursor and set the default values.


core.git: vcl/source

2024-07-18 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl1.cxx |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 24103bdf3fa3d6962efcc6fb6ee5c95b62e29cc4
Author: Michael Weghorn 
AuthorDate: Thu Jul 18 08:58:10 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 19 06:05:00 2024 +0200

tdf#161501 icon choice ctrl: Use tab text colors

Instead of using the generic window or highlight
text color, use the specific text colors for tabs
when painting entries of the vertical tab control,
similar to how it's done for the non-vertical
tab control (see `TabControl::ImplDrawItem`).

This is also in preparation for changes to make more
use of the system colors for the entries.

It e.g. ensures that black text color is used for the
text of the focused entry with Breeze (light) in my Debian
testing KDE Plasma 5 setup with Rafael's pending change [1],
preventing the issue of too low contrast mentioned in [2]
that is otherwise seen in my setup, but not Rafael's for some
reason.

[1] https://gerrit.libreoffice.org/c/core/+/170554
[2] 
https://gerrit.libreoffice.org/c/core/+/170554/comments/f9d0f988_6a0f5eec

Change-Id: I718d08f717bd896b7fca9fc39eedae68fba4bd25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170677
Reviewed-by: Michael Weghorn 
Reviewed-by: Rafael Lima 
Tested-by: Jenkins

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index ed76c87cc80b..f14663e3f6fc 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1005,8 +1005,6 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const 
tools::Rectangle& rRect,
 
 void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const 
Point& rPos, vcl::RenderContext& rRenderContext)
 {
-bool bSelected = pEntry->IsSelected();
-
 rRenderContext.Push(vcl::PushFlags::FONT | vcl::PushFlags::TEXTCOLOR);
 
 tools::Rectangle aTextRect(CalcTextRect(pEntry, ));
@@ -1014,6 +1012,8 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 
 bool bActiveSelection = (0 != (nWinBits & WB_NOHIDESELECTION)) || 
pView->HasFocus();
 
+const bool bMouseHovered = pEntry == pCurHighlightFrame;
+const bool bSelected = pEntry->IsSelected();
 if (bSelected)
 {
 const StyleSettings& rSettings = 
rRenderContext.GetSettings().GetStyleSettings();
@@ -1026,11 +1026,12 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 else
 aNewFont.SetFillColor(rSettings.GetDeactiveColor());
 
-Color aWinCol = rSettings.GetWindowTextColor();
-if (!bActiveSelection && rSettings.GetFaceColor().IsBright() == 
aWinCol.IsBright())
-aNewFont.SetColor(rSettings.GetWindowTextColor());
-else
-aNewFont.SetColor(rSettings.GetHighlightTextColor());
+Color aTextColor(rSettings.GetTabTextColor());
+if (bSelected)
+aTextColor = rSettings.GetTabHighlightTextColor();
+else if (bMouseHovered)
+aTextColor = rSettings.GetTabRolloverTextColor();
+aNewFont.SetColor(aTextColor);
 
 rRenderContext.SetFont(aNewFont);
 
@@ -1066,7 +1067,7 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 DrawFocusRect(rRenderContext, pEntry);
 
 // highlight mouse-hovered entry
-if (pEntry == pCurHighlightFrame)
+if (bMouseHovered)
 {
 const tools::Rectangle aRect = CalcFocusRect(pEntry);
 bool bNativeOK


core.git: vcl/inc vcl/osx

2024-07-17 Thread Michael Weghorn (via logerrit)
 vcl/inc/osx/a11ywrapper.h |2 ++
 vcl/osx/a11ywrapper.mm|   20 
 2 files changed, 22 insertions(+)

New commits:
commit 43f0022fcaed2d9d1b1b3707173acd562c7f0ebe
Author: Michael Weghorn 
AuthorDate: Wed Jul 17 13:31:17 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jul 18 06:52:46 2024 +0200

tdf#155447 macOS a11y: Report accessibilityIdentifier

Implement `accessibilityIdentifier` [1] for
macOS/NSAccessibility by retrieving the accessible ID
via `XAccessibleContext2::getAccessibleId` if that
interface is implemented.

This is the macOS equivalent of

commit c64b823b74cbd3063d6e87643bd68ea5343b2f54
Author: Michael Weghorn 
Date:   Tue Jul 16 13:57:41 2024 +0200

tdf#155447 qt a11y: Report accessible ID

[1] 
https://developer.apple.com/documentation/appkit/nsaccessibilityprotocol/1527792-accessibilityidentifier

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

diff --git a/vcl/inc/osx/a11ywrapper.h b/vcl/inc/osx/a11ywrapper.h
index 48fdd8e2a582..c3360f58c24e 100644
--- a/vcl/inc/osx/a11ywrapper.h
+++ b/vcl/inc/osx/a11ywrapper.h
@@ -22,6 +22,7 @@
 #include "osxvcltypes.h"
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -38,6 +39,7 @@ struct ReferenceWrapper
 {
 css::uno::Reference < css::accessibility::XAccessibleAction > 
rAccessibleAction;
 css::uno::Reference < css::accessibility::XAccessibleContext > 
rAccessibleContext;
+css::uno::Reference < css::accessibility::XAccessibleContext2 > 
rAccessibleContext2;
 css::uno::Reference < css::accessibility::XAccessibleComponent > 
rAccessibleComponent;
 css::uno::Reference < css::accessibility::XAccessibleExtendedComponent > 
rAccessibleExtendedComponent;
 css::uno::Reference < css::accessibility::XAccessibleSelection > 
rAccessibleSelection;
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 365aa99ca816..e05e951e81c9 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -108,6 +108,8 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 mIsDisposed = NO;
 // Querying all supported interfaces
 try {
+// XAccessibleContext2
+maReferenceWrapper.rAccessibleContext2.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleComponent
 maReferenceWrapper.rAccessibleComponent.set( rxAccessibleContext, 
UNO_QUERY );
 // XAccessibleExtendedComponent
@@ -456,6 +458,14 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 return [ CreateNSString ( [ self accessibleContext ] -> 
getAccessibleDescription() ) autorelease ];
 }
 
+-(id)identifierAttribute {
+if ([ self accessibleContext2]) {
+return [ CreateNSString ( [ self accessibleContext2 ] -> 
getAccessibleId() ) autorelease ];
+} else {
+return nil;
+}
+}
+
 -(id)roleDescriptionAttribute {
 if ( mActsAsRadioGroup ) {
 return [ AquaA11yRoleHelper getRoleDescriptionFrom: 
NSAccessibilityRadioGroupRole with: @"" ];
@@ -1192,6 +1202,10 @@ static Reference < XAccessibleContext > hitTestRunner ( 
css::awt::Point point,
 return maReferenceWrapper.rAccessibleContext.get();
 }
 
+-(XAccessibleContext2 *)accessibleContext2 {
+return maReferenceWrapper.rAccessibleContext2.get();
+}
+
 -(XAccessibleComponent *)accessibleComponent {
 return maReferenceWrapper.rAccessibleComponent.get();
 }
@@ -1357,6 +1371,12 @@ static Reference < XAccessibleContext > hitTestRunner ( 
css::awt::Point point,
 return [ self accessibilityAttributeValue: NSAccessibilityHelpAttribute ];
 }
 
+
+- (NSString *) accessibilityIdentifier
+{
+return [ self accessibilityAttributeValue: 
NSAccessibilityIdentifierAttribute ];
+}
+
 - (BOOL)isAccessibilityExpanded
 {
 NSNumber *pNumber = [ self accessibilityAttributeValue: 
NSAccessibilityExpandedAttribute ];


core.git: android/Bootstrap android/source

2024-07-17 Thread Michael Weghorn (via logerrit)
 android/Bootstrap/Makefile.shared |1 -
 android/source/build.gradle   |4 
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 97b827aa6135fa95235742122d49222b3c1b9109
Author: Michael Weghorn 
AuthorDate: Wed Jul 17 10:23:18 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 17 12:14:37 2024 +0200

android: Port from deprecated "archivesBaseName"

Port from deprecated Gradle API that is planned to
be removed in Gradle 9.0, as was warned about in the
build output previously:

> Configure project :
Script 
'/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle':
 line 22
The org.gradle.api.plugins.BasePluginConvention type has been 
deprecated. This is scheduled to be removed in Gradle 9.0. Consult the 
upgrading guide for further information: 
https://docs.gradle.org/8.7/userguide/upgrading_version_8.html#base_convention_deprecation
at 
liboSettings_bbauwf0uak693a4tmdwwty192$_run_closure3.doCall$original(/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle:22)
(Run with --stacktrace to get the full stack trace of this 
deprecation warning.)
at 
liboSettings_bbauwf0uak693a4tmdwwty192.run(/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle:20)
(Run with --stacktrace to get the full stack trace of this 
deprecation warning.)
Script 
'/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle':
 line 22
The BasePluginExtension.archivesBaseName property has been deprecated. 
This is scheduled to be removed in Gradle 9.0. Please use the archivesName 
property instead. For more information, please refer to 
https://docs.gradle.org/8.7/dsl/org.gradle.api.plugins.BasePluginExtension.html#org.gradle.api.plugins.BasePluginExtension:archivesName
 in the Gradle documentation.
at 
liboSettings_bbauwf0uak693a4tmdwwty192$_run_closure3.doCall$original(/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle:22)
(Run with --stacktrace to get the full stack trace of this 
deprecation warning.)

As described in the upgrading guide [1], use the "base"
configuration block in build.gradle instead.

[1] 
https://docs.gradle.org/8.7/userguide/upgrading_version_8.html#base_convention_deprecation

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

diff --git a/android/Bootstrap/Makefile.shared 
b/android/Bootstrap/Makefile.shared
index 070239924e32..3e4615dd3942 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -112,7 +112,6 @@ liboSettings.gradle: $(BUILDDIR)/config_build.mk 
$(BUILDDIR)/config_host.mk \
&& echo "}" \
&& echo "android.defaultConfig {" \
&& echo "applicationId '$(ANDROID_PACKAGE_NAME)'" \
-   && echo "archivesBaseName = 'LibreOfficeViewer'" \
&& echo "minSdkVersion $(ANDROID_API_LEVEL)" \
&& echo "versionCode project.hasProperty('cmdVersionCode') 
? cmdVersionCode.toInteger() : $(if $(versionCode),$(versionCode),1)" \
&& echo "versionName 
'$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)'"
 \
diff --git a/android/source/build.gradle b/android/source/build.gradle
index afdd0b00a586..e96fac18f43f 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -37,6 +37,10 @@ dependencies {
 implementation 'androidx.preference:preference:1.2.1'
 }
 
+base {
+archivesName = "LibreOfficeViewer"
+}
+
 android {
 namespace 'org.libreoffice'
 compileSdk 34


core.git: 2 commits - android/Bootstrap android/source

2024-07-17 Thread Michael Weghorn (via logerrit)
 android/Bootstrap/Makefile.shared |2 +-
 android/source/gradle.properties  |1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 89fd1a2adaa05329eead62573a084238e5e57ebf
Author: Michael Weghorn 
AuthorDate: Wed Jul 17 10:11:34 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 17 12:14:29 2024 +0200

android: Show all gradle warnings

Set the gradle property to show individual warnings during the
build. Without this, the build output showed:

> Deprecated Gradle features were used in this build, making it 
incompatible with Gradle 9.0.
>
> You can use '--warning-mode all' to show the individual deprecation 
warnings and determine if they come from your own scripts or plugins.
>
> For more on this, please refer to 
https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings
 in the Gradle documentation.

Now, it shows the individual issues that need to be addressed:

> > Configure project :
> Script 
'/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle':
 line 22
> The org.gradle.api.plugins.BasePluginConvention type has been deprecated. 
This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for 
further information: 
https://docs.gradle.org/8.7/userguide/upgrading_version_8.html#base_convention_deprecation
> at 
liboSettings_bbauwf0uak693a4tmdwwty192$_run_closure3.doCall$original(/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle:22)
> (Run with --stacktrace to get the full stack trace of this 
deprecation warning.)
> at 
liboSettings_bbauwf0uak693a4tmdwwty192.run(/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle:20)
> (Run with --stacktrace to get the full stack trace of this 
deprecation warning.)
> Script 
'/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle':
 line 22
> The BasePluginExtension.archivesBaseName property has been deprecated. 
This is scheduled to be removed in Gradle 9.0. Please use the archivesName 
property instead. For more information, please refer to 
https://docs.gradle.org/8.7/dsl/org.gradle.api.plugins.BasePluginExtension.html#org.gradle.api.plugins.BasePluginExtension:archivesName
 in the Gradle documentation.
> at 
liboSettings_bbauwf0uak693a4tmdwwty192$_run_closure3.doCall$original(/home/michi/development/git/libreoffice-WORKTREE-android/android/source/liboSettings.gradle:22)
> (Run with --stacktrace to get the full stack trace of this 
deprecation warning.)

Actually addressing them still needs to be done separately.

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

diff --git a/android/source/gradle.properties b/android/source/gradle.properties
index 19f2d673e497..996ab0b6dbdb 100644
--- a/android/source/gradle.properties
+++ b/android/source/gradle.properties
@@ -2,3 +2,4 @@ android.nonFinalResIds=false
 android.nonTransitiveRClass=false
 android.useAndroidX=true
 org.gradle.jvmargs=-Xmx3072m
+org.gradle.warning.mode=all
commit 27f1851eb2452a25358d455de2566dc4f651c2b7
Author: Michael Weghorn 
AuthorDate: Wed Jul 17 10:01:03 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 17 12:14:20 2024 +0200

android: Set minSdkVersion without "="

Addresses this warning shown in Android Studio:

> Do not use assignment with the minSdkVersion property (remove the '=')

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

diff --git a/android/Bootstrap/Makefile.shared 
b/android/Bootstrap/Makefile.shared
index b93735234b3d..070239924e32 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -113,7 +113,7 @@ liboSettings.gradle: $(BUILDDIR)/config_build.mk 
$(BUILDDIR)/config_host.mk \
&& echo "android.defaultConfig {" \
&& echo "applicationId '$(ANDROID_PACKAGE_NAME)'" \
&& echo "archivesBaseName = 'LibreOfficeViewer'" \
-   && echo "minSdkVersion = $(ANDROID_API_LEVEL)" \
+   && echo "minSdkVersion $(ANDROID_API_LEVEL)" \
&& echo "versionCode project.hasProperty('cmdVersionCode') 
? cmdVersionCode.toInteger() : $(if $(versionCode),$(versionCode),1)" \
&& echo "versionName 
'$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)'"
 \
&& echo "buildConfigField('String', 'BUILD_ID_SHORT', 
'\"$(shell cd $(SRCDIR) && git log -1 

core.git: 2 commits - android/source

2024-07-17 Thread Michael Weghorn (via logerrit)
 android/source/build.gradle|2 +-
 android/source/gradle/wrapper/gradle-wrapper.properties|4 ++--
 android/source/src/java/org/libreoffice/LOKitTileProvider.java |9 -
 3 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 053d9feec432ca4dff4d85593d9cad0d975388b3
Author: Michael Weghorn 
AuthorDate: Wed Jul 17 09:40:13 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 17 12:13:33 2024 +0200

android: Handle cursor keys

In Android Viewer, forward the left/right/up/down keys
as such by adding the corresponding mapping to
`LOKitTileProvider#getKeyCode`.

This allows navigating through the document using those
keys e.g. on a hardware keyboard.

This addresses this comment from a Google Play Review:

> Editing, the cursor doesn't respond to the cursor keys

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

diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java 
b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index c8a055206dd0..bbdc9456cf4c 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -11,7 +11,6 @@ package org.libreoffice;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.PointF;
-import android.os.Build;
 import android.print.PrintAttributes;
 import android.print.PrintDocumentAdapter;
 import android.print.PrintManager;
@@ -630,6 +629,14 @@ class LOKitTileProvider implements TileProvider {
 switch (keyEvent.getKeyCode()) {
 case KeyEvent.KEYCODE_DEL:
 return com.sun.star.awt.Key.BACKSPACE;
+case KeyEvent.KEYCODE_DPAD_DOWN:
+return com.sun.star.awt.Key.DOWN;
+case KeyEvent.KEYCODE_DPAD_LEFT:
+return com.sun.star.awt.Key.LEFT;
+case KeyEvent.KEYCODE_DPAD_RIGHT:
+return com.sun.star.awt.Key.RIGHT;
+case KeyEvent.KEYCODE_DPAD_UP:
+return com.sun.star.awt.Key.UP;
 case KeyEvent.KEYCODE_ENTER:
 return com.sun.star.awt.Key.RETURN;
 }
commit a360543249fb850ec2fa5f26102d5cc270b6b870
Author: Michael Weghorn 
AuthorDate: Wed Jul 17 08:54:33 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 17 12:13:25 2024 +0200

android: Update Android Gradle Plugin to 8.5.1

... and gradle to 8.7, as suggested by Android Studio.

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

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 8aa3d2dbf9c6..afdd0b00a586 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -21,7 +21,7 @@ buildscript {
 google()
 }
 dependencies {
-classpath 'com.android.tools.build:gradle:8.4.0'
+classpath 'com.android.tools.build:gradle:8.5.1'
 }
 }
 
diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties 
b/android/source/gradle/wrapper/gradle-wrapper.properties
index af9c6a996c1d..cce67b04680b 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,7 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionSha256Sum=85719317abd2112f021d4f41f09ec370534ba288432065f4b477b6a3b652910d
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
+distributionSha256Sum=194717442575a6f96e1c1befa2c30e9a4fc90f701d7aee33eb879b79e7ff05c0
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
 validateDistributionUrl=true
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists


core.git: 3 commits - vcl/qt5 vcl/unx

2024-07-16 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtAccessibleWidget.cxx |   13 -
 vcl/unx/gtk3/gtkinst.cxx   |   14 ++
 2 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 8495e77f4d49733f645cdacfb71729b91e5c4f30
Author: Michael Weghorn 
AuthorDate: Tue Jul 16 15:03:20 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 17 06:25:13 2024 +0200

tdf#155447 gtk3 a11y: Use GtkBuilder ID as accessible ID

Set the GtkBuilder ID (the ID set in the .ui file)
as the accessible ID of the GtkWidget for welded
widgets in the gtk3 VCL plugin.

For non-welded widgets, that would happen
in `atk_object_wrapper_new`, similar to how

Change-Id: I2281d15c38a229410469c29a14fdc4221aeb3e1e
Author: Michael Weghorn 
Date:   Tue Jul 16 13:57:41 2024 +0200

tdf#155447 qt a11y: Report accessible ID

implements it for the qt6 VCL plugin.

However, since native widgets are now used
almost everywhere for the gtk3 VCL plugin,
the implementation in `atk_object_wrapper_new`
does not take effect for most of the UI, including the
spell checking dialog mentioned in tdf#155447.
This commit makes sure an accessible ID is set for
such cases as well.

Using the GtkBuilder ID is also mentioned
in the `atk_object_set_accessible_id` doc [1]:

> Sets the accessible ID of the accessible. This is not meant to be
> presented to the user, but to be an ID which is stable over application
> development. Typically, this is the gtkbuilder ID. Such an ID will be
> available for instance to identify a given well-known accessible object
> for tailored screen reading, or for automatic regression testing.

GTK 4 currently doesn't have API to set an accessible ID.

[1] https://docs.gtk.org/atk/method.Object.set_accessible_id.html

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 698f2dbe1575..4f4b42e52192 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -3458,6 +3458,20 @@ public:
 if (!bTakeOwnership)
 g_object_ref(m_pWidget);
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
+const char* pId = gtk_buildable_get_name(GTK_BUILDABLE(m_pWidget));
+if (pId)
+{
+static auto func = reinterpret_cast(dlsym(nullptr, "atk_object_set_accessible_id"));
+if (func)
+{
+AtkObject* pAtkObject = gtk_widget_get_accessible(m_pWidget);
+assert(pAtkObject);
+(*func)(pAtkObject, pId);
+}
+}
+#endif
+
 localizeDecimalSeparator();
 }
 
commit c64b823b74cbd3063d6e87643bd68ea5343b2f54
Author: Michael Weghorn 
AuthorDate: Tue Jul 16 13:57:41 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 17 06:25:06 2024 +0200

tdf#155447 qt a11y: Report accessible ID

For Qt >= 6.8, report the accessible ID provided by
`XAccessibleContext2::getAccessibleId` when
`QtAccessibleWidget::text` gets called with param
`QAccessible::Identifier`, as introduced in
qtbase commit [1]:

commit 9ec1de2528b871099d416d15592fcc5ef9242a64
Author: Jens Trillmann 
Date:   Wed Mar 13 14:00:38 2024 +0100

Add Identifier role to QAccessible and use it in OS interfaces

* Unify the default identifier creation for QAccessibleInterface on
  all platforms to be the same as the previous identifier on Linux.
  This may change some identifiers on Windows.

[ChangeLog][QAccessible][QAccessibleInterface] Add possibility to
add unique identifier to QAccessibleInterface to give a11y elements
consistent identifiers.

Task-number: QTBUG-123361
Change-Id: I8c42956a4c497e71909d71dcb27bc87433937b69
Reviewed-by: Volker Hilsheimer 

`VCLXAccessibleComponent::getAccessibleId` returns the ID
of the corresponding `vcl::Window` which equals to the GtkBuilder ID
set in the .ui file, e.g. "SpellingDialog" for the spelling dialog
(see `cui/uiconfig/ui/spellingdialog.ui`).

This could be used for reliable identification by ATs, e.g.
to identify the spelling dialog and specific widgets in it
(see tdf#155447) or for automated tests.

[1] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=9ec1de2528b871099d416d15592fcc5ef9242a64

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

diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index 9320516bee0c..21c5f1477fb3 100644
--- 

core.git: 2 commits - offapi/com test/source

2024-07-16 Thread Michael Weghorn (via logerrit)
 offapi/com/sun/star/accessibility/XAccessibleAction.idl |   10 --
 test/source/a11y/accessibletestbase.cxx |2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 5495a2ef9c5e0a457c44e2fe0f6a62effda43ebc
Author: Michael Weghorn 
AuthorDate: Tue Jul 16 11:08:13 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Jul 16 12:47:45 2024 +0200

a11y tests: Double the timeout for UI tests

Increase the timeout for a11y UI tests from 1 to 2 min,
to see whether this helps with one slow Windows Jenkins
builder running into the timeout every once in a while,
as was mentioned in ESC calls.

Example from [1]:

timeout waiting for dialog 'Bookmark' to show up
warn:vcl.schedule:6600:11456:vcl/source/app/scheduler.cxx:524: Uncaught 
exception during Task::Invoke()!
abort() has been 
calledwarn:sal.cppunittester:6600:11456:sal/cppunittester/cppunittester.cxx:601:
 CAUGHT SIGABRT:
[...]

[1] https://ci.libreoffice.org/job/gerrit_windows/181051/console

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

diff --git a/test/source/a11y/accessibletestbase.cxx 
b/test/source/a11y/accessibletestbase.cxx
index 27bea36f6084..5d8f50c90f10 100644
--- a/test/source/a11y/accessibletestbase.cxx
+++ b/test/source/a11y/accessibletestbase.cxx
@@ -436,7 +436,7 @@ test::AccessibleTestBase::awaitDialog(const 
std::u16string_view name,
 mxToolkit->addTopWindowListener(mxTopWindowListener);
 
 maTimeoutTimer.SetInvokeHandler(LINK(this, ListenerHelper, 
timeoutTimerHandler));
-maTimeoutTimer.SetTimeout(6);
+maTimeoutTimer.SetTimeout(12);
 maTimeoutTimer.Start();
 
 maIdleHandler.SetInvokeHandler(LINK(this, ListenerHelper, 
idleHandler));
commit 4f63dd8b374ce6e5c6fd783625c287eef6079265
Author: Michael Weghorn 
AuthorDate: Tue Jul 16 10:51:59 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Jul 16 12:47:34 2024 +0200

a11y: Clean up XAccessibleAction doc

The `XAccessibleAction::getAccessibleActionDescription`
and `XAcccessibleAction::doAccessibleAction` doc mentions
that an `IndexOutOfBoundsException` exception is thrown
when the index is invalid, which is indeed the expected
behaviour. However, they mentioned in addition that false
or an empty string is returned, which doesn't make sense
when exception gets thrown, so drop that.

Also slightly improve wording at 2 other places.

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

diff --git a/offapi/com/sun/star/accessibility/XAccessibleAction.idl 
b/offapi/com/sun/star/accessibility/XAccessibleAction.idl
index bae281c8e98f..e35d049e1b44 100644
--- a/offapi/com/sun/star/accessibility/XAccessibleAction.idl
+++ b/offapi/com/sun/star/accessibility/XAccessibleAction.idl
@@ -47,8 +47,7 @@ interface XAccessibleAction : 
::com::sun::star::uno::XInterface
 /** Perform the specified Action on the object.
 
 @param nIndex
-This index specifies the action to perform.  If it lies outside
-the valid range `FALSE` is returned and no action is performed.
+This index specifies the action to perform.
 @return
 Returns `TRUE` if the action was successfully performed.  If
 the action could not be performed successfully `FALSE` is
@@ -66,14 +65,13 @@ interface XAccessibleAction : 
::com::sun::star::uno::XInterface
 
 @param nIndex
 This index specifies the action of which to return a
-description.  If it lies outside the valid range an empty string
-is returned.
+description.
 
 @return
 The returned value is a localized string of the specified action.
 
 @throws IndexOutOfBoundsException
-If the given index lies not in the valid range then an
+If the given index does not lie in the valid range then a
 ::com::sun::star::lang::IndexOutOfBoundsException
 exception is thrown.
 */
@@ -86,7 +84,7 @@ interface XAccessibleAction : 
::com::sun::star::uno::XInterface
 more information about how key bindings are represented.
 
 @param nIndex
-This index specifies the action of which to return the key
+This index specifies the action for which to return the key
 binding.
 
 @return


core.git: vcl/source

2024-07-15 Thread Michael Weghorn (via logerrit)
 vcl/source/window/toolbox.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 63ea3783bd49e2d005f2fe9821732615166867dd
Author: Michael Weghorn 
AuthorDate: Mon Jul 15 08:50:11 2024 +0200
Commit: Michael Weghorn 
CommitDate: Mon Jul 15 14:23:30 2024 +0200

vcl: Use nNewPos consistently

Use the `nNewPos` variable for assigning to
`mnCurPos` in `ToolBox::MouseButtonDown`
as well, rather than `i` which was the loop
variable above, and whose value was
assigned to `nNewPos` for the case that this
code path is entered.

Using `nNewPos` consistently makes a bit
more obvious that this is the same as in
the surrounding lines.

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

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 61245bf2fdbe..7a4195560f51 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3222,7 +3222,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
 
 // update actual data
 StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE;
-mnCurPos = i;
+mnCurPos = nNewPos;
 mnCurItemId  = mpData->m_aItems[nNewPos].mnId;
 mnDownItemId = mnCurItemId;
 mnMouseModifier  = rMEvt.GetModifier();


core.git: vcl/source

2024-07-15 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl1.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 92c30fd8320cd340a0daaac3a45475cbea4c3e99
Author: Michael Weghorn 
AuthorDate: Fri Jul 12 08:43:10 2024 +0200
Commit: Michael Weghorn 
CommitDate: Mon Jul 15 11:36:54 2024 +0200

tdf#161501 icon choice ctrl: Highlight full entry area

For background and borders/frames drawn to highlight
the currently selected/focused/mouse-hovered entry in
the icon choice control, use the entry's full area
and don't restrict the bottom edge to where the text
ends.

It's also unclear to me why 1 pixel would be subtracted
for the top and right edge when calculating the rect -
drop that as well.
(There is a line of a pixel or so in between the entries,
but since that actually doesn't belong to any of the
entries -- clicking there doesn't change the selected
entry -- also don't highlight it as part of one of the
entries.)

This addresses this (preexisting) issue mentioned in [1]:

> Maybe for a future patch... but the height from `CalcFocusRect`
> is too low. It barely covers the item and leaves gaps with
> respect to subsequent items.

[1] 
https://gerrit.libreoffice.org/c/core/+/170341/comment/57dc568d_1c0a8cf2/

Change-Id: I3369401c0bbdb77a054da9f57ac70f30f97c9cca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170393
Reviewed-by: Michael Weghorn 
Reviewed-by: Rafael Lima 
Tested-by: Jenkins

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index aa935c22632f..ed76c87cc80b 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1711,16 +1711,13 @@ const Size& SvxIconChoiceCtrl_Impl::GetItemSize( 
IcnViewFieldType eItem ) const
 
 tools::Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( 
SvxIconChoiceCtrlEntry* pEntry )
 {
-tools::Rectangle aTextRect( CalcTextRect( pEntry ) );
 tools::Rectangle aBoundRect( GetEntryBoundRect( pEntry ) );
 
 // Remove left margin
 if (nWinBits & WB_DETAILS)
 aBoundRect.SetPos(Point(0, aBoundRect.GetPos().Y()));
 
-return tools::Rectangle(
-aBoundRect.Left(), aBoundRect.Top() - 1, aBoundRect.Right() - 1,
-aTextRect.Bottom());
+return aBoundRect;
 }
 
 IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, VisRectChangedHdl, Timer *, void)


core.git: 4 commits - accessibility/inc accessibility/source

2024-07-11 Thread Michael Weghorn (via logerrit)
 accessibility/inc/extended/accessibleiconchoicectrlentry.hxx|   25 +--
 accessibility/source/extended/accessibleiconchoicectrl.cxx  |   31 +---
 accessibility/source/extended/accessibleiconchoicectrlentry.cxx |   69 
--
 3 files changed, 22 insertions(+), 103 deletions(-)

New commits:
commit 1c892a7729234202e6ce14e116e91786b248835a
Author: Michael Weghorn 
AuthorDate: Thu Jul 11 16:54:09 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 12 07:03:45 2024 +0200

icon choice ctrl entry a11y: Use OAccessibleComponentHelper as base

Let `AccessibleIconChoiceCtrlEntry` derive from
`comphelper::OAccessibleComponentHelper` which
allows simplifying the class. It just requires
implementing the virtual `implGetBounds()` method
and provides implementations for the the other
location/size-related methods using that, so drop
the custom implementations doing the same.

This also makes it unnecessary to implement the
`XAccessibleEventBroadcaster` methods ourselves,
so drop the custom handling and
`AccessibleIconChoiceCtrlEntry::m_nClientId`
altogether as well.

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

diff --git a/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx 
b/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx
index b2430481e58c..c94672c877f2 100644
--- a/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx
+++ b/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx
@@ -27,8 +27,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -42,27 +42,21 @@ namespace accessibility
 {
 
 
-typedef ::cppu::WeakComponentImplHelper< css::accessibility::XAccessible
-, 
css::accessibility::XAccessibleContext
-, 
css::accessibility::XAccessibleComponent
-, 
css::accessibility::XAccessibleEventBroadcaster
+typedef ::cppu::ImplInheritanceHelper< 
comphelper::OAccessibleComponentHelper
+, 
css::accessibility::XAccessible
 , 
css::accessibility::XAccessibleText
 , 
css::accessibility::XAccessibleAction
 , css::lang::XServiceInfo
 , css::lang::XEventListener > 
AccessibleIconChoiceCtrlEntry_BASE;
 
 /** the class AccessibleListBoxEntry represents the class for an 
accessible object of a listbox entry */
-class AccessibleIconChoiceCtrlEntry final : public ::cppu::BaseMutex,
-public 
AccessibleIconChoiceCtrlEntry_BASE,
+class AccessibleIconChoiceCtrlEntry final : public 
AccessibleIconChoiceCtrlEntry_BASE,
 public 
::comphelper::OCommonAccessibleText
 {
 /** The treelistbox control */
 VclPtr   m_pIconCtrl;
 sal_Int32   m_nIndex;
 
-/// client id in the AccessibleEventNotifier queue
-sal_uInt32  m_nClientId;
-
 css::uno::Reference< css::accessibility::XAccessible > m_xParent;
 
 tools::Rectangle   GetBoundingBox_Impl() const;
@@ -84,6 +78,9 @@ namespace accessibility
 */
 virtual void SAL_CALL   disposing() override;
 
+// OCommonAccessibleComponent
+virtual css::awt::Rectangle implGetBounds() override;
+
 // OCommonAccessibleText
 virtual OUStringimplGetText() override;
 virtual css::lang::Locale   implGetLocale() override;
@@ -129,12 +126,8 @@ namespace accessibility
 virtual css::lang::Locale SAL_CALL getLocale(  ) override;
 
 // XAccessibleComponent
-virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint 
) override;
 virtual css::uno::Reference< css::accessibility::XAccessible > 
SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
-virtual css::awt::Rectangle SAL_CALL getBounds(  ) override;
-virtual css::awt::Point SAL_CALL getLocation(  ) override;
 virtual css::awt::Point SAL_CALL getLocationOnScreen(  ) override;
-virtual css::awt::Size SAL_CALL getSize(  ) override;
 virtual void SAL_CALL grabFocus(  ) override;
 virtual sal_Int32 SAL_CALL getForeground(  ) override;
 virtual sal_Int32 SAL_CALL getBackground(  ) override;
@@ -159,10 +152,6 @@ namespace accessibility
 virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 
nEndIndex ) override;
 

core.git: 3 commits - accessibility/source include/vcl vcl/source

2024-07-11 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/accessibleiconchoicectrl.cxx  |   22 
--
 accessibility/source/extended/accessibleiconchoicectrlentry.cxx |4 -
 include/vcl/toolkit/ivctrl.hxx  |2 
 vcl/source/control/imivctl.hxx  |2 
 vcl/source/control/imivctl1.cxx |   11 -
 vcl/source/control/ivctrl.cxx   |5 --
 6 files changed, 3 insertions(+), 43 deletions(-)

New commits:
commit b3f8d9212e477bca4f94392bcc8e2d3efdcd65fa
Author: Michael Weghorn 
AuthorDate: Wed Jul 10 10:18:42 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 12 07:03:08 2024 +0200

icon choice ctrl a11y: Don't allow unselecting entry

`SvtIconChoiceCtrl` is (only) used in
`VerticalTabControl`, and having no tab
selected doesn't make much sense. Support
for non-single selection modes was dropped in

commit af9413cb4ad49c0b4854c08cc2804644220755ae
Author: Michael Weghorn 
Date:   Tue Jul 2 11:53:27 2024 +0200

tdf#161853 icon choice ctrl: Drop support for non-single selection 
modes

Consequently, also drop support for explicitly
unselecting one or all entries via the
`XAccessibleSelection` interface in the corresponding a11y class,
`AccessibleIconChoiceCtrl`.

Drop the now unused `SvtIconChoiceCtrl::SetNoSelection`
and `SvxIconChoiceCtrl_Impl::SetNoSelection`.

This is also in line with handling for the the non-vertical
tab control used elsewehere.

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

diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx 
b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 877816466a19..061b7274e024 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -231,8 +231,7 @@ namespace accessibility
 
 void SAL_CALL AccessibleIconChoiceCtrl::clearAccessibleSelection(  )
 {
-::comphelper::OExternalLockGuard aGuard( this );
-getCtrl()->SetNoSelection();
+// one entry should always be selected, so don't unselect
 }
 
 void SAL_CALL AccessibleIconChoiceCtrl::selectAllAccessibleChildren(  )
@@ -300,24 +299,7 @@ namespace accessibility
 if ( nSelectedChildIndex < 0 || nSelectedChildIndex >= 
getAccessibleChildCount() )
 throw IndexOutOfBoundsException();
 
-sal_Int32 nSelCount = 0;
-VclPtr pCtrl = getCtrl();
-sal_Int32 nCount = pCtrl->GetEntryCount();
-bool bFound = false;
-for ( sal_Int32 i = 0; i < nCount; ++i )
-{
-SvxIconChoiceCtrlEntry* pEntry = pCtrl->GetEntry( i );
-if ( pEntry->IsSelected() )
-{
-++nSelCount;
-if ( i == nSelectedChildIndex )
-bFound = true;
-}
-}
-
-// if only one entry is selected and its index is chosen to deselect 
-> no selection anymore
-if ( nSelCount == 1 && bFound )
-pCtrl->SetNoSelection();
+// one entry should always be selected, so don't unselect
 }
 
 void AccessibleIconChoiceCtrl::FillAccessibleStateSet( sal_Int64& 
rStateSet )
diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx
index 063ce54ff599..0e22da6bb385 100644
--- a/include/vcl/toolkit/ivctrl.hxx
+++ b/include/vcl/toolkit/ivctrl.hxx
@@ -178,8 +178,6 @@ public:
 tools::Rectangle   GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry 
) const;
 tools::Rectangle   GetEntryCharacterBounds( const sal_Int32 
_nEntryPos, const sal_Int32 _nCharacterIndex ) const;
 
-voidSetNoSelection();
-
 // ACCESSIBILITY ==
 
 /** Creates and returns the accessible object of the Box. */
diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index 1d77a59488fb..9a46b6c1bbc1 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -225,8 +225,6 @@ public:
 
 voidInvalidateEntry( SvxIconChoiceCtrlEntry* );
 
-voidSetNoSelection();
-
 SvxIconChoiceCtrlEntry* GetCurEntry() const { return pCursor; }
 voidSetCursor( SvxIconChoiceCtrlEntry* );
 
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index f5ef978c1184..aa935c22632f 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1091,17 +1091,6 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 rRenderContext.SetClipRegion();
 }
 
-void SvxIconChoiceCtrl_Impl::SetNoSelection()
-{
-// block 

core.git: vcl/source

2024-07-11 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl1.cxx |   18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 8708e8cf90d0ac0acbbce34b82f10ef7352d5062
Author: Michael Weghorn 
AuthorDate: Thu Jul 11 10:47:50 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jul 11 17:58:35 2024 +0200

tdf#161026 tdf#161355 tdf#161501 icon choice ctrl: Natively draw mouse-hover

... feedback.

Instead of always using `SvxIconChoiceCtrl_Impl::DrawHighlightFrame`
to draw a frame around the currently mouse-hovered item in
the icon choice control/vertical tab page, use the native
drawing API to let the backends draw a `ControlType::TabItem`
with the `ControlState::ROLLOVER` state set.

This also aligns this more with the horizontal tabbar used in other dialogs
(s. `TabControl::ImplDrawItem`).

With this commit in place, the hovered vertical tab in
e.g. the "Insert" -> "Hyperlink" or "Format" -> "Page" vertical
tab dialogs is now displayed "properly" and in line with what
happens for non-vertical tab pages (like the "Format" -> "Paragraph"
one) on Windows or with the Breeze and Breeze Dark themes and
the kf5 VCL plugin on Linux.

Instead of just using the native drawing API for the mouse-hover
feedback, this could likely be extended to also take care of focus,
selection, etc. in a follow-up step.

Change-Id: I5437d18cb78e8da0736c9ab920c55b90af4d0e25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170341
Reviewed-by: Rafael Lima 
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index eabe1ab83106..f5ef978c1184 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1065,9 +1065,23 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 if (pEntry->IsFocused())
 DrawFocusRect(rRenderContext, pEntry);
 
-// draw highlight frame
+// highlight mouse-hovered entry
 if (pEntry == pCurHighlightFrame)
-DrawHighlightFrame(rRenderContext, CalcFocusRect(pEntry));
+{
+const tools::Rectangle aRect = CalcFocusRect(pEntry);
+bool bNativeOK
+= rRenderContext.IsNativeControlSupported(ControlType::TabItem, 
ControlPart::Entire);
+if (bNativeOK)
+{
+ControlState nState = ControlState::ENABLED | 
ControlState::ROLLOVER;
+TabitemValue tiValue(aRect);
+bNativeOK = rRenderContext.DrawNativeControl(ControlType::TabItem, 
ControlPart::Entire,
+ aRect, nState, 
tiValue, OUString());
+}
+
+if (!bNativeOK)
+DrawHighlightFrame(rRenderContext, aRect);
+}
 
 PaintItem(aBmpRect, IcnViewFieldType::Image, pEntry, nBmpPaintFlags, 
rRenderContext);
 PaintItem(aTextRect, IcnViewFieldType::Text, pEntry, nTextPaintFlags, 
rRenderContext);


core.git: 2 commits - vcl/source

2024-07-11 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl1.cxx |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 6a3f91c4e9c669fc445eab8f3c526233cd68fdb9
Author: Michael Weghorn 
AuthorDate: Thu Jul 11 10:41:02 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jul 11 17:51:44 2024 +0200

tdf#161026 tdf#161355 icon choice ctrl: Draw icon + text at the end

Draw the entry's icon and text after drawing other things, to
make sure it is on top, i.e. always visible.

This shouldn't make any difference by itself yet as currently
only frames/borders are drawn after it, but that will change
with an upcoming commit to use the native drawing API for
taking care of at least the highlighting part.

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 37410ae91cf0..eabe1ab83106 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1062,11 +1062,6 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 vcl::RenderTools::DrawSelectionBackground(rRenderContext, *pView, 
CalcFocusRect(pEntry),
   bActiveSelection ? 1 : 2, 
false, false, false);
 
-
-PaintItem(aBmpRect, IcnViewFieldType::Image, pEntry, nBmpPaintFlags, 
rRenderContext);
-
-PaintItem(aTextRect, IcnViewFieldType::Text, pEntry, nTextPaintFlags, 
rRenderContext);
-
 if (pEntry->IsFocused())
 DrawFocusRect(rRenderContext, pEntry);
 
@@ -1074,6 +1069,9 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 if (pEntry == pCurHighlightFrame)
 DrawHighlightFrame(rRenderContext, CalcFocusRect(pEntry));
 
+PaintItem(aBmpRect, IcnViewFieldType::Image, pEntry, nBmpPaintFlags, 
rRenderContext);
+PaintItem(aTextRect, IcnViewFieldType::Text, pEntry, nTextPaintFlags, 
rRenderContext);
+
 rRenderContext.Pop();
 if (bResetClipRegion)
 rRenderContext.SetClipRegion();
commit 5db251640b24747a349eec2c3e53902f3f91eec9
Author: Michael Weghorn 
AuthorDate: Thu Jul 11 10:09:45 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jul 11 17:51:37 2024 +0200

icon choice ctrl: Decouple focus from text/icon drawing

Move focus drawing out of `SvxIconChoiceCtrl_Impl::PaintItem`,
where it was drawn for the `IcnViewFieldType::Text` case,
since that's not actually related to drawing the text.

Move it to just after the (only) call to
`SvxIconChoiceCtrl_Impl::PaintItem` with the
`IcnViewFieldType::Text` parameter instead.

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

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 6f42c5c93280..37410ae91cf0 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -991,9 +991,6 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const 
tools::Rectangle& rRect,
 if (eItem == IcnViewFieldType::Text)
 {
 rRenderContext.DrawText(rRect, pEntry->GetText(), nCurTextDrawFlags);
-
-if (pEntry->IsFocused())
-DrawFocusRect(rRenderContext, pEntry);
 }
 else
 {
@@ -1070,6 +1067,9 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 
 PaintItem(aTextRect, IcnViewFieldType::Text, pEntry, nTextPaintFlags, 
rRenderContext);
 
+if (pEntry->IsFocused())
+DrawFocusRect(rRenderContext, pEntry);
+
 // draw highlight frame
 if (pEntry == pCurHighlightFrame)
 DrawHighlightFrame(rRenderContext, CalcFocusRect(pEntry));


core.git: vcl/source

2024-07-10 Thread Michael Weghorn (via logerrit)
 vcl/source/control/imivctl1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c0a8112de1a86d2f8b926a7b016eb35325372552
Author: Michael Weghorn 
AuthorDate: Wed Jul 10 07:51:32 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jul 11 07:02:46 2024 +0200

tdf#161659: icon choice ctrl: Make use of the extra space

commit f6ea343e6fb2dc3539823dee60c9c6f96fc16275
Date:   Thu May 30 12:26:11 2024 +0200

tdf#161030 Improve vertical Tab list display

increased the width for items in the vertical tab
control.
Make use of the new space also for items using an icon.

This causes them to be centered again (tdf#161659).

When using the kf5 VCL plugin with the default
Breeze style, this also causes the "New Document"
text of the last item in the "Insert" -> "Hyperlink"
dialog to no longer be cut off (see attachment 149544
from tdf#123623 for the previous behavior).
(As a side note, switching `SvxIconChoiceCtrlEntry::eTextMode`
from `SvxIconChoiceCtrlTextMode::Short`
to `SvxIconChoiceCtrlTextMode::Full` would generally
allow text to wrap and use multiple lines instead of
cutting off text at the end of the single line.)

Change-Id: I7ec2575bbeb895c034dfc9f2033cea3e3986305a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170262
Reviewed-by: Heiko Tietze 
Reviewed-by: Rafael Lima 
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index b99f61221f2a..6f42c5c93280 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -81,7 +81,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl(
 
aVisRectChangedIdle.SetInvokeHandler(LINK(this,SvxIconChoiceCtrl_Impl,VisRectChangedHdl));
 
 Clear( true );
-Size gridSize((nWinStyle & WB_DETAILS) ? 150 : 100, (nWinStyle & 
WB_DETAILS) ?  20 : 70);
+Size gridSize((nWinStyle & WB_DETAILS) ? 150 : 140, (nWinStyle & 
WB_DETAILS) ?  20 : 70);
 if(pView->GetDPIScaleFactor() > 1)
 {
   gridSize.setHeight( gridSize.Height() * ( pView->GetDPIScaleFactor()) );


core.git: accessibility/inc accessibility/source basctl/source framework/source include/toolkit reportdesign/inc reportdesign/source sc/source sfx2/inc sfx2/source solenv/clang-format svtools/source s

2024-07-10 Thread Michael Weghorn (via logerrit)
 accessibility/inc/pch/precompiled_acc.hxx|2 
 accessibility/source/extended/AccessibleBrowseBox.cxx|9 -
 accessibility/source/extended/AccessibleBrowseBoxBase.cxx|   15 +-
 accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx   |   10 -
 accessibility/source/extended/AccessibleBrowseBoxTable.cxx   |5 
 accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx   |9 -
 accessibility/source/extended/AccessibleGridControl.cxx  |   10 -
 accessibility/source/extended/AccessibleGridControlBase.cxx  |   15 +-
 accessibility/source/extended/AccessibleGridControlHeader.cxx|5 
 accessibility/source/extended/AccessibleGridControlTable.cxx |5 
 accessibility/source/extended/AccessibleGridControlTableCell.cxx |8 -
 accessibility/source/extended/AccessibleIconView.cxx |5 
 accessibility/source/extended/accessibleiconchoicectrlentry.cxx  |   20 +--
 accessibility/source/extended/accessiblelistboxentry.cxx |   25 ++--
 accessibility/source/extended/accessibletabbar.cxx   |   10 -
 accessibility/source/extended/accessibletabbarpage.cxx   |4 
 accessibility/source/extended/accessibletabbarpagelist.cxx   |8 -
 accessibility/source/extended/textwindowaccessibility.cxx|6 
 accessibility/source/standard/accessiblemenubasecomponent.cxx|6 
 accessibility/source/standard/accessiblemenucomponent.cxx|6 
 accessibility/source/standard/accessiblemenuitemcomponent.cxx|8 -
 accessibility/source/standard/vclxaccessibleedit.cxx |4 
 accessibility/source/standard/vclxaccessibleheaderbaritem.cxx|5 
 accessibility/source/standard/vclxaccessiblelist.cxx |7 -
 accessibility/source/standard/vclxaccessiblelistitem.cxx |   17 +-
 accessibility/source/standard/vclxaccessiblemenuitem.cxx |6 
 accessibility/source/standard/vclxaccessiblestatusbar.cxx|4 
 accessibility/source/standard/vclxaccessiblestatusbaritem.cxx|8 -
 accessibility/source/standard/vclxaccessibletabpage.cxx  |   12 -
 accessibility/source/standard/vclxaccessibletabpagewindow.cxx|4 
 accessibility/source/standard/vclxaccessibletextcomponent.cxx|6 
 accessibility/source/standard/vclxaccessibletoolbox.cxx  |5 
 accessibility/source/standard/vclxaccessibletoolboxitem.cxx  |8 -
 basctl/source/accessibility/accessibledialogcontrolshape.cxx |3 
 basctl/source/accessibility/accessibledialogwindow.cxx   |9 -
 framework/source/layoutmanager/toolbarlayoutmanager.cxx  |   27 ++--
 include/toolkit/helper/convert.hxx   |   61 
-
 reportdesign/inc/pch/precompiled_rptui.hxx   |1 
 reportdesign/source/ui/inspection/GeometryHandler.cxx|9 -
 reportdesign/source/ui/misc/UITools.cxx  |4 
 reportdesign/source/ui/report/ReportController.cxx   |4 
 reportdesign/source/ui/report/ReportSection.cxx  |   11 +
 reportdesign/source/ui/report/ViewsWindow.cxx|9 -
 sc/source/ui/Accessibility/AccessibleContextBase.cxx |   18 +-
 sc/source/ui/Accessibility/AccessibleDocument.cxx|   13 +-
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |   22 ++-
 sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx  |   11 +
 sc/source/ui/Accessibility/AccessiblePreviewCell.cxx |5 
 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx   |5 
 sc/source/ui/unoobj/shapeuno.cxx |   10 +
 sc/source/ui/unoobj/viewuno.cxx  |6 
 sfx2/inc/pch/precompiled_sfx.hxx |1 
 sfx2/source/statbar/stbitem.cxx  |3 
 sfx2/source/view/ipclient.cxx|9 -
 sfx2/source/view/sfxbasecontroller.cxx   |6 
 solenv/clang-format/excludelist  |1 
 svtools/source/control/accessibleruler.cxx   |   15 +-
 svx/source/accessibility/svxpixelctlaccessiblecontext.cxx|4 
 svx/source/accessibility/svxrectctaccessiblecontext.cxx  |4 
 svx/source/svdraw/svdoole2.cxx   |7 -
 toolkit/source/awt/vclxaccessiblecomponent.cxx   |   10 -
 toolkit/source/awt/vclxmenu.cxx  |6 
 toolkit/source/awt/vclxregion.cxx|   16 +-
 toolkit/source/awt/vclxtoolkit.cxx   |3 
 toolkit/source/awt/vclxwindow.cxx|   26 ++--
 toolkit/source/awt/vclxwindows.cxx   |   62 
+-
 

core.git: include/toolkit toolkit/source

2024-07-10 Thread Michael Weghorn (via logerrit)
 include/toolkit/helper/vclunohelper.hxx |   42 +---
 toolkit/source/helper/vclunohelper.cxx  |   37 
 2 files changed, 34 insertions(+), 45 deletions(-)

New commits:
commit f111fbf5d508c8215615f037d7e1c1f563812a13
Author: Michael Weghorn 
AuthorDate: Wed Jul 10 14:49:03 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jul 11 06:44:28 2024 +0200

VCLUnoHelper: Align AWT <-> VCL helpers with convert.hxx impl

There are currently (at least) 2 sets of helpers
for converting from AWT to VCL point, rectangle
and size classes - and the other way around:

* the ones in `include/toolkit/helper/convert.hxx`
* the ones provided by `VCLUnoHelper`

Align the `VCLUnoHelper` implementations with the
ones in `include/toolkit/helper/convert.hxx` and
make them inline as well.

Switch params from the specific subclasses to the
more generic base classes as well
(e.g. `css::awt::Point` -> `PointTemplateBase`).

Otherwise, `VCLUnoHelper::ConvertToVCLRect` is the only one
that didn't implement the functionality in the
exact same way as the counterpart, `VCLRectangle`,
as it was manually calculating the right and bottom
edges.

The `VCLRectangle` implementation
gives the same result for valid rects, so take over
that one. (It shouldn't make a difference for the
only 2 current callers, `ControlHolder::getPosSize`
and `VCLXGraphics::clear`.)

This commit is in preparation of consolidating all uses
to use the `VCLUnoHelper` variants and getting
rid of the other one in following commits.

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

diff --git a/include/toolkit/helper/vclunohelper.hxx 
b/include/toolkit/helper/vclunohelper.hxx
index 07d4aeff1047..16616119e1aa 100644
--- a/include/toolkit/helper/vclunohelper.hxx
+++ b/include/toolkit/helper/vclunohelper.hxx
@@ -24,6 +24,9 @@
 #include 
 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -122,14 +125,37 @@ public:
 /// @throws css::lang::IllegalArgumentException
 static MapUnit /* MapModeUnit */ ConvertToMapModeUnit(sal_Int16 /* 
com.sun.star.util.MeasureUnit.* */ _nMeasureUnit);
 
-static ::Size /* VCLSize */ ConvertToVCLSize(css::awt::Size const& _aSize);
-static css::awt::Size ConvertToAWTSize(::Size /* VCLSize */ const& _aSize);
-
-static ::Point /* VCLPoint */ ConvertToVCLPoint(css::awt::Point const& 
_aPoint);
-static css::awt::Point ConvertToAWTPoint(::Point /* VCLPoint */ const& 
_aPoint);
-
-static ::tools::Rectangle ConvertToVCLRect( css::awt::Rectangle const & 
_rRect );
-static css::awt::Rectangle ConvertToAWTRect( ::tools::Rectangle const & 
_rRect );
+static inline ::Size ConvertToVCLSize(const css::awt::Size& rAWTSize)
+{
+return ::Size(rAWTSize.Width, rAWTSize.Height);
+}
+
+static inline css::awt::Size ConvertToAWTSize(const Size& rVCLSize)
+{
+return css::awt::Size(rVCLSize.Width(), rVCLSize.Height());
+}
+
+static inline ::Point ConvertToVCLPoint(const css::awt::Point& rAWTPoint)
+{
+return ::Point(rAWTPoint.X, rAWTPoint.Y);
+}
+
+static inline css::awt::Point ConvertToAWTPoint(const PointTemplateBase& 
rVCLPoint)
+{
+return css::awt::Point(rVCLPoint.X(), rVCLPoint.Y());
+}
+
+static inline ::tools::Rectangle ConvertToVCLRect(const 
css::awt::Rectangle& rAWTRect)
+{
+return ::tools::Rectangle(::Point(rAWTRect.X, rAWTRect.Y),
+  ::Size(rAWTRect.Width, rAWTRect.Height));
+}
+
+static inline css::awt::Rectangle ConvertToAWTRect(const 
RectangleTemplateBase& rVCLRect)
+{
+return css::awt::Rectangle(rVCLRect.Left(), rVCLRect.Top(), 
rVCLRect.GetWidth(),
+   rVCLRect.GetHeight());
+}
 
 static css::awt::MouseEvent
 createMouseEvent(
diff --git a/toolkit/source/helper/vclunohelper.cxx 
b/toolkit/source/helper/vclunohelper.cxx
index fc6925561984..354675e5c96b 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -48,8 +48,6 @@
 #include 
 
 #include 
-#include 
-#include 
 
 using namespace ::com::sun::star;
 
@@ -478,41 +476,6 @@ MapUnit /* MapModeUnit */ 
VCLUnoHelper::ConvertToMapModeUnit(sal_Int16 /* com.su
 return eMode;
 }
 
-::Size VCLUnoHelper::ConvertToVCLSize(css::awt::Size const& _aSize)
-{
-::Size aVCLSize(_aSize.Width, _aSize.Height);
-return aVCLSize;
-}
-
-css::awt::Size VCLUnoHelper::ConvertToAWTSize(::Size /* VCLSize */ const& 
_aSize)
-{
-css::awt::Size aAWTSize(_aSize.Width(), _aSize.Height());
-return aAWTSize;
-}
-
-
-::Point VCLUnoHelper::ConvertToVCLPoint(css::awt::Point const& _aPoint)
-{
-::Point 

core.git: sd/source

2024-07-10 Thread Michael Weghorn (via logerrit)
 sd/source/ui/view/drawview.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 4241f171ad3deb1d272dba12acde50011dd90c3c
Author: Michael Weghorn 
AuthorDate: Wed Jul 10 10:56:13 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jul 10 18:19:29 2024 +0200

sd: Switch DBG_ASSERT to assert

This fixes Windows/MSVC build errors like the one reported in [1]:

C:/BuildLO/core/sd/source/ui/view/drawview.cxx(394): error C2220: the
following warning is treated as an error
C:\BuildLODereferencing NULL pointer 'pSheet'. : Lines: 285, 
287, 289, 292, 293,
294, 313, 333, 336, 339, 341, 343, 345, 347, 349, 353, 354, 355, 369,
373, 372

[1] https://lists.freedesktop.org/archives/libreoffice/2024-July/092158.html

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

diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index f0dbf7a9d760..de83bfde277b 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -295,7 +295,7 @@ void DrawView::SetMasterAttributes( SdrObject* pObject, 
const SdPage& rPage, Sfx
 {
 // Presentation object (except outline)
 SfxStyleSheet* pSheet = rPage.GetTextStyleSheetForObject(pObject);
-DBG_ASSERT(pSheet, "StyleSheet not found");
+assert(pSheet && "StyleSheet not found");
 
 SfxItemSet aTempSet( pSheet->GetItemSet() );
 aTempSet.Put( rSet );
@@ -316,7 +316,7 @@ void DrawView::SetMasterAttributes( SdrObject* pObject, 
const SdPage& rPage, Sfx
 {
 // Presentation object (except outline)
 SfxStyleSheet* pSheet = rPage.GetStyleSheetForPresObj( ePresObjKind );
-DBG_ASSERT(pSheet, "StyleSheet not found");
+assert(pSheet && "StyleSheet not found");
 
 SfxItemSet aTempSet( pSheet->GetItemSet() );
 aTempSet.Put( rSet );
@@ -342,7 +342,7 @@ void DrawView::SetMasterAttributes( SdrObject* pObject, 
const SdPage& rPage, Sfx
 OUString::number(nLevel);
 SfxStyleSheet* pSheet = static_cast(pStShPool->
 Find(aName, SfxStyleFamily::Page));
-DBG_ASSERT(pSheet, "StyleSheet not found");
+assert(pSheet && "StyleSheet not found");
 
 SfxItemSet aTempSet( pSheet->GetItemSet() );
 


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-06-27 Thread Michael Weghorn (via logerrit)
 sfx2/source/sidebar/TabBar.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 212ec979787d22acd0c0518ea19cf9e9a9d239b2
Author: Michael Weghorn 
AuthorDate: Wed Jun 26 09:12:55 2024 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 27 16:43:42 2024 +0200

tdf#159835 sfx2: Skip sidebar menu update for gtk4 to work around crash

After

commit daed96f0818b1baae5de8b74b866009d7d89f853
Author: Michael Weghorn 
Date:   Wed Jun 19 13:08:34 2024 +0200

tdf#159835 sfx2: Keep sidebar menu up to date

, starting LO Writer with the gtk4 VCL plugin resulted
in a crash (backtrace below) due to the current menu
implementation for the gtk4 VCL plugin being
incomplete/broken.

For now, until the underlying issue has been fixed,
at least avoid crashing by skipping the menu update
when using gtk4.

This effectively reverts back to the old behavior
for gtk4, where before the above commit,
`mxMenuButton->get_active()` in `TabBar::OnToolboxClicked`
would always return false when clicking the menu button
in the sidebar, so the code path triggering the crash
wouldn't be hit, thus not triggering the
pre-existing underlying issue.

Backtrace of the crash:

Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
0x7fffe9d25afe in g_atomic_ref_count_inc () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#0  0x7fffe9d25afe in g_atomic_ref_count_inc () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x7fffe9cfb3b6 in g_hash_table_ref () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x7fffe90ff92e in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#3  0x7fffe90feaf4 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x7fffe90fef2c in g_menu_model_get_item_attribute () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#5  0x7fffe44fd500 in (anonymous 
namespace)::MenuHelper::get_item_id(int) const (this=0x5c78dbf0, pos=0) at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:5748
#6  0x7fffe44fc976 in (anonymous 
namespace)::GtkInstanceMenu::get_id(int) const (this=0x5c78dbf0, pos=0) at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:11711
#7  0x7fffe44fcd40 in virtual thunk to (anonymous 
namespace)::GtkInstanceMenu::get_id(int) const () at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:11745
#8  0x73fae52b in sfx2::sidebar::TabBar::UpdateMenus() 
(this=0x5c7ce530) at .../libreoffice/sfx2/source/sidebar/TabBar.cxx:342
#9  0x73faf86a in sfx2::sidebar::TabBar::TabBar(vcl::Window*, 
com::sun::star::uno::Reference const&, 
std::function, std::function, sfx2::sidebar::SidebarController&) (this=0x5c7ce530, 
pParentWindow=0x5c62cea0, rxFrame=..., aDeckActivationFunctor=..., 
aPopupMenuSignalConnectFunction=..., rParentSidebarController=...) at 
.../libreoffice/sfx2/source/sidebar/TabBar.cxx:76
#10 0x73f1c84d in 
VclPtr::Create&,
 com::sun::star::uno::Reference&, 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*)::$_3, 
sfx2::sidebar::SidebarController::$_3(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*)::$_4, 
sfx2::sidebar::SidebarController&>(VclPtr&,
 com::sun::star::uno::Reference&, 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*)::$_3&&, 
sfx2::sidebar::SidebarController::$_3(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*)::$_4&&, sfx2::sidebar::SidebarController&) (arg=..., 
arg=..., arg=..., arg=..., arg=...) at include/vcl/vclptr.hxx:129
#11 0x73f1cc86 in 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*) (this=0x5c6f1fc0, pParentWindow=0x5c62cea0, 
pViewFrame=0x5abb87a0) at 
.../libreoffice/sfx2/source/sidebar/SidebarController.cxx:119
#12 0x73f1d59f in 
sfx2::sidebar::SidebarController::create(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*) (pParentWindow=0x5c62cea0, pViewFrame=0x5abb87a0) 
at .../libreoffice/sfx2/source/sidebar/SidebarController.cxx:147
#13 0x73f1a997 in 
sfx2::sidebar::SidebarDockingWindow::GetOrCreateSidebarController() 
(this=0x5c62cea0) at 
.../libreoffice/sfx2/source/sidebar/SidebarDockingWindow.cxx:64
#14 0x73f1ac24 in 
sfx2::sidebar::SidebarDockingWindow::SidebarDockingWindow(SfxBindings*, 
sfx2::sidebar::SidebarChildWindow&, vcl::Window*, long) (this=0x5c62cea0, 
pSfxBindings=0x5abdafe0, rChildWindow=..., pParentWindow=0x5abdb6a0, 
nBits=137975825761) at 
.../libreoffice/sfx2/source/sidebar/SidebarDockingWindow.cxx:55
#15 0x73f19e79 in 
VclPtr::Create(SfxBindings*&, 
sfx2::sidebar::SidebarChildWindow&, vcl::Window*&, long&&) 
(arg=@0x7fff45f8: 0x5abdafe0, arg=..., 

core.git: Branch 'libreoffice-24-2' - include/sfx2 sfx2/source

2024-06-27 Thread Michael Weghorn (via logerrit)
 include/sfx2/sidebar/TabBar.hxx   |4 ++--
 sfx2/source/sidebar/SidebarController.cxx |5 +
 sfx2/source/sidebar/TabBar.cxx|   15 +--
 3 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit 2318ce7f71110beca1d89dc9fd33e6d3a98ede1e
Author: Michael Weghorn 
AuthorDate: Wed Jun 19 13:08:34 2024 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 27 16:43:18 2024 +0200

tdf#159835 sfx2: Keep sidebar menu up to date

No longer update the menu for the menu button
in the sidebar in the handler that gets called
when the button gets clicked, but continually
keep the menu up to date instead.

This ensures that the menu is up-to-date when
it gets shown. Updating the menu in the button handler
is too late since

commit f075fa01cb4f74185f13eb0a8d7f84cf1f47af49
Author: Michael Weghorn 
Date:   Tue Aug 22 10:26:32 2023 +0200

tdf#141101 tdf#101886 a11y: Restore previous focus on col/line 
popup close

, as the handler is now no more called before the menu
gets shown.

Do the update in method `TabBar::UpdateMenus` instead
and call that one whenever items change or the
sidebar gets docked/undocked, as menu entries
are shown for the items and for (un)docking.

This makes the menu show all entries again
when opened the first time after starting Writer,
which was no longer the case after the
above-mentioned commmit.

Change-Id: I9a7e341e88d2de5f34e8f85ebada3ff2ebf6b47d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169196
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit daed96f0818b1baae5de8b74b866009d7d89f853)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169250
Reviewed-by: Xisco Fauli 

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 6f922c34ea01..9a9613239689 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -73,6 +73,8 @@ public:
 /// Enables/Disables the menu button. Used by LoKit.
 void EnableMenuButton(const bool bEnable);
 
+void UpdateMenus();
+
 virtual FactoryFunction GetUITestFactory() const override;
 private:
 css::uno::Reference mxFrame;
@@ -111,8 +113,6 @@ private:
 css::uno::Reference GetItemImage(const 
DeckDescriptor& rDeskDescriptor) const;
 void UpdateButtonIcons();
 
-DECL_LINK(OnToolboxClicked, weld::Toggleable&, void);
-
 SidebarController& mrParentSidebarController;
 std::unique_ptr mpAccel;
 };
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index ce02e434833c..ae55e76cd830 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1049,6 +1049,11 @@ IMPL_LINK(SidebarController, WindowEventHandler, 
VclWindowEvent&, rEvent, void)
 maContextChangeUpdate.RequestCall();
 break;
 
+case VclEventId::WindowToggleFloating:
+// make sure the appropriate "Dock" or "Undock" menu entry is 
shown
+mpTabBar->UpdateMenus();
+break;
+
 case VclEventId::ObjectDying:
 dispose();
 break;
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 35b3c80444a6..0a305e744a15 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -73,6 +73,8 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 mxSubMenu = mxAuxBuilder->weld_menu("submenu");
 aPopupMenuSignalConnectFunction(*mxMainMenu, *mxSubMenu);
 
+UpdateMenus();
+
 gDefaultWidth = m_xContainer->get_preferred_size().Width();
 
 // we have this widget just so we can measure best width for static 
TabBar::GetDefaultWidth
@@ -80,8 +82,6 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 
 SetBackground(Wallpaper(Theme::GetColor(Theme::Color_TabBarBackground)));
 
-mxMenuButton->connect_toggled(LINK(this, TabBar, OnToolboxClicked));
-
 #ifdef DEBUG
 SetText(OUString("TabBar"));
 #endif
@@ -147,6 +147,7 @@ void TabBar::SetDecks(const 
ResourceManager::DeckContextDescriptorContainer& rDe
 }
 
 UpdateButtonIcons();
+UpdateMenus();
 }
 
 void TabBar::UpdateButtonIcons()
@@ -164,18 +165,21 @@ void TabBar::HighlightDeck(std::u16string_view rsDeckId)
 {
 for (auto const& item : maItems)
 item->mxButton->set_item_active("toggle", item->msDeckId == rsDeckId);
+UpdateMenus();
 }
 
 void TabBar::RemoveDeckHighlight()
 {
 for (auto const& item : maItems)
 item->mxButton->set_item_active("toggle", false);
+UpdateMenus();
 }
 
 void TabBar::DataChanged(const DataChangedEvent& rDataChangedEvent)
 {
 SetBackground(Theme::GetColor(Theme::Color_TabBarBackground));
 UpdateButtonIcons();
+UpdateMenus();
 
 

core.git: Branch 'libreoffice-24-2' - 4 commits - include/sfx2 sfx2/source translations vcl/source

2024-06-27 Thread Michael Weghorn (via logerrit)
 include/sfx2/sidebar/TabBar.hxx |   13 --
 sfx2/source/sidebar/TabBar.cxx  |   52 
 translations|2 -
 vcl/source/window/dockwin.cxx   |   13 +++---
 4 files changed, 26 insertions(+), 54 deletions(-)

New commits:
commit 265dad840da65377475e236ed7e031645d9e3138
Author: Michael Weghorn 
AuthorDate: Tue Jun 18 13:21:40 2024 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 27 16:42:33 2024 +0200

tdf#159835 sfx2 Connect SidebarController menu handlers earlier

Instead of connecting the SidebarController handlers
for handling activation of `TabBar` menu items
every time in `TabBar::OnToolboxClicked` (which is the
handler that gets called when clicking the menu button),
do so once in the `TabBar` ctor.

This also ensures that the handlers are connected
before the menu shows for the first time, which is
no longer true for the previous approach since

commit f075fa01cb4f74185f13eb0a8d7f84cf1f47af49
Author: Michael Weghorn 
Date:   Tue Aug 22 10:26:32 2023 +0200

tdf#141101 tdf#101886 a11y: Restore previous focus on col/line 
popup close

Now, clicking on the sidebar menu and selecting the
"Undock" entry works to undock the first time, not only
when opening the menu for the second time.

Populating all menu entries before the menu gets
opened for the first time still needs to be implemented
separately.

Change-Id: I7e5d5e511c2ce2c7304e8f88676970d76e6319df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169193
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 504e5501fce3f53d15b53f344c20e4404ff8f3db)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169248
Reviewed-by: Xisco Fauli 

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 6da0d507815f..6f922c34ea01 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -106,7 +106,6 @@ private:
 typedef ::std::vector> ItemContainer;
 ItemContainer maItems;
 const ::std::function 
maDeckActivationFunctor;
-PopupMenuSignalConnectFunction maPopupMenuSignalConnectFunction;
 
 void CreateTabItem(weld::Toolbar& rButton, const DeckDescriptor& 
rDeckDescriptor);
 css::uno::Reference GetItemImage(const 
DeckDescriptor& rDeskDescriptor) const;
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index a8afd1d4769d..35b3c80444a6 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -57,7 +57,6 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 , mxContents(mxAuxBuilder->weld_widget("TabBarContents"))
 , mxMeasureBox(mxAuxBuilder->weld_widget("measure"))
 , maDeckActivationFunctor(std::move(aDeckActivationFunctor))
-, 
maPopupMenuSignalConnectFunction(std::move(aPopupMenuSignalConnectFunction))
 , mrParentSidebarController(rParentSidebarController)
 {
 set_id("TabBar"); // for uitest
@@ -72,6 +71,7 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 mxMenuButton = mxAuxBuilder->weld_menu_button("menubutton");
 mxMainMenu = mxAuxBuilder->weld_menu("mainmenu");
 mxSubMenu = mxAuxBuilder->weld_menu("submenu");
+aPopupMenuSignalConnectFunction(*mxMainMenu, *mxSubMenu);
 
 gDefaultWidth = m_xContainer->get_preferred_size().Width();
 
@@ -415,8 +415,6 @@ IMPL_LINK_NOARG(TabBar, OnToolboxClicked, 
weld::Toggleable&, void)
 
 // No Restore or Customize options for LoKit.
 mxMainMenu->set_visible("customization", 
!comphelper::LibreOfficeKit::isActive());
-
-maPopupMenuSignalConnectFunction(*mxMainMenu, *mxSubMenu);
 }
 
 void TabBar::EnableMenuButton(const bool bEnable)
commit 6551e6160e60d05584f4fe5e6a11a4f1d639d945
Author: Michael Weghorn 
AuthorDate: Wed Jun 19 12:49:07 2024 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 27 16:42:08 2024 +0200

tdf#159835 Deduplicate a few lines in DockingWindow::SetFloatingMode

They're the same for both branches.

Change-Id: I73c3433fe3cfbb3eaa1b25cc2a76613d59d894a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169194
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>
Tested-by: Jenkins
(cherry picked from commit d7aeaeafc32f78ca38942868f965bae0e6c376b1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169247
Reviewed-by: Xisco Fauli 

diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 3f8853877b08..8d12b6658b0e 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -758,11 +758,6 @@ void DockingWindow::SetFloatingMode( bool bFloatMode )
 pWin->SetMinOutputSizePixel( maMinOutSize );
 
 pWin->SetMaxOutputSizePixel( mpImplData->maMaxOutSize );
-
-ToggleFloatingMode();
-
-if ( bVisible )
-Show();
 }
 else
 {
@@ -788,12 +783,12 

core.git: Branch 'libreoffice-24-2' - include/sfx2 sfx2/source

2024-06-27 Thread Michael Weghorn (via logerrit)
 include/sfx2/sidebar/SidebarController.hxx |   12 +
 include/sfx2/sidebar/TabBar.hxx|7 +--
 sfx2/source/sidebar/SidebarController.cxx  |   64 +
 sfx2/source/sidebar/TabBar.cxx |   56 -
 4 files changed, 64 insertions(+), 75 deletions(-)

New commits:
commit 4cd1c580a7eb20ab36623295c35c49cb63a0ee65
Author: Michael Weghorn 
AuthorDate: Mon Jun 17 13:35:12 2024 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 27 16:41:21 2024 +0200

tdf#159835 sfx2: Move logic to populate sidebar menus to TabBar

Move the logic to populate the menus from
`SidebarController::PopulatePopupMenus` (called
by `SidebarController::ShowPopupMenu`) to
`TabBar::OnToolboxClicked`. The latter called
`SidebarController::ShowPopupMenu`.
(In a first step, take over the existing implementation
but leave further changes for following commits.)

`TabBar::OnToolboxClicked` already collects all the deck
data relevant for the menus and the menus are members of that
class, so it seems more straighforward to populate
the menus there right away.
The only information needed from `SidebarController`
is whether the sidebar is docked or not, so add a
new method `SidebarController::IsDocked` to retrieve that
information.

Rename `SidebarController::ShowPopupMenu` to
`SidebarController::ConnectMenuActivateHandlers` as
it only connects the signals now, and rename
`PopupMenuProvider` to `PopupMenuSignalConnectFunction`
accordingly.

This commit does some refactoring in preparation of
fixing tdf#159835, no change in behavior intended (yet).

Change-Id: I8236f2467239e6a2f485d468656e961478eeb09c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169005
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit 008c3049b8aaaf3d40675bddc31b0198493fa761)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169245
Reviewed-by: Xisco Fauli 

diff --git a/include/sfx2/sidebar/SidebarController.hxx 
b/include/sfx2/sidebar/SidebarController.hxx
index 06e092bceec8..63fc4435848f 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -113,6 +113,8 @@ public:
 const static sal_Int32 SwitchFlag_ForceNewDeck = 0x02;
 const static sal_Int32 SwitchFlag_ForceNewPanels = 0x02;
 
+bool IsDocked() const;
+
 void OpenThenSwitchToDeck(std::u16string_view rsDeckId);
 void OpenThenToggleDeck(const OUString& rsDeckId);
 
@@ -251,14 +253,8 @@ private:
 const DeckDescriptor& rDeckDescriptor,
 const Context& rContext);
 
-void ShowPopupMenu (
-weld::Menu& rMainMenu,
-weld::Menu& rSubMenu,
-const ::std::vector& rMenuData) const;
-void PopulatePopupMenus(
-weld::Menu& rMainButton,
-weld::Menu& rSubMenu,
-const ::std::vector& rMenuData) const;
+void ConnectMenuActivateHandlers(weld::Menu& rMainMenu, weld::Menu& 
rSubMenu) const;
+
 DECL_DLLPRIVATE_LINK(OnMenuItemSelected, const OUString&, void);
 DECL_DLLPRIVATE_LINK(OnSubMenuItemSelected, const OUString&, void);
 void BroadcastPropertyChange();
diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index bb7e48f3cd51..765dffc1435f 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -54,13 +54,12 @@ public:
 bool mbIsEnabled;
 };
 typedef ::std::function& rMenuData)> PopupMenuProvider;
+weld::Menu& rMainMenu, weld::Menu& rSubMenu)> 
PopupMenuSignalConnectFunction;
 TabBar (
 vcl::Window* pParentWindow,
 const css::uno::Reference& rxFrame,
 ::std::function 
aDeckActivationFunctor,
-PopupMenuProvider aPopupMenuProvider,
+PopupMenuSignalConnectFunction aPopupMenuSignalConnectFunction,
 SidebarController& rParentSidebarController);
 
 weld::Container* GetContainer() { return m_xContainer.get(); }
@@ -119,7 +118,7 @@ private:
 typedef ::std::vector> ItemContainer;
 ItemContainer maItems;
 const ::std::function 
maDeckActivationFunctor;
-PopupMenuProvider maPopupMenuProvider;
+PopupMenuSignalConnectFunction maPopupMenuSignalConnectFunction;
 
 void CreateTabItem(weld::Toolbar& rButton, const DeckDescriptor& 
rDeckDescriptor);
 css::uno::Reference GetItemImage(const 
DeckDescriptor& rDeskDescriptor) const;
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index d7234553e86a..ce02e434833c 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -117,8 +117,7 @@ SidebarController::SidebarController (
   mpParentWindow,
   mxFrame,
   [this](const OUString& rsDeckId) { return 
this->OpenThenToggleDeck(rsDeckId); },
-  

core.git: Branch 'libreoffice-24-2' - include/sfx2 sfx2/source

2024-06-27 Thread Michael Weghorn (via logerrit)
 include/sfx2/sidebar/TabBar.hxx   |5 ++---
 sfx2/source/sidebar/SidebarController.cxx |2 +-
 sfx2/source/sidebar/TabBar.cxx|   16 
 sfx2/source/sidebar/uiobject.cxx  |2 +-
 4 files changed, 12 insertions(+), 13 deletions(-)

New commits:
commit 384331baab1166d9a7abdebc25e6ae1a1772179f
Author: Michael Weghorn 
AuthorDate: Mon Jun 17 13:26:18 2024 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 27 16:40:48 2024 +0200

tdf#159835 sfx2: Use reference instead of pointer

This e.g. makes it clear that this is never null.
Also use an `m` prefix for the class member.

Change-Id: Ia66245f17e7f0ca9e57750e8606c8ccc1387eb97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169004
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 8a10012039204b208aea3bc2f9da9fe1162c4a2a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169244
Reviewed-by: Xisco Fauli 

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 6ef0fc9c3ddd..bb7e48f3cd51 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -61,7 +61,7 @@ public:
 const css::uno::Reference& rxFrame,
 ::std::function 
aDeckActivationFunctor,
 PopupMenuProvider aPopupMenuProvider,
-SidebarController* rParentSidebarController);
+SidebarController& rParentSidebarController);
 
 weld::Container* GetContainer() { return m_xContainer.get(); }
 
@@ -127,9 +127,8 @@ private:
 
 DECL_LINK(OnToolboxClicked, weld::Toggleable&, void);
 
-SidebarController* pParentSidebarController;
+SidebarController& mrParentSidebarController;
 std::unique_ptr mpAccel;
-
 };
 
 
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 3e76cb2b14af..d7234553e86a 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -119,7 +119,7 @@ SidebarController::SidebarController (
   [this](const OUString& rsDeckId) { return 
this->OpenThenToggleDeck(rsDeckId); },
   [this](weld::Menu& rMainMenu, weld::Menu& rSubMenu,
  const ::std::vector& rMenuData) { 
return this->ShowPopupMenu(rMainMenu, rSubMenu, rMenuData); },
-  this)),
+  *this)),
   maCurrentContext(OUString(), OUString()),
   maRequestedContext(OUString(), OUString()),
   mnRequestedForceFlags(SwitchFlag_NoForce),
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 9d92d24cd93a..ffc6959e3904 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -48,7 +48,7 @@ TabBar::TabBar(vcl::Window* pParentWindow,
const Reference& rxFrame,
std::function aDeckActivationFunctor,
PopupMenuProvider  aPopupMenuProvider,
-   SidebarController* rParentSidebarController
+   SidebarController& rParentSidebarController
   )
 : InterimItemWindow(pParentWindow, "sfx/ui/tabbar.ui", "TabBar")
 , mxFrame(rxFrame)
@@ -58,7 +58,7 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 , mxMeasureBox(mxAuxBuilder->weld_widget("measure"))
 , maDeckActivationFunctor(std::move(aDeckActivationFunctor))
 , maPopupMenuProvider(std::move(aPopupMenuProvider))
-, pParentSidebarController(rParentSidebarController)
+, mrParentSidebarController(rParentSidebarController)
 {
 set_id("TabBar"); // for uitest
 
@@ -127,7 +127,7 @@ void TabBar::SetDecks(const 
ResourceManager::DeckContextDescriptorContainer& rDe
 maItems.clear();
 for (auto const& deck : rDecks)
 {
-std::shared_ptr xDescriptor = 
pParentSidebarController->GetResourceManager()->GetDeckDescriptor(deck.msId);
+std::shared_ptr xDescriptor = 
mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(deck.msId);
 if (xDescriptor == nullptr)
 {
 OSL_ASSERT(xDescriptor!=nullptr);
@@ -153,7 +153,7 @@ void TabBar::UpdateButtonIcons()
 {
 for (auto const& item : maItems)
 {
-std::shared_ptr xDeckDescriptor = 
pParentSidebarController->GetResourceManager()->GetDeckDescriptor(item->msDeckId);
+std::shared_ptr xDeckDescriptor = 
mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(item->msDeckId);
 if (!xDeckDescriptor)
 continue;
 item->mxButton->set_item_image("toggle", 
GetItemImage(*xDeckDescriptor));
@@ -297,13 +297,13 @@ void TabBar::ToggleHideFlag (const sal_Int32 nIndex)
 
 maItems[nIndex]->mbIsHidden = ! maItems[nIndex]->mbIsHidden;
 
-std::shared_ptr xDeckDescriptor = 
pParentSidebarController->GetResourceManager()->GetDeckDescriptor(maItems[nIndex]->msDeckId);
+std::shared_ptr xDeckDescriptor = 
mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(maItems[nIndex]->msDeckId);
 

core.git: Branch 'libreoffice-24-8' - sfx2/source

2024-06-26 Thread Michael Weghorn (via logerrit)
 sfx2/source/sidebar/TabBar.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit a0b317a321146cac545aacd16b08fa84ce48d998
Author: Michael Weghorn 
AuthorDate: Wed Jun 26 09:12:55 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jun 26 23:00:01 2024 +0200

tdf#159835 sfx2: Skip sidebar menu update for gtk4 to work around crash

After

commit daed96f0818b1baae5de8b74b866009d7d89f853
Author: Michael Weghorn 
Date:   Wed Jun 19 13:08:34 2024 +0200

tdf#159835 sfx2: Keep sidebar menu up to date

, starting LO Writer with the gtk4 VCL plugin resulted
in a crash (backtrace below) due to the current menu
implementation for the gtk4 VCL plugin being
incomplete/broken.

For now, until the underlying issue has been fixed,
at least avoid crashing by skipping the menu update
when using gtk4.

This effectively reverts back to the old behavior
for gtk4, where before the above commit,
`mxMenuButton->get_active()` in `TabBar::OnToolboxClicked`
would always return false when clicking the menu button
in the sidebar, so the code path triggering the crash
wouldn't be hit, thus not triggering the
pre-existing underlying issue.

Backtrace of the crash:

Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
0x7fffe9d25afe in g_atomic_ref_count_inc () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#0  0x7fffe9d25afe in g_atomic_ref_count_inc () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x7fffe9cfb3b6 in g_hash_table_ref () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x7fffe90ff92e in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#3  0x7fffe90feaf4 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x7fffe90fef2c in g_menu_model_get_item_attribute () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#5  0x7fffe44fd500 in (anonymous 
namespace)::MenuHelper::get_item_id(int) const (this=0x5c78dbf0, pos=0) at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:5748
#6  0x7fffe44fc976 in (anonymous 
namespace)::GtkInstanceMenu::get_id(int) const (this=0x5c78dbf0, pos=0) at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:11711
#7  0x7fffe44fcd40 in virtual thunk to (anonymous 
namespace)::GtkInstanceMenu::get_id(int) const () at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:11745
#8  0x73fae52b in sfx2::sidebar::TabBar::UpdateMenus() 
(this=0x5c7ce530) at .../libreoffice/sfx2/source/sidebar/TabBar.cxx:342
#9  0x73faf86a in sfx2::sidebar::TabBar::TabBar(vcl::Window*, 
com::sun::star::uno::Reference const&, 
std::function, std::function, sfx2::sidebar::SidebarController&) (this=0x5c7ce530, 
pParentWindow=0x5c62cea0, rxFrame=..., aDeckActivationFunctor=..., 
aPopupMenuSignalConnectFunction=..., rParentSidebarController=...) at 
.../libreoffice/sfx2/source/sidebar/TabBar.cxx:76
#10 0x73f1c84d in 
VclPtr::Create&,
 com::sun::star::uno::Reference&, 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*)::$_3, 
sfx2::sidebar::SidebarController::$_3(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*)::$_4, 
sfx2::sidebar::SidebarController&>(VclPtr&,
 com::sun::star::uno::Reference&, 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*)::$_3&&, 
sfx2::sidebar::SidebarController::$_3(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*)::$_4&&, sfx2::sidebar::SidebarController&) (arg=..., 
arg=..., arg=..., arg=..., arg=...) at include/vcl/vclptr.hxx:129
#11 0x73f1cc86 in 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*) (this=0x5c6f1fc0, pParentWindow=0x5c62cea0, 
pViewFrame=0x5abb87a0) at 
.../libreoffice/sfx2/source/sidebar/SidebarController.cxx:119
#12 0x73f1d59f in 
sfx2::sidebar::SidebarController::create(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*) (pParentWindow=0x5c62cea0, pViewFrame=0x5abb87a0) 
at .../libreoffice/sfx2/source/sidebar/SidebarController.cxx:147
#13 0x73f1a997 in 
sfx2::sidebar::SidebarDockingWindow::GetOrCreateSidebarController() 
(this=0x5c62cea0) at 
.../libreoffice/sfx2/source/sidebar/SidebarDockingWindow.cxx:64
#14 0x73f1ac24 in 
sfx2::sidebar::SidebarDockingWindow::SidebarDockingWindow(SfxBindings*, 
sfx2::sidebar::SidebarChildWindow&, vcl::Window*, long) (this=0x5c62cea0, 
pSfxBindings=0x5abdafe0, rChildWindow=..., pParentWindow=0x5abdb6a0, 
nBits=137975825761) at 
.../libreoffice/sfx2/source/sidebar/SidebarDockingWindow.cxx:55
#15 0x73f19e79 in 
VclPtr::Create(SfxBindings*&, 
sfx2::sidebar::SidebarChildWindow&, vcl::Window*&, long&&) 
(arg=@0x7fff45f8: 0x5abdafe0, arg=..., 

core.git: sfx2/source

2024-06-26 Thread Michael Weghorn (via logerrit)
 sfx2/source/sidebar/TabBar.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 879bcc88759d7dd033e0ee667daee0d2a743cf06
Author: Michael Weghorn 
AuthorDate: Wed Jun 26 09:12:55 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jun 26 17:59:37 2024 +0200

tdf#159835 sfx2: Skip sidebar menu update for gtk4 to work around crash

After

commit daed96f0818b1baae5de8b74b866009d7d89f853
Author: Michael Weghorn 
Date:   Wed Jun 19 13:08:34 2024 +0200

tdf#159835 sfx2: Keep sidebar menu up to date

, starting LO Writer with the gtk4 VCL plugin resulted
in a crash (backtrace below) due to the current menu
implementation for the gtk4 VCL plugin being
incomplete/broken.

For now, until the underlying issue has been fixed,
at least avoid crashing by skipping the menu update
when using gtk4.

This effectively reverts back to the old behavior
for gtk4, where before the above commit,
`mxMenuButton->get_active()` in `TabBar::OnToolboxClicked`
would always return false when clicking the menu button
in the sidebar, so the code path triggering the crash
wouldn't be hit, thus not triggering the
pre-existing underlying issue.

Backtrace of the crash:

Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
0x7fffe9d25afe in g_atomic_ref_count_inc () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#0  0x7fffe9d25afe in g_atomic_ref_count_inc () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x7fffe9cfb3b6 in g_hash_table_ref () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x7fffe90ff92e in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#3  0x7fffe90feaf4 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x7fffe90fef2c in g_menu_model_get_item_attribute () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#5  0x7fffe44fd500 in (anonymous 
namespace)::MenuHelper::get_item_id(int) const (this=0x5c78dbf0, pos=0) at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:5748
#6  0x7fffe44fc976 in (anonymous 
namespace)::GtkInstanceMenu::get_id(int) const (this=0x5c78dbf0, pos=0) at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:11711
#7  0x7fffe44fcd40 in virtual thunk to (anonymous 
namespace)::GtkInstanceMenu::get_id(int) const () at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:11745
#8  0x73fae52b in sfx2::sidebar::TabBar::UpdateMenus() 
(this=0x5c7ce530) at .../libreoffice/sfx2/source/sidebar/TabBar.cxx:342
#9  0x73faf86a in sfx2::sidebar::TabBar::TabBar(vcl::Window*, 
com::sun::star::uno::Reference const&, 
std::function, std::function, sfx2::sidebar::SidebarController&) (this=0x5c7ce530, 
pParentWindow=0x5c62cea0, rxFrame=..., aDeckActivationFunctor=..., 
aPopupMenuSignalConnectFunction=..., rParentSidebarController=...) at 
.../libreoffice/sfx2/source/sidebar/TabBar.cxx:76
#10 0x73f1c84d in 
VclPtr::Create&,
 com::sun::star::uno::Reference&, 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*)::$_3, 
sfx2::sidebar::SidebarController::$_3(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*)::$_4, 
sfx2::sidebar::SidebarController&>(VclPtr&,
 com::sun::star::uno::Reference&, 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*)::$_3&&, 
sfx2::sidebar::SidebarController::$_3(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*)::$_4&&, sfx2::sidebar::SidebarController&) (arg=..., 
arg=..., arg=..., arg=..., arg=...) at include/vcl/vclptr.hxx:129
#11 0x73f1cc86 in 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*) (this=0x5c6f1fc0, pParentWindow=0x5c62cea0, 
pViewFrame=0x5abb87a0) at 
.../libreoffice/sfx2/source/sidebar/SidebarController.cxx:119
#12 0x73f1d59f in 
sfx2::sidebar::SidebarController::create(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*) (pParentWindow=0x5c62cea0, pViewFrame=0x5abb87a0) 
at .../libreoffice/sfx2/source/sidebar/SidebarController.cxx:147
#13 0x73f1a997 in 
sfx2::sidebar::SidebarDockingWindow::GetOrCreateSidebarController() 
(this=0x5c62cea0) at 
.../libreoffice/sfx2/source/sidebar/SidebarDockingWindow.cxx:64
#14 0x73f1ac24 in 
sfx2::sidebar::SidebarDockingWindow::SidebarDockingWindow(SfxBindings*, 
sfx2::sidebar::SidebarChildWindow&, vcl::Window*, long) (this=0x5c62cea0, 
pSfxBindings=0x5abdafe0, rChildWindow=..., pParentWindow=0x5abdb6a0, 
nBits=137975825761) at 
.../libreoffice/sfx2/source/sidebar/SidebarDockingWindow.cxx:55
#15 0x73f19e79 in 
VclPtr::Create(SfxBindings*&, 
sfx2::sidebar::SidebarChildWindow&, vcl::Window*&, long&&) 
(arg=@0x7fff45f8: 0x5abdafe0, arg=..., 

core.git: vcl/unx

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

New commits:
commit 085510962a4455f07d7be713adbb6084302c121e
Author: Michael Weghorn 
AuthorDate: Mon Jun 24 10:12:57 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jun 26 05:53:09 2024 +0200

gtk4 a11y: Handle when there's no a11y context

Handle the case where `XAccessible::getAccessibleContext`
returns an empty reference, as e.g.
`VCLXWindow::getAccessibleContext` does when already
disposed.

Fixes an assert/crash seen with the gtk4 VCL plugin
when experimenting with missing menu item handling
in Writer's "Tools" -> "Bibliography Database",
expanding the search filter menu, then closing the dialog
and LO altogether.

Backtrace:

Thread 1 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.
(rr) bt
#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x7fe8f96a6b6f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7fe8f96584e2 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7fe8f96414ed in __GI_abort () at ./stdlib/abort.c:79
#4  0x7fe8f9641415 in __assert_fail_base
(fmt=0x7fe8f97b7ba8 "%s%s%s:%u: %s%sAssertion `%s' failed.
%n", assertion=assertion@entry=0x7fe8e5f1ba3a "_pInterface != NULL", 
file=file@entry=0x7fe8e5f46536 
".../libreoffice/include/com/sun/star/uno/Reference.h", line=line@entry=387, 
function=function@entry=0x7fe8e5f41e71 "interface_type 
*com::sun::star::uno::Reference::operator->()
 const [interface_type = com::sun::star::accessibility::XAccessibleContext]") 
at ./assert/assert.c:92
#5  0x7fe8f9651002 in __assert_fail
(assertion=0x7fe8e5f1ba3a "_pInterface != NULL", 
file=0x7fe8e5f46536 ".../libreoffice/include/com/sun/star/uno/Reference.h", 
line=387, function=0x7fe8e5f41e71 "interface_type 
*com::sun::star::uno::Reference::operator->()
 const [interface_type = com::sun::star::accessibility::XAccessibleContext]") 
at ./assert/assert.c:101
#6  0x7fe8e6034e42 in 
com::sun::star::uno::Reference::operator->()
 const (this=0x7ffe3fddc640) at include/com/sun/star/uno/Reference.h:387
#7  0x7fe8e6038c14 in 
map_accessible_role(com::sun::star::uno::Reference
 const&) (rAccessible=uno::Reference to (VCLXWindow *) 0x5603d155bba8)
at .../libreoffice/vcl/unx/gtk4/a11y.cxx:56
#8  0x7fe8e6038a16 in lo_accessible_get_property(_GObject*, 
unsigned int, _GValue*, _GParamSpec*) (object=0x5603e5e9fde0, property_id=2, 
value=0x7ffe3fddca00, pspec=0x5603bfdc1820)
at .../libreoffice/vcl/unx/gtk4/a11y.cxx:559
#9  0x7fe8f47be345 in g_object_get_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x7fe8f47be8b7 in g_object_get () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#11 0x7fe8e54d81f8 in gtk_accessible_get_accessible_role 
(self=self@entry=0x5603e5e9fde0) at ../gtk/gtkaccessible.c:296
#12 0x7fe8e54d9447 in gtk_accessible_should_present 
(self=self@entry=0x5603e5e9fde0) at ../gtk/gtkaccessible.c:1304
#13 0x7fe8e575dab8 in get_index_in 
(parent=parent@entry=0x5603e4203030, child=child@entry=0x5603e5ea13a0) at 
../gtk/a11y/gtkatspicontext.c:398
#14 0x7fe8e5760213 in gtk_at_spi_context_child_change 
(ctx=0x5603e41f8670, change=GTK_ACCESSIBLE_CHILD_CHANGE_REMOVED, 
child=0x5603e5ea13a0) at ../gtk/a11y/gtkatspicontext.c:1260
#15 0x7fe8e575ed8f in gtk_at_spi_context_state_change
(ctx=0x5603e5ea15a0, 
changed_states=GTK_ACCESSIBLE_STATE_CHANGE_HIDDEN, changed_properties=0, 
changed_relations=, states=0x5603e5ea1770, 
properties=0x5603e5ea16b0, relations=0x5603e5ea1710)
at ../gtk/a11y/gtkatspicontext.c:979
#16 0x7fe8e54e2bdf in gtk_at_context_update (self=0x5603e5ea15a0) 
at ../gtk/gtkatcontext.c:831
#17 0x7fe8e54d839a in gtk_accessible_update_state 
(self=self@entry=0x5603e5ea13a0, 
first_state=first_state@entry=GTK_ACCESSIBLE_STATE_HIDDEN) at 
../gtk/gtkaccessible.c:364
#18 0x7fe8e5684d4b in gtk_widget_unmap (widget=0x5603e5ea13a0) at 
../gtk/gtkwidget.c:2895
#19 gtk_widget_unmap (widget=0x5603e5ea13a0) at ../gtk/gtkwidget.c:2879
#20 0x7fe8e5684e25 in gtk_widget_real_hide (widget=0x5603e5ea13a0) 
at ../gtk/gtkwidget.c:2811
#21 0x7fe8f47b4939 in  () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x7fe8f47ca33f in  () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x7fe8f47cff06 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x7fe8f47cffc3 in g_signal_emit () at 

core.git: Branch 'libreoffice-24-8' - vcl/qt5

2024-06-21 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtObject.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 359cdd6b3b401519621dd10fc072305d627dccc0
Author: Michael Weghorn 
AuthorDate: Fri Jun 21 20:39:46 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat Jun 22 06:56:37 2024 +0200

tdf#149461 qt5: Provide a QWindow for OpenGL rendering on X11

When using the qt5 or kf5 VCL plugins on X11/XWayland
(as can be forced using QT_QPA_PLUGIN=xcb on Wayland),
ensure that a QWindow exists for the QtObjectWidget
created in the QtObject ctor, as that is needed for
OpenGL rendering.

This makes OpenGL Impress slide transitions like the
"Tiles" one work.

Don't force native windows on Wayland, as that causes
other issues, see also QtFrame::ResolveWindowHandle
and the bugs referenced in there.

Change-Id: I8fac34d2f1cc7cc723ad4570546276a05641dd88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169348
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit 89372e62454a72c6c400f00bfe3221bc0fe6d23e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169367

diff --git a/vcl/qt5/QtObject.cxx b/vcl/qt5/QtObject.cxx
index b9f1b804f95c..8c9535b41f20 100644
--- a/vcl/qt5/QtObject.cxx
+++ b/vcl/qt5/QtObject.cxx
@@ -48,6 +48,11 @@ QtObject::QtObject(QtFrame* pParent, bool bShow)
 // which is not a problem with the QtMultimedia approach that the qt6 
VCL plugin uses;
 // stay with the QtObjectWidget introduced in commit 
4366e0605214260e55a937173b0c2e02225dc843
 m_pQWidget = new QtObjectWidget(*this);
+
+// invoke QWidget::winId() to ensure a native window for OpenGL 
rendering is available on X11,
+// don't do it on Wayland, as that breaks rendering otherwise, s.a. 
QtFrame::ResolveWindowHandle
+if (QGuiApplication::platformName() == "xcb")
+m_pQWidget->winId();
 m_pQWindow = m_pQWidget->windowHandle();
 }
 


core.git: Branch 'libreoffice-24-8' - 2 commits - vcl/inc vcl/qt5

2024-06-21 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtObject.hxx|7 ++-
 vcl/qt5/QtObject.cxx|   31 +--
 vcl/qt5/QtOpenGLContext.cxx |9 +
 3 files changed, 36 insertions(+), 11 deletions(-)

New commits:
commit 734a74dec8f20d46d6a236071d4601aa763763e7
Author: Michael Weghorn 
AuthorDate: Fri Jun 21 19:53:50 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat Jun 22 06:56:30 2024 +0200

tdf#149461 qt6: Provide a QWindow for OpenGL rendering

As described at [1], "QWindow supports rendering using
OpenGL [...]".

Using a QWindow for OpenGL rendering had been introduced
in

commit 56b19f9a814ae5a39ed760ee542d715493cd0bf3
Date:   Fri Dec 14 12:44:20 2018 +0300

tdf#121247, tdf#121266 KDE5: Add basic support for OpenGL

, but then

commit 4366e0605214260e55a937173b0c2e02225dc843
Date:   Tue May 24 11:34:59 2022 +0200

tdf#148864 Qt switch QtObjectWindow to QWidget

had switched from QWindow to QWidget, and OpenGL slide
transitions like the "Tiles" one stopped working.

At least for qt6, which now uses QtMultimedia for video
playback (see the tdf#145735 commits), issues like tdf#148864
("Kubuntu 22.04 LTS LibreOffice Impress 7.3.3 Fails to Play Embedded
 Videos") and tdf#125517 ("LO Impress: Can't stop presentation
with video and go to the next slide") related to video playback
appear to be no problem, so switch back to using QWindow there.

Explicitly set the window background to transparent
in `QtOpenGLContext::ImplInit`, as not doing so
caused slide content in presentation mode to not
be updated properly when testing with the attachment 183972
from tdf#149461 on Wayland.
(This was not an issue when running on XWayland, i.e.
with QT_QPA_PLATFORM=xcb).

With this in place, OpenGL transitions work with qt6.
With QT_QPA_PLATFORM=xcb, it looks all fine in my tests
on Debian testing.

With QT_QPA_PLATFORM=wayland, the slide text from attachment 183972
sometimes incorrectly showed up for a fraction of a second after
the slide transition finished, then disappeared again until
it was triggered to show as it should (e.g. by pressing the right
arrow key), s. screencast attachment 194899 in tdf#149461.
A multitude of warnings like the following are shown on stderr
in that case, which don't show up for xcb:

warn:vcl.opengl:47352:47352:vcl/source/opengl/OpenGLHelper.cxx:709: GL 
Error 0506 (invalid framebuffer operation) in file 
/home/michi/development/git/libreoffice/slideshow/source/engine/opengl/TransitionImpl.cxx
 at line 398

That looks like a separate issue to me, however which would
need further analysis.

Keep using the QtObjectWindow approach for qt5 to
not regress on video playback.

[1] https://doc.qt.io/qt-5/qtgui-index.html#opengl-and-opengl-es-integration

Change-Id: I6e1eb989254e2cbbfada6f719ee0518571df4c42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169347
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit b296b33cfbde5113f27ddef71a48380cb6ce5e06)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169366

diff --git a/vcl/inc/qt5/QtObject.hxx b/vcl/inc/qt5/QtObject.hxx
index bc5a8e584b8f..e5f9944d6b86 100644
--- a/vcl/inc/qt5/QtObject.hxx
+++ b/vcl/inc/qt5/QtObject.hxx
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class QtFrame;
@@ -36,7 +37,11 @@ class QtObject final : public QObject, public SalObject
 
 SystemEnvData m_aSystemData;
 QtFrame* m_pParent;
-QtObjectWidget* m_pQWidget;
+
+// window, required for OpenGL rendering
+QWindow* m_pQWindow;
+QWidget* m_pQWidget;
+
 QRegion m_pRegion;
 bool m_bForwardKey;
 
diff --git a/vcl/qt5/QtObject.cxx b/vcl/qt5/QtObject.cxx
index 229916bcd1ff..b9f1b804f95c 100644
--- a/vcl/qt5/QtObject.cxx
+++ b/vcl/qt5/QtObject.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -36,7 +37,19 @@ QtObject::QtObject(QtFrame* pParent, bool bShow)
 if (!m_pParent || !pParent->GetQWidget())
 return;
 
-m_pQWidget = new QtObjectWidget(*this);
+if (QLibraryInfo::version().majorVersion() > 5)
+{
+m_pQWindow = new QWindow;
+m_pQWidget = QWidget::createWindowContainer(m_pQWindow, 
pParent->GetQWidget());
+}
+else
+{
+// with the qt5 VCL plugin, the above would cause issues with video 
playback (s. tdf#148864, tdf#125517),
+// which is not a problem with the QtMultimedia approach that the qt6 
VCL plugin uses;
+// stay with the QtObjectWidget introduced in commit 
4366e0605214260e55a937173b0c2e02225dc843
+m_pQWidget = new QtObjectWidget(*this);
+m_pQWindow = m_pQWidget->windowHandle();
+}
 
 // set layout, used for video playback, see 

core.git: vcl/qt5

2024-06-21 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtObject.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 89372e62454a72c6c400f00bfe3221bc0fe6d23e
Author: Michael Weghorn 
AuthorDate: Fri Jun 21 20:39:46 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jun 21 23:19:09 2024 +0200

tdf#149461 qt5: Provide a QWindow for OpenGL rendering on X11

When using the qt5 or kf5 VCL plugins on X11/XWayland
(as can be forced using QT_QPA_PLUGIN=xcb on Wayland),
ensure that a QWindow exists for the QtObjectWidget
created in the QtObject ctor, as that is needed for
OpenGL rendering.

This makes OpenGL Impress slide transitions like the
"Tiles" one work.

Don't force native windows on Wayland, as that causes
other issues, see also QtFrame::ResolveWindowHandle
and the bugs referenced in there.

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

diff --git a/vcl/qt5/QtObject.cxx b/vcl/qt5/QtObject.cxx
index b9f1b804f95c..8c9535b41f20 100644
--- a/vcl/qt5/QtObject.cxx
+++ b/vcl/qt5/QtObject.cxx
@@ -48,6 +48,11 @@ QtObject::QtObject(QtFrame* pParent, bool bShow)
 // which is not a problem with the QtMultimedia approach that the qt6 
VCL plugin uses;
 // stay with the QtObjectWidget introduced in commit 
4366e0605214260e55a937173b0c2e02225dc843
 m_pQWidget = new QtObjectWidget(*this);
+
+// invoke QWidget::winId() to ensure a native window for OpenGL 
rendering is available on X11,
+// don't do it on Wayland, as that breaks rendering otherwise, s.a. 
QtFrame::ResolveWindowHandle
+if (QGuiApplication::platformName() == "xcb")
+m_pQWidget->winId();
 m_pQWindow = m_pQWidget->windowHandle();
 }
 


core.git: 2 commits - vcl/inc vcl/qt5

2024-06-21 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtObject.hxx|7 ++-
 vcl/qt5/QtObject.cxx|   31 +--
 vcl/qt5/QtOpenGLContext.cxx |9 +
 3 files changed, 36 insertions(+), 11 deletions(-)

New commits:
commit b296b33cfbde5113f27ddef71a48380cb6ce5e06
Author: Michael Weghorn 
AuthorDate: Fri Jun 21 19:53:50 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jun 21 23:19:02 2024 +0200

tdf#149461 qt6: Provide a QWindow for OpenGL rendering

As described at [1], "QWindow supports rendering using
OpenGL [...]".

Using a QWindow for OpenGL rendering had been introduced
in

commit 56b19f9a814ae5a39ed760ee542d715493cd0bf3
Date:   Fri Dec 14 12:44:20 2018 +0300

tdf#121247, tdf#121266 KDE5: Add basic support for OpenGL

, but then

commit 4366e0605214260e55a937173b0c2e02225dc843
Date:   Tue May 24 11:34:59 2022 +0200

tdf#148864 Qt switch QtObjectWindow to QWidget

had switched from QWindow to QWidget, and OpenGL slide
transitions like the "Tiles" one stopped working.

At least for qt6, which now uses QtMultimedia for video
playback (see the tdf#145735 commits), issues like tdf#148864
("Kubuntu 22.04 LTS LibreOffice Impress 7.3.3 Fails to Play Embedded
 Videos") and tdf#125517 ("LO Impress: Can't stop presentation
with video and go to the next slide") related to video playback
appear to be no problem, so switch back to using QWindow there.

Explicitly set the window background to transparent
in `QtOpenGLContext::ImplInit`, as not doing so
caused slide content in presentation mode to not
be updated properly when testing with the attachment 183972
from tdf#149461 on Wayland.
(This was not an issue when running on XWayland, i.e.
with QT_QPA_PLATFORM=xcb).

With this in place, OpenGL transitions work with qt6.
With QT_QPA_PLATFORM=xcb, it looks all fine in my tests
on Debian testing.

With QT_QPA_PLATFORM=wayland, the slide text from attachment 183972
sometimes incorrectly showed up for a fraction of a second after
the slide transition finished, then disappeared again until
it was triggered to show as it should (e.g. by pressing the right
arrow key), s. screencast attachment 194899 in tdf#149461.
A multitude of warnings like the following are shown on stderr
in that case, which don't show up for xcb:

warn:vcl.opengl:47352:47352:vcl/source/opengl/OpenGLHelper.cxx:709: GL 
Error 0506 (invalid framebuffer operation) in file 
/home/michi/development/git/libreoffice/slideshow/source/engine/opengl/TransitionImpl.cxx
 at line 398

That looks like a separate issue to me, however which would
need further analysis.

Keep using the QtObjectWindow approach for qt5 to
not regress on video playback.

[1] https://doc.qt.io/qt-5/qtgui-index.html#opengl-and-opengl-es-integration

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

diff --git a/vcl/inc/qt5/QtObject.hxx b/vcl/inc/qt5/QtObject.hxx
index bc5a8e584b8f..e5f9944d6b86 100644
--- a/vcl/inc/qt5/QtObject.hxx
+++ b/vcl/inc/qt5/QtObject.hxx
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class QtFrame;
@@ -36,7 +37,11 @@ class QtObject final : public QObject, public SalObject
 
 SystemEnvData m_aSystemData;
 QtFrame* m_pParent;
-QtObjectWidget* m_pQWidget;
+
+// window, required for OpenGL rendering
+QWindow* m_pQWindow;
+QWidget* m_pQWidget;
+
 QRegion m_pRegion;
 bool m_bForwardKey;
 
diff --git a/vcl/qt5/QtObject.cxx b/vcl/qt5/QtObject.cxx
index 229916bcd1ff..b9f1b804f95c 100644
--- a/vcl/qt5/QtObject.cxx
+++ b/vcl/qt5/QtObject.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -36,7 +37,19 @@ QtObject::QtObject(QtFrame* pParent, bool bShow)
 if (!m_pParent || !pParent->GetQWidget())
 return;
 
-m_pQWidget = new QtObjectWidget(*this);
+if (QLibraryInfo::version().majorVersion() > 5)
+{
+m_pQWindow = new QWindow;
+m_pQWidget = QWidget::createWindowContainer(m_pQWindow, 
pParent->GetQWidget());
+}
+else
+{
+// with the qt5 VCL plugin, the above would cause issues with video 
playback (s. tdf#148864, tdf#125517),
+// which is not a problem with the QtMultimedia approach that the qt6 
VCL plugin uses;
+// stay with the QtObjectWidget introduced in commit 
4366e0605214260e55a937173b0c2e02225dc843
+m_pQWidget = new QtObjectWidget(*this);
+m_pQWindow = m_pQWidget->windowHandle();
+}
 
 // set layout, used for video playback, see QtPlayer::createPlayerWindow
 QVBoxLayout* layout = new QVBoxLayout;
@@ -58,10 +71,7 @@ QtObject::~QtObject()
 }
 }
 
-QWindow* 

core.git: Branch 'libreoffice-24-8' - sc/source solenv/sanitizers

2024-06-21 Thread Michael Weghorn (via logerrit)
 sc/source/ui/sidebar/CellBorderStyleControl.cxx |   16 
 solenv/sanitizers/ui/modules/scalc.false|   19 +++
 solenv/sanitizers/ui/modules/scalc.suppr|   19 ---
 3 files changed, 35 insertions(+), 19 deletions(-)

New commits:
commit 947b67ff63a58e858537cdbbd4ffea0a96d33bfe
Author: Michael Weghorn 
AuthorDate: Fri Jun 21 09:00:41 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Jun 21 15:50:52 2024 +0200

tdf#161648 sc a11y: Set a11y names for items in border style control

Set accessible names for the items in the "Borders"
control in the Calc Sidebar, "Properties" deck, section
"Cell Appearance". Use the same text as is used for the tooltip.

With this in place, Orca now announces what each item
is about when using the gtk3 VCL plugin, instead of just saying
"Button".

Move the gla11y suppressions to the .false file, as they
have been dealt with now, see doc at [1].

[1] https://wiki.documentfoundation.org/Development/Accessibility

Change-Id: Id1856e4b116acad9bf6d14132bc6d9c91a01ae06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169321
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169331

diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx 
b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index f8e792ee183b..1ffbc213fb19 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -66,27 +66,43 @@ void CellBorderStylePopup::Initialize()
 {
 mxTBBorder1->connect_clicked ( LINK(this, CellBorderStylePopup, 
TB1SelectHdl) );
 mxTBBorder1->set_item_tooltip_text(0, 
SvxResId(RID_SVXSTR_TABLE_PRESET_NONE));
+mxTBBorder1->set_item_accessible_name(0, 
SvxResId(RID_SVXSTR_TABLE_PRESET_NONE));
 mxTBBorder1->set_item_tooltip_text(1, 
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERALL));
+mxTBBorder1->set_item_accessible_name(1, 
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERALL));
 mxTBBorder1->set_item_tooltip_text(2, 
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTER));
+mxTBBorder1->set_item_accessible_name(2, 
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTER));
 mxTBBorder1->set_item_tooltip_text(3, 
SvxResId(RID_SVXSTR_TABLE_PRESET_THICK));
+mxTBBorder1->set_item_accessible_name(3, 
SvxResId(RID_SVXSTR_TABLE_PRESET_THICK));
 
 mxTBBorder2->connect_clicked ( LINK(this, CellBorderStylePopup, 
TB2and3SelectHdl) );
 mxTBBorder2->set_item_tooltip_text(0, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYLEFT));
+mxTBBorder2->set_item_accessible_name(0, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYLEFT));
 mxTBBorder2->set_item_tooltip_text(1, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYRIGHT));
+mxTBBorder2->set_item_accessible_name(1, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYRIGHT));
 mxTBBorder2->set_item_tooltip_text(2, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTOP));
+mxTBBorder2->set_item_accessible_name(2, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTOP));
 mxTBBorder2->set_item_tooltip_text(3, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYBOTTOM));
+mxTBBorder2->set_item_accessible_name(3, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYBOTTOM));
 
 mxTBBorder3->connect_clicked ( LINK(this, CellBorderStylePopup, 
TB2and3SelectHdl) );
 mxTBBorder3->set_item_tooltip_text(0, 
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALUP));
+mxTBBorder3->set_item_accessible_name(0, 
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALUP));
 mxTBBorder3->set_item_tooltip_text(1, 
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALDOWN));
+mxTBBorder3->set_item_accessible_name(1, 
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALDOWN));
 mxTBBorder3->set_item_tooltip_text(2, 
SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOM));
+mxTBBorder3->set_item_accessible_name(2, 
SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOM));
 mxTBBorder3->set_item_tooltip_text(3, 
SvxResId(RID_SVXSTR_PARA_PRESET_LEFTRIGHT));
+mxTBBorder3->set_item_accessible_name(3, 
SvxResId(RID_SVXSTR_PARA_PRESET_LEFTRIGHT));
 
 mxTBBorder4->connect_clicked ( LINK(this, CellBorderStylePopup, 
TB4SelectHdl) );
 mxTBBorder4->set_item_tooltip_text(0, 
SvxResId(RID_SVXSTR_TABLE_PRESET_THICKBOTTOM));
+mxTBBorder4->set_item_accessible_name(0, 
SvxResId(RID_SVXSTR_TABLE_PRESET_THICKBOTTOM));
 mxTBBorder4->set_item_tooltip_text(1, 
SvxResId(RID_SVXSTR_TABLE_PRESET_DOUBLEBOTTOM));
+mxTBBorder4->set_item_accessible_name(1, 
SvxResId(RID_SVXSTR_TABLE_PRESET_DOUBLEBOTTOM));
 mxTBBorder4->set_item_tooltip_text(2, 
SvxResId(RID_SVXSTR_TABLE_PRESET_TOPTHICKBOTTOM));
+mxTBBorder4->set_item_accessible_name(2, 
SvxResId(RID_SVXSTR_TABLE_PRESET_TOPTHICKBOTTOM));
 mxTBBorder4->set_item_tooltip_text(3, 
SvxResId(RID_SVXSTR_TABLE_PRESET_TOPDOUBLEBOTTOM));
+mxTBBorder4->set_item_accessible_name(3, 
SvxResId(RID_SVXSTR_TABLE_PRESET_TOPDOUBLEBOTTOM));
 }
 
 IMPL_LINK(CellBorderStylePopup, 

core.git: Branch 'libreoffice-24-8' - include/vcl vcl/inc vcl/source vcl/unx

2024-06-21 Thread Michael Weghorn (via logerrit)
 include/vcl/weld.hxx  |2 ++
 vcl/inc/salvtables.hxx|4 
 vcl/source/app/salvtables.cxx |   10 ++
 vcl/unx/gtk3/gtkinst.cxx  |   26 ++
 4 files changed, 42 insertions(+)

New commits:
commit f6aa099d34726d719bd8dd9ac7452c051fcc0d8f
Author: Michael Weghorn 
AuthorDate: Fri Jun 21 08:44:58 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Jun 21 15:49:49 2024 +0200

tdf#161648 vcl a11y: Add weld::Toolbar::set_item_accessible_name

Add API to set the accessible name of toolbar items
and implement it for the VCL, gtk3 and gtk4 implementations.

This will be used in an upcoming commit to set a11y names
for the border items in Calc's sidebar.

Change-Id: I958390d8736da8f1281f91586cacbefb5975e229
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169320
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169330

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index c3a688d84be0..427c0f869c05 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2538,6 +2538,8 @@ public:
 const 
css::uno::Reference& rIcon)
 = 0;
 virtual void set_item_tooltip_text(int nIndex, const OUString& rTip) = 0;
+virtual void set_item_accessible_name(int nIndex, const OUString& rName) = 
0;
+virtual void set_item_accessible_name(const OUString& rIdent, const 
OUString& rName) = 0;
 
 virtual vcl::ImageType get_icon_size() const = 0;
 virtual void set_icon_size(vcl::ImageType eType) = 0;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 984baf4e61b8..47c692793001 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1426,6 +1426,10 @@ public:
 
 virtual void set_item_tooltip_text(const OUString& rIdent, const OUString& 
rTip) override;
 
+virtual void set_item_accessible_name(int nIndex, const OUString& rName) 
override;
+
+virtual void set_item_accessible_name(const OUString& rIdent, const 
OUString& rName) override;
+
 virtual OUString get_item_tooltip_text(const OUString& rIdent) const 
override;
 
 virtual vcl::ImageType get_icon_size() const override;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e086def8434c..176944cca54c 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1217,6 +1217,16 @@ void SalInstanceToolbar::set_item_tooltip_text(const 
OUString& rIdent, const OUS
 m_xToolBox->SetQuickHelpText(m_xToolBox->GetItemId(rIdent), rTip);
 }
 
+void SalInstanceToolbar::set_item_accessible_name(int nIndex, const OUString& 
rName)
+{
+m_xToolBox->SetAccessibleName(m_xToolBox->GetItemId(nIndex), rName);
+}
+
+void SalInstanceToolbar::set_item_accessible_name(const OUString& rIdent, 
const OUString& rName)
+{
+m_xToolBox->SetAccessibleName(m_xToolBox->GetItemId(rIdent), rName);
+}
+
 OUString SalInstanceToolbar::get_item_tooltip_text(const OUString& rIdent) 
const
 {
 return m_xToolBox->GetQuickHelpText(m_xToolBox->GetItemId(rIdent));
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index d354fd4b7bbd..d2453e230d6e 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -12447,6 +12447,32 @@ public:
 gtk_widget_set_tooltip_text(pItem, OUStringToOString(rTip, 
RTL_TEXTENCODING_UTF8).getStr());
 }
 
+virtual void set_item_accessible_name(int nIndex, const OUString& rName) 
override
+{
+GtkWidget* pItem = toolbar_get_nth_item(nIndex);
+#if !GTK_CHECK_VERSION(4, 0, 0)
+AtkObject* pAccessible = gtk_widget_get_accessible(pItem);
+assert(pAccessible);
+atk_object_set_name(pAccessible, OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr());
+#else
+gtk_accessible_update_property(GTK_ACCESSIBLE(pItem), 
GTK_ACCESSIBLE_PROPERTY_LABEL,
+   OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr());
+#endif
+}
+
+virtual void set_item_accessible_name(const OUString& rIdent, const 
OUString& rName) override
+{
+GtkWidget* pItem = GTK_WIDGET(m_aMap[rIdent]);
+#if !GTK_CHECK_VERSION(4, 0, 0)
+AtkObject* pAccessible = gtk_widget_get_accessible(pItem);
+assert(pAccessible);
+atk_object_set_name(pAccessible, OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr());
+#else
+gtk_accessible_update_property(GTK_ACCESSIBLE(pItem), 
GTK_ACCESSIBLE_PROPERTY_LABEL,
+   OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr());
+#endif
+}
+
 virtual OUString get_item_tooltip_text(const OUString& rIdent) const 
override
 {
 GtkWidget* pItem = GTK_WIDGET(m_aMap.find(rIdent)->second);


core.git: 2 commits - include/vcl sc/source solenv/sanitizers vcl/inc vcl/source vcl/unx

2024-06-21 Thread Michael Weghorn (via logerrit)
 include/vcl/weld.hxx|2 +
 sc/source/ui/sidebar/CellBorderStyleControl.cxx |   16 ++
 solenv/sanitizers/ui/modules/scalc.false|   19 +
 solenv/sanitizers/ui/modules/scalc.suppr|   19 -
 vcl/inc/salvtables.hxx  |4 +++
 vcl/source/app/salvtables.cxx   |   10 +
 vcl/unx/gtk3/gtkinst.cxx|   26 
 7 files changed, 77 insertions(+), 19 deletions(-)

New commits:
commit 54f7308641c79d4907bd30cf6afc5bb62481637a
Author: Michael Weghorn 
AuthorDate: Fri Jun 21 09:00:41 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jun 21 11:17:24 2024 +0200

tdf#161648 sc a11y: Set a11y names for items in border style control

Set accessible names for the items in the "Borders"
control in the Calc Sidebar, "Properties" deck, section
"Cell Appearance". Use the same text as is used for the tooltip.

With this in place, Orca now announces what each item
is about when using the gtk3 VCL plugin, instead of just saying
"Button".

Move the gla11y suppressions to the .false file, as they
have been dealt with now, see doc at [1].

[1] https://wiki.documentfoundation.org/Development/Accessibility

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

diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx 
b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index f8e792ee183b..1ffbc213fb19 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -66,27 +66,43 @@ void CellBorderStylePopup::Initialize()
 {
 mxTBBorder1->connect_clicked ( LINK(this, CellBorderStylePopup, 
TB1SelectHdl) );
 mxTBBorder1->set_item_tooltip_text(0, 
SvxResId(RID_SVXSTR_TABLE_PRESET_NONE));
+mxTBBorder1->set_item_accessible_name(0, 
SvxResId(RID_SVXSTR_TABLE_PRESET_NONE));
 mxTBBorder1->set_item_tooltip_text(1, 
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERALL));
+mxTBBorder1->set_item_accessible_name(1, 
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERALL));
 mxTBBorder1->set_item_tooltip_text(2, 
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTER));
+mxTBBorder1->set_item_accessible_name(2, 
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTER));
 mxTBBorder1->set_item_tooltip_text(3, 
SvxResId(RID_SVXSTR_TABLE_PRESET_THICK));
+mxTBBorder1->set_item_accessible_name(3, 
SvxResId(RID_SVXSTR_TABLE_PRESET_THICK));
 
 mxTBBorder2->connect_clicked ( LINK(this, CellBorderStylePopup, 
TB2and3SelectHdl) );
 mxTBBorder2->set_item_tooltip_text(0, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYLEFT));
+mxTBBorder2->set_item_accessible_name(0, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYLEFT));
 mxTBBorder2->set_item_tooltip_text(1, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYRIGHT));
+mxTBBorder2->set_item_accessible_name(1, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYRIGHT));
 mxTBBorder2->set_item_tooltip_text(2, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTOP));
+mxTBBorder2->set_item_accessible_name(2, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTOP));
 mxTBBorder2->set_item_tooltip_text(3, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYBOTTOM));
+mxTBBorder2->set_item_accessible_name(3, 
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYBOTTOM));
 
 mxTBBorder3->connect_clicked ( LINK(this, CellBorderStylePopup, 
TB2and3SelectHdl) );
 mxTBBorder3->set_item_tooltip_text(0, 
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALUP));
+mxTBBorder3->set_item_accessible_name(0, 
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALUP));
 mxTBBorder3->set_item_tooltip_text(1, 
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALDOWN));
+mxTBBorder3->set_item_accessible_name(1, 
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALDOWN));
 mxTBBorder3->set_item_tooltip_text(2, 
SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOM));
+mxTBBorder3->set_item_accessible_name(2, 
SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOM));
 mxTBBorder3->set_item_tooltip_text(3, 
SvxResId(RID_SVXSTR_PARA_PRESET_LEFTRIGHT));
+mxTBBorder3->set_item_accessible_name(3, 
SvxResId(RID_SVXSTR_PARA_PRESET_LEFTRIGHT));
 
 mxTBBorder4->connect_clicked ( LINK(this, CellBorderStylePopup, 
TB4SelectHdl) );
 mxTBBorder4->set_item_tooltip_text(0, 
SvxResId(RID_SVXSTR_TABLE_PRESET_THICKBOTTOM));
+mxTBBorder4->set_item_accessible_name(0, 
SvxResId(RID_SVXSTR_TABLE_PRESET_THICKBOTTOM));
 mxTBBorder4->set_item_tooltip_text(1, 
SvxResId(RID_SVXSTR_TABLE_PRESET_DOUBLEBOTTOM));
+mxTBBorder4->set_item_accessible_name(1, 
SvxResId(RID_SVXSTR_TABLE_PRESET_DOUBLEBOTTOM));
 mxTBBorder4->set_item_tooltip_text(2, 
SvxResId(RID_SVXSTR_TABLE_PRESET_TOPTHICKBOTTOM));
+mxTBBorder4->set_item_accessible_name(2, 
SvxResId(RID_SVXSTR_TABLE_PRESET_TOPTHICKBOTTOM));
 mxTBBorder4->set_item_tooltip_text(3, 

core.git: Branch 'libreoffice-24-8' - 3 commits - include/sfx2 sfx2/source vcl/source

2024-06-20 Thread Michael Weghorn (via logerrit)
 include/sfx2/sidebar/TabBar.hxx   |5 ++---
 sfx2/source/sidebar/SidebarController.cxx |5 +
 sfx2/source/sidebar/TabBar.cxx|   19 ++-
 vcl/source/window/dockwin.cxx |2 ++
 4 files changed, 19 insertions(+), 12 deletions(-)

New commits:
commit f556e99ce3d6a73ac13559ba3eeefe2d59bc6231
Author: Michael Weghorn 
AuthorDate: Wed Jun 19 13:08:34 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jun 20 09:27:31 2024 +0200

tdf#159835 sfx2: Keep sidebar menu up to date

No longer update the menu for the menu button
in the sidebar in the handler that gets called
when the button gets clicked, but continually
keep the menu up to date instead.

This ensures that the menu is up-to-date when
it gets shown. Updating the menu in the button handler
is too late since

commit f075fa01cb4f74185f13eb0a8d7f84cf1f47af49
Author: Michael Weghorn 
Date:   Tue Aug 22 10:26:32 2023 +0200

tdf#141101 tdf#101886 a11y: Restore previous focus on col/line 
popup close

, as the handler is now no more called before the menu
gets shown.

Do the update in method `TabBar::UpdateMenus` instead
and call that one whenever items change or the
sidebar gets docked/undocked, as menu entries
are shown for the items and for (un)docking.

This makes the menu show all entries again
when opened the first time after starting Writer,
which was no longer the case after the
above-mentioned commmit.

Change-Id: I9a7e341e88d2de5f34e8f85ebada3ff2ebf6b47d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169196
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit daed96f0818b1baae5de8b74b866009d7d89f853)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169142

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 7591aeff7bf6..8778c9bd2e21 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -73,6 +73,8 @@ public:
 /// Enables/Disables the menu button. Used by LoKit.
 void EnableMenuButton(const bool bEnable);
 
+void UpdateMenus();
+
 virtual FactoryFunction GetUITestFactory() const override;
 private:
 css::uno::Reference mxFrame;
@@ -111,8 +113,6 @@ private:
 css::uno::Reference GetItemImage(const 
DeckDescriptor& rDeskDescriptor) const;
 void UpdateButtonIcons();
 
-DECL_LINK(OnToolboxClicked, weld::Toggleable&, void);
-
 SidebarController& mrParentSidebarController;
 };
 
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 2ebfebe6ab81..bdca4a89055c 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1075,6 +1075,11 @@ IMPL_LINK(SidebarController, WindowEventHandler, 
VclWindowEvent&, rEvent, void)
 maContextChangeUpdate.RequestCall();
 break;
 
+case VclEventId::WindowToggleFloating:
+// make sure the appropriate "Dock" or "Undock" menu entry is 
shown
+mpTabBar->UpdateMenus();
+break;
+
 case VclEventId::ObjectDying:
 dispose();
 break;
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index af086c2610b5..76669adc5798 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -73,6 +73,8 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 mxSubMenu = mxAuxBuilder->weld_menu(u"submenu"_ustr);
 aPopupMenuSignalConnectFunction(*mxMainMenu, *mxSubMenu);
 
+UpdateMenus();
+
 gDefaultWidth = m_xContainer->get_preferred_size().Width();
 
 // we have this widget just so we can measure best width for static 
TabBar::GetDefaultWidth
@@ -80,8 +82,6 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 
 SetBackground(Wallpaper(Theme::GetColor(Theme::Color_TabBarBackground)));
 
-mxMenuButton->connect_toggled(LINK(this, TabBar, OnToolboxClicked));
-
 #if OSL_DEBUG_LEVEL >= 2
 SetText(OUString("TabBar"));
 #endif
@@ -147,6 +147,7 @@ void TabBar::SetDecks(const 
ResourceManager::DeckContextDescriptorContainer& rDe
 }
 
 UpdateButtonIcons();
+UpdateMenus();
 }
 
 void TabBar::UpdateButtonIcons()
@@ -164,18 +165,21 @@ void TabBar::HighlightDeck(std::u16string_view rsDeckId)
 {
 for (auto const& item : maItems)
 item->mxButton->set_item_active(u"toggle"_ustr, item->msDeckId == 
rsDeckId);
+UpdateMenus();
 }
 
 void TabBar::RemoveDeckHighlight()
 {
 for (auto const& item : maItems)
 item->mxButton->set_item_active(u"toggle"_ustr, false);
+UpdateMenus();
 }
 
 void TabBar::DataChanged(const DataChangedEvent& rDataChangedEvent)
 {
 SetBackground(Theme::GetColor(Theme::Color_TabBarBackground));
 UpdateButtonIcons();
+UpdateMenus();
 

core.git: Branch 'libreoffice-24-8' - vcl/source

2024-06-20 Thread Michael Weghorn (via logerrit)
 vcl/source/window/dockwin.cxx |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 3867ff745d92d9ad5455647af799b4dd96eec1fb
Author: Michael Weghorn 
AuthorDate: Wed Jun 19 12:49:07 2024 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 20 08:37:48 2024 +0200

tdf#159835 Deduplicate a few lines in DockingWindow::SetFloatingMode

They're the same for both branches.

Change-Id: I73c3433fe3cfbb3eaa1b25cc2a76613d59d894a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169194
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>
Tested-by: Jenkins
(cherry picked from commit d7aeaeafc32f78ca38942868f965bae0e6c376b1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169139
Reviewed-by: Xisco Fauli 

diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index e55cca238349..ed31cc356f44 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -758,11 +758,6 @@ void DockingWindow::SetFloatingMode( bool bFloatMode )
 pWin->SetMinOutputSizePixel( maMinOutSize );
 
 pWin->SetMaxOutputSizePixel( mpImplData->maMaxOutSize );
-
-ToggleFloatingMode();
-
-if ( bVisible )
-Show();
 }
 else
 {
@@ -788,12 +783,12 @@ void DockingWindow::SetFloatingMode( bool bFloatMode )
 mpWindowImpl->mpRealParent = pRealParent;
 mpFloatWin.disposeAndClear();
 SetPosPixel( maDockPos );
+}
 
-ToggleFloatingMode();
+ToggleFloatingMode();
 
-if ( bVisible )
-Show();
-}
+if (bVisible)
+Show();
 }
 
 void DockingWindow::SetFloatStyle( WinBits nStyle )


core.git: vcl/qt5

2024-06-20 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtOpenGLContext.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit dd6bc1243af8d20cb19c96598f805cc6c9703ce7
Author: Michael Weghorn 
AuthorDate: Wed Jun 19 14:09:48 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jun 20 08:09:46 2024 +0200

qt opengl: Drop superfluous check

The `m_pChildWindow` is created in the lines
above if not set before, so there's no need to check
whether it's set. Assert instead.

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

diff --git a/vcl/qt5/QtOpenGLContext.cxx b/vcl/qt5/QtOpenGLContext.cxx
index 9dd75b69a1c9..f0cf9b5f4c65 100644
--- a/vcl/qt5/QtOpenGLContext.cxx
+++ b/vcl/qt5/QtOpenGLContext.cxx
@@ -143,11 +143,9 @@ void QtOpenGLContext::initWindow()
 SystemWindowData winData = generateWinData(mpWindow, 
mbRequestLegacyContext);
 m_pChildWindow = VclPtr::Create(mpWindow, 0, 
, false);
 }
+assert(m_pChildWindow);
 
-if (m_pChildWindow)
-{
-InitChildWindow(m_pChildWindow.get());
-}
+InitChildWindow(m_pChildWindow.get());
 
 m_pWindow
 = 
static_cast(m_pChildWindow->ImplGetWindowImpl()->mpSysObj)->windowHandle();


core.git: sc/uiconfig

2024-06-19 Thread Michael Weghorn (via logerrit)
 sc/uiconfig/scalc/ui/sidebarcellappearance.ui |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 1bde8595bde911063f200e9aac6f1ade87d4ad59
Author: Michael Weghorn 
AuthorDate: Wed Jun 19 11:16:06 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jun 20 05:52:36 2024 +0200

tdf#161648 sc a11y: Set a11y name for border style button in sidebar

Set accessible name for the button to open the popup
to select a border style.

This is announced by Orca with the gtk3 VCL plugin
when the button gets focused as expected.

Setting accessible names for the items in the
popup still remains to be done, s.a. discussion
in pending Gerrit change [1] that's related.
(If that gets merged, setting a11y names should
probably be done in C++ code, not the corresponding
.ui file.)

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

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

diff --git a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui 
b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
index 8daad7711040..1611c326d2ac 100644
--- a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
+++ b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
@@ -71,6 +71,11 @@
 start
 start
 True
+
+  
+Borders
+  
+
   
   
 True


core.git: 3 commits - include/sfx2 sfx2/source vcl/source

2024-06-19 Thread Michael Weghorn (via logerrit)
 include/sfx2/sidebar/TabBar.hxx   |5 ++---
 sfx2/source/sidebar/SidebarController.cxx |5 +
 sfx2/source/sidebar/TabBar.cxx|   19 ++-
 vcl/source/window/dockwin.cxx |2 ++
 4 files changed, 19 insertions(+), 12 deletions(-)

New commits:
commit daed96f0818b1baae5de8b74b866009d7d89f853
Author: Michael Weghorn 
AuthorDate: Wed Jun 19 13:08:34 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jun 20 05:51:59 2024 +0200

tdf#159835 sfx2: Keep sidebar menu up to date

No longer update the menu for the menu button
in the sidebar in the handler that gets called
when the button gets clicked, but continually
keep the menu up to date instead.

This ensures that the menu is up-to-date when
it gets shown. Updating the menu in the button handler
is too late since

commit f075fa01cb4f74185f13eb0a8d7f84cf1f47af49
Author: Michael Weghorn 
Date:   Tue Aug 22 10:26:32 2023 +0200

tdf#141101 tdf#101886 a11y: Restore previous focus on col/line 
popup close

, as the handler is now no more called before the menu
gets shown.

Do the update in method `TabBar::UpdateMenus` instead
and call that one whenever items change or the
sidebar gets docked/undocked, as menu entries
are shown for the items and for (un)docking.

This makes the menu show all entries again
when opened the first time after starting Writer,
which was no longer the case after the
above-mentioned commmit.

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

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 7591aeff7bf6..8778c9bd2e21 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -73,6 +73,8 @@ public:
 /// Enables/Disables the menu button. Used by LoKit.
 void EnableMenuButton(const bool bEnable);
 
+void UpdateMenus();
+
 virtual FactoryFunction GetUITestFactory() const override;
 private:
 css::uno::Reference mxFrame;
@@ -111,8 +113,6 @@ private:
 css::uno::Reference GetItemImage(const 
DeckDescriptor& rDeskDescriptor) const;
 void UpdateButtonIcons();
 
-DECL_LINK(OnToolboxClicked, weld::Toggleable&, void);
-
 SidebarController& mrParentSidebarController;
 };
 
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 2ebfebe6ab81..bdca4a89055c 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1075,6 +1075,11 @@ IMPL_LINK(SidebarController, WindowEventHandler, 
VclWindowEvent&, rEvent, void)
 maContextChangeUpdate.RequestCall();
 break;
 
+case VclEventId::WindowToggleFloating:
+// make sure the appropriate "Dock" or "Undock" menu entry is 
shown
+mpTabBar->UpdateMenus();
+break;
+
 case VclEventId::ObjectDying:
 dispose();
 break;
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index af086c2610b5..76669adc5798 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -73,6 +73,8 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 mxSubMenu = mxAuxBuilder->weld_menu(u"submenu"_ustr);
 aPopupMenuSignalConnectFunction(*mxMainMenu, *mxSubMenu);
 
+UpdateMenus();
+
 gDefaultWidth = m_xContainer->get_preferred_size().Width();
 
 // we have this widget just so we can measure best width for static 
TabBar::GetDefaultWidth
@@ -80,8 +82,6 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 
 SetBackground(Wallpaper(Theme::GetColor(Theme::Color_TabBarBackground)));
 
-mxMenuButton->connect_toggled(LINK(this, TabBar, OnToolboxClicked));
-
 #if OSL_DEBUG_LEVEL >= 2
 SetText(OUString("TabBar"));
 #endif
@@ -147,6 +147,7 @@ void TabBar::SetDecks(const 
ResourceManager::DeckContextDescriptorContainer& rDe
 }
 
 UpdateButtonIcons();
+UpdateMenus();
 }
 
 void TabBar::UpdateButtonIcons()
@@ -164,18 +165,21 @@ void TabBar::HighlightDeck(std::u16string_view rsDeckId)
 {
 for (auto const& item : maItems)
 item->mxButton->set_item_active(u"toggle"_ustr, item->msDeckId == 
rsDeckId);
+UpdateMenus();
 }
 
 void TabBar::RemoveDeckHighlight()
 {
 for (auto const& item : maItems)
 item->mxButton->set_item_active(u"toggle"_ustr, false);
+UpdateMenus();
 }
 
 void TabBar::DataChanged(const DataChangedEvent& rDataChangedEvent)
 {
 SetBackground(Theme::GetColor(Theme::Color_TabBarBackground));
 UpdateButtonIcons();
+UpdateMenus();
 
 InterimItemWindow::DataChanged(rDataChangedEvent);
 }
@@ -300,6 +304,7 @@ void TabBar::ToggleHideFlag (const sal_Int32 nIndex)

core.git: vcl/source

2024-06-19 Thread Michael Weghorn (via logerrit)
 vcl/source/window/dockwin.cxx |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit d7aeaeafc32f78ca38942868f965bae0e6c376b1
Author: Michael Weghorn 
AuthorDate: Wed Jun 19 12:49:07 2024 +0200
Commit: Taichi Haradaguchi <20001...@ymail.ne.jp>
CommitDate: Thu Jun 20 01:57:23 2024 +0200

tdf#159835 Deduplicate a few lines in DockingWindow::SetFloatingMode

They're the same for both branches.

Change-Id: I73c3433fe3cfbb3eaa1b25cc2a76613d59d894a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169194
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>
Tested-by: Jenkins

diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index e55cca238349..ed31cc356f44 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -758,11 +758,6 @@ void DockingWindow::SetFloatingMode( bool bFloatMode )
 pWin->SetMinOutputSizePixel( maMinOutSize );
 
 pWin->SetMaxOutputSizePixel( mpImplData->maMaxOutSize );
-
-ToggleFloatingMode();
-
-if ( bVisible )
-Show();
 }
 else
 {
@@ -788,12 +783,12 @@ void DockingWindow::SetFloatingMode( bool bFloatMode )
 mpWindowImpl->mpRealParent = pRealParent;
 mpFloatWin.disposeAndClear();
 SetPosPixel( maDockPos );
+}
 
-ToggleFloatingMode();
+ToggleFloatingMode();
 
-if ( bVisible )
-Show();
-}
+if (bVisible)
+Show();
 }
 
 void DockingWindow::SetFloatStyle( WinBits nStyle )


core.git: Branch 'libreoffice-24-8' - 3 commits - include/sfx2 sfx2/source

2024-06-19 Thread Michael Weghorn (via logerrit)
 include/sfx2/sidebar/SidebarController.hxx |   12 +--
 include/sfx2/sidebar/TabBar.hxx|   23 +-
 sfx2/source/sidebar/SidebarController.cxx  |   66 +--
 sfx2/source/sidebar/TabBar.cxx |   96 -
 sfx2/source/sidebar/uiobject.cxx   |2 
 5 files changed, 84 insertions(+), 115 deletions(-)

New commits:
commit 9895117d877cc5bd7ebb27a69e985a0770448427
Author: Michael Weghorn 
AuthorDate: Mon Jun 17 14:45:34 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jun 19 09:24:29 2024 +0200

tdf#159835 sfx2: Simplify TabBar::OnToolboxClicked

Now that the logic from `SidebarController::PopulatePopupMenus`
has been moved here in
Change-Id: I8236f2467239e6a2f485d468656e961478eeb09c
Author: Michael Weghorn 
Date:   Mon Jun 17 13:35:12 2024 +0200

tdf#159835 sfx2: Move logic to populate sidebar menus to TabBar

as well, simplify `TabBar::OnToolboxClicked`:
No longer use one loop to build a vector of entries
and another to process these, but use a single loop
for that instead.
Drop the now unused `DeckMenuData` class.

Change-Id: I884f3b70bb4d85b9a52421e9de6042cda80cfa0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169006
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169076

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 54d018aae018..bc2b2a4e4d04 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -41,18 +41,6 @@ class TabBar final : public InterimItemWindow
 {
 friend class TabBarUIObject;
 public:
-/** DeckMenuData has entries for display name, and a flag:
- - isCurrentDeck for the deck selection data
- - isEnabled for the show/hide menu
-*/
-class DeckMenuData
-{
-public:
-OUString msDisplayName;
-bool mbIsCurrentDeck;
-bool mbIsActive;
-bool mbIsEnabled;
-};
 typedef ::std::function 
PopupMenuSignalConnectFunction;
 TabBar (
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index bb5ec5471f9b..d9608e36d49f 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -334,23 +334,6 @@ IMPL_LINK_NOARG(TabBar, OnToolboxClicked, 
weld::Toggleable&, void)
 if (!mxMenuButton->get_active())
 return;
 
-std::vector aMenuData;
-
-for (auto const& item : maItems)
-{
-std::shared_ptr xDeckDescriptor = 
mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(item->msDeckId);
-
-if (!xDeckDescriptor)
-continue;
-
-DeckMenuData aData;
-aData.msDisplayName = xDeckDescriptor->msTitle;
-aData.mbIsCurrentDeck = 
item->mxButton->get_item_active(u"toggle"_ustr);
-aData.mbIsActive = !item->mbIsHidden;
-aData.mbIsEnabled = item->mxButton->get_sensitive();
-aMenuData.push_back(aData);
-}
-
 for (int i = mxMainMenu->n_children() - 1; i >= 0; --i)
 {
 OUString sIdent = mxMainMenu->get_id(i);
@@ -367,30 +350,39 @@ IMPL_LINK_NOARG(TabBar, OnToolboxClicked, 
weld::Toggleable&, void)
 // Add one entry for every tool panel element to individually make
 // them visible or hide them.
 sal_Int32 nIndex (0);
-for (const auto& rItem : aMenuData)
+for (auto const& rItem : maItems)
 {
+std::shared_ptr xDeckDescriptor
+= 
mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(rItem->msDeckId);
+
+if (!xDeckDescriptor)
+continue;
+
+const OUString sDisplayName = xDeckDescriptor->msTitle;
 OUString sIdent("select" + OUString::number(nIndex));
-mxMainMenu->insert(nIndex, sIdent, rItem.msDisplayName,
- nullptr, nullptr, nullptr, TRISTATE_FALSE);
-mxMainMenu->set_active(sIdent, rItem.mbIsCurrentDeck);
-mxMainMenu->set_sensitive(sIdent, rItem.mbIsEnabled && 
rItem.mbIsActive);
+const bool bCurrentDeck = 
rItem->mxButton->get_item_active(u"toggle"_ustr);
+const bool bActive = !rItem->mbIsHidden;
+const bool bEnabled = rItem->mxButton->get_sensitive();
+mxMainMenu->insert(nIndex, sIdent, sDisplayName, nullptr, nullptr, 
nullptr, TRISTATE_FALSE);
+mxMainMenu->set_active(sIdent, bCurrentDeck);
+mxMainMenu->set_sensitive(sIdent, bEnabled && bActive);
 
 if (!comphelper::LibreOfficeKit::isActive())
 {
-if (rItem.mbIsCurrentDeck)
+if (bCurrentDeck)
 {
 // Don't allow the currently visible deck to be disabled.
 OUString sSubIdent("nocustomize" + OUString::number(nIndex));
-mxSubMenu->insert(nIndex, sSubIdent, rItem.msDisplayName,
- 

core.git: Branch 'libreoffice-24-8' - 2 commits - avmedia/source

2024-06-17 Thread Michael Weghorn (via logerrit)
 avmedia/source/qt6/QtFrameGrabber.cxx |7 ---
 avmedia/source/qt6/QtPlayer.cxx   |   79 +-
 avmedia/source/qt6/QtPlayer.hxx   |7 +++
 3 files changed, 77 insertions(+), 16 deletions(-)

New commits:
commit c69b0bbe94047a2edee1b1b1e10b0f9baf1a35f6
Author: Michael Weghorn 
AuthorDate: Mon Jun 17 17:37:49 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Jun 18 07:10:33 2024 +0200

tdf#145735 qt avmedia: Don't deadlock with QGstreamerMediaPlayer

While opending a slide with a video worked fine for
me with the qt6 VCL plugin and a local Qt development
build on Debian testing (qtbase as of
8915ae3a75c4a356d94962dd9b31e1458f2a506f,
qtwayland as of deae8b9ce9f551b29ef98d0bb827a8543af2797e,
qtmultimedia as of 235ba5f273fbb7dfed8ba3736ea85aee5770),
this resulted in a freeze when using Debian's system-provided
Qt packages instead (libqt6multimedia6:amd64 6.4.2-11+b2).

While the self-compiled Qt dev is using `QFFmpegMediaPlayer`
which asynchronously loads media, the system QtMultimedia
is using `QGstreamerMediaPlayer` (s. frame 37 in below backtrace)
that apparently doesn't use multiple threads.

Therefore, using `Qt::BlockingQueuedConnection` is problematic,
as its documentation [1] says:

> Same as Qt::QueuedConnection, except that the signalling thread blocks
> until the slot returns. This connection must not be used if the receiver
> lives in the signalling thread, or else the application will deadlock.

Use `Qt::AutoConnection` (= 0, the default) instead and specify the
`Qt::SingleShotConnection` flag in addition to ensure the slot
gets called only once:

> This is a flag that can be combined with any one of the above connection
> types, using a bitwise OR. When Qt::SingleShotConnection is set, the
> slot is going to be called only once; the connection will be
> automatically broken when the signal is emitted. This flag was
> introduced in Qt 6.0.

Drop the now no longer needed manual disconnect.

This makes the scenario work with both, the custom-compiled
Qt dev using `QFFmpegMediaPlayer` and the system-provided
Qt 6.4.2 using `QGstreamerMediaPlayer`.

Side note: Unrelated to the issue addressed here, using the
system-provided Qt with `QGstreamerMediaPlayer` results
in a crash when started via the soffice shell script wrapper
with a LibreOffice debug build or when using soffice.bin directly
and manually setting `MALLOC_PERTURB_=153`, which indicates
some memory issue. That could be within Qt, though, haven't
analyzed that further.

Backtrace of deadlock:

1 syscall syscall.S 38 0x7f40a83249f9
2 QSemaphore::acquire(int) 0x7f40948714e2
3 ?? 0x7f409477fede
4 QVideoSink::videoFrameChanged(QVideoFrame const&) const 0x7f4095195376
5 ?? 0x7f405c219f5c
6 ?? 0x7f405c21a25b
7 QApplicationPrivate::notify_helper(QObject *, QEvent *) 0x7f4093782d62
8 QCoreApplication::notifyInternal2(QObject *, QEvent *) 0x7f40947356d8
9 QCoreApplicationPrivate::sendPostedEvents(QObject *, int, QThreadData 
*) 0x7f40947358b7
10 ?? 0x7f4094925257
11 ?? 0x7f409ab0de3f
12 ?? 0x7f409ab0fec7
13 g_main_context_iteration 0x7f409ab104e0
14 
QEventDispatcherGlib::processEvents(QFlags) 
0x7f4094922f60
15 QtInstance::ImplYield QtInstance.cxx 455 0x7f4094e534e0
16 QtInstance::DoYield QtInstance.cxx 464 0x7f4094e568a5
17 ImplYield svapp.cxx 384 0x7f409f3c48cc
18 Scheduler::ProcessEventsToIdle svapp.cxx 419 0x7f409f3c4bc8
19 avmedia::qt::QtFrameGrabber::grabFrame QtFrameGrabber.cxx 106 
0x7f405cac5524
20 non-virtual thunk to avmedia::qt::QtFrameGrabber::grabFrame(double) 
0x7f405cac564e
21 avmedia::MediaWindow::grabFrame mediawindow.cxx 385 0x7f40a03e41ad
22 SdrMediaObj::getSnapshot() 
const::$_0::operator()(com::sun::star::uno::Reference
 const&) const svdomedia.cxx 195 0x7f40a249e5b5
23 std::__invoke_impl 
const&>(std::__invoke_other, SdrMediaObj::getSnapshot() const::$_0&, 
com::sun::star::uno::Reference const&) invoke.h 
61 0x7f40a249e52d
24 std::__invoke_r 
const&>(SdrMediaObj::getSnapshot() const::$_0&, 
com::sun::star::uno::Reference const&) invoke.h 
111 0x7f40a249e4dd
25 std::_Function_handler const&), 
SdrMediaObj::getSnapshot() const::$_0>::_M_invoke(std::_Any_data const&, 
com::sun::star::uno::Reference const&) 
std_function.h 290 0x7f40a249e345
26 std::function 
const&)>::operator()(com::sun::star::uno::Reference
 const&) const std_function.h 591 0x7f40a03e96cd
27 avmedia::PlayerListener::callPlayerWindowSizeAvailable 
mediawindow.hxx 76 0x7f40a03e6bf1
28 avmedia::PlayerListener::preferredPlayerWindowSizeAvailable 
mediawindow.cxx 496 0x7f40a03e5055
29 

core.git: 2 commits - avmedia/source

2024-06-17 Thread Michael Weghorn (via logerrit)
 avmedia/source/qt6/QtFrameGrabber.cxx |7 ---
 avmedia/source/qt6/QtPlayer.cxx   |   79 +-
 avmedia/source/qt6/QtPlayer.hxx   |7 +++
 3 files changed, 77 insertions(+), 16 deletions(-)

New commits:
commit 4df2a30c57c150d30d34e4cd1641a076cf3010f6
Author: Michael Weghorn 
AuthorDate: Mon Jun 17 17:37:49 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Jun 18 05:27:53 2024 +0200

tdf#145735 qt avmedia: Don't deadlock with QGstreamerMediaPlayer

While opending a slide with a video worked fine for
me with the qt6 VCL plugin and a local Qt development
build on Debian testing (qtbase as of
8915ae3a75c4a356d94962dd9b31e1458f2a506f,
qtwayland as of deae8b9ce9f551b29ef98d0bb827a8543af2797e,
qtmultimedia as of 235ba5f273fbb7dfed8ba3736ea85aee5770),
this resulted in a freeze when using Debian's system-provided
Qt packages instead (libqt6multimedia6:amd64 6.4.2-11+b2).

While the self-compiled Qt dev is using `QFFmpegMediaPlayer`
which asynchronously loads media, the system QtMultimedia
is using `QGstreamerMediaPlayer` (s. frame 37 in below backtrace)
that apparently doesn't use multiple threads.

Therefore, using `Qt::BlockingQueuedConnection` is problematic,
as its documentation [1] says:

> Same as Qt::QueuedConnection, except that the signalling thread blocks
> until the slot returns. This connection must not be used if the receiver
> lives in the signalling thread, or else the application will deadlock.

Use `Qt::AutoConnection` (= 0, the default) instead and specify the
`Qt::SingleShotConnection` flag in addition to ensure the slot
gets called only once:

> This is a flag that can be combined with any one of the above connection
> types, using a bitwise OR. When Qt::SingleShotConnection is set, the
> slot is going to be called only once; the connection will be
> automatically broken when the signal is emitted. This flag was
> introduced in Qt 6.0.

Drop the now no longer needed manual disconnect.

This makes the scenario work with both, the custom-compiled
Qt dev using `QFFmpegMediaPlayer` and the system-provided
Qt 6.4.2 using `QGstreamerMediaPlayer`.

Side note: Unrelated to the issue addressed here, using the
system-provided Qt with `QGstreamerMediaPlayer` results
in a crash when started via the soffice shell script wrapper
with a LibreOffice debug build or when using soffice.bin directly
and manually setting `MALLOC_PERTURB_=153`, which indicates
some memory issue. That could be within Qt, though, haven't
analyzed that further.

Backtrace of deadlock:

1 syscall syscall.S 38 0x7f40a83249f9
2 QSemaphore::acquire(int) 0x7f40948714e2
3 ?? 0x7f409477fede
4 QVideoSink::videoFrameChanged(QVideoFrame const&) const 0x7f4095195376
5 ?? 0x7f405c219f5c
6 ?? 0x7f405c21a25b
7 QApplicationPrivate::notify_helper(QObject *, QEvent *) 0x7f4093782d62
8 QCoreApplication::notifyInternal2(QObject *, QEvent *) 0x7f40947356d8
9 QCoreApplicationPrivate::sendPostedEvents(QObject *, int, QThreadData 
*) 0x7f40947358b7
10 ?? 0x7f4094925257
11 ?? 0x7f409ab0de3f
12 ?? 0x7f409ab0fec7
13 g_main_context_iteration 0x7f409ab104e0
14 
QEventDispatcherGlib::processEvents(QFlags) 
0x7f4094922f60
15 QtInstance::ImplYield QtInstance.cxx 455 0x7f4094e534e0
16 QtInstance::DoYield QtInstance.cxx 464 0x7f4094e568a5
17 ImplYield svapp.cxx 384 0x7f409f3c48cc
18 Scheduler::ProcessEventsToIdle svapp.cxx 419 0x7f409f3c4bc8
19 avmedia::qt::QtFrameGrabber::grabFrame QtFrameGrabber.cxx 106 
0x7f405cac5524
20 non-virtual thunk to avmedia::qt::QtFrameGrabber::grabFrame(double) 
0x7f405cac564e
21 avmedia::MediaWindow::grabFrame mediawindow.cxx 385 0x7f40a03e41ad
22 SdrMediaObj::getSnapshot() 
const::$_0::operator()(com::sun::star::uno::Reference
 const&) const svdomedia.cxx 195 0x7f40a249e5b5
23 std::__invoke_impl 
const&>(std::__invoke_other, SdrMediaObj::getSnapshot() const::$_0&, 
com::sun::star::uno::Reference const&) invoke.h 
61 0x7f40a249e52d
24 std::__invoke_r 
const&>(SdrMediaObj::getSnapshot() const::$_0&, 
com::sun::star::uno::Reference const&) invoke.h 
111 0x7f40a249e4dd
25 std::_Function_handler const&), 
SdrMediaObj::getSnapshot() const::$_0>::_M_invoke(std::_Any_data const&, 
com::sun::star::uno::Reference const&) 
std_function.h 290 0x7f40a249e345
26 std::function 
const&)>::operator()(com::sun::star::uno::Reference
 const&) const std_function.h 591 0x7f40a03e96cd
27 avmedia::PlayerListener::callPlayerWindowSizeAvailable 
mediawindow.hxx 76 0x7f40a03e6bf1
28 avmedia::PlayerListener::preferredPlayerWindowSizeAvailable 
mediawindow.cxx 496 0x7f40a03e5055
29 

core.git: 3 commits - include/sfx2 sfx2/source

2024-06-17 Thread Michael Weghorn (via logerrit)
 include/sfx2/sidebar/SidebarController.hxx |   12 +--
 include/sfx2/sidebar/TabBar.hxx|   23 +-
 sfx2/source/sidebar/SidebarController.cxx  |   66 +--
 sfx2/source/sidebar/TabBar.cxx |   96 -
 sfx2/source/sidebar/uiobject.cxx   |2 
 5 files changed, 84 insertions(+), 115 deletions(-)

New commits:
commit ca364f8f16f0c64589d15e7bc44fe6eaebe8f5b2
Author: Michael Weghorn 
AuthorDate: Mon Jun 17 14:45:34 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Jun 18 05:26:41 2024 +0200

tdf#159835 sfx2: Simplify TabBar::OnToolboxClicked

Now that the logic from `SidebarController::PopulatePopupMenus`
has been moved here in
Change-Id: I8236f2467239e6a2f485d468656e961478eeb09c
Author: Michael Weghorn 
Date:   Mon Jun 17 13:35:12 2024 +0200

tdf#159835 sfx2: Move logic to populate sidebar menus to TabBar

as well, simplify `TabBar::OnToolboxClicked`:
No longer use one loop to build a vector of entries
and another to process these, but use a single loop
for that instead.
Drop the now unused `DeckMenuData` class.

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

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 54d018aae018..bc2b2a4e4d04 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -41,18 +41,6 @@ class TabBar final : public InterimItemWindow
 {
 friend class TabBarUIObject;
 public:
-/** DeckMenuData has entries for display name, and a flag:
- - isCurrentDeck for the deck selection data
- - isEnabled for the show/hide menu
-*/
-class DeckMenuData
-{
-public:
-OUString msDisplayName;
-bool mbIsCurrentDeck;
-bool mbIsActive;
-bool mbIsEnabled;
-};
 typedef ::std::function 
PopupMenuSignalConnectFunction;
 TabBar (
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index bb5ec5471f9b..d9608e36d49f 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -334,23 +334,6 @@ IMPL_LINK_NOARG(TabBar, OnToolboxClicked, 
weld::Toggleable&, void)
 if (!mxMenuButton->get_active())
 return;
 
-std::vector aMenuData;
-
-for (auto const& item : maItems)
-{
-std::shared_ptr xDeckDescriptor = 
mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(item->msDeckId);
-
-if (!xDeckDescriptor)
-continue;
-
-DeckMenuData aData;
-aData.msDisplayName = xDeckDescriptor->msTitle;
-aData.mbIsCurrentDeck = 
item->mxButton->get_item_active(u"toggle"_ustr);
-aData.mbIsActive = !item->mbIsHidden;
-aData.mbIsEnabled = item->mxButton->get_sensitive();
-aMenuData.push_back(aData);
-}
-
 for (int i = mxMainMenu->n_children() - 1; i >= 0; --i)
 {
 OUString sIdent = mxMainMenu->get_id(i);
@@ -367,30 +350,39 @@ IMPL_LINK_NOARG(TabBar, OnToolboxClicked, 
weld::Toggleable&, void)
 // Add one entry for every tool panel element to individually make
 // them visible or hide them.
 sal_Int32 nIndex (0);
-for (const auto& rItem : aMenuData)
+for (auto const& rItem : maItems)
 {
+std::shared_ptr xDeckDescriptor
+= 
mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(rItem->msDeckId);
+
+if (!xDeckDescriptor)
+continue;
+
+const OUString sDisplayName = xDeckDescriptor->msTitle;
 OUString sIdent("select" + OUString::number(nIndex));
-mxMainMenu->insert(nIndex, sIdent, rItem.msDisplayName,
- nullptr, nullptr, nullptr, TRISTATE_FALSE);
-mxMainMenu->set_active(sIdent, rItem.mbIsCurrentDeck);
-mxMainMenu->set_sensitive(sIdent, rItem.mbIsEnabled && 
rItem.mbIsActive);
+const bool bCurrentDeck = 
rItem->mxButton->get_item_active(u"toggle"_ustr);
+const bool bActive = !rItem->mbIsHidden;
+const bool bEnabled = rItem->mxButton->get_sensitive();
+mxMainMenu->insert(nIndex, sIdent, sDisplayName, nullptr, nullptr, 
nullptr, TRISTATE_FALSE);
+mxMainMenu->set_active(sIdent, bCurrentDeck);
+mxMainMenu->set_sensitive(sIdent, bEnabled && bActive);
 
 if (!comphelper::LibreOfficeKit::isActive())
 {
-if (rItem.mbIsCurrentDeck)
+if (bCurrentDeck)
 {
 // Don't allow the currently visible deck to be disabled.
 OUString sSubIdent("nocustomize" + OUString::number(nIndex));
-mxSubMenu->insert(nIndex, sSubIdent, rItem.msDisplayName,
-  nullptr, nullptr, nullptr, 
TRISTATE_FALSE);
+mxSubMenu->insert(nIndex, 

core.git: Branch 'libreoffice-24-2' - winaccessibility/source

2024-06-17 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/AccTextBase.cxx |   22 +-
 1 file changed, 5 insertions(+), 17 deletions(-)

New commits:
commit 2b98d2a4341ee158e3534ca5a59fbb57b1936ade
Author: Michael Weghorn 
AuthorDate: Fri Jun 14 10:57:58 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon Jun 17 11:15:58 2024 +0200

wina11y: Fix handling for special text offset -1

As described in the IAccessible2 spec [1], -1 can be used as a
special text offset:

> Using IA2_TEXT_OFFSET_LENGTH (-1) as an offset in any of the
> IAccessibleText or IAccessibleEditableText methods is the same
> as specifying the length of the string.

Replace -1 by the text length *before* doing the
check whether end offset is smaller than the start offset.

Otherwise, trying to query the whole text of a Writer paragraph
containing the text "hello" in NVDA's Python console would
incorrectly trigger an error:

>>> focus.IAccessibleTextObject.text(0,-1)
Traceback (most recent call last):
  File "", line 1, in 
  File "comtypes\__init__.pyc", line 856, in __call__
  File "monkeyPatches_ctypes.COMError: (-2147467259, 
'Unspecified error', (None, None, None, 0, None))

With this commit in place, it works as expected:

>>> focus.IAccessibleTextObject.text(0,-1)
'hello'

[1] 
https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/_general_info.html#_specialOffsets

Change-Id: I489a42270a56178cc8ee0564eec3dc82e15969c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168853
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit 0c7928dc10da2c8c5ce9910fe20cea439573f2ae)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168886
Reviewed-by: Xisco Fauli 

diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx 
b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index a50cee9dd41c..857b52f2f53f 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -438,25 +438,13 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_text(long startOffset, long
 if(!pRXText.is())
 return E_FAIL;
 
-if (endOffset < -1 || endOffset < startOffset )
-{
-return E_FAIL;
-}
+if (endOffset == -1)
+endOffset = pRXText->getCharacterCount();
 
-OUString ouStr;
-if (endOffset == -1 )
-{
-long nLen=0;
-if(SUCCEEDED(get_characterCount()))
-{
-ouStr = pRXText->getTextRange(0, nLen);
-}
-}
-else
-{
-ouStr = pRXText->getTextRange(startOffset, endOffset);
-}
+if (endOffset < 0 || endOffset < startOffset)
+return E_FAIL;
 
+const OUString ouStr = pRXText->getTextRange(startOffset, endOffset);
 SysFreeString(*text);
 *text = SysAllocString(o3tl::toW(ouStr.getStr()));
 return S_OK;


core.git: Branch 'libreoffice-24-8' - winaccessibility/source

2024-06-14 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/AccTextBase.cxx |   22 +-
 1 file changed, 5 insertions(+), 17 deletions(-)

New commits:
commit a1ad4744a17193c9627f802fc3746d69375ccf08
Author: Michael Weghorn 
AuthorDate: Fri Jun 14 10:57:58 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat Jun 15 00:40:59 2024 +0200

wina11y: Fix handling for special text offset -1

As described in the IAccessible2 spec [1], -1 can be used as a
special text offset:

> Using IA2_TEXT_OFFSET_LENGTH (-1) as an offset in any of the
> IAccessibleText or IAccessibleEditableText methods is the same
> as specifying the length of the string.

Replace -1 by the text length *before* doing the
check whether end offset is smaller than the start offset.

Otherwise, trying to query the whole text of a Writer paragraph
containing the text "hello" in NVDA's Python console would
incorrectly trigger an error:

>>> focus.IAccessibleTextObject.text(0,-1)
Traceback (most recent call last):
  File "", line 1, in 
  File "comtypes\__init__.pyc", line 856, in __call__
  File "monkeyPatches_ctypes.COMError: (-2147467259, 
'Unspecified error', (None, None, None, 0, None))

With this commit in place, it works as expected:

>>> focus.IAccessibleTextObject.text(0,-1)
'hello'

[1] 
https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/_general_info.html#_specialOffsets

Change-Id: I489a42270a56178cc8ee0564eec3dc82e15969c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168853
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit 0c7928dc10da2c8c5ce9910fe20cea439573f2ae)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168885

diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx 
b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index a50cee9dd41c..857b52f2f53f 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -438,25 +438,13 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_text(long startOffset, long
 if(!pRXText.is())
 return E_FAIL;
 
-if (endOffset < -1 || endOffset < startOffset )
-{
-return E_FAIL;
-}
+if (endOffset == -1)
+endOffset = pRXText->getCharacterCount();
 
-OUString ouStr;
-if (endOffset == -1 )
-{
-long nLen=0;
-if(SUCCEEDED(get_characterCount()))
-{
-ouStr = pRXText->getTextRange(0, nLen);
-}
-}
-else
-{
-ouStr = pRXText->getTextRange(startOffset, endOffset);
-}
+if (endOffset < 0 || endOffset < startOffset)
+return E_FAIL;
 
+const OUString ouStr = pRXText->getTextRange(startOffset, endOffset);
 SysFreeString(*text);
 *text = SysAllocString(o3tl::toW(ouStr.getStr()));
 return S_OK;


core.git: winaccessibility/source

2024-06-14 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/AccTextBase.cxx |   22 +-
 1 file changed, 5 insertions(+), 17 deletions(-)

New commits:
commit 0c7928dc10da2c8c5ce9910fe20cea439573f2ae
Author: Michael Weghorn 
AuthorDate: Fri Jun 14 10:57:58 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jun 14 23:26:57 2024 +0200

wina11y: Fix handling for special text offset -1

As described in the IAccessible2 spec [1], -1 can be used as a
special text offset:

> Using IA2_TEXT_OFFSET_LENGTH (-1) as an offset in any of the
> IAccessibleText or IAccessibleEditableText methods is the same
> as specifying the length of the string.

Replace -1 by the text length *before* doing the
check whether end offset is smaller than the start offset.

Otherwise, trying to query the whole text of a Writer paragraph
containing the text "hello" in NVDA's Python console would
incorrectly trigger an error:

>>> focus.IAccessibleTextObject.text(0,-1)
Traceback (most recent call last):
  File "", line 1, in 
  File "comtypes\__init__.pyc", line 856, in __call__
  File "monkeyPatches_ctypes.COMError: (-2147467259, 
'Unspecified error', (None, None, None, 0, None))

With this commit in place, it works as expected:

>>> focus.IAccessibleTextObject.text(0,-1)
'hello'

[1] 
https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/_general_info.html#_specialOffsets

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

diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx 
b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index a50cee9dd41c..857b52f2f53f 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -438,25 +438,13 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_text(long startOffset, long
 if(!pRXText.is())
 return E_FAIL;
 
-if (endOffset < -1 || endOffset < startOffset )
-{
-return E_FAIL;
-}
+if (endOffset == -1)
+endOffset = pRXText->getCharacterCount();
 
-OUString ouStr;
-if (endOffset == -1 )
-{
-long nLen=0;
-if(SUCCEEDED(get_characterCount()))
-{
-ouStr = pRXText->getTextRange(0, nLen);
-}
-}
-else
-{
-ouStr = pRXText->getTextRange(startOffset, endOffset);
-}
+if (endOffset < 0 || endOffset < startOffset)
+return E_FAIL;
 
+const OUString ouStr = pRXText->getTextRange(startOffset, endOffset);
 SysFreeString(*text);
 *text = SysAllocString(o3tl::toW(ouStr.getStr()));
 return S_OK;


core.git: 2 commits - vcl/inc vcl/qt5 vcl/unx

2024-06-13 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtMenu.hxx |1 +
 vcl/qt5/QtMenu.cxx |   14 ++
 vcl/unx/generic/app/sm.cxx |4 +++-
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 542e590f6a35a350cb6bc53645462a273017258d
Author: Michael Weghorn 
AuthorDate: Thu Jun 13 10:08:25 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jun 13 15:30:04 2024 +0200

gen: Handle null client ID when SmcOpenConnection fails

Trying to start LO with the gen/x11 VCL plugin in my KDE Plasma 5
Wayland session triggered this assert:

soffice.bin: .../libreoffice/sal/rtl/strtmpl.hxx:148: sal_Int32 
rtl::str::getLength(const T *) [T = char]: Assertion `pStr' 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  0x778a6b6f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x778584e2 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x778414ed in __GI_abort () at ./stdlib/abort.c:79
#4  0x77841415 in __assert_fail_base
(fmt=0x779b7ba8 "%s%s%s:%u: %s%sAssertion `%s' failed.
%n", assertion=assertion@entry=0x77ea47e1 "pStr", 
file=file@entry=0x77e9fa78 ".../libreoffice/sal/rtl/strtmpl.hxx", 
line=line@entry=148, function=function@entry=0x77ea58ba "sal_Int32 
rtl::str::getLength(const T *) [T = char]") at ./assert/assert.c:92
#5  0x77851002 in __assert_fail
(assertion=0x77ea47e1 "pStr", file=0x77e9fa78 
".../libreoffice/sal/rtl/strtmpl.hxx", line=148, function=0x77ea58ba 
"sal_Int32 rtl::str::getLength(const T *) [T = char]") at ./assert/assert.c:101
#6  0x77f33e2b in rtl::str::getLength(char const*) 
(pStr=0x0) at sal/rtl/strtmpl.hxx:148
#7  0x77f36ac9 in 
rtl::str::newFromStr<_rtl_String>(_rtl_String**, std::remove_extent::type const*) (ppThis=0x7fff7970, pCharStr=0x0) at 
sal/rtl/strtmpl.hxx:862
#8  0x77f32e9d in rtl_string_newFromStr(rtl_String**, char 
const*) (ppThis=0x7fff7970, pCharStr=0x0) at 
.../libreoffice/sal/rtl/string.cxx:567
#9  0x7fffe46efea7 in rtl::OString::OString(char* const&, 
rtl::libreoffice_internal::CharPtrDetector::Type) (this=0x7fff7970, 
value=@0x7fff7978: 0x0)
at include/rtl/string.hxx:315
#10 0x7fffe4711954 in SessionManagerClient::open(SalSession*) 
(pSession=0x567f1bf0) at .../libreoffice/vcl/unx/generic/app/sm.cxx:514
#11 0x7fffe4710f94 in X11SalInstance::CreateSalSession() 
(this=0x555ee3d0) at .../libreoffice/vcl/unx/generic/app/sm.cxx:73
#12 0x7fffee985cfc in (anonymous 
namespace)::VCLSession::VCLSession() (this=0x56903480) at 
.../libreoffice/vcl/source/app/session.cxx:115
#13 0x7fffee985ba9 in 
com_sun_star_frame_VCLSessionManagerClient_get_implementation(com::sun::star::uno::XComponentContext*,
 com::sun::star::uno::Sequence const&) ()
at .../libreoffice/vcl/source/app/session.cxx:411
#14 0x75bed248 in 
std::__invoke_impl const&), 
com::sun::star::uno::XComponentContext*, 
com::sun::star::uno::Sequence 
const&>(std::__invoke_other, com::sun::star::uno::XInterface* 
(*&)(com::sun::star::uno::XComponentContext*, 
com::sun::star::uno::Sequence const&), 
com::sun::star::uno::XComponentContext*&&, 
com::sun::star::uno::Sequence const&)
(__f=@0x557170f8: 0x7fffee985b80 
 const&)>, 
__args=@0x7fff8600: 0x555e7f08, __args=empty uno::Sequence) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61
#15 0x75bed1e5 in 
std::__invoke_r const&), 
com::sun::star::uno::XComponentContext*, 
com::sun::star::uno::Sequence 
const&>(com::sun::star::uno::XInterface* 
(*&)(com::sun::star::uno::XComponentContext*, 
com::sun::star::uno::Sequence const&), 
com::sun::star::uno::XComponentContext*&&, 
com::sun::star::uno::Sequence const&)
(__fn=@0x557170f8: 0x7fffee985b80 
 const&)>, 
__args=@0x7fff8600: 0x555e7f08, __args=empty uno::Sequence) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:114
#16 0x75bed0dd in 
std::_Function_handler const&), 
com::sun::star::uno::XInterface* (*)(com::sun::star::uno::XComponentContext*, 
com::sun::star::uno::Sequence 
const&)>::_M_invoke(std::_Any_data const&, 
com::sun::star::uno::XComponentContext*&&, 
com::sun::star::uno::Sequence const&) (__functor=..., 
__args=@0x7fff8600: 0x555e7f08, __args=empty uno::Sequence) at 

core.git: config_host/config_cpdb.h.in config_host.mk.in configure.ac RepositoryExternal.mk vcl/Library_vcl.mk vcl/unx

2024-06-13 Thread Michael Weghorn (via logerrit)
 RepositoryExternal.mk  |   22 +++
 config_host.mk.in  |3 ++
 config_host/config_cpdb.h.in   |   14 
 configure.ac   |   28 +
 vcl/Library_vcl.mk |5 +++-
 vcl/unx/generic/printer/ppdparser.cxx  |3 +-
 vcl/unx/generic/printer/printerinfomanager.cxx |4 +++
 7 files changed, 77 insertions(+), 2 deletions(-)

New commits:
commit e702e27795bc32de9c68ed05fd4f3476b8d1ebc2
Author: Michael Weghorn 
AuthorDate: Tue Jun 11 07:31:07 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jun 13 09:23:38 2024 +0200

Handle CPDB lib in configure/build system

In preparation of Biswadeep's upcoming GSoC changes (see [1])
to update the CPDB (Common Print Dialog Backends) support to the
latest version and use the CPDB C API, add a
corresponding `--enable-cpdb` autogen option
(disabled by default).

When CPDB is enabled, check for the cpdb-frontend
library, define `ENABLE_CPDB` and set the compiler
and linker flags for building the `CPDManager`
(in vcl/unx/generic/printer/cpdmgr.cxx).

Add checks for existing code using `CPDBManager`,
so it only gets used when when CPDB is actually enabled.

While the cpdb-frontend library is currently not
actually used in `CPDManager` yet (as the previous approach
tried to use some DBUs API directly), it will be in
Biswadeep's upcoming changes.

With this commit in place, an `--enable-cpdb` build
works with this additional local test change in place
to actually make use of the library:

diff --git a/vcl/unx/generic/printer/cpdmgr.cxx 
b/vcl/unx/generic/printer/cpdmgr.cxx
index 7dc17cede353..0c3b71d519db 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -22,6 +22,8 @@
 #include 
 #include 

+#include 
+
 #include 

 #include 
@@ -259,6 +261,7 @@ CPDManager* CPDManager::tryLoadCPD()
 }
 }
 #endif
+cpdbPrintFile(nullptr, nullptr);
 return pManager;
 }

[1] https://lists.freedesktop.org/archives/libreoffice/2024-May/091911.html

Change-Id: Ifc50d2cd6496346bea55c73cb703e3c2d3eb44b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168656
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
Reviewed-by: Biswadeep Purkayastha 

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index c72b814b8a07..1b2f147df595 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -2569,6 +2569,28 @@ gb_LinkTarget__use_avahi :=
 
 endif # ENABLE_AVAHI
 
+ifeq ($(ENABLE_CPDB),TRUE)
+
+define gb_LinkTarget__use_cpdb
+$(call gb_LinkTarget_set_include,$(1),\
+   $$(INCLUDE) \
+   $(CPDB_CFLAGS) \
+)
+
+$(call gb_LinkTarget_add_libs,$(1),\
+   $(CPDB_LIBS) \
+)
+
+endef
+
+else # ENABLE_CPDB
+
+define gb_LinkTarget__use_cpdb
+
+endef
+
+endif # ENABLE_CPDB
+
 ifeq ($(ENABLE_CUPS),TRUE)
 
 define gb_LinkTarget__use_cups
diff --git a/config_host.mk.in b/config_host.mk.in
index 787a1e629c43..b9a7cbfb4cae 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -93,6 +93,8 @@ export 
COMPILER_PLUGINS_TOOLING_ARGS=@COMPILER_PLUGINS_TOOLING_ARGS@
 export COMPRESSIONTOOL=@COMPRESSIONTOOL@
 export COM_IS_CLANG=@COM_IS_CLANG@
 export COREDUMPCTL=@COREDUMPCTL@
+export CPDB_CFLAGS=@CPDB_CFLAGS@
+export CPDB_LIBS=@CPDB_LIBS@
 export CPPU_ENV=@CPPU_ENV@
 export CPPU_ENV_FOR_BUILD=@CPPU_ENV_FOR_BUILD@
 export CPPUNIT_CFLAGS=$(gb_SPACE)@CPPUNIT_CFLAGS@
@@ -159,6 +161,7 @@ SYSTEM_COINMP=@SYSTEM_COINMP@
 export COINMP_CFLAGS=@COINMP_CFLAGS@
 export COINMP_LIBS=@COINMP_LIBS@
 export ENABLE_ATSPI_TESTS=@ENABLE_ATSPI_TESTS@
+export ENABLE_CPDB=@ENABLE_CPDB@
 export ENABLE_CUPS=@ENABLE_CUPS@
 export ENABLE_CURL=@ENABLE_CURL@
 export ENABLE_DBGUTIL=@ENABLE_DBGUTIL@
diff --git a/config_host/config_cpdb.h.in b/config_host/config_cpdb.h.in
new file mode 100644
index ..9a3aca17452b
--- /dev/null
+++ b/config_host/config_cpdb.h.in
@@ -0,0 +1,14 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#pragma once
+
+#define ENABLE_CPDB 0
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configure.ac b/configure.ac
index 55416d77adf7..f59128e84d61 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1215,6 +1215,7 @@ if test -z "$using_x11" -o -z 
"$using_freetype_fontconfig"; then
 fi
 
 # Set defaults, if not set by platform
+test "${test_cpdb+set}" = 

core.git: sc/source

2024-06-10 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7d334ba7467d03e2d890e2926244f783d403878f
Author: Michael Weghorn 
AuthorDate: Mon Jun 10 14:08:15 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Jun 11 03:15:43 2024 +0200

tdf#158914 sc a11y: Remember new cell text again

commit 5f9a955042822d05af5c04b2c852738c7e1e21a2
Author: Michael Weghorn 
Date:   Fri Jun 7 13:03:19 2024 +0200

tdf#158914 sc a11y: Send TEXT_CHANGED event when text changes

had made sending a `AccessibleEventId::VALUE_CHANGED` event
conditional on the cell having a *numerical* value.

Assigning the new string to `m_strCurCellValue`
should always happen independent of this, though,
as this is the string value, not the numerical
value.

Thanks to Patrick Luby for noting the difference
in [1].

[1] 
https://gerrit.libreoffice.org/c/core/+/167961/comment/1af95eb6_7db33e0b/

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

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 39998fa7fee6..1c27bbc94d81 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -697,8 +697,9 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, 
const SfxHint& rHint
 AccessibleEventObject aEvent;
 aEvent.EventId = 
AccessibleEventId::VALUE_CHANGED;
 mpAccCell->CommitChange(aEvent);
-m_strCurCellValue=valStr;
 }
+
+m_strCurCellValue = valStr;
 }
 OUString tabName;
 pScDoc->GetName( maActiveCell.Tab(), tabName );


core.git: sc/source

2024-06-07 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |   21 +++
 1 file changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 5f9a955042822d05af5c04b2c852738c7e1e21a2
Author: Michael Weghorn 
AuthorDate: Fri Jun 7 13:03:19 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jun 7 14:44:14 2024 +0200

tdf#158914 sc a11y: Send TEXT_CHANGED event when text changes

Don't always send an `AccessibleEventId::VALUE_CHANGED` event
when the string value of a Calc cell changes, but send a
`AccessibleEventId::TEXT_CHANGED` event instead.

Only send an `AccessibleEventId::VALUE_CHANGED` event in
addition if the cell actually has value data, as the
`XAccessibleValue` interface and the related `VALUE_CHANGED`
event are meant to handle numerical values only.

Together with changes like the one in PS 11 of [1],
sending the `TEXT_CHANGE` event might help with
missing text updates on the AT side, e.g. the NVDA or
Accerciser scenarios described in [2], s. further
discussion there.

[1] https://gerrit.libreoffice.org/c/core/+/167961
[2] 
https://gerrit.libreoffice.org/c/core/+/167961/comments/16394c5a_338dbbf2

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

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 7296863d0cee..64d220619c7f 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -682,10 +683,22 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& 
rBC, const SfxHint& rHint
 OUString 
valStr(pScDoc->GetString(aNewCell.Col(),aNewCell.Row(),aNewCell.Tab()));
 if(m_strCurCellValue != valStr)
 {
-AccessibleEventObject aEvent;
-aEvent.EventId = AccessibleEventId::VALUE_CHANGED;
-mpAccCell->CommitChange(aEvent);
-m_strCurCellValue=valStr;
+uno::Any aOldValue;
+uno::Any aNewValue;
+
comphelper::OCommonAccessibleText::implInitTextChangedEvent(m_strCurCellValue, 
valStr, aOldValue, aNewValue);
+AccessibleEventObject aTextChangedEvent;
+aTextChangedEvent.EventId = 
AccessibleEventId::TEXT_CHANGED;
+aTextChangedEvent.OldValue = aOldValue;
+aTextChangedEvent.NewValue = aNewValue;
+mpAccCell->CommitChange(aTextChangedEvent);
+
+if (pScDoc->HasValueData(maActiveCell))
+{
+AccessibleEventObject aEvent;
+aEvent.EventId = 
AccessibleEventId::VALUE_CHANGED;
+mpAccCell->CommitChange(aEvent);
+m_strCurCellValue=valStr;
+}
 }
 OUString tabName;
 pScDoc->GetName( maActiveCell.Tab(), tabName );


core.git: avmedia/source

2024-06-01 Thread Michael Weghorn (via logerrit)
 avmedia/source/qt6/QtFrameGrabber.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit a99575f04fa9c858bfcd996f037444135810d43f
Author: Michael Weghorn 
AuthorDate: Sat Jun 1 07:32:22 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sun Jun 2 06:19:25 2024 +0200

tdf#194504 qt avmedia: Don't wait for video frame if there's none

If the media doesn't have video, then don't try to
grab a frame, but stop waiting for the
`QVideoSink::videoFrameChanged` signal to be emitted
in `QtFrameGrabber::grabFrame`.

Don't call `QMediaPlayer::hasVideo` while the media
is still being loaded, as the result is only valid once loading
the media has been finished (`false` is returned otherwise
even if the media file contains video), s. the platform
implementation in qtmultimedia's `QFFmpegMediaPlayer::setMedia`,
which loads the media in a separate thread: Once the media
has been loaded, `QFFmpegMediaPlayer::setMediaAsync`
calls `QPlatformMediaPlayer::videoAvailableChanged`
to specify whether video is available.

With this commit in place, opening an Impress presentation
that contains an audio file (like attachment 194504
from tdf#145735) now shows an "audio icon" as placeholder
as expected and the application exits properly on close,
rather than blocking as it's still waiting for a video frame.

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

diff --git a/avmedia/source/qt6/QtFrameGrabber.cxx 
b/avmedia/source/qt6/QtFrameGrabber.cxx
index 9adfdc6d3978..d58c274520ef 100644
--- a/avmedia/source/qt6/QtFrameGrabber.cxx
+++ b/avmedia/source/qt6/QtFrameGrabber.cxx
@@ -93,7 +93,19 @@ css::uno::Reference SAL_CALL 
QtFrameGrabber::grabFrame(d
 ::onVideoFrameChanged, 
Qt::BlockingQueuedConnection);
 m_xMediaPlayer->play();
 while (m_bWaitingForFrame)
-Scheduler::ProcessEventsToIdle();
+{
+// QMediaPlayer::hasVideo() result isn't valid while media is loading
+if (m_xMediaPlayer->mediaStatus() != QMediaPlayer::LoadingMedia
+&& !m_xMediaPlayer->hasVideo())
+{
+// There's no video, don't wait for frame
+m_bWaitingForFrame = false;
+}
+else
+{
+Scheduler::ProcessEventsToIdle();
+}
+}
 m_xMediaPlayer->stop();
 
 uno::Reference xGraphic = m_xGraphic;


core.git: shell/source

2024-05-31 Thread Michael Weghorn (via logerrit)
 shell/source/backends/kf5be/kfaccess.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit eff8497fa2ab9c0e4889e1cf38fdeff1b2ec195a
Author: Michael Weghorn 
AuthorDate: Thu May 30 14:29:05 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 31 14:29:01 2024 +0200

kf5be: Make fromQStringToOUString work for Qt 6

Sync `fromQStringToOUString` with the `toOUString`
implementation in `vcl/inc/qt5/QtTools.hxx`, which
makes it work with Qt 6 as well.

Without this, building this with a planned upcoming
change that introduces a KF 6 desktop backend would fail
like this:

In file included from 
/home/user/development/git/libreoffice/shell/source/backends/kf6be/kfaccess.cxx:10:

/home/user/development/git/libreoffice/shell/source/backends/kf6be/../kf5be/kfaccess.cxx:53:60:
 error: non-constant-expression cannot be narrowed from type 'qsizetype' (aka 
'long long') to 'sal_Int32' (aka 'int') in initializer list [-Wc++11-narrowing]
   53 | return { reinterpret_cast(s.utf16()), 
s.size() };
  |
^~~~

/home/user/development/git/libreoffice/shell/source/backends/kf6be/../kf5be/kfaccess.cxx:53:60:
 note: insert an explicit cast to silence this issue
   53 | return { reinterpret_cast(s.utf16()), 
s.size() };
  |
^~~~
  |
static_cast( )

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

diff --git a/shell/source/backends/kf5be/kfaccess.cxx 
b/shell/source/backends/kf5be/kfaccess.cxx
index 93fe1ed49b20..498fb9e1efb5 100644
--- a/shell/source/backends/kf5be/kfaccess.cxx
+++ b/shell/source/backends/kf5be/kfaccess.cxx
@@ -47,10 +47,9 @@ namespace uno = css::uno;
 
 namespace
 {
-OUString fromQStringToOUString(QString const& s)
+OUString fromQStringToOUString(const QString& s)
 {
-// Conversion from QString size()'s int to OUString's sal_Int32 should be 
non-narrowing:
-return { reinterpret_cast(s.utf16()), s.size() };
+return OUString(reinterpret_cast(s.data()), 
s.length());
 }
 }
 


core.git: 2 commits - shell/IwyuFilter_shell.yaml shell/Library_kf5be.mk shell/source

2024-05-31 Thread Michael Weghorn (via logerrit)
 shell/IwyuFilter_shell.yaml   |4 ++--
 shell/Library_kf5be.mk|4 ++--
 shell/source/backends/kf5be/kfaccess.cxx  |4 ++--
 shell/source/backends/kf5be/kfaccess.hxx  |7 ++-
 shell/source/backends/kf5be/kfbackend.cxx |6 +++---
 5 files changed, 11 insertions(+), 14 deletions(-)

New commits:
commit 9214b80fe67f6771a4120b6eeaddd85cea1d6f2a
Author: Michael Weghorn 
AuthorDate: Thu May 30 13:57:03 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 31 14:28:52 2024 +0200

kf: Drop "5" from KF 5 desktop backend file names

... and namespace.

This is in preparation of implementing a KF 6
backend that will reuse most of the code.

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

diff --git a/shell/IwyuFilter_shell.yaml b/shell/IwyuFilter_shell.yaml
index 755dc738343e..5239593d0ee0 100644
--- a/shell/IwyuFilter_shell.yaml
+++ b/shell/IwyuFilter_shell.yaml
@@ -4,7 +4,7 @@ excludelist:
 shell/source/sessioninstall/SyncDbusSessionHelper.hxx:
 # No hpp->hdl replacement
 - org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp
-shell/source/backends/kf5be/kf5access.cxx:
+shell/source/backends/kf5be/kfaccess.cxx:
 # Keep abstract QT headers
 - QtCore/QDir
 - QtCore/QStandardPaths
@@ -12,7 +12,7 @@ excludelist:
 - QtCore/QUrl
 - QtGui/QFont
 - QtGui/QFontDatabase
-shell/source/backends/kf5be/kf5backend.cxx:
+shell/source/backends/kf5be/kfbackend.cxx:
 # Keep abstract QT headers
 - QtWidgets/QApplication
 shell/source/backends/localebe/localebackend.cxx:
diff --git a/shell/Library_kf5be.mk b/shell/Library_kf5be.mk
index 1355d402dc00..dfcac91f871a 100644
--- a/shell/Library_kf5be.mk
+++ b/shell/Library_kf5be.mk
@@ -25,8 +25,8 @@ $(eval $(call gb_Library_use_libraries,kf5be1,\
 $(eval $(call 
gb_Library_set_componentfile,kf5be1,shell/source/backends/kf5be/kf5be1,services))
 
 $(eval $(call gb_Library_add_exception_objects,kf5be1,\
-shell/source/backends/kf5be/kf5access \
-shell/source/backends/kf5be/kf5backend \
+shell/source/backends/kf5be/kfaccess \
+shell/source/backends/kf5be/kfbackend \
 ))
 
 # Workaround for clang+icecream (clang's -frewrite-includes
diff --git a/shell/source/backends/kf5be/kf5access.cxx 
b/shell/source/backends/kf5be/kfaccess.cxx
similarity index 99%
rename from shell/source/backends/kf5be/kf5access.cxx
rename to shell/source/backends/kf5be/kfaccess.cxx
index d266f147d68a..93fe1ed49b20 100644
--- a/shell/source/backends/kf5be/kf5access.cxx
+++ b/shell/source/backends/kf5be/kfaccess.cxx
@@ -19,7 +19,7 @@
 
 #include 
 
-#include "kf5access.hxx"
+#include "kfaccess.hxx"
 
 #include 
 #include 
@@ -38,7 +38,7 @@
 #include 
 #include 
 
-namespace kf5access
+namespace kfaccess
 {
 namespace
 {
diff --git a/shell/source/backends/kf5be/kf5access.hxx 
b/shell/source/backends/kf5be/kfaccess.hxx
similarity index 98%
rename from shell/source/backends/kf5be/kf5access.hxx
rename to shell/source/backends/kf5be/kfaccess.hxx
index bb4817c38cf5..2bbd5ad4887b 100644
--- a/shell/source/backends/kf5be/kf5access.hxx
+++ b/shell/source/backends/kf5be/kfaccess.hxx
@@ -30,7 +30,7 @@ namespace com::sun::star::uno
 class Any;
 }
 
-namespace kf5access
+namespace kfaccess
 {
 css::beans::Optional getValue(std::u16string_view id);
 }
diff --git a/shell/source/backends/kf5be/kf5backend.cxx 
b/shell/source/backends/kf5be/kfbackend.cxx
similarity index 97%
rename from shell/source/backends/kf5be/kf5backend.cxx
rename to shell/source/backends/kf5be/kfbackend.cxx
index 7a90dfdcdffd..81a48ad53ffe 100644
--- a/shell/source/backends/kf5be/kf5backend.cxx
+++ b/shell/source/backends/kf5be/kfbackend.cxx
@@ -46,7 +46,7 @@
 #include 
 #include 
 
-#include "kf5access.hxx"
+#include "kfaccess.hxx"
 
 namespace
 {
@@ -144,14 +144,14 @@ void readKDESettings(std::map>& rS
 
 for (const OUString& aKey : aKeys)
 {
-css::beans::Optional aValue = kf5access::getValue(aKey);
+css::beans::Optional aValue = kfaccess::getValue(aKey);
 std::pair> elem
 = std::make_pair(aKey, aValue);
 rSettings.insert(elem);
 }
 }
 
-// init the QApplication when we load the kf5backend into a non-Qt vclplug 
(e.g. gtk3_kde5)
+// init the QApplication when we load the kfbackend into a non-Qt vclplug 
(e.g. gtk3_kde5)
 // TODO: use a helper process to read these values without linking to Qt 
directly?
 // TODO: share this code somehow with Qt5Instance.cxx?
 void initQApp(std::map>& 
rSettings)
commit cc733542fecc2e63bc794559dfa6320d788e9254
Author: Michael Weghorn 
AuthorDate: Thu May 30 13:48:35 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 31 14:28:44 2024 +0200

tdf#143148 kf: Use pragma once in kf5access.hxx

Change-Id: If2d8d2dc13088ba2b2972198b8386be55401871d
Reviewed-on: 

core.git: avmedia/CustomTarget_avmediaqt6_moc.mk avmedia/Library_avmediaqt6.mk avmedia/source

2024-05-31 Thread Michael Weghorn (via logerrit)
 avmedia/CustomTarget_avmediaqt6_moc.mk |1 
 avmedia/Library_avmediaqt6.mk  |1 
 avmedia/source/qt6/QtFrameGrabber.cxx  |  106 +
 avmedia/source/qt6/QtFrameGrabber.hxx  |   50 +++
 avmedia/source/qt6/QtPlayer.cxx|9 ++
 5 files changed, 166 insertions(+), 1 deletion(-)

New commits:
commit f04e711ea34ad3ad5ee642047be5d56a18fa0b53
Author: Michael Weghorn 
AuthorDate: Thu May 30 13:24:02 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 31 09:24:01 2024 +0200

tdf#145735 qt avmedia: Implement frame grabber

Add a new `QtFrameGrabber` class that implements
the `css::media::XFrameGrabber` interface and
return an instance of it in
`QtPlayer::createFrameGrabber`.

As there seems to be no direct way to retrieve
the image/frame of a video at a certain point
in time, create a separate `QMediaPlayer` instance
for the `QtFrameGrabber`, set a video sink, connect
to its `::videoFrameChanged` signal and
start playing the video (and stop it again once the
first frame has been received) in order to retrieve
a corresponding frame.

From that `QVideoFrame`, a `QImage` can be retrieved
that can then be converted to an `XGraphic`.

With this in place, a frame from the actual video
is now displaced in Impress in non-presentation
mode instead of just a generic "video icon" placeholder
when opening a presentation containing a video,
(e.g. attachment 145517 from tdf#120452) when the
qt6 VCL plugin is in use.

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

diff --git a/avmedia/CustomTarget_avmediaqt6_moc.mk 
b/avmedia/CustomTarget_avmediaqt6_moc.mk
index 0f9ca1af23b6..6cce5d258323 100644
--- a/avmedia/CustomTarget_avmediaqt6_moc.mk
+++ b/avmedia/CustomTarget_avmediaqt6_moc.mk
@@ -10,6 +10,7 @@
 $(eval $(call gb_CustomTarget_CustomTarget,avmedia/source/qt6))
 
 $(call gb_CustomTarget_get_target,avmedia/source/qt6) : \
+   $(gb_CustomTarget_workdir)/avmedia/source/qt6/QtFrameGrabber.moc \
$(gb_CustomTarget_workdir)/avmedia/source/qt6/QtPlayer.moc
 
 
diff --git a/avmedia/Library_avmediaqt6.mk b/avmedia/Library_avmediaqt6.mk
index a1acb7568d02..86b4553e1add 100644
--- a/avmedia/Library_avmediaqt6.mk
+++ b/avmedia/Library_avmediaqt6.mk
@@ -37,6 +37,7 @@ $(eval $(call gb_Library_use_libraries,avmediaqt6,\
 
 $(eval $(call gb_Library_add_exception_objects,avmediaqt6,\
avmedia/source/qt6/gstwindow \
+   avmedia/source/qt6/QtFrameGrabber \
avmedia/source/qt6/QtManager \
avmedia/source/qt6/QtPlayer \
 ))
diff --git a/avmedia/source/qt6/QtFrameGrabber.cxx 
b/avmedia/source/qt6/QtFrameGrabber.cxx
new file mode 100644
index ..58726d649af0
--- /dev/null
+++ b/avmedia/source/qt6/QtFrameGrabber.cxx
@@ -0,0 +1,106 @@
+/* -*- 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/.
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "QtFrameGrabber.hxx"
+#include 
+
+using namespace ::com::sun::star;
+
+namespace
+{
+inline OUString toOUString(const QString& s)
+{
+return OUString(reinterpret_cast(s.data()), 
s.length());
+}
+
+uno::Reference toXGraphic(const QImage& rImage)
+{
+QByteArray aData;
+QBuffer aBuffer();
+rImage.save(, "PNG");
+
+SvMemoryStream aStream(aData.data(), aData.size(), StreamMode::READ);
+vcl::PngImageReader aReader(aStream);
+Graphic aGraphic;
+aReader.read(aGraphic);
+
+return aGraphic.GetXGraphic();
+}
+}
+
+namespace avmedia::qt
+{
+QtFrameGrabber::QtFrameGrabber(const QUrl& rSourceUrl)
+: m_bWaitingForFrame(false)
+{
+m_xMediaPlayer = std::make_unique();
+m_xMediaPlayer->setSource(rSourceUrl);
+
+m_xVideoSink = std::make_unique();
+m_xMediaPlayer->setVideoSink(m_xVideoSink.get());
+
+connect(m_xMediaPlayer.get(), ::errorOccurred, this,
+::onErrorOccured, Qt::BlockingQueuedConnection);
+}
+
+void QtFrameGrabber::onErrorOccured(QMediaPlayer::Error eError, const QString& 
rErrorString)
+{
+std::lock_guard aLock(m_aMutex);
+
+SAL_WARN("avmedia", "Media playback error occured when trying to grab 
frame: "
+<< toOUString(rErrorString) << ", code: " << 
eError);
+
+m_bWaitingForFrame = false;
+}
+
+void QtFrameGrabber::onVideoFrameChanged(const QVideoFrame& rFrame)
+{
+std::lock_guard aLock(m_aMutex);
+
+disconnect(m_xVideoSink.get(), ::videoFrameChanged, this,
+   ::onVideoFrameChanged);
+
+  

core.git: vcl/unx

2024-05-29 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 405cf00e4818886b0d3053d03cfb2e3f3a5e8eb8
Author: Michael Weghorn 
AuthorDate: Tue May 28 11:50:12 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed May 29 09:47:21 2024 +0200

related tdf#160971 gtk3 a11y: Keep new combobox value

Selecting a new value in an editable combobox using
the gtk3 VCL plugin using the popup didn't work when
that popup was opened using the keyboard, sample
scenario:

1) Start Writer
2) Press F6 until the Formatting toolbar has focus
3) Press Tab until the "Font Name" combobox has focus
4) Press Alt+Down to open the combobox popup
5) Press Down key a few times to select another font, e.g.
   "Carlito"
6) Press Enter to confirm

Rather than the newly selected font, the previously
set one would still be set in the combobox.

Selecting a new font using the popup would work however
when clicking the combobox's button using the mouse
instead of steps 1-4 above.

The problem was that restoring focus was resulting
in the newly selected value not getting saved.

Backtrace for how the value already got properly saved
for the case where the button was previously clicked
using the mouse:

1 weld::ComboBox::save_value weld.hxx 853 0x7f19a7af3f81
2 FontNameBox::save_value ctrlbox.hxx 369 0x7f19a7b01f3d
3 (anonymous namespace)::SvxFontNameBox_Base::statusChanged_Impl 
tbcontrl.cxx 3432 0x7f19a7ad95e0
4 (anonymous namespace)::SvxFontNameToolBoxControl::statusChanged 
tbcontrl.cxx 3439 0x7f19a7ad8312
5 SfxStatusDispatcher::sendStatusChanged(rtl::OUString const&, 
com::sun::star::frame::FeatureStateEvent 
const&)::$_0::operator()(com::sun::star::uno::Reference
 const&) const unoctitm.cxx 132 0x7f19a98ae241
6 
comphelper::OInterfaceContainerHelper4::forEach(std::unique_lock&, 
SfxStatusDispatcher::sendStatusChanged(rtl::OUString const&, 
com::sun::star::frame::FeatureStateEvent const&)::$_0 const&) const 
interfacecontainer4.hxx 304 0x7f19a98a4411
7 SfxStatusDispatcher::sendStatusChanged unoctitm.cxx 129 0x7f19a98a42aa
8 SfxDispatchController_Impl::sendStatusChanged unoctitm.cxx 802 
0x7f19a98a907c
9 SfxDispatchController_Impl::StateChanged unoctitm.cxx 885 
0x7f19a98a987a
10 SfxStateCache::SetState_Impl statcach.cxx 424 0x7f19a98308cc
11 SfxStateCache::SetState statcach.cxx 328 0x7f19a98306f2
12 SfxBindings::UpdateControllers_Impl bindings.cxx 1211 0x7f19a97aeffd
13 SfxBindings::Update_Impl bindings.cxx 274 0x7f19a97ae5cf
14 SfxBindings::Update bindings.cxx 353 0x7f19a97af682
15 SfxDispatcher::Call_Impl dispatch.cxx 280 0x7f19a97c731c
16 SfxDispatcher::Execute_ dispatch.cxx 753 0x7f19a97cbc4b
17 SfxDispatcher::Execute dispatch.cxx 812 0x7f19a97cc02f
18 SfxDispatchController_Impl::dispatch unoctitm.cxx 671 0x7f19a98a6673
19 SfxOfficeDispatch::dispatch unoctitm.cxx 250 0x7f19a98a511a
20 SfxToolBoxControl::Dispatch tbxitem.cxx 253 0x7f19a9df168f
21 (anonymous namespace)::SvxFontNameBox_Base::Select tbcontrl.cxx 2007 
0x7f19a7adb44a
22 (anonymous namespace)::SvxFontNameBox_Base::SelectHdl tbcontrl.cxx 
1962 0x7f19a7adafb4
23 (anonymous namespace)::SvxFontNameBox_Base::LinkStubSelectHdl 
tbcontrl.cxx 1960 0x7f19a7adab9d
24 Link::Call link.hxx 111 0x7f199a19ddd8
25 weld::ComboBox::signal_changed weld.hxx 731 0x7f199a19dd8c
26 (anonymous namespace)::GtkInstanceComboBox::fire_signal_changed 
gtkinst.cxx 21229 0x7f199a0e1880
27 (anonymous namespace)::GtkInstanceComboBox::handle_row_activated 
gtkinst.cxx 21891 0x7f199a0e17f9
28 (anonymous namespace)::GtkInstanceComboBox::signalRowActivated 
gtkinst.cxx 21876 0x7f199a0dd299
29 ?? 0x7f1999695931
30 ?? 0x7f19a87b4939
31 ?? 0x7f19a87ca33f
32 g_signal_emit_valist 0x7f19a87cff06
33 g_signal_emit 0x7f19a87cffc3
34 ?? 0x7f13384b
35 ?? 0x7f1999697085
36 ?? 0x7f19a87b4939
37 ?? 0x7f19a87ca33f
38 g_signal_emit_valist 0x7f19a87cff06
39 g_signal_emit 0x7f19a87cffc3
40 ?? 0x7f19997b317e
41 g_cclosure_marshal_VOID__BOXEDv 0x7f19a87b7b76
42 ?? 0x7f19a87b4939
43 ?? 0x7f19a87ca33f
44 g_signal_emit_valist 0x7f19a87cff06
45 g_signal_emit 0x7f19a87cffc3
46 ?? 0x7f19997b0213
47 ?? 0x7f19997b1803
48 ?? 0x7f19997b4a42
49 gtk_event_controller_handle_event 0x7f1999779361
50 ?? 0x7f1488bd
51 ?? 0x7f1999690db8
52 ?? 0x7f19a87b4939
53 ?? 0x7f19a87c9693
54 g_signal_emit_valist 0x7f19a87cff06
55 g_signal_emit 0x7f19a87cffc3
56 ?? 0x7f14a314
57 ?? 0x7f19997fc84e
58 gtk_main_do_event 

core.git: accessibility/source

2024-05-29 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/accessibleiconchoicectrl.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit ceca4cde363154b0c7e276d65fc87ec94eb0bb9a
Author: Michael Weghorn 
AuthorDate: Tue May 28 15:07:30 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed May 29 09:46:56 2024 +0200

a11y: Don't report dummy a11y name for icon choice control

If no a11y name is set for the `SvtIconChoiceCtrl`, don't
report any, rather than using "IconChoiceControl" as
accessible name.

Having the Orca screen reader (when used with the qt6 VCL plugin)
announce "IconChoiceControl" and then the name of the actually
selected item e.g. in Writer's "Insert" -> "Hyperlink" or the
"Format" -> "Page Setup" dialog is rather confusing when an
entry in the control gets focus.

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

diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx 
b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 33b15d5f54c8..877816466a19 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -194,10 +194,7 @@ namespace accessibility
 {
 ::comphelper::OExternalLockGuard aGuard( this );
 
-OUString sName = getCtrl()->GetAccessibleName();
-if ( sName.isEmpty() )
-sName = "IconChoiceControl";
-return sName;
+return getCtrl()->GetAccessibleName();
 }
 
 // XAccessibleSelection


core.git: accessibility/source

2024-05-29 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/accessibleiconchoicectrlentry.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit c61f6a78022de6b29f031f3ac6726520032de187
Author: Michael Weghorn 
AuthorDate: Tue May 28 14:44:29 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed May 29 09:46:36 2024 +0200

a11y: Report focused state for icon choice control entries

Handle the FOCUSABLE and FOCUSED a11y states in
`AccessibleIconChoiceCtrlEntry::getAccessibleStateSet`.

Without this, the currently focused tab item would
e.g. not be reported by Orca when using the qt6 VCL
plugin in Writer's "Insert" -> "Hyperlink" dialog
or in "Format" -> "Page Style" that was recently
converted to use vertical tabs.

Monitoring AT-SPI events showed that an
`object:state-changed:focused` event was sent
on the AT-SPI layer (see also
`AccessibleIconChoiceCtrl::ProcessWindowEvent` that sends
an `AccessibleEventId::ACTIVE_DESCENDANT_CHANGED` event):

However, the focused state is not set, so Orca
would not report the item as the new focus item:

95.1 object:state-changed:focused(0, 0, [list item | Mail])
source: [list item | Mail]
application: [application | soffice.bin]

With this change in place, the state is properly
set now and Orca announces the newly focused item:

31.0 object:state-changed:focused(1, 0, [list item | Mail])
source: [list item | Mail]
application: [application | soffice.bin]

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

diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx 
b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
index 5f4761770f03..95e9c4375004 100644
--- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
@@ -297,6 +297,7 @@ namespace accessibility
 
 if ( IsAlive_Impl() )
 {
+nStateSet |= AccessibleStateType::FOCUSABLE;
 nStateSet |= AccessibleStateType::TRANSIENT;
 nStateSet |= AccessibleStateType::SELECTABLE;
 nStateSet |= AccessibleStateType::ENABLED;
@@ -308,7 +309,11 @@ namespace accessibility
 }
 
 if ( m_pIconCtrl && m_pIconCtrl->GetCursor() == 
m_pIconCtrl->GetEntry( m_nIndex ) )
+{
 nStateSet |=  AccessibleStateType::SELECTED;
+if (m_pIconCtrl->HasChildPathFocus())
+nStateSet |= AccessibleStateType::FOCUSED;
+}
 }
 else
 nStateSet |=  AccessibleStateType::DEFUNC;


core.git: 3 commits - include/vcl vcl/qt5 vcl/source vcl/unx

2024-05-27 Thread Michael Weghorn (via logerrit)
 include/vcl/settings.hxx  |   11 +++
 vcl/qt5/QtFrame.cxx   |4 
 vcl/source/app/settings.cxx   |   14 ++
 vcl/source/control/combobox.cxx   |   29 +
 vcl/unx/gtk3/salnativewidgets-gtk.cxx |4 
 5 files changed, 58 insertions(+), 4 deletions(-)

New commits:
commit 4b53712cccfa48fc7d1f754d6a596204e041d554
Author: Michael Weghorn 
AuthorDate: Mon May 27 14:16:53 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 28 06:47:08 2024 +0200

tdf#160971 gtk: Don't select combobox text on entry selection

In the same way that

Change-Id: I17ce71198ec37cb1735194818bae17d1a5654d89
Author: Michael Weghorn 
Date:   Mon May 27 13:35:52 2024 +0200

tdf#160971 qt a11y: Don't select combobox text on entry selection

together with

Change-Id: Ia2c77245049d708885cbd374c20ce1892259329b
Author: Michael Weghorn 
Date:   Mon May 27 13:29:39 2024 +0200

tdf#160971 vcl a11y: Make combobox text selection mode style-able

sets the style option to not select combobox text when switching
between entries in an editable combobox for the Qt-based VCL plugins,
do the same for the GTK-based VCL plugins, except for putting the
text cursor at the beginning of the entry text instead of the end,
as happens when using a native GtkComboBox (see tdf#160971 comment 11).

Since the GTK-based VCL plugins use native GTK widgets
in most places, the behavior for e.g. the "Font Name"
combobox in Writer's Formatting toolbar is already like that
without this change in place and is unaffected by this change
(even though LO's gtk3 VCL plugin is using a custom combobox
implementation, see vcl/uiconfig/ui/combobox.ui).

However, the new behavior applies for combobox form
controls, as can be seen e.g. with the sample doc
attachment 194376 from tdf#160971.

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

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 7c2fcc633b77..402a50df6d96 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -209,6 +209,7 @@ enum class ToolbarIconSize
 enum class ComboBoxTextSelectionMode
 {
 SelectText, // select the whole text of the new entry
+CursorToStart, // don't select text, put text cursor to start of text
 CursorToEnd // don't select text, put text cursor to end of text
 };
 
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 360053e4134d..e8d93f1ea52c 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -384,9 +384,17 @@ IMPL_LINK_NOARG(ComboBox, ImplSelectHdl, LinkParamNone*, 
void)
 m_pSubEdit->SetSelection(aNewSelection);
 break;
 }
+case ComboBoxTextSelectionMode::CursorToStart:
+{
+Selection aNewSelection(0, 0);
+m_pSubEdit->SetSelection(aNewSelection);
+break;
+}
 case ComboBoxTextSelectionMode::CursorToEnd:
+{
 m_pSubEdit->SetCursorAtLast();
 break;
+}
 default:
 assert(false && "Unhandled ComboBoxTextSelectionMode case");
 break;
diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
index a4e8a82aed28..e02e642bc534 100644
--- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
@@ -2579,6 +2579,10 @@ bool GtkSalGraphics::updateSettings(AllSettings& 
rSettings)
 }
 #endif
 
+// match native GtkComboBox behavior of putting text cursor to start of 
text
+// without text selection when combobox entry is selected
+
aStyleSet.SetComboBoxTextSelectionMode(ComboBoxTextSelectionMode::CursorToStart);
+
 // get cursor blink time
 gboolean blink = false;
 
commit 3776874c20b4d4b2b24850c5f21e3b89a7feaaea
Author: Michael Weghorn 
AuthorDate: Mon May 27 13:35:52 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 28 06:47:01 2024 +0200

tdf#160971 qt a11y: Don't select combobox text on entry selection

In order to align the behavior with that of the native
`QComboBox`, don't select the entry text when selecting
a different combobox entry, e.g. using the up/down arrow
keys in the editable combobox for the font name in
Writer's Formatting toolbar.

In order to achieve that, set the corresponding
style setting newly introduced in the previous commit,

Change-Id: Ia2c77245049d708885cbd374c20ce1892259329b
Author: Michael Weghorn 
Date:   Mon May 27 13:29:39 2024 +0200

tdf#160971 

core.git: Branch 'libreoffice-24-2-4' - sc/source

2024-05-26 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 661eed7b8e5412a0c6f952dc30a529683a2f5986
Author: Michael Weghorn 
AuthorDate: Thu May 23 12:57:46 2024 +0200
Commit: Noel Grandin 
CommitDate: Sun May 26 09:53:14 2024 +0200

related tdf#158914 sc a11y: Release references when disposing sheet

Clear all `ScAccessibleCell` references that are owned by
`ScAccessibleSpreadsheet` when disposing the sheet instead
of when the sheet is deleted.

While `ScAccessibleSpreadsheet::disposing` is always called,
`ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet` is not called
until all of the sheet's `ScAccessibleCell` instances have been
deleted. So make sure that `ScAccessibleSpreadsheet::disposing`
releases all `ScAccessibleCell` references.

This might possibly reduce some of the leaks mentioned in [1].

[1] 
https://gerrit.libreoffice.org/c/core/+/167961/comments/15a6a4e4_91a77291

Change-Id: Iaf14338945c1899d54c8e7f8a16f38a48316ac98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167985
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 4d2c41e8171139e210d94b0c3c2b6b3d6392665a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168051
Reviewed-by: Noel Grandin 
Reviewed-by: Patrick Luby 
Tested-by: Noel Grandin 

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 7aaa7237ccac..020386a69af8 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -310,7 +310,11 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing()
 mpViewShell->RemoveAccessibilityObject(*this);
 mpViewShell = nullptr;
 }
+
 mpAccCell.clear();
+m_mapSelectionSend.clear();
+m_mapFormulaSelectionSend.clear();
+m_pAccFormulaCell.clear();
 
 ScAccessibleTableBase::disposing();
 }


core.git: Branch 'libreoffice-24-2' - sc/source

2024-05-26 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit e7a660709c153239bfec8ddb445d0ee7ed790215
Author: Michael Weghorn 
AuthorDate: Thu May 23 12:57:46 2024 +0200
Commit: Noel Grandin 
CommitDate: Sun May 26 09:53:04 2024 +0200

related tdf#158914 sc a11y: Release references when disposing sheet

Clear all `ScAccessibleCell` references that are owned by
`ScAccessibleSpreadsheet` when disposing the sheet instead
of when the sheet is deleted.

While `ScAccessibleSpreadsheet::disposing` is always called,
`ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet` is not called
until all of the sheet's `ScAccessibleCell` instances have been
deleted. So make sure that `ScAccessibleSpreadsheet::disposing`
releases all `ScAccessibleCell` references.

This might possibly reduce some of the leaks mentioned in [1].

[1] 
https://gerrit.libreoffice.org/c/core/+/167961/comments/15a6a4e4_91a77291

Change-Id: Iaf14338945c1899d54c8e7f8a16f38a48316ac98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167985
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 4d2c41e8171139e210d94b0c3c2b6b3d6392665a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168050
Reviewed-by: Noel Grandin 
Reviewed-by: Patrick Luby 

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 7aaa7237ccac..020386a69af8 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -310,7 +310,11 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing()
 mpViewShell->RemoveAccessibilityObject(*this);
 mpViewShell = nullptr;
 }
+
 mpAccCell.clear();
+m_mapSelectionSend.clear();
+m_mapFormulaSelectionSend.clear();
+m_pAccFormulaCell.clear();
 
 ScAccessibleTableBase::disposing();
 }


core.git: sc/source

2024-05-25 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 4d2c41e8171139e210d94b0c3c2b6b3d6392665a
Author: Michael Weghorn 
AuthorDate: Thu May 23 12:57:46 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat May 25 09:02:38 2024 +0200

related tdf#158914 sc a11y: Release references when disposing sheet

Clear all `ScAccessibleCell` references that are owned by
`ScAccessibleSpreadsheet` when disposing the sheet instead
of when the sheet is deleted.

While `ScAccessibleSpreadsheet::disposing` is always called,
`ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet` is not called
until all of the sheet's `ScAccessibleCell` instances have been
deleted. So make sure that `ScAccessibleSpreadsheet::disposing`
releases all `ScAccessibleCell` references.

This might possibly reduce some of the leaks mentioned in [1].

[1] 
https://gerrit.libreoffice.org/c/core/+/167961/comments/15a6a4e4_91a77291

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

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index fdeea8d7579a..7296863d0cee 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -310,7 +310,11 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing()
 mpViewShell->RemoveAccessibilityObject(*this);
 mpViewShell = nullptr;
 }
+
 mpAccCell.clear();
+m_mapSelectionSend.clear();
+m_mapFormulaSelectionSend.clear();
+m_pAccFormulaCell.clear();
 
 ScAccessibleTableBase::disposing();
 }


core.git: avmedia/source

2024-05-24 Thread Michael Weghorn (via logerrit)
 avmedia/source/qt6/QtPlayer.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 7960bd204bdecb73522c1eda6c101c40edda
Author: Michael Weghorn 
AuthorDate: Fri May 24 11:31:09 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 18:18:17 2024 +0200

tdf#145735 qt avmedia: Return video resolution for preferred win size

In `QtPlayer::getPreferredPlayerWindowSize`, retrieve the
video resolution from the meta data and return that for the
preferred window size if available, instead of always returning
an empty rect.

For the sample presentation referenced in tdf#145735,
the size retrieved this way also matches what
`GtkPlayer::getPreferredPlayerWindowSize` returns
(720x400).

As mentioned in

commit 441d8ed9be0e7f831b455a69b8688dcb79a8bc00
Author: Michael Weghorn 
Date:   Mon May 20 16:25:09 2024 +0200

tdf#145735 avmedia qt: Use QtMultimedia for Qt 6 media playback

, the behaviour without this was:

> * In non-presentation mode, the placeholder
>   shown until the video gets started using the controls
>   in the sidebar is just an "audio icon", not a frame
>   from the actual video. (This might be related to the
>   fact that `QtPlayer::createFrameGrabber` currently
>   returns an empty reference.)

With this in place, the placeholder is now a different
icon, a "video icon" (but still not a frame from the actual
video).

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

diff --git a/avmedia/source/qt6/QtPlayer.cxx b/avmedia/source/qt6/QtPlayer.cxx
index 1ad675f37d5c..5f75394ff1a3 100644
--- a/avmedia/source/qt6/QtPlayer.cxx
+++ b/avmedia/source/qt6/QtPlayer.cxx
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -178,8 +179,16 @@ awt::Size SAL_CALL QtPlayer::getPreferredPlayerWindowSize()
 {
 osl::MutexGuard aGuard(m_aMutex);
 
-awt::Size aSize(0, 0);
-return aSize;
+assert(m_xMediaPlayer);
+const QMediaMetaData aMetaData = m_xMediaPlayer->metaData();
+const QVariant aResolutionVariant = 
aMetaData.value(QMediaMetaData::Resolution);
+if (aResolutionVariant.canConvert())
+{
+const QSize aResolution = aResolutionVariant.value();
+return awt::Size(aResolution.width(), aResolution.height());
+}
+
+return awt::Size(0, 0);
 }
 
 uno::Reference<::media::XPlayerWindow>


core.git: vcl/qt5

2024-05-24 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtObject.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 81c94af71206013cb200f5612bc3bd61c799cf83
Author: Michael Weghorn 
AuthorDate: Fri May 24 11:16:17 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 18:17:58 2024 +0200

tdf#145735 qt: Set margins for video widget/layout to 0

Set all of the content margins of the layout that
holds the widget for video playback to 0.

Quoting [1]:

> Sets the left, top, right, and bottom margins to use around the layout.
>
> By default, QLayout uses the values provided by the style. On most 
platforms,
> the margin is 11 pixels in all directions.

This makes the odd margin/frame shown around the video
on video playback mentioned in

commit 441d8ed9be0e7f831b455a69b8688dcb79a8bc00
Author: Michael Weghorn 
Date:   Mon May 20 16:25:09 2024 +0200

tdf#145735 avmedia qt: Use QtMultimedia for Qt 6 media playback

disappear.

[1] https://doc.qt.io/qt-6/qlayout.html#setContentsMargins

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

diff --git a/vcl/qt5/QtObject.cxx b/vcl/qt5/QtObject.cxx
index cd133e095ff5..bde8b570ac2e 100644
--- a/vcl/qt5/QtObject.cxx
+++ b/vcl/qt5/QtObject.cxx
@@ -115,6 +115,7 @@ QtObjectWidget::QtObjectWidget(QtObject& rParent)
 
 // set layout, used for video playback, see QtPlayer::createPlayerWindow
 QVBoxLayout* layout = new QVBoxLayout;
+layout->setContentsMargins(0, 0, 0, 0);
 setLayout(layout);
 }
 


core.git: 2 commits - accessibility/inc accessibility/source

2024-05-24 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/accessiblemenubasecomponent.hxx|4 
 accessibility/source/standard/accessiblemenubasecomponent.cxx |   68 +-
 2 files changed, 35 insertions(+), 37 deletions(-)

New commits:
commit 248a19ad2b21669be6f76dbacb0f89ea41fe6d96
Author: Michael Weghorn 
AuthorDate: Fri May 24 08:01:41 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 11:07:42 2024 +0200

a11y: Rename m_aAccessibleChildren1 -> m_aAccessibleChildren

Was previously changed the other way around in

commit 28c89e58d90ea73513e273db274eb46ff9081c35
Date:   Wed Aug 30 15:16:01 2023 +0200

use concrete type for 
OAccessibleMenuBaseComponent::m_aAccessibleChildren

for no apparent reason.

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

diff --git a/accessibility/inc/standard/accessiblemenubasecomponent.hxx 
b/accessibility/inc/standard/accessiblemenubasecomponent.hxx
index 7d62a63eff63..4ddcdd791e1b 100644
--- a/accessibility/inc/standard/accessiblemenubasecomponent.hxx
+++ b/accessibility/inc/standard/accessiblemenubasecomponent.hxx
@@ -45,7 +45,7 @@ class OAccessibleMenuBaseComponent : public 
cppu::ImplInheritanceHelper<
 friend class VCLXAccessibleMenu;
 
 protected:
-std::vector> 
m_aAccessibleChildren1;
+std::vector> 
m_aAccessibleChildren;
 VclPtrm_pMenu;
 
 boolm_bEnabled;
diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx 
b/accessibility/source/standard/accessiblemenubasecomponent.cxx
index e5e390d59512..4ef911dccc12 100644
--- a/accessibility/source/standard/accessiblemenubasecomponent.cxx
+++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx
@@ -54,7 +54,7 @@ OAccessibleMenuBaseComponent::OAccessibleMenuBaseComponent( 
Menu* pMenu )
 {
 if ( m_pMenu )
 {
-m_aAccessibleChildren1.assign( m_pMenu->GetItemCount(), 
rtl::Reference< OAccessibleMenuItemComponent >() );
+m_aAccessibleChildren.assign( m_pMenu->GetItemCount(), rtl::Reference< 
OAccessibleMenuItemComponent >() );
 m_pMenu->AddEventListener( LINK( this, OAccessibleMenuBaseComponent, 
MenuEventListener ) );
 }
 }
@@ -196,9 +196,9 @@ void OAccessibleMenuBaseComponent::SetChecked( bool 
bChecked )
 
 void OAccessibleMenuBaseComponent::UpdateEnabled( sal_Int32 i, bool bEnabled )
 {
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren1[i] );
+rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren[i] );
 if ( xChild.is() )
 xChild->SetEnabled( bEnabled );
 }
@@ -207,9 +207,9 @@ void OAccessibleMenuBaseComponent::UpdateEnabled( sal_Int32 
i, bool bEnabled )
 
 void OAccessibleMenuBaseComponent::UpdateFocused( sal_Int32 i, bool bFocused )
 {
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren1[i] );
+rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren[i] );
 if ( xChild.is() )
 xChild->SetFocused( bFocused );
 }
@@ -219,7 +219,7 @@ void OAccessibleMenuBaseComponent::UpdateFocused( sal_Int32 
i, bool bFocused )
 void OAccessibleMenuBaseComponent::UpdateVisible()
 {
 SetVisible( IsVisible() );
-for (const rtl::Reference& xChild : 
m_aAccessibleChildren1)
+for (const rtl::Reference& xChild : 
m_aAccessibleChildren)
 {
 if ( xChild.is() )
 xChild->SetVisible( xChild->IsVisible() );
@@ -231,9 +231,9 @@ void OAccessibleMenuBaseComponent::UpdateSelected( 
sal_Int32 i, bool bSelected )
 {
 NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() 
);
 
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren1[i] );
+rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren[i] );
 if ( xChild.is() )
 xChild->SetSelected( bSelected );
 }
@@ -242,9 +242,9 @@ void OAccessibleMenuBaseComponent::UpdateSelected( 
sal_Int32 i, bool bSelected )
 
 void OAccessibleMenuBaseComponent::UpdateChecked( sal_Int32 i, bool bChecked )
 {
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 

core.git: vcl/qa

2024-05-24 Thread Michael Weghorn (via logerrit)
 vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 87c41bbf04c361746bf9c2373aa144a02d971303
Author: Michael Weghorn 
AuthorDate: Fri May 24 06:21:30 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 08:44:29 2024 +0200

gtk3 a11y tests: Increase timeout for AT-SPI method calls

As discussed in the ESC call of 2024-05-23,
CppunitTest_vcl_gtk3_a11y fails relatively often recently:

> 38 CppunitTest_vcl_gtk3_a11ygerrit_linux_clang_dbgutil
>+ this week: have a new problem with CppunitTest_vcl_gtk3_a11y (Cloph)
>  + failure is not new, but the frequency increased recently
>  + assume: timing issue

Jenkins logs show that failures are due to running into
timeouts, example from [1]:

[...]
found run attribute: CharTopBorder=
found run attribute: CharTopBorderComplexColor=
found run attribute: MMToPixelRatio=
  matching atspi attribute is: mm-to-pixel-ratio=1.25
unknown:0:Test1::TestBody
An uncaught exception of type com.sun.star.uno.RuntimeException
- timeout from dbind at 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/vcl/qa/cppunit/a11y/atspi2/atspiwrapper.hxx:302

Increase the timeout for method calls from 2.5 to 10 seconds
in the hope that will help.
(Issue is not reproducible locally for me.)

[1] 
https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/162811/consoleFull

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

diff --git a/vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx 
b/vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx
index bcde764aa981..a0ac926c719d 100644
--- a/vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx
+++ b/vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx
@@ -80,8 +80,8 @@ public:
 if (!atspi_is_initialized())
 atspi_init();
 
-// increase timeout to avoid spurious avoid CI failures
-atspi_set_timeout(2500, 15000);
+// increase timeout to avoid spurious CI failures
+atspi_set_timeout(1, 15000);
 }
 
 virtual void setUp() override


core.git: vcl/unx

2024-05-23 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit ee168614ddea2f349e80372599296e835080f264
Author: Michael Weghorn 
AuthorDate: Thu May 23 15:39:34 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 06:25:54 2024 +0200

tdf#160971 gtk3 a11y: Manually unset focus for combobox popup

The gtk3 VCL plugin uses a custom implementation that
has a listbox in a popup (s. vcl/uiconfig/ui/combobox.ui).

The popup window gets shown when expanding the combobox, e.g.
using Alt+Up/Alt+Down while the edit has focus.

Once the popup is closed again, focus is given to the edit
again.

That one correctly reports focus when checked via
`gtk_widget_has_focus`, but for some unknown
reason, the listbox in the popup assumes/claims
it still has global keyboard focus as well, despite it no
longer being visible and the `gtk_widget_has_focus` doc [1]
explicitly mentioning:

> Determines if the widget has the global input focus.
> See gtk_widget_is_focus() for the difference between
having the global input focus, and only having the focus
> within a toplevel.

The tree view listbox still assuming focus leads to it
emitting invalid active-descendant-changed a11y events
when the selected entry changes, which e.g. breaks focus
tracking by the Orca screen reader.
As a consequence, current Orca git main
(as of commit d70919051ef01384c473e08321a88cec52549cd2)
doesn't doesn't announce the new value of e.g. the "Font Name"
combobox in the Writer toolbar when changing it via the
Up/Down arrow keys any more once the popup has been shown.
(It works fine before showing the popup for the first time.)

To avoid that problem, manually unset the focus
using `gtk_widget_send_focus_change`.
Its doc [2] mentions

> This function is not meant to be used by applications.

, but since the focus is apparently not unset
automatically, still use it as a workaround for now.

[1] https://docs.gtk.org/gtk3/method.Widget.has_focus.html
[2] https://docs.gtk.org/gtk3/method.Widget.send_focus_change.html

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index f9b087e25f4e..6e4f95dc7e3d 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -21368,6 +21368,29 @@ private:
 //is what the vcl case does, to ease the transition a little
 gtk_widget_grab_focus(m_pEntry);
 enable_notify_events();
+
+// tdf#160971: For some reason, the tree view in the no longer 
visible
+// popup still incorrectly assumes it has focus in addition to the 
now
+// actually focused entry.
+// That would cause it to send invalid active-descendant-changed 
a11y events when
+// the selected entry changes, e.g. breaking focus tracking by the 
Orca screen reader.
+// Manually unset focus to avoid that
+assert(!gtk_widget_is_visible(GTK_WIDGET(m_pTreeView)));
+const bool bTreeViewFocus = 
gtk_widget_has_focus(GTK_WIDGET(m_pTreeView));
+if (bTreeViewFocus)
+{
+SAL_WARN("vcl.gtk", "No more visible tree view in combobox 
still incorrectly "
+"claims having focus - unsetting 
manually.");
+GdkWindow* pWindow = 
gtk_widget_get_window(GTK_WIDGET(m_pTreeView));
+GdkEvent* pEvent = gdk_event_new(GDK_FOCUS_CHANGE);
+pEvent->focus_change.type = GDK_FOCUS_CHANGE;
+pEvent->focus_change.window = pWindow;
+if (pWindow)
+g_object_ref(pWindow);
+pEvent->focus_change.in = 0;
+gtk_widget_send_focus_change(GTK_WIDGET(m_pTreeView), pEvent);
+gdk_event_free(pEvent);
+}
 }
 }
 


core.git: 2 commits - android/source sw/inc

2024-05-23 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/FontController.java|   37 
++
 android/source/src/java/org/libreoffice/LOKitTileProvider.java |1 
 sw/inc/swmodule.hxx|8 +-
 3 files changed, 14 insertions(+), 32 deletions(-)

New commits:
commit 6bab5485913ca99feb00855a20171a8a770f0469
Author: Michael Weghorn 
AuthorDate: Wed May 22 13:50:24 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 23 15:53:26 2024 +0200

android: Use "compact_fonts" LibreOfficeKit option

For Android Viewer, set the "compact_fonts" LibreOfficeKit
option via environment variable `SAL_LOK_OPTIONS` introduced in

Change-Id: I3dc9f5de876def6e4afc09a43105b1740f7c621f
Author: Michael Meeks 
Date:   Fri May 17 21:25:29 2024 +0100

lok: stop amazing waste of repeated font sizes in each font element.

and adjust the handling in `FontController` to process
the flat lists for font names and sizes that is reported
with that options set, rather than processing
font sizes for each individual font.

(See also discussion in original Gerrit change
for the distro/collabora/co-24.04 branch: [1].).

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

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

diff --git a/android/source/src/java/org/libreoffice/FontController.java 
b/android/source/src/java/org/libreoffice/FontController.java
index 72f35d8b42d8..211b9d6c8b56 100644
--- a/android/source/src/java/org/libreoffice/FontController.java
+++ b/android/source/src/java/org/libreoffice/FontController.java
@@ -19,8 +19,6 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
 
 public class FontController implements AdapterView.OnItemSelectedListener {
 
@@ -32,7 +30,6 @@ public class FontController implements 
AdapterView.OnItemSelectedListener {
 private final LibreOfficeMainActivity mActivity;
 private final ArrayList mFontList = new ArrayList<>();
 private final ArrayList mFontSizes = new ArrayList<>();
-private final HashMap> mAllFontSizes = new 
HashMap<>();
 
 private String mCurrentFontSelected = null;
 private String mCurrentFontSizeSelected = null;
@@ -210,21 +207,17 @@ public class FontController implements 
AdapterView.OnItemSelectedListener {
 
 public void parseJson(String json) {
 mFontList.clear();
-mAllFontSizes.clear();
+mFontSizes.clear();
 try {
 JSONObject jObject = new JSONObject(json);
-JSONObject jObject2 = jObject.getJSONObject("commandValues");
-Iterator keys = jObject2.keys();
-ArrayList fontSizes;
-while (keys.hasNext()) {
-String key = keys.next();
-mFontList.add(key);
-JSONArray array = jObject2.getJSONArray(key);
-fontSizes = new ArrayList<>();
-for (int i = 0; i < array.length(); i++) {
-fontSizes.add(array.getString(i));
-}
-mAllFontSizes.put(key, fontSizes);
+final JSONArray fontNameArray = jObject.getJSONArray("FontNames");
+for (int i = 0; i < fontNameArray.length(); i++) {
+mFontList.add(fontNameArray.getString(i));
+}
+
+final JSONArray fontSizeArray = jObject.getJSONArray("FontSizes");
+for (int i = 0; i < fontSizeArray.length(); i++) {
+mFontSizes.add(fontSizeArray.getString(i));
 }
 } catch (JSONException e) {
 e.printStackTrace();
@@ -405,18 +398,6 @@ public class FontController implements 
AdapterView.OnItemSelectedListener {
 mCurrentFontSelected = fontName;
 spinner.setSelection(position,false);
 }
-
-resetFontSizes(fontName);
-}
-
-private void resetFontSizes(String fontName) {
-if (mAllFontSizes.get(fontName) != null) {
-mFontSizes.clear();
-mFontSizes.addAll(mAllFontSizes.get(fontName));
-Spinner spinner = mActivity.findViewById(R.id.font_size_spinner);
-ArrayAdapter arrayAdapter = 
(ArrayAdapter)spinner.getAdapter();
-arrayAdapter.notifyDataSetChanged();
-}
 }
 
 public void selectFontSize(final String fontSize) {
diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java 
b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index 5d1cf12209dc..c8a055206dd0 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -64,6 +64,7 @@ class LOKitTileProvider implements TileProvider {
 

core.git: sw/source

2024-05-22 Thread Michael Weghorn (via logerrit)
 sw/source/core/doc/tblrwcl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 554c06b2f66ff7c26df0ac29f89894fff89eecd6
Author: Michael Weghorn 
AuthorDate: Wed May 22 08:16:00 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed May 22 11:05:03 2024 +0200

sw: Change OSL_ENSURE -> assert

This fixes my local Windows/MSVC build that previously
failed like this:


C:/tools/cygwin/home/user/development/git/libreoffice/sw/source/core/doc/tblrwcl.cxx(3187):
 error C2220: the following warning is treated as an error
C:  oolsmake[1]: *** 
[C:/tools/cygwin/home/user/development/git/libreoffice/solenv/gbuild/LinkTarget.mk:338:
 
C:/tools/cygwin/home/user/development/git/libreoffice/workdir/CxxObject/sw/source/core/doc/tblrwcl.o]
 Error 2
make: *** [Makefile:294: build] Error 2

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

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index b13dc38ebcef..38c5074f0e89 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -3100,7 +3100,7 @@ bool SwTable::SetRowHeight( SwTableBox& rCurrentBox, 
TableChgWidthHeightType eTy
 for( auto n = nStt; n < nEnd; ++n )
 {
 SwLayoutFrame* pLineFrame = GetRowFrame( *(*pLines)[ n 
] );
-OSL_ENSURE( pLineFrame, "Where is the Frame from the 
SwTableLine??" );
+assert(pLineFrame && "Where is the Frame from the 
SwTableLine??");
 aParam.nMaxSpace += CalcRowRstHeight( pLineFrame );
 aParam.nMaxHeight += 
pLineFrame->getFrameArea().Height();
 }


core.git: avmedia/CustomTarget_avmediaqt6_moc.mk avmedia/Library_avmediaqt6.mk avmedia/Module_avmedia.mk avmedia/source config_host/config_vclplug.h.in config_host.mk.in configure.ac Repository.mk vcl

2024-05-21 Thread Michael Weghorn (via logerrit)
 Repository.mk  |1 
 avmedia/CustomTarget_avmediaqt6_moc.mk |   24 ++
 avmedia/Library_avmediaqt6.mk  |   44 +++
 avmedia/Module_avmedia.mk  |7 
 avmedia/source/qt6/QtManager.cxx   |   62 +
 avmedia/source/qt6/QtManager.hxx   |   33 ++
 avmedia/source/qt6/QtPlayer.cxx|  328 +
 avmedia/source/qt6/QtPlayer.hxx|   84 +++
 avmedia/source/qt6/avmediaqt.component |   16 +
 avmedia/source/qt6/gstwindow.cxx   |   12 +
 avmedia/source/viewer/mediawindow_impl.cxx |5 
 config_host.mk.in  |1 
 config_host/config_vclplug.h.in|1 
 configure.ac   |   19 +
 vcl/qt5/QtObject.cxx   |5 
 15 files changed, 641 insertions(+), 1 deletion(-)

New commits:
commit 441d8ed9be0e7f831b455a69b8688dcb79a8bc00
Author: Michael Weghorn 
AuthorDate: Mon May 20 16:25:09 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 21 17:28:04 2024 +0200

tdf#145735 avmedia qt: Use QtMultimedia for Qt 6 media playback

Similar to the way that GTK 4's native facilities for
video playback are used for the gtk4 VCL plugin, initially
added in commit

commit d0a527ec09516bc7215baf229adb90cd21ffa27a
Author: Caolán McNamara 
Date:   Thu Feb 10 12:55:18 2022 +

first cut at using Gtk4 built in video playback

, implement media playback using QtMultimedia for the
Qt 6 based VCL plugins (qt6/kf6) via a new service
"com.sun.star.comp.avmedia.Manager_Qt".

Video playback with the mechanism used for qt5 no
longer works with qt6, as "qwidget5videosink"
that gets used on Wayland for qt5 wasn't ported
to Qt 6 and is unmaintained, s. the commit message of

commit 88d57cf241209ffec9eaed3e523942ab51af6db6
Author: Michael Weghorn 
Date:   Wed Sep 29 11:09:51 2021 +0200

qt6: Add a qt6 VCL plugin

for more details. Additionally, this also doesn't work
properly any more on X11/with the xcb Qt QPA platform, see
tdf#145735 comment 7.

Instead of using GStreamer directly, let Qt handle
the low-level stuff by using the QtMultimedia module [1]
instead.

This adds a new dependency on QtMultimedia.
For building, this requires installing the Qt 6 QtMultimedia
development headers (e.g. package `qt6-multimedia-dev`
on current Debian testing).

Except for WASM, the use of QtMultimedia is enabled by
default when building with autogen options `--enable-qt6`
or `--enable-kf6`, but can explicitly be disabled using
`--disable-qt6-multimedia`.

In tests with the qt6 VCL plugin on Debian testing, with a
sample presentation containing an embedded
video, attachment 145517 from tdf#120452, video playback
generally works for both, the xcb and the wayland
Qt QPA platforms:

* Video and audio are played as expected on the external
  screen in presentation mode when using the presenter
  console
* Video and audio playback work in non-presentation
  mode by clicking on the video and using the controls
  in the Impress sidebar (play, pause,...).

However, the following issues were observed with
the current implementation:

* There's an odd frame/margin around the video.
* In non-presentation mode, the placeholder
  shown until the video gets started using the controls
  in the sidebar is just an "audio icon", not a frame
  from the actual video. (This might be related to the
  fact that `QtPlayer::createFrameGrabber` currently
  returns an empty reference.)
* At least on Wayland (issue not observed with
  QT_QPA_PLATFORM=xcb so far), when using the presenter
  console,   video playback in the presenter console (i.e. on the
  non-presentation screen) is unreliable: The video
  sometimes shows, but sometimes doesn't. At least the
  (more important) one on the presentation screen was
  reliably shown in my tests, however.

Tested with git dev versions of qtbase
(as of commit 8d5e7d50d8dbf1ad79bd8ff9f6ef6028eba481c9),
qtwayland (as of commit 6f0ebd916f176f6fbe35af28caeb52b62768ac94)
and qtmultimedia (as of commit
264b7e8d7d5683252102b5e5149685c8b8a70c2d).

[1] https://doc.qt.io/qt-6/qtmultimedia-index.html

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

diff --git a/Repository.mk b/Repository.mk
index b6ebf64dcf39..b86eb1bc5646 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -656,6 +656,7 @@ $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
 $(call 

core.git: 2 commits - vcl/inc vcl/qt5

2024-05-21 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtAccessibleEventListener.hxx |2 
 vcl/qt5/QtAccessibleEventListener.cxx |  196 ++
 2 files changed, 119 insertions(+), 79 deletions(-)

New commits:
commit 575ab78504c5082590970812e723ec01299787a2
Author: Michael Weghorn 
AuthorDate: Mon May 20 12:54:34 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 21 09:57:09 2024 +0200

qt a11y: Don't leak QAccessibleEvent

Create the `QAccessibleEvent`s passed to
`QAccessible::updateAccessibility` as local
stack variables instead of on the heap, to not leak
them, as `QAccessible::updateAccessibility` does
not take over ownership, i.e. doesn't delete them.

This is also what the example in the Qt doc [1]
does.

This fixes leaks reported by Valgrind, for example:

==104242== 416 bytes in 13 blocks are definitely lost in loss record 
23,612 of 27,514
==104242==at 0x4840F83: operator new(unsigned long) (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==104242==by 0x186F6884: 
QtAccessibleEventListener::HandleStateChangedEvent(QAccessibleInterface*, 
com::sun::star::accessibility::AccessibleEventObject const&) 
(QtAccessibleEventListener.cxx:144)
==104242==by 0x186F8478: 
QtAccessibleEventListener::notifyEvent(com::sun::star::accessibility::AccessibleEventObject
 const&) (QtAccessibleEventListener.cxx:401)
==104242==by 0x61B2756: 
comphelper::AccessibleEventNotifier::addEvent(unsigned int, 
com::sun::star::accessibility::AccessibleEventObject const&) 
(accessibleeventnotifier.cxx:256)
==104242==by 0x61ADB50: 
comphelper::OCommonAccessibleComponent::NotifyAccessibleEvent(short, 
com::sun::star::uno::Any const&, com::sun::star::uno::Any const&, int) 
(accessiblecomponenthelper.cxx:127)
==104242==by 0xBAA46FB: 
VCLXAccessibleComponent::ProcessWindowChildEvent(VclWindowEvent const&) 
(vclxaccessiblecomponent.cxx:173)
==104242==by 0xBAA4285: 
VCLXAccessibleComponent::WindowChildEventListener(VclWindowEvent&) 
(vclxaccessiblecomponent.cxx:124)
==104242==by 0xBAA3BBC: 
VCLXAccessibleComponent::LinkStubWindowChildEventListener(void*, 
VclWindowEvent&) (vclxaccessiblecomponent.cxx:114)
==104242==by 0xD56C687: Link::Call(VclWindowEvent&) const (link.hxx:111)
==104242==by 0xD56977E: vcl::Window::CallEventListeners(VclEventId, 
void*) (event.cxx:296)
==104242==by 0xD6C83A1: vcl::Window::ImplSetReallyVisible() 
(window.cxx:1328)
==104242==by 0xD6C846C: vcl::Window::ImplSetReallyVisible() 
(window.cxx:1344)

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

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

diff --git a/vcl/qt5/QtAccessibleEventListener.cxx 
b/vcl/qt5/QtAccessibleEventListener.cxx
index 4668e1585fba..ae79709fde86 100644
--- a/vcl/qt5/QtAccessibleEventListener.cxx
+++ b/vcl/qt5/QtAccessibleEventListener.cxx
@@ -140,8 +140,8 @@ void QtAccessibleEventListener::HandleStateChangedEvent(
 eEventType = QAccessible::ObjectShow;
 else
 eEventType = QAccessible::ObjectHide;
-QAccessible::updateAccessibility(
-new QAccessibleEvent(pQAccessibleInterface, eEventType));
+QAccessibleEvent aEvent(pQAccessibleInterface, eEventType);
+QAccessible::updateAccessibility();
 break;
 }
 // These don't seem to have a matching Qt equivalent
@@ -160,8 +160,8 @@ void QtAccessibleEventListener::HandleStateChangedEvent(
 return;
 }
 
-QAccessible::updateAccessibility(
-new QAccessibleStateChangeEvent(pQAccessibleInterface, aState));
+QAccessibleStateChangeEvent aEvent(pQAccessibleInterface, aState);
+QAccessible::updateAccessibility();
 }
 
 void QtAccessibleEventListener::notifyEvent(const 
css::accessibility::AccessibleEventObject& rEvent)
@@ -171,17 +171,23 @@ void QtAccessibleEventListener::notifyEvent(const 
css::accessibility::Accessible
 switch (rEvent.EventId)
 {
 case AccessibleEventId::NAME_CHANGED:
-QAccessible::updateAccessibility(
-new QAccessibleEvent(pQAccessibleInterface, 
QAccessible::NameChanged));
+{
+QAccessibleEvent aEvent(pQAccessibleInterface, 
QAccessible::NameChanged);
+QAccessible::updateAccessibility();
 return;
+}
 case AccessibleEventId::DESCRIPTION_CHANGED:
-QAccessible::updateAccessibility(
-new QAccessibleEvent(pQAccessibleInterface, 
QAccessible::DescriptionChanged));
+{
+QAccessibleEvent aEvent(pQAccessibleInterface, 
QAccessible::DescriptionChanged);
+QAccessible::updateAccessibility();
 return;
+}
 

core.git: avmedia/Library_avmediagtk.mk

2024-05-20 Thread Michael Weghorn (via logerrit)
 avmedia/Library_avmediagtk.mk |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit ba41718095a790e2a39d569f5cdd9006c5169545
Author: Michael Weghorn 
AuthorDate: Mon May 20 10:28:05 2024 +0200
Commit: Michael Weghorn 
CommitDate: Mon May 20 15:22:49 2024 +0200

avmediagtk: Use gb_Library_set_include for GTK4_CFLAGS

In the same way that `vcl/Library_vclplug_gtk4.mk` does
it, set the `GTK4_CFLAGS` (which have the includes) via
`gb_Library_set_include`, not `gb_Library_add_cxxflags`.

This makes sure that they end up in the `INCLUDE`
section in `workdir/GbuildToJson/Library/libavmediagtk.so`
and thus end up in the IDE integrations as includes,
which makes Qt Creator's Clang Code Model  find them
instead of showing an error
("gtkplayer.cxx:28:10: 'gtk/gtk.h' file not found").

See also this similar commit for more details:

commit 6a53832080cf201e960113de8e1887d99e857606
Author: Michael Weghorn 
Date:   Mon Dec 17 15:35:58 2018 +0100

Use 'gb_Library_set_include' for GTK3_CFLAGS

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

diff --git a/avmedia/Library_avmediagtk.mk b/avmedia/Library_avmediagtk.mk
index 08d30d3259dc..4e7fc1c50f77 100644
--- a/avmedia/Library_avmediagtk.mk
+++ b/avmedia/Library_avmediagtk.mk
@@ -13,16 +13,13 @@ $(eval $(call 
gb_Library_set_componentfile,avmediagtk,avmedia/source/gtk/avmedia
 
 $(eval $(call gb_Library_set_include,avmediagtk,\
$$(INCLUDE) \
+   $$(GTK4_CFLAGS) \
-I$(SRCDIR)/avmedia/source/inc \
-I$(SRCDIR)/avmedia/source/gstreamer \
 ))
 
 $(eval $(call gb_Library_use_external,avmediagtk,boost_headers))
 
-$(eval $(call gb_Library_add_cxxflags,avmediagtk,\
-$$(GTK4_CFLAGS) \
-))
-
 $(eval $(call gb_Library_use_sdk_api,avmediagtk))
 
 $(eval $(call gb_Library_use_libraries,avmediagtk,\


core.git: Branch 'libreoffice-24-2' - vcl/qt5

2024-05-18 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtFrame.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 9497be2e668c19aedc588588bf9dfed9338afe54
Author: Michael Weghorn 
AuthorDate: Fri May 17 17:02:49 2024 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat May 18 15:17:40 2024 +0200

tdf#160565 tdf#145735 qt: Avoid native window handles for Qt 6

Similar to the tdf#122293 scenario with Qt 5 on Wayland,
using native windows causes unresponsive UI even with
the xcb Qt QPA plugin when using Qt 6.

Therefore, don't call `QWidget::winId()` at all when
using Qt 6, but just refuse to resolve a native window
handle, the same way that is already done here for the
wayland Qt QPA plugin with qt5.

Add a comment based on the one originally added with

commit 0e3c3b842e14b9646d3697cf1266be21359e0f13
Author: Michael Weghorn 
Date:   Sat May 11 21:31:33 2019 +0200

tdf#122293 qt5: Use "alien widgets" by default on Wayland

that was later dropped during a refactoring.

This code path is triggered when trying to resolve the
parent window for a file picker (s. `QtFilePicker::initialize`).
In a quick test in a KDE Plasma 5 Wayland session on Debian testing,
the modality behavior was unchanged with or without this change in
place:

* With qt6 xcb, the main window nicely gets grayed out and is
  unresponsive while the file dialog gets shown  when using
  e.g. "File" -> "Open" in Writer.

* With qt6 wayland, the main window is not grayed out and looks
  more "active" still, but doesn't actually accept keyboard
  or mouse input.

This is basically the same in other Qt/KDE applications, e.g.
a self-compiled Kate from git master, so not LO-specific.

If resolving the parent for the file picker turns out to be necessary,
maybe something similar to what commit

commit 3ff4800fe400de916c97f587322104af06cc0879
Author: Caolán McNamara 
Date:   Wed Apr 4 10:22:34 2018 +0100

weld SvInsertOleDlg

and

weld SfxInsertFloatingFrameDialog

and smuggle in the parent widget for the Gtk File dialog via
an XWindow interface

did for gtk3 might be worth looking into.

However, I can at least not reproduce issues like the one described
for gtk3 in

commit 203d96787969f707c78101be18d51b44ace98f93
Author: Caolán McNamara 
Date:   Mon Jun 21 13:01:52 2021 +0100

give folderpicker an optional parent

so, like a file picker, it can make its parent modal while its
operating. Otherwise its possible to interact with the parent 
dialog in
undesirable ways, e.g. file, export as, export as epub, the folder
picker of 'media directory'

with the qt6 VCL plugin even with this commit in place.

Another scenario relying on a native window handle is video
playback with GStreamer's x11 video sink.

That still works for qt5 with the xcb plugin as the handle is
still returned for that one.

For qt6 with the xcb plugin, that didn't work properly
without this commit either (at least not in my tests with
current qtbase dev as of commit
70a2e7f32b9f9ce19d1538f14fbde7b0d1e77ffd), s.
tdf#145735 comment 7.
It's now broken a different way than before
(extra windows show up instead of no video being shown).
This will be further tracked together with a solution for
Wayland in tdf#125219.

As a side note, forcing native windows for everything
using `QT_USE_NATIVE_WINDOWS=1` as described at [1]
causes more sever brokenness with the qt6 xcb plugin
(mostly black window in Writer instead of showing the
actual content).

[1] https://doc.qt.io/qt-6/qwidget.html#native-widgets-vs-alien-widgets

Change-Id: I9718c680bd8bc4ff0574f171403d965c1beac781
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167783
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit 2f4103da5625a9b90eb41d5c767a248a8d0b4255)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167813
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 6aff814aacd2..1c3839a287d9 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -35,6 +35,7 @@
 #include 
 #endif
 
+#include 
 #include 
 #include 
 #include 
@@ -1339,8 +1340,17 @@ void QtFrame::ResolveWindowHandle(SystemEnvData& rData) 
const
 if (!rData.pWidget)
 return;
 assert(rData.platform != SystemEnvData::Platform::Invalid);
-if (rData.platform != SystemEnvData::Platform::Wayland)
+// Calling QWidget::winId() implicitly enables native windows to be used 
instead
+// of "alien widgets" that don't have a native widget 

core.git: 3 commits - vcl/qt5

2024-05-17 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtFrame.cxx |   28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 2f4103da5625a9b90eb41d5c767a248a8d0b4255
Author: Michael Weghorn 
AuthorDate: Fri May 17 17:02:49 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat May 18 06:55:31 2024 +0200

tdf#160565 tdf#145735 qt: Avoid native window handles for Qt 6

Similar to the tdf#122293 scenario with Qt 5 on Wayland,
using native windows causes unresponsive UI even with
the xcb Qt QPA plugin when using Qt 6.

Therefore, don't call `QWidget::winId()` at all when
using Qt 6, but just refuse to resolve a native window
handle, the same way that is already done here for the
wayland Qt QPA plugin with qt5.

Add a comment based on the one originally added with

commit 0e3c3b842e14b9646d3697cf1266be21359e0f13
Author: Michael Weghorn 
Date:   Sat May 11 21:31:33 2019 +0200

tdf#122293 qt5: Use "alien widgets" by default on Wayland

that was later dropped during a refactoring.

This code path is triggered when trying to resolve the
parent window for a file picker (s. `QtFilePicker::initialize`).
In a quick test in a KDE Plasma 5 Wayland session on Debian testing,
the modality behavior was unchanged with or without this change in
place:

* With qt6 xcb, the main window nicely gets grayed out and is
  unresponsive while the file dialog gets shown  when using
  e.g. "File" -> "Open" in Writer.

* With qt6 wayland, the main window is not grayed out and looks
  more "active" still, but doesn't actually accept keyboard
  or mouse input.

This is basically the same in other Qt/KDE applications, e.g.
a self-compiled Kate from git master, so not LO-specific.

If resolving the parent for the file picker turns out to be necessary,
maybe something similar to what commit

commit 3ff4800fe400de916c97f587322104af06cc0879
Author: Caolán McNamara 
Date:   Wed Apr 4 10:22:34 2018 +0100

weld SvInsertOleDlg

and

weld SfxInsertFloatingFrameDialog

and smuggle in the parent widget for the Gtk File dialog via
an XWindow interface

did for gtk3 might be worth looking into.

However, I can at least not reproduce issues like the one described
for gtk3 in

commit 203d96787969f707c78101be18d51b44ace98f93
Author: Caolán McNamara 
Date:   Mon Jun 21 13:01:52 2021 +0100

give folderpicker an optional parent

so, like a file picker, it can make its parent modal while its
operating. Otherwise its possible to interact with the parent 
dialog in
undesirable ways, e.g. file, export as, export as epub, the folder
picker of 'media directory'

with the qt6 VCL plugin even with this commit in place.

Another scenario relying on a native window handle is video
playback with GStreamer's x11 video sink.

That still works for qt5 with the xcb plugin as the handle is
still returned for that one.

For qt6 with the xcb plugin, that didn't work properly
without this commit either (at least not in my tests with
current qtbase dev as of commit
70a2e7f32b9f9ce19d1538f14fbde7b0d1e77ffd), s.
tdf#145735 comment 7.
It's now broken a different way than before
(extra windows show up instead of no video being shown).
This will be further tracked together with a solution for
Wayland in tdf#125219.

As a side note, forcing native windows for everything
using `QT_USE_NATIVE_WINDOWS=1` as described at [1]
causes more sever brokenness with the qt6 xcb plugin
(mostly black window in Writer instead of showing the
actual content).

[1] https://doc.qt.io/qt-6/qwidget.html#native-widgets-vs-alien-widgets

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

diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 0ff940408769..0950b520cb77 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -35,6 +35,7 @@
 #include 
 #endif
 
+#include 
 #include 
 #include 
 #include 
@@ -1355,8 +1356,17 @@ void QtFrame::ResolveWindowHandle(SystemEnvData& rData) 
const
 if (!rData.pWidget)
 return;
 assert(rData.platform != SystemEnvData::Platform::Invalid);
-if (rData.platform != SystemEnvData::Platform::Wayland)
+// Calling QWidget::winId() implicitly enables native windows to be used 
instead
+// of "alien widgets" that don't have a native widget asscoiated with them,
+// s. https://doc.qt.io/qt-6/qwidget.html#native-widgets-vs-alien-widgets
+// Avoid native widgets with Qt 5 on Wayland and with Qt 6 

core.git: Branch 'libreoffice-24-2' - android/README.md android/source

2024-05-16 Thread Michael Weghorn (via logerrit)
 android/README.md |   14 ++
 android/source/src/main/play/listings/en-US/graphics/icon.png |1 
 2 files changed, 15 insertions(+)

New commits:
commit 6460b76852b69f428ed26aba3877e9853ec22555
Author: Michael Weghorn 
AuthorDate: Thu May 16 09:26:44 2024 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu May 16 21:45:49 2024 +0200

tdf#157009 android: Add icon symlink for F-Droid

Add a symlink to the app icon at the expected
location when using the Triple-T data structure
that can be used to provide metadata for F-Droid. [1]

As Android Viewer currently uses a non-default directory layout,
this currently needs to be placed in a different subdirectory than
the actual source code in order for F-Droid to find it, see the
discussion in [2] for more details.

This should cause the app icon to show up in F-Droid
after the next update.

[1] 
https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#triple-t-structure
[2] 
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/13643#note_153683

Change-Id: Ic1a987e430b6e92134ac19d7f1c264953cd3cf0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167732
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit 69189de8fa9a9d4973a4304a82780d32e79fbe6f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167679
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/android/README.md b/android/README.md
index 919122df38d1..186208c3e118 100644
--- a/android/README.md
+++ b/android/README.md
@@ -310,3 +310,17 @@ Anyway, our current "experimental" apps are not based on 
`NativeActivity`.
 They have normal Java code for the activity, and just call out to a single,
 app-specific native library (called `liblo-native-code.so`) to do all the
 heavy lifting.
+
+## Triple-T metadata for F-Droid
+
+The subdirectory `source/src/main/play` contains data in the Triple-T
+structure that F-Droid evaluates to extract metadata.
+
+More information:
+
+
+As Android Viewer currently uses a non-default directory layout,
+this currently needs to be placed in a different subdirectory than
+the actual source code in order for F-Droid to find it, see the
+[related 
discussion]()
+for more details.
diff --git a/android/source/src/main/play/listings/en-US/graphics/icon.png 
b/android/source/src/main/play/listings/en-US/graphics/icon.png
new file mode 12
index ..f3e316efb456
--- /dev/null
+++ b/android/source/src/main/play/listings/en-US/graphics/icon.png
@@ -0,0 +1 @@
+../../../../../../ic_launcher-web.png
\ No newline at end of file


core.git: 2 commits - android/source instsetoo_native/inc_ooohelppack instsetoo_native/inc_openoffice instsetoo_native/inc_sdkoo solenv/bin

2024-05-16 Thread Michael Weghorn (via logerrit)
 android/source/build.gradle |4 -
 android/source/src/java/org/libreoffice/LibreOfficeApplication.java |4 -
 instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt |   18 
+++---
 instsetoo_native/inc_ooohelppack/windows/msi_templates/_Validat.idt |1 
 instsetoo_native/inc_openoffice/windows/msi_templates/CustomAc.idt  |   26 
+-
 instsetoo_native/inc_openoffice/windows/msi_templates/_Validat.idt  |1 
 instsetoo_native/inc_sdkoo/windows/msi_templates/CustomAc.idt   |   16 
+++---
 instsetoo_native/inc_sdkoo/windows/msi_templates/_Validat.idt   |1 
 solenv/bin/modules/installer/windows/idtglobal.pm   |4 -
 9 files changed, 37 insertions(+), 38 deletions(-)

New commits:
commit 86050dc7c72b98cf7af98d78e664965c9d9bb383
Author: Michael Weghorn 
AuthorDate: Thu May 16 10:35:39 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 15:13:20 2024 +0200

android: Disable multidex, only needed for minSdkVersion < 21

multidex was enabled in

commit 037680488b56aa2c4eb21900168aa88ef35d5b07
Author: Michael Weghorn 
Date:   Tue Dec 27 12:51:54 2022 +0100

android: Enable multidex, update com.google.android.material to 
1.7.0

as it was needed when building for minSdkVersion <= 20, see [1]
and the full commit message of the above-mentioned commit
for more details.

However, since

commit c2fc2c8c7c63ca4e43bca6e8c9b82c50418422d2
Author: Michael Weghorn 
Date:   Tue Dec 5 09:57:22 2023 +0100

android: Bump minSdkVersion to 21 (Android 5.0)

, the minSdkVersion is greater than that, so this
is no longer needed.

[1] https://developer.android.com/build/multidex

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

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 6428a0ffcfda..8aa3d2dbf9c6 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -34,7 +34,6 @@ dependencies {
 ])
 implementation 'com.google.android.material:material:1.12.0'
 implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
-implementation "androidx.multidex:multidex:2.0.1"
 implementation 'androidx.preference:preference:1.2.1'
 }
 
@@ -60,9 +59,6 @@ android {
 defaultConfig {
 // minSdkVersion is set in liboSettings.gradle
 targetSdkVersion 34
-// multidex needed when > 65,536 methods referenced with minSdKVersion 
< 21
-// s. https://developer.android.com/studio/build/multidex
-multiDexEnabled true
 vectorDrawables.useSupportLibrary = true
 }
 buildTypes {
diff --git 
a/android/source/src/java/org/libreoffice/LibreOfficeApplication.java 
b/android/source/src/java/org/libreoffice/LibreOfficeApplication.java
index 3b03c83adda9..77f1af493b0e 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeApplication.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeApplication.java
@@ -10,11 +10,11 @@
 
 package org.libreoffice;
 
+import android.app.Application;
 import android.content.Context;
 import android.os.Handler;
-import androidx.multidex.MultiDexApplication;
 
-public class LibreOfficeApplication extends MultiDexApplication {
+public class LibreOfficeApplication extends Application {
 
 private static Handler mainHandler;
 
commit bf06fee9fccd361fecc106eafc587b1c8a88
Author: kubak 
AuthorDate: Wed May 1 09:59:14 2024 +0200
Commit: Mike Kaganski 
CommitDate: Thu May 16 15:13:09 2024 +0200

MSI: Adds the missing ExtendedType column in the CustomAction table

ICE06 WARNING Column: ExtendedType of Table: CustomAction is not defined in 
database.

https: //learn.microsoft.com/en-us/windows/win32/msi/ice06
https: //learn.microsoft.com/en-us/windows/win32/msi/customaction-table

Change-Id: I5f9368fedf421b23a397f5dcd77f383cb9f42ac5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166951
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git 
a/instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt 
b/instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt
index aaf07ca28d96..80f0a0ad043a 100644
--- a/instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt
+++ b/instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt
@@ -1,10 +1,10 @@
-Action TypeSource  Target
-s72i2  S64 S255
+Action TypeSource  Target  ExtendedType
+s72i2  S72 S255I4
 CustomAction   Action
-setAllUsersProfile2K   51  ALLUSERSPROFILE [%ALLUSERSPROFILE]
-SetAllUsersProfileNT   51  ALLUSERSPROFILE [%SystemRoot]\Profiles\All Users
-setUserProfileNT   51  USERPROFILE 

core.git: 2 commits - android/README.md android/source

2024-05-16 Thread Michael Weghorn (via logerrit)
 android/README.md |   14 +
 android/source/lint-baseline.xml  |   72 --
 android/source/src/main/play/listings/en-US/graphics/icon.png |1 
 3 files changed, 18 insertions(+), 69 deletions(-)

New commits:
commit 69189de8fa9a9d4973a4304a82780d32e79fbe6f
Author: Michael Weghorn 
AuthorDate: Thu May 16 09:26:44 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 12:14:04 2024 +0200

tdf#157009 android: Add icon symlink for F-Droid

Add a symlink to the app icon at the expected
location when using the Triple-T data structure
that can be used to provide metadata for F-Droid. [1]

As Android Viewer currently uses a non-default directory layout,
this currently needs to be placed in a different subdirectory than
the actual source code in order for F-Droid to find it, see the
discussion in [2] for more details.

This should cause the app icon to show up in F-Droid
after the next update.

[1] 
https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#triple-t-structure
[2] 
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/13643#note_153683

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

diff --git a/android/README.md b/android/README.md
index 919122df38d1..186208c3e118 100644
--- a/android/README.md
+++ b/android/README.md
@@ -310,3 +310,17 @@ Anyway, our current "experimental" apps are not based on 
`NativeActivity`.
 They have normal Java code for the activity, and just call out to a single,
 app-specific native library (called `liblo-native-code.so`) to do all the
 heavy lifting.
+
+## Triple-T metadata for F-Droid
+
+The subdirectory `source/src/main/play` contains data in the Triple-T
+structure that F-Droid evaluates to extract metadata.
+
+More information:
+
+
+As Android Viewer currently uses a non-default directory layout,
+this currently needs to be placed in a different subdirectory than
+the actual source code in order for F-Droid to find it, see the
+[related 
discussion]()
+for more details.
diff --git a/android/source/src/main/play/listings/en-US/graphics/icon.png 
b/android/source/src/main/play/listings/en-US/graphics/icon.png
new file mode 12
index ..f3e316efb456
--- /dev/null
+++ b/android/source/src/main/play/listings/en-US/graphics/icon.png
@@ -0,0 +1 @@
+../../../../../../ic_launcher-web.png
\ No newline at end of file
commit e63fa1ab17a082b14927079cfc04843061024947
Author: Michael Weghorn 
AuthorDate: Thu May 16 09:07:30 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 12:13:57 2024 +0200

android lint: Udate lint-baseline.xml

Some of the issues have been addressed in
the meanwhile, so regenerate the file to
reflect that.

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

diff --git a/android/source/lint-baseline.xml b/android/source/lint-baseline.xml
index d973b4c4b078..d78cdfca6bd4 100644
--- a/android/source/lint-baseline.xml
+++ b/android/source/lint-baseline.xml
@@ -8,7 +8,7 @@
 errorLine2="   
~">
 
 
 
@@ -67,17 +67,6 @@
 column="25"/>
 
 
-
-
-
-
 
 
 
-
-
-
-
 
 
 
-https://g.co/dev/packagevisibility for details"
-errorLine1="if 
(takePictureIntent.resolveActivity(mContext.getPackageManager()) != null) {"
-errorLine2="  ~~~">
-
-
-
-https://g.co/dev/packagevisibility for details"
-errorLine1="
.queryIntentActivities(takePictureIntent, PackageManager.MATCH_DEFAULT_ONLY);"
-errorLine2=" ~">
-
-
-
-
-
-
-
-
-
-
-
 
 
 
 
@@ -1436,7 +1370,7 @@
 errorLine2="
~~">
 
 
 


  1   2   3   4   5   6   7   8   9   10   >