When you export a spreadsheet to CSV format, you can have the computed values of the cells, but not the formulas of the cells. Add a checkbox to the export filter configuration panel could easily solve this problem. Eike Rathke seemed to agree with that in a discussion with me at FOSDEM 2012.
Seems to me a really good idea. I'm not aware of something like that implemented anywhere.
Note that you can check Tools->Options->Calc->View Display Formulas, if that is enabled formulas are written to CSV instead of results. If someone is interested in the EasyHack to implement the check box mentioned: dialog is in sc/source/ui/dbgui/scuiimoptdlg.cxx If checked, a parameter needs to be passed down to ScDocShell::AsciiSave() to force the bShowFormulas in there. Implement transport of option parameter via ScImportOptions similar to bSaveAsShown.
Florent Gallaire committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c041db6f59888adc90ee8257eafe150d874c46c9 fdo#45664 EasyHack: Add a "Save cell formulas" checkbox to the CSV Export panel.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3cceb8a900cd1fe1ae9bdb0c2e532e82a1835861 changes to fdo#45664 EasyHack
Migrating Whiteboard tags to Keywords: (EasyHack,DifficultyInteresting,SkillCpp,TopicUI ) [NinjaEdit]