buffer_clone->setChild(dit, child_clone);
}
buffer_clone->d->macro_lock = false;
- return;
}
bool Buffer::activeLabel(docstring const & label) const
{
- if (!insetLabel(label, true))
- return false;
-
- return true;
+ return insetLabel(label, true) != nullptr;
}
if (!lineno_opts.empty())
os << "\\lineno_options " << lineno_opts << '\n';
- if (isbackgroundcolor == true)
+ if (isbackgroundcolor)
os << "\\backgroundcolor " << lyx::X11hexname(backgroundcolor) << '\n';
- if (isfontcolor == true)
+ if (isfontcolor)
os << "\\fontcolor " << lyx::X11hexname(fontcolor) << '\n';
if (notefontcolor != lyx::rgbFromHexName("#cccccc"))
os << "\\notefontcolor " << lyx::X11hexname(notefontcolor) << '\n';
}
// only output when the background color is not default
- if (isbackgroundcolor == true) {
+ if (isbackgroundcolor) {
// only require color here, the background color will be defined
// in LaTeXFeatures.cpp to avoid interferences with the LaTeX
// package pdfpages
}
// only output when the font color is not default
- if (isfontcolor == true) {
+ if (isfontcolor) {
// only require color here, the font color will be defined
// in LaTeXFeatures.cpp to avoid interferences with the LaTeX
// package pdfpages
deplist[FileName(nome)] = di;
}
- return deplist.size();
+ return !deplist.empty();
}
ErrorItem::ErrorItem()
- : start(TexRow::text_none), end(TexRow::text_none), buffer(0)
+ : start(TexRow::text_none), end(TexRow::text_none), buffer(nullptr)
{}
ostream & operator<<(ostream & os, Font const & font)
{
return os << font.bits_
- << " lang: " << (font.lang_ ? font.lang_->lang() : nullptr);
+ << " lang: " << (font.lang_ ? font.lang_->lang() : "");
}
}
-Hunspell * HunspellChecker::Private::addSpeller(Language const * lang,string & path)
+Hunspell * HunspellChecker::Private::addSpeller(Language const * lang, string & path)
{
if (!haveDictionary(lang, path)) {
- spellers_[lang->lang()] = 0;
- return 0;
+ spellers_[lang->lang()] = nullptr;
+ return nullptr;
}
FileName const affix(path + ".aff");
namespace lyx {
Languages languages;
-Language const * ignore_language = 0;
-Language const * default_language = 0;
-Language const * latex_language = 0;
-Language const * reset_language = 0;
+Language const * ignore_language = nullptr;
+Language const * default_language = nullptr;
+Language const * latex_language = nullptr;
+Language const * reset_language = nullptr;
bool Language::isPolyglossiaExclusive() const
break;
if (l.lang() == "latex") {
// Check if latex language was not already defined.
- LASSERT(latex_language == 0, continue);
+ LASSERT(latex_language == nullptr, continue);
static const Language latex_lang = l;
latex_language = &latex_lang;
} else if (l.lang() == "ignore") {
// Check if ignore language was not already defined.
- LASSERT(ignore_language == 0, continue);
+ LASSERT(ignore_language == nullptr, continue);
static const Language ignore_lang = l;
ignore_language = &ignore_lang;
} else
if (match(code, l.second) == ApproximateMatch)
return &l.second;
}
- return 0;
+ return nullptr;
}
return getFromCode(code);
LYXERR0("Unknown language `" << code << "'");
- return 0;
+ return nullptr;
}
bool LyXVC::inUse() const
{
- if (vcs)
- return true;
- return false;
+ return vcs != nullptr;
}
// start the spell checker on the unit of meaning
docstring word = asString(first, last, AS_STR_INSETS + AS_STR_SKIPDELETE);
WordLangTuple wl = WordLangTuple(word, lang);
- SpellChecker::Result result = word.size() ?
+ SpellChecker::Result result = !word.empty() ?
speller->check(wl) : SpellChecker::WORD_OK;
d->markMisspelledWords(first, last, result, word, skips);
first = ++last;
LYXERR(Debug::FILES, "load personal dictionary from: " << fn);
ifstream ifs(fn.toFilesystemEncoding().c_str());
- dirty(words_.size() > 0);
+ dirty(!words_.empty());
words_.clear();
string line;
getline(ifs, line);
bool AuthFilesSection::find(string const & name) const
{
- if (auth_files_.find(name) != auth_files_.end())
- return true;
-
- return false;
+ return auth_files_.find(name) != auth_files_.end();
}
bool ShellEscapeSection::findAuth(string const & name) const
{
- if (shellescape_files_.find(name + ",1") != shellescape_files_.end())
- return true;
-
- return false;
+ return shellescape_files_.find(name + ",1") != shellescape_files_.end();
}
Cursor prev_cur = cur;
--prev_cur.pit();
- if (cur.paragraph().size() > 0
+ if (!cur.paragraph().empty()
&& !prev_cur.paragraph().isMergedOnEndOfParDeletion(cur.buffer()->params().track_changes)) {
cur.recordUndo(prev_cur.pit(), prev_cur.pit());
prev_cur.paragraph().setChange(prev_cur.lastpos(), Change(Change::DELETED));
Paragraph const & nextpar = lastpar ? par : pars_[pit + 1];
pit_type prev = pit > 0 ? depthHook(pit, par.getDepth()) : pit;
if (prev < pit && cur.pos() == par.beginOfBody()
- && !par.size() && !par.isEnvSeparator(cur.pos())
+ && par.empty() && !par.isEnvSeparator(cur.pos())
&& !par.layout().keepempty
&& !par.layout().isCommand()
&& pars_[prev].layout() != par.layout()
}
LYXERR(Debug::DEBUG, "No inset hit. ");
- return 0;
+ return nullptr;
}
KmodException::const_iterator cit = deadkey_info_.exception_list.begin();
KmodException::const_iterator end = deadkey_info_.exception_list.end();
for (; cit != end; ++cit) {
- if (cit->combined == true && cit->accent == d.accent) {
+ if (cit->combined && cit->accent == d.accent) {
deadkey2_ = c;
deadkey2_info_ = d;
comb_info_ = (*cit);
// A deadkey was pressed that cannot be printed
// or a accent command was typed in the minibuffer
KmodInfo i;
- if (active_->isAccentDefined(accent, i) == true) {
+ if (active_->isAccentDefined(accent, i)) {
docstring const res = trans_fsm_
.currentState->deadkey(c, i);
insert(res, t, cur);
// Here we know that the buffer file is either already in SVN or
// about to be registered
master_ = m;
- locked_mode_ = 0;
+ locked_mode_ = false;
scanMaster();
}
double pixelRatio() const { return pixel_ratio_; }
- double develMode() const { return devel_mode_; }
+ bool develMode() const { return devel_mode_; }
/// draw the underbar, strikeout, xout, uuline and uwave font attributes
virtual void textDecoration(FontInfo const & f, int x, int y, int width) = 0;
class CCFilterModel : public QSortFilterProxyModel {
public:
///
- CCFilterModel(QObject * parent = 0)
+ CCFilterModel(QObject * parent = nullptr)
: QSortFilterProxyModel(parent)
{}
};
m_lineEdit(parent)
{
for (int i = 0; i < 2; ++i) {
- m_menu[i] = 0;
+ m_menu[i] = nullptr;
m_menuTabFocusTrigger[i] = false;
m_iconbutton[i] = new IconButton(parent);
m_iconbutton[i]->installEventFilter(this);
FindAndReplace::~FindAndReplace()
{
- setFocusProxy(0);
+ setFocusProxy(nullptr);
delete widget_;
}
old_buffer_ = &bv->buffer();
}
} else
- old_buffer_ = 0;
+ old_buffer_ = nullptr;
bool const replace_enabled = bv && !bv->buffer().isReadonly();
replace_work_area_->setEnabled(replace_enabled);
FloatPlacement::FloatPlacement(bool show_options, QWidget * parent)
: InsetParamsWidget(parent), standardfloat_(true),
- allows_wide_(true), allows_sideways_(true), float_list_(0)
+ allows_wide_(true), allows_sideways_(true), float_list_(nullptr)
{
setupUi(this);
struct GuiApplication::Private
{
- Private(): language_model_(0), meta_fake_bit(NoModifier),
- global_menubar_(0)
+ Private(): language_model_(nullptr), meta_fake_bit(NoModifier),
+ global_menubar_(nullptr)
{
#if (QT_VERSION < 0x050000) || (QT_VERSION >= 0x050400)
#if defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)
GuiApplication::GuiApplication(int & argc, char ** argv)
- : QApplication(argc, argv), current_view_(0),
+ : QApplication(argc, argv), current_view_(nullptr),
d(new GuiApplication::Private)
{
QString app_name = "LyX";
{
FuncStatus status;
- BufferView * bv = 0;
- BufferView * doc_bv = 0;
+ BufferView * bv = nullptr;
+ BufferView * doc_bv = nullptr;
if (cmd.action() == LFUN_NOACTION) {
status.message(from_utf8(N_("Nothing to do")));
break;
case LFUN_WINDOW_CLOSE:
- enable = d->views_.size() > 0;
+ enable = !d->views_.empty();
break;
case LFUN_BUFFER_NEW:
namespace frontend {
GuiErrorList::GuiErrorList(GuiView & lv)
- : GuiDialog(lv, "errorlist", qt_("Error List")), buf_(0), from_master_(false)
+ : GuiDialog(lv, "errorlist", qt_("Error List")), buf_(nullptr), from_master_(false)
{
setupUi(this);
bool GuiImage::rotate(Params const & params)
{
- if (!params.angle)
+ if (params.angle == 0)
return false;
QImage const & image = is_transformed_ ? transformed_ : original_;
return;
QTreeWidgetItem * sel = selections.first();
refHighlighted(sel);
- return;
}
GuiSendTo::GuiSendTo(GuiView & lv)
- : GuiDialog(lv, "sendto", qt_("Export or Send Document")), format_(0)
+ : GuiDialog(lv, "sendto", qt_("Export or Send Document")), format_(nullptr)
{
setupUi(this);
Format const * current_format = nullptr;
int const line = formatLW->currentRow();
if (line >= 0 && static_cast<unsigned int>(line) < all_formats.size()
- && formatLW->selectedItems().size() > 0)
+ && !formatLW->selectedItems().empty())
current_format = all_formats[line];
// Reset the list widget
formatLW->clear();
if (line < 0 || (line > int(formatLW->count())))
return false;
- return (formatLW->selectedItems().size() > 0
+ return (!formatLW->selectedItems().empty()
&& formatLW->count() != 0);
}
bool GuiSendTo::initialiseParams(string const &)
{
- format_ = 0;
+ format_ = nullptr;
paramsToDialog(format_, command_);
return true;
}
{
public:
Model(GuiSymbols * parent)
- : QAbstractListModel(parent), encoding_(0)
+ : QAbstractListModel(parent), encoding_(nullptr)
{}
QModelIndex index(int row, int column, QModelIndex const &) const override
GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner)
: QToolBar(toqstr(tbinfo.gui_name), &owner), visibility_(0),
- owner_(owner), command_buffer_(0), tbinfo_(tbinfo), filled_(false),
+ owner_(owner), command_buffer_(nullptr), tbinfo_(tbinfo), filled_(false),
restored_(false)
{
setIconSize(owner.iconSize());
Private(Private const &);
void operator=(Private const &);
public:
- Private() : inset_(0) {}
+ Private() : inset_(nullptr) {}
///
DocumentClassConstPtr text_class_;
///
found_formats.push_back(*it);
FuncRequest cmd;
- if (found_formats.size() >= 1) {
+ if (!found_formats.empty()) {
if (found_formats.size() > 1) {
//FIXME: show a dialog to choose the correct importable format
LYXERR(Debug::FILES,
cur.boundary(bound);
d->buffer_view_->buffer().changed(false);
- return;
}
class GuiLayoutFilterModel : public QSortFilterProxyModel {
public:
///
- GuiLayoutFilterModel(QObject * parent = 0)
+ GuiLayoutFilterModel(QObject * parent = nullptr)
: QSortFilterProxyModel(parent)
{}
void operator=(Private const &);
public:
Private(LayoutBox * parent, GuiView & gv) : p(parent), owner_(gv),
- inset_(0),
+ inset_(nullptr),
// set the layout model with two columns
// 1st: translated layout names
// 2nd: raw layout names
setEnabled(false);
setMinimumWidth(sizeHint().width());
d->text_class_.reset();
- d->inset_ = 0;
+ d->inset_ = nullptr;
return;
}
// we'll only update the layout list if the text class has changed
void PanelStack::addCategory(QString const & name, QString const & parent)
{
- QTreeWidgetItem * item = 0;
+ QTreeWidgetItem * item = nullptr;
LYXERR(Debug::GUI, "addCategory n= " << name << " parent= ");
for (Infos::const_iterator it = toolbar_info_.begin(); it != end; ++it)
if (it->name == name)
return &(*it);
- return 0;
+ return nullptr;
}
InsetIPAChar::InsetIPAChar(Kind k)
- : Inset(0), kind_(k)
+ : Inset(nullptr), kind_(k)
{}
namespace lyx {
-InsetNewline::InsetNewline() : Inset(0)
+InsetNewline::InsetNewline() : Inset(nullptr)
{}
namespace lyx {
- InsetNewpage::InsetNewpage() : Inset(0)
+ InsetNewpage::InsetNewpage() : Inset(nullptr)
{}
InsetNewpage::InsetNewpage(InsetNewpageParams const & params)
- : Inset(0), params_(params)
+ : Inset(nullptr), params_(params)
{}
struct NomenclEntry {
- NomenclEntry() : par(0) {}
+ NomenclEntry() : par(nullptr) {}
NomenclEntry(docstring s, docstring d, Paragraph const * p)
: symbol(s), desc(d), par(p)
{}
int w = 0;
docstring symb;
- InsetNomencl const * nomencl = 0;
+ InsetNomencl const * nomencl = nullptr;
ParagraphList::const_iterator it = buffer.paragraphs().begin();
ParagraphList::const_iterator end = buffer.paragraphs().end();
switch (type) {
case 0x0027: {
if (features.runparams().isFullUnicode() && fontspec_)
- features.require("textquotesinglep");
- else
- features.require("textcomp");
- break;
+ features.require("textquotesinglep");
+ else
+ features.require("textcomp");
+ break;
}
case 0x0022: {
if (features.runparams().isFullUnicode() && fontspec_)
namespace lyx {
-InsetSeparator::InsetSeparator() : Inset(0)
+InsetSeparator::InsetSeparator() : Inset(nullptr)
{}
InsetSeparator::InsetSeparator(InsetSeparatorParams const & params)
- : Inset(0), params_(params)
+ : Inset(nullptr), params_(params)
{}
InsetSpace::InsetSpace(InsetSpaceParams const & params)
- : Inset(0), params_(params)
+ : Inset(nullptr), params_(params)
{}
InsetSpecialChar::InsetSpecialChar(Kind k)
- : Inset(0), kind_(k)
+ : Inset(nullptr), kind_(k)
{}
bool Tabular::isLastCell(idx_type cell) const
{
- if (cell + 1 < numberofcells)
- return false;
- return true;
+ return cell + 1 >= numberofcells;
}
InsetVSpace::InsetVSpace(VSpace const & space)
- : Inset(0), space_(space)
+ : Inset(nullptr), space_(space)
{}
if (!cur.selection()) {
// no selection, non-empty search string: find it
if (!searchstr.empty()) {
- bool found = findOne(bv, searchstr, case_sens, whole, forward, true, findnext);
+ bool const found = findOne(bv, searchstr, case_sens, whole, forward, true, findnext);
return make_pair(found, 0);
}
// empty search string
// no selection or current selection is not search word:
// just find the search word
if (!have_selection || !match) {
- bool found = findOne(bv, searchstr, case_sens, whole, forward, true, findnext);
+ bool const found = findOne(bv, searchstr, case_sens, whole, forward, true, findnext);
return make_pair(found, 0);
}
static void changeFirstCase(Buffer & buffer, TextCase first_case, TextCase others_case)
{
ParagraphList::iterator pit = buffer.paragraphs().begin();
- LASSERT(pit->size() >= 1, /**/);
+ LASSERT(!pit->empty(), /**/);
pos_type right = pos_type(1);
pit->changeCase(buffer.params(), pos_type(0), right, first_case);
right = pit->size();
static int findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, MatchStringAdv & matchAdv)
{
Cursor & cur = bv->cursor();
- if (opt.repl_buf_name == docstring()
+ if (opt.repl_buf_name.empty()
|| theBufferList().getBuffer(FileName(to_utf8(opt.repl_buf_name)), true) == 0
|| theBufferList().getBuffer(FileName(to_utf8(opt.find_buf_name)), true) == 0)
return 0;
// We have to ensure correct spacing when the front and/or back
// atoms are not ordinary ones (bug 11827).
docstring const frontclass =
- cell(0).size() ? class_to_string(cell(0).front()->mathClass())
+ !cell(0).empty() ? class_to_string(cell(0).front()->mathClass())
: from_ascii("mathord");
docstring const backclass =
- cell(0).size() ? class_to_string(cell(0).back()->mathClass())
+ !cell(0).empty() ? class_to_string(cell(0).back()->mathClass())
: from_ascii("mathord");
bool adjchk = os.latex() && !os.inMathClass() && (normalcolor(color_) || oldstyle_);
bool adjust_front = frontclass != "mathord" && adjchk;
bool InsetMathFont::lockedMode() const
{
- if (key_->extra == "forcetext")
- return true;
- return false;
+ return key_->extra == "forcetext";
}
InsetMathFrac * InsetMathFrac::asFracInset()
{
- return kind_ == ATOP ? 0 : this;
+ return kind_ == ATOP ? nullptr : this;
}
InsetMathFrac const * InsetMathFrac::asFracInset() const
{
- return kind_ == ATOP ? 0 : this;
+ return kind_ == ATOP ? nullptr : this;
}
numbered(0, false);
} else {
setType(hullEquation);
- numbered(0, label_[0] ? true : false);
+ numbered(0, label_[0] != nullptr);
mutate(newtype);
}
break;
: name_(name), displayMode_(DISPLAY_INIT),
expanded_(buf), definition_(buf), attachedArgsNum_(0),
optionals_(0), nextFoldMode_(true), macroBackup_(buf),
- macro_(0), needsUpdate_(false), isUpdating_(false),
+ macro_(nullptr), needsUpdate_(false), isUpdating_(false),
appetite_(9), nesting_(0), limits_(AUTO_LIMITS)
{
}
d->needsUpdate_ = true;
}
} else {
- d->macro_ = 0;
+ d->macro_ = nullptr;
}
}
UpdateLocker locker(*this);
// known macro?
- if (d->macro_ == 0)
+ if (d->macro_ == nullptr)
return;
// remember nesting level of this macro
InsetMathMacro::DisplayMode InsetMathMacro::computeDisplayMode() const
{
- if (d->nextFoldMode_ == true && d->macro_ && !d->macro_->locked())
+ if (d->nextFoldMode_ && d->macro_ && !d->macro_->locked())
return DISPLAY_NORMAL;
else
return DISPLAY_UNFOLDED;
// contains macros with optionals.
bool braced = false;
size_type last = cell(i).size() - 1;
- if (cell(i).size() && cell(i)[last]->asUnknownInset()) {
+ if (!cell(i).empty() && cell(i)[last]->asUnknownInset()) {
latexkeys const * l = in_word_set(cell(i)[last]->name());
braced = (l && l->inset == "big");
- } else if (cell(i).size() && cell(i)[0]->asScriptInset()) {
+ } else if (!cell(i).empty() && cell(i)[0]->asScriptInset()) {
braced = cell(i)[0]->asScriptInset()->nuc().empty();
} else {
for (size_type j = 0; j < cell(i).size(); ++j) {
InsetMathNest::createCompletionList(Cursor const & cur) const
{
if (!cur.inMacroMode())
- return 0;
+ return nullptr;
return new MathCompletionList(cur);
}
if (up == cell_1_is_up_)
cells_.pop_back();
} else if (nargs() == 3) {
- if (up == true) {
+ if (up) {
swap(cells_[1], cells_[2]);
cell_1_is_up_ = false;
} else {
"det", "dim", "exp", "gcd", "hom", "inf", "ker",
"lg", "lim", "liminf", "limsup", "ln", "log",
"max", "min", "sec", "sin", "sinh", "sup",
- "tan", "tanh", "Pr", 0
+ "tan", "tanh", "Pr", nullptr
};
static size_t const npos = lyx::docstring::npos;
{
MathWordList::iterator it = theMathWordList.find(str);
if (it == theMathWordList.end())
- return 0;
+ return nullptr;
if (it->second.inset == "macro")
- return 0;
+ return nullptr;
return &(it->second);
}
if (ar[i].size() == 1)
script[i] = ar[i][0].nucleus()->asScriptInset();
}
- bool const hasscript[2] = {script[0] ? true : false, script[1] ? true : false};
+ bool const hasscript[2] = {script[0] != nullptr, script[1] != nullptr};
cell->push_back(MathAtom(new InsetMathSideset(buf, hasscript[0], hasscript[1])));
if (hasscript[0]) {
if (script[0]->hasDown())
MathRow::Element::Element(MetricsInfo const & mi, Type t, MathClass mc)
: type(t), mclass(mc), before(0), after(0), macro_nesting(mi.base.macro_nesting),
- marker(InsetMath::NO_MARKER), inset(0), compl_unique_to(0), ar(0),
+ marker(InsetMath::NO_MARKER), inset(nullptr), compl_unique_to(0), ar(nullptr),
color(Color_red)
{}
// commands. Instead, return always true when using babel with
// only a begin command.
- return state->lang_switch_depth_.size() == 0
+ return state->lang_switch_depth_.empty()
? true
: abs(state->lang_switch_depth_.top()) == state->nest_level_;
}
{
// Return true if the language was opened by a local command switch.
- return state->lang_switch_depth_.size()
+ return !state->lang_switch_depth_.empty()
&& state->lang_switch_depth_.top() < 0;
}
{
// Return true if the language was opened at the current nesting level.
- return state->lang_switch_depth_.size()
+ return !state->lang_switch_depth_.empty()
&& abs(state->lang_switch_depth_.top()) == state->nest_level_;
}
// polyglossia or begin/end commands, then the current
// language is the document language.
string const & cur_lang = using_begin_end
- && state->lang_switch_depth_.size()
+ && !state->lang_switch_depth_.empty()
? openLanguageName(state)
: doc_lang;
if ((par->layout() != nextpar->layout()
|| par->params().depth() == nextpar->params().depth()
|| par->params().leftIndent() == nextpar->params().leftIndent())
- && !runparams.for_search && cpar.size() > 0
+ && !runparams.for_search && !cpar.empty()
&& cpar.isDeleted(0, cpar.size()) && !buf.params().output_changes) {
if (!buf.params().output_changes && !cpar.parEndChange().deleted())
os << '\n' << '\n';
// Do not output empty commands if the whole paragraph has
// been deleted with ct and changes are not output.
if (!runparams_in.for_search && style.latextype != LATEX_ENVIRONMENT
- && par.size() > 0 && par.isDeleted(0, par.size()) && !bparams.output_changes)
+ && !par.empty() && par.isDeleted(0, par.size()) && !bparams.output_changes)
return;
LYXERR(Debug::LATEX, "TeXOnePar for paragraph " << pit << " ptr " << &par << " '"
&& nextpar
&& style != nextpar->layout())))
|| (atSameLastLangSwitchDepth(state)
- && state->lang_switch_depth_.size()
+ && !state->lang_switch_depth_.empty()
&& cur_lang != par_lang)
|| in_polyglossia_rtl_env)
{
}
bool const last_was_separator =
- par.size() > 0 && par.isEnvSeparator(par.size() - 1);
+ !par.empty() && par.isEnvSeparator(par.size() - 1);
// Signify added/deleted par break in output if show changes in output
if (nextpar && !os.afterParbreak() && !last_was_separator
if ((par->layout() != nextpar->layout()
|| par->params().depth() == nextpar->params().depth()
|| par->params().leftIndent() == nextpar->params().leftIndent())
- && !runparams.for_search && cpar.size() > 0
+ && !runparams.for_search && !cpar.empty()
&& cpar.isDeleted(0, cpar.size()) && !bparams.output_changes) {
if (!cpar.parEndChange().deleted())
os << '\n' << '\n';
: fi(toqstr(handleTildeName(abs_filename)))
{
name = fromqstr(fi.absoluteFilePath());
- fi.setCaching(fi.exists() ? true : false);
+ fi.setCaching(fi.exists());
}
///
inline void refresh()
bool doesFileExist(FileName & result, string const & search_dir, string const & name)
{
result = fileSearch(search_dir, name);
- if (!result.empty()) {
- return true;
- }
- return false;
+ return !result.empty();
}
} else if (doesFileExist(lyx_binary, search_dir, "lyx" + string(PROGRAM_SUFFIX) + ext)) {
} else if (doesFileExist(lyx_binary, search_dir, "LyX" + string(PROGRAM_SUFFIX) + ext)){
}
- return !lyx_binary.empty() ? true : false;
+ return !lyx_binary.empty();
}
}
if (ok) {
err = ios_base::goodbit;
- v = truename == s ? true : false;
+ v = (truename == s);
} else
err = ios_base::failbit;
if (iit == eit)
return false;
}
LayoutFile const & f = l[i];
- ostream * os = NULL;
+ ostream * os = nullptr;
if (output == "-")
os = &cout;
else if (!output.empty())
Parser::Parser(idocstream & is, std::string const & fixedenc)
- : lineno_(0), pos_(0), iss_(0), is_(is),
+ : lineno_(0), pos_(0), iss_(nullptr), is_(is),
encoding_iconv_(fixedenc.empty() ? "UTF-8" : fixedenc),
theCatcodesType_(NORMAL_CATCODES), curr_cat_(UNDECIDED_CATCODES),
fixed_enc_(!fixedenc.empty())