summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-08-19 17:31:02 +0200
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-09 18:41:35 +0100
commitd4cc0442655d28a259d5129c95cbd7d4befb5c73 (patch)
tree5fe1a22f785a4fac47883c2cdeeb29e7dec8996d
parent2251ba580ba093bdea831ebd38dad2c2bda1db64 (diff)
import table as ScDBData
Change-Id: Ibce6247b19ca7c0788743baba24d07722500efd0
-rw-r--r--sc/source/filter/inc/orcusinterface.hxx3
-rw-r--r--sc/source/filter/orcus/interface.cxx32
2 files changed, 33 insertions, 2 deletions
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 0fdde6833af3..e1138da4b66d 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -284,6 +284,9 @@ private:
ScDocument& mrDoc;
ScOrcusAutoFilter maAutoFilter;
+ ScRange maRange;
+ OUString maName;
+
public:
ScOrcusTable(SCTAB nTab, ScDocument& rDoc);
virtual ~ScOrcusTable();
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 7399b87a84b8..f79efc23da47 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -17,6 +17,7 @@
#include "docoptio.hxx"
#include "globstr.hrc"
#include "compiler.hxx"
+#include "dbdata.hxx"
#include <formula/token.hxx>
#include <tools/datetime.hxx>
@@ -726,10 +727,30 @@ void ScOrcusTable::set_identifier(size_t id)
SAL_INFO("sc.orcus.table", "set_identifier :" << id);
}
+namespace {
+
+std::ostream& operator<<(std::ostream& rStrm, const ScAddress& rAddr)
+{
+ rStrm << "Col: " << rAddr.Col() << ", Row: " << rAddr.Row() << ", Tab: " << rAddr.Tab();
+ return rStrm;
+}
+
+std::ostream& operator<<(std::ostream& rStrm, const ScRange& rRange)
+{
+ rStrm << "aStart: " << rRange.aStart << std::endl;
+ rStrm << "aEnd: " << rRange.aEnd;
+ return rStrm;
+}
+
+}
+
void ScOrcusTable::set_range(const char* p_ref, size_t n_ref)
{
OUString aRange(p_ref, n_ref, RTL_TEXTENCODING_UTF8);
SAL_INFO("sc.orcus.table", "set_range: " << aRange);
+
+ maRange.Parse(aRange);
+ SAL_INFO("sc.orcus.table", "set_range translated range: " << maRange);
}
void ScOrcusTable::set_totals_row_count(size_t row_count)
@@ -739,8 +760,8 @@ void ScOrcusTable::set_totals_row_count(size_t row_count)
void ScOrcusTable::set_name(const char* p, size_t n)
{
- OUString aName(p, n, RTL_TEXTENCODING_UTF8);
- SAL_INFO("sc.orcus.table", "set_name: " << aName);
+ maName = OUString(p, n, RTL_TEXTENCODING_UTF8);
+ SAL_INFO("sc.orcus.table", "set_name: " << maName);
}
void ScOrcusTable::set_display_name(const char* p, size_t n)
@@ -810,6 +831,13 @@ void ScOrcusTable::set_style_show_column_stripes(bool b)
void ScOrcusTable::commit()
{
SAL_INFO("sc.orcus.table", "commit");
+
+ ScDBData* pDBData = new ScDBData(maName, mnTab,
+ maRange.aStart.Col(), maRange.aStart.Row(),
+ maRange.aEnd.Col(), maRange.aEnd.Row());
+
+ if(!mrDoc.GetDBCollection()->getNamedDBs().insert(pDBData))
+ delete pDBData;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */