changeset 26879:6e019db9c0a6

maint: merge stable to default.
author Rik <rik@octave.org>
date Mon, 11 Mar 2019 11:49:24 -0700
parents 62c1443babd8 (current diff) 3c7c5b7c3044 (diff)
children a2aed4b49be3
files doc/interpreter/genpropdoc.m doc/interpreter/plot.txi libinterp/corefcn/error.cc libinterp/corefcn/graphics.cc libinterp/corefcn/graphics.in.h scripts/gui/uimenu.m
diffstat 21 files changed, 79 insertions(+), 98 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/genpropdoc.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/doc/interpreter/genpropdoc.m	Mon Mar 11 11:49:24 2019 -0700
@@ -242,7 +242,7 @@
         s.doc = doc_unused;
 
       case "parent"
-        s.doc = "Root figure has no parent graphics object.  __prop__ \
+        s.doc = "Root object has no parent graphics object.  __prop__ \
 is always empty.";
 
       case "hittest"
@@ -1909,8 +1909,15 @@
   fields = sort (fieldnames (obj));
   nf = numel (fields);
 
-  ## File header and begining of properties table
-  str = [warn_autogen() "\n\n@table @asis"];
+  ## File header and beginning of properties table
+  str = warn_autogen ();
+  if (strcmp (objname, "root"))
+    str = sprintf ("%s\n\nProperties of the root graphics object:", str);
+  else
+    str = sprintf ("%s\n\nProperties of @code{%s} objects (@pxref{XREF%s,,%s}):",
+                   str, objname, objname, objname);
+  endif
+  str = sprintf ("%s\n\n@table @asis", str);
 
   for ii = 1:nf
     field = fields{ii};
--- a/doc/interpreter/octave.texi	Sun Mar 10 17:02:27 2019 -0700
+++ b/doc/interpreter/octave.texi	Mon Mar 11 11:49:24 2019 -0700
@@ -562,7 +562,7 @@
 
 Graphics Object Properties
 
-* Root Figure Properties::
+* Root Properties::
 * Figure Properties::
 * Axes Properties::
 * Line Properties::
--- a/doc/interpreter/plot.txi	Sun Mar 10 17:02:27 2019 -0700
+++ b/doc/interpreter/plot.txi	Mon Mar 11 11:49:24 2019 -0700
@@ -1262,9 +1262,9 @@
 @table @asis
 @c @group
 
-@item root figure
-@cindex root figure graphics object
-@cindex graphics object, root figure
+@item root
+@cindex root graphics object
+@cindex graphics object, root
 The top level of the hierarchy and the parent of all figure objects.
 Use @code{groot} to obtain the handle of the root graphics object.
 
@@ -1387,12 +1387,12 @@
 @end example
 
 @noindent
-returns a structure containing all the properties of the root figure.
+returns a structure containing all the properties of the root graphics object.
 As with all functions in Octave, the structure is returned by value, so
-modifying it will not modify the internal root figure plot object.  To
-do that, you must use the @code{set} function.  Also, note that in this
-case, the @code{currentfigure} property is empty, which indicates that
-there is no current figure window.
+modifying it will not modify the internal root object.  To do that, you must
+use the @code{set} function.  Also, note that in this case, the
+@code{currentfigure} property is empty, which indicates that there is no
+current figure window.
 
 The @code{get} function may also be used to find the value of a single
 property.  For example,
@@ -1473,7 +1473,7 @@
 @cindex graphics object properties
 
 @menu
-* Root Figure Properties::
+* Root Properties::
 * Figure Properties::
 * Axes Properties::
 * Line Properties::
@@ -1493,24 +1493,21 @@
 * Uitoggletool Properties::
 @end menu
 
-In this Section the graphics object properties are discussed in detail,
-starting with the root figure properties and continuing through the objects
-hierarchy.  The documentation about a specific graphics object can be
-displayed using @code{doc} function, e.g., @code{doc ("axes properties")} will
-show
+In this section the graphics object properties are discussed in detail,
+starting with the root properties and continuing through the object hierarchy.
+The documentation about a specific graphics object can be displayed using
+@code{doc} function, e.g., @code{doc ("axes properties")} will show
 @ref{Axes Properties}.
 
 The allowed values for radio (string) properties can be retrieved
-programmatically or displayed using the one or
-two arguments call to @code{set} function.  @xref{XREFset, , set}.
-
-In the following documentation, default values are enclosed in @{ @}.
-
-@node Root Figure Properties
-@subsubsection Root Figure Properties
-@prindex @sortas{@ Root Figure Properties} Root Figure Properties
-
-The @code{root figure} properties are:
+programmatically or displayed using the one or two argument calling form of the
+@code{set} function.  @xref{XREFset, , set}.
+
+In the following documentation default values are enclosed in @{ @}.
+
+@node Root Properties
+@subsubsection Root Properties
+@prindex @sortas{@ Root Properties} Root Properties
 
 @include plot-rootproperties.texi
 
@@ -1519,8 +1516,6 @@
 @subsubsection Figure Properties
 @prindex @sortas{@ Figure Properties} Figure Properties
 
-The @code{figure} properties are:
-
 @include plot-figureproperties.texi
 
 
@@ -1528,8 +1523,6 @@
 @subsubsection Axes Properties
 @prindex @sortas{@ Axes Properties} Axes Properties
 
-The @code{axes} properties are:
-
 @include plot-axesproperties.texi
 
 
@@ -1537,8 +1530,6 @@
 @subsubsection Line Properties
 @prindex @sortas{@ Line Properties} Line Properties
 
-The @code{line} properties are:
-
 @include plot-lineproperties.texi
 
 
@@ -1546,8 +1537,6 @@
 @subsubsection Text Properties
 @prindex @sortas{@ Text Properties} Text Properties
 
-The @code{text} properties are:
-
 @include plot-textproperties.texi
 
 
@@ -1555,8 +1544,6 @@
 @subsubsection Image Properties
 @prindex @sortas{@ Image Properties} Image Properties
 
-The @code{image} properties are:
-
 @include plot-imageproperties.texi
 
 
@@ -1564,8 +1551,6 @@
 @subsubsection Patch Properties
 @prindex @sortas{@ Patch Properties} Patch Properties
 
-The @code{patch} properties are:
-
 @include plot-patchproperties.texi
 
 
@@ -1573,8 +1558,6 @@
 @subsubsection Surface Properties
 @prindex @sortas{@ Surface Properties} Surface Properties
 
-The @code{surface} properties are:
-
 @include plot-surfaceproperties.texi
 
 
@@ -1582,80 +1565,60 @@
 @subsubsection Light Properties
 @prindex @sortas{@ Light Properties} Light Properties
 
-The @code{light} properties are:
-
 @include plot-lightproperties.texi
 
 @node Uimenu Properties
 @subsubsection Uimenu Properties
 @prindex @sortas{@ Uimenu Properties} Uimenu Properties
 
-The @code{uimenu} properties are:
-
 @include plot-uimenuproperties.texi
 
 @node Uibuttongroup Properties
 @subsubsection Uibuttongroup Properties
 @prindex @sortas{@ Uibuttongroup Properties} Uibuttongroup Properties
 
-The @code{uibuttongroup} properties are:
-
 @include plot-uibuttongroupproperties.texi
 
 @node Uicontextmenu Properties
 @subsubsection Uicontextmenu Properties
 @prindex @sortas{@ Uicontextmenu Properties} Uicontextmenu Properties
 
-The @code{uicontextmenu} properties are:
-
 @include plot-uicontextmenuproperties.texi
 
 @node Uipanel Properties
 @subsubsection Uipanel Properties
 @prindex @sortas{@ Uipanel Properties} Uipanel Properties
 
-The @code{uipanel} properties are:
-
 @include plot-uipanelproperties.texi
 
 @node Uicontrol Properties
 @subsubsection Uicontrol Properties
 @prindex @sortas{@ Uicontrol Properties} Uicontrol Properties
 
-The @code{uicontrol} properties are:
-
 @include plot-uicontrolproperties.texi
 
 @node Uitable Properties
 @subsubsection Uitable Properties
 @cindex uitable properties
 
-The @code{uitable} properties are:
-
 @include plot-uitableproperties.texi
 
 @node Uitoolbar Properties
 @subsubsection Uitoolbar Properties
 @prindex @sortas{@ Uitoolbar Properties} Uitoolbar Properties
 
-The @code{uitoolbar} properties are:
-
 @include plot-uitoolbarproperties.texi
 
 @node Uipushtool Properties
 @subsubsection Uipushtool Properties
 @prindex @sortas{@ Uipushtool Properties} Uipushtool Properties
 
-The @code{uipushtool} properties are:
-
 @include plot-uipushtoolproperties.texi
 
 @node Uitoggletool Properties
 @subsubsection Uitoggletool Properties
 @prindex @sortas{@ Uitoggletool Properties} Uitoggletool Properties
 
-The @code{uitoggletool} properties are:
-
 @include plot-uitoggletoolproperties.texi
 
 @node Searching Properties
@@ -1696,11 +1659,11 @@
 @code{defaultlinelinewidth"} specifies the default @code{linewidth}
 property for @code{line} objects.
 
-The example above used the root figure object so the default
-property value will apply to all line objects.  However, default values
-are hierarchical, so defaults set in a figure objects override those
-set in the root figure object.  Likewise, defaults set in axes objects
-override those set in figure or root figure objects.  For example,
+The example above used the root object so the default property value will apply
+to all line objects.  However, default values are hierarchical, so defaults set
+in a figure objects override those set in the root object.  Likewise, defaults
+set in an axes object override those set in figure or root objects.  For
+example,
 
 @example
 @group
@@ -1722,7 +1685,7 @@
 object.  The line in the second subplot window of the first figure is
 green because it inherits its color from its parent figure object.  The
 line in the second figure window is red because it inherits its color
-from the global root figure parent object.
+from the global root object.
 
 To remove a user-defined default setting, set the default property to
 the value @qcode{"remove"}.  For example,
@@ -1768,8 +1731,7 @@
 returns a list of user-defined default values for the current axes
 object.
 
-Factory default values are stored in the root figure object.  The
-command
+Factory default values are stored in the root object.  The command
 
 @example
 get (groot, "factory");
--- a/libinterp/corefcn/error.cc	Sun Mar 10 17:02:27 2019 -0700
+++ b/libinterp/corefcn/error.cc	Mon Mar 11 11:49:24 2019 -0700
@@ -1443,6 +1443,12 @@
 @end group
 @end example
 
+If the warning message does not end with a newline character, Octave will
+print a traceback of all the function calls leading to the warning.  If the
+warning message does end in a newline character, Octave will suppress the
+traceback messages as it returns control to the top level.  For more details
+and examples, see @ref{XREFerror,,error}.
+
 The optional warning identifier @var{id} allows users to enable or disable
 warnings tagged by this identifier.  A message identifier is a string of the
 form @qcode{"NAMESPACE:WARNING-NAME"}.  Octave's own warnings use the
--- a/libinterp/corefcn/graphics.cc	Sun Mar 10 17:02:27 2019 -0700
+++ b/libinterp/corefcn/graphics.cc	Mon Mar 11 11:49:24 2019 -0700
@@ -2751,7 +2751,7 @@
   if (h.ok ())
     {
       if (h.value () == 0)
-        error ("graphics_handle::free: can't delete root figure");
+        error ("graphics_handle::free: can't delete root object");
 
       auto p = handle_map.find (h);
 
@@ -12190,7 +12190,7 @@
 %!   close (hf);
 %! end_unwind_protect
 
-%!test  # root figure object
+%!test  # root object
 %! set (0, "defaultfigurevisible", "off");
 %! hf = figure ("visible", "off", "paperunits", "centimeters",
 %!              "papertype", "a4");
@@ -13665,7 +13665,7 @@
 
 In the first form, program execution is suspended until the graphics object
 @var{h} is destroyed.  If the graphics handle is invalid or if @var{h} is
-the root figure handle and no property @var{prop} was provided, the function
+the root graphics handle and no property @var{prop} was provided, the function
 returns immediately.
 
 In the second form, execution is suspended until the graphics object is
--- a/libinterp/corefcn/graphics.in.h	Sun Mar 10 17:02:27 2019 -0700
+++ b/libinterp/corefcn/graphics.in.h	Mon Mar 11 11:49:24 2019 -0700
@@ -3233,7 +3233,7 @@
 
   void override_defaults (base_graphics_object& obj)
   {
-    // Allow parent (root figure) to override first (properties knows how
+    // Allow parent (root object) to override first (properties knows how
     // to find the parent object).
     xproperties.override_defaults (obj);
 
--- a/scripts/gui/uibuttongroup.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/gui/uibuttongroup.m	Mon Mar 11 11:49:24 2019 -0700
@@ -34,8 +34,7 @@
 ## Any provided property value pairs will override the default values of the
 ## created uibuttongroup object.
 ##
-## Properties of uibuttongroup objects are documented at
-## @ref{Uibuttongroup Properties}.
+## The full list of properties is documented at @ref{Uibuttongroup Properties}.
 ##
 ## Examples:
 ##
--- a/scripts/gui/uicontextmenu.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/gui/uicontextmenu.m	Mon Mar 11 11:49:24 2019 -0700
@@ -30,7 +30,7 @@
 ## Any provided property value pairs will override the default values of the
 ## created uicontextmenu object.
 ##
-## Uicontextmenu properties are documented at @ref{Uicontextmenu Properties}.
+## The full list of properties is documented at @ref{Uicontextmenu Properties}.
 ##
 ## Examples:
 ##
--- a/scripts/gui/uicontrol.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/gui/uicontrol.m	Mon Mar 11 11:49:24 2019 -0700
@@ -35,8 +35,7 @@
 ## Any provided property value pairs will override the default values of the
 ## created uicontrol object.
 ##
-## Properties of uicontrol objects are documented at
-## @ref{Uicontrol Properties}.
+## The full list of properties is documented at @ref{Uicontrol Properties}.
 ##
 ## The type of uicontrol created is specified by the @var{style} property.  If
 ## no style property is provided, a push button will be created.
--- a/scripts/gui/uimenu.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/gui/uimenu.m	Mon Mar 11 11:49:24 2019 -0700
@@ -62,8 +62,7 @@
 ##
 ## @end table
 ##
-## The full list of properties is documented at
-## @ref{Uimenu Properties,,Uimenu Properties}.
+## The full list of properties is documented at @ref{Uimenu Properties}.
 ##
 ## Examples:
 ##
--- a/scripts/gui/uipanel.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/gui/uipanel.m	Mon Mar 11 11:49:24 2019 -0700
@@ -33,7 +33,7 @@
 ## Any provided property value pairs will override the default values of the
 ## created uipanel object.
 ##
-## Uipanel properties are documented at @ref{Uipanel Properties}.
+## The full list of properties is documented at @ref{Uipanel Properties}.
 ##
 ## The optional return value @var{hui} is a graphics handle to the created
 ## uipanel object.
--- a/scripts/gui/uipushtool.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/gui/uipushtool.m	Mon Mar 11 11:49:24 2019 -0700
@@ -38,7 +38,7 @@
 ## Any provided property value pairs will override the default values of the
 ## created uipushtool object.
 ##
-## Uipushtool properties are documented at @ref{Uipushtool Properties}.
+## The full list of properties is documented at @ref{Uipushtool Properties}.
 ##
 ## The optional return value @var{hui} is a graphics handle to the created
 ## uipushtool object.
--- a/scripts/gui/uitable.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/gui/uitable.m	Mon Mar 11 11:49:24 2019 -0700
@@ -32,8 +32,7 @@
 ## Any provided property value pairs will override the default values of the
 ## created uitable object.
 ##
-## Properties of uitable objects are documented at
-## @ref{Uitable Properties}.
+## The full list of properties is documented at @ref{Uitable Properties}.
 ##
 ## Examples:
 ##
--- a/scripts/gui/uitoggletool.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/gui/uitoggletool.m	Mon Mar 11 11:49:24 2019 -0700
@@ -38,7 +38,7 @@
 ## Any provided property value pairs will override the default values of the
 ## created uitoggletool object.
 ##
-## Uitoggletool properties are documented at @ref{Uitoggletool Properties}.
+## The full list of properties is documented at @ref{Uitoggletool Properties}.
 ##
 ## The optional return value @var{hui} is a graphics handle to the created
 ## uitoggletool object.
--- a/scripts/gui/uitoolbar.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/gui/uitoolbar.m	Mon Mar 11 11:49:24 2019 -0700
@@ -33,7 +33,7 @@
 ## Any provided property value pairs will override the default values of the
 ## created uitoolbar object.
 ##
-## Uitoolbar properties are documented at @ref{Uitoolbar Properties}.
+## The full list of properties is documented at @ref{Uitoolbar Properties}.
 ##
 ## The optional return value @var{hui} is a graphics handle to the created
 ## uitoolbar object.
--- a/scripts/plot/util/__plt_get_axis_arg__.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/plot/util/__plt_get_axis_arg__.m	Mon Mar 11 11:49:24 2019 -0700
@@ -28,7 +28,7 @@
   h = [];
 
   ## Look for a scalar which is a graphics handle but not the
-  ## Root Figure (0) or an ordinary figure (integer).
+  ## root object (0) or an ordinary figure (integer).
   if (! isempty (varargin) && isscalar (varargin{1})
       && ishghandle (varargin{1}) && varargin{1} != 0
       && ! isfigure (varargin{1}))
--- a/scripts/plot/util/close.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/plot/util/close.m	Mon Mar 11 11:49:24 2019 -0700
@@ -62,7 +62,7 @@
     ## Close current figure.
     ## Can't use gcf because it opens a new plot window if one does not exist.
     figs = get (0, "currentfigure");
-    if (figs == 0)  # don't close root figure
+    if (figs == 0)  # don't call close on root object
       figs = [];
     endif
   elseif (nargin == 1)
--- a/scripts/plot/util/gcf.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/plot/util/gcf.m	Mon Mar 11 11:49:24 2019 -0700
@@ -58,8 +58,8 @@
   if (nargin == 0)
     h = get (0, "currentfigure");
     if (isempty (h) || h == 0)
-      ## We only have a root figure object, so create a new figure
-      ## object and make it the current figure.
+      ## We only have a root object, so create a new figure object
+      ## and make it the current figure.
       h = figure ();
     endif
   else
--- a/scripts/plot/util/struct2hdl.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/plot/util/struct2hdl.m	Mon Mar 11 11:49:24 2019 -0700
@@ -28,7 +28,7 @@
 ## If the handle of an existing figure or axes is specified, @var{p}, the new
 ## object will be created as a child of that object.  If no parent handle is
 ## provided then a new figure and the necessary children will be constructed
-## using the default values from the root figure.
+## using the default values from the root object.
 ##
 ## A third boolean argument @var{hilev} can be passed to specify whether the
 ## function should preserve listeners/callbacks, e.g., for legends or
--- a/scripts/polynomial/poly.m	Sun Mar 10 17:02:27 2019 -0700
+++ b/scripts/polynomial/poly.m	Mon Mar 11 11:49:24 2019 -0700
@@ -81,9 +81,13 @@
   if (isreal (x))
     y = real (y);
   else
-    tmp = sort (v(imag (v) > 0)) == sort (conj (v(imag (v) < 0)));
-    if (! isempty (tmp) && all (tmp))
-      y = real (y);
+    pos_imag = sort (v(imag (v) > 0));
+    neg_imag = sort (conj (v(imag (v) < 0)));
+    if (size_equal (pos_imag, neg_imag))
+      is_equal = (pos_imag == neg_imag);
+      if (! isempty (is_equal) && all (is_equal))
+        y = real (y);
+      endif
     endif
   endif
 
@@ -100,6 +104,11 @@
 %! y = poly (x);
 %! assert (isreal (y), true);
 
+%!test <53897>
+%! x = [1 + 1i, 1 + 2i, 3, 4];
+%! y = poly (x);
+%! assert (y, [1 + 0i, -9 - 3i, 25 + 24i, -17 - 57i, -12 + 36i]);
+
 %!error poly ()
 %!error poly (1,2)
 %!error poly ([1, 2, 3; 4, 5, 6])
--- a/src/mkoctfile.in.cc	Sun Mar 10 17:02:27 2019 -0700
+++ b/src/mkoctfile.in.cc	Mon Mar 11 11:49:24 2019 -0700
@@ -559,9 +559,12 @@
 {
   std::string tempd;
 
+  tempd = octave_getenv ("TMPDIR");
+
 #if defined (__MINGW32__) || defined (_MSC_VER)
 
-  tempd = octave_getenv ("TEMP");
+  if (tempd.empty ())
+    tempd = octave_getenv ("TEMP");
 
   if (tempd.empty ())
     tempd = octave_getenv ("TMP");
@@ -578,8 +581,6 @@
 
 #else
 
-  tempd = octave_getenv ("TMP");
-
 #if defined (P_tmpdir)
   if (tempd.empty ())
     tempd = P_tmpdir;