]> git.lyx.org Git - features.git/commitdiff
fix bugs 357 and 407; speedup Paragraph::Pimpl::isTextAt
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 29 May 2002 22:07:59 +0000 (22:07 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 29 May 2002 22:07:59 +0000 (22:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4285 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/configure.m4
src/ChangeLog
src/insets/ChangeLog
src/insets/insetgraphicsParams.C
src/paragraph_pimpl.C
src/paragraph_pimpl.h

index e812ffb51f90e6ceb001468480026b18f6899aa0..3551398669cb5f37e1d5d2a03aa7d2a3ff38c116 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-29  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * configure.m4: fix handling of --with-version-suffix, so that
+       reLyX is still found. (bug #357)
+
 2002-05-28  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * layouts/hollywood.layout: fix style "FADE_OUT:"
index 6ce98bb726e9b56c3a6da8eee051b915390a13fc..df123826d959c72ef6ddeea316703884527b230f 100644 (file)
@@ -100,7 +100,7 @@ rc_entries=
 lyx_check_config=yes
 lyx_keep_temps=no
 srcdir=
-lyx_suffix=
+version_suffix=
 
 #### Parse the command line
 for ac_option do
@@ -112,15 +112,15 @@ Options:
   --help                   show this help lines
   --keep-temps             keep temporary files (for debug. purposes)
   --without-latex-config   do not run LaTeX to determine configuration
-  --with-lyx-suffix=suffix suffix of binary installed files
+  --with-version-suffix=suffix suffix of binary installed files
 EOF
       exit 0;;
     --without-latex-config)
       lyx_check_config=no ;;
     --keep-temps)
       lyx_keep_temps=yes ;;
-    --with-lyx-suffix*)
-      lyx_suffix=`echo "$ac_option" | sed 's,--with-lyx-suffix=,,;s,^,-,'`
+    --with-version-suffix*)
+      version_suffix=`echo "$ac_option" | sed 's,--with-version-suffix=,,'`
   esac
 done
 
@@ -219,11 +219,11 @@ PATH=${PATH}:./reLyX/
 SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command,reLyX)
 PATH=${save_PATH}
 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
-tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$lyx_suffix,"`
+tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$version_suffix,"`
 
 SEARCH_PROG([for a Noweb -> LyX converter],literate_to_lyx_command,noweb2lyx)
 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$i \$\$o"
-literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$lyx_suffix,"`
+literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$version_suffix,"`
 
 # Search something to process a literate document
 SEARCH_PROG([for a Noweb -> LaTeX converter],literate_to_tex_command,noweave)
index 2536336098ee7690904b91d804feaf1c14a2af43..d9557742e145f246ffd7fc6bc8519bd61c37d097 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-29  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * paragraph_pimpl.C (isTextAt): rewrite to be much faster (do not
+       call getFont all the time)
+
 2002-05-29  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * switch from SigC signals to boost::signals
index b23d272276dc572551337a7588ee437b9d0022e4..a04ca44186908cfcee66304f748f71ec97ef7cd5 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-29  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * insetgraphicsParams.C (Read): use lyxlex::eatLine to read the
+       file name, in case there are weird characters like ',' in there.
+       (bug #407)
+
 2002-05-29  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * switch from SigC signals to boost::signals.
index 41c61fdb7851eb9e8a4c8b045e1da5d8246feecd..43d2057e65d5e9b03f0d80e2efbd3e94cadcb262 100644 (file)
@@ -221,7 +221,7 @@ void InsetGraphicsParams::Write(ostream & os) const
 bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
 {
        if (token == "filename") {
-               lex.next();
+               lex.eatLine();
                filename = lex.getString();
        } else if (token == "BoundingBox") {
                for (int i=0; i<4 ;i++) {
index bbc9f87be89e2d48db80a85b86b60ee28136e233..4f662fe18258c4c19787388b758f20ca3ceebc5e 100644 (file)
@@ -275,19 +275,30 @@ void Paragraph::Pimpl::simpleTeXBlanks(ostream & os, TexRow & texrow,
 }
 
 
-bool Paragraph::Pimpl::isTextAt(BufferParams const & bp,
-                               string const & str, pos_type pos)
+bool Paragraph::Pimpl::isTextAt(string const & str, pos_type pos)
 {
-       LyXFont const & font = owner_->getFont(bp, pos);
+       pos_type const len = str.length();
+       
+       // is the paragraph large enough?
+       if (pos + len > size())
+               return false;
 
+       // does the wanted text start at point?
        for (string::size_type i = 0; i < str.length(); ++i) {
-               if (pos + static_cast<pos_type>(i) >= size())
-                       return false;
-               if (str[i] != getChar(pos + i))
-                       return false;
-               if (owner_->getFont(bp, pos + i) != font)
+               if (str[i] != text[pos + i])
                        return false;
        }
+
+       // is there a font change in middle of the word?
+       FontList::const_iterator cit = fontlist.begin();
+       FontList::const_iterator end = fontlist.end();
+       for (; cit != end; ++cit) {
+               if (cit->pos() >= pos)
+                       break;
+       }
+       if (cit != end && pos + len - 1 > cit->pos())
+               return false;
+
        return true;
 }
 
@@ -507,7 +518,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                        size_t pnr = 0;
 
                        for (; pnr < phrases_nr; ++pnr) {
-                               if (isTextAt(bparams, special_phrases[pnr][0], i)) {
+                               if (isTextAt(special_phrases[pnr][0], i)) {
                                        os << special_phrases[pnr][1];
                                        i += special_phrases[pnr][0].length() - 1;
                                        column += special_phrases[pnr][1].length() - 1;
index c504bc85aa806a0ceb5dda37ce001d2fa1334662..efbbd7046f66952e139a073d85a907a9213e770b 100644 (file)
@@ -151,8 +151,7 @@ struct Paragraph::Pimpl {
        ParagraphParameters params;
 private:
        /// match a string against a particular point in the paragraph
-       bool isTextAt(BufferParams const &,
-                     string const & str, lyx::pos_type pos);
+       bool isTextAt(string const & str, lyx::pos_type pos);
 
        /// Who owns us?
        Paragraph * owner_;