mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Use new T not new T()
This commit is contained in:
parent
43f6b1672b
commit
d52c9fda34
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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(
|
||||
|
@ -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_);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user