From: Jean-Marc Lasgouttes Date: Mon, 1 Jul 2002 14:31:57 +0000 (+0000) Subject: fix latex output for graphics file names containing "."; partly fix 381 X-Git-Tag: 1.6.10~18985 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4e2dae89d2edb10e6366d254673ead57355fda49;p=features.git fix latex output for graphics file names containing "."; partly fix 381 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4508 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/po/POTFILES.in b/po/POTFILES.in index b6d704dc55..ab2b31bb8c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -8,6 +8,7 @@ src/converter.C src/CutAndPaste.C src/debug.C src/exporter.C +src/ext_l10n.h src/FloatList.C src/frontends/controllers/biblio.C src/frontends/controllers/ButtonController.h @@ -161,7 +162,6 @@ src/mathed/formulamacro.C src/mathed/math_cursor.C src/mathed/ref_inset.C src/MenuBackend.C -src/minibuffer.C src/paragraph.C src/support/filetools.C src/tabular.C diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 261d8b3fcf..22c5617291 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -888,7 +888,7 @@ Inset * BufferView::Pimpl::checkInsetHit(LyXText * text, int & x, int & y) void BufferView::Pimpl::workAreaResize() { static int work_area_width; - static unsigned int work_area_height; + static int work_area_height; bool const widthChange = workarea().workWidth() != work_area_width; bool const heightChange = workarea().workHeight() != work_area_height; diff --git a/src/ChangeLog b/src/ChangeLog index 18852488da..7f253e82b4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2002-07-01 Jean-Marc Lasgouttes + + * paragraph.C (startTeXParParams): + (endTeXParParams): add \protect when necessary + +2002-06-19 Jean-Marc Lasgouttes + + * BufferView_pimpl.C (workAreaExpose): remove warning + 2002-06-27 Angus Leeming * Makefile.am: add lyxlayout_ptr_fwd.h. diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 7058c9c33f..3f4056bce5 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,8 @@ +2002-07-01 Jean-Marc Lasgouttes + + * GraphicsConverter.C (convert): do not use ChangeExtension + because to_file_base may contain a dot. + 2002-06-28 Angus Leeming * GraphicsCacheItem.[Ch]: refactor some of the more convoluted logic diff --git a/src/graphics/GraphicsConverter.C b/src/graphics/GraphicsConverter.C index 841d6d1891..a1f45e1280 100644 --- a/src/graphics/GraphicsConverter.C +++ b/src/graphics/GraphicsConverter.C @@ -150,7 +150,9 @@ Converter::Impl::Impl(Converter & p, fs.close(); // The converted image is to be stored in this file - to_file_ = ChangeExtension(to_file_base, formats.extension(to_format)); + // We do not use ChangeExtension here because this is a + // basename, which may nevertheless contain a dot + to_file_ = to_file_base + '.' + formats.extension(to_format); // The command needed to run the conversion process // We create a dummy command for ease of understanding of the diff --git a/src/paragraph.C b/src/paragraph.C index f92968bac2..97405c5e94 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1461,7 +1461,7 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf, // This could go to ParagraphParameters if we want to int Paragraph::startTeXParParams(BufferParams const & bparams, - ostream & os) const + ostream & os, bool moving_arg) const { int column = 0; @@ -1470,6 +1470,22 @@ int Paragraph::startTeXParParams(BufferParams const & bparams, column += 10; } + switch (params().align()) { + case LYX_ALIGN_NONE: + case LYX_ALIGN_BLOCK: + case LYX_ALIGN_LAYOUT: + case LYX_ALIGN_SPECIAL: + break; + case LYX_ALIGN_LEFT: + case LYX_ALIGN_RIGHT: + case LYX_ALIGN_CENTER: + if (moving_arg) { + os << "\\protect"; + column = 8; + } + break; + } + switch (params().align()) { case LYX_ALIGN_NONE: case LYX_ALIGN_BLOCK: @@ -1505,10 +1521,26 @@ int Paragraph::startTeXParParams(BufferParams const & bparams, // This could go to ParagraphParameters if we want to int Paragraph::endTeXParParams(BufferParams const & bparams, - ostream & os) const + ostream & os, bool moving_arg) const { int column = 0; + switch (params().align()) { + case LYX_ALIGN_NONE: + case LYX_ALIGN_BLOCK: + case LYX_ALIGN_LAYOUT: + case LYX_ALIGN_SPECIAL: + break; + case LYX_ALIGN_LEFT: + case LYX_ALIGN_RIGHT: + case LYX_ALIGN_CENTER: + if (moving_arg) { + os << "\\protect"; + column = 8; + } + break; + } + switch (params().align()) { case LYX_ALIGN_NONE: case LYX_ALIGN_BLOCK: @@ -1602,7 +1634,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf, ++column; } if (!asdefault) - column += startTeXParParams(bparams, os); + column += startTeXParParams(bparams, os, moving_arg); } @@ -1626,7 +1658,8 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf, } if (!asdefault) - column += startTeXParParams(bparams, os); + column += startTeXParParams(bparams, os, + moving_arg); } value_type c = getChar(i); @@ -1741,7 +1774,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf, } if (!asdefault) { - column += endTeXParParams(bparams, os); + column += endTeXParParams(bparams, os, moving_arg); } lyxerr[Debug::LATEX] << "SimpleTeXOnePar...done " << this << endl; diff --git a/src/paragraph.h b/src/paragraph.h index b555faa376..f7fc207b2b 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -123,10 +123,10 @@ public: bool moving_arg); /// - int startTeXParParams(BufferParams const &, std::ostream &) const; + int startTeXParParams(BufferParams const &, std::ostream &, bool) const; /// - int endTeXParParams(BufferParams const &, std::ostream &) const; + int endTeXParParams(BufferParams const &, std::ostream &, bool) const; ///