summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-01-11 14:16:30 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-01-11 14:16:30 +0100
commitab2f60d4e1f95a2a19308c84160de3abdae4a452 (patch)
treed1b886caa1343adef43334462bb2394be77a4aba
parentb808bcd158de73623144e9dac18f39e6ec0b9bf0 (diff)
parenta154c25b688122c405e10bcc40684cc091af0690 (diff)
Automated merge with ssh://hg@hg.services.openoffice.org/cws/dba33b
-rw-r--r--connectivity/source/commontools/FValue.cxx2
-rw-r--r--connectivity/source/commontools/dbtools.cxx53
-rw-r--r--connectivity/source/drivers/jdbc/tools.cxx2
-rw-r--r--connectivity/source/parse/PColumn.cxx3
-rw-r--r--connectivity/source/parse/sqlnode.cxx2
-rw-r--r--svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx1
6 files changed, 39 insertions, 24 deletions
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 0a1cb572c522..b3254a0165a8 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -1955,7 +1955,7 @@ namespace detail
virtual Reference< XInputStream > getCharacterStream() const { return m_xRow->getCharacterStream( m_nPos ); };
virtual Reference< XBlob > getBlob() const { return m_xRow->getBlob( m_nPos ); };
virtual Reference< XClob > getClob() const { return m_xRow->getClob( m_nPos ); };
- virtual Any getObject() const { return m_xRow->getObject( m_nPos, NULL ); };
+ virtual Any getObject() const { return m_xRow->getObject( m_nPos ,NULL); };
virtual sal_Bool wasNull() const { return m_xRow->wasNull( ); };
private:
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index f00cfe14a9e5..79f9f9707c26 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1388,16 +1388,18 @@ namespace
::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
Reference< XPropertySetInfo > xInfo = _xTable->getPropertySetInfo();
if ( xInfo.is()
- && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME))
- && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME))
&& xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) )
{
::rtl::OUString aCatalog;
::rtl::OUString aSchema;
::rtl::OUString aTable;
- _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) >>= _out_rCatalog;
- _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= _out_rSchema;
+ if ( xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME))
+ && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) )
+ {
+ _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) >>= _out_rCatalog;
+ _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= _out_rSchema;
+ }
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= _out_rName;
}
else
@@ -1779,15 +1781,31 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer,
Reference<XIndexAccess> xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference<XIndexAccess>();
Reference<XNameAccess> xParamsAsNames(xParamsAsIndicies, UNO_QUERY);
sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0;
- if ( (nParamCount && _aParametersSet.empty()) || ::std::count(_aParametersSet.begin(),_aParametersSet.end(),true) != nParamCount )
+ ::std::bit_vector aNewParameterSet( _aParametersSet );
+ if ( nParamCount || ::std::count(aNewParameterSet.begin(),aNewParameterSet.end(),true) != nParamCount )
{
+ static const ::rtl::OUString PROPERTY_NAME(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME));
+ aNewParameterSet.resize(nParamCount ,false);
+ typedef ::std::map< ::rtl::OUString, ::std::vector<sal_Int32> > TParameterPositions;
+ TParameterPositions aParameterNames;
+ for(sal_Int32 i = 0; i < nParamCount; ++i)
+ {
+ Reference<XPropertySet> xParam(xParamsAsIndicies->getByIndex(i),UNO_QUERY);
+ ::rtl::OUString sName;
+ xParam->getPropertyValue(PROPERTY_NAME) >>= sName;
+
+ TParameterPositions::iterator aFind = aParameterNames.find(sName);
+ if ( aFind != aParameterNames.end() )
+ aNewParameterSet[i] = true;
+ aParameterNames[sName].push_back(i+1);
+ }
// build an interaction request
// two continuations (Ok and Cancel)
OInteractionAbort* pAbort = new OInteractionAbort;
OParameterContinuation* pParams = new OParameterContinuation;
// the request
ParametersRequest aRequest;
- Reference<XIndexAccess> xWrappedParameters = new OParameterWrapper(_aParametersSet,xParamsAsIndicies);
+ Reference<XIndexAccess> xWrappedParameters = new OParameterWrapper(aNewParameterSet,xParamsAsIndicies);
aRequest.Parameters = xWrappedParameters;
aRequest.Connection = _xConnection;
OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest));
@@ -1815,11 +1833,10 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer,
Reference< XPropertySet > xParamColumn(xWrappedParameters->getByIndex(i),UNO_QUERY);
if (xParamColumn.is())
{
-#ifdef DBG_UTIL
::rtl::OUString sName;
- xParamColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sName;
+ xParamColumn->getPropertyValue(PROPERTY_NAME) >>= sName;
OSL_ENSURE(sName.equals(pFinalValues->Name), "::dbaui::askForParameters: inconsistent parameter names!");
-#endif
+
// determine the field type and ...
sal_Int32 nParamType = 0;
xParamColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nParamType;
@@ -1827,21 +1844,17 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer,
sal_Int32 nScale = 0;
if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE), xParamColumn))
xParamColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nScale;
- // and set the value
- ::std::bit_vector::const_iterator aIter = _aParametersSet.begin();
- ::std::bit_vector::const_iterator aEnd = _aParametersSet.end();
- sal_Int32 j = 0;
- sal_Int32 nParamPos = -1;
- for(; aIter != aEnd && j <= i; ++aIter)
+ // (the index of the parameters is one-based)
+ TParameterPositions::iterator aFind = aParameterNames.find(pFinalValues->Name);
+ ::std::vector<sal_Int32>::iterator aIterPos = aFind->second.begin();
+ ::std::vector<sal_Int32>::iterator aEndPos = aFind->second.end();
+ for(;aIterPos != aEndPos;++aIterPos)
{
- ++nParamPos;
- if ( !*aIter )
+ if ( _aParametersSet.empty() || !_aParametersSet[(*aIterPos)-1] )
{
- ++j;
+ _xParameters->setObjectWithInfo(*aIterPos, pFinalValues->Value, nParamType, nScale);
}
}
- _xParameters->setObjectWithInfo(nParamPos + 1, pFinalValues->Value, nParamType, nScale);
- // (the index of the parameters is one-based)
}
}
}
diff --git a/connectivity/source/drivers/jdbc/tools.cxx b/connectivity/source/drivers/jdbc/tools.cxx
index f77c45d66fc8..13bc83d1a56d 100644
--- a/connectivity/source/drivers/jdbc/tools.cxx
+++ b/connectivity/source/drivers/jdbc/tools.cxx
@@ -153,6 +153,8 @@ java_util_Properties* connectivity::createStringPropertyArray(const Sequence< Pr
&& pBegin->Name.compareToAscii( "SupportsTableCreation" )
&& pBegin->Name.compareToAscii( "UseJava" )
&& pBegin->Name.compareToAscii( "Authentication" )
+ && pBegin->Name.compareToAscii( "PreferDosLikeLineEnds" )
+ && pBegin->Name.compareToAscii( "PrimaryKeySupport" )
)
{
::rtl::OUString aStr;
diff --git a/connectivity/source/parse/PColumn.cxx b/connectivity/source/parse/PColumn.cxx
index d8372ca69167..e8baf187eef7 100644
--- a/connectivity/source/parse/PColumn.cxx
+++ b/connectivity/source/parse/PColumn.cxx
@@ -116,7 +116,7 @@ OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSe
const Reference< XDatabaseMetaData >& _rxDBMetaData, sal_Int32 _nColumnPos )
{
OParseColumn* pColumn = new OParseColumn(
- _rxResMetaData->getColumnName( _nColumnPos ),
+ _rxResMetaData->getColumnLabel( _nColumnPos ),
_rxResMetaData->getColumnTypeName( _nColumnPos ),
::rtl::OUString(),
_rxResMetaData->isNullable( _nColumnPos ),
@@ -135,6 +135,7 @@ OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSe
eComplete
) );
pColumn->setIsSearchable( _rxResMetaData->isSearchable( _nColumnPos ) );
+ pColumn->setRealName(_rxResMetaData->getColumnName( _nColumnPos ));
return pColumn;
}
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index c76dd44e3d18..969682539074 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -911,7 +911,7 @@ OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType,OSQLParseNode*& pLiteral)
}
break;
default:
- OSL_ENSURE(0,"Not handled!");
+ ;
}
}
return pReturn;
diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
index d55097f21dc2..33eee0126604 100644
--- a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
+++ b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
@@ -66,7 +66,6 @@ namespace sdr { namespace contact {
public:
ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
-
/// determines whether an XControl already exists, and is currently visible
bool isControlVisible() const;