Kaydet (Commit) 33e94f36 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

fdo#82151 finish fixup

Fix the UnoApi test, and give ORowSetDataColumn::getFastPropertyValue the reasonable behaviour.

Change-Id: I68cc1221b6772e3036c78b8234b1d8b248d4d673
üst 213e1f9f
...@@ -113,17 +113,9 @@ void SAL_CALL ORowSetDataColumn::getFastPropertyValue( Any& rValue, sal_Int32 nH ...@@ -113,17 +113,9 @@ void SAL_CALL ORowSetDataColumn::getFastPropertyValue( Any& rValue, sal_Int32 nH
} }
catch(const SQLException &e) catch(const SQLException &e)
{ {
SAL_INFO("dbaccess", "exception caught: " << e.Message); throw WrappedTargetRuntimeException("Could not retrieve column value: " + e.Message,
// TODO: doing nothing matches the previous behaviour, *const_cast<ORowSetDataColumn*>(this),
// (and keeps dbaccess unoapi test working...) Any(e));
// but should be investigated... If the value could not be
// fetched, that's a different result than "value is null",
// which corresponds to an empty Any.
//throw WrappedTargetRuntimeException("Could not retrieve column value", *const_cast<ORowSetDataColumn*>(this), Any(e));
// css::uno::Any a(cppu::getCaughtException());
// throw css::lang::WrappedTargetException(
// "wrapped css::sdbc::SQLException: " + e.Message,
// css::uno::Reference<css::uno::XInterface>(), a);
} }
} }
else if ( PROPERTY_ID_LABEL == nHandle && !m_sLabel.isEmpty() ) else if ( PROPERTY_ID_LABEL == nHandle && !m_sLabel.isEmpty() )
......
...@@ -1180,15 +1180,17 @@ void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow) ...@@ -1180,15 +1180,17 @@ void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow)
SAL_INFO("dbaccess", "ORowSetBase::firePropertyChange() Clone = " << m_bClone); SAL_INFO("dbaccess", "ORowSetBase::firePropertyChange() Clone = " << m_bClone);
OSL_ENSURE(m_pColumns,"Columns can not be NULL here!"); OSL_ENSURE(m_pColumns,"Columns can not be NULL here!");
sal_Int32 i=0; sal_Int32 i=0;
try TDataColumns::iterator aEnd = m_aDataColumns.end();
for(TDataColumns::iterator aIter = m_aDataColumns.begin();aIter != aEnd;++aIter,++i)
{ {
TDataColumns::iterator aEnd = m_aDataColumns.end(); try
for(TDataColumns::iterator aIter = m_aDataColumns.begin();aIter != aEnd;++aIter,++i) {
(*aIter)->fireValueChange(_rOldRow.is() ? (_rOldRow->get())[i+1] : ::connectivity::ORowSetValue()); (*aIter)->fireValueChange(_rOldRow.is() ? (_rOldRow->get())[i+1] : ::connectivity::ORowSetValue());
} }
catch (const Exception&) catch (const Exception&)
{ {
SAL_WARN("dbaccess", "firePropertyChange: Exception"); SAL_WARN("dbaccess", "firePropertyChange: Exception on column " << i);
}
} }
SAL_INFO("dbaccess", "ORowSetBase::firePropertyChange() Clone = " << m_bClone); SAL_INFO("dbaccess", "ORowSetBase::firePropertyChange() Clone = " << m_bClone);
} }
......
...@@ -35,6 +35,7 @@ import com.sun.star.sdb.XSingleSelectQueryAnalyzer; ...@@ -35,6 +35,7 @@ import com.sun.star.sdb.XSingleSelectQueryAnalyzer;
import com.sun.star.sdb.XSingleSelectQueryComposer; import com.sun.star.sdb.XSingleSelectQueryComposer;
import com.sun.star.sdbc.XConnection; import com.sun.star.sdbc.XConnection;
import com.sun.star.sdbc.XDataSource; import com.sun.star.sdbc.XDataSource;
import com.sun.star.sdbc.XResultSet;
import com.sun.star.sdbcx.XColumnsSupplier; import com.sun.star.sdbcx.XColumnsSupplier;
import com.sun.star.uno.AnyConverter; import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type; import com.sun.star.uno.Type;
...@@ -158,6 +159,8 @@ public class OSingleSelectQueryComposer extends TestCase { ...@@ -158,6 +159,8 @@ public class OSingleSelectQueryComposer extends TestCase {
* {@link ifc.sdb._XSingleSelectQueryComposer} interface * {@link ifc.sdb._XSingleSelectQueryComposer} interface
* <li> <code>'colName'</code> for * <li> <code>'colName'</code> for
* {@link ifc.sdb._XSingleSelectQueryComposer} interface * {@link ifc.sdb._XSingleSelectQueryComposer} interface
* <li> <code>'xResultSet'</code> for
* {@link ifc.sdb._XSingleSelectQueryComposer} interface
* </ul> * </ul>
* *
*/ */
...@@ -242,6 +245,9 @@ public class OSingleSelectQueryComposer extends TestCase { ...@@ -242,6 +245,9 @@ public class OSingleSelectQueryComposer extends TestCase {
tEnv.addObjRelation("xProp", xCol); tEnv.addObjRelation("xProp", xCol);
tEnv.addObjRelation("colName", xCols.getElementNames()[0]); tEnv.addObjRelation("colName", xCols.getElementNames()[0]);
XResultSet xResultSet = UnoRuntime.queryInterface(XResultSet.class, oRowSet);
tEnv.addObjRelation("xResultSet", xResultSet);
return tEnv; return tEnv;
} catch(com.sun.star.uno.Exception e) { } catch(com.sun.star.uno.Exception e) {
......
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