changeset 635:e1fdfb9adf92

According to the previous code formatting also made the function opening brace be consistently placed. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@894 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Tue, 11 Nov 2008 12:33:57 +0000
parents 82cd1efd6015
children 2cf920506bc4
files src/AboutDialogGraphicsView.cpp src/UiguiHighlighter.cpp src/UiguiIndentServer.cpp src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/ImageListSet.cpp src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/StaticDialog.cpp src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/SysMsg.cpp src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/ToolBar.cpp src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.cpp src/aboutdialog.cpp src/indenthandler.cpp src/main.cpp src/mainwindow.cpp src/uiguiIniFileParser.cpp src/uiguisettingsdialog.cpp
diffstat 15 files changed, 50 insertions(+), 103 deletions(-) [+]
line wrap: on
line diff
--- a/src/AboutDialogGraphicsView.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/AboutDialogGraphicsView.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -126,8 +126,7 @@
 /*!
     \brief Does the next calculation/transformation step.
  */
-void AboutDialogGraphicsView::updateStep(int step)
-{
+void AboutDialogGraphicsView::updateStep(int step) {
     QRectF r = graphicsProxyWidget->boundingRect();
     graphicsProxyWidget->setTransform(QTransform()
         .translate(r.width() / 2, -windowTitleBarWidth)
--- a/src/UiguiHighlighter.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/UiguiHighlighter.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -34,9 +34,7 @@
 /*!
     \brief The constructor initializes some regular expressions and keywords to identify cpp tokens
  */
-UiguiHighlighter::UiguiHighlighter(QsciScintilla *parent)
-    : QObject(parent)
-{
+UiguiHighlighter::UiguiHighlighter(QsciScintilla *parent) : QObject(parent) {
     this->qsciEditorParent = parent;
 
     // Create the highlighter settings object from the UiGuiSyntaxHighlightConfig.ini file.
@@ -150,8 +148,7 @@
     \brief Read the settings for the current lexer from the settings file.
  */
 //TODO: Refactor this function so that the coding style and variable names suit better.
-bool UiguiHighlighter::readCurrentSettings( const char *prefix )
-{
+bool UiguiHighlighter::readCurrentSettings( const char *prefix ) {
     bool ok, flag, rc = true;
     int num;
     QString key;
@@ -236,8 +233,7 @@
 /*!
     \brief Write the settings for the current lexer to the settings file.
  */
-void UiguiHighlighter::writeCurrentSettings( const char *prefix )
-{
+void UiguiHighlighter::writeCurrentSettings( const char *prefix ) {
     QString key;
 
     // Write the styles.
--- a/src/UiguiIndentServer.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/UiguiIndentServer.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -127,8 +127,7 @@
 }
 
 
-void UiguiIndentServer::sendMessage( const QString &message )
-{
+void UiguiIndentServer::sendMessage( const QString &message ) {
     readyForHandleRequest = false;
 
     dataToSend = "";
--- a/src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/ImageListSet.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/ImageListSet.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -18,14 +18,12 @@
 #include "ImageListSet.h"
 //#include "resource.h"
 
-void ToolBarIcons::init(ToolBarButtonUnit *buttonUnitArray, int arraySize)
-{
+void ToolBarIcons::init(ToolBarButtonUnit *buttonUnitArray, int arraySize) {
     for (int i = 0 ; i < arraySize ; i++)
         _tbiis.push_back(buttonUnitArray[i]);
 }
 
-void ToolBarIcons::create(HINSTANCE hInst, int iconSize)
-{
+void ToolBarIcons::create(HINSTANCE hInst, int iconSize) {
     _iconListVector.push_back(IconList());
     _iconListVector.push_back(IconList());
     _iconListVector.push_back(IconList());
@@ -47,8 +45,7 @@
     }
 }
 
-void ToolBarIcons::destroy()
-{
+void ToolBarIcons::destroy() {
     _iconListVector[HLIST_DEFAULT].destroy();
     _iconListVector[HLIST_HOT].destroy();
     _iconListVector[HLIST_DISABLE].destroy();
--- a/src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/StaticDialog.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/StaticDialog.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -21,8 +21,7 @@
 #define WS_EX_LAYOUTRTL 0x00400000L
 
 
-void StaticDialog::goToCenter()
-{
+void StaticDialog::goToCenter() {
     RECT rc;
     ::GetClientRect(_hParent, &rc);
     POINT center;
@@ -36,8 +35,7 @@
     ::SetWindowPos(_hSelf, HWND_TOP, x, y, _rc.right - _rc.left, _rc.bottom - _rc.top, SWP_SHOWWINDOW);
 }
 
-HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate)
-{
+HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate) {
     // Get Dlg Template resource
     HRSRC  hDialogRC = ::FindResource(_hInst, MAKEINTRESOURCE(dialogID), RT_DIALOG);
     HGLOBAL  hDlgTemplate = ::LoadResource(_hInst, hDialogRC);
@@ -59,8 +57,7 @@
     return hMyDlgTemplate;
 }
 
-void StaticDialog::create(int dialogID, bool isRTL)
-{
+void StaticDialog::create(int dialogID, bool isRTL) {
     if (isRTL) {
         DLGTEMPLATE *pMyDlgTemplate = NULL;
         HGLOBAL hMyDlgTemplate = makeRTLResource(dialogID, &pMyDlgTemplate);
@@ -78,8 +75,7 @@
     ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGADD, (WPARAM)_hSelf);
 }
 
-BOOL CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
+BOOL CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
     switch (message)
     {
         case WM_INITDIALOG:
@@ -103,8 +99,7 @@
     }
 }
 
-void StaticDialog::alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point)
-{
+void StaticDialog::alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point) {
     RECT rc, rc2;
     ::GetWindowRect(handle, &rc);
 
--- a/src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/SysMsg.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/SysMsg.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -20,8 +20,7 @@
 #include <string>
 #include <algorithm>
 
-DWORD ShortToLongPathName(LPCTSTR lpszShortPath, LPTSTR lpszLongPath, DWORD cchBuffer)
-{
+DWORD ShortToLongPathName(LPCTSTR lpszShortPath, LPTSTR lpszLongPath, DWORD cchBuffer) {
     // Catch null pointers.
     if (!lpszShortPath || !lpszLongPath) {
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -138,8 +137,7 @@
     return (DWORD)path.length();
 }
 
-void systemMessage(const char *title)
-{
+void systemMessage(const char *title) {
     LPVOID lpMsgBuf;
     FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
         NULL,
--- a/src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/ToolBar.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/UniversalIndentGUI_NPP/NPPCommon/Ccpp/ToolBar.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -25,8 +25,7 @@
 
 bool ToolBar::init(HINSTANCE hInst, HWND hPere, int iconSize,
                    ToolBarButtonUnit *buttonUnitArray, int arraySize,
-                   bool doUglyStandardIcon, int *bmpArray, int bmpArraySize)
-{
+                   bool doUglyStandardIcon, int *bmpArray, int bmpArraySize) {
     Window::init(hInst, hPere);
     _state = doUglyStandardIcon ? TB_STANDARD : (iconSize >= 32 ? TB_LARGE : TB_SMALL);
     _bmpArray = bmpArray;
@@ -120,8 +119,7 @@
     return true;
 }
 
-void ToolBar::reset()
-{
+void ToolBar::reset() {
     setDefaultImageList();
     setHotImageList();
     setDisableImageList();
@@ -160,8 +158,7 @@
     ::SendMessage(_hSelf, TB_AUTOSIZE, 0, 0);
 }
 
-void ToolBar::setToUglyIcons()
-{
+void ToolBar::setToUglyIcons() {
     if (_state == TB_STANDARD)
         return;
 
@@ -237,8 +234,7 @@
     _state = TB_STANDARD;
 }
 
-void ReBar::init(HINSTANCE hInst, HWND hPere, ToolBar *pToolBar)
-{
+void ReBar::init(HINSTANCE hInst, HWND hPere, ToolBar *pToolBar) {
     Window::init(hInst, hPere);
     _pToolBar = pToolBar;
     _hSelf = CreateWindowEx(WS_EX_TOOLWINDOW,
--- a/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -42,8 +42,7 @@
 
 
 /* main function of dll */
-BOOL APIENTRY DllMain( HANDLE hModule, DWORD reasonForCall, LPVOID lpReserved )
-{
+BOOL APIENTRY DllMain( HANDLE hModule, DWORD reasonForCall, LPVOID lpReserved ) {
     g_hModule = hModule;
 
     switch (reasonForCall)
@@ -102,8 +101,7 @@
 }
 
 
-extern "C" __declspec(dllexport) void setInfo(NppData notpadPlusData)
-{
+extern "C" __declspec(dllexport) void setInfo(NppData notpadPlusData) {
     /* stores notepad data */
     nppData = notpadPlusData;
 
@@ -115,8 +113,7 @@
 }
 
 
-extern "C" __declspec(dllexport) LPCSTR getName()
-{
+extern "C" __declspec(dllexport) LPCSTR getName() {
     return PLUGIN_NAME;
 }
 
@@ -133,8 +130,7 @@
  *
  *	This function is called, if a notification in Scintilla/Notepad++ occurs
  */
-extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode)
-{
+extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode) {
     if (notifyCode->nmhdr.hwndFrom == nppData._nppHandle) {
         /* on this notification code you can register your plugin icon in Notepad++ toolbar */
         if (notifyCode->nmhdr.code == NPPN_TBMODIFICATION) {
@@ -150,8 +146,7 @@
  *
  *	This function is called, if a notification from Notepad occurs
  */
-extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam)
-{
+extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam) {
     return TRUE;
 }
 
@@ -161,8 +156,7 @@
  *
  *	Load the parameters of plugin
  */
-void loadSettings(void)
-{
+void loadSettings(void) {
     /* initialize the config directory */
     ::SendMessage(nppData._nppHandle, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, (LPARAM)configPath);
 
@@ -187,8 +181,7 @@
  *
  *	Saves the parameters of plugin
  */
-void saveSettings(void)
-{
+void saveSettings(void) {
     TCHAR   temp[16];
 
     ::WritePrivateProfileString(dlgTemp, Value1, _itoa(pluginProp.iValue1, temp, 10), iniFilePath);
@@ -199,8 +192,7 @@
 /**************************************************************************
  *	Interface functions
  */
-void toggleAutoUpdate(void)
-{
+void toggleAutoUpdate(void) {
     HMENU   hMenu = ::GetMenu(nppData._nppHandle);
     UINT state = ::GetMenuState(hMenu, funcItem[TOGGLE_AUTO_UPDATE_INDEX]._cmdID, MF_BYCOMMAND);
 
@@ -220,8 +212,7 @@
 }
 
 
-void showUiGUI(void)
-{
+void showUiGUI(void) {
     HMENU   hMenu = ::GetMenu(nppData._nppHandle);
     UINT menuState = ::GetMenuState(hMenu, funcItem[TOGGLE_SHOW_UIGUI_INDEX]._cmdID, MF_BYCOMMAND);
     bool windowIsVisible = indentHandler->isVisible();
@@ -241,8 +232,7 @@
 }
 
 
-HWND getCurrentHScintilla(int which)
-{
+HWND getCurrentHScintilla(int which) {
     return (which == 0) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle;
 };
 
--- a/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -41,8 +41,7 @@
     "Redo"
 };
 
-void UniversalIndentGUI_NPPDialog::GetNameStrFromCmd(UINT resID, LPTSTR tip)
-{
+void UniversalIndentGUI_NPPDialog::GetNameStrFromCmd(UINT resID, LPTSTR tip) {
     strcpy(tip, szToolTip[resID - IDM_EX_UNDO]);
 }
 /**************************** end of toolbar layout ****************************/
@@ -51,25 +50,21 @@
 
 
 /* Note: Within constructor send dialog IDD to DockingDlgInterface class */
-UniversalIndentGUI_NPPDialog::UniversalIndentGUI_NPPDialog(void) : DockingDlgInterface(IDD_DOCK_DLG), _hEdit(NULL)
-{
+UniversalIndentGUI_NPPDialog::UniversalIndentGUI_NPPDialog(void) : DockingDlgInterface(IDD_DOCK_DLG), _hEdit(NULL) {
 }
 
-UniversalIndentGUI_NPPDialog::~UniversalIndentGUI_NPPDialog(void)
-{
+UniversalIndentGUI_NPPDialog::~UniversalIndentGUI_NPPDialog(void) {
 }
 
 
-void UniversalIndentGUI_NPPDialog::init(HINSTANCE hInst, NppData nppData, tPluginProp *pPluginProp)
-{
+void UniversalIndentGUI_NPPDialog::init(HINSTANCE hInst, NppData nppData, tPluginProp *pPluginProp) {
     _nppData = nppData;
     _pPluginProp = pPluginProp;
     DockingDlgInterface::init(hInst, nppData._nppHandle);
 }
 
 
-void UniversalIndentGUI_NPPDialog::doDialog(bool willBeShown)
-{
+void UniversalIndentGUI_NPPDialog::doDialog(bool willBeShown) {
     if (!isCreated()) {
         create(&_data);
 
@@ -84,8 +79,7 @@
 }
 
 
-BOOL CALLBACK UniversalIndentGUI_NPPDialog::run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
-{
+BOOL CALLBACK UniversalIndentGUI_NPPDialog::run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) {
     switch (Message)
     {
         case WM_INITDIALOG:
@@ -179,8 +173,7 @@
     return FALSE;
 }
 
-void UniversalIndentGUI_NPPDialog::InitialDialog(void)
-{
+void UniversalIndentGUI_NPPDialog::InitialDialog(void) {
     /* get handle of dialogs */
     _hEdit          = ::GetDlgItem(_hSelf, IDC_EDIT_TEMP);
 
@@ -191,8 +184,7 @@
     _Rebar.display();
 }
 
-void UniversalIndentGUI_NPPDialog::tb_cmd(UINT message)
-{
+void UniversalIndentGUI_NPPDialog::tb_cmd(UINT message) {
     switch (message)
     {
         case IDM_EX_UNDO:
--- a/src/aboutdialog.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/aboutdialog.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -28,9 +28,7 @@
     \brief The constructor calls the setup function for the ui created by uic and adds
     the GPL text to the text edit.
  */
-AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags, QString version, QString revision, QString buildDate) :
-    QDialog(parent, flags)
-{
+AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags, QString version, QString revision, QString buildDate) : QDialog(parent, flags) {
     this->parent = parent;
     qApp->setStyleSheet("QTextBrowser{background-color:transparent}");
     setupUi(this);
--- a/src/indenthandler.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/indenthandler.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -42,9 +42,7 @@
     its \a indenterID, which is the number of found indenter ini files in alphabetic
     order starting at index 0.
  */
-IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *parent)
-    : QWidget(parent)
-{
+IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *parent) : QWidget(parent) {
     Q_ASSERT_X( indenterID >= 0, "IndentHandler", "the selected indenterID is < 0" );
 
     setObjectName(QString::fromUtf8("indentHandler"));
--- a/src/main.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/main.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -35,8 +35,7 @@
     -s --server  : Run as server only without gui.
     If -p and -s are set, -p will be used.
  */
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
     QApplication app(argc, argv);
     QString file2OpenOnStart = "";
     bool startAsPlugin = false;
--- a/src/mainwindow.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/mainwindow.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -538,8 +538,7 @@
     Reassigns the line numbers and in case of switch between preview and none preview keeps the text field
     at the same line number.
  */
-void MainWindow::updateSourceView()
-{
+void MainWindow::updateSourceView() {
     textEditLastScrollPos = textEditVScrollBar->value();
 
     if ( toolBarWidget->cbLivePreview->isChecked() ) {
@@ -960,8 +959,7 @@
     for indenter parameters are connected with this event filter.
     So depending on the settings the tooltips can be enabled and disabled for these widgets.
  */
-bool MainWindow::eventFilter(QObject *obj, QEvent *event)
-{
+bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
     if ( event->type() == QEvent::ToolTip) {
         if ( indenterParameterTooltipsEnabledAction->isChecked() ) {
             return QMainWindow::eventFilter(obj, event);
@@ -981,8 +979,7 @@
 /*!
     \brief Is called at application exit and asks whether to save the source code file, if it has been changed.
  */
-bool MainWindow::maybeSave()
-{
+bool MainWindow::maybeSave() {
     if ( isWindowModified() ) {
         int ret = QMessageBox::warning(this, tr("Modified code"),
             tr("The source code has been modified.\n"
--- a/src/uiguiIniFileParser.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/uiguiIniFileParser.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -40,8 +40,7 @@
 /*!
     \brief Init and empty all needed lists and strings.
  */
-UiguiIniFileParser::UiguiIniFileParser(void)
-{
+UiguiIniFileParser::UiguiIniFileParser(void) {
     sections.clear();
     keyValueMap.clear();
     iniFileName = "";
@@ -51,24 +50,21 @@
 /*!
     \brief Directly loads and parses the file with name \a iniFileName.
  */
-UiguiIniFileParser::UiguiIniFileParser(const QString &iniFileName)
-{
+UiguiIniFileParser::UiguiIniFileParser(const QString &iniFileName) {
     UiguiIniFileParser::UiguiIniFileParser();
     this->iniFileName = iniFileName;
     parseIniFile();
 }
 
 
-UiguiIniFileParser::~UiguiIniFileParser(void)
-{
+UiguiIniFileParser::~UiguiIniFileParser(void) {
 }
 
 
 /*!
     \brief Returns the group/section names in the same order as they occurr in the ini file as QStringList.
  */
-QStringList UiguiIniFileParser::childGroups()
-{
+QStringList UiguiIniFileParser::childGroups() {
     QStringList sectionsStringList;
 
     for( unsigned int i = 0; i < sections.size(); i++ ) {
@@ -87,8 +83,7 @@
     <code>[NiceSection]</br>niceKeyName=2</code> you would have to call
     value("NiceSection/niceKeyName").
  */
-QVariant UiguiIniFileParser::value(const QString &keyName, const QString &defaultValue)
-{
+QVariant UiguiIniFileParser::value(const QString &keyName, const QString &defaultValue) {
     return keyValueMap.value( keyName, defaultValue );
 }
 
@@ -96,8 +91,7 @@
 /*!
     \brief Parses the ini file and stores the key value pairs in the internal vectors \a keys and \a values.
  */
-void UiguiIniFileParser::parseIniFile()
-{
+void UiguiIniFileParser::parseIniFile() {
     QFile iniFile(iniFileName);
 
     if ( iniFile.open(QFile::ReadOnly) ) {
--- a/src/uiguisettingsdialog.cpp	Tue Nov 11 11:12:36 2008 +0000
+++ b/src/uiguisettingsdialog.cpp	Tue Nov 11 12:33:57 2008 +0000
@@ -28,8 +28,7 @@
 /*!
     \brief The constructor calls the setup function for the ui created by uic. and adds
 */
-UiguiSettingsDialog::UiguiSettingsDialog(QWidget* parent, UiguiSettings* settings) : QDialog(parent)
-{
+UiguiSettingsDialog::UiguiSettingsDialog(QWidget* parent, UiguiSettings* settings) : QDialog(parent) {
     // Remember pointer to the UiguiSettings object.
     this->settings = settings;