diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-04-08 12:20:51 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-04-08 14:49:14 +0200 |
commit | 1e75673b50e7fcac11bbfaaf4ef7308e95c0a49d (patch) | |
tree | fdd061011344a11d601731a5584917ee2d978513 | |
parent | b6d2d6db28eec4ab311c4223cf5be508feb2e057 (diff) |
Adapted one more SdrModel usage
...to be more local and make use of getting a reference
now from it's soure
Change-Id: I365df886fe8c489badab0fd4dcf1e9d414204577
Reviewed-on: https://gerrit.libreoffice.org/52585
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
-rw-r--r-- | filter/source/svg/svgexport.cxx | 21 | ||||
-rw-r--r-- | filter/source/svg/svgfilter.cxx | 1 | ||||
-rw-r--r-- | filter/source/svg/svgfilter.hxx | 1 |
3 files changed, 10 insertions, 13 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 056c1c7fa5c9..f4ab91bb6461 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -549,6 +549,8 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) for(uno::Reference<drawing::XDrawPage> & mMasterPageTarget : mMasterPageTargets) implRegisterInterface( mMasterPageTarget ); + SdrModel* pSdrModel(nullptr); + try { mxDefaultPage = mSelectedPages[0]; @@ -560,17 +562,14 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) if( pSvxDrawPage ) { mpDefaultSdrPage = pSvxDrawPage->GetSdrPage(); - mpSdrModel = &mpDefaultSdrPage->getSdrModelFromSdrPage(); - - if( mpSdrModel ) // TTTT should be reference - { - SdrOutliner& rOutl = mpSdrModel->GetDrawOutliner(); + pSdrModel = &mpDefaultSdrPage->getSdrModelFromSdrPage(); + SdrOutliner& rOutl = pSdrModel->GetDrawOutliner(); - maOldFieldHdl = rOutl.GetCalcFieldValueHdl(); - maNewFieldHdl = LINK(this, SVGFilter, CalcFieldHdl); - rOutl.SetCalcFieldValueHdl(maNewFieldHdl); - } + maOldFieldHdl = rOutl.GetCalcFieldValueHdl(); + maNewFieldHdl = LINK(this, SVGFilter, CalcFieldHdl); + rOutl.SetCalcFieldValueHdl(maNewFieldHdl); } + bRet = implExportDocument(); } } @@ -581,14 +580,14 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) OSL_FAIL( "Exception caught" ); } - if( mpSdrModel ) + if( nullptr != pSdrModel ) { // fdo#62682 The maNewFieldHdl can end up getting copied // into various other outliners which live past this // method, so get the full list of outliners and restore // the maOldFieldHdl for all that have ended up using // maNewFieldHdl - std::vector<SdrOutliner*> aOutliners(mpSdrModel->GetActiveOutliners()); + std::vector<SdrOutliner*> aOutliners(pSdrModel->GetActiveOutliners()); for (auto const& outliner : aOutliners) { if (maNewFieldHdl == outliner->GetCalcFieldValueHdl()) diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index ed8c632a6535..94fe876e3faa 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -68,7 +68,6 @@ SVGFilter::SVGFilter( const Reference< XComponentContext >& rxCtx ) : mpSVGFontExport( nullptr ), mpSVGWriter( nullptr ), mpDefaultSdrPage( nullptr ), - mpSdrModel( nullptr ), mbPresentation( false ), mbSinglePage( false ), mnVisiblePage( -1 ), diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index 51ef81573fb1..63616a9e0c53 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -198,7 +198,6 @@ private: SVGFontExport* mpSVGFontExport; SVGActionWriter* mpSVGWriter; SdrPage* mpDefaultSdrPage; - SdrModel* mpSdrModel; bool mbPresentation; bool mbSinglePage; sal_Int32 mnVisiblePage; |