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>
* bind/emacs.bind:

View File

@ -73,6 +73,7 @@ Menuset
Menu "file_export"
ExportFormats
Item "Custom...|C" "buffer-export custom"
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>
* 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)
{
if (TEXT(bv)->selection) {
bv->text->SetUndo(bv->buffer(), Undo::EDIT,
#ifndef NEW_INSETS
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
#endif
);
}
TEXT(bv)->SetFont(bv, font, toggleall);
bv->fitCursor(TEXT(bv));
UpdateLocal(bv, CURSOR_PAR, true);

View 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,6 +848,9 @@ string const LyXFunc::Dispatch(int ac,
break;
case LFUN_EXPORT:
if (argument == "custom")
MenuSendto();
else
Exporter::Export(owner->buffer(), argument, false);
break;

View 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;