From 24a189b75302d111629d814dc4bf58737cdea0f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Mon, 26 Feb 2001 10:32:45 +0000 Subject: [PATCH] Reactivate "Custom Export Code" and small fix to LyXFunc::getStatus(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1618 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 ++++ lib/ui/default.ui | 1 + src/ChangeLog | 7 +++++++ src/insets/insettext.C | 12 +++++++----- src/lyxfunc.C | 24 ++++++++++++++++++------ src/lyxfunc.h | 4 +++- 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 9e65cc981f..14a7504154 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2001-02-26 Juergen Vigna + + * ui/default.ui: added Custom-Export to export menu. + 2001-02-13 Jean-Marc Lasgouttes * bind/emacs.bind: diff --git a/lib/ui/default.ui b/lib/ui/default.ui index def3d0ed7d..2d7192e665 100644 --- a/lib/ui/default.ui +++ b/lib/ui/default.ui @@ -73,6 +73,7 @@ Menuset Menu "file_export" ExportFormats + Item "Custom...|C" "buffer-export custom" End # diff --git a/src/ChangeLog b/src/ChangeLog index 584b326072..4dfb87a132 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2001-02-26 Juergen Vigna + + * 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 * lyxrc.C: Add language_command_local, language_use_babel and diff --git a/src/insets/insettext.C b/src/insets/insettext.C index d450653315..b2240c1539 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -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); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index f6cd51de3f..9707d8737b 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -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(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: diff --git a/src/lyxfunc.h b/src/lyxfunc.h index 6a52fd7e67..0f796b768e 100644 --- a/src/lyxfunc.h +++ b/src/lyxfunc.h @@ -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; -- 2.39.2