pyuno/qa/pytests/embindtest.py | 2 +- pyuno/source/module/pyuno.cxx | 16 ++++++++++++++++ unotest/source/embindtest/embindtest.cxx | 6 +----- vcl/null/printerinfomanager.cxx | 5 +++-- 4 files changed, 21 insertions(+), 8 deletions(-)
New commits: commit a5ea77b0417113068609f363cfd07ab919bc506e Author: Stephan Bergmann <[email protected]> AuthorDate: Thu Dec 11 11:27:10 2025 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Thu Dec 11 21:24:34 2025 +0100 Avoid loplugin:stringviewparam Change-Id: I36c7f954e7e63cf46b5cbcba16c99dadb3ca0c56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195441 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx index 55d81e65a2f4..6d50607922e8 100644 --- a/vcl/null/printerinfomanager.cxx +++ b/vcl/null/printerinfomanager.cxx @@ -70,7 +70,8 @@ void PrinterInfoManager::listPrinters( ::std::vector< OUString >& rVector ) cons rVector.clear(); } -const PrinterInfo& PrinterInfoManager::getPrinterInfo( const OUString& /* rPrinter */ ) const +const PrinterInfo& PrinterInfoManager::getPrinterInfo( + [[maybe_unused]] const OUString& /* rPrinter */ ) const { static PrinterInfo aEmptyInfo; @@ -79,7 +80,7 @@ const PrinterInfo& PrinterInfoManager::getPrinterInfo( const OUString& /* rPrint return aEmptyInfo; } -bool PrinterInfoManager::checkFeatureToken( const OUString& /* rPrinterName */, std::string_view /* pToken */ ) const +bool PrinterInfoManager::checkFeatureToken( [[maybe_unused]] const OUString& /* rPrinterName */, [[maybe_unused]] std::string_view /* pToken */ ) const { (void) this; commit 82413eb1f95a6f384bb12a5ad7a22602ff7b1a1a Author: Stephan Bergmann <[email protected]> AuthorDate: Wed Dec 10 17:09:20 2025 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Thu Dec 11 21:24:20 2025 +0100 Improve PyUNO_cmp ...for cases where one operand is a PyUNO Adapter of the other (i.e., one operand is a Python object that got passed out and back in again, and the other operand is that same Python object). This fixes the second "TODO" from 1e2e9a20a4190140e32e6996ea5fd6c22c71e55f "More exhaustive testing of PyUNO type mapping based on embindtest". Change-Id: I0fc938db5c464ed56adee3b428537925fff0fc81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195392 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/pyuno/qa/pytests/embindtest.py b/pyuno/qa/pytests/embindtest.py index 783594a4cbd5..f0d60724eba0 100644 --- a/pyuno/qa/pytests/embindtest.py +++ b/pyuno/qa/pytests/embindtest.py @@ -226,7 +226,7 @@ class Test(unohelper.Base, XTest): return uno.Any('org.libreoffice.embindtest.XTest', self) def isAnyInterface(self, value): - return value == self #TODO: this doesn't work as intended + return value == self def getEnum(self): return E_2 diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx index c2faf016e383..abac37eecf08 100644 --- a/pyuno/source/module/pyuno.cxx +++ b/pyuno/source/module/pyuno.cxx @@ -1518,6 +1518,22 @@ static PyObject* PyUNO_cmp( PyObject *self, PyObject *that, int op ) } } } + else if (PyObject_IsInstance( + that, getClass(u"com.sun.star.uno.XInterface"_ustr, runtime).get())) + { + // `self` could be an Adapter of `that`: + if (css::uno::Reference<css::lang::XUnoTunnel> tunnel; + reinterpret_cast<PyUNO *>(self)->members->wrappedObject >>= tunnel) + { + if (auto const adapter = comphelper::getFromUnoTunnel<Adapter>(tunnel)) { + if (adapter->getWrappedObject().get() == that) { + result = (op == Py_EQ ? Py_True : Py_False); + Py_INCREF(result); + return result; + } + } + } + } } catch( const css::uno::RuntimeException & e) { diff --git a/unotest/source/embindtest/embindtest.cxx b/unotest/source/embindtest/embindtest.cxx index b24022e60ee5..32673aa00d47 100644 --- a/unotest/source/embindtest/embindtest.cxx +++ b/unotest/source/embindtest/embindtest.cxx @@ -450,11 +450,7 @@ void doExecuteTest(css::uno::Reference<org::libreoffice::embindtest::XTest> cons auto const val = test->getAnyInterface(); verify(checkAnyInterface(val, test)); bool const ok = test->isAnyInterface(val); - //TODO: Test.isAnyInterface in pyuno/qa/pytests/embindtest.py doesn't work as intended: - if (ok) - { - verify(ok); - } + verify(ok); } { auto const val = test->getSequenceBoolean();
