mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-14 12:25:11 +00:00
A first batch of potential bugs spotted by llvm/clang
There are more warnings left, but these are the easiest to fix. And some of them are real bugs (assignments with == instead of =).
This commit is contained in:
parent
154319d063
commit
bd2e7480b1
@ -385,7 +385,7 @@ public:
|
|||||||
/// \return true if there is a Layout with latexname lay
|
/// \return true if there is a Layout with latexname lay
|
||||||
bool hasLaTeXLayout(std::string const & lay) const;
|
bool hasLaTeXLayout(std::string const & lay) const;
|
||||||
/// A DocumentClass nevers count as loaded, since it is dynamic
|
/// A DocumentClass nevers count as loaded, since it is dynamic
|
||||||
virtual bool loaded() { return false; }
|
virtual bool loaded() const { return false; }
|
||||||
/// \return the layout object of an inset given by name. If the name
|
/// \return the layout object of an inset given by name. If the name
|
||||||
/// is not found as such, the part after the ':' is stripped off, and
|
/// is not found as such, the part after the ':' is stripped off, and
|
||||||
/// searched again. In this way, an error fallback can be provided:
|
/// searched again. In this way, an error fallback can be provided:
|
||||||
|
@ -183,8 +183,6 @@ private:
|
|||||||
GuiIdListModel modules_av_model_;
|
GuiIdListModel modules_av_model_;
|
||||||
/// selected modules
|
/// selected modules
|
||||||
GuiIdListModel modules_sel_model_;
|
GuiIdListModel modules_sel_model_;
|
||||||
/// current buffer
|
|
||||||
BufferId current_id_;
|
|
||||||
|
|
||||||
/// return false if validate_listings_params returns error
|
/// return false if validate_listings_params returns error
|
||||||
bool isValid();
|
bool isValid();
|
||||||
|
@ -131,10 +131,12 @@ QString symbolFamily(FontFamily family)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
bool isSymbolFamily(FontFamily family)
|
bool isSymbolFamily(FontFamily family)
|
||||||
{
|
{
|
||||||
return family >= SYMBOL_FAMILY && family <= ESINT_FAMILY;
|
return family >= SYMBOL_FAMILY && family <= ESINT_FAMILY;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static bool isChosenFont(QFont & font, QString const & family)
|
static bool isChosenFont(QFont & font, QString const & family)
|
||||||
|
@ -968,7 +968,7 @@ void GuiWorkArea::generateSyntheticMouseEvent()
|
|||||||
d->buffer_view_->scroll(up ? -step : step);
|
d->buffer_view_->scroll(up ? -step : step);
|
||||||
d->buffer_view_->updateMetrics();
|
d->buffer_view_->updateMetrics();
|
||||||
} else {
|
} else {
|
||||||
d->buffer_view_->scrollDocView(value + up ? -step : step, false);
|
d->buffer_view_->scrollDocView(value + (up ? -step : step), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// In which paragraph do we have to set the cursor ?
|
// In which paragraph do we have to set the cursor ?
|
||||||
|
@ -257,8 +257,6 @@ protected:
|
|||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
QPoint dragStartPos_;
|
QPoint dragStartPos_;
|
||||||
///
|
|
||||||
int dragCurrentIndex_;
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
///
|
///
|
||||||
|
@ -262,6 +262,7 @@ void TocWidget::on_persistentCB_stateChanged(int state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* FIXME (Ugras 17/11/06):
|
/* FIXME (Ugras 17/11/06):
|
||||||
I have implemented a indexDepth function to get the model indices. In my
|
I have implemented a indexDepth function to get the model indices. In my
|
||||||
opinion, somebody should derive a new qvariant class for tocModelItem
|
opinion, somebody should derive a new qvariant class for tocModelItem
|
||||||
@ -274,7 +275,7 @@ static int indexDepth(QModelIndex const & index, int depth = -1)
|
|||||||
return index.parent() == QModelIndex()
|
return index.parent() == QModelIndex()
|
||||||
? depth : indexDepth(index.parent(), depth);
|
? depth : indexDepth(index.parent(), depth);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void TocWidget::on_depthSL_valueChanged(int depth)
|
void TocWidget::on_depthSL_valueChanged(int depth)
|
||||||
{
|
{
|
||||||
|
@ -31,6 +31,8 @@ class Lexer;
|
|||||||
|
|
||||||
class ParamInfo {
|
class ParamInfo {
|
||||||
public:
|
public:
|
||||||
|
///
|
||||||
|
ParamInfo() {}
|
||||||
/// Types of parameters
|
/// Types of parameters
|
||||||
enum ParamType {
|
enum ParamType {
|
||||||
LATEX_OPTIONAL, /// normal optional argument
|
LATEX_OPTIONAL, /// normal optional argument
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
///
|
///
|
||||||
InsetCode lyxCode() const { return CELL_CODE; }
|
InsetCode lyxCode() const { return CELL_CODE; }
|
||||||
///
|
///
|
||||||
Inset * clone() { return new InsetTableCell(*this); }
|
Inset * clone() const { return new InsetTableCell(*this); }
|
||||||
///
|
///
|
||||||
bool getStatus(Cursor & cur, FuncRequest const & cmd,
|
bool getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||||
FuncStatus & status) const;
|
FuncStatus & status) const;
|
||||||
|
@ -101,7 +101,7 @@ void InsetMathFont::validate(LaTeXFeatures & features) const
|
|||||||
|| (key_->name.length() == 6 && key_->name.substr(0, 4) == "text"))
|
|| (key_->name.length() == 6 && key_->name.substr(0, 4) == "text"))
|
||||||
features.require("amstext");
|
features.require("amstext");
|
||||||
if (key_->name == "mathscr")
|
if (key_->name == "mathscr")
|
||||||
features.require("mathrsfs");
|
features.require("mathrsfs");
|
||||||
if (key_->name == "textipa")
|
if (key_->name == "textipa")
|
||||||
features.require("tipa");
|
features.require("tipa");
|
||||||
if (key_->name == "ce" || key_->name == "cf")
|
if (key_->name == "ce" || key_->name == "cf")
|
||||||
@ -139,7 +139,7 @@ void InsetMathFont::htmlize(HtmlStream & os) const
|
|||||||
|| tag == "textbf")
|
|| tag == "textbf")
|
||||||
variant = "bold";
|
variant = "bold";
|
||||||
else if (tag == "mathcal")
|
else if (tag == "mathcal")
|
||||||
variant == "script";
|
variant = "script";
|
||||||
else if (tag == "mathit" || tag == "textsl"
|
else if (tag == "mathit" || tag == "textsl"
|
||||||
|| tag == "emph" || tag == "textit")
|
|| tag == "emph" || tag == "textit")
|
||||||
variant = "italic";
|
variant = "italic";
|
||||||
@ -149,7 +149,7 @@ void InsetMathFont::htmlize(HtmlStream & os) const
|
|||||||
variant = "monospace";
|
variant = "monospace";
|
||||||
else if (tag == "textipa" || tag == "textsc" || tag == "noun")
|
else if (tag == "textipa" || tag == "textsc" || tag == "noun")
|
||||||
variant = "noun";
|
variant = "noun";
|
||||||
|
|
||||||
docstring const beg = (tag.size() < 4) ? from_ascii("") : tag.substr(0, 4);
|
docstring const beg = (tag.size() < 4) ? from_ascii("") : tag.substr(0, 4);
|
||||||
if (!variant.empty()) {
|
if (!variant.empty()) {
|
||||||
os << MTag("span", "class='" + variant + "'")
|
os << MTag("span", "class='" + variant + "'")
|
||||||
@ -179,7 +179,7 @@ void InsetMathFont::mathmlize(MathStream & os) const
|
|||||||
|| tag == "textbf")
|
|| tag == "textbf")
|
||||||
variant = "bold";
|
variant = "bold";
|
||||||
else if (tag == "mathcal")
|
else if (tag == "mathcal")
|
||||||
variant == "script";
|
variant = "script";
|
||||||
else if (tag == "mathit" || tag == "textsl"
|
else if (tag == "mathit" || tag == "textsl"
|
||||||
|| tag == "emph" || tag == "textit")
|
|| tag == "emph" || tag == "textit")
|
||||||
variant = "italic";
|
variant = "italic";
|
||||||
@ -188,7 +188,7 @@ void InsetMathFont::mathmlize(MathStream & os) const
|
|||||||
else if (tag == "mathtt" || tag == "texttt")
|
else if (tag == "mathtt" || tag == "texttt")
|
||||||
variant = "monospace";
|
variant = "monospace";
|
||||||
// no support at present for textipa, textsc, noun
|
// no support at present for textipa, textsc, noun
|
||||||
|
|
||||||
if (!variant.empty()) {
|
if (!variant.empty()) {
|
||||||
os << MTag("mstyle", "mathvariant='" + variant + "'")
|
os << MTag("mstyle", "mathvariant='" + variant + "'")
|
||||||
<< cell(0)
|
<< cell(0)
|
||||||
|
@ -55,8 +55,8 @@ public:
|
|||||||
* \param filename the file in question. Must have an absolute path.
|
* \param filename the file in question. Must have an absolute path.
|
||||||
* Encoding is always UTF-8.
|
* Encoding is always UTF-8.
|
||||||
*/
|
*/
|
||||||
virtual void set(std::string const & filename);
|
void set(std::string const & filename);
|
||||||
virtual void set(FileName const & fn, std::string const & suffix);
|
void set(FileName const & fn, std::string const & suffix);
|
||||||
virtual void erase();
|
virtual void erase();
|
||||||
/// Is this filename empty?
|
/// Is this filename empty?
|
||||||
bool empty() const;
|
bool empty() const;
|
||||||
@ -253,7 +253,7 @@ public:
|
|||||||
* \param buffer_path if \c filename has a relative path, generate
|
* \param buffer_path if \c filename has a relative path, generate
|
||||||
* the absolute path using this.
|
* the absolute path using this.
|
||||||
*/
|
*/
|
||||||
virtual void set(std::string const & filename, std::string const & buffer_path);
|
void set(std::string const & filename, std::string const & buffer_path);
|
||||||
///
|
///
|
||||||
void erase();
|
void erase();
|
||||||
///
|
///
|
||||||
|
@ -69,7 +69,7 @@ namespace lyx {
|
|||||||
|
|
||||||
// This version use the traditional gettext.
|
// This version use the traditional gettext.
|
||||||
Messages::Messages(string const & l)
|
Messages::Messages(string const & l)
|
||||||
: lang_(l), warned_(false)
|
: lang_(l)
|
||||||
{
|
{
|
||||||
// strip off any encoding suffix, i.e., assume 8-bit po files
|
// strip off any encoding suffix, i.e., assume 8-bit po files
|
||||||
size_t i = lang_.find(".");
|
size_t i = lang_.find(".");
|
||||||
|
@ -36,8 +36,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
std::string lang_;
|
std::string lang_;
|
||||||
/// Did we warn about unavailable locale already?
|
|
||||||
mutable bool warned_;
|
|
||||||
///
|
///
|
||||||
typedef std::map<std::string, docstring> TranslationCache;
|
typedef std::map<std::string, docstring> TranslationCache;
|
||||||
/// Internal cache for gettext translated strings.
|
/// Internal cache for gettext translated strings.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user