Bug Summary

File:home/maarten/src/libreoffice/core/sc/source/ui/view/auditsh.cxx
Warning:line 96, column 57
Called C++ object pointer is null

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name auditsh.cxx -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/11.0.0 -isystem /usr/include/libxml2 -D BOOST_ERROR_CODE_HEADER_ONLY -D BOOST_SYSTEM_NO_DEPRECATED -D CPPU_ENV=gcc3 -D LINUX -D OSL_DEBUG_LEVEL=1 -D SAL_LOG_INFO -D SAL_LOG_WARN -D UNIX -D UNX -D X86_64 -D _PTHREADS -D _REENTRANT -D SC_DLLIMPLEMENTATION -D SC_INFO_OSVERSION="LINUX" -D SYSTEM_LIBXML -D EXCEPTIONS_ON -D LIBO_INTERNAL_ONLY -I /home/maarten/src/libreoffice/core/workdir/UnpackedTarball/liborcus/include -I /home/maarten/src/libreoffice/core/workdir/UnpackedTarball/mdds/include -I /home/maarten/src/libreoffice/core/workdir/UnpackedTarball/icu/source -I /home/maarten/src/libreoffice/core/workdir/UnpackedTarball/icu/source/i18n -I /home/maarten/src/libreoffice/core/workdir/UnpackedTarball/icu/source/common -I /home/maarten/src/libreoffice/core/external/clew/source/include -I /home/maarten/src/libreoffice/core/external/boost/include -I /home/maarten/src/libreoffice/core/workdir/UnpackedTarball/boost -I /home/maarten/src/libreoffice/core/sc/source/core/inc -I /home/maarten/src/libreoffice/core/sc/source/filter/inc -I /home/maarten/src/libreoffice/core/sc/source/ui/inc -I /home/maarten/src/libreoffice/core/sc/inc -I /home/maarten/src/libreoffice/core/workdir/SdiTarget/sc/sdi -I /home/maarten/src/libreoffice/core/include -I /usr/lib/jvm/java-11-openjdk-11.0.9.10-0.0.ea.fc33.x86_64/include -I /usr/lib/jvm/java-11-openjdk-11.0.9.10-0.0.ea.fc33.x86_64/include/linux -I /home/maarten/src/libreoffice/core/config_host -I /home/maarten/src/libreoffice/core/workdir/CustomTarget/officecfg/registry -I /home/maarten/src/libreoffice/core/workdir/UnoApiHeadersTarget/udkapi/normal -I /home/maarten/src/libreoffice/core/workdir/UnoApiHeadersTarget/offapi/normal -I /home/maarten/src/libreoffice/core/workdir/UnoApiHeadersTarget/oovbaapi/normal -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10 -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/x86_64-redhat-linux -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/11.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -Wno-missing-braces -std=c++17 -fdeprecated-macro -fdebug-compilation-dir /home/maarten/src/libreoffice/core -ferror-limit 19 -fvisibility hidden -fvisibility-inlines-hidden -stack-protector 2 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -debug-info-kind=constructor -analyzer-output=html -faddrsig -o /home/maarten/tmp/wis/scan-build-libreoffice/output/report/2020-10-07-141433-9725-1 -x c++ /home/maarten/src/libreoffice/core/sc/source/ui/view/auditsh.cxx
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sfx2/bindings.hxx>
21#include <sfx2/objface.hxx>
22#include <sfx2/objsh.hxx>
23#include <sfx2/request.hxx>
24#include <vcl/EnumContext.hxx>
25
26#include <auditsh.hxx>
27#include <tabvwsh.hxx>
28#include <sc.hrc>
29#include <document.hxx>
30
31#define ShellClass_ScAuditingShell
32#include <scslots.hxx>
33
34
35SFX_IMPL_INTERFACE(ScAuditingShell, SfxShell)SfxInterface* ScAuditingShell::pInterface = nullptr; SfxInterface
* ScAuditingShell::GetStaticInterface() { if ( !pInterface ) {
pInterface = new SfxInterface( "ScAuditingShell", false, GetInterfaceId
(), SfxShell::GetStaticInterface(), aScAuditingShellSlots_Impl
[0], sal_uInt16(sizeof(aScAuditingShellSlots_Impl) / sizeof(SfxSlot
) ) ); InitInterface_Impl(); } return pInterface; } SfxInterface
* ScAuditingShell::GetInterface() const { return GetStaticInterface
(); } void ScAuditingShell::RegisterInterface(const SfxModule
* pMod) { GetStaticInterface()->Register(pMod); }
36
37void ScAuditingShell::InitInterface_Impl()
38{
39 GetStaticInterface()->RegisterPopupMenu("audit");
40}
41
42ScAuditingShell::ScAuditingShell(ScViewData& rData) :
43 SfxShell(rData.GetViewShell()),
44 rViewData( rData ),
45 nFunction( SID_FILL_ADD_PRED((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+7)
)
46{
47 SetPool( &rViewData.GetViewShell()->GetPool() );
48 SfxUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager();
49 SetUndoManager( pMgr );
50 if ( !rViewData.GetDocument().IsUndoEnabled() )
51 {
52 pMgr->SetMaxUndoActionCount( 0 );
53 }
54 SetName("Auditing");
55 SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Auditing));
56}
57
58ScAuditingShell::~ScAuditingShell()
59{
60}
61
62void ScAuditingShell::Execute( const SfxRequest& rReq )
63{
64 SfxBindings& rBindings = rViewData.GetBindings();
65 sal_uInt16 nSlot = rReq.GetSlot();
66 switch ( nSlot )
1
Control jumps to 'case 26479:' at line 83
67 {
68 case SID_FILL_ADD_PRED((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+7)
:
69 case SID_FILL_DEL_PRED((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+8)
:
70 case SID_FILL_ADD_SUCC((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+9)
:
71 case SID_FILL_DEL_SUCC((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+10)
:
72 nFunction = nSlot;
73 rBindings.Invalidate( SID_FILL_ADD_PRED((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+7)
);
74 rBindings.Invalidate( SID_FILL_DEL_PRED((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+8)
);
75 rBindings.Invalidate( SID_FILL_ADD_SUCC((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+9)
);
76 rBindings.Invalidate( SID_FILL_DEL_SUCC((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+10)
);
77 break;
78 case SID_CANCEL((26000 + 521) + 36): // Escape
79 case SID_FILL_NONE((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+11)
:
80 rViewData.GetViewShell()->SetAuditShell( false );
81 break;
82
83 case SID_FILL_SELECT((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+12)
:
84 {
85 const SfxItemSet* pReqArgs = rReq.GetArgs();
86 if ( pReqArgs )
2
Assuming 'pReqArgs' is non-null
3
Taking true branch
87 {
88 const SfxPoolItem* pXItem;
89 const SfxPoolItem* pYItem;
90 if ( pReqArgs->GetItemState( SID_RANGE_COL((((26000 + 521) + 50))+21), true, &pXItem ) == SfxItemState::SET
4
Assuming the condition is true
7
Taking true branch
91 && pReqArgs->GetItemState( SID_RANGE_ROW((((26000 + 521) + 50))+20), true, &pYItem ) == SfxItemState::SET )
5
Value assigned to 'pYItem'
6
Assuming the condition is true
92 {
93 OSL_ENSURE( dynamic_cast<const SfxInt16Item*>( pXItem) != nullptr && dynamic_cast<const SfxInt32Item*>( pYItem) != nullptr,do { if (true && (!(dynamic_cast<const SfxInt16Item
*>( pXItem) != nullptr && dynamic_cast<const SfxInt32Item
*>( pYItem) != nullptr))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/sc/source/ui/view/auditsh.cxx"
":" "94" ": "), "%s", "wrong items"); } } while (false)
8
Assuming the condition is true
9
Assuming pointer value is null
10
Taking true branch
11
Loop condition is false. Exiting loop
94 "wrong items" )do { if (true && (!(dynamic_cast<const SfxInt16Item
*>( pXItem) != nullptr && dynamic_cast<const SfxInt32Item
*>( pYItem) != nullptr))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/sc/source/ui/view/auditsh.cxx"
":" "94" ": "), "%s", "wrong items"); } } while (false)
;
95 SCCOL nCol = static_cast<SCCOL>(static_cast<const SfxInt16Item*>(pXItem)->GetValue());
96 SCROW nRow = static_cast<SCROW>(static_cast<const SfxInt32Item*>(pYItem)->GetValue());
12
Called C++ object pointer is null
97 ScViewFunc* pView = rViewData.GetView();
98 pView->MoveCursorAbs( nCol, nRow, SC_FOLLOW_LINE, false, false );
99 switch ( nFunction )
100 {
101 case SID_FILL_ADD_PRED((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+7)
:
102 pView->DetectiveAddPred();
103 break;
104 case SID_FILL_DEL_PRED((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+8)
:
105 pView->DetectiveDelPred();
106 break;
107 case SID_FILL_ADD_SUCC((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+9)
:
108 pView->DetectiveAddSucc();
109 break;
110 case SID_FILL_DEL_SUCC((((((((((((((((((((((((((26000 + 200) + 20)) + 20)) + 20)) +
25)) + 22)) + 20)) + 29)) + 20))+20))+1))+50))+20))+10)
:
111 pView->DetectiveDelSucc();
112 break;
113 }
114 }
115 }
116 }
117 break;
118 }
119}
120
121void ScAuditingShell::GetState( SfxItemSet& rSet )
122{
123 rSet.Put( SfxBoolItem( nFunction, true ) ); // mark active functions
124}
125
126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */