Cleaned up ScImportParam.

This commit is contained in:
Kohei Yoshida 2011-05-10 11:57:13 -04:00
parent eac91db8a2
commit d79960037e
6 changed files with 27 additions and 27 deletions

View file

@ -422,19 +422,19 @@ struct ScImportParam
SCROW nRow1;
SCCOL nCol2;
SCROW nRow2;
sal_Bool bImport;
String aDBName; // alias of data base
String aStatement;
sal_Bool bNative;
sal_Bool bSql; // statement or name?
sal_uInt8 nType; // enum DBObject
bool bImport;
::rtl::OUString aDBName; // alias of data base
::rtl::OUString aStatement;
bool bNative;
bool bSql; // statement or name?
sal_uInt8 nType; // enum DBObject
ScImportParam();
ScImportParam( const ScImportParam& r );
~ScImportParam();
ScImportParam& operator= ( const ScImportParam& r );
sal_Bool operator== ( const ScImportParam& r ) const;
bool operator== ( const ScImportParam& r ) const;
};
struct ScStringHashCode

View file

@ -67,7 +67,7 @@ ScImportParam::ScImportParam() :
nRow2(0),
bImport(false),
bNative(false),
bSql(sal_True),
bSql(true),
nType(ScDbTable)
{
}
@ -106,7 +106,7 @@ ScImportParam& ScImportParam::operator=( const ScImportParam& r )
return *this;
}
sal_Bool ScImportParam::operator==( const ScImportParam& rOther ) const
bool ScImportParam::operator==( const ScImportParam& rOther ) const
{
return( nCol1 == rOther.nCol1 &&
nRow1 == rOther.nRow1 &&

View file

@ -1501,7 +1501,7 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
aImportParam.aStatement = bSql ? rStatement : rTableName;
aImportParam.bNative = bNative;
aImportParam.nType = nType;
aImportParam.bImport = sal_True;
aImportParam.bImport = true;
sal_Bool bContinue = DoImport( nTab, aImportParam, xResultSet, pSelection, sal_True );
// DB-Operationen wiederholen

View file

@ -104,8 +104,8 @@ void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFram
sdb::CommandType::TABLE );
::svx::ODataAccessDescriptor aSelection;
aSelection.setDataSource(rtl::OUString( rParam.aDBName ));
aSelection[svx::daCommand] <<= rtl::OUString( rParam.aStatement );
aSelection.setDataSource(rParam.aDBName);
aSelection[svx::daCommand] <<= rParam.aStatement;
aSelection[svx::daCommandType] <<= nType;
xControllerSelection->select(uno::makeAny(aSelection.createPropertyValueSequence()));
@ -127,7 +127,7 @@ sal_Bool ScDBDocFunc::DoImportUno( const ScAddress& rPos,
ScImportParam aImParam;
aImParam.nCol1 = aImParam.nCol2 = rPos.Col();
aImParam.nRow1 = aImParam.nRow2 = rPos.Row();
aImParam.bImport = sal_True;
aImParam.bImport = true;
uno::Reference<sdbc::XResultSet> xResSet;
uno::Sequence<uno::Any> aSelection;
@ -303,11 +303,11 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
sdb::CommandType::TABLE );
uno::Any aAny;
aAny <<= rtl::OUString( rParam.aDBName );
aAny <<= rParam.aDBName;
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_DATASOURCENAME)), aAny );
aAny <<= rtl::OUString( rParam.aStatement );
aAny <<= rParam.aStatement;
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMAND)), aAny );

View file

@ -232,19 +232,19 @@ void ScImportDescriptor::FillProperties( uno::Sequence<beans::PropertyValue>& rS
if (aDescriptor.has( svx::daDataSource ))
{
pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_DBNAME ));
pArray[0].Value <<= rtl::OUString( rParam.aDBName );
pArray[0].Value <<= rParam.aDBName;
}
else if (aDescriptor.has( svx::daConnectionResource ))
{
pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CONRES ));
pArray[0].Value <<= rtl::OUString( rParam.aDBName );
pArray[0].Value <<= rParam.aDBName;
}
pArray[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SRCTYPE ));
pArray[1].Value <<= eMode;
pArray[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SRCOBJ ));
pArray[2].Value <<= rtl::OUString( rParam.aStatement );
pArray[2].Value <<= rParam.aStatement;
pArray[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ISNATIVE ));
ScUnoHelpFunctions::SetBoolInAny( pArray[3].Value, rParam.bNative );
@ -265,17 +265,17 @@ void ScImportDescriptor::FillImportParam( ScImportParam& rParam, const uno::Sequ
else if (aPropName.EqualsAscii( SC_UNONAME_DBNAME ))
{
if ( rProp.Value >>= aStrVal )
rParam.aDBName = String( aStrVal );
rParam.aDBName = aStrVal;
}
else if (aPropName.EqualsAscii( SC_UNONAME_CONRES ))
{
if ( rProp.Value >>= aStrVal )
rParam.aDBName = String( aStrVal );
rParam.aDBName = aStrVal;
}
else if (aPropName.EqualsAscii( SC_UNONAME_SRCOBJ ))
{
if ( rProp.Value >>= aStrVal )
rParam.aStatement = String( aStrVal );
rParam.aStatement = aStrVal;
}
else if (aPropName.EqualsAscii( SC_UNONAME_SRCTYPE ))
{
@ -288,16 +288,16 @@ void ScImportDescriptor::FillImportParam( ScImportParam& rParam, const uno::Sequ
rParam.bImport = false;
break;
case sheet::DataImportMode_SQL:
rParam.bImport = sal_True;
rParam.bSql = sal_True;
rParam.bImport = true;
rParam.bSql = true;
break;
case sheet::DataImportMode_TABLE:
rParam.bImport = sal_True;
rParam.bImport = true;
rParam.bSql = false;
rParam.nType = ScDbTable;
break;
case sheet::DataImportMode_QUERY:
rParam.bImport = sal_True;
rParam.bImport = true;
rParam.bSql = false;
rParam.nType = ScDbQuery;
break;

View file

@ -276,8 +276,8 @@ void lcl_FillDataSource( frame::FeatureStateEvent& rEvent, const ScImportParam&
( (rParam.nType == ScDbQuery) ? sdb::CommandType::QUERY :
sdb::CommandType::TABLE );
aDescriptor.setDataSource(rtl::OUString( rParam.aDBName ));
aDescriptor[svx::daCommand] <<= rtl::OUString( rParam.aStatement );
aDescriptor.setDataSource(rParam.aDBName);
aDescriptor[svx::daCommand] <<= rParam.aStatement;
aDescriptor[svx::daCommandType] <<= nType;
}
else