* \author Jean-Marc Lasgouttes
* \author Lars Gullik Bjønnes
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
using std::ostream;
using std::max;
+using std::auto_ptr;
InsetSpecialChar::InsetSpecialChar(Kind k)
}
-void InsetSpecialChar::dimension(BufferView *, LyXFont const & font,
- Dimension & dim) const
+void InsetSpecialChar::metrics(MetricsInfo & mi, Dimension & dim) const
{
+ LyXFont & font = mi.base.font;
dim.asc = font_metrics::maxAscent(font);
dim.des = font_metrics::maxDescent(font);
dim.wid = font_metrics::width(s, font);
if (kind_ == HYPHENATION && dim.wid > 5)
dim.wid -= 2; // to make it look shorter
+ dim_ = dim;
}
// In lyxf3 this will be just LaTeX
-void InsetSpecialChar::write(Buffer const *, ostream & os) const
+void InsetSpecialChar::write(Buffer const &, ostream & os) const
{
string command;
switch (kind_) {
// This function will not be necessary when lyx3
-void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
+void InsetSpecialChar::read(Buffer const &, LyXLex & lex)
{
lex.nextToken();
string const command = lex.getString();
}
-int InsetSpecialChar::latex(Buffer const *, ostream & os,
+int InsetSpecialChar::latex(Buffer const &, ostream & os,
LatexRunParams const &) const
{
switch (kind_) {
}
-int InsetSpecialChar::ascii(Buffer const *, ostream & os, int) const
+int InsetSpecialChar::ascii(Buffer const &, ostream & os, int) const
{
switch (kind_) {
case HYPHENATION:
}
-int InsetSpecialChar::linuxdoc(Buffer const *, ostream & os) const
+int InsetSpecialChar::linuxdoc(Buffer const &, ostream & os) const
{
switch (kind_) {
case HYPHENATION:
}
-int InsetSpecialChar::docbook(Buffer const *, ostream & os, bool) const
+int InsetSpecialChar::docbook(Buffer const &, ostream & os, bool) const
{
switch (kind_) {
case HYPHENATION:
}
-Inset * InsetSpecialChar::clone(Buffer const &) const
+auto_ptr<InsetBase> InsetSpecialChar::clone() const
{
- return new InsetSpecialChar(kind_);
+ return auto_ptr<InsetBase>(new InsetSpecialChar(kind_));
}
-// Inset * InsetSpecialChar::clone(Buffer const &, bool) const
-// {
-// return new InsetSpecialChar(kind_);
-// }
-
-
void InsetSpecialChar::validate(LaTeXFeatures & features) const
{
if (kind_ == MENU_SEPARATOR) {