]> git.lyx.org Git - lyx.git/commitdiff
a few small new features
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 20 Jul 2001 09:38:19 +0000 (09:38 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 20 Jul 2001 09:38:19 +0000 (09:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2289 a592a061-630c-0410-9148-cb99ea01b6c8

15 files changed:
lib/ChangeLog
lib/ui/default.ui
src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/ChangeLog
src/LyXAction.C
src/commandtags.h
src/insets/ChangeLog
src/insets/insetquotes.C
src/insets/insetquotes.h
src/insets/insetspecialchar.C
src/insets/insetspecialchar.h
src/lyx_main.C
src/paragraph.C
src/paragraph.h

index 920e9bcd827ef7f4c4a9db4c0da5f9626352b5d0..feb79efc04f62809bdaa761e59d026c1bb6d21a7 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-19  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * ui/default.ui: change a shortcut
+
 2001-07-19  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * chkconfig.ltx: test for the presence of natbib.
index abbeafc1f2c2f13f3630db9f441172ced5dc4fd2..c0033d5d376753881ad7f9983b1029abbc219774 100644 (file)
@@ -45,7 +45,7 @@ Menuset
        Item "Close|C" "buffer-close"
        Item "Save|S" "buffer-write"
        Item "Save As...|A" "buffer-write-as"
-       Item "Revert to Saved|d" "buffer-reload"
+       Item "Revert to Saved|R" "buffer-reload"
        Submenu "Version Control|V" "file_vc"
        Separator
        Submenu "Import|I" "file_import"
@@ -217,6 +217,7 @@ Menuset
        Item "Subscript|u" "command-sequence math-insert _;math-mode;"
        Item "HFill|H" "hfill-insert"
        Item "Hyphenation Point|P" "hyphenation-point-insert"
+       Item "Hyphenation break|k" "hyphenation-break-insert"
        Item "Protected Blank|B" "protected-space-insert"
        Item "Linebreak|L" "break-line"
        Item "Ellipsis|i" "dots-insert"
index 16c82432c33c1bca6875ab9a95e44428268bcc2a..0e2431a36791c5f0fee5ae20c01bda0e517cdc35 100644 (file)
@@ -1520,19 +1520,23 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
        }
 
        case LFUN_HYPHENATION:
-               hyphenationPoint();
+               specialChar(InsetSpecialChar::HYPHENATION);
+               break;
+               
+       case LFUN_HYPHENATION_BREAK:
+               specialChar(InsetSpecialChar::HYPHENATION_BREAK);
                break;
                
        case LFUN_LDOTS:
-               ldots();
+               specialChar(InsetSpecialChar::LDOTS);
                break;
                
        case LFUN_END_OF_SENTENCE:
-               endOfSentenceDot();
+               specialChar(InsetSpecialChar::END_OF_SENTENCE);
                break;
 
        case LFUN_MENU_SEPARATOR:
-               menuSeparator();
+               specialChar(InsetSpecialChar::MENU_SEPARATOR);
                break;
                
        case LFUN_HFILL:
@@ -3015,24 +3019,21 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                
        case LFUN_INDEX_CREATE:
        {
-               InsetCommandParams p( "index" );
+               InsetCommandParams p("index");
                
                if (argument.empty()) {
-                       // Get the word immediately preceding the cursor
-                       Paragraph::size_type curpos = 
-                               bv_->getLyXText()->cursor.pos() - 1;
-
-                       string curstring;
-                       if (curpos >= 0 )
-                               curstring = bv_->getLyXText()
-                                       ->cursor.par()->getWord(curpos);
+                       // Get word or selection
+                       bv_->getLyXText()->selectWordWhenUnderCursor(bv_);
+                       
+                       string const curstring = 
+                               bv_->getLyXText()->selectionAsString(buffer_);
 
-                       p.setContents( curstring );
+                       p.setContents(curstring);
                } else {
-                       p.setContents( argument );
+                       p.setContents(argument);
                }
 
-               owner_->getDialogs()->createIndex( p.getAsString() );
+               owner_->getDialogs()->createIndex(p.getAsString());
        }
        break;
                    
@@ -3051,14 +3052,11 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                    
        case LFUN_INDEX_INSERT_LAST:
        {
-               // Get word immediately preceding the cursor
-               Paragraph::size_type curpos = 
-                       bv_->getLyXText()->cursor.pos() - 1;
-               // Can't do that at the beginning of a paragraph
-               if (curpos < 0) break;
+               // Get word or selection
+               bv_->getLyXText()->selectWordWhenUnderCursor(bv_);
 
-               string const curstring(bv_->getLyXText()
-                                      ->cursor.par()->getWord(curpos));
+               string const curstring = 
+                       bv_->getLyXText()->selectionAsString(buffer_);
 
                InsetCommandParams p("index", curstring);
                InsetIndex * inset = new InsetIndex(p);
@@ -3252,6 +3250,12 @@ void BufferView::Pimpl::protectedBlank(LyXText * lt)
                update(lt, BufferView::SELECT|BufferView::FITCUR);
                InsetSpecialChar * new_inset =
                        new InsetSpecialChar(InsetSpecialChar::PROTECTED_SEPARATOR);
+#ifdef WITH_WARNINGS
+#warning Why is this code different from specialChar() below? (JMarc)
+// the code in specialChar is a generic version of what used to exist
+// for other special chars. I did not merge this case because of the
+// call to updateInset(), but what does it do?
+#endif
                if (!insertInset(new_inset))
                        delete new_inset;
                else
@@ -3259,8 +3263,7 @@ void BufferView::Pimpl::protectedBlank(LyXText * lt)
        }
 }
 
-
-void BufferView::Pimpl::menuSeparator()
+void BufferView::Pimpl::specialChar(InsetSpecialChar::Kind kind)
 {
        if (available()) {
                LyXText * lt = bv_->getLyXText();
@@ -3268,43 +3271,7 @@ void BufferView::Pimpl::menuSeparator()
                hideCursor();
                update(lt, BufferView::SELECT|BufferView::FITCUR);
                InsetSpecialChar * new_inset = 
-                       new InsetSpecialChar(InsetSpecialChar::MENU_SEPARATOR);
-               insertInset(new_inset);
-       }
-}
-
-
-void BufferView::Pimpl::endOfSentenceDot()
-{
-       if (available()) {
-               hideCursor();
-               update(bv_->getLyXText(), BufferView::SELECT|BufferView::FITCUR);
-               InsetSpecialChar * new_inset = 
-                       new InsetSpecialChar(InsetSpecialChar::END_OF_SENTENCE);
-               insertInset(new_inset);
-       }
-}
-
-
-void BufferView::Pimpl::ldots()
-{
-       if (available())  {
-               hideCursor();
-               update(bv_->getLyXText(), BufferView::SELECT|BufferView::FITCUR);
-               InsetSpecialChar * new_inset = 
-                       new InsetSpecialChar(InsetSpecialChar::LDOTS);
-               insertInset(new_inset);
-       }
-}
-
-
-void BufferView::Pimpl::hyphenationPoint()
-{
-       if (available()) {
-               hideCursor();
-               update(bv_->getLyXText(), BufferView::SELECT|BufferView::FITCUR);
-               InsetSpecialChar * new_inset = 
-                       new InsetSpecialChar(InsetSpecialChar::HYPHENATION);
+                       new InsetSpecialChar(kind);
                insertInset(new_inset);
        }
 }
index 6f3e376230ac8ae264fb75859b7f2551ea654706..f4b9162a10079f503fd58432c861b7486e43fa9b 100644 (file)
@@ -11,6 +11,7 @@
 #include "frontends/Timeout.h"
 #include "WorkArea.h"
 #include "paragraph.h"
+#include "insets/insetspecialchar.h"
 
 #ifdef __GNUG__
 #pragma interface
@@ -131,19 +132,13 @@ private:
        bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
        ///
        void protectedBlank(LyXText * lt);
+       /// 
+       void specialChar(InsetSpecialChar::Kind);
        ///
        void newline();
        ///
        void hfill();
        ///
-       void menuSeparator();
-       ///
-       void endOfSentenceDot();
-       ///
-       void ldots();
-       ///
-       void hyphenationPoint();
-       ///
        void insertNote();
        ///
        void gotoInset(std::vector<Inset::Code> const & codes,
index c1185489c70ee073cc8870aa5302760428b01205..e6a5c80bf4af95c158960ef7f79dba45c69da024 100644 (file)
@@ -1,3 +1,21 @@
+2001-07-19  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * BufferView_pimpl.C (specialChar): new method. Obsoletes
+       menuSeparator(), endOfSentenceDot(), ldots() and
+       hyphenationPoint(), which are therefore removed.
+       (Dispatch): handle LFUN_HYPHENATION_BREAK.
+
+       * LyXAction.C (init): 
+       * commandtags.h: add LFUN_HYPHENATION_BREAK.
+
+       * paragraph.C (getWord): removed.
+
+       * BufferView_pimpl.C (Dispatch): use last word or selection for
+       LFUN_INDEX_INSERT_LAST and LFUN_INDEX_CREATE.
+
+       * lyx_main.C (queryUserLyXDir): do not ask before creating
+       user_dir, except if it has been named explicitely.
+
 2001-07-20  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * BufferView_pimpl.C (updateScrollbar): Fix crash when reading in
index 7ad41699161076ce0630d8951080e2a1b9e58262..6c4a60d3dddfe1ece248e5c762c4e592397aa8cc 100644 (file)
@@ -232,6 +232,8 @@ void LyXAction::init()
                { LFUN_HTMLURL, "html-insert", "", Noop },
                { LFUN_HYPHENATION, "hyphenation-point-insert",
                  N_("Insert hyphenation point"), Noop },
+               { LFUN_HYPHENATION_BREAK, "hyphenation-break-insert",
+                 N_("Insert hyphenation break"), Noop },
                { LFUN_INDEX_CREATE, "index-insert",
                  N_("Insert index item"), Noop },
                { LFUN_INDEX_INSERT_LAST, "index-insert-last",
index f422a7e67317474a819d9f2230b4971974e33e13..5a18c90531e3fe047e923a740e3d7bdc62b04de4 100644 (file)
@@ -51,6 +51,7 @@ enum kb_action {
        LFUN_GOTONOTE,
        LFUN_INSET_TOGGLE,
        LFUN_HYPHENATION,
+       LFUN_HYPHENATION_BREAK,
        LFUN_HFILL,
        LFUN_DEPTH,
        LFUN_FREE,     // 30
index 233192c6e601a44533711f5f88d3266aaec93e9d..01682fd07ac04973531d0fc059db51c0dc275f2b 100644 (file)
@@ -1,3 +1,13 @@
+2001-07-19  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * insetspecialchar.[Ch]: add support for HYPHENATION_BREAK. some
+       reformatting
+
+       * insetquotes.C: general cleanup
+       (dispString): add spaces inside french double quotes.
+       (latex): ditto. Moreover, treat first the case where the frenchb
+       or french options have been given.
+
 2001-07-19  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * insetcite.[Ch] (latex, validate): new methods, required for natbib
index 387e4613338395b0bec93b91cb65e36f58f8f8c6..695187a4945b94bf99cf013fd01c2022dea77689 100644 (file)
@@ -73,25 +73,25 @@ InsetQuotes::InsetQuotes(string const & str)
 }
 
 
-InsetQuotes::InsetQuotes(InsetQuotes::quote_language l,
-                        InsetQuotes::quote_side s,
-                        InsetQuotes::quote_times t)
-       : language(l), side(s), times(t)
+InsetQuotes::InsetQuotes(quote_language l,
+                        quote_side s,
+                        quote_times t)
+       : language_(l), side_(s), times_(t)
 {}
 
 
 InsetQuotes::InsetQuotes(char c, BufferParams const & params)
-       : language(params.quotes_language), times(params.quotes_times)
+       : language_(params.quotes_language), times_(params.quotes_times)
 {
        // Decide whether left or right 
        switch (c) {
        case ' ': case '(': case '{': case '[': case '-': case ':':
        case Paragraph::META_HFILL:
        case Paragraph::META_NEWLINE: 
-               side = InsetQuotes::LeftQ;   // left quote 
+               side_ = LeftQ;   // left quote 
                break;
        default:
-               side = InsetQuotes::RightQ;  // right quote
+               side_ = RightQ;  // right quote
        }
 }
 
@@ -109,47 +109,47 @@ void InsetQuotes::parseString(string const & s)
        
        for (i = 0; i < 6; ++i) {
                if (str[0] == language_char[i]) {
-                       language = InsetQuotes::quote_language(i);
+                       language_ = quote_language(i);
                        break;
                }
        }
        if (i >= 6) {
                lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
                        " bad language specification." << endl;
-               language = InsetQuotes::EnglishQ; 
+               language_ = EnglishQ; 
        }
 
        for (i = 0; i < 2; ++i) {
                if (str[1] == side_char[i]) {
-                       side = InsetQuotes::quote_side(i);
+                       side_ = quote_side(i);
                        break;
                }
        }
        if (i >= 2) {
                lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
                        " bad side specification." << endl;
-               side = InsetQuotes::LeftQ; 
+               side_ = LeftQ; 
        }
 
        for (i = 0; i < 2; ++i) {
                if (str[2] == times_char[i]) {
-                       times = InsetQuotes::quote_times(i);
+                       times_ = quote_times(i);
                        break;
                }
        }
        if (i >= 2) {
                lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
                        " bad times specification." << endl;
-               times = InsetQuotes::DoubleQ; 
+               times_ = DoubleQ; 
        }
 }
 
 
-string const InsetQuotes::dispString() const
+string const InsetQuotes::dispString(Language const * doclang) const
 {
        string disp;
-       disp += quote_char[quote_index[side][language]];
-       if (times == InsetQuotes::DoubleQ)
+       disp += quote_char[quote_index[side_][language_]];
+       if (times_ == DoubleQ)
                disp += disp;
 
        if (lyxrc.font_norm_type == LyXRC::ISO_8859_1
@@ -158,6 +158,14 @@ string const InsetQuotes::dispString() const
                        disp = '«';
                else if (disp == ">>")
                        disp = '»';
+
+       // in french, spaces are added inside double quotes
+       if (times_ == DoubleQ && doclang->code() == "fr") {
+               if (side_ == LeftQ)
+                       disp += " ";
+               else
+                       disp = " " + disp;
+       }
        
        return disp;
 }
@@ -175,9 +183,9 @@ int InsetQuotes::descent(BufferView *, LyXFont const & font) const
 }
 
 
-int InsetQuotes::width(BufferView *, LyXFont const & font) const
+int InsetQuotes::width(BufferView * bv, LyXFont const & font) const
 {
-       string text = dispString();
+       string text = dispString(bv->buffer()->getLanguage());
        int w = 0;
 
        for (string::size_type i = 0; i < text.length(); ++i) {
@@ -207,7 +215,7 @@ LyXFont const InsetQuotes::convertFont(LyXFont const & f) const
 void InsetQuotes::draw(BufferView * bv, LyXFont const & font,
                       int baseline, float & x, bool) const
 {
-       string text = dispString();
+       string text = dispString(bv->buffer()->getLanguage());
 
        bv->painter().text(int(x), baseline, text, font);
        x += width(bv, font);
@@ -217,9 +225,9 @@ void InsetQuotes::draw(BufferView * bv, LyXFont const & font,
 void InsetQuotes::write(Buffer const *, ostream & os) const
 {
        string text;
-       text += language_char[language];
-       text += side_char[side];
-       text += times_char[times]; 
+       text += language_char[language_];
+       text += side_char[side_];
+       text += times_char[times_]; 
        os << "Quotes " << text;
 }
 
@@ -241,27 +249,33 @@ extern bool use_babel;
 int InsetQuotes::latex(Buffer const * buf, ostream & os,
                       bool /*fragile*/, bool) const
 {
-       string const doclang = buf->getLanguage()->lang();
-       int quoteind = quote_index[side][language];
+       string const doclang = buf->getLanguage()->babel();
+       int quoteind = quote_index[side_][language_];
        string qstr;
        
-       if (lyxrc.fontenc == "T1") {
-               qstr = latex_quote_t1[times][quoteind];
+       if (language_ == FrenchQ && times_ == DoubleQ) {
+               if (doclang == "frenchb") {
+                       if (side_ == LeftQ) 
+                               qstr = "\\og "; //the spaces are important here
+                       else 
+                               qstr = " \\fg "; //and here
+               } else if (doclang == "french") {
+                       if (side_ == LeftQ) 
+                               qstr = "<< "; //the spaces are important here
+                       else 
+                               qstr = " >>"; //and here
+               }                       
+       } else if (lyxrc.fontenc == "T1") {
+               qstr = latex_quote_t1[times_][quoteind];
 #ifdef DO_USE_DEFAULT_LANGUAGE
        } else if (doclang == "default") {
 #else
        } else if (!use_babel) {
 #endif
-               qstr = latex_quote_ot1[times][quoteind];
-       } else if (language == InsetQuotes::FrenchQ 
-                && times == InsetQuotes::DoubleQ
-                && doclang == "frenchb") {
-               if (side == InsetQuotes::LeftQ) 
-                       qstr = "\\og{}";
-               else 
-                       qstr = " \\fg{}";
-       } else 
-               qstr = latex_quote_babel[times][quoteind];
+               qstr = latex_quote_ot1[times_][quoteind];
+       } else { 
+               qstr = latex_quote_babel[times_][quoteind];
+       }
 
        // Always guard against unfortunate ligatures (!` ?`)
        if (prefixIs(qstr, "`"))
@@ -288,13 +302,13 @@ int InsetQuotes::linuxdoc(Buffer const *, ostream & os) const
 
 int InsetQuotes::docBook(Buffer const *, ostream & os) const
 {
-       if (times == InsetQuotes::DoubleQ) {
-               if (side == InsetQuotes::LeftQ)
+       if (times_ == DoubleQ) {
+               if (side_ == LeftQ)
                        os << "&ldquo;";
                else
                        os << "&rdquo;";
        } else {
-               if (side == InsetQuotes::LeftQ)
+               if (side_ == LeftQ)
                        os << "&lsquo;";
                else
                        os << "&rsquo;";
@@ -305,11 +319,11 @@ int InsetQuotes::docBook(Buffer const *, ostream & os) const
 
 void InsetQuotes::validate(LaTeXFeatures & features) const 
 {
-       char type = quote_char[quote_index[side][language]];
+       char type = quote_char[quote_index[side_][language_]];
 
        if (features.bufferParams().language->lang() == "default" 
            && lyxrc.fontenc != "T1") {
-               if (times == InsetQuotes::SingleQ) 
+               if (times_ == SingleQ) 
                        switch (type) {
                        case ',': features.quotesinglbase = true; break;
                        case '<': features.guilsinglleft = true; break;
@@ -329,7 +343,7 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
 
 Inset * InsetQuotes::clone(Buffer const &, bool) const
 {
-  return new InsetQuotes(language, side, times);
+  return new InsetQuotes(language_, side_, times_);
 }
 
 
index b4b953d59c52d25f163d63fb4004d19b6dd8244c..cad15a2d4c6e28c73a6b815eec51d0b0545e90d7 100644 (file)
@@ -19,6 +19,7 @@
 #include "inset.h"
 
 class BufferParams;
+class Language;
 
 struct LaTeXFeatures;
 
@@ -102,11 +103,11 @@ public:
        Inset::Code lyxCode() const;
 private:
        ///
-       quote_language language;
+       quote_language language_;
        ///
-       quote_side side;
+       quote_side side_;
        ///
-       quote_times times;
+       quote_times times_;
 
        /** The parameters of the constructor are the language, the
            side and the multiplicity of the quote.
@@ -115,7 +116,7 @@ private:
        ///
        void parseString(string const &);
        ///
-       string const dispString() const;
+       string const dispString(Language const *) const;
 };
 #endif
 
index 5c17d9e95ae1f31e1f4623024dec6ffb733a4a54..2b5e7fab0a74c06f3e82077906f7c1cfd5a6cb49 100644 (file)
@@ -50,6 +50,10 @@ int InsetSpecialChar::width(BufferView *, LyXFont const & font) const
                        w -= 2; // to make it look shorter
                return w;
        }
+       case HYPHENATION_BREAK:
+       {
+               return lyxfont::width('|', font);
+       }
        case END_OF_SENTENCE:
        {
                return lyxfont::width('.', font);
@@ -86,6 +90,13 @@ void InsetSpecialChar::draw(BufferView * bv, LyXFont const & f,
                x += width(bv, font);
                break;
        }
+       case HYPHENATION_BREAK:
+       {
+               font.setColor(LColor::special);
+               pain.text(int(x), baseline, "|", font);
+               x += width(bv, font);
+               break;
+       }
        case END_OF_SENTENCE:
        {
                font.setColor(LColor::special);
@@ -148,10 +159,21 @@ void InsetSpecialChar::write(Buffer const *, ostream & os) const
 {
        string command;
        switch (kind) {
-       case HYPHENATION:       command = "\\-";        break;
-       case END_OF_SENTENCE:   command = "\\@.";       break;
-       case LDOTS:             command = "\\ldots{}";  break;
-       case MENU_SEPARATOR:    command = "\\menuseparator"; break;
+       case HYPHENATION:       
+               command = "\\-";        
+               break;
+       case HYPHENATION_BREAK: 
+               command = "\\textcompwordmark{}"; 
+               break;
+       case END_OF_SENTENCE:   
+               command = "\\@.";
+               break;
+       case LDOTS:
+               command = "\\ldots{}";  
+               break;
+       case MENU_SEPARATOR:
+               command = "\\menuseparator"; 
+               break;
        case PROTECTED_SEPARATOR:
                //command = "\\protected_separator";
                command = "~";
@@ -169,6 +191,8 @@ void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
 
        if (command == "\\-")
                kind = HYPHENATION;
+       else if (command == "\\textcompwordmark{}")
+               kind = HYPHENATION_BREAK;
        else if (command == "\\@.")
                kind = END_OF_SENTENCE;
        else if (command == "\\ldots{}")
@@ -187,11 +211,24 @@ int InsetSpecialChar::latex(Buffer const *, ostream & os, bool /*fragile*/,
                            bool free_space) const
 {
        switch (kind) {
-       case HYPHENATION:         os << "\\-";  break;
-       case END_OF_SENTENCE:     os << "\\@."; break;
-       case LDOTS:               os << "\\ldots{}";    break;
-       case MENU_SEPARATOR:      os << "\\lyxarrow{}"; break;
-       case PROTECTED_SEPARATOR: os << (free_space ? " " : "~"); break;
+       case HYPHENATION:         
+               os << "\\-";    
+               break;
+       case HYPHENATION_BREAK:
+               os << "\\textcompwordmark{}";
+               break;
+       case END_OF_SENTENCE:     
+               os << "\\@.";   
+               break;
+       case LDOTS:               
+               os << "\\ldots{}";      
+               break;
+       case MENU_SEPARATOR:      
+               os << "\\lyxarrow{}"; 
+               break;
+       case PROTECTED_SEPARATOR: 
+               os << (free_space ? " " : "~"); 
+               break;
        }
        return 0;
 }
@@ -200,11 +237,21 @@ int InsetSpecialChar::latex(Buffer const *, ostream & os, bool /*fragile*/,
 int InsetSpecialChar::ascii(Buffer const *, ostream & os, int) const
 {
        switch (kind) {
-       case HYPHENATION:                       break;
-       case END_OF_SENTENCE:     os << ".";    break;
-       case LDOTS:               os << "...";  break;
-       case MENU_SEPARATOR:      os << "->";   break;
-       case PROTECTED_SEPARATOR: os << " ";   break;
+       case HYPHENATION:
+       case HYPHENATION_BREAK:
+               break;
+       case END_OF_SENTENCE:     
+               os << ".";      
+               break;
+       case LDOTS:               
+               os << "...";    
+               break;
+       case MENU_SEPARATOR:      
+               os << "->";   
+               break;
+       case PROTECTED_SEPARATOR: 
+               os << " ";
+               break;
        }
        return 0;
 }
index 3e08623c70d92833bed8f6d05f159159f546fed0..e2678a7712dae3421d69279fa893aa14744b4f31 100644 (file)
@@ -28,6 +28,8 @@ public:
        enum Kind {
                /// Optional hyphenation point (\-)
                HYPHENATION,
+               /// Hyphenation break point (\textcompwordmark)
+               HYPHENATION_BREAK,
                /// ... (\ldots)
                LDOTS,
                /// End of sentence punctuation (\@)
index 367911132c2fc604564ba71358426577d5a3a972..8b2b75bf7d747f8eb7f63d9b389cfd25d14a622b 100644 (file)
@@ -550,15 +550,13 @@ void LyX::queryUserLyXDir(bool explicit_userdir)
                first_start = false;
                return;
        } else {
-               first_start = true;
+               first_start = !explicit_userdir;
        }
        
-       // Nope
-       // Different wording if the user specifically requested a directory
-       if (!AskQuestion( explicit_userdir
-                        ? _("You have specified an invalid LyX directory.")
-                        : _("You don't have a personal LyX directory.") ,
-
+       // If the user specified explicitely a directory, ask whether
+       // to create it (otherwise, always create it)
+       if (explicit_userdir &&
+           !AskQuestion(_("You have specified an invalid LyX directory."),
                         _("It is needed to keep your own configuration."),
                         _("Should I try to set it up for you (recommended)?"))) {
                lyxerr << _("Running without personal LyX directory.") << endl;
index 5e70fda1ec300f62ad0ebcaee94a7e99486f5980..6c904bf92daf4ba6d893ac38410fba41adfd5197 100644 (file)
@@ -707,52 +707,6 @@ Paragraph::getUChar(BufferParams const & bparams,
 }
 
 
-// return an string of the current word, and the end of the word in lastpos.
-string const Paragraph::getWord(Paragraph::size_type & lastpos) const
-{
-       lyx::Assert(lastpos >= 0);
-
-       // the current word is defined as starting at the first character
-       // from the immediate left of lastpospos which meets the definition
-       // of IsLetter(), continuing to the last character to the right
-       // of this meeting IsLetter.
-
-       string theword;
-
-       // grab a word
-               
-       // move back until we have a letter
-
-       //there's no real reason to have firstpos & lastpos as
-       //separate variables as this is written, but maybe someon
-       // will want to return firstpos in the future.
-
-       //since someone might have typed a punctuation first
-       int firstpos = lastpos;
-       
-       while ((firstpos >= 0) && !isLetter(firstpos))
-               --firstpos;
-
-       // now find the beginning by looking for a nonletter
-       
-       while ((firstpos>= 0) && isLetter(firstpos))
-               --firstpos;
-
-       // the above is now pointing to the preceeding non-letter
-       ++firstpos;
-       lastpos = firstpos;
-
-       // so copy characters into theword  until we get a nonletter
-       // note that this can easily exceed lastpos, wich means
-       // that if used in the middle of a word, the whole word
-       // is included
-
-       while (isLetter(lastpos)) theword += getChar(lastpos++);
-       
-       return theword;
-}
-
-
 void Paragraph::setFont(Paragraph::size_type pos,
                           LyXFont const & font)
 {
index 042da4b717435202e40b4cd497e6012d84826698..ea20d04a6ec3addb5e27e0b99301741d6c4ac467 100644 (file)
@@ -260,8 +260,6 @@ public:
        void setChar(size_type pos, value_type c);
        ///
        void setFont(size_type pos, LyXFont const & font);
-       ///
-        string const getWord(size_type &) const;
        /// Returns the height of the highest font in range
        LyXFont::FONT_SIZE highestFontInRange(size_type startpos,
                                              size_type endpos) const;