diff options
author | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2009-12-10 07:40:02 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2009-12-10 07:40:02 +0100 |
commit | ada13bed0d00ec3af944850148f9b3ed177dd101 (patch) | |
tree | 5c7666ac557685dde87d0b8a9647f3ee955afeee /forms | |
parent | fb287ba7c5fdacfefba0dabf81211b6d1759453e (diff) | |
parent | d95c37cdac36e96c22fa38b519817cc0466f1f96 (diff) |
dba33d: merge with DEV300_m67
Diffstat (limited to 'forms')
26 files changed, 153 insertions, 23 deletions
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 1d6d204ea977..432bc5124775 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -747,6 +747,13 @@ void SAL_CALL OComboBoxModel::reloaded( const EventObject& aEvent ) throw(Runtim loadData( false ); } +//------------------------------------------------------------------------------ +void OComboBoxModel::resetNoBroadcast() +{ + OBoundControlModel::resetNoBroadcast(); + m_aLastKnownValue.clear(); +} + //----------------------------------------------------------------------------- sal_Bool OComboBoxModel::commitControlValueToDbColumn( bool _bPostReset ) { diff --git a/forms/source/component/ComboBox.hxx b/forms/source/component/ComboBox.hxx index 835099a7637c..068f4fd97163 100644 --- a/forms/source/component/ComboBox.hxx +++ b/forms/source/component/ComboBox.hxx @@ -145,6 +145,8 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); + // OEntryListHelper overriables virtual void stringItemListChanged( ControlModelLock& _rInstanceLock ); virtual void connectedExternalListSource( ); diff --git a/forms/source/component/Currency.cxx b/forms/source/component/Currency.cxx index 1b19b794d273..963e8fa165b7 100644 --- a/forms/source/component/Currency.cxx +++ b/forms/source/component/Currency.cxx @@ -257,6 +257,13 @@ Any OCurrencyModel::getDefaultForReset() const return aValue; } +//------------------------------------------------------------------------------ +void OCurrencyModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + //......................................................................... } // namespace frm //......................................................................... diff --git a/forms/source/component/Currency.hxx b/forms/source/component/Currency.hxx index 91eb109d6a14..3e968dcf3bc7 100644 --- a/forms/source/component/Currency.hxx +++ b/forms/source/component/Currency.hxx @@ -73,6 +73,8 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); + protected: DECLARE_XCLONEABLE(); diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index b95b48b9b214..bb9ecded3e28 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -151,7 +151,6 @@ public: DocumentModifyGuard( const Reference< XInterface >& _rxFormComponent ) :m_xDocumentModify( getXModel( _rxFormComponent ), UNO_QUERY ) { - OSL_ENSURE( m_xDocumentModify.is(), "DocumentModifyGuard::DocumentModifyGuard: no document, or no XModifiable2!" ); impl_changeModifiableFlag_nothrow( false ); } ~DocumentModifyGuard() diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx index 33332ae82908..5d0d3f21ce7a 100644 --- a/forms/source/component/Date.cxx +++ b/forms/source/component/Date.cxx @@ -348,6 +348,13 @@ Any ODateModel::getDefaultForReset() const } //------------------------------------------------------------------------------ +void ODateModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + +//------------------------------------------------------------------------------ Sequence< Type > ODateModel::getSupportedBindingTypes() { return Sequence< Type >( &::getCppuType( static_cast< util::Date* >( NULL ) ), 1 ); diff --git a/forms/source/component/Date.hxx b/forms/source/component/Date.hxx index 4c4e84e2822f..7eb1acfabf75 100644 --- a/forms/source/component/Date.hxx +++ b/forms/source/component/Date.hxx @@ -96,6 +96,8 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); + virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxForm ); protected: diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 0f4abd687d65..4eca9402fef8 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -675,6 +675,13 @@ sal_Bool OEditModel::approveDbColumnType( sal_Int32 _nColumnType ) } //------------------------------------------------------------------------------ +void OEditModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aLastKnownValue.clear(); +} + +//------------------------------------------------------------------------------ sal_Bool OEditModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) { Any aNewValue( m_xAggregateFastSet->getFastPropertyValue( getValuePropertyAggHandle() ) ); diff --git a/forms/source/component/Edit.hxx b/forms/source/component/Edit.hxx index cb8d5c6300e4..774944eda939 100644 --- a/forms/source/component/Edit.hxx +++ b/forms/source/component/Edit.hxx @@ -118,6 +118,8 @@ protected: virtual sal_Bool approveDbColumnType( sal_Int32 _nColumnType ); + virtual void resetNoBroadcast(); + protected: virtual sal_uInt16 getPersistenceFlags() const; diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 3ba45781c11b..4a612642bbff 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -2266,14 +2266,6 @@ void OBoundControlModel::impl_connectDatabaseColumn_noNotify( bool _bFromReload m_bLoaded = sal_True; onConnectedDbColumn( xRowSet ); - // Some derived classes decide to cache the "current" (resp. "last known") control value, so operations like - // commitControlValueToDbColumn can be made a no-op when nothing actually changed. - // Normally, this cache is kept in sync with the column value, but during a reload, this synchronization is - // temporarily disable. To allow the derived classes to update their cache from the current column value, - // we call translateDbColumnToControlValue. - if ( _bFromReload && hasField() ) - translateDbColumnToControlValue(); - // initially transfer the db column value to the control, if we successfully connected to a database column if ( hasField() ) initFromField( xRowSet ); diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index bc0e952f1735..0edbf781e786 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -1248,6 +1248,13 @@ Any OFormattedModel::getDefaultForReset() const return m_xAggregateSet->getPropertyValue( PROPERTY_EFFECTIVE_DEFAULT ); } +//------------------------------------------------------------------------------ +void OFormattedModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + //......................................................................... } //......................................................................... diff --git a/forms/source/component/FormattedField.hxx b/forms/source/component/FormattedField.hxx index 0e728288aaba..4a25d10c5c81 100644 --- a/forms/source/component/FormattedField.hxx +++ b/forms/source/component/FormattedField.hxx @@ -141,6 +141,7 @@ namespace frm virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxForm ); virtual void onDisconnectedDbColumn(); diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index ec953f66c6f6..4bbf42381900 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -1003,23 +1003,23 @@ namespace frm sal_Bool OListBoxModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) { // current selektion list - const ORowSetValue rCurrentValue( getFirstSelectedValue() ); - if ( rCurrentValue != m_aSaveValue ) + const ORowSetValue aCurrentValue( getFirstSelectedValue() ); + if ( aCurrentValue != m_aSaveValue ) { - if ( rCurrentValue.isNull() ) + if ( aCurrentValue.isNull() ) m_xColumnUpdate->updateNull(); else { try { - m_xColumnUpdate->updateObject( rCurrentValue.makeAny() ); + m_xColumnUpdate->updateObject( aCurrentValue.makeAny() ); } catch ( const Exception& ) { return sal_False; } } - m_aSaveValue = rCurrentValue; + m_aSaveValue = aCurrentValue; } return sal_True; } @@ -1037,10 +1037,10 @@ namespace frm Sequence< sal_Int16 > aSelectionIndicies; - // Bei NULL-Eintraegen Selektion aufheben! ORowSetValue aCurrentValue; - aCurrentValue.fill( xBoundField->getPropertyValue( PROPERTY_VALUE ) ); + aCurrentValue.fill( getFieldType(), m_xColumn ); + // reset selection for NULL values if ( aCurrentValue.isNull() ) { if ( m_nNULLPos != -1 ) @@ -1088,6 +1088,13 @@ namespace frm } //-------------------------------------------------------------------- + void OListBoxModel::resetNoBroadcast() + { + OBoundControlModel::resetNoBroadcast(); + m_aSaveValue.setNull(); + } + + //-------------------------------------------------------------------- void SAL_CALL OListBoxModel::disposing( const EventObject& _rSource ) throw ( RuntimeException ) { if ( !OEntryListHelper::handleDisposing( _rSource ) ) diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index 60bd63b3712d..308fb618e18a 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -157,6 +157,7 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); virtual ::com::sun::star::uno::Any getCurrentFormComponentValue() const; diff --git a/forms/source/component/Numeric.cxx b/forms/source/component/Numeric.cxx index 2ec1f0cfcfdc..2eba2daae067 100644 --- a/forms/source/component/Numeric.cxx +++ b/forms/source/component/Numeric.cxx @@ -212,6 +212,13 @@ Any ONumericModel::getDefaultForReset() const return aValue; } +//------------------------------------------------------------------------------ +void ONumericModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + //......................................................................... } // namespace frm //......................................................................... diff --git a/forms/source/component/Numeric.hxx b/forms/source/component/Numeric.hxx index 45b096afef50..5599707e86d5 100644 --- a/forms/source/component/Numeric.hxx +++ b/forms/source/component/Numeric.hxx @@ -72,6 +72,7 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); protected: DECLARE_XCLONEABLE(); diff --git a/forms/source/component/Pattern.cxx b/forms/source/component/Pattern.cxx index 64f5ea0e5e75..166522c18359 100644 --- a/forms/source/component/Pattern.cxx +++ b/forms/source/component/Pattern.cxx @@ -252,6 +252,13 @@ Any OPatternModel::getDefaultForReset() const return makeAny( m_aDefaultText ); } +//------------------------------------------------------------------------------ +void OPatternModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aLastKnownValue.clear(); +} + //......................................................................... } // namespace frm //......................................................................... diff --git a/forms/source/component/Pattern.hxx b/forms/source/component/Pattern.hxx index 8b2bf3b878c2..9e0bc3b68d77 100644 --- a/forms/source/component/Pattern.hxx +++ b/forms/source/component/Pattern.hxx @@ -81,6 +81,7 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); protected: DECLARE_XCLONEABLE(); diff --git a/forms/source/component/Time.cxx b/forms/source/component/Time.cxx index 85ce1670572d..6a63724829d1 100644 --- a/forms/source/component/Time.cxx +++ b/forms/source/component/Time.cxx @@ -350,6 +350,13 @@ Any OTimeModel::getDefaultForReset() const } //------------------------------------------------------------------------------ +void OTimeModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + +//------------------------------------------------------------------------------ Sequence< Type > OTimeModel::getSupportedBindingTypes() { return Sequence< Type >( &::getCppuType( static_cast< util::Time* >( NULL ) ), 1 ); diff --git a/forms/source/component/Time.hxx b/forms/source/component/Time.hxx index d2ba5381f466..7a7ce373b363 100644 --- a/forms/source/component/Time.hxx +++ b/forms/source/component/Time.hxx @@ -96,6 +96,7 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxForm ); diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index b9738ddd49ae..79d28727b5d5 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -435,6 +435,11 @@ namespace frm // allowed to leave throw; } + catch( const WrappedTargetException& e ) + { + // allowed to leave + throw; + } catch( const Exception& e ) { OSL_ENSURE( sal_False, "OClickableImageBaseControl::implSubmit: caught an unknown exception!" ); diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 43f784f2219c..9f41f68427b1 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -46,6 +46,8 @@ /** === begin UNO includes === **/ #include <com/sun/star/awt/PosSize.hpp> /** === end UNO includes === **/ + +#include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> @@ -400,6 +402,33 @@ namespace frm } //-------------------------------------------------------------------- + void SAL_CALL ORichTextPeer::draw( sal_Int32 _nX, sal_Int32 _nY ) throw(::com::sun::star::uno::RuntimeException) + { + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + RichTextControl* pControl = static_cast< RichTextControl* >( GetWindow() ); + if ( !pControl ) + return; + + OutputDevice* pTargetDevice = VCLUnoHelper::GetOutputDevice( getGraphics() ); + OSL_ENSURE( pTargetDevice != NULL, "ORichTextPeer::draw: no graphics -> no drawing!" ); + if ( !pTargetDevice ) + return; + + ::Size aSize = pControl->GetSizePixel(); + const MapUnit eTargetUnit = pTargetDevice->GetMapMode().GetMapUnit(); + if ( eTargetUnit != MAP_PIXEL ) + aSize = pControl->PixelToLogic( aSize, eTargetUnit ); + + ::Point aPos( _nX, _nY ); + // the XView::draw API talks about pixels, always ... + if ( eTargetUnit != MAP_PIXEL ) + aPos = pTargetDevice->PixelToLogic( aPos ); + + pControl->Draw( pTargetDevice, aPos, aSize, WINDOW_DRAW_NOCONTROLS ); + } + + //-------------------------------------------------------------------- void SAL_CALL ORichTextPeer::setProperty( const ::rtl::OUString& _rPropertyName, const Any& _rValue ) throw (RuntimeException) { if ( !GetWindow() ) diff --git a/forms/source/richtext/richtextcontrol.hxx b/forms/source/richtext/richtextcontrol.hxx index 5775e2626d2d..eecff6527eea 100644 --- a/forms/source/richtext/richtextcontrol.hxx +++ b/forms/source/richtext/richtextcontrol.hxx @@ -135,6 +135,9 @@ namespace frm ORichTextPeer(); ~ORichTextPeer(); + // XView + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + // XVclWindowPeer virtual void SAL_CALL setProperty( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::uno::RuntimeException); diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx index bcfb0fc2ad35..9e002d4ed7c0 100644 --- a/forms/source/richtext/richtextimplcontrol.cxx +++ b/forms/source/richtext/richtextimplcontrol.cxx @@ -605,21 +605,32 @@ namespace frm _pDev->SetMapMode( aNormalizedMapMode ); // translate coordinates - Point aPos( OutputDevice::LogicToLogic( _rPos, aOriginalMapMode, aNormalizedMapMode ) ); - Size aSize( OutputDevice::LogicToLogic( _rSize, aOriginalMapMode, aNormalizedMapMode ) ); + Point aPos( _rPos ); + Size aSize( _rSize ); + if ( aOriginalMapMode.GetMapUnit() == MAP_PIXEL ) + { + aPos = _pDev->PixelToLogic( _rPos, aNormalizedMapMode ); + aSize = _pDev->PixelToLogic( _rSize, aNormalizedMapMode ); + } + else + { + aPos = OutputDevice::LogicToLogic( _rPos, aOriginalMapMode, aNormalizedMapMode ); + aSize = OutputDevice::LogicToLogic( _rSize, aOriginalMapMode, aNormalizedMapMode ); + } Rectangle aPlayground( aPos, aSize ); Size aOnePixel( _pDev->PixelToLogic( Size( 1, 1 ) ) ); + aPlayground.Right() -= aOnePixel.Width(); + aPlayground.Bottom() -= aOnePixel.Height(); // background _pDev->SetLineColor(); - _pDev->DrawRect( Rectangle( aPlayground.TopLeft(), m_pEngine->GetPaperSize()) ); + _pDev->DrawRect( aPlayground ); - // possibly with border + // do we need to draw a border? bool bBorder = ( m_pAntiImpl->GetStyle() & WB_BORDER ); if ( bBorder ) - // let's draw a border - _pDev->SetLineColor( COL_BLACK ); + _pDev->SetLineColor( m_pAntiImpl->GetSettings().GetStyleSettings().GetMonoColor() ); else _pDev->SetLineColor(); _pDev->SetFillColor( m_pAntiImpl->GetBackground().GetColor() ); @@ -632,7 +643,9 @@ namespace frm // leave a space of one pixel between the "surroundings" of the control // and the content lcl_inflate( aPlayground, -aOnePixel.Width(), -aOnePixel.Height() ); + lcl_inflate( aPlayground, -aOnePixel.Width(), -aOnePixel.Height() ); + // actually draw the content m_pEngine->Draw( _pDev, aPlayground, Point(), TRUE ); _pDev->Pop(); diff --git a/forms/source/richtext/richtextvclcontrol.hxx b/forms/source/richtext/richtextvclcontrol.hxx index 778d31c3e6e1..a4f49aa2d41c 100644 --- a/forms/source/richtext/richtextvclcontrol.hxx +++ b/forms/source/richtext/richtextvclcontrol.hxx @@ -117,13 +117,15 @@ namespace frm const EditView& getView() const; EditView& getView(); + // Window overridables + virtual void Draw( OutputDevice* _pDev, const Point& _rPos, const Size& _rSize, ULONG _nFlags ); + protected: // Window overridables virtual void Resize(); virtual void GetFocus(); virtual void StateChanged( StateChangedType nStateChange ); virtual long PreNotify( NotifyEvent& _rNEvt ); - virtual void Draw( OutputDevice* _pDev, const Point& _rPos, const Size& _rSize, ULONG _nFlags ); virtual long Notify( NotifyEvent& _rNEvt ); private: diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index bfefb05f8ab6..f599f196ee32 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -74,6 +74,7 @@ namespace frm sLabel += String::CreateFromAscii( " " ); return sLabel; } +<<<<<<< local static bool lcl_isHighContrast( const Color& _rColor ) { @@ -111,6 +112,8 @@ namespace frm OSL_ENSURE( false, "lcl_getCommandURL: unknown FormFeature!" ); return ::rtl::OUString(); } +======= +>>>>>>> other } //===================================================================== @@ -424,7 +427,15 @@ namespace frm if ( _eSize != m_eImageSize ) { m_eImageSize = _eSize; +<<<<<<< local implUpdateImages(); +======= + ::std::auto_ptr< SfxImageManager > pImageManager( new SfxImageManager( NULL ) ); + pImageManager->SetImagesForceSize( *m_pToolbar, GetSettings().GetStyleSettings().GetHighContrastMode(), m_eImageSize == eLarge ); + + // parts of our layout is dependent on the size of our icons + Resize(); +>>>>>>> other } } |