summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-07-22 00:56:07 +0300
committerMichael Stahl <michael.stahl@allotropia.de>2021-07-22 10:56:29 +0200
commit06f7757bd377c6dbeada7941249371ab5b31bbad (patch)
treee638222b6ac75ec4a05d35de912fd93da36b67a4 /sc
parent29df92dc04897796aa47815989c51f59975607fb (diff)
Dereferencing uninitialized pointer
SfxItemSet::GetItemState returns SfxItemState::DEFAULT without resetting the passed pointer. Regression after commit dd5bf12193471f064bf7f581dd1b21783390e735. Change-Id: I1e427a05f8e5b375f50d81b51d32e78fca83eb42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119348 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 0d4cbdbc9cd4ab06056cec66cffd292b41615b6e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119259 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 82609b657959..889c7efd33b3 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -390,13 +390,13 @@ void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet )
if( bHasMarked )
{
SfxAllItemSet aSet(pDrView->GetAttrFromMarked(false));
- if (const SfxPoolItem * pItem;
+ if (const SfxPoolItem* pItem = nullptr;
aSet.GetItemState(SDRATTR_TEXTCOLUMNS_NUMBER, false, &pItem) >= SfxItemState::DEFAULT
&& pItem)
{
aSet.Put(pItem->CloneSetWhich(SID_ATTR_TEXTCOLUMNS_NUMBER));
}
- if (const SfxPoolItem * pItem;
+ if (const SfxPoolItem* pItem = nullptr;
aSet.GetItemState(SDRATTR_TEXTCOLUMNS_SPACING, false, &pItem) >= SfxItemState::DEFAULT
&& pItem)
{