mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Update the Advanced F&R document class when switching buffers.
This commit is contained in:
parent
5064c09e9f
commit
944b0ae55d
@ -67,6 +67,8 @@ FindAndReplaceWidget::FindAndReplaceWidget(GuiView & view)
|
||||
// We don't want two cursors blinking.
|
||||
find_work_area_->stopBlinkingCaret();
|
||||
replace_work_area_->stopBlinkingCaret();
|
||||
old_buffer_ = view_.documentBufferView() ?
|
||||
&(view_.documentBufferView()->buffer()) : 0;
|
||||
}
|
||||
|
||||
|
||||
@ -605,8 +607,17 @@ bool FindAndReplace::initialiseParams(std::string const & params)
|
||||
|
||||
void FindAndReplaceWidget::updateGUI()
|
||||
{
|
||||
bool replace_enabled = view_.documentBufferView()
|
||||
&& !view_.documentBufferView()->buffer().isReadonly();
|
||||
BufferView * bv = view_.documentBufferView();
|
||||
if (bv) {
|
||||
if (old_buffer_ != &bv->buffer()) {
|
||||
copy_params(*bv, find_work_area_->bufferView());
|
||||
copy_params(*bv, replace_work_area_->bufferView());
|
||||
old_buffer_ = &bv->buffer();
|
||||
}
|
||||
} else
|
||||
old_buffer_ = 0;
|
||||
|
||||
bool const replace_enabled = bv && !bv->buffer().isReadonly();
|
||||
replace_work_area_->setEnabled(replace_enabled);
|
||||
replacePB->setEnabled(replace_enabled);
|
||||
replaceallPB->setEnabled(replace_enabled);
|
||||
|
@ -40,6 +40,8 @@ public Q_SLOTS:
|
||||
private:
|
||||
///
|
||||
GuiView & view_;
|
||||
///
|
||||
Buffer * old_buffer_;
|
||||
|
||||
/// add a string to the combo if needed
|
||||
void remember(std::string const & find, QComboBox & combo);
|
||||
|
Loading…
Reference in New Issue
Block a user