]> git.lyx.org Git - features.git/commitdiff
Reactivate "Custom Export Code" and small fix to LyXFunc::getStatus().
authorJürgen Vigna <jug@sad.it>
Mon, 26 Feb 2001 10:32:45 +0000 (10:32 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 26 Feb 2001 10:32:45 +0000 (10:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1618 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/ui/default.ui
src/ChangeLog
src/insets/insettext.C
src/lyxfunc.C
src/lyxfunc.h

index 9e65cc981f78f76fdd8c2107581a2ba158be3df0..14a75041545cd29cde05ae6fc28207916dc1f89e 100644 (file)
@@ -1,3 +1,7 @@
+2001-02-26  Juergen Vigna  <jug@sad.it>
+
+       * ui/default.ui: added Custom-Export to export menu.
+
 2001-02-13  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * bind/emacs.bind: 
index def3d0ed7dcb00e365716dc6fc98462880922a60..2d7192e6650f2f1afe8743a5c8cf691b116c68b5 100644 (file)
@@ -73,6 +73,7 @@ Menuset
 
     Menu "file_export"
        ExportFormats
+       Item "Custom...|C" "buffer-export custom"
     End
 
 #
index 584b32607253023e51c9e0adde88340f782d4d02..4dfb87a13221d174268206c48a5b6d92f0c252a3 100644 (file)
@@ -1,3 +1,10 @@
+2001-02-26  Juergen Vigna  <jug@sad.it>
+
+       * lyxfunc.C (getStatus): added a string argument override function so
+       that this is correctly called from LyXFunc::Dispatch if it contains a
+       do_not_use_argument which is used!
+       (Dispatch): added check for "custom" export and call appropriate func.
+
 2001-02-23  Dekel Tsur  <dekelts@tau.ac.il>
 
        * lyxrc.C: Add language_command_local, language_use_babel and
index d450653315758d840afdea265b1d8680aa7c9bb6..b2240c153968004ceaa76e9c402c981cc599bf51 100644 (file)
@@ -1363,15 +1363,17 @@ UpdatableInset * InsetText::GetFirstLockingInsetOfType(Inset::Code c)
 
 void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall)
 {
-    bv->text->SetUndo(bv->buffer(), Undo::EDIT,
+    if (TEXT(bv)->selection) {
+       bv->text->SetUndo(bv->buffer(), Undo::EDIT,
 #ifndef NEW_INSETS
-             bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
-             bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+                         bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
+                         bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
 #else
-             bv->text->cursor.par()->previous,
-             bv->text->cursor.par()->next
+                         bv->text->cursor.par()->previous,
+                         bv->text->cursor.par()->next
 #endif
            );
+    }
     TEXT(bv)->SetFont(bv, font, toggleall);
     bv->fitCursor(TEXT(bv));
     UpdateLocal(bv, CURSOR_PAR, true);
index f6cd51de3f81f802986ecf90043244742bb8ecc5..9707d8737b8bfec5e60c4bf6fc680fb59e3c2742 100644 (file)
@@ -97,6 +97,7 @@ extern BufferList bufferlist;
 extern LyXServer * lyxserver;
 extern int greek_kb_flag;
 extern bool selection_possible;
+extern void MenuSendto();
 
 extern kb_keymap * toplevel_keymap;
 
@@ -333,8 +334,12 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state)
        return 0;
 } 
 
-
 LyXFunc::func_status LyXFunc::getStatus(int ac) const
+{
+       return getStatus(ac, string());
+}
+
+LyXFunc::func_status LyXFunc::getStatus(int ac, string const & not_to_use_arg) const
 {
         kb_action action;
         func_status flag = LyXFunc::OK;
@@ -343,8 +348,11 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
        
        if (lyxaction.isPseudoAction(ac)) 
                action = lyxaction.retrieveActionArg(ac, argument);
-       else
+       else {
                action = static_cast<kb_action>(ac);
+               if (!not_to_use_arg.empty())
+                       argument = not_to_use_arg; // exept here
+       }
        
        if (action == LFUN_UNKNOWN_ACTION) {
                setErrorMessage(N_("Unknown action"));
@@ -382,8 +390,9 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
                        || lyxrc.print_command == "none";
                break;
        case LFUN_EXPORT:
-               disable = argument == "fax" &&
-                       !Exporter::IsExportable(buf, argument);
+               disable = (argument != "custom") ||
+                   (argument == "fax" &&
+                    !Exporter::IsExportable(buf, argument));
                break;
        case LFUN_UNDO:
                disable = buf->undostack.empty();
@@ -546,7 +555,7 @@ string const LyXFunc::Dispatch(int ac,
                owner->view()->hideCursor();
 
        // We cannot use this function here
-       if (getStatus(ac) & Disabled)
+       if (getStatus(ac, do_not_use_this_arg) & Disabled)
                goto exit_with_message;
 
        commandshortcut.erase();
@@ -839,7 +848,10 @@ string const LyXFunc::Dispatch(int ac,
                break;
 
        case LFUN_EXPORT:
-               Exporter::Export(owner->buffer(), argument, false);
+               if (argument == "custom")
+                       MenuSendto();
+               else
+                       Exporter::Export(owner->buffer(), argument, false);
                break;
 
        case LFUN_IMPORT:
index 6a52fd7e67b73f0968f0f2077b614ea5189f608c..0f796b768e48c9b3365b4a4ee58d574bb5bbf4b4 100644 (file)
@@ -52,8 +52,10 @@ public:
        ///
        int processKeySym(KeySym k, unsigned int state);
 
-       ///
+       /// we need one internall which is called from inside LyXAction and
+       /// can contain the string argument.
        func_status getStatus(int ac) const;
+       func_status getStatus(int ac, string const & not_to_use_arg) const;
        
        /// The last key was meta
        bool wasMetaKey() const;