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
This commit is contained in:
Jürgen Vigna 2001-02-26 10:32:45 +00:00
parent 86dc4696af
commit 24a189b753
6 changed files with 40 additions and 12 deletions

View 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> 2001-02-13 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* bind/emacs.bind: * bind/emacs.bind:

View File

@ -73,6 +73,7 @@ Menuset
Menu "file_export" Menu "file_export"
ExportFormats ExportFormats
Item "Custom...|C" "buffer-export custom"
End End
# #

View 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> 2001-02-23 Dekel Tsur <dekelts@tau.ac.il>
* lyxrc.C: Add language_command_local, language_use_babel and * lyxrc.C: Add language_command_local, language_use_babel and

View File

@ -1363,6 +1363,7 @@ UpdatableInset * InsetText::GetFirstLockingInsetOfType(Inset::Code c)
void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall) void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall)
{ {
if (TEXT(bv)->selection) {
bv->text->SetUndo(bv->buffer(), Undo::EDIT, bv->text->SetUndo(bv->buffer(), Undo::EDIT,
#ifndef NEW_INSETS #ifndef NEW_INSETS
bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous, bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
@ -1372,6 +1373,7 @@ void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall)
bv->text->cursor.par()->next bv->text->cursor.par()->next
#endif #endif
); );
}
TEXT(bv)->SetFont(bv, font, toggleall); TEXT(bv)->SetFont(bv, font, toggleall);
bv->fitCursor(TEXT(bv)); bv->fitCursor(TEXT(bv));
UpdateLocal(bv, CURSOR_PAR, true); UpdateLocal(bv, CURSOR_PAR, true);

View File

@ -97,6 +97,7 @@ extern BufferList bufferlist;
extern LyXServer * lyxserver; extern LyXServer * lyxserver;
extern int greek_kb_flag; extern int greek_kb_flag;
extern bool selection_possible; extern bool selection_possible;
extern void MenuSendto();
extern kb_keymap * toplevel_keymap; extern kb_keymap * toplevel_keymap;
@ -333,8 +334,12 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state)
return 0; return 0;
} }
LyXFunc::func_status LyXFunc::getStatus(int ac) const 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; kb_action action;
func_status flag = LyXFunc::OK; func_status flag = LyXFunc::OK;
@ -343,8 +348,11 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
if (lyxaction.isPseudoAction(ac)) if (lyxaction.isPseudoAction(ac))
action = lyxaction.retrieveActionArg(ac, argument); action = lyxaction.retrieveActionArg(ac, argument);
else else {
action = static_cast<kb_action>(ac); action = static_cast<kb_action>(ac);
if (!not_to_use_arg.empty())
argument = not_to_use_arg; // exept here
}
if (action == LFUN_UNKNOWN_ACTION) { if (action == LFUN_UNKNOWN_ACTION) {
setErrorMessage(N_("Unknown action")); setErrorMessage(N_("Unknown action"));
@ -382,8 +390,9 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
|| lyxrc.print_command == "none"; || lyxrc.print_command == "none";
break; break;
case LFUN_EXPORT: case LFUN_EXPORT:
disable = argument == "fax" && disable = (argument != "custom") ||
!Exporter::IsExportable(buf, argument); (argument == "fax" &&
!Exporter::IsExportable(buf, argument));
break; break;
case LFUN_UNDO: case LFUN_UNDO:
disable = buf->undostack.empty(); disable = buf->undostack.empty();
@ -546,7 +555,7 @@ string const LyXFunc::Dispatch(int ac,
owner->view()->hideCursor(); owner->view()->hideCursor();
// We cannot use this function here // We cannot use this function here
if (getStatus(ac) & Disabled) if (getStatus(ac, do_not_use_this_arg) & Disabled)
goto exit_with_message; goto exit_with_message;
commandshortcut.erase(); commandshortcut.erase();
@ -839,6 +848,9 @@ string const LyXFunc::Dispatch(int ac,
break; break;
case LFUN_EXPORT: case LFUN_EXPORT:
if (argument == "custom")
MenuSendto();
else
Exporter::Export(owner->buffer(), argument, false); Exporter::Export(owner->buffer(), argument, false);
break; break;

View File

@ -52,8 +52,10 @@ public:
/// ///
int processKeySym(KeySym k, unsigned int state); 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) const;
func_status getStatus(int ac, string const & not_to_use_arg) const;
/// The last key was meta /// The last key was meta
bool wasMetaKey() const; bool wasMetaKey() const;