summaryrefslogtreecommitdiff
path: root/sc/source/ui/app
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 09:25:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 20:59:31 +0200
commit61d8db6b1a2026a29f61eaa691beb3c6cf05de5c (patch)
treefc81eda81cf811256290c3e564166ef217f8268e /sc/source/ui/app
parent7baa60a5e9a8c48829f47db8cd98d0f05a30e235 (diff)
loplugin:buriedassign in sc
Change-Id: I9b4146c4e8814a36c7bfcd4c31f913c8412320e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92244 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/app')
-rw-r--r--sc/source/ui/app/drwtrans.cxx19
-rw-r--r--sc/source/ui/app/inputhdl.cxx11
-rw-r--r--sc/source/ui/app/seltrans.cxx19
3 files changed, 29 insertions, 20 deletions
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 9b6529b18601..ac338fa2c115 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -142,17 +142,18 @@ ScDrawTransferObj::ScDrawTransferObj( std::unique_ptr<SdrModel> pClipModel, ScDo
if ( (aAny >>= sTmp) && !sTmp.isEmpty() )
{
OUString aUrl = sTmp;
- OUString aAbs;
- const SfxMedium* pMedium;
- if (pContainerShell && (pMedium = pContainerShell->GetMedium()) != nullptr)
+ OUString aAbs = aUrl;
+ if (pContainerShell)
{
- bool bWasAbs = true;
- aAbs = pMedium->GetURLObject().smartRel2Abs( aUrl, bWasAbs ).
- GetMainURL(INetURLObject::DecodeMechanism::NONE);
- // full path as stored INetBookmark must be encoded
+ const SfxMedium* pMedium = pContainerShell->GetMedium();
+ if (pMedium)
+ {
+ bool bWasAbs = true;
+ aAbs = pMedium->GetURLObject().smartRel2Abs( aUrl, bWasAbs ).
+ GetMainURL(INetURLObject::DecodeMechanism::NONE);
+ // full path as stored INetBookmark must be encoded
+ }
}
- else
- aAbs = aUrl;
// Label
OUString aLabel;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index bea2cc244eb3..530ad88ab0b7 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3265,8 +3265,13 @@ void ScInputHandler::AddRefEntry()
OUString aText = GetEditText(mpEditEngine.get());
sal_Unicode cLastChar = 0;
sal_Int32 nPos = aText.getLength() - 1;
- while (nPos >= 0 && ((cLastChar = aText[nPos]) == ' ')) //checking space
+ while (nPos >= 0) //checking space
+ {
+ cLastChar = aText[nPos];
+ if (cLastChar != ' ')
+ break;
--nPos;
+ }
bool bAppendSeparator = (cLastChar != '(' && cLastChar != cSep && cLastChar != '=');
if (bAppendSeparator)
@@ -3285,7 +3290,9 @@ void ScInputHandler::SetReference( const ScRange& rRef, const ScDocument& rDoc )
HideTip();
const ScDocument* pThisDoc = nullptr;
- bool bOtherDoc = (pRefViewSh && ((pThisDoc = pRefViewSh->GetViewData().GetDocument()) != &rDoc));
+ if (pRefViewSh)
+ pThisDoc = pRefViewSh->GetViewData().GetDocument();
+ bool bOtherDoc = (pThisDoc != &rDoc);
if (bOtherDoc && !rDoc.GetDocumentShell()->HasName())
{
// References to unnamed document; that doesn't work
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index a2f4b44c8c45..1757b64749bd 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -114,16 +114,17 @@ ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView
// allow MultiMarked because GetSimpleArea may be able to merge into a simple range
// (GetSimpleArea modifies a local copy of MarkData)
// Also allow simple filtered area.
- ScMarkType eMarkType;
- if ( ( rMark.IsMarked() || rMark.IsMultiMarked() ) &&
- (((eMarkType = rViewData.GetSimpleArea( aRange )) == SC_MARK_SIMPLE) ||
- (eMarkType == SC_MARK_SIMPLE_FILTERED)) )
+ if ( rMark.IsMarked() || rMark.IsMultiMarked() )
{
- // only for "real" selection, cursor alone isn't used
- if ( aRange.aStart == aRange.aEnd )
- eMode = SC_SELTRANS_CELL;
- else
- eMode = SC_SELTRANS_CELLS;
+ ScMarkType eMarkType = rViewData.GetSimpleArea( aRange );
+ if (eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED)
+ {
+ // only for "real" selection, cursor alone isn't used
+ if ( aRange.aStart == aRange.aEnd )
+ eMode = SC_SELTRANS_CELL;
+ else
+ eMode = SC_SELTRANS_CELLS;
+ }
}
}