simple ws changes only

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8594 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2004-04-03 08:37:12 +00:00
parent e4025acc32
commit 68b7ef25fb
96 changed files with 267 additions and 283 deletions

View File

@ -46,8 +46,8 @@ struct Bidi {
///
void computeTables(Paragraph const & par,
Buffer const &, Row const & row);
private:
///
private:
///
bool same_direction_;
///
std::vector<lyx::pos_type> log2vis_list_;

View File

@ -405,7 +405,7 @@ void BufferView::putSelectionAt(DocIterator const & cur,
LyXText & text = *cur[0].text();
setCursor(par, cur.pos());
// hack for the chicken and egg problem
top_y(text.getPar(par.outerPar()).y);

View File

@ -115,7 +115,7 @@ public:
/// return the parent language of the given inset
Language const * getParentLanguage(InsetOld * inset) const;
/// simple replacing. Use the font of the first selected character
/// simple replacing. Use the font of the first selected character
void replaceSelectionWithString(std::string const & str);
/// move cursor to the named label
@ -163,7 +163,7 @@ public:
FuncStatus getStatus(FuncRequest const & cmd);
/// execute the given function
bool dispatch(FuncRequest const & argument);
/// clear the X selection
void unsetXSel();

View File

@ -878,7 +878,7 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0)
lyxerr << "created temp cursor:\n" << cur << endl;
// Try to dispatch to an non-editable inset near this position
// via the temp cursor. If the inset wishes to change the real
// via the temp cursor. If the inset wishes to change the real
// cursor it has to do so explicitly by using
// cur.bv().cursor() = cur; (or similar)'
DispatchResult res;
@ -890,7 +890,7 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0)
if (!res.dispatched())
res = cur.dispatch(cmd);
// If the request was dispatched the temp cursor should have been
// If the request was dispatched the temp cursor should have been
// in a way to be used as new 'real' cursor.
if (res.dispatched())
bv_->cursor() = cur;
@ -924,7 +924,7 @@ FuncStatus BufferView::Pimpl::getStatus(FuncRequest const & cmd)
Buffer * buf = bv_->buffer();
FuncStatus flag;
switch (cmd.action) {
case LFUN_UNDO:

View File

@ -84,7 +84,7 @@ int SwitchLayoutsBetweenClasses(textclass_type c1, textclass_type c2,
InsetText in;
std::swap(in.paragraphs(), pars);
ParIterator end = par_iterator_end(in);
for (ParIterator it = par_iterator_begin(in); it != end; ++it) {
string const name = it->layout()->name();
@ -330,7 +330,7 @@ pasteSelection(Buffer const & buffer, ParagraphList & pars,
}
}
std::swap(in.paragraphs(), insertion);
// Split the paragraph for inserting the buf if necessary.
bool did_split = false;
if (pars[pit].size() || pit + 1 == par_type(pars.size())) {
@ -343,7 +343,7 @@ pasteSelection(Buffer const & buffer, ParagraphList & pars,
mergeParagraph(buffer.params(), pars, pit);
par_type last_paste = pit + insertion.size() - 1;
// Store the new cursor position.
pit = last_paste;
pos = pars[last_paste].size();

View File

@ -6,7 +6,7 @@
* \author Alfredo Braunstein
*
* Full author contact details are available in file CREDITS.
*
*
*/

View File

@ -32,7 +32,7 @@ class FontIterator : std::iterator<std::forward_iterator_tag, LyXFont>
public:
///
FontIterator(LyXText const & text, lyx::par_type pit, lyx::pos_type pos);
///
///
LyXFont operator*() const;
///
FontIterator & operator++();

View File

@ -52,7 +52,7 @@ public:
///
bool empty() const { return list.empty(); }
///
iterator insetIterator(lyx::pos_type pos);
iterator insetIterator(lyx::pos_type pos);
///
const_iterator insetIterator(lyx::pos_type pos) const;
///

View File

@ -223,7 +223,7 @@ bool LColor::setColor(LColor::color col, string const & x11name)
<< " may not be redefined" << endl;
return false;
}
it->second.x11name = x11name;
return true;
}
@ -233,8 +233,8 @@ bool LColor::setColor(string const & lyxname, string const &x11name)
{
string const lcname = ascii_lowercase(lyxname);
if (pimpl_->transform.find(lcname) == pimpl_->transform.end()) {
lyxerr[Debug::GUI]
<< "LColor::setColor: Unknown color \""
lyxerr[Debug::GUI]
<< "LColor::setColor: Unknown color \""
<< lyxname << '"' << endl;
addColor(static_cast<color>(pimpl_->infotab.size()), lcname);
}
@ -267,7 +267,7 @@ LColor::color LColor::getFromLyXName(string const & lyxname) const
{
string const lcname = ascii_lowercase(lyxname);
if (pimpl_->transform.find(lcname) == pimpl_->transform.end()) {
lyxerr << "LColor::getFromLyXName: Unknown color \""
lyxerr << "LColor::getFromLyXName: Unknown color \""
<< lyxname << '"' << endl;
return none;
}

View File

@ -306,7 +306,7 @@ string const LaTeXFeatures::getPackages() const
}
packages << "]{natbib}\n";
}
// bibtopic -- the dot provides the aux file naming which
// LyX can detect.
if (isRequired("bibtopic")) {
@ -420,7 +420,7 @@ string const LaTeXFeatures::getTClassPreamble() const
if (isRequired(cs->name))
tcpreamble << cs->preamble;
}
return tcpreamble.str();
}

View File

@ -16,13 +16,13 @@
class Paragraph;
class ParagraphList : public std::vector<Paragraph>
class ParagraphList : public std::vector<Paragraph>
{
public:
///
typedef std::vector<Paragraph> base_type;
///
ParagraphList();
ParagraphList();
///
template <class Iter>
ParagraphList(Iter beg, Iter end)

View File

@ -304,4 +304,3 @@ bool operator==(ParagraphParameeters const & ps1,
&& ps1.leftindent == ps2.leftindent;
}
*/

View File

@ -647,7 +647,7 @@ bool Buffer::readFile(LyXLex & lex, string const & filename, par_type pit)
" that it is probably corrupted."),
filename));
}
#endif
#endif
pimpl_->file_fully_loaded = true;
return true;
}

View File

@ -937,7 +937,7 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
<< features.getBabelOptions();
texrow.newline();
}
// Now insert the LyX specific LaTeX commands...
// The optional packages;
@ -1006,7 +1006,7 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
lyxpreamble += bullets_def + "}\n\n";
// We try to load babel late, in case it interferes
// with other packages.
// with other packages.
// Jurabib has to be called after babel, though.
if (use_babel && !features.isRequired("jurabib")) {
lyxpreamble += babelCall(language_options.str()) + '\n';

View File

@ -125,7 +125,7 @@ DispatchResult LCursor::dispatch(FuncRequest const & cmd0)
BOOST_ASSERT(idx() <= lastidx());
BOOST_ASSERT(par() <= lastpar());
// The common case is 'LFUN handled, need update', so make the
// The common case is 'LFUN handled, need update', so make the
// LFUN handler's life easier by assuming this as default value.
// The handler can reset the update and val flags if necessary.
disp_.update(true);
@ -1112,7 +1112,7 @@ bool LCursor::bruteFind(int x, int y, int xlow, int xhigh, int ylow, int yhigh)
{
BOOST_ASSERT(!empty());
par_type beg, end;
CursorSlice bottom = operator[](0);
CursorSlice bottom = operator[](0);
LyXText * text = bottom.text();
BOOST_ASSERT(text);
getParsInRange(text->paragraphs(), ylow, yhigh, beg, end);
@ -1324,7 +1324,7 @@ Encoding const * LCursor::getEncoding() const
CursorSlice const & sl = operator[](s);
LyXText & text = *sl.text();
LyXFont font = text.getPar(sl.par()).getFont(
bv().buffer()->params(), sl.pos(), outerFont(sl.par(), text.paragraphs()));
bv().buffer()->params(), sl.pos(), outerFont(sl.par(), text.paragraphs()));
return font.language()->encoding();
}

View File

@ -152,9 +152,9 @@ public:
/// cache the absolute coordinate from the top inset
void updatePos();
/// sets anchor to cursor position
void resetAnchor();
void resetAnchor();
/// access to owning BufferView
BufferView & bv() const;
BufferView & bv() const;
/// get some interesting description of top position
void info(std::ostream & os) const;
/// are we in math mode (2), text mode (1) or unsure (0)?
@ -182,8 +182,8 @@ public:
//private:
/// the anchor position
DocIterator anchor_;
///
///
DispatchResult disp_;
private:

View File

@ -56,7 +56,7 @@ InsetBase * DocIterator::nextInset()
BOOST_ASSERT(!empty());
if (pos() == lastpos())
return 0;
if (inMathed())
if (inMathed())
return nextAtom().nucleus();
return paragraph().isInset(pos()) ? paragraph().getInset(pos()) : 0;
}
@ -67,7 +67,7 @@ InsetBase * DocIterator::prevInset()
BOOST_ASSERT(!empty());
if (pos() == 0)
return 0;
if (inMathed())
if (inMathed())
return prevAtom().nucleus();
return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0;
}
@ -78,7 +78,7 @@ InsetBase const * DocIterator::prevInset() const
BOOST_ASSERT(!empty());
if (pos() == 0)
return 0;
if (inMathed())
if (inMathed())
return prevAtom().nucleus();
return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0;
}
@ -339,13 +339,13 @@ void DocIterator::forwardChar()
{
forwardPos();
while (size() != 0 && pos() == lastpos())
forwardPos();
forwardPos();
}
void DocIterator::forwardInset()
{
forwardPos();
forwardPos();
while (size() != 0 && (pos() == lastpos() || nextInset() == 0))
forwardPos();
}
@ -355,7 +355,7 @@ void DocIterator::backwardChar()
{
backwardPos();
while (size() != 0 && pos() == lastpos())
backwardPos();
backwardPos();
}
@ -390,7 +390,7 @@ void DocIterator::backwardPos()
// move into an inset to the left if possible
InsetBase * n = 0;
if (inMathed()) {
n = (top.cell().begin() + top.pos())->nucleus();
} else {
@ -449,4 +449,3 @@ std::ostream & operator<<(std::ostream & os, StableDocIterator const & dit)
os << " " << dit.data_[i] << "\n";
return os;
}

View File

@ -66,7 +66,7 @@ public:
CursorSlice & top() { return back(); }
/// access to tip
CursorSlice const & top() const { return back(); }
/// access to outermost slice
/// access to outermost slice
CursorSlice & bottom() { return front(); }
/// access to outermost slicetip
CursorSlice const & bottom() const { return front(); }

View File

@ -341,7 +341,7 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf)
auto_ptr<InsetBase> inset;
LyXTextClass tclass = buf.params().getLyXTextClass();
lex.next();
string tmptok = lex.getString();

View File

@ -37,9 +37,9 @@ bool ControlCitation::initialiseParams(string const & data)
kernel().buffer().fillWithBibKeys(blist);
bool use_styles = (usingNatbib() || usingJurabib());
typedef std::map<string, string>::value_type InfoMapValue;
for (vector<pair<string,string> >::size_type i = 0;
i < blist.size(); ++i) {
bibkeysInfo_.insert(InfoMapValue(blist[i].first,
@ -51,7 +51,7 @@ bool ControlCitation::initialiseParams(string const & data)
else {
if ((use_styles && citeStyles_.size() == 1) ||
(!use_styles && citeStyles_.size() != 1))
citeStyles_ = biblio::getCiteStyles(usingNatbib(),
citeStyles_ = biblio::getCiteStyles(usingNatbib(),
usingJurabib());
}

View File

@ -68,10 +68,10 @@ namespace {
void dispatch_bufferparams(Kernel const & kernel, BufferParams const & bp,
kb_action lfun)
{
ostringstream ss;
bp.writeFile(ss);
ss << "\\end_header\n";
kernel.dispatch(FuncRequest(lfun, ss.str()));
ostringstream ss;
bp.writeFile(ss);
ss << "\\end_header\n";
kernel.dispatch(FuncRequest(lfun, ss.str()));
}
} // namespace anon
@ -83,17 +83,17 @@ void ControlDocument::dispatchParams()
setLanguage();
// Set the document class.
lyx::textclass_type const old_class =
lyx::textclass_type const old_class =
kernel().buffer().params().textclass;
lyx::textclass_type const new_class = bp_->textclass;
lyx::textclass_type const new_class = bp_->textclass;
if (new_class != old_class) {
string const name = textclasslist[new_class].name();
if (new_class != old_class) {
string const name = textclasslist[new_class].name();
kernel().dispatch(FuncRequest(LFUN_TEXTCLASS_APPLY, name));
}
// Apply the BufferParams.
dispatch_bufferparams(kernel(), params(), LFUN_BUFFERPARAMS_APPLY);
dispatch_bufferparams(kernel(), params(), LFUN_BUFFERPARAMS_APPLY);
// Generate the colours requested by each new branch.
BranchList & branchlist = params().branchlist();
@ -123,10 +123,10 @@ void ControlDocument::setLanguage() const
{
Language const * const newL = bp_->language;
if (kernel().buffer().params().language == newL)
return;
return;
string const lang_name = newL->lang();
kernel().dispatch(FuncRequest(LFUN_LANGUAGE_BUFFER, lang_name));
string const lang_name = newL->lang();
kernel().dispatch(FuncRequest(LFUN_LANGUAGE_BUFFER, lang_name));
}
@ -143,5 +143,5 @@ bool ControlDocument::loadTextclass(lyx::textclass_type tc) const
void ControlDocument::saveAsDefault() const
{
dispatch_bufferparams(kernel(), params(), LFUN_SAVE_AS_DEFAULT);
dispatch_bufferparams(kernel(), params(), LFUN_SAVE_AS_DEFAULT);
}

View File

@ -62,9 +62,9 @@ bool ControlPrefs::initialiseParams(std::string const &)
void ControlPrefs::dispatchParams()
{
ostringstream ss;
rc_.write(ss);
kernel().dispatch(FuncRequest(LFUN_LYXRC_APPLY, ss.str()));
ostringstream ss;
rc_.write(ss);
kernel().dispatch(FuncRequest(LFUN_LYXRC_APPLY, ss.str()));
// FIXME: these need lfuns
bufferlist.setCurrentAuthor(rc_.user_name, rc_.user_email);

View File

@ -128,7 +128,7 @@ void ControlPrint::dispatchParams()
string const target = (pp.target == PrinterParams::PRINTER) ?
"printer" : "file";
string const target_name = (pp.target == PrinterParams::PRINTER) ?
(pp.printer_name.empty() ? "default" : pp.printer_name) :
pp.file_name;

View File

@ -161,10 +161,10 @@ void ControlSpellchecker::check()
ptrdiff_t start = 0, total = 0;
DocIterator it = DocIterator(kernel().buffer().inset());
for (start = 0; it != cur; it.forwardPos())
++start;
++start;
for (total = start; it; it.forwardPos())
++total;
++total;
for (; cur && isLetter(cur); cur.forwardPos())
++start;

View File

@ -81,7 +81,7 @@ public:
/** A request that the GUI be redrawn,
* e.g. because the colors have been remapped.
*/
void redrawGUI() const;
void redrawGUI() const;
/** \name Kernel Nasties
* Unpleasantly public internals of the LyX kernel.

View File

@ -84,7 +84,7 @@ private:
bool Dialogs::isValidName(string const & name) const
{
return std::find_if(dialognames, end_dialognames,
return std::find_if(dialognames, end_dialognames,
cmpCStr(name.c_str())) != end_dialognames;
}

View File

@ -41,9 +41,9 @@ void GPreamble::build()
void GPreamble::apply()
{
// controller().params() = preamble()->get_buffer()->get_text(preamble()->get_buffer()->get_start_iter(),
// preamble()->get_buffer()->get_end_iter(),
// false);
// controller().params() = preamble()->get_buffer()->get_text(preamble()->get_buffer()->get_start_iter(),
// preamble()->get_buffer()->get_end_iter(),
// false);
}

View File

@ -111,7 +111,7 @@ T* GView::getWidget(const string & name) const
template <class Controller>
class GControlledView : public GView {
public:
GControlledView(string const & name);
GControlledView(string const & name);
protected:
Controller & controller();
};

View File

@ -111,7 +111,7 @@ T* GnomeBase::getWidget(const string & name) const
template <class Controller>
class GnomeCB : public GnomeBase {
public:
GnomeCB(string const & name);
GnomeCB(string const & name);
protected:
Controller & controller();
};

View File

@ -25,4 +25,3 @@ void addDefaultTags(Glib::RefPtr<Gtk::TextBuffer> & buf) {
buf->get_tag_table()->add(boldTag);
}

View File

@ -70,7 +70,7 @@ void GXpmBtnTbl::construct()
GXpmBtn * btn;
int row, col;
for (row = 0; row < rows_; ++row)
for (row = 0; row < rows_; ++row)
for (col = 0; col < cols_; ++col) {
btn = &btns_[index(row, col)];
btn->setRow(row);
@ -85,7 +85,7 @@ void GXpmBtnTbl::construct()
void GXpmBtnTbl::setBtnXpm(XpmData xpms[])
{
int row, col;
for (row = 0; row < rows_; ++row)
for (row = 0; row < rows_; ++row)
for (col = 0; col < cols_; ++col)
btns_[index(row, col)].setXpm(xpms[index(row, col)]);
}

View File

@ -107,17 +107,17 @@ void QBibtex::update_contents()
dialog_->bibtocCB->setChecked(false);
dialog_->bibtocCB->setEnabled(!bibtopic);
string btprint(controller().params().getSecOptions());
int btp = 0;
if (btprint == "btPrintNotCited")
btp = 1;
else if (btprint == "btPrintAll")
btp = 2;
dialog_->btPrintCO->setCurrentItem(btp);
dialog_->btPrintCO->setEnabled(bibtopic);
dialog_->styleCB->clear();
int item_nr(-1);
@ -168,13 +168,13 @@ void QBibtex::apply()
// command!
controller().params().setOptions(bibstyle);
}
// bibtopic allows three kinds of sections:
// 1. sections that include all cited references of the database(s)
// 2. sections that include all uncited references of the database(s)
// 3. sections that include all references of the database(s), cited or not
int btp = dialog_->btPrintCO->currentItem();
switch (btp) {
case 0:
controller().params().setSecOptions("btPrintCited");
@ -186,7 +186,7 @@ void QBibtex::apply()
controller().params().setSecOptions("btPrintAll");
break;
}
if (!controller().usingBibtopic())
controller().params().setSecOptions("");
}

View File

@ -62,10 +62,10 @@ void QCitation::apply()
string const before = fromqstr(dialog_->textBeforeED->text());
controller().params().setSecOptions(before);
string const after = fromqstr(dialog_->textAfterED->text());
controller().params().setOptions(after);
style_ = choice;
open_find_ = false;
}
@ -100,7 +100,7 @@ void QCitation::build_dialog()
bcview().addReadOnly(dialog_->fulllistCB);
bcview().addReadOnly(dialog_->textBeforeED);
bcview().addReadOnly(dialog_->textAfterED);
open_find_ = true;
}
@ -125,7 +125,7 @@ void QCitation::fillStyles()
vector<string> const & sty = controller().getCiteStrings(key);
bool const use_styles = (controller().usingNatbib() ||
bool const use_styles = (controller().usingNatbib() ||
controller().usingJurabib());
dialog_->citationStyleCO->setEnabled(!sty.empty() && use_styles);
dialog_->citationStyleLA->setEnabled(!sty.empty() && use_styles);
@ -146,7 +146,7 @@ void QCitation::updateStyle()
dialog_->fulllistCB->setEnabled(natbib);
dialog_->forceuppercaseCB->setEnabled(natbib);
dialog_->textBeforeED->setEnabled(natbib ||
dialog_->textBeforeED->setEnabled(natbib ||
controller().usingJurabib());
string const & command = controller().params().getCmdName();
@ -158,8 +158,8 @@ void QCitation::updateStyle()
vector<biblio::CiteStyle>::const_iterator cit =
find(styles.begin(), styles.end(), cs.style);
// restore the latest natbib style
// restore the latest natbib style
if (style_ >= 0 && style_ < dialog_->citationStyleCO->count())
dialog_->citationStyleCO->setCurrentItem(style_);
else
@ -197,7 +197,7 @@ void QCitation::update_contents()
fillStyles();
updateStyle();
// open the find dialog if nothing has been selected (yet)
// the bool prevents that this is also done after "apply"
if (open_find_)

View File

@ -78,7 +78,7 @@ void QCitationDialog::openFind()
{
if (form_->readOnly())
return;
if (selectedLB->count() == 0 && add_->availableLB->count() != 0){
// open the find dialog
add();

View File

@ -36,7 +36,7 @@ QFloatDialog::QFloatDialog(QFloat * form)
// enable span columns checkbox
floatFP->useWide();
// enable sideways checkbox
floatFP->useSideways();

View File

@ -55,7 +55,7 @@ void QRef::build_dialog()
bcview().addReadOnly(dialog_->referenceED);
bcview().addReadOnly(dialog_->typeCO);
bcview().addReadOnly(dialog_->bufferCO);
restored_buffer_ = -1;
}
@ -63,14 +63,14 @@ void QRef::build_dialog()
void QRef::update_contents()
{
InsetCommandParams const & params = controller().params();
int orig_type = dialog_->typeCO->currentItem();
dialog_->referenceED->setText(toqstr(params.getContents()));
dialog_->nameED->setText(toqstr(params.getOptions()));
dialog_->nameED->setReadOnly(!nameAllowed() && !readOnly());
// restore type settings for new insets
if (params.getContents().empty())
dialog_->typeCO->setCurrentItem(orig_type);
@ -90,7 +90,7 @@ void QRef::update_contents()
dialog_->bufferCO->insertItem(toqstr(*it));
}
// restore the buffer combo setting for new insets
if (params.getContents().empty() && restored_buffer_ != -1
if (params.getContents().empty() && restored_buffer_ != -1
&& restored_buffer_ < dialog_->bufferCO->count())
dialog_->bufferCO->setCurrentItem(restored_buffer_);
else
@ -107,7 +107,7 @@ void QRef::apply()
params.setCmdName(InsetRef::getName(dialog_->typeCO->currentItem()));
params.setContents(fromqstr(dialog_->referenceED->text()));
params.setOptions(fromqstr(dialog_->nameED->text()));
restored_buffer_ = dialog_->bufferCO->currentItem();
}
@ -164,7 +164,7 @@ void QRef::gotoRef()
void QRef::redoRefs()
{
int lastref = dialog_->refsLB->currentItem();
dialog_->refsLB->setAutoUpdate(false);
dialog_->refsLB->clear();
@ -181,12 +181,12 @@ void QRef::redoRefs()
dialog_->refsLB->sort();
dialog_->referenceED->setText(tmp);
// restore the last selection for new insets
if (tmp.isEmpty() && lastref != -1
if (tmp.isEmpty() && lastref != -1
&& lastref < int(dialog_->refsLB->count()))
dialog_->refsLB->setCurrentItem(lastref);
else
else
for (unsigned int i = 0; i < dialog_->refsLB->count(); ++i) {
if (tmp == dialog_->refsLB->text(i))
dialog_->refsLB->setCurrentItem(i);

View File

@ -62,7 +62,7 @@ private:
/// at a reference ?
bool at_ref_;
/// store the buffer settings
int restored_buffer_;

View File

@ -56,4 +56,3 @@ void QVSpaceDialog::enableCustom(int)
valueLE->setEnabled(enable);
unitCO->setEnabled(enable);
}

View File

@ -110,55 +110,55 @@ OSErr checkAppleEventForMissingParams(const AppleEvent& theAppleEvent)
{
DescType returnedType;
Size actualSize;
OSErr err = AEGetAttributePtr(&theAppleEvent, keyMissedKeywordAttr,
typeWildCard, &returnedType, nil, 0,
OSErr err = AEGetAttributePtr(&theAppleEvent, keyMissedKeywordAttr,
typeWildCard, &returnedType, nil, 0,
&actualSize);
switch (err) {
case errAEDescNotFound:
return noErr;
case noErr:
return noErr;
case noErr:
return errAEEventNotHandled;
default:
return err;
return err;
}
}
}
pascal OSErr handleOpenDocuments(const AppleEvent* inEvent,
AppleEvent* /*reply*/, long /*refCon*/)
pascal OSErr handleOpenDocuments(const AppleEvent* inEvent,
AppleEvent* /*reply*/, long /*refCon*/)
{
QString s_arg;
AEDescList documentList;
OSErr err = AEGetParamDesc(inEvent, keyDirectObject, typeAEList,
OSErr err = AEGetParamDesc(inEvent, keyDirectObject, typeAEList,
&documentList);
if (err != noErr)
if (err != noErr)
return err;
err = checkAppleEventForMissingParams(*inEvent);
if (err == noErr) {
long documentCount;
err = AECountItems(&documentList, &documentCount);
for (long documentIndex = 1;
err == noErr && documentIndex <= documentCount;
for (long documentIndex = 1;
err == noErr && documentIndex <= documentCount;
documentIndex++) {
DescType returnedType;
Size actualSize;
AEKeyword keyword;
FSRef ref;
char qstr_buf[1024];
err = AESizeOfNthItem(&documentList, documentIndex,
err = AESizeOfNthItem(&documentList, documentIndex,
&returnedType, &actualSize);
if (err == noErr) {
err = AEGetNthPtr(&documentList, documentIndex,
typeFSRef, &keyword,
&returnedType, (Ptr)&ref,
&returnedType, (Ptr)&ref,
sizeof(FSRef), &actualSize);
if (err == noErr) {
FSRefMakePath(&ref, (UInt8*)qstr_buf,
FSRefMakePath(&ref, (UInt8*)qstr_buf,
1024);
s_arg=QString::fromUtf8(qstr_buf);
wa_ptr->dispatch(
FuncRequest(LFUN_FILE_OPEN,
FuncRequest(LFUN_FILE_OPEN,
fromqstr(s_arg)));
break;
}

View File

@ -22,7 +22,7 @@ void addCheckedLineEdit(BCView & bcview,
{
bcview.addCheckedWidget(new CheckedLineEdit(input, label));
}
namespace {
@ -38,14 +38,14 @@ void setWarningColor(QWidget * widget)
widget->setPalette(pal);
}
void setWidget(bool valid, QLineEdit * input, QLabel * label)
{
if (valid)
input->unsetPalette();
else
setWarningColor(input);
if (!label)
return;

View File

@ -162,7 +162,7 @@ void FloatPlacement::set(InsetFloatParams const & params)
spanCB->setChecked(params.wide);
sidewaysCB->setChecked(params.sideways);
sidewaysCB->setEnabled(params.type == "figure"
sidewaysCB->setEnabled(params.type == "figure"
|| params.type == "table");
checkAllowed();
}

View File

@ -93,7 +93,7 @@ extern bool lyxX11EventFilter(XEvent * xev);
#ifdef Q_WS_MACX
extern bool macEventFilter(EventRef event);
extern pascal OSErr
handleOpenDocuments(const AppleEvent* inEvent, AppleEvent* /*reply*/,
handleOpenDocuments(const AppleEvent* inEvent, AppleEvent* /*reply*/,
long /*refCon*/);
#endif
@ -127,13 +127,13 @@ LQApplication::~LQApplication()
#ifdef Q_WS_MACX
bool LQApplication::macEventFilter(EventRef event)
bool LQApplication::macEventFilter(EventRef event)
{
if (GetEventClass(event) == kEventClassAppleEvent) {
EventRecord eventrec;
ConvertEventRefToEventRecord(event, &eventrec);
AEProcessAppleEvent(&eventrec);
return false;
}
return false;

View File

@ -75,11 +75,11 @@ void addFontPath()
FSRef fontDirRef;
FSSpec fontDirSpec;
CFStringRef filePath = CFStringCreateWithBytes(kCFAllocatorDefault,
(UInt8 *) "Fonts", strlen("Fonts"),
(UInt8 *) "Fonts", strlen("Fonts"),
kCFStringEncodingISOLatin1, false);
myAppResourcesURL = CFBundleCopyResourcesDirectoryURL(myAppBundle);
FontsURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,
FontsURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,
myAppResourcesURL, filePath, true);
if (lyxerr.debugging(Debug::FONT)) {
UInt8 buf[255];
@ -87,12 +87,12 @@ void addFontPath()
lyxerr << "Adding Fonts directory: " << buf << endl;
}
CFURLGetFSRef (FontsURL, &fontDirRef);
OSStatus err = FSGetCatalogInfo (&fontDirRef, kFSCatInfoNone,
OSStatus err = FSGetCatalogInfo (&fontDirRef, kFSCatInfoNone,
NULL, NULL, &fontDirSpec, NULL);
if (err)
if (err)
lyxerr << "FSGetCatalogInfo err = " << err << endl;
err = FMActivateFonts (&fontDirSpec, NULL, NULL,
kFMLocalActivationContext);
err = FMActivateFonts (&fontDirSpec, NULL, NULL,
kFMLocalActivationContext);
if (err)
lyxerr << "FMActivateFonts err = " << err << endl;
#endif

View File

@ -215,7 +215,7 @@ bool LyXScreen::fitCursor(BufferView * bv)
bv->cursor().getDim(asc, desc);
//lyxerr << "LyXScreen::fitCursor: x: " << x << " y: " << y
// << " top_y: " << top_y << endl;
bool const big_row = h / 4 < asc + desc && asc + desc < h;
if (y + desc - top_y >= h) {

View File

@ -78,7 +78,7 @@ void FormBibtex::build()
// callback for double click in browser
fl_set_browser_dblclick_callback(dialog_->browser_styles,
C_FormDialogView_InputCB, 2);
fl_addto_choice(dialog_->choice_btprint,
_(" all cited references "
"| all uncited references "
@ -113,7 +113,7 @@ void FormBibtex::build()
"the styles which are in directories where TeX finds them "
"are listed!");
tooltips().init(dialog_->button_rescan, str);
str = _("The bibliography section contains...");
tooltips().init(dialog_->choice_btprint, str);
}
@ -198,14 +198,14 @@ void FormBibtex::update()
}
}
fl_set_input(dialog_->input_style, bibstyle.c_str());
string btprint = controller().params().getSecOptions();
int btp = 1;
if (btprint == "btPrintNotCited")
btp = 2;
else if (btprint == "btPrintAll")
btp = 3;
fl_set_choice(dialog_->choice_btprint, btp);
setEnabled(dialog_->choice_btprint, bibtopic);
@ -260,11 +260,11 @@ void FormBibtex::apply()
controller().params().setOptions(bibtotoc + ',' + bibstyle);
} else {
// At least one of addtotoc and bibstyle is empty.
// At least one of addtotoc and bibstyle is empty.
// No harm to output both!
controller().params().setOptions(bibtotoc + bibstyle);
}
// bibtopic allows three kinds of sections:
// 1. sections that include all cited references of the database(s)
// 2. sec. that include all uncited references of the database(s)
@ -283,7 +283,7 @@ void FormBibtex::apply()
break;
}
}
else
controller().params().setSecOptions("");
}

View File

@ -285,4 +285,3 @@ ButtonPolicy::SMInput FormBox::input(FL_OBJECT * ob, long)
return ButtonPolicy::SMI_VALID;
}

View File

@ -117,7 +117,7 @@ void FormCitation::apply()
string const before = getString(dialog_->input_before);
controller().params().setSecOptions(before);
string const after = getString(dialog_->input_after);
controller().params().setOptions(after);
}
@ -464,7 +464,7 @@ void FormCitation::update()
fl_set_input(dialog_->input_after,
controller().params().getOptions().c_str());
fl_set_input(dialog_->input_before,
fl_set_input(dialog_->input_before,
controller().params().getSecOptions().c_str());
}

View File

@ -315,12 +315,12 @@ void FormDocument::build()
bcview().addReadOnly(options_->choice_citation_format);
bcview().addReadOnly(options_->input_float_placement);
bcview().addReadOnly(options_->choice_postscript_driver);
// add cite style radio buttons
citestyle_.init(options_->radio_use_defcite, DEFCITE);
citestyle_.init(options_->radio_use_natbib, NATBIB);
citestyle_.init(options_->radio_use_jurabib, JURABIB);
// set up the tooltips for optionss form
string str = _("Use LaTeX's default citation style");
tooltips().init(options_->radio_use_defcite, str);
@ -535,8 +535,8 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
fl_set_choice_text(class_->choice_skip_units,
default_unit.c_str());
} else if (ob == options_->radio_use_jurabib ||
ob == options_->radio_use_defcite ||
} else if (ob == options_->radio_use_jurabib ||
ob == options_->radio_use_defcite ||
ob == options_->radio_use_natbib) {
setEnabled(options_->choice_citation_format,
fl_get_button(options_->radio_use_natbib));
@ -784,12 +784,12 @@ void FormDocument::branch_input(FL_OBJECT * ob)
bool const selecting = ob == branch_->button_select;
string current_branch;
// When selecting, take highlighted item from left browser,
// When selecting, take highlighted item from left browser,
// when deselecting, from right browser:
if (selecting) {
int const i = fl_get_browser(branch_->browser_all_branches);
current_branch =
current_branch =
fl_get_browser_line(branch_->browser_all_branches, i);
} else {
int const i = fl_get_browser(branch_->browser_selection);

View File

@ -133,7 +133,7 @@ private:
std::vector<std::string> lang_;
/// Contains all legal branches for this doc
BranchList branchlist_;
/// citation style buttons
RadioButtonGroup citestyle_;
};

View File

@ -367,14 +367,14 @@ void FormExternal::build()
bcview().addReadOnly(options_->input_option);
// initial setting
// addCheckedPositiveFloat(bcview(), scale_->input_width);
// addCheckedPositiveFloat(bcview(), scale_->input_width);
// As I haven't written addCheckedPositiveFloat, we default to
// always checking that it is a valide LyXLength, even when
// I'm 'scaling'. No harm done, just not as strict as it might be.
addCheckedLyXLength(bcview(), scale_->input_width);
addCheckedLyXLength(bcview(), scale_->input_height);
// addCheckedPositiveFloat(bcview(), input_displayscale);
// addCheckedPositiveFloat(bcview(), input_displayscale);
fl_set_input_filter(lyxview_->input_displayscale,
fl_unsigned_int_filter);
@ -745,10 +745,10 @@ void FormExternal::widthUnitChanged()
bool useHeight = fl_get_choice(scale_->choice_width) > 1;
// if (useHeight)
// widthED->setValidator(unsignedLengthValidator(widthED));
// else
// widthED->setValidator(new QDoubleValidator(0, 1000, 2, widthED));
// if (useHeight)
// widthED->setValidator(unsignedLengthValidator(widthED));
// else
// widthED->setValidator(new QDoubleValidator(0, 1000, 2, widthED));
setEnabled(scale_->input_height, useHeight);
setEnabled(scale_->choice_height, useHeight);

View File

@ -230,13 +230,13 @@ ButtonPolicy::SMInput FormFloat::input(FL_OBJECT * ob, long)
setEnabled(dialog_->check_here, alternatives && !wide);
setEnabled(dialog_->radio_here_definitely, !wide);
setEnabled(dialog_->check_bottom, alternatives && !wide);
} else if (ob == dialog_->check_sideways) {
setEnabled(dialog_->radio_default, !sideways);
setEnabled(dialog_->radio_alternatives, !sideways);
setEnabled(dialog_->radio_here_definitely, !wide && !sideways);
setEnabled(dialog_->check_top, alternatives && !sideways);
setEnabled(dialog_->check_bottom,
setEnabled(dialog_->check_bottom,
alternatives && !wide && !sideways);
setEnabled(dialog_->check_page, alternatives && !sideways);
setEnabled(dialog_->check_here, alternatives && !wide && !sideways);

View File

@ -37,7 +37,7 @@ int const delim_rversion[] = {
1,1,3,3,4,5,7,7,9,9,10,11,
3,13,15,15,16,17,19,19,20,21,22
};
int const delim_size =
int const delim_size =
sizeof(delim_rversion) / sizeof(delim_rversion[0]);
char const * delim_values[] = {

View File

@ -85,7 +85,7 @@ ButtonPolicy::SMInput FormSearch::input(FL_OBJECT * ob, long)
getString(dialog_->input_replace),
fl_get_button(dialog_->check_casesensitive),
fl_get_button(dialog_->check_matchword),
!fl_get_button(dialog_->check_searchbackwards),
!fl_get_button(dialog_->check_searchbackwards),
all);
}

View File

@ -325,7 +325,7 @@ bool XformsColor::read(string const & filename)
if (f.readable() && !lexrc.setFile(filename)) {
lyxerr << "XformsColor::read(" << filename << ")\n"
<< _("Failed to open file.") << std::endl;
return false;
return false;
}
while (lexrc.isOK()) {
@ -370,7 +370,7 @@ bool XformsColor::write(string const & filename)
if (!os) {
lyxerr << "XformsColor::write(" << filename << ")\n"
<< _("Failed to open file.") << std::endl;
return false;
return false;
}
os << "###"

View File

@ -91,8 +91,8 @@ bool operator==(FuncRequest const & lhs, FuncRequest const & rhs)
std::ostream & operator<<(std::ostream & os, FuncRequest const & cmd)
{
return os
<< " action: " << cmd.action
<< " action: " << cmd.action
<< " arg: '" << cmd.argument << "'"
<< " x: " << cmd.x
<< " y: " << cmd.y;
<< " x: " << cmd.x
<< " y: " << cmd.y;
}

View File

@ -112,7 +112,7 @@ string const ResizeLatexCommand::front_impl() const
if (!data.height.zero())
height = data.height.asLatexString();
}
os << "\\resizebox{"
<< width << "}{"
<< height << "}{";

View File

@ -67,7 +67,7 @@ public:
virtual MathInset * asMathInset() { return 0; }
/// identification as non-math inset
virtual UpdatableInset * asUpdatableInset() { return 0; }
/// true for 'math' math inset, but not for e.g. mbox
/// true for 'math' math inset, but not for e.g. mbox
virtual bool inMathed() const { return false; }
// the real dispatcher
@ -107,7 +107,7 @@ public:
virtual bool covers(int x, int y) const;
/// get the screen positions of the cursor (see note in cursor.C)
virtual void getCursorPos(CursorSlice const & cur, int & x, int & y) const;
/// is this an inset that can be moved into?
virtual bool isActive() const { return nargs() > 0; }
/// Where should we go when we press the up or down cursor key?
@ -147,12 +147,12 @@ public:
virtual int cellXOffset(idx_type) const { return 0; }
/// any additional y-offset when drawing a cell?
virtual int cellYOffset(idx_type) const { return 0; }
/// number of embedded cells
virtual size_t nargs() const { return 0; }
/// number of rows in gridlike structures
virtual size_t nrows() const { return 0; }
/// number of columns in gridlike structures
virtual size_t ncols() const { return 0; }
/// number of embedded cells
virtual size_t nargs() const { return 0; }
/// number of rows in gridlike structures
virtual size_t nrows() const { return 0; }
/// number of columns in gridlike structures
virtual size_t ncols() const { return 0; }
/// is called when the cursor leaves this inset
virtual void notifyCursorLeaves(idx_type) {}

View File

@ -77,7 +77,7 @@ void InsetBibtex::priv_dispatch(LCursor & cur, FuncRequest & cmd)
setParams(p);
break;
}
default:
InsetCommand::priv_dispatch(cur, cmd);
break;
@ -103,7 +103,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os,
// 2. \begin{btSect}{database}
// 3. \btPrint{Cited|NotCited|All}
// 4. \end{btSect}
// the database string
string adb;
string db_in = getContents();
@ -115,8 +115,8 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os,
while (!adb.empty()) {
if (!runparams.nice &&
IsFileReadable(MakeAbsPath(adb, buffer.filePath())+".bib"))
adb = os::external_path(MakeAbsPath(adb,
buffer.filePath()));
adb = os::external_path(MakeAbsPath(adb,
buffer.filePath()));
db_out += adb;
db_out += ',';
db_in = split(db_in, adb,',');
@ -132,7 +132,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os,
style = split(style, bibtotoc, ',');
}
}
// line count
int i = 0;
@ -145,7 +145,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os,
os << "\\bibliographystyle{" << style << "}\n";
i += 1;
}
if (buffer.params().use_bibtopic){
os << "\\begin{btSect}{" << db_out << "}\n";
string btprint = getSecOptions();
@ -186,7 +186,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os,
os << "\\bibliography{" << db_out << "}\n";
i += 1;
}
return i;
}
@ -290,4 +290,3 @@ void InsetBibtex::validate(LaTeXFeatures & features) const
if (features.bufferParams().use_bibtopic)
features.require("bibtopic");
}

View File

@ -154,7 +154,7 @@ void InsetBox::setButtonLabel()
void InsetBox::metrics(MetricsInfo & m, Dimension & dim) const
{
MetricsInfo mi = m;
mi.base.textwidth = params_.width.inPixels(m.base.textwidth);
mi.base.textwidth = params_.width.inPixels(m.base.textwidth);
InsetCollapsable::metrics(mi, dim);
//if (params_.inner_box && isOpen())
// dim.wid = mi.base.textwidth;

View File

@ -130,7 +130,7 @@ void InsetCharStyle::draw(PainterInfo & pi, int x, int y) const
int a = 0;
int d = 0;
font_metrics::rectText(params_.type, font, w, a, d);
pi.pain.rectText(x + (dim_.wid - w) / 2,
pi.pain.rectText(x + (dim_.wid - w) / 2,
y + InsetText::descent() + a,
params_.type, font, LColor::none, LColor::none);
}

View File

@ -101,8 +101,8 @@ string const getNatbibLabel(Buffer const & buffer,
cite_type == "citeyearpar")
before_str = before + ' ';
// In CITE (jurabib), the "before" string is used to attach
// the annotator (of legal texts) to the author(s) of the
// first reference.
// the annotator (of legal texts) to the author(s) of the
// first reference.
else if (cite_type == "cite")
before_str = '/' + before;
}
@ -143,7 +143,7 @@ string const getNatbibLabel(Buffer const & buffer,
label += author + before_str + sep_str;
else
label += author + sep_str;
// (authors1 (<before> year); ... ;
// authors_last (<before> year, <after>)
} else if (cite_type == "citet") {
@ -286,7 +286,7 @@ InsetCitation::Cache::Style InsetCitation::getStyle(Buffer const & buffer) const
style = Cache::NATBIB_AY;
}
}
if (buffer.params().use_jurabib)
style = Cache::JURABIB;
@ -344,7 +344,7 @@ int InsetCitation::latex(Buffer const & buffer, ostream & os,
if (buffer.params().use_natbib)
os << getCmdName();
else if (buffer.params().use_jurabib) {
// jurabib does not (yet) support "force upper case"
// jurabib does not (yet) support "force upper case"
// and "full author name". Fallback.
string cmd = getCmdName();
if (cmd[0] == 'C')
@ -358,7 +358,7 @@ int InsetCitation::latex(Buffer const & buffer, ostream & os,
string const before = getSecOptions();
string const after = getOptions();
if (!before.empty()
if (!before.empty()
&& (buffer.params().use_natbib || buffer.params().use_jurabib))
os << '[' << before << "][" << after << ']';
else if (!after.empty())

View File

@ -183,7 +183,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
if (openinlined_)
InsetText::draw(pi, x + dimc.width(),
y - aa + textdim_.asc);
else
else
InsetText::draw(pi, x, dimc.height()
+ y - aa + textdim_.asc);
}

View File

@ -64,7 +64,7 @@ public:
void setLabel(std::string const & l);
///
virtual void setButtonLabel() {}
///
///
void setLabelFont(LyXFont & f);
///
int scroll(bool recursive = true) const;

View File

@ -104,7 +104,7 @@ void InsetCommand::priv_dispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_INSET_MODIFY: {
InsetCommandParams p;
InsetCommandMailer::string2params(mailer_name_, cmd.argument, p);
if (p.getCmdName().empty()) {
if (p.getCmdName().empty()) {
cur.undispatched();
} else {
setParams(p);

View File

@ -29,7 +29,7 @@ InsetCommandParams::InsetCommandParams(string const & n,
string const & c,
string const & o,
string const & s)
: cmdname(n), contents(c), options(o), sec_options(s),
: cmdname(n), contents(c), options(o), sec_options(s),
preview_(false)
{}
@ -39,7 +39,7 @@ void InsetCommandParams::scanCommand(string const & cmd)
string tcmdname, toptions, tsecoptions, tcontents;
if (cmd.empty()) return;
enum { WS, CMDNAME, OPTION, SECOPTION, CONTENT } state = WS;
// Used to handle things like \command[foo[bar]]{foo{bar}}
@ -100,7 +100,7 @@ void InsetCommandParams::scanCommand(string const & cmd)
<< "> == <" << getCommand()
<< "> == <" << getCmdName()
<< '|' << getContents()
<< '|' << getOptions()
<< '|' << getOptions()
<< '|' << getSecOptions() << '>' << endl;
}

View File

@ -182,7 +182,7 @@ void InsetFloat::priv_dispatch(LCursor & cur, FuncRequest & cmd)
InsetCollapsable::priv_dispatch(cur, cmd);
break;
}
default:
InsetCollapsable::priv_dispatch(cur, cmd);
break;
@ -201,7 +201,7 @@ void InsetFloatParams::write(ostream & os) const
os << "wide true\n";
else
os << "wide false\n";
if (sideways)
os << "sideways true\n";
else
@ -261,7 +261,7 @@ void InsetFloat::validate(LaTeXFeatures & features) const
if (contains(params_.placement, 'H')) {
features.require("float");
}
if (params_.sideways)
features.require("rotating");

View File

@ -471,7 +471,7 @@ void InsetTabular::priv_dispatch(LCursor & cur, FuncRequest & cmd)
}
break;
case LFUN_LEFTSEL:
case LFUN_LEFTSEL:
case LFUN_LEFT:
cell(cur.idx()).dispatch(cur, cmd);
cur.dispatched(); // override the cell's decision
@ -695,7 +695,7 @@ bool InsetTabular::getStatus(LCursor & cur, FuncRequest const & cmd,
switch (cmd.action) {
case LFUN_TABULAR_FEATURE: {
int actcell = cur.idx();
int action = LyXTabular::LAST_ACTION;
int action = LyXTabular::LAST_ACTION;
int i = 0;
for (; tabularFeature[i].action != LyXTabular::LAST_ACTION; ++i) {
string const tmp = tabularFeature[i].feature;
@ -1540,7 +1540,7 @@ void InsetTabular::cutSelection(LCursor & cur)
bool const track = cur.bv().buffer()->params().tracking_changes;
int rs, re, cs, ce;
getSelection(cur, rs, re, cs, ce);
getSelection(cur, rs, re, cs, ce);
for (int i = rs; i <= re; ++i)
for (int j = cs; j <= ce; ++j)
cell(tabular.getCellNumber(i, j)).clear(track);
@ -1801,4 +1801,3 @@ string const InsetTabularMailer::params2string(InsetTabular const & inset)
data << "\\end_inset\n";
return data.str();
}

View File

@ -150,7 +150,7 @@ public:
bool insetAllowed(Code) const { return true; }
///
bool allowSpellCheck() const { return true; }
protected:
///
void priv_dispatch(LCursor & cur, FuncRequest & cmd);

View File

@ -95,7 +95,7 @@ void InsetWrap::priv_dispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_INSET_DIALOG_UPDATE:
InsetWrapMailer(*this).updateDialog(&cur.bv());
break;
case LFUN_MOUSE_RELEASE: {
if (cmd.button() == mouse_button::button3 && hitButton(cmd)) {
InsetWrapMailer(*this).showDialog(&cur.bv());

View File

@ -367,5 +367,3 @@ bool findNextChange(BufferView * bv)
} // find namespace
} // lyx namespace

View File

@ -488,7 +488,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
break;
default:
cur.getStatus(cmd, flag);
if (!flag.enabled())
flag = view()->getStatus(cmd);
@ -562,7 +562,7 @@ void loadTextclass(string const & name)
Alert::error(_("Could not change class"), s);
}
}
} //namespace anon
@ -1342,14 +1342,14 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
case LFUN_LYXRC_APPLY: {
istringstream ss(argument);
bool const success = lyxrc.read(ss) == 0;
if (!success) {
lyxerr << "Warning in LFUN_LYXRC_APPLY!\n"
<< "Unable to read lyxrc data"
<< endl;
}
break;
}
}
default: {
DispatchResult res = view()->cursor().dispatch(cmd);

View File

@ -320,4 +320,3 @@ LyXLex & LyXLex::operator>>(bool & s)
}
return *this;
}

View File

@ -580,7 +580,7 @@ int LyXRC::read(LyXLex & lexrc)
chktex_command = lexrc.getString();
}
break;
case RC_BIBTEX_COMMAND:
if (lexrc.next()) {
bibtex_command = lexrc.getString();
@ -2012,7 +2012,7 @@ string const LyXRC::getDescription(LyXRCTags tag)
case RC_CHKTEX_COMMAND:
str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
break;
case RC_BIBTEX_COMMAND:
str = _("Define the options of bibtex (cf. man bibtex) or select and alternative compiler (e.g. mlbibtex or bibulus).");
break;

View File

@ -124,4 +124,3 @@ void Row::dump(const char * s) const
<< " top_of_text: " << top_of_text_
<< " y_offset: " << y_offset_ << std::endl;
}

View File

@ -78,7 +78,7 @@ public:
int fd() const;
/// Connection status
bool connected() const;
/// Line buffered input from the socket
/// Line buffered input from the socket
bool readln(std::string &);
/// Write the string + '\n' to the socket
void writeln(std::string const &);

View File

@ -51,7 +51,7 @@ public:
typedef lyx::pos_type pos_type;
///
typedef lyx::par_type par_type;
/// constructor
explicit LyXText(BufferView *);
///
@ -265,7 +265,7 @@ public:
/// current text heigth
int height() const;
/// updates all counters
void updateCounters();
/// Returns an inset if inset was hit, or 0 if not.
@ -299,7 +299,7 @@ public:
ParagraphList & paragraphs() const;
/// return true if this is the main text
bool isMainText() const;
/// return first row of text
RowList::iterator firstRow() const;
/// return last row of text
@ -377,7 +377,7 @@ private:
/// return past-the-last paragraph influenced by a layout
/// change on pit
par_type undoSpan(par_type pit);
/// rebreaks the given par
void redoParagraphInternal(par_type pit);
/// used in setlayout

View File

@ -82,7 +82,7 @@ void MathColorInset::write(WriteStream & os) const
{
if (oldstyle_)
os << "{\\color" << '{' << cell(0) << '}' << cell(1) << '}';
else
else
os << "\\textcolor" << '{' << cell(0) << "}{" << cell(1) << '}';
}

View File

@ -22,7 +22,7 @@ class PainterInfo;
class MathDimInset : public MathInset {
public:
///
MathDimInset();
MathDimInset();
///
Dimension dimensions() const { return dim_; }

View File

@ -39,11 +39,11 @@ public:
bool inMathed() const { return false; }
///
LyXText * getText(int) const;
LyXText * getText(int) const;
///
void getCursorPos(CursorSlice const & cur, int & x, int & y) const;
protected:
///
///
mutable LyXText text_;
///
BufferView * const bv_;

View File

@ -543,9 +543,9 @@ void MathNestInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
break;
case LFUN_ESCAPE:
if (cur.selection())
if (cur.selection())
cur.selClear();
else
else
cmd = FuncRequest(LFUN_FINISHED_LEFT);
break;

View File

@ -111,7 +111,7 @@ void MathScriptInset::ensure(bool up)
// just nucleus so far
cells_.push_back(MathArray());
cell_1_is_up_ = up;
} else if (nargs() == 2 && !has(up)) {
} else if (nargs() == 2 && !has(up)) {
if (up) {
cells_.push_back(cell(1));
cell(1).clear();

View File

@ -60,7 +60,7 @@ void RefInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
if (cmd.getArg(0) == "ref") {
MathArray ar;
if (createMathInset_fromDialogStr(cmd.argument, ar)) {
*this = *ar[0].nucleus()->asRefInset();
*this = *ar[0].nucleus()->asRefInset();
break;
}
}

View File

@ -68,14 +68,14 @@ void docbookParagraphs(Buffer const & buf,
ParagraphList::iterator pend = const_cast<ParagraphList&>(paragraphs).end();
Counters & counters = buf.params().getLyXTextClass().counters();
for (; par != pend; ++par) {
LyXLayout_ptr const & style = par->layout();
// environment tag closing
for (; depth > par->params().depth(); --depth) {
sgml::closeEnvTags(os, false, environment_inner[depth],
sgml::closeEnvTags(os, false, environment_inner[depth],
item_tag, command_depth + depth);
sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]);
environment_stack[depth].erase();
@ -85,14 +85,14 @@ void docbookParagraphs(Buffer const & buf,
if (depth == par->params().depth()
&& environment_stack[depth] != style->latexname()
&& !environment_stack[depth].empty()) {
sgml::closeEnvTags(os, false, environment_inner[depth],
sgml::closeEnvTags(os, false, environment_inner[depth],
item_tag, command_depth + depth);
sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]);
environment_stack[depth].erase();
environment_inner[depth].erase();
}
string ls = "";
bool labelid = false;
// Write opening SGML tags.
@ -111,11 +111,11 @@ void docbookParagraphs(Buffer const & buf,
if (depth != 0)
//error(ErrorItem(_("Error"), _("Wrong depth for LatexType Command."), par->id(), 0, par->size()));
;
command_name = style->latexname();
cmd_depth = style->commanddepth;
if (command_flag) {
if (cmd_depth < command_base) {
for (Paragraph::depth_type j = command_depth;
@ -160,25 +160,25 @@ void docbookParagraphs(Buffer const & buf,
if (!labelid && !style->latexparam().empty()) {
ls = style->latexparam();
if (ls.find('#') != string::npos) {
string el = expandLabel(buf.params().getLyXTextClass(),
string el = expandLabel(buf.params().getLyXTextClass(),
style, false);
ls = subst(ls, "#", el);
}
}
}
sgml::openTag(os, depth + command_depth, false, command_name, ls);
// Label around sectioning number:
if (!style->labeltag().empty()) {
sgml::openTag(os, depth + 1 + command_depth, false,
sgml::openTag(os, depth + 1 + command_depth, false,
style->labeltag());
os << expandLabel(buf.params().getLyXTextClass(), style, false);
sgml::closeTag(os, depth + 1 + command_depth, false,
sgml::closeTag(os, depth + 1 + command_depth, false,
style->labeltag());
}
// Inner tagged header text, e.g. <title> for sectioning:
sgml::openTag(os, depth + 1 + command_depth, false,
sgml::openTag(os, depth + 1 + command_depth, false,
style->innertag());
break;
@ -197,10 +197,10 @@ void docbookParagraphs(Buffer const & buf,
environment_stack[depth] = style->latexname();
environment_inner[depth] = "!-- --";
// outputs <environment_stack[depth] latexparam()>
sgml::openTag(os, depth + command_depth, false,
sgml::openTag(os, depth + command_depth, false,
environment_stack[depth], style->latexparam());
} else {
sgml::closeEnvTags(os, false, environment_inner[depth],
sgml::closeEnvTags(os, false, environment_inner[depth],
style->itemtag(), command_depth + depth);
}
@ -209,7 +209,7 @@ void docbookParagraphs(Buffer const & buf,
if (style->innertag() == "CDATA")
os << "<![CDATA[";
else
sgml::openTag(os, depth + command_depth, false,
sgml::openTag(os, depth + command_depth, false,
style->innertag());
}
break;
@ -234,7 +234,7 @@ void docbookParagraphs(Buffer const & buf,
// write closing SGML tags
switch (style->latextype) {
case LATEX_COMMAND:
sgml::closeTag(os, depth + command_depth, false,
sgml::closeTag(os, depth + command_depth, false,
style->innertag());
break;
case LATEX_ENVIRONMENT:
@ -242,7 +242,7 @@ void docbookParagraphs(Buffer const & buf,
if (style->innertag() == "CDATA")
os << "]]>";
else
sgml::closeTag(os, depth + command_depth, false,
sgml::closeTag(os, depth + command_depth, false,
style->innertag());
}
break;
@ -261,7 +261,7 @@ void docbookParagraphs(Buffer const & buf,
// Close open tags
for (int d = depth; d >= 0; --d) {
if (!environment_stack[depth].empty()) {
sgml::closeEnvTags(os, false, environment_inner[depth],
sgml::closeEnvTags(os, false, environment_inner[depth],
item_tag, command_depth + depth);
}
}
@ -272,4 +272,3 @@ void docbookParagraphs(Buffer const & buf,
os << endl;
}
}

View File

@ -36,7 +36,7 @@ void linuxdocParagraphs(Buffer const & buf,
ostream & os,
OutputParams const & runparams)
{
Paragraph::depth_type depth = 0; // paragraph depth
string item_name;
vector<string> environment_stack(5);
@ -160,5 +160,3 @@ void linuxdocParagraphs(Buffer const & buf,
for (int i = depth; i >= 0; --i)
sgml::closeTag(os, depth, false, environment_stack[i]);
}

View File

@ -24,6 +24,6 @@ void linuxdocParagraphs(Buffer const & buf,
ParagraphList const & paragraphs,
std::ostream & os,
OutputParams const & runparams);
#endif

View File

@ -1881,5 +1881,3 @@ unsigned char Paragraph::transformChar(unsigned char c, pos_type pos) const
return Encodings::TransformChar(c, Encodings::FORM_ISOLATED);
}
}

View File

@ -341,7 +341,7 @@ Paragraph const & ownerPar(Buffer const & buf, InsetBase const * inset)
}
/// return the range of pars [beg, end[ owning the range of y [ystart, yend]
/// return the range of pars [beg, end[ owning the range of y [ystart, yend]
void getParsInRange(ParagraphList & pars, int ystart, int yend,
par_type & beg, par_type & end)
{

View File

@ -64,7 +64,7 @@ lyx::par_type outerPar(Buffer const & buf, InsetBase const * inset);
/// find owning paragraph containing an inset
Paragraph const & ownerPar(Buffer const & buf, InsetBase const * inset);
/// return the range of pars [beg, end[ owning the range of y [ystart, yend]
/// return the range of pars [beg, end[ owning the range of y [ystart, yend]
void getParsInRange(ParagraphList & plist,
int ystart, int yend,
lyx::par_type & beg,

View File

@ -37,7 +37,7 @@ int closeTag(std::ostream & os, lyx::depth_type depth,
bool mixcont, std::string const & latexname);
///
unsigned int closeEnvTags(std::ostream & os,
unsigned int closeEnvTags(std::ostream & os,
bool mixcont,
std::string const & environment_inner_depth,
std::string const & item_tag,

View File

@ -38,7 +38,7 @@ public:
/** Those child processes that are found to have finished are removed
* from the list and their callback function is passed the final
* return state.
*/
*/
void handleCompletedProcesses();
/// Add a new child process to the list of controlled processes.

View File

@ -623,7 +623,7 @@ int LyXText::leftMargin(par_type pit, pos_type pos) const
break;
}
}
if (!pars_[pit].params().leftIndent().zero())
x += pars_[pit].params().leftIndent().inPixels(maxwidth_);
@ -791,7 +791,7 @@ void LyXText::rowBreakPoint(par_type pit, Row & row) const
break;
}
}
if (!pars_[pit].isInset(i) || pars_[pit].getInset(i)->isChar()) {
// some insets are line separators too
if (pars_[pit].isLineSeparator(i)) {
@ -1397,7 +1397,7 @@ void LyXText::cursorLeftOneWord(LCursor & cur)
if (cur.pos() == 0 && cur.par() != 0) {
--cur.par();
cur.pos() = cur.lastpos();
} else {
} else {
// Skip through initial nonword stuff.
// Treat floats and insets as words.
while (cur.pos() != 0 && !cur.paragraph().isWord(cur.pos() - 1))
@ -1587,7 +1587,7 @@ void LyXText::Delete(LCursor & cur)
CursorSlice sl = cur.top();
cursorRight(cur);
if (sl != cur.top()) {
recordUndo(cur, Undo::DELETE, cur.par(),
recordUndo(cur, Undo::DELETE, cur.par(),
max(par_type(0), cur.par() - 1));
backspace(cur);
}
@ -2019,7 +2019,7 @@ int LyXText::cursorX(CursorSlice const & cur) const
return xo_;
Row const & row = *pars_[pit].getRow(cur.pos());
pos_type pos = cur.pos();
pos_type cursor_vpos = 0;

View File

@ -336,7 +336,7 @@ bool changeDepthAllowed(LyXText::DEPTH_CHANGE type,
bool LyXText::changeDepthAllowed(LCursor & cur, DEPTH_CHANGE type) const
{
BOOST_ASSERT(this == cur.text());
par_type beg, end;
par_type beg, end;
getSelectionSpan(cur, beg, end);
int max_depth = 0;
if (beg != 0)
@ -412,8 +412,8 @@ void LyXText::setFont(LCursor & cur, LyXFont const & font, bool toggleall)
par_type const beg = cur.selBegin().par();
par_type const end = cur.selEnd().par();
DocIterator pos = cur.selectionBegin();
DocIterator posend = cur.selectionEnd();
DocIterator pos = cur.selectionBegin();
DocIterator posend = cur.selectionEnd();
BufferParams const & params = bv()->buffer()->params();
@ -422,7 +422,7 @@ void LyXText::setFont(LCursor & cur, LyXFont const & font, bool toggleall)
f.update(font, params.language, toggleall);
setCharFont(pos.par(), pos.pos(), f);
}
redoParagraphs(beg, end + 1);
}
@ -819,7 +819,7 @@ void LyXText::updateCounters()
bv()->buffer()->params().getLyXTextClass().counters().reset();
bool update_pos = false;
par_type end = paragraphs().size();
for (par_type pit = 0; pit != end; ++pit) {
string const oldLabel = pars_[pit].params().labelString();
@ -949,7 +949,7 @@ void LyXText::setCursor(CursorSlice & cur, par_type par,
// This shouldn't happen.
BOOST_ASSERT(false);
}
if (pos < row.pos()) {
lyxerr << "dont like 3 please report pos:" << pos
<< " size: " << para.size()
@ -1017,7 +1017,7 @@ pos_type LyXText::getColumnNearX(par_type pit,
{
x -= xo_;
RowMetrics const r = computeRowMetrics(pit, row);
pos_type vc = row.pos();
pos_type end = row.endpos();
pos_type c = 0;
@ -1198,7 +1198,7 @@ void LyXText::cursorRight(LCursor & cur)
}
if (cur.pos() != cur.lastpos()) {
if (!checkAndActivateInset(cur, true)) {
if (!checkAndActivateInset(cur, true)) {
setCursor(cur, cur.par(), cur.pos() + 1, true, false);
if (false && bidi.isBoundary(*bv()->buffer(), cur.paragraph(),
cur.pos()))

View File

@ -595,7 +595,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
if (!cur.mark())
cur.clearSelection();
finishChange(cur, false);
if (cur.par() == 0 && cur.textRow().pos() == 0) {
if (cur.par() == 0 && cur.textRow().pos() == 0) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_UP);
} else {
@ -1001,21 +1001,21 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
c = par.getChar(pos - 1);
LyXLayout_ptr const & style = par.layout();
BufferParams const & bufparams = bv->buffer()->params();
if (!style->pass_thru
&& par.getFontSettings(bufparams, pos).language()->lang() != "hebrew") {
string arg = cmd.argument;
string arg = cmd.argument;
if (arg == "single")
cur.insert(new InsetQuotes(c,
bufparams.quotes_language,
bufparams.quotes_language,
InsetQuotes::SingleQ));
else if (arg == "double")
cur.insert(new InsetQuotes(c,
bufparams.quotes_language,
bufparams.quotes_language,
InsetQuotes::DoubleQ));
else
cur.insert(new InsetQuotes(c, bufparams));
cur.insert(new InsetQuotes(c, bufparams));
}
else
bv->owner()->dispatch(FuncRequest(LFUN_SELFINSERT, "\""));
@ -1756,7 +1756,7 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
case LFUN_LDOTS:
case LFUN_END_OF_SENTENCE:
case LFUN_SPACE_INSERT:
case LFUN_INSET_DIALOG_SHOW:
case LFUN_INSET_DIALOG_SHOW:
break;
case LFUN_EMPH:

View File

@ -95,7 +95,7 @@ void recordUndo(Undo::undo_kind kind,
undo.pars = ParagraphList(first, last);
}
// push the undo entry to undo stack
// push the undo entry to undo stack
//lyxerr << "undo record: " << stack.top() << std::endl;
stack.push(undo);

View File

@ -17,7 +17,7 @@
#define UNDO_H
#include "dociterator.h"
#include "ParagraphList_fwd.h"
#include "ParagraphList_fwd.h"
#include "support/types.h"

View File

@ -83,12 +83,12 @@ char nextToken(string & data)
lyx_advance(data, 1);
return '+';
}
if (prefixIs(data, "plus")) {
lyx_advance(data, 4);
return '+';
}
if (data[0] == '-') {
lyx_advance(data, 1);
return '-';
@ -467,7 +467,7 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
case VFILL:
return keep_ ? "\\vspace*{\\fill}" : "\\vfill{}";
case LENGTH:
case LENGTH:
return keep_ ? "\\vspace*{" + len_.asLatexString() + '}'
: "\\vspace{" + len_.asLatexString() + '}';
@ -482,7 +482,7 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
int VSpace::inPixels(BufferView const & bv) const
{
// Height of a normal line in pixels (zoom factor considered)
int const default_height = defaultRowHeight();
int const default_height = defaultRowHeight();
switch (kind_) {