summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2009-10-30 13:12:29 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2009-10-30 13:12:29 +0100
commite39dac8cb3f4d98f6aab875f64672b1f502264a2 (patch)
treed2ba6ec473961be05c918f504b9aa1e030744895 /svx
parent346d0a2a7644c54da29338df9102cbbc027aa20a (diff)
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
Diffstat (limited to 'svx')
-rw-r--r--svx/source/fmcomp/fmgridif.cxx13
-rw-r--r--svx/source/fmcomp/gridcols.cxx35
-rw-r--r--svx/source/form/filtnav.cxx1
-rw-r--r--svx/source/form/fmobj.cxx72
-rw-r--r--svx/source/form/fmobjfac.cxx1
-rw-r--r--svx/source/form/fmpage.cxx1
-rw-r--r--svx/source/form/fmshell.cxx1
-rw-r--r--svx/source/form/fmshimp.cxx238
-rw-r--r--svx/source/form/fmsrcimp.cxx1
-rw-r--r--svx/source/form/fmtools.cxx564
-rw-r--r--svx/source/form/fmundo.cxx68
-rw-r--r--svx/source/form/fmview.cxx1
-rw-r--r--svx/source/form/fmvwimp.cxx2
-rw-r--r--svx/source/form/formcontrolling.cxx2
-rw-r--r--svx/source/form/tabwin.cxx1
-rw-r--r--svx/source/inc/filtnav.hxx1
-rw-r--r--svx/source/inc/fmPropBrw.hxx4
-rw-r--r--svx/source/inc/fmexpl.hxx6
-rw-r--r--svx/source/inc/fmsrcimp.hxx17
-rw-r--r--svx/source/inc/fmtools.hxx52
-rw-r--r--svx/source/inc/gridcell.hxx2
-rw-r--r--svx/source/inc/tabwin.hxx3
22 files changed, 460 insertions, 626 deletions
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 <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
@@ -52,6 +53,8 @@
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/sdbcx/XRowLocate.hpp>
+/** === end UNO includes === **/
#include <comphelper/container.hxx>
#include <comphelper/enumhelper.hxx>
@@ -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 <tools/debug.hxx>
#include <comphelper/types.hxx>
#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 <cppuhelper/implbase1.hxx>
#include <fmservs.hxx>
#include <fmshimp.hxx>
-#include <fmtools.hxx>
#include <rtl/logfile.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objitem.hxx>
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 <tools/resmgr.hxx>
-#include <tools/diagnose_ex.h>
#include "fmobj.hxx"
#include "fmprop.hrc"
#include "fmvwimp.hxx"
-#include <svx/editeng.hxx>
-#include <svx/svdovirt.hxx>
+#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 <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <com/sun/star/io/XPersistObject.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
/** === end UNO includes === **/
-#include <svx/fmmodel.hxx>
-#include "fmtools.hxx"
-#include <tools/shl.hxx>
-#include <svx/dialmgr.hxx>
-#include "fmresids.hrc"
-#include <svx/fmview.hxx>
-#include <svx/fmglob.hxx>
-
-#include "fmpgeimp.hxx"
-#include <svx/fmpage.hxx>
+#include <tools/shl.hxx>
#include <comphelper/property.hxx>
#include <comphelper/processfactory.hxx>
#include <toolkit/awt/vclxdevice.hxx>
#include <vcl/svapp.hxx>
+#include <tools/resmgr.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::uno;
@@ -422,10 +422,48 @@ 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 <comphelper/stl_types.hxx>
#include <svx/svdobj.hxx>
-#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 <comphelper/property.hxx>
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 <svx/fmshell.hxx>
-#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 <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/beans/XIntrospection.hpp>
/** === end UNO includes === **/
#include <comphelper/extract.hxx>
@@ -110,6 +110,7 @@
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/waitobj.hxx>
+#include <vos/mutex.hxx>
#include <algorithm>
#include <functional>
@@ -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; i<rColumns->getCount(); ++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 (i<rColumns->getCount())
+ 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;i<pType->nMembers;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<typelib_InterfaceMemberTypeDescription*>(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<rTransferIfAvailable.getLength(); ++i, ++pCurrent)
+ {
+ // search the model/control idl classes for the event described by pCurrent
+ for ( Sequence< Type>* pCurrentArray = &aModelListeners;
+ pCurrentArray;
+ pCurrentArray = (pCurrentArray == &aModelListeners) ? &aControlListeners : NULL
+ )
+ {
+ const Type* pCurrentListeners = pCurrentArray->getConstArray();
+ for (j=0; j<pCurrentArray->getLength(); ++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; k<aMethodsNames.getLength(); ++k, ++pMethodsNames)
+ {
+ if ((*pMethodsNames).compareTo(pCurrent->EventMethod) != 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 (k<aMethodsNames.getLength())
+ break;
+ }
+ }
+ }
+
+ sal_Int32 nRealNewLen = pTransferable - aTransferable.getArray();
+ aTransferable.realloc(nRealNewLen);
+
+ xEventManager->registerScriptEvents(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 <tools/debug.hxx>
#include <tools/diagnose_ex.h>
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 <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/io/XPersistObject.hpp>
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#include <com/sun/star/sdb/XCompletedConnection.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/lang/Locale.hpp>
+
+#include "fmprop.hrc"
+#include "fmservs.hxx"
#include "fmtools.hxx"
#include "svx/dbtoolsclient.hxx"
-#include "fmservs.hxx"
-#include <svx/fmglob.hxx>
-#include <vcl/stdtext.hxx>
-#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
-#include <toolkit/unohlp.hxx>
-#endif
+#include "svx/fmglob.hxx"
-#include <stdlib.h>
-#include <stdio.h>
-#include <wchar.h>
-#include <com/sun/star/uno/XNamingService.hpp>
-#include <com/sun/star/sdbc/XDataSource.hpp>
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/LineEndFormat.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/form/XForm.hpp>
+#include <com/sun/star/form/XFormComponent.hpp>
+#include <com/sun/star/form/XGridColumnFactory.hpp>
+#include <com/sun/star/io/XActiveDataSink.hpp>
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/io/XObjectInputStream.hpp>
+#include <com/sun/star/io/XObjectOutputStream.hpp>
+#include <com/sun/star/io/XPersistObject.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
-#include <com/sun/star/sdb/XQueriesSupplier.hpp>
+#include <com/sun/star/sdb/ErrorCondition.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+#include <com/sun/star/sdb/XCompletedConnection.hpp>
+#include <com/sun/star/sdb/XQueriesSupplier.hpp>
#include <com/sun/star/sdb/XResultSetAccess.hpp>
-#include <com/sun/star/sdb/ErrorCondition.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/util/NumberFormat.hpp>
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/script/XEventAttacherManager.hpp>
-#include <com/sun/star/form/XForm.hpp>
-#include <com/sun/star/form/XFormComponent.hpp>
-#include <com/sun/star/util/XNumberFormatter.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/sdbc/XDataSource.hpp>
+#include <com/sun/star/sdbcx/Privilege.hpp>
+#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/util/Language.hpp>
-#include <com/sun/star/util/XNumberFormats.hpp>
-#include <com/sun/star/util/XNumberFormatTypes.hpp>
+#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <com/sun/star/io/XObjectInputStream.hpp>
-#include <com/sun/star/io/XObjectOutputStream.hpp>
-#include <com/sun/star/reflection/XIdlClass.hpp>
-#include <com/sun/star/reflection/XIdlMethod.hpp>
-#include <com/sun/star/beans/XIntrospection.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <com/sun/star/awt/LineEndFormat.hpp>
-#include <com/sun/star/form/XGridColumnFactory.hpp>
-
+#include <com/sun/star/util/XNumberFormatTypes.hpp>
+#include <com/sun/star/util/XNumberFormats.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
+/** === end UNO includes === **/
-#include <tools/debug.hxx>
-#include <tools/string.hxx>
#include <basic/sbxvar.hxx>
-#include <rtl/math.hxx>
-#include <vcl/svapp.hxx>
-
-#ifndef _SVX_FMPROP_HRC
-#include "fmprop.hrc"
-#endif
-#include <sfx2/bindings.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/stritem.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <comphelper/types.hxx>
-#include <comphelper/property.hxx>
#include <comphelper/container.hxx>
-#include <connectivity/dbtools.hxx>
+#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
-#include <comphelper/extract.hxx>
+#include <comphelper/types.hxx>
#include <comphelper/uno3.hxx>
#include <connectivity/dbexception.hxx>
-#include <comphelper/extract.hxx>
+#include <connectivity/dbtools.hxx>
+#include <cppuhelper/servicefactory.hxx>
#include <cppuhelper/typeprovider.hxx>
-#include <algorithm>
#include <rtl/logfile.hxx>
+#include <rtl/math.hxx>
+#include <sfx2/bindings.hxx>
+#include <svtools/eitem.hxx>
+#include <svtools/stritem.hxx>
+#include <toolkit/unohlp.hxx>
+#include <tools/debug.hxx>
+#include <tools/string.hxx>
+#include <vcl/stdtext.hxx>
+#include <vcl/svapp.hxx>
+
+#include <algorithm>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
@@ -204,106 +195,8 @@ void displayException(const ::com::sun::star::sdb::SQLErrorEvent& _rEvent, Windo
}
//------------------------------------------------------------------------------
-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;
@@ -336,127 +229,6 @@ sal_Int32 getElementPos(const Reference< ::com::sun::star::container::XIndexAcce
}
//------------------------------------------------------------------
-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)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::getLabelName" );
@@ -690,242 +462,6 @@ sal_Int16 getControlTypeByObject(const Reference< ::com::sun::star::lang::XServi
}
//------------------------------------------------------------------------------
-::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;i<pType->nMembers;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<typelib_InterfaceMemberTypeDescription*>(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<rTransferIfAvailable.getLength(); ++i, ++pCurrent)
- {
- // search the model/control idl classes for the event described by pCurrent
- for ( Sequence< Type>* pCurrentArray = &aModelListeners;
- pCurrentArray;
- pCurrentArray = (pCurrentArray == &aModelListeners) ? &aControlListeners : NULL
- )
- {
- const Type* pCurrentListeners = pCurrentArray->getConstArray();
- for (j=0; j<pCurrentArray->getLength(); ++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; k<aMethodsNames.getLength(); ++k, ++pMethodsNames)
- {
- if ((*pMethodsNames).compareTo(pCurrent->EventMethod) != 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 (k<aMethodsNames.getLength())
- break;
- }
- }
- }
-
- sal_Int32 nRealNewLen = pTransferable - aTransferable.getArray();
- aTransferable.realloc(nRealNewLen);
-
- xEventManager->registerScriptEvents(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; i<rColumns->getCount(); ++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 (i<rColumns->getCount())
- 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)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "fmtools::setConnection" );
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 <com/sun/star/util/XModifyBroadcaster.hpp>
@@ -43,18 +55,7 @@
#include <com/sun/star/reflection/XInterfaceMethodTypeDescription.hpp>
/** === end UNO includes === **/
-#ifndef _FM_FMMODEL_HXX
-#include <svx/fmmodel.hxx>
-#endif
-#include "fmtools.hxx"
-#include <svx/fmpage.hxx>
-#ifndef _SVX_FMRESIDS_HRC
-#include "fmresids.hrc"
-#endif
#include <rtl/logfile.hxx>
-#include <svx/dialmgr.hxx>
-#include "fmpgeimp.hxx"
-#include "svx/dbtoolsclient.hxx"
#include <svtools/macitem.hxx>
#include <tools/shl.hxx>
#include <tools/diagnose_ex.h>
@@ -63,13 +64,8 @@
#include <sfx2/app.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/event.hxx>
-#include "svditer.hxx"
-#include "fmobj.hxx"
#include <osl/mutex.hxx>
-#include <svx/fmglob.hxx>
-#ifndef _SVX_FMPROP_HRC
-#include "fmprop.hrc"
-#endif
+#include <vos/mutex.hxx>
#include <comphelper/property.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/stl_types.hxx>
@@ -300,6 +296,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)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXUndoEnvironment::Inserted" );
@@ -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 <svx/fmpage.hxx>
#include <svx/fmshell.hxx>
#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 <tools/diagnose_ex.h>
#include <vcl/msgbox.hxx>
#include <vcl/stdtext.hxx>
+#include <vos/mutex.hxx>
#include <rtl/logfile.hxx>
#include <algorithm>
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 <svx/svxids.hrc>
+#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 <vcl/dialog.hxx>
#include <vcl/group.hxx>
#include <vcl/dockwin.hxx>
-#include "fmtools.hxx"
#include "fmexch.hxx"
#include <connectivity/sqlparse.hxx>
#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 <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
@@ -37,10 +39,10 @@
#include <com/sun/star/inspection/XObjectInspectorModel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
/** === end UNO includes === **/
+
#include <sfx2/basedlgs.hxx>
#include <sfx2/ctrlitem.hxx>
#include <sfx2/childwin.hxx>
-#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 <sfx2/dockwin.hxx>
#include <sfx2/ctrlitem.hxx>
#include <vcl/image.hxx>
+
+/** === begin UNO includes === **/
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/form/XForm.hpp>
#include <com/sun/star/form/XFormComponent.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+/** === end UNO includes === **/
#include <svtools/svtreebx.hxx>
@@ -57,7 +62,6 @@
#include <svx/fmview.hxx>
#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 <vos/thread.hxx>
-#include <osl/mutex.hxx>
-#include <com/sun/star/awt/XTextComponent.hpp>
+#include "svx/svxdllapi.h"
+
+/** === begin UNO includes === **/
#include <com/sun/star/awt/XCheckBox.hpp>
#include <com/sun/star/awt/XListBox.hpp>
+#include <com/sun/star/awt/XTextComponent.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
+/** === end UNO includes === **/
+
#include <comphelper/stl_types.hxx>
#include <cppuhelper/implbase1.hxx>
+#include <osl/mutex.hxx>
#include <unotools/charclass.hxx>
#include <unotools/collatorwrapper.hxx>
-#include "svx/svxdllapi.h"
+#include <vos/thread.hxx>
+
+#ifndef _SVSTDARR_ULONGS
+#define _SVSTDARR_ULONGS
+#include <svtools/svstdarr.hxx>
+#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 <com/sun/star/sdb/SQLContext.hpp>
#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
@@ -65,36 +65,18 @@
#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <vcl/wintypes.hxx>
-#include <vos/mutex.hxx>
-
-#ifndef _SVSTDARR_ULONGS
-#define _SVSTDARR_ULONGS
-#include <svtools/svstdarr.hxx>
-#endif
-#include <sfx2/ctrlitem.hxx>
-#include <tools/link.hxx>
-#include <tools/date.hxx>
-#include <tools/time.hxx>
-#include <tools/datetime.hxx>
-
-#include "fmprop.hrc"
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/io/XObjectInputStream.hpp>
#include <com/sun/star/io/XObjectOutputStream.hpp>
#include <com/sun/star/io/XPersistObject.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
#include <com/sun/star/util/XNumberFormats.hpp>
-#include <cppuhelper/interfacecontainer.h>
-#include <cppuhelper/compbase2.hxx>
-#include <cppuhelper/compbase3.hxx>
+
+#include <vcl/wintypes.hxx>
#include <cppuhelper/weakref.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/stl_types.hxx>
#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/component.hxx>
-
-#include <svx/svxdllapi.h>
#include <set>
@@ -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 <com/sun/star/sdb/XColumn.hpp>
@@ -51,6 +50,7 @@
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/form/XChangeBroadcaster.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
/** === end UNO includes === **/
#include <comphelper/propmultiplex.hxx>
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 <sfx2/ctrlitem.hxx>
#include <com/sun/star/form/XForm.hpp>
-//#ifndef _SVX_FMTOOLS_HXX
-//#include "fmtools.hxx"
-//#endif
#include <comphelper/propmultiplex.hxx>
#include <svtools/transfer.hxx>
#include "svx/dbtoolsclient.hxx"