bump product version to 4.1.6.2
[LibreOffice.git] / dbaccess / source / ui / dlg / advancedsettings.cxx
blob868d8a82119c61e87765ac267d94e6f9ff610fb4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "advancedsettings.hxx"
21 #include "advancedsettingsdlg.hxx"
22 #include "moduledbu.hxx"
23 #include "dsitems.hxx"
24 #include "DbAdminImpl.hxx"
25 #include "DriverSettings.hxx"
26 #include "optionalboolitem.hxx"
27 #include "dbu_resource.hrc"
28 #include "dbu_dlg.hrc"
29 #include "dbadmin.hrc"
30 #include "advancedsettings.hrc"
32 #include <svl/eitem.hxx>
33 #include <svl/intitem.hxx>
34 #include <svl/stritem.hxx>
36 #include <vcl/msgbox.hxx>
38 //........................................................................
39 namespace dbaui
41 //........................................................................
43 using ::com::sun::star::uno::Reference;
44 using ::com::sun::star::lang::XMultiServiceFactory;
45 using ::com::sun::star::uno::Any;
46 using ::com::sun::star::uno::XComponentContext;
47 using ::com::sun::star::uno::UNO_QUERY_THROW;
48 using ::com::sun::star::beans::XPropertySet;
49 using ::com::sun::star::sdbc::XConnection;
50 using ::com::sun::star::sdbc::XDriver;
52 //========================================================================
53 //= SpecialSettingsPage
54 //========================================================================
55 struct BooleanSettingDesc
57 CheckBox** ppControl; // the dialog's control which displays this setting
58 sal_uInt16 nControlResId; // the resource ID to load the control from
59 sal_uInt16 nItemId; // the ID of the item (in an SfxItemSet) which corresponds to this setting
60 bool bInvertedDisplay; // true if and only if the checkbox is checked when the item is sal_False, and vice versa
63 //========================================================================
64 //= SpecialSettingsPage
65 //========================================================================
66 SpecialSettingsPage::SpecialSettingsPage( Window* pParent, const SfxItemSet& _rCoreAttrs, const DataSourceMetaData& _rDSMeta )
67 :OGenericAdministrationPage( pParent, ModuleRes( PAGE_ADVANCED_SETTINGS_SPECIAL ), _rCoreAttrs )
68 ,m_aTopLine( this, ModuleRes( FL_DATAHANDLING ) )
69 ,m_pIsSQL92Check( NULL )
70 ,m_pAppendTableAlias( NULL )
71 ,m_pAsBeforeCorrelationName( NULL )
72 ,m_pEnableOuterJoin( NULL )
73 ,m_pIgnoreDriverPrivileges( NULL )
74 ,m_pParameterSubstitution( NULL )
75 ,m_pSuppressVersionColumn( NULL )
76 ,m_pCatalog( NULL )
77 ,m_pSchema( NULL )
78 ,m_pIndexAppendix( NULL )
79 ,m_pDosLineEnds( NULL )
80 ,m_pCheckRequiredFields( NULL )
81 ,m_pIgnoreCurrency(NULL)
82 ,m_pEscapeDateTime(NULL)
83 ,m_pPrimaryKeySupport(NULL)
84 ,m_pRespectDriverResultSetType(NULL)
85 ,m_pBooleanComparisonModeLabel( NULL )
86 ,m_pBooleanComparisonMode( NULL )
87 ,m_pMaxRowScanLabel( NULL )
88 ,m_pMaxRowScan( NULL )
89 ,m_aControlDependencies()
90 ,m_aBooleanSettings()
91 ,m_bHasBooleanComparisonMode( _rDSMeta.getFeatureSet().has( DSID_BOOLEANCOMPARISON ) )
92 ,m_bHasMaxRowScan( _rDSMeta.getFeatureSet().has( DSID_MAX_ROW_SCAN ) )
94 impl_initBooleanSettings();
96 const FeatureSet& rFeatures( _rDSMeta.getFeatureSet() );
97 // create all the check boxes for the boolean settings
98 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
99 setting != m_aBooleanSettings.end();
100 ++setting
103 sal_uInt16 nItemId = setting->nItemId;
104 if ( rFeatures.has( nItemId ) )
106 sal_uInt16 nResourceId = setting->nControlResId;
107 (*setting->ppControl) = new CheckBox( this, ModuleRes( nResourceId ) );
108 (*setting->ppControl)->SetClickHdl( getControlModifiedLink() );
110 // check whether this must be a tristate check box
111 const SfxPoolItem& rItem = _rCoreAttrs.Get( nItemId );
112 if ( rItem.ISA( OptionalBoolItem ) )
113 (*setting->ppControl)->EnableTriState( sal_True );
117 if ( m_pAsBeforeCorrelationName && m_pAppendTableAlias )
118 // make m_pAsBeforeCorrelationName depend on m_pAppendTableAlias
119 m_aControlDependencies.enableOnCheckMark( *m_pAppendTableAlias, *m_pAsBeforeCorrelationName );
121 // move the controls to the appropriate positions
122 Point aPos( m_aTopLine.GetPosPixel() );
123 aPos.Move( 0, m_aTopLine.GetSizePixel().Height() );
124 Size aFirstDistance( LogicToPixel( Size( INDENTED_X, RELATED_CONTROLS ), MAP_APPFONT ) );
125 aPos.Move( aFirstDistance.Width(), aFirstDistance.Height() );
127 Size aUnrelatedControls( LogicToPixel( Size( RELATED_CONTROLS, RELATED_CONTROLS ), MAP_APPFONT ) );
129 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
130 setting != m_aBooleanSettings.end();
131 ++setting
134 if ( !*setting->ppControl )
135 continue;
137 (*setting->ppControl)->SetPosPixel( aPos );
138 aPos.Move( 0, (*setting->ppControl)->GetSizePixel().Height() );
139 aPos.Move( 0, aUnrelatedControls.Height() );
142 // create the controls for the boolean comparison mode
143 if ( m_bHasBooleanComparisonMode )
145 m_pBooleanComparisonModeLabel = new FixedText( this, ModuleRes( FT_BOOLEANCOMPARISON ) );
146 m_pBooleanComparisonMode = new ListBox( this, ModuleRes( LB_BOOLEANCOMPARISON ) );
147 m_pBooleanComparisonMode->SetDropDownLineCount( 4 );
148 m_pBooleanComparisonMode->SetSelectHdl( getControlModifiedLink() );
150 Point aLabelPos( m_pBooleanComparisonModeLabel->GetPosPixel() );
151 Point aControlPos( m_pBooleanComparisonMode->GetPosPixel() );
152 long nMoveUp = aControlPos.Y() - aPos.Y();
154 m_pBooleanComparisonModeLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) );
155 m_pBooleanComparisonMode->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) );
157 // create the controls for the max row scan
158 if ( m_bHasMaxRowScan )
160 m_pMaxRowScanLabel = new FixedText( this, ModuleRes( FT_MAXROWSCAN ) );
161 m_pMaxRowScan = new NumericField( this, ModuleRes( NF_MAXROWSCAN ) );
162 m_pMaxRowScan->SetModifyHdl(getControlModifiedLink());
163 m_pMaxRowScan->SetUseThousandSep(sal_False);
165 Point aLabelPos( m_pMaxRowScanLabel->GetPosPixel() );
166 Point aControlPos( m_pMaxRowScan->GetPosPixel() );
167 long nMoveUp = aControlPos.Y() - aPos.Y();
169 m_pMaxRowScanLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) );
170 m_pMaxRowScan->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) );
173 FreeResource();
176 // -----------------------------------------------------------------------
177 SpecialSettingsPage::~SpecialSettingsPage()
179 m_aControlDependencies.clear();
181 DELETEZ( m_pIsSQL92Check );
182 DELETEZ( m_pAppendTableAlias );
183 DELETEZ( m_pAsBeforeCorrelationName );
184 DELETEZ( m_pParameterSubstitution );
185 DELETEZ( m_pIgnoreDriverPrivileges );
186 DELETEZ( m_pSuppressVersionColumn );
187 DELETEZ( m_pEnableOuterJoin );
188 DELETEZ( m_pCatalog );
189 DELETEZ( m_pSchema );
190 DELETEZ( m_pIndexAppendix );
191 DELETEZ( m_pDosLineEnds );
192 DELETEZ( m_pCheckRequiredFields );
193 DELETEZ( m_pIgnoreCurrency );
194 DELETEZ( m_pEscapeDateTime );
195 DELETEZ( m_pPrimaryKeySupport );
196 DELETEZ( m_pRespectDriverResultSetType );
197 DELETEZ( m_pBooleanComparisonModeLabel );
198 DELETEZ( m_pBooleanComparisonMode );
199 DELETEZ( m_pMaxRowScanLabel );
200 DELETEZ( m_pMaxRowScan );
203 // -----------------------------------------------------------------------
204 void SpecialSettingsPage::impl_initBooleanSettings()
206 OSL_PRECOND( m_aBooleanSettings.empty(), "SpecialSettingsPage::impl_initBooleanSettings: called twice!" );
208 // for easier maintainance, write the table in this form, then copy it to m_aBooleanSettings
209 BooleanSettingDesc aSettings[] = {
210 { &m_pIsSQL92Check, CB_SQL92CHECK, DSID_SQL92CHECK, false },
211 { &m_pAppendTableAlias, CB_APPENDTABLEALIAS, DSID_APPEND_TABLE_ALIAS, false },
212 { &m_pAsBeforeCorrelationName, CB_AS_BEFORE_CORR_NAME, DSID_AS_BEFORE_CORRNAME, false },
213 { &m_pEnableOuterJoin, CB_ENABLEOUTERJOIN, DSID_ENABLEOUTERJOIN, false },
214 { &m_pIgnoreDriverPrivileges, CB_IGNOREDRIVER_PRIV, DSID_IGNOREDRIVER_PRIV, false },
215 { &m_pParameterSubstitution, CB_PARAMETERNAMESUBST, DSID_PARAMETERNAMESUBST, false },
216 { &m_pSuppressVersionColumn, CB_SUPPRESVERSIONCL, DSID_SUPPRESSVERSIONCL, true },
217 { &m_pCatalog, CB_CATALOG, DSID_CATALOG, false },
218 { &m_pSchema, CB_SCHEMA, DSID_SCHEMA, false },
219 { &m_pIndexAppendix, CB_IGNOREINDEXAPPENDIX, DSID_INDEXAPPENDIX, false },
220 { &m_pDosLineEnds, CB_DOSLINEENDS, DSID_DOSLINEENDS, false },
221 { &m_pCheckRequiredFields, CB_CHECK_REQUIRED, DSID_CHECK_REQUIRED_FIELDS, false },
222 { &m_pIgnoreCurrency, CB_IGNORECURRENCY, DSID_IGNORECURRENCY, false },
223 { &m_pEscapeDateTime, CB_ESCAPE_DATETIME, DSID_ESCAPE_DATETIME, false },
224 { &m_pPrimaryKeySupport, CB_PRIMARY_KEY_SUPPORT, DSID_PRIMARY_KEY_SUPPORT, false },
225 { &m_pRespectDriverResultSetType, CB_RESPECTRESULTSETTYPE,DSID_RESPECTRESULTSETTYPE, false },
226 { NULL, 0, 0, false }
229 for ( const BooleanSettingDesc* pCopy = aSettings; pCopy->nItemId != 0; ++pCopy )
231 m_aBooleanSettings.push_back( *pCopy );
235 // -----------------------------------------------------------------------
236 void SpecialSettingsPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList )
238 if ( m_bHasBooleanComparisonMode )
240 _rControlList.push_back( new ODisableWrapper< FixedText >( m_pBooleanComparisonModeLabel ) );
242 if ( m_bHasMaxRowScan )
244 _rControlList.push_back( new ODisableWrapper< FixedText >( m_pMaxRowScanLabel ) );
248 // -----------------------------------------------------------------------
249 void SpecialSettingsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
251 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
252 setting != m_aBooleanSettings.end();
253 ++setting
256 if ( *setting->ppControl )
258 _rControlList.push_back( new OSaveValueWrapper< CheckBox >( *setting->ppControl ) );
262 if ( m_bHasBooleanComparisonMode )
263 _rControlList.push_back( new OSaveValueWrapper< ListBox >( m_pBooleanComparisonMode ) );
264 if ( m_bHasMaxRowScan )
265 _rControlList.push_back(new OSaveValueWrapper<NumericField>(m_pMaxRowScan));
268 // -----------------------------------------------------------------------
269 void SpecialSettingsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
271 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
272 sal_Bool bValid, bReadonly;
273 getFlags( _rSet, bValid, bReadonly );
275 if ( !bValid )
277 OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
278 return;
281 // the boolean items
282 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
283 setting != m_aBooleanSettings.end();
284 ++setting
287 if ( !*setting->ppControl )
288 continue;
290 ::boost::optional< bool > aValue(false);
291 aValue.reset();
293 SFX_ITEMSET_GET( _rSet, pItem, SfxPoolItem, setting->nItemId, sal_True );
294 if ( pItem->ISA( SfxBoolItem ) )
296 aValue.reset( PTR_CAST( SfxBoolItem, pItem )->GetValue() );
298 else if ( pItem->ISA( OptionalBoolItem ) )
300 aValue = PTR_CAST( OptionalBoolItem, pItem )->GetFullValue();
302 else
303 OSL_FAIL( "SpecialSettingsPage::implInitControls: unknown boolean item type!" );
305 if ( !aValue )
307 (*setting->ppControl)->SetState( STATE_DONTKNOW );
309 else
311 bool bValue = *aValue;
312 if ( setting->bInvertedDisplay )
313 bValue = !bValue;
314 (*setting->ppControl)->Check( bValue );
318 // the non-boolean items
319 if ( m_bHasBooleanComparisonMode )
321 SFX_ITEMSET_GET( _rSet, pBooleanComparison, SfxInt32Item, DSID_BOOLEANCOMPARISON, sal_True );
322 m_pBooleanComparisonMode->SelectEntryPos( static_cast< sal_uInt16 >( pBooleanComparison->GetValue() ) );
325 if ( m_bHasMaxRowScan )
327 SFX_ITEMSET_GET(_rSet, pMaxRowScan, SfxInt32Item, DSID_MAX_ROW_SCAN, sal_True);
328 m_pMaxRowScan->SetValue(pMaxRowScan->GetValue());
331 OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
334 // -----------------------------------------------------------------------
335 sal_Bool SpecialSettingsPage::FillItemSet( SfxItemSet& _rSet )
337 sal_Bool bChangedSomething = sal_False;
339 // the boolean items
340 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
341 setting != m_aBooleanSettings.end();
342 ++setting
345 if ( !*setting->ppControl )
346 continue;
347 fillBool( _rSet, *setting->ppControl, setting->nItemId, bChangedSomething, setting->bInvertedDisplay );
350 // the non-boolean items
351 if ( m_bHasBooleanComparisonMode )
353 if ( m_pBooleanComparisonMode->GetSelectEntryPos() != m_pBooleanComparisonMode->GetSavedValue() )
355 _rSet.Put( SfxInt32Item( DSID_BOOLEANCOMPARISON, m_pBooleanComparisonMode->GetSelectEntryPos() ) );
356 bChangedSomething = sal_True;
359 if ( m_bHasMaxRowScan )
361 fillInt32(_rSet,m_pMaxRowScan,DSID_MAX_ROW_SCAN,bChangedSomething);
363 return bChangedSomething;
366 //========================================================================
367 //= GeneratedValuesPage
368 //========================================================================
369 //------------------------------------------------------------------------
370 GeneratedValuesPage::GeneratedValuesPage( Window* pParent, const SfxItemSet& _rCoreAttrs )
371 :OGenericAdministrationPage(pParent, ModuleRes( PAGE_GENERATED_VALUES ), _rCoreAttrs)
372 ,m_aAutoFixedLine ( this, ModuleRes( FL_SEPARATORAUTO ) )
373 ,m_aAutoRetrievingEnabled( this, ModuleRes( CB_RETRIEVE_AUTO ) )
374 ,m_aAutoIncrementLabel ( this, ModuleRes( FT_AUTOINCREMENTVALUE ) )
375 ,m_aAutoIncrement ( this, ModuleRes( ET_AUTOINCREMENTVALUE ) )
376 ,m_aAutoRetrievingLabel ( this, ModuleRes( FT_RETRIEVE_AUTO ) )
377 ,m_aAutoRetrieving ( this, ModuleRes( ET_RETRIEVE_AUTO ) )
379 m_aAutoRetrievingEnabled.SetClickHdl( getControlModifiedLink() );
380 m_aAutoIncrement.SetModifyHdl( getControlModifiedLink() );
381 m_aAutoRetrieving.SetModifyHdl( getControlModifiedLink() );
383 m_aControlDependencies.enableOnCheckMark( m_aAutoRetrievingEnabled,
384 m_aAutoIncrementLabel, m_aAutoIncrement, m_aAutoRetrievingLabel, m_aAutoRetrieving );
386 FreeResource();
389 // -----------------------------------------------------------------------
390 GeneratedValuesPage::~GeneratedValuesPage()
392 m_aControlDependencies.clear();
395 // -----------------------------------------------------------------------
396 void GeneratedValuesPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList )
398 _rControlList.push_back( new ODisableWrapper< FixedLine >( &m_aAutoFixedLine ) );
399 _rControlList.push_back( new ODisableWrapper< FixedText >( &m_aAutoIncrementLabel ) );
400 _rControlList.push_back( new ODisableWrapper< FixedText >( &m_aAutoRetrievingLabel ) );
403 // -----------------------------------------------------------------------
404 void GeneratedValuesPage::fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList )
406 _rControlList.push_back( new OSaveValueWrapper< CheckBox >( &m_aAutoRetrievingEnabled ) );
407 _rControlList.push_back( new OSaveValueWrapper< Edit >( &m_aAutoIncrement ) );
408 _rControlList.push_back( new OSaveValueWrapper< Edit >( &m_aAutoRetrieving ) );
411 // -----------------------------------------------------------------------
412 void GeneratedValuesPage::implInitControls( const SfxItemSet& _rSet, sal_Bool _bSaveValue )
414 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
415 sal_Bool bValid, bReadonly;
416 getFlags(_rSet, bValid, bReadonly);
418 // collect the items
419 SFX_ITEMSET_GET(_rSet, pAutoIncrementItem, SfxStringItem, DSID_AUTOINCREMENTVALUE, sal_True);
420 SFX_ITEMSET_GET(_rSet, pAutoRetrieveValueItem, SfxStringItem, DSID_AUTORETRIEVEVALUE, sal_True);
421 SFX_ITEMSET_GET(_rSet, pAutoRetrieveEnabledItem, SfxBoolItem, DSID_AUTORETRIEVEENABLED, sal_True);
423 // forward the values to the controls
424 if (bValid)
426 sal_Bool bEnabled = pAutoRetrieveEnabledItem->GetValue();
427 m_aAutoRetrievingEnabled.Check( bEnabled );
429 m_aAutoIncrement.SetText( pAutoIncrementItem->GetValue() );
430 m_aAutoIncrement.ClearModifyFlag();
431 m_aAutoRetrieving.SetText( pAutoRetrieveValueItem->GetValue() );
432 m_aAutoRetrieving.ClearModifyFlag();
434 OGenericAdministrationPage::implInitControls( _rSet, _bSaveValue );
437 // -----------------------------------------------------------------------
438 sal_Bool GeneratedValuesPage::FillItemSet(SfxItemSet& _rSet)
440 sal_Bool bChangedSomething = sal_False;
442 fillString( _rSet, &m_aAutoIncrement, DSID_AUTOINCREMENTVALUE, bChangedSomething );
443 fillBool( _rSet, &m_aAutoRetrievingEnabled, DSID_AUTORETRIEVEENABLED, bChangedSomething );
444 fillString( _rSet, &m_aAutoRetrieving, DSID_AUTORETRIEVEVALUE, bChangedSomething );
446 return bChangedSomething;
449 //========================================================================
450 //= AdvancedSettingsDialog
451 //========================================================================
452 //------------------------------------------------------------------------
453 AdvancedSettingsDialog::AdvancedSettingsDialog( Window* _pParent, SfxItemSet* _pItems,
454 const Reference< XComponentContext >& _rxContext, const Any& _aDataSourceName )
455 :SfxTabDialog(_pParent, ModuleRes(DLG_DATABASE_ADVANCED), _pItems)
457 m_pImpl = ::std::auto_ptr<ODbDataSourceAdministrationHelper>(new ODbDataSourceAdministrationHelper(_rxContext,_pParent,this));
458 m_pImpl->setDataSourceOrName(_aDataSourceName);
459 Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
460 m_pImpl->translateProperties(xDatasource, *_pItems);
461 SetInputSet(_pItems);
462 // propagate this set as our new input set and reset the example set
463 delete pExampleSet;
464 pExampleSet = new SfxItemSet(*GetInputSetImpl());
466 const OUString eType = m_pImpl->getDatasourceType(*_pItems);
468 DataSourceMetaData aMeta( eType );
469 const FeatureSet& rFeatures( aMeta.getFeatureSet() );
471 // auto-generated values?
472 if ( rFeatures.supportsGeneratedValues() )
473 AddTabPage( PAGE_GENERATED_VALUES, String( ModuleRes( STR_GENERATED_VALUE ) ), ODriversSettings::CreateGeneratedValuesPage, NULL );
475 // any "special settings"?
476 if ( rFeatures.supportsAnySpecialSetting() )
477 AddTabPage( PAGE_ADVANCED_SETTINGS_SPECIAL, String( ModuleRes( STR_DS_BEHAVIOUR ) ), ODriversSettings::CreateSpecialSettingsPage, NULL );
479 // remove the reset button - it's meaning is much too ambiguous in this dialog
480 RemoveResetButton();
481 FreeResource();
484 // -----------------------------------------------------------------------
485 AdvancedSettingsDialog::~AdvancedSettingsDialog()
487 SetInputSet(NULL);
488 DELETEZ(pExampleSet);
491 // -----------------------------------------------------------------------
492 bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( const OUString& _sURL )
494 DataSourceMetaData aMeta( _sURL );
495 const FeatureSet& rFeatures( aMeta.getFeatureSet() );
496 if ( rFeatures.supportsGeneratedValues() || rFeatures.supportsAnySpecialSetting() )
497 return true;
498 return false;
501 // -----------------------------------------------------------------------
502 short AdvancedSettingsDialog::Execute()
504 short nRet = SfxTabDialog::Execute();
505 if ( nRet == RET_OK )
507 pExampleSet->Put(*GetOutputItemSet());
508 m_pImpl->saveChanges(*pExampleSet);
510 return nRet;
513 //-------------------------------------------------------------------------
514 void AdvancedSettingsDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage)
516 // register ourself as modified listener
517 static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( getORB() );
518 static_cast<OGenericAdministrationPage&>(_rPage).SetAdminDialog(this,this);
520 AdjustLayout();
521 Window *pWin = GetViewWindow();
522 if(pWin)
523 pWin->Invalidate();
525 SfxTabDialog::PageCreated(_nId, _rPage);
528 // -----------------------------------------------------------------------------
529 const SfxItemSet* AdvancedSettingsDialog::getOutputSet() const
531 return pExampleSet;
534 // -----------------------------------------------------------------------------
535 SfxItemSet* AdvancedSettingsDialog::getWriteOutputSet()
537 return pExampleSet;
540 // -----------------------------------------------------------------------------
541 ::std::pair< Reference< XConnection >, sal_Bool > AdvancedSettingsDialog::createConnection()
543 return m_pImpl->createConnection();
546 // -----------------------------------------------------------------------------
547 Reference< XComponentContext > AdvancedSettingsDialog::getORB() const
549 return m_pImpl->getORB();
552 // -----------------------------------------------------------------------------
553 Reference< XDriver > AdvancedSettingsDialog::getDriver()
555 return m_pImpl->getDriver();
558 // -----------------------------------------------------------------------------
559 OUString AdvancedSettingsDialog::getDatasourceType(const SfxItemSet& _rSet) const
561 return m_pImpl->getDatasourceType(_rSet);
564 // -----------------------------------------------------------------------------
565 void AdvancedSettingsDialog::clearPassword()
567 m_pImpl->clearPassword();
570 // -----------------------------------------------------------------------------
571 void AdvancedSettingsDialog::setTitle(const OUString& _sTitle)
573 SetText(_sTitle);
576 //-------------------------------------------------------------------------
577 void AdvancedSettingsDialog::enableConfirmSettings( bool _bEnable )
579 (void)_bEnable;
582 //-------------------------------------------------------------------------
583 sal_Bool AdvancedSettingsDialog::saveDatasource()
585 return PrepareLeaveCurrentPage();
588 //........................................................................
589 } // namespace dbaui
590 //........................................................................
592 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */