summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/fontworkgallery.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-14 13:22:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-12-14 15:48:43 +0100
commit2dfe7702a08e74a140f2e55f1625ab780f0e8c2a (patch)
treecdc7fb68f59f3b291fb323987076fee26f20ed27 /svx/source/tbxctrls/fontworkgallery.cxx
parent12e878d3b5e8a59079811c36b7c89e588266dd0e (diff)
coverity#1441522 FontWorkGalleryDialog mpSdrView member is never null
Change-Id: If17d2984831b0881d39101648206accdadde12aa Reviewed-on: https://gerrit.libreoffice.org/65163 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/tbxctrls/fontworkgallery.cxx')
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 3b88ab1d78c7..b21db9d4220d 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -65,10 +65,10 @@ namespace svx
const int nColCount = 4;
const int nLineCount = 4;
-FontWorkGalleryDialog::FontWorkGalleryDialog(weld::Window* pParent, SdrView* pSdrView)
+FontWorkGalleryDialog::FontWorkGalleryDialog(weld::Window* pParent, SdrView& rSdrView)
: GenericDialogController(pParent, "svx/ui/fontworkgallerydialog.ui", "FontworkGalleryDialog")
, mnThemeId(0xffff)
- , mpSdrView(pSdrView)
+ , mrSdrView(rSdrView)
, mppSdrObject(nullptr)
, mpDestModel(nullptr)
, maCtlFavorites(m_xBuilder->weld_scrolled_window("ctlFavoriteswin"))
@@ -191,20 +191,20 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
// only caller of ::SetSdrObjectRef. Only in that case mpDestModel seems
// to be the correct target SdrModel.
// If this is not used, the correct SdrModel seems to be the one from
- // the mpSdrView that is used to insert (InsertObjectAtView below) the
+ // the mrSdrView that is used to insert (InsertObjectAtView below) the
// cloned SdrObject.
const bool bUseSpecialCalcMode(nullptr != mppSdrObject && nullptr != mpDestModel);
- const bool bSdrViewInsertMode(nullptr != mpSdrView);
+ const bool bSdrViewInsertMode(true);
// center shape on current view
- OutputDevice* pOutDev(mpSdrView->GetFirstOutputDevice());
+ OutputDevice* pOutDev(mrSdrView.GetFirstOutputDevice());
if(pOutDev && (bUseSpecialCalcMode || bSdrViewInsertMode))
{
// Clone directly to target SdrModel (may be different due to user/caller (!))
SdrObject* pNewObject(
pPage->GetObj(0)->CloneSdrObject(
- bUseSpecialCalcMode ? *mpDestModel : mpSdrView->getSdrModelFromSdrView()));
+ bUseSpecialCalcMode ? *mpDestModel : mrSdrView.getSdrModelFromSdrView()));
// tdf#117629
// Since the 'old' ::CloneSdrObject also copies the SdrPage* the
@@ -232,11 +232,11 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
}
else // bSdrViewInsertMode
{
- SdrPageView* pPV(mpSdrView->GetSdrPageView());
+ SdrPageView* pPV(mrSdrView.GetSdrPageView());
- if(nullptr != pPV)
+ if (nullptr != pPV)
{
- mpSdrView->InsertObjectAtView( pNewObject, *pPV );
+ mrSdrView.InsertObjectAtView( pNewObject, *pPV );
}
else
{