]> git.lyx.org Git - features.git/commitdiff
Revert commits from 36745
authorPavel Sanda <sanda@lyx.org>
Tue, 7 Dec 2010 00:05:40 +0000 (00:05 +0000)
committerPavel Sanda <sanda@lyx.org>
Tue, 7 Dec 2010 00:05:40 +0000 (00:05 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36749 a592a061-630c-0410-9148-cb99ea01b6c8

13 files changed:
development/cmake/CMakeLists.txt
development/cmake/modules/LyXMacros.cmake
src/Format.cpp
src/Paragraph.cpp
src/Text.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h
src/insets/InsetBibtex.cpp
src/insets/InsetListingsParams.cpp
src/support/docstring.cpp
src/support/lstrings.cpp
src/support/lstrings.h
src/support/textutils.h

index 0e129f271f11797608b4243a98b723e06b775cdf..a88b68d569a947adee221ed50b4881b9bb158816 100644 (file)
@@ -69,7 +69,6 @@ LYX_OPTION(VLD "Use VLD with MSVC" OFF MSVC)
 LYX_OPTION(WALL "Enable all warnings" OFF MSVC)
 LYX_OPTION(DISABLE_PCH "Disable precompiled headers" ON ALL)
 LYX_OPTION(MERGE_FILES "Merge source files into one compilation unit" OFF ALL)
-LYX_OPTION(MERGE_REBUILD "Rebuild generated files from merged files build" OFF ALL)
 LYX_OPTION(DEBUG_GLIBC "Enable libstdc++ debug mode" OFF GCC)
 LYX_OPTION(DEBUG_GLIBC_PEDANTIC "Enable libstdc++pedantic debug mode" OFF GCC)
 LYX_OPTION(STDLIB_DEBUG "Use debug stdlib" OFF GCC)
index b1898fb40eeab1220a3175e442f531a9a720eeea..928a9d05a103ab2ef05cadfd09dc837eb5720bd8 100644 (file)
@@ -152,8 +152,7 @@ macro(lyx_const_touched_files _allinone_name _list)
       endif()
    endif()
 
-   if (LYX_MERGE_REBUILD)
-         #message(STATUS "Merge files build: rebuilding generated files")
+   if (merge_rebuild)
       set(_rebuild_file_const 1)
       set(_rebuild_file_touched 1)
    endif()
index 7d495b7aa91897b8fe4f56740e3c9a9df787399a..7e82f9a3b073756f4eadaed6ebc4bc702f9ed9d7 100644 (file)
@@ -24,7 +24,6 @@
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Systemcall.h"
-#include "support/textutils.h"
 
 #include <algorithm>
 
@@ -103,7 +102,7 @@ bool Format::isChildFormat() const
 {
        if (name_.empty())
                return false;
-       return isDigitASCII(name_[name_.length() - 1]);
+       return isdigit(name_[name_.length() - 1]);
 }
 
 
index ed22830e5a9f994f1e200ddfdb812dd6ac39c70a..4d31441d4f37ab848600667d51bb39e00e2446fa 100644 (file)
@@ -358,8 +358,6 @@ public:
                return speller_change_number > speller_state_.currentChangeNumber();
        }
 
-       bool ignoreWord(docstring const & word) const ;
-       
        void setMisspelled(pos_type from, pos_type to, SpellChecker::Result state)
        {
                pos_type textsize = owner_->size();
@@ -2820,7 +2818,7 @@ bool Paragraph::isWordSeparator(pos_type pos) const
        char_type const c = d->text_[pos];
        // We want to pass the ' and escape chars to the spellchecker
        static docstring const quote = from_utf8(lyxrc.spellchecker_esc_chars + '\'');
-       return (!isLetterChar(c) && !isDigitASCII(c) && !contains(quote, c))
+       return (!isLetterChar(c) && !isDigit(c) && !contains(quote, c))
                || pos == size();
 }
 
@@ -2830,7 +2828,7 @@ bool Paragraph::isChar(pos_type pos) const
        if (Inset const * inset = getInset(pos))
                return inset->isChar();
        char_type const c = d->text_[pos];
-       return !isLetterChar(c) && !isDigitASCII(c) && !lyx::isSpace(c);
+       return !isLetterChar(c) && !isDigit(c) && !lyx::isSpace(c);
 }
 
 
@@ -3547,21 +3545,6 @@ bool Paragraph::needsSpellCheck() const
 }
 
 
-bool Paragraph::Private::ignoreWord(docstring const & word) const
-{
-       // Ignore words with digits
-       // FIXME: make this customizable
-       // (note that some checkers ignore words with digits by default)
-       docstring::const_iterator cit = word.begin();
-       docstring::const_iterator const end = word.end();
-       for (; cit != end; ++cit) {
-               if (isNumber((*cit)))
-                       return true;
-       }
-       return false;
-}
-
-
 SpellChecker::Result Paragraph::spellCheck(pos_type & from, pos_type & to,
        WordLangTuple & wl, docstring_list & suggestions,
        bool do_suggestion, bool check_learned) const
@@ -3587,7 +3570,10 @@ SpellChecker::Result Paragraph::spellCheck(pos_type & from, pos_type & to,
                return result;
 
        if (needsSpellCheck() || check_learned) {
-               if (!d->ignoreWord(word)) {
+               // Ignore words with digits
+               // FIXME: make this customizable
+               // (note that some checkers ignore words with digits by default)
+               if (!hasDigit(word)) {
                        bool const trailing_dot = to < size() && d->text_[to] == '.';
                        result = speller->check(wl);
                        if (SpellChecker::misspelled(result) && trailing_dot) {
index 25f58d55dd89a1915e6a6592b12da989f90f8d7e..63cf1734b9b88551bc5d1301e63b41c75e7d375e 100644 (file)
@@ -850,7 +850,7 @@ void Text::insertChar(Cursor & cur, char_type c)
                static docstring const number_seperators = from_ascii(".,:");
 
                if (cur.current_font.fontInfo().number() == FONT_ON) {
-                       if (!isDigitASCII(c) && !contains(number_operators, c) &&
+                       if (!isDigit(c) && !contains(number_operators, c) &&
                            !(contains(number_seperators, c) &&
                              cur.pos() != 0 &&
                              cur.pos() != cur.lastpos() &&
@@ -858,7 +858,7 @@ void Text::insertChar(Cursor & cur, char_type c)
                              tm.displayFont(pit, cur.pos() - 1).fontInfo().number() == FONT_ON)
                           )
                                number(cur); // Set current_font.number to OFF
-               } else if (isDigitASCII(c) &&
+               } else if (isDigit(c) &&
                           cur.real_current_font.isVisibleRightToLeft()) {
                        number(cur); // Set current_font.number to ON
 
index 8585fb4cb1471ac8b62518517a0da8dba7822e86..554fd90afc03141c40ef5af7efdc14ec4d4f6b0f 100644 (file)
@@ -446,7 +446,7 @@ GuiView::GuiView(int id)
 
 #if (QT_VERSION >= 0x040400)
        connect(&d.autosave_watcher_, SIGNAL(finished()), this,
-               SLOT(autoSaveThreadFinished()));
+               SLOT(processingThreadFinished()));
        connect(&d.processing_thread_watcher_, SIGNAL(finished()), this,
                SLOT(processingThreadFinished()));
 
@@ -548,30 +548,18 @@ void GuiView::processingThreadStarted()
 }
 
 
-void GuiView::processingThreadFinished(bool show_errors)
+void GuiView::processingThreadFinished()
 {
        QFutureWatcher<docstring> const * watcher =
                static_cast<QFutureWatcher<docstring> const *>(sender());
        message(watcher->result());
        updateToolbars();
-       if (show_errors) {
-               errors(d.last_export_format);
-       }
+       errors(d.last_export_format);
        d.processing_cursor_timer_.stop();
        restoreCursorShapes();
        d.indicates_processing_ = false;
 }
 
-void GuiView::processingThreadFinished()
-{
-       processingThreadFinished(true);
-}
-
-void GuiView::autoSaveThreadFinished()
-{
-       processingThreadFinished(false);
-}
-
 #else
 
 void GuiView::setCursorShapes(Qt::CursorShape)
@@ -599,19 +587,9 @@ void GuiView::processingThreadStarted()
 }
 
 
-void GuiView::processingThreadFinished(bool)
-{
-}
-
-
 void GuiView::processingThreadFinished()
 {
 }
-
-
-void GuiView::autoSaveThreadFinished()
-{
-}
 #endif
 
 
index 192516601bd73ad5b4a4f9c4025896d0ce5032f8..a7fd79e8ca66120026c71b5da3aff8a7a6afc9a3 100644 (file)
@@ -232,9 +232,7 @@ private Q_SLOTS:
 
        /// For completion of autosave or export threads.
        void processingThreadStarted();
-       void processingThreadFinished(bool show_errors);
        void processingThreadFinished();
-       void autoSaveThreadFinished();
        void indicateProcessing();
 
        /// must be called in GUI thread
index 88ff6649676b3c9bfc5ec5a4038d82bb054e9d4c..ebabdbdb13970820152b6b29f5e9e550015140e4 100644 (file)
@@ -555,13 +555,13 @@ namespace {
                                return false;
 
                        // check for field type
-                       if (isDigitASCII(ch)) {
+                       if (isDigit(ch)) {
 
                                // read integer value
                                do {
                                        val += ch;
                                        ifs.get(ch);
-                               } while (ifs && isDigitASCII(ch));
+                               } while (ifs && isDigit(ch));
 
                                if (!ifs)
                                        return false;
index db10eb7d8ae5bfee92f8d203f9aa23f7f456a8a4..b0b412b529e3bcf42bb26b688608f495909711f3 100644 (file)
@@ -768,7 +768,7 @@ void InsetListingsParams::addParam(string const & key,
        else {
                bool has_special_char = false;
                for (size_t i = 0; i < value.size(); ++i)
-                       if (!isAlnumASCII(value[i])) {
+                       if (!isAlphaASCII(value[i]) && !isDigit(value[i])) {
                                has_special_char = true;
                                break;
                        }
index 30298b5f59a9a6e310847bcae490ee0c5e1597ee..86deda1d869de654064c2a38c661d47c08c93a48 100644 (file)
@@ -753,9 +753,9 @@ private:
        bool isNumpunct(lyx::char_type const c) const
        {
                /// Only account for the standard numpunct "C" locale facet.
-               return c == '-' || c == '+'
-                       || c == 'x' || c == 'X'
-                       || isHexChar(c);
+               return c < 0x80 && (c == '-' || c == '+' || isdigit(c)
+                       || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F')
+                       || c == 'x' || c == 'X');
        }
 
        template <typename ValueType>
index 4ba72d8081582ec55bb760ad344078eb3ea0ebe6..9e5301fc004991e406b365e7ff4cce69f62e1943 100644 (file)
@@ -147,13 +147,13 @@ bool isSpace(char_type c)
 }
 
 
-bool isNumber(char_type c)
+bool isDigit(char_type c)
 {
        if (!is_utf16(c))
-               // assume that no non-utf16 character is a numeral
+               // assume that no non-utf16 character is a digit
                // c outside the UCS4 range is catched as well
                return false;
-       return ucs4_to_qchar(c).isNumber();
+       return ucs4_to_qchar(c).isDigit();
 }
 
 
@@ -165,7 +165,8 @@ bool isDigitASCII(char_type c)
 
 bool isAlnumASCII(char_type c)
 {
-       return isAlphaASCII(c) || isDigitASCII(c);
+       return ('0' <= c && c <= '9')
+               || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
 }
 
 
@@ -265,7 +266,7 @@ bool isStrInt(string const & str)
 
        string::const_iterator end = tmpstr.end();
        for (; cit != end; ++cit)
-               if (!isDigitASCII(*cit))
+               if (!isdigit((*cit)))
                        return false;
 
        return true;
@@ -285,7 +286,7 @@ bool isStrUnsignedInt(string const & str)
        string::const_iterator cit = tmpstr.begin();
        string::const_iterator end = tmpstr.end();
        for (; cit != end; ++cit)
-               if (!isDigitASCII(*cit))
+               if (!isdigit((*cit)))
                        return false;
 
        return true;
@@ -309,7 +310,7 @@ bool isStrDbl(string const & str)
                ++cit;
        string::const_iterator end = tmpstr.end();
        for (; cit != end; ++cit) {
-               if (!isDigitASCII(*cit) && *cit != '.')
+               if (!isdigit(*cit) && *cit != '.')
                        return false;
                if ('.' == (*cit)) {
                        if (found_dot)
@@ -321,13 +322,19 @@ bool isStrDbl(string const & str)
 }
 
 
-bool hasDigitASCII(docstring const & str)
+bool hasDigit(docstring const & str)
 {
+       if (str.empty())
+               return false;
+
        docstring::const_iterator cit = str.begin();
        docstring::const_iterator const end = str.end();
-       for (; cit != end; ++cit)
-               if (isDigitASCII(*cit))
+       for (; cit != end; ++cit) {
+               if (*cit == ' ')
+                       continue;
+               if (isdigit((*cit)))
                        return true;
+       }
        return false;
 }
 
index 46e4e814b2f1646b471f4a8959053f959fdda128..ae68c49df55a5c881794fbb14d428320875d97be 100644 (file)
@@ -45,7 +45,7 @@ bool isStrUnsignedInt(std::string const & str);
 bool isStrDbl(std::string const & str);
 
 /// does the string contain a digit?
-bool hasDigitASCII(docstring const & str);
+bool hasDigit(docstring const & str);
 
 bool isHex(docstring const & str);
 
index af7736c3c57c38f4a84ee780c9078e5ab74c6490..99594f32c3dfa5092e50a696ad1881b9ae451ab6 100644 (file)
@@ -41,8 +41,8 @@ bool isPrintableNonspace(char_type c);
 /// return true if a unicode char is a space.
 bool isSpace(char_type c);
 
-/// return true if a unicode char is a numeral.
-bool isNumber(char_type c);
+/// return true if a unicode char is a digit.
+bool isDigit(char_type c);
 
 /// return whether \p c is a digit in the ASCII range
 bool isDigitASCII(char_type c);