Kaydet (Commit) dff4e51f authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Add configure option --enable-formula-logger to conditionalize it.

Change-Id: I1badbcfa259b22d742e5241bd817ea44769a771e
üst 08086d76
...@@ -130,6 +130,7 @@ export ENABLE_DIRECTX=@ENABLE_DIRECTX@ ...@@ -130,6 +130,7 @@ export ENABLE_DIRECTX=@ENABLE_DIRECTX@
export ENABLE_EOT=@ENABLE_EOT@ export ENABLE_EOT=@ENABLE_EOT@
export ENABLE_EVOAB2=@ENABLE_EVOAB2@ export ENABLE_EVOAB2=@ENABLE_EVOAB2@
export ENABLE_FIREBIRD_SDBC=@ENABLE_FIREBIRD_SDBC@ export ENABLE_FIREBIRD_SDBC=@ENABLE_FIREBIRD_SDBC@
export ENABLE_FORMULA_LOGGER=@ENABLE_FORMULA_LOGGER@
export ENABLE_GIO=@ENABLE_GIO@ export ENABLE_GIO=@ENABLE_GIO@
export ENABLE_GRAPHITE=@ENABLE_GRAPHITE@ export ENABLE_GRAPHITE=@ENABLE_GRAPHITE@
export ENABLE_ORCUS=@ENABLE_ORCUS@ export ENABLE_ORCUS=@ENABLE_ORCUS@
......
/*
* General configuration settings for various options specific to Calc.
*/
#ifndef CONFIG_OPTIONS_CALC_H
#define CONFIG_OPTIONS_CALC_H
#define ENABLE_FORMULA_LOGGER 0
#endif
...@@ -1515,6 +1515,13 @@ AC_ARG_ENABLE(dconf, ...@@ -1515,6 +1515,13 @@ AC_ARG_ENABLE(dconf,
[Disable the dconf configuration backend (enabled by default where [Disable the dconf configuration backend (enabled by default where
available).])) available).]))
AC_ARG_ENABLE(formula-logger,
AS_HELP_STRING(
[--enable-formula-logger],
[Enable formula logger for logging formula calculation flow in Calc.]
)
)
dnl =================================================================== dnl ===================================================================
dnl Optional Packages (--with/without-) dnl Optional Packages (--with/without-)
dnl =================================================================== dnl ===================================================================
...@@ -12754,6 +12761,20 @@ else ...@@ -12754,6 +12761,20 @@ else
fi fi
AC_SUBST(MPL_SUBSET) AC_SUBST(MPL_SUBSET)
dnl ===================================================================
AC_MSG_CHECKING([formula logger])
ENABLE_FORMULA_LOGGER=
if test "x$enable_formula_logger" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE(ENABLE_FORMULA_LOGGER)
ENABLE_FORMULA_LOGGER=TRUE
else
AC_MSG_RESULT([no])
fi
AC_SUBST(ENABLE_FORMULA_LOGGER)
dnl =================================================================== dnl ===================================================================
dnl Setting up the environment. dnl Setting up the environment.
...@@ -12927,6 +12948,7 @@ AC_CONFIG_HEADERS([config_host/config_kde4.h]) ...@@ -12927,6 +12948,7 @@ AC_CONFIG_HEADERS([config_host/config_kde4.h])
AC_CONFIG_HEADERS([config_host/config_oox.h]) AC_CONFIG_HEADERS([config_host/config_oox.h])
AC_CONFIG_HEADERS([config_host/config_opengl.h]) AC_CONFIG_HEADERS([config_host/config_opengl.h])
AC_CONFIG_HEADERS([config_host/config_options.h]) AC_CONFIG_HEADERS([config_host/config_options.h])
AC_CONFIG_HEADERS([config_host/config_options_calc.h])
AC_CONFIG_HEADERS([config_host/config_test.h]) AC_CONFIG_HEADERS([config_host/config_test.h])
AC_CONFIG_HEADERS([config_host/config_telepathy.h]) AC_CONFIG_HEADERS([config_host/config_telepathy.h])
AC_CONFIG_HEADERS([config_host/config_typesizes.h]) AC_CONFIG_HEADERS([config_host/config_typesizes.h])
......
...@@ -230,7 +230,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ ...@@ -230,7 +230,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/editutil \ sc/source/core/tool/editutil \
sc/source/core/tool/filtopt \ sc/source/core/tool/filtopt \
sc/source/core/tool/formulagroup \ sc/source/core/tool/formulagroup \
sc/source/core/tool/formulalogger \
sc/source/core/tool/formulaopt \ sc/source/core/tool/formulaopt \
sc/source/core/tool/formulaparserpool \ sc/source/core/tool/formulaparserpool \
sc/source/core/tool/formularesult \ sc/source/core/tool/formularesult \
...@@ -671,6 +670,12 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ ...@@ -671,6 +670,12 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/xmlsource/xmlsourcedlg \ sc/source/ui/xmlsource/xmlsourcedlg \
)) ))
ifeq ($(ENABLE_FORMULA_LOGGER),TRUE)
$(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/formulalogger \
))
endif
ifneq (,$(gb_ENABLE_DBGUTIL)) ifneq (,$(gb_ENABLE_DBGUTIL))
$(eval $(call gb_Library_add_exception_objects,sc,\ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/view/gridwin_dbgutil \ sc/source/ui/view/gridwin_dbgutil \
......
...@@ -12,11 +12,15 @@ ...@@ -12,11 +12,15 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <config_options_calc.h>
class ScFormulaCell; class ScFormulaCell;
class ScDocument; class ScDocument;
namespace sc { namespace sc {
#if ENABLE_FORMULA_LOGGER
/** /**
* Outputs formula calculation log outputs to specified file. * Outputs formula calculation log outputs to specified file.
*/ */
...@@ -84,6 +88,35 @@ public: ...@@ -84,6 +88,35 @@ public:
GroupScope enterGroup( const ScDocument& rDoc, const ScFormulaCell& rCell ); GroupScope enterGroup( const ScDocument& rDoc, const ScFormulaCell& rCell );
}; };
#else
/**
* Dummy class with all empty inline methods.
*/
class FormulaLogger
{
public:
static FormulaLogger get()
{
return FormulaLogger();
}
class GroupScope
{
public:
void addMessage( const OUString& /*rMsg*/ ) {}
void setCalcComplete() {}
};
GroupScope enterGroup( const ScDocument& /*rDoc*/, const ScFormulaCell& /*rCell*/ )
{
return GroupScope();
}
};
#endif // ENABLE_FORMULA_LOGGER
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment