mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Patches from Angus, Baruch, Dekel (2), and some glue from me.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1123 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a5af5783ac
commit
4255b4a1b7
49
ChangeLog
49
ChangeLog
@ -1,3 +1,52 @@
|
||||
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]:
|
||||
|
@ -11,7 +11,7 @@ SnapGrid: 5
|
||||
Name: form_character
|
||||
Width: 300
|
||||
Height: 415
|
||||
Number of Objects: 16
|
||||
Number of Objects: 14
|
||||
|
||||
--------------------
|
||||
class: FL_BOX
|
||||
@ -31,42 +31,6 @@ name:
|
||||
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
|
||||
@ -247,42 +211,6 @@ name: check_toggle_all
|
||||
callback:
|
||||
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
|
||||
lcol: FL_BLACK
|
||||
label: These are never toggled
|
||||
shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name:
|
||||
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
|
||||
style: FL_BOLD_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: These are always toggled
|
||||
shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_CHOICE
|
||||
type: DROPLIST_CHOICE
|
||||
@ -301,6 +229,42 @@ name: choice_language
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
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 never toggled
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
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: These are always toggled
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NorthWest FL_NorthEast
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
=============== FORM ===============
|
||||
Name: form_preamble
|
||||
Width: 380
|
||||
|
@ -147,6 +147,10 @@
|
||||
@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
|
||||
|
@ -574,6 +574,12 @@
|
||||
# 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 ####################################################
|
||||
#
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "gettext.h"
|
||||
#include "lastfiles.h"
|
||||
#include "bufferlist.h"
|
||||
#include "converter.h"
|
||||
#include "exporter.h"
|
||||
#include "support/filetools.h"
|
||||
#include "support/lyxfunctional.h"
|
||||
@ -35,6 +36,7 @@ using std::endl;
|
||||
using std::vector;
|
||||
using std::pair;
|
||||
using std::find_if;
|
||||
using std::sort;
|
||||
|
||||
// This is the global menu definition
|
||||
MenuBackend menubackend;
|
||||
@ -190,6 +192,11 @@ Menu & Menu::read(LyXLex & lex)
|
||||
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
|
||||
{
|
||||
@ -237,7 +244,7 @@ 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);
|
||||
@ -249,13 +256,23 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
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));
|
||||
}
|
||||
|
7
src/cheaders/cstdarg
Normal file
7
src/cheaders/cstdarg
Normal file
@ -0,0 +1,7 @@
|
||||
// -*- C++ -*- forwarding header.
|
||||
// This file is part of the GNU ANSI C++ Library.
|
||||
|
||||
#ifndef __CSTDARG__
|
||||
#define __CSTDARG__
|
||||
#include <stdarg.h>
|
||||
#endif
|
@ -15,7 +15,6 @@
|
||||
#endif
|
||||
|
||||
#include <queue>
|
||||
#include <algorithm> // sort()
|
||||
|
||||
#include "converter.h"
|
||||
#include "lyxrc.h"
|
||||
@ -33,7 +32,6 @@ using std::map;
|
||||
using std::vector;
|
||||
using std::queue;
|
||||
using std::pair;
|
||||
using std::sort;
|
||||
using std::endl;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@ -53,7 +51,7 @@ string const add_options(string const & command, string const & options)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Format::Format(string const & n)
|
||||
: name(n), in_degree(0)
|
||||
: name(n)
|
||||
{
|
||||
struct Item {
|
||||
char const * name;
|
||||
@ -209,23 +207,19 @@ void Converter::Add(string const & from, string const & to,
|
||||
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();
|
||||
@ -238,18 +232,12 @@ Converter::GetReachable(string const & from, bool only_viewable)
|
||||
|
||||
while (!Q.empty()) {
|
||||
vector<Command>::iterator it = Q.front();
|
||||
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();
|
||||
format = Formats::GetFormat((*it).to);
|
||||
if (!only_viewable || !format->viewer.empty())
|
||||
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) {
|
||||
@ -258,10 +246,42 @@ Converter::GetReachable(string const & from, bool only_viewable)
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
@ -471,6 +491,12 @@ bool Converter::scanLog(Buffer const * buffer, string const & command,
|
||||
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)) {
|
||||
@ -529,6 +555,10 @@ bool Converter::runLaTeX(Buffer const * buffer, string const & command)
|
||||
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().
|
||||
@ -554,7 +584,12 @@ bool Converter::runLaTeX(Buffer const * buffer, string const & command)
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
@ -613,3 +648,8 @@ string const Converter::dvips_options(Buffer const * buffer)
|
||||
result += ' ' + lyxrc.print_landscape_flag;
|
||||
return result;
|
||||
}
|
||||
|
||||
void Converter::init()
|
||||
{
|
||||
Formats::Add("txt");
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ struct Command {
|
||||
class Format {
|
||||
public:
|
||||
///
|
||||
Format() : in_degree(0) {}
|
||||
Format() {}
|
||||
///
|
||||
Format(string const & n);
|
||||
///
|
||||
@ -66,8 +66,19 @@ public:
|
||||
string prettyname;
|
||||
///
|
||||
string viewer;
|
||||
};
|
||||
|
||||
class FormatPair {
|
||||
public:
|
||||
///
|
||||
int in_degree;
|
||||
Format * format;
|
||||
///
|
||||
Format * from;
|
||||
///
|
||||
string command;
|
||||
///
|
||||
FormatPair(Format * f1, Format * f2, string c)
|
||||
: format(f1), from(f2), command(c) {}
|
||||
};
|
||||
|
||||
///
|
||||
@ -102,12 +113,17 @@ public:
|
||||
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);
|
||||
@ -120,6 +136,9 @@ public:
|
||||
///
|
||||
static
|
||||
string const dvips_options(Buffer const * buffer);
|
||||
///
|
||||
static
|
||||
void init();
|
||||
private:
|
||||
///
|
||||
static
|
||||
|
@ -15,14 +15,13 @@
|
||||
#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)
|
||||
@ -84,37 +83,31 @@ bool Exporter::Preview(Buffer * buffer, string const & format0)
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -20,8 +20,8 @@
|
||||
#include "LString.h"
|
||||
|
||||
class Buffer;
|
||||
class FormatPair;
|
||||
|
||||
///
|
||||
class Exporter {
|
||||
public:
|
||||
///
|
||||
@ -36,11 +36,11 @@ 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
|
||||
|
@ -8,6 +8,8 @@ INCLUDES = -I${srcdir}/../../ $(SIGC_CFLAGS)
|
||||
|
||||
libfrontendsupport_la_SOURCES = \
|
||||
LyXImage.h \
|
||||
LyXImage.C \
|
||||
LyXImage.C
|
||||
|
||||
libfrontendsupport_la_EXTRA_DIST = \
|
||||
LyXImage_X.h \
|
||||
LyXImage_X.C
|
||||
|
@ -17,12 +17,6 @@ FD_form_character *create_form_form_character(void)
|
||||
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);
|
||||
@ -67,21 +61,17 @@ FD_form_character *create_form_form_character(void)
|
||||
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;
|
||||
|
@ -185,35 +185,41 @@ void LyXGUI::init()
|
||||
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)
|
||||
@ -312,6 +318,10 @@ void LyXGUI::create_forms()
|
||||
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);
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "ToolbarDefaults.h"
|
||||
#include "lyxlex.h"
|
||||
#include "encoding.h"
|
||||
#include "converter.h"
|
||||
|
||||
using std::endl;
|
||||
|
||||
@ -404,6 +405,9 @@ void LyX::init(int */*argc*/, char **argv, bool gui)
|
||||
if (!ReadRcFile("preferences"))
|
||||
ReadRcFile("lyxrc");
|
||||
|
||||
/// Init Converter
|
||||
Converter::init();
|
||||
|
||||
// Read encodings
|
||||
ReadEncodingsFile("encodings");
|
||||
// Read languages
|
||||
|
@ -2895,6 +2895,8 @@ string const LyXFunc::Dispatch(int ac,
|
||||
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;
|
||||
|
||||
@ -3030,6 +3032,8 @@ string const LyXFunc::Dispatch(int ac,
|
||||
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
|
||||
|
@ -4,23 +4,31 @@
|
||||
#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
|
||||
|
13
src/text.C
13
src/text.C
@ -2956,10 +2956,19 @@ void LyXText::Backspace(BufferView * bview)
|
||||
status = LyXText::NEED_MORE_REFRESH;
|
||||
|
||||
BreakAgainOneRow(bview, row);
|
||||
SetCursor(bview, cursor.par(), cursor.pos(), false, cursor.boundary());
|
||||
// cursor MUST be in row now
|
||||
// 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());
|
||||
|
||||
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)));
|
||||
|
Loading…
Reference in New Issue
Block a user