loplugin:datamembershadow in SdGenericDrawPage

Change-Id: I0c7a08206b6480ba954464be1782d4577483b15e
Reviewed-on: https://gerrit.libreoffice.org/54106
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-05-10 11:54:31 +02:00
parent 7758d6609d
commit 1b0b0f3c64
2 changed files with 10 additions and 10 deletions

View File

@@ -59,7 +59,7 @@ class SdGenericDrawPage : public SvxFmDrawPage,
public css::document::XLinkTargetSupplier public css::document::XLinkTargetSupplier
{ {
private: private:
SdXImpressDocument* mpModel; SdXImpressDocument* mpDocModel;
SdrModel* mpSdrModel; SdrModel* mpSdrModel;
bool mbIsImpressDocument; bool mbIsImpressDocument;
sal_Int16 mnTempPageNumber; // for printing handouts sal_Int16 mnTempPageNumber; // for printing handouts

View File

@@ -341,15 +341,15 @@ sal_Int64 SAL_CALL SdGenericDrawPage::getSomething( const css::uno::Sequence< sa
SdGenericDrawPage::SdGenericDrawPage(SdXImpressDocument* _pModel, SdPage* pInPage, const SvxItemPropertySet* _pSet) SdGenericDrawPage::SdGenericDrawPage(SdXImpressDocument* _pModel, SdPage* pInPage, const SvxItemPropertySet* _pSet)
: SvxFmDrawPage( static_cast<SdrPage*>(pInPage) ), : SvxFmDrawPage( static_cast<SdrPage*>(pInPage) ),
SdUnoSearchReplaceShape(this), SdUnoSearchReplaceShape(this),
mpModel ( _pModel ), mpDocModel( _pModel ),
mpSdrModel(nullptr), mpSdrModel(nullptr),
mbIsImpressDocument(false), mbIsImpressDocument(false),
mnTempPageNumber(0), mnTempPageNumber(0),
mpPropSet ( _pSet ) mpPropSet ( _pSet )
{ {
mpSdrModel = SvxFmDrawPage::mpModel; mpSdrModel = SvxFmDrawPage::mpModel;
if( mpModel ) if( mpDocModel )
mbIsImpressDocument = mpModel->IsImpressDocument(); mbIsImpressDocument = mpDocModel->IsImpressDocument();
} }
@@ -359,7 +359,7 @@ SdGenericDrawPage::~SdGenericDrawPage() throw()
void SdGenericDrawPage::throwIfDisposed() const void SdGenericDrawPage::throwIfDisposed() const
{ {
if( (SvxFmDrawPage::mpModel == nullptr) || (mpModel == nullptr) || (SvxFmDrawPage::mpPage == nullptr) ) if( (SvxFmDrawPage::mpModel == nullptr) || (mpDocModel == nullptr) || (SvxFmDrawPage::mpPage == nullptr) )
throw lang::DisposedException(); throw lang::DisposedException();
} }
@@ -367,7 +367,7 @@ SdXImpressDocument* SdGenericDrawPage::GetModel() const
{ {
if( mpSdrModel != SvxFmDrawPage::mpModel ) if( mpSdrModel != SvxFmDrawPage::mpModel )
const_cast<SdGenericDrawPage*>(this)->UpdateModel(); const_cast<SdGenericDrawPage*>(this)->UpdateModel();
return mpModel; return mpDocModel;
} }
bool SdGenericDrawPage::IsImpressDocument() const bool SdGenericDrawPage::IsImpressDocument() const
@@ -384,13 +384,13 @@ void SdGenericDrawPage::UpdateModel()
if( mpSdrModel ) if( mpSdrModel )
{ {
uno::Reference< uno::XInterface > xModel( SvxFmDrawPage::mpModel->getUnoModel() ); uno::Reference< uno::XInterface > xModel( SvxFmDrawPage::mpModel->getUnoModel() );
mpModel = SdXImpressDocument::getImplementation( xModel ); mpDocModel = SdXImpressDocument::getImplementation( xModel );
} }
else else
{ {
mpModel = nullptr; mpDocModel = nullptr;
} }
mbIsImpressDocument = mpModel && mpModel->IsImpressDocument(); mbIsImpressDocument = mpDocModel && mpDocModel->IsImpressDocument();
} }
// this is called whenever a SdrObject must be created for a empty api shape wrapper // this is called whenever a SdrObject must be created for a empty api shape wrapper
@@ -1862,7 +1862,7 @@ void SdGenericDrawPage::release() throw()
// XComponent // XComponent
void SdGenericDrawPage::disposing() throw() void SdGenericDrawPage::disposing() throw()
{ {
mpModel = nullptr; mpDocModel = nullptr;
SvxFmDrawPage::disposing(); SvxFmDrawPage::disposing();
} }