]> git.lyx.org Git - features.git/commitdiff
Copy modules into the Advanced F&R pane as well.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Fri, 4 May 2018 16:37:52 +0000 (12:37 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Fri, 5 Oct 2018 00:30:01 +0000 (20:30 -0400)
src/BufferParams.cpp
src/BufferParams.h
src/frontends/qt4/FindAndReplace.cpp

index 8245f73cacc55b7472ca0c53d49450e041f901bf..31c124132782ee184069db6d976ac731b783491d 100644 (file)
@@ -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
index 0fbc2e707a106a4a1bd1fb676b24a5e31fca40b7..37041edfa905cd0e2438c73a8ead83a5b17fd4bf 100644 (file)
@@ -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<Impl, MemoryTraits> pimpl_;
-
 };
 
 } // namespace lyx
index 607f1653aac7afd1d43235497d9884355d47649e..a0d95684b2592ce47f4457bb472648860b03cf4f 100644 (file)
@@ -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);
 }