[Libreoffice-commits] core.git: 3 commits - sc/source sd/source vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Mar 24 19:43:13 UTC 2021
sc/source/filter/lotus/lotimpop.cxx | 36 ++++++++++++++
sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx | 10 ---
sd/source/ui/inc/AccessibleDocumentViewBase.hxx | 5 -
vcl/unx/gtk3/a11y/atkwrapper.hxx | 1
vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx | 28 ++++++++++
5 files changed, 65 insertions(+), 15 deletions(-)
New commits:
commit 1bc297cb63e52b5cad3580ac5a3cb274c6dfcf66
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Mar 24 09:30:18 2021 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Mar 24 20:41:58 2021 +0100
cid#1474363 Untrusted value as argument
and...
cid#1474164 Untrusted value as argument
cid#1474033 Untrusted value as argument
cid#1473968 Untrusted value as argument
cid#1473922 Untrusted value as argument
cid#1473817 Untrusted value as argument
Change-Id: I19d3b758767c2b0cb4369257efbe477c37f231ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113027
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index 78ff31f824ef..1fa5c14632e7 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -173,6 +173,12 @@ void ImportLotus::Errcell()
Read( aA );
+ if (!rD.ValidAddress(aA))
+ {
+ SAL_WARN("sc.filter", "invalid address");
+ return;
+ }
+
ScSetStringParam aParam;
aParam.setTextInput();
rD.EnsureTable(aA.Tab());
@@ -185,6 +191,12 @@ void ImportLotus::Nacell()
Read( aA );
+ if (!rD.ValidAddress(aA))
+ {
+ SAL_WARN("sc.filter", "invalid address");
+ return;
+ }
+
ScSetStringParam aParam;
aParam.setTextInput();
rD.EnsureTable(aA.Tab());
@@ -201,6 +213,12 @@ void ImportLotus::Labelcell()
Read( cAlign );
Read( aLabel );
+ if (!rD.ValidAddress(aA))
+ {
+ SAL_WARN("sc.filter", "invalid address");
+ return;
+ }
+
ScSetStringParam aParam;
aParam.setTextInput();
rD.EnsureTable(aA.Tab());
@@ -215,6 +233,12 @@ void ImportLotus::Numbercell()
Read( aAddr );
Read( fVal );
+ if (!rD.ValidAddress(aAddr))
+ {
+ SAL_WARN("sc.filter", "invalid address");
+ return;
+ }
+
rD.EnsureTable(aAddr.Tab());
rD.SetValue(aAddr, fVal);
}
@@ -227,6 +251,12 @@ void ImportLotus::Smallnumcell()
Read( aAddr );
Read( nVal );
+ if (!rD.ValidAddress(aAddr))
+ {
+ SAL_WARN("sc.filter", "invalid address");
+ return;
+ }
+
rD.EnsureTable(aAddr.Tab());
rD.SetValue(aAddr, SnumToDouble(nVal));
}
@@ -251,6 +281,12 @@ void ImportLotus::Formulacell( sal_uInt16 n )
if (!aConv.good())
return;
+ if (!rD.ValidAddress(aAddr))
+ {
+ SAL_WARN("sc.filter", "invalid address");
+ return;
+ }
+
ScFormulaCell* pCell = pErg ? new ScFormulaCell(rD, aAddr, std::move(pErg)) : new ScFormulaCell(rD, aAddr);
pCell->AddRecalcMode( ScRecalcMode::ONLOAD_ONCE );
rD.EnsureTable(aAddr.Tab());
commit c72a00868cd13be911798d2c508c10b6367606ab
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Mar 23 13:13:37 2021 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Mar 24 20:39:29 2021 +0100
Related: tdf#135363 don't keep a reference to the vcl::Window
in fact, why keep a VclPtr reference to that window at all
Change-Id: I3f0511b41434cba744a63d4a9e185c97a6cef5e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112992
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index a819ca19b3e4..2e198ba8827e 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -66,7 +66,6 @@ AccessibleDocumentViewBase::AccessibleDocumentViewBase (
pViewShell->GetDoc()->GetDocumentType() == DocumentType::Impress ?
AccessibleRole::DOCUMENT_PRESENTATION :
AccessibleRole::DOCUMENT),
- mpWindow (pSdWindow),
mxController (rxController),
maViewForwarder (
static_cast<SdrPaintView*>(pViewShell->GetView()),
@@ -88,17 +87,10 @@ AccessibleDocumentViewBase::AccessibleDocumentViewBase (
mpViewShell = pViewShell;
}
-void AccessibleDocumentViewBase::ReleaseWindow()
-{
- SolarMutexGuard g;
- mpWindow.reset();
-}
-
AccessibleDocumentViewBase::~AccessibleDocumentViewBase()
{
// At this place we should be disposed. You may want to add a
// corresponding assertion into the destructor of a derived class.
- ReleaseWindow(); // this should already be done by impl_dispose
}
void AccessibleDocumentViewBase::Init()
@@ -488,8 +480,6 @@ void AccessibleDocumentViewBase::impl_dispose()
mxController = nullptr;
maShapeTreeInfo.SetDocumentWindow (nullptr);
-
- ReleaseWindow(); // tdf#135364 - ensure the window is released by dispose
}
//===== XEventListener ======================================================
diff --git a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx
index efaeda0cc9b2..9fd7f02d92fc 100644
--- a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx
+++ b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx
@@ -238,12 +238,7 @@ private:
virtual void
implSelect( sal_Int32 nAccessibleChildIndex, bool bSelect ) override;
- void ReleaseWindow();
-
protected:
- /// The core window that is made accessible.
- VclPtr< ::sd::Window> mpWindow;
-
/// The API window that is made accessible.
css::uno::Reference< css::awt::XWindow>
mxWindow;
commit 305c6fee0be4db38023d9ca5f7915e443e0bc1fc
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Mar 24 11:33:42 2021 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Mar 24 20:36:52 2021 +0100
tdf#141197 if we have a sysobj child then include that in the atk hierarchy
this also should make the case of an embedded video visible in the atk
hierarchy as well as the target of the native gtk widgets in a vcl
window container in the startcenter
Change-Id: Ia91439cbccbffbb0badbfb466f7ab6d1ccbfe3ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113033
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/a11y/atkwrapper.hxx b/vcl/unx/gtk3/a11y/atkwrapper.hxx
index 3b9e5bd03c1b..b892b8979d8e 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.hxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.hxx
@@ -50,6 +50,7 @@ struct AtkObjectWrapper
{
AtkObject aParent;
AtkObject* mpOrig; //if we're a GtkDrawingArea acting as a custom LibreOffice widget, this is the toolkit default impl
+ AtkObject* mpSysObjChild; //if we're a container for a sysobj, then this is the sysobj native gtk AtkObject
css::uno::Reference<css::accessibility::XAccessible> mpAccessible;
css::uno::Reference<css::accessibility::XAccessibleContext> mpContext;
diff --git a/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx b/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx
index cbce84b09fd1..1d53043f3d2b 100644
--- a/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx
@@ -40,10 +40,14 @@
#include <com/sun/star/accessibility/XAccessibleImage.hpp>
#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
#include <rtl/strbuf.hxx>
#include <osl/diagnose.h>
#include <tools/diagnose_ex.h>
+#include <vcl/syschild.hxx>
+#include <vcl/sysdata.hxx>
+#include <vcl/toolkit/unowrap.hxx>
#include "atkwrapper.hxx"
#include "atkregistry.hxx"
@@ -407,6 +411,10 @@ static gint
wrapper_get_n_children( AtkObject *atk_obj )
{
AtkObjectWrapper *obj = ATK_OBJECT_WRAPPER (atk_obj);
+
+ if (obj->mpSysObjChild)
+ return 1;
+
gint n = 0;
if( obj->mpContext.is() )
@@ -429,6 +437,13 @@ wrapper_ref_child( AtkObject *atk_obj,
gint i )
{
AtkObjectWrapper *obj = ATK_OBJECT_WRAPPER (atk_obj);
+
+ if (obj->mpSysObjChild)
+ {
+ g_object_ref(obj->mpSysObjChild);
+ return obj->mpSysObjChild;
+ }
+
AtkObject* child = nullptr;
// see comments above atk_object_wrapper_remove_child
@@ -875,6 +890,19 @@ atk_object_wrapper_new( const css::uno::Reference< css::accessibility::XAccessib
}
}
+ // tdf#141197 if we have a sysobj child then include that in the hierarchy
+ if (UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper())
+ {
+ css::uno::Reference<css::awt::XWindow> xAWTWindow(rxAccessible, css::uno::UNO_QUERY);
+ VclPtr<vcl::Window> xWindow = pWrapper->GetWindow(xAWTWindow);
+ if (xWindow && xWindow->GetType() == WindowType::SYSTEMCHILDWINDOW)
+ {
+ const SystemEnvData* pEnvData = static_cast<SystemChildWindow*>(xWindow.get())->GetSystemData();
+ if (GtkWidget *pSysObj = pEnvData ? static_cast<GtkWidget*>(pEnvData->pWidget) : nullptr)
+ pWrap->mpSysObjChild = gtk_widget_get_accessible(pSysObj);
+ }
+ }
+
return ATK_OBJECT( pWrap );
}
catch (const uno::Exception &)
More information about the Libreoffice-commits
mailing list