]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_gui_misc.C
use the new bufferstorage (this change only deletes all references to the old one
[lyx.git] / src / lyx_gui_misc.C
index ed3e07f4947a0beb9fb369feb833a13c906ef61b..802d3b7d789e9c14552715272e8a2195554ef8b5 100644 (file)
@@ -1,13 +1,13 @@
 // -*- C++ -*-
 /* This file is part of
- * ======================================================
+ * ====================================================== 
  * 
  *           LyX, The Document Processor
  *        
  *           Copyright 1995 Matthias Ettrich
  *           Copyright 1995-1999 The LyX Team.
  *
- * ======================================================*/
+ * ====================================================== */
 
 #include <config.h>
 
@@ -49,9 +49,6 @@ extern FD_form_sendto * fd_form_sendto;
 extern FD_form_figure * fd_form_figure;
 extern FD_form_toc * fd_form_toc;
 extern FD_form_ref * fd_form_ref;
-#if 0
-extern FD_form_url * fd_form_url;
-#endif
 extern FD_form_paragraph_extra * fd_form_paragraph_extra;
 extern FD_LaTeXLog * fd_latex_log;
 extern FD_form_spell_check * fd_form_spell_check;
@@ -70,14 +67,14 @@ extern void TocUpdateCB();
 extern void HideFiguresPopups();
 
 // Prevents LyX from being killed when the close box is pressed in a popup.
-int CancelCloseBoxCB(FL_FORM *, void *)
+extern "C" int CancelCloseBoxCB(FL_FORM *, void *)
 {
        return FL_CANCEL;
 }
 
 
 // Prevents LyX from being killed when the close box is pressed in a popup.
-int IgnoreCloseBoxCB(FL_FORM *, void *)
+extern "C" int IgnoreCloseBoxCB(FL_FORM *, void *)
 {
        return FL_IGNORE;
 }
@@ -129,11 +126,6 @@ void CloseAllBufferRelatedPopups()
        if (fd_form_ref->form_ref->visible) {
                fl_hide_form(fd_form_ref->form_ref);
        }
-#if 0
-       if (fd_form_url->form_url->visible) {
-               fl_hide_form(fd_form_url->form_url);
-       }
-#endif
        if (fd_form_paper->form_paper->visible) {
                fl_hide_form(fd_form_paper->form_paper);
        }
@@ -235,7 +227,7 @@ void updateAllVisibleBufferRelatedPopups()
                }
        }
        if (fd_form_toc->browser_toc->visible) {
-               TocUpdateCB(0,0);
+               TocUpdateCB(0, 0);
        }
 #ifdef ALWAYS_UPDATE_REF
        // Ideally, the RefUpdateCB should be modified so that if the
@@ -247,10 +239,10 @@ void updateAllVisibleBufferRelatedPopups()
        // of course a compromise and an annoyance for users switching
        // between separate documents.  ARRae 241198
        if (fd_form_ref->form_ref->visible) {
-               RefUpdateCB(0,0);
+               RefUpdateCB(0, 0);
        }
 #endif
-       if (current_view->currentBuffer()->isReadonly()) {
+       if (current_view->buffer()->isReadonly()) {
                // a little crude perhaps but it works. ARRae
                if (fd_form_character->form_character->visible) {
                        fl_hide_form(fd_form_character->form_character);
@@ -316,10 +308,10 @@ void updateAllVisibleBufferRelatedPopups()
 const char* flyx_shortcut_extract(const char*sc)
 {
        // Find '|' in the sc and return the string after that.
-       register const char *sd = sc;
-       while(sd[0]!=0 && sd[0] != '|') sd++;
+       register char const *sd = sc;
+       while(sd[0]!= 0 && sd[0] != '|') sd++;
 
-       if (sd[0]=='|') {
+       if (sd[0] == '|') {
                sd++;
                //lyxerr << sd << endl;
                return sd;
@@ -328,21 +320,21 @@ const char* flyx_shortcut_extract(const char*sc)
 }
 
 // Extract identifier from <ident>|<shortcut> string
-const char* flyx_ident_extract(const char *sc)
+const char* flyx_ident_extract(char const *sc)
 {
-       register const char *se = sc;
-       while(se[0]!=0 && se[0] != '|') se++;
+       register char const *se = sc;
+       while(se[0]!= 0 && se[0] != '|') se++;
 
-       if (se[0]==0) return sc;
+       if (se[0] == 0) return sc;
        
        char * sb = new char[se-sc + 1];
        int index = 0;
-       register const char *sd = sc;
+       register char const *sd = sc;
        while (sd != se) {
                sb[index] = sd[0];
                index++; sd++;
        }
-       sb[index]=0;
+       sb[index] = 0;
        return sb;
 }
 
@@ -404,12 +396,15 @@ int AskConfirmation(string const & s1, string const & s2, string const & s3)
 // Asks for a text
 string askForText(string const & msg, string const & dflt)
 {
-       string tmp;
+       const char * tmp;
        fl_set_resource("flInput.cancel.label", idex(_("Cancel|^[")));
        fl_set_resource("flInput.ok.label", idex(_("OK|#O")));
        fl_set_resource("flInput.clear.label", idex(_("Clear|#e")));
        tmp = fl_show_input(msg.c_str(), dflt.c_str());
-       return tmp;
+       if (tmp != 0)
+         return tmp;
+       else
+         return string();
 }
 
 // Inform the user that the buffer is read-only, and that changes in the
@@ -418,6 +413,6 @@ void WarnReadonly()
 {
        WriteAlert(_("Any changes will be ignored"),
                   _("The document is read-only:"),
-                  current_view->currentBuffer()->getFileName());
+                  current_view->buffer()->getFileName());
 }