2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-26 09:49:35 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2006-09-17 01:39:00 +00:00
|
|
|
|
2000-10-30 10:00:36 +00:00
|
|
|
#include <ctype.h>
|
2000-10-05 13:47:22 +00:00
|
|
|
#include "flat/ETable.hxx"
|
|
|
|
#include <com/sun/star/sdbc/ColumnValue.hpp>
|
|
|
|
#include <com/sun/star/sdbc/DataType.hpp>
|
|
|
|
#include <com/sun/star/ucb/XContentAccess.hpp>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/converter.hxx>
|
2000-10-05 13:47:22 +00:00
|
|
|
#include "flat/EConnection.hxx"
|
|
|
|
#include "flat/EColumns.hxx"
|
|
|
|
#include <osl/thread.h>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/zforlist.hxx>
|
2003-03-19 15:38:50 +00:00
|
|
|
#include <rtl/math.hxx>
|
2000-10-05 13:47:22 +00:00
|
|
|
#include <stdio.h> //sprintf
|
2001-03-15 08:02:28 +00:00
|
|
|
#include <comphelper/extract.hxx>
|
2000-10-11 09:48:50 +00:00
|
|
|
#include <comphelper/numbers.hxx>
|
2011-11-18 21:03:31 +00:00
|
|
|
#include <comphelper/sequence.hxx>
|
|
|
|
#include <comphelper/string.hxx>
|
|
|
|
#include <comphelper/types.hxx>
|
2000-10-05 13:47:22 +00:00
|
|
|
#include "flat/EDriver.hxx"
|
|
|
|
#include <com/sun/star/util/NumberFormat.hpp>
|
|
|
|
#include <unotools/configmgr.hxx>
|
2006-04-07 12:11:36 +00:00
|
|
|
#include <i18npool/mslangid.hxx>
|
2000-12-06 11:07:47 +00:00
|
|
|
#include "connectivity/dbconversion.hxx"
|
2006-06-20 00:28:52 +00:00
|
|
|
#include "file/quotedstring.hxx"
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <unotools/syslocale.hxx>
|
2009-04-23 10:42:05 +00:00
|
|
|
#include <rtl/logfile.hxx>
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2001-05-18 07:33:49 +00:00
|
|
|
using namespace ::comphelper;
|
2000-10-05 13:47:22 +00:00
|
|
|
using namespace connectivity;
|
|
|
|
using namespace connectivity::flat;
|
|
|
|
using namespace connectivity::file;
|
2001-05-18 07:33:49 +00:00
|
|
|
using namespace ::cppu;
|
2000-10-19 10:56:36 +00:00
|
|
|
using namespace utl;
|
2000-10-05 13:47:22 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::ucb;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::sdbcx;
|
|
|
|
using namespace ::com::sun::star::sdbc;
|
|
|
|
using namespace ::com::sun::star::container;
|
|
|
|
using namespace ::com::sun::star::lang;
|
2000-12-14 07:32:10 +00:00
|
|
|
|
2000-10-05 13:47:22 +00:00
|
|
|
// -------------------------------------------------------------------------
|
2005-12-21 12:16:52 +00:00
|
|
|
void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::fillColumns" );
|
2011-01-07 18:04:22 +01:00
|
|
|
sal_Bool bRead = sal_True;
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2006-06-20 00:28:52 +00:00
|
|
|
QuotedTokenizedString aHeaderLine;
|
2000-10-05 13:47:22 +00:00
|
|
|
OFlatConnection* pConnection = (OFlatConnection*)m_pConnection;
|
2009-04-23 10:42:05 +00:00
|
|
|
const rtl_TextEncoding nEncoding = m_pConnection->getTextEncoding();
|
|
|
|
const sal_Bool bHasHeaderLine = pConnection->isHeaderLine();
|
|
|
|
if ( bHasHeaderLine )
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
|
|
|
while(bRead && !aHeaderLine.Len())
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
bRead = m_pFileStream->ReadByteStringLine(aHeaderLine,nEncoding);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
2009-04-23 10:42:05 +00:00
|
|
|
m_nStartRowFilePos = m_pFileStream->Tell();
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// read first row
|
2006-06-20 00:28:52 +00:00
|
|
|
QuotedTokenizedString aFirstLine;
|
2009-04-23 10:42:05 +00:00
|
|
|
bRead = m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding);
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2009-04-23 10:42:05 +00:00
|
|
|
if ( !bHasHeaderLine || !aHeaderLine.Len())
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
|
|
|
while(bRead && !aFirstLine.Len())
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
bRead = m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
// use first row as headerline because we need the number of columns
|
|
|
|
aHeaderLine = aFirstLine;
|
|
|
|
}
|
|
|
|
// column count
|
2009-04-23 10:42:05 +00:00
|
|
|
const xub_StrLen nFieldCount = aHeaderLine.GetTokenCount(m_cFieldDelimiter,m_cStringDelimiter);
|
2001-08-24 05:19:41 +00:00
|
|
|
|
2010-10-15 12:10:06 -05:00
|
|
|
if(!m_aColumns.is())
|
2001-08-24 05:19:41 +00:00
|
|
|
m_aColumns = new OSQLColumns();
|
|
|
|
else
|
2008-12-30 13:32:01 +00:00
|
|
|
m_aColumns->get().clear();
|
2001-08-24 05:19:41 +00:00
|
|
|
|
|
|
|
m_aTypes.clear();
|
|
|
|
m_aPrecisions.clear();
|
|
|
|
m_aScales.clear();
|
|
|
|
// reserve some space
|
2009-04-23 10:42:05 +00:00
|
|
|
m_aColumns->get().reserve(nFieldCount+1);
|
2010-11-25 08:51:07 +01:00
|
|
|
m_aTypes.assign(nFieldCount+1,DataType::SQLNULL);
|
|
|
|
m_aPrecisions.assign(nFieldCount+1,-1);
|
|
|
|
m_aScales.assign(nFieldCount+1,-1);
|
2001-08-24 05:19:41 +00:00
|
|
|
|
2010-11-25 12:43:46 +01:00
|
|
|
const sal_Bool bCase = m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers();
|
2005-12-21 12:16:52 +00:00
|
|
|
CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale);
|
2000-10-05 13:47:22 +00:00
|
|
|
// read description
|
2009-04-23 10:42:05 +00:00
|
|
|
const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
|
|
|
|
const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
|
2002-10-31 13:15:29 +00:00
|
|
|
String aColumnName;
|
2001-08-24 05:19:41 +00:00
|
|
|
::comphelper::UStringMixEqual aCase(bCase);
|
2010-11-25 08:51:07 +01:00
|
|
|
::std::vector<String> aColumnNames,m_aTypeNames;
|
|
|
|
m_aTypeNames.resize(nFieldCount);
|
2010-11-25 11:23:27 +01:00
|
|
|
const sal_Int32 nMaxRowsToScan = pConnection->getMaxRowsToScan();
|
2010-11-25 08:51:07 +01:00
|
|
|
sal_Int32 nRowCount = 0;
|
|
|
|
do
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
xub_StrLen nStartPosHeaderLine = 0; // use for eficient way to get the tokens
|
|
|
|
xub_StrLen nStartPosFirstLine = 0; // use for eficient way to get the tokens
|
|
|
|
xub_StrLen nStartPosFirstLine2 = 0;
|
|
|
|
for (xub_StrLen i = 0; i < nFieldCount; i++)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
if ( nRowCount == 0)
|
2003-09-04 07:27:04 +00:00
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
if ( bHasHeaderLine )
|
|
|
|
{
|
|
|
|
aHeaderLine.GetTokenSpecial(aColumnName,nStartPosHeaderLine,m_cFieldDelimiter,m_cStringDelimiter);
|
|
|
|
if ( !aColumnName.Len() )
|
|
|
|
{
|
|
|
|
aColumnName = 'C';
|
|
|
|
aColumnName += String::CreateFromInt32(i+1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// no column name so ...
|
|
|
|
aColumnName = 'C';
|
|
|
|
aColumnName += String::CreateFromInt32(i+1);
|
|
|
|
}
|
|
|
|
aColumnNames.push_back(aColumnName);
|
2003-09-04 07:27:04 +00:00
|
|
|
}
|
2010-11-25 08:51:07 +01:00
|
|
|
impl_fillColumnInfo_nothrow(aFirstLine,nStartPosFirstLine,nStartPosFirstLine2,m_aTypes[i],m_aPrecisions[i],m_aScales[i],m_aTypeNames[i],cDecimalDelimiter,cThousandDelimiter,aCharClass);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
2010-11-25 08:51:07 +01:00
|
|
|
++nRowCount;
|
|
|
|
}
|
2011-02-02 08:47:25 +01:00
|
|
|
while(nRowCount < nMaxRowsToScan && m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding) && !m_pFileStream->IsEof());
|
2010-11-25 08:51:07 +01:00
|
|
|
|
|
|
|
for (xub_StrLen i = 0; i < nFieldCount; i++)
|
|
|
|
{
|
|
|
|
// check if the columname already exists
|
|
|
|
String aAlias(aColumnNames[i]);
|
|
|
|
OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
|
|
|
|
sal_Int32 nExprCnt = 0;
|
|
|
|
while(aFind != m_aColumns->get().end())
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
(aAlias = aColumnNames[i]) += String::CreateFromInt32(++nExprCnt);
|
|
|
|
aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
|
2010-11-25 08:51:07 +01:00
|
|
|
sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,m_aTypeNames[i],::rtl::OUString(),::rtl::OUString(),
|
|
|
|
ColumnValue::NULLABLE,
|
|
|
|
m_aPrecisions[i],
|
|
|
|
m_aScales[i],
|
|
|
|
m_aTypes[i],
|
|
|
|
sal_False,
|
|
|
|
sal_False,
|
|
|
|
sal_False,
|
|
|
|
bCase);
|
|
|
|
Reference< XPropertySet> xCol = pColumn;
|
|
|
|
m_aColumns->get().push_back(xCol);
|
|
|
|
}
|
|
|
|
m_pFileStream->Seek(m_nStartRowFilePos);
|
|
|
|
}
|
|
|
|
void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,xub_StrLen& nStartPosFirstLine,xub_StrLen& nStartPosFirstLine2
|
|
|
|
,sal_Int32& io_nType,sal_Int32& io_nPrecisions,sal_Int32& io_nScales,String& o_sTypeName
|
|
|
|
,const sal_Unicode cDecimalDelimiter,const sal_Unicode cThousandDelimiter,const CharClass& aCharClass)
|
|
|
|
{
|
|
|
|
if ( io_nType != DataType::VARCHAR )
|
|
|
|
{
|
2011-02-07 16:04:02 +01:00
|
|
|
sal_Bool bNumeric = io_nType == DataType::SQLNULL || io_nType == DataType::DOUBLE || io_nType == DataType::DECIMAL || io_nType == DataType::INTEGER;
|
|
|
|
sal_uLong nIndex = 0;
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2010-11-25 08:51:07 +01:00
|
|
|
if ( bNumeric )
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
// first without fielddelimiter
|
|
|
|
String aField;
|
|
|
|
aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
|
|
|
|
if (aField.Len() == 0 ||
|
|
|
|
(m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2011-02-07 16:04:02 +01:00
|
|
|
bNumeric = sal_False;
|
2010-11-25 08:51:07 +01:00
|
|
|
if ( m_cStringDelimiter != '\0' )
|
|
|
|
aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
|
|
|
|
else
|
|
|
|
nStartPosFirstLine2 = nStartPosFirstLine;
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
String aField2;
|
|
|
|
if ( m_cStringDelimiter != '\0' )
|
|
|
|
aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
|
|
|
|
else
|
|
|
|
aField2 = aField;
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2010-11-25 08:51:07 +01:00
|
|
|
if (aField2.Len() == 0)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2011-02-07 16:04:02 +01:00
|
|
|
bNumeric = sal_False;
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
2010-11-25 08:51:07 +01:00
|
|
|
else
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2011-02-07 16:04:02 +01:00
|
|
|
bNumeric = sal_True;
|
2010-11-25 08:51:07 +01:00
|
|
|
xub_StrLen nDot = 0;
|
|
|
|
xub_StrLen nDecimalDelCount = 0;
|
2010-11-25 15:39:55 +01:00
|
|
|
xub_StrLen nSpaceCount = 0;
|
2010-11-25 08:51:07 +01:00
|
|
|
for (xub_StrLen j = 0; j < aField2.Len(); j++)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
const sal_Unicode c = aField2.GetChar(j);
|
2010-11-25 15:39:55 +01:00
|
|
|
if ( j == nSpaceCount && m_cFieldDelimiter != 32 && c == 32 )
|
|
|
|
{
|
|
|
|
++nSpaceCount;
|
2000-10-05 13:47:22 +00:00
|
|
|
continue;
|
2010-11-25 15:39:55 +01:00
|
|
|
}
|
2011-03-12 02:42:58 +01:00
|
|
|
// just digits, decimal- and thousands-delimiter?
|
2010-11-25 08:51:07 +01:00
|
|
|
if ( ( !cDecimalDelimiter || c != cDecimalDelimiter ) &&
|
|
|
|
( !cThousandDelimiter || c != cThousandDelimiter ) &&
|
|
|
|
!aCharClass.isDigit(aField2,j) &&
|
|
|
|
( j != 0 || (c != '+' && c != '-' ) ) )
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2011-02-07 16:04:02 +01:00
|
|
|
bNumeric = sal_False;
|
2000-10-05 13:47:22 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-11-25 08:51:07 +01:00
|
|
|
if (cDecimalDelimiter && c == cDecimalDelimiter)
|
|
|
|
{
|
|
|
|
io_nPrecisions = 15; // we have an decimal value
|
|
|
|
io_nScales = 2;
|
|
|
|
++nDecimalDelCount;
|
|
|
|
} // if (cDecimalDelimiter && c == cDecimalDelimiter)
|
|
|
|
if ( c == '.' )
|
|
|
|
++nDot;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nDecimalDelCount > 1 || nDot > 1 ) // if there is more than one dot it isn't a number
|
2011-02-07 16:04:02 +01:00
|
|
|
bNumeric = sal_False;
|
2010-11-25 08:51:07 +01:00
|
|
|
if (bNumeric && cThousandDelimiter)
|
|
|
|
{
|
2011-03-12 02:42:58 +01:00
|
|
|
// Is the delimiter correct?
|
2010-11-25 08:51:07 +01:00
|
|
|
const String aValue = aField2.GetToken(0,cDecimalDelimiter);
|
|
|
|
for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4)
|
|
|
|
{
|
|
|
|
const sal_Unicode c = aValue.GetChar(static_cast<sal_uInt16>(j));
|
2011-03-12 02:42:58 +01:00
|
|
|
// just digits, decimal- and thousands-delimiter?
|
2010-11-25 08:51:07 +01:00
|
|
|
if (c == cThousandDelimiter && j)
|
|
|
|
continue;
|
|
|
|
else
|
|
|
|
{
|
2011-02-07 16:04:02 +01:00
|
|
|
bNumeric = sal_False;
|
2010-11-25 08:51:07 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
|
2011-03-12 02:42:58 +01:00
|
|
|
// now also check for a date field
|
2010-11-25 08:51:07 +01:00
|
|
|
if (!bNumeric)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
nIndex = m_xNumberFormatter->detectNumberFormat(::com::sun::star::util::NumberFormat::ALL,aField2);
|
|
|
|
}
|
|
|
|
catch(Exception&)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( io_nType == DataType::DATE || io_nType == DataType::TIMESTAMP || io_nType == DataType::TIME)
|
|
|
|
{
|
|
|
|
String aField;
|
|
|
|
aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
|
|
|
|
if (aField.Len() == 0 ||
|
|
|
|
(m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
String aField2;
|
|
|
|
if ( m_cStringDelimiter != '\0' )
|
|
|
|
aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
|
|
|
|
else
|
|
|
|
aField2 = aField;
|
|
|
|
if (aField2.Len() )
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2000-12-12 09:44:18 +00:00
|
|
|
try
|
|
|
|
{
|
2002-10-31 13:15:29 +00:00
|
|
|
nIndex = m_xNumberFormatter->detectNumberFormat(::com::sun::star::util::NumberFormat::ALL,aField2);
|
2000-12-12 09:44:18 +00:00
|
|
|
}
|
|
|
|
catch(Exception&)
|
|
|
|
{
|
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 nFlags = 0;
|
|
|
|
if (bNumeric)
|
|
|
|
{
|
|
|
|
if (cDecimalDelimiter)
|
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
if(io_nPrecisions)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
io_nType = DataType::DECIMAL;
|
2012-06-02 09:42:35 -05:00
|
|
|
static const ::rtl::OUString s_sDECIMAL("DECIMAL");
|
2010-11-25 08:51:07 +01:00
|
|
|
o_sTypeName = s_sDECIMAL;
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-25 08:51:07 +01:00
|
|
|
io_nType = DataType::DOUBLE;
|
2012-06-02 09:42:35 -05:00
|
|
|
static const ::rtl::OUString s_sDOUBLE("DOUBLE");
|
2010-11-25 08:51:07 +01:00
|
|
|
o_sTypeName = s_sDOUBLE;
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2010-11-25 08:51:07 +01:00
|
|
|
{
|
|
|
|
io_nType = DataType::INTEGER;
|
|
|
|
io_nPrecisions = 0;
|
|
|
|
io_nScales = 0;
|
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
nFlags = ColumnSearch::BASIC;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-10-11 09:48:50 +00:00
|
|
|
switch (comphelper::getNumberFormatType(m_xNumberFormatter,nIndex))
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
|
|
|
case NUMBERFORMAT_DATE:
|
2010-11-25 08:51:07 +01:00
|
|
|
io_nType = DataType::DATE;
|
2009-04-23 10:42:05 +00:00
|
|
|
{
|
2012-06-02 09:42:35 -05:00
|
|
|
static const ::rtl::OUString s_sDATE("DATE");
|
2010-11-25 08:51:07 +01:00
|
|
|
o_sTypeName = s_sDATE;
|
2009-04-23 10:42:05 +00:00
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
break;
|
|
|
|
case NUMBERFORMAT_DATETIME:
|
2010-11-25 08:51:07 +01:00
|
|
|
io_nType = DataType::TIMESTAMP;
|
2009-04-23 10:42:05 +00:00
|
|
|
{
|
2012-06-02 09:42:35 -05:00
|
|
|
static const ::rtl::OUString s_sTIMESTAMP("TIMESTAMP");
|
2010-11-25 08:51:07 +01:00
|
|
|
o_sTypeName = s_sTIMESTAMP;
|
2009-04-23 10:42:05 +00:00
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
break;
|
|
|
|
case NUMBERFORMAT_TIME:
|
2010-11-25 08:51:07 +01:00
|
|
|
io_nType = DataType::TIME;
|
2009-04-23 10:42:05 +00:00
|
|
|
{
|
2012-06-02 09:42:35 -05:00
|
|
|
static const ::rtl::OUString s_sTIME("TIME");
|
2010-11-25 08:51:07 +01:00
|
|
|
o_sTypeName = s_sTIME;
|
2009-04-23 10:42:05 +00:00
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
break;
|
|
|
|
default:
|
2010-11-25 08:51:07 +01:00
|
|
|
io_nType = DataType::VARCHAR;
|
2011-03-12 02:42:58 +01:00
|
|
|
io_nPrecisions = 0; // nyi: Data can be longer!
|
2010-11-25 08:51:07 +01:00
|
|
|
io_nScales = 0;
|
2009-04-23 10:42:05 +00:00
|
|
|
{
|
2012-06-02 09:42:35 -05:00
|
|
|
static const ::rtl::OUString s_sVARCHAR("VARCHAR");
|
2010-11-25 08:51:07 +01:00
|
|
|
o_sTypeName = s_sVARCHAR;
|
2009-04-23 10:42:05 +00:00
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
};
|
|
|
|
nFlags |= ColumnSearch::CHAR;
|
|
|
|
}
|
|
|
|
}
|
2010-11-25 15:39:55 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
String aField;
|
|
|
|
aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
|
|
|
|
if (aField.Len() == 0 ||
|
|
|
|
(m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
|
2000-12-14 12:15:04 +00:00
|
|
|
{
|
2010-11-25 15:39:55 +01:00
|
|
|
if ( m_cStringDelimiter != '\0' )
|
|
|
|
aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
|
|
|
|
else
|
|
|
|
nStartPosFirstLine2 = nStartPosFirstLine;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
String aField2;
|
|
|
|
if ( m_cStringDelimiter != '\0' )
|
|
|
|
aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
|
2000-12-14 12:15:04 +00:00
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2001-09-25 12:12:51 +00:00
|
|
|
OFlatTable::OFlatTable(sdbcx::OCollection* _pTables,OFlatConnection* _pConnection,
|
2000-10-05 13:47:22 +00:00
|
|
|
const ::rtl::OUString& _Name,
|
|
|
|
const ::rtl::OUString& _Type,
|
|
|
|
const ::rtl::OUString& _Description ,
|
|
|
|
const ::rtl::OUString& _SchemaName,
|
|
|
|
const ::rtl::OUString& _CatalogName
|
2001-09-25 12:12:51 +00:00
|
|
|
) : OFlatTable_BASE(_pTables,_pConnection,_Name,
|
2000-10-05 13:47:22 +00:00
|
|
|
_Type,
|
|
|
|
_Description,
|
|
|
|
_SchemaName,
|
|
|
|
_CatalogName)
|
2009-04-23 10:42:05 +00:00
|
|
|
,m_nStartRowFilePos(0)
|
2000-10-05 13:47:22 +00:00
|
|
|
,m_nRowPos(0)
|
|
|
|
,m_nMaxRowCount(0)
|
2009-04-23 10:42:05 +00:00
|
|
|
,m_cStringDelimiter(_pConnection->getStringDelimiter())
|
|
|
|
,m_cFieldDelimiter(_pConnection->getFieldDelimiter())
|
|
|
|
,m_bNeedToReadLine(false)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::OFlatTable" );
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2002-10-08 07:26:17 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void OFlatTable::construct()
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::construct" );
|
2008-03-05 15:31:20 +00:00
|
|
|
SvtSysLocale aLocale;
|
|
|
|
::com::sun::star::lang::Locale aAppLocale(aLocale.GetLocaleDataPtr()->getLocale());
|
2000-10-05 13:47:22 +00:00
|
|
|
Sequence< ::com::sun::star::uno::Any > aArg(1);
|
|
|
|
aArg[0] <<= aAppLocale;
|
|
|
|
|
2012-06-02 09:42:35 -05:00
|
|
|
Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(m_pConnection->getDriver()->getFactory()->createInstanceWithArguments(::rtl::OUString("com.sun.star.util.NumberFormatsSupplier"),aArg),UNO_QUERY);
|
|
|
|
m_xNumberFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(m_pConnection->getDriver()->getFactory()->createInstance(::rtl::OUString("com.sun.star.util.NumberFormatter")),UNO_QUERY);
|
2000-10-05 13:47:22 +00:00
|
|
|
m_xNumberFormatter->attachNumberFormatsSupplier(xSupplier);
|
2009-04-23 10:42:05 +00:00
|
|
|
Reference<XPropertySet> xProp(xSupplier->getNumberFormatSettings(),UNO_QUERY);
|
2012-06-02 09:42:35 -05:00
|
|
|
xProp->getPropertyValue(::rtl::OUString("NullDate")) >>= m_aNullDate;
|
2000-10-05 13:47:22 +00:00
|
|
|
|
|
|
|
INetURLObject aURL;
|
2000-11-16 09:47:23 +00:00
|
|
|
aURL.SetURL(getEntry());
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2004-12-13 11:03:41 +00:00
|
|
|
if(aURL.getExtension() != rtl::OUString(m_pConnection->getExtension()))
|
2000-10-05 13:47:22 +00:00
|
|
|
aURL.setExtension(m_pConnection->getExtension());
|
|
|
|
|
2001-07-16 08:58:40 +00:00
|
|
|
String aFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
|
2000-11-16 09:47:23 +00:00
|
|
|
|
2001-07-17 11:37:19 +00:00
|
|
|
m_pFileStream = createStream_simpleError( aFileName,STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
|
2000-11-16 09:47:23 +00:00
|
|
|
|
|
|
|
if(!m_pFileStream)
|
2001-07-17 11:37:19 +00:00
|
|
|
m_pFileStream = createStream_simpleError( aFileName,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2000-11-16 09:47:23 +00:00
|
|
|
if(m_pFileStream)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2000-11-16 09:47:23 +00:00
|
|
|
m_pFileStream->Seek(STREAM_SEEK_TO_END);
|
|
|
|
sal_Int32 nSize = m_pFileStream->Tell();
|
|
|
|
m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2011-02-21 16:14:21 +01:00
|
|
|
// Buffersize is dependent on the file-size
|
2000-11-16 09:47:23 +00:00
|
|
|
m_pFileStream->SetBufferSize(nSize > 1000000 ? 32768 :
|
2000-10-05 13:47:22 +00:00
|
|
|
nSize > 100000 ? 16384 :
|
|
|
|
nSize > 10000 ? 4096 : 1024);
|
|
|
|
|
2005-12-21 12:16:52 +00:00
|
|
|
fillColumns(aAppLocale);
|
2000-10-05 13:47:22 +00:00
|
|
|
|
|
|
|
refreshColumns();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
String OFlatTable::getEntry()
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::getEntry" );
|
2004-08-02 16:04:35 +00:00
|
|
|
::rtl::OUString sURL;
|
|
|
|
try
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2004-08-02 16:04:35 +00:00
|
|
|
Reference< XResultSet > xDir = m_pConnection->getDir()->getStaticResultSet();
|
|
|
|
Reference< XRow> xRow(xDir,UNO_QUERY);
|
|
|
|
::rtl::OUString sName;
|
|
|
|
::rtl::OUString sExt;
|
|
|
|
|
|
|
|
INetURLObject aURL;
|
|
|
|
xDir->beforeFirst();
|
2012-06-02 09:42:35 -05:00
|
|
|
static const ::rtl::OUString s_sSeparator("/");
|
2004-08-02 16:04:35 +00:00
|
|
|
while(xDir->next())
|
|
|
|
{
|
|
|
|
sName = xRow->getString(1);
|
|
|
|
aURL.SetSmartProtocol(INET_PROT_FILE);
|
|
|
|
String sUrl = m_pConnection->getURL() + s_sSeparator + sName;
|
|
|
|
aURL.SetSmartURL( sUrl );
|
2000-12-10 18:30:10 +00:00
|
|
|
|
2004-08-02 16:04:35 +00:00
|
|
|
// cut the extension
|
|
|
|
sExt = aURL.getExtension();
|
2000-12-10 18:30:10 +00:00
|
|
|
|
2004-08-02 16:04:35 +00:00
|
|
|
// name and extension have to coincide
|
|
|
|
if ( m_pConnection->matchesExtension( sExt ) )
|
|
|
|
{
|
2011-12-14 23:13:36 -02:00
|
|
|
if ( !sExt.isEmpty() )
|
2011-03-17 13:38:39 +01:00
|
|
|
sName = sName.replaceAt(sName.getLength()-(sExt.getLength()+1),sExt.getLength()+1,::rtl::OUString());
|
2004-08-02 16:04:35 +00:00
|
|
|
if ( sName == m_Name )
|
|
|
|
{
|
|
|
|
Reference< XContentAccess > xContentAccess( xDir, UNO_QUERY );
|
|
|
|
sURL = xContentAccess->queryContentIdentifierString();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
2004-08-02 16:04:35 +00:00
|
|
|
xDir->beforeFirst(); // move back to before first record
|
|
|
|
}
|
2012-06-12 13:40:45 +01:00
|
|
|
catch(const Exception&)
|
2004-08-02 16:04:35 +00:00
|
|
|
{
|
|
|
|
OSL_ASSERT(0);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
2012-06-12 13:40:45 +01:00
|
|
|
return sURL;
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void OFlatTable::refreshColumns()
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::refreshColumns" );
|
2000-10-05 13:47:22 +00:00
|
|
|
::osl::MutexGuard aGuard( m_aMutex );
|
|
|
|
|
2001-05-02 11:57:37 +00:00
|
|
|
TStringVector aVector;
|
2008-12-30 13:32:01 +00:00
|
|
|
aVector.reserve(m_aColumns->get().size());
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2008-12-30 13:32:01 +00:00
|
|
|
for(OSQLColumns::Vector::const_iterator aIter = m_aColumns->get().begin();aIter != m_aColumns->get().end();++aIter)
|
2000-10-05 13:47:22 +00:00
|
|
|
aVector.push_back(Reference< XNamed>(*aIter,UNO_QUERY)->getName());
|
|
|
|
|
|
|
|
if(m_pColumns)
|
2001-05-04 08:58:45 +00:00
|
|
|
m_pColumns->reFill(aVector);
|
|
|
|
else
|
|
|
|
m_pColumns = new OFlatColumns(this,m_aMutex,aVector);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OFlatTable::disposing(void)
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::disposing" );
|
2000-10-05 13:47:22 +00:00
|
|
|
OFileTable::disposing();
|
|
|
|
::osl::MutexGuard aGuard(m_aMutex);
|
2001-05-07 09:37:54 +00:00
|
|
|
m_aColumns = NULL;
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
Sequence< Type > SAL_CALL OFlatTable::getTypes( ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
Sequence< Type > aTypes = OTable_TYPEDEF::getTypes();
|
2001-10-18 12:24:06 +00:00
|
|
|
::std::vector<Type> aOwnTypes;
|
|
|
|
aOwnTypes.reserve(aTypes.getLength());
|
2000-10-05 13:47:22 +00:00
|
|
|
const Type* pBegin = aTypes.getConstArray();
|
|
|
|
const Type* pEnd = pBegin + aTypes.getLength();
|
2001-05-31 05:11:58 +00:00
|
|
|
for(;pBegin != pEnd;++pBegin)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
|
|
|
if(!(*pBegin == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
|
|
|
|
*pBegin == ::getCppuType((const Reference<XRename>*)0) ||
|
|
|
|
*pBegin == ::getCppuType((const Reference<XIndexesSupplier>*)0) ||
|
|
|
|
*pBegin == ::getCppuType((const Reference<XAlterTable>*)0) ||
|
|
|
|
*pBegin == ::getCppuType((const Reference<XDataDescriptorFactory>*)0)))
|
|
|
|
{
|
2001-10-18 12:24:06 +00:00
|
|
|
aOwnTypes.push_back(*pBegin);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
}
|
2004-09-08 15:21:22 +00:00
|
|
|
Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
|
|
|
|
return Sequence< Type >(pTypes, aOwnTypes.size());
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
Any SAL_CALL OFlatTable::queryInterface( const Type & rType ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
if( rType == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
|
|
|
|
rType == ::getCppuType((const Reference<XIndexesSupplier>*)0) ||
|
|
|
|
rType == ::getCppuType((const Reference<XRename>*)0) ||
|
|
|
|
rType == ::getCppuType((const Reference<XAlterTable>*)0) ||
|
|
|
|
rType == ::getCppuType((const Reference<XDataDescriptorFactory>*)0))
|
|
|
|
return Any();
|
|
|
|
|
2001-08-24 05:19:41 +00:00
|
|
|
Any aRet = OTable_TYPEDEF::queryInterface(rType);
|
|
|
|
return aRet.hasValue() ? aRet : ::cppu::queryInterface(rType,static_cast< ::com::sun::star::lang::XUnoTunnel*> (this));
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
Sequence< sal_Int8 > OFlatTable::getUnoTunnelImplementationId()
|
|
|
|
{
|
|
|
|
static ::cppu::OImplementationId * pId = 0;
|
|
|
|
if (! pId)
|
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
|
|
|
if (! pId)
|
|
|
|
{
|
|
|
|
static ::cppu::OImplementationId aId;
|
|
|
|
pId = &aId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pId->getImplementationId();
|
|
|
|
}
|
|
|
|
|
|
|
|
// com::sun::star::lang::XUnoTunnel
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
sal_Int64 OFlatTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::getSomething" );
|
2012-08-05 19:01:37 +02:00
|
|
|
return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
|
2006-06-20 00:28:52 +00:00
|
|
|
? reinterpret_cast< sal_Int64 >( this )
|
|
|
|
: OFlatTable_BASE::getSomething(rId);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
//------------------------------------------------------------------
|
2003-09-04 07:27:04 +00:00
|
|
|
sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal_Bool bIsTable,sal_Bool bRetrieveData)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::fetchRow" );
|
2008-12-30 13:32:01 +00:00
|
|
|
*(_rRow->get())[0] = m_nFilePos;
|
2000-10-05 13:47:22 +00:00
|
|
|
|
|
|
|
if (!bRetrieveData)
|
2011-01-07 18:04:22 +01:00
|
|
|
return sal_True;
|
2009-04-23 10:42:05 +00:00
|
|
|
if ( m_bNeedToReadLine )
|
|
|
|
{
|
|
|
|
sal_Int32 nCurrentPos = 0;
|
|
|
|
m_pFileStream->Seek(m_nFilePos);
|
|
|
|
readLine(nCurrentPos);
|
|
|
|
m_bNeedToReadLine = false;
|
|
|
|
}
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2001-07-30 07:53:02 +00:00
|
|
|
OFlatConnection* pConnection = (OFlatConnection*)m_pConnection;
|
2009-04-23 10:42:05 +00:00
|
|
|
const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
|
|
|
|
const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
|
2011-02-21 16:14:21 +01:00
|
|
|
// Fields:
|
2001-08-24 05:19:41 +00:00
|
|
|
xub_StrLen nStartPos = 0;
|
2002-10-31 13:15:29 +00:00
|
|
|
String aStr;
|
2008-12-30 13:32:01 +00:00
|
|
|
OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin();
|
|
|
|
OSQLColumns::Vector::const_iterator aEnd = _rCols.get().end();
|
2009-04-23 10:42:05 +00:00
|
|
|
const OValueRefVector::Vector::size_type nCount = _rRow->get().size();
|
|
|
|
for (OValueRefVector::Vector::size_type i = 1; aIter != aEnd && i < nCount;
|
2006-06-20 00:28:52 +00:00
|
|
|
++aIter, i++)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
m_aCurrentLine.GetTokenSpecial(aStr,nStartPos,m_cFieldDelimiter,m_cStringDelimiter);
|
2000-10-05 13:47:22 +00:00
|
|
|
|
|
|
|
if (aStr.Len() == 0)
|
2008-12-30 13:32:01 +00:00
|
|
|
(_rRow->get())[i]->setNull();
|
2001-07-30 07:53:02 +00:00
|
|
|
else
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2011-02-21 16:14:21 +01:00
|
|
|
// lengths depending on data-type:
|
2001-07-30 07:53:02 +00:00
|
|
|
sal_Int32 nLen,
|
2006-11-21 16:00:22 +00:00
|
|
|
nType = 0;
|
2001-07-30 07:53:02 +00:00
|
|
|
if(bIsTable)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2007-09-26 13:29:25 +00:00
|
|
|
nLen = m_aPrecisions[i-1];
|
|
|
|
nType = m_aTypes[i-1];
|
2001-07-30 07:53:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Reference< XPropertySet> xColumn = *aIter;
|
|
|
|
xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)) >>= nLen;
|
|
|
|
xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
|
|
|
|
}
|
|
|
|
switch(nType)
|
|
|
|
{
|
|
|
|
case DataType::TIMESTAMP:
|
|
|
|
case DataType::DATE:
|
|
|
|
case DataType::TIME:
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2001-07-30 07:53:02 +00:00
|
|
|
try
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
double nRes = m_xNumberFormatter->convertStringToNumber(::com::sun::star::util::NumberFormat::ALL,aStr);
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2001-07-30 07:53:02 +00:00
|
|
|
switch(nType)
|
|
|
|
{
|
|
|
|
case DataType::DATE:
|
2009-04-23 10:42:05 +00:00
|
|
|
*(_rRow->get())[i] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(nRes,m_aNullDate));
|
2001-07-30 07:53:02 +00:00
|
|
|
break;
|
|
|
|
case DataType::TIMESTAMP:
|
2009-04-23 10:42:05 +00:00
|
|
|
*(_rRow->get())[i] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDateTime(nRes,m_aNullDate));
|
2001-07-30 07:53:02 +00:00
|
|
|
break;
|
|
|
|
default:
|
2008-12-30 13:32:01 +00:00
|
|
|
*(_rRow->get())[i] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(nRes));
|
2001-07-30 07:53:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
catch(Exception&)
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2008-12-30 13:32:01 +00:00
|
|
|
(_rRow->get())[i]->setNull();
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
2001-07-30 07:53:02 +00:00
|
|
|
} break;
|
|
|
|
case DataType::DOUBLE:
|
|
|
|
case DataType::INTEGER:
|
2011-02-21 16:14:21 +01:00
|
|
|
case DataType::DECIMAL:
|
2002-10-15 08:12:57 +00:00
|
|
|
case DataType::NUMERIC:
|
2000-10-05 13:47:22 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
|
2002-10-31 13:15:29 +00:00
|
|
|
String aStrConverted;
|
2009-04-23 10:42:05 +00:00
|
|
|
if ( DataType::INTEGER != nType )
|
|
|
|
{
|
|
|
|
sal_Unicode* pData = aStrConverted.AllocBuffer(aStr.Len());
|
|
|
|
const sal_Unicode* pStart = pData;
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2010-11-18 14:36:24 +00:00
|
|
|
OSL_ENSURE((cDecimalDelimiter && nType != DataType::INTEGER) ||
|
|
|
|
(!cDecimalDelimiter && nType == DataType::INTEGER),
|
2009-04-23 10:42:05 +00:00
|
|
|
"FalscherTyp");
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2011-02-21 16:14:21 +01:00
|
|
|
// convert to Standard-Notation (DecimalPOINT without thousands-comma):
|
2009-04-23 10:42:05 +00:00
|
|
|
for (xub_StrLen j = 0; j < aStr.Len(); ++j)
|
2001-07-30 07:53:02 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
const sal_Unicode cChar = aStr.GetChar(j);
|
|
|
|
if (cDecimalDelimiter && cChar == cDecimalDelimiter)
|
|
|
|
*pData++ = '.';
|
|
|
|
//aStrConverted.Append( '.' );
|
|
|
|
else if ( cChar == '.' ) // special case, if decimal seperator isn't '.' we have to put the string after it
|
2011-02-21 16:14:21 +01:00
|
|
|
continue;
|
2009-04-23 10:42:05 +00:00
|
|
|
else if (cThousandDelimiter && cChar == cThousandDelimiter)
|
|
|
|
{
|
2011-02-21 16:14:21 +01:00
|
|
|
// leave out
|
2009-04-23 10:42:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
*pData++ = cChar;
|
|
|
|
//aStrConverted.Append(cChar);
|
|
|
|
} // for (xub_StrLen j = 0; j < aStr.Len(); ++j)
|
|
|
|
aStrConverted.ReleaseBufferAccess(xub_StrLen(pData - pStart));
|
|
|
|
} // if ( DataType::INTEGER != nType )
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( cThousandDelimiter )
|
2011-11-18 21:03:31 +00:00
|
|
|
aStrConverted = comphelper::string::remove(aStr, cThousandDelimiter);
|
|
|
|
else
|
|
|
|
aStrConverted = aStr;
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
2009-04-23 10:42:05 +00:00
|
|
|
const double nVal = ::rtl::math::stringToDouble(aStrConverted,'.',',',NULL,NULL);
|
2002-10-15 08:12:57 +00:00
|
|
|
|
|
|
|
// #99178# OJ
|
|
|
|
if ( DataType::DECIMAL == nType || DataType::NUMERIC == nType )
|
2009-04-23 10:42:05 +00:00
|
|
|
*(_rRow->get())[i] = ::rtl::OUString::valueOf(nVal);
|
2002-10-15 08:12:57 +00:00
|
|
|
else
|
2008-12-30 13:32:01 +00:00
|
|
|
*(_rRow->get())[i] = nVal;
|
2001-07-30 07:53:02 +00:00
|
|
|
} break;
|
2002-10-15 08:12:57 +00:00
|
|
|
|
2001-07-30 07:53:02 +00:00
|
|
|
default:
|
|
|
|
{
|
2011-02-21 16:14:21 +01:00
|
|
|
// Copy Value as String in Row-Variable
|
2008-12-30 13:32:01 +00:00
|
|
|
*(_rRow->get())[i] = ORowSetValue(aStr);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
2001-07-30 07:53:02 +00:00
|
|
|
break;
|
2009-04-23 10:42:05 +00:00
|
|
|
} // switch(nType)
|
|
|
|
(_rRow->get())[i]->setTypeKind(nType);
|
2000-10-05 13:47:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return sal_True;
|
|
|
|
}
|
CWS-TOOLING: integrate CWS dba32e
2009-08-10 13:16:25 +0200 fs r274805 : #i84390# typo corrected
2009-08-10 13:04:28 +0200 fs r274804 : #i103741# properly terminate the last token in a string with a 0 byte
2009-07-24 08:54:05 +0200 msc r274286 : #103219# changed long name
2009-07-24 08:42:28 +0200 msc r274285 : #i79649# changed behaviour of the wizard
2009-07-22 14:17:49 +0200 oj r274238 : GrabFocus
2009-07-22 13:38:01 +0200 oj r274232 : #i102934# mixed up
2009-07-22 13:37:16 +0200 oj r274231 : #i102934# mixed up
2009-07-21 12:30:36 +0200 oj r274176 : crash when using distinct
2009-07-21 10:03:44 +0200 oj r274163 : set last char to 0
2009-07-21 09:31:22 +0200 oj r274161 : mediatype corrected
2009-07-20 11:45:33 +0200 fs r274118 : typo in formatting string
2009-07-20 11:40:39 +0200 fs r274117 : removed unused include
2009-07-20 11:40:01 +0200 fs r274116 : class name corrected
2009-07-16 13:41:45 +0200 oj r274046 : i101587 wrong check for embeddeddatabase url in confguration, have to check path
2009-07-16 13:12:05 +0200 tbo r274044 : #i103219# adjust declarion to new hid.lst
2009-07-16 12:43:48 +0200 oj r274041 : #i102497# check also fot longvarchar
2009-07-16 12:15:41 +0200 oj r274039 : #i103030# handle type description and exceptions as well
2009-07-16 11:14:26 +0200 fs r274035 : let SVN ignore output paths
2009-07-16 09:23:43 +0200 fs r274030 : TransforFormComponentProperties: no need to check for attribute equality
2009-07-10 14:16:23 +0200 oj r273892 : CWS-TOOLING: rebase CWS dba32e to trunk@273858 (milestone: DEV300:m52)
2009-07-01 21:41:50 +0200 fs r273614 : #i10000#
2009-07-01 15:01:10 +0200 fs r273589 : Input required doesn't make sense at all in XML form documents
2009-07-01 12:10:31 +0200 fs r273562 : updated
2009-07-01 11:46:12 +0200 fs r273560 : #i103219# add about 100 missing long names
2009-07-01 10:11:41 +0200 fs r273551 : moved from socket/port usage to pipe/name usage, which is more common nowadays
2009-07-01 09:50:03 +0200 fs r273549 : removed obsolete (empty) folder
2009-07-01 09:47:35 +0200 fs r273548 : copied the code for the Accessibility Workbench herein, formerly located in the old CVS repository, at gsl/awb
2009-06-30 10:07:47 +0200 fs r273493 : merging latest changes from CWS dba32d
2009-06-29 20:46:31 +0200 fs r273482 : #i103138# Rectangle conversions
2009-06-29 10:01:13 +0200 fs r273453 : #i103138#
refactored the code for positioning/zooming the control
Basically, we now allow adjustControlGeometry_throw (formerly known as positionControl_throw and setControlZoom) to
take an additional ViewTransformation parameter, describing the transformation to obtain the actual
control position/size. Consequently, positionControl itself also allows for a ViewTransformation parameter.
This has become necessary since during painting, the device which we created our control for might not necessarily
have a proper MapMode set. In this case, if we would use this map mode for calculating the control's position/size,
this would lead to wrong results.
Note that this problem was introduced by the fix for #i101398#: During the fix, we postponed the control creation
to a later time (when it is really needed). At this later time, the MapMode at the device is broken, at the earlier
time where we formerly crearted the control (createPrimitive2DSequence), it is not yet broken.
Whether or not the MapMode is defined as "broken" might depend on one's point of view, however ...
I consider it broken, since:
- we need the map mode to obtain the proper zoom level, which is to be forwarded to the control
- there are scenarios where the MapMode is *not* set to MAP_PIXEL (in those scenarios, everything works
fine), and there are scenarios where it *is* set to MAP_PIXEL (in those the bug 103138 appears).
It somehow feels wrong that one cannot rely on the device's map mode this way, but on the other hand
one has no possibility to obtain the current zoom by other means.
Note that one issue (still to be submitted) is left: In the page pane of a Draw/Impress document, controls
have a wrong text size. This is because in this pane, the above-mentioned "broken" map mode is used,
which means the controls have a zoom of "1:1" set, which is wrong here.
2009-06-29 09:52:13 +0200 fs r273452 : during #i103138#: belongsToDevice is unused nowadays
2009-06-24 12:40:06 +0200 fs r273329 : #i102888# #i102899#
2009-06-24 12:10:29 +0200 oj r273327 : #i103030# some code changes
2009-06-24 09:44:14 +0200 oj r273311 : #i103030# some code changes
2009-06-24 09:24:42 +0200 oj r273309 : #i103030# add log
2009-06-24 09:03:29 +0200 fs r273308 : if a col's table name is schema.table, properly quote all parts
2009-06-24 08:56:06 +0200 oj r273307 : #i102691# changed string
2009-06-23 13:31:43 +0200 oj r273280 : #i102479# fix date, time and datetime
2009-06-23 12:51:28 +0200 oj r273277 : #i103020# clear old expression when updating to avoid dead pointers in treelist userdata
2009-06-23 12:17:16 +0200 oj r273275 : #i103030# add LogBridge
2009-06-23 11:53:10 +0200 oj r273272 : shawdowed var resolved
2009-06-23 11:48:49 +0200 oj r273270 : #i103030# add :log to uno env if var UNO_ENV_LOG is set
2009-06-23 11:47:47 +0200 oj r273269 : #i103030# add LogBridge
2009-06-23 11:47:11 +0200 oj r273268 : #i103030# add LogBridge
2009-06-23 08:05:08 +0200 oj r273253 : #i102934# add key for collapsing
2009-06-22 13:21:33 +0200 fs r273225 : merging latest changes from CWS dba32d
2009-06-22 13:15:22 +0200 fs r273221 : why restrict to 12 entries?
2009-06-22 08:12:21 +0200 oj r273196 : #i102655# choosen > chosen typo fixed
2009-06-22 08:08:04 +0200 oj r273195 : #i102657# typo fix
2009-06-22 08:06:28 +0200 oj r273194 : #i102934# expanding and collasping of section
2009-06-22 08:05:52 +0200 oj r273193 : #i102930# set focus in treelistbox
2009-06-22 08:04:56 +0200 oj r273192 : #i102929# enable tabstop
2009-06-19 13:18:26 +0200 oj r273157 : remove unused param
2009-06-19 10:07:05 +0200 oj r273149 : CWS-TOOLING: rebase CWS dba32e to trunk@272827 (milestone: DEV300:m50)
2009-06-19 07:32:40 +0200 oj r273146 : merge from dba32d to dba32e
2009-06-19 07:22:56 +0200 oj r273145 : merge from dba32d to dba32e
2009-06-19 07:22:33 +0200 oj r273144 : merge from dba32d to dba32e
2009-06-18 14:09:34 +0200 fs r273116 : merging the latest changes from CWS dba32d (up to revision 273108) herein, which effectively is a rebase to DEV300.m50
2009-06-18 08:50:35 +0200 oj r273098 : #i102894# fix for new line in text
2009-06-18 08:28:48 +0200 oj r273097 : #i102892# check any
2009-06-18 08:21:34 +0200 oj r273096 : check if error is valid
2009-06-16 13:49:28 +0200 fs r273019 : why make a drop down control by default? The form control factory in SVX does this better those days ...
2009-06-10 09:53:20 +0200 oj r272797 : add lic text
2009-06-10 09:48:55 +0200 oj r272796 : test added for i101618
2009-06-09 14:57:39 +0200 oj r272771 : #i101618# access database document only when script container is needed
2009-06-09 12:42:25 +0200 oj r272765 : #i102497# check type property
2009-06-09 12:32:49 +0200 oj r272764 : adjust test cases
2009-06-09 12:31:58 +0200 oj r272763 : adjust test cases
2009-06-09 12:31:22 +0200 oj r272762 : adjust test cases
2009-06-09 11:35:42 +0200 oj r272761 : check if error is valid
2009-06-09 11:29:42 +0200 oj r272760 : #i102497# longvarchar was missing
2009-06-08 14:52:49 +0200 fs r272733 : #i102564# when setting a new field, also set m_nFieldType
2009-06-08 13:51:20 +0200 oj r272730 : add tests
2009-06-05 14:38:01 +0200 oj r272686 : add dep
2009-06-05 14:35:00 +0200 oj r272684 : add new tests
2009-06-05 13:41:18 +0200 oj r272681 : code clean ups
2009-06-05 12:40:51 +0200 oj r272678 : code cleanup
2009-06-05 12:02:57 +0200 oj r272677 : code cleanup
2009-06-05 10:42:38 +0200 oj r272670 : #i49320# impl export of single rows and as RTF and HTML
2009-06-03 14:30:37 +0200 oj r272576 : #i79649# check if file matches filter wildcard
2009-06-03 13:41:57 +0200 oj r272560 : #i102470# impl not b like 'c'
2009-08-26 10:09:17 +00:00
|
|
|
void OFlatTable::refreshHeader()
|
|
|
|
{
|
|
|
|
m_nRowPos = 0;
|
|
|
|
}
|
2001-07-30 07:53:02 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2006-06-20 00:28:52 +00:00
|
|
|
sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos)
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::seekRow" );
|
|
|
|
OSL_ENSURE(m_pFileStream,"OFlatTable::seekRow: FileStream is NULL!");
|
2006-06-20 00:28:52 +00:00
|
|
|
// ----------------------------------------------------------
|
2011-02-21 16:14:21 +01:00
|
|
|
// Prepare positioning:
|
2006-06-20 00:28:52 +00:00
|
|
|
m_nFilePos = nCurPos;
|
2000-10-05 13:47:22 +00:00
|
|
|
|
2006-06-20 00:28:52 +00:00
|
|
|
switch(eCursorPosition)
|
|
|
|
{
|
|
|
|
case IResultSetHelper::FIRST:
|
2009-04-23 10:42:05 +00:00
|
|
|
m_nRowPos = 0;
|
2006-06-20 00:28:52 +00:00
|
|
|
// run through
|
|
|
|
case IResultSetHelper::NEXT:
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
++m_nRowPos;
|
|
|
|
::std::map<sal_Int32,TRowPositionsInFile::iterator>::const_iterator aFind = m_aRowPosToFilePos.find(m_nRowPos);
|
|
|
|
m_bNeedToReadLine = aFind != m_aRowPosToFilePos.end();
|
|
|
|
if ( m_bNeedToReadLine )
|
|
|
|
{
|
|
|
|
m_nFilePos = aFind->second->first;
|
|
|
|
nCurPos = aFind->second->second;
|
|
|
|
} // if ( m_bNeedToReadLine )
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( m_nRowPos == 1 )
|
|
|
|
m_nFilePos = m_nStartRowFilePos;
|
|
|
|
m_pFileStream->Seek(m_nFilePos);
|
|
|
|
if ( m_pFileStream->IsEof() || !readLine(nCurPos) /*|| !checkHeaderLine()*/)
|
|
|
|
{
|
CWS-TOOLING: integrate CWS dba32e
2009-08-10 13:16:25 +0200 fs r274805 : #i84390# typo corrected
2009-08-10 13:04:28 +0200 fs r274804 : #i103741# properly terminate the last token in a string with a 0 byte
2009-07-24 08:54:05 +0200 msc r274286 : #103219# changed long name
2009-07-24 08:42:28 +0200 msc r274285 : #i79649# changed behaviour of the wizard
2009-07-22 14:17:49 +0200 oj r274238 : GrabFocus
2009-07-22 13:38:01 +0200 oj r274232 : #i102934# mixed up
2009-07-22 13:37:16 +0200 oj r274231 : #i102934# mixed up
2009-07-21 12:30:36 +0200 oj r274176 : crash when using distinct
2009-07-21 10:03:44 +0200 oj r274163 : set last char to 0
2009-07-21 09:31:22 +0200 oj r274161 : mediatype corrected
2009-07-20 11:45:33 +0200 fs r274118 : typo in formatting string
2009-07-20 11:40:39 +0200 fs r274117 : removed unused include
2009-07-20 11:40:01 +0200 fs r274116 : class name corrected
2009-07-16 13:41:45 +0200 oj r274046 : i101587 wrong check for embeddeddatabase url in confguration, have to check path
2009-07-16 13:12:05 +0200 tbo r274044 : #i103219# adjust declarion to new hid.lst
2009-07-16 12:43:48 +0200 oj r274041 : #i102497# check also fot longvarchar
2009-07-16 12:15:41 +0200 oj r274039 : #i103030# handle type description and exceptions as well
2009-07-16 11:14:26 +0200 fs r274035 : let SVN ignore output paths
2009-07-16 09:23:43 +0200 fs r274030 : TransforFormComponentProperties: no need to check for attribute equality
2009-07-10 14:16:23 +0200 oj r273892 : CWS-TOOLING: rebase CWS dba32e to trunk@273858 (milestone: DEV300:m52)
2009-07-01 21:41:50 +0200 fs r273614 : #i10000#
2009-07-01 15:01:10 +0200 fs r273589 : Input required doesn't make sense at all in XML form documents
2009-07-01 12:10:31 +0200 fs r273562 : updated
2009-07-01 11:46:12 +0200 fs r273560 : #i103219# add about 100 missing long names
2009-07-01 10:11:41 +0200 fs r273551 : moved from socket/port usage to pipe/name usage, which is more common nowadays
2009-07-01 09:50:03 +0200 fs r273549 : removed obsolete (empty) folder
2009-07-01 09:47:35 +0200 fs r273548 : copied the code for the Accessibility Workbench herein, formerly located in the old CVS repository, at gsl/awb
2009-06-30 10:07:47 +0200 fs r273493 : merging latest changes from CWS dba32d
2009-06-29 20:46:31 +0200 fs r273482 : #i103138# Rectangle conversions
2009-06-29 10:01:13 +0200 fs r273453 : #i103138#
refactored the code for positioning/zooming the control
Basically, we now allow adjustControlGeometry_throw (formerly known as positionControl_throw and setControlZoom) to
take an additional ViewTransformation parameter, describing the transformation to obtain the actual
control position/size. Consequently, positionControl itself also allows for a ViewTransformation parameter.
This has become necessary since during painting, the device which we created our control for might not necessarily
have a proper MapMode set. In this case, if we would use this map mode for calculating the control's position/size,
this would lead to wrong results.
Note that this problem was introduced by the fix for #i101398#: During the fix, we postponed the control creation
to a later time (when it is really needed). At this later time, the MapMode at the device is broken, at the earlier
time where we formerly crearted the control (createPrimitive2DSequence), it is not yet broken.
Whether or not the MapMode is defined as "broken" might depend on one's point of view, however ...
I consider it broken, since:
- we need the map mode to obtain the proper zoom level, which is to be forwarded to the control
- there are scenarios where the MapMode is *not* set to MAP_PIXEL (in those scenarios, everything works
fine), and there are scenarios where it *is* set to MAP_PIXEL (in those the bug 103138 appears).
It somehow feels wrong that one cannot rely on the device's map mode this way, but on the other hand
one has no possibility to obtain the current zoom by other means.
Note that one issue (still to be submitted) is left: In the page pane of a Draw/Impress document, controls
have a wrong text size. This is because in this pane, the above-mentioned "broken" map mode is used,
which means the controls have a zoom of "1:1" set, which is wrong here.
2009-06-29 09:52:13 +0200 fs r273452 : during #i103138#: belongsToDevice is unused nowadays
2009-06-24 12:40:06 +0200 fs r273329 : #i102888# #i102899#
2009-06-24 12:10:29 +0200 oj r273327 : #i103030# some code changes
2009-06-24 09:44:14 +0200 oj r273311 : #i103030# some code changes
2009-06-24 09:24:42 +0200 oj r273309 : #i103030# add log
2009-06-24 09:03:29 +0200 fs r273308 : if a col's table name is schema.table, properly quote all parts
2009-06-24 08:56:06 +0200 oj r273307 : #i102691# changed string
2009-06-23 13:31:43 +0200 oj r273280 : #i102479# fix date, time and datetime
2009-06-23 12:51:28 +0200 oj r273277 : #i103020# clear old expression when updating to avoid dead pointers in treelist userdata
2009-06-23 12:17:16 +0200 oj r273275 : #i103030# add LogBridge
2009-06-23 11:53:10 +0200 oj r273272 : shawdowed var resolved
2009-06-23 11:48:49 +0200 oj r273270 : #i103030# add :log to uno env if var UNO_ENV_LOG is set
2009-06-23 11:47:47 +0200 oj r273269 : #i103030# add LogBridge
2009-06-23 11:47:11 +0200 oj r273268 : #i103030# add LogBridge
2009-06-23 08:05:08 +0200 oj r273253 : #i102934# add key for collapsing
2009-06-22 13:21:33 +0200 fs r273225 : merging latest changes from CWS dba32d
2009-06-22 13:15:22 +0200 fs r273221 : why restrict to 12 entries?
2009-06-22 08:12:21 +0200 oj r273196 : #i102655# choosen > chosen typo fixed
2009-06-22 08:08:04 +0200 oj r273195 : #i102657# typo fix
2009-06-22 08:06:28 +0200 oj r273194 : #i102934# expanding and collasping of section
2009-06-22 08:05:52 +0200 oj r273193 : #i102930# set focus in treelistbox
2009-06-22 08:04:56 +0200 oj r273192 : #i102929# enable tabstop
2009-06-19 13:18:26 +0200 oj r273157 : remove unused param
2009-06-19 10:07:05 +0200 oj r273149 : CWS-TOOLING: rebase CWS dba32e to trunk@272827 (milestone: DEV300:m50)
2009-06-19 07:32:40 +0200 oj r273146 : merge from dba32d to dba32e
2009-06-19 07:22:56 +0200 oj r273145 : merge from dba32d to dba32e
2009-06-19 07:22:33 +0200 oj r273144 : merge from dba32d to dba32e
2009-06-18 14:09:34 +0200 fs r273116 : merging the latest changes from CWS dba32d (up to revision 273108) herein, which effectively is a rebase to DEV300.m50
2009-06-18 08:50:35 +0200 oj r273098 : #i102894# fix for new line in text
2009-06-18 08:28:48 +0200 oj r273097 : #i102892# check any
2009-06-18 08:21:34 +0200 oj r273096 : check if error is valid
2009-06-16 13:49:28 +0200 fs r273019 : why make a drop down control by default? The form control factory in SVX does this better those days ...
2009-06-10 09:53:20 +0200 oj r272797 : add lic text
2009-06-10 09:48:55 +0200 oj r272796 : test added for i101618
2009-06-09 14:57:39 +0200 oj r272771 : #i101618# access database document only when script container is needed
2009-06-09 12:42:25 +0200 oj r272765 : #i102497# check type property
2009-06-09 12:32:49 +0200 oj r272764 : adjust test cases
2009-06-09 12:31:58 +0200 oj r272763 : adjust test cases
2009-06-09 12:31:22 +0200 oj r272762 : adjust test cases
2009-06-09 11:35:42 +0200 oj r272761 : check if error is valid
2009-06-09 11:29:42 +0200 oj r272760 : #i102497# longvarchar was missing
2009-06-08 14:52:49 +0200 fs r272733 : #i102564# when setting a new field, also set m_nFieldType
2009-06-08 13:51:20 +0200 oj r272730 : add tests
2009-06-05 14:38:01 +0200 oj r272686 : add dep
2009-06-05 14:35:00 +0200 oj r272684 : add new tests
2009-06-05 13:41:18 +0200 oj r272681 : code clean ups
2009-06-05 12:40:51 +0200 oj r272678 : code cleanup
2009-06-05 12:02:57 +0200 oj r272677 : code cleanup
2009-06-05 10:42:38 +0200 oj r272670 : #i49320# impl export of single rows and as RTF and HTML
2009-06-03 14:30:37 +0200 oj r272576 : #i79649# check if file matches filter wildcard
2009-06-03 13:41:57 +0200 oj r272560 : #i102470# impl not b like 'c'
2009-08-26 10:09:17 +00:00
|
|
|
m_nMaxRowCount = m_nRowPos -1;
|
2009-04-23 10:42:05 +00:00
|
|
|
return sal_False;
|
|
|
|
} // if ( m_pFileStream->IsEof() || !readLine(nCurPos) /*|| !checkHeaderLine()*/)
|
2006-06-20 00:28:52 +00:00
|
|
|
|
2009-04-23 10:42:05 +00:00
|
|
|
TRowPositionsInFile::iterator aPos = m_aFilePosToEndLinePos.insert(TRowPositionsInFile::value_type(m_nFilePos,nCurPos)).first;
|
|
|
|
m_aRowPosToFilePos.insert(::std::map<sal_Int32,TRowPositionsInFile::iterator>::value_type(m_nRowPos,aPos));
|
|
|
|
}
|
2006-06-20 00:28:52 +00:00
|
|
|
}
|
2008-01-30 06:53:01 +00:00
|
|
|
|
2006-06-20 00:28:52 +00:00
|
|
|
break;
|
|
|
|
case IResultSetHelper::PRIOR:
|
|
|
|
--m_nRowPos;
|
|
|
|
if(m_nRowPos > 0)
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
TRowPositionsInFile::iterator aPositions = m_aRowPosToFilePos[m_nRowPos];
|
|
|
|
m_nFilePos = aPositions->first;
|
|
|
|
nCurPos = aPositions->second;
|
|
|
|
m_bNeedToReadLine = true;
|
2006-06-20 00:28:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
m_nRowPos = 0;
|
|
|
|
|
|
|
|
break;
|
|
|
|
case IResultSetHelper::LAST:
|
2009-04-23 10:42:05 +00:00
|
|
|
if ( m_nMaxRowCount )
|
2006-06-20 00:28:52 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
::std::map<sal_Int32,TRowPositionsInFile::iterator>::reverse_iterator aLastPos = m_aRowPosToFilePos.rbegin();
|
|
|
|
m_nRowPos = aLastPos->first;
|
|
|
|
m_nFilePos = aLastPos->second->first;
|
|
|
|
nCurPos = aLastPos->second->second;
|
|
|
|
|
|
|
|
//m_pFileStream->Seek(m_nFilePos);
|
|
|
|
m_bNeedToReadLine = true;
|
|
|
|
//if ( m_pFileStream->IsEof() /*|| !checkHeaderLine()*/ || !readLine(nCurPos) )
|
|
|
|
// return sal_False;
|
2006-06-20 00:28:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while(seekRow(IResultSetHelper::NEXT,1,nCurPos)) ; // run through after last row
|
|
|
|
// now I know all
|
|
|
|
seekRow(IResultSetHelper::PRIOR,1,nCurPos);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IResultSetHelper::RELATIVE:
|
|
|
|
if(nOffset > 0)
|
|
|
|
{
|
|
|
|
for(sal_Int32 i = 0;i<nOffset;++i)
|
|
|
|
seekRow(IResultSetHelper::NEXT,1,nCurPos);
|
|
|
|
}
|
|
|
|
else if(nOffset < 0)
|
|
|
|
{
|
|
|
|
for(sal_Int32 i = nOffset;i;++i)
|
|
|
|
seekRow(IResultSetHelper::PRIOR,1,nCurPos);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IResultSetHelper::ABSOLUTE:
|
|
|
|
{
|
|
|
|
if(nOffset < 0)
|
|
|
|
nOffset = m_nRowPos + nOffset;
|
2009-04-23 10:42:05 +00:00
|
|
|
::std::map<sal_Int32,TRowPositionsInFile::iterator>::const_iterator aIter = m_aRowPosToFilePos.find(nOffset);
|
|
|
|
if(aIter != m_aRowPosToFilePos.end())
|
2006-06-20 00:28:52 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
m_nFilePos = aIter->second->first;
|
|
|
|
nCurPos = aIter->second->second;
|
|
|
|
//m_pFileStream->Seek(m_nFilePos);
|
|
|
|
m_bNeedToReadLine = true;
|
|
|
|
//if ( m_pFileStream->IsEof() /*|| !checkHeaderLine()*/ || !readLine(nCurPos) )
|
|
|
|
// return sal_False;
|
2006-06-20 00:28:52 +00:00
|
|
|
}
|
|
|
|
else if(m_nMaxRowCount && nOffset > m_nMaxRowCount) // offset is outside the table
|
|
|
|
{
|
|
|
|
m_nRowPos = m_nMaxRowCount;
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
aIter = m_aRowPosToFilePos.upper_bound(nOffset);
|
|
|
|
if(aIter == m_aRowPosToFilePos.end())
|
2006-06-20 00:28:52 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
::std::map<sal_Int32,TRowPositionsInFile::iterator>::reverse_iterator aLastPos = m_aRowPosToFilePos.rbegin();
|
|
|
|
m_nRowPos = aLastPos->first;
|
|
|
|
nCurPos = m_nFilePos = aLastPos->second->first;
|
2006-06-20 00:28:52 +00:00
|
|
|
while(m_nRowPos != nOffset)
|
|
|
|
seekRow(IResultSetHelper::NEXT,1,nCurPos);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
--aIter;
|
|
|
|
m_nRowPos = aIter->first;
|
2009-04-23 10:42:05 +00:00
|
|
|
m_nFilePos = aIter->second->first;
|
|
|
|
nCurPos = aIter->second->second;
|
|
|
|
//m_pFileStream->Seek(m_nFilePos);
|
|
|
|
m_bNeedToReadLine = true;
|
|
|
|
//if ( m_pFileStream->IsEof() /*|| !checkHeaderLine()*/ || !readLine(nCurPos) )
|
|
|
|
// return sal_False;
|
2006-06-20 00:28:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
case IResultSetHelper::BOOKMARK:
|
2009-04-23 10:42:05 +00:00
|
|
|
{
|
|
|
|
TRowPositionsInFile::const_iterator aFind = m_aFilePosToEndLinePos.find(nOffset);
|
|
|
|
m_bNeedToReadLine = aFind != m_aFilePosToEndLinePos.end();
|
|
|
|
if ( m_bNeedToReadLine )
|
CWS-TOOLING: integrate CWS dba32e
2009-08-10 13:16:25 +0200 fs r274805 : #i84390# typo corrected
2009-08-10 13:04:28 +0200 fs r274804 : #i103741# properly terminate the last token in a string with a 0 byte
2009-07-24 08:54:05 +0200 msc r274286 : #103219# changed long name
2009-07-24 08:42:28 +0200 msc r274285 : #i79649# changed behaviour of the wizard
2009-07-22 14:17:49 +0200 oj r274238 : GrabFocus
2009-07-22 13:38:01 +0200 oj r274232 : #i102934# mixed up
2009-07-22 13:37:16 +0200 oj r274231 : #i102934# mixed up
2009-07-21 12:30:36 +0200 oj r274176 : crash when using distinct
2009-07-21 10:03:44 +0200 oj r274163 : set last char to 0
2009-07-21 09:31:22 +0200 oj r274161 : mediatype corrected
2009-07-20 11:45:33 +0200 fs r274118 : typo in formatting string
2009-07-20 11:40:39 +0200 fs r274117 : removed unused include
2009-07-20 11:40:01 +0200 fs r274116 : class name corrected
2009-07-16 13:41:45 +0200 oj r274046 : i101587 wrong check for embeddeddatabase url in confguration, have to check path
2009-07-16 13:12:05 +0200 tbo r274044 : #i103219# adjust declarion to new hid.lst
2009-07-16 12:43:48 +0200 oj r274041 : #i102497# check also fot longvarchar
2009-07-16 12:15:41 +0200 oj r274039 : #i103030# handle type description and exceptions as well
2009-07-16 11:14:26 +0200 fs r274035 : let SVN ignore output paths
2009-07-16 09:23:43 +0200 fs r274030 : TransforFormComponentProperties: no need to check for attribute equality
2009-07-10 14:16:23 +0200 oj r273892 : CWS-TOOLING: rebase CWS dba32e to trunk@273858 (milestone: DEV300:m52)
2009-07-01 21:41:50 +0200 fs r273614 : #i10000#
2009-07-01 15:01:10 +0200 fs r273589 : Input required doesn't make sense at all in XML form documents
2009-07-01 12:10:31 +0200 fs r273562 : updated
2009-07-01 11:46:12 +0200 fs r273560 : #i103219# add about 100 missing long names
2009-07-01 10:11:41 +0200 fs r273551 : moved from socket/port usage to pipe/name usage, which is more common nowadays
2009-07-01 09:50:03 +0200 fs r273549 : removed obsolete (empty) folder
2009-07-01 09:47:35 +0200 fs r273548 : copied the code for the Accessibility Workbench herein, formerly located in the old CVS repository, at gsl/awb
2009-06-30 10:07:47 +0200 fs r273493 : merging latest changes from CWS dba32d
2009-06-29 20:46:31 +0200 fs r273482 : #i103138# Rectangle conversions
2009-06-29 10:01:13 +0200 fs r273453 : #i103138#
refactored the code for positioning/zooming the control
Basically, we now allow adjustControlGeometry_throw (formerly known as positionControl_throw and setControlZoom) to
take an additional ViewTransformation parameter, describing the transformation to obtain the actual
control position/size. Consequently, positionControl itself also allows for a ViewTransformation parameter.
This has become necessary since during painting, the device which we created our control for might not necessarily
have a proper MapMode set. In this case, if we would use this map mode for calculating the control's position/size,
this would lead to wrong results.
Note that this problem was introduced by the fix for #i101398#: During the fix, we postponed the control creation
to a later time (when it is really needed). At this later time, the MapMode at the device is broken, at the earlier
time where we formerly crearted the control (createPrimitive2DSequence), it is not yet broken.
Whether or not the MapMode is defined as "broken" might depend on one's point of view, however ...
I consider it broken, since:
- we need the map mode to obtain the proper zoom level, which is to be forwarded to the control
- there are scenarios where the MapMode is *not* set to MAP_PIXEL (in those scenarios, everything works
fine), and there are scenarios where it *is* set to MAP_PIXEL (in those the bug 103138 appears).
It somehow feels wrong that one cannot rely on the device's map mode this way, but on the other hand
one has no possibility to obtain the current zoom by other means.
Note that one issue (still to be submitted) is left: In the page pane of a Draw/Impress document, controls
have a wrong text size. This is because in this pane, the above-mentioned "broken" map mode is used,
which means the controls have a zoom of "1:1" set, which is wrong here.
2009-06-29 09:52:13 +0200 fs r273452 : during #i103138#: belongsToDevice is unused nowadays
2009-06-24 12:40:06 +0200 fs r273329 : #i102888# #i102899#
2009-06-24 12:10:29 +0200 oj r273327 : #i103030# some code changes
2009-06-24 09:44:14 +0200 oj r273311 : #i103030# some code changes
2009-06-24 09:24:42 +0200 oj r273309 : #i103030# add log
2009-06-24 09:03:29 +0200 fs r273308 : if a col's table name is schema.table, properly quote all parts
2009-06-24 08:56:06 +0200 oj r273307 : #i102691# changed string
2009-06-23 13:31:43 +0200 oj r273280 : #i102479# fix date, time and datetime
2009-06-23 12:51:28 +0200 oj r273277 : #i103020# clear old expression when updating to avoid dead pointers in treelist userdata
2009-06-23 12:17:16 +0200 oj r273275 : #i103030# add LogBridge
2009-06-23 11:53:10 +0200 oj r273272 : shawdowed var resolved
2009-06-23 11:48:49 +0200 oj r273270 : #i103030# add :log to uno env if var UNO_ENV_LOG is set
2009-06-23 11:47:47 +0200 oj r273269 : #i103030# add LogBridge
2009-06-23 11:47:11 +0200 oj r273268 : #i103030# add LogBridge
2009-06-23 08:05:08 +0200 oj r273253 : #i102934# add key for collapsing
2009-06-22 13:21:33 +0200 fs r273225 : merging latest changes from CWS dba32d
2009-06-22 13:15:22 +0200 fs r273221 : why restrict to 12 entries?
2009-06-22 08:12:21 +0200 oj r273196 : #i102655# choosen > chosen typo fixed
2009-06-22 08:08:04 +0200 oj r273195 : #i102657# typo fix
2009-06-22 08:06:28 +0200 oj r273194 : #i102934# expanding and collasping of section
2009-06-22 08:05:52 +0200 oj r273193 : #i102930# set focus in treelistbox
2009-06-22 08:04:56 +0200 oj r273192 : #i102929# enable tabstop
2009-06-19 13:18:26 +0200 oj r273157 : remove unused param
2009-06-19 10:07:05 +0200 oj r273149 : CWS-TOOLING: rebase CWS dba32e to trunk@272827 (milestone: DEV300:m50)
2009-06-19 07:32:40 +0200 oj r273146 : merge from dba32d to dba32e
2009-06-19 07:22:56 +0200 oj r273145 : merge from dba32d to dba32e
2009-06-19 07:22:33 +0200 oj r273144 : merge from dba32d to dba32e
2009-06-18 14:09:34 +0200 fs r273116 : merging the latest changes from CWS dba32d (up to revision 273108) herein, which effectively is a rebase to DEV300.m50
2009-06-18 08:50:35 +0200 oj r273098 : #i102894# fix for new line in text
2009-06-18 08:28:48 +0200 oj r273097 : #i102892# check any
2009-06-18 08:21:34 +0200 oj r273096 : check if error is valid
2009-06-16 13:49:28 +0200 fs r273019 : why make a drop down control by default? The form control factory in SVX does this better those days ...
2009-06-10 09:53:20 +0200 oj r272797 : add lic text
2009-06-10 09:48:55 +0200 oj r272796 : test added for i101618
2009-06-09 14:57:39 +0200 oj r272771 : #i101618# access database document only when script container is needed
2009-06-09 12:42:25 +0200 oj r272765 : #i102497# check type property
2009-06-09 12:32:49 +0200 oj r272764 : adjust test cases
2009-06-09 12:31:58 +0200 oj r272763 : adjust test cases
2009-06-09 12:31:22 +0200 oj r272762 : adjust test cases
2009-06-09 11:35:42 +0200 oj r272761 : check if error is valid
2009-06-09 11:29:42 +0200 oj r272760 : #i102497# longvarchar was missing
2009-06-08 14:52:49 +0200 fs r272733 : #i102564# when setting a new field, also set m_nFieldType
2009-06-08 13:51:20 +0200 oj r272730 : add tests
2009-06-05 14:38:01 +0200 oj r272686 : add dep
2009-06-05 14:35:00 +0200 oj r272684 : add new tests
2009-06-05 13:41:18 +0200 oj r272681 : code clean ups
2009-06-05 12:40:51 +0200 oj r272678 : code cleanup
2009-06-05 12:02:57 +0200 oj r272677 : code cleanup
2009-06-05 10:42:38 +0200 oj r272670 : #i49320# impl export of single rows and as RTF and HTML
2009-06-03 14:30:37 +0200 oj r272576 : #i79649# check if file matches filter wildcard
2009-06-03 13:41:57 +0200 oj r272560 : #i102470# impl not b like 'c'
2009-08-26 10:09:17 +00:00
|
|
|
{
|
|
|
|
m_nFilePos = aFind->first;
|
2009-04-23 10:42:05 +00:00
|
|
|
nCurPos = aFind->second;
|
CWS-TOOLING: integrate CWS dba32e
2009-08-10 13:16:25 +0200 fs r274805 : #i84390# typo corrected
2009-08-10 13:04:28 +0200 fs r274804 : #i103741# properly terminate the last token in a string with a 0 byte
2009-07-24 08:54:05 +0200 msc r274286 : #103219# changed long name
2009-07-24 08:42:28 +0200 msc r274285 : #i79649# changed behaviour of the wizard
2009-07-22 14:17:49 +0200 oj r274238 : GrabFocus
2009-07-22 13:38:01 +0200 oj r274232 : #i102934# mixed up
2009-07-22 13:37:16 +0200 oj r274231 : #i102934# mixed up
2009-07-21 12:30:36 +0200 oj r274176 : crash when using distinct
2009-07-21 10:03:44 +0200 oj r274163 : set last char to 0
2009-07-21 09:31:22 +0200 oj r274161 : mediatype corrected
2009-07-20 11:45:33 +0200 fs r274118 : typo in formatting string
2009-07-20 11:40:39 +0200 fs r274117 : removed unused include
2009-07-20 11:40:01 +0200 fs r274116 : class name corrected
2009-07-16 13:41:45 +0200 oj r274046 : i101587 wrong check for embeddeddatabase url in confguration, have to check path
2009-07-16 13:12:05 +0200 tbo r274044 : #i103219# adjust declarion to new hid.lst
2009-07-16 12:43:48 +0200 oj r274041 : #i102497# check also fot longvarchar
2009-07-16 12:15:41 +0200 oj r274039 : #i103030# handle type description and exceptions as well
2009-07-16 11:14:26 +0200 fs r274035 : let SVN ignore output paths
2009-07-16 09:23:43 +0200 fs r274030 : TransforFormComponentProperties: no need to check for attribute equality
2009-07-10 14:16:23 +0200 oj r273892 : CWS-TOOLING: rebase CWS dba32e to trunk@273858 (milestone: DEV300:m52)
2009-07-01 21:41:50 +0200 fs r273614 : #i10000#
2009-07-01 15:01:10 +0200 fs r273589 : Input required doesn't make sense at all in XML form documents
2009-07-01 12:10:31 +0200 fs r273562 : updated
2009-07-01 11:46:12 +0200 fs r273560 : #i103219# add about 100 missing long names
2009-07-01 10:11:41 +0200 fs r273551 : moved from socket/port usage to pipe/name usage, which is more common nowadays
2009-07-01 09:50:03 +0200 fs r273549 : removed obsolete (empty) folder
2009-07-01 09:47:35 +0200 fs r273548 : copied the code for the Accessibility Workbench herein, formerly located in the old CVS repository, at gsl/awb
2009-06-30 10:07:47 +0200 fs r273493 : merging latest changes from CWS dba32d
2009-06-29 20:46:31 +0200 fs r273482 : #i103138# Rectangle conversions
2009-06-29 10:01:13 +0200 fs r273453 : #i103138#
refactored the code for positioning/zooming the control
Basically, we now allow adjustControlGeometry_throw (formerly known as positionControl_throw and setControlZoom) to
take an additional ViewTransformation parameter, describing the transformation to obtain the actual
control position/size. Consequently, positionControl itself also allows for a ViewTransformation parameter.
This has become necessary since during painting, the device which we created our control for might not necessarily
have a proper MapMode set. In this case, if we would use this map mode for calculating the control's position/size,
this would lead to wrong results.
Note that this problem was introduced by the fix for #i101398#: During the fix, we postponed the control creation
to a later time (when it is really needed). At this later time, the MapMode at the device is broken, at the earlier
time where we formerly crearted the control (createPrimitive2DSequence), it is not yet broken.
Whether or not the MapMode is defined as "broken" might depend on one's point of view, however ...
I consider it broken, since:
- we need the map mode to obtain the proper zoom level, which is to be forwarded to the control
- there are scenarios where the MapMode is *not* set to MAP_PIXEL (in those scenarios, everything works
fine), and there are scenarios where it *is* set to MAP_PIXEL (in those the bug 103138 appears).
It somehow feels wrong that one cannot rely on the device's map mode this way, but on the other hand
one has no possibility to obtain the current zoom by other means.
Note that one issue (still to be submitted) is left: In the page pane of a Draw/Impress document, controls
have a wrong text size. This is because in this pane, the above-mentioned "broken" map mode is used,
which means the controls have a zoom of "1:1" set, which is wrong here.
2009-06-29 09:52:13 +0200 fs r273452 : during #i103138#: belongsToDevice is unused nowadays
2009-06-24 12:40:06 +0200 fs r273329 : #i102888# #i102899#
2009-06-24 12:10:29 +0200 oj r273327 : #i103030# some code changes
2009-06-24 09:44:14 +0200 oj r273311 : #i103030# some code changes
2009-06-24 09:24:42 +0200 oj r273309 : #i103030# add log
2009-06-24 09:03:29 +0200 fs r273308 : if a col's table name is schema.table, properly quote all parts
2009-06-24 08:56:06 +0200 oj r273307 : #i102691# changed string
2009-06-23 13:31:43 +0200 oj r273280 : #i102479# fix date, time and datetime
2009-06-23 12:51:28 +0200 oj r273277 : #i103020# clear old expression when updating to avoid dead pointers in treelist userdata
2009-06-23 12:17:16 +0200 oj r273275 : #i103030# add LogBridge
2009-06-23 11:53:10 +0200 oj r273272 : shawdowed var resolved
2009-06-23 11:48:49 +0200 oj r273270 : #i103030# add :log to uno env if var UNO_ENV_LOG is set
2009-06-23 11:47:47 +0200 oj r273269 : #i103030# add LogBridge
2009-06-23 11:47:11 +0200 oj r273268 : #i103030# add LogBridge
2009-06-23 08:05:08 +0200 oj r273253 : #i102934# add key for collapsing
2009-06-22 13:21:33 +0200 fs r273225 : merging latest changes from CWS dba32d
2009-06-22 13:15:22 +0200 fs r273221 : why restrict to 12 entries?
2009-06-22 08:12:21 +0200 oj r273196 : #i102655# choosen > chosen typo fixed
2009-06-22 08:08:04 +0200 oj r273195 : #i102657# typo fix
2009-06-22 08:06:28 +0200 oj r273194 : #i102934# expanding and collasping of section
2009-06-22 08:05:52 +0200 oj r273193 : #i102930# set focus in treelistbox
2009-06-22 08:04:56 +0200 oj r273192 : #i102929# enable tabstop
2009-06-19 13:18:26 +0200 oj r273157 : remove unused param
2009-06-19 10:07:05 +0200 oj r273149 : CWS-TOOLING: rebase CWS dba32e to trunk@272827 (milestone: DEV300:m50)
2009-06-19 07:32:40 +0200 oj r273146 : merge from dba32d to dba32e
2009-06-19 07:22:56 +0200 oj r273145 : merge from dba32d to dba32e
2009-06-19 07:22:33 +0200 oj r273144 : merge from dba32d to dba32e
2009-06-18 14:09:34 +0200 fs r273116 : merging the latest changes from CWS dba32d (up to revision 273108) herein, which effectively is a rebase to DEV300.m50
2009-06-18 08:50:35 +0200 oj r273098 : #i102894# fix for new line in text
2009-06-18 08:28:48 +0200 oj r273097 : #i102892# check any
2009-06-18 08:21:34 +0200 oj r273096 : check if error is valid
2009-06-16 13:49:28 +0200 fs r273019 : why make a drop down control by default? The form control factory in SVX does this better those days ...
2009-06-10 09:53:20 +0200 oj r272797 : add lic text
2009-06-10 09:48:55 +0200 oj r272796 : test added for i101618
2009-06-09 14:57:39 +0200 oj r272771 : #i101618# access database document only when script container is needed
2009-06-09 12:42:25 +0200 oj r272765 : #i102497# check type property
2009-06-09 12:32:49 +0200 oj r272764 : adjust test cases
2009-06-09 12:31:58 +0200 oj r272763 : adjust test cases
2009-06-09 12:31:22 +0200 oj r272762 : adjust test cases
2009-06-09 11:35:42 +0200 oj r272761 : check if error is valid
2009-06-09 11:29:42 +0200 oj r272760 : #i102497# longvarchar was missing
2009-06-08 14:52:49 +0200 fs r272733 : #i102564# when setting a new field, also set m_nFieldType
2009-06-08 13:51:20 +0200 oj r272730 : add tests
2009-06-05 14:38:01 +0200 oj r272686 : add dep
2009-06-05 14:35:00 +0200 oj r272684 : add new tests
2009-06-05 13:41:18 +0200 oj r272681 : code clean ups
2009-06-05 12:40:51 +0200 oj r272678 : code cleanup
2009-06-05 12:02:57 +0200 oj r272677 : code cleanup
2009-06-05 10:42:38 +0200 oj r272670 : #i49320# impl export of single rows and as RTF and HTML
2009-06-03 14:30:37 +0200 oj r272576 : #i79649# check if file matches filter wildcard
2009-06-03 13:41:57 +0200 oj r272560 : #i102470# impl not b like 'c'
2009-08-26 10:09:17 +00:00
|
|
|
}
|
2009-04-23 10:42:05 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
m_nFilePos = nOffset;
|
|
|
|
m_pFileStream->Seek(nOffset);
|
|
|
|
if (m_pFileStream->IsEof() || !readLine(nCurPos) )
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2006-06-20 00:28:52 +00:00
|
|
|
}
|
|
|
|
|
2009-04-23 10:42:05 +00:00
|
|
|
//nCurPos = m_nFilePos;
|
2006-06-20 00:28:52 +00:00
|
|
|
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-01-30 06:53:01 +00:00
|
|
|
sal_Bool OFlatTable::readLine(sal_Int32& _rnCurrentPos)
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::readLine" );
|
|
|
|
const rtl_TextEncoding nEncoding = m_pConnection->getTextEncoding();
|
|
|
|
m_pFileStream->ReadByteStringLine(m_aCurrentLine,nEncoding);
|
2008-01-30 06:53:01 +00:00
|
|
|
if (m_pFileStream->IsEof())
|
|
|
|
return sal_False;
|
|
|
|
|
2009-04-23 10:42:05 +00:00
|
|
|
QuotedTokenizedString sLine = m_aCurrentLine; // check if the string continues on next line
|
2012-01-02 10:55:27 +00:00
|
|
|
while( (comphelper::string::getTokenCount(sLine.GetString(), m_cStringDelimiter) % 2) != 1 )
|
2008-01-30 06:53:01 +00:00
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
m_pFileStream->ReadByteStringLine(sLine,nEncoding);
|
2008-01-30 06:53:01 +00:00
|
|
|
if ( !m_pFileStream->IsEof() )
|
|
|
|
{
|
2009-04-23 10:42:05 +00:00
|
|
|
m_aCurrentLine.GetString().Append('\n');
|
|
|
|
m_aCurrentLine.GetString() += sLine.GetString();
|
2008-01-30 06:53:01 +00:00
|
|
|
sLine = m_aCurrentLine;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
_rnCurrentPos = m_pFileStream->Tell();
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|