From d52c9fda348a9fb830f5dfa7815787587e3e5877 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Fri, 26 Oct 2012 02:42:27 +0200 Subject: [PATCH] Use new T not new T() --- src/Buffer.cpp | 4 ++-- src/LyX.cpp | 8 ++++---- src/WordList.cpp | 2 +- src/frontends/qt4/GuiApplication.cpp | 4 ++-- src/frontends/qt4/GuiClipboard.cpp | 2 +- src/frontends/qt4/GuiProgressView.cpp | 2 +- src/frontends/qt4/GuiView.cpp | 2 +- src/frontends/qt4/GuiViewSource.cpp | 2 +- src/frontends/qt4/PanelStack.cpp | 2 +- src/insets/InsetListingsParams.cpp | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index ebc5d3ae30..a045deadc9 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -493,7 +493,7 @@ Buffer::~Buffer() Buffer * Buffer::cloneFromMaster() const { BufferMap bufmap; - cloned_buffers.push_back(new CloneList()); + cloned_buffers.push_back(new CloneList); CloneList * clones = cloned_buffers.back(); masterBuffer()->cloneWithChildren(bufmap, clones); @@ -549,7 +549,7 @@ void Buffer::cloneWithChildren(BufferMap & bufmap, CloneList * clones) const Buffer * Buffer::cloneBufferOnly() const { - cloned_buffers.push_back(new CloneList()); + cloned_buffers.push_back(new CloneList); CloneList * clones = cloned_buffers.back(); Buffer * buffer_clone = new Buffer(fileName().absFileName(), false, this); clones->insert(buffer_clone); diff --git a/src/LyX.cpp b/src/LyX.cpp index 722f04067a..2962207241 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -1424,7 +1424,7 @@ void setSpellChecker() if (lyxrc.spellchecker == "native") { #if defined(USE_MACOSX_PACKAGING) if (!singleton_->pimpl_->apple_spell_checker_) - singleton_->pimpl_->apple_spell_checker_ = new AppleSpellChecker(); + singleton_->pimpl_->apple_spell_checker_ = new AppleSpellChecker; singleton_->pimpl_->spell_checker_ = singleton_->pimpl_->apple_spell_checker_; #else singleton_->pimpl_->spell_checker_ = 0; @@ -1432,7 +1432,7 @@ void setSpellChecker() } else if (lyxrc.spellchecker == "aspell") { #if defined(USE_ASPELL) if (!singleton_->pimpl_->aspell_checker_) - singleton_->pimpl_->aspell_checker_ = new AspellChecker(); + singleton_->pimpl_->aspell_checker_ = new AspellChecker; singleton_->pimpl_->spell_checker_ = singleton_->pimpl_->aspell_checker_; #else singleton_->pimpl_->spell_checker_ = 0; @@ -1440,7 +1440,7 @@ void setSpellChecker() } else if (lyxrc.spellchecker == "enchant") { #if defined(USE_ENCHANT) if (!singleton_->pimpl_->enchant_checker_) - singleton_->pimpl_->enchant_checker_ = new EnchantChecker(); + singleton_->pimpl_->enchant_checker_ = new EnchantChecker; singleton_->pimpl_->spell_checker_ = singleton_->pimpl_->enchant_checker_; #else singleton_->pimpl_->spell_checker_ = 0; @@ -1448,7 +1448,7 @@ void setSpellChecker() } else if (lyxrc.spellchecker == "hunspell") { #if defined(USE_HUNSPELL) if (!singleton_->pimpl_->hunspell_checker_) - singleton_->pimpl_->hunspell_checker_ = new HunspellChecker(); + singleton_->pimpl_->hunspell_checker_ = new HunspellChecker; singleton_->pimpl_->spell_checker_ = singleton_->pimpl_->hunspell_checker_; #else singleton_->pimpl_->spell_checker_ = 0; diff --git a/src/WordList.cpp b/src/WordList.cpp index 191dc33b83..5dcbc14234 100644 --- a/src/WordList.cpp +++ b/src/WordList.cpp @@ -37,7 +37,7 @@ WordList * theWordList(Language const & lang) if (it != theGlobalWordList.end()) return it->second; else - theGlobalWordList[lang] = new WordList(); + theGlobalWordList[lang] = new WordList; return theGlobalWordList[lang]; } diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 78066242c7..60473c9ff7 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -737,7 +737,7 @@ struct GuiApplication::Private { #ifdef Q_WS_WIN /// WMF Mime handler for Windows clipboard. - wmf_mime_ = new QWindowsMimeMetafile(); + wmf_mime_ = new QWindowsMimeMetafile; #endif initKeySequences(&theTopLevelKeymap()); } @@ -2145,7 +2145,7 @@ void GuiApplication::execBatchCommands() // Create the global default menubar which is shown for the dialogs // and if no GuiView is visible. // This must be done after the session was recovered to know the "last files". - d->global_menubar_ = new GlobalMenuBar(); + d->global_menubar_ = new GlobalMenuBar; d->menus_.fillMenuBar(d->global_menubar_, 0, true); #endif diff --git a/src/frontends/qt4/GuiClipboard.cpp b/src/frontends/qt4/GuiClipboard.cpp index d8f6d5f96c..438feac97b 100644 --- a/src/frontends/qt4/GuiClipboard.cpp +++ b/src/frontends/qt4/GuiClipboard.cpp @@ -66,7 +66,7 @@ static QMimeData const * read_clipboard() qApp->clipboard()->mimeData(QClipboard::Clipboard); if (!source) { LYXERR0("0 bytes (no QMimeData)"); - return new QMimeData(); + return new QMimeData; } // It appears that doing IO between getting a mimeData object // and using it can cause a crash (maybe Qt used IO diff --git a/src/frontends/qt4/GuiProgressView.cpp b/src/frontends/qt4/GuiProgressView.cpp index 2665e46f21..fb52ba8bb7 100644 --- a/src/frontends/qt4/GuiProgressView.cpp +++ b/src/frontends/qt4/GuiProgressView.cpp @@ -52,7 +52,7 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area, : DockView(parent, "progress", qt_("Progress/Debug Messages"), area, flags) { eol_last_ = true; - widget_ = new ProgressViewWidget(); + widget_ = new ProgressViewWidget; widget_->setMinimumHeight(150); widget_->debugMessagesTW->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Expanding); diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index b29a4f8fbb..4b39cecd05 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -238,7 +238,7 @@ struct GuiView::GuiViewPrivate // TODO cleanup, remove the singleton, handle multiple Windows? progress_ = ProgressInterface::instance(); if (!dynamic_cast(progress_)) { - progress_ = new GuiProgress(); // TODO who deletes it + progress_ = new GuiProgress; // TODO who deletes it ProgressInterface::setInstance(progress_); } QObject::connect( diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp index 1fc259ba0a..95cefd8ede 100644 --- a/src/frontends/qt4/GuiViewSource.cpp +++ b/src/frontends/qt4/GuiViewSource.cpp @@ -231,7 +231,7 @@ GuiViewSource::GuiViewSource(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags) : DockView(parent, "view-source", qt_("LaTeX Source"), area, flags) { - widget_ = new ViewSourceWidget(); + widget_ = new ViewSourceWidget; setWidget(widget_); } diff --git a/src/frontends/qt4/PanelStack.cpp b/src/frontends/qt4/PanelStack.cpp index 68fb07e73c..aeb389d5df 100644 --- a/src/frontends/qt4/PanelStack.cpp +++ b/src/frontends/qt4/PanelStack.cpp @@ -86,7 +86,7 @@ PanelStack::PanelStack(QWidget * parent) // Create the output layout, horizontal plus a VBox on the left with the search // box and the tree - QVBoxLayout * left_layout = new QVBoxLayout(); + QVBoxLayout * left_layout = new QVBoxLayout; left_layout->addWidget(search_, 0); left_layout->addWidget(list_, 1); diff --git a/src/insets/InsetListingsParams.cpp b/src/insets/InsetListingsParams.cpp index d055fd01dd..fa488c07d8 100644 --- a/src/insets/InsetListingsParams.cpp +++ b/src/insets/InsetListingsParams.cpp @@ -757,7 +757,7 @@ void InsetListingsParams::addParam(string const & key, // check onoff flag // onoff parameter with value false if (!par_validator) - par_validator = new ParValidator(); + par_validator = new ParValidator; if (par_validator->onoff(key) && (value == "false" || value == "{false}")) params_[keyname] = string(); // if the parameter is surrounded with {}, good @@ -884,7 +884,7 @@ docstring InsetListingsParams::validate() const { docstring msg; if (!par_validator) - par_validator = new ParValidator(); + par_validator = new ParValidator; for (map::const_iterator it = params_.begin(); it != params_.end(); ++it) { msg = par_validator->validate(it->first, it->second); -- 2.39.2