diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-23 20:14:45 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-30 17:05:28 +0200 |
commit | f220acf3aad954e20f3b15b30910432fac97ed15 (patch) | |
tree | 5c2f604499bcd812c9c5ed3b5bc572e837d509fa /shell | |
parent | 723a0a067daaefb8b082fc849713ee6502ec9231 (diff) |
Use getXWeak in shell
Change-Id: Ied9a244a0fdd5973f2c9cb3bdd46500f6be2e0cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150868
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/source/backends/desktopbe/desktopbackend.cxx | 6 | ||||
-rw-r--r-- | shell/source/backends/kf5be/kf5backend.cxx | 5 | ||||
-rw-r--r-- | shell/source/backends/localebe/localebackend.cxx | 4 | ||||
-rw-r--r-- | shell/source/backends/macbe/macbackend.mm | 4 | ||||
-rw-r--r-- | shell/source/backends/wininetbe/wininetbackend.cxx | 4 | ||||
-rw-r--r-- | shell/source/unix/exec/shellexec.cxx | 4 | ||||
-rw-r--r-- | shell/source/win32/SysShExec.cxx | 2 | ||||
-rw-r--r-- | shell/source/win32/jumplist/JumpList.cxx | 13 |
8 files changed, 20 insertions, 22 deletions
diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index b6f49e37ed24..8d001499bad0 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -106,7 +106,7 @@ void Default::setPropertyValue(OUString const &, css::uno::Any const &) { throw css::lang::IllegalArgumentException( "setPropertyValue not supported", - static_cast< cppu::OWeakObject * >(this), -1); + getXWeak(), -1); } OUString xdg_user_dir_lookup (const char *type, bool bAllowHomeDir) @@ -252,7 +252,7 @@ css::uno::Any Default::getPropertyValue(OUString const & PropertyName) } throw css::beans::UnknownPropertyException( - PropertyName, static_cast< cppu::OWeakObject * >(this)); + PropertyName, getXWeak()); } css::uno::Reference< css::uno::XInterface > createBackend( @@ -290,7 +290,7 @@ shell_DesktopBackend_get_implementation( backend = createBackend(context, "com.sun.star.configuration.backend.KF5Backend"); if (!backend) - backend = static_cast< cppu::OWeakObject * >(new Default); + backend = getXWeak(new Default); backend->acquire(); return backend.get(); } diff --git a/shell/source/backends/kf5be/kf5backend.cxx b/shell/source/backends/kf5be/kf5backend.cxx index 7137a9999873..b811300a8e6e 100644 --- a/shell/source/backends/kf5be/kf5backend.cxx +++ b/shell/source/backends/kf5be/kf5backend.cxx @@ -220,8 +220,7 @@ Service::Service() void Service::setPropertyValue(OUString const&, css::uno::Any const&) { - throw css::lang::IllegalArgumentException("setPropertyValue not supported", - static_cast<cppu::OWeakObject*>(this), -1); + throw css::lang::IllegalArgumentException("setPropertyValue not supported", getXWeak(), -1); } css::uno::Any Service::getPropertyValue(OUString const& PropertyName) @@ -247,7 +246,7 @@ css::uno::Any Service::getPropertyValue(OUString const& PropertyName) return css::uno::Any(css::beans::Optional<css::uno::Any>()); //TODO: obtain values from KDE? } - throw css::beans::UnknownPropertyException(PropertyName, static_cast<cppu::OWeakObject*>(this)); + throw css::beans::UnknownPropertyException(PropertyName, getXWeak()); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index 9f1d22fef93e..d34c3441e6bc 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -286,7 +286,7 @@ void LocaleBackend::setPropertyValue( { throw css::lang::IllegalArgumentException( "setPropertyValue not supported", - static_cast< cppu::OWeakObject * >(this), -1); + getXWeak(), -1); } css::uno::Any LocaleBackend::getPropertyValue( @@ -302,7 +302,7 @@ css::uno::Any LocaleBackend::getPropertyValue( return css::uno::Any(getUILocale()); } else { throw css::beans::UnknownPropertyException( - PropertyName, static_cast< cppu::OWeakObject * >(this)); + PropertyName, getXWeak()); } } diff --git a/shell/source/backends/macbe/macbackend.mm b/shell/source/backends/macbe/macbackend.mm index cb35a4b9d066..e84ecd4b8013 100644 --- a/shell/source/backends/macbe/macbackend.mm +++ b/shell/source/backends/macbe/macbackend.mm @@ -186,7 +186,7 @@ void MacOSXBackend::setPropertyValue( { throw css::lang::IllegalArgumentException( "setPropertyValue not supported", - static_cast< cppu::OWeakObject * >(this), -1); + getXWeak(), -1); } css::uno::Any MacOSXBackend::getPropertyValue( @@ -365,7 +365,7 @@ css::uno::Any MacOSXBackend::getPropertyValue( return css::uno::Any(css::beans::Optional< css::uno::Any >()); } else { throw css::beans::UnknownPropertyException( - PropertyName, static_cast< cppu::OWeakObject * >(this)); + PropertyName, getXWeak()); } } diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx index 71de3b135b4c..109ef7fa6519 100644 --- a/shell/source/backends/wininetbe/wininetbackend.cxx +++ b/shell/source/backends/wininetbe/wininetbackend.cxx @@ -301,7 +301,7 @@ void WinInetBackend::setPropertyValue( { throw css::lang::IllegalArgumentException( "setPropertyValue not supported", - static_cast< cppu::OWeakObject * >(this), -1); + getXWeak(), -1); } css::uno::Any WinInetBackend::getPropertyValue( @@ -333,7 +333,7 @@ css::uno::Any WinInetBackend::getPropertyValue( return css::uno::Any(valueProxyType_); } else { throw css::beans::UnknownPropertyException( - PropertyName, static_cast< cppu::OWeakObject * >(this)); + PropertyName, getXWeak()); } } diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index 97334fcd32c3..71137c7d6703 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -107,7 +107,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar throw RuntimeException( "Cannot translate URI reference to external format: " + aCommand, - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } #ifdef MACOSX @@ -205,7 +205,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar "XSystemShellExecute.execute URIS_ONLY with non-absolute" " URI reference " + aCommand, - static_cast< cppu::OWeakObject * >(this), 0); + getXWeak(), 0); } else { escapeForShell(aBuffer, OUStringToOString(aCommand, osl_getThreadTextEncoding())); aBuffer.append(" "); diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 7be77d6344de..57e59f96b6f0 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -234,7 +234,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa "XSystemShellExecute.execute URIS_ONLY with" " non-absolute URI reference " + aCommand, - static_cast< cppu::OWeakObject * >(this), 0); + getXWeak(), 0); } if (uri->getScheme().equalsIgnoreAsciiCase("file")) { // ShellExecuteExW appears to ignore the fragment of a file URL anyway, so remove it: diff --git a/shell/source/win32/jumplist/JumpList.cxx b/shell/source/win32/jumplist/JumpList.cxx index 114c6f4e95b5..2773294be717 100644 --- a/shell/source/win32/jumplist/JumpList.cxx +++ b/shell/source/win32/jumplist/JumpList.cxx @@ -129,7 +129,7 @@ void SAL_CALL JumpListImpl::beginList(const OUString& sApplication) throw IllegalArgumentException( "Parameter 'application' must be one of 'Writer', 'Calc', 'Impress', 'Draw', " "'Math', 'Base', 'Startcenter'.", - static_cast<OWeakObject*>(this), 1); + getXWeak(), 1); } OUString sApplicationID("TheDocumentFoundation.LibreOffice." + sApplication); @@ -157,8 +157,7 @@ void SAL_CALL JumpListImpl::appendCategory(const OUString& sCategory, if (sCategory.isEmpty()) { - throw IllegalArgumentException("Parameter 'category' must not be empty", - static_cast<OWeakObject*>(this), 1); + throw IllegalArgumentException("Parameter 'category' must not be empty", getXWeak(), 1); } try @@ -241,7 +240,7 @@ void SAL_CALL JumpListImpl::appendCategory(const OUString& sCategory, throw IllegalArgumentException( "No valid items given. `jumpListItems` is either empty, or contains only items " "which were removed by the user. See `XJumpList::getRemovedItems()`.", - static_cast<OWeakObject*>(this), 1); + getXWeak(), 1); } ThrowIfFailed( @@ -329,7 +328,7 @@ void SAL_CALL JumpListImpl::addTasks(const Sequence<JumpListItem>& aJumpListItem if (nItems == 0) { throw IllegalArgumentException("No valid items given. `jumpListItems` is empty.", - static_cast<OWeakObject*>(this), 1); + getXWeak(), 1); } ThrowIfFailed(m_aDestinationList->AddUserTasks(pObjectArray), "AddUserTasks failed."); @@ -417,7 +416,7 @@ void SAL_CALL JumpListImpl::deleteList(const OUString& sApplication) throw IllegalArgumentException( "Parameter 'application' must be one of 'Writer', 'Calc', 'Impress', 'Draw', " "'Math', 'Base', 'Startcenter'.", - static_cast<OWeakObject*>(this), 1); + getXWeak(), 1); } OUString sApplicationID("TheDocumentFoundation.LibreOffice." + sApplication); @@ -442,7 +441,7 @@ Sequence<JumpListItem> SAL_CALL JumpListImpl::getRemovedItems(const OUString& sA throw IllegalArgumentException( "Parameter 'application' must be one of 'Writer', 'Calc', 'Impress', 'Draw', " "'Math', 'Base', 'Startcenter'.", - static_cast<OWeakObject*>(this), 1); + getXWeak(), 1); } OUString sApplicationID("TheDocumentFoundation.LibreOffice." + sApplication); |