diff libgui/src/m-editor/file-editor-tab.cc @ 30398:d4d83344d653 stable

maint: style check C++ files in src/ and libgui/ ahead of 7.1 release. * ButtonGroup.cc, Canvas.cc, CheckBoxControl.cc, Container.cc, ContextMenu.cc, EditControl.cc, Figure.cc, Figure.h, FigureWindow.cc, GenericEventNotify.h, ListBoxControl.cc, ListBoxControl.h, Logger.cc, Menu.cc, Object.cc, Panel.cc, PopupMenuControl.cc, PushButtonControl.cc, PushTool.cc, RadioButtonControl.cc, SliderControl.cc, Table.cc, Table.h, TextControl.cc, ToggleButtonControl.cc, ToggleTool.cc, ToolBar.cc, annotation-dialog.cc, qt-graphics-toolkit.cc, documentation-bookmarks.cc, documentation-bookmarks.h, documentation-dock-widget.h, documentation.cc, documentation.h, dw-main-window.h, files-dock-widget.cc, files-dock-widget.h, find-files-dialog.cc, find-files-model.cc, gui-preferences-dw.h, gui-preferences-ed.h, gui-preferences-global.h, gui-settings.h, interpreter-qobject.cc, led-indicator.cc, file-editor-interface.h, file-editor-tab.cc, file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc, find-dialog.h, marker.cc, octave-qscintilla.cc, octave-qscintilla.h, main-window.cc, main-window.h, octave-dock-widget.cc, octave-dock-widget.h, octave-qobject.cc, octave-qobject.h, octave-qtutils.h, qt-interpreter-events.cc, release-notes.cc, resource-manager.cc, set-path-dialog.cc, settings-dialog.cc, settings-dialog.h, shortcut-manager.cc, shortcut-manager.h, tab-bar.cc, tab-bar.h, variable-editor-model.cc, variable-editor-model.h, variable-editor.cc, variable-editor.h, workspace-model.cc, workspace-view.cc, mkoctfile.in.cc, octave-config.in.cc: Style check C++ files in src/ and libgui/ ahead of 7.1 release.
author Rik <rik@octave.org>
date Mon, 29 Nov 2021 15:58:51 -0800
parents da9c55b3e9fa
children 2dc31151ca27 796f54d4ddbf
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Mon Nov 29 12:36:04 2021 -0500
+++ b/libgui/src/m-editor/file-editor-tab.cc	Mon Nov 29 15:58:51 2021 -0800
@@ -155,10 +155,10 @@
     // row- and col-indicator
     m_row_indicator = new QLabel ("", this);
     QFontMetrics fm = m_row_indicator->fontMetrics ();
-    m_row_indicator->setMinimumSize (4.5*fm.averageCharWidth (),0);
+    m_row_indicator->setMinimumSize (4.5*fm.averageCharWidth (), 0);
     QLabel *row_label = new QLabel (tr ("line:"), this);
     m_col_indicator = new QLabel ("", this);
-    m_col_indicator->setMinimumSize (4*fm.averageCharWidth (),0);
+    m_col_indicator->setMinimumSize (4*fm.averageCharWidth (), 0);
     QLabel *col_label = new QLabel (tr ("col:"), this);
     m_status_bar->addWidget (row_label, 0);
     m_status_bar->addWidget (m_row_indicator, 0);
@@ -167,14 +167,14 @@
 
     // status bar: encoding
     QLabel *enc_label = new QLabel (tr ("encoding:"), this);
-    m_enc_indicator = new QLabel ("",this);
+    m_enc_indicator = new QLabel ("", this);
     m_status_bar->addWidget (enc_label, 0);
     m_status_bar->addWidget (m_enc_indicator, 0);
     m_status_bar->addWidget (new QLabel (" ", this), 0);
 
     // status bar: eol mode
     QLabel *eol_label = new QLabel (tr ("eol:"), this);
-    m_eol_indicator = new QLabel ("",this);
+    m_eol_indicator = new QLabel ("", this);
     m_status_bar->addWidget (eol_label, 0);
     m_status_bar->addWidget (m_eol_indicator, 0);
     m_status_bar->addWidget (new QLabel (" ", this), 0);
@@ -183,18 +183,18 @@
     m_edit_area->setMarginType (1, QsciScintilla::SymbolMargin);
     m_edit_area->setMarginSensitivity (1, true);
     m_edit_area->markerDefine (QsciScintilla::RightTriangle, marker::bookmark);
-    m_edit_area->setMarkerBackgroundColor (QColor (0,0,232), marker::bookmark);
+    m_edit_area->setMarkerBackgroundColor (QColor (0, 0, 232), marker::bookmark);
     m_edit_area->markerDefine (QsciScintilla::Circle, marker::breakpoint);
-    m_edit_area->setMarkerBackgroundColor (QColor (192,0,0), marker::breakpoint);
+    m_edit_area->setMarkerBackgroundColor (QColor (192, 0, 0), marker::breakpoint);
     m_edit_area->markerDefine (QsciScintilla::Circle, marker::cond_break);
-    m_edit_area->setMarkerBackgroundColor (QColor (255,127,0), marker::cond_break);
+    m_edit_area->setMarkerBackgroundColor (QColor (255, 127, 0), marker::cond_break);
     m_edit_area->markerDefine (QsciScintilla::RightArrow,
                                marker::debugger_position);
-    m_edit_area->setMarkerBackgroundColor (QColor (255,255,0),
+    m_edit_area->setMarkerBackgroundColor (QColor (255, 255, 0),
                                            marker::debugger_position);
     m_edit_area->markerDefine (QsciScintilla::RightArrow,
                                marker::unsure_debugger_position);
-    m_edit_area->setMarkerBackgroundColor (QColor (192,192,192),
+    m_edit_area->setMarkerBackgroundColor (QColor (192, 192, 192),
                                            marker::unsure_debugger_position);
 
     connect (m_edit_area, SIGNAL (marginClicked (int, int,
@@ -496,10 +496,10 @@
     if (! trackedFiles.isEmpty ())
       m_file_system_watcher.removePath (m_file_name);
     if (! fileName.isEmpty () && QFile::exists (fileName))
-    {
-      m_file_system_watcher.addPath (fileName);
-      m_last_modified =  QFileInfo (fileName).lastModified ().toUTC ();
-    }
+      {
+        m_file_system_watcher.addPath (fileName);
+        m_last_modified =  QFileInfo (fileName).lastModified ().toUTC ();
+      }
 
     // update lexer and file name variable if file name changes
     if (m_file_name != fileName)
@@ -922,7 +922,7 @@
         m_edit_area->setMarginsFont (line_numbers_font);
       }
     else
-      m_edit_area->setMarginWidth (2,0);
+      m_edit_area->setMarginWidth (2, 0);
   }
 
   // function for adding entries to the octave lexer's APIs
@@ -1043,7 +1043,7 @@
         // the returned line number.  Store whether to remove this breakpoint
         // afterwards.
         int first_bp_line
-              = m_edit_area->markerFindNext (0, (1 << marker::breakpoint)) + 1;
+          = m_edit_area->markerFindNext (0, (1 << marker::breakpoint)) + 1;
 
         // Set flag for storing the line number of the breakpoint
         m_breakpoint_info.remove_next = true;
@@ -1790,8 +1790,8 @@
 
     if (settings->value (ed_force_newline).toBool ())
       {
-        const QByteArray eol_lf = QByteArray (1,0x0a);
-        const QByteArray eol_cr = QByteArray (1,0x0d);
+        const QByteArray eol_lf = QByteArray (1, 0x0a);
+        const QByteArray eol_cr = QByteArray (1, 0x0d);
 
         if (text_data.endsWith (eol_lf))
           text_data.chop (1);   // remove LF
@@ -1921,8 +1921,8 @@
   {
     QByteArray text = m_edit_area->text ().toLatin1 ();
 
-    QByteArray eol_lf = QByteArray (1,0x0a);
-    QByteArray eol_cr = QByteArray (1,0x0d);
+    QByteArray eol_lf = QByteArray (1, 0x0a);
+    QByteArray eol_cr = QByteArray (1, 0x0d);
     QByteArray eol_crlf = eol_cr;
     eol_crlf.append (eol_lf);
 
@@ -2373,7 +2373,7 @@
     QFileDialog *file_dialog = qobject_cast<QFileDialog *> (sender ());
 
     QRegExp rx ("\\*\\.([^ ^\\)]*)[ \\)]");   // regexp for suffix in filter
-    int index = rx.indexIn (filter,0);        // get first suffix in filter
+    int index = rx.indexIn (filter, 0);       // get first suffix in filter
 
     if (index > -1)
       file_dialog->setDefaultSuffix (rx.cap (1)); // found a suffix, set default
@@ -2488,7 +2488,7 @@
 
     // If overwrite confirmation was not done by the file dialog (in case
     // of native file dialogs, see above), do it here
-    if(file_dialog->testOption (QFileDialog::DontConfirmOverwrite) && file.exists ())
+    if (file_dialog->testOption (QFileDialog::DontConfirmOverwrite) && file.exists ())
       {
         int ans = QMessageBox::question (file_dialog,
                               tr ("Octave Editor"),
@@ -2797,9 +2797,9 @@
       cursor_blinking = settings->value (cs_cursor_blinking).toBool ();
 
     if (cursor_blinking)
-      m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD,500);
+      m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD, 500);
     else
-      m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD,0);
+      m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD, 0);
 
   }
 
@@ -3180,7 +3180,7 @@
                                             true,    // whole words only
                                             false,   // do not wrap
                                             true,    // forward
-                                            0,0,     // from the beginning
+                                            0, 0,    // from the beginning
                                             false
 #if defined (HAVE_QSCI_VERSION_2_6_0)
                                             , true