From 48a38aabc12fe2090063b93a0424823578beb176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Garc=C3=ADa=20Pallero?= Date: Sun, 29 Dec 2024 18:29:52 +0100 Subject: [PATCH 1/4] es_ES.ts: Update Spanish translation file (bug #66616). * libgui/languages/es_ES.ts: Fix small mistakes. --- libgui/languages/es_ES.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libgui/languages/es_ES.ts b/libgui/languages/es_ES.ts index 2af5a15097..090901ca31 100644 --- a/libgui/languages/es_ES.ts +++ b/libgui/languages/es_ES.ts @@ -19,7 +19,7 @@ Background color, magenta (255, 0, 255) means default - Color de fondo; rosa (255,0,255) representa predeterminado + Color de fondo. Predeterminado a magenta (255,0,255) @@ -224,13 +224,13 @@ Horizontal alignment - Alineamiento horizontal + Alineación horizontal Vertical alignment - Alineamiento vertical + Alineación vertical @@ -501,7 +501,7 @@ Sólo estará disponible la ayuda a través de la ventana de comandos. No documentation bookmarks loaded! -No se han cargado favoritos de documentación. +No se han cargado favoritos de documentación @@ -3575,7 +3575,7 @@ esta actualmente en uso para la acción These preferences are applied after any .octaverc startup files. - Estas configuraciones se aplicarán después de la carga del archivo de inicio .octaverc. + Estas configuraciones se aplicarán después de la carga de cualquier archivo de inicio .octaverc. @@ -4008,7 +4008,7 @@ esta actualmente en uso para la acción Break lines only in comments - Partir líneas solo en comentarios + Partir líneas sólo en comentarios @@ -4170,7 +4170,7 @@ esta actualmente en uso para la acción <html><head/><body><p>If set, the focus of the widgets that are docked to the main window follows the mouse cursor. This is intended for having the same behavior within the main window when &quot;focus follows mouse&quot; is used for the desktop environment.</p></body></html> - <html><head/><body><p>Si se selecciona, el foco en los widgets anclados en la ventana principal se activa según la posición del ratón. Esto persigue un comportamiento igual al del entorno de escritorio..</p></body></html> + <html><head/><body><p>Si se selecciona, el foco en los widgets anclados en la ventana principal se activa según la posición del ratón. Esto persigue un comportamiento igual al del entorno de escritorio.</p></body></html> @@ -4334,7 +4334,7 @@ esta actualmente en uso para la acción Variable Editor Colors - Colores de editor de variables + Colores del editor de variables From e6f070916356f547764931752175a306fe4c9428 Mon Sep 17 00:00:00 2001 From: "John W. Eaton" Date: Thu, 23 Jan 2025 22:34:45 -0500 Subject: [PATCH 2/4] allow editing of lazy_index objects (bug #56690) * ov-lazy-idx.h (octave_lazy_index::edit_display): New function. --- libinterp/octave-value/ov-lazy-idx.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libinterp/octave-value/ov-lazy-idx.h b/libinterp/octave-value/ov-lazy-idx.h index fa1a1cb044..816264c3fd 100644 --- a/libinterp/octave-value/ov-lazy-idx.h +++ b/libinterp/octave-value/ov-lazy-idx.h @@ -143,6 +143,10 @@ class OCTINTERP_API octave_lazy_index : public octave_base_value void print (std::ostream& os, bool pr_as_read_syntax = false) { make_value ().print (os, pr_as_read_syntax); } + std::string edit_display (const float_display_format& fmt, + octave_idx_type i, octave_idx_type j) const + { return make_value ().edit_display (fmt, i, j); } + void print_info (std::ostream& os, const std::string& prefix) const { make_value ().print_info (os, prefix); } From c7e7cb5b04007d8c8edab18962b8176d15168fe1 Mon Sep 17 00:00:00 2001 From: Fernando Alvarruiz Date: Thu, 16 Jan 2025 18:16:11 -0500 Subject: [PATCH 3/4] Add self-tests for structfun with function without output arguments (bug #66617). * scripts/general/structfun.m: Add some built-in self-test with function that does not have any output arguments. --- scripts/general/structfun.m | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/scripts/general/structfun.m b/scripts/general/structfun.m index 74a2e22684..1b56e3dca7 100644 --- a/scripts/general/structfun.m +++ b/scripts/general/structfun.m @@ -148,3 +148,45 @@ %! [aa, bb] = structfun (@__twoouts, s, "UniformOutput", false); %! assert (aa, c); %! assert (bb, d); + +%!function __zeroout(x) +%!endfunction; + +%!test <66617> +%! s.a = 3; +%! clear ("ans"); +%! structfun (@__zeroout, s); +%! assert (! exist ("ans", "var")); + +%!test <66617> +%! s.a = 3; +%! clear ("ans"); +%! structfun (@__zeroout, s, "UniformOutput", false); +%! assert (! exist ("ans", "var")); + +%!test <66617> +%! s = struct ("a", 1, "b", 4); +%! clear ("ans"); +%! structfun (@deal, s); +%! assert (! exist ("ans", "var")); + +%!test +%! s = struct ("a", 1, "b", 4); +%! a = structfun (@deal, s); +%! assert (a, [1; 4]); + +%!test +%! s = struct ("a", 1, "b", 4); +%! [a, b] = structfun (@deal, s); +%! assert ([a, b], [1, 1; 4, 4]); + +%!test <66617> +%! s = struct (); +%! clear ("ans"); +%! structfun (@(z) z, s); +%! assert (! exist ("ans", "var")); + +%!test <66617> +%! s = struct; +%! y = structfun (@(z) z, s); +%! assert (y, zeros (0, 1)); From bf9582788255c924888cfe360e5ca8b685211a9c Mon Sep 17 00:00:00 2001 From: "John W. Eaton" Date: Thu, 16 Jan 2025 18:16:11 -0500 Subject: [PATCH 4/4] Avoid error for struct2cell with function without output arguments (bug #66617). * scripts/general/structfun.m: Correctly handle function arguments that do not return any output arguments. Mark corresponding built-in self-tests as fixed. --- scripts/general/structfun.m | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/general/structfun.m b/scripts/general/structfun.m index 1b56e3dca7..eeed15c395 100644 --- a/scripts/general/structfun.m +++ b/scripts/general/structfun.m @@ -104,10 +104,24 @@ error ("structfun: invalid options"); endif - varargout = cell (max ([nargout, 1]), 1); - [varargout{:}] = cellfun (fcn, struct2cell (S), varargin{:}); + varargout_defined = true; + + if (nargout == 0) + ## ANS should not normally be defined here, but just in case someone + ## changes the code above so that it could be... + clear ("ans"); + cellfun (fcn, struct2cell (S), varargin{:}); + if (exist ("ans", "var")) + varargout = {ans}; + else + varargout_defined = false; + endif + else + varargout = cell (max ([nargout, 1]), 1); + [varargout{:}] = cellfun (fcn, struct2cell (S), varargin{:}); + endif - if (! uniform_output) + if (! uniform_output && varargout_defined) varargout = cellfun ("cell2struct", varargout, {fieldnames(S)}, {1}, ... uo_str, false); endif