summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2011-03-04 07:53:39 +0100
committerOcke Janssen <oj@openoffice.org>2011-03-04 07:53:39 +0100
commit660f7c59a0f4b8a21114c773a0651da7a6993554 (patch)
tree710e1fd89c38e80a58b3649cac276e375fc58455 /forms
parent8427b0f498b040a465cc20c4a323191d6b2aea5f (diff)
parent307556af7f3802f71b9c28643021513d6256f084 (diff)
Automated merge with file:///d:\tools\master\ooo
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/DatabaseForm.cxx2
-rw-r--r--forms/source/component/Edit.cxx58
-rw-r--r--forms/source/component/Edit.hxx1
-rw-r--r--forms/source/component/FormattedField.cxx4
4 files changed, 28 insertions, 37 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index d7c56b293523..8ff11dfc2f59 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -2905,7 +2905,7 @@ void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirs
// a database form always uses caching
// we use starting fetchsize with at least 10 rows
if (bConnected)
- m_xAggregateSet->setPropertyValue(PROPERTY_FETCHSIZE, makeAny((sal_Int32)10));
+ m_xAggregateSet->setPropertyValue(PROPERTY_FETCHSIZE, makeAny((sal_Int32)40));
// if we're loaded as sub form we got a "rowSetChanged" from the parent rowset _before_ we got the "loaded"
// so we don't need to execute the statement again, this was already done
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index c3f759696ef9..113d664acf33 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -675,7 +675,6 @@ sal_Bool OEditModel::approveDbColumnType( sal_Int32 _nColumnType )
void OEditModel::resetNoBroadcast()
{
OEditBaseModel::resetNoBroadcast();
- m_aLastKnownValue.clear();
}
//------------------------------------------------------------------------------
@@ -683,38 +682,34 @@ sal_Bool OEditModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
{
Any aNewValue( m_xAggregateFastSet->getFastPropertyValue( getValuePropertyAggHandle() ) );
- if ( aNewValue != m_aLastKnownValue )
- {
- ::rtl::OUString sNewValue;
- aNewValue >>= sNewValue;
+ ::rtl::OUString sNewValue;
+ aNewValue >>= sNewValue;
- if ( !aNewValue.hasValue()
- || ( !sNewValue.getLength() // an empty string
- && m_bEmptyIsNull // which should be interpreted as NULL
- )
+ if ( !aNewValue.hasValue()
+ || ( !sNewValue.getLength() // an empty string
+ && m_bEmptyIsNull // which should be interpreted as NULL
)
+ )
+ {
+ m_xColumnUpdate->updateNull();
+ }
+ else
+ {
+ OSL_PRECOND( m_pValueFormatter.get(), "OEditModel::commitControlValueToDbColumn: no value formatter!" );
+ try
{
- m_xColumnUpdate->updateNull();
- }
- else
- {
- OSL_PRECOND( m_pValueFormatter.get(), "OEditModel::commitControlValueToDbColumn: no value formatter!" );
- try
+ if ( m_pValueFormatter.get() )
{
- if ( m_pValueFormatter.get() )
- {
- if ( !m_pValueFormatter->setFormattedValue( sNewValue ) )
- return sal_False;
- }
- else
- m_xColumnUpdate->updateString( sNewValue );
- }
- catch ( const Exception& )
- {
- return sal_False;
+ if ( !m_pValueFormatter->setFormattedValue( sNewValue ) )
+ return sal_False;
}
+ else
+ m_xColumnUpdate->updateString( sNewValue );
+ }
+ catch ( const Exception& )
+ {
+ return sal_False;
}
- m_aLastKnownValue = aNewValue;
}
return sal_True;
@@ -724,6 +719,7 @@ sal_Bool OEditModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
Any OEditModel::translateDbColumnToControlValue()
{
OSL_PRECOND( m_pValueFormatter.get(), "OEditModel::translateDbColumnToControlValue: no value formatter!" );
+ Any aRet;
if ( m_pValueFormatter.get() )
{
::rtl::OUString sValue( m_pValueFormatter->getFormattedValue() );
@@ -732,7 +728,6 @@ Any OEditModel::translateDbColumnToControlValue()
&& m_pValueFormatter->getColumn()->wasNull()
)
{
- m_aLastKnownValue.clear();
}
else
{
@@ -744,14 +739,11 @@ Any OEditModel::translateDbColumnToControlValue()
sValue = sValue.replaceAt( nMaxTextLen, nDiff, ::rtl::OUString() );
}
- m_aLastKnownValue <<= sValue;
+ aRet <<= sValue;
}
}
- else
- m_aLastKnownValue.clear();
- return m_aLastKnownValue.hasValue() ? m_aLastKnownValue : makeAny( ::rtl::OUString() );
- // (m_aLastKnownValue is alllowed to be VOID, the control value isn't)
+ return aRet.hasValue() ? aRet : makeAny( ::rtl::OUString() );
}
//------------------------------------------------------------------------------
diff --git a/forms/source/component/Edit.hxx b/forms/source/component/Edit.hxx
index 5b4146b82d06..3b4c7c55a436 100644
--- a/forms/source/component/Edit.hxx
+++ b/forms/source/component/Edit.hxx
@@ -44,7 +44,6 @@ namespace frm
class OEditModel
:public OEditBaseModel
{
- ::com::sun::star::uno::Any m_aLastKnownValue;
::std::auto_ptr< ::dbtools::FormattedColumnValue >
m_pValueFormatter;
sal_Bool m_bMaxTextLenModified : 1; // set to <TRUE/> when we change the MaxTextLen of the aggregate
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index 63195bf74af0..5f36934cb98e 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -1040,10 +1040,10 @@ sal_Bool OFormattedModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
m_xColumnUpdate->updateNull();
else
{
- // als Value koennen nur double, string oder void auftreten
try
{
- if ( aControlValue.getValueType().getTypeClass() == TypeClass_DOUBLE )
+ double f = 0.0;
+ if ( aControlValue.getValueType().getTypeClass() == TypeClass_DOUBLE || (aControlValue >>= f)) // #i110323
{
DBTypeConversion::setValue( m_xColumnUpdate, m_aNullDate, getDouble( aControlValue ), m_nKeyType );
}