From ee5190d0a9425354fb8a8af42328d1411bb7c279 Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Tue, 19 Jan 2010 09:10:33 +0000 Subject: #i108375#: when searching the control belonging to a control model, ask the SdrUnoObj. This will ensure the control is actually created when it does not yet exist. --- svx/source/form/fmshimp.cxx | 104 +++++++++++++++++++++++++++++--------------- svx/source/inc/fmshimp.hxx | 8 +++- 2 files changed, 74 insertions(+), 38 deletions(-) diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index f783aeacf4..c3e5a9f316 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1430,22 +1430,25 @@ void FmXFormShell::ExecuteSearch() return; // filter out the forms which do not contain valid controls at all - FmFormArray::reverse_iterator form = m_aSearchForms.rbegin(); - ::std::vector< String >::reverse_iterator contextName = aContextNames.rbegin(); - sal_Int32 i = m_aSearchForms.size(); - for ( ; - form != m_aSearchForms.rend(); - ++form, ++contextName, --i - ) { - FmSearchContext aTestContext; - aTestContext.nContext = static_cast< sal_Int16 >( i-1 ); - sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext ); - if ( nValidControls == 0 ) + FmFormArray aValidForms; + ::std::vector< String > aValidContexts; + FmFormArray::const_iterator form = m_aSearchForms.begin(); + ::std::vector< String >::const_iterator contextName = aContextNames.begin(); + for ( ; form != m_aSearchForms.end(); ++form, ++contextName ) { - m_aSearchForms.erase( form.base() - 1 ); - aContextNames.erase( contextName.base() - 1 ); + FmSearchContext aTestContext; + aTestContext.nContext = static_cast< sal_Int16 >( form - m_aSearchForms.begin() ); + sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext ); + if ( nValidControls > 0 ) + { + aValidForms.push_back( *form ); + aValidContexts.push_back( *contextName ); + } } + + m_aSearchForms.swap( aValidForms ); + aContextNames.swap( aValidContexts ); } if (m_aSearchForms.size() == 0) @@ -1457,7 +1460,7 @@ void FmXFormShell::ExecuteSearch() // jetzt brauche ich noch einen 'initial context' sal_Int16 nInitialContext = 0; Reference< XForm> xActiveForm( getActiveForm()); - for (i=0; i<(sal_Int32)m_aSearchForms.size(); ++i) + for ( size_t i=0; i<(sal_Int32)m_aSearchForms.size(); ++i ) { if (m_aSearchForms.at(i) == xActiveForm) { @@ -2232,6 +2235,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) FmFormObj* pFormObject = FmFormObj::GetFormObject( pObject ); Reference< XControlModel > xControlModel( pFormObject ? pFormObject->GetUnoControlModel() : Reference< XControlModel >() ); DBG_ASSERT( xControlModel.is(), "FmXFormShell::OnFoundData: invalid control!" ); + if ( !xControlModel.is() ) + return 0; // disable the permanent cursor for the last grid we found a record if (m_xLastGridFound.is() && (m_xLastGridFound != xControlModel)) @@ -2249,7 +2254,7 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) sal_Int32 nGridColumn = m_arrRelativeGridColumn.GetObject(pfriWhere->nFieldPos); if (nGridColumn != -1) { // dummer weise muss ich mir das Control erst wieder besorgen - Reference< XControl> xControl( GetControlFromModel(xControlModel)); + Reference< XControl> xControl( impl_getControl( xControlModel, *pFormObject ) ); Reference< XGrid> xGrid(xControl, UNO_QUERY); DBG_ASSERT(xGrid.is(), "FmXFormShell::OnFoundData : ungueltiges Control !"); // wenn eine der Asserts anschlaegt, habe ich beim Aufbauen von m_arrSearchedControls wohl was falsch gemacht @@ -2261,7 +2266,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) xModelSet->setPropertyValue( FM_PROP_CURSORCOLOR, makeAny( sal_Int32( COL_LIGHTRED ) ) ); m_xLastGridFound = xControlModel; - xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn); + if ( xGrid.is() ) + xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn); } // als der Cursor neu positioniert wurde, habe ich (in positioned) meine Formularleisten-Slots invalidiert, aber das greift @@ -2369,7 +2375,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn // ... nach der ControlSource-Eigenschaft fragen SearchableControlIterator iter( xCurrentFormComponent ); - Reference< XControl> xControlBehindModel; + Reference< XControl> xControl; // das Control, das als Model xControlModel hat // (das folgende while kann mehrmals durchlaufen werden, ohne dass das Control sich aendert, dann muss // ich nicht jedesmal neu suchen) @@ -2381,10 +2387,12 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn if ( sControlSource.getLength() == 0 ) { // das aktuelle Element hat keine ControlSource, also ist es ein GridControl (das ist das einzige, was // der SearchableControlIterator noch zulaesst) - xControlBehindModel = GetControlFromModel(xControlModel); - DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !"); + xControl = impl_getControl( xControlModel, *pFormObject ); + DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !"); - Reference< XGridPeer> xGridPeer(xControlBehindModel->getPeer(), UNO_QUERY); + Reference< XGridPeer> xGridPeer; + if ( xControl.is() ) + xGridPeer.set( xControl->getPeer(), UNO_QUERY ); do { if (!xGridPeer.is()) @@ -2438,13 +2446,13 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn if (sControlSource.getLength() && xValidFormFields->hasByName(sControlSource)) { // jetzt brauche ich das Control zum SdrObject - if (!xControlBehindModel.is()) + if (!xControl.is()) { - xControlBehindModel = GetControlFromModel(xControlModel); - DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !"); + xControl = impl_getControl( xControlModel, *pFormObject ); + DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !"); } - if (IsSearchableControl(xControlBehindModel)) + if (IsSearchableControl(xControl)) { // alle Tests ueberstanden -> in die Liste mit aufnehmen strFieldList += sControlSource.getStr(); strFieldList += ';'; @@ -2460,7 +2468,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn m_arrRelativeGridColumn.Insert(-1, m_arrRelativeGridColumn.Count()); // und fuer die formatierte Suche ... - pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControlBehindModel, UNO_QUERY)); + pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControl, UNO_QUERY)); } } } @@ -2834,24 +2842,48 @@ void FmXFormShell::SetDesignMode(sal_Bool bDesign) } //------------------------------------------------------------------------------ -Reference< XControl> FmXFormShell::GetControlFromModel(const Reference< XControlModel>& xModel) +Reference< XControl> FmXFormShell::impl_getControl( const Reference< XControlModel >& i_rxModel, const FmFormObj& i_rKnownFormObj ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::GetControlFromModel" ); if ( impl_checkDisposed() ) return NULL; - Reference< XControlContainer> xControlContainer( getControlContainerForView() ); + Reference< XControl > xControl; + try + { + Reference< XControlContainer> xControlContainer( getControlContainerForView(), UNO_SET_THROW ); - Sequence< Reference< XControl> > seqControls( xControlContainer->getControls() ); - Reference< XControl>* pControls = seqControls.getArray(); - // ... die ich dann durchsuchen kann - for (int i=0; i > seqControls( xControlContainer->getControls() ); + const Reference< XControl >* pControls = seqControls.getArray(); + // ... die ich dann durchsuchen kann + for (sal_Int32 i=0; i xCurrentModel( xControl->getModel() ); + if ( xCurrentModel == i_rxModel ) + break; + xControl.clear(); + } + + if ( !xControl.is() ) + { + // fallabck (some controls might not have been created, yet, since they were never visible so far) + Reference< XControl > xContainerControl( xControlContainer, UNO_QUERY_THROW ); + const Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerControl->getPeer() ); + ENSURE_OR_THROW( pContainerWindow, "unexpected control container implementation" ); + + const SdrView* pSdrView = m_pShell ? m_pShell->GetFormView() : NULL; + ENSURE_OR_THROW( pSdrView, "no current view" ); + + xControl.set( i_rKnownFormObj.GetUnoControl( *pSdrView, *pContainerWindow ), UNO_QUERY_THROW ); + } + } + catch( const Exception& ) { - Reference< XControlModel> xSearchLoopModel( pControls[i]->getModel()); - if ((XControlModel*)xSearchLoopModel.get() == (XControlModel*)xModel.get()) - return pControls[i]; + DBG_UNHANDLED_EXCEPTION(); } - return Reference< XControl>(NULL); + + OSL_ENSURE( xControl.is(), "FmXFormShell::impl_getControl: no control found!" ); + return xControl; } //------------------------------------------------------------------------------ diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index 5d378212e9..0f09d9f220 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -179,6 +179,7 @@ typedef ::utl::ConfigItem FmXFormShell_CFGBASE; struct SdrViewEvent; class FmFormShell; class FmFormView; +class FmFormObj; class SAL_DLLPRIVATE FmXFormShell :public FmXFormShell_BASE ,public FmXFormShell_CFGBASE ,public ::svxform::OStaticDataAccessTools @@ -379,8 +380,11 @@ protected: void startListening(); void stopListening(); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl> GetControlFromModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& xModel); - // liefert das Control, welches das angegebene Model hat + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > + impl_getControl( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& i_rxModel, + const FmFormObj& i_rKnownFormObj + ); // sammelt in strNames die Namen aller Formulare static void impl_collectFormSearchContexts_nothrow( -- cgit v1.2.3 From ccbf5a4c7567dcd4f70325890360f60118cae753 Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Wed, 20 Jan 2010 18:45:26 +0000 Subject: reverting the fix for #i108325#, which caused #i108423#. Adding another, less invasive workaround. Still not the final solution, which is covered by issue 108357 --- svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 729e5702e4..97fed3a171 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -237,6 +237,8 @@ namespace sdr { namespace contact { void invalidate() const; + void invalidate() const; + public: inline const Reference< XControl >& getControl() const { return m_xControl; } }; @@ -305,6 +307,15 @@ namespace sdr { namespace contact { pWindow->Invalidate(); } + //-------------------------------------------------------------------- + void ControlHolder::invalidate() const + { + Window* pWindow = VCLUnoHelper::GetWindow( m_xControl->getPeer() ); + OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" ); + if ( pWindow ) + pWindow->Invalidate(); + } + //-------------------------------------------------------------------- ::basegfx::B2DVector ControlHolder::getZoom() const { @@ -1656,6 +1667,9 @@ namespace sdr { namespace contact { Reference< XControlModel > xControlModel( rViewContactOfUnoControl.GetSdrUnoObj().GetUnoControlModel() ); const ControlHolder& rControl( m_pVOCImpl->getExistentControl() ); + if ( !bHadControl && rControl.is() && rControl.isVisible() ) + rControl.invalidate(); + if ( !bHadControl && rControl.is() && rControl.isVisible() ) rControl.invalidate(); -- cgit v1.2.3 From 9c095b866cea37f76cbd7c357434e453479f681a Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Wed, 20 Jan 2010 19:31:43 +0000 Subject: #i10000# --- svx/source/form/fmshimp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index c3e5a9f316..315a064148 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1460,7 +1460,7 @@ void FmXFormShell::ExecuteSearch() // jetzt brauche ich noch einen 'initial context' sal_Int16 nInitialContext = 0; Reference< XForm> xActiveForm( getActiveForm()); - for ( size_t i=0; i<(sal_Int32)m_aSearchForms.size(); ++i ) + for ( size_t i=0; i Date: Thu, 11 Feb 2010 15:46:14 +0000 Subject: #i108897# set first bit to 20h --- connectivity/source/drivers/dbase/DTable.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index a913db1cf1..dc64c6cc50 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1527,6 +1527,7 @@ BOOL ODbaseTable::InsertRow(OValueRefVector& rRow, BOOL bFlush,const Reference Date: Wed, 17 Mar 2010 11:17:09 +0000 Subject: #i109366# add SAL_DLLPUBLIC_EXPORT --- connectivity/source/drivers/macab/MacabServices.cxx | 6 +++--- connectivity/source/drivers/macab/makefile.mk | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/connectivity/source/drivers/macab/MacabServices.cxx b/connectivity/source/drivers/macab/MacabServices.cxx index 84cdb27d5c..ee0ec58f39 100644 --- a/connectivity/source/drivers/macab/MacabServices.cxx +++ b/connectivity/source/drivers/macab/MacabServices.cxx @@ -114,7 +114,7 @@ struct ProviderRequest //--------------------------------------------------------------------------------------- -extern "C" void SAL_CALL component_getImplementationEnvironment( +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, uno_Environment ** ) @@ -123,7 +123,7 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( } //--------------------------------------------------------------------------------------- -extern "C" sal_Bool SAL_CALL component_writeInfo( +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) @@ -148,7 +148,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( } //--------------------------------------------------------------------------------------- -extern "C" void* SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void*) diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk index 376273b11a..4af290682d 100644 --- a/connectivity/source/drivers/macab/makefile.mk +++ b/connectivity/source/drivers/macab/makefile.mk @@ -70,6 +70,7 @@ SHL1IMPLIB= i$(TARGET) SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) +DEF1EXPORTFILE= exports.dxp # === MACAB impl library ========================== -- cgit v1.2.3 From efc06c17b8797d35fd73d478eaa4bfa821d2206b Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 17 Mar 2010 12:19:26 +0000 Subject: removed export.dxp --- connectivity/source/drivers/macab/makefile.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk index 4af290682d..376273b11a 100644 --- a/connectivity/source/drivers/macab/makefile.mk +++ b/connectivity/source/drivers/macab/makefile.mk @@ -70,7 +70,6 @@ SHL1IMPLIB= i$(TARGET) SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) -DEF1EXPORTFILE= exports.dxp # === MACAB impl library ========================== -- cgit v1.2.3 From b18a9914fd27790e0d1e1571de3c6980a85236d2 Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 17 Mar 2010 12:53:49 +0000 Subject: add SAL_DLLPUBLIC_EXPORT --- connectivity/source/drivers/macab/MacabConnection.cxx | 3 ++- connectivity/source/drivers/macab/makefile.mk | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/connectivity/source/drivers/macab/MacabConnection.cxx b/connectivity/source/drivers/macab/MacabConnection.cxx index 8d3bdf6ff5..2a079c87d3 100644 --- a/connectivity/source/drivers/macab/MacabConnection.cxx +++ b/connectivity/source/drivers/macab/MacabConnection.cxx @@ -314,10 +314,11 @@ MacabAddressBook* MacabConnection::getAddressBook() const return m_pAddressBook; } // ----------------------------------------------------------------------------- -extern "C" void* SAL_CALL createMacabConnection( void* _pDriver ) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL createMacabConnection( void* _pDriver ) { MacabConnection* pConnection = new MacabConnection( static_cast< MacabDriver* >( _pDriver ) ); // by definition, the pointer crossing library boundaries as void ptr is acquired once pConnection->acquire(); return pConnection; } + diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk index 376273b11a..18e64217be 100644 --- a/connectivity/source/drivers/macab/makefile.mk +++ b/connectivity/source/drivers/macab/makefile.mk @@ -54,8 +54,6 @@ DEPOBJFILES= \ # --- Library ----------------------------------- -SHL1VERSIONMAP=$(TARGET).map - SHL1TARGET= $(TARGET)$(MACAB_MAJOR) SHL1OBJS=$(SLOFILES) SHL1STDLIBS=\ @@ -98,8 +96,6 @@ MACAB_LIB=-framework Carbon -framework AddressBook # --- Library ----------------------------------- -SHL2VERSIONMAP=$(TARGET2).map - SHL2TARGET= $(TARGET2)$(MACAB_MAJOR) SHL2OBJS=$(SLO2FILES) SHL2STDLIBS=\ -- cgit v1.2.3 From e3f006b43b5c297518bf3d01576e8e12515af78e Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 17 Mar 2010 12:54:06 +0000 Subject: add SAL_DLLPUBLIC_EXPORT --- connectivity/source/drivers/macab/macab.map | 8 -------- connectivity/source/drivers/macab/macabdrv.map | 6 ------ 2 files changed, 14 deletions(-) delete mode 100755 connectivity/source/drivers/macab/macab.map delete mode 100755 connectivity/source/drivers/macab/macabdrv.map diff --git a/connectivity/source/drivers/macab/macab.map b/connectivity/source/drivers/macab/macab.map deleted file mode 100755 index fe2d1ac905..0000000000 --- a/connectivity/source/drivers/macab/macab.map +++ /dev/null @@ -1,8 +0,0 @@ -MACAB_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/connectivity/source/drivers/macab/macabdrv.map b/connectivity/source/drivers/macab/macabdrv.map deleted file mode 100755 index d953690f6b..0000000000 --- a/connectivity/source/drivers/macab/macabdrv.map +++ /dev/null @@ -1,6 +0,0 @@ -MACAB_1_0 { - global: - createMacabConnection; - local: - *; -}; -- cgit v1.2.3 From 3b4f8634f8147fb54d633351a28179422295de7e Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Tue, 23 Mar 2010 14:10:06 +0000 Subject: #i109366# remove :* from url --- connectivity/source/drivers/macab/macab.xcu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/drivers/macab/macab.xcu b/connectivity/source/drivers/macab/macab.xcu index 7d4fa6df7d..0845bc9a2c 100644 --- a/connectivity/source/drivers/macab/macab.xcu +++ b/connectivity/source/drivers/macab/macab.xcu @@ -27,7 +27,7 @@ ************************************************************************ --> - + com.sun.star.comp.sdbc.macab.Driver -- cgit v1.2.3