diff --git a/ChangeLog b/ChangeLog index 2664a8b08f..a83b224a55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-02-18 Lars Gullik Bjønnes + + * WorkArea, Painter, LyXScreen: Fixed the crash that occured on + resize due to wrong pixmap beeing used. Also took the opurtunity + to make the LyXScreen stateless on regard to WorkArea and some + general cleanup in the same files. + 2000-02-17 Lars Gullik Bjønnes * src/Makefile.am: add missing direction.h diff --git a/acinclude.m4 b/acinclude.m4 index 5a04deef98..2330a68bc0 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -185,7 +185,7 @@ dnl Check the version of g++ case $gxx_version in 2.7*) CXXFLAGS="$lyx_opt";; 2.95.1) CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti";; - 2.95.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; + 2.95.*) CXXFLAGS="-g $lyx_opt -Woverloaded-virtual -fno-rtti -fno-exceptions";; *2.91.*) CXXFLAGS="-g $lyx_opt -Wno-return-type -fno-exceptions -fno-rtti";; *) CXXFLAGS="-g $lyx_opt -fno-exceptions -fno-rtti";; esac diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 7209fa1b7a..c8f8cc85d4 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -185,7 +185,7 @@ dnl Check the version of g++ case $gxx_version in 2.7*) CXXFLAGS="$lyx_opt";; 2.95.1) CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti";; - 2.95.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; + 2.95.*) CXXFLAGS="-g $lyx_opt -Woverloaded-virtual -fno-rtti -fno-exceptions";; *2.91.*) CXXFLAGS="-g $lyx_opt -Wno-return-type -fno-exceptions -fno-rtti";; *) CXXFLAGS="-g $lyx_opt -fno-exceptions -fno-rtti";; esac diff --git a/src/BufferView.C b/src/BufferView.C index 157d4a1ae4..ef52862ca4 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -32,6 +32,7 @@ using std::for_each; #include "LyXView.h" #include "lyxfunc.h" #include "insets/lyxinset.h" +#include "insets/insetbib.h" #include "minibuffer.h" #include "lyxscreen.h" @@ -70,8 +71,8 @@ BufferView::BufferView(LyXView * o, int xpos, int ypos, { buffer_ = 0; text = 0; - screen = 0; workarea = new WorkArea(this, xpos, ypos, width, height); + screen = 0; timer_cursor = 0; create_view(); current_scrollbar_value = 0; @@ -170,14 +171,7 @@ void BufferView::updateScreen() { // Regenerate the screen. delete screen; - screen = new LyXScreen(this, - workarea->getWin(), - workarea->getPixmap(), - workarea->workWidth(), - workarea->height(), - workarea->xpos(), - workarea->ypos(), - text); + screen = new LyXScreen(*workarea, text); } diff --git a/src/BufferView2.C b/src/BufferView2.C index e38a0ca2bd..f6cc6a41c4 100644 --- a/src/BufferView2.C +++ b/src/BufferView2.C @@ -709,7 +709,7 @@ void BufferView::showLockedInsetCursor(long x, long y, int asc, int desc) void BufferView::hideLockedInsetCursor() { if (the_locking_inset && available()) { - screen->HideManualCursor(); + screen->HideCursor(); } } diff --git a/src/Painter.C b/src/Painter.C index f12c833bbd..4396ab1408 100644 --- a/src/Painter.C +++ b/src/Painter.C @@ -27,6 +27,7 @@ #include "lyxfont.h" #include "support/LAssert.h" #include "support/lstrings.h" +#include "WorkArea.h" Painter::Painter(WorkArea & wa) : PainterBase(wa) @@ -54,6 +55,12 @@ Painter::~Painter() { } +Drawable Painter::drawable() const +{ + return owner.getPixmap(); +} + + /* Basic drawing routines */ extern bool Lgb_bug_find_hack; @@ -64,10 +71,10 @@ PainterBase & Painter::point(int x, int y, LColor::color c) if (!Lgb_bug_find_hack) lyxerr << "point not called from " "workarea::workhandler\n"; - lyxerr.debug() << "Painter drawable: " << drawable << endl; + lyxerr.debug() << "Painter drawable: " << drawable() << endl; } - XDrawPoint(display, drawable, getGCForeground(c), x, y); + XDrawPoint(display, drawable(), getGCForeground(c), x, y); return *this; } @@ -81,10 +88,10 @@ PainterBase & Painter::line(int x1, int y1, int x2, int y2, if (!Lgb_bug_find_hack) lyxerr << "line not called from " "workarea::workhandler\n"; - lyxerr.debug() << "Painter drawable: " << drawable << endl; + lyxerr.debug() << "Painter drawable: " << drawable() << endl; } - XDrawLine(display, drawable, + XDrawLine(display, drawable(), getGCLinepars(ls, lw, col), x1, y1, x2, y2); return *this; } @@ -99,7 +106,7 @@ PainterBase & Painter::lines(int const * xp, int const * yp, int np, if (!Lgb_bug_find_hack) lyxerr << "lines not called from " "workarea::workhandler\n"; - lyxerr.debug() << "Painter drawable: " << drawable << endl; + lyxerr.debug() << "Painter drawable: " << drawable() << endl; } #ifndef HAVE_AUTO_PTR @@ -112,7 +119,7 @@ PainterBase & Painter::lines(int const * xp, int const * yp, int np, points[i].y = yp[i]; } - XDrawLines(display, drawable, getGCLinepars(ls, lw, col), + XDrawLines(display, drawable(), getGCLinepars(ls, lw, col), points, np, CoordModeOrigin); #ifndef HAVE_AUTO_PTR @@ -131,10 +138,10 @@ PainterBase & Painter::rectangle(int x, int y, int w, int h, if (!Lgb_bug_find_hack) lyxerr << "rectangle not called from " "workarea::workhandler\n"; - lyxerr << "Painter drawable: " << drawable << endl; + lyxerr << "Painter drawable: " << drawable() << endl; } - XDrawRectangle(display, drawable, getGCLinepars(ls, lw, col), + XDrawRectangle(display, drawable(), getGCLinepars(ls, lw, col), x, y, w, h); return *this; } @@ -147,10 +154,10 @@ PainterBase & Painter::fillRectangle(int x, int y, int w, int h, if (!Lgb_bug_find_hack) lyxerr << "fillrectangle not called from " "workarea::workhandler\n"; - lyxerr << "Painter drawable: " << drawable << endl; + lyxerr << "Painter drawable: " << drawable() << endl; } - XFillRectangle(display, drawable, getGCForeground(col), x, y, w, h); + XFillRectangle(display, drawable(), getGCForeground(col), x, y, w, h); return *this; } @@ -162,7 +169,7 @@ PainterBase & Painter::fillPolygon(int const * xp, int const * yp, int np, if (!Lgb_bug_find_hack) lyxerr <<"fillpolygon not called from " "workarea::workhandler\n"; - lyxerr << "Painter drawable: " << drawable << endl; + lyxerr << "Painter drawable: " << drawable() << endl; } #ifndef HAVE_AUTO_PTR @@ -175,7 +182,7 @@ PainterBase & Painter::fillPolygon(int const * xp, int const * yp, int np, points[i].y = yp[i]; } - XFillPolygon(display, drawable, getGCForeground(col), points, np, + XFillPolygon(display, drawable(), getGCForeground(col), points, np, Nonconvex, CoordModeOrigin); #ifndef HAVE_AUTO_PTR delete[] points; @@ -192,10 +199,10 @@ PainterBase & Painter::arc(int x, int y, if (!Lgb_bug_find_hack) lyxerr << "arc not called from " "workarea::workhandler\n"; - lyxerr << "Painter drawable: " << drawable << endl; + lyxerr << "Painter drawable: " << drawable() << endl; } - XDrawArc(display, drawable, getGCForeground(col), + XDrawArc(display, drawable(), getGCForeground(col), x, y, w, h, a1, a2); return *this; } @@ -211,7 +218,7 @@ PainterBase & Painter::segments(int const * x1, int const * y1, if (!Lgb_bug_find_hack) lyxerr << "segments not called from " "workarea::workhandler\n"; - lyxerr << "Painter drawable: " << drawable << endl; + lyxerr << "Painter drawable: " << drawable() << endl; } #ifndef HAVE_AUTO_PTR @@ -225,7 +232,7 @@ PainterBase & Painter::segments(int const * x1, int const * y1, s[i].x2 = x2[i]; s[i].y2 = y2[i]; } - XDrawSegments(display, drawable, getGCLinepars(ls, lw, col), s, ns); + XDrawSegments(display, drawable(), getGCLinepars(ls, lw, col), s, ns); #ifndef HAVE_AUTO_PTR delete [] s; @@ -240,14 +247,14 @@ PainterBase & Painter::pixmap(int x, int y, int w, int h, Pixmap bitmap) if (!Lgb_bug_find_hack) lyxerr << "workAreaExpose not called from " "workarea::workhandler\n"; - lyxerr << "Painter drawable: " << drawable << endl; + lyxerr << "Painter drawable: " << drawable() << endl; } XGCValues val; val.function = GXcopy; - GC gc = XCreateGC(display, drawable, + GC gc = XCreateGC(display, drawable(), GCFunction, &val); - XCopyArea(display, bitmap, drawable, gc, + XCopyArea(display, bitmap, drawable(), gc, 0, 0, w, h, x, y); XFreeGC(display, gc); return *this; @@ -274,12 +281,12 @@ PainterBase & Painter::text(int x, int y, char const * s, int ls, if (!Lgb_bug_find_hack) lyxerr << "text not called from " "workarea::workhandler\n"; - lyxerr << "Painter drawable: " << drawable << endl; + lyxerr << "Painter drawable: " << drawable() << endl; } GC gc = getGCForeground(f.realColor()); XSetFont(display, gc, f.getFontID()); - XDrawString(display, drawable, gc, x, y, s, ls); + XDrawString(display, drawable(), gc, x, y, s, ls); underline(f, x, y, this->width(s, ls, f)); return *this; } @@ -303,7 +310,7 @@ void Painter::underline(LyXFont const & f, int x, int y, int width) GC Painter::getGCForeground(LColor::color c) { if (lyxerr.debugging()) { - lyxerr << "Painter drawable: " << drawable << endl; + lyxerr << "Painter drawable: " << drawable() << endl; } if (colorGCcache[c] != 0) return colorGCcache[c]; @@ -387,7 +394,7 @@ GC Painter::getGCForeground(LColor::color c) } val.function = GXcopy; - return colorGCcache[c] = XCreateGC(display, drawable, + return colorGCcache[c] = XCreateGC(display, drawable(), GCForeground | GCFunction, &val); } @@ -397,7 +404,7 @@ GC Painter::getGCLinepars(enum line_style ls, enum line_width lw, LColor::color c) { if (lyxerr.debugging()) { - lyxerr << "Painter drawable: " << drawable << endl; + lyxerr << "Painter drawable: " << drawable() << endl; } int index = lw + (ls << 1) + (c << 3); @@ -425,7 +432,7 @@ GC Painter::getGCLinepars(enum line_style ls, val.function = GXcopy; return lineGCcache[index] = - XCreateGC(display, drawable, + XCreateGC(display, drawable(), GCForeground | GCLineStyle | GCLineWidth | GCCapStyle | GCJoinStyle | GCFunction, &val); } diff --git a/src/Painter.h b/src/Painter.h index 3a8bad6ab5..780aad225b 100644 --- a/src/Painter.h +++ b/src/Painter.h @@ -109,9 +109,6 @@ protected: /// PainterBase & setDisplay(Display * d) { display = d; return *this; } - /// - PainterBase & setDrawable(Drawable d) { drawable = d; return *this; } - /// Get foreground color in ordinary GC GC getGCForeground(LColor::color c); @@ -124,8 +121,10 @@ protected: /**@Low level X parameters */ /// Display * display; + /// - Drawable drawable; + Drawable drawable() const; + /// Colormap colormap; diff --git a/src/PainterBase.h b/src/PainterBase.h index 24e1748577..9657322df1 100644 --- a/src/PainterBase.h +++ b/src/PainterBase.h @@ -192,7 +192,7 @@ public: int & width = PainterBase::dummy1, int & ascent = PainterBase::dummy2, int & descent = PainterBase::dummy3); -private: +protected: WorkArea & owner; }; diff --git a/src/WorkArea.C b/src/WorkArea.C index 899beb71dc..cc409b11e5 100644 --- a/src/WorkArea.C +++ b/src/WorkArea.C @@ -164,7 +164,6 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height) // setup the painter painter_.setDisplay(fl_display); - painter_.setDrawable(workareapixmap); // We add this object as late as possible to avoit problems // with drawing. @@ -223,9 +222,6 @@ void WorkArea::resize(int xpos, int ypos, int width, int height) // Create the workarea pixmap createPixmap(width - 15 - 2 * bw, height - 2 * bw); - // reset the painter - painter_.setDrawable(workareapixmap); - // the free object fl_set_object_geometry(work_area, xpos + bw, ypos + bw, width - 15 - 2 * bw, diff --git a/src/insets/figinset.C b/src/insets/figinset.C index 69b6ae70ae..3f0a2cb1d7 100644 --- a/src/insets/figinset.C +++ b/src/insets/figinset.C @@ -1097,7 +1097,7 @@ void InsetFig::draw(Painter & pain, LyXFont const & f, } -void InsetFig::Write(ostream & os) +void InsetFig::Write(ostream & os) const { Regenerate(); os << "Figure size " << wid << " " << hgh << "\n"; @@ -1200,7 +1200,7 @@ void InsetFig::Read(LyXLex & lex) } -int InsetFig::Latex(ostream & os, signed char /* fragile*/ ) +int InsetFig::Latex(ostream & os, signed char /* fragile*/ ) const { Regenerate(); if (!cmd.empty()) os << cmd << " "; @@ -1208,7 +1208,7 @@ int InsetFig::Latex(ostream & os, signed char /* fragile*/ ) } -int InsetFig::Latex(string & file, signed char /* fragile*/ ) +int InsetFig::Latex(string & file, signed char /* fragile*/ ) const { Regenerate(); file += cmd + ' '; @@ -1216,13 +1216,13 @@ int InsetFig::Latex(string & file, signed char /* fragile*/ ) } -int InsetFig::Linuxdoc(string &/*file*/) +int InsetFig::Linuxdoc(string &/*file*/) const { return 0; } -int InsetFig::DocBook(string & file) +int InsetFig::DocBook(string & file) const { string figurename = fname; @@ -1330,7 +1330,7 @@ Inset::Code InsetFig::LyxCode() const } -void InsetFig::Regenerate() +void InsetFig::Regenerate() const { string cmdbuf; string resizeW, resizeH; diff --git a/src/insets/figinset.h b/src/insets/figinset.h index dc47ae8c9f..cba75e4f71 100644 --- a/src/insets/figinset.h +++ b/src/insets/figinset.h @@ -34,17 +34,17 @@ public: void draw(Painter &, LyXFont const & font, int baseline, float & x) const; /// - void Write(ostream &); + void Write(ostream &) const; /// void Read(LyXLex & lex); /// - int Latex(ostream &, signed char fragile); + int Latex(ostream &, signed char fragile) const; /// - int Latex(string & file, signed char fragile); + int Latex(string & file, signed char fragile) const; /// - int Linuxdoc(string & file); + int Linuxdoc(string & file) const; /// - int DocBook(string & file); + int DocBook(string & file) const; /// Updates needed features for this inset. void Validate(LaTeXFeatures & features) const; @@ -117,7 +117,7 @@ public: float angle; /// graphics command, latex version - string cmd; + mutable string cmd; /// Caption for subfigure package string subcaption; @@ -139,7 +139,7 @@ private: /// recompute screen params void Recompute(); /// regenerate \includegraphics{} command - void Regenerate(); + void Regenerate() const; /// regenerate \inlcudegraphics{} command in temporary buffer void TempRegenerate(); /// get sizes from .eps file diff --git a/src/insets/insetbib.C b/src/insets/insetbib.C index 826c3cc34c..01f5ae9c6b 100644 --- a/src/insets/insetbib.C +++ b/src/insets/insetbib.C @@ -226,7 +226,7 @@ void InsetBibKey::setCounter(int c) // as a LyX 2.x command, and lyxlex is not enough smart to understand // real LaTeX commands. Yes, that could be fixed, but would be a waste // of time cause LyX3 won't use lyxlex anyway. (ale) -void InsetBibKey::Write(ostream & os) +void InsetBibKey::Write(ostream & os) const { string s; if (!options.empty()) { @@ -296,7 +296,7 @@ string InsetBibtex::getScreenLabel() const } -int InsetBibtex::Latex(ostream & os, signed char /*fragile*/) +int InsetBibtex::Latex(ostream & os, signed char /*fragile*/) const { string bib; signed char dummy = 0; @@ -306,7 +306,7 @@ int InsetBibtex::Latex(ostream & os, signed char /*fragile*/) } -int InsetBibtex::Latex(string & file, signed char /*fragile*/) +int InsetBibtex::Latex(string & file, signed char /*fragile*/) const { // this looks like an horrible hack and it is :) The problem // is that owner is not initialized correctly when the bib diff --git a/src/insets/insetbib.h b/src/insets/insetbib.h index 04ec9d3d5e..493e011207 100644 --- a/src/insets/insetbib.h +++ b/src/insets/insetbib.h @@ -64,7 +64,7 @@ public: /// Inset * Clone() const { return new InsetBibKey(this); } /// Currently \bibitem is used as a LyX2.x command, so we need this method. - void Write(ostream &); + void Write(ostream &) const; /// virtual string getScreenLabel() const; /// @@ -111,9 +111,9 @@ public: /// void Edit(int, int); /// - int Latex(ostream &, signed char); + int Latex(ostream &, signed char) const; /// - int Latex(string & file, signed char fragile); + int Latex(string & file, signed char fragile) const; /// string getKeys(char delim); /// @@ -128,7 +128,7 @@ public: bool display() const { return true; } private: /// - Buffer * owner; + mutable Buffer * owner; }; #endif diff --git a/src/insets/insetcommand.C b/src/insets/insetcommand.C index d6af5cc017..61d516961a 100644 --- a/src/insets/insetcommand.C +++ b/src/insets/insetcommand.C @@ -164,7 +164,7 @@ void InsetCommand::draw(Painter & pain, LyXFont const &, // In lyxf3 this will be just LaTeX -void InsetCommand::Write(ostream & os) +void InsetCommand::Write(ostream & os) const { os << "LatexCommand " << getCommand() << "\n"; } @@ -244,27 +244,27 @@ void InsetCommand::Read(LyXLex & lex) } -int InsetCommand::Latex(ostream & os, signed char /*fragile*/) +int InsetCommand::Latex(ostream & os, signed char /*fragile*/) const { os << getCommand(); return 0; } -int InsetCommand::Latex(string & file, signed char /*fragile*/) +int InsetCommand::Latex(string & file, signed char /*fragile*/) const { file += getCommand(); return 0; } -int InsetCommand::Linuxdoc(string &/*file*/) +int InsetCommand::Linuxdoc(string &/*file*/) const { return 0; } -int InsetCommand::DocBook(string &/*file*/) +int InsetCommand::DocBook(string &/*file*/) const { return 0; } diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index 87c7e40495..c784b19544 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -41,19 +41,19 @@ public: /// void draw(Painter &, LyXFont const &, int baseline, float & x) const; /// - void Write(ostream &); + void Write(ostream &) const; /// Parse the command. void scanCommand(string const & cmd); /// Will not be used when lyxf3 void Read(LyXLex & lex); /// - virtual int Latex(ostream &, signed char fragile); + virtual int Latex(ostream &, signed char fragile) const; /// - virtual int Latex(string & file, signed char fragile); + virtual int Latex(string & file, signed char fragile) const; /// - virtual int Linuxdoc(string & file); + virtual int Linuxdoc(string & file) const; /// - virtual int DocBook(string & file); + virtual int DocBook(string & file) const; /// Inset * Clone() const; /// diff --git a/src/insets/inseterror.C b/src/insets/inseterror.C index 75b118fea7..b0c1ad29b9 100644 --- a/src/insets/inseterror.C +++ b/src/insets/inseterror.C @@ -91,7 +91,7 @@ void InsetError::draw(Painter & pain, LyXFont const & font, } -void InsetError::Write(ostream &) +void InsetError::Write(ostream &) const { } @@ -101,25 +101,25 @@ void InsetError::Read(LyXLex &) } -int InsetError::Latex(ostream &, signed char /*fragile*/) +int InsetError::Latex(ostream &, signed char /*fragile*/) const { return 0; } -int InsetError::Latex(string &, signed char /*fragile*/) +int InsetError::Latex(string &, signed char /*fragile*/) const { return 0; } -int InsetError::Linuxdoc(string &) +int InsetError::Linuxdoc(string &) const { return 0; } -int InsetError::DocBook(string &) +int InsetError::DocBook(string &) const { return 0; } diff --git a/src/insets/inseterror.h b/src/insets/inseterror.h index 030b585527..b863091d7b 100644 --- a/src/insets/inseterror.h +++ b/src/insets/inseterror.h @@ -44,17 +44,17 @@ public: void draw(Painter &, LyXFont const & font, int baseline, float & x) const; /// - void Write(ostream &); + void Write(ostream &) const; /// void Read(LyXLex & lex); /// - int Latex(ostream &, signed char fragile); + int Latex(ostream &, signed char fragile) const; /// - int Latex(string & file, signed char fragile); + int Latex(string & file, signed char fragile) const; /// - int Linuxdoc(string & file); + int Linuxdoc(string & file) const; /// - int DocBook(string & file); + int DocBook(string & file) const; /// bool AutoDelete() const; /// what appears in the minibuffer when opening diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index a8b37408f2..c27268d0f7 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -260,7 +260,7 @@ void InsetInclude::Edit(int, int) } -void InsetInclude::Write(ostream & os) +void InsetInclude::Write(ostream & os) const { os << "Include " << getCommand() << "\n"; } @@ -316,7 +316,7 @@ bool InsetInclude::loadIfNeeded() const } -int InsetInclude::Latex(ostream & os, signed char /*fragile*/) +int InsetInclude::Latex(ostream & os, signed char /*fragile*/) const { string include_file; signed char dummy = 0; @@ -326,7 +326,7 @@ int InsetInclude::Latex(ostream & os, signed char /*fragile*/) } -int InsetInclude::Latex(string & file, signed char /*fragile*/) +int InsetInclude::Latex(string & file, signed char /*fragile*/) const { string writefile, incfile; diff --git a/src/insets/insetinclude.h b/src/insets/insetinclude.h index b0e1e84f5c..6cc19d7519 100644 --- a/src/insets/insetinclude.h +++ b/src/insets/insetinclude.h @@ -54,13 +54,13 @@ public: return 1; } /// With lyx3 we won't overload these 3 methods - void Write(ostream &); + void Write(ostream &) const; /// void Read(LyXLex &); /// - int Latex(ostream &, signed char fragile); + int Latex(ostream &, signed char fragile) const; /// - int Latex(string & file, signed char fragile); + int Latex(string & file, signed char fragile) const; /// void Validate(LaTeXFeatures &) const; diff --git a/src/insets/insetinfo.C b/src/insets/insetinfo.C index 93d5f604f8..4dcc96f674 100644 --- a/src/insets/insetinfo.C +++ b/src/insets/insetinfo.C @@ -93,7 +93,7 @@ void InsetInfo::draw(Painter & pain, LyXFont const & f, } -void InsetInfo::Write(ostream & os) +void InsetInfo::Write(ostream & os) const { os << "Info " << contents; } @@ -126,25 +126,25 @@ void InsetInfo::Read(LyXLex & lex) } -int InsetInfo::Latex(ostream &, signed char /*fragile*/) +int InsetInfo::Latex(ostream &, signed char /*fragile*/) const { return 0; } -int InsetInfo::Latex(string &, signed char /*fragile*/) +int InsetInfo::Latex(string &, signed char /*fragile*/) const { return 0; } -int InsetInfo::Linuxdoc(string &) +int InsetInfo::Linuxdoc(string &) const { return 0; } -int InsetInfo::DocBook(string &) +int InsetInfo::DocBook(string &) const { return 0; } diff --git a/src/insets/insetinfo.h b/src/insets/insetinfo.h index a08e46df38..da159fb252 100644 --- a/src/insets/insetinfo.h +++ b/src/insets/insetinfo.h @@ -45,17 +45,17 @@ public: /// void draw(Painter &, LyXFont const &, int baseline, float & x) const; /// - void Write(ostream &); + void Write(ostream &) const; /// void Read(LyXLex & lex); /// - int Latex(ostream &, signed char fragile); + int Latex(ostream &, signed char fragile) const; /// - int Latex(string & file, signed char fragile); + int Latex(string & file, signed char fragile) const; /// - int Linuxdoc(string & file); + int Linuxdoc(string & file) const; /// - int DocBook(string & file); + int DocBook(string & file) const; /// what appears in the minibuffer when opening char const * EditMessage() const {return _("Opened note");} /// diff --git a/src/insets/insetlabel.C b/src/insets/insetlabel.C index b669e72b24..9e5143df54 100644 --- a/src/insets/insetlabel.C +++ b/src/insets/insetlabel.C @@ -43,28 +43,28 @@ string InsetLabel::getLabel(int) const } -int InsetLabel::Latex(ostream & os, signed char /*fragile*/) +int InsetLabel::Latex(ostream & os, signed char /*fragile*/) const { os << escape(getCommand()); return 0; } -int InsetLabel::Latex(string & file, signed char /*fragile*/) +int InsetLabel::Latex(string & file, signed char /*fragile*/) const { file += escape(getCommand()); return 0; } -int InsetLabel::Linuxdoc(string & file) +int InsetLabel::Linuxdoc(string & file) const { file += "