summaryrefslogtreecommitdiff
path: root/svx/source/dialog
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-01 20:28:16 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-02 09:24:11 +0200
commit41590e7d1f8ee67c7d5c29c89a9b246c8c8f0f05 (patch)
tree8550293a2dc028b84799b4721b8b369eba97e6d8 /svx/source/dialog
parentcaf719c59c6dc8db2b6a0eab8d47760277f112a3 (diff)
WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: I8edb1fefe1b2b8a3db3ee8f3a0eed59c7f08a36e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166863 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'svx/source/dialog')
-rw-r--r--svx/source/dialog/connctrl.cxx2
-rw-r--r--svx/source/dialog/hdft.cxx2
-rw-r--r--svx/source/dialog/srchctrl.cxx2
-rw-r--r--svx/source/dialog/srchdlg.cxx10
-rw-r--r--svx/source/dialog/weldeditview.cxx2
5 files changed, 12 insertions, 6 deletions
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index c10bdd0fff7b..c7e1c31a6362 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -125,7 +125,7 @@ void SvxXConnectionPreview::AdaptSize()
void SvxXConnectionPreview::Construct()
{
- DBG_ASSERT( pView, "No valid view is passed on! ");
+ assert(pView && "No valid view is passed on!");
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
const size_t nMarkCount = rMarkList.GetMarkCount();
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 90c2f7450275..cc8758ad0422 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -324,7 +324,7 @@ void SvxHFPage::Reset( const SfxItemSet* rSet )
ResetBackground_Impl( *rSet );
SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Where is the pool" );
+ assert(pPool && "Where is the pool");
MapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_PAGE_SIZE ) );
// Evaluate header-/footer- attributes
diff --git a/svx/source/dialog/srchctrl.cxx b/svx/source/dialog/srchctrl.cxx
index 51c8d0333784..89315050d88e 100644
--- a/svx/source/dialog/srchctrl.cxx
+++ b/svx/source/dialog/srchctrl.cxx
@@ -53,7 +53,7 @@ void SvxSearchController::StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItem
}
else if ( SID_SEARCH_OPTIONS == nSID )
{
- DBG_ASSERT( dynamic_cast<const SfxUInt16Item* >(pState) != nullptr, "wrong item type" );
+ assert(dynamic_cast<const SfxUInt16Item* >(pState) != nullptr && "wrong item type");
SearchOptionFlags nFlags = static_cast<SearchOptionFlags>(static_cast<const SfxUInt16Item*>(pState)->GetValue());
rSrchDlg.EnableControls_Impl( nFlags );
}
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 481124e3c963..363d6a4e7146 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -81,7 +81,13 @@ using namespace com::sun::star;
using namespace comphelper;
-#define IS_MOBILE (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() && SfxViewShell::Current()->isLOKMobilePhone())
+static bool IsMobile()
+{
+ if (!comphelper::LibreOfficeKit::isActive())
+ return false;
+ SfxViewShell* pCurrent = SfxViewShell::Current();
+ return pCurrent && pCurrent->isLOKMobilePhone();
+}
enum class ModifyFlags {
NONE = 0x000000,
@@ -237,7 +243,7 @@ void SearchAttrItemList::Remove(size_t nPos)
SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind)
: SfxModelessDialogController(&rBind, pChildWin, pParent,
- IS_MOBILE ? OUString("svx/ui/findreplacedialog-mobile.ui") : OUString("svx/ui/findreplacedialog.ui"),
+ IsMobile() ? OUString("svx/ui/findreplacedialog-mobile.ui") : OUString("svx/ui/findreplacedialog.ui"),
"FindReplaceDialog")
, rBindings(rBind)
, m_aPresentIdle("Bring SvxSearchDialog to Foreground")
diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx
index ceb09f37ff81..7adda3da17fa 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -1122,7 +1122,7 @@ static SfxItemState GetSvxEditEngineItemState(EditEngine const& rEditEngine, con
for (const auto& rAttrib : aAttribs)
{
- OSL_ENSURE(rAttrib.pAttr, "GetCharAttribs gives corrupt data");
+ assert(rAttrib.pAttr && "GetCharAttribs gives corrupt data");
const bool bEmptyPortion = (rAttrib.nStart == rAttrib.nEnd);
if ((!bEmptyPortion && (rAttrib.nStart >= nEndPos))