Edwin's updateParagraph patch.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4837 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-08-02 12:28:59 +00:00
parent eed7fcfdf4
commit 3d137bfe77
6 changed files with 35 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2002-08-02 Edwin Leuven <leuven@fee.uva.nl>
* Dialogs.[Ch] (updateParagraph): converted back to a signal again.
2002-08-02 Angus Leeming <leeming@lyx.org>
* LyXView.[Ch] (view): now returns shared_ptr<BufferView> const &

View File

@ -187,13 +187,6 @@ void Dialogs::showParagraph()
gui_ShowParagraph(*dialogs_lyxview, *this);
}
void Dialogs::updateParagraph()
{
#if 0
gui_UpdateParagraph(*dialogs_lyxview, *this);
#endif
}
void Dialogs::showPreamble()
{

View File

@ -143,7 +143,7 @@ public:
///
void showParagraph();
///
void updateParagraph();
boost::signal0<void> updateParagraph;
///
void showPreamble();
///

View File

@ -1,3 +1,8 @@
2002-08-02 Edwin Leuven <leuven@fee.uva.nl>
* ControlParagraph.[Ch] (changedParagraph): new method invoked when
the Dialogs::updateParagraph signal is emitted.
2002-08-02 Angus Leeming <leeming@lyx.org>
* ControlCharacter.C (apply):

View File

@ -14,6 +14,7 @@
#endif
#include "ControlParagraph.h"
#include "ButtonControllerBase.h"
#include "ViewBase.h"
#include "ParagraphParameters.h"
#include "Liason.h"
@ -23,13 +24,19 @@
#include "buffer.h"
#include "lyxtext.h"
#include "support/LAssert.h"
#include "Dialogs.h"
#include <boost/bind.hpp>
using Liason::setMinibuffer;
ControlParagraph::ControlParagraph(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d), pp_(0), ininset_(false)
{}
{
d_.updateParagraph.connect(
boost::bind(&ControlParagraph::changedParagraph, this));
}
ControlParagraph::~ControlParagraph()
@ -112,3 +119,18 @@ void ControlParagraph::setParams()
/// is paragraph in inset
ininset_ = par_->inInset();
}
void ControlParagraph::changedParagraph()
{
/// get paragraph
Paragraph const * p = lv_.view()->getLyXText()->cursor.par();
if (p == 0) // this is wrong as we don't set par_ here! /* || p == par_) */
return;
// For now, don't bother checking if the params are different.
// Will the underlying paragraph accept our changes?
Inset * const inset = p->inInset();
bool const accept = !(inset && inset->forceDefaultParagraphs(inset));
bc().valid(accept);
}

View File

@ -38,6 +38,8 @@ public:
bool inInset() const;
///
LyXAlignment alignPossible() const;
///
void changedParagraph();
private:
/// Get changed parameters and Dispatch them to the kernel.