sc/source/ui/inc/duplicaterecordsdlg.hxx | 6 ++++++ unoxml/source/dom/documentbuilder.cxx | 17 +++++++++++++---- unoxml/source/dom/documentbuilder.hxx | 8 +------- 3 files changed, 20 insertions(+), 11 deletions(-)
New commits: commit 8e02696b32588e3a1eca3885450873f62213244e Author: Caolán McNamara <[email protected]> AuthorDate: Fri Sep 27 21:27:10 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Sep 28 20:21:02 2024 +0200 cid#1557088 Data race condition since: commit d181d8acbf49e2fe87c8cf53a9431e503ccced55 CommitDate: Fri Aug 25 12:44:33 2017 +0200 tdf#84237 use XErrorHandler in CDocumentBuilder Change-Id: Iac1d2b88f2910298d30de4d12798bb38c36a0de9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174102 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 3be49adcd899..d24b1d7364f7 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -254,14 +254,15 @@ namespace DOM CDocumentBuilder * const pDocBuilder = static_cast<CDocumentBuilder*>(pctx->_private); - if (pDocBuilder->getErrorHandler().is()) // if custom error handler is set (using setErrorHandler ()) + Reference<XErrorHandler> xErrorHandler = pDocBuilder->getErrorHandler(); + if (xErrorHandler.is()) // if custom error handler is set (using setErrorHandler ()) { // Prepare SAXParseException to be passed to custom XErrorHandler::warning function css::xml::sax::SAXParseException saxex(make_error_message(pctx), {}, {}, {}, {}, pctx->lastError.line, pctx->lastError.int2); // Call custom warning function - pDocBuilder->getErrorHandler()->warning(::css::uno::Any(saxex)); + xErrorHandler->warning(::css::uno::Any(saxex)); } } catch (const css::uno::Exception &) @@ -284,14 +285,15 @@ namespace DOM CDocumentBuilder * const pDocBuilder = static_cast<CDocumentBuilder*>(pctx->_private); - if (pDocBuilder->getErrorHandler().is()) // if custom error handler is set (using setErrorHandler ()) + Reference<XErrorHandler> xErrorHandler = pDocBuilder->getErrorHandler(); + if (xErrorHandler.is()) // if custom error handler is set (using setErrorHandler ()) { // Prepare SAXParseException to be passed to custom XErrorHandler::error function css::xml::sax::SAXParseException saxex(make_error_message(pctx), {}, {}, {}, {}, pctx->lastError.line, pctx->lastError.int2); // Call custom warning function - pDocBuilder->getErrorHandler()->error(::css::uno::Any(saxex)); + xErrorHandler->error(::css::uno::Any(saxex)); } } catch (const css::uno::Exception &) @@ -412,6 +414,13 @@ namespace DOM m_xErrorHandler = xEH; } + + Reference< XErrorHandler > CDocumentBuilder::getErrorHandler() + { + std::scoped_lock const g(m_Mutex); + + return m_xErrorHandler; + } } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* diff --git a/unoxml/source/dom/documentbuilder.hxx b/unoxml/source/dom/documentbuilder.hxx index 7b93b170d4c1..c63a8970d289 100644 --- a/unoxml/source/dom/documentbuilder.hxx +++ b/unoxml/source/dom/documentbuilder.hxx @@ -104,7 +104,6 @@ namespace DOM /// @throws css::uno::RuntimeException css::uno::Reference< css::xml::sax::XEntityResolver > getEntityResolver(); - /** Specify the ErrorHandler to be used to report errors present in the XML document to be parsed. @@ -115,12 +114,7 @@ namespace DOM Get the ErrorHandler to be used to report errors present in the XML document to be parsed. */ - - const css::uno::Reference< css::xml::sax::XErrorHandler >& getErrorHandler() const - { - return m_xErrorHandler; - } - + css::uno::Reference< css::xml::sax::XErrorHandler > getErrorHandler(); }; } commit 9bd20c306e3a7d049b656a96e5eef9c65a8e7994 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Sep 28 10:36:50 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Sep 28 20:20:52 2024 +0200 cid#1620316 Uninitialized scalar variable Change-Id: I3ef7f30dc2045b0386bd7f14c0e9be34f7e67726 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174101 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/sc/source/ui/inc/duplicaterecordsdlg.hxx b/sc/source/ui/inc/duplicaterecordsdlg.hxx index aaa253af7348..07a9f64a992b 100644 --- a/sc/source/ui/inc/duplicaterecordsdlg.hxx +++ b/sc/source/ui/inc/duplicaterecordsdlg.hxx @@ -30,6 +30,12 @@ struct DuplicatesResponse bool bRemove; // false ==> Select bool bIncludesHeaders; bool bDuplicateRows; // false ==> DuplicateColumns + DuplicatesResponse() + : bRemove(false) + , bIncludesHeaders(false) + , bDuplicateRows(false) + { + } }; class ScDuplicateRecordsDlg : public weld::GenericDialogController
