summaryrefslogtreecommitdiff
path: root/sc
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 /sc
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 'sc')
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx2
-rw-r--r--sc/source/ui/view/viewfun2.cxx3
-rw-r--r--sc/source/ui/view/viewfun4.cxx4
3 files changed, 5 insertions, 4 deletions
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index de1f6b3b6f8e..51b0eda00b2f 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -487,7 +487,7 @@ void ScPivotLayoutDialog::ApplyChanges()
const SfxPoolItemHolder aResult(pDispatcher->ExecuteList(SID_PIVOT_TABLE,
nCallMode, { &aPivotItem }));
- if (nullptr != aResult.getItem())
+ if (aResult)
{
// existing pivot table might have moved to a new range or a new sheet
if ( pOldDPObj != nullptr )
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 224bb722e0dd..5cb800fe8ce1 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2885,7 +2885,8 @@ void ScViewFunc::MoveTable(
const SfxPoolItemHolder aResult(GetViewData().GetDispatcher().ExecuteList(
SID_OPENDOC, SfxCallMode::API|SfxCallMode::SYNCHRON,
{ &aItem, &aTarget }));
- if (nullptr != aResult.getItem())
+
+ if (aResult)
{
if ( auto pObjectItem = dynamic_cast<const SfxObjectItem*>(aResult.getItem()) )
pDestShell = dynamic_cast<ScDocShell*>( pObjectItem->GetShell() );
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index d75541b30234..48ac1a97cf02 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -590,7 +590,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
const SfxPoolItemHolder aResult(GetViewData().GetDispatcher().ExecuteList(
SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON,
{ &aMediaURLItem }));
- return (nullptr != aResult.getItem());
+ return aResult.is();
}
#endif
@@ -621,7 +621,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
const SfxPoolItemHolder aResult(rDispatcher.ExecuteList(SID_OPENDOC,
SfxCallMode::ASYNCHRON,
{ &aFileNameItem, &aFilterItem, &aTargetItem}));
- return (nullptr != aResult.getItem());
+ return aResult.is();
}
}