connectivity/source/drivers/ado/APreparedStatement.cxx | 2 - connectivity/source/drivers/ado/AStatement.cxx | 11 ++++------ connectivity/source/inc/ado/AStatement.hxx | 3 +- cui/source/customize/macropg.cxx | 4 +-- cui/source/options/optgdlg.cxx | 18 +++++++++-------- cui/source/options/optlingu.cxx | 2 - dbaccess/source/ui/inc/imageprovider.hxx | 2 - dbaccess/source/ui/misc/imageprovider.cxx | 2 - 8 files changed, 23 insertions(+), 21 deletions(-)
New commits: commit 8d0a0bc4d4bc9d6b453f98164c4ab33d0afa91f9 Author: Noel Grandin <[email protected]> AuthorDate: Thu Nov 7 12:04:48 2024 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu Nov 7 14:31:03 2024 +0100 use more concrete UNO type in connectivity::ado Change-Id: Ia9bc0e4aade832373def4460e44750be4415967d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176205 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx b/connectivity/source/drivers/ado/APreparedStatement.cxx index 9e17d71b0bed..6be6cfefd993 100644 --- a/connectivity/source/drivers/ado/APreparedStatement.cxx +++ b/connectivity/source/drivers/ado/APreparedStatement.cxx @@ -264,7 +264,7 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) rtl::Reference<OResultSet> pSet = new OResultSet(m_RecordSet,this); pSet->construct(); pSet->setMetaData(getMetaData()); - m_xResultSet = WeakReference<XResultSet>(pSet); + m_xResultSet = pSet.get(); return pSet; } diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx index c2a09385dee6..f5fed2c22027 100644 --- a/connectivity/source/drivers/ado/AStatement.cxx +++ b/connectivity/source/drivers/ado/AStatement.cxx @@ -79,7 +79,7 @@ OStatement_Base::OStatement_Base(OConnection* _pConnection ) : OStatement_BASE( void OStatement_Base::disposeResultSet() { // free the cursor if alive - Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY); + rtl::Reference< OResultSet > xComp = m_xResultSet.get(); if (xComp.is()) xComp->dispose(); m_xResultSet.clear(); @@ -178,8 +178,7 @@ void OStatement_Base::clearMyResultSet () try { - Reference<XCloseable> xCloseable( - m_xResultSet.get(), css::uno::UNO_QUERY); + rtl::Reference<OResultSet> xCloseable = m_xResultSet.get(); if ( xCloseable.is() ) xCloseable->close(); } @@ -286,7 +285,7 @@ Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const OUString& reset(); - m_xResultSet = WeakReference<XResultSet>(nullptr); + m_xResultSet.clear(); WpADORecordset aSet; aSet.Create(); @@ -308,7 +307,7 @@ Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const OUString& rtl::Reference<OResultSet> pSet = new OResultSet(aSet,this); pSet->construct(); - m_xResultSet = WeakReference<XResultSet>(pSet); + m_xResultSet = pSet.get(); return pSet; } @@ -417,7 +416,7 @@ Reference< XResultSet > SAL_CALL OStatement_Base::getResultSet( ) checkDisposed(OStatement_BASE::rBHelper.bDisposed); - return m_xResultSet; + return m_xResultSet.get(); } diff --git a/connectivity/source/inc/ado/AStatement.hxx b/connectivity/source/inc/ado/AStatement.hxx index 625339917591..ce4369b347f2 100644 --- a/connectivity/source/inc/ado/AStatement.hxx +++ b/connectivity/source/inc/ado/AStatement.hxx @@ -29,6 +29,7 @@ #include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> #include <comphelper/proparrhlp.hxx> +#include <unotools/weakref.hxx> #include <ado/AConnection.hxx> #include <string_view> #include <vector> @@ -59,7 +60,7 @@ namespace connectivity::ado protected: std::vector< OUString> m_aBatchVector; - css::uno::WeakReference< css::sdbc::XResultSet> m_xResultSet; // The last ResultSet created + unotools::WeakReference<OResultSet> m_xResultSet; // The last ResultSet created // for this Statement OConnection* m_pConnection;// The owning Connection object commit 2de45b85574063cfef3d6ccddc9efe959a8b1076 Author: Noel Grandin <[email protected]> AuthorDate: Thu Nov 7 10:00:00 2024 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu Nov 7 14:30:52 2024 +0100 loplugin:passstuffbyref in cui..dbaccess Change-Id: Ie15974919f7c0764e661225ef14a9f50917ab083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176189 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index fa4ef4663255..60824e011f00 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -296,10 +296,10 @@ namespace return aPureMethod; } - OUString GetEventDisplayImage(std::u16string_view rURL) + const OUString & GetEventDisplayImage(std::u16string_view rURL) { if (rURL.empty()) - return OUString(); + return EMPTY_OUSTRING; size_t nIndex = rURL.find(aVndSunStarUNO); bool bUNO = nIndex == 0; return bUNO ? RID_SVXBMP_COMPONENT : RID_SVXBMP_MACRO; diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index c80449a62602..6b84062337a4 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -114,15 +114,17 @@ DeactivateRC OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ ) namespace { -OUString impl_SystemFileOpenServiceName() +const OUString & impl_SystemFileOpenServiceName() { - #if defined(_WIN32) - return "com.sun.star.ui.dialogs.SystemFilePicker"; - #elif defined MACOSX - return "com.sun.star.ui.dialogs.AquaFilePicker"; - #else - return OUString(); - #endif +#if defined(_WIN32) + static constexpr OUString gPicker = u"com.sun.star.ui.dialogs.SystemFilePicker"_ustr; + return gPicker; +#elif defined MACOSX + static constexpr OUString gPicker = u"com.sun.star.ui.dialogs.AquaFilePicker"_ustr; + return gPicker; +#else + return EMPTY_OUSTRING; +#endif } bool lcl_HasSystemFilePicker() diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index bd5f59c8f741..7381c4d190e3 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -198,7 +198,7 @@ enum EID_OPTIONS } -static OUString lcl_GetPropertyName( EID_OPTIONS eEntryId ) +static const OUString & lcl_GetPropertyName( EID_OPTIONS eEntryId ) { switch (eEntryId) { diff --git a/dbaccess/source/ui/inc/imageprovider.hxx b/dbaccess/source/ui/inc/imageprovider.hxx index 28784e6dbfa1..5249fb0091fe 100644 --- a/dbaccess/source/ui/inc/imageprovider.hxx +++ b/dbaccess/source/ui/inc/imageprovider.hxx @@ -92,7 +92,7 @@ namespace dbaui @return the image to be used for folders of this type */ - static OUString getDatabaseImage(); + static const OUString & getDatabaseImage(); private: /// the connection we work with css::uno::Reference< css::sdbc::XConnection > mxConnection; diff --git a/dbaccess/source/ui/misc/imageprovider.cxx b/dbaccess/source/ui/misc/imageprovider.cxx index 388df30e271f..6cba1b80ca30 100644 --- a/dbaccess/source/ui/misc/imageprovider.cxx +++ b/dbaccess/source/ui/misc/imageprovider.cxx @@ -182,7 +182,7 @@ namespace dbaui return sImageResourceID; } - OUString ImageProvider::getDatabaseImage() + const OUString & ImageProvider::getDatabaseImage() { return DATABASE_TREE_ICON; }
