pimpl_->isViewCacheValid = false;
}
+
+// We shouldn't need to reset the params here, since anything
+// we need will be recopied.
+void BufferParams::copyForAdvFR(const BufferParams & bp)
+{
+ string const & lang = bp.language->lang();
+ setLanguage(lang);
+ layout_modules_ = bp.layout_modules_;
+ string const & doc_class = bp.documentClass().name();
+ setBaseClass(doc_class);
+}
+
} // namespace lyx
bool setLanguage(std::string const & lang);
///
void invalidateConverterCache() const;
+ /// Copies over some of the settings from \param bp,
+ /// namely the ones need by Advanced F&R. We don't want
+ /// to copy them all, e.g., not the default master.
+ void copyForAdvFR(BufferParams const & bp);
private:
///
static void destroy(Impl *);
};
support::copied_ptr<Impl, MemoryTraits> pimpl_;
-
};
} // namespace lyx
// We don't want two cursors blinking.
find_work_area_->stopBlinkingCaret();
replace_work_area_->stopBlinkingCaret();
+ old_buffer_ = view_.documentBufferView() ?
+ &(view_.documentBufferView()->buffer()) : 0;
}
}
-/** Copy selected elements from bv's BufferParams to the dest_bv's one
- ** We don't want to copy'em all, e.g., not the default master **/
+// Copy selected elements from bv's BufferParams to the dest_bv's
static void copy_params(BufferView const & bv, BufferView & dest_bv) {
Buffer const & doc_buf = bv.buffer();
BufferParams const & doc_bp = doc_buf.params();
- string const & lang = doc_bp.language->lang();
- string const & doc_class = doc_bp.documentClass().name();
Buffer & dest_buf = dest_bv.buffer();
- dest_buf.params().setLanguage(lang);
- dest_buf.params().setBaseClass(doc_class);
+ dest_buf.params().copyForAdvFR(doc_bp);
dest_bv.makeDocumentClass();
dest_bv.cursor().current_font.setLanguage(doc_bp.language);
}
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);