summaryrefslogtreecommitdiffstats
path: root/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
blob: 63e30d06ad3b80d95e4c911688227e78b8b30b33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include <browserids.hxx>
#include <commontypes.hxx>
#include <core_resource.hxx>
#include <dbaccess/dataview.hxx>
#include <strings.hrc>
#include <strings.hxx>
#include <dbaccess/dbsubcomponentcontroller.hxx>

#include <com/sun/star/frame/XUntitledNumbers.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/sdb/XDocumentDataSource.hpp>
#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <com/sun/star/util/NumberFormatter.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>

#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/dbmetadata.hxx>
#include <connectivity/dbtools.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>

namespace dbaui
{

    using ::com::sun::star::uno::Any;
    using ::com::sun::star::uno::Reference;
    using ::com::sun::star::beans::XPropertySet;
    using ::com::sun::star::uno::Sequence;
    using ::com::sun::star::uno::Type;
    using ::com::sun::star::uno::XComponentContext;
    using ::com::sun::star::sdbc::XConnection;
    using ::com::sun::star::uno::UNO_QUERY;
    using ::com::sun::star::container::XChild;
    using ::com::sun::star::sdbc::XDataSource;
    using ::com::sun::star::util::NumberFormatter;
    using ::com::sun::star::util::XNumberFormatter;
    using ::com::sun::star::util::XNumberFormatsSupplier;
    using ::com::sun::star::frame::XFrame;
    using ::com::sun::star::uno::Exception;
    using ::com::sun::star::lang::EventObject;
    using ::com::sun::star::beans::PropertyValue;
    using ::com::sun::star::frame::XModel;
    using ::com::sun::star::sdb::XOfficeDatabaseDocument;
    using ::com::sun::star::awt::XWindow;
    using ::com::sun::star::sdbc::XDatabaseMetaData;
    using ::com::sun::star::sdb::XDocumentDataSource;
    using ::com::sun::star::document::XEmbeddedScripts;
    using ::com::sun::star::lang::IllegalArgumentException;
    using ::com::sun::star::uno::UNO_SET_THROW;
    using ::com::sun::star::uno::UNO_QUERY_THROW;
    using ::com::sun::star::frame::XUntitledNumbers;

    namespace {

    class DataSourceHolder
    {
    public:
        DataSourceHolder()
        {
        }

        explicit DataSourceHolder(const Reference< XDataSource >& _rxDataSource)
              : m_xDataSource(_rxDataSource)
        {
            Reference< XDocumentDataSource > xDocDS( m_xDataSource, UNO_QUERY );
            if ( xDocDS.is() )
                m_xDocument = xDocDS->getDatabaseDocument();

            m_xDataSourceProps.set( m_xDataSource, UNO_QUERY );
        }

        const Reference< XDataSource >&             getDataSource() const { return m_xDataSource; }
        const Reference< XPropertySet >&            getDataSourceProps() const { return m_xDataSourceProps; }
        const Reference< XOfficeDatabaseDocument >&  getDatabaseDocument() const { return m_xDocument; }

        bool is() const { return m_xDataSource.is(); }

        void clear()
        {
            m_xDataSource.clear();
            m_xDocument.clear();
        }

    private:
        Reference< XDataSource >                m_xDataSource;
        Reference< XPropertySet >               m_xDataSourceProps;
        Reference< XOfficeDatabaseDocument >    m_xDocument;
    };

    }

    struct DBSubComponentController_Impl
    {
    private:
        ::std::optional< bool >       m_aDocScriptSupport;

    public:
        ::dbtools::SQLExceptionInfo     m_aCurrentError;

        ::comphelper::OInterfaceContainerHelper2
                                        m_aModifyListeners;

        // <properties>
        SharedConnection                m_xConnection;
        ::dbtools::DatabaseMetaData     m_aSdbMetaData;
        // </properties>
        OUString                        m_sDataSourceName;  // the data source we're working for
        DataSourceHolder                m_aDataSource;
        Reference< XNumberFormatter >   m_xFormatter;   // a number formatter working with the connection's NumberFormatsSupplier
        sal_Int32                       m_nDocStartNumber;
        bool                            m_bSuspended;   // is true when the controller was already suspended
        bool                            m_bEditable;    // is the control readonly or not
        bool                            m_bModified;    // is the data modified
        bool                            m_bNotAttached;

        explicit DBSubComponentController_Impl(osl::Mutex& i_rMutex)
            :m_aDocScriptSupport()
            ,m_aModifyListeners( i_rMutex )
            ,m_nDocStartNumber(0)
            ,m_bSuspended( false )
            ,m_bEditable(true)
            ,m_bModified(false)
            ,m_bNotAttached(true)
        {
        }

        bool    documentHasScriptSupport() const
        {
            OSL_PRECOND( !!m_aDocScriptSupport,
                "DBSubComponentController_Impl::documentHasScriptSupport: not completely initialized, yet - don't know!?" );
            return !!m_aDocScriptSupport && *m_aDocScriptSupport;
        }

        void    setDocumentScriptSupport( const bool _bSupport )
        {
            OSL_PRECOND( !m_aDocScriptSupport,
                "DBSubComponentController_Impl::setDocumentScriptSupport: already initialized!" );
            m_aDocScriptSupport = ::std::optional< bool >( _bSupport );
        }
    };

    // DBSubComponentController
    DBSubComponentController::DBSubComponentController(const Reference< XComponentContext >& _rxORB)
        :DBSubComponentController_Base( _rxORB )
        ,m_pImpl( new DBSubComponentController_Impl( getMutex() ) )
    {
    }

    DBSubComponentController::~DBSubComponentController()
    {
    }

    void DBSubComponentController::impl_initialize()
    {
        OGenericUnoController::impl_initialize();

        const ::comphelper::NamedValueCollection& rArguments( getInitParams() );

        Reference< XConnection > xConnection;
        xConnection = rArguments.getOrDefault( PROPERTY_ACTIVE_CONNECTION, xConnection );

        if ( !xConnection.is() )
            ::dbtools::isEmbeddedInDatabase( getModel(), xConnection );

        if ( xConnection.is() )
            initializeConnection( xConnection );

        bool bShowError = true;
        if ( !isConnected() )
        {
            reconnect( false );
            bShowError = false;
        }
        if ( !isConnected() )
        {
            if ( bShowError )
                connectionLostMessage();
            throw IllegalArgumentException();
        }
    }

    Any SAL_CALL DBSubComponentController::queryInterface(const Type& _rType)
    {
        if ( _rType.equals( cppu::UnoType<XScriptInvocationContext>::get() ) )
        {
            if ( m_pImpl->documentHasScriptSupport() )
                return makeAny( Reference< XScriptInvocationContext >( this ) );
            return Any();
        }

        return DBSubComponentController_Base::queryInterface( _rType );
    }

    Sequence< Type > SAL_CALL DBSubComponentController::getTypes(  )
    {
        Sequence< Type > aTypes( DBSubComponentController_Base::getTypes() );
        if ( !m_pImpl->documentHasScriptSupport() )
        {
            auto newEnd = std::remove_if( aTypes.begin(), aTypes.end(),
                                          [](const Type& type)
                                          { return type == cppu::UnoType<XScriptInvocationContext>::get(); } );
            aTypes.realloc( std::distance(aTypes.begin(), newEnd) );
       }
        return aTypes;
    }

    void DBSubComponentController::initializeConnection( const Reference< XConnection >& _rxForeignConn )
    {
        DBG_ASSERT( !isConnected(), "DBSubComponentController::initializeConnection: not to be called when already connected!" );
            // usually this gets called from within initialize of derived classes ...
        if ( isConnected() )
            disconnect();

        m_pImpl->m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership );
        m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection );
        startConnectionListening( m_pImpl->m_xConnection );

        // get the data source the connection belongs to
        try
        {
            // determine our data source
            OSL_PRECOND( !m_pImpl->m_aDataSource.is(), "DBSubComponentController::initializeConnection: already a data source in this phase?" );
            {
                Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY );
                Reference< XDataSource > xDS;
                if ( xConnAsChild.is() )
                    xDS.set( xConnAsChild->getParent(), UNO_QUERY );

                // (take the indirection through XDataSource to ensure we have a correct object...)
                m_pImpl->m_aDataSource = DataSourceHolder(xDS);
            }
            SAL_WARN_IF( !m_pImpl->m_aDataSource.is(), "dbaccess.ui", "DBSubComponentController::initializeConnection: unable to obtain the data source object!" );

            if ( m_pImpl->m_bNotAttached )
            {
                Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY );
                m_pImpl->m_nDocStartNumber = 1;
                if ( xUntitledProvider.is() )
                    m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) );
            }

            // determine the availability of script support in our document. Our own XScriptInvocationContext
            // interface depends on this
            m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() );

            // get a number formatter
            Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW );
            xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName;
            DBG_ASSERT( !m_pImpl->m_sDataSourceName.isEmpty(), "DBSubComponentController::initializeConnection: invalid data source name!" );
            Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection);
            if(xSupplier.is())
            {
                m_pImpl->m_xFormatter.set(NumberFormatter::create(getORB()), UNO_QUERY_THROW);
                m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier);
            }
            OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!");
        }
        catch( const Exception& )
        {
            DBG_UNHANDLED_EXCEPTION("dbaccess");
        }
    }

    void DBSubComponentController::reconnect( bool _bUI )
    {
        OSL_ENSURE(!m_pImpl->m_bSuspended, "Cannot reconnect while suspended!");

        stopConnectionListening( m_pImpl->m_xConnection );
        m_pImpl->m_aSdbMetaData.reset( nullptr );
        m_pImpl->m_xConnection.clear();

        // reconnect
        bool bReConnect = true;
        if ( _bUI )
        {
            std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(getFrameWeld(),
                                                        VclMessageType::Question, VclButtonsType::YesNo,
                                                        DBA_RES(STR_QUERY_CONNECTION_LOST)));
            bReConnect = (RET_YES == xQuery->run());
        }

        // now really reconnect ...
        if ( bReConnect )
        {
            m_pImpl->m_xConnection.reset( connect( m_pImpl->m_aDataSource.getDataSource() ), SharedConnection::TakeOwnership );
            m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection );
        }

        // invalidate all slots
        InvalidateAll();
    }

    void DBSubComponentController::disconnect()
    {
        stopConnectionListening(m_pImpl->m_xConnection);
        m_pImpl->m_aSdbMetaData.reset( nullptr );
        m_pImpl->m_xConnection.clear();

        InvalidateAll();
    }

    void DBSubComponentController::losingConnection()
    {
        // our connection was disposed so we need a new one
        reconnect( true );
        InvalidateAll();
    }

    void SAL_CALL DBSubComponentController::disposing()
    {
        DBSubComponentController_Base::disposing();

        disconnect();

        attachFrame( Reference < XFrame >() );

        m_pImpl->m_aDataSource.clear();
    }

    void SAL_CALL DBSubComponentController::disposing(const EventObject& _rSource)
    {
        if ( _rSource.Source == getConnection() )
        {
            if (    !m_pImpl->m_bSuspended // when already suspended then we don't have to reconnect
                &&  !getBroadcastHelper().bInDispose
                &&  !getBroadcastHelper().bDisposed
                &&  isConnected()
                )
            {
                losingConnection();
            }
            else
            {
                m_pImpl->m_xConnection.reset( m_pImpl->m_xConnection, SharedConnection::NoTakeOwnership );
                    // this prevents the "disposeComponent" call in disconnect
                disconnect();
            }
        }
        else
            DBSubComponentController_Base::disposing( _rSource );
    }

    void DBSubComponentController::appendError( const OUString& _rErrorMessage )
    {
        m_pImpl->m_aCurrentError.append( ::dbtools::SQLExceptionInfo::TYPE::SQLException, _rErrorMessage,
                                        getStandardSQLState( ::dbtools::StandardSQLState::GENERAL_ERROR ),
                                        1000 );
    }
    void DBSubComponentController::clearError()
    {
        m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo();
    }

    bool DBSubComponentController::hasError() const
    {
        return m_pImpl->m_aCurrentError.isValid();
    }

    const ::dbtools::SQLExceptionInfo& DBSubComponentController::getError() const
    {
        return m_pImpl->m_aCurrentError;
    }

    void DBSubComponentController::displayError()
    {
        showError( m_pImpl->m_aCurrentError );
    }

    sal_Bool SAL_CALL DBSubComponentController::suspend(sal_Bool bSuspend)
    {
        m_pImpl->m_bSuspended = bSuspend;
        if ( !bSuspend && !isConnected() )
            reconnect(true);

        return true;
    }

    sal_Bool SAL_CALL DBSubComponentController::attachModel( const Reference< XModel > & _rxModel)
    {
        if ( !_rxModel.is() )
            return false;
        if ( !DBSubComponentController_Base::attachModel( _rxModel ) )
            return false;

        m_pImpl->m_bNotAttached = false;
        if ( m_pImpl->m_nDocStartNumber == 1 )
            releaseNumberForComponent();

        Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY );
        m_pImpl->m_nDocStartNumber = 1;
        if ( xUntitledProvider.is() )
            m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) );

        return true;
    }

    void DBSubComponentController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs)
    {
        if ( _nId == ID_BROWSER_CLOSE )
        {
            closeTask();
            return;
        }

        DBSubComponentController_Base::Execute( _nId, _rArgs );
        InvalidateFeature( _nId );
    }

    OUString DBSubComponentController::getDataSourceName() const
    {
        OUString sName;
        Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps() );
        if ( xDataSourceProps.is() )
            xDataSourceProps->getPropertyValue(PROPERTY_NAME) >>= sName;
        return sName;
    }
    void DBSubComponentController::connectionLostMessage() const
    {
        OUString aMessage(DBA_RES(RID_STR_CONNECTION_LOST));
        Reference< XWindow > xWindow = getTopMostContainerWindow();
        vcl::Window* pWin = nullptr;
        if ( xWindow.is() )
            pWin = VCLUnoHelper::GetWindow(xWindow).get();
        if ( !pWin )
            pWin = getView()->Window::GetParent();

        std::unique_ptr<weld::MessageDialog> xInfo(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
                                                   VclMessageType::Info, VclButtonsType::Ok, aMessage));
        xInfo->run();
    }
    const Reference< XConnection >& DBSubComponentController::getConnection() const
    {
        return m_pImpl->m_xConnection;
    }

    bool DBSubComponentController::isReadOnly() const
    {
        return !m_pImpl->m_bEditable;
    }

    bool DBSubComponentController::isEditable() const
    {
        return m_pImpl->m_bEditable;
    }

    void DBSubComponentController::setEditable(bool _bEditable)
    {
        m_pImpl->m_bEditable = _bEditable;
    }

    const ::dbtools::DatabaseMetaData& DBSubComponentController::getSdbMetaData() const
    {
        return m_pImpl->m_aSdbMetaData;
    }

    bool DBSubComponentController::isConnected() const
    {
        return m_pImpl->m_xConnection.is();
    }

    Reference< XDatabaseMetaData > DBSubComponentController::getMetaData( ) const
    {
        Reference< XDatabaseMetaData > xMeta;
        try
        {
            if ( isConnected() )
                xMeta.set( m_pImpl->m_xConnection->getMetaData(), UNO_SET_THROW );
        }
        catch( const Exception& )
        {
            DBG_UNHANDLED_EXCEPTION("dbaccess");
        }
        return xMeta;
    }

    const Reference< XPropertySet >& DBSubComponentController::getDataSource() const
    {
        return m_pImpl->m_aDataSource.getDataSourceProps();
    }

    bool DBSubComponentController::haveDataSource() const
    {
        return m_pImpl->m_aDataSource.is();
    }

    Reference< XModel > DBSubComponentController::getDatabaseDocument() const
    {
        return Reference< XModel >( m_pImpl->m_aDataSource.getDatabaseDocument(), UNO_QUERY );
    }

    Reference< XNumberFormatter > const & DBSubComponentController::getNumberFormatter() const
    {
        return m_pImpl->m_xFormatter;
    }

    Reference< XModel > DBSubComponentController::getPrivateModel() const
    {
        return getDatabaseDocument();
    }
    // XTitle
    OUString SAL_CALL DBSubComponentController::getTitle()
    {
        ::osl::MutexGuard aGuard( getMutex() );
        if ( m_bExternalTitle )
            return impl_getTitleHelper_throw()->getTitle ();

        OUStringBuffer sTitle;
        Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY);
        if ( xTitle.is() )
        {
            sTitle.append( xTitle->getTitle() );
            sTitle.append(" : ");
        }
        sTitle.append( getPrivateTitle() );
        return sTitle.makeStringAndClear();
    }

    sal_Int32 DBSubComponentController::getCurrentStartNumber() const
    {
        return m_pImpl->m_nDocStartNumber;
    }

    Reference< XEmbeddedScripts > SAL_CALL DBSubComponentController::getScriptContainer()
    {
        ::osl::MutexGuard aGuard( getMutex() );
        if ( !m_pImpl->documentHasScriptSupport() )
            return nullptr;

        return Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY_THROW );
    }

    void SAL_CALL DBSubComponentController::addModifyListener( const Reference< XModifyListener >& i_Listener )
    {
        ::osl::MutexGuard aGuard( getMutex() );
        m_pImpl->m_aModifyListeners.addInterface( i_Listener );
    }

    void SAL_CALL DBSubComponentController::removeModifyListener( const Reference< XModifyListener >& i_Listener )
    {
        ::osl::MutexGuard aGuard( getMutex() );
        m_pImpl->m_aModifyListeners.removeInterface( i_Listener );
    }

    sal_Bool SAL_CALL DBSubComponentController::isModified(  )
    {
        ::osl::MutexGuard aGuard( getMutex() );
        return impl_isModified();
    }

    void SAL_CALL DBSubComponentController::setModified( sal_Bool i_bModified )
    {
        ::osl::ClearableMutexGuard aGuard( getMutex() );

        if ( m_pImpl->m_bModified == bool(i_bModified) )
            return;

        m_pImpl->m_bModified = i_bModified;
        impl_onModifyChanged();

        EventObject aEvent( *this );
        aGuard.clear();
        m_pImpl->m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent );
    }

    bool DBSubComponentController::impl_isModified() const
    {
        return m_pImpl->m_bModified;
    }

    void DBSubComponentController::impl_onModifyChanged()
    {
        InvalidateFeature( ID_BROWSER_SAVEDOC );
        if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) )
            InvalidateFeature( ID_BROWSER_SAVEASDOC );
    }

}   // namespace dbaui

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */