summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/appluno.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-09 11:54:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-09 15:48:32 +0200
commit0e1264f44ce421f6b175598fff68a15ccc8b5449 (patch)
tree205188c2842de6f539d7fef504b5520c58996950 /sc/source/ui/unoobj/appluno.cxx
parentf97077c5fe41195bf2054892ae08e3307983e6dc (diff)
loplugin:flatten in sc/ui/unoobj
Change-Id: I9b03672387aa555eb11149763a1113e0768f3f37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj/appluno.cxx')
-rw-r--r--sc/source/ui/unoobj/appluno.cxx52
1 files changed, 26 insertions, 26 deletions
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index e13722131b42..c5a3137419e5 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -448,34 +448,34 @@ static void lcl_FillSequence( uno::Sequence<beans::PropertyValue>& rSequence, co
pArray[3].Value <<= *rDesc.mxFuncDesc;
pArray[4].Name = SC_UNONAME_ARGUMENTS;
- if (!rDesc.maDefArgNames.empty() && !rDesc.maDefArgDescs.empty() && rDesc.pDefArgFlags )
+ if (rDesc.maDefArgNames.empty() || rDesc.maDefArgDescs.empty() || !rDesc.pDefArgFlags)
+ return;
+
+ sal_uInt16 nCount = rDesc.nArgCount;
+ if (nCount >= PAIRED_VAR_ARGS)
+ nCount -= PAIRED_VAR_ARGS - 2;
+ else if (nCount >= VAR_ARGS)
+ nCount -= VAR_ARGS - 1;
+ sal_uInt16 nSeqCount = rDesc.GetSuppressedArgCount();
+ if (nSeqCount >= PAIRED_VAR_ARGS)
+ nSeqCount -= PAIRED_VAR_ARGS - 2;
+ else if (nSeqCount >= VAR_ARGS)
+ nSeqCount -= VAR_ARGS - 1;
+
+ if (!nSeqCount)
+ return;
+
+ uno::Sequence<sheet::FunctionArgument> aArgSeq(nSeqCount);
+ sheet::FunctionArgument* pArgAry = aArgSeq.getArray();
+ for (sal_uInt16 i=0, j=0; i<nCount; i++)
{
- sal_uInt16 nCount = rDesc.nArgCount;
- if (nCount >= PAIRED_VAR_ARGS)
- nCount -= PAIRED_VAR_ARGS - 2;
- else if (nCount >= VAR_ARGS)
- nCount -= VAR_ARGS - 1;
- sal_uInt16 nSeqCount = rDesc.GetSuppressedArgCount();
- if (nSeqCount >= PAIRED_VAR_ARGS)
- nSeqCount -= PAIRED_VAR_ARGS - 2;
- else if (nSeqCount >= VAR_ARGS)
- nSeqCount -= VAR_ARGS - 1;
-
- if (nSeqCount)
- {
- uno::Sequence<sheet::FunctionArgument> aArgSeq(nSeqCount);
- sheet::FunctionArgument* pArgAry = aArgSeq.getArray();
- for (sal_uInt16 i=0, j=0; i<nCount; i++)
- {
- sheet::FunctionArgument aArgument;
- aArgument.Name = rDesc.maDefArgNames[i];
- aArgument.Description = rDesc.maDefArgDescs[i];
- aArgument.IsOptional = rDesc.pDefArgFlags[i].bOptional;
- pArgAry[j++] = aArgument;
- }
- pArray[4].Value <<= aArgSeq;
- }
+ sheet::FunctionArgument aArgument;
+ aArgument.Name = rDesc.maDefArgNames[i];
+ aArgument.Description = rDesc.maDefArgDescs[i];
+ aArgument.IsOptional = rDesc.pDefArgFlags[i].bOptional;
+ pArgAry[j++] = aArgument;
}
+ pArray[4].Value <<= aArgSeq;
}
// XFunctionDescriptions