summaryrefslogtreecommitdiffstats
path: root/sc/inc/compare.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-17 19:23:01 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-18 23:22:41 -0400
commite09cedd92259d8fdb98a7591b46a813685f0df96 (patch)
treece3df7ef5fd361550b1b5fc2f4d85ca6030663be /sc/inc/compare.hxx
parentEnable group calculation on SUMIFS. (diff)
downloadcore-e09cedd92259d8fdb98a7591b46a813685f0df96.tar.gz
core-e09cedd92259d8fdb98a7591b46a813685f0df96.zip
Initial attempt to speed up matrix comparison.
And move the value compare code to somewhere public. I'll be using it from the ScMatrix internal. This change requires mdds 0.9.1 which is yet to be released. Change-Id: I942133c85b614b3404006fa38af111ace9361fd4
Diffstat (limited to 'sc/inc/compare.hxx')
-rw-r--r--sc/inc/compare.hxx68
1 files changed, 68 insertions, 0 deletions
diff --git a/sc/inc/compare.hxx b/sc/inc/compare.hxx
new file mode 100644
index 000000000000..307b5311a8e3
--- /dev/null
+++ b/sc/inc/compare.hxx
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SC_COMPARE_HXX
+#define SC_COMPARE_HXX
+
+#include "queryentry.hxx"
+
+#include "rtl/ustring.hxx"
+
+class ScDocument;
+
+namespace sc {
+
+struct Compare
+{
+ double nVal[2];
+ OUString* pVal[2];
+ bool bVal[2];
+ bool bEmpty[2];
+
+ Compare( OUString* p1, OUString* p2 )
+ {
+ pVal[0] = p1;
+ pVal[1] = p2;
+ bEmpty[0] = false;
+ bEmpty[1] = false;
+ }
+};
+
+struct CompareOptions
+{
+ ScQueryEntry aQueryEntry;
+ bool bRegEx;
+ bool bMatchWholeCell;
+ bool bIgnoreCase;
+
+ CompareOptions( ScDocument* pDoc, const ScQueryEntry& rEntry, bool bReg );
+private:
+ // Not implemented, prevent usage.
+ CompareOptions();
+ CompareOptions( const CompareOptions & );
+ CompareOptions& operator=( const CompareOptions & );
+};
+
+double CompareFunc( bool bIgnoreCase, const Compare& rComp, CompareOptions* pOptions = NULL );
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */