26#include <com/sun/star/beans/XPropertySet.hpp>
27#include <com/sun/star/container/XIndexAccess.hpp>
28#include <com/sun/star/io/XPersistObject.hpp>
29#include <com/sun/star/lang/XServiceInfo.hpp>
30#include <com/sun/star/sdb/ErrorCondition.hpp>
31#include <com/sun/star/sdb/ErrorMessageDialog.hpp>
32#include <com/sun/star/sdb/SQLContext.hpp>
33#include <com/sun/star/sdb/SQLErrorEvent.hpp>
34#include <com/sun/star/sdb/XCompletedConnection.hpp>
35#include <com/sun/star/sdb/XResultSetAccess.hpp>
36#include <com/sun/star/sdbc/XRowSet.hpp>
37#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
38#include <com/sun/star/util/Language.hpp>
63 bool lcl_shouldDisplayError(
const Any& _rError )
66 if ( !( _rError >>= aError ) )
69 if ( ! aError.Message.startsWith(
"[OOoBase]" ) )
75 if ( aError.ErrorCode + ErrorCondition::ROW_SET_OPERATION_VETOED == 0 )
83void displayException(
const Any& _rExcept,
const css::uno::Reference<css::awt::XWindow>& rParent)
86 if ( !lcl_shouldDisplayError( _rExcept ) )
91 Reference< XExecutableDialog > xErrorDialog = ErrorMessageDialog::create(::comphelper::getProcessComponentContext(),
"", rParent, _rExcept);
92 xErrorDialog->execute();
100void displayException(
const css::sdbc::SQLException& _rExcept,
const css::uno::Reference<css::awt::XWindow>& rParent)
105void displayException(
const css::sdb::SQLContext& _rExcept,
const css::uno::Reference<css::awt::XWindow>& rParent)
110void displayException(
const css::sdb::SQLErrorEvent& _rEvent,
const css::uno::Reference<css::awt::XWindow>& rParent)
115sal_Int32
getElementPos(
const Reference< css::container::XIndexAccess>& xCont,
const Reference< XInterface >& xElement)
122 Reference< XInterface > xNormalized( xElement, UNO_QUERY );
123 DBG_ASSERT( xNormalized.is(),
"getElementPos: invalid element!" );
124 if ( xNormalized.is() )
127 nIndex = xCont->getCount();
132 Reference< XInterface > xCurrent(xCont->getByIndex(
nIndex ),UNO_QUERY);
133 DBG_ASSERT( xCurrent.get() == Reference< XInterface >( xCurrent, UNO_QUERY ).get(),
134 "getElementPos: container element not normalized!" );
135 if ( xNormalized.get() == xCurrent.get() )
149OUString
getLabelName(
const Reference< css::beans::XPropertySet>& xControlModel)
151 if (!xControlModel.is())
156 Reference< css::beans::XPropertySet> xLabelSet;
158 if (xLabelSet.is() && ::comphelper::hasProperty(
FM_PROP_LABEL, xLabelSet))
161 if ((
aLabel.getValueTypeClass() == TypeClass_STRING) && !::comphelper::getString(
aLabel).isEmpty())
162 return ::comphelper::getString(
aLabel);
174 ImplConstruct(Reference< css::sdbc::XResultSet>(_rxCursor), bUseCloned);
188 Reference< css::sdb::XResultSetAccess> xAccess(_rxCursor, UNO_QUERY);
191 m_xMoveOperations = xAccess.is() ? xAccess->createResultSet() : Reference< css::sdbc::XResultSet>();
240 :m_xObject(_rxObject)
241 ,m_pListener(_pListener)
257 Reference< css::lang::XEventListener> xPreventDelete(
this);
273 Reference< css::lang::XEventListener> xPreventDelete(
this);
287 Reference< css::io::XPersistObject> xPersistence(_rxObject, UNO_QUERY);
288 DBG_ASSERT(xPersistence.is(),
"::getControlTypeByObject : argument should be a css::io::XPersistObject !");
289 if (!xPersistence.is())
292 OUString sPersistentServiceName = xPersistence->getServiceName();
342 OSL_FAIL(
"::getControlTypeByObject : suspicious persistent service name (formatted field) !");
353 OSL_FAIL(
"::getControlTypeByObject : unknown object type !");
360 bool bIsAlive =
false;
361 Reference< css::sdbcx::XColumnsSupplier> xSupplyCols(_rxRowSet, UNO_QUERY);
362 Reference< css::container::XIndexAccess> xCols;
363 if (xSupplyCols.is())
364 xCols.set(xSupplyCols->getColumns(), UNO_QUERY);
365 if (xCols.is() && (xCols->getCount() > 0))
css::uno::Reference< css::beans::XPropertySet > m_xPropertyAccess
css::uno::Reference< css::sdbcx::XRowLocate > m_xBookmarkOperations
CursorWrapper(const css::uno::Reference< css::sdbc::XRowSet > &_rxCursor, bool bUseCloned=false)
css::uno::Reference< css::sdbc::XResultSet > m_xMoveOperations
css::uno::Reference< css::uno::XInterface > m_xGeneric
CursorWrapper & operator=(const css::uno::Reference< css::sdbc::XRowSet > &xCursor)
css::uno::Reference< css::sdbcx::XColumnsSupplier > m_xColumnsSupplier
void ImplConstruct(const css::uno::Reference< css::sdbc::XResultSet > &_rxCursor, bool bUseCloned)
void setAdapter(FmXDisposeMultiplexer *pAdapter)
virtual ~FmXDisposeListener()
virtual void disposing(sal_Int16 _nId)=0
rtl::Reference< FmXDisposeMultiplexer > m_pAdapter
css::uno::Reference< css::lang::XComponent > m_xObject
FmXDisposeMultiplexer(FmXDisposeListener *_pListener, const css::uno::Reference< css::lang::XComponent > &_rxObject)
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
FmXDisposeListener * m_pListener
virtual ~FmXDisposeMultiplexer() override
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr OUStringLiteral FM_PROP_CONTROLLABEL
constexpr OUStringLiteral FM_PROP_LABEL
constexpr OUStringLiteral FM_PROP_CONTROLSOURCE
constexpr OUStringLiteral FM_COMPONENT_CURRENCYFIELD
constexpr OUStringLiteral FM_COMPONENT_FILECONTROL
constexpr OUStringLiteral FM_COMPONENT_GRID
constexpr OUStringLiteral FM_SUN_COMPONENT_NAVIGATIONBAR
constexpr OUStringLiteral FM_COMPONENT_LISTBOX
constexpr OUStringLiteral FM_COMPONENT_TEXTFIELD
constexpr OUStringLiteral FM_SUN_COMPONENT_FORMATTEDFIELD
constexpr OUStringLiteral FM_COMPONENT_GRIDCONTROL
constexpr OUStringLiteral FM_COMPONENT_RADIOBUTTON
constexpr OUStringLiteral FM_SUN_COMPONENT_SCROLLBAR
constexpr OUStringLiteral FM_COMPONENT_NUMERICFIELD
constexpr OUStringLiteral FM_COMPONENT_TIMEFIELD
constexpr OUStringLiteral FM_COMPONENT_HIDDENCONTROL
constexpr OUStringLiteral FM_COMPONENT_EDIT
constexpr OUStringLiteral FM_COMPONENT_FORMATTEDFIELD
constexpr OUStringLiteral FM_COMPONENT_IMAGEBUTTON
constexpr OUStringLiteral FM_COMPONENT_FIXEDTEXT
constexpr OUStringLiteral FM_SUN_COMPONENT_SPINBUTTON
constexpr OUStringLiteral FM_COMPONENT_DATEFIELD
constexpr OUStringLiteral FM_COMPONENT_CHECKBOX
constexpr OUStringLiteral FM_COMPONENT_COMBOBOX
constexpr OUStringLiteral FM_COMPONENT_IMAGECONTROL
constexpr OUStringLiteral FM_COMPONENT_GROUPBOX
constexpr OUStringLiteral FM_COMPONENT_HIDDEN
constexpr OUStringLiteral FM_COMPONENT_COMMANDBUTTON
constexpr OUStringLiteral FM_COMPONENT_PATTERNFIELD