]> git.lyx.org Git - features.git/commitdiff
Remove IsInsetChar and IsWordChar from textutils.h.
authorAngus Leeming <leeming@lyx.org>
Tue, 16 Sep 2003 12:12:33 +0000 (12:12 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 16 Sep 2003 12:12:33 +0000 (12:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7771 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/buffer.C
src/lyxfind.C
src/paragraph.C
src/rowpainter.C
src/support/ChangeLog
src/support/textutils.h
src/text.C
src/text2.C

index 0846ab4e373e2f08a723ececf7a978a48618de14..24d007561eabca850cfe70f6cae6b26704494f05 100644 (file)
@@ -1,3 +1,18 @@
+2003-09-16  Angus Leeming  <leeming@lyx.org>
+
+       * paragraph.C (IsInsetChar): new function in namespace anon, moved out of
+       support/textutils.h.
+       (isWord): move the contents of support/textutils.h's IsWordChar here.
+
+       * buffer.C:
+       * lyxfind.C:
+       * rowpainter.C:
+       * text.C:
+       * text2.C: add #include "paragraph.h".
+
+       * rowpainter.C:
+       * text.C: replace IsInsetChar(c) with a direct test of Paragraph::META_INSET.
+
 2003-09-16  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * main.C: 
index 19d4103fc8c09ddbbe13fe67c09fbd004a1cfbda..9bf58d5507e05005088d6f91abbe8ea0ba2e8105 100644 (file)
@@ -32,6 +32,7 @@
 #include "lyxrc.h"
 #include "lyxvc.h"
 #include "messages.h"
+#include "paragraph.h"
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
 #include "sgml.h"
index 3e30e438a089c007bcd97d63aec7b09f99769824..bea21a291ab02e064af85b18c23682026ed27835 100644 (file)
@@ -18,6 +18,7 @@
 #include "BufferView.h"
 #include "gettext.h"
 #include "lyxtext.h"
+#include "paragraph.h"
 
 #include "frontends/Alert.h"
 
index 730b7d0159785ab38a5dd73d88407faae3e7740b..671e3af71359ebf0306431593ca3d6dbbad42448 100644 (file)
@@ -1004,6 +1004,17 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
 }
 
 
+namespace {
+
+/// return true if the char is a meta-character for an inset
+inline
+bool IsInsetChar(char c)
+{
+       return (c == Paragraph::META_INSET);
+}
+
+} // namespace anon
+
 
 
 bool Paragraph::isHfill(pos_type pos) const
@@ -1063,7 +1074,10 @@ bool Paragraph::isLetter(pos_type pos) const
 
 bool Paragraph::isWord(pos_type pos) const
 {
-       return IsWordChar(getChar(pos)) ;
+       unsigned char const c = getChar(pos);
+       return !(IsSeparatorChar(c)
+                 || IsKommaChar(c)
+                 || IsInsetChar(c));
 }
 
 
index 0410a79437fcbb407ab9ebbb616cdc9021cfa9f9..7acb3393b407438188080347d4d42b5b1ea38dfc 100644 (file)
@@ -24,6 +24,7 @@
 #include "lyxrow.h"
 #include "lyxrow_funcs.h"
 #include "metricsinfo.h"
+#include "paragraph.h"
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
 #include "vspace.h"
@@ -336,7 +337,7 @@ void RowPainter::paintFromPos(pos_type & vpos)
 
        char const c = pit_->getChar(pos);
 
-       if (IsInsetChar(c)) {
+       if (c == Paragraph::META_INSET) {
                paintInset(pos);
                ++vpos;
                paintForeignMark(orig_x, orig_font);
index 0e87d6f3ac061f8cd1b9f42b127ca649085e6e43..f1abf8229932858ce613119aa37c75bbc03d4afc 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-16  Angus Leeming  <leeming@lyx.org>
+
+       * textutils.h: remove #include "paragraph.h". Remove functions IsInsetChar
+       and IsWordChar.
+
 2003-09-15  Angus Leeming  <leeming@lyx.org>
 
        * copied_ptr.h: re-jig to something that resembles Herb Sutter's HolderPtr ---
index 99f2df85ff37fc0b0e3c106b32443b71fe342c2a..7e9d9fc8e73a77c845017468fe80a07d312e984f 100644 (file)
@@ -15,8 +15,6 @@
 #ifndef TEXTUTILS_H
 #define TEXTUTILS_H
 
-#include "paragraph.h"
-
 /// return true if the char is a word separator
 inline
 bool IsSeparatorChar(char c)
@@ -33,14 +31,6 @@ bool IsLineSeparatorChar(char c)
 }
 
 
-/// return true if the char is a meta-character for an inset
-inline
-bool IsInsetChar(char c)
-{
-       return (c == Paragraph::META_INSET);
-}
-
-
 /// return true if the char is "punctuation"
 inline
 bool IsKommaChar(char c)
@@ -98,16 +88,6 @@ bool IsPrintableNonspace(unsigned char c)
 }
 
 
-/// return true if the char forms part of a word
-inline
-bool IsWordChar(unsigned char c)
-{
-       return !(IsSeparatorChar(c)
-                 || IsKommaChar(c)
-                 || IsInsetChar(c));
-}
-
-
 /// completely pointless FIXME
 inline
 bool IsDigit(unsigned char ch)
index cb29a4cd86e64fddf52b7bd1f68bc695b790e068..6088af6a858c88fde16b6c5d8f72a40a608d1087 100644 (file)
@@ -31,6 +31,7 @@
 #include "lyxrc.h"
 #include "lyxrow.h"
 #include "lyxrow_funcs.h"
+#include "paragraph.h"
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
 #include "rowpainter.h"
@@ -1809,7 +1810,7 @@ void LyXText::changeCase(LyXText::TextCase action)
                        continue;
                }
                unsigned char c = pit->getChar(pos);
-               if (!IsInsetChar(c)) {
+               if (c != Paragraph::META_INSET) {
                        switch (action) {
                        case text_lowercase:
                                c = lowercase(c);
index b1cc8f22b65db79fa7473d01b9fc88d3873941af..579367e73572ab73ee1597514e19ef8af5c85768 100644 (file)
@@ -39,6 +39,7 @@
 #include "lyxrow.h"
 #include "lyxrow_funcs.h"
 #include "metricsinfo.h"
+#include "paragraph.h"
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
 #include "undo_funcs.h"