+2000-10-16 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * forms/layout_forms.fd:
+ * src/layout_forms.C (create_form_form_character): small change to use
+ labelframe rather than engraved frame + text
+
+ * src/lyx_gui.C (create_forms): initialise choice_language with some
+ arbitrary value to prevent segfault when dialog is shown.
+
+2000-10-16 Baruch Even <baruch.even@writeme.com>
+
+ * src/converter.C (runLaTeX, scanLog): Added a warning when there
+ is no resulting file. This pertains only to LaTeX output.
+
+2000-10-14 Dekel Tsur <dekelts@tau.ac.il>
+
+ * src/text.C (Backspace): Make sure that the row of the cursor is
+ rebreaked.
+
+ * src/lyxfunc.C (Dispatch): Call to showState() after insertion of
+ a char.
+
+ * src/lyx_gui.C (init): Prevent a crash when only one font from
+ menu/popup fonts is not found.
+
+ * lib/lyxrc.example: Add an example for binding a key for language
+ switching.
+
+2000-10-15 Dekel Tsur <dekelts@tau.ac.il>
+
+ * src/converter.C (GetReachable): Changed the returned type to
+ vector<FormatPair>
+ (IsReachable): New method
+
+ * src/MenuBackend.C (expand): Handle formats that appear more
+ than once
+
+2000-10-16 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * src/frontends/support/Makefile.am
+ (libfrontendsupport_la_EXTRA_DIST): add LyXImage_X.[Ch] here and
+ not in SOURCES.
+
+ * lib/CREDITS: add Garst Reese.
+
+ * src/support/snprintf.h: add extern "C" {} around the definitions.
+
+ * src/cheaders/cstdarg: new header file, taken from GNU libstdc++.
+
2000-10-13 Angus Leeming <a.leeming@ic.ac.uk>
* src/combox.[Ch]:
Name: form_character
Width: 300
Height: 415
-Number of Objects: 16
+Number of Objects: 14
--------------------
class: FL_BOX
callback:
argument:
---------------------
-class: FL_FRAME
-type: ENGRAVED_FRAME
-box: 10 325 280 45
-boxtype: FL_NO_BOX
-colors: FL_BLACK FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label:
-shortcut:
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name:
-callback:
-argument:
-
---------------------
-class: FL_FRAME
-type: ENGRAVED_FRAME
-box: 10 265 280 45
-boxtype: FL_NO_BOX
-colors: FL_BLACK FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label:
-shortcut:
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name:
-callback:
-argument:
-
--------------------
class: FL_FRAME
type: ENGRAVED_FRAME
argument:
--------------------
-class: FL_TEXT
-type: NORMAL_TEXT
-box: 20 255 210 20
-boxtype: FL_FLAT_BOX
-colors: FL_COL1 FL_MCOL
-alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
-style: FL_BOLD_STYLE
-size: FL_DEFAULT_SIZE
+class: FL_CHOICE
+type: DROPLIST_CHOICE
+box: 95 175 190 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: These are never toggled
+label: Language:
shortcut:
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NorthEast
-name:
+name: choice_language
callback:
argument:
--------------------
-class: FL_TEXT
-type: NORMAL_TEXT
-box: 20 315 215 20
-boxtype: FL_FLAT_BOX
-colors: FL_COL1 FL_MCOL
-alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
+class: FL_LABELFRAME
+type: ENGRAVED_FRAME
+box: 10 265 280 45
+boxtype: FL_NO_BOX
+colors: FL_BLACK FL_COL1
+alignment: FL_ALIGN_TOP_LEFT
style: FL_BOLD_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
-label: These are always toggled
+label: These are never toggled
shortcut:
-resize: FL_RESIZE_X
+resize: FL_RESIZE_ALL
gravity: FL_NorthWest FL_NorthEast
name:
callback:
argument:
--------------------
-class: FL_CHOICE
-type: DROPLIST_CHOICE
-box: 95 175 190 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
+class: FL_LABELFRAME
+type: ENGRAVED_FRAME
+box: 10 325 280 45
+boxtype: FL_NO_BOX
+colors: FL_BLACK FL_COL1
+alignment: FL_ALIGN_TOP_LEFT
+style: FL_BOLD_STYLE
+size: FL_DEFAULT_SIZE
lcol: FL_BLACK
-label: Language:
+label: These are always toggled
shortcut:
-resize: FL_RESIZE_X
+resize: FL_RESIZE_ALL
gravity: FL_NorthWest FL_NorthEast
-name: choice_language
+name:
callback:
argument:
@iE-mail: rae@elec.uq.edu.au
bug reports/fixes, Itemize Bullet Selection,
xforms-0.81 + gcc-2.6.3 compatibility
+@bGarst R. Reese
+@iE-mail: reese@isn.net
+ provided hollywood and broadway classes
+ for writing screen scripts and plays
@bBernd Rellermeyer
@iE-mail: 100.41728@germanynet.de
Support for Koma-Script family of classes
# Default is "true"
#\mark_foreign_language false
+# It is possible to bind keys for changing the language inside a document.
+# For example, the following command will cause F12 to switch between French
+# and English in a French document, and in a document of other language it will
+# switch between that language and French.
+#\bind "F12" "language french"
+
#
# HEBREW SUPPORT SECTION ####################################################
#
#include "gettext.h"
#include "lastfiles.h"
#include "bufferlist.h"
+#include "converter.h"
#include "exporter.h"
#include "support/filetools.h"
#include "support/lyxfunctional.h"
using std::vector;
using std::pair;
using std::find_if;
+using std::sort;
// This is the global menu definition
MenuBackend menubackend;
return *this;
}
+struct compare_formatpair {
+ bool operator()(FormatPair const & a, FormatPair const & b) {
+ return a.format->prettyname < b.format->prettyname;
+ }
+};
void Menu::expand(Menu & tomenu, Buffer * buf) const
{
case MenuItem::ViewFormats:
case MenuItem::UpdateFormats:
case MenuItem::ExportFormats: {
- vector<pair<string,string> > names;
+ vector<FormatPair> names;
kb_action action;
if ((*cit).kind() == MenuItem::ViewFormats) {
names = Exporter::GetViewableFormats(buf);
names = Exporter::GetExportableFormats(buf);
action = LFUN_EXPORT;
}
+ sort(names.begin(), names.end(), compare_formatpair());
- for (vector<pair<string,string> >::const_iterator fit = names.begin();
+ for (vector<FormatPair>::const_iterator fit = names.begin();
fit != names.end() ; ++fit) {
- int action2 =
- lyxaction.getPseudoAction(action,
- (*fit).first);
- string label = (*fit).second;
+ string fmt = (*fit).format->name;
+ string label = (*fit).format->prettyname;
+ if ((*fit).from &&
+ ( (fit != names.begin() &&
+ (*fit).format == (*(fit-1)).format) ||
+ (fit+1 != names.end() &&
+ (*fit).format == (*(fit+1)).format) )) {
+ fmt += ":" + (*fit).from->name;
+ string head;
+ split((*fit).command, head, ' ');
+ label += _(" (using ") + head + ")";
+ }
+ int action2 = lyxaction.getPseudoAction(action, fmt);
tomenu.add(MenuItem(MenuItem::Command,
label, action2));
}
--- /dev/null
+// -*- C++ -*- forwarding header.
+// This file is part of the GNU ANSI C++ Library.
+
+#ifndef __CSTDARG__
+#define __CSTDARG__
+#include <stdarg.h>
+#endif
#endif
#include <queue>
-#include <algorithm> // sort()
#include "converter.h"
#include "lyxrc.h"
using std::vector;
using std::queue;
using std::pair;
-using std::sort;
using std::endl;
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Format::Format(string const & n)
- : name(n), in_degree(0)
+ : name(n)
{
struct Item {
char const * name;
commands.push_back(Com);
Formats::Add(from);
Formats::Add(to);
- ++Formats::GetFormat(to)->in_degree;
}
-vector< pair<string,string> > const
+vector<FormatPair> const
Converter::GetReachable(string const & from, bool only_viewable)
{
- vector< pair<string,string> > result;
+ vector<FormatPair> result;
Format * format = Formats::GetFormat(from);
if (!format)
return result;
- int sort_start = 0;
- if (!only_viewable || !format->viewer.empty()) {
- result.push_back(pair<string,string>(from, format->prettyname));
- sort_start = 1;
- }
+ if (!only_viewable || !format->viewer.empty())
+ result.push_back(FormatPair(format, 0, ""));
queue< vector<Command>::iterator > Q;
for (vector<Command>::iterator it = commands.begin();
while (!Q.empty()) {
vector<Command>::iterator it = Q.front();
+ Q.pop();
format = Formats::GetFormat((*it).to);
- string name = format->name;
- string prettyname = format->prettyname;
- if (format->in_degree > 1) {
- name += ":" + (*it).from;
- string tmp;
- split((*it).command, tmp, ' ');
- prettyname += _(" (using ") + tmp + ")";
- }
if (!only_viewable || !format->viewer.empty())
- result.push_back(pair<string,string>(name, prettyname));
- Q.pop();
+ result.push_back(FormatPair(format,
+ Formats::GetFormat((*it).from),
+ (*it).command));
for (vector<Command>::iterator it2 = commands.begin();
it2 != commands.end(); ++it2)
if (!(*it2).visited && (*it).to == (*it2).from) {
}
}
- sort(result.begin() + sort_start, result.end());
return result;
}
+bool Converter::IsReachable(string const & from, string const & target_format)
+{
+ Format * format = Formats::GetFormat(from);
+ if (!format)
+ return false;
+ else if (format->name == target_format)
+ return true;
+
+ queue< vector<Command>::iterator > Q;
+ for (vector<Command>::iterator it = commands.begin();
+ it != commands.end(); ++it)
+ if ((*it).from == from) {
+ Q.push(it);
+ (*it).visited = true;
+ } else
+ (*it).visited = false;
+
+ while (!Q.empty()) {
+ vector<Command>::iterator it = Q.front();
+ Q.pop();
+ format = Formats::GetFormat((*it).to);
+ if (format->name == target_format)
+ return true;
+ for (vector<Command>::iterator it2 = commands.begin();
+ it2 != commands.end(); ++it2)
+ if (!(*it2).visited && (*it).to == (*it2).from) {
+ Q.push(it2);
+ (*it2).visited = true;
+ }
+ }
+ return false;
+}
+
bool Converter::Convert(Buffer const * buffer, string const & from_file,
string const & to_file, string const & using_format,
bv->redraw();
bv->fitCursor(bv->text);
}
+ if (result & LaTeX::NO_OUTPUT) {
+ string const s = _("The operation resulted in");
+ string const t = _("an empty file.");
+ WriteAlert(_("Resulting file is empty"), s, t);
+ return false;
+ }
AllowInput(bv);
}
if ((result & LaTeX::ERRORS)) {
bv->redraw();
bv->fitCursor(bv->text);
}
+ } else if (result & LaTeX::NO_OUTPUT) {
+ string const s = _("The operation resulted in");
+ string const t = _("an empty file.");
+ WriteAlert(_("Resulting file is empty"), s, t);
}
// check return value from latex.run().
if (bv)
AllowInput(bv);
- return (result & (LaTeX::NO_LOGFILE | LaTeX::ERRORS)) == 0;
+ int const ERROR_MASK =
+ LaTeX::NO_LOGFILE |
+ LaTeX::ERRORS |
+ LaTeX::NO_OUTPUT;
+
+ return (result & ERROR_MASK) == 0;
}
result += ' ' + lyxrc.print_landscape_flag;
return result;
}
+
+void Converter::init()
+{
+ Formats::Add("txt");
+}
class Format {
public:
///
- Format() : in_degree(0) {}
+ Format() {}
///
Format(string const & n);
///
string prettyname;
///
string viewer;
+};
+
+class FormatPair {
+public:
+ ///
+ Format * format;
+ ///
+ Format * from;
+ ///
+ string command;
///
- int in_degree;
+ FormatPair(Format * f1, Format * f2, string c)
+ : format(f1), from(f2), command(c) {}
};
///
void Add(string const & from, string const & to,
string const & command, string const & flags);
///
+
+ ///
static
- std::vector<std::pair<string, string> > const
+ std::vector<FormatPair> const
GetReachable(string const & from,
bool only_viewable = false);
///
static
+ bool IsReachable(string const & from, string const & target_format);
+ ///
+ static
bool Convert(Buffer const * buffer, string const & from_file,
string const & to_file, string const & using_format,
string * view_file = 0);
///
static
string const dvips_options(Buffer const * buffer);
+ ///
+ static
+ void init();
private:
///
static
#endif
#include "exporter.h"
-#include "converter.h"
#include "buffer.h"
#include "lyx_cb.h" //ShowMessage()
#include "support/filetools.h"
#include "lyxrc.h"
+#include "converter.h"
using std::vector;
-using std::pair;
bool Exporter::Export(Buffer * buffer, string const & format0,
bool put_in_tempdir, string * view_file)
bool Exporter::IsExportable(Buffer const * buffer, string const & format)
{
- // This is not efficient (Dekel)
- vector<pair<string, string> > const v = GetExportableFormats(buffer);
- for (vector<pair<string, string> >::const_iterator it = v.begin();
- it != v.end(); ++it) {
- string format2;
- split((*it).first, format2, ':');
- if (format == format2)
- return true;
- }
- return false;
+ return format == "txt" ||
+ Converter::IsReachable(BufferExtension(buffer), format);
}
-vector<pair<string, string> > const
+vector<FormatPair> const
Exporter::GetExportableFormats(Buffer const * buffer)
{
- vector<pair<string, string> > result =
+ vector<FormatPair> result =
Converter::GetReachable(BufferExtension(buffer), false);
- result.push_back(pair<string,string>("txt", "Ascii"));
+ Format * format = Formats::GetFormat("txt");
+ if (format)
+ result.push_back(FormatPair(format , 0, ""));
return result;
}
-vector<pair<string, string> > const
+vector<FormatPair> const
Exporter::GetViewableFormats(Buffer const * buffer)
{
- vector<pair<string, string> > result =
+ vector<FormatPair> result =
Converter::GetReachable(BufferExtension(buffer), true);
Format * format = Formats::GetFormat("txt");
if (format && !format->viewer.empty())
- result.push_back(pair<string,string>("txt", "Ascii"));
+ result.push_back(FormatPair(format , 0, ""));
return result;
}
#include "LString.h"
class Buffer;
+class FormatPair;
-///
class Exporter {
public:
///
bool IsExportable(Buffer const * buffer, string const & format);
///
static
- std::vector<std::pair<string, string> > const
+ std::vector<FormatPair> const
GetExportableFormats(Buffer const * buffer);
///
static
- std::vector<std::pair<string, string> > const
+ std::vector<FormatPair> const
GetViewableFormats(Buffer const * buffer);
///
static
libfrontendsupport_la_SOURCES = \
LyXImage.h \
- LyXImage.C \
+ LyXImage.C
+
+libfrontendsupport_la_EXTRA_DIST = \
LyXImage_X.h \
LyXImage_X.C
fdui->form_character = fl_bgn_form(FL_NO_BOX, 300, 415);
obj = fl_add_box(FL_UP_BOX, 0, 0, 300, 415, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
- obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 325, 280, 45, "");
- fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
- fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 265, 280, 45, "");
- fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
- fl_set_object_resize(obj, FL_RESIZE_X);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 10, 280, 240, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->check_toggle_all = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 215, 255, 25, idex(_("Toggle on all these|#T")));fl_set_button_shortcut(obj, scex(_("Toggle on all these|#T")), 1);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_text(FL_NORMAL_TEXT, 20, 255, 210, 20, _("These are never toggled"));
- fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj, FL_BOLD_STYLE);
- fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
- fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_text(FL_NORMAL_TEXT, 20, 315, 215, 20, _("These are always toggled"));
- fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj, FL_BOLD_STYLE);
- fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
- fl_set_object_resize(obj, FL_RESIZE_X);
fdui->choice_language = obj = fl_add_choice(FL_DROPLIST_CHOICE, 95, 175, 190, 30, _("Language:"));
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
+ obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 265, 280, 45, _("These are never toggled"));
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+ obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 325, 280, 45, _("These are always toggled"));
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_end_form();
fdui->form_character->fdui = fdui;
if (lyxrc.font_norm_menu.empty())
lyxrc.font_norm_menu = lyxrc.font_norm;
// Set the font name for popups and menus
- string menufontname = lyxrc.menu_font_name
+ string boldfontname = lyxrc.menu_font_name
+ "-*-*-*-?-*-*-*-*-"
+ lyxrc.font_norm_menu;
// "?" means "scale that font"
- string popupfontname = lyxrc.popup_font_name
+ string fontname = lyxrc.popup_font_name
+ "-*-*-*-?-*-*-*-*-"
+ lyxrc.font_norm_menu;
- int bold = fl_set_font_name(FL_BOLD_STYLE, menufontname.c_str());
- int normal = fl_set_font_name(FL_NORMAL_STYLE, popupfontname.c_str());
+ int bold = fl_set_font_name(FL_BOLD_STYLE, boldfontname.c_str());
+ int normal = fl_set_font_name(FL_NORMAL_STYLE, fontname.c_str());
if (bold < 0)
lyxerr << "Could not set menu font to "
- << menufontname << endl;
+ << boldfontname << endl;
if (normal < 0)
lyxerr << "Could not set popup font to "
- << popupfontname << endl;
+ << fontname << endl;
if (bold < 0 && normal < 0) {
lyxerr << "Using 'helvetica' font for menus" << endl;
- bold = fl_set_font_name(FL_BOLD_STYLE,
- "-*-helvetica-bold-r-*-*-*-?-*-*-*-*-iso8859-1");
- normal = fl_set_font_name(FL_NORMAL_STYLE,
- "-*-helvetica-medium-r-*-*-*-?-*-*-*-*-iso8859-1");
+ boldfontname = "-*-helvetica-bold-r-*-*-*-?-*-*-*-*-iso8859-1";
+ fontname = "-*-helvetica-medium-r-*-*-*-?-*-*-*-*-iso8859-1";
+ bold = fl_set_font_name(FL_BOLD_STYLE, boldfontname.c_str());
+ normal = fl_set_font_name(FL_NORMAL_STYLE, fontname.c_str());
+
if (bold < 0 && normal < 0) {
lyxerr << "Could not find helvetica font. Using 'fixed'." << endl;
- normal = fl_set_font_name(FL_NORMAL_STYLE, "fixed");
+ fl_set_font_name(FL_NORMAL_STYLE, "fixed");
+ normal = bold = 0;
}
}
+ if (bold < 0)
+ fl_set_font_name(FL_BOLD_STYLE, fontname.c_str());
+ else if (normal < 0)
+ fl_set_font_name(FL_NORMAL_STYLE, boldfontname.c_str());
// put here (after fl_initialize) to avoid segfault. Cannot be done
// in setDefaults() (Matthias 140496)
fl_addto_choice(fd_form_character->choice_color,
_(" No change %l| No color | Black | White | Red | Green "
"| Blue | Cyan | Magenta | Yellow %l| Reset "));
+ // Appears to need initialising to avoid seg fault when dialog is
+ // launched. Over-written by combo_language2, below
+ fl_addto_choice(fd_form_character->choice_language,
+ _(" English %l| German | French "));
fl_set_form_minsize(fd_form_character->form_character,
fd_form_character->form_character->w,
fd_form_character->form_character->h);
#include "ToolbarDefaults.h"
#include "lyxlex.h"
#include "encoding.h"
+#include "converter.h"
using std::endl;
if (!ReadRcFile("preferences"))
ReadRcFile("lyxrc");
+ /// Init Converter
+ Converter::init();
+
// Read encodings
ReadEncodingsFile("encodings");
// Read languages
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
moveCursorUpdate(false);
+ owner->showState(); // current_font.number can change
+ // so we need to update the minibuffer
}
break;
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
moveCursorUpdate(false);
+ owner->showState(); // current_font.number can change
+ // so we need to update the minibuffer
return string();
} else {
// why is an "Unknown action" with empty
#define PORTABLE_SNPRINTF_VERSION_MAJOR 2
#define PORTABLE_SNPRINTF_VERSION_MINOR 1
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef HAVE_SNPRINTF
#include <stdio.h>
#else
-extern int snprintf(char *, size_t, const char *, /*args*/ ...);
-extern int vsnprintf(char *, size_t, const char *, va_list);
+int snprintf(char *, size_t, const char *, /*args*/ ...);
+int vsnprintf(char *, size_t, const char *, va_list);
#endif
#if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
-extern int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
-extern int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
+int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
+int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
#define snprintf portable_snprintf
#define vsnprintf portable_vsnprintf
#endif
-extern int asprintf (char **ptr, const char *fmt, /*args*/ ...);
-extern int vasprintf (char **ptr, const char *fmt, va_list ap);
-extern int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
-extern int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
+int asprintf (char **ptr, const char *fmt, /*args*/ ...);
+int vasprintf (char **ptr, const char *fmt, va_list ap);
+int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
+int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
#endif
status = LyXText::NEED_MORE_REFRESH;
BreakAgainOneRow(bview, row);
+ // will the cursor be in another row now?
+ if (row->next() && row->next()->par() == row->par() &&
+ RowLast(row) <= cursor.pos()) {
+ row = row->next();
+ BreakAgainOneRow(bview, row);
+ }
+
SetCursor(bview, cursor.par(), cursor.pos(), false, cursor.boundary());
- // cursor MUST be in row now
-
- need_break_row = row->next();
+
+ if (row->next() && row->next()->par() == row->par())
+ need_break_row = row->next();
+ else
+ need_break_row = 0;
} else {
// set the dimensions of the row
row->fill(Fill(bview, row, workWidth(bview)));