From e39dac8cb3f4d98f6aab875f64672b1f502264a2 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 30 Oct 2009 13:12:29 +0100 Subject: cleaned up fmtools.?xx, so that only files which need it include it, and functions having 1 client only are moved to the client file --- svx/source/fmcomp/fmgridif.cxx | 13 +- svx/source/fmcomp/gridcols.cxx | 35 ++- svx/source/form/filtnav.cxx | 1 - svx/source/form/fmobj.cxx | 72 +++-- svx/source/form/fmobjfac.cxx | 1 - svx/source/form/fmpage.cxx | 1 - svx/source/form/fmshell.cxx | 1 - svx/source/form/fmshimp.cxx | 238 ++++++++++++++- svx/source/form/fmsrcimp.cxx | 1 - svx/source/form/fmtools.cxx | 564 ++++-------------------------------- svx/source/form/fmundo.cxx | 68 +++-- svx/source/form/fmview.cxx | 1 - svx/source/form/fmvwimp.cxx | 2 +- svx/source/form/formcontrolling.cxx | 2 +- svx/source/form/tabwin.cxx | 1 - svx/source/inc/filtnav.hxx | 1 - svx/source/inc/fmPropBrw.hxx | 4 +- svx/source/inc/fmexpl.hxx | 6 +- svx/source/inc/fmsrcimp.hxx | 17 +- svx/source/inc/fmtools.hxx | 52 +--- svx/source/inc/gridcell.hxx | 2 +- svx/source/inc/tabwin.hxx | 3 - 22 files changed, 460 insertions(+), 626 deletions(-) (limited to 'svx') diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 0bfc7c768973..c7e19499e70a 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -34,14 +34,15 @@ #include "fmgridif.hxx" #include "fmprop.hrc" #include "fmservs.hxx" -#include "fmtools.hxx" #include "fmurl.hxx" +#include "fmtools.hxx" #include "formcontrolfactory.hxx" #include "gridcell.hxx" #include "sdbdatacolumn.hxx" #include "svx/fmgridcl.hxx" #include "svx/svxids.hrc" +/** === begin UNO includes === **/ #include #include #include @@ -52,6 +53,8 @@ #include #include #include +#include +/** === end UNO includes === **/ #include #include @@ -1118,7 +1121,7 @@ namespace fmgridif { const ::rtl::OUString getDataModeIdentifier() { - static ::rtl::OUString s_sDataModeIdentifier = DATA_MODE; + static ::rtl::OUString s_sDataModeIdentifier = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) ); return s_sDataModeIdentifier; } } @@ -2457,7 +2460,7 @@ void FmXGridPeer::setMode(const ::rtl::OUString& Mode) throw( NoSupportException m_aMode = Mode; FmGridControl* pGrid = (FmGridControl*) GetWindow(); - if (Mode == FILTER_MODE) + if ( Mode == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterMode" ) ) ) pGrid->SetFilterMode(sal_True); else { @@ -2480,8 +2483,8 @@ void FmXGridPeer::setMode(const ::rtl::OUString& Mode) throw( NoSupportException { aModes.realloc(2); ::rtl::OUString* pModes = aModes.getArray(); - pModes[0] = DATA_MODE; - pModes[1] = FILTER_MODE; + pModes[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) ); + pModes[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterMode" ) ); } return aModes; } diff --git a/svx/source/fmcomp/gridcols.cxx b/svx/source/fmcomp/gridcols.cxx index da7fe3447b0a..1fb7c69c9835 100644 --- a/svx/source/fmcomp/gridcols.cxx +++ b/svx/source/fmcomp/gridcols.cxx @@ -34,7 +34,8 @@ #include #include #include "fmservs.hxx" -#include "fmtools.hxx" + +using namespace ::com::sun::star::uno; //------------------------------------------------------------------------------ const ::comphelper::StringSequence& getColumnTypes() @@ -57,6 +58,36 @@ const ::comphelper::StringSequence& getColumnTypes() return aColumnTypes; } +//------------------------------------------------------------------ +// Vergleichen von PropertyInfo +extern "C" int +#if defined( WNT ) + __cdecl +#endif +#if defined( ICC ) && defined( OS2 ) +_Optlink +#endif + NameCompare(const void* pFirst, const void* pSecond) +{ + return ((::rtl::OUString*)pFirst)->compareTo(*(::rtl::OUString*)pSecond); +} + +namespace +{ + //------------------------------------------------------------------------------ + sal_Int32 lcl_findPos(const ::rtl::OUString& aStr, const Sequence< ::rtl::OUString>& rList) + { + const ::rtl::OUString* pStrList = rList.getConstArray(); + ::rtl::OUString* pResult = (::rtl::OUString*) bsearch(&aStr, (void*)pStrList, rList.getLength(), sizeof(::rtl::OUString), + &NameCompare); + + if (pResult) + return (pResult - pStrList); + else + return -1; + } +} + //------------------------------------------------------------------------------ sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName) { @@ -79,7 +110,7 @@ sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName) : aModelName.copy(aCompatibleModelPrefix.getLength()); const ::comphelper::StringSequence& rColumnTypes = getColumnTypes(); - nTypeId = findPos(aColumnType, rColumnTypes); + nTypeId = lcl_findPos(aColumnType, rColumnTypes); } return nTypeId; } diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 73b077068ac3..dec2f4c0d5a6 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index f2773b7350fa..e6ec36515e87 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -30,35 +30,35 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#include -#include #include "fmobj.hxx" #include "fmprop.hrc" #include "fmvwimp.hxx" -#include -#include +#include "fmtools.hxx" +#include "fmpgeimp.hxx" +#include "fmresids.hrc" +#include "svx/fmview.hxx" +#include "svx/fmglob.hxx" +#include "svx/fmpage.hxx" +#include "svx/editeng.hxx" +#include "svx/svdovirt.hxx" +#include "svx/fmmodel.hxx" +#include "svx/dialmgr.hxx" /** === begin UNO includes === **/ #include #include #include #include +#include /** === end UNO includes === **/ -#include -#include "fmtools.hxx" -#include -#include -#include "fmresids.hrc" -#include -#include - -#include "fmpgeimp.hxx" -#include +#include #include #include #include #include +#include +#include using namespace ::com::sun::star::io; using namespace ::com::sun::star::uno; @@ -421,11 +421,49 @@ void FmFormObj::operator= (const SdrObject& rObj) } } +//------------------------------------------------------------------ +namespace +{ + String lcl_getFormComponentAccessPath(const Reference< XInterface >& _xElement, Reference< XInterface >& _rTopLevelElement) + { + Reference< ::com::sun::star::form::XFormComponent> xChild(_xElement, UNO_QUERY); + Reference< ::com::sun::star::container::XIndexAccess> xParent; + if (xChild.is()) + xParent = Reference< ::com::sun::star::container::XIndexAccess>(xChild->getParent(), UNO_QUERY); + + // while the current content is a form + String sReturn; + String sCurrentIndex; + while (xChild.is()) + { + // get the content's relative pos within it's parent container + sal_Int32 nPos = getElementPos(xParent, xChild); + + // prepend this current relaive pos + sCurrentIndex = String::CreateFromInt32(nPos); + if (sReturn.Len() != 0) + { + sCurrentIndex += '\\'; + sCurrentIndex += sReturn; + } + + sReturn = sCurrentIndex; + + // travel up + if (::comphelper::query_interface((Reference< XInterface >)xParent,xChild)) + xParent = Reference< ::com::sun::star::container::XIndexAccess>(xChild->getParent(), UNO_QUERY); + } + + _rTopLevelElement = xParent; + return sReturn; + } +} + //------------------------------------------------------------------ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface > & _rSourceContainer, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > _rTopLevelDestContainer) { Reference< XInterface > xTopLevelSouce; - String sAccessPath = getFormComponentAccessPath(_rSourceContainer, xTopLevelSouce); + String sAccessPath = lcl_getFormComponentAccessPath(_rSourceContainer, xTopLevelSouce); if (!xTopLevelSouce.is()) // somthing went wrong, maybe _rSourceContainer isn't part of a valid forms hierarchy return Reference< XInterface > (); @@ -532,8 +570,8 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface > DBG_ASSERT(xSourcePersist.is(), "FmFormObj::ensureModelEnv : invalid form (no persist object) !"); // create and insert (into the destination) a clone of the form - xCurrentDestForm = Reference< XPropertySet > (cloneUsingProperties(xSourcePersist), UNO_QUERY); - DBG_ASSERT(xCurrentDestForm.is(), "FmFormObj::ensureModelEnv : invalid cloned form !"); + Reference< XCloneable > xCloneable( xSourcePersist, UNO_QUERY_THROW ); + xCurrentDestForm.set( xCloneable->createClone(), UNO_QUERY_THROW ); DBG_ASSERT(nCurrentDestIndex == xDestContainer->getCount(), "FmFormObj::ensureModelEnv : something went wrong with the numbers !"); xDestContainer->insertByIndex(nCurrentDestIndex, makeAny(xCurrentDestForm)); diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx index e2c9101b718c..0a8bfe1c7885 100644 --- a/svx/source/form/fmobjfac.cxx +++ b/svx/source/form/fmobjfac.cxx @@ -32,7 +32,6 @@ #include "precompiled_svx.hxx" #include #include -#include "fmtools.hxx" #include "fmservs.hxx" #ifndef _FM_FMOBJFAC_HXX diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx index 0ead41eb87bc..69c04ff862bf 100644 --- a/svx/source/form/fmpage.cxx +++ b/svx/source/form/fmpage.cxx @@ -78,7 +78,6 @@ #include "fmprop.hrc" #endif #include "fmundo.hxx" -#include "fmtools.hxx" using namespace ::svxform; #endif #include diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index fff584964132..4820cf44978b 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -32,7 +32,6 @@ #include "precompiled_svx.hxx" #include "fmvwimp.hxx" #include -#include "fmtools.hxx" #include "fmservs.hxx" #ifndef _SVX_FMPROP_HRC #include "fmprop.hrc" diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 0f6894cb5ac8..228f99ace265 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -39,7 +39,6 @@ #include "fmservs.hxx" #include "fmshimp.hxx" #include "fmtextcontrolshell.hxx" -#include "fmtools.hxx" #include "fmundo.hxx" #include "fmurl.hxx" #include "fmvwimp.hxx" @@ -87,6 +86,7 @@ #include #include #include +#include /** === end UNO includes === **/ #include @@ -110,6 +110,7 @@ #include #include #include +#include #include #include @@ -278,6 +279,7 @@ using namespace ::com::sun::star::view; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::util; using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::script; using namespace ::svxform; using namespace ::svx; @@ -286,7 +288,7 @@ using namespace ::svx; //============================================================================== namespace { - //.................................................................... + //.......................................................................... void collectInterfacesFromMarkList( const SdrMarkList& _rMarkList, InterfaceBag& /* [out] */ _rInterfaces ) { _rInterfaces.clear(); @@ -324,6 +326,198 @@ namespace } } + //.......................................................................... + sal_Int16 GridView2ModelPos(const Reference< XIndexAccess>& rColumns, sal_Int16 nViewPos) + { + try + { + if (rColumns.is()) + { + // loop through all columns + sal_Int16 i; + Reference< XPropertySet> xCur; + for (i=0; igetCount(); ++i) + { + rColumns->getByIndex(i) >>= xCur; + if (!::comphelper::getBOOL(xCur->getPropertyValue(FM_PROP_HIDDEN))) + { + // for every visible col : if nViewPos is greater zero, decrement it, else we + // have found the model position + if (!nViewPos) + break; + else + --nViewPos; + } + } + if (igetCount()) + return i; + } + } + catch(const Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } + return (sal_Int16)-1; + } + + //.......................................................................... + Sequence< ::rtl::OUString> getEventMethods(const Type& type) + { + typelib_InterfaceTypeDescription *pType=0; + type.getDescription( (typelib_TypeDescription**)&pType); + + if(!pType) + return Sequence< ::rtl::OUString>(); + + Sequence< ::rtl::OUString> aNames(pType->nMembers); + ::rtl::OUString* pNames = aNames.getArray(); + for(sal_Int32 i=0;inMembers;i++,++pNames) + { + // the decription reference + typelib_TypeDescriptionReference* pMemberDescriptionReference = pType->ppMembers[i]; + // the description for the reference + typelib_TypeDescription* pMemberDescription = NULL; + typelib_typedescriptionreference_getDescription(&pMemberDescription, pMemberDescriptionReference); + if (pMemberDescription) + { + typelib_InterfaceMemberTypeDescription* pRealMemberDescription = + reinterpret_cast(pMemberDescription); + *pNames = pRealMemberDescription->pMemberName; + } + } + typelib_typedescription_release( (typelib_TypeDescription *)pType ); + return aNames; + } + + //.......................................................................... + void TransferEventScripts(const Reference< XControlModel>& xModel, const Reference< XControl>& xControl, + const Sequence< ScriptEventDescriptor>& rTransferIfAvailable) + { + // first check if we have a XEventAttacherManager for the model + Reference< XChild> xModelChild(xModel, UNO_QUERY); + if (!xModelChild.is()) + return; // nothing to do + + Reference< XEventAttacherManager> xEventManager(xModelChild->getParent(), UNO_QUERY); + if (!xEventManager.is()) + return; // nothing to do + + if (!rTransferIfAvailable.getLength()) + return; // nothing to do + + // check for the index of the model within it's parent + Reference< XIndexAccess> xParentIndex(xModelChild->getParent(), UNO_QUERY); + if (!xParentIndex.is()) + return; // nothing to do + sal_Int32 nIndex = getElementPos(xParentIndex, xModel); + if (nIndex<0 || nIndex>=xParentIndex->getCount()) + return; // nothing to do + + // then we need informations about the listeners supported by the control and the model + Sequence< Type> aModelListeners; + Sequence< Type> aControlListeners; + + Reference< XIntrospection> xModelIntrospection(::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.beans.Introspection")), UNO_QUERY); + Reference< XIntrospection> xControlIntrospection(::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.beans.Introspection")), UNO_QUERY); + + if (xModelIntrospection.is() && xModel.is()) + { + Any aModel(makeAny(xModel)); + aModelListeners = xModelIntrospection->inspect(aModel)->getSupportedListeners(); + } + + if (xControlIntrospection.is() && xControl.is()) + { + Any aControl(makeAny(xControl)); + aControlListeners = xControlIntrospection->inspect(aControl)->getSupportedListeners(); + } + + sal_Int32 nMaxNewLen = aModelListeners.getLength() + aControlListeners.getLength(); + if (!nMaxNewLen) + return; // the model and the listener don't support any listeners (or we were unable to retrieve these infos) + + Sequence< ScriptEventDescriptor> aTransferable(nMaxNewLen); + ScriptEventDescriptor* pTransferable = aTransferable.getArray(); + + const ScriptEventDescriptor* pCurrent = rTransferIfAvailable.getConstArray(); + sal_Int32 i,j,k; + for (i=0; i* pCurrentArray = &aModelListeners; + pCurrentArray; + pCurrentArray = (pCurrentArray == &aModelListeners) ? &aControlListeners : NULL + ) + { + const Type* pCurrentListeners = pCurrentArray->getConstArray(); + for (j=0; jgetLength(); ++j, ++pCurrentListeners) + { + UniString aListener = (*pCurrentListeners).getTypeName(); + xub_StrLen nTokens = aListener.GetTokenCount('.'); + if (nTokens) + aListener = aListener.GetToken(nTokens - 1, '.'); + + if (aListener == pCurrent->ListenerType.getStr()) + // the current ScriptEventDescriptor doesn't match the current listeners class + continue; + + // now check the methods + Sequence< ::rtl::OUString> aMethodsNames = getEventMethods(*pCurrentListeners); + const ::rtl::OUString* pMethodsNames = aMethodsNames.getConstArray(); + for (k=0; kEventMethod) != COMPARE_EQUAL) + // the current ScriptEventDescriptor doesn't match the current listeners current method + continue; + + // we can transfer the script event : the model (control) supports it + *pTransferable = *pCurrent; + ++pTransferable; + break; + } + if (kregisterScriptEvents(nIndex, aTransferable); + } + + //------------------------------------------------------------------------------ + ::rtl::OUString getServiceNameByControlType(sal_Int16 nType) + { + switch (nType) + { + case OBJ_FM_EDIT : return FM_COMPONENT_TEXTFIELD; + case OBJ_FM_BUTTON : return FM_COMPONENT_COMMANDBUTTON; + case OBJ_FM_FIXEDTEXT : return FM_COMPONENT_FIXEDTEXT; + case OBJ_FM_LISTBOX : return FM_COMPONENT_LISTBOX; + case OBJ_FM_CHECKBOX : return FM_COMPONENT_CHECKBOX; + case OBJ_FM_RADIOBUTTON : return FM_COMPONENT_RADIOBUTTON; + case OBJ_FM_GROUPBOX : return FM_COMPONENT_GROUPBOX; + case OBJ_FM_COMBOBOX : return FM_COMPONENT_COMBOBOX; + case OBJ_FM_GRID : return FM_COMPONENT_GRIDCONTROL; + case OBJ_FM_IMAGEBUTTON : return FM_COMPONENT_IMAGEBUTTON; + case OBJ_FM_FILECONTROL : return FM_COMPONENT_FILECONTROL; + case OBJ_FM_DATEFIELD : return FM_COMPONENT_DATEFIELD; + case OBJ_FM_TIMEFIELD : return FM_COMPONENT_TIMEFIELD; + case OBJ_FM_NUMERICFIELD : return FM_COMPONENT_NUMERICFIELD; + case OBJ_FM_CURRENCYFIELD : return FM_COMPONENT_CURRENCYFIELD; + case OBJ_FM_PATTERNFIELD : return FM_COMPONENT_PATTERNFIELD; + case OBJ_FM_HIDDEN : return FM_COMPONENT_HIDDENCONTROL; + case OBJ_FM_IMAGECONTROL : return FM_COMPONENT_IMAGECONTROL; + case OBJ_FM_FORMATTEDFIELD : return FM_COMPONENT_FORMATTEDFIELD; + case OBJ_FM_SCROLLBAR : return FM_SUN_COMPONENT_SCROLLBAR; + case OBJ_FM_SPINBUTTON : return FM_SUN_COMPONENT_SPINBUTTON; + case OBJ_FM_NAVIGATIONBAR : return FM_SUN_COMPONENT_NAVIGATIONBAR; + } + return ::rtl::OUString(); + } + } //------------------------------------------------------------------------------ @@ -4136,6 +4330,44 @@ IMPL_LINK( FmXFormShell, OnLoadForms, FmFormPage*, /*_pPage*/ ) return 0L; } +//------------------------------------------------------------------------------ +namespace +{ + sal_Bool lcl_isLoadable( const Reference< XInterface >& _rxLoadable ) + { + // determines whether a form should be loaded or not + // if there is no datasource or connection there is no reason to load a form + Reference< XPropertySet > xSet( _rxLoadable, UNO_QUERY ); + if ( !xSet.is() ) + return sal_False; + try + { + Reference< XConnection > xConn; + if ( OStaticDataAccessTools().isEmbeddedInDatabase( _rxLoadable.get(), xConn ) ) + return sal_True; + + // is there already a active connection + xSet->getPropertyValue(FM_PROP_ACTIVE_CONNECTION) >>= xConn; + if ( xConn.is() ) + return sal_True; + + ::rtl::OUString sPropertyValue; + OSL_VERIFY( xSet->getPropertyValue( FM_PROP_DATASOURCE ) >>= sPropertyValue ); + if ( sPropertyValue.getLength() ) + return sal_True; + + OSL_VERIFY( xSet->getPropertyValue( FM_PROP_URL ) >>= sPropertyValue ); + if ( sPropertyValue.getLength() ) + return sal_True; + } + catch(const Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } + return sal_False; + } +} + //------------------------------------------------------------------------ void FmXFormShell::loadForms( FmFormPage* _pPage, const sal_uInt16 _nBehaviour /* FORMS_LOAD | FORMS_SYNC */ ) { @@ -4180,7 +4412,7 @@ void FmXFormShell::loadForms( FmFormPage* _pPage, const sal_uInt16 _nBehaviour / { if ( 0 == ( _nBehaviour & FORMS_UNLOAD ) ) { - if ( ::isLoadable( xForm ) && !xForm->isLoaded() ) + if ( lcl_isLoadable( xForm ) && !xForm->isLoaded() ) xForm->load(); } else diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index 3d1235624802..91384d3274d5 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -34,7 +34,6 @@ #ifndef _SVX_FMRESIDS_HRC #include "fmresids.hrc" #endif -#include "fmtools.hxx" #include "fmsrccfg.hxx" #include #include diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx index 03dd6f97021d..c3df100cd873 100644 --- a/svx/source/form/fmtools.cxx +++ b/svx/source/form/fmtools.cxx @@ -30,83 +30,74 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#include -#include -#include -#include -#include -#include + +#include "fmprop.hrc" +#include "fmservs.hxx" #include "fmtools.hxx" #include "svx/dbtoolsclient.hxx" -#include "fmservs.hxx" -#include -#include -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ -#include -#endif +#include "svx/fmglob.hxx" -#include -#include -#include -#include -#include +/** === begin UNO includes === **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include -#include +#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - +#include +#include +#include +#include +/** === end UNO includes === **/ -#include -#include #include -#include -#include - -#ifndef _SVX_FMPROP_HRC -#include "fmprop.hrc" -#endif -#include -#include -#include -#include -#include -#include #include -#include +#include #include +#include #include -#include +#include #include #include -#include +#include +#include #include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; @@ -203,107 +194,9 @@ void displayException(const ::com::sun::star::sdb::SQLErrorEvent& _rEvent, Windo displayException(_rEvent.Reason, _pParent); } -//------------------------------------------------------------------------------ -Reference< XInterface > cloneUsingProperties(const Reference< ::com::sun::star::io::XPersistObject>& _xObj) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::cloneUsingProperties" ); - if (!_xObj.is()) - return Reference< XInterface >(); - - // create a new object - ::rtl::OUString aObjectService = _xObj->getServiceName(); - Reference< ::com::sun::star::beans::XPropertySet> xDestSet(::comphelper::getProcessServiceFactory()->createInstance(aObjectService), UNO_QUERY); - if (!xDestSet.is()) - { - DBG_ERROR("cloneUsingProperties : could not instantiate an object of the given type !"); - return Reference< XInterface >(); - } - // transfer properties - Reference< XPropertySet > xSourceSet(_xObj, UNO_QUERY); - Reference< XPropertySetInfo > xSourceInfo( xSourceSet->getPropertySetInfo()); - Sequence< Property> aSourceProperties = xSourceInfo->getProperties(); - Reference< XPropertySetInfo > xDestInfo( xDestSet->getPropertySetInfo()); - Sequence< Property> aDestProperties = xDestInfo->getProperties(); - int nDestLen = aDestProperties.getLength(); - - Property* pSourceProps = aSourceProperties.getArray(); - Property* pSourceEnd = pSourceProps + aSourceProperties.getLength(); - Property* pDestProps = aDestProperties.getArray(); - - for (; pSourceProps != pSourceEnd; ++pSourceProps) - { - ::com::sun::star::beans::Property* pResult = ::std::lower_bound( - pDestProps, - pDestProps + nDestLen, - pSourceProps->Name, - ::comphelper::PropertyStringLessFunctor() - ); - - if ( ( pResult != pDestProps + nDestLen ) - && ( pResult->Name == pSourceProps->Name ) - && ( pResult->Attributes == pSourceProps->Attributes ) - && ( (pResult->Attributes & PropertyAttribute::READONLY ) == 0 ) - && ( pResult->Type.equals( pSourceProps->Type ) ) - ) - { // Attribute/type are the same and the prop isn't readonly - try - { - xDestSet->setPropertyValue(pResult->Name, xSourceSet->getPropertyValue(pResult->Name)); - } - catch(IllegalArgumentException e) - { - (void)e; -#ifdef DBG_UTIL - ::rtl::OString sMessage("cloneUsingProperties : could not transfer the value for property \""); - sMessage = sMessage + ::rtl::OString(pResult->Name.getStr(), pResult->Name.getLength(), RTL_TEXTENCODING_ASCII_US); - sMessage = sMessage + '\"'; - DBG_ERROR(sMessage); -#endif - } - - } - } - - return xDestSet.get(); -} - -//------------------------------------------------------------------------------ -sal_Bool searchElement(const Reference< ::com::sun::star::container::XIndexAccess>& xCont, const Reference< XInterface >& xElement) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::searchElement" ); - if (!xCont.is() || !xElement.is()) - return sal_False; - - sal_Int32 nCount = xCont->getCount(); - Reference< XInterface > xComp; - for (sal_Int32 i = 0; i < nCount; i++) - { - try - { - xCont->getByIndex(i) >>= xComp; - if (xComp.is()) - { - if ( xElement == xComp ) - return sal_True; - else - { - Reference< ::com::sun::star::container::XIndexAccess> xCont2(xComp, UNO_QUERY); - if (xCont2.is() && searchElement(xCont2, xElement)) - return sal_True; - } - } - } - catch(Exception&) - { - } - } - return sal_False; -} - //------------------------------------------------------------------------------ sal_Int32 getElementPos(const Reference< ::com::sun::star::container::XIndexAccess>& xCont, const Reference< XInterface >& xElement) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::getElementPos" ); sal_Int32 nIndex = -1; if (!xCont.is()) return nIndex; @@ -335,127 +228,6 @@ sal_Int32 getElementPos(const Reference< ::com::sun::star::container::XIndexAcce return nIndex; } -//------------------------------------------------------------------ -String getFormComponentAccessPath(const Reference< XInterface >& _xElement, Reference< XInterface >& _rTopLevelElement) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::getFormComponentAccessPath" ); - Reference< ::com::sun::star::form::XFormComponent> xChild(_xElement, UNO_QUERY); - Reference< ::com::sun::star::container::XIndexAccess> xParent; - if (xChild.is()) - xParent = Reference< ::com::sun::star::container::XIndexAccess>(xChild->getParent(), UNO_QUERY); - - // while the current content is a form - String sReturn; - String sCurrentIndex; - while (xChild.is()) - { - // get the content's relative pos within it's parent container - sal_Int32 nPos = getElementPos(xParent, xChild); - - // prepend this current relaive pos - sCurrentIndex = String::CreateFromInt32(nPos); - if (sReturn.Len() != 0) - { - sCurrentIndex += '\\'; - sCurrentIndex += sReturn; - } - - sReturn = sCurrentIndex; - - // travel up - if (::comphelper::query_interface((Reference< XInterface >)xParent,xChild)) - xParent = Reference< ::com::sun::star::container::XIndexAccess>(xChild->getParent(), UNO_QUERY); - } - - _rTopLevelElement = xParent; - return sReturn; -} - -//------------------------------------------------------------------ -String getFormComponentAccessPath(const Reference< XInterface >& _xElement) -{ - Reference< XInterface > xDummy; - return getFormComponentAccessPath(_xElement, xDummy); -} - -//------------------------------------------------------------------------------ -Reference< XInterface > getElementFromAccessPath(const Reference< ::com::sun::star::container::XIndexAccess>& _xParent, const String& _rRelativePath) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::getElementFromAccessPath" ); - if (!_xParent.is()) - return Reference< XInterface >(); - Reference< ::com::sun::star::container::XIndexAccess> xContainer(_xParent); - Reference< XInterface > xElement( _xParent); - - String sPath(_rRelativePath); - while (sPath.Len() && xContainer.is()) - { - xub_StrLen nSepPos = sPath.Search((sal_Unicode)'\\'); - - String sIndex(sPath.Copy(0, (nSepPos == STRING_NOTFOUND) ? sPath.Len() : nSepPos)); - // DBG_ASSERT(sIndex.IsNumeric(), "getElementFromAccessPath : invalid path !"); - - sPath = sPath.Copy((nSepPos == STRING_NOTFOUND) ? sPath.Len() : nSepPos+1); - - ::cppu::extractInterface(xElement, xContainer->getByIndex(sIndex.ToInt32())); - xContainer = Reference< ::com::sun::star::container::XIndexAccess>::query(xElement); - } - - if (sPath.Len() != 0) - // the loop terminated because an element wasn't a container, but we stil have a path -> the path is invalid - xElement = NULL; - - return xElement; -} - -//------------------------------------------------------------------ -// Vergleichen von PropertyInfo -extern "C" int -#if defined( WNT ) - __cdecl -#endif -#if defined( ICC ) && defined( OS2 ) -_Optlink -#endif - NameCompare(const void* pFirst, const void* pSecond) -{ - return ((::rtl::OUString*)pFirst)->compareTo(*(::rtl::OUString*)pSecond); -} - -//------------------------------------------------------------------------------ -sal_Int32 findPos(const ::rtl::OUString& aStr, const Sequence< ::rtl::OUString>& rList) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::findPos" ); - const ::rtl::OUString* pStrList = rList.getConstArray(); - ::rtl::OUString* pResult = (::rtl::OUString*) bsearch(&aStr, (void*)pStrList, rList.getLength(), sizeof(::rtl::OUString), - &NameCompare); - - if (pResult) - return (pResult - pStrList); - else - return -1; -} - -//------------------------------------------------------------------ -Reference< ::com::sun::star::frame::XModel> getXModel(const Reference< XInterface >& xIface) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::getXModel" ); - Reference< ::com::sun::star::frame::XModel> xModel(xIface, UNO_QUERY); - if (xModel.is()) - return xModel; - else - { - Reference< ::com::sun::star::container::XChild> xChild(xIface, UNO_QUERY); - if (xChild.is()) - { - Reference< XInterface > xParent( xChild->getParent()); - return getXModel(xParent); - } - else - return NULL; - } -} - //------------------------------------------------------------------ ::rtl::OUString getLabelName(const Reference< ::com::sun::star::beans::XPropertySet>& xControlModel) { @@ -689,242 +461,6 @@ sal_Int16 getControlTypeByObject(const Reference< ::com::sun::star::lang::XServi return OBJ_FM_CONTROL; } -//------------------------------------------------------------------------------ -::rtl::OUString getServiceNameByControlType(sal_Int16 nType) -{ - switch (nType) - { - case OBJ_FM_EDIT : return FM_COMPONENT_TEXTFIELD; - case OBJ_FM_BUTTON : return FM_COMPONENT_COMMANDBUTTON; - case OBJ_FM_FIXEDTEXT : return FM_COMPONENT_FIXEDTEXT; - case OBJ_FM_LISTBOX : return FM_COMPONENT_LISTBOX; - case OBJ_FM_CHECKBOX : return FM_COMPONENT_CHECKBOX; - case OBJ_FM_RADIOBUTTON : return FM_COMPONENT_RADIOBUTTON; - case OBJ_FM_GROUPBOX : return FM_COMPONENT_GROUPBOX; - case OBJ_FM_COMBOBOX : return FM_COMPONENT_COMBOBOX; - case OBJ_FM_GRID : return FM_COMPONENT_GRIDCONTROL; - case OBJ_FM_IMAGEBUTTON : return FM_COMPONENT_IMAGEBUTTON; - case OBJ_FM_FILECONTROL : return FM_COMPONENT_FILECONTROL; - case OBJ_FM_DATEFIELD : return FM_COMPONENT_DATEFIELD; - case OBJ_FM_TIMEFIELD : return FM_COMPONENT_TIMEFIELD; - case OBJ_FM_NUMERICFIELD : return FM_COMPONENT_NUMERICFIELD; - case OBJ_FM_CURRENCYFIELD : return FM_COMPONENT_CURRENCYFIELD; - case OBJ_FM_PATTERNFIELD : return FM_COMPONENT_PATTERNFIELD; - case OBJ_FM_HIDDEN : return FM_COMPONENT_HIDDENCONTROL; - case OBJ_FM_IMAGECONTROL : return FM_COMPONENT_IMAGECONTROL; - case OBJ_FM_FORMATTEDFIELD : return FM_COMPONENT_FORMATTEDFIELD; - case OBJ_FM_SCROLLBAR : return FM_SUN_COMPONENT_SCROLLBAR; - case OBJ_FM_SPINBUTTON : return FM_SUN_COMPONENT_SPINBUTTON; - case OBJ_FM_NAVIGATIONBAR : return FM_SUN_COMPONENT_NAVIGATIONBAR; - } - return ::rtl::OUString(); -} -//------------------------------------------------------------------------------ -Sequence< ::rtl::OUString> getEventMethods(const Type& type) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::getEventMethods" ); - typelib_InterfaceTypeDescription *pType=0; - type.getDescription( (typelib_TypeDescription**)&pType); - - if(!pType) - return Sequence< ::rtl::OUString>(); - - Sequence< ::rtl::OUString> aNames(pType->nMembers); - ::rtl::OUString* pNames = aNames.getArray(); - for(sal_Int32 i=0;inMembers;i++,++pNames) - { - // the decription reference - typelib_TypeDescriptionReference* pMemberDescriptionReference = pType->ppMembers[i]; - // the description for the reference - typelib_TypeDescription* pMemberDescription = NULL; - typelib_typedescriptionreference_getDescription(&pMemberDescription, pMemberDescriptionReference); - if (pMemberDescription) - { - typelib_InterfaceMemberTypeDescription* pRealMemberDescription = - reinterpret_cast(pMemberDescription); - *pNames = pRealMemberDescription->pMemberName; - } - } - typelib_typedescription_release( (typelib_TypeDescription *)pType ); - return aNames; -} - - -//------------------------------------------------------------------------------ -void TransferEventScripts(const Reference< ::com::sun::star::awt::XControlModel>& xModel, const Reference< ::com::sun::star::awt::XControl>& xControl, - const Sequence< ::com::sun::star::script::ScriptEventDescriptor>& rTransferIfAvailable) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::TransferEventScripts" ); - // first check if we have a XEventAttacherManager for the model - Reference< ::com::sun::star::container::XChild> xModelChild(xModel, UNO_QUERY); - if (!xModelChild.is()) - return; // nothing to do - - Reference< ::com::sun::star::script::XEventAttacherManager> xEventManager(xModelChild->getParent(), UNO_QUERY); - if (!xEventManager.is()) - return; // nothing to do - - if (!rTransferIfAvailable.getLength()) - return; // nothing to do - - // check for the index of the model within it's parent - Reference< ::com::sun::star::container::XIndexAccess> xParentIndex(xModelChild->getParent(), UNO_QUERY); - if (!xParentIndex.is()) - return; // nothing to do - sal_Int32 nIndex = getElementPos(xParentIndex, xModel); - if (nIndex<0 || nIndex>=xParentIndex->getCount()) - return; // nothing to do - - // then we need informations about the listeners supported by the control and the model - Sequence< Type> aModelListeners; - Sequence< Type> aControlListeners; - - Reference< ::com::sun::star::beans::XIntrospection> xModelIntrospection(::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.beans.Introspection")), UNO_QUERY); - Reference< ::com::sun::star::beans::XIntrospection> xControlIntrospection(::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.beans.Introspection")), UNO_QUERY); - - if (xModelIntrospection.is() && xModel.is()) - { - Any aModel(makeAny(xModel)); - aModelListeners = xModelIntrospection->inspect(aModel)->getSupportedListeners(); - } - - if (xControlIntrospection.is() && xControl.is()) - { - Any aControl(makeAny(xControl)); - aControlListeners = xControlIntrospection->inspect(aControl)->getSupportedListeners(); - } - - sal_Int32 nMaxNewLen = aModelListeners.getLength() + aControlListeners.getLength(); - if (!nMaxNewLen) - return; // the model and the listener don't support any listeners (or we were unable to retrieve these infos) - - Sequence< ::com::sun::star::script::ScriptEventDescriptor> aTransferable(nMaxNewLen); - ::com::sun::star::script::ScriptEventDescriptor* pTransferable = aTransferable.getArray(); - - const ::com::sun::star::script::ScriptEventDescriptor* pCurrent = rTransferIfAvailable.getConstArray(); - sal_Int32 i,j,k; - for (i=0; i* pCurrentArray = &aModelListeners; - pCurrentArray; - pCurrentArray = (pCurrentArray == &aModelListeners) ? &aControlListeners : NULL - ) - { - const Type* pCurrentListeners = pCurrentArray->getConstArray(); - for (j=0; jgetLength(); ++j, ++pCurrentListeners) - { - UniString aListener = (*pCurrentListeners).getTypeName(); - xub_StrLen nTokens = aListener.GetTokenCount('.'); - if (nTokens) - aListener = aListener.GetToken(nTokens - 1, '.'); - - if (aListener == pCurrent->ListenerType.getStr()) - // the current ::com::sun::star::script::ScriptEventDescriptor doesn't match the current listeners class - continue; - - // now check the methods - Sequence< ::rtl::OUString> aMethodsNames = getEventMethods(*pCurrentListeners); - const ::rtl::OUString* pMethodsNames = aMethodsNames.getConstArray(); - for (k=0; kEventMethod) != COMPARE_EQUAL) - // the current ::com::sun::star::script::ScriptEventDescriptor doesn't match the current listeners current method - continue; - - // we can transfer the script event : the model (control) supports it - *pTransferable = *pCurrent; - ++pTransferable; - break; - } - if (kregisterScriptEvents(nIndex, aTransferable); -} - -//------------------------------------------------------------------------------ -sal_Int16 GridView2ModelPos(const Reference< ::com::sun::star::container::XIndexAccess>& rColumns, sal_Int16 nViewPos) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::GridView2ModelPos" ); - try - { - if (rColumns.is()) - { - // loop through all columns - sal_Int16 i; - Reference< ::com::sun::star::beans::XPropertySet> xCur; - for (i=0; igetCount(); ++i) - { - rColumns->getByIndex(i) >>= xCur; - if (!::comphelper::getBOOL(xCur->getPropertyValue(FM_PROP_HIDDEN))) - { - // for every visible col : if nViewPos is greater zero, decrement it, else we - // have found the model position - if (!nViewPos) - break; - else - --nViewPos; - } - } - if (igetCount()) - return i; - } - } - catch(const Exception&) - { - DBG_ERROR("GridView2ModelPos Exception occured!"); - } - return (sal_Int16)-1; -} - -//============================================================================== -//============================================================================== - -//------------------------------------------------------------------------------ -sal_Bool isLoadable( const Reference< XInterface >& _rxLoadable ) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::isLoadable" ); - // determines whether a form should be loaded or not - // if there is no datasource or connection there is no reason to load a form - Reference< XPropertySet > xSet( _rxLoadable, UNO_QUERY ); - if ( xSet.is() ) - { - try - { - Reference< XConnection > xConn; - if ( OStaticDataAccessTools().isEmbeddedInDatabase( _rxLoadable.get(), xConn ) ) - return sal_True; - - // is there already a active connection - xSet->getPropertyValue(FM_PROP_ACTIVE_CONNECTION) >>= xConn; - if ( xConn.is() ) - return sal_True; - - ::rtl::OUString sPropertyValue; - OSL_VERIFY( xSet->getPropertyValue( FM_PROP_DATASOURCE ) >>= sPropertyValue ); - if ( sPropertyValue.getLength() ) - return sal_True; - - OSL_VERIFY( xSet->getPropertyValue( FM_PROP_URL ) >>= sPropertyValue ); - if ( sPropertyValue.getLength() ) - return sal_True; - } - catch(Exception&) - { - DBG_ERROR( "isLoadable: caught an exception!" ); - } - - } - return sal_False; -} - //------------------------------------------------------------------------------ void setConnection(const Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet, const Reference< ::com::sun::star::sdbc::XConnection>& _rxConn) { diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index ed8a4a382ed3..3295d011f9ff 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -30,7 +30,19 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" + #include "fmundo.hxx" +#include "fmtools.hxx" +#include "fmpgeimp.hxx" +#include "svx/dbtoolsclient.hxx" +#include "svditer.hxx" +#include "fmobj.hxx" +#include "fmprop.hrc" +#include "fmresids.hrc" +#include "svx/fmglob.hxx" +#include "svx/dialmgr.hxx" +#include "svx/fmmodel.hxx" +#include "svx/fmpage.hxx" /** === begin UNO includes === **/ #include @@ -43,18 +55,7 @@ #include /** === end UNO includes === **/ -#ifndef _FM_FMMODEL_HXX -#include -#endif -#include "fmtools.hxx" -#include -#ifndef _SVX_FMRESIDS_HRC -#include "fmresids.hrc" -#endif #include -#include -#include "fmpgeimp.hxx" -#include "svx/dbtoolsclient.hxx" #include #include #include @@ -63,13 +64,8 @@ #include #include #include -#include "svditer.hxx" -#include "fmobj.hxx" #include -#include -#ifndef _SVX_FMPROP_HRC -#include "fmprop.hrc" -#endif +#include #include #include #include @@ -299,6 +295,42 @@ void FmXUndoEnvironment::Inserted(SdrObject* pObj) } } +//------------------------------------------------------------------------------ +namespace +{ + sal_Bool lcl_searchElement(const Reference< XIndexAccess>& xCont, const Reference< XInterface >& xElement) + { + if (!xCont.is() || !xElement.is()) + return sal_False; + + sal_Int32 nCount = xCont->getCount(); + Reference< XInterface > xComp; + for (sal_Int32 i = 0; i < nCount; i++) + { + try + { + xCont->getByIndex(i) >>= xComp; + if (xComp.is()) + { + if ( xElement == xComp ) + return sal_True; + else + { + Reference< XIndexAccess> xCont2(xComp, UNO_QUERY); + if (xCont2.is() && lcl_searchElement(xCont2, xElement)) + return sal_True; + } + } + } + catch(const Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + return sal_False; + } +} + //------------------------------------------------------------------------------ void FmXUndoEnvironment::Inserted(FmFormObj* pObj) { @@ -325,7 +357,7 @@ void FmXUndoEnvironment::Inserted(FmFormObj* pObj) Reference< XIndexContainer > xNewParent; Reference< XForm > xForm; sal_Int32 nPos = -1; - if ( searchElement( xForms, xObjectParent ) ) + if ( lcl_searchElement( xForms, xObjectParent ) ) { // the form which was the parent of the object when it was removed is still // part of the form component hierachy of the current page diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index 1c16a092ad18..24029a98a393 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -61,7 +61,6 @@ #include #include #include "fmpgeimp.hxx" -#include "fmtools.hxx" #include "fmshimp.hxx" #include "fmservs.hxx" #include "fmprop.hrc" diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 829d9f6b61e8..fc4bbc62b58e 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -38,7 +38,6 @@ #include "fmresids.hrc" #include "fmservs.hxx" #include "fmshimp.hxx" -#include "fmtools.hxx" #include "fmundo.hxx" #include "fmvwimp.hxx" #include "formcontrolfactory.hxx" @@ -96,6 +95,7 @@ #include #include #include +#include #include #include diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx index 5485763904ce..63f2ddf69d8e 100644 --- a/svx/source/form/formcontrolling.cxx +++ b/svx/source/form/formcontrolling.cxx @@ -33,7 +33,7 @@ #include "formcontrolling.hxx" #include "fmurl.hxx" -#include +#include "svx/svxids.hrc" #include "fmprop.hrc" #include "fmtools.hxx" diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index 4ad118418981..39c246b99730 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -32,7 +32,6 @@ #include "precompiled_svx.hxx" #include "tabwin.hxx" -#include "fmtools.hxx" #include "fmservs.hxx" #include "stringlistresource.hxx" diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx index f1ae1ed4398d..08db2e8ae7dc 100644 --- a/svx/source/inc/filtnav.hxx +++ b/svx/source/inc/filtnav.hxx @@ -48,7 +48,6 @@ #include #include #include -#include "fmtools.hxx" #include "fmexch.hxx" #include #include "fmexch.hxx" diff --git a/svx/source/inc/fmPropBrw.hxx b/svx/source/inc/fmPropBrw.hxx index 285cb90320d2..fb970eb0a22f 100644 --- a/svx/source/inc/fmPropBrw.hxx +++ b/svx/source/inc/fmPropBrw.hxx @@ -30,6 +30,8 @@ #ifndef SVX_FMPROPBRW_HXX #define SVX_FMPROPBRW_HXX +#include "fmtools.hxx" + /** === begin UNO includes === **/ #include #include @@ -37,10 +39,10 @@ #include #include /** === end UNO includes === **/ + #include #include #include -#include "fmtools.hxx" //======================================================================== class FmPropBrwMgr : public SfxChildWindow diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx index df60ba931739..a03940fd510b 100644 --- a/svx/source/inc/fmexpl.hxx +++ b/svx/source/inc/fmexpl.hxx @@ -39,12 +39,17 @@ #include #include #include + +/** === begin UNO includes === **/ #include #include #include #include #include #include +#include +#include +/** === end UNO includes === **/ #include @@ -57,7 +62,6 @@ #include #include "fmexch.hxx" -#include "fmtools.hxx" class SdrObjListIter; class FmFormShell; diff --git a/svx/source/inc/fmsrcimp.hxx b/svx/source/inc/fmsrcimp.hxx index eb2475bc56e8..cfe38153c0ba 100644 --- a/svx/source/inc/fmsrcimp.hxx +++ b/svx/source/inc/fmsrcimp.hxx @@ -32,18 +32,27 @@ #define _FMSRCIMP_HXX #include "fmtools.hxx" -#include -#include -#include +#include "svx/svxdllapi.h" + +/** === begin UNO includes === **/ #include #include +#include #include #include +/** === end UNO includes === **/ + #include #include +#include #include #include -#include "svx/svxdllapi.h" +#include + +#ifndef _SVSTDARR_ULONGS +#define _SVSTDARR_ULONGS +#include +#endif // =================================================================================================== // Hilfsstrukturen diff --git a/svx/source/inc/fmtools.hxx b/svx/source/inc/fmtools.hxx index 9e9e892ef6cc..a456bed35bc6 100644 --- a/svx/source/inc/fmtools.hxx +++ b/svx/source/inc/fmtools.hxx @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: fmtools.hxx,v $ - * $Revision: 1.27 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -30,6 +27,9 @@ #ifndef _SVX_FMTOOLS_HXX #define _SVX_FMTOOLS_HXX +#include "fmprop.hrc" +#include "svx/svxdllapi.h" + #include #include #include @@ -65,36 +65,18 @@ #include #include #include -#include -#include - -#ifndef _SVSTDARR_ULONGS -#define _SVSTDARR_ULONGS -#include -#endif -#include -#include -#include -#include -#include - -#include "fmprop.hrc" #include #include #include #include #include #include -#include -#include -#include + +#include #include #include #include #include -#include - -#include #include @@ -111,21 +93,7 @@ SVX_DLLPUBLIC void displayException(const ::com::sun::star::sdb::SQLContext&, Wi void displayException(const ::com::sun::star::sdb::SQLErrorEvent&, Window* _pParent = NULL); void displayException(const ::com::sun::star::uno::Any&, Window* _pParent = NULL); -// Kopieren von Persistenten Objecten -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> cloneUsingProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XPersistObject>& _xObj); - -sal_Int32 findPos(const ::rtl::OUString& aStr, const ::com::sun::star::uno::Sequence< ::rtl::OUString>& rList); - -// Suchen in einer Indexliste nach einem Element -sal_Bool searchElement(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& xCont, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElement); - sal_Int32 getElementPos(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& xCont, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElement); -String getFormComponentAccessPath(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xElement); -String getFormComponentAccessPath(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xElement, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rTopLevelElement); -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> getElementFromAccessPath(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xParent, const String& _rRelativePath); - - -::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel> getXModel(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xIface); SVX_DLLPUBLIC ::rtl::OUString getLabelName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xControlModel); @@ -230,10 +198,8 @@ protected: void setAdapter(FmXDisposeMultiplexer* pAdapter); }; -typedef ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener> FmXDisposeMultiplexer_x; //============================================================================== - class FmXDisposeMultiplexer :public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener> { ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xObject; @@ -252,18 +218,10 @@ public: // ================================================================== -::rtl::OUString getServiceNameByControlType(sal_Int16 nType); - // get a service name to create a model of the given type (OBJ_FM_...) sal_Int16 getControlTypeByObject(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo>& _rxObject); // get the object type (OBJ_FM_...) from the services the object supports -void TransferEventScripts(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& xModel, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& xControl, - const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor>& rTransferIfAvailable); - -sal_Int16 GridView2ModelPos(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& rColumns, sal_Int16 nViewPos); - //================================================================== -sal_Bool isLoadable(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xLoad); sal_Bool isRowSetAlive(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rxRowSet); // checks if the ::com::sun::star::sdbcx::XColumnsSupplier provided by _rxRowSet supllies any columns diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index cb747e3a894c..b3792b76422c 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -35,7 +35,6 @@ #include "sqlparserclient.hxx" #include "typeconversionclient.hxx" -#include "fmtools.hxx" /** === begin UNO includes === **/ #include @@ -51,6 +50,7 @@ #include #include #include +#include /** === end UNO includes === **/ #include diff --git a/svx/source/inc/tabwin.hxx b/svx/source/inc/tabwin.hxx index be46c05a58d5..02f58a507511 100644 --- a/svx/source/inc/tabwin.hxx +++ b/svx/source/inc/tabwin.hxx @@ -37,9 +37,6 @@ #include #include -//#ifndef _SVX_FMTOOLS_HXX -//#include "fmtools.hxx" -//#endif #include #include #include "svx/dbtoolsclient.hxx" -- cgit