+2000-05-19 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * src/vspace.C (operator=): removed
+ (operator=): removed
+
+ * src/lyx_gui_misc.C (askForText): manually set the type in make_pair
+
+ * src/layout.C (NumberOfClass): manually set the type in make_pair
+ (NumberOfLayout): ditto
+
+ * src/language.C: use the Language constructor for ignore_lang
+
+ * src/language.h: add constructors to struct Language
+
+ * src/BufferView_pimpl.C (scrollDown): change to pair<float, float>
+
+ * src/text2.C (SetCursorIntern): comment out #warning
+
+ * src/mathed/math_symbols.C (pixmapFromBitmapData): add const_cast
+
+ * src/mathed/math_iter.h: initialize sx and sw to 0
+
2000-05-10 Dekel Tsur <dekel@math.tau.ac.il>
* forms/lyx.fd: Redesign of form_ref
if (!screen) return 0;
double value= workarea->getScrollbarValue();
- pair<double, double> p = workarea->getScrollbarBounds();
+ pair<float, float> p = workarea->getScrollbarBounds();
double max = p.second;
if (value == max) return 0;
}
}
+
extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data)
{
LyXFileDlg::FileDlgCB(ob, data);
#include "gettext.h"
Languages languages;
-Language const *default_language;
-Language ignore_lang = {"ignore", "Ignore", false};
+Language const * default_language;
+Language ignore_lang("ignore", "Ignore", false);
Language const * ignore_language = &ignore_lang;
///
#include "LString.h"
struct Language {
+ Language() : RightToLeft(false) {}
+ Language(string const & l, string const & d, bool rtl)
+ : lang(l), display(d), RightToLeft(rtl) {}
string lang;
string display;
bool RightToLeft;
for (ClassList::const_iterator cit = classlist.begin();
cit != classlist.end(); ++cit) {
if ((*cit).name() == textclass)
- return make_pair(true, cit - classlist.begin());
+ return make_pair(true,
+ size_type(cit - classlist.begin()));
}
return make_pair(false, size_type(0));
}
return make_pair(true, i);
}
if (name == "dummy")
- return make_pair(true, LYX_DUMMY_LAYOUT);
- return make_pair(false, LyXTextClass::LayoutList::size_type(0)); // not found
+ return make_pair(true, LyXTextClassList::size_type(LYX_DUMMY_LAYOUT));
+ return make_pair(false, LyXTextClass::size_type(0)); // not found
}
// Asks for a text
pair<bool, string> askForText(string const & msg, string const & dflt)
{
- char const * tmp;
fl_set_resource("flInput.cancel.label", idex(_("Cancel|^[")));
fl_set_resource("flInput.ok.label", idex(_("OK|#O")));
fl_set_resource("flInput.clear.label", idex(_("Clear|#e")));
- tmp = fl_show_input(msg.c_str(), dflt.c_str());
+ char const * tmp = fl_show_input(msg.c_str(), dflt.c_str());
if (tmp != 0)
- return make_pair<bool, string>(true, tmp);
+ return make_pair<bool, string>(true, string(tmp));
else
return make_pair<bool, string>(false, string());
}
void LyX::init(int */*argc*/, char **argv, bool gui)
{
// Install the signal handlers
- signal(SIGHUP, error_handler);
- signal(SIGFPE, error_handler);
- signal(SIGSEGV, error_handler);
- signal(SIGINT, error_handler);
- signal(SIGTERM, error_handler);
+ ::signal(SIGHUP, error_handler);
+ ::signal(SIGFPE, error_handler);
+ ::signal(SIGSEGV, error_handler);
+ ::signal(SIGINT, error_handler);
+ ::signal(SIGTERM, error_handler);
//
// Determine path of binary
}
}
if (orgfont.color() != color()) {
- os << "\\color " << lcolor.getLyXName(color()) << "\n";
+ // To make us file compatible with older
+ // lyx versions we emit "default" instead
+ // of "ignore"
+ string col_str(lcolor.getLyXName(color()));
+ if (col_str == "inherit") col_str = "default";
+ os << "\\color " << col_str << "\n";
}
if (orgfont.language() != language()) {
if (language())
x += float(width(pain, font));
if (par->GetType() == LM_OT_PARN || par->GetType() == LM_OT_MPARN) {
- LyXFont font = WhichFont(LM_TC_BF, par->size);
- font.setLatex(LyXFont::OFF);
+ LyXFont wfont = WhichFont(LM_TC_BF, par->size);
+ wfont.setLatex(LyXFont::OFF);
if (par->GetType() == LM_OT_PARN) {
string str;
str = string("(") + label + ")";
else
str = string("(#)");
- pain.text(int(x + 20), baseline, str, font);
+ pain.text(int(x + 20), baseline, str, wfont);
} else if (par->GetType() == LM_OT_MPARN) {
MathMatrixInset * mt =
static_cast<MathMatrixInset*>(par);
str = string("(") + crow->getLabel() + ")";
else
str = "(#)";
- pain.text(int(x + 20), y, str, font);
+ pain.text(int(x + 20), y, str, wfont);
}
crow = crow->getNext();
}
string lb = arg;
if (lb.empty()) {
pair<bool, string>
- result = askForText(_("Enter new label to insert:"));
- if (result.first) {
- lb = result.second;
+ res = askForText(_("Enter new label to insert:"));
+ if (res.first) {
+ lb = res.second;
}
}
if (!lb.empty() && lb[0] > ' ') {
// lyxerr <<"LNX " << pos << endl;
// if (sw>0 && GetChar()!= LM_TC_UP && GetChar()!= LM_TC_DOWN) {
// w = (sx>sw) ? 0: sw-sx;
- if ((sw > 0 || sx > 0) && GetChar() != LM_TC_UP && GetChar() != LM_TC_DOWN) {
+ if ((sw > 0 || sx > 0)
+ && GetChar() != LM_TC_UP && GetChar() != LM_TC_DOWN) {
if (sw > 0)
w = (sx > sw) ? 0 : sw - sx;
sx = sw = 0;
class MathedXIter: public MathedIter {
public:
///
- MathedXIter(): MathedIter() { x = y = size = 0; p = 0; crow = 0; }
+ MathedXIter() : MathedIter(), sx(0), sw(0) { x = y = size = 0; p = 0; crow = 0; }
///
MathedXIter(MathParInset*);
///
XpmCreateDataFromImage(fl_display, const_cast<char***>(&data), sbima, sbima, 0);
// Dirty hack to get blue symbols quickly
- char * sx = strstr(data[2], "FFFFFFFF");
+ char * sx = const_cast<char*>(strstr(data[2], "FFFFFFFF"));
if (sx) {
for (int k = 0; k < 8; ++k) sx[k] = '0';
}
void LyXTabular::DeleteRow(int row)
{
- row_info.erase(&row_info[row]);
- cell_info.erase(&cell_info[row]);
- --rows_;
- Reinit();
+ row_info.erase(row_info.begin() + row); //&row_info[row]);
+ cell_info.erase(cell_info.begin() + row); //&cell_info[row]);
+ --rows_;
+ Reinit();
}
row = row_of_cell(cell);
if (cont_row_info[row]) {
DeleteRow(row);
- cont_row_info.erase(&cont_row_info[row]);
+ cont_row_info.erase(cont_row_info.begin() + row); //&cont_row_info[row]);
while(!IsFirstCellInRow(--cell));
} else {
inset = GetCellInset(cell);
LyXParagraph::size_type pos, bool setfont) const
{
SetCursor(cursor, par, pos);
-#warning Remove this when verified working (Jug 20000413)
+// #warning Remove this when verified working (Jug 20000413)
#if 0
// correct the cursor position if impossible
if (pos > par->Last()){
}
-bool LyXLength::operator== (LyXLength const & other) const
-{
- return (val == other.val &&
- uni == other.uni);
-}
-
-
string LyXLength::asString() const
{
#ifdef HAVE_SSTREAM
}
-bool LyXGlueLength::operator== (LyXGlueLength const & other) const
-{
- return (val == other.val &&
- uni == other.uni &&
- plus_val == other.plus_val &&
- plus_uni == other.plus_uni &&
- minus_val == other.minus_val &&
- minus_uni == other.minus_uni);
-}
-
-
string LyXGlueLength::asString() const
{
#ifdef HAVE_SSTREAM
LyXLength::UNIT unit() const { return uni; };
//@}
- ///
- bool operator== (LyXLength const &) const;
-
/// conversion
virtual string asString() const;
///
LyXLength::UNIT uni;
};
+
+inline
+bool operator==(LyXLength const & l1, LyXLength const & l2)
+{
+ return l1.value() == l2.value()
+ && l1.unit() == l2.unit();
+}
+
+
extern LyXLength::UNIT unitFromString (string const & data);
extern bool isValidLength(string const & data, LyXLength * result);
LyXLength::UNIT minusUnit() const { return minus_uni; };
//@}
- ///
- bool operator == (LyXGlueLength const &) const;
-
/// conversion
virtual string asString() const;
///
LyXLength::UNIT plus_uni, minus_uni;
};
+///
+inline
+bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2)
+{
+ return l1.value() == l2.value()
+ && l1.unit() == l2.unit()
+ && l1.plusValue() == l2.plusValue()
+ && l1.plusUnit() == l2.plusUnit()
+ && l1.minusValue() == l2.minusValue()
+ && l1.minusUnit() == l2.minusUnit();
+}
+
+
+
extern bool isValidGlueLength(string const & data, LyXGlueLength * result);
/// VSpace class