src/converter.C
src/debug.C
src/exporter.C
+src/ext_l10n.h
src/figureForm.C
src/figure_form.C
src/frontends/controllers/ButtonController.h
+2001-10-18 Juergen Vigna <jug@sad.it>
+
+ * text.C (workWidth): new function with added Inset * parameter.
+
2001-10-16 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* text2.C (setCursorFromCoordinates): use Paragraph::size_type
+2001-10-18 Juergen Vigna <jug@sad.it>
+
+ * inset.C (getMaxWidth): use LyXText::workWidth(BufferView, Inset *).
+
2001-10-15 José Matos <jamatos@fep.up.pt>
* insetert.C: allow export for docbook and linuxdoc
w = static_cast<UpdatableInset*>
(owner())->getMaxWidth(bv, this);
} else {
- w = bv->workWidth();
+ w = bv->text->workWidth(bv, const_cast<UpdatableInset *>(this));
}
if (w < 0) {
return -1;
if ((w - ((2 * TEXT_TO_INSET_OFFSET) + 5)) >= 0)
w -= (2 * TEXT_TO_INSET_OFFSET) + 5;
if (topx_set && owner()) {
+ lyxerr << "topx_set && owner()\n";
w -= top_x;
w += owner()->x();
- } else if (!owner()) {
+ }
+#if 0 // already handled above now!!!
+ else if (!owner()) {
// give some left margin this should be made better!
// Idea: LyXText::giveLeftMargin(Inset * inset) will search the
// inset in the text and return the LeftMargin of that row!
+ lyxerr << "w -= 20\n";
w -= 20;
}
+#endif
if (w < 10) {
w = 10;
}
///
int workWidth(BufferView *) const;
///
+ int workWidth(BufferView *, Inset * inset) const;
+ ///
void computeBidiTables(Buffer const *, Row * row) const;
/// Maps positions in the visual string to positions in logical string.
}
+int LyXText::workWidth(BufferView * bview, Inset * inset) const
+{
+ Buffer::inset_iterator it;
+ Paragraph * par = 0;
+ Paragraph::size_type pos;
+
+ for(it=bview->buffer()->inset_iterator_begin();
+ it != bview->buffer()->inset_iterator_end();
+ ++it)
+ {
+ if (*it == inset) {
+ par = it.getPar();
+ pos = it.getPos();
+ break;
+ }
+ }
+ if (par) {
+ Row * row = firstrow;
+ for(; row; row = row->next()) {
+ if ((row->par() == par && row->pos() >= pos)) {
+ if (!row->next())
+ break;
+ else if ((row->next()->par() == par) &&
+ (row->next()->pos() >= pos))
+ continue;
+ }
+ }
+ if (row) {
+ return workWidth(bview) - leftMargin(bview, row);
+ }
+ }
+ return workWidth(bview);
+}
+
+
int LyXText::getRealCursorX(BufferView * bview) const
{
int x = cursor.x();