summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2016-10-24 18:56:51 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2016-10-25 18:07:27 -0400
commitdff4e51f5db23baab368ab7e656ad1b74f2663bd (patch)
treef5f108fc581f163aa815bd98ab2765ba4d02b524
parent08086d76f86794963b3ab27168f9516edf7b9d2d (diff)
Add configure option --enable-formula-logger to conditionalize it.
Change-Id: I1badbcfa259b22d742e5241bd817ea44769a771e
-rw-r--r--config_host.mk.in1
-rw-r--r--config_host/config_options_calc.h.in10
-rw-r--r--configure.ac22
-rw-r--r--sc/Library_sc.mk7
-rw-r--r--sc/inc/formulalogger.hxx33
5 files changed, 72 insertions, 1 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index 90c25a63dc99..260acf7787c4 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -130,6 +130,7 @@ export ENABLE_DIRECTX=@ENABLE_DIRECTX@
export ENABLE_EOT=@ENABLE_EOT@
export ENABLE_EVOAB2=@ENABLE_EVOAB2@
export ENABLE_FIREBIRD_SDBC=@ENABLE_FIREBIRD_SDBC@
+export ENABLE_FORMULA_LOGGER=@ENABLE_FORMULA_LOGGER@
export ENABLE_GIO=@ENABLE_GIO@
export ENABLE_GRAPHITE=@ENABLE_GRAPHITE@
export ENABLE_ORCUS=@ENABLE_ORCUS@
diff --git a/config_host/config_options_calc.h.in b/config_host/config_options_calc.h.in
new file mode 100644
index 000000000000..f369797a5ed8
--- /dev/null
+++ b/config_host/config_options_calc.h.in
@@ -0,0 +1,10 @@
+/*
+ * 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
diff --git a/configure.ac b/configure.ac
index af07d135032c..f06ef8e2806a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1515,6 +1515,13 @@ AC_ARG_ENABLE(dconf,
[Disable the dconf configuration backend (enabled by default where
available).]))
+AC_ARG_ENABLE(formula-logger,
+ AS_HELP_STRING(
+ [--enable-formula-logger],
+ [Enable formula logger for logging formula calculation flow in Calc.]
+ )
+)
+
dnl ===================================================================
dnl Optional Packages (--with/without-)
dnl ===================================================================
@@ -12754,6 +12761,20 @@ else
fi
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 Setting up the environment.
@@ -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_opengl.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_telepathy.h])
AC_CONFIG_HEADERS([config_host/config_typesizes.h])
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index f3abc81ac818..0e2190361554 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -230,7 +230,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/editutil \
sc/source/core/tool/filtopt \
sc/source/core/tool/formulagroup \
- sc/source/core/tool/formulalogger \
sc/source/core/tool/formulaopt \
sc/source/core/tool/formulaparserpool \
sc/source/core/tool/formularesult \
@@ -671,6 +670,12 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
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))
$(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/view/gridwin_dbgutil \
diff --git a/sc/inc/formulalogger.hxx b/sc/inc/formulalogger.hxx
index 144fabf02849..1348c63d9218 100644
--- a/sc/inc/formulalogger.hxx
+++ b/sc/inc/formulalogger.hxx
@@ -12,11 +12,15 @@
#include <memory>
#include <vector>
+#include <config_options_calc.h>
+
class ScFormulaCell;
class ScDocument;
namespace sc {
+#if ENABLE_FORMULA_LOGGER
+
/**
* Outputs formula calculation log outputs to specified file.
*/
@@ -84,6 +88,35 @@ public:
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