summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-12-28 13:18:23 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2023-12-28 15:23:48 +0100
commit2ddec231d513cf317f9fb2c2a82c7e3a0a2d7ef3 (patch)
treeb05b5b166ae135f63990c4200c058a98027d6b7a /sd/source
parent249fb2c6b1b8163bfa4bd6c1fcff000a42d2e967 (diff)
Added boolean op's to SfxPoolItemHolder
...and adapted code to make use of it. This makes checking if the SfxPoolItemHolder instance contains an Item or not simpler and thus more readable, no need to access the Item* every time using getItem() - is okay, but not intuitive. Change-Id: I8042267cce670aca2641a91cd36285058f17ffbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161380 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/app/sdmod1.cxx4
-rw-r--r--sd/source/ui/unoidl/unomodule.cxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 0d9e82f27802..d6fc5c406efb 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -323,7 +323,7 @@ void SdModule::GetState(SfxItemSet& rItemSet)
if (rItemSet.GetItemState(SID_OPENDOC) != SfxItemState::UNKNOWN)
{
const SfxPoolItemHolder aItem(SfxGetpApp()->GetSlotState(SID_OPENDOC, SfxGetpApp()->GetInterface()));
- if (nullptr != aItem.getItem())
+ if (aItem)
rItemSet.Put(*aItem.getItem());
}
@@ -331,7 +331,7 @@ void SdModule::GetState(SfxItemSet& rItemSet)
if (rItemSet.GetItemState(SID_OPENHYPERLINK) != SfxItemState::UNKNOWN)
{
const SfxPoolItemHolder aItem(SfxGetpApp()->GetSlotState(SID_OPENHYPERLINK, SfxGetpApp()->GetInterface()));
- if (nullptr != aItem.getItem())
+ if (aItem)
rItemSet.Put(*aItem.getItem());
}
diff --git a/sd/source/ui/unoidl/unomodule.cxx b/sd/source/ui/unoidl/unomodule.cxx
index 5ee3cab40d7e..65642ece9c04 100644
--- a/sd/source/ui/unoidl/unomodule.cxx
+++ b/sd/source/ui/unoidl/unomodule.cxx
@@ -49,7 +49,7 @@ void SAL_CALL SdUnoModule::dispatchWithNotification( const util::URL& aURL, cons
{
SfxRequest aReq( pSlot, aArgs, SfxCallMode::SYNCHRON, SD_MOD()->GetPool() );
const SfxPoolItemHolder aResult(SD_MOD()->ExecuteSlot(aReq));
- if (nullptr != aResult.getItem())
+ if (aResult)
aState = frame::DispatchResultState::SUCCESS;
else
aState = frame::DispatchResultState::FAILURE;