From 27f15f1d50b1b67c940bf57e1581240011806159 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 22 Jan 2024 09:45:16 +0200 Subject: simplify the getters in AbstractSvx*Dialog to look like getters elsewhere, which compose better Change-Id: I23277910d3fb3c08fa6e839f0fbec010915e951a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162362 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/uibase/shells/drwbassh.cxx | 15 +++++---------- sw/source/uibase/shells/frmsh.cxx | 13 ++++--------- 2 files changed, 9 insertions(+), 19 deletions(-) (limited to 'sw/source/uibase/shells') diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index d5eec2132093..1789b3f374d4 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -596,7 +596,7 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq) if(RET_OK == pDlg->Execute()) { const OUString aOrigName = aName; - pDlg->GetName(aName); + aName = pDlg->GetName(); pSelected->SetName(aName); pSh->SetModified(); @@ -631,13 +631,9 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq) if(RET_OK == pDlg->Execute()) { - pDlg->GetTitle(aTitle); - pDlg->GetDescription(aDescription); - pDlg->IsDecorative(isDecorative); - - pSelected->SetTitle(aTitle); - pSelected->SetDescription(aDescription); - pSelected->SetDecorative(isDecorative); + pSelected->SetTitle(pDlg->GetTitle()); + pSelected->SetDescription(pDlg->GetDescription()); + pSelected->SetDecorative(pDlg->IsDecorative()); pSh->SetModified(); } @@ -717,8 +713,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog& OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection"); SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); const OUString sCurrentName = pObj->GetName(); - OUString sNewName; - rNameDialog.GetName(sNewName); + OUString sNewName = rNameDialog.GetName(); bool bRet = false; if (sNewName.isEmpty() || sCurrentName == sNewName) bRet = true; diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index ac5ee0d80835..fa0dd795447c 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -680,8 +680,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) if ( pDlg->Execute() == RET_OK ) { - pDlg->GetName(aName); - rSh.SetFlyName(aName); + rSh.SetFlyName(pDlg->GetName()); } } } @@ -705,13 +704,9 @@ void SwFrameShell::Execute(SfxRequest &rReq) if ( pDlg->Execute() == RET_OK ) { - pDlg->GetDescription(aDescription); - pDlg->GetTitle(aTitle); - pDlg->IsDecorative(isDecorative); - - rSh.SetObjDescription(aDescription); - rSh.SetObjTitle(aTitle); - rSh.SetObjDecorative(isDecorative); + rSh.SetObjDescription(pDlg->GetDescription()); + rSh.SetObjTitle(pDlg->GetTitle()); + rSh.SetObjDecorative(pDlg->IsDecorative()); } } } -- cgit