From 08086d76f86794963b3ab27168f9516edf7b9d2d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 22 Oct 2016 21:36:22 -0400 Subject: [PATCH] Ensure that GroupScope can only be instantiated by FormulaLogger. And also annotate the class a bit. Change-Id: I7544e49991778be36a9214851f3d7add4bfef626 --- sc/inc/formulalogger.hxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sc/inc/formulalogger.hxx b/sc/inc/formulalogger.hxx index d272ed0280ee..144fabf02849 100644 --- a/sc/inc/formulalogger.hxx +++ b/sc/inc/formulalogger.hxx @@ -17,6 +17,9 @@ class ScDocument; namespace sc { +/** + * Outputs formula calculation log outputs to specified file. + */ class FormulaLogger { std::unique_ptr mpLogFile; @@ -42,6 +45,8 @@ public: */ class GroupScope { + friend class FormulaLogger; + struct Impl; std::unique_ptr mpImpl; @@ -50,13 +55,23 @@ public: GroupScope( const GroupScope& ) = delete; GroupScope& operator= ( const GroupScope& ) = delete; - GroupScope( FormulaLogger& rLogger, const OUString& rPrefix, const ScDocument& rDoc, const ScFormulaCell& rCell ); + private: + GroupScope( + FormulaLogger& rLogger, const OUString& rPrefix, + const ScDocument& rDoc, const ScFormulaCell& rCell ); + public: GroupScope( GroupScope&& r ); ~GroupScope(); - void addMessage( const OUString& rName ); + /** + * Add an arbitrary message to dump to the log. + */ + void addMessage( const OUString& rMsg ); + /** + * Call this when the group calculation has finished successfullly. + */ void setCalcComplete(); };