mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Constify
This commit is contained in:
parent
904d960d6a
commit
a7018252b7
@ -31,7 +31,7 @@ Box::Box(int x1_, int x2_, int y1_, int y2_)
|
||||
{}
|
||||
|
||||
|
||||
bool Box::contains(int x, int y)
|
||||
bool Box::contains(int x, int y) const
|
||||
{
|
||||
return (x1 < x && x2 > x && y1 < y && y2 > y);
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
* the box. Check is exclusive (point on a border
|
||||
* returns false).
|
||||
*/
|
||||
bool contains(int x, int y);
|
||||
bool contains(int x, int y) const;
|
||||
};
|
||||
|
||||
|
||||
|
@ -1610,7 +1610,7 @@ bool Buffer::writeFile(FileName const & fname) const
|
||||
}
|
||||
|
||||
|
||||
docstring Buffer::emergencyWrite()
|
||||
docstring Buffer::emergencyWrite() const
|
||||
{
|
||||
// No need to save if the buffer has not changed.
|
||||
if (isClean())
|
||||
|
@ -259,7 +259,7 @@ public:
|
||||
bool autoSave() const;
|
||||
/// save emergency file
|
||||
/// \return a status message towards the user.
|
||||
docstring emergencyWrite();
|
||||
docstring emergencyWrite() const;
|
||||
|
||||
//FIXME:The following function should be private
|
||||
//private:
|
||||
|
@ -107,7 +107,7 @@ public:
|
||||
: o(o_), n(n_)
|
||||
{}
|
||||
|
||||
bool operator!=(DocPair const & rhs)
|
||||
bool operator!=(DocPair const & rhs) const
|
||||
{
|
||||
// this might not be intuitive but correct for our purpose
|
||||
return o != rhs.o && n != rhs.n;
|
||||
|
@ -259,7 +259,7 @@ void Converters::updateLast(Formats const & formats)
|
||||
|
||||
|
||||
OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path,
|
||||
Buffer const * buffer)
|
||||
Buffer const * buffer) const
|
||||
{
|
||||
for (auto const & edge : path) {
|
||||
Converter const & conv = converterlist_[edge];
|
||||
@ -283,7 +283,7 @@ OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path,
|
||||
}
|
||||
|
||||
|
||||
string Converters::getHyperrefDriver(Graph::EdgePath const & path)
|
||||
string Converters::getHyperrefDriver(Graph::EdgePath const & path) const
|
||||
{
|
||||
for (auto const & edge : path) {
|
||||
Converter const & conv = converterlist_[edge];
|
||||
@ -818,7 +818,7 @@ bool Converters::move(string const & fmt,
|
||||
}
|
||||
|
||||
|
||||
bool Converters::formatIsUsed(string const & format)
|
||||
bool Converters::formatIsUsed(string const & format) const
|
||||
{
|
||||
for (auto const & cvt : converterlist_) {
|
||||
if (cvt.from() == format || cvt.to() == format)
|
||||
|
@ -176,9 +176,9 @@ public:
|
||||
Graph::EdgePath getPath(std::string const & from, std::string const & to);
|
||||
///
|
||||
OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path,
|
||||
Buffer const * buffer = nullptr);
|
||||
Buffer const * buffer = nullptr) const;
|
||||
///
|
||||
std::string getHyperrefDriver(Graph::EdgePath const & path);
|
||||
std::string getHyperrefDriver(Graph::EdgePath const & path) const;
|
||||
/// Flags for converting files
|
||||
enum ConversionFlags {
|
||||
/// No special flags
|
||||
@ -199,7 +199,7 @@ public:
|
||||
///
|
||||
void updateLast(Formats const & formats);
|
||||
///
|
||||
bool formatIsUsed(std::string const & format);
|
||||
bool formatIsUsed(std::string const & format) const;
|
||||
///
|
||||
const_iterator begin() const { return converterlist_.begin(); }
|
||||
///
|
||||
|
@ -502,7 +502,7 @@ void CursorData::clearSelection()
|
||||
}
|
||||
|
||||
|
||||
int CursorData::countInsetsInSelection(InsetCode const & inset_code)
|
||||
int CursorData::countInsetsInSelection(InsetCode const & inset_code) const
|
||||
{
|
||||
if (!selection_)
|
||||
return 0;
|
||||
@ -528,7 +528,7 @@ int CursorData::countInsetsInSelection(InsetCode const & inset_code)
|
||||
}
|
||||
|
||||
|
||||
bool CursorData::insetInSelection(InsetCode const & inset_code)
|
||||
bool CursorData::insetInSelection(InsetCode const & inset_code) const
|
||||
{
|
||||
if (!selection_)
|
||||
return false;
|
||||
@ -669,7 +669,7 @@ void CursorData::recordUndoSelection() const
|
||||
}
|
||||
|
||||
|
||||
int CursorData::currentMode()
|
||||
int CursorData::currentMode() const
|
||||
{
|
||||
LASSERT(!empty(), return Inset::UNDECIDED_MODE);
|
||||
for (int i = depth() - 1; i >= 0; --i) {
|
||||
|
@ -118,7 +118,7 @@ public:
|
||||
///
|
||||
void setWordSelection(bool set) { word_selection_ = set; }
|
||||
///
|
||||
bool wordSelection() { return word_selection_; }
|
||||
bool wordSelection() const { return word_selection_; }
|
||||
/// did we place the anchor?
|
||||
bool mark() const { return mark_; }
|
||||
/// did we place the anchor?
|
||||
@ -131,10 +131,10 @@ public:
|
||||
void clearSelection();
|
||||
/// check whether selection contains specific type of inset
|
||||
/// returns 0 if no selection was made
|
||||
bool insetInSelection(InsetCode const & inset);
|
||||
bool insetInSelection(InsetCode const & inset) const;
|
||||
/// count occurences of specific inset type in the selection
|
||||
/// returns 0 if no selection was made
|
||||
int countInsetsInSelection(InsetCode const & inset);
|
||||
int countInsetsInSelection(InsetCode const & inset) const;
|
||||
|
||||
/// access to normalized selection anchor
|
||||
CursorSlice normalAnchor() const;
|
||||
@ -207,7 +207,7 @@ public:
|
||||
DocIterator newWord() const { return new_word_; }
|
||||
|
||||
/// are we in math mode (2), text mode (1) or unsure (0)?
|
||||
int currentMode();
|
||||
int currentMode() const;
|
||||
|
||||
/// Return true if the next or previous inset has confirmDeletion depending
|
||||
/// on the boolean before. If there is a selection, return true if at least
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
///
|
||||
void setError(bool e) { error_ = e; }
|
||||
///
|
||||
docstring message() { return message_; }
|
||||
docstring message() const { return message_; }
|
||||
///
|
||||
void setMessage(docstring const & m) { message_ = m; }
|
||||
///
|
||||
|
@ -86,7 +86,7 @@ public:
|
||||
///
|
||||
mouse_button::state button() const { return button_; }
|
||||
///
|
||||
KeyModifier modifier() { return modifier_; }
|
||||
KeyModifier modifier() const { return modifier_; }
|
||||
|
||||
/// argument parsing, extract argument i as std::string
|
||||
std::string getArg(unsigned int i) const;
|
||||
|
@ -185,7 +185,7 @@ public:
|
||||
int run(TeXErrors &);
|
||||
|
||||
///
|
||||
int getNumErrors() { return num_errors;}
|
||||
int getNumErrors() const { return num_errors;}
|
||||
|
||||
///
|
||||
int scanLogFile(TeXErrors &);
|
||||
|
@ -359,19 +359,19 @@ public:
|
||||
char_type const c,
|
||||
otexstream & os,
|
||||
pos_type i,
|
||||
unsigned int & column);
|
||||
unsigned int & column) const;
|
||||
///
|
||||
bool latexSpecialTU(
|
||||
char_type const c,
|
||||
otexstream & os,
|
||||
pos_type i,
|
||||
unsigned int & column);
|
||||
unsigned int & column) const;
|
||||
///
|
||||
bool latexSpecialT3(
|
||||
char_type const c,
|
||||
otexstream & os,
|
||||
pos_type i,
|
||||
unsigned int & column);
|
||||
unsigned int & column) const;
|
||||
|
||||
///
|
||||
void validate(LaTeXFeatures & features) const;
|
||||
@ -1316,7 +1316,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
|
||||
|
||||
|
||||
bool Paragraph::Private::latexSpecialT1(char_type const c, otexstream & os,
|
||||
pos_type i, unsigned int & column)
|
||||
pos_type i, unsigned int & column) const
|
||||
{
|
||||
switch (c) {
|
||||
case '>':
|
||||
@ -1344,7 +1344,7 @@ bool Paragraph::Private::latexSpecialT1(char_type const c, otexstream & os,
|
||||
|
||||
|
||||
bool Paragraph::Private::latexSpecialTU(char_type const c, otexstream & os,
|
||||
pos_type i, unsigned int & column)
|
||||
pos_type i, unsigned int & column) const
|
||||
{
|
||||
// TU encoding is currently on par with T1.
|
||||
return latexSpecialT1(c, os, i, column);
|
||||
@ -1352,7 +1352,7 @@ bool Paragraph::Private::latexSpecialTU(char_type const c, otexstream & os,
|
||||
|
||||
|
||||
bool Paragraph::Private::latexSpecialT3(char_type const c, otexstream & os,
|
||||
pos_type /*i*/, unsigned int & column)
|
||||
pos_type /*i*/, unsigned int & column) const
|
||||
{
|
||||
switch (c) {
|
||||
case '*':
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
#endif
|
||||
|
||||
/// Tell whether we asked another instance of LyX to open the files
|
||||
bool deferredLoading() { return deferred_loading_; }
|
||||
bool deferredLoading() const { return deferred_loading_; }
|
||||
|
||||
private:
|
||||
/// the filename of the in pipe
|
||||
|
@ -153,7 +153,7 @@ TocBuilder & TocBackend::builder(string const & type)
|
||||
// TocItem creation and update should be made in a dedicated function and
|
||||
// updateItem should be rewritten to uniformly update the matching items from
|
||||
// all TOCs.
|
||||
bool TocBackend::updateItem(DocIterator const & dit_in)
|
||||
bool TocBackend::updateItem(DocIterator const & dit_in) const
|
||||
{
|
||||
// we need a text
|
||||
DocIterator dit = dit_in.getInnerText();
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
///
|
||||
void reset();
|
||||
/// \return true if the item was updated.
|
||||
bool updateItem(DocIterator const & pit);
|
||||
bool updateItem(DocIterator const & pit) const;
|
||||
///
|
||||
TocList const & tocs() const { return tocs_; }
|
||||
/// never null
|
||||
|
@ -47,7 +47,7 @@ void WorkAreaManager::closeAll()
|
||||
}
|
||||
|
||||
|
||||
bool WorkAreaManager::unhide(Buffer * buf)
|
||||
bool WorkAreaManager::unhide(Buffer * buf) const
|
||||
{
|
||||
if (!work_areas_.empty())
|
||||
return true;
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
void updateTitles();
|
||||
/// If there is no work area, create a new one in the current view using the
|
||||
/// buffer buf. Returns false if not possible.
|
||||
bool unhide(Buffer * buf);
|
||||
bool unhide(Buffer * buf) const;
|
||||
|
||||
private:
|
||||
typedef std::list<WorkArea *>::iterator iterator;
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
///
|
||||
void setSymbol(latexkeys const * sym) { sym_ = sym; }
|
||||
///
|
||||
DocIterator const & pos() { return pos_; }
|
||||
DocIterator const & pos() const { return pos_; }
|
||||
|
||||
/// lock while being drawn to avoid recursions
|
||||
int lock() const { return ++lockCount_; }
|
||||
|
@ -443,7 +443,7 @@ void Parser::dropPosition()
|
||||
}
|
||||
|
||||
|
||||
bool Parser::good()
|
||||
bool Parser::good() const
|
||||
{
|
||||
if (pos_ < tokens_.size())
|
||||
return true;
|
||||
|
@ -334,7 +334,7 @@ public:
|
||||
/// Is any further input pending()? This is not like
|
||||
/// std::istream::good(), which returns true if all available input
|
||||
/// was read, and the next attempt to read would return EOF.
|
||||
bool good();
|
||||
bool good() const;
|
||||
/// resets the parser to initial state
|
||||
void reset();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user