mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
ws cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3803 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a654de29ea
commit
8283e978f8
@ -199,19 +199,19 @@ void BufferView::insetUnlock()
|
|||||||
|
|
||||||
bool BufferView::focus() const
|
bool BufferView::focus() const
|
||||||
{
|
{
|
||||||
return pimpl_->focus();
|
return pimpl_->focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BufferView::focus(bool f)
|
void BufferView::focus(bool f)
|
||||||
{
|
{
|
||||||
pimpl_->focus(f);
|
pimpl_->focus(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BufferView::active() const
|
bool BufferView::active() const
|
||||||
{
|
{
|
||||||
return pimpl_->active();
|
return pimpl_->active();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,10 +87,10 @@ public:
|
|||||||
LyXView * owner() const;
|
LyXView * owner() const;
|
||||||
///
|
///
|
||||||
void beforeChange(LyXText *);
|
void beforeChange(LyXText *);
|
||||||
///
|
///
|
||||||
void savePosition(unsigned int i);
|
void savePosition(unsigned int i);
|
||||||
///
|
///
|
||||||
void restorePosition(unsigned int i);
|
void restorePosition(unsigned int i);
|
||||||
///
|
///
|
||||||
bool isSavedPosition(unsigned int i);
|
bool isSavedPosition(unsigned int i);
|
||||||
/** This holds the mapping between buffer paragraphs and screen rows.
|
/** This holds the mapping between buffer paragraphs and screen rows.
|
||||||
|
@ -560,7 +560,7 @@ void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
|
|||||||
(cursor.par()->getInset(cursor.pos() - 1) ==
|
(cursor.par()->getInset(cursor.pos() - 1) ==
|
||||||
locking_inset))
|
locking_inset))
|
||||||
text->setCursor(this, cursor,
|
text->setCursor(this, cursor,
|
||||||
cursor.par(), cursor.pos() - 1);
|
cursor.par(), cursor.pos() - 1);
|
||||||
LyXScreen::Cursor_Shape shape = LyXScreen::BAR_SHAPE;
|
LyXScreen::Cursor_Shape shape = LyXScreen::BAR_SHAPE;
|
||||||
LyXText * txt = getLyXText();
|
LyXText * txt = getLyXText();
|
||||||
if (locking_inset->isTextInset() &&
|
if (locking_inset->isTextInset() &&
|
||||||
@ -625,8 +625,8 @@ void BufferView::lockedInsetStoreUndo(Undo::undo_kind kind)
|
|||||||
if (kind == Undo::EDIT) // in this case insets would not be stored!
|
if (kind == Undo::EDIT) // in this case insets would not be stored!
|
||||||
kind = Undo::FINISH;
|
kind = Undo::FINISH;
|
||||||
setUndo(this, kind,
|
setUndo(this, kind,
|
||||||
text->cursor.par(),
|
text->cursor.par(),
|
||||||
text->cursor.par()->next());
|
text->cursor.par()->next());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -587,7 +587,7 @@ void BufferView::Pimpl::workAreaMotionNotify(int x, int y, unsigned int state)
|
|||||||
|
|
||||||
// Single-click on work area
|
// Single-click on work area
|
||||||
void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
|
void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
|
||||||
unsigned int button)
|
unsigned int button)
|
||||||
{
|
{
|
||||||
if (!buffer_ || !screen_.get())
|
if (!buffer_ || !screen_.get())
|
||||||
return;
|
return;
|
||||||
@ -682,7 +682,7 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
|
|||||||
owner_->getLyXFunc()->dispatch(LFUN_PASTE);
|
owner_->getLyXFunc()->dispatch(LFUN_PASTE);
|
||||||
else
|
else
|
||||||
owner_->getLyXFunc()->dispatch(LFUN_PASTESELECTION,
|
owner_->getLyXFunc()->dispatch(LFUN_PASTESELECTION,
|
||||||
"paragraph");
|
"paragraph");
|
||||||
selection_possible = false;
|
selection_possible = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1173,7 +1173,7 @@ void BufferView::Pimpl::cursorPrevious(LyXText * text)
|
|||||||
if ((cursorrow == text->cursor.row()))
|
if ((cursorrow == text->cursor.row()))
|
||||||
text->cursorUp(bv_);
|
text->cursorUp(bv_);
|
||||||
|
|
||||||
if (text->inset_owner ||
|
if (text->inset_owner ||
|
||||||
text->cursor.row()->height() < workarea_.height())
|
text->cursor.row()->height() < workarea_.height())
|
||||||
screen_->draw(bv_->text, bv_,
|
screen_->draw(bv_->text, bv_,
|
||||||
text->cursor.y()
|
text->cursor.y()
|
||||||
@ -1201,7 +1201,7 @@ void BufferView::Pimpl::cursorNext(LyXText * text)
|
|||||||
if ((cursorrow == bv_->text->cursor.row()))
|
if ((cursorrow == bv_->text->cursor.row()))
|
||||||
text->cursorDown(bv_);
|
text->cursorDown(bv_);
|
||||||
|
|
||||||
if (text->inset_owner ||
|
if (text->inset_owner ||
|
||||||
text->cursor.row()->height() < workarea_.height())
|
text->cursor.row()->height() < workarea_.height())
|
||||||
screen_->draw(bv_->text, bv_, text->cursor.y() -
|
screen_->draw(bv_->text, bv_, text->cursor.y() -
|
||||||
text->cursor.row()->baseline());
|
text->cursor.row()->baseline());
|
||||||
@ -1250,7 +1250,7 @@ void BufferView::Pimpl::restorePosition(unsigned int i)
|
|||||||
|
|
||||||
if (fname != buffer_->fileName()) {
|
if (fname != buffer_->fileName()) {
|
||||||
Buffer * b = bufferlist.exists(fname) ?
|
Buffer * b = bufferlist.exists(fname) ?
|
||||||
bufferlist.getBuffer(fname) :
|
bufferlist.getBuffer(fname) :
|
||||||
bufferlist.loadLyXFile(fname); // don't ask, just load it
|
bufferlist.loadLyXFile(fname); // don't ask, just load it
|
||||||
if (b != 0) buffer(b);
|
if (b != 0) buffer(b);
|
||||||
}
|
}
|
||||||
@ -1883,7 +1883,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
|||||||
InsetRef * inset =
|
InsetRef * inset =
|
||||||
static_cast<InsetRef*>(getInsetByCode(Inset::REF_CODE));
|
static_cast<InsetRef*>(getInsetByCode(Inset::REF_CODE));
|
||||||
if (inset) {
|
if (inset) {
|
||||||
label = inset->getContents();
|
label = inset->getContents();
|
||||||
savePosition(0);
|
savePosition(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2906,11 +2906,11 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
|||||||
case LFUN_GETFONT:
|
case LFUN_GETFONT:
|
||||||
{
|
{
|
||||||
LyXFont & font = bv_->getLyXText()->current_font;
|
LyXFont & font = bv_->getLyXText()->current_font;
|
||||||
if (font.shape() == LyXFont::ITALIC_SHAPE)
|
if (font.shape() == LyXFont::ITALIC_SHAPE)
|
||||||
owner_->getLyXFunc()->setMessage("E");
|
owner_->getLyXFunc()->setMessage("E");
|
||||||
else if (font.shape() == LyXFont::SMALLCAPS_SHAPE)
|
else if (font.shape() == LyXFont::SMALLCAPS_SHAPE)
|
||||||
owner_->getLyXFunc()->setMessage("N");
|
owner_->getLyXFunc()->setMessage("N");
|
||||||
else
|
else
|
||||||
owner_->getLyXFunc()->setMessage("0");
|
owner_->getLyXFunc()->setMessage("0");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ struct BufferView::Pimpl : public SigC::Object {
|
|||||||
void update();
|
void update();
|
||||||
//
|
//
|
||||||
void update(LyXText *, BufferView::UpdateCodes);
|
void update(LyXText *, BufferView::UpdateCodes);
|
||||||
/// Update pixmap of screen
|
/// Update pixmap of screen
|
||||||
void updateScreen();
|
void updateScreen();
|
||||||
///
|
///
|
||||||
void workAreaExpose();
|
void workAreaExpose();
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
|
|
||||||
|
* most files: ws cleanup
|
||||||
|
|
||||||
* buffer.[Ch]: ws changes
|
* buffer.[Ch]: ws changes
|
||||||
|
|
||||||
* Makefile.am (LYX_CONV_LIBS): remove ld -r stuff.
|
* Makefile.am (LYX_CONV_LIBS): remove ld -r stuff.
|
||||||
|
@ -49,7 +49,7 @@ int Chktex::run(TeXErrors &terr)
|
|||||||
// run bibtex
|
// run bibtex
|
||||||
string log = OnlyFilename(ChangeExtension(file, ".log"));
|
string log = OnlyFilename(ChangeExtension(file, ".log"));
|
||||||
string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log;
|
string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log;
|
||||||
Systemcall one;
|
Systemcall one;
|
||||||
int result= one.startscript(Systemcall::Wait, tmp);
|
int result= one.startscript(Systemcall::Wait, tmp);
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
result = scanLogFile(terr);
|
result = scanLogFile(terr);
|
||||||
|
@ -73,7 +73,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
|
|||||||
// lyxerr << "Painter drawable: " << drawable() << endl;
|
// lyxerr << "Painter drawable: " << drawable() << endl;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (colorGCcache[c] != 0)
|
if (colorGCcache[c] != 0)
|
||||||
return colorGCcache[c];
|
return colorGCcache[c];
|
||||||
|
|
||||||
XColor xcol;
|
XColor xcol;
|
||||||
@ -83,7 +83,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
|
|||||||
|
|
||||||
// Look up the RGB values for the color, and an approximate
|
// Look up the RGB values for the color, and an approximate
|
||||||
// color that we can hope to get on this display.
|
// color that we can hope to get on this display.
|
||||||
if (XLookupColor(display, colormap, s.c_str(), &xcol, &ccol) == 0) {
|
if (XLookupColor(display, colormap, s.c_str(), &xcol, &ccol) == 0) {
|
||||||
lyxerr << _("LyX: Unknown X11 color ") << s
|
lyxerr << _("LyX: Unknown X11 color ") << s
|
||||||
<< _(" for ") << lcolor.getGUIName(c) << '\n'
|
<< _(" for ") << lcolor.getGUIName(c) << '\n'
|
||||||
<< _(" Using black instead, sorry!") << endl;
|
<< _(" Using black instead, sorry!") << endl;
|
||||||
|
@ -80,7 +80,7 @@ void DeleteBuffer()
|
|||||||
|
|
||||||
|
|
||||||
bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
||||||
int start, int & end, char tc, bool doclear,
|
int start, int & end, char tc, bool doclear,
|
||||||
bool realcut)
|
bool realcut)
|
||||||
{
|
{
|
||||||
if (!startpar || (start > startpar->size()))
|
if (!startpar || (start > startpar->size()))
|
||||||
@ -103,7 +103,7 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
|||||||
for (; i < end; ++i) {
|
for (; i < end; ++i) {
|
||||||
if (realcut)
|
if (realcut)
|
||||||
startpar->copyIntoMinibuffer(*current_view->buffer(),
|
startpar->copyIntoMinibuffer(*current_view->buffer(),
|
||||||
start);
|
start);
|
||||||
startpar->erase(start);
|
startpar->erase(start);
|
||||||
if (realcut)
|
if (realcut)
|
||||||
buf->insertFromMinibuffer(buf->size());
|
buf->insertFromMinibuffer(buf->size());
|
||||||
@ -112,12 +112,12 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
|||||||
} else {
|
} else {
|
||||||
// more than one paragraph
|
// more than one paragraph
|
||||||
(*endpar)->breakParagraphConservative(current_view->buffer()->params,
|
(*endpar)->breakParagraphConservative(current_view->buffer()->params,
|
||||||
end);
|
end);
|
||||||
*endpar = (*endpar)->next();
|
*endpar = (*endpar)->next();
|
||||||
end = 0;
|
end = 0;
|
||||||
|
|
||||||
startpar->breakParagraphConservative(current_view->buffer()->params,
|
startpar->breakParagraphConservative(current_view->buffer()->params,
|
||||||
start);
|
start);
|
||||||
|
|
||||||
// store the selection
|
// store the selection
|
||||||
if (realcut) {
|
if (realcut) {
|
||||||
@ -160,7 +160,7 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
|||||||
|
|
||||||
|
|
||||||
bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
|
bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
|
||||||
int start, int end, char tc)
|
int start, int end, char tc)
|
||||||
{
|
{
|
||||||
if (!startpar || (start > startpar->size()))
|
if (!startpar || (start > startpar->size()))
|
||||||
return false;
|
return false;
|
||||||
@ -218,7 +218,7 @@ bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
|
|||||||
|
|
||||||
|
|
||||||
bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
|
bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
|
||||||
int & pos, char tc)
|
int & pos, char tc)
|
||||||
{
|
{
|
||||||
if (!checkPastePossible(*par))
|
if (!checkPastePossible(*par))
|
||||||
return false;
|
return false;
|
||||||
@ -324,7 +324,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
|
|||||||
|
|
||||||
// make sure there is no class difference
|
// make sure there is no class difference
|
||||||
SwitchLayoutsBetweenClasses(textclass, tc, buf,
|
SwitchLayoutsBetweenClasses(textclass, tc, buf,
|
||||||
current_view->buffer()->params);
|
current_view->buffer()->params);
|
||||||
|
|
||||||
// make the buf exactly the same layout than
|
// make the buf exactly the same layout than
|
||||||
// the cursor paragraph
|
// the cursor paragraph
|
||||||
@ -341,7 +341,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
|
|||||||
// if necessary
|
// if necessary
|
||||||
if (((*par)->size() > pos) || !(*par)->next()) {
|
if (((*par)->size() > pos) || !(*par)->next()) {
|
||||||
(*par)->breakParagraphConservative(current_view->buffer()->params,
|
(*par)->breakParagraphConservative(current_view->buffer()->params,
|
||||||
pos);
|
pos);
|
||||||
paste_the_end = true;
|
paste_the_end = true;
|
||||||
}
|
}
|
||||||
// set the end for redoing later
|
// set the end for redoing later
|
||||||
|
@ -45,8 +45,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
int SwitchLayoutsBetweenClasses(lyx::textclass_type class1,
|
int SwitchLayoutsBetweenClasses(lyx::textclass_type class1,
|
||||||
lyx::textclass_type class2,
|
lyx::textclass_type class2,
|
||||||
Paragraph * par,
|
Paragraph * par,
|
||||||
BufferParams const & bparams);
|
BufferParams const & bparams);
|
||||||
///
|
///
|
||||||
static
|
static
|
||||||
|
@ -249,4 +249,3 @@ void DepTable::read(string const & f)
|
|||||||
deplist[nome] = di;
|
deplist[nome] = di;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,4 +71,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* LyX, The Document Processor
|
* LyX, The Document Processor
|
||||||
*
|
*
|
||||||
* Copyright 1997 Asger Alstrup
|
* Copyright 1997 Asger Alstrup
|
||||||
* and the LyX Team.
|
* and the LyX Team.
|
||||||
*
|
*
|
||||||
* ====================================================== */
|
* ====================================================== */
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ bool FuncStatus::unknown () const
|
|||||||
FuncStatus & FuncStatus::disabled (bool b)
|
FuncStatus & FuncStatus::disabled (bool b)
|
||||||
{
|
{
|
||||||
if (b)
|
if (b)
|
||||||
v_ |= DISABLED;
|
v_ |= DISABLED;
|
||||||
else
|
else
|
||||||
v_ &= !DISABLED;
|
v_ &= !DISABLED;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -158,7 +158,7 @@ public:
|
|||||||
/// Color used for bottom background
|
/// Color used for bottom background
|
||||||
buttonbg,
|
buttonbg,
|
||||||
|
|
||||||
// Logical attributes
|
// Logical attributes
|
||||||
|
|
||||||
/// Color is inherited
|
/// Color is inherited
|
||||||
inherit,
|
inherit,
|
||||||
|
@ -62,7 +62,7 @@ extern BufferList bufferlist;
|
|||||||
void TeXErrors::insertError(int line, string const & error_desc,
|
void TeXErrors::insertError(int line, string const & error_desc,
|
||||||
string const & error_text)
|
string const & error_text)
|
||||||
{
|
{
|
||||||
Error newerr(line, error_desc, error_text);
|
Error newerr(line, error_desc, error_text);
|
||||||
errors.push_back(newerr);
|
errors.push_back(newerr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ int LaTeX::operator()()
|
|||||||
#else // cmd.exe (OS/2) causes SYS0003 error at "/dev/null"
|
#else // cmd.exe (OS/2) causes SYS0003 error at "/dev/null"
|
||||||
string tmp = cmd + ' ' + file + " > nul";
|
string tmp = cmd + ' ' + file + " > nul";
|
||||||
#endif
|
#endif
|
||||||
Systemcall one;
|
Systemcall one;
|
||||||
return one.startscript(Systemcall::Wait, tmp);
|
return one.startscript(Systemcall::Wait, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ string const LaTeXFeatures::getMacros() const
|
|||||||
if (isRequired("guillemotright"))
|
if (isRequired("guillemotright"))
|
||||||
macros << guillemotright_def << '\n';
|
macros << guillemotright_def << '\n';
|
||||||
|
|
||||||
// Math mode
|
// Math mode
|
||||||
if (isRequired("boldsymbol") && !isRequired("amsmath"))
|
if (isRequired("boldsymbol") && !isRequired("amsmath"))
|
||||||
macros << boldsymbol_def << '\n';
|
macros << boldsymbol_def << '\n';
|
||||||
if (isRequired("binom") && !isRequired("amsmath"))
|
if (isRequired("binom") && !isRequired("amsmath"))
|
||||||
|
@ -27,7 +27,7 @@ using std::endl;
|
|||||||
Here's the set of rules to apply when a new command name is introduced:
|
Here's the set of rules to apply when a new command name is introduced:
|
||||||
|
|
||||||
1) Use the object.event order. That is, use `word-forward'
|
1) Use the object.event order. That is, use `word-forward'
|
||||||
instead of `forward-word'.
|
instead of `forward-word'.
|
||||||
2) Don't introduce an alias for an already named object. Same for events.
|
2) Don't introduce an alias for an already named object. Same for events.
|
||||||
3) Forward movement or focus is called `forward' (not `right').
|
3) Forward movement or focus is called `forward' (not `right').
|
||||||
4) Backward movement or focus is called `backward' (not `left').
|
4) Backward movement or focus is called `backward' (not `left').
|
||||||
@ -582,17 +582,17 @@ int LyXAction::getApproxFunc(string const & func) const
|
|||||||
// Checking for prefix is not so simple, but
|
// Checking for prefix is not so simple, but
|
||||||
// using a simple bounding function gives
|
// using a simple bounding function gives
|
||||||
// a similar result. [ale 19981103]
|
// a similar result. [ale 19981103]
|
||||||
func_map::const_iterator fit =
|
func_map::const_iterator fit =
|
||||||
lyx_func_map.lower_bound(func);
|
lyx_func_map.lower_bound(func);
|
||||||
|
|
||||||
if (fit != lyx_func_map.end()) {
|
if (fit != lyx_func_map.end()) {
|
||||||
action = fit->second;
|
action = fit->second;
|
||||||
}
|
}
|
||||||
} else { // Go get the next function
|
} else { // Go get the next function
|
||||||
func_map::const_iterator fit =
|
func_map::const_iterator fit =
|
||||||
lyx_func_map.upper_bound(func);
|
lyx_func_map.upper_bound(func);
|
||||||
|
|
||||||
if (fit != lyx_func_map.end()) {
|
if (fit != lyx_func_map.end()) {
|
||||||
action = fit->second;
|
action = fit->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -666,7 +666,7 @@ string const LyXAction::helpText(int pseudoaction) const
|
|||||||
|
|
||||||
|
|
||||||
bool LyXAction::funcHasFlag(kb_action action,
|
bool LyXAction::funcHasFlag(kb_action action,
|
||||||
LyXAction::func_attrib flag) const
|
LyXAction::func_attrib flag) const
|
||||||
{
|
{
|
||||||
info_map::const_iterator ici = lyx_info_map.find(action);
|
info_map::const_iterator ici = lyx_info_map.find(action);
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ public:
|
|||||||
Noop = 0,
|
Noop = 0,
|
||||||
/// can be used in RO mode (perhaps this should change)
|
/// can be used in RO mode (perhaps this should change)
|
||||||
ReadOnly = 1, // ,
|
ReadOnly = 1, // ,
|
||||||
/// Can be used when there is no document open
|
/// Can be used when there is no document open
|
||||||
NoBuffer = 2,
|
NoBuffer = 2,
|
||||||
//Interactive = 2, // Is interactive (requires a GUI)
|
//Interactive = 2, // Is interactive (requires a GUI)
|
||||||
///
|
///
|
||||||
Argument = 4 // Requires argument
|
Argument = 4 // Requires argument
|
||||||
@ -68,13 +68,13 @@ public:
|
|||||||
created if needed. */
|
created if needed. */
|
||||||
int LookupFunc(string const & func_name) const;
|
int LookupFunc(string const & func_name) const;
|
||||||
|
|
||||||
/** Returns an action tag which name is the most similar to a string.
|
/** Returns an action tag which name is the most similar to a string.
|
||||||
Don't include arguments, they would be ignored. */
|
Don't include arguments, they would be ignored. */
|
||||||
int getApproxFunc(string const & func) const;
|
int getApproxFunc(string const & func) const;
|
||||||
|
|
||||||
/** Returns an action name the most similar to a string.
|
/** Returns an action name the most similar to a string.
|
||||||
Don't include arguments, they would be ignored. */
|
Don't include arguments, they would be ignored. */
|
||||||
string const getApproxFuncName(string const & func) const;
|
string const getApproxFuncName(string const & func) const;
|
||||||
|
|
||||||
/// Returns a pseudo-action given an action and its argument.
|
/// Returns a pseudo-action given an action and its argument.
|
||||||
int getPseudoAction(kb_action action, string const & arg) const;
|
int getPseudoAction(kb_action action, string const & arg) const;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/* This file is part of
|
/* This file is part of
|
||||||
* ======================================================
|
* ======================================================
|
||||||
*
|
*
|
||||||
|
@ -132,14 +132,14 @@ public:
|
|||||||
ItemList::size_type size() const { return items_.size(); }
|
ItemList::size_type size() const { return items_.size(); }
|
||||||
///
|
///
|
||||||
bool hasSubmenu(string const &) const;
|
bool hasSubmenu(string const &) const;
|
||||||
///
|
///
|
||||||
const_iterator begin() const {
|
const_iterator begin() const {
|
||||||
return items_.begin();
|
return items_.begin();
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
const_iterator end() const {
|
const_iterator end() const {
|
||||||
return items_.end();
|
return items_.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the menu shortcuts are unique
|
// Check whether the menu shortcuts are unique
|
||||||
void checkShortcuts() const;
|
void checkShortcuts() const;
|
||||||
@ -175,14 +175,14 @@ public:
|
|||||||
Menu const & getMenu (string const &) const;
|
Menu const & getMenu (string const &) const;
|
||||||
//
|
//
|
||||||
bool empty() const { return menulist_.empty(); }
|
bool empty() const { return menulist_.empty(); }
|
||||||
///
|
///
|
||||||
const_iterator begin() const {
|
const_iterator begin() const {
|
||||||
return menulist_.begin();
|
return menulist_.begin();
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
const_iterator end() const {
|
const_iterator end() const {
|
||||||
return menulist_.end();
|
return menulist_.end();
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
MenuList menulist_;
|
MenuList menulist_;
|
||||||
|
@ -88,7 +88,7 @@ PainterBase & Painter::lines(int const * xp, int const * yp, int np,
|
|||||||
points[i].y = yp[i];
|
points[i].y = yp[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
XDrawLines(display(), owner.getPixmap(),
|
XDrawLines(display(), owner.getPixmap(),
|
||||||
lyxColorHandler->getGCLinepars(ls, lw, col),
|
lyxColorHandler->getGCLinepars(ls, lw, col),
|
||||||
points.get(), np, CoordModeOrigin);
|
points.get(), np, CoordModeOrigin);
|
||||||
|
|
||||||
@ -139,9 +139,9 @@ PainterBase & Painter::arc(int x, int y,
|
|||||||
unsigned int w, unsigned int h,
|
unsigned int w, unsigned int h,
|
||||||
int a1, int a2, LColor::color col)
|
int a1, int a2, LColor::color col)
|
||||||
{
|
{
|
||||||
XDrawArc(display(), owner.getPixmap(),
|
XDrawArc(display(), owner.getPixmap(),
|
||||||
lyxColorHandler->getGCForeground(col),
|
lyxColorHandler->getGCForeground(col),
|
||||||
x, y, w, h, a1, a2);
|
x, y, w, h, a1, a2);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public:
|
|||||||
LColor::color = LColor::foreground);
|
LColor::color = LColor::foreground);
|
||||||
|
|
||||||
/// Draw lines from x1,y1 to x2,y2. They are arrays
|
/// Draw lines from x1,y1 to x2,y2. They are arrays
|
||||||
PainterBase & segments(int const * x1, int const * y1,
|
PainterBase & segments(int const * x1, int const * y1,
|
||||||
int const * x2, int const * y2, int ns,
|
int const * x2, int const * y2, int ns,
|
||||||
LColor::color = LColor::foreground,
|
LColor::color = LColor::foreground,
|
||||||
enum line_style = line_solid,
|
enum line_style = line_solid,
|
||||||
|
@ -92,7 +92,7 @@ public:
|
|||||||
LColor::color = LColor::foreground) = 0;
|
LColor::color = LColor::foreground) = 0;
|
||||||
|
|
||||||
/// Draw lines from x1,y1 to x2,y2. They are arrays
|
/// Draw lines from x1,y1 to x2,y2. They are arrays
|
||||||
virtual PainterBase & segments(
|
virtual PainterBase & segments(
|
||||||
int const * x1, int const * y1,
|
int const * x1, int const * y1,
|
||||||
int const * x2, int const * y2, int ns,
|
int const * x2, int const * y2, int ns,
|
||||||
LColor::color = LColor::foreground,
|
LColor::color = LColor::foreground,
|
||||||
@ -138,7 +138,7 @@ public:
|
|||||||
virtual PainterBase & button(int x, int y, int w, int h);
|
virtual PainterBase & button(int x, int y, int w, int h);
|
||||||
|
|
||||||
///
|
///
|
||||||
virtual PainterBase & buttonFrame(int x, int y, int w, int h);
|
virtual PainterBase & buttonFrame(int x, int y, int w, int h);
|
||||||
|
|
||||||
|
|
||||||
// For the figure inset
|
// For the figure inset
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@ -36,14 +35,14 @@ void ParagraphParameters::clear()
|
|||||||
tmp.labelwidthstring.erase();
|
tmp.labelwidthstring.erase();
|
||||||
tmp.start_of_appendix = false;
|
tmp.start_of_appendix = false;
|
||||||
#ifndef NO_PEXTRA_REALLY
|
#ifndef NO_PEXTRA_REALLY
|
||||||
//tmp.pextra_type = PEXTRA_NONE;
|
//tmp.pextra_type = PEXTRA_NONE;
|
||||||
tmp.pextra_type = 0;
|
tmp.pextra_type = 0;
|
||||||
tmp.pextra_width.erase();
|
tmp.pextra_width.erase();
|
||||||
tmp.pextra_widthp.erase();
|
tmp.pextra_widthp.erase();
|
||||||
//tmp.pextra_alignment = MINIPAGE_ALIGN_TOP;
|
//tmp.pextra_alignment = MINIPAGE_ALIGN_TOP;
|
||||||
tmp.pextra_alignment = 0;
|
tmp.pextra_alignment = 0;
|
||||||
tmp.pextra_hfill = false;
|
tmp.pextra_hfill = false;
|
||||||
tmp.pextra_start_minipage = false;
|
tmp.pextra_start_minipage = false;
|
||||||
#endif
|
#endif
|
||||||
set_from_struct(tmp);
|
set_from_struct(tmp);
|
||||||
}
|
}
|
||||||
@ -62,11 +61,11 @@ bool ParagraphParameters::sameLayout(ParagraphParameters const & pp) const
|
|||||||
param->spacing == pp.param->spacing &&
|
param->spacing == pp.param->spacing &&
|
||||||
#ifndef NO_PEXTRA_REALLY
|
#ifndef NO_PEXTRA_REALLY
|
||||||
param->pextra_type == pp.param->pextra_type &&
|
param->pextra_type == pp.param->pextra_type &&
|
||||||
param->pextra_width == pp.param->pextra_width &&
|
param->pextra_width == pp.param->pextra_width &&
|
||||||
param->pextra_widthp == pp.param->pextra_widthp &&
|
param->pextra_widthp == pp.param->pextra_widthp &&
|
||||||
param->pextra_alignment == pp.param->pextra_alignment &&
|
param->pextra_alignment == pp.param->pextra_alignment &&
|
||||||
param->pextra_hfill == pp.param->pextra_hfill &&
|
param->pextra_hfill == pp.param->pextra_hfill &&
|
||||||
param->pextra_start_minipage == pp.param->pextra_start_minipage &&
|
param->pextra_start_minipage == pp.param->pextra_start_minipage &&
|
||||||
#endif
|
#endif
|
||||||
param->noindent == pp.param->noindent &&
|
param->noindent == pp.param->noindent &&
|
||||||
param->depth == pp.param->depth;
|
param->depth == pp.param->depth;
|
||||||
|
@ -46,18 +46,18 @@ struct ParameterStruct {
|
|||||||
///
|
///
|
||||||
string labelwidthstring;
|
string labelwidthstring;
|
||||||
#ifndef NO_PEXTRA_REALLY
|
#ifndef NO_PEXTRA_REALLY
|
||||||
///
|
///
|
||||||
int pextra_type;
|
int pextra_type;
|
||||||
///
|
///
|
||||||
string pextra_width;
|
string pextra_width;
|
||||||
///
|
///
|
||||||
string pextra_widthp;
|
string pextra_widthp;
|
||||||
///
|
///
|
||||||
int pextra_alignment;
|
int pextra_alignment;
|
||||||
///
|
///
|
||||||
bool pextra_hfill;
|
bool pextra_hfill;
|
||||||
///
|
///
|
||||||
bool pextra_start_minipage;
|
bool pextra_start_minipage;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,11 +73,11 @@ struct PrinterParams {
|
|||||||
///
|
///
|
||||||
bool unsorted_copies;
|
bool unsorted_copies;
|
||||||
///
|
///
|
||||||
int count_copies;
|
int count_copies;
|
||||||
// The settings below should allow us to print any read-only doc in
|
// The settings below should allow us to print any read-only doc in
|
||||||
// whatever size/orientation we want it -- overriding the documents
|
// whatever size/orientation we want it -- overriding the documents
|
||||||
// settings.
|
// settings.
|
||||||
// Override the documents orientation
|
// Override the documents orientation
|
||||||
// bool orientation;
|
// bool orientation;
|
||||||
// Print n pages per physical sheet
|
// Print n pages per physical sheet
|
||||||
// unsigned int nup;
|
// unsigned int nup;
|
||||||
@ -104,7 +104,7 @@ struct PrinterParams {
|
|||||||
}
|
}
|
||||||
switch (target) {
|
switch (target) {
|
||||||
case PRINTER:
|
case PRINTER:
|
||||||
// Assert(!printer_name.empty());
|
// Assert(!printer_name.empty());
|
||||||
break;
|
break;
|
||||||
case FILE:
|
case FILE:
|
||||||
lyx::Assert(!file_name.empty());
|
lyx::Assert(!file_name.empty());
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
|
@ -87,7 +87,7 @@ void ToolbarDefaults::init()
|
|||||||
add(LFUN_DEPTH_PLUS);
|
add(LFUN_DEPTH_PLUS);
|
||||||
add(SEPARATOR);
|
add(SEPARATOR);
|
||||||
|
|
||||||
add(LFUN_MATH_MODE);
|
add(LFUN_MATH_MODE);
|
||||||
add(SEPARATOR);
|
add(SEPARATOR);
|
||||||
|
|
||||||
add(LFUN_INSET_GRAPHICS);
|
add(LFUN_INSET_GRAPHICS);
|
||||||
|
@ -27,7 +27,7 @@ class LyXLex;
|
|||||||
///
|
///
|
||||||
class ToolbarDefaults {
|
class ToolbarDefaults {
|
||||||
public:
|
public:
|
||||||
/// The special toolbar actions
|
/// The special toolbar actions
|
||||||
enum ItemType {
|
enum ItemType {
|
||||||
/// adds space between buttons in the toolbar
|
/// adds space between buttons in the toolbar
|
||||||
SEPARATOR=-3,
|
SEPARATOR=-3,
|
||||||
|
@ -80,4 +80,3 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -54,24 +54,24 @@ extern "C" {
|
|||||||
// Just a bunch of C wrappers around static members of WorkArea
|
// Just a bunch of C wrappers around static members of WorkArea
|
||||||
static
|
static
|
||||||
void C_WorkArea_scroll_cb(FL_OBJECT * ob, long buf)
|
void C_WorkArea_scroll_cb(FL_OBJECT * ob, long buf)
|
||||||
{
|
{
|
||||||
WorkArea::scroll_cb(ob, buf);
|
WorkArea::scroll_cb(ob, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
int C_WorkArea_work_area_handler(FL_OBJECT * ob, int event,
|
int C_WorkArea_work_area_handler(FL_OBJECT * ob, int event,
|
||||||
FL_Coord, FL_Coord,
|
FL_Coord, FL_Coord,
|
||||||
int key, void * xev)
|
int key, void * xev)
|
||||||
{
|
{
|
||||||
return WorkArea::work_area_handler(ob, event,
|
return WorkArea::work_area_handler(ob, event,
|
||||||
0, 0, key, xev);
|
0, 0, key, xev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int C_WorkAreaEventCB(FL_FORM * form, void * xev) {
|
int C_WorkAreaEventCB(FL_FORM * form, void * xev) {
|
||||||
WorkArea * wa = static_cast<WorkArea*>(form->u_vdata);
|
WorkArea * wa = static_cast<WorkArea*>(form->u_vdata);
|
||||||
int ret = wa->event_cb(static_cast<XEvent*>(xev));
|
int ret = wa->event_cb(static_cast<XEvent*>(xev));
|
||||||
lyxerr << "Pending: " << XPending(fl_get_display()) << endl;
|
lyxerr << "Pending: " << XPending(fl_get_display()) << endl;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/* This file is part of
|
/* This file is part of
|
||||||
* ======================================================
|
* ======================================================
|
||||||
*
|
*
|
||||||
@ -171,7 +170,7 @@ void XFormsView::create_form_form_main(int width, int height)
|
|||||||
// Misc
|
// Misc
|
||||||
//
|
//
|
||||||
|
|
||||||
// assign an icon to main form
|
// assign an icon to main form
|
||||||
string iconname = LibFileSearch("images", "lyx", "xpm");
|
string iconname = LibFileSearch("images", "lyx", "xpm");
|
||||||
if (!iconname.empty()) {
|
if (!iconname.empty()) {
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
|
@ -154,7 +154,7 @@ bool BufferList::qwriteAll()
|
|||||||
|
|
||||||
if (!unsaved.empty() && lyxrc.exit_confirmation) {
|
if (!unsaved.empty() && lyxrc.exit_confirmation) {
|
||||||
return Alert::askQuestion(_("Some documents were not saved:"),
|
return Alert::askQuestion(_("Some documents were not saved:"),
|
||||||
unsaved, _("Exit anyway?"));
|
unsaved, _("Exit anyway?"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -183,7 +183,7 @@ bool BufferList::close(Buffer * buf)
|
|||||||
// Trace back why we need to use buf->getUser here.
|
// Trace back why we need to use buf->getUser here.
|
||||||
// Perhaps slight rewrite is in order? (Lgb)
|
// Perhaps slight rewrite is in order? (Lgb)
|
||||||
|
|
||||||
if (buf->getUser())
|
if (buf->getUser())
|
||||||
buf->getUser()->insetUnlock();
|
buf->getUser()->insetUnlock();
|
||||||
|
|
||||||
if (buf->paragraph && !buf->isLyxClean() && !quitting) {
|
if (buf->paragraph && !buf->isLyxClean() && !quitting) {
|
||||||
@ -301,7 +301,7 @@ void BufferList::emergencyWriteAll()
|
|||||||
void BufferList::emergencyWrite(Buffer * buf)
|
void BufferList::emergencyWrite(Buffer * buf)
|
||||||
{
|
{
|
||||||
// assert(buf) // this is not good since C assert takes an int
|
// assert(buf) // this is not good since C assert takes an int
|
||||||
// and a pointer is a long (JMarc)
|
// and a pointer is a long (JMarc)
|
||||||
assert(buf != 0); // use c assert to avoid a loop
|
assert(buf != 0); // use c assert to avoid a loop
|
||||||
|
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
|
|||||||
if (LyXVC::file_not_found_hook(s)) {
|
if (LyXVC::file_not_found_hook(s)) {
|
||||||
// Ask if the file should be checked out for
|
// Ask if the file should be checked out for
|
||||||
// viewing/editing, if so: load it.
|
// viewing/editing, if so: load it.
|
||||||
if (Alert::askQuestion(_("Do you want to retrieve file under version control?"))) {
|
if (Alert::askQuestion(_("Do you want to retrieve file under version control?"))) {
|
||||||
// How can we know _how_ to do the checkout?
|
// How can we know _how_ to do the checkout?
|
||||||
// With the current VC support it has to be,
|
// With the current VC support it has to be,
|
||||||
// a RCS file since CVS do not have special ,v files.
|
// a RCS file since CVS do not have special ,v files.
|
||||||
|
@ -87,7 +87,7 @@ private:
|
|||||||
class BufferList : boost::noncopyable {
|
class BufferList : boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
BufferList();
|
BufferList();
|
||||||
|
|
||||||
/// state info
|
/// state info
|
||||||
enum list_state {
|
enum list_state {
|
||||||
@ -115,7 +115,7 @@ public:
|
|||||||
bool empty() const;
|
bool empty() const;
|
||||||
|
|
||||||
///
|
///
|
||||||
bool qwriteAll();
|
bool qwriteAll();
|
||||||
|
|
||||||
/// Close all open buffers.
|
/// Close all open buffers.
|
||||||
void closeAll();
|
void closeAll();
|
||||||
|
@ -74,8 +74,8 @@ void BufferParams::writeFile(ostream & os) const
|
|||||||
// The top of the file is written by the buffer.
|
// The top of the file is written by the buffer.
|
||||||
// Prints out the buffer info into the .lyx file given by file
|
// Prints out the buffer info into the .lyx file given by file
|
||||||
|
|
||||||
// the textclass
|
// the textclass
|
||||||
os << "\\textclass " << textclasslist[textclass].name() << '\n';
|
os << "\\textclass " << textclasslist[textclass].name() << '\n';
|
||||||
|
|
||||||
// then the the preamble
|
// then the the preamble
|
||||||
if (!preamble.empty()) {
|
if (!preamble.empty()) {
|
||||||
@ -113,31 +113,31 @@ void BufferParams::writeFile(ostream & os) const
|
|||||||
<< "\n\\use_numerical_citations " << use_numerical_citations
|
<< "\n\\use_numerical_citations " << use_numerical_citations
|
||||||
<< "\n\\paperorientation " << string_orientation[orientation]
|
<< "\n\\paperorientation " << string_orientation[orientation]
|
||||||
<< '\n';
|
<< '\n';
|
||||||
if (!paperwidth.empty())
|
if (!paperwidth.empty())
|
||||||
os << "\\paperwidth "
|
os << "\\paperwidth "
|
||||||
<< VSpace(paperwidth).asLyXCommand() << '\n';
|
<< VSpace(paperwidth).asLyXCommand() << '\n';
|
||||||
if (!paperheight.empty())
|
if (!paperheight.empty())
|
||||||
os << "\\paperheight "
|
os << "\\paperheight "
|
||||||
<< VSpace(paperheight).asLyXCommand() << '\n';
|
<< VSpace(paperheight).asLyXCommand() << '\n';
|
||||||
if (!leftmargin.empty())
|
if (!leftmargin.empty())
|
||||||
os << "\\leftmargin "
|
os << "\\leftmargin "
|
||||||
<< VSpace(leftmargin).asLyXCommand() << '\n';
|
<< VSpace(leftmargin).asLyXCommand() << '\n';
|
||||||
if (!topmargin.empty())
|
if (!topmargin.empty())
|
||||||
os << "\\topmargin "
|
os << "\\topmargin "
|
||||||
<< VSpace(topmargin).asLyXCommand() << '\n';
|
<< VSpace(topmargin).asLyXCommand() << '\n';
|
||||||
if (!rightmargin.empty())
|
if (!rightmargin.empty())
|
||||||
os << "\\rightmargin "
|
os << "\\rightmargin "
|
||||||
<< VSpace(rightmargin).asLyXCommand() << '\n';
|
<< VSpace(rightmargin).asLyXCommand() << '\n';
|
||||||
if (!bottommargin.empty())
|
if (!bottommargin.empty())
|
||||||
os << "\\bottommargin "
|
os << "\\bottommargin "
|
||||||
<< VSpace(bottommargin).asLyXCommand() << '\n';
|
<< VSpace(bottommargin).asLyXCommand() << '\n';
|
||||||
if (!headheight.empty())
|
if (!headheight.empty())
|
||||||
os << "\\headheight "
|
os << "\\headheight "
|
||||||
<< VSpace(headheight).asLyXCommand() << '\n';
|
<< VSpace(headheight).asLyXCommand() << '\n';
|
||||||
if (!headsep.empty())
|
if (!headsep.empty())
|
||||||
os << "\\headsep "
|
os << "\\headsep "
|
||||||
<< VSpace(headsep).asLyXCommand() << '\n';
|
<< VSpace(headsep).asLyXCommand() << '\n';
|
||||||
if (!footskip.empty())
|
if (!footskip.empty())
|
||||||
os << "\\footskip "
|
os << "\\footskip "
|
||||||
<< VSpace(footskip).asLyXCommand() << '\n';
|
<< VSpace(footskip).asLyXCommand() << '\n';
|
||||||
os << "\\secnumdepth " << secnumdepth
|
os << "\\secnumdepth " << secnumdepth
|
||||||
|
@ -130,7 +130,7 @@ public:
|
|||||||
/** Wether paragraphs are separated by using a indent like in
|
/** Wether paragraphs are separated by using a indent like in
|
||||||
articles or by using a little skip like in letters.
|
articles or by using a little skip like in letters.
|
||||||
*/
|
*/
|
||||||
PARSEP paragraph_separation;
|
PARSEP paragraph_separation;
|
||||||
///
|
///
|
||||||
InsetQuotes::quote_language quotes_language;
|
InsetQuotes::quote_language quotes_language;
|
||||||
///
|
///
|
||||||
@ -138,7 +138,7 @@ public:
|
|||||||
///
|
///
|
||||||
string fontsize;
|
string fontsize;
|
||||||
///
|
///
|
||||||
lyx::textclass_type textclass;
|
lyx::textclass_type textclass;
|
||||||
|
|
||||||
/* this are for the PaperLayout */
|
/* this are for the PaperLayout */
|
||||||
/// the general papersize (papersize2 or paperpackage
|
/// the general papersize (papersize2 or paperpackage
|
||||||
|
@ -259,7 +259,7 @@ enum kb_action {
|
|||||||
LFUN_LOFVIEW, // 230 // Dekel 20000519
|
LFUN_LOFVIEW, // 230 // Dekel 20000519
|
||||||
LFUN_LOTVIEW, // Dekel 20000519
|
LFUN_LOTVIEW, // Dekel 20000519
|
||||||
LFUN_LOAVIEW, // Dekel 20000519
|
LFUN_LOAVIEW, // Dekel 20000519
|
||||||
LFUN_SET_COLOR, // SLior 20000611
|
LFUN_SET_COLOR, // SLior 20000611
|
||||||
LFUN_INSET_EXTERNAL, // Alstrup 20000609
|
LFUN_INSET_EXTERNAL, // Alstrup 20000609
|
||||||
LFUN_INSET_MARGINAL, // Lgb 20000626
|
LFUN_INSET_MARGINAL, // Lgb 20000626
|
||||||
LFUN_INSET_MINIPAGE, // Lgb 20000627
|
LFUN_INSET_MINIPAGE, // Lgb 20000627
|
||||||
|
@ -72,7 +72,7 @@ bool Format::isChildFormat() const
|
|||||||
{
|
{
|
||||||
if (name_.empty())
|
if (name_.empty())
|
||||||
return false;
|
return false;
|
||||||
return isdigit(name_[name_.length() - 1]);
|
return isdigit(name_[name_.length() - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ bool Formats::view(Buffer const * buffer, string const & filename,
|
|||||||
if (buffer->params.orientation
|
if (buffer->params.orientation
|
||||||
== BufferParams::ORIENTATION_LANDSCAPE)
|
== BufferParams::ORIENTATION_LANDSCAPE)
|
||||||
command += 'r';
|
command += 'r';
|
||||||
}
|
}
|
||||||
|
|
||||||
command += " " + QuoteName(OnlyFilename((filename)));
|
command += " " + QuoteName(OnlyFilename((filename)));
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ bool operator<(Format const & a, Format const & b)
|
|||||||
///
|
///
|
||||||
class Formats {
|
class Formats {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
typedef std::vector<Format> FormatList;
|
typedef std::vector<Format> FormatList;
|
||||||
///
|
///
|
||||||
typedef FormatList::const_iterator const_iterator;
|
typedef FormatList::const_iterator const_iterator;
|
||||||
///
|
///
|
||||||
@ -176,7 +176,7 @@ public:
|
|||||||
///
|
///
|
||||||
class Converters {
|
class Converters {
|
||||||
public:
|
public:
|
||||||
typedef std::vector<Converter> ConverterList;
|
typedef std::vector<Converter> ConverterList;
|
||||||
///
|
///
|
||||||
typedef ConverterList::const_iterator const_iterator;
|
typedef ConverterList::const_iterator const_iterator;
|
||||||
///
|
///
|
||||||
|
@ -275,7 +275,7 @@ unsigned char Encodings::TransformChar(unsigned char c,
|
|||||||
|
|
||||||
Encoding const * Encodings::getEncoding(string const & encoding) const
|
Encoding const * Encodings::getEncoding(string const & encoding) const
|
||||||
{
|
{
|
||||||
EncodingList::const_iterator it = encodinglist.find(encoding);
|
EncodingList::const_iterator it = encodinglist.find(encoding);
|
||||||
if (it != encodinglist.end())
|
if (it != encodinglist.end())
|
||||||
return &it->second;
|
return &it->second;
|
||||||
else
|
else
|
||||||
|
@ -126,7 +126,7 @@ int lyxfont::width(char const * s, size_t n, LyXFont const & f)
|
|||||||
Uchar c = encoding->ucs(s[i]);
|
Uchar c = encoding->ucs(s[i]);
|
||||||
xs[i].byte1 = c >> 8;
|
xs[i].byte1 = c >> 8;
|
||||||
xs[i].byte2 = c & 0xff;
|
xs[i].byte2 = c & 0xff;
|
||||||
}
|
}
|
||||||
int result = width(xs.get(), n, font);
|
int result = width(xs.get(), n, font);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
|
|
||||||
|
* most files: ws cleanup
|
||||||
|
|
||||||
* Makefile.am: remove ld -r stuff
|
* Makefile.am: remove ld -r stuff
|
||||||
|
|
||||||
2002-03-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
2002-03-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
|
@ -444,11 +444,11 @@ void GCacheItem::convertToDisplayFormat()
|
|||||||
// ones that may be declared in texmf/tex/latex/config/graphics.cfg.
|
// ones that may be declared in texmf/tex/latex/config/graphics.cfg.
|
||||||
// for example:
|
// for example:
|
||||||
/* -----------snip-------------
|
/* -----------snip-------------
|
||||||
{\DeclareGraphicsRule{.pz}{eps}{.bb}{}%
|
{\DeclareGraphicsRule{.pz}{eps}{.bb}{}%
|
||||||
\DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}%
|
\DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}%
|
||||||
\DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}%
|
\DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}%
|
||||||
\DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}%
|
\DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}%
|
||||||
\DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{}}}%
|
\DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{}}}%
|
||||||
-----------snip-------------*/
|
-----------snip-------------*/
|
||||||
|
|
||||||
lyxerr[Debug::GRAPHICS]
|
lyxerr[Debug::GRAPHICS]
|
||||||
@ -635,7 +635,7 @@ ModifiedItemPtr ModifiedItem::changeDisplay()
|
|||||||
// Loop over the list of insets. Compare the updated params for each
|
// Loop over the list of insets. Compare the updated params for each
|
||||||
// with params(). If different, move into a new list.
|
// with params(). If different, move into a new list.
|
||||||
ListType::iterator begin = insets.begin();
|
ListType::iterator begin = insets.begin();
|
||||||
ListType::iterator end = insets.end();
|
ListType::iterator end = insets.end();
|
||||||
ListType::iterator it =
|
ListType::iterator it =
|
||||||
std::remove_if(begin, end, Params_Changed(params()));
|
std::remove_if(begin, end, Params_Changed(params()));
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ ConvProcess::ConvProcess(string const & script_file,
|
|||||||
Forkedcall::SignalTypePtr convert_ptr;
|
Forkedcall::SignalTypePtr convert_ptr;
|
||||||
convert_ptr.reset(new Forkedcall::SignalType);
|
convert_ptr.reset(new Forkedcall::SignalType);
|
||||||
|
|
||||||
convert_ptr->connect(SigC::slot(this, &ConvProcess::converted));
|
convert_ptr->connect(SigC::slot(this, &ConvProcess::converted));
|
||||||
|
|
||||||
Forkedcall call;
|
Forkedcall call;
|
||||||
int retval = call.startscript(script_command, convert_ptr);
|
int retval = call.startscript(script_command, convert_ptr);
|
||||||
|
@ -57,4 +57,3 @@ GImage::getScaledDimensions(GParams const & params) const
|
|||||||
return std::make_pair(width, height);
|
return std::make_pair(width, height);
|
||||||
}
|
}
|
||||||
} // namespace grfx
|
} // namespace grfx
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ char * clone_c_string(char const * in)
|
|||||||
if (!in)
|
if (!in)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Don't forget the '\0'
|
// Don't forget the '\0'
|
||||||
char * out = static_cast<char *>(malloc(strlen(in) + 1));
|
char * out = static_cast<char *>(malloc(strlen(in) + 1));
|
||||||
return strcpy(out, in);
|
return strcpy(out, in);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public:
|
|||||||
#if 0
|
#if 0
|
||||||
///
|
///
|
||||||
static
|
static
|
||||||
bool IsImportable(string const & format);
|
bool IsImportable(string const & format);
|
||||||
#endif
|
#endif
|
||||||
///
|
///
|
||||||
static
|
static
|
||||||
|
@ -103,7 +103,7 @@ void Languages::read(string const & filename)
|
|||||||
|
|
||||||
Language const * Languages::getLanguage(string const & language) const
|
Language const * Languages::getLanguage(string const & language) const
|
||||||
{
|
{
|
||||||
const_iterator it = languagelist.find(language);
|
const_iterator it = languagelist.find(language);
|
||||||
if (it != languagelist.end())
|
if (it != languagelist.end())
|
||||||
return &it->second;
|
return &it->second;
|
||||||
else
|
else
|
||||||
|
@ -99,12 +99,12 @@ public:
|
|||||||
}
|
}
|
||||||
///
|
///
|
||||||
const_iterator begin() const {
|
const_iterator begin() const {
|
||||||
return languagelist.begin();
|
return languagelist.begin();
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
const_iterator end() const {
|
const_iterator end() const {
|
||||||
return languagelist.end();
|
return languagelist.end();
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -103,6 +103,6 @@ private:
|
|||||||
/** Used by the constructor to set the number of stored last files.
|
/** Used by the constructor to set the number of stored last files.
|
||||||
@param num the number of lastfiles to set.
|
@param num the number of lastfiles to set.
|
||||||
*/
|
*/
|
||||||
void setNumberOfFiles(unsigned int num);
|
void setNumberOfFiles(unsigned int num);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -265,7 +265,7 @@ void AutoSave(BufferView * bv)
|
|||||||
bv->owner()->message(_("Autosaving current document..."));
|
bv->owner()->message(_("Autosaving current document..."));
|
||||||
|
|
||||||
// create autosave filename
|
// create autosave filename
|
||||||
string fname = bv->buffer()->filePath();
|
string fname = bv->buffer()->filePath();
|
||||||
fname += "#";
|
fname += "#";
|
||||||
fname += OnlyFilename(bv->buffer()->fileName());
|
fname += OnlyFilename(bv->buffer()->fileName());
|
||||||
fname += "#";
|
fname += "#";
|
||||||
@ -371,7 +371,7 @@ void InsertAsciiFile(BufferView * bv, string const & f, bool asParagraph)
|
|||||||
bv->getLyXText()->insertStringAsParagraphs(bv, tmpstr);
|
bv->getLyXText()->insertStringAsParagraphs(bv, tmpstr);
|
||||||
if (flag)
|
if (flag)
|
||||||
bv->update(bv->text,
|
bv->update(bv->text,
|
||||||
BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ void MenuInsertLabel(BufferView * bv, string const & arg)
|
|||||||
par_text = split(par_text, head, ' ');
|
par_text = split(par_text, head, ' ');
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
text += '-'; // Is it legal to use spaces in
|
text += '-'; // Is it legal to use spaces in
|
||||||
// labels ?
|
// labels ?
|
||||||
text += head;
|
text += head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,4 +37,3 @@ void MenuInsertLabel(BufferView * bv, string const & arg);
|
|||||||
///
|
///
|
||||||
void Reconfigure(BufferView * bv);
|
void Reconfigure(BufferView * bv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
|
|||||||
// It appears that, in xforms >=0.89.5, fl_initialize()
|
// It appears that, in xforms >=0.89.5, fl_initialize()
|
||||||
// calls setlocale() and ruins our LC_NUMERIC setting.
|
// calls setlocale() and ruins our LC_NUMERIC setting.
|
||||||
locale_init();
|
locale_init();
|
||||||
fl_get_app_resources(res, num_res);
|
fl_get_app_resources(res, num_res);
|
||||||
|
|
||||||
static const int geometryBitmask =
|
static const int geometryBitmask =
|
||||||
XParseGeometry(geometry,
|
XParseGeometry(geometry,
|
||||||
@ -133,7 +133,7 @@ LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
|
|||||||
// A width less than 590 pops up an awkward main window
|
// A width less than 590 pops up an awkward main window
|
||||||
// The minimal values of width/height (590/400) are defined in
|
// The minimal values of width/height (590/400) are defined in
|
||||||
// src/lyx.C
|
// src/lyx.C
|
||||||
if (width < 590) width = 590;
|
if (width < 590) width = 590;
|
||||||
if (height < 400) height = 400;
|
if (height < 400) height = 400;
|
||||||
|
|
||||||
// If width is not set by geometry, check it against monitor width
|
// If width is not set by geometry, check it against monitor width
|
||||||
@ -168,8 +168,8 @@ LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
|
|||||||
// A destructor is always necessary (asierra-970604)
|
// A destructor is always necessary (asierra-970604)
|
||||||
LyXGUI::~LyXGUI()
|
LyXGUI::~LyXGUI()
|
||||||
{
|
{
|
||||||
// Lyxserver was created in this class so should be destroyed
|
// Lyxserver was created in this class so should be destroyed
|
||||||
// here. asierra-970604
|
// here. asierra-970604
|
||||||
delete lyxserver;
|
delete lyxserver;
|
||||||
lyxserver = 0;
|
lyxserver = 0;
|
||||||
delete lyxViews;
|
delete lyxViews;
|
||||||
@ -196,22 +196,22 @@ void LyXGUI::init()
|
|||||||
if (lyxrc.popup_font_encoding.empty())
|
if (lyxrc.popup_font_encoding.empty())
|
||||||
lyxrc.popup_font_encoding = lyxrc.font_norm;
|
lyxrc.popup_font_encoding = lyxrc.font_norm;
|
||||||
// Set the font name for popups and menus
|
// Set the font name for popups and menus
|
||||||
string boldfontname = lyxrc.popup_bold_font
|
string boldfontname = lyxrc.popup_bold_font
|
||||||
+ "-*-*-*-?-*-*-*-*-"
|
+ "-*-*-*-?-*-*-*-*-"
|
||||||
+ lyxrc.popup_font_encoding;
|
+ lyxrc.popup_font_encoding;
|
||||||
// "?" means "scale that font"
|
// "?" means "scale that font"
|
||||||
string fontname = lyxrc.popup_normal_font
|
string fontname = lyxrc.popup_normal_font
|
||||||
+ "-*-*-*-?-*-*-*-*-"
|
+ "-*-*-*-?-*-*-*-*-"
|
||||||
+ lyxrc.popup_font_encoding;
|
+ lyxrc.popup_font_encoding;
|
||||||
|
|
||||||
int bold = fl_set_font_name(FL_BOLD_STYLE, boldfontname.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());
|
int normal = fl_set_font_name(FL_NORMAL_STYLE, fontname.c_str());
|
||||||
if (bold < 0)
|
if (bold < 0)
|
||||||
lyxerr << "Could not set menu font to "
|
lyxerr << "Could not set menu font to "
|
||||||
<< boldfontname << endl;
|
<< boldfontname << endl;
|
||||||
|
|
||||||
if (normal < 0)
|
if (normal < 0)
|
||||||
lyxerr << "Could not set popup font to "
|
lyxerr << "Could not set popup font to "
|
||||||
<< fontname << endl;
|
<< fontname << endl;
|
||||||
|
|
||||||
if (bold < 0 && normal < 0) {
|
if (bold < 0 && normal < 0) {
|
||||||
@ -232,13 +232,13 @@ void LyXGUI::init()
|
|||||||
else if (normal < 0)
|
else if (normal < 0)
|
||||||
fl_set_font_name(FL_NORMAL_STYLE, boldfontname.c_str());
|
fl_set_font_name(FL_NORMAL_STYLE, boldfontname.c_str());
|
||||||
|
|
||||||
// put here (after fl_initialize) to avoid segfault. Cannot be done
|
// put here (after fl_initialize) to avoid segfault. Cannot be done
|
||||||
// in setDefaults() (Matthias 140496)
|
// in setDefaults() (Matthias 140496)
|
||||||
// Moved from ::LyXGUI to ::init to allow popup font customization
|
// Moved from ::LyXGUI to ::init to allow popup font customization
|
||||||
// (petr 120997).
|
// (petr 120997).
|
||||||
fl_setpup_fontstyle(FL_NORMAL_STYLE);
|
fl_setpup_fontstyle(FL_NORMAL_STYLE);
|
||||||
fl_setpup_fontsize(FL_NORMAL_SIZE);
|
fl_setpup_fontsize(FL_NORMAL_SIZE);
|
||||||
fl_setpup_color(FL_MCOL, FL_BLACK);
|
fl_setpup_color(FL_MCOL, FL_BLACK);
|
||||||
fl_set_goodies_font(FL_NORMAL_STYLE, FL_NORMAL_SIZE);
|
fl_set_goodies_font(FL_NORMAL_STYLE, FL_NORMAL_SIZE);
|
||||||
#if FL_REVISION < 89
|
#if FL_REVISION < 89
|
||||||
fl_set_oneliner_font(FL_NORMAL_STYLE, FL_NORMAL_SIZE);
|
fl_set_oneliner_font(FL_NORMAL_STYLE, FL_NORMAL_SIZE);
|
||||||
|
@ -303,7 +303,7 @@ void LyX::init(bool gui)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool followlink;
|
bool followlink;
|
||||||
do {
|
do {
|
||||||
// Path of binary/../share/name of binary/
|
// Path of binary/../share/name of binary/
|
||||||
searchpath += NormalizePath(AddPath(binpath, "../share/") +
|
searchpath += NormalizePath(AddPath(binpath, "../share/") +
|
||||||
@ -447,11 +447,11 @@ void LyX::init(bool gui)
|
|||||||
if (!gui)
|
if (!gui)
|
||||||
lyxrc.use_gui = false;
|
lyxrc.use_gui = false;
|
||||||
|
|
||||||
// Calculate screen dpi as average of x-DPI and y-DPI:
|
// Calculate screen dpi as average of x-DPI and y-DPI:
|
||||||
if (lyxrc.use_gui) {
|
if (lyxrc.use_gui) {
|
||||||
lyxrc.dpi = GUIRunTime::getScreenDPI();
|
lyxrc.dpi = GUIRunTime::getScreenDPI();
|
||||||
lyxerr[Debug::INIT] << "DPI setting detected to be "
|
lyxerr[Debug::INIT] << "DPI setting detected to be "
|
||||||
<< lyxrc.dpi + 0.5 << endl;
|
<< lyxrc.dpi + 0.5 << endl;
|
||||||
} else {
|
} else {
|
||||||
lyxrc.dpi = 1; // I hope this is safe
|
lyxrc.dpi = 1; // I hope this is safe
|
||||||
}
|
}
|
||||||
@ -570,7 +570,7 @@ void LyX::defaultKeyBindings(kb_keymap * kbmap)
|
|||||||
kbmap->bind("KP_Prior", LFUN_PRIOR);
|
kbmap->bind("KP_Prior", LFUN_PRIOR);
|
||||||
kbmap->bind("KP_Next", LFUN_NEXT);
|
kbmap->bind("KP_Next", LFUN_NEXT);
|
||||||
|
|
||||||
kbmap->bind("C-Tab", LFUN_TABINSERT); // ale970515
|
kbmap->bind("C-Tab", LFUN_TABINSERT); // ale970515
|
||||||
kbmap->bind("S-Tab", LFUN_SHIFT_TAB); // jug20000522
|
kbmap->bind("S-Tab", LFUN_SHIFT_TAB); // jug20000522
|
||||||
kbmap->bind("S-ISO_Left_Tab", LFUN_SHIFT_TAB); // jbl 2001-23-02
|
kbmap->bind("S-ISO_Left_Tab", LFUN_SHIFT_TAB); // jbl 2001-23-02
|
||||||
}
|
}
|
||||||
@ -668,17 +668,17 @@ bool LyX::readRcFile(string const & name)
|
|||||||
|
|
||||||
string const lyxrc_path = LibFileSearch(string(), name);
|
string const lyxrc_path = LibFileSearch(string(), name);
|
||||||
if (!lyxrc_path.empty()) {
|
if (!lyxrc_path.empty()) {
|
||||||
lyxerr[Debug::INIT] << "Found " << name
|
lyxerr[Debug::INIT] << "Found " << name
|
||||||
<< " in " << lyxrc_path << endl;
|
<< " in " << lyxrc_path << endl;
|
||||||
if (lyxrc.read(lyxrc_path) < 0) {
|
if (lyxrc.read(lyxrc_path) < 0) {
|
||||||
Alert::alert(_("LyX Warning!"),
|
Alert::alert(_("LyX Warning!"),
|
||||||
_("Error while reading ") + lyxrc_path + ".",
|
_("Error while reading ") + lyxrc_path + ".",
|
||||||
_("Using built-in defaults."));
|
_("Using built-in defaults."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
lyxerr[Debug::INIT] << "Could not find " << name << endl;
|
lyxerr[Debug::INIT] << "Could not find " << name << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -704,7 +704,7 @@ void LyX::readUIFile(string const & name)
|
|||||||
string const ui_path = LibFileSearch("ui", name, "ui");
|
string const ui_path = LibFileSearch("ui", name, "ui");
|
||||||
|
|
||||||
if (ui_path.empty()) {
|
if (ui_path.empty()) {
|
||||||
lyxerr[Debug::INIT] << "Could not find " << name << endl;
|
lyxerr[Debug::INIT] << "Could not find " << name << endl;
|
||||||
menubackend.defaults();
|
menubackend.defaults();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -791,9 +791,9 @@ void commandLineHelp()
|
|||||||
"\t-userdir dir try to set user directory to dir\n"
|
"\t-userdir dir try to set user directory to dir\n"
|
||||||
"\t-sysdir dir try to set system directory to dir\n"
|
"\t-sysdir dir try to set system directory to dir\n"
|
||||||
"\t-geometry WxH+X+Y set geometry of the main window\n"
|
"\t-geometry WxH+X+Y set geometry of the main window\n"
|
||||||
"\t-dbg feature[,feature]...\n"
|
"\t-dbg feature[,feature]...\n"
|
||||||
" select the features to debug.\n"
|
" select the features to debug.\n"
|
||||||
" Type `lyx -dbg' to see the list of features\n"
|
" Type `lyx -dbg' to see the list of features\n"
|
||||||
"\t-x [--execute] command\n"
|
"\t-x [--execute] command\n"
|
||||||
" where command is a lyx command.\n"
|
" where command is a lyx command.\n"
|
||||||
"\t-e [--export] fmt\n"
|
"\t-e [--export] fmt\n"
|
||||||
|
@ -77,14 +77,14 @@ private:
|
|||||||
/** Search for and read the LyXRC file name, return
|
/** Search for and read the LyXRC file name, return
|
||||||
true if successfull.
|
true if successfull.
|
||||||
*/
|
*/
|
||||||
bool readRcFile(string const & name);
|
bool readRcFile(string const & name);
|
||||||
/// Read the ui file `name'
|
/// Read the ui file `name'
|
||||||
void readUIFile(string const & name);
|
void readUIFile(string const & name);
|
||||||
/// Read the languages file `name'
|
/// Read the languages file `name'
|
||||||
void readLanguagesFile(string const & name);
|
void readLanguagesFile(string const & name);
|
||||||
/// Read the encodings file `name'
|
/// Read the encodings file `name'
|
||||||
void readEncodingsFile(string const & name);
|
void readEncodingsFile(string const & name);
|
||||||
///
|
///
|
||||||
bool easyParse(int * argc, char * argv[]);
|
bool easyParse(int * argc, char * argv[]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,28 +52,28 @@ string const quotesinglbase_def =
|
|||||||
"}";
|
"}";
|
||||||
|
|
||||||
string const guillemotleft_def =
|
string const guillemotleft_def =
|
||||||
"\\ProvideTextCommandDefault{\\guillemotleft}{%\n"
|
"\\ProvideTextCommandDefault{\\guillemotleft}{%\n"
|
||||||
" {\\usefont{U}{lasy}{m}{n}\\char'50\\kern-.15em\\char'50}%\n"
|
" {\\usefont{U}{lasy}{m}{n}\\char'50\\kern-.15em\\char'50}%\n"
|
||||||
"\\penalty10000\\hskip0pt\\relax%\n"
|
"\\penalty10000\\hskip0pt\\relax%\n"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
string const guillemotright_def =
|
string const guillemotright_def =
|
||||||
"\\ProvideTextCommandDefault{\\guillemotright}{%\n"
|
"\\ProvideTextCommandDefault{\\guillemotright}{%\n"
|
||||||
" \\penalty10000\\hskip0pt%\n"
|
" \\penalty10000\\hskip0pt%\n"
|
||||||
" {\\usefont{U}{lasy}{m}{n}\\char'51\\kern-.15em\\char'51}%\n"
|
" {\\usefont{U}{lasy}{m}{n}\\char'51\\kern-.15em\\char'51}%\n"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
string const guilsinglleft_def =
|
string const guilsinglleft_def =
|
||||||
"\\ProvideTextCommandDefault{\\guilsinglleft}{%\n"
|
"\\ProvideTextCommandDefault{\\guilsinglleft}{%\n"
|
||||||
" {\\usefont{U}{lasy}{m}{n}\\char'50}%\n"
|
" {\\usefont{U}{lasy}{m}{n}\\char'50}%\n"
|
||||||
" \\penalty10000\\hskip0pt\\relax%\n"
|
" \\penalty10000\\hskip0pt\\relax%\n"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
string const guilsinglright_def =
|
string const guilsinglright_def =
|
||||||
"\\ProvideTextCommandDefault{\\guilsinglright}{%\n"
|
"\\ProvideTextCommandDefault{\\guilsinglright}{%\n"
|
||||||
" \\penalty10000\\hskip0pt%\n"
|
" \\penalty10000\\hskip0pt%\n"
|
||||||
" {\\usefont{U}{lasy}{m}{n}\\char'51}%\n"
|
" {\\usefont{U}{lasy}{m}{n}\\char'51}%\n"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
string const paragraphindent_def =
|
string const paragraphindent_def =
|
||||||
"\\newenvironment{LyXParagraphIndent}[1]%\n"
|
"\\newenvironment{LyXParagraphIndent}[1]%\n"
|
||||||
@ -81,10 +81,10 @@ string const paragraphindent_def =
|
|||||||
" \\begin{list}{}{%\n"
|
" \\begin{list}{}{%\n"
|
||||||
" \\setlength\\topsep{0pt}%\n"
|
" \\setlength\\topsep{0pt}%\n"
|
||||||
" \\addtolength{\\leftmargin}{#1}\n"
|
" \\addtolength{\\leftmargin}{#1}\n"
|
||||||
// "%% \\addtolength{\\leftmargin}{#1\\textwidth}\n"
|
// "%% \\addtolength{\\leftmargin}{#1\\textwidth}\n"
|
||||||
// "%% \\setlength{\\textwidth}{#2\\textwidth}\n"
|
// "%% \\setlength{\\textwidth}{#2\\textwidth}\n"
|
||||||
// "%% \\setlength\\listparindent\\parindent%\n"
|
// "%% \\setlength\\listparindent\\parindent%\n"
|
||||||
// "%% \\setlength\\itemindent\\parindent%\n"
|
// "%% \\setlength\\itemindent\\parindent%\n"
|
||||||
" \\setlength\\parsep{0pt plus 1pt}%\n"
|
" \\setlength\\parsep{0pt plus 1pt}%\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" \\item[]\n"
|
" \\item[]\n"
|
||||||
@ -125,5 +125,3 @@ string const binom_def =
|
|||||||
string const mathcircumflex_def =
|
string const mathcircumflex_def =
|
||||||
"%% For printing a cirumflex inside a formula\n"
|
"%% For printing a cirumflex inside a formula\n"
|
||||||
"\\newcommand{\\mathcircumflex}[0]{\\mbox{\\^{}}}\n";
|
"\\newcommand{\\mathcircumflex}[0]{\\mbox{\\^{}}}\n";
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,21 +33,21 @@ enum SearchResult {
|
|||||||
|
|
||||||
/// returns true if the specified string is at the specified position
|
/// returns true if the specified string is at the specified position
|
||||||
bool IsStringInText(Paragraph * par, pos_type pos,
|
bool IsStringInText(Paragraph * par, pos_type pos,
|
||||||
string const & str, bool const & = true,
|
string const & str, bool const & = true,
|
||||||
bool const & = false);
|
bool const & = false);
|
||||||
|
|
||||||
/// if the string is found: return true and set the cursor to the new position
|
/// if the string is found: return true and set the cursor to the new position
|
||||||
SearchResult SearchForward(BufferView *, LyXText * text, string const & str,
|
SearchResult SearchForward(BufferView *, LyXText * text, string const & str,
|
||||||
bool const & = true, bool const & = false);
|
bool const & = true, bool const & = false);
|
||||||
///
|
///
|
||||||
SearchResult SearchBackward(BufferView *, LyXText * text, string const & str,
|
SearchResult SearchBackward(BufferView *, LyXText * text, string const & str,
|
||||||
bool const & = true, bool const & = false);
|
bool const & = true, bool const & = false);
|
||||||
|
|
||||||
|
|
||||||
int LyXReplace(BufferView * bv,
|
int LyXReplace(BufferView * bv,
|
||||||
string const & searchstr, string const & replacestr,
|
string const & searchstr, string const & replacestr,
|
||||||
bool forward, bool casesens, bool matchwrd, bool replaceall,
|
bool forward, bool casesens, bool matchwrd, bool replaceall,
|
||||||
bool once)
|
bool once)
|
||||||
{
|
{
|
||||||
if (!bv->available() || bv->buffer()->isReadonly())
|
if (!bv->available() || bv->buffer()->isReadonly())
|
||||||
return 0;
|
return 0;
|
||||||
@ -58,7 +58,7 @@ int LyXReplace(BufferView * bv,
|
|||||||
|| (searchstr.length() == 1 && searchstr[0] == ' '))
|
|| (searchstr.length() == 1 && searchstr[0] == ' '))
|
||||||
{
|
{
|
||||||
Alert::alert(_("Sorry!"), _("You cannot replace a single space, "
|
Alert::alert(_("Sorry!"), _("You cannot replace a single space, "
|
||||||
"nor an empty character."));
|
"nor an empty character."));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,8 +118,8 @@ int LyXReplace(BufferView * bv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool LyXFind(BufferView * bv,
|
bool LyXFind(BufferView * bv,
|
||||||
string const & searchstr, bool forward,
|
string const & searchstr, bool forward,
|
||||||
bool frominset, bool casesens, bool matchwrd)
|
bool frominset, bool casesens, bool matchwrd)
|
||||||
{
|
{
|
||||||
if (!bv->available() || searchstr.empty())
|
if (!bv->available() || searchstr.empty())
|
||||||
return false;
|
return false;
|
||||||
@ -199,7 +199,7 @@ bool IsStringInText(Paragraph * par, pos_type pos,
|
|||||||
while (((pos + i) < par->size())
|
while (((pos + i) < par->size())
|
||||||
&& (string::size_type(i) < size)
|
&& (string::size_type(i) < size)
|
||||||
&& (cs ? (str[i] == par->getChar(pos + i))
|
&& (cs ? (str[i] == par->getChar(pos + i))
|
||||||
: (uppercase(str[i]) == uppercase(par->getChar(pos + i)))))
|
: (uppercase(str[i]) == uppercase(par->getChar(pos + i)))))
|
||||||
{
|
{
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
@ -220,7 +220,7 @@ bool IsStringInText(Paragraph * par, pos_type pos,
|
|||||||
// if the string can be found: return true and set the cursor to
|
// if the string can be found: return true and set the cursor to
|
||||||
// the new position, cs = casesensitive, mw = matchword
|
// the new position, cs = casesensitive, mw = matchword
|
||||||
SearchResult SearchForward(BufferView * bv, LyXText * text, string const & str,
|
SearchResult SearchForward(BufferView * bv, LyXText * text, string const & str,
|
||||||
bool const & cs, bool const & mw)
|
bool const & cs, bool const & mw)
|
||||||
{
|
{
|
||||||
Paragraph * par = text->cursor.par();
|
Paragraph * par = text->cursor.par();
|
||||||
pos_type pos = text->cursor.pos();
|
pos_type pos = text->cursor.pos();
|
||||||
@ -265,8 +265,8 @@ SearchResult SearchForward(BufferView * bv, LyXText * text, string const & str,
|
|||||||
// if the string can be found: return true and set the cursor to
|
// if the string can be found: return true and set the cursor to
|
||||||
// the new position, cs = casesensitive, mw = matchword
|
// the new position, cs = casesensitive, mw = matchword
|
||||||
SearchResult SearchBackward(BufferView * bv, LyXText * text,
|
SearchResult SearchBackward(BufferView * bv, LyXText * text,
|
||||||
string const & str,
|
string const & str,
|
||||||
bool const & cs, bool const & mw)
|
bool const & cs, bool const & mw)
|
||||||
{
|
{
|
||||||
Paragraph * par = text->cursor.par();
|
Paragraph * par = text->cursor.par();
|
||||||
pos_type pos = text->cursor.pos();
|
pos_type pos = text->cursor.pos();
|
||||||
@ -307,4 +307,3 @@ SearchResult SearchBackward(BufferView * bv, LyXText * text,
|
|||||||
return SR_NOT_FOUND;
|
return SR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,11 +12,11 @@
|
|||||||
class BufferView;
|
class BufferView;
|
||||||
|
|
||||||
int LyXReplace(BufferView * bv, string const &, string const &,
|
int LyXReplace(BufferView * bv, string const &, string const &,
|
||||||
bool, bool = true, bool = false,
|
bool, bool = true, bool = false,
|
||||||
bool = false, bool = false);
|
bool = false, bool = false);
|
||||||
|
|
||||||
bool LyXFind(BufferView *,
|
bool LyXFind(BufferView *,
|
||||||
string const & searchstr, bool forward,
|
string const & searchstr, bool forward,
|
||||||
bool frominset = false, bool casesens = true,
|
bool frominset = false, bool casesens = true,
|
||||||
bool matchwrd = false);
|
bool matchwrd = false);
|
||||||
|
|
||||||
|
@ -740,7 +740,7 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
|
|||||||
/// Writes the changes from this font to orgfont in .lyx format in file
|
/// Writes the changes from this font to orgfont in .lyx format in file
|
||||||
void LyXFont::lyxWriteChanges(LyXFont const & orgfont,
|
void LyXFont::lyxWriteChanges(LyXFont const & orgfont,
|
||||||
#ifdef INHERIT_LANGUAGE
|
#ifdef INHERIT_LANGUAGE
|
||||||
Language const * doclang,
|
Language const * doclang,
|
||||||
#endif
|
#endif
|
||||||
ostream & os) const
|
ostream & os) const
|
||||||
{
|
{
|
||||||
@ -904,7 +904,7 @@ int LyXFont::latexWriteStartChanges(ostream & os, LyXFont const & base,
|
|||||||
// Returns number of chars written
|
// Returns number of chars written
|
||||||
// This one corresponds to latexWriteStartChanges(). (Asger)
|
// This one corresponds to latexWriteStartChanges(). (Asger)
|
||||||
int LyXFont::latexWriteEndChanges(ostream & os, LyXFont const & base,
|
int LyXFont::latexWriteEndChanges(ostream & os, LyXFont const & base,
|
||||||
LyXFont const & next) const
|
LyXFont const & next) const
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
bool env = false;
|
bool env = false;
|
||||||
|
@ -208,7 +208,7 @@ public:
|
|||||||
///
|
///
|
||||||
LColor::color color() const;
|
LColor::color color() const;
|
||||||
|
|
||||||
///
|
///
|
||||||
Language const * language() const;
|
Language const * language() const;
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -238,7 +238,7 @@ public:
|
|||||||
LyXFont & setNumber(LyXFont::FONT_MISC_STATE n);
|
LyXFont & setNumber(LyXFont::FONT_MISC_STATE n);
|
||||||
///
|
///
|
||||||
LyXFont & setColor(LColor::color c);
|
LyXFont & setColor(LColor::color c);
|
||||||
///
|
///
|
||||||
LyXFont & setLanguage(Language const * l);
|
LyXFont & setLanguage(Language const * l);
|
||||||
|
|
||||||
/// Set family after LyX text format
|
/// Set family after LyX text format
|
||||||
@ -296,7 +296,7 @@ public:
|
|||||||
void lyxWriteChanges(LyXFont const & orgfont, std::ostream &) const;
|
void lyxWriteChanges(LyXFont const & orgfont, std::ostream &) const;
|
||||||
#else
|
#else
|
||||||
void lyxWriteChanges(LyXFont const & orgfont, Language const * doclang,
|
void lyxWriteChanges(LyXFont const & orgfont, Language const * doclang,
|
||||||
std::ostream &) const;
|
std::ostream &) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Writes the head of the LaTeX needed to change to this font.
|
/** Writes the head of the LaTeX needed to change to this font.
|
||||||
|
@ -387,8 +387,8 @@ FuncStatus LyXFunc::getStatus(kb_action action,
|
|||||||
|
|
||||||
// I would really like to avoid having this switch and rather try to
|
// I would really like to avoid having this switch and rather try to
|
||||||
// encode this in the function itself.
|
// encode this in the function itself.
|
||||||
bool disable = false;
|
bool disable = false;
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case LFUN_MENUPRINT:
|
case LFUN_MENUPRINT:
|
||||||
disable = !Exporter::IsExportable(buf, "dvi")
|
disable = !Exporter::IsExportable(buf, "dvi")
|
||||||
|| lyxrc.print_command == "none";
|
|| lyxrc.print_command == "none";
|
||||||
@ -479,10 +479,10 @@ FuncStatus LyXFunc::getStatus(kb_action action,
|
|||||||
|
|
||||||
case LFUN_INSET_TOGGLE: {
|
case LFUN_INSET_TOGGLE: {
|
||||||
LyXText * lt = owner->view()->getLyXText();
|
LyXText * lt = owner->view()->getLyXText();
|
||||||
disable = !(isEditableInset(lt->getInset())
|
disable = !(isEditableInset(lt->getInset())
|
||||||
|| (lt->inset_owner
|
|| (lt->inset_owner
|
||||||
&& lt->inset_owner->owner()
|
&& lt->inset_owner->owner()
|
||||||
&& lt->inset_owner->owner()->isOpen()));
|
&& lt->inset_owner->owner()->isOpen()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LFUN_MATH_VALIGN:
|
case LFUN_MATH_VALIGN:
|
||||||
@ -808,7 +808,7 @@ void LyXFunc::verboseDispatch(kb_action action,
|
|||||||
// the pseudoaction is useful for the bindings
|
// the pseudoaction is useful for the bindings
|
||||||
pseudoaction =
|
pseudoaction =
|
||||||
lyxaction.searchActionArg(action,
|
lyxaction.searchActionArg(action,
|
||||||
argument);
|
argument);
|
||||||
|
|
||||||
if (pseudoaction == LFUN_UNKNOWN_ACTION) {
|
if (pseudoaction == LFUN_UNKNOWN_ACTION) {
|
||||||
pseudoaction = action;
|
pseudoaction = action;
|
||||||
@ -832,7 +832,7 @@ void LyXFunc::verboseDispatch(kb_action action,
|
|||||||
commandshortcut = "(" + comname + ')';
|
commandshortcut = "(" + comname + ')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.empty()) {
|
if (res.empty()) {
|
||||||
if (!commandshortcut.empty()) {
|
if (!commandshortcut.empty()) {
|
||||||
@ -849,8 +849,8 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
|||||||
lyxerr[Debug::ACTION] << "LyXFunc::Dispatch: action[" << action
|
lyxerr[Debug::ACTION] << "LyXFunc::Dispatch: action[" << action
|
||||||
<<"] arg[" << argument << "]" << endl;
|
<<"] arg[" << argument << "]" << endl;
|
||||||
|
|
||||||
// we have not done anything wrong yet.
|
// we have not done anything wrong yet.
|
||||||
errorstat = false;
|
errorstat = false;
|
||||||
dispatch_buffer.erase();
|
dispatch_buffer.erase();
|
||||||
|
|
||||||
#ifdef NEW_DISPATCHER
|
#ifdef NEW_DISPATCHER
|
||||||
@ -893,9 +893,9 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
|||||||
goto exit_with_message;
|
goto exit_with_message;
|
||||||
} else if (((result=owner->view()->theLockingInset()->
|
} else if (((result=owner->view()->theLockingInset()->
|
||||||
// Hand-over to inset's own dispatch:
|
// Hand-over to inset's own dispatch:
|
||||||
localDispatch(owner->view(), action, argument)) ==
|
localDispatch(owner->view(), action, argument)) ==
|
||||||
UpdatableInset::DISPATCHED) ||
|
UpdatableInset::DISPATCHED) ||
|
||||||
(result == UpdatableInset::DISPATCHED_NOUPDATE))
|
(result == UpdatableInset::DISPATCHED_NOUPDATE))
|
||||||
goto exit_with_message;
|
goto exit_with_message;
|
||||||
// If UNDISPATCHED, just soldier on
|
// If UNDISPATCHED, just soldier on
|
||||||
else if (result == UpdatableInset::FINISHED) {
|
else if (result == UpdatableInset::FINISHED) {
|
||||||
@ -1107,7 +1107,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
|||||||
Exporter::Export(owner->buffer(), "program", true);
|
Exporter::Export(owner->buffer(), "program", true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_RUNCHKTEX:
|
case LFUN_RUNCHKTEX:
|
||||||
MenuRunChktex(owner->buffer());
|
MenuRunChktex(owner->buffer());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1222,7 +1222,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
|||||||
owner->getDialogs()->showTexinfo();
|
owner->getDialogs()->showTexinfo();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_HELP_OPEN:
|
case LFUN_HELP_OPEN:
|
||||||
{
|
{
|
||||||
string const arg = argument;
|
string const arg = argument;
|
||||||
if (arg.empty()) {
|
if (arg.empty()) {
|
||||||
@ -1244,7 +1244,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
|||||||
owner->view()->buffer(bufferlist.loadLyXFile(fname, false));
|
owner->view()->buffer(bufferlist.loadLyXFile(fname, false));
|
||||||
owner->allowInput();
|
owner->allowInput();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- version control -------------------------------
|
// --- version control -------------------------------
|
||||||
case LFUN_VC_REGISTER:
|
case LFUN_VC_REGISTER:
|
||||||
@ -1290,8 +1290,8 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
|||||||
|
|
||||||
// --- buffers ----------------------------------------
|
// --- buffers ----------------------------------------
|
||||||
|
|
||||||
case LFUN_SWITCHBUFFER:
|
case LFUN_SWITCHBUFFER:
|
||||||
owner->view()->buffer(bufferlist.getBuffer(argument));
|
owner->view()->buffer(bufferlist.getBuffer(argument));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_FILE_NEW:
|
case LFUN_FILE_NEW:
|
||||||
@ -1383,9 +1383,9 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
|||||||
|
|
||||||
// Either change buffer or load the file
|
// Either change buffer or load the file
|
||||||
if (bufferlist.exists(s)) {
|
if (bufferlist.exists(s)) {
|
||||||
owner->view()->buffer(bufferlist.getBuffer(s));
|
owner->view()->buffer(bufferlist.getBuffer(s));
|
||||||
} else {
|
} else {
|
||||||
owner->view()->buffer(bufferlist.loadLyXFile(s));
|
owner->view()->buffer(bufferlist.loadLyXFile(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the cursor
|
// Set the cursor
|
||||||
@ -1796,7 +1796,7 @@ void LyXFunc::menuNew(bool fromTemplate)
|
|||||||
|
|
||||||
if (fname.empty())
|
if (fname.empty())
|
||||||
return;
|
return;
|
||||||
templname = fname;
|
templname = fname;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find a free buffer
|
// find a free buffer
|
||||||
@ -2057,4 +2057,3 @@ void LyXFunc::initMiniBuffer()
|
|||||||
|
|
||||||
owner->message(text);
|
owner->message(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,18 +64,18 @@ public:
|
|||||||
/// The last key was meta
|
/// The last key was meta
|
||||||
bool wasMetaKey() const;
|
bool wasMetaKey() const;
|
||||||
|
|
||||||
/// True if lyxfunc reports an error
|
/// True if lyxfunc reports an error
|
||||||
bool errorStat() const { return errorstat; }
|
bool errorStat() const { return errorstat; }
|
||||||
/// Buffer to store result messages
|
/// Buffer to store result messages
|
||||||
void setMessage(string const & m) const;
|
void setMessage(string const & m) const;
|
||||||
/// Buffer to store result messages
|
/// Buffer to store result messages
|
||||||
void setErrorMessage(string const &) const;
|
void setErrorMessage(string const &) const;
|
||||||
/// Buffer to store result messages from getStatus
|
/// Buffer to store result messages from getStatus
|
||||||
void setStatusMessage(string const &) const;
|
void setStatusMessage(string const &) const;
|
||||||
/// Buffer to store result messages
|
/// Buffer to store result messages
|
||||||
string const getMessage() const { return dispatch_buffer; }
|
string const getMessage() const { return dispatch_buffer; }
|
||||||
/// Buffer to store result messages
|
/// Buffer to store result messages
|
||||||
string const getStatusMessage() const { return status_buffer; }
|
string const getStatusMessage() const { return status_buffer; }
|
||||||
/// Handle a accented char keysequenze
|
/// Handle a accented char keysequenze
|
||||||
void handleKeyFunc(kb_action action);
|
void handleKeyFunc(kb_action action);
|
||||||
|
|
||||||
@ -84,30 +84,30 @@ private:
|
|||||||
LyXView * owner;
|
LyXView * owner;
|
||||||
///
|
///
|
||||||
static int psd_idx;
|
static int psd_idx;
|
||||||
///
|
///
|
||||||
kb_sequence keyseq;
|
kb_sequence keyseq;
|
||||||
///
|
///
|
||||||
kb_sequence cancel_meta_seq;
|
kb_sequence cancel_meta_seq;
|
||||||
///
|
///
|
||||||
unsigned meta_fake_bit;
|
unsigned meta_fake_bit;
|
||||||
///
|
///
|
||||||
void moveCursorUpdate(bool flag = true, bool selecting = false);
|
void moveCursorUpdate(bool flag = true, bool selecting = false);
|
||||||
///
|
///
|
||||||
void setupLocalKeymap();
|
void setupLocalKeymap();
|
||||||
///
|
///
|
||||||
kb_action lyx_dead_action;
|
kb_action lyx_dead_action;
|
||||||
///
|
///
|
||||||
kb_action lyx_calling_dead_action;
|
kb_action lyx_calling_dead_action;
|
||||||
/// Error status, only Dispatch can change this flag
|
/// Error status, only Dispatch can change this flag
|
||||||
mutable bool errorstat;
|
mutable bool errorstat;
|
||||||
|
|
||||||
/** Buffer to store messages and result data. Is there a
|
/** Buffer to store messages and result data. Is there a
|
||||||
good reason to have this one as static in Dispatch? (Ale)
|
good reason to have this one as static in Dispatch? (Ale)
|
||||||
*/
|
*/
|
||||||
mutable string dispatch_buffer;
|
mutable string dispatch_buffer;
|
||||||
/** Buffer to store messages and result data from getStatus
|
/** Buffer to store messages and result data from getStatus
|
||||||
*/
|
*/
|
||||||
mutable string status_buffer;
|
mutable string status_buffer;
|
||||||
/// Command name and shortcut information
|
/// Command name and shortcut information
|
||||||
string commandshortcut;
|
string commandshortcut;
|
||||||
|
|
||||||
|
@ -139,8 +139,8 @@ LyXLength const & LyXGlueLength::minus() const
|
|||||||
bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2)
|
bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2)
|
||||||
{
|
{
|
||||||
return l1.len() == l2.len()
|
return l1.len() == l2.len()
|
||||||
&& l1.plus() == l2.plus()
|
&& l1.plus() == l2.plus()
|
||||||
&& l1.minus() == l2.minus();
|
&& l1.minus() == l2.minus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/* This file is part of
|
/* This file is part of
|
||||||
* ======================================================
|
* ======================================================
|
||||||
*
|
*
|
||||||
@ -72,7 +71,7 @@ enum LayoutTags {
|
|||||||
LT_RIGHTMARGIN,
|
LT_RIGHTMARGIN,
|
||||||
LT_SPACING,
|
LT_SPACING,
|
||||||
LT_TOPSEP,
|
LT_TOPSEP,
|
||||||
LT_INTITLE
|
LT_INTITLE
|
||||||
};
|
};
|
||||||
|
|
||||||
/////////////////////
|
/////////////////////
|
||||||
@ -120,27 +119,27 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
{ "bottomsep", LT_BOTTOMSEP },
|
{ "bottomsep", LT_BOTTOMSEP },
|
||||||
{ "copystyle", LT_COPYSTYLE },
|
{ "copystyle", LT_COPYSTYLE },
|
||||||
{ "end", LT_END },
|
{ "end", LT_END },
|
||||||
{ "endlabelstring", LT_ENDLABELSTRING },
|
{ "endlabelstring", LT_ENDLABELSTRING },
|
||||||
{ "endlabeltype", LT_ENDLABELTYPE },
|
{ "endlabeltype", LT_ENDLABELTYPE },
|
||||||
{ "fill_bottom", LT_FILL_BOTTOM },
|
{ "fill_bottom", LT_FILL_BOTTOM },
|
||||||
{ "fill_top", LT_FILL_TOP },
|
{ "fill_top", LT_FILL_TOP },
|
||||||
{ "font", LT_FONT },
|
{ "font", LT_FONT },
|
||||||
{ "freespacing", LT_FREE_SPACING },
|
{ "freespacing", LT_FREE_SPACING },
|
||||||
{ "intitle", LT_INTITLE },
|
{ "intitle", LT_INTITLE },
|
||||||
{ "itemsep", LT_ITEMSEP },
|
{ "itemsep", LT_ITEMSEP },
|
||||||
{ "keepempty", LT_KEEPEMPTY },
|
{ "keepempty", LT_KEEPEMPTY },
|
||||||
{ "labelbottomsep", LT_LABEL_BOTTOMSEP },
|
{ "labelbottomsep", LT_LABEL_BOTTOMSEP },
|
||||||
{ "labelfont", LT_LABELFONT },
|
{ "labelfont", LT_LABELFONT },
|
||||||
{ "labelindent", LT_LABELINDENT },
|
{ "labelindent", LT_LABELINDENT },
|
||||||
{ "labelsep", LT_LABELSEP },
|
{ "labelsep", LT_LABELSEP },
|
||||||
{ "labelstring", LT_LABELSTRING },
|
{ "labelstring", LT_LABELSTRING },
|
||||||
{ "labelstringappendix", LT_LABELSTRING_APPENDIX },
|
{ "labelstringappendix", LT_LABELSTRING_APPENDIX },
|
||||||
{ "labeltype", LT_LABELTYPE },
|
{ "labeltype", LT_LABELTYPE },
|
||||||
{ "latexname", LT_LATEXNAME },
|
{ "latexname", LT_LATEXNAME },
|
||||||
{ "latexparam", LT_LATEXPARAM },
|
{ "latexparam", LT_LATEXPARAM },
|
||||||
{ "latextype", LT_LATEXTYPE },
|
{ "latextype", LT_LATEXTYPE },
|
||||||
{ "leftmargin", LT_LEFTMARGIN },
|
{ "leftmargin", LT_LEFTMARGIN },
|
||||||
{ "margin", LT_MARGIN },
|
{ "margin", LT_MARGIN },
|
||||||
{ "needprotect", LT_NEED_PROTECT },
|
{ "needprotect", LT_NEED_PROTECT },
|
||||||
{ "newline", LT_NEWLINE },
|
{ "newline", LT_NEWLINE },
|
||||||
{ "nextnoindent", LT_NEXTNOINDENT },
|
{ "nextnoindent", LT_NEXTNOINDENT },
|
||||||
@ -148,7 +147,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
{ "parindent", LT_PARINDENT },
|
{ "parindent", LT_PARINDENT },
|
||||||
{ "parsep", LT_PARSEP },
|
{ "parsep", LT_PARSEP },
|
||||||
{ "parskip", LT_PARSKIP },
|
{ "parskip", LT_PARSKIP },
|
||||||
{ "passthru", LT_PASS_THRU },
|
{ "passthru", LT_PASS_THRU },
|
||||||
{ "preamble", LT_PREAMBLE },
|
{ "preamble", LT_PREAMBLE },
|
||||||
{ "rightmargin", LT_RIGHTMARGIN },
|
{ "rightmargin", LT_RIGHTMARGIN },
|
||||||
{ "spacing", LT_SPACING },
|
{ "spacing", LT_SPACING },
|
||||||
@ -179,7 +178,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_COPYSTYLE: // initialize with a known style
|
case LT_COPYSTYLE: // initialize with a known style
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string const style = lexrc.getString();
|
string const style = lexrc.getString();
|
||||||
|
|
||||||
if (tclass.hasLayout(style)) {
|
if (tclass.hasLayout(style)) {
|
||||||
@ -202,7 +201,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_OBSOLETEDBY: // replace with a known style
|
case LT_OBSOLETEDBY: // replace with a known style
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string const style = lexrc.getString();
|
string const style = lexrc.getString();
|
||||||
|
|
||||||
if (tclass.hasLayout(style)) {
|
if (tclass.hasLayout(style)) {
|
||||||
@ -262,8 +261,8 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LATEXNAME:
|
case LT_LATEXNAME:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
latexname_ = lexrc.getString();
|
latexname_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LATEXPARAM:
|
case LT_LATEXPARAM:
|
||||||
@ -284,7 +283,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LEFTMARGIN: // left margin type
|
case LT_LEFTMARGIN: // left margin type
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
leftmargin = lexrc.getString();
|
leftmargin = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -210,4 +210,3 @@ bool operator!=(LyXLength const & l1, LyXLength const & l2)
|
|||||||
{
|
{
|
||||||
return !(l1 == l2);
|
return !(l1 == l2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ string const LyXLex::getLongString(string const & endtoken)
|
|||||||
|
|
||||||
// We do a case independent comparison, like search_kw
|
// We do a case independent comparison, like search_kw
|
||||||
// does.
|
// does.
|
||||||
if (compare_no_case(token, endtoken) != 0) {
|
if (compare_no_case(token, endtoken) != 0) {
|
||||||
string tmpstr = getString();
|
string tmpstr = getString();
|
||||||
if (firstline) {
|
if (firstline) {
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
@ -187,7 +187,7 @@ string const LyXLex::getLongString(string const & endtoken)
|
|||||||
tmpstr.erase(0, prefix.length() - 1);
|
tmpstr.erase(0, prefix.length() - 1);
|
||||||
}
|
}
|
||||||
str += frontStrip(tmpstr, "\t") + '\n';
|
str += frontStrip(tmpstr, "\t") + '\n';
|
||||||
}
|
}
|
||||||
else // token == endtoken
|
else // token == endtoken
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ void InitLyXLookup(Display * display, Window window)
|
|||||||
// This part could be done before opening display
|
// This part could be done before opening display
|
||||||
string oldlocale = setlocale(LC_CTYPE, 0);
|
string oldlocale = setlocale(LC_CTYPE, 0);
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
if (!XSupportsLocale()) {
|
if (!XSupportsLocale()) {
|
||||||
lyxerr[Debug::KEY]
|
lyxerr[Debug::KEY]
|
||||||
<< "InitLyXLookup: X does not support this locale."
|
<< "InitLyXLookup: X does not support this locale."
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -191,7 +191,7 @@ int LyXLookupString(XEvent * event,
|
|||||||
if (XFilterEvent (event, None)) {
|
if (XFilterEvent (event, None)) {
|
||||||
lyxerr[Debug::KEY] <<"XFilterEvent" << endl;
|
lyxerr[Debug::KEY] <<"XFilterEvent" << endl;
|
||||||
*keysym_return = NoSymbol;
|
*keysym_return = NoSymbol;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Status status_return = 0;
|
Status status_return = 0;
|
||||||
@ -282,4 +282,3 @@ void CloseLyXLookup()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAVE_XOPENIM
|
#endif // HAVE_XOPENIM
|
||||||
|
|
||||||
|
58
src/lyxrc.C
58
src/lyxrc.C
@ -105,8 +105,8 @@ keyword_item lyxrcTags[] = {
|
|||||||
{ "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
|
{ "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
|
||||||
{ "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
|
{ "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
|
||||||
{ "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
|
{ "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
|
||||||
{ "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
|
{ "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
|
||||||
{ "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
|
{ "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
|
||||||
{ "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
|
{ "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
|
||||||
{ "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
|
{ "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
|
||||||
{ "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
|
{ "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
|
||||||
@ -315,7 +315,7 @@ int LyXRC::read(string const & filename)
|
|||||||
}
|
}
|
||||||
switch (static_cast<LyXRCTags>(le)) {
|
switch (static_cast<LyXRCTags>(le)) {
|
||||||
case RC_INPUT: // Include file
|
case RC_INPUT: // Include file
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string const tmp =
|
string const tmp =
|
||||||
LibFileSearch(string(),
|
LibFileSearch(string(),
|
||||||
lexrc.getString());
|
lexrc.getString());
|
||||||
@ -483,12 +483,12 @@ int LyXRC::read(string const & filename)
|
|||||||
print_spool_printerprefix = lexrc.getString();
|
print_spool_printerprefix = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTPAPERDIMENSIONFLAG:
|
case RC_PRINTPAPERDIMENSIONFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_paper_dimension_flag = lexrc.getString();
|
print_paper_dimension_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTPAPERFLAG:
|
case RC_PRINTPAPERFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_paper_flag = lexrc.getString();
|
print_paper_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
@ -504,29 +504,29 @@ int LyXRC::read(string const & filename)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_DEFAULT_PAPERSIZE:
|
case RC_DEFAULT_PAPERSIZE:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string const size =
|
string const size =
|
||||||
lowercase(lexrc.getString());
|
lowercase(lexrc.getString());
|
||||||
if (size == "usletter")
|
if (size == "usletter")
|
||||||
default_papersize =
|
default_papersize =
|
||||||
BufferParams::PAPER_USLETTER;
|
BufferParams::PAPER_USLETTER;
|
||||||
else if (size == "legal")
|
else if (size == "legal")
|
||||||
default_papersize =
|
default_papersize =
|
||||||
BufferParams::PAPER_LEGALPAPER;
|
BufferParams::PAPER_LEGALPAPER;
|
||||||
else if (size == "executive")
|
else if (size == "executive")
|
||||||
default_papersize =
|
default_papersize =
|
||||||
BufferParams::PAPER_EXECUTIVEPAPER;
|
BufferParams::PAPER_EXECUTIVEPAPER;
|
||||||
else if (size == "a3")
|
else if (size == "a3")
|
||||||
default_papersize =
|
default_papersize =
|
||||||
BufferParams::PAPER_A3PAPER;
|
BufferParams::PAPER_A3PAPER;
|
||||||
else if (size == "a4")
|
else if (size == "a4")
|
||||||
default_papersize =
|
default_papersize =
|
||||||
BufferParams::PAPER_A4PAPER;
|
BufferParams::PAPER_A4PAPER;
|
||||||
else if (size == "a5")
|
else if (size == "a5")
|
||||||
default_papersize =
|
default_papersize =
|
||||||
BufferParams::PAPER_A5PAPER;
|
BufferParams::PAPER_A5PAPER;
|
||||||
else if (size == "b5")
|
else if (size == "b5")
|
||||||
default_papersize =
|
default_papersize =
|
||||||
BufferParams::PAPER_B5PAPER;
|
BufferParams::PAPER_B5PAPER;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -596,9 +596,9 @@ int LyXRC::read(string const & filename)
|
|||||||
lexrc.getFloat();
|
lexrc.getFloat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_SCALABLE:
|
case RC_SCREEN_FONT_SCALABLE:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
use_scalable_fonts = lexrc.getBool();
|
use_scalable_fonts = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_AUTOSAVE:
|
case RC_AUTOSAVE:
|
||||||
@ -632,14 +632,14 @@ int LyXRC::read(string const & filename)
|
|||||||
lastfiles = ExpandPath(lexrc.getString());
|
lastfiles = ExpandPath(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_NUMLASTFILES:
|
case RC_NUMLASTFILES:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
num_lastfiles = lexrc.getInteger();
|
num_lastfiles = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_CHECKLASTFILES:
|
case RC_CHECKLASTFILES:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
check_lastfiles = lexrc.getBool();
|
check_lastfiles = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_ROMAN:
|
case RC_SCREEN_FONT_ROMAN:
|
||||||
@ -705,8 +705,8 @@ int LyXRC::read(string const & filename)
|
|||||||
}
|
}
|
||||||
case RC_AUTOREGIONDELETE:
|
case RC_AUTOREGIONDELETE:
|
||||||
// Auto region delete defaults to true
|
// Auto region delete defaults to true
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
auto_region_delete = lexrc.getBool();
|
auto_region_delete = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_BIND:
|
case RC_BIND:
|
||||||
@ -777,7 +777,7 @@ int LyXRC::read(string const & filename)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_ASCIIROFF_COMMAND:
|
case RC_ASCIIROFF_COMMAND:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
ascii_roff_command = lexrc.getString();
|
ascii_roff_command = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_ASCII_LINELEN:
|
case RC_ASCII_LINELEN:
|
||||||
@ -828,8 +828,8 @@ int LyXRC::read(string const & filename)
|
|||||||
isp_esc_chars = lexrc.getString();
|
isp_esc_chars = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_MAKE_BACKUP:
|
case RC_MAKE_BACKUP:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
make_backup = lexrc.getBool();
|
make_backup = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_BACKUPDIR_PATH:
|
case RC_BACKUPDIR_PATH:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
@ -1713,7 +1713,7 @@ string const LyXRC::getDescription(LyXRCTags tag)
|
|||||||
str = N_("The option to print out in landscape.");
|
str = N_("The option to print out in landscape.");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTPAPERFLAG:
|
case RC_PRINTPAPERFLAG:
|
||||||
str = N_("The option to specify paper type.");
|
str = N_("The option to specify paper type.");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
12
src/lyxrc.h
12
src/lyxrc.h
@ -44,7 +44,7 @@ enum LyXRCTags {
|
|||||||
RC_PRINTEXSTRAOPTIONS,
|
RC_PRINTEXSTRAOPTIONS,
|
||||||
RC_PRINTSPOOL_COMMAND,
|
RC_PRINTSPOOL_COMMAND,
|
||||||
RC_PRINTSPOOL_PRINTERPREFIX,
|
RC_PRINTSPOOL_PRINTERPREFIX,
|
||||||
RC_PRINTPAPERFLAG,
|
RC_PRINTPAPERFLAG,
|
||||||
RC_PRINTPAPERDIMENSIONFLAG,
|
RC_PRINTPAPERDIMENSIONFLAG,
|
||||||
RC_CUSTOM_EXPORT_COMMAND,
|
RC_CUSTOM_EXPORT_COMMAND,
|
||||||
RC_CUSTOM_EXPORT_FORMAT,
|
RC_CUSTOM_EXPORT_FORMAT,
|
||||||
@ -139,7 +139,7 @@ enum LyXRCTags {
|
|||||||
///
|
///
|
||||||
void write(string const & filename) const;
|
void write(string const & filename) const;
|
||||||
///
|
///
|
||||||
void print() const;
|
void print() const;
|
||||||
///
|
///
|
||||||
void output(std::ostream & os) const;
|
void output(std::ostream & os) const;
|
||||||
///
|
///
|
||||||
@ -178,14 +178,14 @@ enum LyXRCTags {
|
|||||||
string print_extra_options;
|
string print_extra_options;
|
||||||
///
|
///
|
||||||
string print_spool_command;
|
string print_spool_command;
|
||||||
///
|
///
|
||||||
string print_spool_printerprefix;
|
string print_spool_printerprefix;
|
||||||
///
|
///
|
||||||
string print_paper_flag;
|
string print_paper_flag;
|
||||||
///
|
///
|
||||||
string print_paper_dimension_flag;
|
string print_paper_dimension_flag;
|
||||||
///
|
///
|
||||||
string custom_export_command;
|
string custom_export_command;
|
||||||
///
|
///
|
||||||
string custom_export_format;
|
string custom_export_format;
|
||||||
///
|
///
|
||||||
@ -194,8 +194,8 @@ enum LyXRCTags {
|
|||||||
string ps_command;
|
string ps_command;
|
||||||
/// option for telling the dvi viewer about the paper size
|
/// option for telling the dvi viewer about the paper size
|
||||||
string view_dvi_paper_option;
|
string view_dvi_paper_option;
|
||||||
/// default paper size for local xdvi/dvips/ghostview/whatever
|
/// default paper size for local xdvi/dvips/ghostview/whatever
|
||||||
BufferParams::PAPER_SIZE default_papersize;
|
BufferParams::PAPER_SIZE default_papersize;
|
||||||
/// command to run chktex incl. options
|
/// command to run chktex incl. options
|
||||||
string chktex_command;
|
string chktex_command;
|
||||||
///
|
///
|
||||||
|
@ -98,7 +98,7 @@ private:
|
|||||||
|
|
||||||
/// y1 and y2 are coordinates of the screen
|
/// y1 and y2 are coordinates of the screen
|
||||||
void drawFromTo(LyXText *, BufferView *, int y1, int y2,
|
void drawFromTo(LyXText *, BufferView *, int y1, int y2,
|
||||||
int y_offset = 0, int x_offset = 0, bool internal=false);
|
int y_offset = 0, int x_offset = 0, bool internal=false);
|
||||||
|
|
||||||
/// y is a coordinate of the text
|
/// y is a coordinate of the text
|
||||||
void drawOneRow(LyXText *, BufferView *, Row * row,
|
void drawOneRow(LyXText *, BufferView *, Row * row,
|
||||||
|
@ -10,27 +10,27 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Docu : To use the lyxserver define the name of the pipe in your
|
Docu : To use the lyxserver define the name of the pipe in your
|
||||||
lyxrc:
|
lyxrc:
|
||||||
\serverpipe "/home/myhome/.lyxpipe"
|
\serverpipe "/home/myhome/.lyxpipe"
|
||||||
Then use .lyxpipe.in and .lyxpipe.out to communicate to LyX.
|
Then use .lyxpipe.in and .lyxpipe.out to communicate to LyX.
|
||||||
Each message consists of a single line in ASCII. Input lines
|
Each message consists of a single line in ASCII. Input lines
|
||||||
(client -> LyX) have the following format:
|
(client -> LyX) have the following format:
|
||||||
"LYXCMD:<clientname>:<functionname>:<argument>"
|
"LYXCMD:<clientname>:<functionname>:<argument>"
|
||||||
Answers from LyX look like this:
|
Answers from LyX look like this:
|
||||||
"INFO:<clientname>:<functionname>:<data>"
|
"INFO:<clientname>:<functionname>:<data>"
|
||||||
[asierra970531] Or like this in case of error:
|
[asierra970531] Or like this in case of error:
|
||||||
"ERROR:<clientname>:<functionname>:<error message>"
|
"ERROR:<clientname>:<functionname>:<error message>"
|
||||||
where <clientname> and <functionname> are just echoed.
|
where <clientname> and <functionname> are just echoed.
|
||||||
If LyX notifies about a user defined extension key-sequence,
|
If LyX notifies about a user defined extension key-sequence,
|
||||||
the line looks like this:
|
the line looks like this:
|
||||||
"NOTIFY:<key-sequence>"
|
"NOTIFY:<key-sequence>"
|
||||||
[asierra970531] New server-only messages to implement a simple protocol
|
[asierra970531] New server-only messages to implement a simple protocol
|
||||||
"LYXSRV:<clientname>:<protocol message>"
|
"LYXSRV:<clientname>:<protocol message>"
|
||||||
where <protocol message> can be "hello" or "bye". If hello is
|
where <protocol message> can be "hello" or "bye". If hello is
|
||||||
received LyX will inform the client that it's listening its
|
received LyX will inform the client that it's listening its
|
||||||
messages, and 'bye' will inform that lyx is closing.
|
messages, and 'bye' will inform that lyx is closing.
|
||||||
|
|
||||||
See development/server_monitor.c for an example client.
|
See development/server_monitor.c for an example client.
|
||||||
Purpose: implement a client/server lib for LyX
|
Purpose: implement a client/server lib for LyX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ using std::endl;
|
|||||||
// lyxserver.
|
// lyxserver.
|
||||||
#ifndef HAVE_MKFIFO
|
#ifndef HAVE_MKFIFO
|
||||||
int mkfifo(char const * __path, mode_t __mode) {
|
int mkfifo(char const * __path, mode_t __mode) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -138,13 +138,13 @@ void LyXComm::openConnection()
|
|||||||
/// Close pipes
|
/// Close pipes
|
||||||
void LyXComm::closeConnection()
|
void LyXComm::closeConnection()
|
||||||
{
|
{
|
||||||
lyxerr[Debug::LYXSERVER] << "LyXComm: Closing connection" << endl;
|
lyxerr[Debug::LYXSERVER] << "LyXComm: Closing connection" << endl;
|
||||||
|
|
||||||
if (pipename.empty()) {
|
if (pipename.empty()) {
|
||||||
lyxerr[Debug::LYXSERVER]
|
lyxerr[Debug::LYXSERVER]
|
||||||
<< "LyXComm: server is disabled, nothing to do"
|
<< "LyXComm: server is disabled, nothing to do"
|
||||||
<< endl;
|
<< endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ready) {
|
if (!ready) {
|
||||||
@ -279,9 +279,9 @@ void LyXComm::callback(int fd, void *v)
|
|||||||
lyxerr << "LyXComm: Receiving from fd " << fd << endl;
|
lyxerr << "LyXComm: Receiving from fd " << fd << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int CMDBUFLEN = 100;
|
const int CMDBUFLEN = 100;
|
||||||
char charbuf[CMDBUFLEN];
|
char charbuf[CMDBUFLEN];
|
||||||
string cmd;
|
string cmd;
|
||||||
// nb! make lsbuf a class-member for multiple sessions
|
// nb! make lsbuf a class-member for multiple sessions
|
||||||
static string lsbuf;
|
static string lsbuf;
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ void LyXComm::callback(int fd, void *v)
|
|||||||
<< ", cmd:" << cmd << endl;
|
<< ", cmd:" << cmd << endl;
|
||||||
if (!cmd.empty())
|
if (!cmd.empty())
|
||||||
c->clientcb(c->client, cmd);
|
c->clientcb(c->client, cmd);
|
||||||
//\n or not \n?
|
//\n or not \n?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (errno == EAGAIN)
|
if (errno == EAGAIN)
|
||||||
@ -409,7 +409,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
|
|||||||
while (*p) {
|
while (*p) {
|
||||||
// --- 1. check 'header' ---
|
// --- 1. check 'header' ---
|
||||||
|
|
||||||
if (compare(p, "LYXSRV:", 7) == 0) {
|
if (compare(p, "LYXSRV:", 7) == 0) {
|
||||||
server_only = true;
|
server_only = true;
|
||||||
} else if (0 != compare(p, "LYXCMD:", 7)) {
|
} else if (0 != compare(p, "LYXCMD:", 7)) {
|
||||||
lyxerr << "LyXServer: Unknown request \"" << p << "\"" << endl;
|
lyxerr << "LyXServer: Unknown request \"" << p << "\"" << endl;
|
||||||
@ -519,7 +519,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
|
|||||||
buf = "ERROR:";
|
buf = "ERROR:";
|
||||||
else
|
else
|
||||||
buf = "INFO:";
|
buf = "INFO:";
|
||||||
buf += string(client) + ":" + cmd + ":" + rval + "\n";
|
buf += string(client) + ":" + cmd + ":" + rval + "\n";
|
||||||
serv->pipes.send(buf);
|
serv->pipes.send(buf);
|
||||||
|
|
||||||
// !!! we don't do any error checking -
|
// !!! we don't do any error checking -
|
||||||
@ -547,4 +547,3 @@ void LyXServer::notifyClient(string const & s)
|
|||||||
string buf = string("NOTIFY:") + s + "\n";
|
string buf = string("NOTIFY:") + s + "\n";
|
||||||
pipes.send(buf);
|
pipes.send(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,14 +111,14 @@ public:
|
|||||||
// The lyx server should not take an argument "LyXFunc" but this is
|
// The lyx server should not take an argument "LyXFunc" but this is
|
||||||
// how it will be done for 0.12. In 0.13 we must write a non-gui
|
// how it will be done for 0.12. In 0.13 we must write a non-gui
|
||||||
// bufferview.
|
// bufferview.
|
||||||
// IMO lyxserver is atypical, and for the moment the only one, non-gui
|
// IMO lyxserver is atypical, and for the moment the only one, non-gui
|
||||||
// bufferview. We just have to find a way to handle situations like if
|
// bufferview. We just have to find a way to handle situations like if
|
||||||
// lyxserver is using a buffer that is being edited with a bufferview.
|
// lyxserver is using a buffer that is being edited with a bufferview.
|
||||||
// With a common buffer list this is not a problem, maybe. (Alejandro)
|
// With a common buffer list this is not a problem, maybe. (Alejandro)
|
||||||
///
|
///
|
||||||
LyXServer(LyXFunc * f, string const & pip)
|
LyXServer(LyXFunc * f, string const & pip)
|
||||||
: numclients(0), func(f), pipes(pip, (this), callback) {}
|
: numclients(0), func(f), pipes(pip, (this), callback) {}
|
||||||
///
|
///
|
||||||
~LyXServer();
|
~LyXServer();
|
||||||
///
|
///
|
||||||
void notifyClient(string const &);
|
void notifyClient(string const &);
|
||||||
|
@ -104,9 +104,9 @@ public:
|
|||||||
LyXFont const getLabelFont(Buffer const *, Paragraph * par) const;
|
LyXFont const getLabelFont(Buffer const *, Paragraph * par) const;
|
||||||
///
|
///
|
||||||
void setCharFont(Buffer const *, Paragraph * par,
|
void setCharFont(Buffer const *, Paragraph * par,
|
||||||
lyx::pos_type pos, LyXFont const & font);
|
lyx::pos_type pos, LyXFont const & font);
|
||||||
void setCharFont(BufferView *, Paragraph * par,
|
void setCharFont(BufferView *, Paragraph * par,
|
||||||
lyx::pos_type pos, LyXFont const & font, bool toggleall);
|
lyx::pos_type pos, LyXFont const & font, bool toggleall);
|
||||||
|
|
||||||
/// what you expect when pressing <enter> at cursor position
|
/// what you expect when pressing <enter> at cursor position
|
||||||
void breakParagraph(BufferView *, char keep_layout = 0);
|
void breakParagraph(BufferView *, char keep_layout = 0);
|
||||||
@ -264,7 +264,7 @@ public:
|
|||||||
mark_ = m;
|
mark_ = m;
|
||||||
}
|
}
|
||||||
LyXCursor cursor; // temporary cursor to hold a cursor position
|
LyXCursor cursor; // temporary cursor to hold a cursor position
|
||||||
// until setSelection is called!
|
// until setSelection is called!
|
||||||
LyXCursor start; // start of a REAL selection
|
LyXCursor start; // start of a REAL selection
|
||||||
LyXCursor end; // end of a REAL selection
|
LyXCursor end; // end of a REAL selection
|
||||||
private:
|
private:
|
||||||
|
@ -135,7 +135,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
LyXLex lexrc(textClassTags, TC_RIGHTMARGIN);
|
LyXLex lexrc(textClassTags, TC_RIGHTMARGIN);
|
||||||
bool error = false;
|
bool error = false;
|
||||||
|
|
||||||
lexrc.setFile(filename);
|
lexrc.setFile(filename);
|
||||||
if (!lexrc.isOK()) error = true;
|
if (!lexrc.isOK()) error = true;
|
||||||
|
|
||||||
// parsing
|
// parsing
|
||||||
@ -157,8 +157,8 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_INPUT: // Include file
|
case TC_INPUT: // Include file
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string tmp = LibFileSearch("layouts",
|
string tmp = LibFileSearch("layouts",
|
||||||
lexrc.getString(),
|
lexrc.getString(),
|
||||||
"layout");
|
"layout");
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_PAGESTYLE:
|
case TC_PAGESTYLE:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
pagestyle_ = strip(lexrc.getString());
|
pagestyle_ = strip(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
defaultfont_.realize(LyXFont(LyXFont::ALL_SANE));
|
defaultfont_.realize(LyXFont(LyXFont::ALL_SANE));
|
||||||
#else
|
#else
|
||||||
defaultfont_.realize(LyXFont(LyXFont::ALL_SANE),
|
defaultfont_.realize(LyXFont(LyXFont::ALL_SANE),
|
||||||
default_language);
|
default_language);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -271,9 +271,9 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
// First step to support options
|
// First step to support options
|
||||||
case TC_CLASSOPTIONS:
|
case TC_CLASSOPTIONS:
|
||||||
readClassOptions(lexrc);
|
readClassOptions(lexrc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_PREAMBLE:
|
case TC_PREAMBLE:
|
||||||
preamble_ = lexrc.getLongString("EndPreamble");
|
preamble_ = lexrc.getLongString("EndPreamble");
|
||||||
@ -295,7 +295,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_LEFTMARGIN: // left margin type
|
case TC_LEFTMARGIN: // left margin type
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
leftmargin_ = lexrc.getString();
|
leftmargin_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public:
|
|||||||
|
|
||||||
/// Text that dictates how wide the right margin is on the screen
|
/// Text that dictates how wide the right margin is on the screen
|
||||||
string const & rightmargin() const;
|
string const & rightmargin() const;
|
||||||
///
|
///
|
||||||
int maxcounter() const;
|
int maxcounter() const;
|
||||||
///
|
///
|
||||||
int size() const;
|
int size() const;
|
||||||
|
@ -112,7 +112,7 @@ bool LyXTextClassList::Read ()
|
|||||||
"textclass file `" << MakeDisplayPath(real_file, 1000)
|
"textclass file `" << MakeDisplayPath(real_file, 1000)
|
||||||
<< "'\nCheck your installation. LyX can't continue."
|
<< "'\nCheck your installation. LyX can't continue."
|
||||||
<< endl;
|
<< endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
|
@ -301,16 +301,16 @@ FL_OBJECT * MiniBuffer::add(int type, FL_Coord x, FL_Coord y,
|
|||||||
FL_OBJECT * obj;
|
FL_OBJECT * obj;
|
||||||
|
|
||||||
the_buffer = obj = fl_add_input(type, x, y, w, h, text.c_str());
|
the_buffer = obj = fl_add_input(type, x, y, w, h, text.c_str());
|
||||||
fl_set_object_boxtype(obj, FL_DOWN_BOX);
|
fl_set_object_boxtype(obj, FL_DOWN_BOX);
|
||||||
fl_set_object_resize(obj, FL_RESIZE_ALL);
|
fl_set_object_resize(obj, FL_RESIZE_ALL);
|
||||||
fl_set_object_gravity(obj, SouthWestGravity, SouthEastGravity);
|
fl_set_object_gravity(obj, SouthWestGravity, SouthEastGravity);
|
||||||
fl_set_object_color(obj, FL_MCOL, FL_MCOL);
|
fl_set_object_color(obj, FL_MCOL, FL_MCOL);
|
||||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||||
|
|
||||||
// To intercept Up, Down, Table for history
|
// To intercept Up, Down, Table for history
|
||||||
fl_set_object_prehandler(obj, C_MiniBuffer_peek_event);
|
fl_set_object_prehandler(obj, C_MiniBuffer_peek_event);
|
||||||
obj->u_vdata = this;
|
obj->u_vdata = this;
|
||||||
obj->wantkey = FL_KEY_TAB;
|
obj->wantkey = FL_KEY_TAB;
|
||||||
|
|
||||||
set_input(text);
|
set_input(text);
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public:
|
|||||||
///
|
///
|
||||||
void redraw();
|
void redraw();
|
||||||
///
|
///
|
||||||
int peek_event(FL_OBJECT *, int, int);
|
int peek_event(FL_OBJECT *, int, int);
|
||||||
///
|
///
|
||||||
SigC::Signal1<void, string const &> stringReady;
|
SigC::Signal1<void, string const &> stringReady;
|
||||||
///
|
///
|
||||||
|
@ -170,8 +170,8 @@ Paragraph::~Paragraph()
|
|||||||
|
|
||||||
|
|
||||||
void Paragraph::writeFile(Buffer const * buf, ostream & os,
|
void Paragraph::writeFile(Buffer const * buf, ostream & os,
|
||||||
BufferParams const & bparams,
|
BufferParams const & bparams,
|
||||||
depth_type dth) const
|
depth_type dth) const
|
||||||
{
|
{
|
||||||
// The beginning or end of a deeper (i.e. nested) area?
|
// The beginning or end of a deeper (i.e. nested) area?
|
||||||
if (dth != params().depth()) {
|
if (dth != params().depth()) {
|
||||||
@ -502,7 +502,7 @@ void Paragraph::insertChar(pos_type pos, Paragraph::value_type c)
|
|||||||
|
|
||||||
|
|
||||||
void Paragraph::insertChar(pos_type pos, Paragraph::value_type c,
|
void Paragraph::insertChar(pos_type pos, Paragraph::value_type c,
|
||||||
LyXFont const & font)
|
LyXFont const & font)
|
||||||
{
|
{
|
||||||
pimpl_->insertChar(pos, c, font);
|
pimpl_->insertChar(pos, c, font);
|
||||||
}
|
}
|
||||||
@ -588,7 +588,7 @@ Inset const * Paragraph::getInset(pos_type pos) const
|
|||||||
|
|
||||||
// Gets uninstantiated font setting at position.
|
// Gets uninstantiated font setting at position.
|
||||||
LyXFont const Paragraph::getFontSettings(BufferParams const & bparams,
|
LyXFont const Paragraph::getFontSettings(BufferParams const & bparams,
|
||||||
pos_type pos) const
|
pos_type pos) const
|
||||||
{
|
{
|
||||||
lyx::Assert(pos <= size());
|
lyx::Assert(pos <= size());
|
||||||
|
|
||||||
@ -1239,9 +1239,9 @@ int Paragraph::getPositionOfInset(Inset const * inset) const
|
|||||||
|
|
||||||
|
|
||||||
Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
|
Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
|
||||||
BufferParams const & bparams,
|
BufferParams const & bparams,
|
||||||
ostream & os, TexRow & texrow,
|
ostream & os, TexRow & texrow,
|
||||||
bool moving_arg)
|
bool moving_arg)
|
||||||
{
|
{
|
||||||
lyxerr[Debug::LATEX] << "TeXOnePar... " << this << endl;
|
lyxerr[Debug::LATEX] << "TeXOnePar... " << this << endl;
|
||||||
Inset const * in = inInset();
|
Inset const * in = inInset();
|
||||||
@ -1302,14 +1302,14 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
|
|||||||
if (language->babel() != previous_language->babel()
|
if (language->babel() != previous_language->babel()
|
||||||
// check if we already put language command in TeXEnvironment()
|
// check if we already put language command in TeXEnvironment()
|
||||||
&& !(style.isEnvironment()
|
&& !(style.isEnvironment()
|
||||||
&& (!previous() || previous()->layout() != layout() ||
|
&& (!previous() || previous()->layout() != layout() ||
|
||||||
previous()->params().depth() != params().depth())))
|
previous()->params().depth() != params().depth())))
|
||||||
{
|
{
|
||||||
if (!lyxrc.language_command_end.empty() &&
|
if (!lyxrc.language_command_end.empty() &&
|
||||||
previous_language->babel() != doc_language->babel())
|
previous_language->babel() != doc_language->babel())
|
||||||
{
|
{
|
||||||
os << subst(lyxrc.language_command_end, "$$lang",
|
os << subst(lyxrc.language_command_end, "$$lang",
|
||||||
previous_language->babel())
|
previous_language->babel())
|
||||||
<< endl;
|
<< endl;
|
||||||
texrow.newline();
|
texrow.newline();
|
||||||
}
|
}
|
||||||
@ -1318,7 +1318,7 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
|
|||||||
language->babel() != doc_language->babel())
|
language->babel() != doc_language->babel())
|
||||||
{
|
{
|
||||||
os << subst(lyxrc.language_command_begin, "$$lang",
|
os << subst(lyxrc.language_command_begin, "$$lang",
|
||||||
language->babel())
|
language->babel())
|
||||||
<< endl;
|
<< endl;
|
||||||
texrow.newline();
|
texrow.newline();
|
||||||
}
|
}
|
||||||
@ -1339,7 +1339,7 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
|
|||||||
<< style.latexparam();
|
<< style.latexparam();
|
||||||
break;
|
break;
|
||||||
case LATEX_ITEM_ENVIRONMENT:
|
case LATEX_ITEM_ENVIRONMENT:
|
||||||
if (bibkey) {
|
if (bibkey) {
|
||||||
bibkey->latex(buf, os, false, false);
|
bibkey->latex(buf, os, false, false);
|
||||||
} else
|
} else
|
||||||
os << "\\item ";
|
os << "\\item ";
|
||||||
@ -1543,9 +1543,9 @@ int Paragraph::endTeXParParams(BufferParams const & bparams,
|
|||||||
|
|
||||||
// This one spits out the text of the paragraph
|
// This one spits out the text of the paragraph
|
||||||
bool Paragraph::simpleTeXOnePar(Buffer const * buf,
|
bool Paragraph::simpleTeXOnePar(Buffer const * buf,
|
||||||
BufferParams const & bparams,
|
BufferParams const & bparams,
|
||||||
ostream & os, TexRow & texrow,
|
ostream & os, TexRow & texrow,
|
||||||
bool moving_arg)
|
bool moving_arg)
|
||||||
{
|
{
|
||||||
lyxerr[Debug::LATEX] << "SimpleTeXOnePar... " << this << endl;
|
lyxerr[Debug::LATEX] << "SimpleTeXOnePar... " << this << endl;
|
||||||
|
|
||||||
@ -1710,11 +1710,11 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
|
|||||||
if (next_) {
|
if (next_) {
|
||||||
running_font
|
running_font
|
||||||
.latexWriteEndChanges(os, basefont,
|
.latexWriteEndChanges(os, basefont,
|
||||||
next_->getFont(bparams,
|
next_->getFont(bparams,
|
||||||
0));
|
0));
|
||||||
} else {
|
} else {
|
||||||
running_font.latexWriteEndChanges(os, basefont,
|
running_font.latexWriteEndChanges(os, basefont,
|
||||||
basefont);
|
basefont);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef WITH_WARNINGS
|
#ifdef WITH_WARNINGS
|
||||||
@ -1922,7 +1922,7 @@ bool Paragraph::isLineSeparator(pos_type pos) const
|
|||||||
value_type const c = getChar(pos);
|
value_type const c = getChar(pos);
|
||||||
return IsLineSeparatorChar(c)
|
return IsLineSeparatorChar(c)
|
||||||
|| (IsInsetChar(c) && getInset(pos) &&
|
|| (IsInsetChar(c) && getInset(pos) &&
|
||||||
getInset(pos)->isLineSeparator());
|
getInset(pos)->isLineSeparator());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ public:
|
|||||||
void setFont(lyx::pos_type pos, LyXFont const & font);
|
void setFont(lyx::pos_type pos, LyXFont const & font);
|
||||||
/// Returns the height of the highest font in range
|
/// Returns the height of the highest font in range
|
||||||
LyXFont::FONT_SIZE highestFontInRange(lyx::pos_type startpos,
|
LyXFont::FONT_SIZE highestFontInRange(lyx::pos_type startpos,
|
||||||
lyx::pos_type endpos,
|
lyx::pos_type endpos,
|
||||||
LyXFont::FONT_SIZE const def_size) const;
|
LyXFont::FONT_SIZE const def_size) const;
|
||||||
///
|
///
|
||||||
void insertChar(lyx::pos_type pos, value_type c);
|
void insertChar(lyx::pos_type pos, value_type c);
|
||||||
|
@ -108,7 +108,7 @@ void Paragraph::Pimpl::setChar(pos_type pos, value_type c)
|
|||||||
|
|
||||||
|
|
||||||
void Paragraph::Pimpl::insertChar(pos_type pos, value_type c,
|
void Paragraph::Pimpl::insertChar(pos_type pos, value_type c,
|
||||||
LyXFont const & font)
|
LyXFont const & font)
|
||||||
{
|
{
|
||||||
lyx::Assert(pos <= size());
|
lyx::Assert(pos <= size());
|
||||||
|
|
||||||
@ -117,8 +117,8 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c,
|
|||||||
// Update the font table.
|
// Update the font table.
|
||||||
FontTable search_font(pos, LyXFont());
|
FontTable search_font(pos, LyXFont());
|
||||||
for (FontList::iterator it = lower_bound(fontlist.begin(),
|
for (FontList::iterator it = lower_bound(fontlist.begin(),
|
||||||
fontlist.end(),
|
fontlist.end(),
|
||||||
search_font, matchFT());
|
search_font, matchFT());
|
||||||
it != fontlist.end(); ++it)
|
it != fontlist.end(); ++it)
|
||||||
{
|
{
|
||||||
it->pos(it->pos() + 1);
|
it->pos(it->pos() + 1);
|
||||||
@ -127,8 +127,8 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c,
|
|||||||
// Update the inset table.
|
// Update the inset table.
|
||||||
InsetTable search_inset(pos, 0);
|
InsetTable search_inset(pos, 0);
|
||||||
for (InsetList::iterator it = lower_bound(owner_->insetlist.begin(),
|
for (InsetList::iterator it = lower_bound(owner_->insetlist.begin(),
|
||||||
owner_->insetlist.end(),
|
owner_->insetlist.end(),
|
||||||
search_inset, matchIT());
|
search_inset, matchIT());
|
||||||
it != owner_->insetlist.end(); ++it)
|
it != owner_->insetlist.end(); ++it)
|
||||||
{
|
{
|
||||||
++it->pos;
|
++it->pos;
|
||||||
@ -226,9 +226,9 @@ void Paragraph::Pimpl::erase(pos_type pos)
|
|||||||
|
|
||||||
|
|
||||||
void Paragraph::Pimpl::simpleTeXBlanks(ostream & os, TexRow & texrow,
|
void Paragraph::Pimpl::simpleTeXBlanks(ostream & os, TexRow & texrow,
|
||||||
pos_type const i,
|
pos_type const i,
|
||||||
int & column, LyXFont const & font,
|
int & column, LyXFont const & font,
|
||||||
LyXLayout const & style)
|
LyXLayout const & style)
|
||||||
{
|
{
|
||||||
if (style.pass_thru) return;
|
if (style.pass_thru) return;
|
||||||
if (column > tex_code_break_column
|
if (column > tex_code_break_column
|
||||||
@ -317,7 +317,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int tmp = inset->latex(buf, os, moving_arg,
|
int tmp = inset->latex(buf, os, moving_arg,
|
||||||
style.free_spacing);
|
style.free_spacing);
|
||||||
|
|
||||||
if (close)
|
if (close)
|
||||||
os << "}";
|
os << "}";
|
||||||
@ -471,9 +471,9 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
|
|||||||
case ' ':
|
case ' ':
|
||||||
// Blanks are printed before font switching.
|
// Blanks are printed before font switching.
|
||||||
// Sure? I am not! (try nice-latex)
|
// Sure? I am not! (try nice-latex)
|
||||||
// I am sure it's correct. LyX might be smarter
|
// I am sure it's correct. LyX might be smarter
|
||||||
// in the future, but for now, nothing wrong is
|
// in the future, but for now, nothing wrong is
|
||||||
// written. (Asger)
|
// written. (Asger)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
16
src/screen.C
16
src/screen.C
@ -112,8 +112,8 @@ void LyXScreen::expose(int x, int y, int exp_width, int exp_height)
|
|||||||
|
|
||||||
|
|
||||||
void LyXScreen::drawFromTo(LyXText * text, BufferView * bv,
|
void LyXScreen::drawFromTo(LyXText * text, BufferView * bv,
|
||||||
int y1, int y2, int y_offset, int x_offset,
|
int y1, int y2, int y_offset, int x_offset,
|
||||||
bool internal)
|
bool internal)
|
||||||
{
|
{
|
||||||
int y_text = text->first_y + y1;
|
int y_text = text->first_y + y1;
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ void LyXScreen::drawFromTo(LyXText * text, BufferView * bv,
|
|||||||
while (row != 0 && y < y2) {
|
while (row != 0 && y < y2) {
|
||||||
LyXText::text_status st = text->status();
|
LyXText::text_status st = text->status();
|
||||||
text->getVisibleRow(bv, y + y_offset,
|
text->getVisibleRow(bv, y + y_offset,
|
||||||
x_offset, row, y + text->first_y);
|
x_offset, row, y + text->first_y);
|
||||||
internal = internal && (st != LyXText::CHANGED_IN_DRAW);
|
internal = internal && (st != LyXText::CHANGED_IN_DRAW);
|
||||||
while (internal && text->status() == LyXText::CHANGED_IN_DRAW) {
|
while (internal && text->status() == LyXText::CHANGED_IN_DRAW) {
|
||||||
if (text->fullRebreak(bv)) {
|
if (text->fullRebreak(bv)) {
|
||||||
@ -136,7 +136,7 @@ void LyXScreen::drawFromTo(LyXText * text, BufferView * bv,
|
|||||||
}
|
}
|
||||||
text->status(bv, st);
|
text->status(bv, st);
|
||||||
text->getVisibleRow(bv, y + y_offset,
|
text->getVisibleRow(bv, y + y_offset,
|
||||||
x_offset, row, y + text->first_y);
|
x_offset, row, y + text->first_y);
|
||||||
}
|
}
|
||||||
y += row->height();
|
y += row->height();
|
||||||
row = row->next();
|
row = row->next();
|
||||||
@ -168,7 +168,7 @@ void LyXScreen::drawOneRow(LyXText * text, BufferView * bv, Row * row,
|
|||||||
text->getVisibleRow(bv, y, x_offset, row,
|
text->getVisibleRow(bv, y, x_offset, row,
|
||||||
y + text->first_y);
|
y + text->first_y);
|
||||||
} while (!text->inset_owner &&
|
} while (!text->inset_owner &&
|
||||||
text->status() == LyXText::CHANGED_IN_DRAW);
|
text->status() == LyXText::CHANGED_IN_DRAW);
|
||||||
bv->text->status(bv, st);
|
bv->text->status(bv, st);
|
||||||
#else
|
#else
|
||||||
text->getVisibleRow(bv, y, x_offset, row, y + text->first_y);
|
text->getVisibleRow(bv, y, x_offset, row, y + text->first_y);
|
||||||
@ -212,8 +212,8 @@ void LyXScreen::draw(LyXText * text, BufferView * bv, unsigned int y)
|
|||||||
old_first - text->first_y);
|
old_first - text->first_y);
|
||||||
} else {
|
} else {
|
||||||
drawFromTo(text, bv,
|
drawFromTo(text, bv,
|
||||||
owner.height() + old_first - text->first_y,
|
owner.height() + old_first - text->first_y,
|
||||||
owner.height(), 0, 0, internal);
|
owner.height(), 0, 0, internal);
|
||||||
XCopyArea (fl_get_display(),
|
XCopyArea (fl_get_display(),
|
||||||
owner.getWin(),
|
owner.getWin(),
|
||||||
owner.getWin(),
|
owner.getWin(),
|
||||||
@ -440,7 +440,7 @@ bool LyXScreen::fitCursor(LyXText * text, BufferView * bv)
|
|||||||
|
|
||||||
|
|
||||||
void LyXScreen::update(LyXText * text, BufferView * bv,
|
void LyXScreen::update(LyXText * text, BufferView * bv,
|
||||||
int y_offset, int x_offset)
|
int y_offset, int x_offset)
|
||||||
{
|
{
|
||||||
switch (text->status()) {
|
switch (text->status()) {
|
||||||
case LyXText::NEED_MORE_REFRESH:
|
case LyXText::NEED_MORE_REFRESH:
|
||||||
|
@ -47,4 +47,3 @@ class SpellBase
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -77,5 +77,3 @@ class ISpell : public SpellBase
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,5 +61,3 @@ class PSpell : public SpellBase
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ LyXTabular::LyXTabular(BufferParams const & bp,
|
|||||||
|
|
||||||
LyXTabular::LyXTabular(BufferParams const & bp,
|
LyXTabular::LyXTabular(BufferParams const & bp,
|
||||||
InsetTabular * inset, LyXTabular const & lt,
|
InsetTabular * inset, LyXTabular const & lt,
|
||||||
bool same_id)
|
bool same_id)
|
||||||
{
|
{
|
||||||
owner_ = inset;
|
owner_ = inset;
|
||||||
cur_cell = -1;
|
cur_cell = -1;
|
||||||
@ -198,7 +198,7 @@ LyXTabular * LyXTabular::clone(BufferParams const & bp,
|
|||||||
|
|
||||||
/* activates all lines and sets all widths to 0 */
|
/* activates all lines and sets all widths to 0 */
|
||||||
void LyXTabular::Init(BufferParams const & bp,
|
void LyXTabular::Init(BufferParams const & bp,
|
||||||
int rows_arg, int columns_arg, LyXTabular const * lt)
|
int rows_arg, int columns_arg, LyXTabular const * lt)
|
||||||
{
|
{
|
||||||
rows_ = rows_arg;
|
rows_ = rows_arg;
|
||||||
columns_ = columns_arg;
|
columns_ = columns_arg;
|
||||||
@ -675,7 +675,7 @@ void LyXTabular::recalculateMulticolumnsOfColumn(int column)
|
|||||||
{
|
{
|
||||||
int const cellno = cell_info[row][column].cellno;
|
int const cellno = cell_info[row][column].cellno;
|
||||||
SetWidthOfMulticolCell(cellno,
|
SetWidthOfMulticolCell(cellno,
|
||||||
GetWidthOfCell(cellno)-(2 * WIDTH_OF_LINE));
|
GetWidthOfCell(cellno)-(2 * WIDTH_OF_LINE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -775,7 +775,7 @@ bool LyXTabular::SetMColumnPWidth(int cell, LyXLength const & width)
|
|||||||
|
|
||||||
|
|
||||||
bool LyXTabular::SetAlignSpecial(int cell, string const & special,
|
bool LyXTabular::SetAlignSpecial(int cell, string const & special,
|
||||||
LyXTabular::Feature what)
|
LyXTabular::Feature what)
|
||||||
{
|
{
|
||||||
if (what == SET_SPECIAL_MULTI)
|
if (what == SET_SPECIAL_MULTI)
|
||||||
cellinfo_of_cell(cell)->align_special = special;
|
cellinfo_of_cell(cell)->align_special = special;
|
||||||
@ -1314,7 +1314,7 @@ void LyXTabular::ReadNew(Buffer const * buf, istream & is,
|
|||||||
|
|
||||||
|
|
||||||
void LyXTabular::OldFormatRead(BufferParams const & bp,
|
void LyXTabular::OldFormatRead(BufferParams const & bp,
|
||||||
LyXLex & lex, string const & fl)
|
LyXLex & lex, string const & fl)
|
||||||
{
|
{
|
||||||
int version;
|
int version;
|
||||||
int i;
|
int i;
|
||||||
@ -2085,7 +2085,7 @@ int LyXTabular::TeXCellPostamble(ostream & os, int cell) const
|
|||||||
|
|
||||||
|
|
||||||
int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
|
int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
|
||||||
bool fragile, bool fp) const
|
bool fragile, bool fp) const
|
||||||
{
|
{
|
||||||
if (!is_long_tabular)
|
if (!is_long_tabular)
|
||||||
return 0;
|
return 0;
|
||||||
@ -2185,7 +2185,7 @@ bool LyXTabular::isValidRow(int const row) const
|
|||||||
|
|
||||||
|
|
||||||
int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
|
int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
|
||||||
bool fragile, bool fp) const
|
bool fragile, bool fp) const
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int cell = GetCellNumber(i, 0);
|
int cell = GetCellNumber(i, 0);
|
||||||
@ -2446,7 +2446,7 @@ int LyXTabular::docBook(Buffer const * buf, ostream & os) const
|
|||||||
// ASCII export function and helpers
|
// ASCII export function and helpers
|
||||||
//--
|
//--
|
||||||
int LyXTabular::asciiTopHLine(ostream & os, int row,
|
int LyXTabular::asciiTopHLine(ostream & os, int row,
|
||||||
vector<unsigned int> const & clen) const
|
vector<unsigned int> const & clen) const
|
||||||
{
|
{
|
||||||
int const fcell = GetFirstCellInRow(row);
|
int const fcell = GetFirstCellInRow(row);
|
||||||
int const n = NumberOfCellsInRow(fcell) + fcell;
|
int const n = NumberOfCellsInRow(fcell) + fcell;
|
||||||
@ -2493,7 +2493,7 @@ int LyXTabular::asciiTopHLine(ostream & os, int row,
|
|||||||
|
|
||||||
|
|
||||||
int LyXTabular::asciiBottomHLine(ostream & os, int row,
|
int LyXTabular::asciiBottomHLine(ostream & os, int row,
|
||||||
vector<unsigned int> const & clen) const
|
vector<unsigned int> const & clen) const
|
||||||
{
|
{
|
||||||
int const fcell = GetFirstCellInRow(row);
|
int const fcell = GetFirstCellInRow(row);
|
||||||
int const n = NumberOfCellsInRow(fcell) + fcell;
|
int const n = NumberOfCellsInRow(fcell) + fcell;
|
||||||
@ -2540,9 +2540,9 @@ int LyXTabular::asciiBottomHLine(ostream & os, int row,
|
|||||||
|
|
||||||
|
|
||||||
int LyXTabular::asciiPrintCell(Buffer const * buf, ostream & os,
|
int LyXTabular::asciiPrintCell(Buffer const * buf, ostream & os,
|
||||||
int cell, int row, int column,
|
int cell, int row, int column,
|
||||||
vector<unsigned int> const & clen,
|
vector<unsigned int> const & clen,
|
||||||
bool onlydata) const
|
bool onlydata) const
|
||||||
{
|
{
|
||||||
ostringstream sstr;
|
ostringstream sstr;
|
||||||
int ret = GetCellInset(cell)->ascii(buf, sstr, 0);
|
int ret = GetCellInset(cell)->ascii(buf, sstr, 0);
|
||||||
|
@ -300,7 +300,7 @@ public:
|
|||||||
int docBook(Buffer const * buf, std::ostream & os) const;
|
int docBook(Buffer const * buf, std::ostream & os) const;
|
||||||
///
|
///
|
||||||
int ascii(Buffer const *, std::ostream &, int const depth,
|
int ascii(Buffer const *, std::ostream &, int const depth,
|
||||||
bool onlydata, unsigned char delim) const;
|
bool onlydata, unsigned char delim) const;
|
||||||
///
|
///
|
||||||
bool IsMultiColumn(int cell, bool real = false) const;
|
bool IsMultiColumn(int cell, bool real = false) const;
|
||||||
///
|
///
|
||||||
@ -566,24 +566,24 @@ private:
|
|||||||
int TeXCellPostamble(std::ostream &, int cell) const;
|
int TeXCellPostamble(std::ostream &, int cell) const;
|
||||||
///
|
///
|
||||||
int TeXLongtableHeaderFooter(std::ostream &, Buffer const * buf,
|
int TeXLongtableHeaderFooter(std::ostream &, Buffer const * buf,
|
||||||
bool fragile, bool fp) const;
|
bool fragile, bool fp) const;
|
||||||
///
|
///
|
||||||
bool isValidRow(int const row) const;
|
bool isValidRow(int const row) const;
|
||||||
///
|
///
|
||||||
int TeXRow(std::ostream &, int const row, Buffer const * buf,
|
int TeXRow(std::ostream &, int const row, Buffer const * buf,
|
||||||
bool fragile, bool fp) const;
|
bool fragile, bool fp) const;
|
||||||
///
|
///
|
||||||
// helper function for ASCII returns number of newlines
|
// helper function for ASCII returns number of newlines
|
||||||
///
|
///
|
||||||
int asciiTopHLine(std::ostream &, int row,
|
int asciiTopHLine(std::ostream &, int row,
|
||||||
std::vector<unsigned int> const &) const;
|
std::vector<unsigned int> const &) const;
|
||||||
///
|
///
|
||||||
int asciiBottomHLine(std::ostream &, int row,
|
int asciiBottomHLine(std::ostream &, int row,
|
||||||
std::vector<unsigned int> const &) const;
|
std::vector<unsigned int> const &) const;
|
||||||
///
|
///
|
||||||
int asciiPrintCell(Buffer const *, std::ostream &,
|
int asciiPrintCell(Buffer const *, std::ostream &,
|
||||||
int cell, int row, int column,
|
int cell, int row, int column,
|
||||||
std::vector<unsigned int> const &,
|
std::vector<unsigned int> const &,
|
||||||
bool onlydata) const;
|
bool onlydata) const;
|
||||||
/// auxiliary function for docbook
|
/// auxiliary function for docbook
|
||||||
int docbookRow(Buffer const * buf, std::ostream & os, int row) const;
|
int docbookRow(Buffer const * buf, std::ostream & os, int row) const;
|
||||||
|
@ -52,14 +52,14 @@ extern bool string2type(string const str, bool & num);
|
|||||||
extern bool getTokenValue(string const & str, char const * token, string &ret);
|
extern bool getTokenValue(string const & str, char const * token, string &ret);
|
||||||
extern bool getTokenValue(string const & str, char const * token, int & num);
|
extern bool getTokenValue(string const & str, char const * token, int & num);
|
||||||
extern bool getTokenValue(string const & str, char const * token,
|
extern bool getTokenValue(string const & str, char const * token,
|
||||||
LyXAlignment & num);
|
LyXAlignment & num);
|
||||||
extern bool getTokenValue(string const & str, char const * token,
|
extern bool getTokenValue(string const & str, char const * token,
|
||||||
LyXTabular::VAlignment & num);
|
LyXTabular::VAlignment & num);
|
||||||
extern bool getTokenValue(string const & str, char const * token,
|
extern bool getTokenValue(string const & str, char const * token,
|
||||||
LyXTabular::BoxType & num);
|
LyXTabular::BoxType & num);
|
||||||
extern bool getTokenValue(string const & str, char const * token, bool & flag);
|
extern bool getTokenValue(string const & str, char const * token, bool & flag);
|
||||||
extern bool getTokenValue(string const & str, char const * token,
|
extern bool getTokenValue(string const & str, char const * token,
|
||||||
LyXLength & len);
|
LyXLength & len);
|
||||||
extern void l_getline(std::istream & is, string & str);
|
extern void l_getline(std::istream & is, string & str);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -105,4 +105,3 @@ string const DoAccent(char c, tex_accent accent)
|
|||||||
{
|
{
|
||||||
return DoAccent(tostr(c), accent);
|
return DoAccent(tostr(c), accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,12 +19,12 @@
|
|||||||
// this file should perhaps be split into even smaller parts
|
// this file should perhaps be split into even smaller parts
|
||||||
|
|
||||||
char const * string_paragraph_separation[3] = {
|
char const * string_paragraph_separation[3] = {
|
||||||
"indent", "skip", ""
|
"indent", "skip", ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
char const * string_quotes_language[7] = {
|
char const * string_quotes_language[7] = {
|
||||||
"english", "swedish", "german", "polish", "french", "danish", ""
|
"english", "swedish", "german", "polish", "french", "danish", ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -45,12 +45,12 @@ char const * string_orientation[3] = {
|
|||||||
|
|
||||||
|
|
||||||
char const * string_footnotekinds[8] = {
|
char const * string_footnotekinds[8] = {
|
||||||
"footnote", "margin", "fig", "tab", "alg", "wide-fig", "wide-tab", ""
|
"footnote", "margin", "fig", "tab", "alg", "wide-fig", "wide-tab", ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
char const * string_align[5] = {
|
char const * string_align[5] = {
|
||||||
"block", "left", "right", "center", ""
|
"block", "left", "right", "center", ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -64,5 +64,3 @@ char const * tex_graphics[] = {"default", "dvips", "dvitops", "emtex",
|
|||||||
|
|
||||||
char const * tex_fonts[] = {"default", "ae", "pslatex", "times", "palatino",
|
char const * tex_fonts[] = {"default", "ae", "pslatex", "times", "palatino",
|
||||||
"helvet", "avant", "newcent", "bookman", ""};
|
"helvet", "avant", "newcent", "bookman", ""};
|
||||||
|
|
||||||
|
|
||||||
|
100
src/text.C
100
src/text.C
@ -188,7 +188,7 @@ unsigned char LyXText::transformChar(unsigned char c, Paragraph * par,
|
|||||||
// Lgb
|
// Lgb
|
||||||
|
|
||||||
int LyXText::singleWidth(BufferView * bview, Paragraph * par,
|
int LyXText::singleWidth(BufferView * bview, Paragraph * par,
|
||||||
pos_type pos) const
|
pos_type pos) const
|
||||||
{
|
{
|
||||||
char const c = par->getChar(pos);
|
char const c = par->getChar(pos);
|
||||||
return singleWidth(bview, par, pos, c);
|
return singleWidth(bview, par, pos, c);
|
||||||
@ -196,7 +196,7 @@ int LyXText::singleWidth(BufferView * bview, Paragraph * par,
|
|||||||
|
|
||||||
|
|
||||||
int LyXText::singleWidth(BufferView * bview, Paragraph * par,
|
int LyXText::singleWidth(BufferView * bview, Paragraph * par,
|
||||||
pos_type pos, char c) const
|
pos_type pos, char c) const
|
||||||
{
|
{
|
||||||
LyXFont const font = getFont(bview->buffer(), par, pos);
|
LyXFont const font = getFont(bview->buffer(), par, pos);
|
||||||
|
|
||||||
@ -579,7 +579,7 @@ void LyXText::drawArabicComposeChar(DrawRowParams & p, pos_type & vpos)
|
|||||||
|
|
||||||
|
|
||||||
void LyXText::drawChars(DrawRowParams & p, pos_type & vpos,
|
void LyXText::drawChars(DrawRowParams & p, pos_type & vpos,
|
||||||
bool hebrew, bool arabic)
|
bool hebrew, bool arabic)
|
||||||
{
|
{
|
||||||
pos_type pos = vis2log(vpos);
|
pos_type pos = vis2log(vpos);
|
||||||
pos_type const last = rowLastPrintable(p.row);
|
pos_type const last = rowLastPrintable(p.row);
|
||||||
@ -1200,7 +1200,7 @@ int LyXText::numberOfLabelHfills(Buffer const * buf, Row const * row) const
|
|||||||
// returns true, if a expansion is needed.
|
// returns true, if a expansion is needed.
|
||||||
// Rules are given by LaTeX
|
// Rules are given by LaTeX
|
||||||
bool LyXText::hfillExpansion(Buffer const * buf, Row const * row_ptr,
|
bool LyXText::hfillExpansion(Buffer const * buf, Row const * row_ptr,
|
||||||
pos_type pos) const
|
pos_type pos) const
|
||||||
{
|
{
|
||||||
// by the way, is it a hfill?
|
// by the way, is it a hfill?
|
||||||
if (!row_ptr->par()->isHfill(pos))
|
if (!row_ptr->par()->isHfill(pos))
|
||||||
@ -1292,11 +1292,11 @@ void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const
|
|||||||
//lyxerr << "spacing_val = " << spacing_val << endl;
|
//lyxerr << "spacing_val = " << spacing_val << endl;
|
||||||
|
|
||||||
int maxasc = int(lyxfont::maxAscent(font) *
|
int maxasc = int(lyxfont::maxAscent(font) *
|
||||||
layout.spacing.getValue() *
|
layout.spacing.getValue() *
|
||||||
spacing_val);
|
spacing_val);
|
||||||
int maxdesc = int(lyxfont::maxDescent(font) *
|
int maxdesc = int(lyxfont::maxDescent(font) *
|
||||||
layout.spacing.getValue() *
|
layout.spacing.getValue() *
|
||||||
spacing_val);
|
spacing_val);
|
||||||
pos_type const pos_end = rowLast(row_ptr);
|
pos_type const pos_end = rowLast(row_ptr);
|
||||||
int labeladdon = 0;
|
int labeladdon = 0;
|
||||||
int maxwidth = 0;
|
int maxwidth = 0;
|
||||||
@ -1356,8 +1356,8 @@ void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const
|
|||||||
{
|
{
|
||||||
maxasc += bview->buffer()->params.getDefSkip().inPixels(bview);
|
maxasc += bview->buffer()->params.getDefSkip().inPixels(bview);
|
||||||
} else if (firstpar->previous() &&
|
} else if (firstpar->previous() &&
|
||||||
textclasslist[bview->buffer()->params.textclass][firstpar->previous()->layout()].isParagraph() &&
|
textclasslist[bview->buffer()->params.textclass][firstpar->previous()->layout()].isParagraph() &&
|
||||||
firstpar->previous()->getDepth() == 0)
|
firstpar->previous()->getDepth() == 0)
|
||||||
{
|
{
|
||||||
// is it right to use defskip here too? (AS)
|
// is it right to use defskip here too? (AS)
|
||||||
maxasc += bview->buffer()->params.getDefSkip().inPixels(bview);
|
maxasc += bview->buffer()->params.getDefSkip().inPixels(bview);
|
||||||
@ -1375,7 +1375,7 @@ void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const
|
|||||||
// there height depends on the font of the nearest character
|
// there height depends on the font of the nearest character
|
||||||
if (firstpar->params().lineTop())
|
if (firstpar->params().lineTop())
|
||||||
maxasc += 2 * lyxfont::ascent('x', getFont(bview->buffer(),
|
maxasc += 2 * lyxfont::ascent('x', getFont(bview->buffer(),
|
||||||
firstpar, 0));
|
firstpar, 0));
|
||||||
|
|
||||||
// and now the pagebreaks
|
// and now the pagebreaks
|
||||||
if (firstpar->params().pagebreakTop())
|
if (firstpar->params().pagebreakTop())
|
||||||
@ -1394,8 +1394,8 @@ void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
labeladdon = int(lyxfont::maxDescent(labelfont) *
|
labeladdon = int(lyxfont::maxDescent(labelfont) *
|
||||||
layout.spacing.getValue() *
|
layout.spacing.getValue() *
|
||||||
spacing_val)
|
spacing_val)
|
||||||
+ int(lyxfont::maxAscent(labelfont) *
|
+ int(lyxfont::maxAscent(labelfont) *
|
||||||
layout.spacing.getValue() *
|
layout.spacing.getValue() *
|
||||||
spacing_val);
|
spacing_val);
|
||||||
@ -1485,7 +1485,7 @@ void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const
|
|||||||
// there height depends on the font of the nearest character
|
// there height depends on the font of the nearest character
|
||||||
if (firstpar->params().lineBottom())
|
if (firstpar->params().lineBottom())
|
||||||
maxdesc += 2 * lyxfont::ascent('x',
|
maxdesc += 2 * lyxfont::ascent('x',
|
||||||
getFont(bview->buffer(),
|
getFont(bview->buffer(),
|
||||||
par,
|
par,
|
||||||
max(pos_type(0), par->size() - 1)));
|
max(pos_type(0), par->size() - 1)));
|
||||||
|
|
||||||
@ -1698,7 +1698,7 @@ void LyXText::breakParagraph(BufferView * bview, char keep_layout)
|
|||||||
if (cursor.pos() < cursor.par()->size()
|
if (cursor.pos() < cursor.par()->size()
|
||||||
&& cursor.par()->isLineSeparator(cursor.pos()))
|
&& cursor.par()->isLineSeparator(cursor.pos()))
|
||||||
cursor.par()->erase(cursor.pos());
|
cursor.par()->erase(cursor.pos());
|
||||||
// cursor.pos(cursor.pos() + 1);
|
// cursor.pos(cursor.pos() + 1);
|
||||||
|
|
||||||
// break the paragraph
|
// break the paragraph
|
||||||
if (keep_layout)
|
if (keep_layout)
|
||||||
@ -1911,7 +1911,7 @@ void LyXText::insertChar(BufferView * bview, char c)
|
|||||||
Row * row = cursor.row();
|
Row * row = cursor.row();
|
||||||
int y = cursor.y() - row->baseline();
|
int y = cursor.y() - row->baseline();
|
||||||
if (c != Paragraph::META_INSET) /* Here case LyXText::InsertInset
|
if (c != Paragraph::META_INSET) /* Here case LyXText::InsertInset
|
||||||
* already insertet the character */
|
* already insertet the character */
|
||||||
cursor.par()->insertChar(cursor.pos(), c);
|
cursor.par()->insertChar(cursor.pos(), c);
|
||||||
setCharFont(bview->buffer(), cursor.par(), cursor.pos(), rawtmpfont);
|
setCharFont(bview->buffer(), cursor.par(), cursor.pos(), rawtmpfont);
|
||||||
|
|
||||||
@ -1975,8 +1975,8 @@ void LyXText::insertChar(BufferView * bview, char c)
|
|||||||
|
|
||||||
// recalculate the fill of the row
|
// recalculate the fill of the row
|
||||||
if (row->fill() >= 0) /* needed because a newline
|
if (row->fill() >= 0) /* needed because a newline
|
||||||
* will set fill to -1. Otherwise
|
* will set fill to -1. Otherwise
|
||||||
* we would not get a rebreak! */
|
* we would not get a rebreak! */
|
||||||
row->fill(fill(bview, row, workWidth(bview)));
|
row->fill(fill(bview, row, workWidth(bview)));
|
||||||
if (row->fill() < 0) {
|
if (row->fill() < 0) {
|
||||||
refresh_y = y;
|
refresh_y = y;
|
||||||
@ -2055,11 +2055,11 @@ void LyXText::charInserted()
|
|||||||
|
|
||||||
|
|
||||||
void LyXText::prepareToPrint(BufferView * bview,
|
void LyXText::prepareToPrint(BufferView * bview,
|
||||||
Row * row, float & x,
|
Row * row, float & x,
|
||||||
float & fill_separator,
|
float & fill_separator,
|
||||||
float & fill_hfill,
|
float & fill_hfill,
|
||||||
float & fill_label_hfill,
|
float & fill_label_hfill,
|
||||||
bool bidi) const
|
bool bidi) const
|
||||||
{
|
{
|
||||||
float nlh;
|
float nlh;
|
||||||
float ns;
|
float ns;
|
||||||
@ -2116,7 +2116,7 @@ void LyXText::prepareToPrint(BufferView * bview,
|
|||||||
&& (inset=row->par()->getInset(row->pos()))
|
&& (inset=row->par()->getInset(row->pos()))
|
||||||
&& (inset->display())) // || (inset->scroll() < 0)))
|
&& (inset->display())) // || (inset->scroll() < 0)))
|
||||||
align = (inset->lyxCode() == Inset::MATHMACRO_CODE)
|
align = (inset->lyxCode() == Inset::MATHMACRO_CODE)
|
||||||
? LYX_ALIGN_BLOCK : LYX_ALIGN_CENTER;
|
? LYX_ALIGN_BLOCK : LYX_ALIGN_CENTER;
|
||||||
// ERT insets should always be LEFT ALIGNED on screen
|
// ERT insets should always be LEFT ALIGNED on screen
|
||||||
inset = row->par()->inInset();
|
inset = row->par()->inInset();
|
||||||
if (inset && inset->owner() &&
|
if (inset && inset->owner() &&
|
||||||
@ -2131,8 +2131,8 @@ void LyXText::prepareToPrint(BufferView * bview,
|
|||||||
if (ns && row->next() && row->next()->par() == row->par() &&
|
if (ns && row->next() && row->next()->par() == row->par() &&
|
||||||
!(row->next()->par()->isNewline(row->next()->pos() - 1))
|
!(row->next()->par()->isNewline(row->next()->pos() - 1))
|
||||||
&& !(row->next()->par()->isInset(row->next()->pos())
|
&& !(row->next()->par()->isInset(row->next()->pos())
|
||||||
&& row->next()->par()->getInset(row->next()->pos())
|
&& row->next()->par()->getInset(row->next()->pos())
|
||||||
&& row->next()->par()->getInset(row->next()->pos())->display())
|
&& row->next()->par()->getInset(row->next()->pos())->display())
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fill_separator = w / ns;
|
fill_separator = w / ns;
|
||||||
@ -2197,7 +2197,7 @@ void LyXText::cursorRightOneWord(BufferView * bview) const
|
|||||||
}
|
}
|
||||||
// Advance through word.
|
// Advance through word.
|
||||||
while (tmpcursor.pos() < tmpcursor.par()->size() &&
|
while (tmpcursor.pos() < tmpcursor.par()->size() &&
|
||||||
tmpcursor.par()->isWord(tmpcursor.pos())) {
|
tmpcursor.par()->isWord(tmpcursor.pos())) {
|
||||||
// printf("Current pos2 %d", tmpcursor.pos()) ;
|
// printf("Current pos2 %d", tmpcursor.pos()) ;
|
||||||
tmpcursor.pos(tmpcursor.pos() + 1);
|
tmpcursor.pos(tmpcursor.pos() + 1);
|
||||||
++steps;
|
++steps;
|
||||||
@ -2211,22 +2211,22 @@ void LyXText::cursorTab(BufferView * bview) const
|
|||||||
{
|
{
|
||||||
LyXCursor tmpcursor = cursor;
|
LyXCursor tmpcursor = cursor;
|
||||||
while (tmpcursor.pos() < tmpcursor.par()->size()
|
while (tmpcursor.pos() < tmpcursor.par()->size()
|
||||||
&& !tmpcursor.par()->isNewline(tmpcursor.pos()))
|
&& !tmpcursor.par()->isNewline(tmpcursor.pos()))
|
||||||
tmpcursor.pos(tmpcursor.pos() + 1);
|
tmpcursor.pos(tmpcursor.pos() + 1);
|
||||||
|
|
||||||
if (tmpcursor.pos() == tmpcursor.par()->size()) {
|
if (tmpcursor.pos() == tmpcursor.par()->size()) {
|
||||||
if (tmpcursor.par()->next()) {
|
if (tmpcursor.par()->next()) {
|
||||||
tmpcursor.par(tmpcursor.par()->next());
|
tmpcursor.par(tmpcursor.par()->next());
|
||||||
tmpcursor.pos(0);
|
tmpcursor.pos(0);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
tmpcursor.pos(tmpcursor.pos() + 1);
|
tmpcursor.pos(tmpcursor.pos() + 1);
|
||||||
setCursor(bview, tmpcursor.par(), tmpcursor.pos());
|
setCursor(bview, tmpcursor.par(), tmpcursor.pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------> Skip initial whitespace at end of word and move cursor to *start*
|
/* -------> Skip initial whitespace at end of word and move cursor to *start*
|
||||||
of prior word, not to end of next prior word. */
|
of prior word, not to end of next prior word. */
|
||||||
|
|
||||||
void LyXText::cursorLeftOneWord(BufferView * bview) const
|
void LyXText::cursorLeftOneWord(BufferView * bview) const
|
||||||
{
|
{
|
||||||
@ -2339,7 +2339,7 @@ bool LyXText::selectWordWhenUnderCursor(BufferView * bview,
|
|||||||
// This function is only used by the spellchecker for NextWord().
|
// This function is only used by the spellchecker for NextWord().
|
||||||
// It doesn't handle LYX_ACCENTs and probably never will.
|
// It doesn't handle LYX_ACCENTs and probably never will.
|
||||||
string const LyXText::selectNextWordToSpellcheck(BufferView * bview,
|
string const LyXText::selectNextWordToSpellcheck(BufferView * bview,
|
||||||
float & value) const
|
float & value) const
|
||||||
{
|
{
|
||||||
if (the_locking_inset) {
|
if (the_locking_inset) {
|
||||||
string str = the_locking_inset->selectNextWordToSpellcheck(bview, value);
|
string str = the_locking_inset->selectNextWordToSpellcheck(bview, value);
|
||||||
@ -2643,7 +2643,7 @@ void LyXText::Delete(BufferView * bview)
|
|||||||
// to make sure undo gets the right cursor position
|
// to make sure undo gets the right cursor position
|
||||||
cursor = old_cursor;
|
cursor = old_cursor;
|
||||||
setUndo(bview, Undo::DELETE,
|
setUndo(bview, Undo::DELETE,
|
||||||
cursor.par(), cursor.par()->next());
|
cursor.par(), cursor.par()->next());
|
||||||
cursor = tmpcursor;
|
cursor = tmpcursor;
|
||||||
backspace(bview);
|
backspace(bview);
|
||||||
}
|
}
|
||||||
@ -2699,11 +2699,11 @@ void LyXText::backspace(BufferView * bview)
|
|||||||
|
|
||||||
if (cursor.par()->previous()) {
|
if (cursor.par()->previous()) {
|
||||||
setUndo(bview, Undo::DELETE,
|
setUndo(bview, Undo::DELETE,
|
||||||
cursor.par()->previous(), cursor.par()->next());
|
cursor.par()->previous(), cursor.par()->next());
|
||||||
}
|
}
|
||||||
|
|
||||||
Paragraph * tmppar = cursor.par();
|
Paragraph * tmppar = cursor.par();
|
||||||
Row * tmprow = cursor.row();
|
Row * tmprow = cursor.row();
|
||||||
|
|
||||||
// We used to do cursorLeftIntern() here, but it is
|
// We used to do cursorLeftIntern() here, but it is
|
||||||
// not a good idea since it triggers the auto-delete
|
// not a good idea since it triggers the auto-delete
|
||||||
@ -2712,8 +2712,8 @@ void LyXText::backspace(BufferView * bview)
|
|||||||
if (cursor.par()->previous()) {
|
if (cursor.par()->previous()) {
|
||||||
// steps into the above paragraph.
|
// steps into the above paragraph.
|
||||||
setCursorIntern(bview, cursor.par()->previous(),
|
setCursorIntern(bview, cursor.par()->previous(),
|
||||||
cursor.par()->previous()->size(),
|
cursor.par()->previous()->size(),
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pasting is not allowed, if the paragraphs have different
|
/* Pasting is not allowed, if the paragraphs have different
|
||||||
@ -2768,13 +2768,13 @@ void LyXText::backspace(BufferView * bview)
|
|||||||
/* this is the code for a normal backspace, not pasting
|
/* this is the code for a normal backspace, not pasting
|
||||||
* any paragraphs */
|
* any paragraphs */
|
||||||
setUndo(bview, Undo::DELETE,
|
setUndo(bview, Undo::DELETE,
|
||||||
cursor.par(), cursor.par()->next());
|
cursor.par(), cursor.par()->next());
|
||||||
// We used to do cursorLeftIntern() here, but it is
|
// We used to do cursorLeftIntern() here, but it is
|
||||||
// not a good idea since it triggers the auto-delete
|
// not a good idea since it triggers the auto-delete
|
||||||
// mechanism. So we do a cursorLeftIntern()-lite,
|
// mechanism. So we do a cursorLeftIntern()-lite,
|
||||||
// without the dreaded mechanism. (JMarc)
|
// without the dreaded mechanism. (JMarc)
|
||||||
setCursorIntern(bview, cursor.par(), cursor.pos()- 1,
|
setCursorIntern(bview, cursor.par(), cursor.pos()- 1,
|
||||||
false, cursor.boundary());
|
false, cursor.boundary());
|
||||||
|
|
||||||
// some insets are undeletable here
|
// some insets are undeletable here
|
||||||
if (cursor.par()->isInset(cursor.pos())) {
|
if (cursor.par()->isInset(cursor.pos())) {
|
||||||
@ -2798,8 +2798,8 @@ void LyXText::backspace(BufferView * bview)
|
|||||||
if (cursor.pos() < rowLast(row) ||
|
if (cursor.pos() < rowLast(row) ||
|
||||||
!cursor.par()->isLineSeparator(cursor.pos())) {
|
!cursor.par()->isLineSeparator(cursor.pos())) {
|
||||||
row->fill(row->fill() + singleWidth(bview,
|
row->fill(row->fill() + singleWidth(bview,
|
||||||
cursor.par(),
|
cursor.par(),
|
||||||
cursor.pos()));
|
cursor.pos()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* some special code when deleting a newline. This is similar
|
/* some special code when deleting a newline. This is similar
|
||||||
@ -3213,7 +3213,7 @@ int LyXText::drawLengthMarker(DrawRowParams & p, string const & prefix,
|
|||||||
VSpace const & vsp, int start)
|
VSpace const & vsp, int start)
|
||||||
{
|
{
|
||||||
int const arrow_size = 4;
|
int const arrow_size = 4;
|
||||||
int const size = getLengthMarkerHeight(p.bv, vsp);
|
int const size = getLengthMarkerHeight(p.bv, vsp);
|
||||||
int const end = start + size;
|
int const end = start + size;
|
||||||
|
|
||||||
// the label to display (if any)
|
// the label to display (if any)
|
||||||
@ -3633,7 +3633,7 @@ void LyXText::paintRowText(DrawRowParams & p)
|
|||||||
|
|
||||||
|
|
||||||
void LyXText::getVisibleRow(BufferView * bv, int y_offset, int x_offset,
|
void LyXText::getVisibleRow(BufferView * bv, int y_offset, int x_offset,
|
||||||
Row * row, int y, bool cleared)
|
Row * row, int y, bool cleared)
|
||||||
{
|
{
|
||||||
if (row->height() <= 0) {
|
if (row->height() <= 0) {
|
||||||
lyxerr << "LYX_ERROR: row.height: "
|
lyxerr << "LYX_ERROR: row.height: "
|
||||||
@ -3762,12 +3762,12 @@ LyXText::getColumnNearX(BufferView * bview, Row * row, int & x,
|
|||||||
|
|
||||||
boundary = false;
|
boundary = false;
|
||||||
bool const lastrow = lyxrc.rtl_support // This is not needed, but gives
|
bool const lastrow = lyxrc.rtl_support // This is not needed, but gives
|
||||||
// some speedup if rtl_support=false
|
// some speedup if rtl_support=false
|
||||||
&& (!row->next() || row->next()->par() != row->par());
|
&& (!row->next() || row->next()->par() != row->par());
|
||||||
bool const rtl = (lastrow)
|
bool const rtl = (lastrow)
|
||||||
? row->par()->isRightToLeftPar(bview->buffer()->params)
|
? row->par()->isRightToLeftPar(bview->buffer()->params)
|
||||||
: false; // If lastrow is false, we don't need to compute
|
: false; // If lastrow is false, we don't need to compute
|
||||||
// the value of rtl.
|
// the value of rtl.
|
||||||
|
|
||||||
if (row->pos() > last) // Row is empty?
|
if (row->pos() > last) // Row is empty?
|
||||||
c = row->pos();
|
c = row->pos();
|
||||||
|
80
src/text2.C
80
src/text2.C
@ -145,7 +145,7 @@ LyXFont const realizeFont(LyXFont const & font,
|
|||||||
tmpfont.realize(textclasslist[buf->params.textclass].defaultfont());
|
tmpfont.realize(textclasslist[buf->params.textclass].defaultfont());
|
||||||
#else
|
#else
|
||||||
tmpfont.realize(textclasslist[buf->params.textclass].defaultfont(),
|
tmpfont.realize(textclasslist[buf->params.textclass].defaultfont(),
|
||||||
buf->params.language);
|
buf->params.language);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return tmpfont;
|
return tmpfont;
|
||||||
@ -162,7 +162,7 @@ LyXFont const realizeFont(LyXFont const & font,
|
|||||||
// If position is -1, we get the layout font of the paragraph.
|
// If position is -1, we get the layout font of the paragraph.
|
||||||
// If position is -2, we get the font of the manual label of the paragraph.
|
// If position is -2, we get the font of the manual label of the paragraph.
|
||||||
LyXFont const LyXText::getFont(Buffer const * buf, Paragraph * par,
|
LyXFont const LyXText::getFont(Buffer const * buf, Paragraph * par,
|
||||||
pos_type pos) const
|
pos_type pos) const
|
||||||
{
|
{
|
||||||
lyx::Assert(pos >= 0);
|
lyx::Assert(pos >= 0);
|
||||||
|
|
||||||
@ -251,8 +251,8 @@ LyXFont const LyXText::getLabelFont(Buffer const * buf, Paragraph * par) const
|
|||||||
|
|
||||||
|
|
||||||
void LyXText::setCharFont(BufferView * bv, Paragraph * par,
|
void LyXText::setCharFont(BufferView * bv, Paragraph * par,
|
||||||
pos_type pos, LyXFont const & fnt,
|
pos_type pos, LyXFont const & fnt,
|
||||||
bool toggleall)
|
bool toggleall)
|
||||||
{
|
{
|
||||||
Buffer const * buf = bv->buffer();
|
Buffer const * buf = bv->buffer();
|
||||||
LyXFont font = getFont(buf, par, pos);
|
LyXFont font = getFont(buf, par, pos);
|
||||||
@ -273,7 +273,7 @@ void LyXText::setCharFont(BufferView * bv, Paragraph * par,
|
|||||||
|
|
||||||
|
|
||||||
void LyXText::setCharFont(Buffer const * buf, Paragraph * par,
|
void LyXText::setCharFont(Buffer const * buf, Paragraph * par,
|
||||||
pos_type pos, LyXFont const & fnt)
|
pos_type pos, LyXFont const & fnt)
|
||||||
{
|
{
|
||||||
LyXFont font(fnt);
|
LyXFont font(fnt);
|
||||||
|
|
||||||
@ -298,9 +298,9 @@ void LyXText::setCharFont(Buffer const * buf, Paragraph * par,
|
|||||||
layoutfont.realize(tclass[tp->layout()].font);
|
layoutfont.realize(tclass[tp->layout()].font);
|
||||||
#else
|
#else
|
||||||
layoutfont.realize(textclasslist.
|
layoutfont.realize(textclasslist.
|
||||||
Style(buf->params.textclass,
|
Style(buf->params.textclass,
|
||||||
tp->layout()).font,
|
tp->layout()).font,
|
||||||
buf->params.language);
|
buf->params.language);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -321,7 +321,7 @@ void LyXText::setCharFont(Buffer const * buf, Paragraph * par,
|
|||||||
// inserts a new row behind the specified row, increments
|
// inserts a new row behind the specified row, increments
|
||||||
// the touched counters
|
// the touched counters
|
||||||
void LyXText::insertRow(Row * row, Paragraph * par,
|
void LyXText::insertRow(Row * row, Paragraph * par,
|
||||||
pos_type pos) const
|
pos_type pos) const
|
||||||
{
|
{
|
||||||
Row * tmprow = new Row;
|
Row * tmprow = new Row;
|
||||||
if (!row) {
|
if (!row) {
|
||||||
@ -395,10 +395,10 @@ void LyXText::removeParagraph(Row * row) const
|
|||||||
|
|
||||||
// insert the specified paragraph behind the specified row
|
// insert the specified paragraph behind the specified row
|
||||||
void LyXText::insertParagraph(BufferView * bview, Paragraph * par,
|
void LyXText::insertParagraph(BufferView * bview, Paragraph * par,
|
||||||
Row * row) const
|
Row * row) const
|
||||||
{
|
{
|
||||||
insertRow(row, par, 0); /* insert a new row, starting
|
insertRow(row, par, 0); /* insert a new row, starting
|
||||||
* at postition 0 */
|
* at postition 0 */
|
||||||
|
|
||||||
setCounter(bview->buffer(), par); // set the counters
|
setCounter(bview->buffer(), par); // set the counters
|
||||||
|
|
||||||
@ -702,7 +702,7 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
|
|||||||
// Determine basis font
|
// Determine basis font
|
||||||
LyXFont layoutfont;
|
LyXFont layoutfont;
|
||||||
if (cursor.pos() < beginningOfMainBody(bview->buffer(),
|
if (cursor.pos() < beginningOfMainBody(bview->buffer(),
|
||||||
cursor.par())) {
|
cursor.par())) {
|
||||||
layoutfont = getLabelFont(bview->buffer(),
|
layoutfont = getLabelFont(bview->buffer(),
|
||||||
cursor.par());
|
cursor.par());
|
||||||
} else {
|
} else {
|
||||||
@ -722,7 +722,7 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
|
|||||||
real_current_font.realize(layoutfont);
|
real_current_font.realize(layoutfont);
|
||||||
#else
|
#else
|
||||||
real_current_font.realize(layoutfont,
|
real_current_font.realize(layoutfont,
|
||||||
bview->buffer()->params.language);
|
bview->buffer()->params.language);
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -733,7 +733,7 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
|
|||||||
// and sel_end cursor
|
// and sel_end cursor
|
||||||
|
|
||||||
setUndo(bview, Undo::EDIT,
|
setUndo(bview, Undo::EDIT,
|
||||||
selection.start.par(), selection.end.par()->next());
|
selection.start.par(), selection.end.par()->next());
|
||||||
freezeUndo();
|
freezeUndo();
|
||||||
cursor = selection.start;
|
cursor = selection.start;
|
||||||
while (cursor.par() != selection.end.par() ||
|
while (cursor.par() != selection.end.par() ||
|
||||||
@ -762,7 +762,7 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
|
|||||||
setCursor(bview, selection.end.par(), selection.end.pos());
|
setCursor(bview, selection.end.par(), selection.end.pos());
|
||||||
setSelection(bview);
|
setSelection(bview);
|
||||||
setCursor(bview, tmpcursor.par(), tmpcursor.pos(), true,
|
setCursor(bview, tmpcursor.par(), tmpcursor.pos(), true,
|
||||||
tmpcursor.boundary());
|
tmpcursor.boundary());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -815,7 +815,7 @@ void LyXText::redoDrawingOfParagraph(BufferView * bview, LyXCursor const & cur)
|
|||||||
// and the specified par
|
// and the specified par
|
||||||
// This function is needed after SetLayout and SetFont etc.
|
// This function is needed after SetLayout and SetFont etc.
|
||||||
void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
|
void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
|
||||||
Paragraph const * endpar) const
|
Paragraph const * endpar) const
|
||||||
{
|
{
|
||||||
Row * tmprow2;
|
Row * tmprow2;
|
||||||
Paragraph * tmppar = 0;
|
Paragraph * tmppar = 0;
|
||||||
@ -845,8 +845,8 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
|
|||||||
status(bview, LyXText::NEED_MORE_REFRESH);
|
status(bview, LyXText::NEED_MORE_REFRESH);
|
||||||
refresh_y = y;
|
refresh_y = y;
|
||||||
refresh_row = tmprow->previous(); /* the real refresh row will
|
refresh_row = tmprow->previous(); /* the real refresh row will
|
||||||
be deleted, so I store
|
be deleted, so I store
|
||||||
the previous here */
|
the previous here */
|
||||||
// remove it
|
// remove it
|
||||||
if (tmprow->next())
|
if (tmprow->next())
|
||||||
tmppar = tmprow->next()->par();
|
tmppar = tmprow->next()->par();
|
||||||
@ -863,7 +863,7 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
|
|||||||
|
|
||||||
// remove the first one
|
// remove the first one
|
||||||
tmprow2 = tmprow; /* this is because tmprow->previous()
|
tmprow2 = tmprow; /* this is because tmprow->previous()
|
||||||
can be 0 */
|
can be 0 */
|
||||||
tmprow = tmprow->previous();
|
tmprow = tmprow->previous();
|
||||||
removeRow(tmprow2);
|
removeRow(tmprow2);
|
||||||
|
|
||||||
@ -978,7 +978,7 @@ void LyXText::setSelection(BufferView * bview)
|
|||||||
|
|
||||||
|
|
||||||
string const LyXText::selectionAsString(Buffer const * buffer,
|
string const LyXText::selectionAsString(Buffer const * buffer,
|
||||||
bool label) const
|
bool label) const
|
||||||
{
|
{
|
||||||
if (!selection.set()) return string();
|
if (!selection.set()) return string();
|
||||||
string result;
|
string result;
|
||||||
@ -1071,7 +1071,7 @@ void LyXText::cursorBottom(BufferView * bview) const
|
|||||||
|
|
||||||
|
|
||||||
void LyXText::toggleFree(BufferView * bview,
|
void LyXText::toggleFree(BufferView * bview,
|
||||||
LyXFont const & font, bool toggleall)
|
LyXFont const & font, bool toggleall)
|
||||||
{
|
{
|
||||||
// If the mask is completely neutral, tell user
|
// If the mask is completely neutral, tell user
|
||||||
if (font == LyXFont(LyXFont::ALL_IGNORE)) {
|
if (font == LyXFont(LyXFont::ALL_IGNORE)) {
|
||||||
@ -1085,7 +1085,7 @@ void LyXText::toggleFree(BufferView * bview,
|
|||||||
// is disabled.
|
// is disabled.
|
||||||
LyXCursor resetCursor = cursor;
|
LyXCursor resetCursor = cursor;
|
||||||
bool implicitSelection = (font.language() == ignore_language
|
bool implicitSelection = (font.language() == ignore_language
|
||||||
&& font.number() == LyXFont::IGNORE)
|
&& font.number() == LyXFont::IGNORE)
|
||||||
? selectWordWhenUnderCursor(bview, WHOLE_WORD_STRICT) : false;
|
? selectWordWhenUnderCursor(bview, WHOLE_WORD_STRICT) : false;
|
||||||
|
|
||||||
// Set font
|
// Set font
|
||||||
@ -1203,7 +1203,7 @@ void LyXText::setParagraph(BufferView * bview,
|
|||||||
cursor.par()->params().pagebreakBottom(pagebreak_bottom);
|
cursor.par()->params().pagebreakBottom(pagebreak_bottom);
|
||||||
cursor.par()->params().spaceTop(space_top);
|
cursor.par()->params().spaceTop(space_top);
|
||||||
cursor.par()->params().spaceBottom(space_bottom);
|
cursor.par()->params().spaceBottom(space_bottom);
|
||||||
cursor.par()->params().spacing(spacing);
|
cursor.par()->params().spacing(spacing);
|
||||||
// does the layout allow the new alignment?
|
// does the layout allow the new alignment?
|
||||||
LyXLayout const & layout = tclass[cursor.par()->layout()];
|
LyXLayout const & layout = tclass[cursor.par()->layout()];
|
||||||
|
|
||||||
@ -1372,7 +1372,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
|
|||||||
par->params().labelString(layout.labelstring());
|
par->params().labelString(layout.labelstring());
|
||||||
else
|
else
|
||||||
par->params().labelString(string());
|
par->params().labelString(string());
|
||||||
} else {
|
} else {
|
||||||
if (!layout.labelstring_appendix().empty())
|
if (!layout.labelstring_appendix().empty())
|
||||||
par->params().labelString(layout.labelstring_appendix());
|
par->params().labelString(layout.labelstring_appendix());
|
||||||
else
|
else
|
||||||
@ -1424,7 +1424,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
|
|||||||
// case it is, how can this be correct?
|
// case it is, how can this be correct?
|
||||||
// (Lgb)
|
// (Lgb)
|
||||||
s << par->getCounter(i) << '.';
|
s << par->getCounter(i) << '.';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else { // appendix
|
} else { // appendix
|
||||||
switch (2 * LABEL_COUNTER_CHAPTER - textclass.maxcounter() + i) {
|
switch (2 * LABEL_COUNTER_CHAPTER - textclass.maxcounter() + i) {
|
||||||
@ -1720,16 +1720,16 @@ void LyXText::cutSelection(BufferView * bview, bool doclear, bool realcut)
|
|||||||
endpar = selection.end.par();
|
endpar = selection.end.par();
|
||||||
int pos = selection.end.pos();
|
int pos = selection.end.pos();
|
||||||
CutAndPaste::cutSelection(selection.start.par(), &endpar,
|
CutAndPaste::cutSelection(selection.start.par(), &endpar,
|
||||||
selection.start.pos(), pos,
|
selection.start.pos(), pos,
|
||||||
bview->buffer()->params.textclass,
|
bview->buffer()->params.textclass,
|
||||||
doclear, realcut);
|
doclear, realcut);
|
||||||
selection.end.pos(pos);
|
selection.end.pos(pos);
|
||||||
} else {
|
} else {
|
||||||
endpar = selection.end.par();
|
endpar = selection.end.par();
|
||||||
int pos = selection.end.pos();
|
int pos = selection.end.pos();
|
||||||
CutAndPaste::cutSelection(selection.start.par(), &endpar,
|
CutAndPaste::cutSelection(selection.start.par(), &endpar,
|
||||||
selection.start.pos(), pos,
|
selection.start.pos(), pos,
|
||||||
bview->buffer()->params.textclass,
|
bview->buffer()->params.textclass,
|
||||||
doclear, realcut);
|
doclear, realcut);
|
||||||
cursor.par(endpar);
|
cursor.par(endpar);
|
||||||
selection.end.par(endpar);
|
selection.end.par(endpar);
|
||||||
@ -1777,8 +1777,8 @@ void LyXText::copySelection(BufferView * bview)
|
|||||||
selection.start.pos(selection.start.pos() + 1);
|
selection.start.pos(selection.start.pos() + 1);
|
||||||
|
|
||||||
CutAndPaste::copySelection(selection.start.par(), selection.end.par(),
|
CutAndPaste::copySelection(selection.start.par(), selection.end.par(),
|
||||||
selection.start.pos(), selection.end.pos(),
|
selection.start.pos(), selection.end.pos(),
|
||||||
bview->buffer()->params.textclass);
|
bview->buffer()->params.textclass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1796,7 +1796,7 @@ void LyXText::pasteSelection(BufferView * bview)
|
|||||||
int pos = cursor.pos();
|
int pos = cursor.pos();
|
||||||
|
|
||||||
CutAndPaste::pasteSelection(&actpar, &endpar, pos,
|
CutAndPaste::pasteSelection(&actpar, &endpar, pos,
|
||||||
bview->buffer()->params.textclass);
|
bview->buffer()->params.textclass);
|
||||||
|
|
||||||
redoParagraphs(bview, cursor, endpar);
|
redoParagraphs(bview, cursor, endpar);
|
||||||
|
|
||||||
@ -1934,7 +1934,7 @@ bool LyXText::gotoNextInset(BufferView * bview,
|
|||||||
|
|
||||||
|
|
||||||
void LyXText::checkParagraph(BufferView * bview, Paragraph * par,
|
void LyXText::checkParagraph(BufferView * bview, Paragraph * par,
|
||||||
pos_type pos)
|
pos_type pos)
|
||||||
{
|
{
|
||||||
LyXCursor tmpcursor;
|
LyXCursor tmpcursor;
|
||||||
|
|
||||||
@ -2042,8 +2042,8 @@ bool LyXText::updateInset(BufferView * bview, Inset * inset)
|
|||||||
|
|
||||||
|
|
||||||
bool LyXText::setCursor(BufferView * bview, Paragraph * par,
|
bool LyXText::setCursor(BufferView * bview, Paragraph * par,
|
||||||
pos_type pos,
|
pos_type pos,
|
||||||
bool setfont, bool boundary) const
|
bool setfont, bool boundary) const
|
||||||
{
|
{
|
||||||
LyXCursor old_cursor = cursor;
|
LyXCursor old_cursor = cursor;
|
||||||
setCursorIntern(bview, par, pos, setfont, boundary);
|
setCursorIntern(bview, par, pos, setfont, boundary);
|
||||||
@ -2052,7 +2052,7 @@ bool LyXText::setCursor(BufferView * bview, Paragraph * par,
|
|||||||
|
|
||||||
|
|
||||||
void LyXText::setCursor(BufferView * bview, LyXCursor & cur, Paragraph * par,
|
void LyXText::setCursor(BufferView * bview, LyXCursor & cur, Paragraph * par,
|
||||||
pos_type pos, bool boundary) const
|
pos_type pos, bool boundary) const
|
||||||
{
|
{
|
||||||
lyx::Assert(par);
|
lyx::Assert(par);
|
||||||
lyx::Assert(bview);
|
lyx::Assert(bview);
|
||||||
@ -2086,7 +2086,7 @@ void LyXText::setCursor(BufferView * bview, LyXCursor & cur, Paragraph * par,
|
|||||||
float fill_hfill;
|
float fill_hfill;
|
||||||
float fill_label_hfill;
|
float fill_label_hfill;
|
||||||
prepareToPrint(bview, row, x, fill_separator, fill_hfill,
|
prepareToPrint(bview, row, x, fill_separator, fill_hfill,
|
||||||
fill_label_hfill);
|
fill_label_hfill);
|
||||||
pos_type cursor_vpos = 0;
|
pos_type cursor_vpos = 0;
|
||||||
pos_type last = rowLastPrintable(row);
|
pos_type last = rowLastPrintable(row);
|
||||||
|
|
||||||
@ -2105,7 +2105,7 @@ void LyXText::setCursor(BufferView * bview, LyXCursor & cur, Paragraph * par,
|
|||||||
cursor_vpos = (row->par()->isRightToLeftPar(bview->buffer()->params))
|
cursor_vpos = (row->par()->isRightToLeftPar(bview->buffer()->params))
|
||||||
? row->pos() : last + 1;
|
? row->pos() : last + 1;
|
||||||
else if (pos > row->pos() &&
|
else if (pos > row->pos() &&
|
||||||
(pos > last || boundary))
|
(pos > last || boundary))
|
||||||
/// Place cursor after char at (logical) position pos - 1
|
/// Place cursor after char at (logical) position pos - 1
|
||||||
cursor_vpos = (bidi_level(pos - 1) % 2 == 0)
|
cursor_vpos = (bidi_level(pos - 1) % 2 == 0)
|
||||||
? log2vis(pos - 1) + 1 : log2vis(pos - 1);
|
? log2vis(pos - 1) + 1 : log2vis(pos - 1);
|
||||||
@ -2154,7 +2154,7 @@ void LyXText::setCursor(BufferView * bview, LyXCursor & cur, Paragraph * par,
|
|||||||
|
|
||||||
|
|
||||||
void LyXText::setCursorIntern(BufferView * bview, Paragraph * par,
|
void LyXText::setCursorIntern(BufferView * bview, Paragraph * par,
|
||||||
pos_type pos, bool setfont, bool boundary) const
|
pos_type pos, bool setfont, bool boundary) const
|
||||||
{
|
{
|
||||||
InsetText * it = static_cast<InsetText *>(par->inInset());
|
InsetText * it = static_cast<InsetText *>(par->inInset());
|
||||||
if (it) {
|
if (it) {
|
||||||
@ -2247,7 +2247,7 @@ void LyXText::setCursorFromCoordinates(BufferView * bview, LyXCursor & cur,
|
|||||||
cur.pos(row->pos() + column);
|
cur.pos(row->pos() + column);
|
||||||
cur.x(x);
|
cur.x(x);
|
||||||
cur.y(y + row->baseline());
|
cur.y(y + row->baseline());
|
||||||
cur.row(row);
|
cur.row(row);
|
||||||
cur.boundary(bound);
|
cur.boundary(bound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
/// Init State
|
/// Init State
|
||||||
class TransInitState : virtual public TransFSMData, public TransState {
|
class TransInitState : virtual public TransFSMData, public TransState {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
TransInitState();
|
TransInitState();
|
||||||
|
@ -53,7 +53,7 @@ bool textUndo(BufferView * bv)
|
|||||||
if (first) {
|
if (first) {
|
||||||
bv->buffer()->redostack.push(
|
bv->buffer()->redostack.push(
|
||||||
createUndo(bv, undo->kind, first,
|
createUndo(bv, undo->kind, first,
|
||||||
bv->buffer()->getParFromID(undo->number_of_behind_par)));
|
bv->buffer()->getParFromID(undo->number_of_behind_par)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ bool textRedo(BufferView * bv)
|
|||||||
if (first) {
|
if (first) {
|
||||||
bv->buffer()->undostack.push(
|
bv->buffer()->undostack.push(
|
||||||
createUndo(bv, undo->kind, first,
|
createUndo(bv, undo->kind, first,
|
||||||
bv->buffer()->getParFromID(undo->number_of_behind_par)));
|
bv->buffer()->getParFromID(undo->number_of_behind_par)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,8 +131,8 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
|
|||||||
// replace the paragraphs with the undo informations
|
// replace the paragraphs with the undo informations
|
||||||
|
|
||||||
Paragraph * tmppar3 = undo->par;
|
Paragraph * tmppar3 = undo->par;
|
||||||
undo->par = 0; /* otherwise the undo destructor would
|
undo->par = 0; /* otherwise the undo destructor would
|
||||||
delete the paragraph */
|
delete the paragraph */
|
||||||
|
|
||||||
// get last undo par and set the right(new) inset-owner of the
|
// get last undo par and set the right(new) inset-owner of the
|
||||||
// paragraph if there is any. This is not needed if we don't have
|
// paragraph if there is any. This is not needed if we don't have
|
||||||
@ -188,7 +188,7 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
|
|||||||
before->next(tmppar3);
|
before->next(tmppar3);
|
||||||
else
|
else
|
||||||
bv->text->ownerParagraph(firstUndoParagraph(bv, undo->number_of_inset_id)->id(),
|
bv->text->ownerParagraph(firstUndoParagraph(bv, undo->number_of_inset_id)->id(),
|
||||||
tmppar3);
|
tmppar3);
|
||||||
|
|
||||||
tmppar3->previous(before);
|
tmppar3->previous(before);
|
||||||
} else {
|
} else {
|
||||||
@ -197,7 +197,7 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
|
|||||||
// one is the first!
|
// one is the first!
|
||||||
if (!before && behind) {
|
if (!before && behind) {
|
||||||
bv->text->ownerParagraph(firstUndoParagraph(bv, undo->number_of_inset_id)->id(),
|
bv->text->ownerParagraph(firstUndoParagraph(bv, undo->number_of_inset_id)->id(),
|
||||||
behind);
|
behind);
|
||||||
tmppar3 = behind;
|
tmppar3 = behind;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -228,8 +228,8 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
|
|||||||
it = static_cast<UpdatableInset*>(tmppar3->inInset());
|
it = static_cast<UpdatableInset*>(tmppar3->inInset());
|
||||||
if (it) {
|
if (it) {
|
||||||
it->getLyXText(bv)->redoParagraphs(bv,
|
it->getLyXText(bv)->redoParagraphs(bv,
|
||||||
it->getLyXText(bv)->cursor,
|
it->getLyXText(bv)->cursor,
|
||||||
endpar);
|
endpar);
|
||||||
if (tmppar) {
|
if (tmppar) {
|
||||||
it = static_cast<UpdatableInset*>(tmppar->inInset());
|
it = static_cast<UpdatableInset*>(tmppar->inInset());
|
||||||
LyXText * t;
|
LyXText * t;
|
||||||
@ -245,7 +245,7 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
|
|||||||
}
|
}
|
||||||
bv->updateInset(it, false);
|
bv->updateInset(it, false);
|
||||||
bv->text->setCursorIntern(bv, bv->text->cursor.par(),
|
bv->text->setCursorIntern(bv, bv->text->cursor.par(),
|
||||||
bv->text->cursor.pos());
|
bv->text->cursor.pos());
|
||||||
} else {
|
} else {
|
||||||
bv->text->redoParagraphs(bv, bv->text->cursor, endpar);
|
bv->text->redoParagraphs(bv, bv->text->cursor, endpar);
|
||||||
if (tmppar) {
|
if (tmppar) {
|
||||||
@ -319,7 +319,7 @@ void unFreezeUndo()
|
|||||||
|
|
||||||
|
|
||||||
void setUndo(BufferView * bv, Undo::undo_kind kind,
|
void setUndo(BufferView * bv, Undo::undo_kind kind,
|
||||||
Paragraph const * first, Paragraph const * behind)
|
Paragraph const * first, Paragraph const * behind)
|
||||||
{
|
{
|
||||||
if (!undo_frozen) {
|
if (!undo_frozen) {
|
||||||
bv->buffer()->undostack.push(createUndo(bv, kind, first, behind));
|
bv->buffer()->undostack.push(createUndo(bv, kind, first, behind));
|
||||||
@ -329,14 +329,14 @@ void setUndo(BufferView * bv, Undo::undo_kind kind,
|
|||||||
|
|
||||||
|
|
||||||
void setRedo(BufferView * bv, Undo::undo_kind kind,
|
void setRedo(BufferView * bv, Undo::undo_kind kind,
|
||||||
Paragraph const * first, Paragraph const * behind)
|
Paragraph const * first, Paragraph const * behind)
|
||||||
{
|
{
|
||||||
bv->buffer()->redostack.push(createUndo(bv, kind, first, behind));
|
bv->buffer()->redostack.push(createUndo(bv, kind, first, behind));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Undo * createUndo(BufferView * bv, Undo::undo_kind kind,
|
Undo * createUndo(BufferView * bv, Undo::undo_kind kind,
|
||||||
Paragraph const * first, Paragraph const * behind)
|
Paragraph const * first, Paragraph const * behind)
|
||||||
{
|
{
|
||||||
lyx::Assert(first);
|
lyx::Assert(first);
|
||||||
|
|
||||||
@ -421,8 +421,8 @@ Undo * createUndo(BufferView * bv, Undo::undo_kind kind,
|
|||||||
int cursor_pos = undoCursor(bv).pos();
|
int cursor_pos = undoCursor(bv).pos();
|
||||||
|
|
||||||
Undo * undo = new Undo(kind, inset_id,
|
Undo * undo = new Undo(kind, inset_id,
|
||||||
before_number, behind_number,
|
before_number, behind_number,
|
||||||
cursor_par, cursor_pos, undopar);
|
cursor_par, cursor_pos, undopar);
|
||||||
|
|
||||||
undo_finished = false;
|
undo_finished = false;
|
||||||
return undo;
|
return undo;
|
||||||
@ -432,7 +432,7 @@ Undo * createUndo(BufferView * bv, Undo::undo_kind kind,
|
|||||||
void setCursorParUndo(BufferView * bv)
|
void setCursorParUndo(BufferView * bv)
|
||||||
{
|
{
|
||||||
setUndo(bv, Undo::FINISH, bv->text->cursor.par(),
|
setUndo(bv, Undo::FINISH, bv->text->cursor.par(),
|
||||||
bv->text->cursor.par()->next());
|
bv->text->cursor.par()->next());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,13 +35,13 @@ extern void freezeUndo();
|
|||||||
extern void unFreezeUndo();
|
extern void unFreezeUndo();
|
||||||
///
|
///
|
||||||
extern void setUndo(BufferView *, Undo::undo_kind kind,
|
extern void setUndo(BufferView *, Undo::undo_kind kind,
|
||||||
Paragraph const * first, Paragraph const * behind);
|
Paragraph const * first, Paragraph const * behind);
|
||||||
///
|
///
|
||||||
extern void setRedo(BufferView *, Undo::undo_kind kind,
|
extern void setRedo(BufferView *, Undo::undo_kind kind,
|
||||||
Paragraph const * first, Paragraph const * behind);
|
Paragraph const * first, Paragraph const * behind);
|
||||||
///
|
///
|
||||||
extern Undo * createUndo(BufferView *, Undo::undo_kind kind,
|
extern Undo * createUndo(BufferView *, Undo::undo_kind kind,
|
||||||
Paragraph const * first, Paragraph const * behind);
|
Paragraph const * first, Paragraph const * behind);
|
||||||
/// for external use in lyx_cb.C
|
/// for external use in lyx_cb.C
|
||||||
extern void setCursorParUndo(BufferView *);
|
extern void setCursorParUndo(BufferView *);
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ using std::getline;
|
|||||||
int VCS::doVCCommand(string const & cmd, string const & path)
|
int VCS::doVCCommand(string const & cmd, string const & path)
|
||||||
{
|
{
|
||||||
lyxerr[Debug::LYXVC] << "doVCCommand: " << cmd << endl;
|
lyxerr[Debug::LYXVC] << "doVCCommand: " << cmd << endl;
|
||||||
Systemcall one;
|
Systemcall one;
|
||||||
Path p(path);
|
Path p(path);
|
||||||
int const ret = one.startscript(Systemcall::Wait, cmd);
|
int const ret = one.startscript(Systemcall::Wait, cmd);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -61,7 +61,7 @@ bool isEndOfData(string const & data)
|
|||||||
* @return a char representing the type of token returned
|
* @return a char representing the type of token returned
|
||||||
*
|
*
|
||||||
* The possible return values are :
|
* The possible return values are :
|
||||||
* + stretch indicator for glue length
|
* + stretch indicator for glue length
|
||||||
* - shrink indicator for glue length
|
* - shrink indicator for glue length
|
||||||
* n a numeric value (stored in number array)
|
* n a numeric value (stored in number array)
|
||||||
* u a unit type (stored in unit array)
|
* u a unit type (stored in unit array)
|
||||||
|
Loading…
Reference in New Issue
Block a user