]> git.lyx.org Git - features.git/commitdiff
Use new T not new T()
authorLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 26 Oct 2012 00:42:27 +0000 (02:42 +0200)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 26 Oct 2012 23:25:38 +0000 (01:25 +0200)
src/Buffer.cpp
src/LyX.cpp
src/WordList.cpp
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiClipboard.cpp
src/frontends/qt4/GuiProgressView.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiViewSource.cpp
src/frontends/qt4/PanelStack.cpp
src/insets/InsetListingsParams.cpp

index ebc5d3ae30c112f1bb729102d6dacaa1a759b60f..a045deadc97a46cc81ea6c1b9896cc8e704305a4 100644 (file)
@@ -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);
index 722f04067a6e33acaeb2b808b9b26b401a228680..2962207241cc613f1c78e918817bad6812f76dbf 100644 (file)
@@ -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;
index 191dc33b83ebc365a166ead16bd0dffa47091bde..5dcbc142348622efb76dd09cdadcf876bdf61b9e 100644 (file)
@@ -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];
 }
 
index 78066242c71539b7e39500edb757abddcea84007..60473c9ff742a6df205e1a2a58e7f61672a7d1ad 100644 (file)
@@ -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
 
index d8f6d5f96c27c285fb8bf3b47b52a5982569f705..438feac97bc28cf2fc5923c85e3a4b44b14f71bc 100644 (file)
@@ -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
index 2665e46f21fb997d708a0ae007dfaa4c2a446717..fb52ba8bb759f6f8a2004c1667112df4f9de0b42 100644 (file)
@@ -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);
index b29a4f8fbb376b6bd731940a9e46f02ca70d0c4d..4b39cecd05c7e05335be918a07969e2cc7533d30 100644 (file)
@@ -238,7 +238,7 @@ struct GuiView::GuiViewPrivate
                // TODO cleanup, remove the singleton, handle multiple Windows?
                progress_ = ProgressInterface::instance();
                if (!dynamic_cast<GuiProgress*>(progress_)) {
-                       progress_ = new GuiProgress();  // TODO who deletes it
+                       progress_ = new GuiProgress;  // TODO who deletes it
                        ProgressInterface::setInstance(progress_);
                }
                QObject::connect(
index 1fc259ba0a6ef6bf8d329a06d00b0669168aa314..95cefd8ede6f5c1fb23c77aef417aec7fa1b7cc1 100644 (file)
@@ -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_);
 }
 
index 68fb07e73c4f2fb9a1c2931cb30cae16727e8416..aeb389d5dfd49c7e8dbecd032469a9a09a22c1ef 100644 (file)
@@ -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);
 
index d055fd01ddff8ccb704aab0d61d4ee26dedf2171..fa488c07d82f60af68a702e285e4003f534d0702 100644 (file)
@@ -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<string, string>::const_iterator it = params_.begin();
                it != params_.end(); ++it) {
                msg = par_validator->validate(it->first, it->second);