coverity#704777 Explicit null dereferenced

Change-Id: Ia9a3a45183b7aa8367b3146061bde5036bcd8cfe
This commit is contained in:
Caolán McNamara
2014-12-15 09:33:09 +00:00
parent d03d1ad55e
commit 52a242e5bc
2 changed files with 16 additions and 14 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ public:
: mpDoc(pSdDrawDocument) {}
virtual ~SdUndoAction() {}
void SetComment(OUString& rStr) { maComment = rStr; }
void SetComment(const OUString& rStr) { maComment = rStr; }
virtual OUString GetComment() const SAL_OVERRIDE { return maComment; }
virtual SdUndoAction* Clone() const { return NULL; }
+15 -13
View File
@@ -492,20 +492,14 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
Size aPageSize = mpActualPage->GetSize();
Size aViewSize = GetActiveWindow()->GetViewSize();
SdUndoGroup* pUndoGroup = NULL;
if ( rReq.GetSlot() == SID_ATTR_LONG_LRSPACE ||
rReq.GetSlot() == SID_ATTR_LONG_ULSPACE )
{
pUndoGroup = new SdUndoGroup(GetDoc());
OUString aString(SdResId(STR_UNDO_CHANGE_PAGEBORDER));
pUndoGroup->SetComment(aString);
}
switch ( rReq.GetSlot() )
{
case SID_ATTR_LONG_LRSPACE:
{
SdUndoGroup* pUndoGroup = new SdUndoGroup(GetDoc());
pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEBORDER));
const SvxLongLRSpaceItem& rLRSpace = static_cast<const SvxLongLRSpaceItem&>(
pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_LRSPACE)));
@@ -559,10 +553,17 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
}
InvalidateWindows();
}
// give the undo group to the undo manager
GetViewFrame()->GetObjectShell()->GetUndoManager()->
AddUndoAction(pUndoGroup);
break;
}
case SID_ATTR_LONG_ULSPACE:
{
SdUndoGroup* pUndoGroup = new SdUndoGroup(GetDoc());
pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEBORDER));
const SvxLongULSpaceItem& rULSpace = static_cast<const SvxLongULSpaceItem&>(
pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_ULSPACE)));
@@ -617,6 +618,11 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
}
InvalidateWindows();
}
// give the undo group to the undo manager
GetViewFrame()->GetObjectShell()->GetUndoManager()->
AddUndoAction(pUndoGroup);
break;
}
@@ -846,10 +852,6 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
break;
}
}
if ( pUndoGroup )
// give the undo group to the undo manager
GetViewFrame()->GetObjectShell()->GetUndoManager()->
AddUndoAction(pUndoGroup);
}
void DrawViewShell::GetRulerState(SfxItemSet& rSet)