Kaydet (Commit) a11ddfdc authored tarafından Miklos Vajna's avatar Miklos Vajna

connectivity writer driver: add Columns implementation

Gets rid of the stub warnings in OWriterTable::refreshColumns().

Change-Id: I2dd43777a00a6958548e3dc8119c5cb825ebb02e
Reviewed-on: https://gerrit.libreoffice.org/40091Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst bec2da98
......@@ -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 \
......
/* -*- 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: */
......@@ -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()
......
/* -*- 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment