fix: Allow n() function to count (empty) cells off edge of sheet #84

Merged
glen merged 1 commits from range_crash into main 2023-04-09 19:28:58 +00:00
3 changed files with 17 additions and 6 deletions
Showing only changes of commit 44554be5d4 - Show all commits

View File

@ -93,3 +93,8 @@ include(CPack)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
add_custom_target(
print_build_type
COMMAND ${CMAKE_COMMAND} -E echo $<$<CONFIG:>:Undefined>$<$<NOT:$<CONFIG:>>:$<CONFIG>>
)

View File

@ -8463,6 +8463,13 @@ l1
l1
\emph default
defaults to the current location.
If any dimension of either location is negative, that component is simply
taken as 0.
In other words, locations off the sheet are considered empty, but it is
not an error to access them.
\begin_inset Newline newline
\end_inset
The second form simply returns the number of its arguments which are nonempty.
\end_layout

View File

@ -30,16 +30,15 @@
#include "utf8.h"
/*}}}*/
/* posorder -- sort two integers */ /*{{{*/
/* posorder -- sort two integers, clamping each to be nonnegative. */ /*{{{*/
void posorder(int *x, int *y)
{
assert(x != (int*)0);
assert(*x >= 0);
assert(y != (int*)0);
assert(*y >= 0);
if (*x < 0) *x = 0;
if (*y < 0) *y = 0;
if (*x > *y)
{
if (*x > *y) {
int t = *x;
*x = *y;
*y = t;