S. 39(2) applies to FX movements on dividends between declaration and payment

As a dividend (declared in a foreign currency) becomes a debt at the moment of its declaration, the subsequent FX movement will be recognized under s. 39(2) on payment, so that the exclusion from the application of s. 39(2) for "a transaction or event in respect of shares of the capital stock of the taxpayer" will not apply.

Neal Armstrong.  Summary of 5 November 2013 T.I. 2013-0501241E5 F under s. 39(2).