Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 01/07/2012 02:07 AM, Kohei Yoshida wrote:
Anyway, it's my understanding that the main problem is that the global
ScAutoFormat instance unintentionally get instantiated in the destructor
of ScAutoFormatObj during the termination of the cppunit?  In that case,
what I would do is to add ScGlobal::HasAutoFormat() which simply checks
whether the instance already exists, and if yes go on ahead and save if
the flag is set.  When no such instance exists there is no need to save
stuff anyway (since there is no data to save).

Another advantage of this is that we wouldn't have to modify all the
code that currently uses GetAutoFormat() expecting it to return a live
instance at all times, and we could only modify the code in
~ScAutoFormatObj().

A new HasAutoFormat (only) called from ~ScAutoFormatObj would of course solve the immediate problem, too.

However, whether it actually would be an advantage to not have to address the other calls to GetAutoFormat, I am not sure. After all, those calls that afterwards check for null-ness *are* dubious.

Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.