diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-06-04 14:23:34 +0200 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-06-04 14:23:34 +0200 |
commit | 52d1202cce6b0c53dd5ef6682132b59c77e0783e (patch) | |
tree | d8feeea19204cb078f6de7cf2a24cab0546ea58d /svx/source | |
parent | e95e77100efb7aa337358fa0c58b43c3e7e8f19e (diff) | |
parent | b8076ccb49b2fa9730230490b4c34d15878a8ad7 (diff) |
CWS-TOOLING: integrate CWS dba33f
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/fmcomp/dbaexchange.cxx | 57 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridcl.cxx | 21 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 109 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 47 | ||||
-rw-r--r-- | svx/source/form/fmshell.cxx | 101 | ||||
-rw-r--r-- | svx/source/form/fmshimp.cxx | 26 | ||||
-rw-r--r-- | svx/source/form/fmtextcontrolshell.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmtools.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmvwimp.cxx | 101 | ||||
-rw-r--r-- | svx/source/form/formcontrolfactory.cxx | 8 | ||||
-rw-r--r-- | svx/source/form/navigatortree.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/tabwin.cxx | 58 | ||||
-rw-r--r-- | svx/source/inc/fmprop.hrc | 1 | ||||
-rw-r--r-- | svx/source/inc/fmshimp.hxx | 3 | ||||
-rw-r--r-- | svx/source/inc/fmvwimp.hxx | 5 | ||||
-rw-r--r-- | svx/source/inc/gridcell.hxx | 3 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 12 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 8 |
18 files changed, 404 insertions, 162 deletions
diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx index 672dd32d28b5..0a6e36219ed3 100644 --- a/svx/source/fmcomp/dbaexchange.cxx +++ b/svx/source/fmcomp/dbaexchange.cxx @@ -135,30 +135,19 @@ namespace svx { try { - // need a query composer for this - Reference< XSQLQueryComposerFactory > xComposerFac; - _rxForm->getPropertyValue(FM_PROP_ACTIVE_CONNECTION) >>= xComposerFac; - Reference< XSQLQueryComposer > xComposer; - if (xComposerFac.is()) - xComposer = xComposerFac->createQueryComposer(); - - if (xComposer.is()) + Reference< XTablesSupplier > xSupTab; + _rxForm->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupTab; + + if(xSupTab.is()) { - ::rtl::OUString sActiveCommand; - _rxForm->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sActiveCommand; - xComposer->setQuery(sActiveCommand); - Reference< XTablesSupplier > xSupTab(xComposer, UNO_QUERY); - if(xSupTab.is()) + Reference< XNameAccess > xNames = xSupTab->getTables(); + if (xNames.is()) { - Reference< XNameAccess > xNames = xSupTab->getTables(); - if (xNames.is()) + Sequence< ::rtl::OUString > aTables = xNames->getElementNames(); + if (1 == aTables.getLength()) { - Sequence< ::rtl::OUString > aTables = xNames->getElementNames(); - if (1 == aTables.getLength()) - { - sCommand = aTables[0]; - nCommandType = CommandType::TABLE; - } + sCommand = aTables[0]; + nCommandType = CommandType::TABLE; } } } @@ -457,34 +446,10 @@ namespace svx String sObjectKind = (CommandType::TABLE == nObjectType) ? String('1') : String('0'); // check if the SQL-statement is modified - sal_Bool bHasFilterOrSort(sal_False); ::rtl::OUString sCompleteStatement; try { - ::rtl::OUString sFilter, sSort; - if (::cppu::any2bool(_rxLivingForm->getPropertyValue(FM_PROP_APPLYFILTER))) - _rxLivingForm->getPropertyValue(FM_PROP_FILTER) >>= sFilter; - _rxLivingForm->getPropertyValue(FM_PROP_SORT) >>= sSort; - bHasFilterOrSort = (sFilter.getLength()>0) || (sSort.getLength()>0); - _rxLivingForm->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sCompleteStatement; - - // create a composer - Reference< XSQLQueryComposerFactory > xFactory( xConnection, UNO_QUERY ); - Reference< XSQLQueryComposer > xComposer; - if (xFactory.is()) - xComposer = xFactory->createQueryComposer(); - - // let the composer compose - if (xComposer.is()) - { - xComposer->setQuery(sCompleteStatement); - xComposer->setFilter(sFilter); - xComposer->setOrder(sSort); - sCompleteStatement = xComposer->getComposedQuery(); - } - // Usually, I would expect the result of the composing to be the same as the ActiveCommand property - // But this code here is pretty old, and I don't know wha the side effects are if I remove it now ... } catch(Exception&) { @@ -496,7 +461,7 @@ namespace svx ,sConnectionResource ,nObjectType ,sObjectName,xConnection - ,!((CommandType::QUERY == nObjectType) && !bHasFilterOrSort) + ,!((CommandType::QUERY == nObjectType)) ,sCompleteStatement); } diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index cbe9b49b81f1..d64b0c9ab958 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -210,10 +210,11 @@ void FmGridHeader::RequestHelp( const HelpEvent& rHEvt ) Reference< ::com::sun::star::container::XIndexContainer > xColumns(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns()); try { - Reference< ::com::sun::star::beans::XPropertySet > xColumn; - ::cppu::extractInterface(xColumn, xColumns->getByIndex(nPos)); + Reference< ::com::sun::star::beans::XPropertySet > xColumn(xColumns->getByIndex(nPos),UNO_QUERY); ::rtl::OUString aHelpText; xColumn->getPropertyValue(FM_PROP_HELPTEXT) >>= aHelpText; + if ( !aHelpText.getLength() ) + xColumn->getPropertyValue(FM_PROP_DESCRIPTION) >>= aHelpText; if ( aHelpText.getLength() ) { if ( rHEvt.GetMode() & HELPMODE_BALLOON ) @@ -1737,11 +1738,12 @@ void FmGridControl::InitColumnByField( _pColumn->SetObject( (sal_Int16)nFieldPos ); return; } - +/* // handle readonly columns sal_Bool bReadOnly = sal_True; xField->getPropertyValue( FM_PROP_ISREADONLY ) >>= bReadOnly; _pColumn->SetReadOnly( bReadOnly ); +*/ } // the control type is determined by the ColumnServiceName @@ -1999,7 +2001,11 @@ namespace { Reference<XPropertySet> xProp(GetPeer()->getColumns(),UNO_QUERY); if ( xProp.is() ) + { xProp->getPropertyValue(FM_PROP_HELPTEXT) >>= sRetText; + if ( !sRetText.getLength() ) + xProp->getPropertyValue(FM_PROP_DESCRIPTION) >>= sRetText; + } } break; case ::svt::BBTYPE_COLUMNHEADERCELL: @@ -2008,6 +2014,13 @@ namespace GetModelColumnPos( sal::static_int_cast< sal_uInt16 >(_nPosition)), FM_PROP_HELPTEXT); + if ( !sRetText.getLength() ) + sRetText = getColumnPropertyFromPeer( + GetPeer(), + GetModelColumnPos( + sal::static_int_cast< sal_uInt16 >(_nPosition)), + FM_PROP_DESCRIPTION); + break; default: sRetText = DbGridControl::GetAccessibleObjectDescription(_eObjType,_nPosition); @@ -2029,7 +2042,7 @@ void FmGridControl::Select() // die HandleColumn wird nicht selektiert switch (nSelectedColumn) { - case -1 : break; // no selection + case SAL_MAX_UINT16: break; // no selection case 0 : nSelectedColumn = SAL_MAX_UINT16; break; // handle col can't be seledted default : diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 6a3e4a17f5d7..bb8afd502d43 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -45,6 +45,8 @@ #include <com/sun/star/form/XBoundComponent.hpp> #include <com/sun/star/script/XEventAttacherManager.hpp> #include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp> +#include <com/sun/star/sdbcx/XTablesSupplier.hpp> +#include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/XStatement.hpp> @@ -82,6 +84,7 @@ using namespace ::svt; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::form; @@ -551,6 +554,7 @@ TYPEINIT1( DbFilterField, DbCellControl ) //------------------------------------------------------------------------------ DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ ) :OPropertyChangeListener(m_aMutex) + ,m_pFieldChangeBroadcaster(NULL) ,m_bTransparent( sal_False ) ,m_bAlignedController( sal_True ) ,m_bAccessingValueProperty( sal_False ) @@ -574,6 +578,27 @@ DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ ) implDoPropertyListening( FM_PROP_STATE, sal_False ); implDoPropertyListening( FM_PROP_TEXT, sal_False ); implDoPropertyListening( FM_PROP_EFFECTIVE_VALUE, sal_False ); + + // be listener at the bound field as well + try + { + Reference< XPropertySetInfo > xPSI( xColModelProps->getPropertySetInfo(), UNO_SET_THROW ); + if ( xPSI->hasPropertyByName( FM_PROP_BOUNDFIELD ) ) + { + Reference< XPropertySet > xField; + xColModelProps->getPropertyValue( FM_PROP_BOUNDFIELD ) >>= xField; + if ( xField.is() ) + { + m_pFieldChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, xField); + m_pFieldChangeBroadcaster->acquire(); + m_pFieldChangeBroadcaster->addProperty( FM_PROP_ISREADONLY ); + } + } + } + catch( const Exception& ) + { + DBG_ERROR( "DbCellControl::doPropertyListening: caught an exception!" ); + } } } @@ -605,17 +630,22 @@ void DbCellControl::doPropertyListening( const ::rtl::OUString& _rPropertyName ) { implDoPropertyListening( _rPropertyName ); } - //------------------------------------------------------------------------------ -DbCellControl::~DbCellControl() +void lcl_clearBroadCaster(::comphelper::OPropertyChangeMultiplexer*& _pBroadcaster) { - if ( m_pModelChangeBroadcaster ) + if ( _pBroadcaster ) { - m_pModelChangeBroadcaster->dispose(); - m_pModelChangeBroadcaster->release(); - m_pModelChangeBroadcaster = NULL; + _pBroadcaster->dispose(); + _pBroadcaster->release(); + _pBroadcaster = NULL; // no delete, this is done implicitly } +} +//------------------------------------------------------------------------------ +DbCellControl::~DbCellControl() +{ + lcl_clearBroadCaster(m_pModelChangeBroadcaster); + lcl_clearBroadCaster(m_pFieldChangeBroadcaster); delete m_pWindow; delete m_pPainter; @@ -660,7 +690,14 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R } else if ( _rEvent.PropertyName.equals( FM_PROP_READONLY ) ) { - implAdjustReadOnly( xSourceProps ); + implAdjustReadOnly( xSourceProps, true); + } + else if ( _rEvent.PropertyName.equals( FM_PROP_ISREADONLY ) ) + { + sal_Bool bReadOnly = sal_True; + _rEvent.NewValue >>= bReadOnly; + m_rColumn.SetReadOnly(bReadOnly); + implAdjustReadOnly( xSourceProps, false); } else if ( _rEvent.PropertyName.equals( FM_PROP_ENABLED ) ) { @@ -798,7 +835,7 @@ void DbCellControl::ImplInitWindow( Window& rParent, const InitWindowFacet _eIni } //------------------------------------------------------------------------------ -void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxModel ) +void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxModel,bool i_bReadOnly ) { DBG_ASSERT( m_pWindow, "DbCellControl::implAdjustReadOnly: not to be called without window!" ); DBG_ASSERT( _rxModel.is(), "DbCellControl::implAdjustReadOnly: invalid model!" ); @@ -807,9 +844,12 @@ void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxMode Edit* pEditWindow = dynamic_cast< Edit* >( m_pWindow ); if ( pEditWindow ) { - sal_Bool bReadOnly = sal_True; - _rxModel->getPropertyValue( FM_PROP_READONLY ) >>= bReadOnly; - static_cast< Edit* >( m_pWindow )->SetReadOnly( m_rColumn.IsReadOnly() || bReadOnly ); + sal_Bool bReadOnly = m_rColumn.IsReadOnly(); + if ( !bReadOnly ) + { + _rxModel->getPropertyValue( i_bReadOnly ? FM_PROP_READONLY : FM_PROP_ISREADONLY) >>= bReadOnly; + } + static_cast< Edit* >( m_pWindow )->SetReadOnly( bReadOnly ); } } } @@ -846,7 +886,7 @@ void DbCellControl::Init( Window& rParent, const Reference< XRowSet >& _rxCursor if ( xModelPSI->hasPropertyByName( FM_PROP_READONLY ) ) { - implAdjustReadOnly( xModel ); + implAdjustReadOnly( xModel,true ); } if ( xModelPSI->hasPropertyByName( FM_PROP_ENABLED ) ) @@ -1003,7 +1043,7 @@ double DbCellControl::GetValue(const Reference< ::com::sun::star::sdb::XColumn > //------------------------------------------------------------------------------ void DbCellControl::invalidatedController() { - m_rColumn.GetParent().refreshController(m_rColumn.GetId(), DbGridControl::GrantCellControlAccess()); + m_rColumn.GetParent().refreshController(m_rColumn.GetId(), DbGridControl::GrantControlAccess()); } /*************************************************************************/ @@ -3039,43 +3079,22 @@ void DbFilterField::Update() if (!xForm.is()) return; - Reference< XConnection > xConnection(getRowSetConnection(xForm)); - if (!xConnection.is()) - return; - - Reference< ::com::sun::star::sdb::XSQLQueryComposerFactory > xFactory(xConnection, UNO_QUERY); - if (!xFactory.is()) - { - DBG_ERROR("DbFilterField::Update : used the right place to request the ::com::sun::star::sdb::XSQLQueryComposerFactory interface ?"); - return; - } - - Reference< ::com::sun::star::sdb::XSQLQueryComposer > xComposer = xFactory->createQueryComposer(); - try - { - Reference< ::com::sun::star::beans::XPropertySet > xFormAsSet(xForm, UNO_QUERY); - ::rtl::OUString sStatement; - xFormAsSet->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sStatement; - xComposer->setQuery(sStatement); - } - catch(const Exception&) - { - ::comphelper::disposeComponent(xComposer); - return; - } + Reference<XPropertySet> xFormProp(xForm,UNO_QUERY); + Reference< XTablesSupplier > xSupTab; + xFormProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupTab; - Reference< ::com::sun::star::beans::XPropertySet > xComposerAsSet(xComposer, UNO_QUERY); - if (!xComposerAsSet.is()) + Reference< XConnection > xConnection(getRowSetConnection(xForm)); + if (!xSupTab.is()) return; // search the field - Reference< ::com::sun::star::container::XNameAccess > xFieldNames; - Reference< ::com::sun::star::container::XNameAccess > xTablesNames; - Reference< ::com::sun::star::beans::XPropertySet > xComposerFieldAsSet; + Reference< XColumnsSupplier > xSupCol(xSupTab,UNO_QUERY); + Reference< ::com::sun::star::container::XNameAccess > xFieldNames = xSupCol->getColumns(); + if (!xFieldNames->hasByName(aName)) + return; - ::cppu::extractInterface(xFieldNames, xComposerAsSet->getPropertyValue(FM_PROP_SELECTED_FIELDS)); - ::cppu::extractInterface(xTablesNames, xComposerAsSet->getPropertyValue(FM_PROP_SELECTED_TABLES)); - ::cppu::extractInterface(xComposerFieldAsSet, xFieldNames->getByName(aName)); + Reference< ::com::sun::star::container::XNameAccess > xTablesNames = xSupTab->getTables(); + Reference< ::com::sun::star::beans::XPropertySet > xComposerFieldAsSet(xFieldNames->getByName(aName),UNO_QUERY); if (xComposerFieldAsSet.is() && ::comphelper::hasProperty(FM_PROP_TABLENAME, xComposerFieldAsSet) && ::comphelper::hasProperty(FM_PROP_FIELDSOURCE, xComposerFieldAsSet)) diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 8cc52e4c0b7d..1944bd47dad5 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -44,6 +44,8 @@ #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/sdb/XResultSetAccess.hpp> +#include <com/sun/star/sdb/RowChangeAction.hpp> +#include <com/sun/star/sdb/XRowsChangeBroadcaster.hpp> #include <com/sun/star/sdbc/XResultSetUpdate.hpp> #include <com/sun/star/sdbcx/Privilege.hpp> #include <com/sun/star/container/XChild.hpp> @@ -102,6 +104,39 @@ using namespace com::sun::star::accessibility; | BROWSER_VLINESFULL \ | BROWSER_HEADERBAR_NEW \ +class RowSetEventListener : public ::cppu::WeakImplHelper1<XRowsChangeListener> +{ + DbGridControl* m_pControl; +public: + RowSetEventListener(DbGridControl* i_pControl) : m_pControl(i_pControl) + { + } +private: + // XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& /*i_aEvt*/) throw ( RuntimeException ) + { + } + virtual void SAL_CALL rowsChanged(const ::com::sun::star::sdb::RowsChangeEvent& i_aEvt) throw ( RuntimeException ) + { + if ( i_aEvt.Action == RowChangeAction::UPDATE ) + { + ::DbGridControl::GrantControlAccess aAccess; + CursorWrapper* pSeek = m_pControl->GetSeekCursor(aAccess); + const DbGridRowRef& rSeekRow = m_pControl->GetSeekRow(aAccess); + const Any* pIter = i_aEvt.Bookmarks.getConstArray(); + const Any* pEnd = pIter + i_aEvt.Bookmarks.getLength(); + for(;pIter != pEnd;++pIter) + { + pSeek->moveToBookmark(*pIter); + // get the data + rSeekRow->SetState(pSeek, sal_True); + sal_Int32 nSeekPos = pSeek->getRow() - 1; + m_pControl->SetSeekPos(nSeekPos,aAccess); + m_pControl->RowModified(nSeekPos); + } + } + } +}; //============================================================================== class GridFieldValueListener; @@ -987,6 +1022,7 @@ DbGridControl::~DbGridControl() m_pDataSourcePropMultiplexer = NULL; m_pDataSourcePropListener = NULL; } + m_xRowSetListener.clear(); delete m_pDataCursor; delete m_pSeekCursor; @@ -1377,7 +1413,7 @@ sal_Bool DbGridControl::IsPermanentCursorEnabled() const } //------------------------------------------------------------------------------ -void DbGridControl::refreshController(sal_uInt16 _nColId, GrantCellControlAccess /*_aAccess*/) +void DbGridControl::refreshController(sal_uInt16 _nColId, GrantControlAccess /*_aAccess*/) { if ((GetCurColumnId() == _nColId) && IsEditing()) { // the controller which is currently active needs to be refreshed @@ -1412,6 +1448,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt m_pDataSourcePropMultiplexer = NULL; m_pDataSourcePropListener = NULL; } + m_xRowSetListener.clear(); // is the new cursor valid ? // the cursor is only valid if it contains some columns @@ -1503,7 +1540,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt Reference< XPropertySet > xSet(_xCursor, UNO_QUERY); if (xSet.is()) { - // feststellen welche Updatem�glichkeiten bestehen + // feststellen welche Updatemoeglichkeiten bestehen sal_Int32 nConcurrency = ResultSetConcurrency::READ_ONLY; xSet->getPropertyValue(FM_PROP_RESULTSET_CONCURRENCY) >>= nConcurrency; @@ -1565,6 +1602,12 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt xSet->getPropertyValue(FM_PROP_ROWCOUNT) >>= nRecordCount; m_bRecordCountFinal = ::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ROWCOUNTFINAL)); + m_xRowSetListener = new RowSetEventListener(this); + Reference< XRowsChangeBroadcaster> xChangeBroad(xSet,UNO_QUERY); + if ( xChangeBroad.is( ) ) + xChangeBroad->addRowsChangeListener(m_xRowSetListener); + + // insert the currently known rows // and one row if we are able to insert rows if (m_nOptions & OPT_INSERT) diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index f507068b6e2d..96bdd27d62e1 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -78,6 +78,7 @@ #include <svx/fmglob.hxx> #include <svl/eitem.hxx> #include <tools/shl.hxx> +#include <tools/diagnose_ex.h> #include <svx/svdpage.hxx> #include <svx/fmmodel.hxx> #include <svx/dialmgr.hxx> @@ -98,6 +99,8 @@ #include <svx/svxdlg.hxx> //CHINA001 #include <svx/dialogs.hrc> //CHINA001 +#include "svx/sdrobjectfilter.hxx" + #define HANDLE_SQL_ERRORS( action, successflag, context, message ) \ try \ { \ @@ -544,7 +547,7 @@ void FmFormShell::Execute(SfxRequest &rReq) case SID_FM_SCROLLBAR: case SID_FM_SPINBUTTON: { - SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_GRABCONTROLFOCUS, sal_False ); + SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_TOGGLECONTROLFOCUS, sal_False ); if ( pGrabFocusItem && pGrabFocusItem->GetValue() ) { // see below SfxViewShell* pShell = GetViewShell(); @@ -572,9 +575,9 @@ void FmFormShell::Execute(SfxRequest &rReq) { // #99013# if selected with control key, return focus to current view // do this asynchron, so that the creation can be finished first - // reusing the SID_FM_GRABCONTROLFOCUS is somewhat hacky ... which it wouldn't if it would have another + // reusing the SID_FM_TOGGLECONTROLFOCUS is somewhat hacky ... which it wouldn't if it would have another // name, so I do not really have a big problem with this .... - SfxBoolItem aGrabFocusIndicatorItem( SID_FM_GRABCONTROLFOCUS, sal_True ); + SfxBoolItem aGrabFocusIndicatorItem( SID_FM_TOGGLECONTROLFOCUS, sal_True ); GetViewShell()->GetViewFrame()->GetDispatcher()->Execute( nSlot, SFX_CALLMODE_ASYNCHRON, &aGrabFocusIndicatorItem, NULL ); } @@ -595,11 +598,27 @@ void FmFormShell::Execute(SfxRequest &rReq) } break; - case SID_FM_GRABCONTROLFOCUS: + case SID_FM_TOGGLECONTROLFOCUS: { FmFormView* pFormView = GetFormView(); - if ( pFormView ) + if ( !pFormView ) + break; + + // if we execute this ourself, then either the application does not implement an own handling for this, + // of we're on the top of the dispatcher stack, which means a control has the focus. + // In the latter case, we put the focus to the document window, otherwise, we focus the first control + const bool bHasControlFocus = GetImpl()->HasControlFocus(); + if ( bHasControlFocus ) + { + const OutputDevice* pDevice = GetCurrentViewDevice(); + Window* pWindow = dynamic_cast< Window* >( const_cast< OutputDevice* >( pDevice ) ); + if ( pWindow ) + pWindow->GrabFocus(); + } + else + { pFormView->GrabFirstControlFocus( ); + } } break; @@ -1353,6 +1372,78 @@ namespace } //------------------------------------------------------------------------ +void FmFormShell::ToggleControlFocus( const SdrUnoObj& i_rUnoObject, const SdrView& i_rView, OutputDevice& i_rDevice ) const +{ + try + { + // check if the focus currently is in a control + // Well, okay, do it the other way 'round: Check whether the current control of the active controller + // actually has the focus. This should be equivalent. + const bool bHasControlFocus = GetImpl()->HasControlFocus(); + + if ( bHasControlFocus ) + { + Window* pWindow( dynamic_cast< Window* >( &i_rDevice ) ); + OSL_ENSURE( pWindow, "FmFormShell::ToggleControlFocus: I need a Window, really!" ); + if ( pWindow ) + pWindow->GrabFocus(); + } + else + { + Reference< XControl > xControl; + GetFormControl( i_rUnoObject.GetUnoControlModel(), i_rView, i_rDevice, xControl ); + Reference< XWindow > xControlWindow( xControl, UNO_QUERY ); + if ( xControlWindow.is() ) + xControlWindow->setFocus(); + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +//------------------------------------------------------------------------ +namespace +{ + class FocusableControlsFilter : public ::svx::ISdrObjectFilter + { + public: + FocusableControlsFilter( const SdrView& i_rView, const OutputDevice& i_rDevice ) + :m_rView( i_rView ) + ,m_rDevice( i_rDevice ) + { + } + + public: + virtual bool includeObject( const SdrObject& i_rObject ) const + { + const SdrUnoObj* pUnoObj = dynamic_cast< const SdrUnoObj* >( &i_rObject ); + if ( !pUnoObj ) + return false; + + Reference< XControl > xControl = pUnoObj->GetUnoControl( m_rView, m_rDevice ); + return FmXFormView::isFocusable( xControl ); + } + + private: + const SdrView& m_rView; + const OutputDevice& m_rDevice; + }; +} + +//------------------------------------------------------------------------ +::std::auto_ptr< ::svx::ISdrObjectFilter > FmFormShell::CreateFocusableControlFilter( const SdrView& i_rView, const OutputDevice& i_rDevice ) const +{ + ::std::auto_ptr< ::svx::ISdrObjectFilter > pFilter; + + if ( !i_rView.IsDesignMode() ) + pFilter.reset( new FocusableControlsFilter( i_rView, i_rDevice ) ); + + return pFilter; +} + +//------------------------------------------------------------------------ SdrUnoObj* FmFormShell::GetFormControl( const Reference< XControlModel >& _rxModel, const SdrView& _rView, const OutputDevice& _rDevice, Reference< XControl >& _out_rxControl ) const { if ( !_rxModel.is() ) diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index bb18ae76f4e3..52ad139543c5 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -56,6 +56,7 @@ #include "svx/svxids.hrc" /** === begin UNO includes === **/ +#include <com/sun/star/awt/XWindow2.hpp> #include <com/sun/star/awt/XCheckBox.hpp> #include <com/sun/star/awt/XListBox.hpp> #include <com/sun/star/awt/XTextComponent.hpp> @@ -4183,6 +4184,31 @@ void FmXFormShell::handleMouseButtonDown( const SdrViewEvent& _rViewEvent ) } } +//------------------------------------------------------------------------------ +bool FmXFormShell::HasControlFocus() const +{ + bool bHasControlFocus = false; + + try + { + Reference< XFormController > xController( getActiveController() ); + Reference< XControl > xCurrentControl; + if ( xController.is() ) + xCurrentControl.set( xController->getCurrentControl() ); + if ( xCurrentControl.is() ) + { + Reference< XWindow2 > xPeerWindow( xCurrentControl->getPeer(), UNO_QUERY_THROW ); + bHasControlFocus = xPeerWindow->hasFocus(); + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + return bHasControlFocus; +} + //============================================================================== //============================================================================== SearchableControlIterator::SearchableControlIterator(Reference< XInterface> xStartingPoint) diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index 430c52cfa4db..320baea302b7 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -130,7 +130,6 @@ namespace svx SID_ATTR_LRSPACE, /* 48 */ SID_ATTR_ULSPACE, /* 49 */ SID_ATTR_CHAR_AUTOKERN, - SID_ATTR_CHAR_OVERLINE, SID_SET_SUPER_SCRIPT, SID_SET_SUB_SCRIPT, SID_CHAR_DLG, @@ -141,6 +140,7 @@ namespace svx SID_ATTR_CHAR_RELIEF, SID_ATTR_PARA_LEFT_TO_RIGHT, /* 950 */ SID_ATTR_PARA_RIGHT_TO_LEFT, + SID_ATTR_CHAR_OVERLINE, 0 }; diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx index 068f4aa8a029..460d2e1cd787 100644 --- a/svx/source/form/fmtools.cxx +++ b/svx/source/form/fmtools.cxx @@ -72,6 +72,8 @@ /** === end UNO includes === **/ #include <basic/sbxvar.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <comphelper/container.hxx> #include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 1b5c7daf371c..0bf6a35abd98 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -823,6 +823,48 @@ void FmXFormView::AutoFocus( sal_Bool _bSync ) else m_nAutoFocusEvent = Application::PostUserEvent(LINK(this, FmXFormView, OnAutoFocus)); } + +// ----------------------------------------------------------------------------- +bool FmXFormView::isFocusable( const Reference< XControl >& i_rControl ) +{ + if ( !i_rControl.is() ) + return false; + + try + { + Reference< XPropertySet > xModelProps( i_rControl->getModel(), UNO_QUERY_THROW ); + + // only enabled controls are allowed to participate + sal_Bool bEnabled = sal_False; + OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_ENABLED ) >>= bEnabled ); + if ( !bEnabled ) + return false; + + // check the class id of the control model + sal_Int16 nClassId = FormComponentType::CONTROL; + OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId ); + + // controls which are not focussable + if ( ( FormComponentType::CONTROL != nClassId ) + && ( FormComponentType::IMAGEBUTTON != nClassId ) + && ( FormComponentType::GROUPBOX != nClassId ) + && ( FormComponentType::FIXEDTEXT != nClassId ) + && ( FormComponentType::HIDDENCONTROL != nClassId ) + && ( FormComponentType::IMAGECONTROL != nClassId ) + && ( FormComponentType::SCROLLBAR != nClassId ) + && ( FormComponentType::SPINBUTTON!= nClassId ) + ) + { + return true; + } + } + catch( const Exception& e ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return false; +} + // ----------------------------------------------------------------------------- static Reference< XControl > lcl_firstFocussableControl( const Sequence< Reference< XControl > >& _rControls ) { @@ -833,47 +875,19 @@ static Reference< XControl > lcl_firstFocussableControl( const Sequence< Referen const Reference< XControl >* pControlsEnd = _rControls.getConstArray() + _rControls.getLength(); for ( ; pControls != pControlsEnd; ++pControls ) { - try - { - if ( !pControls->is() ) - continue; - - Reference< XPropertySet > xModelProps( (*pControls)->getModel(), UNO_QUERY_THROW ); - - // only enabled controls are allowed to participate - sal_Bool bEnabled = sal_False; - OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_ENABLED ) >>= bEnabled ); - if ( !bEnabled ) - continue; - - // check the class id of the control model - sal_Int16 nClassId = FormComponentType::CONTROL; - OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId ); - - // controls which are not focussable - if ( ( FormComponentType::CONTROL != nClassId ) - && ( FormComponentType::IMAGEBUTTON != nClassId ) - && ( FormComponentType::GROUPBOX != nClassId ) - && ( FormComponentType::FIXEDTEXT != nClassId ) - && ( FormComponentType::HIDDENCONTROL != nClassId ) - && ( FormComponentType::IMAGECONTROL != nClassId ) - && ( FormComponentType::SCROLLBAR != nClassId ) - && ( FormComponentType::SPINBUTTON!= nClassId ) - ) - { - xReturn = *pControls; - break; - } - } - catch( const Exception& e ) + if ( !pControls->is() ) + continue; + + if ( FmXFormView::isFocusable( *pControls ) ) { - (void)e; // make compiler happy + xReturn = *pControls; + break; } - - if ( !xReturn.is() && _rControls.getLength() ) - xReturn = _rControls[0]; } + if ( !xReturn.is() && _rControls.getLength() ) + xReturn = _rControls[0]; + return xReturn; } @@ -1008,11 +1022,6 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/) } // ----------------------------------------------------------------------------- -namespace -{ -} - -// ----------------------------------------------------------------------------- void FmXFormView::onCreatedFormObject( FmFormObj& _rFormObject ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::onCreatedFormObject" ); @@ -1590,7 +1599,13 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext& xLabelModel.set( pLabel->GetUnoControlModel(), UNO_QUERY ); if ( xLabelModel.is() ) { - xLabelModel->setPropertyValue( FM_PROP_LABEL, makeAny( sFieldName + _rFieldPostfix ) ); + ::rtl::OUString sLabel; + if ( _rxField.is() && _rxField->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) ) + _rxField->getPropertyValue(FM_PROP_LABEL) >>= sLabel; + if ( !sLabel.getLength() ) + sLabel = sFieldName; + + xLabelModel->setPropertyValue( FM_PROP_LABEL, makeAny( sLabel + _rFieldPostfix ) ); String sObjectLabel( SVX_RES( RID_STR_OBJECT_LABEL ) ); sObjectLabel.SearchAndReplaceAllAscii( "#object#", sFieldName ); xLabelModel->setPropertyValue( FM_PROP_NAME, makeAny( ::rtl::OUString( sObjectLabel ) ) ); diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx index 5d222e7f5e88..feb160482665 100644 --- a/svx/source/form/formcontrolfactory.cxx +++ b/svx/source/form/formcontrolfactory.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/form/XFormComponent.hpp> #include <com/sun/star/form/FormComponentType.hpp> #include <com/sun/star/awt/ScrollBarOrientation.hpp> +#include <com/sun/star/awt/MouseWheelBehavior.hpp> #include <com/sun/star/form/XGridColumnFactory.hpp> #include <com/sun/star/style/VerticalAlignment.hpp> #include <com/sun/star/awt/LineEndFormat.hpp> @@ -97,6 +98,7 @@ namespace svxform /** === end UNO using === **/ namespace FormComponentType = ::com::sun::star::form::FormComponentType; namespace ScrollBarOrientation = ::com::sun::star::awt::ScrollBarOrientation; + namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior; namespace LineEndFormat = ::com::sun::star::awt::LineEndFormat; namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode; namespace DataType = ::com::sun::star::sdbc::DataType; @@ -506,6 +508,12 @@ namespace svxform _rxControlModel->setPropertyValue( FM_PROP_STRICTFORMAT, makeAny( sal_Bool( sal_True ) ) ); } + // mouse wheel: don't use it for scrolling by default (i110036) + if ( xPSI->hasPropertyByName( FM_PROP_MOUSE_WHEEL_BEHAVIOR ) ) + { + _rxControlModel->setPropertyValue( FM_PROP_MOUSE_WHEEL_BEHAVIOR, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) ); + } + if ( xPSI->hasPropertyByName( FM_PROP_WRITING_MODE ) ) _rxControlModel->setPropertyValue( FM_PROP_WRITING_MODE, makeAny( WritingMode2::CONTEXT ) ); } diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 0c83655042d2..ff60597d70fe 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -2232,7 +2232,7 @@ namespace svxform { SdrPaintWindow* pPaintWindow = pFormView->GetPaintWindow( i ); OutputDevice& rOutDev = pPaintWindow->GetOutputDevice(); - if ( OUTDEV_WINDOW == rOutDev.GetOutDevType() ) + if ( ( OUTDEV_WINDOW == rOutDev.GetOutDevType() ) && !aMarkRect.IsEmpty() ) { pFormView->MakeVisible( aMarkRect, (Window&)rOutDev ); } diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index 7a51348dfaa3..bce51d8d43f5 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -91,9 +91,46 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::form; using namespace ::com::sun::star::container; +using namespace ::com::sun::star; using namespace ::svxform; using namespace ::svx; + +struct ColumnInfo +{ + ::rtl::OUString sColumnName; + ::rtl::OUString sLabel; + bool bColumn; + ColumnInfo(const ::rtl::OUString& i_sColumnName,const ::rtl::OUString& i_sLabel) + : sColumnName(i_sColumnName) + , sLabel(i_sLabel) + , bColumn(true) + { + } + ColumnInfo(const ::rtl::OUString& i_sColumnName) + : sColumnName(i_sColumnName) + , bColumn(false) + { + } +}; + +void lcl_addToList( SvTreeListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns ) +{ + uno::Sequence< ::rtl::OUString > aEntries = i_xColumns->getElementNames(); + const ::rtl::OUString* pEntries = aEntries.getConstArray(); + sal_Int32 nEntries = aEntries.getLength(); + for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries ) + { + uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(*pEntries),UNO_QUERY_THROW); + ::rtl::OUString sLabel; + if ( xColumn->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) ) + xColumn->getPropertyValue(FM_PROP_LABEL) >>= sLabel; + if ( sLabel.getLength() ) + _rListBox.InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); + else + _rListBox.InsertEntry( *pEntries,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); + } +} //================================================================== // class FmFieldWinListBox //================================================================== @@ -149,7 +186,8 @@ void FmFieldWinListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPi aDescriptor[ daConnection ] <<= pTabWin->GetConnection().getTyped(); aDescriptor[ daCommand ] <<= pTabWin->GetObjectName(); aDescriptor[ daCommandType ]<<= pTabWin->GetObjectType(); - aDescriptor[ daColumnName ] <<= ::rtl::OUString( GetEntryText( pSelected ) ); + ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData()); + aDescriptor[ daColumnName ] <<= pInfo->sColumnName; TransferableHelper* pTransferColumn = new OColumnTransferable( aDescriptor, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR @@ -238,7 +276,8 @@ sal_Bool FmFieldWin::createSelectionControls( ) aDescr[ daCommand ] <<= GetObjectName(); aDescr[ daCommandType ] <<= GetObjectType(); - aDescr[ daColumnName ] <<= ::rtl::OUString( pListBox->GetEntryText( pSelected) ); + ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData()); + aDescr[ daColumnName ] <<= pInfo->sColumnName;//::rtl::OUString( pListBox->GetEntryText( pSelected) ); // transfer this to the SFX world SfxUnoAnyItem aDescriptorItem( SID_FM_DATACCESS_DESCRIPTOR, makeAny( aDescr.createPropertyValueSequence() ) ); @@ -344,15 +383,14 @@ void FmFieldWin::UpdateContent(const ::com::sun::star::uno::Reference< ::com::su // the place, and connectRowset should be replaced with ensureRowSetConnection // get the fields of the object - Sequence< ::rtl::OUString> aFieldNames; - if ( m_aConnection.is() && m_aObjectName.getLength() ) - aFieldNames = getFieldNamesByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName ); - // put them into the list - const ::rtl::OUString* pFieldNames = aFieldNames.getConstArray(); - sal_Int32 nFieldsCount = aFieldNames.getLength(); - for ( sal_Int32 i = 0; i < nFieldsCount; ++i, ++pFieldNames) - pListBox->InsertEntry( * pFieldNames); + if ( m_aConnection.is() && m_aObjectName.getLength() ) + { + Reference< XComponent > xKeepFieldsAlive; + Reference< XNameAccess > xColumns = getFieldsByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName,xKeepFieldsAlive ); + if ( xColumns.is() ) + lcl_addToList(*pListBox,xColumns); + } // Prefix setzen UniString aPrefix; diff --git a/svx/source/inc/fmprop.hrc b/svx/source/inc/fmprop.hrc index 72758a4cac4e..a0592c80b90b 100644 --- a/svx/source/inc/fmprop.hrc +++ b/svx/source/inc/fmprop.hrc @@ -174,5 +174,6 @@ #define FM_PROP_INPUT_REQUIRED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputRequired" ) ) #define FM_PROP_WRITING_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) ) #define FM_PROP_MOUSE_WHEEL_BEHAVIOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MouseWheelBehavior" ) ) +#define FM_PROP_DESCRIPTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Description" ) ) #endif // _SVX_FMPROP_HRC diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index 65a2572cd5af..88d2346b9d20 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -481,6 +481,9 @@ public: // if the form belongs to the controller (extern) displaying a grid, the according internal form will // be displayed, _xForm else + // check if the current control of the active controler has the focus + bool HasControlFocus() const; + private: DECL_LINK(OnFoundData, FmFoundRecordInformation*); DECL_LINK(OnCanceledNotFound, FmFoundRecordInformation*); diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx index d643fc4dc403..1131209a384a 100644 --- a/svx/source/inc/fmvwimp.hxx +++ b/svx/source/inc/fmvwimp.hxx @@ -240,6 +240,11 @@ public: void onCreatedFormObject( FmFormObj& _rFormObject ); + static bool + isFocusable( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& i_rControl + ); + private: FmWinRecList::iterator findWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxCC ); //void addWindow(const SdrPageViewWinRec*); diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index c72a59294d6c..acead19ba9ee 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -219,6 +219,7 @@ class DbCellControl { private: ::comphelper::OPropertyChangeMultiplexer* m_pModelChangeBroadcaster; + ::comphelper::OPropertyChangeMultiplexer* m_pFieldChangeBroadcaster; private: sal_Bool m_bTransparent : 1; @@ -348,7 +349,7 @@ private: void implDoPropertyListening( const ::rtl::OUString& _rPropertyName, sal_Bool _bWarnIfNotExistent = sal_True ); /// updates the "readonly" setting on m_pWindow, according to the respective property value in the given model - void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ); + void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel,bool i_bReadOnly ); /// updates the "enabled" setting on m_pWindow, according to the respective property value in the given model void implAdjustEnabled( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ); diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 0aecac047121..40b9aa5153ec 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -299,10 +299,14 @@ namespace sdr { namespace contact { //-------------------------------------------------------------------- void ControlHolder::invalidate() const { - Window* pWindow = VCLUnoHelper::GetWindow( m_xControl->getPeer() ); - OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" ); - if ( pWindow ) - pWindow->Invalidate(); + Reference< XWindowPeer > xPeer( m_xControl->getPeer() ); + if ( xPeer.is() ) + { + Window* pWindow = VCLUnoHelper::GetWindow( xPeer ); + OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" ); + if ( pWindow ) + pWindow->Invalidate(); + } } //-------------------------------------------------------------------- diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 0ea8413f98a1..b594b0404706 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -120,6 +120,7 @@ #include <svx/sdrhittesthelper.hxx> #include <svx/svdundo.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <svx/sdrobjectfilter.hxx> using namespace ::com::sun::star; @@ -3270,4 +3271,11 @@ void SdrObjFactory::RemoveMakeUserDataHdl(const Link& rLink) rLL.RemoveLink(rLink); } +namespace svx +{ + ISdrObjectFilter::~ISdrObjectFilter() + { + } +} + // eof |