[Libreoffice-commits] core.git: sd/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Oct 21 21:12:02 UTC 2018
sd/source/filter/ppt/pptin.cxx | 108 ++++++++++++++++++++---------------------
1 file changed, 54 insertions(+), 54 deletions(-)
New commits:
commit ebab5c3cdffd5ef51919ff00cd20654a6abdf966
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sun Oct 21 21:50:03 2018 +0200
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sun Oct 21 23:11:39 2018 +0200
tdf#120703 (PVS): missing nullptr check; redundant nullptr check
V1004 The 'pDocShell' pointer was used unsafely after it was verified
against nullptr. Check lines: 258, 561.
V668 There is no sense in testing the 'pFrameView' pointer against null,
as the memory was allocated using the 'new' operator. The exception
will be generated in the case of memory allocation error.
Change-Id: I768d3f56dbd5edd070da9d989ab2d85c4b8e868f
Reviewed-on: https://gerrit.libreoffice.org/62149
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 16ed1e845c9a..4724a6f3df70 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -548,18 +548,21 @@ bool ImplSdPPTImport::Import()
}
}
- Size aVisAreaSize;
- switch ( aUserEditAtom.eLastViewType )
+ if (pDocShell)
{
- case PptViewTypeEnum::Notes:
- case PptViewTypeEnum::NotesMaster:
- aVisAreaSize = aDocAtom.GetNotesPageSize();
- break;
- default :
- aVisAreaSize = aDocAtom.GetSlidesPageSize();
+ Size aVisAreaSize;
+ switch ( aUserEditAtom.eLastViewType )
+ {
+ case PptViewTypeEnum::Notes:
+ case PptViewTypeEnum::NotesMaster:
+ aVisAreaSize = aDocAtom.GetNotesPageSize();
+ break;
+ default :
+ aVisAreaSize = aDocAtom.GetSlidesPageSize();
+ }
+ Scale( aVisAreaSize );
+ pDocShell->SetVisArea( ::tools::Rectangle( Point(), aVisAreaSize ) );
}
- Scale( aVisAreaSize );
- pDocShell->SetVisArea( ::tools::Rectangle( Point(), aVisAreaSize ) );
// create master pages:
@@ -1232,54 +1235,51 @@ bool ImplSdPPTImport::Import()
pFrameView = new ::sd::FrameView( mpDoc );
rViews.push_back( std::unique_ptr<sd::FrameView>(pFrameView) );
}
- if ( pFrameView )
- {
- sal_uInt16 nSelectedPage = 0;
- PageKind ePageKind = PageKind::Standard;
- EditMode eEditMode = EditMode::Page;
+ sal_uInt16 nSelectedPage = 0;
+ PageKind ePageKind = PageKind::Standard;
+ EditMode eEditMode = EditMode::Page;
- switch ( aUserEditAtom.eLastViewType )
+ switch ( aUserEditAtom.eLastViewType )
+ {
+ case PptViewTypeEnum::Outline:
{
- case PptViewTypeEnum::Outline:
- {
- SfxItemSet* pSet = mrMed.GetItemSet();
- if ( pSet )
- pSet->Put( SfxUInt16Item( SID_VIEW_ID, 3 ) );
- }
- break;
- case PptViewTypeEnum::SlideSorter:
- {
- SfxItemSet* pSet = mrMed.GetItemSet();
- if ( pSet )
- pSet->Put( SfxUInt16Item( SID_VIEW_ID, 2 ) );
- }
- break;
- case PptViewTypeEnum::TitleMaster:
- nSelectedPage = 1;
- SAL_FALLTHROUGH;
- case PptViewTypeEnum::SlideMaster:
- {
- ePageKind = PageKind::Standard;
- eEditMode = EditMode::MasterPage;
- }
- break;
- case PptViewTypeEnum::NotesMaster:
- eEditMode = EditMode::MasterPage;
- SAL_FALLTHROUGH;
- case PptViewTypeEnum::Notes:
- ePageKind = PageKind::Notes;
- break;
- case PptViewTypeEnum::Handout:
- ePageKind = PageKind::Handout;
- break;
- default :
- case PptViewTypeEnum::Slide:
- break;
+ SfxItemSet* pSet = mrMed.GetItemSet();
+ if ( pSet )
+ pSet->Put( SfxUInt16Item( SID_VIEW_ID, 3 ) );
+ }
+ break;
+ case PptViewTypeEnum::SlideSorter:
+ {
+ SfxItemSet* pSet = mrMed.GetItemSet();
+ if ( pSet )
+ pSet->Put( SfxUInt16Item( SID_VIEW_ID, 2 ) );
+ }
+ break;
+ case PptViewTypeEnum::TitleMaster:
+ nSelectedPage = 1;
+ SAL_FALLTHROUGH;
+ case PptViewTypeEnum::SlideMaster:
+ {
+ ePageKind = PageKind::Standard;
+ eEditMode = EditMode::MasterPage;
}
- pFrameView->SetPageKind( ePageKind );
- pFrameView->SetSelectedPage( nSelectedPage );
- pFrameView->SetViewShEditMode( eEditMode );
+ break;
+ case PptViewTypeEnum::NotesMaster:
+ eEditMode = EditMode::MasterPage;
+ SAL_FALLTHROUGH;
+ case PptViewTypeEnum::Notes:
+ ePageKind = PageKind::Notes;
+ break;
+ case PptViewTypeEnum::Handout:
+ ePageKind = PageKind::Handout;
+ break;
+ default :
+ case PptViewTypeEnum::Slide:
+ break;
}
+ pFrameView->SetPageKind( ePageKind );
+ pFrameView->SetSelectedPage( nSelectedPage );
+ pFrameView->SetViewShEditMode( eEditMode );
}
DffRecordHeader aCustomShowHeader;
// read and set custom show
More information about the Libreoffice-commits
mailing list