summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-04-08 08:48:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-04-08 10:47:45 +0200
commit969ebe1c5801fa194ee29ffc7abfad7363ebd08f (patch)
tree3e5c652a6708c49f50c7d1623f9d4d3101b022e7 /sd
parente9c327be8f0b4848e9f65687833ed89021907a6a (diff)
cid#1461386 Unchecked return value
and cid#1461388 Unchecked return value Change-Id: I77b8c6eb2dde566521ed8d3f577c4df894f91733 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91870 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx17
-rw-r--r--sd/source/ui/animations/CustomAnimationList.hxx1
2 files changed, 9 insertions, 9 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 559ac92a6b5c..68ecf1362ce9 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -479,8 +479,8 @@ IMPL_LINK(CustomAnimationList, DragBeginHdl, bool&, rUnsetDragIcon, bool)
// Note: pEntry is the effect with focus (if multiple effects are selected)
mxDndEffectDragging = mxTreeView->make_iterator();
- mxTreeView->get_cursor(mxDndEffectDragging.get());
- mxDndEffectInsertBefore = mxTreeView->make_iterator(mxDndEffectDragging.get());
+ if (!mxTreeView->get_cursor(mxDndEffectDragging.get()))
+ mxDndEffectDragging.reset();
// Allow normal processing.
return false;
@@ -500,17 +500,18 @@ sal_Int8 CustomAnimationList::AcceptDrop( const AcceptDropEvent& rEvt )
// D'n'D #5: Tell model to update effect order.
sal_Int8 CustomAnimationList::ExecuteDrop(const ExecuteDropEvent& rEvt)
{
- if (!mxTreeView->get_dest_row_at_pos(rEvt.maPosPixel, mxDndEffectInsertBefore.get()))
- mxDndEffectInsertBefore.reset();
+ std::unique_ptr<weld::TreeIter> xDndEffectInsertBefore(mxTreeView->make_iterator());
+ if (!mxTreeView->get_dest_row_at_pos(rEvt.maPosPixel, xDndEffectInsertBefore.get()))
+ xDndEffectInsertBefore.reset();
const bool bMovingEffect = ( mxDndEffectDragging != nullptr );
- const bool bMoveNotSelf = !mxDndEffectInsertBefore || (mxDndEffectDragging && mxTreeView->iter_compare(*mxDndEffectInsertBefore, *mxDndEffectDragging) != 0);
+ const bool bMoveNotSelf = !xDndEffectInsertBefore || (mxDndEffectDragging && mxTreeView->iter_compare(*xDndEffectInsertBefore, *mxDndEffectDragging) != 0);
const bool bHaveSequence = ( mpMainSequence.get() != nullptr );
if( bMovingEffect && bMoveNotSelf && bHaveSequence )
{
- CustomAnimationListEntryItem* pTarget = mxDndEffectInsertBefore ?
- reinterpret_cast<CustomAnimationListEntryItem*>(mxTreeView->get_id(*mxDndEffectInsertBefore).toInt64()) :
+ CustomAnimationListEntryItem* pTarget = xDndEffectInsertBefore ?
+ reinterpret_cast<CustomAnimationListEntryItem*>(mxTreeView->get_id(*xDndEffectInsertBefore).toInt64()) :
nullptr;
// Build list of effects
@@ -1100,7 +1101,7 @@ EffectSequence CustomAnimationList::getSelection() const
if (!mxTreeView->get_row_expanded(rEntry) && mxTreeView->iter_has_child(rEntry))
{
std::unique_ptr<weld::TreeIter> xChild = mxTreeView->make_iterator(&rEntry);
- mxTreeView->iter_children(*xChild);
+ (void)mxTreeView->iter_children(*xChild);
do
{
diff --git a/sd/source/ui/animations/CustomAnimationList.hxx b/sd/source/ui/animations/CustomAnimationList.hxx
index 398793840187..3da6b350dce6 100644
--- a/sd/source/ui/animations/CustomAnimationList.hxx
+++ b/sd/source/ui/animations/CustomAnimationList.hxx
@@ -154,7 +154,6 @@ private:
// drag & drop
std::unique_ptr<weld::TreeIter> mxDndEffectDragging;
- std::unique_ptr<weld::TreeIter> mxDndEffectInsertBefore;
std::vector<std::unique_ptr<weld::TreeIter>> mDndEffectsSelected;
};