lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx | 20 +++++----- sd/source/ui/unoidl/unopage.cxx | 4 +- sw/source/core/unocore/unodraw.cxx | 4 +- 3 files changed, 14 insertions(+), 14 deletions(-)
New commits: commit 93cd7e878ac03232aaebb14e9425d80fc97f8846 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Feb 7 16:27:55 2023 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Feb 7 19:54:49 2023 +0000 cid#1520799 Unchecked dynamic_cast and cid#1520801 Unchecked dynamic_cast Change-Id: I03a0fdde1da3a9f10699b35455fa2f79ff00a494 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146635 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 5292349b4ba8..7b467158651d 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -983,8 +983,8 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName uno::Reference<util::XTheme> xTheme; if (aValue >>= xTheme) { - auto* pUnoTheme = dynamic_cast<UnoTheme*>(xTheme.get()); - std::unique_ptr<model::Theme> pTheme(new model::Theme(pUnoTheme->getTheme())); + auto& rUnoTheme = dynamic_cast<UnoTheme&>(*xTheme); + std::unique_ptr<model::Theme> pTheme(new model::Theme(rUnoTheme.getTheme())); pPage->getSdrPageProperties().SetTheme(std::move(pTheme)); } break; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index f7603c423ad9..78bdde15f0c6 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -405,8 +405,8 @@ void SwFmDrawPage::setPropertyValue(const OUString& rPropertyName, const uno::An css::uno::Reference<css::util::XTheme> xTheme; if (aValue >>= xTheme) { - auto* pUnoTheme = dynamic_cast<UnoTheme*>(xTheme.get()); - std::unique_ptr<model::Theme> pTheme(new model::Theme(pUnoTheme->getTheme())); + auto& rUnoTheme = dynamic_cast<UnoTheme&>(*xTheme); + std::unique_ptr<model::Theme> pTheme(new model::Theme(rUnoTheme.getTheme())); pPage->getSdrPageProperties().SetTheme(std::move(pTheme)); } } commit 6285297c6933fa9121d7dd412b1f1daaa8b072a5 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Feb 7 16:21:31 2023 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Feb 7 19:54:39 2023 +0000 cid#1520803 silence Unchecked return value from library Change-Id: I47bfb2b64526d47c2a064e3bb3d93474420825af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146613 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx index 9fb8a53bb300..ff38eb67d172 100644 --- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx +++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx @@ -421,24 +421,24 @@ std::string LanguageToolGrammarChecker::makeDudenHttpRequest(std::string_view aU if (!sAccessToken.isEmpty()) pList = curl_slist_append(pList, sAccessToken.getStr()); - curl_easy_setopt(curl.get(), CURLOPT_HTTPHEADER, pList); - curl_easy_setopt(curl.get(), CURLOPT_FAILONERROR, 1L); - curl_easy_setopt(curl.get(), CURLOPT_URL, aURL.data()); - curl_easy_setopt(curl.get(), CURLOPT_TIMEOUT, CURL_TIMEOUT); - curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, static_cast<void*>(&sResponseBody)); + (void)curl_easy_setopt(curl.get(), CURLOPT_HTTPHEADER, pList); + (void)curl_easy_setopt(curl.get(), CURLOPT_FAILONERROR, 1L); + (void)curl_easy_setopt(curl.get(), CURLOPT_URL, aURL.data()); + (void)curl_easy_setopt(curl.get(), CURLOPT_TIMEOUT, CURL_TIMEOUT); + (void)curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, WriteCallback); + (void)curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, static_cast<void*>(&sResponseBody)); // allow unknown or self-signed certificates if (rLanguageOpts.getSSLVerification() == false) { - curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYPEER, false); - curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYHOST, false); + (void)curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYPEER, false); + (void)curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYHOST, false); } if (method == HTTP_METHOD::HTTP_POST) { - curl_easy_setopt(curl.get(), CURLOPT_POST, 1L); - curl_easy_setopt(curl.get(), CURLOPT_POSTFIELDS, aData.getStr()); + (void)curl_easy_setopt(curl.get(), CURLOPT_POST, 1L); + (void)curl_easy_setopt(curl.get(), CURLOPT_POSTFIELDS, aData.getStr()); } CURLcode cc = curl_easy_perform(curl.get());