diff options
author | Kurt Zenker <kz@openoffice.org> | 2010-04-12 17:31:12 +0200 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2010-04-12 17:31:12 +0200 |
commit | 9cd2a3fd1b35ef41642b86b099e9df7cdac02810 (patch) | |
tree | 9ac6f5b3d806c073ca1e9e86c067c5ed1caa671e | |
parent | 970198e03baa58475f40c26340733b44b1d82999 (diff) | |
parent | 3b4f8634f8147fb54d633351a28179422295de7e (diff) |
CWS-TOOLING: integrate CWS dba321a
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 1 | ||||
-rw-r--r-- | connectivity/source/drivers/macab/MacabConnection.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/macab/MacabServices.cxx | 6 | ||||
-rwxr-xr-x | connectivity/source/drivers/macab/macab.map | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/macab/macab.xcu | 2 | ||||
-rwxr-xr-x | connectivity/source/drivers/macab/macabdrv.map | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/macab/makefile.mk | 4 | ||||
-rw-r--r-- | svx/source/form/fmshimp.cxx | 104 | ||||
-rw-r--r-- | svx/source/inc/fmshimp.hxx | 8 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 14 |
10 files changed, 95 insertions, 61 deletions
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<X // Buffer mit Leerzeichen fuellen AllocBuffer(); memset(m_pBuffer, 0, m_aHeader.db_slng); + m_pBuffer[0] = ' '; // Gesamte neue Row uebernehmen: // ... und am Ende als neuen Record hinzufuegen: 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/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/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/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 @@ ************************************************************************ --> <oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <node oor:name="Installed"> - <node oor:name="sdbc:address:macab:*" oor:op="replace"> + <node oor:name="sdbc:address:macab" oor:op="replace"> <prop oor:name="Driver"> <value>com.sun.star.comp.sdbc.macab.Driver</value> </prop> 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: - *; -}; 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=\ diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index f783aeacf4..315a064148 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<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.getLength(); ++i) + Sequence< Reference< XControl > > seqControls( xControlContainer->getControls() ); + const Reference< XControl >* pControls = seqControls.getArray(); + // ... die ich dann durchsuchen kann + for (sal_Int32 i=0; i<seqControls.getLength(); ++i) + { + xControl.set( pControls[i], UNO_SET_THROW ); + Reference< XControlModel > 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( 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; } }; @@ -306,6 +308,15 @@ 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(); + } + + //-------------------------------------------------------------------- ::basegfx::B2DVector ControlHolder::getZoom() const { // no check whether we're valid, this is the responsibility of the caller @@ -1659,6 +1670,9 @@ namespace sdr { namespace contact { if ( !bHadControl && rControl.is() && rControl.isVisible() ) rControl.invalidate(); + if ( !bHadControl && rControl.is() && rControl.isVisible() ) + rControl.invalidate(); + // check if we already have an XControl. if ( !xControlModel.is() || !rControl.is() ) // use the default mechanism. This will create a ControlPrimitive2D without |