changeset 18794:be569698970c gui-release

maint: Periodic merge of stable to gui-release.
author Rik <rik@octave.org>
date Thu, 15 May 2014 08:37:02 -0700
parents 64bd9afac22c (current diff) 83c85d95ac7b (diff)
children dff05c124017 095fdef3d67c
files
diffstat 6 files changed, 42 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/unix/Vt102Emulation.cpp	Sun May 11 13:22:57 2014 -0400
+++ b/libgui/qterminal/libqterminal/unix/Vt102Emulation.cpp	Thu May 15 08:37:02 2014 -0700
@@ -964,7 +964,9 @@
         if ( modifiers & Qt::AltModifier && !(wantsAltModifier || wantsAnyModifier)
              && !event->text().isEmpty() )
         {
-            textToSend.prepend("\033");
+#if !defined(Q_OS_MAC)
+          textToSend.prepend("\033");
+#endif
         }
 
         if ( entry.command() != KeyboardTranslator::NoCommand )
--- a/libinterp/corefcn/profiler.cc	Sun May 11 13:22:57 2014 -0400
+++ b/libinterp/corefcn/profiler.cc	Thu May 15 08:37:02 2014 -0700
@@ -36,7 +36,11 @@
                                         const std::string& f)
   : acc (a)
 {
-  if (acc.is_active ())
+  // FIXME: Add test for f != "" to prevent a blank line showing up
+  //        in profiler statistics.  See bug #39524.  The root cause
+  //        is that the function name is not set for the recurring readline
+  //        hook function.
+  if (acc.is_active () && f != "")
     {
       fcn = f;
       acc.enter_function (fcn);
@@ -104,8 +108,10 @@
 profile_data_accumulator::tree_node*
 profile_data_accumulator::tree_node::exit (octave_idx_type fcn)
 {
-  assert (parent);
-  assert (fcn_id == fcn);
+  // FIXME: These assert statements don't make sense if profile() is called
+  //        from within a function hierarchy to begin with.  See bug #39587.
+  //  assert (parent);
+  //  assert (fcn_id == fcn);
 
   return parent;
 }
@@ -128,7 +134,7 @@
           data[parent->fcn_id - 1].children.insert (fcn_id);
         }
 
-      if (!entry.recursive)
+      if (! entry.recursive)
         for (const tree_node* i = parent; i; i = i->parent)
           if (i->fcn_id == fcn_id)
             {
@@ -207,7 +213,7 @@
   if (value)
     {
       // Create a call-tree top-node if there isn't yet one.
-      if (!call_tree)
+      if (! call_tree)
         call_tree = new tree_node (0, 0);
 
       // Let the top-node be the active one.  This ensures we have a clean
@@ -249,13 +255,16 @@
 
   active_fcn = active_fcn->enter (fcn_idx);
   last_time = query_time ();
+
 }
 
 void
 profile_data_accumulator::exit_function (const std::string& fcn)
 {
   assert (call_tree);
-  assert (active_fcn != call_tree);
+  // FIXME: This assert statements doesn't make sense if profile() is called
+  //        from within a function hierarchy to begin with.  See bug #39587.
+  //assert (active_fcn != call_tree);
 
   // Usually, if we are disabled this function is not even called.  But the
   // call disabling the profiler is an exception.  So also check here
@@ -264,7 +273,9 @@
     add_current_time ();
 
   fcn_index_map::iterator pos = fcn_index.find (fcn);
-  assert (pos != fcn_index.end ());
+  // FIXME: This assert statements doesn't make sense if profile() is called
+  //        from within a function hierarchy to begin with.  See bug #39587.
+  //assert (pos != fcn_index.end ());
   active_fcn = active_fcn->exit (pos->second);
 
   // If this was an "inner call", we resume executing the parent function
@@ -408,7 +419,7 @@
 // Enable or disable the profiler data collection.
 DEFUN (__profiler_enable__, args, ,
        "-*- texinfo -*-\n\
-@deftypefn {Function File} __profiler_enable ()\n\
+@deftypefn {Function File} __profiler_enable__ ()\n\
 Undocumented internal function.\n\
 @end deftypefn")
 {
@@ -434,7 +445,7 @@
 // Clear all collected profiling data.
 DEFUN (__profiler_reset__, args, ,
        "-*- texinfo -*-\n\
-@deftypefn {Function File} __profiler_reset ()\n\
+@deftypefn {Function File} __profiler_reset__ ()\n\
 Undocumented internal function.\n\
 @end deftypefn")
 {
@@ -452,7 +463,7 @@
 // Query the timings collected by the profiler.
 DEFUN (__profiler_data__, args, nargout,
        "-*- texinfo -*-\n\
-@deftypefn {Function File} __profiler_data ()\n\
+@deftypefn {Function File} __profiler_data__ ()\n\
 Undocumented internal function.\n\
 @end deftypefn")
 {
@@ -462,9 +473,10 @@
   if (nargin > 0)
     warning ("profiler_data: ignoring extra arguments");
 
-  retval(0) = profiler.get_flat ();
   if (nargout > 1)
     retval(1) = profiler.get_hierarchical ();
+  retval(0) = profiler.get_flat ();
 
   return retval;
 }
+
--- a/libinterp/octave-value/ov-usr-fcn.cc	Sun May 11 13:22:57 2014 -0400
+++ b/libinterp/octave-value/ov-usr-fcn.cc	Thu May 15 08:37:02 2014 -0700
@@ -654,6 +654,7 @@
 {
   bool retval = false;
   if (Voptimize_subsasgn_calls
+      && param_list && ret_list
       && param_list->length () > 0 && ! param_list->varargs_only ()
       && ret_list->length () == 1 && ! ret_list->takes_varargs ())
     {
--- a/scripts/plot/util/figure.m	Sun May 11 13:22:57 2014 -0400
+++ b/scripts/plot/util/figure.m	Thu May 15 08:37:02 2014 -0700
@@ -21,7 +21,7 @@
 ## @deftypefnx {Command} {} figure @var{n}
 ## @deftypefnx {Function File} {} figure (@var{n})
 ## @deftypefnx {Function File} {} figure (@dots{}, "@var{property}", @var{value}, @dots{})
-## @deftypefnx {Function File} {@var{h} =} figure (@var{dots})
+## @deftypefnx {Function File} {@var{h} =} figure (@dots{})
 ## Create a new figure window for plotting.
 ##
 ## If no arguments are specified, a new figure with the next available number
--- a/scripts/plot/util/isaxes.m	Sun May 11 13:22:57 2014 -0400
+++ b/scripts/plot/util/isaxes.m	Thu May 15 08:37:02 2014 -0700
@@ -35,10 +35,10 @@
   endif
 
   hlist = ishandle (h);
+  retval = hlist;
+
   if (any (hlist))
     retval(hlist) = strcmp (get (h(hlist), "type"), "axes");
-  else
-    retval = hlist;
   endif
 
 endfunction
@@ -54,3 +54,11 @@
 %!   close (hf);
 %! end_unwind_protect
 
+%!test
+%! hf = figure ("visible", "off");
+%! unwind_protect
+%!   hax = axes ();
+%!   assert (isaxes ([hax NaN]), [true false]);
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
--- a/scripts/plot/util/private/__go_draw_axes__.m	Sun May 11 13:22:57 2014 -0400
+++ b/scripts/plot/util/private/__go_draw_axes__.m	Thu May 15 08:37:02 2014 -0700
@@ -1604,8 +1604,9 @@
     else
       colorspec = get_text_colorspec (textcolors, mono);
     endif
-    fprintf (plot_stream, "set key %s %s;\nset key %s %s %s %s %s;\n",
-             inout, pos, box, reverse, horzvert, fontspec, colorspec);
+    fprintf (plot_stream, "set key %s %s;\nset key %s %s %s %s %s %s;\n",
+             inout, pos, box, reverse, horzvert, fontspec, colorspec,
+             __do_enhanced_option__ (enhanced, hlgnd));
   else
     fputs (plot_stream, "unset key;\n");
   endif
@@ -2165,7 +2166,7 @@
                    tickdir, ticklength, axispos);
         endif
 
-        labels = regexprep (labels, '%', "%%");
+        labels = strrep (labels, "%", "%%");
         for i = 1:ntics
           fprintf (plot_stream, " \"%s\" %.15g", labels{k++}, tics(i));
           if (i < ntics)
@@ -2322,38 +2323,10 @@
         warning ("latex markup not supported for text objects");
         warned_latex = true;
       endif
-    elseif (enhanced)
-      str = no_super_sub_scripts (str);
     endif
   endif
 endfunction
 
-function str = no_super_sub_scripts (str)
-  if (iscellstr (str))
-    labels = str;
-  else
-    labels = cellstr (str);
-  endif
-  for marker = "_^" 
-    for m = 1 : numel (labels)
-      n1 = strfind (labels{m}, sprintf ("\\%s", marker));
-      n2 = strfind (labels{m}, marker);
-      if (! isempty (n1))
-        n1 = n1 + 1;
-        n2 = setdiff (n2, n1);
-      endif
-      for n = numel (n2):-1:1
-        labels{m} = [labels{m}(1:n2(n)-1), "\\", labels{m}(n2(n):end)];
-      endfor
-    endfor
-  endfor
-  if (iscellstr (str))
-    str = labels;
-  else
-    str = char (labels);
-  endif
-endfunction
-
 function str = __tex2enhanced__ (str, fnt, it, bld)
   persistent sym = __setup_sym_table__ ();
   persistent flds = fieldnames (sym);