LibreOffice: Disable Typographic Quotes in Preformatted Text

Just so that I will never forget it again, because this now has been the second time that I had to look it up:

For a software manual, I made a paragraph style “Program Code” that was derived from “Preformatted Text”. The first thing I tried typing in was

10 PRINT "HELLO WORLD"
20 GOTO 10

LibreOffice 4 (like OpenOffice) has “Smart Quotes” enabled by default, and as I was typing them in it began replacing the double-quotes with complex typographic quotation marks according to my document’s Locale. For programming language text this is inappropriate.

The option “Extras → Auto Correct Options → Smart Quotes” can only be turned off on an all-or-nothing basis, but for natural language texts I would like to keep the behavior activated.

The solution:

Modify your paragraph style for code, for example type <F11> for the styles list, choose the paragraph styles tab, right-click on the style “Preformatted Text” and choose “Modify”.

In the “Font” tab, below the “Style” selection box, you see a dropdown menu “Language”. Set this to “None” and click “Ok”.

From then on, “Auto Correct” will no longer apply “Smart Quotes” to that style.