X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.cpp;h=5a0ecbb09c393f0942930834a7fcdd32aa1075af;hb=070d75f1c635ad326b2d58642dc4e119f84a3faa;hp=2f1a715d084608ac194fb568e9c93e73cc3a3f72;hpb=bc79c203a9da0a3ed8a4469374c10b34e427e8b9;p=lyx.git diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 2f1a715d08..5a0ecbb09c 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -914,8 +914,8 @@ void replaceSelectionWithString(Cursor & cur, docstring const & str, bool backwa cur.recordUndo(); DocIterator selbeg = cur.selectionBegin(); - // Get font setting before we cut - Font const & font = + // Get font setting before we cut, we need a copy here, not a bare reference. + Font const font = selbeg.paragraph().getFontSettings(cur.buffer().params(), selbeg.pos()); // Insert the new string