LibreOffice Module dbaccess (master) 1
brwctrlr.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <browserids.hxx>
21#include <brwctrlr.hxx>
22#include <brwview.hxx>
23#include <strings.hrc>
24#include <strings.hxx>
25#include <core_resource.hxx>
26#include <queryfilter.hxx>
27#include <queryorder.hxx>
28#include <sqlmessage.hxx>
29
30#include <com/sun/star/container/XNameContainer.hpp>
31#include <com/sun/star/form/XBoundControl.hpp>
32#include <com/sun/star/form/XDatabaseParameterBroadcaster.hpp>
33#include <com/sun/star/form/XLoadable.hpp>
34#include <com/sun/star/form/XReset.hpp>
35#include <com/sun/star/form/XResetListener.hpp>
36#include <com/sun/star/form/runtime/XFormController.hpp>
37#include <com/sun/star/form/runtime/FormOperations.hpp>
38#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
39#include <com/sun/star/lang/XMultiServiceFactory.hpp>
40#include <com/sun/star/lang/NoSupportException.hpp>
41#include <com/sun/star/sdb/CommandType.hpp>
42#include <com/sun/star/sdb/ErrorCondition.hpp>
43#include <com/sun/star/sdb/ParametersRequest.hpp>
44#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp>
45#include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp>
46#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
47#include <com/sun/star/sdb/SQLFilterOperator.hpp>
48#include <com/sun/star/sdbc/XConnection.hpp>
49#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
50#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
51#include <com/sun/star/sdbcx/Privilege.hpp>
52#include <com/sun/star/sdbcx/XRowLocate.hpp>
53#include <com/sun/star/task/InteractionHandler.hpp>
54#include <com/sun/star/util/NumberFormatter.hpp>
55
60#include <comphelper/string.hxx>
61#include <comphelper/types.hxx>
67#include <osl/mutex.hxx>
68#include <sal/log.hxx>
69#include <svx/fmsearch.hxx>
70#include <svx/svxdlg.hxx>
72#include <osl/diagnose.h>
73#include <vcl/svapp.hxx>
74#include <vcl/weld.hxx>
75
76using namespace ::com::sun::star;
77using namespace ::com::sun::star::uno;
78using namespace ::com::sun::star::awt;
79using namespace ::com::sun::star::sdb;
80using namespace ::com::sun::star::sdbc;
81using namespace ::com::sun::star::sdbcx;
82using namespace ::com::sun::star::task;
83using namespace ::com::sun::star::beans;
84using namespace ::com::sun::star::frame;
85using namespace ::com::sun::star::form::runtime;
86using namespace ::com::sun::star::form;
87using namespace ::com::sun::star::util;
88using namespace ::com::sun::star::lang;
89using namespace ::com::sun::star::container;
90using namespace ::dbtools;
91using namespace ::comphelper;
92using namespace ::svt;
93
94namespace dbaui
95{
96
97namespace {
98
99// OParameterContinuation
100class OParameterContinuation : public OInteraction< XInteractionSupplyParameters >
101{
102 Sequence< PropertyValue > m_aValues;
103
104public:
106
107 const Sequence< PropertyValue >& getValues() const { return m_aValues; }
108
109// XInteractionSupplyParameters
110 virtual void SAL_CALL setParameters( const Sequence< PropertyValue >& _rValues ) override;
111};
112
113}
114
115void SAL_CALL OParameterContinuation::setParameters( const Sequence< PropertyValue >& _rValues )
116{
117 m_aValues = _rValues;
118}
119
120// a helper class implementing a runtime::XFormController, will be aggregated by SbaXDataBrowserController
121// (we can't derive from XFormController as it's base class is XTabController and the XTabController::getModel collides
122// with the XController::getModel implemented in our base class SbaXDataBrowserController)
124 : public ::cppu::WeakAggImplHelper2< css::form::runtime::XFormController,
125 css::frame::XFrameActionListener >
126{
130
131public:
133
134 // XFormController
135 virtual css::uno::Reference< css::form::runtime::XFormOperations > SAL_CALL getFormOperations() override;
136 virtual css::uno::Reference< css::awt::XControl > SAL_CALL getCurrentControl() override;
137 virtual void SAL_CALL addActivateListener(const css::uno::Reference< css::form::XFormControllerListener > & l) override;
138 virtual void SAL_CALL removeActivateListener(const css::uno::Reference< css::form::XFormControllerListener > & l) override;
139 virtual void SAL_CALL addChildController( const css::uno::Reference< css::form::runtime::XFormController >& ChildController ) override;
140 virtual css::uno::Reference< css::form::runtime::XFormControllerContext > SAL_CALL getContext() override;
141 virtual void SAL_CALL setContext( const css::uno::Reference< css::form::runtime::XFormControllerContext >& _context ) override;
142 virtual css::uno::Reference< css::task::XInteractionHandler > SAL_CALL getInteractionHandler() override;
143 virtual void SAL_CALL setInteractionHandler( const css::uno::Reference< css::task::XInteractionHandler >& _interactionHandler ) override;
144
145 // XChild, base of XFormController
146 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
147 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
148
149 // XComponent, base of XFormController
150 virtual void SAL_CALL dispose( ) override;
151 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
152 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
153
154 // XIndexAccess, base of XFormController
155 virtual ::sal_Int32 SAL_CALL getCount( ) override;
156 virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override;
157
158 // XElementAccess, base of XIndexAccess
159 virtual css::uno::Type SAL_CALL getElementType( ) override;
160 virtual sal_Bool SAL_CALL hasElements( ) override;
161
162 // XEnumerationAccess, base of XElementAccess
163 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) override;
164
165 // XModifyBroadcaster, base of XFormController
166 virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
167 virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
168
169 // XConfirmDeleteBroadcaster, base of XFormController
170 virtual void SAL_CALL addConfirmDeleteListener( const css::uno::Reference< css::form::XConfirmDeleteListener >& aListener ) override;
171 virtual void SAL_CALL removeConfirmDeleteListener( const css::uno::Reference< css::form::XConfirmDeleteListener >& aListener ) override;
172
173 // XSQLErrorBroadcaster, base of XFormController
174 virtual void SAL_CALL addSQLErrorListener( const css::uno::Reference< css::sdb::XSQLErrorListener >& Listener ) override;
175 virtual void SAL_CALL removeSQLErrorListener( const css::uno::Reference< css::sdb::XSQLErrorListener >& Listener ) override;
176
177 // XRowSetApproveBroadcaster, base of XFormController
178 virtual void SAL_CALL addRowSetApproveListener( const css::uno::Reference< css::sdb::XRowSetApproveListener >& listener ) override;
179 virtual void SAL_CALL removeRowSetApproveListener( const css::uno::Reference< css::sdb::XRowSetApproveListener >& listener ) override;
180
181 // XDatabaseParameterBroadcaster2, base of XFormController
182 virtual void SAL_CALL addDatabaseParameterListener( const css::uno::Reference< css::form::XDatabaseParameterListener >& aListener ) override;
183 virtual void SAL_CALL removeDatabaseParameterListener( const css::uno::Reference< css::form::XDatabaseParameterListener >& aListener ) override;
184
185 // XDatabaseParameterBroadcaster, base of XDatabaseParameterBroadcaster2
186 virtual void SAL_CALL addParameterListener( const css::uno::Reference< css::form::XDatabaseParameterListener >& aListener ) override;
187 virtual void SAL_CALL removeParameterListener( const css::uno::Reference< css::form::XDatabaseParameterListener >& aListener ) override;
188
189 // XModeSelector, base of XFormController
190 virtual void SAL_CALL setMode( const OUString& aMode ) override;
191 virtual OUString SAL_CALL getMode( ) override;
192 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedModes( ) override;
193 virtual sal_Bool SAL_CALL supportsMode( const OUString& aMode ) override;
194
195 // XTabController, base of XFormController
196 virtual void SAL_CALL setModel(const css::uno::Reference< css::awt::XTabControllerModel > & Model) override;
197 virtual css::uno::Reference< css::awt::XTabControllerModel > SAL_CALL getModel() override;
198 virtual void SAL_CALL setContainer(const css::uno::Reference< css::awt::XControlContainer > & Container) override;
199 virtual css::uno::Reference< css::awt::XControlContainer > SAL_CALL getContainer() override;
200 virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls() override;
201 virtual void SAL_CALL autoTabOrder() override;
202 virtual void SAL_CALL activateTabOrder() override;
203 virtual void SAL_CALL activateFirst() override;
204 virtual void SAL_CALL activateLast() override;
205
206 // XFrameActionListener
207 virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent& aEvent) override;
208
209 // XEventListener
210 virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
211
212protected:
213 virtual ~FormControllerImpl() override;
214};
215
216SbaXDataBrowserController::FormControllerImpl::FormControllerImpl(SbaXDataBrowserController* _pOwner)
217 :m_aActivateListeners(_pOwner->getMutex())
218 ,m_pOwner(_pOwner)
219{
220
221 OSL_ENSURE(m_pOwner, "SbaXDataBrowserController::FormControllerImpl::FormControllerImpl : invalid Owner !");
222}
223
225{
226
227}
228
230{
231 return FormOperations::createWithFormController( m_pOwner->m_xContext, this );
232}
233
235{
236 return m_pOwner->getBrowserView() ? m_pOwner->getBrowserView()->getGridControl() : Reference< css::awt::XControl > ();
237}
238
240{
241 m_aActivateListeners.addInterface(l);
242}
243
245{
246 m_aActivateListeners.removeInterface(l);
247}
248
250{
251 // not supported
252 throw IllegalArgumentException( OUString(), *this, 1 );
253}
254
256{
257 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::getContext: no support!!" );
258 return nullptr;
259}
260
262{
263 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::setContext: no support!!" );
264}
265
267{
268 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::getInteractionHandler: no support!!" );
269 return nullptr;
270}
271
273{
274 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::setInteractionHandler: no support!!" );
275}
276
278{
279 // don't have any parent form controllers
280 return nullptr;
281}
282
284{
285 throw NoSupportException( OUString(), *this );
286}
287
289{
290 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::dispose: no, you do *not* want to do this!" );
291}
292
294{
295 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::addEventListener: no support!!" );
296}
297
299{
300 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::removeEventListener: no support!!" );
301}
302
304{
305 // no sub controllers, never
306 return 0;
307}
308
310{
311 // no sub controllers, never
312 throw IndexOutOfBoundsException( OUString(), *this );
313}
314
316{
317 return ::cppu::UnoType< runtime::XFormController >::get();
318}
319
321{
322 // no sub controllers, never
323 return false;
324}
325
327{
328 return new ::comphelper::OEnumerationByIndex( this );
329}
330
332{
333 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::addModifyListener: no support!" );
334}
335
337{
338 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::removeModifyListener: no support!" );
339}
340
342{
343 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::addConfirmDeleteListener: no support!" );
344}
345
347{
348 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::removeConfirmDeleteListener: no support!" );
349}
350
352{
353 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::addSQLErrorListener: no support!" );
354}
355
357{
358 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::removeSQLErrorListener: no support!" );
359}
360
362{
363 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::addRowSetApproveListener: no support!" );
364}
365
367{
368 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::removeRowSetApproveListener: no support!" );
369}
370
372{
373 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::addDatabaseParameterListener: no support!" );
374}
375
377{
378 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::removeDatabaseParameterListener: no support!" );
379}
380
382{
383 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::addParameterListener: no support!" );
384}
385
387{
388 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::FormControllerImpl::removeParameterListener: no support!" );
389}
390
391void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setMode( const OUString& _rMode )
392{
393 if ( !supportsMode( _rMode ) )
394 throw NoSupportException();
395}
396
398{
399 return "DataMode";
400}
401
403{
404 Sequence< OUString > aModes { "DataMode" };
405 return aModes;
406}
407
409{
410 return aMode == "DataMode";
411}
412
414{
415 SAL_WARN("dbaccess.ui","SbaXDataBrowserController::FormControllerImpl::setModel : invalid call, can't change my model !");
416}
417
419{
420 return Reference< XTabControllerModel >(m_pOwner->getRowSet(), UNO_QUERY);
421}
422
424{
425 SAL_WARN("dbaccess.ui","SbaXDataBrowserController::FormControllerImpl::setContainer : invalid call, can't change my container !");
426}
427
429{
430 if (m_pOwner->getBrowserView())
431 return m_pOwner->getBrowserView()->getContainer();
433}
434
436{
437 if (m_pOwner->getBrowserView())
438 {
439 Reference< css::awt::XControl > xGrid = m_pOwner->getBrowserView()->getGridControl();
441 }
443}
444
446{
447 SAL_WARN("dbaccess.ui","SbaXDataBrowserController::FormControllerImpl::autoTabOrder : nothing to do (always have only one control) !");
448}
449
451{
452 SAL_WARN("dbaccess.ui","SbaXDataBrowserController::FormControllerImpl::activateTabOrder : nothing to do (always have only one control) !");
453}
454
456{
457 if (m_pOwner->getBrowserView())
458 m_pOwner->getBrowserView()->getVclControl()->ActivateCell();
459}
460
462{
463 if (m_pOwner->getBrowserView())
464 m_pOwner->getBrowserView()->getVclControl()->ActivateCell();
465}
466
467void SAL_CALL SbaXDataBrowserController::FormControllerImpl::frameAction(const css::frame::FrameActionEvent& /*aEvent*/)
468{
469}
470
471void SAL_CALL SbaXDataBrowserController::FormControllerImpl::disposing(const css::lang::EventObject& /*Source*/)
472{
473 // nothing to do
474 // we don't add ourself as listener to any broadcasters, so we are not responsible for removing us
475}
476
477// SbaXDataBrowserController
479{
480 return ::comphelper::concatSequences(
481 SbaXDataBrowserController_Base::getTypes(),
482 m_xFormControllerImpl->getTypes()
483 );
484}
485
487{
488 return css::uno::Sequence<sal_Int8>();
489}
490
492{
493 // check for our additional interfaces
494 Any aRet = SbaXDataBrowserController_Base::queryInterface(_rType);
495
496 // check for our aggregate (implementing the XFormController)
497 if (!aRet.hasValue())
498 aRet = m_xFormControllerImpl->queryAggregation(_rType);
499
500 // no more to offer
501 return aRet;
502}
503
507 ,m_aInvalidateClipboard("dbaui::SbaXDataBrowserController m_aInvalidateClipboard")
508 ,m_aAsyncGetCellFocus(LINK(this, SbaXDataBrowserController, OnAsyncGetCellFocus))
509 ,m_aAsyncDisplayError( LINK( this, SbaXDataBrowserController, OnAsyncDisplayError ) )
510 ,m_sStateSaveRecord(DBA_RES(RID_STR_SAVE_CURRENT_RECORD))
511 ,m_sStateUndoRecord(DBA_RES(RID_STR_UNDO_MODIFY_RECORD))
512 ,m_sModuleIdentifier( OUString( "com.sun.star.sdb.DataSourceBrowser" ) )
514 ,m_bLoadCanceled( false )
516{
517 // create the form controller aggregate
518 osl_atomic_increment(&m_refCount);
519 {
521 m_xFormControllerImpl->setDelegator(*this);
522 }
523 osl_atomic_decrement(&m_refCount);
524
527}
528
530{
531 // deleteView();
532 // release the aggregated form controller
533 if (m_xFormControllerImpl.is())
534 {
536 m_xFormControllerImpl->setDelegator(xEmpty);
537 }
538
539}
540
542{
543 SbaXDataBrowserController_Base::startFrameListening( _rxFrame );
544
546 if ( m_xFormControllerImpl.is() )
547 m_xFormControllerImpl->queryAggregation( cppu::UnoType<XFrameActionListener>::get() ) >>= xAggListener;
548
549 if ( _rxFrame.is() && xAggListener.is() )
550 _rxFrame->addFrameActionListener( xAggListener );
551}
552
554{
555 SbaXDataBrowserController_Base::stopFrameListening( _rxFrame );
556
558 if ( m_xFormControllerImpl.is() )
559 m_xFormControllerImpl->queryAggregation( cppu::UnoType<XFrameActionListener>::get() ) >>= xAggListener;
560
561 if ( _rxFrame.is() && xAggListener.is() )
562 _rxFrame->removeFrameActionListener( xAggListener );
563}
564
566{
567 m_bLoadCanceled = false;
569
570 Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY );
571 if ( xWarnings.is() )
572 {
573 try
574 {
575 xWarnings->clearWarnings();
576 }
577 catch(const SQLException& )
578 {
579 DBG_UNHANDLED_EXCEPTION("dbaccess");
580 }
581 }
582}
583
585{
586 ::connectivity::ErrorCode nErrorCode( connectivity::SQLError::getErrorCode( sdb::ErrorCondition::DATA_CANNOT_SELECT_UNFILTERED ) );
587 if ( static_cast<const SQLException*>(_rError)->ErrorCode == nErrorCode )
588 {
590 InvalidateFeature( ID_BROWSER_FILTERCRIT );
591 }
592}
593
595{
596 weld::WaitObject aWO(getFrameWeld());
597
598 onStartLoading( _rxLoadable );
599
600 FormErrorHelper aReportError(this);
601 if (_rxLoadable->isLoaded())
602 _rxLoadable->reload();
603 else
604 _rxLoadable->load();
605
606 m_xParser.clear();
607 const Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
608 if (::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)))
609 xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser;
610#if 0
611 {
612 const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY );
613 const Reference< XSingleSelectQueryAnalyzer > xAnalyzer( xRowSetProps->getPropertyValue( PROPERTY_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY );
614 if ( xAnalyzer.is() )
615 {
616 const Reference< XIndexAccess > xOrderColumns( xAnalyzer->getOrderColumns(), UNO_SET_THROW );
617 const sal_Int32 nOrderColumns( xOrderColumns->getCount() );
618 for ( sal_Int32 c=0; c<nOrderColumns; ++c )
619 {
620 const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW );
621 OUString sColumnName;
622 OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_NAME ) >>= sColumnName);
623 OUString sTableName;
624 OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName);
625 (void)sColumnName;
626 (void)sTableName;
627 }
628 }
629 }
630#endif
631
632 Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY );
633 if ( xWarnings.is() )
634 {
635 try
636 {
637 SQLExceptionInfo aInfo( xWarnings->getWarnings() );
638 if ( aInfo.isValid() )
639 {
640 showError( aInfo );
642 }
643 }
644 catch(const SQLException& )
645 {
646 DBG_UNHANDLED_EXCEPTION("dbaccess");
647 }
648 }
649
650 return _rxLoadable->isLoaded();
651}
652
654{
655 // create a formatter working with the connections format supplier
656 Reference< css::util::XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), true, getORB()));
657
658 if(xSupplier.is())
659 {
660 // create a new formatter
661 m_xFormatter.set(util::NumberFormatter::create(getORB()), UNO_QUERY_THROW);
662 m_xFormatter->attachNumberFormatsSupplier(xSupplier);
663 }
664 else // clear the formatter
665 m_xFormatter = nullptr;
666}
667
669{
670 SbaXDataBrowserController_Base::describeSupportedFeatures();
671 implDescribeSupportedFeature( ".uno:FormSlots/undoRecord", ID_BROWSER_UNDORECORD, CommandGroup::CONTROLS );
672 implDescribeSupportedFeature( ".uno:FormController/undoRecord", ID_BROWSER_UNDORECORD, CommandGroup::CONTROLS );
673 implDescribeSupportedFeature( ".uno:RecUndo", ID_BROWSER_UNDORECORD, CommandGroup::CONTROLS );
674 implDescribeSupportedFeature( ".uno:FormSlots/saveRecord", ID_BROWSER_SAVERECORD, CommandGroup::CONTROLS );
675 implDescribeSupportedFeature( ".uno:FormController/saveRecord", ID_BROWSER_SAVERECORD, CommandGroup::CONTROLS );
676 implDescribeSupportedFeature( ".uno:RecSave", ID_BROWSER_SAVERECORD, CommandGroup::CONTROLS );
677 implDescribeSupportedFeature( ".uno:Save", ID_BROWSER_SAVERECORD, CommandGroup::DOCUMENT );
678 implDescribeSupportedFeature( ".uno:RecSearch", SID_FM_SEARCH, CommandGroup::CONTROLS );
679 implDescribeSupportedFeature( ".uno:AutoFilter", SID_FM_AUTOFILTER, CommandGroup::CONTROLS );
680 implDescribeSupportedFeature( ".uno:Refresh", SID_FM_REFRESH, CommandGroup::CONTROLS );
681 implDescribeSupportedFeature( ".uno:OrderCrit", SID_FM_ORDERCRIT, CommandGroup::CONTROLS );
682 implDescribeSupportedFeature( ".uno:RemoveFilterSort", SID_FM_REMOVE_FILTER_SORT,CommandGroup::CONTROLS );
683 implDescribeSupportedFeature( ".uno:FormFiltered", SID_FM_FORM_FILTERED, CommandGroup::CONTROLS );
684 implDescribeSupportedFeature( ".uno:FilterCrit", SID_FM_FILTERCRIT, CommandGroup::CONTROLS );
685 implDescribeSupportedFeature( ".uno:Sortup", ID_BROWSER_SORTUP, CommandGroup::CONTROLS );
686 implDescribeSupportedFeature( ".uno:SortDown", ID_BROWSER_SORTDOWN, CommandGroup::CONTROLS );
687 implDescribeSupportedFeature( ".uno:FormSlots/deleteRecord", SID_FM_DELETEROWS, CommandGroup::EDIT );
688 implDescribeSupportedFeature( ".uno:FormSlots/insertRecord", ID_BROWSER_INSERT_ROW, CommandGroup::INSERT );
689}
690
692{
693 // create/initialize the form and the grid model
695 if (!m_xRowSet.is())
696 return false;
697
698 m_xColumnsSupplier.set(m_xRowSet,UNO_QUERY);
699 m_xLoadable.set(m_xRowSet,UNO_QUERY);
700
701 Reference< XPropertySet > xFormProperties( m_xRowSet, UNO_QUERY );
702 if ( !InitializeForm( xFormProperties ) )
703 return false;
704
706 if (!m_xGridModel.is())
707 return false;
708
709 // set the formatter if available
711
712 // we want to have a grid with a "flat" border
713 Reference< XPropertySet > xGridSet(m_xGridModel, UNO_QUERY);
714 if ( xGridSet.is() )
715 xGridSet->setPropertyValue(PROPERTY_BORDER, Any(sal_Int16(2)));
716
717
718 // marry them
720 {
721 OUString sText(DBA_RES(STR_DATASOURCE_GRIDCONTROL_NAME));
722 xNameCont->insertByName(sText, Any(m_xGridModel));
723 }
724
725 // create the view
726 setView( VclPtr<UnoDataBrowserView>::Create( pParent, *this, getORB() ) );
727 if (!getBrowserView())
728 return false;
729
730 // late construction
731 bool bSuccess = false;
732 try
733 {
735 bSuccess = true;
736 }
737 catch(SQLException&)
738 {
739 }
740 catch(Exception&)
741 {
742 SAL_WARN("dbaccess.ui","SbaXDataBrowserController::Construct : the construction of UnoDataBrowserView failed !");
743 }
744
745 if (!bSuccess)
746 {
747 // deleteView();
748 return false;
749 }
750
751 // now that we have a view we can create the clipboard listener
754
756 m_pClipboardNotifier->AddListener( getView() );
757
758 // this call create the toolbox
759 SbaXDataBrowserController_Base::Construct(pParent);
760
761 getBrowserView()->Show();
762
763 // set the callbacks for the grid control
765 OSL_ENSURE(pVclGrid, "SbaXDataBrowserController::Construct : have no VCL control !");
766 pVclGrid->SetMasterListener(this);
767
768 // add listeners...
769
770 // ... to the form model
771 Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
772 if (xFormSet.is())
773 {
774 xFormSet->addPropertyChangeListener(PROPERTY_ISNEW, static_cast<XPropertyChangeListener*>(this));
775 xFormSet->addPropertyChangeListener(PROPERTY_ISMODIFIED, static_cast<XPropertyChangeListener*>(this));
776 xFormSet->addPropertyChangeListener(PROPERTY_ROWCOUNT, static_cast<XPropertyChangeListener*>(this));
777 xFormSet->addPropertyChangeListener(PROPERTY_ACTIVECOMMAND, static_cast<XPropertyChangeListener*>(this));
778 xFormSet->addPropertyChangeListener(PROPERTY_ORDER, static_cast<XPropertyChangeListener*>(this));
779 xFormSet->addPropertyChangeListener(PROPERTY_FILTER, static_cast<XPropertyChangeListener*>(this));
780 xFormSet->addPropertyChangeListener(PROPERTY_HAVING_CLAUSE, static_cast<XPropertyChangeListener*>(this));
781 xFormSet->addPropertyChangeListener(PROPERTY_APPLYFILTER, static_cast<XPropertyChangeListener*>(this));
782 }
784 if (xFormError.is())
785 xFormError->addSQLErrorListener(static_cast<css::sdb::XSQLErrorListener*>(this));
786
787 if (m_xLoadable.is())
788 m_xLoadable->addLoadListener(this);
789
791 if (xFormParameter.is())
792 xFormParameter->addParameterListener(static_cast<css::form::XDatabaseParameterListener*>(this));
793
795 addControlListeners(getBrowserView()->getGridControl());
796
797 // load the form
798 return LoadForm();
799}
800
802{
804 return true;
805}
806
808{
809 // we're not interested in any column properties...
810}
811
813{
814}
815
817{
818 return Reference< XRowSet > (
819 getORB()->getServiceManager()->createInstanceWithContext("com.sun.star.form.component.Form", getORB()),
820 UNO_QUERY);
821}
822
824{
826 getORB()->getServiceManager()->createInstanceWithContext("com.sun.star.form.component.GridControl", getORB()),
827 UNO_QUERY);
828}
829
831{
832 // ... all the grid columns
833 addColumnListeners(_xGridControlModel);
834
835 // (we are interested in all columns the grid has (and only in these) so we have to listen to the container, too)
836 Reference< css::container::XContainer > xColContainer(_xGridControlModel, UNO_QUERY);
837 if (xColContainer.is())
838 xColContainer->addContainerListener(static_cast<css::container::XContainerListener*>(this));
839
840 Reference< css::form::XReset > xReset(_xGridControlModel, UNO_QUERY);
841 if (xReset.is())
842 xReset->addResetListener(static_cast<css::form::XResetListener*>(this));
843}
844
846{
847 // every single column model
848 Reference< XIndexContainer > xColumns(_xGridControlModel, UNO_QUERY);
849 if (xColumns.is())
850 {
851 sal_Int32 nCount = xColumns->getCount();
852 for (sal_Int32 i=0; i < nCount; ++i)
853 {
854 Reference< XPropertySet > xCol(xColumns->getByIndex(i),UNO_QUERY);
856 }
857 }
858
859 Reference< XContainer > xColContainer(_xGridControlModel, UNO_QUERY);
860 if (xColContainer.is())
861 xColContainer->removeContainerListener( this );
862
863 Reference< XReset > xReset(_xGridControlModel, UNO_QUERY);
864 if (xReset.is())
865 xReset->removeResetListener( this );
866}
867
869{
870 // to ge the 'modified' for the current cell
871 Reference< XModifyBroadcaster > xBroadcaster(getBrowserView()->getGridControl(), UNO_QUERY);
872 if (xBroadcaster.is())
873 xBroadcaster->addModifyListener(static_cast<XModifyListener*>(this));
874
875 // introduce ourself as dispatch provider for the grid
876 Reference< XDispatchProviderInterception > xInterception(getBrowserView()->getGridControl(), UNO_QUERY);
877 if (xInterception.is())
878 xInterception->registerDispatchProviderInterceptor(static_cast<XDispatchProviderInterceptor*>(this));
879
880 // add as focus listener to the control (needed for the form controller functionality)
881 Reference< XWindow > xWindow(_xGridControl, UNO_QUERY);
882 if (xWindow.is())
883 xWindow->addFocusListener(this);
884}
885
887{
888 Reference< XModifyBroadcaster > xBroadcaster(_xGridControl, UNO_QUERY);
889 if (xBroadcaster.is())
890 xBroadcaster->removeModifyListener(static_cast<XModifyListener*>(this));
891
892 Reference< XDispatchProviderInterception > xInterception(_xGridControl, UNO_QUERY);
893 if (xInterception.is())
894 xInterception->releaseDispatchProviderInterceptor(static_cast<XDispatchProviderInterceptor*>(this));
895
896 Reference< XWindow > xWindow(_xGridControl, UNO_QUERY);
897 if (xWindow.is())
898 xWindow->removeFocusListener(this);
899}
900
901void SAL_CALL SbaXDataBrowserController::focusGained(const FocusEvent& /*e*/)
902{
903 // notify our activate listeners (registered on the form controller aggregate)
904 EventObject aEvt(*this);
905 m_xFormControllerImpl->m_aActivateListeners.notifyEach( &css::form::XFormControllerListener::formActivated, aEvt );
906}
907
908void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e)
909{
910 // some general checks
911 if (!getBrowserView() || !getBrowserView()->getGridControl().is())
912 return;
913 Reference< XVclWindowPeer > xMyGridPeer(getBrowserView()->getGridControl()->getPeer(), UNO_QUERY);
914 if (!xMyGridPeer.is())
915 return;
916 Reference< XWindowPeer > xNextControlPeer(e.NextFocus, UNO_QUERY);
917 if (!xNextControlPeer.is())
918 return;
919
920 // don't do a notification if it remains in the family (i.e. a child of the grid control gets the focus)
921 if (xMyGridPeer->isChild(xNextControlPeer))
922 return;
923
924 if (xMyGridPeer == xNextControlPeer)
925 return;
926
927 // notify the listeners that the "form" we represent has been deactivated
928 EventObject aEvt(*this);
929 m_xFormControllerImpl->m_aActivateListeners.notifyEach( &css::form::XFormControllerListener::formDeactivated, aEvt );
930
931 // commit the changes of the grid control (as we're deactivated)
932 Reference< XBoundComponent > xCommitable(getBrowserView()->getGridControl(), UNO_QUERY);
933 if (xCommitable.is())
934 xCommitable->commit();
935 else
936 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::focusLost : why is my control not committable?");
937}
938
939void SbaXDataBrowserController::disposingFormModel(const css::lang::EventObject& Source)
940{
941 Reference< XPropertySet > xSourceSet(Source.Source, UNO_QUERY);
942 if (xSourceSet.is())
943 {
944 xSourceSet->removePropertyChangeListener(PROPERTY_ISNEW, static_cast<XPropertyChangeListener*>(this));
945 xSourceSet->removePropertyChangeListener(PROPERTY_ISMODIFIED, static_cast<XPropertyChangeListener*>(this));
946 xSourceSet->removePropertyChangeListener(PROPERTY_ROWCOUNT, static_cast<XPropertyChangeListener*>(this));
947 xSourceSet->removePropertyChangeListener(PROPERTY_ACTIVECOMMAND, static_cast<XPropertyChangeListener*>(this));
948 xSourceSet->removePropertyChangeListener(PROPERTY_ORDER, static_cast<XPropertyChangeListener*>(this));
949 xSourceSet->removePropertyChangeListener(PROPERTY_FILTER, static_cast<XPropertyChangeListener*>(this));
950 xSourceSet->removePropertyChangeListener(PROPERTY_HAVING_CLAUSE, static_cast<XPropertyChangeListener*>(this));
951 xSourceSet->removePropertyChangeListener(PROPERTY_APPLYFILTER, static_cast<XPropertyChangeListener*>(this));
952 }
953
954 Reference< css::sdb::XSQLErrorBroadcaster > xFormError(Source.Source, UNO_QUERY);
955 if (xFormError.is())
956 xFormError->removeSQLErrorListener(static_cast<css::sdb::XSQLErrorListener*>(this));
957
958 if (m_xLoadable.is())
959 m_xLoadable->removeLoadListener(this);
960
961 Reference< css::form::XDatabaseParameterBroadcaster > xFormParameter(Source.Source, UNO_QUERY);
962 if (xFormParameter.is())
963 xFormParameter->removeParameterListener(static_cast<css::form::XDatabaseParameterListener*>(this));
964}
965
966void SbaXDataBrowserController::disposingColumnModel(const css::lang::EventObject& Source)
967{
969}
970
971void SbaXDataBrowserController::disposing(const EventObject& Source)
972{
973 // if it's a component other than our aggregate, forward it to the aggregate
974 if ( uno::Reference<XInterface>(static_cast<cppu::OWeakObject*>(m_xFormControllerImpl.get()), UNO_QUERY) != Source.Source )
975 {
976 Reference< XEventListener > xAggListener;
977 m_xFormControllerImpl->queryAggregation( cppu::UnoType<decltype(xAggListener)>::get() ) >>= xAggListener;
978 if ( xAggListener.is( ))
979 xAggListener->disposing( Source );
980 }
981
982 // is it the grid control ?
983 if (getBrowserView())
984 {
985 Reference< css::awt::XControl > xSourceControl(Source.Source, UNO_QUERY);
986 if (xSourceControl == getBrowserView()->getGridControl())
987 removeControlListeners(getBrowserView()->getGridControl());
988 }
989
990 // its model (the container of the columns) ?
991 if (getControlModel() == Source.Source)
993
994 // the form's model ?
995 if (getRowSet() == Source.Source)
996 disposingFormModel(Source);
997
998 // from a single column model ?
999 Reference< XPropertySet > xSourceSet(Source.Source, UNO_QUERY);
1000 if (xSourceSet.is())
1001 {
1002 Reference< XPropertySetInfo > xInfo = xSourceSet->getPropertySetInfo();
1003 // we assume that columns have a Width property and all other sets we are listening to don't have
1004 if (xInfo->hasPropertyByName(PROPERTY_WIDTH))
1005 disposingColumnModel(Source);
1006 }
1007 SbaXDataBrowserController_Base::OGenericUnoController::disposing( Source );
1008}
1009
1010void SAL_CALL SbaXDataBrowserController::setIdentifier( const OUString& Identifier )
1011{
1012 ::osl::MutexGuard aGuard( getMutex() );
1014}
1015
1017{
1018 ::osl::MutexGuard aGuard( getMutex() );
1019 return m_sModuleIdentifier;
1020}
1021
1022void SbaXDataBrowserController::propertyChange(const PropertyChangeEvent& evt)
1023{
1024 Reference< XPropertySet > xSource(evt.Source, UNO_QUERY);
1025 if (!xSource.is())
1026 return;
1027
1028 SolarMutexGuard aGuard;
1029 // the IsModified changed to sal_False ?
1030 if ( evt.PropertyName == PROPERTY_ISMODIFIED
1031 && !::comphelper::getBOOL(evt.NewValue)
1032 )
1033 { // -> the current field isn't modified anymore, too
1034 setCurrentModified( false );
1035 }
1036
1037 // switching to a new record ?
1038 if ( evt.PropertyName == PROPERTY_ISNEW
1039 && ::comphelper::getBOOL(evt.NewValue)
1040 )
1041 {
1042 if (::comphelper::getINT32(xSource->getPropertyValue(PROPERTY_ROWCOUNT)) == 0)
1043 // if we're switching to a new record and didn't have any records before we need to invalidate
1044 // all slots (as the cursor was invalid before the mode change and so the slots were disabled)
1045 InvalidateAll();
1046 }
1047
1048 if (evt.PropertyName == PROPERTY_FILTER)
1049 {
1050 InvalidateFeature(ID_BROWSER_REMOVEFILTER);
1051 }
1052 else if (evt.PropertyName == PROPERTY_HAVING_CLAUSE)
1053 {
1054 InvalidateFeature(ID_BROWSER_REMOVEFILTER);
1055 }
1056 else if (evt.PropertyName == PROPERTY_ORDER)
1057 {
1058 InvalidateFeature(ID_BROWSER_REMOVEFILTER);
1059 }
1060
1061 // a new record count ? -> may be our search availability has changed
1062 if (evt.PropertyName == PROPERTY_ROWCOUNT)
1063 {
1064 sal_Int32 nNewValue = 0, nOldValue = 0;
1065 evt.NewValue >>= nNewValue;
1066 evt.OldValue >>= nOldValue;
1067 if((nOldValue == 0 && nNewValue != 0) || (nOldValue != 0 && nNewValue == 0))
1068 InvalidateAll();
1069 }
1070}
1071
1072void SbaXDataBrowserController::modified(const css::lang::EventObject& /*aEvent*/)
1073{
1074 setCurrentModified( true );
1075}
1076
1077void SbaXDataBrowserController::elementInserted(const css::container::ContainerEvent& evt)
1078{
1079 OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(),
1080 "SbaXDataBrowserController::elementInserted: where did this come from (not from the grid model)?!");
1081 Reference< XPropertySet > xNewColumn(evt.Element,UNO_QUERY);
1082 if ( xNewColumn.is() )
1083 AddColumnListener(xNewColumn);
1084}
1085
1086void SbaXDataBrowserController::elementRemoved(const css::container::ContainerEvent& evt)
1087{
1088 OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(),
1089 "SbaXDataBrowserController::elementRemoved: where did this come from (not from the grid model)?!");
1090 Reference< XPropertySet > xOldColumn(evt.Element,UNO_QUERY);
1091 if ( xOldColumn.is() )
1092 RemoveColumnListener(xOldColumn);
1093}
1094
1095void SbaXDataBrowserController::elementReplaced(const css::container::ContainerEvent& evt)
1096{
1097 OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(),
1098 "SbaXDataBrowserController::elementReplaced: where did this come from (not from the grid model)?!");
1099 Reference< XPropertySet > xOldColumn(evt.ReplacedElement,UNO_QUERY);
1100 if ( xOldColumn.is() )
1101 RemoveColumnListener(xOldColumn);
1102
1103 Reference< XPropertySet > xNewColumn(evt.Element,UNO_QUERY);
1104 if ( xNewColumn.is() )
1105 AddColumnListener(xNewColumn);
1106}
1107
1109{
1112 m_aAsyncInvalidateAll.CancelCall();
1113
1114 bool bSuccess = SaveModified();
1115 return bSuccess;
1116}
1117
1119{
1120 // the base class
1121 SbaXDataBrowserController_Base::OGenericUnoController::disposing();
1122
1123 // the data source
1124 Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
1125 if (xFormSet.is())
1126 {
1127 xFormSet->removePropertyChangeListener(PROPERTY_ISNEW, static_cast<XPropertyChangeListener*>(this));
1128 xFormSet->removePropertyChangeListener(PROPERTY_ISMODIFIED, static_cast<XPropertyChangeListener*>(this));
1129 xFormSet->removePropertyChangeListener(PROPERTY_ROWCOUNT, static_cast<XPropertyChangeListener*>(this));
1130 xFormSet->removePropertyChangeListener(PROPERTY_ACTIVECOMMAND, static_cast<XPropertyChangeListener*>(this));
1131 xFormSet->removePropertyChangeListener(PROPERTY_ORDER, static_cast<XPropertyChangeListener*>(this));
1132 xFormSet->removePropertyChangeListener(PROPERTY_FILTER, static_cast<XPropertyChangeListener*>(this));
1133 xFormSet->removePropertyChangeListener(PROPERTY_HAVING_CLAUSE, static_cast<XPropertyChangeListener*>(this));
1134 xFormSet->removePropertyChangeListener(PROPERTY_APPLYFILTER, static_cast<XPropertyChangeListener*>(this));
1135 }
1136
1138 if (xFormError.is())
1139 xFormError->removeSQLErrorListener(static_cast<css::sdb::XSQLErrorListener*>(this));
1140
1141 if (m_xLoadable.is())
1142 m_xLoadable->removeLoadListener(this);
1143
1145 if (xFormParameter.is())
1146 xFormParameter->removeParameterListener(static_cast<css::form::XDatabaseParameterListener*>(this));
1147
1149
1150 if ( getView() && m_pClipboardNotifier.is() )
1151 {
1152 m_pClipboardNotifier->ClearCallbackLink();
1153 m_pClipboardNotifier->RemoveListener( getView() );
1154 m_pClipboardNotifier.clear();
1155 }
1156
1157 if (getBrowserView())
1158 {
1159 removeControlListeners(getBrowserView()->getGridControl());
1160 // don't delete explicitly, this is done by the owner (and user) of this controller (me hopes ...)
1161 clearView();
1162 }
1163
1166
1167 // dispose the row set
1168 try
1169 {
1170 ::comphelper::disposeComponent(m_xRowSet);
1171
1172 m_xRowSet = nullptr;
1173 m_xColumnsSupplier = nullptr;
1174 m_xLoadable = nullptr;
1175 }
1176 catch(Exception&)
1177 {
1178 DBG_UNHANDLED_EXCEPTION("dbaccess");
1179 }
1180 m_xParser.clear();
1181 // don't dispose, just reset - it's owned by the RowSet
1182}
1183
1184void SbaXDataBrowserController::frameAction(const css::frame::FrameActionEvent& aEvent)
1185{
1186 ::osl::MutexGuard aGuard( getMutex() );
1187
1188 SbaXDataBrowserController_Base::frameAction( aEvent );
1189
1190 if ( aEvent.Source != getFrame() )
1191 return;
1192
1193 switch ( aEvent.Action )
1194 {
1195 case FrameAction_FRAME_ACTIVATED:
1196 case FrameAction_FRAME_UI_ACTIVATED:
1197 // ensure that the active cell (if any) has the focus
1199 // start the clipboard timer
1200 if (getBrowserView() && getBrowserView()->getVclControl() && !m_aInvalidateClipboard.IsActive())
1201 {
1203 OnInvalidateClipboard( nullptr );
1204 }
1205 break;
1206 case FrameAction_FRAME_DEACTIVATING:
1207 case FrameAction_FRAME_UI_DEACTIVATING:
1208 // stop the clipboard invalidator
1209 if (getBrowserView() && getBrowserView()->getVclControl() && m_aInvalidateClipboard.IsActive())
1210 {
1212 OnInvalidateClipboard( nullptr );
1213 }
1214 // remove the "get cell focus"-event
1216 break;
1217 default:
1218 break;
1219 }
1220}
1221
1222IMPL_LINK_NOARG( SbaXDataBrowserController, OnAsyncDisplayError, void*, void )
1223{
1224 if ( m_aCurrentError.isValid() )
1225 {
1226 OSQLMessageBox aDlg(getFrameWeld(), m_aCurrentError);
1227 aDlg.run();
1228 }
1229}
1230
1231void SbaXDataBrowserController::errorOccured(const css::sdb::SQLErrorEvent& aEvent)
1232{
1233 ::osl::MutexGuard aGuard( getMutex() );
1234
1235 SQLExceptionInfo aInfo( aEvent.Reason );
1236 if ( !aInfo.isValid() )
1237 return;
1238
1240 {
1241 OSL_ENSURE( !m_aCurrentError.isValid(), "SbaXDataBrowserController::errorOccurred: can handle one error per transaction only!" );
1242 m_aCurrentError = aInfo;
1243 }
1244 else
1245 {
1246 m_aCurrentError = aInfo;
1248 }
1249}
1250
1251sal_Bool SbaXDataBrowserController::approveParameter(const css::form::DatabaseParameterEvent& aEvent)
1252{
1253 if (aEvent.Source != getRowSet())
1254 {
1255 // not my data source -> allow anything
1256 SAL_WARN("dbaccess.ui","SbaXDataBrowserController::approveParameter : invalid event source !");
1257 return true;
1258 }
1259
1260 Reference< css::container::XIndexAccess > xParameters = aEvent.Parameters;
1261 SolarMutexGuard aSolarGuard;
1262
1263 // default handling: instantiate an interaction handler and let it handle the parameter request
1264 try
1265 {
1266 // two continuations allowed: OK and Cancel
1269 // the request
1270 ParametersRequest aRequest;
1271 aRequest.Parameters = xParameters;
1272 aRequest.Connection = getConnection(Reference< XRowSet >(aEvent.Source, UNO_QUERY));
1273 rtl::Reference<OInteractionRequest> pParamRequest = new OInteractionRequest(Any(aRequest));
1274 // some knittings
1275 pParamRequest->addContinuation(pParamValues);
1276 pParamRequest->addContinuation(pAbort);
1277
1278 // create the handler, let it handle the request
1279 Reference< XInteractionHandler2 > xHandler(InteractionHandler::createWithParent(getORB(), getComponentWindow()));
1280 xHandler->handle(pParamRequest);
1281
1282 if (!pParamValues->wasSelected())
1283 { // canceled
1285 return false;
1286 }
1287
1288 // transfer the values into the parameter supplier
1289 Sequence< PropertyValue > aFinalValues = pParamValues->getValues();
1290 if (aFinalValues.getLength() != aRequest.Parameters->getCount())
1291 {
1292 SAL_WARN("dbaccess.ui","SbaXDataBrowserController::approveParameter: the InteractionHandler returned nonsense!");
1294 return false;
1295 }
1296 const PropertyValue* pFinalValues = aFinalValues.getConstArray();
1297 for (sal_Int32 i=0; i<aFinalValues.getLength(); ++i, ++pFinalValues)
1298 {
1300 aRequest.Parameters->getByIndex(i), css::uno::UNO_QUERY);
1301 OSL_ENSURE(xParam.is(), "SbaXDataBrowserController::approveParameter: one of the parameters is no property set!");
1302 if (xParam.is())
1303 {
1304#ifdef DBG_UTIL
1305 OUString sName;
1306 xParam->getPropertyValue(PROPERTY_NAME) >>= sName;
1307 OSL_ENSURE(sName == pFinalValues->Name, "SbaXDataBrowserController::approveParameter: suspicious value names!");
1308#endif
1309 try { xParam->setPropertyValue(PROPERTY_VALUE, pFinalValues->Value); }
1310 catch(Exception&)
1311 {
1312 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::approveParameter: setting one of the properties failed!");
1313 }
1314 }
1315 }
1316 }
1317 catch( const Exception& )
1318 {
1319 DBG_UNHANDLED_EXCEPTION("dbaccess");
1320 }
1321
1322 return true;
1323}
1324
1325sal_Bool SbaXDataBrowserController::approveReset(const css::lang::EventObject& /*rEvent*/)
1326{
1327 return true;
1328}
1329
1330void SbaXDataBrowserController::resetted(const css::lang::EventObject& rEvent)
1331{
1332 OSL_ENSURE(rEvent.Source == getControlModel(), "SbaXDataBrowserController::resetted : where did this come from ?");
1333 setCurrentModified( false );
1334}
1335
1336sal_Bool SbaXDataBrowserController::confirmDelete(const css::sdb::RowChangeEvent& /*aEvent*/)
1337{
1338 std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(getFrameWeld(),
1339 VclMessageType::Question, VclButtonsType::YesNo,
1340 DBA_RES(STR_QUERY_BRW_DELETE_ROWS)));
1341 if (xQuery->run() != RET_YES)
1342 return false;
1343 return true;
1344}
1345
1347{
1348 FeatureState aReturn;
1349 // (disabled automatically)
1350
1351 try
1352 {
1353 // no chance without a view
1354 if (!getBrowserView() || !getBrowserView()->getVclControl())
1355 return aReturn;
1356
1357 switch (nId)
1358 {
1360 if (!m_xParser.is())
1361 {
1362 aReturn.bEnabled = false;
1363 return aReturn;
1364 }
1365 // any filter or sort order set ?
1366 aReturn.bEnabled = m_xParser->getFilter().getLength() || m_xParser->getHavingClause().getLength() || m_xParser->getOrder().getLength();
1367 return aReturn;
1368 }
1369 // no chance without valid models
1370 if (isValid() && !isValidCursor())
1371 return aReturn;
1372
1373 switch (nId)
1374 {
1375 case ID_BROWSER_SEARCH:
1376 {
1377 Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
1378 sal_Int32 nCount = ::comphelper::getINT32(xFormSet->getPropertyValue(PROPERTY_ROWCOUNT));
1379 aReturn.bEnabled = nCount != 0;
1380 }
1381 break;
1383 {
1384 // check if it is available
1385 bool bInsertPrivilege = ( m_nRowSetPrivileges & Privilege::INSERT) != 0;
1386 bool bAllowInsertions = true;
1387 try
1388 {
1389 Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW );
1390 OSL_VERIFY( xRowSetProps->getPropertyValue("AllowInserts") >>= bAllowInsertions );
1391 }
1392 catch( const Exception& )
1393 {
1394 DBG_UNHANDLED_EXCEPTION("dbaccess");
1395 }
1396 aReturn.bEnabled = bInsertPrivilege && bAllowInsertions;
1397 }
1398 break;
1399 case SID_FM_DELETEROWS:
1400 {
1401 // check if it is available
1402 bool bDeletePrivilege = ( m_nRowSetPrivileges & Privilege::INSERT) != 0;
1403 bool bAllowDeletions = true;
1404 sal_Int32 nRowCount = 0;
1405 bool bInsertionRow = false;
1406 try
1407 {
1408 Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW );
1409 OSL_VERIFY( xRowSetProps->getPropertyValue("AllowDeletes") >>= bAllowDeletions );
1410 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ROWCOUNT ) >>= nRowCount );
1411 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ISNEW ) >>= bInsertionRow );
1412 }
1413 catch( const Exception& )
1414 {
1415 DBG_UNHANDLED_EXCEPTION("dbaccess");
1416 }
1417 aReturn.bEnabled = bDeletePrivilege && bAllowDeletions && ( nRowCount != 0 ) && !bInsertionRow;
1418 }
1419 break;
1420
1421 case ID_BROWSER_COPY:
1422 if ( getBrowserView()->getVclControl()->GetSelectRowCount() )
1423 {
1424 aReturn.bEnabled = m_aCurrentFrame.isActive();
1425 break;
1426 }
1427 [[fallthrough]];
1428 case ID_BROWSER_PASTE:
1429 case ID_BROWSER_CUT:
1430 {
1431 CellControllerRef xCurrentController = getBrowserView()->getVclControl()->Controller();
1432 if (const EditCellController* pController = dynamic_cast<const EditCellController*>(xCurrentController.get()))
1433 {
1434 const IEditImplementation* pEditImplementation = pController->GetEditImplementation();
1435 bool bHasLen = pEditImplementation->GetSelection().Len() != 0;
1436 bool bIsReadOnly = pEditImplementation->IsReadOnly();
1437 switch (nId)
1438 {
1439 case ID_BROWSER_CUT: aReturn.bEnabled = m_aCurrentFrame.isActive() && bHasLen && !bIsReadOnly; break;
1440 case SID_COPY : aReturn.bEnabled = m_aCurrentFrame.isActive() && bHasLen; break;
1441 case ID_BROWSER_PASTE:
1442 aReturn.bEnabled = m_aCurrentFrame.isActive() && !bIsReadOnly;
1443 if(aReturn.bEnabled)
1444 {
1445 aReturn.bEnabled = IsFormatSupported( m_aSystemClipboard.GetDataFlavorExVector(), SotClipboardFormatId::STRING );
1446 }
1447 break;
1448 }
1449 }
1450 }
1451 break;
1452
1453 case ID_BROWSER_SORTUP:
1456 {
1457 // a native statement can't be filtered or sorted
1458 const Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
1459 if ( !::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)) || !m_xParser.is() )
1460 break;
1461
1462 Reference< XPropertySet > xCurrentField = getBoundField();
1463 if (!xCurrentField.is())
1464 break;
1465
1466 aReturn.bEnabled = ::comphelper::getBOOL(xCurrentField->getPropertyValue(PROPERTY_ISSEARCHABLE));
1467 const Reference< XRowSet > xRow = getRowSet();
1468 aReturn.bEnabled = aReturn.bEnabled
1469 && xRow.is()
1470 && !xRow->isBeforeFirst()
1471 && !xRow->isAfterLast()
1472 && !xRow->rowDeleted()
1473 && ( ::comphelper::getINT32( xFormSet->getPropertyValue( PROPERTY_ROWCOUNT ) ) != 0 );
1474 }
1475 break;
1476
1479 {
1480 aReturn.bEnabled = true;
1481 break;
1482 }
1483 [[fallthrough]];
1485 {
1486 const Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
1487 if ( !::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)) || !m_xParser.is() )
1488 break;
1489
1490 aReturn.bEnabled = getRowSet().is()
1491 && ( ::comphelper::getINT32( xFormSet->getPropertyValue( PROPERTY_ROWCOUNT ) ) != 0 );
1492 }
1493 break;
1494
1495 case ID_BROWSER_REFRESH:
1496 aReturn.bEnabled = true;
1497 break;
1498
1499 case ID_BROWSER_REDO:
1500 aReturn.bEnabled = false; // simply forget it ;). no redo possible.
1501 break;
1502
1505 {
1506 if (!m_bCurrentlyModified)
1507 {
1508 Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
1509 if (xFormSet.is())
1510 aReturn.bEnabled = ::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ISMODIFIED));
1511 }
1512 else
1513 aReturn.bEnabled = true;
1514
1516 }
1517 break;
1518 case ID_BROWSER_EDITDOC:
1519 {
1520 // check if it is available
1521 Reference< XPropertySet > xDataSourceSet(getRowSet(), UNO_QUERY);
1522 if (!xDataSourceSet.is())
1523 break; // no datasource -> no edit mode
1524
1525 sal_Int32 nDataSourcePrivileges = ::comphelper::getINT32(xDataSourceSet->getPropertyValue(PROPERTY_PRIVILEGES));
1526 bool bInsertAllowedAndPossible = ((nDataSourcePrivileges & css::sdbcx::Privilege::INSERT) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue("AllowInserts"));
1527 bool bUpdateAllowedAndPossible = ((nDataSourcePrivileges & css::sdbcx::Privilege::UPDATE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue("AllowUpdates"));
1528 bool bDeleteAllowedAndPossible = ((nDataSourcePrivileges & css::sdbcx::Privilege::DELETE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue("AllowDeletes"));
1529 if (!bInsertAllowedAndPossible && !bUpdateAllowedAndPossible && !bDeleteAllowedAndPossible)
1530 break; // no insert/update/delete -> no edit mode
1531
1532 if (!isValidCursor() || !isLoaded())
1533 break; // no cursor -> no edit mode
1534
1535 aReturn.bEnabled = true;
1536
1538 aReturn.bChecked = nGridMode > DbGridControlOptions::Readonly;
1539 }
1540 break;
1542 {
1543 aReturn.bEnabled = false;
1544 Reference< XPropertySet > xActiveSet(getRowSet(), UNO_QUERY);
1545 OUString aFilter = ::comphelper::getString(xActiveSet->getPropertyValue(PROPERTY_FILTER));
1546 OUString aHaving = ::comphelper::getString(xActiveSet->getPropertyValue(PROPERTY_HAVING_CLAUSE));
1547 if ( !(aFilter.isEmpty() && aHaving.isEmpty()) )
1548 {
1549 xActiveSet->getPropertyValue( PROPERTY_APPLYFILTER ) >>= aReturn.bChecked;
1550 aReturn.bEnabled = true;
1551 }
1552 else
1553 {
1554 aReturn.bChecked = false;
1555 aReturn.bEnabled = false;
1556 }
1557 }
1558 break;
1559 default:
1560 return SbaXDataBrowserController_Base::GetState(nId);
1561 }
1562 }
1563 catch(const Exception& )
1564 {
1565 DBG_UNHANDLED_EXCEPTION("dbaccess");
1566 }
1567
1568 return aReturn;
1569}
1570
1572{
1573 Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
1574 if (!m_xLoadable.is())
1575 {
1576 SAL_WARN("dbaccess.ui","SbaXDataBrowserController::applyParserOrder: invalid row set!");
1577 return;
1578 }
1579
1580 sal_uInt16 nPos = getCurrentColumnPosition();
1581 bool bSuccess = false;
1582 try
1583 {
1584 xFormSet->setPropertyValue(PROPERTY_ORDER, Any(_xParser->getOrder()));
1585 bSuccess = reloadForm(m_xLoadable);
1586 }
1587 catch(Exception&)
1588 {
1589 }
1590
1591 if (!bSuccess)
1592 {
1593 xFormSet->setPropertyValue(PROPERTY_ORDER, Any(_rOldOrder));
1594
1595 try
1596 {
1598 criticalFail();
1599 }
1600 catch(Exception&)
1601 {
1602 criticalFail();
1603 }
1604 InvalidateAll();
1605 }
1606 InvalidateFeature(ID_BROWSER_REMOVEFILTER);
1607
1609}
1610
1611void SbaXDataBrowserController::applyParserFilter(const OUString& _rOldFilter, bool _bOldFilterApplied,const ::OUString& _sOldHaving,const Reference< XSingleSelectQueryComposer >& _xParser)
1612{
1613 Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
1614 if (!m_xLoadable.is())
1615 {
1616 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::applyParserFilter: invalid row set!");
1617 return;
1618 }
1619
1620 sal_uInt16 nPos = getCurrentColumnPosition();
1621
1622 bool bSuccess = false;
1623 try
1624 {
1625 FormErrorHelper aError(this);
1626 xFormSet->setPropertyValue(PROPERTY_FILTER, Any(_xParser->getFilter()));
1627 xFormSet->setPropertyValue(PROPERTY_HAVING_CLAUSE, Any(_xParser->getHavingClause()));
1628 xFormSet->setPropertyValue(PROPERTY_APPLYFILTER, css::uno::Any(true));
1629
1630 bSuccess = reloadForm(m_xLoadable);
1631 }
1632 catch(Exception&)
1633 {
1634 }
1635
1636 if (!bSuccess)
1637 {
1638 xFormSet->setPropertyValue(PROPERTY_FILTER, Any(_rOldFilter));
1639 xFormSet->setPropertyValue(PROPERTY_HAVING_CLAUSE, Any(_sOldHaving));
1640 xFormSet->setPropertyValue(PROPERTY_APPLYFILTER, css::uno::Any(_bOldFilterApplied));
1641
1642 try
1643 {
1645 criticalFail();
1646 }
1647 catch(Exception&)
1648 {
1649 criticalFail();
1650 }
1651 InvalidateAll();
1652 }
1653 InvalidateFeature(ID_BROWSER_REMOVEFILTER);
1654
1656}
1657
1659{
1661 try
1662 {
1663 const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW );
1665 xRowSetProps->getPropertyValue( PROPERTY_ACTIVE_CONNECTION ), UNO_QUERY_THROW );
1666 xComposer.set( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW );
1667
1668 OUString sActiveCommand;
1669 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= sActiveCommand );
1670 if ( !sActiveCommand.isEmpty() )
1671 {
1672 xComposer->setElementaryQuery( sActiveCommand );
1673 }
1674 else
1675 {
1676 OUString sCommand;
1677 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand );
1678 sal_Int32 nCommandType = CommandType::COMMAND;
1679 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND_TYPE ) >>= nCommandType );
1680 xComposer->setCommand( sCommand, nCommandType );
1681 }
1682
1683 OUString sFilter;
1684 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_FILTER ) >>= sFilter );
1685 xComposer->setFilter( sFilter );
1686
1687 OUString sHavingClause;
1688 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_HAVING_CLAUSE ) >>= sHavingClause );
1689 xComposer->setHavingClause( sHavingClause );
1690
1691 OUString sOrder;
1692 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ORDER ) >>= sOrder );
1693 xComposer->setOrder( sOrder );
1694 }
1695 catch ( const Exception& )
1696 {
1697 DBG_UNHANDLED_EXCEPTION("dbaccess");
1698 }
1699 return xComposer;
1700}
1701
1703{
1704 if (!SaveModified())
1705 return;
1706
1707 Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
1708
1709 const OUString sOldVal = bFilter ? m_xParser->getFilter() : m_xParser->getOrder();
1710 const OUString sOldHaving = m_xParser->getHavingClause();
1712 try
1713 {
1714 Reference< XConnection> xCon(xFormSet->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY);
1715 if(bFilter)
1716 {
1717 DlgFilterCrit aDlg(getFrameWeld(), getORB(), xCon, xParser, m_xColumnsSupplier->getColumns());
1718 if (!aDlg.run())
1719 return; // if so we don't need to update the grid
1720 aDlg.BuildWherePart();
1721 }
1722 else
1723 {
1724 DlgOrderCrit aDlg(getFrameWeld(), xCon, xParser, m_xColumnsSupplier->getColumns());
1725 if (!aDlg.run())
1726 {
1727 return; // if so we don't need to actualize the grid
1728 }
1729 aDlg.BuildOrderPart();
1730 }
1731 }
1732 catch(const SQLException& )
1733 {
1734 SQLExceptionInfo aError( ::cppu::getCaughtException() );
1735 showError( aError );
1736 return;
1737 }
1738 catch(Exception&)
1739 {
1740 return;
1741 }
1742
1743 OUString sNewVal = bFilter ? xParser->getFilter() : xParser->getOrder();
1744 bool bOldFilterApplied(false);
1745 if (bFilter)
1746 {
1747 try { bOldFilterApplied = ::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_APPLYFILTER)); } catch(Exception&) { } ;
1748 }
1749
1750 OUString sNewHaving = xParser->getHavingClause();
1751 if ( sOldVal == sNewVal && (!bFilter || sOldHaving == sNewHaving) )
1752 // nothing to be done
1753 return;
1754
1755 if (bFilter)
1756 applyParserFilter(sOldVal, bOldFilterApplied,sOldHaving,xParser);
1757 else
1758 applyParserOrder(sOldVal,xParser);
1759
1760 ::comphelper::disposeComponent(xParser);
1761}
1762
1764{
1765 // calculate the control source of the active field
1766 Reference< css::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY);
1767 OSL_ENSURE(xGrid.is(), "SbaXDataBrowserController::ExecuteSearch : the control should have a css::form::XGrid interface !");
1768
1769 Reference< css::form::XGridPeer > xGridPeer(getBrowserView()->getGridControl()->getPeer(), UNO_QUERY);
1770 Reference< css::container::XIndexContainer > xColumns = xGridPeer->getColumns();
1771 OSL_ENSURE(xGridPeer.is() && xColumns.is(), "SbaXDataBrowserController::ExecuteSearch : invalid peer !");
1772
1773 sal_Int16 nViewCol = xGrid->getCurrentColumnPosition();
1774 sal_Int16 nModelCol = getBrowserView()->View2ModelPos(nViewCol);
1775
1776 Reference< XPropertySet > xCurrentCol(xColumns->getByIndex(nModelCol),UNO_QUERY);
1777 OUString sActiveField = ::comphelper::getString(xCurrentCol->getPropertyValue(PROPERTY_CONTROLSOURCE));
1778
1779 // the text within the current cell
1780 OUString sInitialText;
1781 Reference< css::container::XIndexAccess > xColControls(xGridPeer, UNO_QUERY);
1782 Reference< XInterface > xCurControl(xColControls->getByIndex(nViewCol),UNO_QUERY);
1783 OUString aInitialText;
1784 if (IsSearchableControl(xCurControl, &aInitialText))
1785 sInitialText = aInitialText;
1786
1787 // prohibit the synchronization of the grid's display with the cursor's position
1788 Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY);
1789 OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!");
1790 xModelSet->setPropertyValue("DisplayIsSynchron", css::uno::Any(false));
1791 xModelSet->setPropertyValue("AlwaysShowCursor", css::uno::Any(true));
1792 xModelSet->setPropertyValue("CursorColor", Any(COL_LIGHTRED));
1793
1796 std::vector< OUString > aContextNames;
1797 aContextNames.emplace_back("Standard" );
1798 pDialog = pFact->CreateFmSearchDialog(getFrameWeld(), sInitialText, aContextNames, 0, LINK(this, SbaXDataBrowserController, OnSearchContextRequest));
1799 pDialog->SetActiveField( sActiveField );
1800 pDialog->SetFoundHandler( LINK( this, SbaXDataBrowserController, OnFoundData ) );
1801 pDialog->SetCanceledNotFoundHdl( LINK( this, SbaXDataBrowserController, OnCanceledNotFound ) );
1802 pDialog->Execute();
1803 pDialog.disposeAndClear();
1804
1805 // restore the grid's normal operating state
1806 xModelSet->setPropertyValue("DisplayIsSynchron", css::uno::Any(true));
1807 xModelSet->setPropertyValue("AlwaysShowCursor", css::uno::Any(false));
1808 xModelSet->setPropertyValue("CursorColor", Any());
1809}
1810
1812{
1813 bool bSortUp = true;
1814
1815 switch (nId)
1816 {
1817 default:
1818 SbaXDataBrowserController_Base::Execute( nId, _rArgs );
1819 return;
1820
1822 try
1823 {
1824 if (SaveModified())
1825 {
1826 getRowSet()->afterLast();
1827 // check if it is available
1828 Reference< XResultSetUpdate > xUpdateCursor(getRowSet(), UNO_QUERY_THROW);
1829 xUpdateCursor->moveToInsertRow();
1830 }
1831 }
1832 catch(Exception&)
1833 {
1834 TOOLS_WARN_EXCEPTION("dbaccess.ui", "" );
1835 }
1836 break;
1837 case SID_FM_DELETEROWS:
1838
1839 if (SaveModified())
1840 {
1842 if ( pVclGrid )
1843 {
1844 if( !pVclGrid->GetSelectRowCount() )
1845 {
1846 pVclGrid->DeactivateCell();
1847 pVclGrid->SelectRow(pVclGrid->GetCurRow());
1848 }
1849 pVclGrid->DeleteSelectedRows();
1850 }
1851 }
1852 break;
1853
1855 if (SaveModified())
1856 {
1857 Reference< XPropertySet > xActiveSet(getRowSet(), UNO_QUERY);
1858 bool bApplied = ::comphelper::getBOOL(xActiveSet->getPropertyValue(PROPERTY_APPLYFILTER));
1859 xActiveSet->setPropertyValue(PROPERTY_APPLYFILTER, css::uno::Any(!bApplied));
1861 }
1862 InvalidateFeature(ID_BROWSER_FILTERED);
1863 break;
1864 case ID_BROWSER_EDITDOC:
1865 {
1867 if (nGridMode == DbGridControlOptions::Readonly)
1868 getBrowserView()->getVclControl()->SetOptions(DbGridControlOptions::Update | DbGridControlOptions::Insert | DbGridControlOptions::Delete);
1869 // the options not supported by the data source will be removed automatically
1870 else
1871 {
1872 if ( !SaveModified( ) )
1873 // give the user a chance to save the current record (if necessary)
1874 break;
1875
1876 // maybe the user wanted to reject the modified record ?
1877 if (GetState(ID_BROWSER_UNDORECORD).bEnabled)
1879
1880 getBrowserView()->getVclControl()->SetOptions(DbGridControlOptions::Readonly);
1881 }
1882 InvalidateFeature(ID_BROWSER_EDITDOC);
1883 }
1884 break;
1885
1886 case ID_BROWSER_SEARCH:
1887 if ( SaveModified( ) )
1888 ExecuteSearch();
1889 break;
1890
1891 case ID_BROWSER_COPY:
1892 if ( getBrowserView()->getVclControl()->GetSelectRowCount() > 0 )
1893 {
1895 break;
1896 }
1897 [[fallthrough]];
1898 case ID_BROWSER_CUT:
1899 case ID_BROWSER_PASTE:
1900 {
1901 CellControllerRef xCurrentController = getBrowserView()->getVclControl()->Controller();
1902 if (EditCellController* pController = dynamic_cast<EditCellController*>(xCurrentController.get()))
1903 {
1904 IEditImplementation* pEditImplementation = pController->GetEditImplementation();
1905 switch (nId)
1906 {
1907 case ID_BROWSER_CUT:
1908 pEditImplementation->Cut();
1909 break;
1910 case SID_COPY:
1911 pEditImplementation->Copy();
1912 break;
1913 case ID_BROWSER_PASTE:
1914 pEditImplementation->Paste();
1915 break;
1916 }
1918 pController->Modify();
1919 }
1920 }
1921 break;
1922
1924 bSortUp = false;
1925 [[fallthrough]];
1926 case ID_BROWSER_SORTUP:
1927 {
1928 if (!SaveModified())
1929 break;
1930
1931 if (!isValidCursor())
1932 break;
1933
1934 // only one sort order
1936 if (!xField.is())
1937 break;
1938
1940 const OUString sOldSort = xParser->getOrder();
1941 bool bParserSuccess = false;
1942 try
1943 {
1944 bParserSuccess = false;
1945 xParser->setOrder(OUString());
1946 xParser->appendOrderByColumn(xField, bSortUp);
1947 bParserSuccess = true;
1948 }
1949 catch(SQLException& e)
1950 {
1951 SQLException aError = ::dbtools::prependErrorInfo(e, *this, DBA_RES(SBA_BROWSER_SETTING_ORDER));
1952 css::sdb::SQLErrorEvent aEvent;
1953 aEvent.Reason <<= aError;
1955 }
1956 catch(Exception&)
1957 {
1958 DBG_UNHANDLED_EXCEPTION("dbaccess", "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !");
1959 }
1960
1961 if (bParserSuccess)
1962 applyParserOrder(sOldSort,xParser);
1963 }
1964 break;
1965
1967 {
1968 if (!SaveModified())
1969 break;
1970
1971 if (!isValidCursor())
1972 break;
1973
1975 if (!xField.is())
1976 break;
1977
1978 // check if the column is an aggregate function
1979 const bool bHaving(isAggregateColumn(m_xParser, xField));
1980
1982 const OUString sOldFilter = xParser->getFilter();
1983 const OUString sOldHaving = xParser->getHavingClause();
1984
1985 Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
1986 bool bApplied = ::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_APPLYFILTER));
1987 // do we have a filter but it's not applied ?
1988 // -> completely overwrite it, else append one
1989 if (!bApplied)
1990 {
1991 try
1992 {
1993 xParser->setFilter(OUString());
1994 }
1995 catch(Exception&)
1996 {
1997 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::Execute : caught an exception while resetting unapplied filter !");
1998 }
1999 try
2000 {
2001 xParser->setHavingClause(OUString());
2002 }
2003 catch(Exception&)
2004 {
2005 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::Execute : caught an exception while resetting unapplied HAVING clause !");
2006 }
2007 }
2008
2009 bool bParserSuccess = false;
2010
2011 const sal_Int32 nOp = SQLFilterOperator::EQUAL;
2012
2013 if ( bHaving )
2014 {
2015 try
2016 {
2017 bParserSuccess = false;
2018 xParser->appendHavingClauseByColumn(xField,true,nOp);
2019 bParserSuccess = true;
2020 }
2021 catch(SQLException& e)
2022 {
2023 SQLException aError = ::dbtools::prependErrorInfo(e, *this, DBA_RES(SBA_BROWSER_SETTING_FILTER));
2024 css::sdb::SQLErrorEvent aEvent;
2025 aEvent.Reason <<= aError;
2027 }
2028 catch(Exception&)
2029 {
2030 DBG_UNHANDLED_EXCEPTION("dbaccess", "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !");
2031 }
2032 }
2033 else
2034 {
2035 try
2036 {
2037 bParserSuccess = false;
2038 xParser->appendFilterByColumn(xField,true,nOp);
2039 bParserSuccess = true;
2040 }
2041 catch(SQLException& e)
2042 {
2043 SQLException aError = ::dbtools::prependErrorInfo(e, *this, DBA_RES(SBA_BROWSER_SETTING_FILTER));
2044 css::sdb::SQLErrorEvent aEvent;
2045 aEvent.Reason <<= aError;
2047 }
2048 catch(Exception&)
2049 {
2050 DBG_UNHANDLED_EXCEPTION("dbaccess", "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !");
2051 }
2052 }
2053
2054 if (bParserSuccess)
2055 applyParserFilter(sOldFilter, bApplied,sOldHaving,xParser);
2056
2057 InvalidateFeature(ID_BROWSER_REMOVEFILTER);
2058 InvalidateFeature(ID_BROWSER_FILTERED);
2059 }
2060 break;
2061
2063 ExecuteFilterSortCrit(false);
2064 break;
2065
2068 InvalidateFeature(ID_BROWSER_FILTERED);
2069 break;
2070
2072 {
2073 if (!SaveModified())
2074 break;
2075
2076 bool bNeedPostReload = preReloadForm();
2077 // reset the filter and the sort property simultaneously so only _one_ new statement has to be
2078 // sent
2079 Reference< XPropertySet > xSet(getRowSet(), UNO_QUERY);
2080 if ( xSet.is() )
2081 {
2082 xSet->setPropertyValue(PROPERTY_FILTER,Any(OUString()));
2083 xSet->setPropertyValue(PROPERTY_HAVING_CLAUSE,Any(OUString()));
2084 xSet->setPropertyValue(PROPERTY_ORDER,Any(OUString()));
2085 }
2086 try
2087 {
2089 if ( bNeedPostReload )
2091 }
2092 catch(Exception&)
2093 {
2094 }
2095 InvalidateFeature(ID_BROWSER_REMOVEFILTER);
2096 InvalidateFeature(ID_BROWSER_FILTERED);
2097 }
2098 break;
2099
2100 case ID_BROWSER_REFRESH:
2101 if ( SaveModified( ) )
2102 {
2103 if (!reloadForm(m_xLoadable))
2104 criticalFail();
2105 }
2106 break;
2107
2109 if ( SaveModified( false ) )
2110 setCurrentModified( false );
2111 break;
2112
2114 {
2115 try
2116 {
2117 // restore the cursor state
2118 Reference< XResultSetUpdate > xCursor(getRowSet(), UNO_QUERY);
2119 Reference< XPropertySet > xSet(xCursor, UNO_QUERY);
2120 Any aVal = xSet->getPropertyValue(PROPERTY_ISNEW);
2121 if (aVal.hasValue() && ::comphelper::getBOOL(aVal))
2122 {
2123 xCursor->moveToInsertRow();
2124 // no need to reset the grid model after we moved to the insert row, this is done implicitly by the
2125 // form
2126 // (and in some cases it may be deadly to do the reset explicitly after the form did it implicitly,
2127 // cause the form's reset may be async, and this leads to some nice deadlock scenarios...)
2128 }
2129 else
2130 {
2131 xCursor->cancelRowUpdates();
2132
2133 // restore the grids state
2135 if (xReset.is())
2136 xReset->reset();
2137 }
2138 }
2139 catch(SQLException&)
2140 {
2141 }
2142
2143 setCurrentModified( false );
2144 }
2145 }
2146}
2147
2149{
2150 if ( bAskFor && GetState(ID_BROWSER_SAVERECORD).bEnabled )
2151 {
2152 getBrowserView()->getVclControl()->GrabFocus();
2153
2154 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(getFrameWeld(), "dbaccess/ui/savemodifieddialog.ui"));
2155 std::unique_ptr<weld::MessageDialog> xQry(xBuilder->weld_message_dialog("SaveModifiedDialog"));
2156 switch (xQry->run())
2157 {
2158 case RET_NO:
2160 return true;
2161 case RET_CANCEL:
2162 return false;
2163 }
2164 }
2165
2166 if ( !CommitCurrent() ) // Commit the current control
2167 return false;
2168
2169 Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
2170 bool bResult = false;
2171 try
2172 {
2173 if (::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ISMODIFIED)))
2174 {
2175 Reference< XResultSetUpdate > xCursor(getRowSet(), UNO_QUERY);
2176 if (::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ISNEW)))
2177 xCursor->insertRow();
2178 else
2179 xCursor->updateRow();
2180 }
2181 bResult = true;
2182 }
2183 catch(SQLException&)
2184 {
2185 }
2186 catch(Exception&)
2187 {
2188 SAL_WARN("dbaccess.ui", "SbaXDataBrowserController::SaveModified : could not save the current record !");
2189 bResult = false;
2190 }
2191
2192 InvalidateFeature(ID_BROWSER_SAVERECORD);
2193 InvalidateFeature(ID_BROWSER_UNDORECORD);
2194 return bResult;
2195}
2196
2198{
2199 if (!getBrowserView())
2200 return true;
2201
2202 Reference< css::awt::XControl > xActiveControl(getBrowserView()->getGridControl());
2203 Reference< css::form::XBoundControl > xLockingTest(xActiveControl, UNO_QUERY);
2204 bool bControlIsLocked = xLockingTest.is() && xLockingTest->getLock();
2205 if (xActiveControl.is() && !bControlIsLocked)
2206 {
2207 // At first check Control if it supports the IFace
2208 Reference< css::form::XBoundComponent > xBoundControl(xActiveControl, UNO_QUERY);
2209 if (!xBoundControl.is())
2210 xBoundControl.set(xActiveControl->getModel(), UNO_QUERY);
2211 if (xBoundControl.is() && !xBoundControl->commit())
2212 return false;
2213 }
2214 return true;
2215}
2216
2218{
2219 m_bCurrentlyModified = _bSet;
2220 InvalidateFeature( ID_BROWSER_SAVERECORD );
2221 InvalidateFeature( ID_BROWSER_UNDORECORD );
2222}
2223
2225{
2226 setCurrentModified( false );
2227}
2228
2230{
2231 InvalidateFeature(ID_BROWSER_SORTUP);
2232 InvalidateFeature(ID_BROWSER_SORTDOWN);
2233 InvalidateFeature(ID_BROWSER_ORDERCRIT);
2234 InvalidateFeature(ID_BROWSER_FILTERCRIT);
2235 InvalidateFeature(ID_BROWSER_AUTOFILTER);
2236 InvalidateFeature(ID_BROWSER_REMOVEFILTER);
2237
2238 setCurrentModified( false );
2239}
2240
2242{
2243 // not interested in
2244}
2245
2247{
2249 OnInvalidateClipboard( nullptr );
2250}
2251
2253{
2255 OnInvalidateClipboard( nullptr );
2256}
2257
2259{
2260 SolarMutexGuard aGuard;
2261 OnInvalidateClipboard( nullptr );
2262}
2263
2264IMPL_LINK(SbaXDataBrowserController, OnInvalidateClipboard, Timer*, _pTimer, void)
2265{
2266 InvalidateFeature(ID_BROWSER_CUT);
2267 InvalidateFeature(ID_BROWSER_COPY);
2268
2269 // if the invalidation was triggered by the timer, we do not need to invalidate PASTE.
2270 // The timer is only for checking the CUT/COPY slots regularly, which depend on the
2271 // selection state of the active cell
2272 // TODO: get a callback at the Edit which allows to be notified when the selection
2273 // changes. This would be much better than this cycle-eating polling mechanism here...
2274 if ( _pTimer != &m_aInvalidateClipboard )
2275 InvalidateFeature(ID_BROWSER_PASTE);
2276}
2277
2279{
2280 Reference< XPropertySet > xEmptyReturn;
2281
2282 // get the current column from the grid
2283 Reference< css::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY);
2284 if (!xGrid.is())
2285 return xEmptyReturn;
2286 sal_uInt16 nViewPos = xGrid->getCurrentColumnPosition();
2287 sal_uInt16 nCurrentCol = getBrowserView()->View2ModelPos(nViewPos);
2288 if (nCurrentCol == sal_uInt16(-1))
2289 return xEmptyReturn;
2290
2291 // get the according column from the model
2293 Reference< XPropertySet > xCurrentCol(xCols->getByIndex(nCurrentCol),UNO_QUERY);
2294 if (!xCurrentCol.is())
2295 return xEmptyReturn;
2296
2297 xEmptyReturn.set(xCurrentCol->getPropertyValue(PROPERTY_BOUNDFIELD) ,UNO_QUERY);
2298 return xEmptyReturn;
2299}
2300
2301IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext&, rContext, sal_uInt32)
2302{
2303 Reference< css::container::XIndexAccess > xPeerContainer(getBrowserView()->getGridControl(), UNO_QUERY);
2304
2305 // check all grid columns for their control source
2306 Reference< css::container::XIndexAccess > xModelColumns(getFormComponent(), UNO_QUERY);
2307 OSL_ENSURE(xModelColumns.is(), "SbaXDataBrowserController::OnSearchContextRequest : there is a grid control without columns !");
2308 // the case 'no columns' should be indicated with an empty container, I think ...
2309 OSL_ENSURE(xModelColumns->getCount() >= xPeerContainer->getCount(), "SbaXDataBrowserController::OnSearchContextRequest : impossible : have more view than model columns !");
2310
2311 OUString sFieldList;
2312 for (sal_Int32 nViewPos=0; nViewPos<xPeerContainer->getCount(); ++nViewPos)
2313 {
2314 Reference< XInterface > xCurrentColumn(xPeerContainer->getByIndex(nViewPos),UNO_QUERY);
2315 if (!xCurrentColumn.is())
2316 continue;
2317
2318 // can we use this column control for searching ?
2319 if (!IsSearchableControl(xCurrentColumn))
2320 continue;
2321
2322 sal_uInt16 nModelPos = getBrowserView()->View2ModelPos(static_cast<sal_uInt16>(nViewPos));
2323 Reference< XPropertySet > xCurrentColModel(xModelColumns->getByIndex(nModelPos),UNO_QUERY);
2324 OUString aName = ::comphelper::getString(xCurrentColModel->getPropertyValue(PROPERTY_CONTROLSOURCE));
2325
2326 sFieldList += aName + ";";
2327
2328 rContext.arrFields.push_back(xCurrentColumn);
2329 }
2330 sFieldList = comphelper::string::stripEnd(sFieldList, ';');
2331
2332 rContext.xCursor = getRowSet();
2333 rContext.strUsedFields = sFieldList;
2334
2335 // if the cursor is in a mode other than STANDARD -> reset
2336 Reference< XPropertySet > xCursorSet(rContext.xCursor, UNO_QUERY);
2337 OSL_ENSURE(xCursorSet.is() && !::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISMODIFIED)),
2338 "SbaXDataBrowserController::OnSearchContextRequest : please do not call for cursors with modified rows !");
2339 if (xCursorSet.is() && ::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISNEW)))
2340 {
2341 Reference< XResultSetUpdate > xUpdateCursor(rContext.xCursor, UNO_QUERY);
2342 xUpdateCursor->moveToCurrentRow();
2343 }
2344 return rContext.arrFields.size();
2345}
2346
2348{
2349 Reference< css::sdbcx::XRowLocate > xCursor(getRowSet(), UNO_QUERY);
2350 OSL_ENSURE(xCursor.is(), "SbaXDataBrowserController::OnFoundData : xCursor is empty");
2351
2352 // move the cursor
2353 xCursor->moveToBookmark(rInfo.aPosition);
2354
2355 // let the grid sync its display with the cursor
2356 Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY);
2357 OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::OnFoundData : no model set ?!");
2358 Any aOld = xModelSet->getPropertyValue("DisplayIsSynchron");
2359 xModelSet->setPropertyValue("DisplayIsSynchron", css::uno::Any(true));
2360 xModelSet->setPropertyValue("DisplayIsSynchron", aOld);
2361
2362 // and move to the field
2363 Reference< css::container::XIndexAccess > aColumnControls(getBrowserView()->getGridControl()->getPeer(), UNO_QUERY);
2364 sal_Int32 nViewPos;
2365
2366 for ( nViewPos = 0; nViewPos < aColumnControls->getCount(); ++nViewPos )
2367 {
2368 Reference< XInterface > xCurrent(aColumnControls->getByIndex(nViewPos),UNO_QUERY);
2369 if (IsSearchableControl(xCurrent))
2370 {
2371 if (rInfo.nFieldPos)
2372 --rInfo.nFieldPos;
2373 else
2374 break;
2375 }
2376 }
2377
2378 Reference< css::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY);
2379 xGrid->setCurrentColumnPosition(nViewPos); //TODO: sal_Int32 -> sal_Int16!
2380}
2381
2383{
2384 Reference< css::sdbcx::XRowLocate > xCursor(getRowSet(), UNO_QUERY);
2385
2386 try
2387 {
2388 OSL_ENSURE(xCursor.is(), "SbaXDataBrowserController::OnCanceledNotFound : xCursor is empty");
2389 // move the cursor
2390 xCursor->moveToBookmark(rInfo.aPosition);
2391 }
2392 catch( const Exception& )
2393 {
2394 DBG_UNHANDLED_EXCEPTION("dbaccess");
2395 }
2396
2397 try
2398 {
2399 // let the grid sync its display with the cursor
2400 Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY);
2401 OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::OnCanceledNotFound : no model set ?!");
2402 Any aOld = xModelSet->getPropertyValue("DisplayIsSynchron");
2403 xModelSet->setPropertyValue("DisplayIsSynchron", css::uno::Any(true));
2404 xModelSet->setPropertyValue("DisplayIsSynchron", aOld);
2405 }
2406 catch( const Exception& )
2407 {
2408 DBG_UNHANDLED_EXCEPTION("dbaccess");
2409 }
2410}
2411
2412IMPL_LINK_NOARG(SbaXDataBrowserController, OnAsyncGetCellFocus, void*, void)
2413{
2414 SbaGridControl* pVclGrid = getBrowserView() ? getBrowserView()->getVclControl() : nullptr;
2415 // if we have a controller, but the window for the controller doesn't have the focus, we correct this
2416 if (pVclGrid && pVclGrid->IsEditing() && pVclGrid->HasChildPathFocus())
2417 pVclGrid->Controller()->GetWindow().GrabFocus();
2418}
2419
2421{
2422 InvalidateAll();
2424}
2425
2427{
2429
2430 if (!isValid() || loadingCancelled())
2431 return;
2432
2433 // obtain cached values
2434 try
2435 {
2436 Reference< XPropertySet > xFormProps( m_xLoadable, UNO_QUERY_THROW );
2437 OSL_VERIFY( xFormProps->getPropertyValue( PROPERTY_PRIVILEGES ) >>= m_nRowSetPrivileges );
2438 }
2439 catch( const Exception& )
2440 {
2441 DBG_UNHANDLED_EXCEPTION("dbaccess");
2442 }
2443
2444 // switch the control to alive mode
2445 getBrowserView()->getGridControl()->setDesignMode(false);
2446
2448
2449 InvalidateAll();
2450
2452}
2453
2455{
2456 if ( m_xParser.is() )
2457 return;
2458
2459 // create a parser (needed for filtering/sorting)
2460 try
2461 {
2462 const Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY);
2463 if (::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)))
2464 { // (only if the statement isn't native)
2465 // (it is allowed to use the PROPERTY_ISPASSTHROUGH : _after_ loading a form it is valid)
2466 xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser;
2467 }
2468 }
2469 catch(Exception&)
2470 {
2471 DBG_UNHANDLED_EXCEPTION("dbaccess");
2472 m_xParser = nullptr;
2473 // no further handling, we ignore the error
2474 }
2475}
2476
2477void SbaXDataBrowserController::loaded(const EventObject& /*aEvent*/)
2478{
2479 // not interested in
2480 // we're loading within a separated thread and have a handling for its "finished event"
2481}
2482
2483void SbaXDataBrowserController::unloading(const EventObject& /*aEvent*/)
2484{
2485 // not interested in
2486}
2487
2488void SbaXDataBrowserController::unloaded(const EventObject& /*aEvent*/)
2489{
2490 m_xParser.clear();
2491 InvalidateAll();
2492 // do this asynchronously, there are other listeners reacting on this message ...
2493 // (it's a little hack : the grid columns are listening to this event, too, and their bound field may
2494 // change as a reaction on that event. as we have no chance to be notified of this change (which is
2495 // the one we're interested in) we give them time to do what they want to before invalidating our
2496 // bound-field-dependent slots...
2497}
2498
2499void SbaXDataBrowserController::reloading(const EventObject& /*aEvent*/)
2500{
2501 // not interested in
2502}
2503
2504void SbaXDataBrowserController::reloaded(const EventObject& /*aEvent*/)
2505{
2506 InvalidateAll();
2507 // do this asynchronously, there are other listeners reacting on this message ...
2508 // (it's a little hack : the grid columns are listening to this event, too, and their bound field may
2509 // change as a reaction on that event. as we have no chance to be notified of this change (which is
2510 // the one we're interested in) we give them time to do what they want to before invalidating our
2511 // bound-field-dependent slots...
2512}
2513
2515{
2517 // first action -> reset
2519
2521}
2522
2524{
2525 OSL_ENSURE( m_nFormActionNestingLevel > 0, "SbaXDataBrowserController::leaveFormAction : invalid call !" );
2526 if ( --m_nFormActionNestingLevel > 0 )
2527 return;
2528
2529 if ( !m_aCurrentError.isValid() )
2530 return;
2531
2533}
2534
2536{
2537 return m_xLoadable.is() && m_xLoadable->isLoaded();
2538}
2539
2541{
2542 if (!m_xColumnsSupplier.is())
2543 return false;
2545 if (!xCols.is() || !xCols->hasElements())
2546 return false;
2547
2548 bool bIsValid = !(m_xRowSet->isBeforeFirst() || m_xRowSet->isAfterLast());
2549 if ( !bIsValid )
2550 {
2551 Reference<XPropertySet> xProp(m_xRowSet,UNO_QUERY);
2552 bIsValid = ::cppu::any2bool(xProp->getPropertyValue(PROPERTY_ISNEW));
2553 if ( !bIsValid )
2554 {
2555 bIsValid = m_xParser.is();
2556 }
2557 }
2558 return bIsValid;
2559}
2560
2562{
2563 Reference< css::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY);
2564 sal_Int16 nViewPos = -1;
2565 try
2566 {
2567 if ( xGrid.is() )
2568 nViewPos = xGrid->getCurrentColumnPosition();
2569 }
2570 catch(Exception&) {}
2571 return nViewPos;
2572}
2573
2575{
2576 Reference< css::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY);
2577 try
2578 {
2579 if ( -1 != _nPos )
2580 xGrid->setCurrentColumnPosition(_nPos);
2581 }
2582 catch(Exception&) {}
2583}
2584
2586{
2588 if (xFormError.is())
2589 xFormError->removeSQLErrorListener(static_cast<css::sdb::XSQLErrorListener*>(this));
2590}
2591
2593{
2595 if (xFormError.is())
2596 xFormError->addSQLErrorListener(static_cast<css::sdb::XSQLErrorListener*>(this));
2597}
2598
2600{
2601// ... all the grid columns
2602 Reference< css::container::XIndexContainer > xColumns(_xGridControlModel, UNO_QUERY);
2603 if (xColumns.is())
2604 {
2605 sal_Int32 nCount = xColumns->getCount();
2606 for (sal_Int32 i=0; i < nCount; ++i)
2607 {
2608 Reference< XPropertySet > xCol(xColumns->getByIndex(i),UNO_QUERY);
2609 AddColumnListener(xCol);
2610 }
2611 }
2612}
2613
2614} // namespace dbaui
2615
2616/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
OptionalString sName
AnyEventRef aEvent
#define ID_BROWSER_EDITDOC
Definition: browserids.hxx:26
#define ID_BROWSER_FILTERCRIT
Definition: browserids.hxx:44
#define ID_BROWSER_FILTERED
Definition: browserids.hxx:47
#define ID_BROWSER_REMOVEFILTER
Definition: browserids.hxx:46
#define ID_BROWSER_SORTDOWN
Definition: browserids.hxx:42
#define ID_BROWSER_REFRESH
Definition: browserids.hxx:48
#define ID_BROWSER_SEARCH
Definition: browserids.hxx:40
#define ID_BROWSER_UNDORECORD
Definition: browserids.hxx:27
#define ID_BROWSER_SORTUP
Definition: browserids.hxx:41
#define ID_BROWSER_PASTE
Definition: browserids.hxx:29
#define ID_BROWSER_CUT
Definition: browserids.hxx:25
#define ID_BROWSER_SAVERECORD
Definition: browserids.hxx:28
#define ID_BROWSER_INSERT_ROW
Definition: browserids.hxx:95
#define ID_BROWSER_AUTOFILTER
Definition: browserids.hxx:43
#define ID_BROWSER_COPY
Definition: browserids.hxx:24
#define ID_BROWSER_REDO
Definition: browserids.hxx:31
#define ID_BROWSER_ORDERCRIT
Definition: browserids.hxx:45
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
DbGridControlOptions GetOptions() const
DbGridControlOptions SetOptions(DbGridControlOptions nOpt)
tools::Long Len() const
static SvxAbstractDialogFactory * Create()
virtual VclPtr< AbstractFmSearchDialog > CreateFmSearchDialog(weld::Window *pParent, const OUString &strInitialText, const ::std::vector< OUString > &_rContexts, sal_Int16 nInitialContext, const Link< FmSearchContext &, sal_uInt32 > &lnkContextSupplier)=0
bool IsActive() const
void Stop()
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
const DataFlavorExVector & GetDataFlavorExVector() const
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
void disposeAndClear()
static ErrorCode getErrorCode(const ErrorCondition _eCondition)
void SetMasterListener(SbaGridListener *pListener)
Definition: sbagrid.hxx:215
void CopySelectedRowsToClipboard()
copies the currently selected rows to the clipboard @precond at least one row is selected
Definition: sbagrid.cxx:1043
virtual void DeactivateCell(bool bUpdate=true) override
Definition: sbagrid.cxx:821
virtual void DeleteSelectedRows() override
virtual void SAL_CALL removeParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener > &aListener) override
Definition: brwctrlr.cxx:386
virtual void SAL_CALL setInteractionHandler(const css::uno::Reference< css::task::XInteractionHandler > &_interactionHandler) override
Definition: brwctrlr.cxx:272
virtual css::uno::Reference< css::awt::XTabControllerModel > SAL_CALL getModel() override
Definition: brwctrlr.cxx:418
::comphelper::OInterfaceContainerHelper3< css::form::XFormControllerListener > m_aActivateListeners
Definition: brwctrlr.cxx:128
virtual css::uno::Type SAL_CALL getElementType() override
Definition: brwctrlr.cxx:315
virtual void SAL_CALL removeRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener > &listener) override
Definition: brwctrlr.cxx:366
virtual void SAL_CALL addSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener > &Listener) override
Definition: brwctrlr.cxx:351
virtual void SAL_CALL activateTabOrder() override
Definition: brwctrlr.cxx:450
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
Definition: brwctrlr.cxx:471
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: brwctrlr.cxx:326
virtual ::sal_Int32 SAL_CALL getCount() override
Definition: brwctrlr.cxx:303
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
Definition: brwctrlr.cxx:331
virtual css::uno::Reference< css::awt::XControl > SAL_CALL getCurrentControl() override
Definition: brwctrlr.cxx:234
virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls() override
Definition: brwctrlr.cxx:435
virtual void SAL_CALL removeSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener > &Listener) override
Definition: brwctrlr.cxx:356
virtual sal_Bool SAL_CALL supportsMode(const OUString &aMode) override
Definition: brwctrlr.cxx:408
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
Definition: brwctrlr.cxx:336
virtual sal_Bool SAL_CALL hasElements() override
Definition: brwctrlr.cxx:320
virtual OUString SAL_CALL getMode() override
Definition: brwctrlr.cxx:397
virtual css::uno::Reference< css::form::runtime::XFormOperations > SAL_CALL getFormOperations() override
Definition: brwctrlr.cxx:229
virtual css::uno::Any SAL_CALL getByIndex(::sal_Int32 Index) override
Definition: brwctrlr.cxx:309
virtual void SAL_CALL autoTabOrder() override
Definition: brwctrlr.cxx:445
virtual css::uno::Reference< css::task::XInteractionHandler > SAL_CALL getInteractionHandler() override
Definition: brwctrlr.cxx:266
virtual void SAL_CALL setMode(const OUString &aMode) override
Definition: brwctrlr.cxx:391
virtual void SAL_CALL removeActivateListener(const css::uno::Reference< css::form::XFormControllerListener > &l) override
Definition: brwctrlr.cxx:244
virtual void SAL_CALL activateLast() override
Definition: brwctrlr.cxx:461
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: brwctrlr.cxx:298
virtual css::uno::Reference< css::awt::XControlContainer > SAL_CALL getContainer() override
Definition: brwctrlr.cxx:428
virtual void SAL_CALL addConfirmDeleteListener(const css::uno::Reference< css::form::XConfirmDeleteListener > &aListener) override
Definition: brwctrlr.cxx:341
virtual void SAL_CALL setModel(const css::uno::Reference< css::awt::XTabControllerModel > &Model) override
Definition: brwctrlr.cxx:413
virtual void SAL_CALL addChildController(const css::uno::Reference< css::form::runtime::XFormController > &ChildController) override
Definition: brwctrlr.cxx:249
virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent &aEvent) override
Definition: brwctrlr.cxx:467
virtual void SAL_CALL addRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener > &listener) override
Definition: brwctrlr.cxx:361
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: brwctrlr.cxx:283
virtual void SAL_CALL setContainer(const css::uno::Reference< css::awt::XControlContainer > &Container) override
Definition: brwctrlr.cxx:423
virtual void SAL_CALL setContext(const css::uno::Reference< css::form::runtime::XFormControllerContext > &_context) override
Definition: brwctrlr.cxx:261
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: brwctrlr.cxx:293
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: brwctrlr.cxx:277
virtual void SAL_CALL addDatabaseParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener > &aListener) override
Definition: brwctrlr.cxx:371
virtual void SAL_CALL removeConfirmDeleteListener(const css::uno::Reference< css::form::XConfirmDeleteListener > &aListener) override
Definition: brwctrlr.cxx:346
virtual void SAL_CALL addParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener > &aListener) override
Definition: brwctrlr.cxx:381
virtual css::uno::Reference< css::form::runtime::XFormControllerContext > SAL_CALL getContext() override
Definition: brwctrlr.cxx:255
virtual void SAL_CALL activateFirst() override
Definition: brwctrlr.cxx:455
virtual void SAL_CALL addActivateListener(const css::uno::Reference< css::form::XFormControllerListener > &l) override
Definition: brwctrlr.cxx:239
virtual void SAL_CALL dispose() override
Definition: brwctrlr.cxx:288
virtual void SAL_CALL removeDatabaseParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener > &aListener) override
Definition: brwctrlr.cxx:376
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedModes() override
Definition: brwctrlr.cxx:402
virtual sal_Bool SAL_CALL confirmDelete(const css::sdb::RowChangeEvent &aEvent) override
Definition: brwctrlr.cxx:1336
void onStartLoading(const css::uno::Reference< css::form::XLoadable > &_rxLoadable)
Definition: brwctrlr.cxx:565
OAsynchronousLink m_aAsyncGetCellFocus
Definition: brwctrlr.hxx:93
css::uno::Reference< css::form::XFormComponent > CreateGridModel()
Definition: brwctrlr.cxx:823
virtual void describeSupportedFeatures() override
Definition: brwctrlr.cxx:668
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: brwctrlr.cxx:486
virtual void SAL_CALL errorOccured(const css::sdb::SQLErrorEvent &aEvent) override
Definition: brwctrlr.cxx:1231
virtual void RowChanged() override
Definition: brwctrlr.cxx:2224
void removeControlListeners(const css::uno::Reference< css::awt::XControl > &_xGridControl)
Definition: brwctrlr.cxx:886
void disposingColumnModel(const css::lang::EventObject &Source)
Definition: brwctrlr.cxx:966
virtual void RemoveColumnListener(const css::uno::Reference< css::beans::XPropertySet > &xCol)
Definition: brwctrlr.cxx:812
virtual void stopFrameListening(const css::uno::Reference< css::frame::XFrame > &_rxFrame) override
Definition: brwctrlr.cxx:553
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: brwctrlr.cxx:478
virtual void LoadFinished(bool bWasSynch)
Definition: brwctrlr.cxx:2426
virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent &aEvent) override
Definition: brwctrlr.cxx:1184
virtual void SAL_CALL focusGained(const css::awt::FocusEvent &e) override
Definition: brwctrlr.cxx:901
virtual void SAL_CALL resetted(const css::lang::EventObject &rEvent) override
Definition: brwctrlr.cxx:1330
void impl_checkForCannotSelectUnfiltered(const ::dbtools::SQLExceptionInfo &_rError)
Definition: brwctrlr.cxx:584
rtl::Reference< FormControllerImpl > m_xFormControllerImpl
Definition: brwctrlr.hxx:102
virtual sal_Bool SAL_CALL approveParameter(const css::form::DatabaseParameterEvent &aEvent) override
Definition: brwctrlr.cxx:1251
virtual sal_Bool SAL_CALL approveReset(const css::lang::EventObject &rEvent) override
Definition: brwctrlr.cxx:1325
virtual void SAL_CALL disposing() override
Definition: brwctrlr.cxx:1118
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
Definition: brwctrlr.cxx:491
::dbtools::SQLExceptionInfo m_aCurrentError
Definition: brwctrlr.hxx:95
virtual void SAL_CALL reloading(const css::lang::EventObject &aEvent) override
Definition: brwctrlr.cxx:2499
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override
Definition: brwctrlr.cxx:1108
void ExecuteFilterSortCrit(bool bFilter)
Definition: brwctrlr.cxx:1702
bool SaveModified(bool bAskFor=true)
Definition: brwctrlr.cxx:2148
virtual void CellActivated() override
Definition: brwctrlr.cxx:2246
virtual FeatureState GetState(sal_uInt16 nId) const override
Definition: brwctrlr.cxx:1346
virtual void AddColumnListener(const css::uno::Reference< css::beans::XPropertySet > &xCol)
Definition: brwctrlr.cxx:807
virtual void SAL_CALL loaded(const css::lang::EventObject &aEvent) override
Definition: brwctrlr.cxx:2477
UnoDataBrowserView * getBrowserView() const
Definition: brwctrlr.hxx:138
TransferableDataHelper m_aSystemClipboard
Definition: brwctrlr.hxx:89
virtual ~SbaXDataBrowserController() override
Definition: brwctrlr.cxx:529
void setCurrentModified(bool _bSet)
Definition: brwctrlr.cxx:2217
virtual void SAL_CALL unloaded(const css::lang::EventObject &aEvent) override
Definition: brwctrlr.cxx:2488
css::uno::Reference< css::beans::XPropertySet > getBoundField() const
Definition: brwctrlr.cxx:2278
css::uno::Reference< css::form::XFormComponent > m_xGridModel
Definition: brwctrlr.hxx:80
virtual bool InitializeForm(const css::uno::Reference< css::beans::XPropertySet > &i_formProperties)=0
const css::uno::Reference< css::sdbc::XRowSet > & getRowSet() const
Definition: brwctrlr.hxx:121
virtual void BeforeDrop() override
Definition: brwctrlr.cxx:2585
void applyParserFilter(const OUString &_rOldFilter, bool _bOldFilterApplied, const ::OUString &_sOldHaving, const css::uno::Reference< css::sdb::XSingleSelectQueryComposer > &_xParser)
Definition: brwctrlr.cxx:1611
void disposingFormModel(const css::lang::EventObject &Source)
Definition: brwctrlr.cxx:939
OAsynchronousLink m_aAsyncDisplayError
Definition: brwctrlr.hxx:94
virtual void SAL_CALL reloaded(const css::lang::EventObject &aEvent) override
Definition: brwctrlr.cxx:2504
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
Definition: brwctrlr.hxx:81
virtual void SelectionChanged() override
Definition: brwctrlr.cxx:2241
SbaXDataBrowserController(const css::uno::Reference< css::uno::XComponentContext > &_rM)
Definition: brwctrlr.cxx:504
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
Definition: brwctrlr.cxx:1022
virtual void CellDeactivated() override
Definition: brwctrlr.cxx:2252
css::uno::Reference< css::form::XLoadable > m_xLoadable
Definition: brwctrlr.hxx:79
css::uno::Reference< css::sdbcx::XColumnsSupplier > m_xColumnsSupplier
Definition: brwctrlr.hxx:78
virtual void startFrameListening(const css::uno::Reference< css::frame::XFrame > &_rxFrame) override
Definition: brwctrlr.cxx:541
css::uno::Reference< css::sdbc::XRowSet > m_xRowSet
Definition: brwctrlr.hxx:77
virtual bool Construct(vcl::Window *pParent) override
Definition: brwctrlr.cxx:691
virtual void addModelListeners(const css::uno::Reference< css::awt::XControlModel > &_xGridControlModel)
Definition: brwctrlr.cxx:830
virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent &Event) override
Definition: brwctrlr.cxx:1095
virtual void removeModelListeners(const css::uno::Reference< css::awt::XControlModel > &_xGridControlModel)
Definition: brwctrlr.cxx:845
virtual void AfterDrop() override
Definition: brwctrlr.cxx:2592
virtual OUString SAL_CALL getIdentifier() override
Definition: brwctrlr.cxx:1016
virtual void ColumnChanged() override
Definition: brwctrlr.cxx:2229
void addColumnListeners(const css::uno::Reference< css::awt::XControlModel > &_xGridControlModel)
Definition: brwctrlr.cxx:2599
virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
Definition: brwctrlr.cxx:1811
css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xParser
Definition: brwctrlr.hxx:83
virtual void SAL_CALL unloading(const css::lang::EventObject &aEvent) override
Definition: brwctrlr.cxx:2483
sal_Int16 getCurrentColumnPosition() const
Definition: brwctrlr.cxx:2561
virtual void SAL_CALL setIdentifier(const OUString &Identifier) override
Definition: brwctrlr.cxx:1010
virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent &Event) override
Definition: brwctrlr.cxx:1086
css::uno::Reference< css::sdb::XSingleSelectQueryComposer > createParser_nothrow()
Definition: brwctrlr.cxx:1658
void addControlListeners(const css::uno::Reference< css::awt::XControl > &_xGridControl)
Definition: brwctrlr.cxx:868
css::uno::Reference< css::awt::XControlModel > getControlModel() const
Definition: brwctrlr.hxx:125
void setCurrentColumnPosition(sal_Int16 _nPos)
Definition: brwctrlr.cxx:2574
rtl::Reference< TransferableClipboardListener > m_pClipboardNotifier
Definition: brwctrlr.hxx:91
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
Definition: brwctrlr.cxx:1072
virtual css::uno::Reference< css::sdbc::XRowSet > CreateForm()
Definition: brwctrlr.cxx:816
void applyParserOrder(const OUString &_rOldOrder, const css::uno::Reference< css::sdb::XSingleSelectQueryComposer > &_xParser)
Definition: brwctrlr.cxx:1571
virtual void SAL_CALL elementInserted(const css::container::ContainerEvent &Event) override
Definition: brwctrlr.cxx:1077
bool reloadForm(const css::uno::Reference< css::form::XLoadable > &_rxLoadable)
loads or reloads the form
Definition: brwctrlr.cxx:594
virtual void SAL_CALL focusLost(const css::awt::FocusEvent &e) override
Definition: brwctrlr.cxx:908
void Construct(const css::uno::Reference< css::awt::XControlModel > &xModel)
late construction
Definition: brwview.cxx:77
SbaGridControl * getVclControl() const
Definition: brwview.cxx:244
const css::uno::Reference< css::awt::XControl > & getGridControl() const
Definition: brwview.hxx:51
sal_uInt16 View2ModelPos(sal_uInt16 nPos) const
as columns may be hidden there is a difference between a columns model pos and its view pos so we you...
Definition: brwview.cxx:239
virtual void SAL_CALL setParameters(const css::uno::Sequence< css::beans::PropertyValue > &_rValues) override
Definition: brwctrlr.cxx:115
const css::uno::Sequence< css::beans::PropertyValue > & getValues() const
css::uno::Sequence< css::beans::PropertyValue > m_aValues
virtual void Cut()=0
virtual bool IsReadOnly() const=0
virtual void Paste()=0
virtual Selection GetSelection() const=0
virtual void Copy()=0
T * get() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual short run()
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
#define DBA_RES(id)
int nCount
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
ULONG m_refCount
SOT_DLLPUBLIC bool IsFormatSupported(const DataFlavorExVector &rDataFlavorExVector, SotClipboardFormatId nId)
Reference< XSingleServiceFactory > xFactory
SVXCORE_DLLPUBLIC bool IsSearchableControl(const css::uno::Reference< css::uno::XInterface > &_xControl, OUString *pCurrentText=nullptr)
DbGridControlOptions
OUString aName
sal_uInt16 nPos
#define SAL_WARN(area, stream)
@ Exception
OString stripEnd(const OString &rIn, char c)
Type
::sal_Int32 ErrorCode
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
IMPL_LINK(OApplicationController, OnSelectContainer, void *, _pType, void)
::cppu::ImplInheritanceHelper< OGenericUnoController, css::sdb::XSQLErrorListener, css::form::XDatabaseParameterListener, css::form::XConfirmDeleteListener, css::form::XLoadListener, css::form::XResetListener, css::awt::XFocusListener, css::container::XContainerListener, css::beans::XPropertyChangeListener, css::frame::XModule > SbaXDataBrowserController_Base
Definition: brwctrlr.hxx:66
Reference< XConnection > getConnection(const Reference< XRowSet > &_rxRowSet)
bool isAggregateColumn(const Reference< XSingleSelectQueryComposer > &_xParser, const Reference< XPropertySet > &_xField)
void showError(const SQLExceptionInfo &_rInfo, const Reference< XWindow > &_xParent, const Reference< XComponentContext > &_rxContext)
::osl::Mutex & getMutex()
int i
JFW_MODE getMode()
SwView * getView(const uno::Reference< frame::XModel > &xModel)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
void dispose()
sal_Int16 nId
ContentProvider * m_pOwner
constexpr OUStringLiteral PROPERTY_WIDTH(u"Width")
constexpr OUStringLiteral PROPERTY_COMMAND(u"Command")
constexpr OUStringLiteral PROPERTY_HAVING_CLAUSE(u"HavingClause")
constexpr OUStringLiteral PROPERTY_CONTROLSOURCE(u"DataField")
constexpr OUStringLiteral PROPERTY_SINGLESELECTQUERYCOMPOSER(u"SingleSelectQueryComposer")
constexpr OUStringLiteral PROPERTY_ISMODIFIED(u"IsModified")
constexpr OUStringLiteral PROPERTY_APPLYFILTER(u"ApplyFilter")
constexpr OUStringLiteral SERVICE_NAME_SINGLESELECTQUERYCOMPOSER
Definition: strings.hxx:201
constexpr OUStringLiteral PROPERTY_ISSEARCHABLE(u"IsSearchable")
constexpr OUStringLiteral PROPERTY_BORDER(u"Border")
constexpr OUStringLiteral PROPERTY_FILTER(u"Filter")
constexpr OUStringLiteral PROPERTY_ACTIVE_CONNECTION(u"ActiveConnection")
constexpr OUStringLiteral PROPERTY_TABLENAME(u"TableName")
constexpr OUStringLiteral PROPERTY_ESCAPE_PROCESSING(u"EscapeProcessing")
constexpr OUStringLiteral PROPERTY_NAME(u"Name")
constexpr OUStringLiteral PROPERTY_BOUNDFIELD(u"BoundField")
constexpr OUStringLiteral PROPERTY_ACTIVECOMMAND(u"ActiveCommand")
constexpr OUStringLiteral PROPERTY_PRIVILEGES(u"Privileges")
constexpr OUStringLiteral PROPERTY_COMMAND_TYPE(u"CommandType")
constexpr OUStringLiteral PROPERTY_ORDER(u"Order")
constexpr OUStringLiteral PROPERTY_ROWCOUNT(u"RowCount")
constexpr OUStringLiteral PROPERTY_ISNEW(u"IsNew")
constexpr OUStringLiteral PROPERTY_VALUE(u"Value")
describes the state of a feature
std::optional< bool > bChecked
std::optional< OUString > sTitle
unsigned char sal_Bool
RET_CANCEL
RET_NO
RET_YES
sal_Int32 _nPos