-2001-12-12 Martin Vermeer <martin.vermeer@hut.fi>
+2001-12-12 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * FontLoader.C (getFontinfo): only use symbol fonts with encoding
+ -adobe-fontspecific. At least Mandrake and Redhat have a symbol
+ font in urw-fonts package which is marked as -urw-fontspecific and
+ does not work (incidentally, changing the encoding in the
+ fonts.dir of this package to -adobe-fontspecific fixes the
+ problem).
+
+ * undo_funcs.C (textHandleUndo): fix leak in undo, but now there
+ is a crash when undoing first paragraph (Juergen, please take a
+ look). THis does not mean the undo fix is wrong, just that it
+ uncovers problems.
+
+ * text2.C (ownerParagraph): let the (int,Paragraph*) version call
+ the (Paragraph*) version when needed instead of duplicating the
+ code.
+
+ * text.C (workWidth): use Inset::parOwner to find out where the
+ inset has been inserted. This is a huge performance gain for large
+ documents with lots of insets. If Inset::parOwner is not set, fall
+ back on the brute force method
+
+ * paragraph_pimpl.C (insertInset):
+ * paragraph.C (Paragraph):
+ (cutIntoMinibuffer): set parOwner of insets when
+ inserting/removing them
+
+ * lyxtext.h: add short comment on deleteEmptyParagraphMechanism
+
+2001-12-12 Martin Vermeer <martin.vermeer@hut.fi>
* commandtags.h:
* LyXAction.C:
{
case LyXFont::SYMBOL_FAMILY:
fontinfo[family][series][shape] =
- new FontInfo("-*-symbol-*-*-*-*-*-*-*-*-*-*-*-*");
+ new FontInfo("-*-symbol-*-*-*-*-*-*-*-*-*-*-adobe-fontspecific");
return;
case LyXFont::CMR_FAMILY:
+2001-12-12 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * insetquotes.C (latex): fix to use the local language setting at
+ the point where the inset is inserted (different macros for
+ different french packages)
+
2001-12-11 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* inset.h: add par_owner_ member variable and parOwner
#endif
#include "insetquotes.h"
-#include "support/lyxlib.h"
-#include "debug.h"
-#include "lyxfont.h"
-#include "lyxrc.h"
-#include "buffer.h"
-#include "LaTeXFeatures.h"
+
+#include "support/LAssert.h"
#include "support/lstrings.h"
+#include "BufferView.h"
+#include "LaTeXFeatures.h"
#include "Painter.h"
+#include "buffer.h"
+#include "debug.h"
#include "font.h"
#include "language.h"
-#include "BufferView.h"
+#include "lyxfont.h"
+#include "lyxrc.h"
+#include "paragraph.h"
using std::ostream;
using std::endl;
extern bool use_babel;
int InsetQuotes::latex(Buffer const * buf, ostream & os,
- bool /*fragile*/, bool) const
+ bool /*fragile*/, bool /* free_spc */) const
{
// How do we get the local language here??
+ lyx::pos_type curr_pos = parOwner()->getPositionOfInset(this);
+ lyx::Assert(curr_pos != -1);
+ string const curr_lang =
+ parOwner()->getFont(buf->params,
+ curr_pos).language()->babel();
- string const doclang = buf->getLanguage()->babel();
const int quoteind = quote_index[side_][language_];
string qstr;
if (language_ == FrenchQ && times_ == DoubleQ
- && doclang == "frenchb") {
+ && curr_lang == "frenchb") {
if (side_ == LeftQ)
qstr = "\\og "; //the spaces are important here
else
qstr = " \\fg{}"; //and here
} else if (language_ == FrenchQ && times_ == DoubleQ
- && doclang == "french") {
+ && curr_lang == "french") {
if (side_ == LeftQ)
qstr = "<< "; //the spaces are important here
else
// returns -1 if inset not found
-int Paragraph::getPositionOfInset(Inset * inset) const
+int Paragraph::getPositionOfInset(Inset const * inset) const
{
// Find the entry.
for (InsetList::const_iterator cit = insetlist.begin();
int autoDeleteInsets();
/// returns -1 if inset not found
- int getPositionOfInset(Inset * inset) const;
+ int getPositionOfInset(Inset const * inset) const;
/// some good comment here John?
Paragraph * getParFromID(int id) const;
#define LYX_TYPES_H
// provide a set of typedefs for commonly used things like sizes and
-// indices whil trying to stay compatible with typse used by the standard
+// indices while trying to stay compatible with types used by the standard
// containers.
if (op && op->inInset()) {
static_cast<InsetText *>(op->inInset())->paragraph(p);
} else {
- if (inset_owner) {
- inset_owner->paragraph(p);
- } else {
- bv_owner->buffer()->paragraph = p;
- }
+ ownerParagraph(p);
}
}
// replace the paragraphs with the undo informations
Paragraph * tmppar3 = undo->par;
- undo->par = 0; // otherwise the undo destructor would delete the paragraph
- Paragraph * tmppar4 = tmppar3;
+ undo->par = 0; // otherwise the undo destructor would
+ // delete the paragraph
+ // get last undo par
+ Paragraph * tmppar4 = tmppar3;
if (tmppar4) {
while (tmppar4->next())
tmppar4 = tmppar4->next();
- } // get last undo par
+ }
// now remove the old text if there is any
if (before != behind || (!behind && !before)) {
// the text informations.
if (undo->kind == Undo::EDIT) {
tmppar2->setContentsFromPar(tmppar);
- tmppar->clearContents();
tmppar2 = tmppar2->next();
}
+ delete tmppar;
}
}
if (before)
before->next(tmppar3);
else
- bv->text->ownerParagraph(tmppar3->id(), tmppar3);
+#warning Juergen, why is this needed?? (JMarc)
+// since tmppar3 is not yet inserted in the document, I do not see why
+// the getParFromID which is done by the function below makes sense.
+// OTOH, since you wrote the method just for this instance, I guess you
+// have something in mind
+#if 1
+ bv->text->ownerParagraph(tmppar3->id(),
+ tmppar3);
+#else
+// in this case, since getParFromID is not called, the program does
+// not crash on trying to access buffer()->paragraph, which does not
+// exist anymore if we undid the first par f the document. (JMarc)
+ bv->text->ownerParagraph(tmppar3);
+#endif
+
tmppar3->previous(before);
} else {
// Do we really enter here ??? (Jug)