src/frontends/qt2/QExternalDialog.C
src/frontends/qt2/QFloat.C
src/frontends/qt2/QGraphics.C
-src/frontends/qt2/QGraphicsDialog.C
src/frontends/qt2/QInclude.C
src/frontends/qt2/QLPrintDialog.C
src/frontends/qt2/QLog.C
src/frontends/xforms/xforms_helpers.C
src/gettext.h
src/importer.C
+src/insets/graphicinset.C
src/insets/inset.C
src/insets/insetbibtex.C
src/insets/insetcaption.C
src/insets/insetminipage.C
src/insets/insetnote.C
src/insets/insetoptarg.C
-src/insets/insetparent.C
src/insets/insetref.C
src/insets/insettabular.C
src/insets/insettext.C
+2003-06-10 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * text2.C (cutSelection): adjust
+ (pasteSelection): adjust
+
+ * messages.C: handle get of empty string
+
+ * main.C (main): use sync_with_stdio(false)
+
+ * lyxfunc.C (dispatch): adjust
+
+ * lyx_cb.[Ch] (MenuWrite): remove unneeded BufferView arg
+ (WriteAs): remove unneeded BufferView arg.
+
+ * bufferparams.h: use correct types on papersize, papersize2 and
+ paperpackage.
+
+ * bufferparams.C (readToken): adjust for type
+ (writeLaTeX): add missing cases to switch.
+
+ * bufferlist.C (quitWriteBuffer): adjust
+ (close): adjust
+
+ * buffer.C (asciiParagraph): remove some commented code.
+
+ * CutAndPaste.C: remove current_view extern variable.
+ (cutSelection): add BufferParams arg.
+ (eraseSelection): add BufferParams arg.
+ (pasteSelection): add Buffer const & arg
+
2003-06-07 John Levon <levon@movementarian.org>
* buffer.C:
2003-06-06 Alfredo Braunstein <abraunst@libero.it>
* BufferView_pimpl.C (dispatch): use Dialogs::visible
-
+
2003-06-04 Angus Leeming <leeming@lyx.org>
* buffer.C: bump format to 224.
using lyx::pos_type;
using lyx::textclass_type;
-extern BufferView * current_view;
-
// Jürgen, note that this means that you cannot currently have a list
// of selections cut/copied. So IMHO later we should have a
// list/vector/deque that we could store
} // namespace anon
-PitPosPair CutAndPaste::cutSelection(ParagraphList & pars,
+PitPosPair CutAndPaste::cutSelection(BufferParams const & params,
+ ParagraphList & pars,
ParagraphList::iterator startpit,
ParagraphList::iterator endpit,
int startpos, int endpos,
textclass_type tc, bool doclear)
{
copySelection(startpit, endpit, startpos, endpos, tc);
- return eraseSelection(pars, startpit, endpit, startpos,
+ return eraseSelection(params, pars, startpit, endpit, startpos,
endpos, doclear);
}
-PitPosPair CutAndPaste::eraseSelection(ParagraphList & pars,
+PitPosPair CutAndPaste::eraseSelection(BufferParams const & params,
+ ParagraphList & pars,
ParagraphList::iterator startpit,
ParagraphList::iterator endpit,
int startpos, int endpos, bool doclear)
if (all_erased &&
(startpit->hasSameLayout(*boost::next(startpit)) ||
boost::next(startpit)->empty())) {
-#warning current_view used here.
-// should we pass buffer or buffer->params around?
- Buffer * buffer = current_view->buffer();
- mergeParagraph(buffer->params, pars, startpit);
+ mergeParagraph(params, pars, startpit);
// this because endpar gets deleted here!
endpit = startpit;
endpos = startpos;
pair<PitPosPair, ParagraphList::iterator>
-CutAndPaste::pasteSelection(ParagraphList & pars,
+CutAndPaste::pasteSelection(Buffer const & buffer,
+ ParagraphList & pars,
ParagraphList::iterator pit, int pos,
textclass_type tc,
ErrorList & errorlist)
{
- return pasteSelection(pars, pit, pos, tc, 0, errorlist);
+ return pasteSelection(buffer, pars, pit, pos, tc, 0, errorlist);
}
pair<PitPosPair, ParagraphList::iterator>
-CutAndPaste::pasteSelection(ParagraphList & pars,
+CutAndPaste::pasteSelection(Buffer const & buffer,
+ ParagraphList & pars,
ParagraphList::iterator pit, int pos,
textclass_type tc, size_t cut_index,
ErrorList & errorlist)
tmpbuf->erase(i--);
}
} else {
- LyXFont f1 = tmpbuf->getFont(current_view->buffer()->params, i, outerFont(pit, pars));
+ LyXFont f1 = tmpbuf->getFont(buffer.params, i, outerFont(pit, pars));
LyXFont f2 = f1;
if (!pit->checkInsertChar(f1)) {
tmpbuf->erase(i--);
case Inset::INCLUDE_CODE: {
InsetInclude * ii = static_cast<InsetInclude*>(lit->inset);
InsetInclude::Params ip = ii->params();
- ip.masterFilename_ = current_view->buffer()->fileName();
+ ip.masterFilename_ = buffer.fileName();
ii->set(ip);
break;
}
-
+
case Inset::TABULAR_CODE: {
InsetTabular * it = static_cast<InsetTabular*>(lit->inset);
- it->buffer(current_view->buffer());
+ it->buffer(const_cast<Buffer*>(&buffer));
break;
}
-
+
default:
break; // nothing
}
// Open the paragraph for inserting the buf
// if necessary.
if (pit->size() > pos || boost::next(pit) == pars.end()) {
- breakParagraphConservative(current_view->buffer()->params,
+ breakParagraphConservative(buffer.params,
pars, pit, pos);
paste_the_end = true;
}
if (boost::next(pit) == last_paste)
last_paste = pit;
- mergeParagraph(current_view->buffer()->params, pars, pit);
+ mergeParagraph(buffer.params, pars, pit);
// Store the new cursor position.
pit = last_paste;
if (boost::next(last_paste) != pars.end() &&
paste_the_end) {
if (boost::next(last_paste)->hasSameLayout(*last_paste)) {
- mergeParagraph(current_view->buffer()->params, pars,
+ mergeParagraph(buffer.params, pars,
last_paste);
} else if (boost::next(last_paste)->empty()) {
boost::next(last_paste)->makeSameLayout(*last_paste);
- mergeParagraph(current_view->buffer()->params, pars,
+ mergeParagraph(buffer.params, pars,
last_paste);
} else if (last_paste->empty()) {
last_paste->makeSameLayout(*boost::next(last_paste));
- mergeParagraph(current_view->buffer()->params, pars,
+ mergeParagraph(buffer.params, pars,
last_paste);
} else
boost::next(last_paste)->stripLeadingSpaces();
///
namespace CutAndPaste {
///
-PitPosPair cutSelection(ParagraphList & pars,
- ParagraphList::iterator startpit,
- ParagraphList::iterator endpit,
- int start, int end, lyx::textclass_type tc,
- bool doclear = false);
+PitPosPair cutSelection(BufferParams const & params,
+ ParagraphList & pars,
+ ParagraphList::iterator startpit,
+ ParagraphList::iterator endpit,
+ int start, int end, lyx::textclass_type tc,
+ bool doclear = false);
///
-PitPosPair eraseSelection(ParagraphList & pars,
- ParagraphList::iterator startpit,
- ParagraphList::iterator endpit,
- int start, int end, bool doclear = false);
+PitPosPair eraseSelection(BufferParams const & params,
+ ParagraphList & pars,
+ ParagraphList::iterator startpit,
+ ParagraphList::iterator endpit,
+ int start, int end, bool doclear = false);
///
bool copySelection(ParagraphList::iterator startpit,
ParagraphList::iterator endpit,
int start, int end, lyx::textclass_type tc);
///
std::pair<PitPosPair, ParagraphList::iterator>
-pasteSelection(ParagraphList & pars,
+pasteSelection(Buffer const & buffer,
+ ParagraphList & pars,
ParagraphList::iterator pit, int pos,
lyx::textclass_type tc, ErrorList &);
///
std::pair<PitPosPair, ParagraphList::iterator>
-pasteSelection(ParagraphList & pars,
+pasteSelection(Buffer const & buffer,
+ ParagraphList & pars,
ParagraphList::iterator pit, int pos,
lyx::textclass_type tc,
size_t cuts_indexm, ErrorList &);
bool noparbreak) const
{
ostringstream buffer;
- Paragraph::depth_type depth = 0;
int ltype = 0;
Paragraph::depth_type ltype_depth = 0;
bool ref_printed = false;
-// if (!par->previous()) {
-#if 0
- // begins or ends a deeper area ?
- if (depth != par->params().depth()) {
- if (par->params().depth() > depth) {
- while (par->params().depth() > depth) {
- ++depth;
- }
- } else {
- while (par->params().depth() < depth) {
- --depth;
- }
- }
- }
-#else
- depth = par.params().depth();
-#endif
+ Paragraph::depth_type depth = par.params().depth();
// First write the layout
string const & tmp = par.layout()->name();
using std::for_each;
using std::mem_fun;
-extern BufferView * current_view;
-
BufferList::BufferList()
{}
bool succeeded;
if (buf->isUnnamed())
- succeeded = WriteAs(current_view, buf);
+ succeeded = WriteAs(buf);
else
- succeeded = MenuWrite(current_view, buf);
+ succeeded = MenuWrite(buf);
if (!succeeded)
return false;
if (ret == 0) {
if (buf->isUnnamed()) {
- if (!WriteAs(current_view, buf))
+ if (!WriteAs(buf))
return false;
} else if (buf->save()) {
lastfiles->newFile(buf->fileName());
if (tmpret == -1)
++tmpret;
else
- papersize2 = tmpret;
+ papersize2 = VMARGIN_PAPER_TYPE(tmpret);
} else if (token == "\\paperpackage") {
int tmpret = lex.findToken(string_paperpackages);
if (tmpret == -1) {
++tmpret;
paperpackage = BufferParams::PACKAGE_NONE;
} else
- paperpackage = tmpret;
+ paperpackage = PAPER_PACKAGES(tmpret);
} else if (token == "\\use_geometry") {
lex.nextToken();
use_geometry = lex.getInteger();
if (!use_geometry &&
(paperpackage == PACKAGE_NONE)) {
switch (papersize) {
+ case PAPER_A3PAPER:
+ clsoptions << "a3paper,";
+ break;
case PAPER_A4PAPER:
clsoptions << "a4paper,";
break;
case PAPER_LEGALPAPER:
clsoptions << "legalpaper,";
break;
+ case PAPER_DEFAULT:
+ break;
}
}
// At the very beginning the text parameters.
if (paperpackage != PACKAGE_NONE) {
switch (paperpackage) {
+ case PACKAGE_NONE:
+ break;
case PACKAGE_A4:
os << "\\usepackage{a4}\n";
texrow.newline();
/* this are for the PaperLayout */
/// the general papersize (papersize2 or paperpackage
- char papersize; // add apprip. signedness
+ PAPER_SIZE papersize;
/// the selected Geometry papersize
- char papersize2; // add approp. signedness
+ VMARGIN_PAPER_TYPE papersize2;
/// a special paperpackage .sty-file
- char paperpackage; // add approp. signedness
+ PAPER_PACKAGES paperpackage;
///
- PAPER_ORIENTATION orientation; // add approp. signedness
+ PAPER_ORIENTATION orientation;
///
bool use_geometry;
///
#include "iconpalette.h"
// needless to say, this can't last for long
+#warning FIXME Current_view used here!
extern BufferView * current_view;
void QMath::subscript()
{
+#warning FIXME Current_view used here!
current_view->owner()->dispatch(FuncRequest(LFUN_SUBSCRIPT));
}
void QMath::superscript()
{
+#warning FIXME Current_view used here!
current_view->owner()->dispatch(FuncRequest(LFUN_SUPERSCRIPT));
}
void QMath::insert(string const & name)
{
+#warning FIXME Current_view used here!
current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + name));
}
void QMath::insertCubeRoot()
{
+#warning FIXME Current_view used here!
current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, "\\root"));
current_view->owner()->dispatch(FuncRequest(LFUN_SELFINSERT, "3"));
current_view->owner()->dispatch(FuncRequest(LFUN_RIGHT));
void QMath::insertMatrix(string const & str)
{
+#warning FIXME Current_view used here!
current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATRIX, str));
}
void QMath::insertDelim(string const & str)
{
+#warning FIXME Current_view used here!
current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DELIM, str));
}
void QMath::toggleDisplay()
{
+#warning FIXME Current_view used here!
current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DISPLAY));
}
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Lars Gullik Bjornes
+ * \author Lars Gullik Bjønnes
* \author John Levon
*
* Full author contact details are available in file CREDITS
} // namespace anon
-// FIXME: this has to go away
+#warning FIXME Current_view is used here!
BufferView * current_view;
qfont_loader fontloader;
qApp->setMainWidget(this);
bufferview_.reset(new BufferView(this, 0, 0, width, height));
+#warning FIXME Current_view is used here!
::current_view = bufferview_.get();
menubar_.reset(new Menubar(this, menubackend));
+2003-06-10 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * XFormsView.C: remvoe current_view global variable.
+ (create_form_form_main): and the usage
+
+ * FormDocument.C: adjust for type
+
2003-06-10 Angus Leeming <leeming@lyx.org>
* FormExternal.C (input, updateComboChange):
void FormDocument::paper_apply(BufferParams & params)
{
- params.papersize2 = char(fl_get_choice(paper_->choice_papersize) - 1);
+ params.papersize2 = BufferParams::VMARGIN_PAPER_TYPE(fl_get_choice(paper_->choice_papersize) - 1);
params.paperpackage =
- char(fl_get_choice(paper_->choice_paperpackage) - 1);
+ BufferParams::PAPER_PACKAGES(fl_get_choice(paper_->choice_paperpackage) - 1);
// set params.papersize from params.papersize2 and params.paperpackage
params.setPaperStuff();
//extern void AutoSave(BufferView *);
extern void QuitLyX();
-// This is very temporary
-BufferView * current_view;
-
extern "C" {
static
bufferview_.reset(new BufferView(this, air, ywork,
width - 3 * air, workheight));
- ::current_view = bufferview_.get();
minibuffer_.reset(new XMiniBuffer(*controlcommand_,
air, height - (25 + air), width - (2 * air), 25));
+2003-06-10 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * insettext.C (appendParagraphs): remove some commented code.
+
2003-06-10 Angus Leeming <leeming@lyx.org>
* graphicinset.[Ch] (params): removed.
* insetert.C (clone): remove const_cast
- * delete commented same_id functions from a lot of files.
+ * delete commented same_id functions from a lot of files.
2003-05-28 John Levon <levon@movementarian.org>
#warning FIXME Check if Changes stuff needs changing here. (Lgb)
// And it probably does. You have to take a look at this John. (Lgb)
#warning John, have a look here. (Lgb)
-#if 0
- BufferParams const & bparams = buffer->params;
- Paragraph * buf;
- Paragraph * tmpbuf = newpar;
- Paragraph * lastbuffer = buf = new Paragraph(*tmpbuf, false);
- if (bparams.tracking_changes)
- buf->cleanChanges();
-
- while (tmpbuf->next()) {
- tmpbuf = tmpbuf->next();
- lastbuffer->next(new Paragraph(*tmpbuf, false));
- lastbuffer->next()->previous(lastbuffer);
- lastbuffer = lastbuffer->next();
- if (bparams.tracking_changes)
- lastbuffer->cleanChanges();
- }
-
- lastbuffer = &*(paragraphs.begin());
- while (lastbuffer->next())
- lastbuffer = lastbuffer->next();
- if (!newpar->empty() && !lastbuffer->empty() &&
- !lastbuffer->isSeparator(lastbuffer->size() - 1))
- {
- lastbuffer->insertChar(lastbuffer->size(), ' ');
- }
-
- // make the buf exactly the same layout than our last paragraph
- buf->makeSameLayout(lastbuffer);
-
- // paste it!
- lastbuffer->next(buf);
- buf->previous(lastbuffer);
- mergeParagraph(buffer->params, paragraphs, lastbuffer);
-#else
ParagraphList::iterator pit = plist.begin();
ParagraphList::iterator ins = paragraphs.insert(paragraphs.end(), *pit);
++pit;
paragraphs.push_back(*pit);
}
-#endif
-
reinitLyXText();
}
// Menu callbacks
//
-bool MenuWrite(BufferView * bv, Buffer * buffer)
+bool MenuWrite(Buffer * buffer)
{
if (buffer->save()) {
lastfiles->newFile(buffer->fileName());
text, 0, 1, _("&Rename"), _("&Cancel"));
if (ret == 0)
- return WriteAs(bv, buffer);
+ return WriteAs(buffer);
return false;
}
-bool WriteAs(BufferView * bv, Buffer * buffer, string const & filename)
+bool WriteAs(Buffer * buffer, string const & filename)
{
string fname = buffer->fileName();
string const oldname = fname;
bool unnamed = buffer->isUnnamed();
buffer->setUnnamed(false);
- if (!MenuWrite(bv, buffer)) {
+ if (!MenuWrite(buffer)) {
buffer->setFileName(oldname);
buffer->setUnnamed(unnamed);
return false;
string const & msg2 = string(),
string const & msg3 = string());
///
-bool MenuWrite(BufferView * bv, Buffer * buffer);
+bool MenuWrite(Buffer * buffer);
/// write the given file, or ask if no name given
-bool WriteAs(BufferView * bv, Buffer * buffer,
- string const & filename = string());
+bool WriteAs(Buffer * buffer, string const & filename = string());
///
void QuitLyX();
///
string const str = bformat(_("Saving document %1$s..."),
MakeDisplayPath(owner->buffer()->fileName()));
owner->message(str);
- MenuWrite(view(), owner->buffer());
+ MenuWrite(owner->buffer());
owner->message(str + _(" done."));
} else
- WriteAs(view(), owner->buffer());
+ WriteAs(owner->buffer());
break;
case LFUN_WRITEAS:
- WriteAs(view(), owner->buffer(), argument);
+ WriteAs(owner->buffer(), argument);
break;
case LFUN_MENURELOAD: {
#include "gettext.h"
#include "support/os.h"
+#include <ios>
+
int main(int argc, char * argv[])
{
+ std::ios::sync_with_stdio(false);
+
os::init(&argc, &argv);
// initialize for internationalized version *EK*
string const get(string const & m) const
{
+ if (m.empty())
+ return m;
+
char * old = strdup(setlocale(LC_ALL, 0));
char * n = setlocale(LC_ALL, lang_.c_str());
const char* msg = gettext(m.c_str());
int endpos = selection.end.pos();
boost::tie(endpit, endpos) = realcut ?
- CutAndPaste::cutSelection(ownerParagraphs(),
+ CutAndPaste::cutSelection(bv()->buffer()->params,
+ ownerParagraphs(),
selection.start.par(), endpit,
selection.start.pos(), endpos,
bv()->buffer()->params.textclass,
doclear)
- : CutAndPaste::eraseSelection(ownerParagraphs(),
+ : CutAndPaste::eraseSelection(bv()->buffer()->params,
+ ownerParagraphs(),
selection.start.par(), endpit,
selection.start.pos(), endpos,
doclear);
ErrorList el;
boost::tie(ppp, endpit) =
- CutAndPaste::pasteSelection(ownerParagraphs(),
+ CutAndPaste::pasteSelection(*bv()->buffer(),
+ ownerParagraphs(),
cursor.par(), cursor.pos(),
bv()->buffer()->params.textclass,
el);