summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-07-17 17:57:26 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-18 09:08:26 +0200
commita11ddfdcf3f5021cbeb0f065694d875bb748dc76 (patch)
treecc6d01c2fce393266aa2f532299be8b34e5ae46e /connectivity
parentbec2da98c74dc4c02561641862de15e5d2630fa2 (diff)
connectivity writer driver: add Columns implementation
Gets rid of the stub warnings in OWriterTable::refreshColumns(). Change-Id: I2dd43777a00a6958548e3dc8119c5cb825ebb02e Reviewed-on: https://gerrit.libreoffice.org/40091 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/Library_writer.mk1
-rw-r--r--connectivity/source/drivers/writer/WColumns.cxx48
-rw-r--r--connectivity/source/drivers/writer/WTable.cxx3
-rw-r--r--connectivity/source/inc/writer/WColumns.hxx46
4 files changed, 97 insertions, 1 deletions
diff --git a/connectivity/Library_writer.mk b/connectivity/Library_writer.mk
index d07f572a3227..4fab8bf043d9 100644
--- a/connectivity/Library_writer.mk
+++ b/connectivity/Library_writer.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_Library_use_libraries,writer,\
$(eval $(call gb_Library_add_exception_objects,writer,\
connectivity/source/drivers/writer/WCatalog \
+ connectivity/source/drivers/writer/WColumns \
connectivity/source/drivers/writer/WConnection \
connectivity/source/drivers/writer/WDatabaseMetaData \
connectivity/source/drivers/writer/WDriver \
diff --git a/connectivity/source/drivers/writer/WColumns.cxx b/connectivity/source/drivers/writer/WColumns.cxx
new file mode 100644
index 000000000000..73945b9e2ca8
--- /dev/null
+++ b/connectivity/source/drivers/writer/WColumns.cxx
@@ -0,0 +1,48 @@
+/* -*- 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 "writer/WColumns.hxx"
+
+#include <connectivity/sdbcx/VColumn.hxx>
+
+#include "writer/WTable.hxx"
+
+using namespace ::com::sun::star;
+
+namespace connectivity
+{
+namespace writer
+{
+
+sdbcx::ObjectType OWriterColumns::createObject(const OUString& _rName)
+{
+ OWriterTable* pTable = static_cast<OWriterTable*>(m_pTable);
+ ::rtl::Reference<OSQLColumns> aCols = pTable->getTableColumns();
+
+ OSQLColumns::Vector::const_iterator aIter = find(aCols->get().begin(),aCols->get().end(),_rName,::comphelper::UStringMixEqual(isCaseSensitive()));
+ sdbcx::ObjectType xRet;
+ if (aIter != aCols->get().end())
+ xRet = sdbcx::ObjectType(*aIter, uno::UNO_QUERY);
+ return xRet;
+}
+
+} // namespace writer
+} // namespace connectivity
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/writer/WTable.cxx b/connectivity/source/drivers/writer/WTable.cxx
index 04becaf9712a..80e7215c3a1e 100644
--- a/connectivity/source/drivers/writer/WTable.cxx
+++ b/connectivity/source/drivers/writer/WTable.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/text/XText.hpp>
#include <svl/converter.hxx>
#include "writer/WConnection.hxx"
+#include "writer/WColumns.hxx"
#include <connectivity/sdbcx/VColumn.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/thread.h>
@@ -231,7 +232,7 @@ void OWriterTable::refreshColumns()
if (m_pColumns)
m_pColumns->reFill(aVector);
else
- SAL_WARN("connectivity.writer", "TODO implement OWriterTable::refreshColumns");
+ m_pColumns = new OWriterColumns(this, m_aMutex, aVector);
}
void OWriterTable::refreshIndexes()
diff --git a/connectivity/source/inc/writer/WColumns.hxx b/connectivity/source/inc/writer/WColumns.hxx
new file mode 100644
index 000000000000..8b59851999eb
--- /dev/null
+++ b/connectivity/source/inc/writer/WColumns.hxx
@@ -0,0 +1,46 @@
+/* -*- 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 INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WCOLUMNS_HXX
+#define INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WCOLUMNS_HXX
+
+#include "file/FColumns.hxx"
+
+namespace connectivity
+{
+namespace writer
+{
+class OWriterColumns : public file::OColumns
+{
+protected:
+ virtual sdbcx::ObjectType createObject(const OUString& _rName) override;
+public:
+ OWriterColumns(file::OFileTable* _pTable,
+ ::osl::Mutex& _rMutex,
+ const TStringVector& _rVector
+ ) : file::OColumns(_pTable,_rMutex,_rVector)
+ {}
+
+};
+}
+}
+
+#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WCOLUMNS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */