summaryrefslogtreecommitdiff
path: root/vcl/source/window/printdlg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-27 10:21:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-27 12:57:27 +0000
commit43d42775cb9e1d1c4a9abb415321963916b76db3 (patch)
tree9c202282f14384fb7f08a8cf0f86058812be68f6 /vcl/source/window/printdlg.cxx
parent3ed04054d3b10a932e0a74d765bc7575ebcc4e85 (diff)
coverity#1187659 Dereference after null check
Change-Id: I31b1a55a72be7fac80cd7bbac52b723d7e33a13a
Diffstat (limited to 'vcl/source/window/printdlg.cxx')
-rw-r--r--vcl/source/window/printdlg.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 9ec2a83e0f05..8abf77fddbbf 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -944,6 +944,10 @@ void PrintDialog::setupOptionalUI()
TabPage *pPage = get<TabPage>(aID);
if (!pPage && mpCustomOptionsUIBuilder)
pPage = mpCustomOptionsUIBuilder->get<TabPage>(aID);
+
+ if (!pPage)
+ continue;
+
sal_uInt16 nPageId = mpTabCtrl->GetPageId(*pPage);
mpTabCtrl->SetPageText(nPageId, aText);
@@ -964,6 +968,9 @@ void PrintDialog::setupOptionalUI()
if (!pFrame && mpCustomOptionsUIBuilder)
pFrame = mpCustomOptionsUIBuilder->get<Window>(aID);
+ if (!pFrame)
+ continue;
+
pFrame->SetText(aText);
// set help id
@@ -1002,6 +1009,9 @@ void PrintDialog::setupOptionalUI()
if (!pNewBox && mpCustomOptionsUIBuilder)
pNewBox = mpCustomOptionsUIBuilder->get<CheckBox>(aID);
+ if (!pNewBox)
+ continue;
+
pNewBox->SetText( aText );
pNewBox->Show();
@@ -1036,6 +1046,9 @@ void PrintDialog::setupOptionalUI()
if (!pBtn && mpCustomOptionsUIBuilder)
pBtn = mpCustomOptionsUIBuilder->get<RadioButton>(aID);
+ if (!pBtn)
+ continue;
+
pBtn->SetText( aChoices[m] );
pBtn->Check( m == nSelectVal );
pBtn->SetToggleHdl( LINK( this, PrintDialog, UIOption_RadioHdl ) );
@@ -1059,6 +1072,9 @@ void PrintDialog::setupOptionalUI()
if (!pList && mpCustomOptionsUIBuilder)
pList = mpCustomOptionsUIBuilder->get<ListBox>(aID);
+ if (!pList)
+ continue;
+
// iterate options
for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
{
@@ -1087,6 +1103,9 @@ void PrintDialog::setupOptionalUI()
if (!pField && mpCustomOptionsUIBuilder)
pField = mpCustomOptionsUIBuilder->get<NumericField>(aID);
+ if (!pField)
+ continue;
+
// set min/max and current value
if( nMinValue != nMaxValue )
{
@@ -1115,6 +1134,9 @@ void PrintDialog::setupOptionalUI()
if (!pField && mpCustomOptionsUIBuilder)
pField = mpCustomOptionsUIBuilder->get<Edit>(aID);
+ if (!pField)
+ continue;
+
OUString aCurVal;
PropertyValue* pVal = maPController->getValue( aPropertyName );
if( pVal && pVal->Value.hasValue() )