[Libreoffice-commits] core.git: Branch 'feature/gsoc-calc-enhanced-db-range' - sc/source

Akash Shetye shetyeakash at gmail.com
Mon Jul 29 19:39:42 PDT 2013


 sc/source/filter/excel/xedbdata.cxx |   86 ++++++++++++++++++++++++++++++++++++
 sc/source/filter/inc/xedbdata.hxx   |   81 +++++++++++++++++++++++++++++++++
 2 files changed, 167 insertions(+)

New commits:
commit fa3d3c870b4bbe9c20ab905f91a78840eeeecc21
Author: Akash Shetye <shetyeakash at gmail.com>
Date:   Tue Jul 30 08:08:13 2013 +0530

    Part 1 of Adding DB Data export
    
    Adding this skeleton for all the constructs for DB Data export
    
    Change-Id: I7510358af5f2ac92bd7f2ec7d1af4170ec8f763c

diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx
new file mode 100644
index 0000000..ebce789
--- /dev/null
+++ b/sc/source/filter/excel/xedbdata.cxx
@@ -0,0 +1,86 @@
+/* -*- 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 .
+ */
+
+#include "xedbdata.hxx"
+#include "document.hxx"
+
+XclExpXmlDBDataStyleInfo::XclExpXmlDBDataStyleInfo( const XclExpRoot& rRoot, ScDBDataFormatting& rDBDataFormatting )
+    : XclExpRoot( rRoot )
+{
+}
+
+void XclExpXmlDBDataStyleInfo::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+
+// ============================================================================
+XclExpXmlDBDataColumn::XclExpXmlDBDataColumn( const XclExpRoot& rRoot, int iID, OUString& rName )
+    : XclExpRoot( rRoot )
+{
+}
+
+void XclExpXmlDBDataColumn::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+
+// ============================================================================
+XclExpXmlDBDataColumns::XclExpXmlDBDataColumns( const XclExpRoot& rRoot, ScDBData& rDBData )
+    : XclExpRoot( rRoot )
+{
+}
+
+void XclExpXmlDBDataColumns::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+
+// ============================================================================
+XclExpXmlDBDataTable::XclExpXmlDBDataTable(const XclExpRoot& rRoot, ScDBData& rDBData )
+    : XclExpRoot( rRoot )
+{
+    maTableColumns.reset( new XclExpXmlDBDataColumns( rRoot, rDBData ) );
+    ScDBDataFormatting aDBFormatting;
+    rDBData.GetTableFormatting( aDBFormatting );
+    maStyleInfo.reset( new XclExpXmlDBDataStyleInfo( rRoot, aDBFormatting) );
+}
+void XclExpXmlDBDataTable::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+
+// =============================================================================
+XclExpXmlDBDataTables::XclExpXmlDBDataTables( const XclExpRoot& rRoot )
+    : XclExpRoot( rRoot )
+{
+    ScDBCollection* pDBCollection = rRoot.GetDoc().GetDBCollection();
+    if( pDBCollection )
+    {
+        ScDBCollection::NamedDBs& aNamedDBs = pDBCollection->getNamedDBs();
+        ScDBCollection::NamedDBs::iterator itr = aNamedDBs.begin();
+        ScDBCollection::NamedDBs::iterator itrEnd = aNamedDBs.end();
+        for(; itr!= itrEnd; ++itr)
+        {
+            maDBDataTableContainer.push_back( new XclExpXmlDBDataTable( rRoot, *itr ) );
+            ++miCount;
+        }
+    }
+}
+
+void XclExpXmlDBDataTables::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+// =============================================================================
diff --git a/sc/source/filter/inc/xedbdata.hxx b/sc/source/filter/inc/xedbdata.hxx
new file mode 100644
index 0000000..d05b683
--- /dev/null
+++ b/sc/source/filter/inc/xedbdata.hxx
@@ -0,0 +1,81 @@
+/* -*- 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_XEDBDATA_HXX
+#define SC_ZEDBDATA_HXX
+
+#include "dbdata.hxx"
+#include "xeroot.hxx"
+#include "xerecord.hxx"
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
+
+class XclExpXmlDBDataStyleInfo : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+    XclExpXmlDBDataStyleInfo( const XclExpRoot& rRoot, ScDBDataFormatting& rDBDataFormatting );
+    virtual void SaveXml( XclExpXmlStream& rStrm );
+};
+// ===========================================================================
+class XclExpXmlDBDataColumn : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+    XclExpXmlDBDataColumn( const XclExpRoot& rRoot, int iID, OUString& rName );
+    virtual void SaveXml( XclExpXmlStream& rStrm );
+};
+
+// ===========================================================================
+class XclExpXmlDBDataColumns : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+    XclExpXmlDBDataColumns( const XclExpRoot& rRoot, ScDBData& rDBData );
+    virtual void SaveXml( XclExpXmlStream& rStrm );
+private:
+    typedef boost::ptr_vector< XclExpXmlDBDataColumn > DBDataColumnContainer;
+    DBDataColumnContainer maDBDataColumnContainer;
+    int miCount;
+};
+
+// ============================================================================
+class XclExpXmlDBDataTable : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+    XclExpXmlDBDataTable( const XclExpRoot& rRoot, ScDBData& rDBData );
+    virtual void SaveXml( XclExpXmlStream& rStrm );
+private:
+    typedef boost::scoped_ptr < XclExpXmlDBDataColumns > DBDataTableColumns;
+    typedef boost::scoped_ptr < XclExpXmlDBDataStyleInfo > DBDataStyleInfo;
+    DBDataTableColumns maTableColumns;
+    DBDataStyleInfo maStyleInfo;
+};
+
+// ============================================================================
+class XclExpXmlDBDataTables : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+    XclExpXmlDBDataTables( const XclExpRoot& rRoot );
+    virtual void SaveXml( XclExpXmlStream& rStrm );
+private:
+    typedef boost::ptr_vector< XclExpXmlDBDataTable > DBDataTableContainer;
+    DBDataTableContainer maDBDataTableContainer;
+    int miCount;
+};
+
+#endif


More information about the Libreoffice-commits mailing list