dispatchresult -> DispatchResult

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7998 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-10-29 10:47:21 +00:00
parent 6d49cbadf0
commit b0eb70e869
79 changed files with 314 additions and 209 deletions

View File

@ -25,6 +25,7 @@
#include "bufferparams.h"
#include "cursor.h"
#include "debug.h"
#include "dispatchresult.h"
#include "factory.h"
#include "FloatList.h"
#include "funcrequest.h"

View File

@ -1,3 +1,18 @@
2003-10-29 Lars Gullik Bjønnes <larsbj@gullik.net>
* text3.C:
* text2.C:
* text.C:
* lyxtext.h:
* lyxfunc.C:
* cursor.C:
* BufferView_pimpl.C: dispatch_result -> DispatchResult changes.
* dispatchresult.h: new file, DispatchResult broken out of
insets/insetbase.h
* Makefile.am (lyx_SOURCES): add dispatchresult.h
2003-10-28 Alfredo Braunstein <abraunst@libero.it>
* text.C (rowBreakPoint): put a hack inside #if 0
@ -50,13 +65,13 @@
2003-10-27 Alfredo Braunstein <abraunst@libero.it>
* text.C:
* lyxrow_funcs.[Ch]:
* Bidi.C:
* paragraph.C:
* lyxtext.h:
* rowpainter.C:
* text2.C:
* text.C:
* lyxrow_funcs.[Ch]:
* Bidi.C:
* paragraph.C:
* lyxtext.h:
* rowpainter.C:
* text2.C:
* text3.C: remove lastPos uses in favour of Row::endpos
2003-10-27 Alfredo Braunstein <abraunst@libero.it>
@ -67,9 +82,9 @@
2003-10-25 Alfredo Braunstein <abraunst@libero.it>
* text.C (prepareToPrint): fix linebreak rowbreaking as suggested
* text.C (prepareToPrint): fix linebreak rowbreaking as suggested
by Martin
(rowBreakPoint): fix width. change point to point + 1.
(rowBreakPoint): fix width. change point to point + 1.
Add a missing check.
2003-10-25 Martin Vermeer <martin.vermeer@hut.fi>
@ -93,7 +108,7 @@
* text3.C (cursorPrevious, cursorNext): fix 2 "dontlikes"
2003-10-23 André Pönitz <poenitz@gmx.net>
* RowList_fwd.h: change list<> to vector<> to gain speed
after suggestion from Alfredo

View File

@ -143,6 +143,7 @@ lyx_SOURCES = \
debug.h \
dimension.C \
dimension.h \
dispatchresult.h \
encoding.C \
encoding.h \
errorlist.C \

View File

@ -14,6 +14,7 @@
#include "BufferView.h"
#include "cursor.h"
#include "debug.h"
#include "dispatchresult.h"
#include "iterators.h"
#include "lyxtext.h"
#include "paragraph.h"

55
src/dispatchresult.h Normal file
View File

@ -0,0 +1,55 @@
// -*- C++ -*-
/**
* \file dispatchresult.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author none
* \author Lars Gullik Bjønnes
*
* Full author contact details are available in file CREDITS.
*/
#ifndef DISPATCH_RESULT_H
#define DISPATCH_RESULT_H
/** Dispatch result codes
DISPATCHED = the inset catched the action
DISPATCHED_NOUPDATE = the inset catched the action and no update
is needed here to redraw the inset
FINISHED = the inset must be unlocked as a result
of the action
FINISHED_RIGHT = FINISHED, but put the cursor to the RIGHT of
the inset.
FINISHED_UP = FINISHED, but put the cursor UP of
the inset.
FINISHED_DOWN = FINISHED, but put the cursor DOWN of
the inset.
UNDISPATCHED = the action was not catched, it should be
dispatched by lower level insets
*/
enum dispatch_result_t {
UNDISPATCHED = 0,
DISPATCHED,
DISPATCHED_NOUPDATE,
FINISHED,
FINISHED_RIGHT,
FINISHED_UP,
FINISHED_DOWN,
DISPATCHED_POP
};
/** \c DispatchResult is a wrapper for dispatch_result_t.
* It can be forward-declared and passed as a function argument without
* having to expose insetbase.h.
*/
class DispatchResult {
dispatch_result_t val_;
public:
DispatchResult()
: val_(UNDISPATCHED) {}
DispatchResult(dispatch_result_t val) : val_(val) {}
operator dispatch_result_t() const{ return val_; }
};
#endif // DISPATCH_RESULT_H

View File

@ -1,3 +1,8 @@
2003-10-29 Lars Gullik Bjønnes <larsbj@gullik.net>
* most insets: dispatch_result -> DispatchResult
* insetbase.h: move DispatchResult out to dispatchresult.h
2003-10-27 André Pönitz <poenitz@gmx.net>
@ -68,7 +73,7 @@
* inset.h:
* insetfloat.h:
* insetfootlike.h: re-introduce display() for insets,
* insetfootlike.h: re-introduce display() for insets,
fixing the various bugs (stretch of line above, math inset
positioning, ...)

View File

@ -11,16 +11,17 @@
#include <config.h>
#include "insetbase.h"
#include "dispatchresult.h"
dispatch_result
DispatchResult
InsetBase::dispatch(FuncRequest const & f, idx_type & i, pos_type & p)
{
return priv_dispatch(f, i, p);
}
dispatch_result
DispatchResult
InsetBase::dispatch(FuncRequest const & f)
{
idx_type i = 0;
@ -29,7 +30,7 @@ InsetBase::dispatch(FuncRequest const & f)
}
dispatch_result
DispatchResult
InsetBase::priv_dispatch(FuncRequest const &, idx_type &, pos_type &)
{
return UNDISPATCHED;

View File

@ -23,45 +23,7 @@ class MetricsInfo;
class Dimension;
class PainterInfo;
class LaTeXFeatures;
/** Dispatch result codes
DISPATCHED = the inset catched the action
DISPATCHED_NOUPDATE = the inset catched the action and no update
is needed here to redraw the inset
FINISHED = the inset must be unlocked as a result
of the action
FINISHED_RIGHT = FINISHED, but put the cursor to the RIGHT of
the inset.
FINISHED_UP = FINISHED, but put the cursor UP of
the inset.
FINISHED_DOWN = FINISHED, but put the cursor DOWN of
the inset.
UNDISPATCHED = the action was not catched, it should be
dispatched by lower level insets
*/
enum dispatch_result {
UNDISPATCHED = 0,
DISPATCHED,
DISPATCHED_NOUPDATE,
FINISHED,
FINISHED_RIGHT,
FINISHED_UP,
FINISHED_DOWN,
DISPATCHED_POP
};
/** \c DispatchResult is a wrapper for dispatch_result.
* It can be forward-declared and passed as a function argument without
* having to expose insetbase.h.
*/
class DispatchResult {
dispatch_result val_;
public:
DispatchResult(dispatch_result val) : val_(val) {}
operator dispatch_result() const{ return val_; }
};
class DispatchResult;
/// Common base class to all insets
class InsetBase {
@ -85,10 +47,10 @@ public:
virtual std::auto_ptr<InsetBase> clone() const = 0;
// the real dispatcher
dispatch_result
DispatchResult
dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
// the real dispatcher
dispatch_result
DispatchResult
dispatch(FuncRequest const & cmd);
/// compute the size of the object returned in dim
@ -103,8 +65,9 @@ public:
std::vector<std::string> & /* list */) const {}
protected:
// the real dispatcher
virtual dispatch_result priv_dispatch
(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
virtual
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
};
#endif

View File

@ -14,6 +14,7 @@
#include "buffer.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "lyxfont.h"
#include "lyxlex.h"
@ -58,7 +59,7 @@ auto_ptr<InsetBase> InsetBibitem::clone() const
}
dispatch_result
DispatchResult
InsetBibitem::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -53,7 +53,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///

View File

@ -14,6 +14,7 @@
#include "buffer.h"
#include "bufferparams.h"
#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "gettext.h"
@ -87,7 +88,7 @@ void InsetBibtex::draw(PainterInfo & pi, int x, int y) const
}
dispatch_result
DispatchResult
InsetBibtex::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -53,7 +53,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};

View File

@ -13,9 +13,10 @@
#include <config.h>
#include "insetbox.h"
#include "debug.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
@ -164,7 +165,7 @@ bool InsetBox::showInsetDialog(BufferView * bv) const
}
dispatch_result
DispatchResult
InsetBox::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -102,7 +102,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
friend class InsetBoxParams;

View File

@ -15,6 +15,7 @@
#include "buffer.h"
#include "bufferparams.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LColor.h"
@ -116,7 +117,7 @@ bool InsetBranch::showInsetDialog(BufferView * bv) const
}
dispatch_result
DispatchResult
InsetBranch::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -73,7 +73,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
friend class InsetBranchParams;

View File

@ -16,6 +16,7 @@
#include "buffer.h"
#include "bufferparams.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "LaTeXFeatures.h"
@ -308,7 +309,7 @@ string const InsetCitation::getScreenLabel(Buffer const & buffer) const
}
dispatch_result
DispatchResult
InsetCitation::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -40,13 +40,13 @@ public:
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
dispatch_result localDispatch(FuncRequest const & cmd);
DispatchResult localDispatch(FuncRequest const & cmd);
///
void validate(LaTeXFeatures &) const;
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
struct Cache {

View File

@ -17,6 +17,7 @@
#include "buffer.h"
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "LColor.h"
#include "lyxlex.h"
#include "funcrequest.h"
@ -281,7 +282,7 @@ void InsetCollapsable::edit(BufferView * bv, int index)
}
dispatch_result
DispatchResult
InsetCollapsable::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
@ -355,7 +356,7 @@ InsetCollapsable::priv_dispatch(FuncRequest const & cmd,
return DISPATCHED;
default:
dispatch_result result = inset.dispatch(cmd);
DispatchResult result = inset.dispatch(cmd);
if (result >= FINISHED)
bv->unlockInset(this);
first_after_edit = false;

View File

@ -151,7 +151,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
///
void dimension_collapsed(Dimension &) const;

View File

@ -14,6 +14,7 @@
#include "insetcommand.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "lyxlex.h"
#include "metricsinfo.h"
@ -84,7 +85,7 @@ int InsetCommand::docbook(Buffer const &, ostream &, bool) const
}
dispatch_result
DispatchResult
InsetCommand::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
{
switch (cmd.action) {

View File

@ -55,7 +55,7 @@ public:
virtual int docbook(Buffer const &, std::ostream &, bool) const;
///
InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
///
InsetCommandParams const & params() const { return p_; }
///
@ -70,7 +70,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
///
std::string const getCommand() const { return p_.getCommand(); }

View File

@ -16,6 +16,7 @@
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "language.h"
@ -421,11 +422,11 @@ int InsetERT::docbook(Buffer const &, ostream & os, bool) const
}
dispatch_result
DispatchResult
InsetERT::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
dispatch_result result = UNDISPATCHED;
DispatchResult result = UNDISPATCHED;
BufferView * bv = cmd.view();
if (inset.paragraphs.begin()->empty()) {

View File

@ -111,7 +111,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
///

View File

@ -20,6 +20,7 @@
#include "buffer.h"
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
@ -120,7 +121,7 @@ Translator<DisplayType, string> const initTranslator()
} // namespace anon
Translator<DisplayType, string> const & displayTranslator()
Translator<DisplayType, string> const & displayTranslator()
{
static Translator<DisplayType, string> const translator =
initTranslator();
@ -426,7 +427,7 @@ void InsetExternal::statusChanged() const
}
dispatch_result
DispatchResult
InsetExternal::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
{
switch (cmd.action) {

View File

@ -142,7 +142,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
/** This method is connected to the graphics loader, so we are

View File

@ -17,6 +17,7 @@
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "Floating.h"
#include "FloatList.h"
#include "funcrequest.h"
@ -159,7 +160,7 @@ InsetFloat::~InsetFloat()
}
dispatch_result
DispatchResult
InsetFloat::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -79,7 +79,7 @@ public:
InsetFloatParams const & params() const { return params_; }
protected:
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///

View File

@ -15,6 +15,7 @@
#include "buffer.h"
#include "bufferparams.h"
#include "debug.h"
#include "dispatchresult.h"
#include "Floating.h"
#include "FloatList.h"
#include "funcrequest.h"
@ -118,7 +119,7 @@ void InsetFloatList::draw(PainterInfo & pi, int x, int y) const
}
dispatch_result
DispatchResult
InsetFloatList::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -59,7 +59,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};

View File

@ -59,6 +59,7 @@ TODO
#include "BufferView.h"
#include "converter.h"
#include "debug.h"
#include "dispatchresult.h"
#include "format.h"
#include "funcrequest.h"
#include "gettext.h"
@ -190,7 +191,7 @@ void InsetGraphics::statusChanged() const
}
dispatch_result
DispatchResult
InsetGraphics::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
{
switch (cmd.action) {

View File

@ -77,7 +77,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///

View File

@ -18,6 +18,7 @@
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
@ -107,7 +108,7 @@ InsetInclude::~InsetInclude()
}
dispatch_result
DispatchResult
InsetInclude::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
{
switch (cmd.action) {

View File

@ -80,7 +80,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
/// Slot receiving a signal that the preview is ready to display.

View File

@ -11,6 +11,7 @@
#include "insetindex.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
@ -60,7 +61,7 @@ void InsetPrintIndex::draw(PainterInfo & pi, int x, int y) const
}
dispatch_result
DispatchResult
InsetIndex::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -40,7 +40,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};

View File

@ -13,6 +13,7 @@
#include "insetlabel.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "frontends/LyXView.h"
@ -56,7 +57,7 @@ string const InsetLabel::getScreenLabel(Buffer const &) const
}
dispatch_result
DispatchResult
InsetLabel::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -42,7 +42,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};

View File

@ -444,8 +444,8 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
case ACUTE:
drawAccent(pi, x2, baseline, char(0xB4));
break;
case GRAVE:
case GRAVE:
drawAccent(pi, x2, baseline, char(0x60));
break;
@ -477,7 +477,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
drawAccent(pi, x2, baseline, '.');
break;
case CIRCLE:
case CIRCLE:
drawAccent(pi, x2, baseline, char(0xB0));
break;

View File

@ -15,6 +15,7 @@
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LColor.h"
@ -95,7 +96,7 @@ InsetMinipage::~InsetMinipage()
}
dispatch_result
DispatchResult
InsetMinipage::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -91,7 +91,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///

View File

@ -15,6 +15,7 @@
#include "insetnote.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
@ -129,7 +130,7 @@ bool InsetNote::showInsetDialog(BufferView * bv) const
}
dispatch_result
DispatchResult
InsetNote::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -71,7 +71,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
friend class InsetNoteParams;

View File

@ -13,6 +13,7 @@
#include "buffer.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
@ -45,8 +46,9 @@ InsetRef::~InsetRef()
}
dispatch_result
InsetRef::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
DispatchResult
InsetRef::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
case LFUN_INSET_EDIT:

View File

@ -67,7 +67,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///

View File

@ -16,6 +16,7 @@
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "FuncStatus.h"
#include "gettext.h"
@ -660,14 +661,14 @@ void InsetTabular::edit(BufferView * bv, int index)
}
dispatch_result
DispatchResult
InsetTabular::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
// We need to save the value of the_locking_inset as the call to
// the_locking_inset->localDispatch might unlock it.
old_locking_inset = the_locking_inset;
dispatch_result result = UpdatableInset::priv_dispatch(cmd, idx, pos);
DispatchResult result = UpdatableInset::priv_dispatch(cmd, idx, pos);
BufferView * bv = cmd.view();
if (cmd.action == LFUN_INSET_EDIT) {
@ -1394,7 +1395,7 @@ void InsetTabular::resetPos(BufferView * bv) const
}
dispatch_result InsetTabular::moveRight(BufferView * bv, bool lock)
DispatchResult InsetTabular::moveRight(BufferView * bv, bool lock)
{
if (lock && !old_locking_inset) {
if (activateCellInset(bv))
@ -1412,7 +1413,7 @@ dispatch_result InsetTabular::moveRight(BufferView * bv, bool lock)
}
dispatch_result InsetTabular::moveLeft(BufferView * bv, bool lock)
DispatchResult InsetTabular::moveLeft(BufferView * bv, bool lock)
{
bool moved = isRightToLeft(bv) ? moveNextCell(bv) : movePrevCell(bv);
if (!moved)
@ -1425,7 +1426,7 @@ dispatch_result InsetTabular::moveLeft(BufferView * bv, bool lock)
}
dispatch_result InsetTabular::moveUp(BufferView * bv, bool lock)
DispatchResult InsetTabular::moveUp(BufferView * bv, bool lock)
{
int const ocell = actcell;
actcell = tabular.getCellAbove(actcell);
@ -1446,7 +1447,7 @@ dispatch_result InsetTabular::moveUp(BufferView * bv, bool lock)
}
dispatch_result InsetTabular::moveDown(BufferView * bv, bool lock)
DispatchResult InsetTabular::moveDown(BufferView * bv, bool lock)
{
int const ocell = actcell;
actcell = tabular.getCellBelow(actcell);

View File

@ -207,7 +207,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
/// lock cell with given index
@ -235,13 +235,13 @@ private:
///
void setPos(BufferView *, int x, int y) const;
///
dispatch_result moveRight(BufferView *, bool lock = true);
DispatchResult moveRight(BufferView *, bool lock = true);
///
dispatch_result moveLeft(BufferView *, bool lock = true);
DispatchResult moveLeft(BufferView *, bool lock = true);
///
dispatch_result moveUp(BufferView *, bool lock = true);
DispatchResult moveUp(BufferView *, bool lock = true);
///
dispatch_result moveDown(BufferView *, bool lock = true);
DispatchResult moveDown(BufferView *, bool lock = true);
///
bool moveNextCell(BufferView *, bool lock = false);
///

View File

@ -18,6 +18,7 @@
#include "BufferView.h"
#include "CutAndPaste.h"
#include "debug.h"
#include "dispatchresult.h"
#include "errorlist.h"
#include "funcrequest.h"
#include "gettext.h"
@ -587,7 +588,7 @@ void InsetText::lfunMouseMotion(FuncRequest const & cmd)
}
dispatch_result
DispatchResult
InsetText::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
@ -669,7 +670,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
bool was_empty = paragraphs.begin()->empty() && paragraphs.size() == 1;
no_selection = false;
dispatch_result result = UpdatableInset::priv_dispatch(cmd, idx, pos);
DispatchResult result = UpdatableInset::priv_dispatch(cmd, idx, pos);
if (result != UNDISPATCHED)
return DISPATCHED;
@ -1178,7 +1179,7 @@ void InsetText::fitInsetCursor(BufferView * bv) const
}
dispatch_result InsetText::moveRight(BufferView * bv)
DispatchResult InsetText::moveRight(BufferView * bv)
{
if (text_.cursorPar()->isRightToLeftPar(bv->buffer()->params()))
return moveLeftIntern(bv, false, true, false);
@ -1187,7 +1188,7 @@ dispatch_result InsetText::moveRight(BufferView * bv)
}
dispatch_result InsetText::moveLeft(BufferView * bv)
DispatchResult InsetText::moveLeft(BufferView * bv)
{
if (text_.cursorPar()->isRightToLeftPar(bv->buffer()->params()))
return moveRightIntern(bv, true, true, false);
@ -1196,7 +1197,7 @@ dispatch_result InsetText::moveLeft(BufferView * bv)
}
dispatch_result
DispatchResult
InsetText::moveRightIntern(BufferView * bv, bool front,
bool activate_inset, bool selecting)
{
@ -1213,7 +1214,7 @@ InsetText::moveRightIntern(BufferView * bv, bool front,
}
dispatch_result
DispatchResult
InsetText::moveLeftIntern(BufferView * bv, bool front,
bool activate_inset, bool selecting)
{
@ -1228,7 +1229,7 @@ InsetText::moveLeftIntern(BufferView * bv, bool front,
}
dispatch_result InsetText::moveUp(BufferView * bv)
DispatchResult InsetText::moveUp(BufferView * bv)
{
if (crow() == text_.firstRow())
return FINISHED_UP;
@ -1238,7 +1239,7 @@ dispatch_result InsetText::moveUp(BufferView * bv)
}
dispatch_result InsetText::moveDown(BufferView * bv)
DispatchResult InsetText::moveDown(BufferView * bv)
{
if (crow() == text_.lastRow())
return FINISHED_DOWN;

View File

@ -202,7 +202,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
///
void updateLocal(BufferView *, bool mark_dirty);
@ -222,22 +222,22 @@ private:
void lfunMouseMotion(FuncRequest const &);
///
dispatch_result moveRight(BufferView *);
DispatchResult moveRight(BufferView *);
///
dispatch_result moveLeft(BufferView *);
DispatchResult moveLeft(BufferView *);
///
dispatch_result moveRightIntern(BufferView *, bool front,
DispatchResult moveRightIntern(BufferView *, bool front,
bool activate_inset = true,
bool selecting = false);
///
dispatch_result moveLeftIntern(BufferView *, bool front,
DispatchResult moveLeftIntern(BufferView *, bool front,
bool activate_inset = true,
bool selecting = false);
///
dispatch_result moveUp(BufferView *);
DispatchResult moveUp(BufferView *);
///
dispatch_result moveDown(BufferView *);
DispatchResult moveDown(BufferView *);
///
void setCharFont(Buffer const &, int pos, LyXFont const & font);
///

View File

@ -12,6 +12,7 @@
#include "insettoc.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "metricsinfo.h"
@ -73,8 +74,9 @@ void InsetTOC::draw(PainterInfo & pi, int x, int y) const
}
dispatch_result
InsetTOC::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
DispatchResult
InsetTOC::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
case LFUN_MOUSE_RELEASE:

View File

@ -49,7 +49,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};

View File

@ -12,6 +12,7 @@
#include "inseturl.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "latexrunparams.h"
#include "LaTeXFeatures.h"
@ -43,7 +44,7 @@ InsetUrl::~InsetUrl()
}
dispatch_result
DispatchResult
InsetUrl::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -52,7 +52,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};

View File

@ -16,6 +16,7 @@
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "Floating.h"
#include "FloatList.h"
#include "funcrequest.h"
@ -83,7 +84,7 @@ InsetWrap::~InsetWrap()
}
dispatch_result
DispatchResult
InsetWrap::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{

View File

@ -71,7 +71,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///

View File

@ -17,6 +17,7 @@
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "lyxtext.h"
#include "WordLangTuple.h"
@ -108,7 +109,7 @@ void UpdatableInset::scroll(BufferView * bv, int offset) const
/// An updatable inset could handle lyx editing commands
dispatch_result
DispatchResult
UpdatableInset::priv_dispatch(FuncRequest const & ev, idx_type &, pos_type &)
{
if (ev.action == LFUN_MOUSE_RELEASE)

View File

@ -113,7 +113,7 @@ public:
protected:
/// An updatable inset could handle lyx editing commands
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
/// scrolls to absolute position in bufferview-workwidth * sx units
void scroll(BufferView *, float sx) const;

View File

@ -29,6 +29,7 @@
#include "BufferView.h"
#include "cursor.h"
#include "debug.h"
#include "dispatchresult.h"
#include "encoding.h"
#include "exporter.h"
#include "format.h"
@ -894,7 +895,7 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
if (view()->available() && view()->theLockingInset()) {
dispatch_result result;
DispatchResult result;
if (action > 1 || (action == LFUN_UNKNOWN_ACTION &&
!keyseq.deleted()))
{
@ -1485,12 +1486,12 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
break;
}
case LFUN_DIALOG_SHOW_NEXT_INSET:
case LFUN_DIALOG_SHOW_NEXT_INSET:
break;
case LFUN_INSET_DIALOG_SHOW: {
InsetOld * inset = view()->getLyXText()->getInset();
if (inset)
if (inset)
inset->dispatch(FuncRequest(view(), LFUN_INSET_DIALOG_SHOW));
break;
}
@ -1556,7 +1557,7 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
argument = split(argument, countstr, ' ');
istringstream is(countstr);
int count = 0;
is >> count;
is >> count;
lyxerr << "repeat: count: " << count << " cmd: " << argument << endl;
for (int i = 0; i < count; ++i)
dispatch(lyxaction.lookupFunc(argument));
@ -1631,7 +1632,7 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
if (isStrInt(argument)) {
pid_t const pid = strToInt(argument);
ForkedcallsController & fcc = ForkedcallsController::get();
fcc.kill(pid);
fcc.kill(pid);
}
break;

View File

@ -150,7 +150,7 @@ public:
void metrics(MetricsInfo & mi, Dimension & dim);
///
dispatch_result dispatch(FuncRequest const & cmd);
DispatchResult dispatch(FuncRequest const & cmd);
BufferView * bv();
@ -409,7 +409,7 @@ private:
/// FIXME
int labelEnd(ParagraphList::iterator pit, Row const & row) const;
///
void charInserted();

View File

@ -1,3 +1,19 @@
2003-10-29 Lars Gullik Bjønnes <larsbj@gullik.net>
* math_scriptinset.h: change dispatch to priv_dispatch and make it
protected
* math_nestinset.h: make priv_dispatch protected
* math_hullinset.h: make priv_dispatch protected
* math_gridinset.h: make priv_dispatch protected
* command_inset.[Ch]: change dispatch to priv_dispatch and make it
protected.
* several files: dispatch_result -> DispatchResult
2003-10-22 Angus Leeming <leeming@lyx.org>
* formula.C (generatePreview): changes due to the changed
@ -15,7 +31,7 @@
into this
(localDispatch): delete
* math_nestinset.C (dispatch):
* math_nestinset.C (dispatch):
* math_hullinset.C (dispatch):
* math_gridinset.C (dispatch):
* formulabase.C (openNewInset, priv_dispatch, mathDispatch):

View File

@ -13,6 +13,7 @@
#include "command_inset.h"
#include "math_data.h"
#include "math_mathmlstream.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "support/std_sstream.h"
@ -52,8 +53,10 @@ void CommandInset::draw(PainterInfo & pi, int x, int y) const
button_.draw(pi, x, y);
}
dispatch_result
CommandInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
DispatchResult
CommandInset::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
default:

View File

@ -33,14 +33,16 @@ public:
//
// void infoize(std::ostream & os) const;
///
dispatch_result dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
///
virtual std::string const screenLabel() const;
/// generate something that will be understood by the Dialogs.
std::string const createDialogStr(std::string const & name) const;
std::string const & commandname() const { return name_; }
protected:
///
virtual
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
private:
std::string name_;
mutable bool set_label_;

View File

@ -26,6 +26,7 @@
#include "BufferView.h"
#include "bufferview_funcs.h"
#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "gettext.h"
@ -211,7 +212,7 @@ void InsetFormulaBase::toggleInsetSelection(BufferView * bv)
}
dispatch_result InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
DispatchResult InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
{
if (!mathcursor)
return UNDISPATCHED;
@ -256,7 +257,7 @@ dispatch_result InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
}
dispatch_result InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
DispatchResult InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
{
BufferView * bv = cmd.view();
//lyxerr << "lfunMousePress: buttons: " << cmd.button() << endl;
@ -288,7 +289,7 @@ dispatch_result InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
}
dispatch_result InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
DispatchResult InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
{
if (!mathcursor)
return DISPATCHED;
@ -316,7 +317,7 @@ dispatch_result InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
}
dispatch_result
DispatchResult
InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
idx_type &, pos_type &)
{
@ -370,7 +371,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
return UNDISPATCHED;
string argument = cmd.argument;
dispatch_result result = DISPATCHED;
DispatchResult result = DISPATCHED;
bool sel = false;
bool was_macro = mathcursor->inMacroMode();
bool was_selection = mathcursor->selection();
@ -494,7 +495,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
// case LFUN_GETXY:
// sprintf(dispatch_buffer, "%d %d",);
// dispatch_result = dispatch_buffer;
// DispatchResult= dispatch_buffer;
// break;
case LFUN_SETXY: {
lyxerr << "LFUN_SETXY broken!" << endl;

View File

@ -84,7 +84,7 @@ public:
protected:
/// To allow transparent use of math editing functions
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
/// unimplemented
@ -92,11 +92,11 @@ private:
/// common base for handling accents
void handleAccent(BufferView * bv, std::string const & arg, std::string const & name);
/// lfun handler
dispatch_result lfunMousePress(FuncRequest const &);
DispatchResult lfunMousePress(FuncRequest const &);
///
dispatch_result lfunMouseRelease(FuncRequest const &);
DispatchResult lfunMouseRelease(FuncRequest const &);
///
dispatch_result lfunMouseMotion(FuncRequest const &);
DispatchResult lfunMouseMotion(FuncRequest const &);
protected:

View File

@ -11,11 +11,12 @@
#include <config.h>
#include "math_cursor.h"
#include "lyxrc.h"
#include "support/limited_stack.h"
#include "dispatchresult.h"
#include "debug.h"
#include "support/std_sstream.h"
#include "math_cursor.h"
#include "formulabase.h"
#include "funcrequest.h"
#include "math_braceinset.h"
@ -1406,7 +1407,7 @@ CursorPos MathCursor::normalAnchor() const
}
dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
DispatchResult MathCursor::dispatch(FuncRequest const & cmd)
{
// mouse clicks are somewhat special
// check
@ -1416,7 +1417,7 @@ dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
case LFUN_MOUSE_RELEASE:
case LFUN_MOUSE_DOUBLE: {
CursorPos & pos = Cursor_.back();
dispatch_result res = UNDISPATCHED;
DispatchResult res = UNDISPATCHED;
int x = 0, y = 0;
getPos(x, y);
if (x < cmd.x && hasPrevAtom()) {
@ -1436,7 +1437,7 @@ dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
for (int i = Cursor_.size() - 1; i >= 0; --i) {
CursorPos & pos = Cursor_[i];
dispatch_result res = pos.inset_->dispatch(cmd, pos.idx_, pos.pos_);
DispatchResult res = pos.inset_->dispatch(cmd, pos.idx_, pos.pos_);
if (res != UNDISPATCHED) {
if (res == DISPATCHED_POP) {
Cursor_.shrink(i + 1);

View File

@ -217,9 +217,6 @@ public:
CursorPos const & cursor() const;
/// how deep are we nested?
unsigned depth() const;
/// local dispatcher
dispatch_result dispatch(FuncRequest const & cmd);
/// describe the situation
std::string info() const;
/// dump selection information for debugging
@ -246,7 +243,9 @@ public:
void pullArg();
/// split font inset etc
void handleFont(std::string const & font);
///
DispatchResult
dispatch(FuncRequest const & cmd);
private:
/// moves cursor index one cell to the left
bool idxLeft();

View File

@ -14,6 +14,7 @@
#include "math_data.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "LColor.h"
@ -1041,7 +1042,7 @@ void MathGridInset::splitCell(idx_type & idx, pos_type & pos)
}
dispatch_result MathGridInset::priv_dispatch(FuncRequest const & cmd,
DispatchResult MathGridInset::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
switch (cmd.action) {

View File

@ -135,10 +135,6 @@ public:
MathGridInset * asGridInset() { return this; }
/// identifies GridInset
MathGridInset const * asGridInset() const { return this; }
/// local dispatcher
dispatch_result priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos);
///
col_type ncols() const;
///
@ -219,6 +215,11 @@ public:
//void octave(OctaveStream &) const;
protected:
///
virtual
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
/// returns x offset of cell compared to inset
int cellXOffset(idx_type idx) const;
/// returns y offset of cell compared to inset

View File

@ -18,6 +18,7 @@
#include "math_extern.h"
#include "math_charinset.h"
#include "textpainter.h"
#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "gettext.h"
@ -771,7 +772,7 @@ void MathHullInset::doExtern
}
dispatch_result MathHullInset::priv_dispatch
DispatchResult MathHullInset::priv_dispatch
(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
{
switch (cmd.action) {

View File

@ -50,9 +50,6 @@ public:
bool display() const;
///
bool ams() const;
/// local dispatcher
dispatch_result priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos);
/// Appends \c list with all labels found within this inset.
void getLabelList(Buffer const &,
std::vector<std::string> & list) const;
@ -100,6 +97,10 @@ public:
void infoize(std::ostream & os) const;
protected:
///
virtual
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
///
std::string eolString(row_type row, bool fragile) const;

View File

@ -15,6 +15,7 @@
#include "math_mathmlstream.h"
#include "math_parser.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "LColor.h"
@ -285,8 +286,9 @@ void MathNestInset::notifyCursorLeaves(idx_type idx)
}
dispatch_result MathNestInset::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
DispatchResult
MathNestInset::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
BufferView * bv = cmd.view();

View File

@ -101,12 +101,12 @@ public:
void write(WriteStream & os) const;
/// writes [, name(), and args in []
void normalize(NormalStream & os) const;
/// local dispatcher
dispatch_result priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos);
protected:
///
virtual
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
/// we store the cells in a vector
typedef std::vector<MathArray> cells_type;
/// thusly:
@ -123,7 +123,6 @@ protected:
void metricsMarkers(int frame = 1) const;
/// add space for markers
void metricsMarkers2(int frame = 1) const;
};
#endif

View File

@ -15,6 +15,7 @@
#include "math_mathmlstream.h"
#include "math_support.h"
#include "math_symbolinset.h"
#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
@ -511,8 +512,9 @@ void MathScriptInset::notifyCursorLeaves(idx_type idx)
}
dispatch_result MathScriptInset::dispatch
(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
DispatchResult
MathScriptInset::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
if (cmd.action == LFUN_MATH_LIMITS) {
if (!cmd.argument.empty()) {

View File

@ -95,9 +95,11 @@ public:
void infoize(std::ostream & os) const;
/// say whether we have displayed limits
void infoize2(std::ostream & os) const;
/// local dispatcher
dispatch_result dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
protected:
///
virtual
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
private:
/// returns x offset for main part
int dxx() const;

View File

@ -15,6 +15,7 @@
#include "math_factory.h"
#include "BufferView.h"
#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "math_support.h"
@ -52,8 +53,9 @@ void RefInset::infoize(std::ostream & os) const
}
dispatch_result
RefInset::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
DispatchResult
RefInset::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
case LFUN_INSET_MODIFY:

View File

@ -43,7 +43,7 @@ public:
int docbook(std::ostream & os, bool) const;
/// small wrapper for the time being
dispatch_result localDispatch(FuncRequest const & cmd);
DispatchResult localDispatch(FuncRequest const & cmd);
struct ref_type_info {
///
@ -61,7 +61,7 @@ public:
protected:
///
virtual
dispatch_result
DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
};

View File

@ -22,6 +22,7 @@
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "encoding.h"
#include "funcrequest.h"
#include "gettext.h"
@ -200,7 +201,7 @@ int LyXText::singleWidth(ParagraphList::iterator pit,
return font_metrics::width(c, font);
}
if (c == Paragraph::META_INSET)
if (c == Paragraph::META_INSET)
return pit->getInset(pos)->width();
if (IsSeparatorChar(c))
@ -409,7 +410,7 @@ namespace {
pos_type addressBreakPoint(pos_type i, Paragraph const & par)
{
pos_type const end = par.size();
for (; i < end; ++i)
if (par.isNewline(i))
return i + 1;
@ -428,7 +429,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
row.endpos(end);
return;
}
// maximum pixel width of a row.
int width = workWidth() - rightMargin(*pit, *bv()->buffer());
// - leftMargin(pit, row);
@ -472,7 +473,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
point = i + 1;
break;
}
// Break before...
// Break before...
if (i + 1 < end) {
InsetOld * in = pit->getInset(i + 1);
if (in && in->display()) {
@ -488,12 +489,12 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
}
char const c = pit->getChar(i);
if (i > endPosOfFontSpan) {
font = getFont(pit, i);
endPosOfFontSpan = pit->getEndPosOfFontSpan(i);
}
{
int thiswidth = singleWidth(pit, i, c, font);
@ -512,7 +513,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
//<< x << " width: " << width << endl;
chunkwidth += thiswidth;
}
// break before a character that will fall off
// the right of the row
@ -521,7 +522,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
if (point == end || chunkwidth >= width - left) {
if (i > pos) {
point = i;
break;
break;
}
}
// exit on last registered breakpoint:
@ -537,7 +538,7 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
// some insets are line separators too
if (pit->isLineSeparator(i)) {
// register breakpoint:
point = i + 1;
point = i + 1;
chunkwidth = 0;
}
}
@ -709,7 +710,7 @@ void LyXText::setHeightOfRow(ParagraphList::iterator pit, Row & row)
BufferParams const & bufparams = bv()->buffer()->params();
// some parksips VERY EASY IMPLEMENTATION
if (bv()->buffer()->params().paragraph_separation
== BufferParams::PARSEP_SKIP
== BufferParams::PARSEP_SKIP
&& pit != ownerParagraphs().begin()
&& ((layout->isParagraph() && pit->getDepth() == 0)
|| (boost::prior(pit)->layout()->isParagraph()
@ -1106,7 +1107,7 @@ void LyXText::prepareToPrint(ParagraphList::iterator pit, Row & row) const
{
align = LYX_ALIGN_CENTER;
}
switch (align) {
case LYX_ALIGN_BLOCK: {
int const ns = numberOfSeparators(*pit, row);

View File

@ -29,6 +29,7 @@
#include "counters.h"
#include "CutAndPaste.h"
#include "debug.h"
#include "dispatchresult.h"
#include "errorlist.h"
#include "Floating.h"
#include "FloatList.h"
@ -602,7 +603,7 @@ void LyXText::toggleFree(LyXFont const & font, bool toggleall)
// If there is a change in the language the implicit word selection
// is disabled.
LyXCursor resetCursor = cursor;
bool implicitSelection =
bool implicitSelection =
font.language() == ignore_language
&& font.number() == LyXFont::IGNORE
&& selectWordWhenUnderCursor(lyx::WHOLE_WORD_STRICT);
@ -1354,7 +1355,7 @@ float LyXText::getCursorX(ParagraphList::iterator pit, Row const & row,
double fill_label_hfill = row.fill_label_hfill();
pos_type const row_pos = row.pos();
pos_type const end = row.endpos();
if (end <= row_pos)
cursor_vpos = row_pos;
else if (pos >= end && !boundary)

View File

@ -21,6 +21,7 @@
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
#include "dispatchresult.h"
#include "factory.h"
#include "funcrequest.h"
#include "gettext.h"
@ -389,7 +390,7 @@ void doInsertInset(LyXText * lt, FuncRequest const & cmd,
} // anon namespace
dispatch_result LyXText::dispatch(FuncRequest const & cmd)
DispatchResult LyXText::dispatch(FuncRequest const & cmd)
{
lyxerr[Debug::ACTION] << "LyXText::dispatch: action[" << cmd.action
<<"] arg[" << cmd.argument << ']' << "xy[" <<