Jürgen Spitzmüller wrote:
http://bugzilla.lyx.org/show_bug.cgi?id=3909
http://bugzilla.lyx.org/show_bug.cgi?id=3943

Printing and view-source of read-only files (such as the documentation of an installed LyX) is disallowed, since we block the passing of params and viewing restrictively for read-only buffers (if kernel().isBufferReadonly()).

In the two cases in question, this is wrong, so we need to differentiate a case where passing params and viewing (if canApply is true for some reason, as for view-source) is possible despite of the buffer being read-only.

The attached patch does this.

OK?

I think it would be less confusing to have one test per controller and so integrate the kernel().isBufferReadonly() call to canApplyToReadOnly(). The default implementation would be:

+       /** \return true if the dialog can apply data also
+        *  for ReadOnly buffers.
+        *  This has to be distinguished from isBufferDependent()
+        */
+       virtual bool canApplyToReadOnly() const
+       { return kernel().isBufferReadonly(); }

Just MHO. Otherwise I am fine with the patch.

Abdel.

Reply via email to