Mercurial > octave
changeset 25948:700b3f415ebe
maint: Strip trailing whitespace from source files.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 19 Oct 2018 12:19:49 -0400 |
parents | 90186e77ae39 |
children | 52ff6e691e49 |
files | libgui/src/octave-qt-link.cc libinterp/corefcn/graphics.cc libinterp/corefcn/octave-link.cc libinterp/corefcn/octave-link.h liboctave/operators/module.mk scripts/gui/errordlg.m scripts/gui/helpdlg.m scripts/gui/msgbox.m scripts/gui/warndlg.m scripts/image/getframe.m scripts/miscellaneous/unpack.m scripts/plot/util/clf.m scripts/plot/util/private/__add_default_menu__.m |
diffstat | 13 files changed, 44 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/octave-qt-link.cc Fri Oct 19 12:14:38 2018 -0400 +++ b/libgui/src/octave-qt-link.cc Fri Oct 19 12:19:49 2018 -0400 @@ -134,7 +134,7 @@ if (! icon.isNull ()) { QImage img = icon.pixmap (QSize (32, 32)).toImage (); - + if (img.format () == QImage::Format_ARGB32_Premultiplied) { retval.resize (dim_vector (img.height (), img.width (), 4), 0);
--- a/libinterp/corefcn/graphics.cc Fri Oct 19 12:14:38 2018 -0400 +++ b/libinterp/corefcn/graphics.cc Fri Oct 19 12:19:49 2018 -0400 @@ -874,12 +874,12 @@ device_pixel_ratio (graphics_handle h) { double retval = 1.0; - + graphics_object fig = gh_manager::get_object (h).get_ancestor ("figure"); - + if (fig.valid_object ()) retval = fig.get ("__device_pixel_ratio__").double_value (); - + return retval; } @@ -8870,7 +8870,7 @@ for (octave_idx_type ii = 0; ii < bbox.numel (); ii++) bbox(ii) = bbox(ii) / dpr; - + return bbox; } @@ -8955,7 +8955,7 @@ // The bbox is relative to the text's position. We'll leave it that // way, because get_position does not return valid results when the // text is first constructed. Conversion to proper coordinates is - // performed in get_extent. + // performed in get_extent. set_extent (bbox); if (__autopos_tag___is ("xlabel") || __autopos_tag___is ("ylabel") @@ -9650,7 +9650,7 @@ // calculate face normal with Newell's method // https://www.khronos.org/opengl/wiki/Calculating_a_Surface_Normal#Newell.27s_Method - + nx = dy * (z(j1,i1) + z(j2,i1) - z(j1,i2) - z(j2,i2)); ny = dx * (z(j1,i1) + z(j1,i2) - z(j2,i1) - z(j2,i2)); @@ -9672,7 +9672,7 @@ { if (! vertexnormalsmode_is ("auto")) return; - + if ((facelighting_is ("gouraud") || facelighting_is ("phong") || edgelighting_is ("gouraud") || edgelighting_is ("phong")) && get_do_lighting ())
--- a/libinterp/corefcn/octave-link.cc Fri Oct 19 12:14:38 2018 -0400 +++ b/libinterp/corefcn/octave-link.cc Fri Oct 19 12:19:49 2018 -0400 @@ -359,7 +359,7 @@ @end deftypefn */) { uint8NDArray retval; - + if (args.length () > 0) { std::string icon_name = args(0).xstring_value ("invalid arguments");
--- a/libinterp/corefcn/octave-link.h Fri Oct 19 12:14:38 2018 -0400 +++ b/libinterp/corefcn/octave-link.h Fri Oct 19 12:19:49 2018 -0400 @@ -235,7 +235,7 @@ if (enabled ()) instance->do_execute_command_in_terminal (command); } - + static uint8NDArray get_named_icon (const std::string& icon_name) {
--- a/liboctave/operators/module.mk Fri Oct 19 12:14:38 2018 -0400 +++ b/liboctave/operators/module.mk Fri Oct 19 12:19:49 2018 -0400 @@ -15,7 +15,7 @@ $(srcdir)/%reldir%/smx-op-src.mk $(OP_MK_FILES) : %.mk : $(srcdir)/%reldir%/config-ops.sh $(srcdir)/%reldir%/mk-ops.awk - $(AM_V_GEN)$(SHELL) $(srcdir)/%reldir%/config-ops.sh $(top_srcdir) `echo $(*F) | $(SED) 's/-op-.*//'` `echo $(*F) | $(SED) 's/.*-op-//'` + $(AM_V_GEN)$(SHELL) $(srcdir)/%reldir%/config-ops.sh $(top_srcdir) `echo $(*F) | $(SED) 's/-op-.*//'` `echo $(*F) | $(SED) 's/.*-op-//'` BUILT_LIBOCTAVE_OPERATORS_SOURCES = \
--- a/scripts/gui/errordlg.m Fri Oct 19 12:14:38 2018 -0400 +++ b/scripts/gui/errordlg.m Fri Oct 19 12:19:49 2018 -0400 @@ -58,7 +58,7 @@ opt = "non-modal"; nargs = numel (varargin); - + if (nargs > 3) print_usage (); elseif (nargs == 1) @@ -71,7 +71,7 @@ tit = varargin{2}; opt = varargin{3}; endif - + htmp = msgbox (msg, tit, "error", opt); if (nargout)
--- a/scripts/gui/helpdlg.m Fri Oct 19 12:14:38 2018 -0400 +++ b/scripts/gui/helpdlg.m Fri Oct 19 12:19:49 2018 -0400 @@ -54,7 +54,7 @@ opt = "non-modal"; nargs = numel (varargin); - + if (nargs > 2) print_usage (); elseif (nargs == 1) @@ -63,7 +63,7 @@ msg = varargin{1}; tit = varargin{2}; endif - + htmp = msgbox (msg, tit, "help", opt); if (nargout)
--- a/scripts/gui/msgbox.m Fri Oct 19 12:14:38 2018 -0400 +++ b/scripts/gui/msgbox.m Fri Oct 19 12:19:49 2018 -0400 @@ -38,7 +38,7 @@ ## colormap for an indexed image. ## ## Finally the optional argument @var{opt} controls the behavior of the dialog. -## If @var{opt} is a string, it may be one of +## If @var{opt} is a string, it may be one of ## ## @table @asis ## @item "modal" @@ -61,7 +61,7 @@ ## Controls the @qcode{"interpreter"} property of the text object used ## for displaying the message. The value must be "none", "tex" or "latex". ## @end table -## +## ## The return value @var{h} is a handle to the figure object used for ## building the dialog. ## @@ -132,7 +132,7 @@ windowstyle = "normal"; endif endif - + ## Make a GUI element or print to console if (__octave_link_enabled__ ()) retval = __msgbox__ (msg, tit, icon, windowstyle, interpreter); @@ -172,15 +172,15 @@ graphics_toolkit (hf, "qt"); endif endif - + hp = uipanel (hf); - + hax = axes ("parent", hp, "visible", "off", "units", "pixels", ... "ydir", "reverse"); - + ht = text ("parent", hax, "string", msg, "units", "pixels", ... "fontsize", 14, "interpreter", interpreter); - + ## Hold default icons data in a persistent variable persistent cdata = struct ("help", [], "warn", [], "error", []); @@ -209,7 +209,7 @@ tmp(:,:,3) += backgnd(3) * (255-alpha); icon.cdata = tmp; cdata.(icon_name) = tmp; - + endif endif endif @@ -224,14 +224,14 @@ extent(3) += txt_margin; im_sz = size (icon.cdata); - + if (! isempty (icon.cdata)) extent(3) += im_sz(2); extent(4) = max (extent(4), im_sz(1)); endif ax_sz = max ([ax_sz; extent(3:4)+2*ax_margin]); - + ## Align text left when there is an icon text_offset = txt_margin; if (! isempty (icon.cdata)) @@ -247,9 +247,9 @@ wd = ax_sz(1); hg = ax_sz(2) + button_margin; center = get (0, "screensize")(3:4) / 2; - + set (hf, "position", [center(1)-wd/2 center(2)-hg/2 wd hg]); - + set (hax, "position", [0 button_margin ax_sz], ... "xlim", [1 ax_sz(1)]-ax_margin, "ylim", [-ax_sz(2)/2 ax_sz(2)/2], ... "units", "normalized"); @@ -258,7 +258,7 @@ hui = uicontrol ("string", "OK", "callback", @() close (gcbf ()), ... "position", [ax_sz(1)/2-40 ax_margin 80 28], "parent", hp); - + set (hf, "windowstyle", windowstyle, "visible", "on"); endfunction @@ -295,7 +295,7 @@ %! "Dialog Title", "custom", rand (32, 32, 3)); %!demo -%! cdata = get (0, "factoryimagecdata"); +%! cdata = get (0, "factoryimagecdata"); %! msgbox ({"Custom dialog with the default Octave image.", ... %! "The image is indexed into the 'copper' colormap"}, ... %! "Dialog Title", "custom", cdata, copper (64));
--- a/scripts/gui/warndlg.m Fri Oct 19 12:14:38 2018 -0400 +++ b/scripts/gui/warndlg.m Fri Oct 19 12:19:49 2018 -0400 @@ -58,7 +58,7 @@ opt = "non-modal"; nargs = numel (varargin); - + if (nargs > 3) print_usage (); elseif (nargs == 1) @@ -71,7 +71,7 @@ tit = varargin{2}; opt = varargin{3}; endif - + htmp = msgbox (msg, tit, "warn", opt); if (nargout)
--- a/scripts/image/getframe.m Fri Oct 19 12:14:38 2018 -0400 +++ b/scripts/image/getframe.m Fri Oct 19 12:19:49 2018 -0400 @@ -99,7 +99,7 @@ || (strcmp (get (hf, "__graphics_toolkit__"), "qt") && (strcmp (get (hf, "__gl_window__"), "on") || __have_feature__ ("QT_OFFSCREEN")))) - + ## __get_frame__ requires that the figure "units" is "pixels" unwind_protect units = get (hf, "units"); @@ -108,7 +108,7 @@ unwind_protect_cleanup set (hf, "units", units) end_unwind_protect - + else error ("getframe: figure must be visible or qt toolkit must be used with __gl_window__ property 'on' or QT_OFFSCREEN feature available"); endif
--- a/scripts/miscellaneous/unpack.m Fri Oct 19 12:14:38 2018 -0400 +++ b/scripts/miscellaneous/unpack.m Fri Oct 19 12:19:49 2018 -0400 @@ -130,7 +130,7 @@ [pathstr, name, ext] = fileparts (file); if (nargin == 3 && ! strcmpi (ext, filetype)) - ## override extension with given filetype + ## override extension with given filetype if (isempty (ext)) ext = filetype; else
--- a/scripts/plot/util/clf.m Fri Oct 19 12:14:38 2018 -0400 +++ b/scripts/plot/util/clf.m Fri Oct 19 12:19:49 2018 -0400 @@ -74,13 +74,13 @@ ## except default menus. kids = allchild (hfig); ismenu = cellfun (@(s) strncmp (s, "__default_menu_", 15), ... - get (kids, "tag")); + get (kids, "tag")); delete (kids(! ismenu)); reset (hfig); ## Recover figure listeners which have been deleted __add_default_menu__ (hfig, kids(ismenu)); - + __set_default_mouse_modes__ (hfig); else ## Select only the chilren with visible handles.
--- a/scripts/plot/util/private/__add_default_menu__.m Fri Oct 19 12:14:38 2018 -0400 +++ b/scripts/plot/util/private/__add_default_menu__.m Fri Oct 19 12:19:49 2018 -0400 @@ -20,7 +20,7 @@ ## @deftypefn {} {} __add_default_menu__ (@var{hfig}) ## @deftypefnx {} {} __add_default_menu__ (@var{hfig}, @var{hmenu}) ## Add default menu and listeners to figure. -## +## ## ## All uimenu handles have their @qcode{"HandleVisibility"} property set to ## @qcode{"off"}. @@ -30,7 +30,7 @@ function __add_default_menu__ (hf, hmenu = []) - ## Create + ## Create if (isempty (hmenu)) ## File menu hui = uimenu (hf, "label", "&File", "handlevisibility", "off", ... @@ -43,8 +43,8 @@ "accelerator", "S"); uimenu (hui, "label", "&Close", "callback", @close_cb, ... "accelerator", "w", "separator", "on"); - hmenu(1) = hui; - + hmenu(1) = hui; + ## Edit menu hui = uimenu (hf, "label", "&Edit", "handlevisibility", "off", ... "tag", "__default_menu__Edit"); @@ -57,8 +57,8 @@ "callback", "clf (gcbf ());"); uimenu (hui, "label", "Reset Figure", "callback", "reset (gcbf ());"); - hmenu(2) = hui; - + hmenu(2) = hui; + ## Tools menu hui = uimenu (hf, "label", "&Tools", "handlevisibility", "off", ... "tag", "__default_menu__Tools"); @@ -69,7 +69,7 @@ uimenu (hui, "label", "Hide grid on all axes", "tag", "off", ... "callback", @grid_cb); uimenu (hui, "label", "Auto&scale all axes", "callback", @autoscale_cb); - + hui2 = uimenu (hui, "label", "GUI &Mode (on all axes)"); uimenu (hui2, "label", "Pan x and y", "tag", "pan_on", ... "callback", @guimode_cb); @@ -85,7 +85,7 @@ "callback", @guimode_cb); uimenu (hui2, "label", "Disable mousezoom", "tag", "zoom_off", ... "callback", @guimode_cb); - hmenu(3) = hui; + hmenu(3) = hui; endif ## Figure listeners