* lyxfunc.C:
	* text3.C: move handling of LFUN_DEPTH *;


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7853 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-10-02 14:42:31 +00:00
parent f23b0a7712
commit b9a8b8f4b6
5 changed files with 47 additions and 12 deletions

View File

@ -1,11 +1,16 @@
2003-10-02 André Pönitz <poenitz@gmx.net>
* lyxfunc.C:
* text3.C: move handling of LFUN_DEPTH *; fix #1360
2003-10-01 André Pönitz <poenitz@gmx.net> 2003-10-01 André Pönitz <poenitz@gmx.net>
* factory.C: assert early * factory.C: assert early
2003-09-26 Lars Gullik Bjønnes <larsbj@gullik.net> 2003-09-26 Lars Gullik Bjønnes <larsbj@gullik.net>
* lyx_main.C: remove the glboal debug object * lyx_main.C: remove the global debug object
* debug.h: adjust for new debugstream * debug.h: adjust for new debugstream

View File

@ -72,7 +72,6 @@
#include "support/path.h" #include "support/path.h"
#include "support/path_defines.h" #include "support/path_defines.h"
#include "support/tostr.h" #include "support/tostr.h"
#include "support/std_sstream.h" #include "support/std_sstream.h"
using bv_funcs::apply_freefont; using bv_funcs::apply_freefont;
@ -1202,16 +1201,6 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
view()->redo(); view()->redo();
break; break;
case LFUN_DEPTH_MIN:
changeDepth(view(), view()->getLyXText(), DEC_DEPTH, false);
owner->view_state_changed();
break;
case LFUN_DEPTH_PLUS:
changeDepth(view(), view()->getLyXText(), INC_DEPTH, false);
owner->view_state_changed();
break;
case LFUN_FREEFONT_APPLY: case LFUN_FREEFONT_APPLY:
apply_freefont(view()); apply_freefont(view());
break; break;

View File

@ -14,6 +14,7 @@
#include "mathed/math_support.h" #include "mathed/math_support.h"
#include "frontends/Painter.h" #include "frontends/Painter.h"
#include "BufferView.h" #include "BufferView.h"
#include "LColor.h"
@ -147,6 +148,7 @@ FontSetChanger::FontSetChanger(MetricsBase & mb, char const * name)
augmentFont(mb.font, name); augmentFont(mb.font, name);
} }
FontSetChanger::~FontSetChanger() FontSetChanger::~FontSetChanger()
{ {
orig_ = save_; orig_ = save_;
@ -165,3 +167,21 @@ WidthChanger::~WidthChanger()
{ {
orig_ = save_; orig_ = save_;
} }
ColorChanger::ColorChanger(LyXFont & font, string const & color)
: Changer<LyXFont, string>(font)
{
save_ = lcolor.getFromGUIName(color);
font.setColor(lcolor.getFromGUIName(color));
}
ColorChanger::~ColorChanger()
{
orig_.setColor(lcolor.getFromGUIName(save_));
}

View File

@ -175,4 +175,12 @@ struct WidthChanger : public Changer<MetricsBase>
}; };
// temporarily change the used color
struct ColorChanger : public Changer<LyXFont, string> {
///
ColorChanger(LyXFont & font, string const & color);
///
~ColorChanger();
};
#endif #endif

View File

@ -1534,6 +1534,19 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
doInsertInset(this, cmd, false, false); doInsertInset(this, cmd, false, false);
break; break;
case LFUN_DEPTH_MIN:
bv_funcs::changeDepth(bv, this, bv_funcs::DEC_DEPTH, false);
clearSelection();
bv->update();
break;
case LFUN_DEPTH_PLUS:
clearSelection();
bv_funcs::changeDepth(bv, this, bv_funcs::INC_DEPTH, false);
clearSelection();
bv->update();
break;
default: default:
return UNDISPATCHED; return UNDISPATCHED;
} }