From: Richard Kimberly Heck Date: Fri, 4 May 2018 16:37:52 +0000 (-0400) Subject: Copy modules into the Advanced F&R pane as well. X-Git-Tag: lyx-2.4.0dev-acb2ca7b~2992 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5064c09e9f57a7ffb6082a7f8ec06c03ee9a0cef;p=features.git Copy modules into the Advanced F&R pane as well. --- diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 8245f73cac..31c1241327 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -3516,4 +3516,16 @@ void BufferParams::invalidateConverterCache() const 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 diff --git a/src/BufferParams.h b/src/BufferParams.h index 0fbc2e707a..37041edfa9 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -546,6 +546,10 @@ public: 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: /// @@ -614,7 +618,6 @@ private: static void destroy(Impl *); }; support::copied_ptr pimpl_; - }; } // namespace lyx diff --git a/src/frontends/qt4/FindAndReplace.cpp b/src/frontends/qt4/FindAndReplace.cpp index 607f1653aa..a0d95684b2 100644 --- a/src/frontends/qt4/FindAndReplace.cpp +++ b/src/frontends/qt4/FindAndReplace.cpp @@ -526,16 +526,12 @@ void FindAndReplaceWidget::on_replaceallPB_clicked() } -/** 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); }