summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-10-01 12:28:29 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-10-01 12:28:29 +0000
commit34b1c1b1673dd86becb00eb490abce060682beff (patch)
treed07dc75cbdbd80149cbe81556f6043fedfc577e2 /dbaccess/source/ui
parent4d01cb7a32b4264bbe3f646e71def13199ed32e2 (diff)
CWS-TOOLING: integrate CWS dba31b
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx34
-rw-r--r--dbaccess/source/ui/app/AppController.hxx5
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx4
-rw-r--r--dbaccess/source/ui/app/app.src7
-rw-r--r--dbaccess/source/ui/app/dbu_app.hrc5
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx186
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx7
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx70
-rw-r--r--dbaccess/source/ui/control/curledit.cxx6
-rw-r--r--dbaccess/source/ui/control/dbtreelistbox.cxx17
-rw-r--r--dbaccess/source/ui/dlg/AdabasStatDlg.cxx8
-rw-r--r--dbaccess/source/ui/dlg/CollectionView.cxx17
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx55
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.hxx7
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.cxx53
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.hxx5
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPageSetup.cxx8
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx11
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx85
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.hxx5
-rw-r--r--dbaccess/source/ui/dlg/DriverSettings.cxx26
-rw-r--r--dbaccess/source/ui/dlg/DriverSettings.hxx5
-rw-r--r--dbaccess/source/ui/dlg/RelationDlg.cxx4
-rw-r--r--dbaccess/source/ui/dlg/UserAdminDlg.cxx4
-rw-r--r--dbaccess/source/ui/dlg/adminpages.cxx4
-rw-r--r--dbaccess/source/ui/dlg/adminpages.hxx4
-rw-r--r--dbaccess/source/ui/dlg/adtabdlg.cxx140
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx8
-rw-r--r--dbaccess/source/ui/dlg/datasourceui.cxx4
-rw-r--r--dbaccess/source/ui/dlg/datasourceui.hxx4
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx51
-rw-r--r--dbaccess/source/ui/dlg/dbwiz.cxx70
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx195
-rw-r--r--dbaccess/source/ui/dlg/detailpages.cxx7
-rw-r--r--dbaccess/source/ui/dlg/dsselect.cxx8
-rw-r--r--dbaccess/source/ui/dlg/dsselect.hxx4
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx53
-rw-r--r--dbaccess/source/ui/dlg/generalpage.hxx23
-rw-r--r--dbaccess/source/ui/inc/AdabasStatDlg.hxx4
-rw-r--r--dbaccess/source/ui/inc/IItemSetHelper.hxx4
-rw-r--r--dbaccess/source/ui/inc/RelationTableView.hxx21
-rw-r--r--dbaccess/source/ui/inc/TableController.hxx12
-rw-r--r--dbaccess/source/ui/inc/TableWindow.hxx31
-rw-r--r--dbaccess/source/ui/inc/TableWindowListBox.hxx7
-rw-r--r--dbaccess/source/ui/inc/UITools.hxx25
-rw-r--r--dbaccess/source/ui/inc/UserAdminDlg.hxx4
-rw-r--r--dbaccess/source/ui/inc/advancedsettingsdlg.hxx6
-rw-r--r--dbaccess/source/ui/inc/curledit.hxx5
-rw-r--r--dbaccess/source/ui/inc/dbadmin.hxx9
-rw-r--r--dbaccess/source/ui/inc/dbu_resource.hrc4
-rw-r--r--dbaccess/source/ui/inc/dbwiz.hxx12
-rw-r--r--dbaccess/source/ui/inc/dbwizsetup.hxx18
-rw-r--r--dbaccess/source/ui/inc/dsmeta.hxx12
-rw-r--r--dbaccess/source/ui/inc/unoadmin.hxx5
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx26
-rw-r--r--dbaccess/source/ui/misc/charsets.cxx5
-rw-r--r--dbaccess/source/ui/misc/dbumiscres.src205
-rw-r--r--dbaccess/source/ui/misc/dsmeta.cxx164
-rw-r--r--dbaccess/source/ui/misc/dsntypes.cxx732
-rw-r--r--dbaccess/source/ui/misc/linkeddocuments.cxx6
-rw-r--r--dbaccess/source/ui/misc/makefile.mk3
-rw-r--r--dbaccess/source/ui/misc/singledoccontroller.cxx20
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLine.cxx48
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx5
-rw-r--r--dbaccess/source/ui/querydesign/TableWindow.cxx65
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowData.cxx24
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowListBox.cxx11
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx18
-rw-r--r--dbaccess/source/ui/querydesign/querydlg.cxx15
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnection.cxx5
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx4
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx134
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescriptions.cxx24
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx32
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx40
-rw-r--r--dbaccess/source/ui/uno/unoadmin.cxx4
76 files changed, 1120 insertions, 1858 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index a8b0712b5..712b6ed72 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AppController.cxx,v $
- * $Revision: 1.65 $
+ * $Revision: 1.63.20.5 $
*
* This file is part of OpenOffice.org.
*
@@ -938,8 +938,8 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
break;
case SID_DB_APP_DSUSERADMIN:
{
- DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
- aReturn.bEnabled = DST_EMBEDDED_HSQLDB != eType;
+ ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
+ aReturn.bEnabled = ::dbaccess::DST_EMBEDDED_HSQLDB != eType;
}
break;
case SID_DB_APP_DSRELDESIGN:
@@ -955,23 +955,23 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = m_xDataSource.is();
if ( aReturn.bEnabled )
{
- DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
- aReturn.bEnabled = DST_EMBEDDED_HSQLDB != eType && DST_MOZILLA != eType && DST_EVOLUTION != eType && DST_KAB != eType && DST_MACAB != eType && DST_OUTLOOK != eType && DST_OUTLOOKEXP != eType;
+ ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
+ aReturn.bEnabled = ::dbaccess::DST_EMBEDDED_HSQLDB != eType && ::dbaccess::DST_MOZILLA != eType && ::dbaccess::DST_EVOLUTION != eType && ::dbaccess::DST_KAB != eType && ::dbaccess::DST_MACAB != eType && ::dbaccess::DST_OUTLOOK != eType && ::dbaccess::DST_OUTLOOKEXP != eType;
}
break;
case SID_DB_APP_DSCONNECTION_TYPE:
aReturn.bEnabled = !isDataSourceReadOnly() && m_xDataSource.is();
if ( aReturn.bEnabled )
{
- DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
- aReturn.bEnabled = DST_EMBEDDED_HSQLDB != eType;
+ ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
+ aReturn.bEnabled = ::dbaccess::DST_EMBEDDED_HSQLDB != eType;
}
break;
case SID_DB_APP_DSADVANCED_SETTINGS:
aReturn.bEnabled = m_xDataSource.is();
if ( aReturn.bEnabled )
{
- DATASOURCE_TYPE eType = m_aTypeCollection.getType( ::comphelper::getString( m_xDataSource->getPropertyValue( PROPERTY_URL ) ) );
+ ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType( ::comphelper::getString( m_xDataSource->getPropertyValue( PROPERTY_URL ) ) );
aReturn.bEnabled = AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( eType );
}
break;
@@ -1023,8 +1023,16 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = m_xDataSource.is();
if ( aReturn.bEnabled )
{
- DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
- ::rtl::OUString sDSTypeName = m_aTypeCollection.getTypeDisplayName(eType);
+ ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
+ ::rtl::OUString sDSTypeName;
+ if ( m_aTypeCollection.isEmbeddedDatabase( eType ) )
+ {
+ sDSTypeName = String( ModuleRes( RID_STR_EMBEDDED_DATABASE ) );
+ }
+ else
+ {
+ sDSTypeName = m_aTypeCollection.getTypeDisplayName(eType);
+ }
aReturn.sTitle = sDSTypeName;
}
break;
@@ -1034,7 +1042,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
{
::rtl::OUString sURL;
m_xDataSource->getPropertyValue(PROPERTY_URL) >>= sURL;
- DATASOURCE_TYPE eType = m_aTypeCollection.getType( sURL );
+ ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType( sURL );
String sDatabaseName;
String sHostName;
@@ -3032,7 +3040,9 @@ Any SAL_CALL OApplicationController::getSelection( ) throw (RuntimeException)
::osl::MutexGuard aGuard(m_aMutex);
Sequence< NamedDatabaseObject > aCurrentSelection;
- getContainer()->describeCurrentSelectionForType( getContainer()->getElementType(), aCurrentSelection );
+ const ElementType eType( getContainer()->getElementType() );
+ if ( eType != E_NONE )
+ getContainer()->describeCurrentSelectionForType( eType, aCurrentSelection );
return makeAny( aCurrentSelection );
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx
index 0d540966a..0fc9c1359 100644
--- a/dbaccess/source/ui/app/AppController.hxx
+++ b/dbaccess/source/ui/app/AppController.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AppController.hxx,v $
- * $Revision: 1.32 $
+ * $Revision: 1.30.20.2 $
*
* This file is part of OpenOffice.org.
*
@@ -132,7 +132,8 @@ namespace dbaui
TContainerVector m_aCurrentContainers; // the containers where we are listener on
TDocuments m_aDocuments;
TFrames m_aSpecialSubFrames; // contains the query, table and relation frame
- ODsnTypeCollection m_aTypeCollection;
+ ::dbaccess::ODsnTypeCollection
+ m_aTypeCollection;
OTableCopyHelper m_aTableCopyHelper;
TransferableClipboardListener*
m_pClipbordNotifier; // notifier for changes in the clipboard
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 0ba170f43..83673dce2 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AppDetailPageHelper.cxx,v $
- * $Revision: 1.33 $
+ * $Revision: 1.33.24.1 $
*
* This file is part of OpenOffice.org.
*
@@ -473,7 +473,7 @@ void OAppDetailPageHelper::describeCurrentSelectionForControl( const Control& _r
void OAppDetailPageHelper::describeCurrentSelectionForType( const ElementType _eType, Sequence< NamedDatabaseObject >& _out_rSelectedObjects )
{
OSL_ENSURE( _eType < E_ELEMENT_TYPE_COUNT, "OAppDetailPageHelper::describeCurrentSelectionForType: invalid type!" );
- DBTreeListBox* pList = m_pLists[ _eType ];
+ DBTreeListBox* pList = ( _eType < E_ELEMENT_TYPE_COUNT ) ? m_pLists[ _eType ] : NULL;
OSL_ENSURE( pList, "OAppDetailPageHelper::describeCurrentSelectionForType: "
"You really should ensure this type has already been viewed before!" );
if ( !pList )
diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src
index e7aa8ef0d..76ef3465a 100644
--- a/dbaccess/source/ui/app/app.src
+++ b/dbaccess/source/ui/app/app.src
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: app.src,v $
- * $Revision: 1.17 $
+ * $Revision: 1.17.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -465,3 +465,8 @@ String STR_SUB_DOCS_WITH_SCRIPTS_DETAIL
"Note that you won't be able to embed macros or scripts into the database document until "
"this migration is done. ";
};
+
+String RID_STR_EMBEDDED_DATABASE
+{
+ Text [ en-US ] = "Embedded database";
+};
diff --git a/dbaccess/source/ui/app/dbu_app.hrc b/dbaccess/source/ui/app/dbu_app.hrc
index 973508a78..aac5ff5f4 100644
--- a/dbaccess/source/ui/app/dbu_app.hrc
+++ b/dbaccess/source/ui/app/dbu_app.hrc
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbu_app.hrc,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -67,11 +67,12 @@
#define RID_STR_TABLES_HELP_TEXT_WIZARD RID_STR_APP_START + 28
#define RID_STR_FORMS_HELP_TEXT_WIZARD RID_STR_APP_START + 29
#define RID_STR_REPORT_HELP_TEXT RID_STR_APP_START + 30
+#define RID_STR_EMBEDDED_DATABASE RID_STR_APP_START + 31
// please adjust checking before insert new strings
-#if RID_STR_REPORT_HELP_TEXT > RID_STR_APP_END
+#if RID_STR_EMBEDDED_DATABASE > RID_STR_APP_END
#error Resource-Id Ueberlauf in #file, #line
#endif
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index bdbc35ddf..89b9abb03 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: genericcontroller.cxx,v $
- * $Revision: 1.94 $
+ * $Revision: 1.94.24.2 $
*
* This file is part of OpenOffice.org.
*
@@ -170,14 +170,76 @@ namespace dbaui
{
//==========================================================================
+//= UserDefinedFeatures
+//==========================================================================
+class UserDefinedFeatures
+{
+public:
+ UserDefinedFeatures( const Reference< XController >& _rxController );
+
+ FeatureState getState( const URL& _rFeatureURL );
+ void execute( const URL& _rFeatureURL, const Sequence< PropertyValue>& _rArgs );
+
+private:
+ ::com::sun::star::uno::WeakReference< XController > m_aController;
+};
+
+//--------------------------------------------------------------------------
+UserDefinedFeatures::UserDefinedFeatures( const Reference< XController >& _rxController )
+ :m_aController( _rxController )
+{
+}
+
+//--------------------------------------------------------------------------
+FeatureState UserDefinedFeatures::getState( const URL& /*_rFeatureURL*/ )
+{
+ // for now, enable all the time
+ // TODO: we should ask the dispatcher. However, this is laborious, since you cannot ask a dispatcher
+ // directly, but need to add a status listener.
+ FeatureState aState;
+ aState.bEnabled = sal_True;
+ return aState;
+}
+
+//--------------------------------------------------------------------------
+void UserDefinedFeatures::execute( const URL& _rFeatureURL, const Sequence< PropertyValue>& _rArgs )
+{
+ try
+ {
+ Reference< XController > xController( (Reference< XController >)m_aController, UNO_SET_THROW );
+ Reference< XDispatchProvider > xDispatchProvider( xController->getFrame(), UNO_QUERY_THROW );
+ Reference< XDispatch > xDispatch( xDispatchProvider->queryDispatch(
+ _rFeatureURL,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ),
+ FrameSearchFlag::AUTO
+ ) );
+
+ if ( xDispatch == xController )
+ {
+ OSL_ENSURE( false, "UserDefinedFeatures::execute: the controller shouldn't be the dispatcher here!" );
+ xDispatch.clear();
+ }
+
+ if ( xDispatch.is() )
+ xDispatch->dispatch( _rFeatureURL, _rArgs );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//==========================================================================
//= OGenericUnoController_Data
//==========================================================================
struct OGenericUnoController_Data
{
::sfx2::UserInputInterception m_aUserInputInterception;
+ UserDefinedFeatures m_aUserDefinedFeatures;
OGenericUnoController_Data( OGenericUnoController& _rController, ::osl::Mutex& _rMutex )
:m_aUserInputInterception( _rController, _rMutex )
+ ,m_aUserDefinedFeatures( _rController.getXController() )
{
}
};
@@ -189,7 +251,6 @@ DBG_NAME(OGenericUnoController)
// -------------------------------------------------------------------------
OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFactory >& _rM)
:OGenericUnoController_Base(m_aMutex)
- ,m_pData( new OGenericUnoController_Data( *this, m_aMutex ) )
#ifdef DBG_UTIL
,m_bDescribingSupportedFeatures( false )
#endif
@@ -203,6 +264,12 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto
,m_bCurrentlyModified(sal_False)
,m_bExternalTitle(sal_False)
{
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ m_pData.reset( new OGenericUnoController_Data( *this, m_aMutex ) );
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+
DBG_CTOR(OGenericUnoController,NULL);
try
@@ -218,7 +285,6 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto
// -----------------------------------------------------------------------------
OGenericUnoController::OGenericUnoController()
:OGenericUnoController_Base(m_aMutex)
- ,m_pData( new OGenericUnoController_Data( *this, m_aMutex ) )
#ifdef DBG_UTIL
,m_bDescribingSupportedFeatures( false )
#endif
@@ -559,7 +625,7 @@ sal_Bool OGenericUnoController::isFeatureSupported( sal_Int32 _nId )
SupportedFeatures::iterator aFeaturePos = ::std::find_if(
m_aSupportedFeatures.begin(),
m_aSupportedFeatures.end(),
- ::std::bind2nd( SupportedFeaturesEqualId(), _nId )
+ ::std::bind2nd( CompareFeatureById(), _nId )
);
return ( m_aSupportedFeatures.end() != aFeaturePos && aFeaturePos->first.getLength());
@@ -580,7 +646,7 @@ void OGenericUnoController::InvalidateFeature_Impl()
#endif
sal_Bool bEmpty = sal_True;
- FeaturePair aNextFeature;
+ FeatureListener aNextFeature;
{
::osl::MutexGuard aGuard( m_aFeatureMutex);
bEmpty = m_aFeaturesToInvalidate.empty();
@@ -599,7 +665,7 @@ void OGenericUnoController::InvalidateFeature_Impl()
SupportedFeatures::iterator aFeaturePos = ::std::find_if(
m_aSupportedFeatures.begin(),
m_aSupportedFeatures.end(),
- ::std::bind2nd( SupportedFeaturesEqualId(), aNextFeature.nId )
+ ::std::bind2nd( CompareFeatureById(), aNextFeature.nId )
);
#if OSL_DEBUG_LEVEL > 0
@@ -631,16 +697,16 @@ void OGenericUnoController::InvalidateFeature_Impl()
// -----------------------------------------------------------------------
void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Reference< XStatusListener >& _xListener, sal_Bool _bForceBroadcast )
{
- FeaturePair aPair;
- aPair.nId = _nId;
- aPair.xListener = _xListener;
- aPair.bForceBroadcast = _bForceBroadcast;
+ FeatureListener aListener;
+ aListener.nId = _nId;
+ aListener.xListener = _xListener;
+ aListener.bForceBroadcast = _bForceBroadcast;
sal_Bool bWasEmpty;
{
- ::osl::MutexGuard aGuard( m_aFeatureMutex);
+ ::osl::MutexGuard aGuard( m_aFeatureMutex );
bWasEmpty = m_aFeaturesToInvalidate.empty();
- m_aFeaturesToInvalidate.push_back(aPair);
+ m_aFeaturesToInvalidate.push_back( aListener );
}
if ( bWasEmpty )
@@ -690,8 +756,10 @@ Reference< XDispatch > OGenericUnoController::queryDispatch(const URL& aURL, con
fillSupportedFeatures();
// URL's we can handle ourself?
- if ( aURL.Complete.equals( getConfirmDeletionURL() )
- || ( m_aSupportedFeatures.find( aURL.Complete ) != m_aSupportedFeatures.end() )
+ if ( aURL.Complete.equals( getConfirmDeletionURL() )
+ || ( ( m_aSupportedFeatures.find( aURL.Complete ) != m_aSupportedFeatures.end() )
+ && !isUserDefinedFeature( aURL.Complete )
+ )
)
{
xReturn = this;
@@ -825,15 +893,27 @@ void OGenericUnoController::removeStatusListener(const Reference< XStatusListene
}
// now remove the listener from the deque
- ::osl::MutexGuard aGuard( m_aFeatureMutex);
+ ::osl::MutexGuard aGuard( m_aFeatureMutex );
m_aFeaturesToInvalidate.erase(
::std::remove_if( m_aFeaturesToInvalidate.begin(),
m_aFeaturesToInvalidate.end(),
- ::std::bind2nd(FeaturePairFunctor(),aListener))
+ ::std::bind2nd(FindFeatureListener(),aListener))
,m_aFeaturesToInvalidate.end());
}
-
-
+// -----------------------------------------------------------------------------
+void OGenericUnoController::releaseNumberForComponent()
+{
+ try
+ {
+ Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY );
+ if ( xUntitledProvider.is() )
+ xUntitledProvider->releaseNumberForComponent(static_cast<XWeak*>(this));
+ }
+ catch( const Exception& )
+ {
+ // NII
+ }
+}
// -----------------------------------------------------------------------
void OGenericUnoController::disposing()
{
@@ -856,16 +936,7 @@ void OGenericUnoController::disposing()
m_aFeaturesToInvalidate.clear();
}
- try
- {
- Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY );
- if ( xUntitledProvider.is() )
- xUntitledProvider->releaseNumberForComponent(static_cast<XWeak*>(this));
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
+ releaseNumberForComponent();
// check out from all the objects we are listening
// the frame
@@ -932,24 +1003,20 @@ void OGenericUnoController::describeSupportedFeatures()
}
//------------------------------------------------------------------------------
-FeatureState OGenericUnoController::GetState(sal_uInt16 nId) const
+FeatureState OGenericUnoController::GetState( sal_uInt16 _nId ) const
{
FeatureState aReturn;
// (disabled automatically)
- try
- {
- switch (nId)
- {
- case ID_BROWSER_UNDO:
- case ID_BROWSER_SAVEDOC:
- aReturn.bEnabled = sal_True;
- break;
- }
- }
- catch( const Exception& )
+ switch ( _nId )
{
- DBG_UNHANDLED_EXCEPTION();
+ case ID_BROWSER_UNDO:
+ case ID_BROWSER_SAVEDOC:
+ aReturn.bEnabled = sal_True;
+ break;
+ default:
+ aReturn = m_pData->m_aUserDefinedFeatures.getState( getURLForId( _nId ) );
+ break;
}
return aReturn;
@@ -960,27 +1027,10 @@ void OGenericUnoController::Execute( sal_uInt16 _nId, const Sequence< PropertyVa
{
OSL_ENSURE( isUserDefinedFeature( _nId ),
"OGenericUnoController::Execute: responsible for user defined features only!" );
- URL aFeatureURL( getURLForId( _nId ) );
-
- // user defined features can be handled by dispatch interceptors only. So, we need to do
- // a queryDispatch, and dispatch the URL
- try
- {
- Reference< XDispatch > xDispatch( queryDispatch(
- aFeatureURL,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ),
- FrameSearchFlag::AUTO
- ) );
- if ( xDispatch == *this )
- xDispatch.clear();
- if ( xDispatch.is() )
- xDispatch->dispatch( aFeatureURL, _rArgs );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
+ // user defined features can be handled by dispatch interceptors resp. protocol handlers only.
+ // So, we need to do a queryDispatch, and dispatch the URL
+ m_pData->m_aUserDefinedFeatures.execute( getURLForId( _nId ), _rArgs );
}
//------------------------------------------------------------------------------
@@ -992,7 +1042,7 @@ URL OGenericUnoController::getURLForId(sal_Int32 _nId) const
SupportedFeatures::const_iterator aIter = ::std::find_if(
m_aSupportedFeatures.begin(),
m_aSupportedFeatures.end(),
- ::std::bind2nd( SupportedFeaturesEqualId(), _nId )
+ ::std::bind2nd( CompareFeatureById(), _nId )
);
if ( m_aSupportedFeatures.end() != aIter && aIter->first.getLength() )
@@ -1005,12 +1055,22 @@ URL OGenericUnoController::getURLForId(sal_Int32 _nId) const
}
//-------------------------------------------------------------------------
-bool OGenericUnoController::isUserDefinedFeature( const sal_uInt16 _nFeatureId )
+bool OGenericUnoController::isUserDefinedFeature( const sal_uInt16 _nFeatureId ) const
{
return ( _nFeatureId >= FIRST_USER_DEFINED_FEATURE ) && ( _nFeatureId < LAST_USER_DEFINED_FEATURE );
}
//-------------------------------------------------------------------------
+bool OGenericUnoController::isUserDefinedFeature( const ::rtl::OUString& _rFeatureURL ) const
+{
+ SupportedFeatures::const_iterator pos = m_aSupportedFeatures.find( _rFeatureURL );
+ OSL_PRECOND( pos != m_aSupportedFeatures.end(),
+ "OGenericUnoController::isUserDefinedFeature: this is no supported feature at all!" );
+
+ return ( pos != m_aSupportedFeatures.end() ) ? isUserDefinedFeature( pos->second.nFeatureId ) : false;
+}
+
+//-------------------------------------------------------------------------
sal_Bool SAL_CALL OGenericUnoController::supportsService(const ::rtl::OUString& ServiceName) throw(RuntimeException)
{
Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 7d8cb8824..424587a26 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: unodatbr.cxx,v $
- * $Revision: 1.203 $
+ * $Revision: 1.203.8.2 $
*
* This file is part of OpenOffice.org.
*
@@ -846,6 +846,8 @@ sal_Bool SbaTableQueryBrowser::suspend(sal_Bool bSuspend) throw( RuntimeExceptio
throw DisposedException( ::rtl::OUString(), *this );
bRet = SbaXDataBrowserController::suspend(bSuspend);
+ if ( bRet && getView() )
+ getView()->Hide();
m_bInSuspend = sal_False;
}
@@ -2291,6 +2293,9 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::rtl::OUString& _rDataSourceNam
}
else
m_pTreeView->getListBox().Select(pCommand);
+
+ m_pTreeView->getListBox().MakeVisible(pCommand);
+ m_pTreeView->getListBox().SetCursor(pCommand);
}
else if (!pCommandType)
{
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index a2b68a11e..9fa415e0e 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FieldDescControl.cxx,v $
- * $Revision: 1.49 $
+ * $Revision: 1.49.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -155,12 +155,12 @@ using namespace ::com::sun::star::util;
// fuer die Controls auf der OFieldDescGenPage
#define CONTROL_SPACING_X 18 // 6
-#define CONTROL_SPACING_Y 5
-#define CONTROL_HEIGHT 20
+#define CONTROL_SPACING_Y 4
+#define CONTROL_HEIGHT 10
#define CONTROL_WIDTH_1 160 // 100
#define CONTROL_WIDTH_2 100 // 60
#define CONTROL_WIDTH_3 250
-#define CONTROL_WIDTH_4 (CONTROL_WIDTH_3 - CONTROL_HEIGHT - 5)
+#define CONTROL_WIDTH_4 (CONTROL_WIDTH_3 - 20 - 5)
#define SBA_DEF_RANGEFORMAT (100 + 143) // RangeItem
#define SBA_DEF_FMTVALUE (100 + 144) // SfxULONG, Format
@@ -451,10 +451,12 @@ void OFieldDescControl::CheckScrollBars()
sal_uInt16 nActive = CountActiveAggregates();
// welches ist das letzte, was ganz drauf passt ?
sal_uInt16 nLastVisible;
+ const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height();
+ const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height();
if (bNeedHScrollBar)
- nLastVisible = static_cast<sal_uInt16>((szOverallSize.Height() - CONTROL_SPACING_Y - nHScrollHeight) / (CONTROL_SPACING_Y + CONTROL_HEIGHT));
+ nLastVisible = static_cast<sal_uInt16>((szOverallSize.Height() - nControl_Spacing_y - nHScrollHeight) / (nControl_Spacing_y + nControlHeight));
else
- nLastVisible = static_cast<sal_uInt16>((szOverallSize.Height() - CONTROL_SPACING_Y) / (CONTROL_SPACING_Y + CONTROL_HEIGHT));
+ nLastVisible = static_cast<sal_uInt16>((szOverallSize.Height() - nControl_Spacing_y) / (nControl_Spacing_y + nControlHeight));
bNeedVScrollBar = nActive>nLastVisible;
if (bNeedVScrollBar)
@@ -467,7 +469,7 @@ void OFieldDescControl::CheckScrollBars()
// durch die vertikale brauche ich jetzt ploetzlich doch eine horizontale
bNeedHScrollBar = sal_True;
// nLastVisible anpassen
- nLastVisible = static_cast<sal_uInt16>((szOverallSize.Height() - CONTROL_SPACING_Y - nHScrollHeight) / (CONTROL_SPACING_Y + CONTROL_HEIGHT));
+ nLastVisible = static_cast<sal_uInt16>((szOverallSize.Height() - nControl_Spacing_y - nHScrollHeight) / (nControl_Spacing_y + nControlHeight));
// bNeedVScrollBar aendert sich nicht : es ist schon auf sal_True und nLastVisible wird hoechstens kleiner
}
}
@@ -534,7 +536,9 @@ void OFieldDescControl::ScrollAllAggregates()
if (m_nOldVThumb != m_pVertScroll->GetThumbPos())
{
- nDeltaY = (m_nOldVThumb - m_pVertScroll->GetThumbPos()) * (CONTROL_SPACING_Y + CONTROL_HEIGHT);
+ const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height();
+ const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height();
+ nDeltaY = (m_nOldVThumb - m_pVertScroll->GetThumbPos()) * (nControl_Spacing_y + nControlHeight);
m_nOldVThumb = m_pVertScroll->GetThumbPos();
}
@@ -994,9 +998,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
pRequired->SelectEntryPos(1);
pRequired->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl));
- // SetPosSize( (Control**)&pRequiredText, m_nPos, 0 );
- // SetPosSize( (Control**)&pRequired, m_nPos, 2 );
-
pRequired->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
pRequired->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1020,9 +1021,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
pAutoIncrement->SelectEntryPos(0);
pAutoIncrement->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl));
- // SetPosSize( (Control**)&pAutoIncrementText, m_nPos, 0 );
- // SetPosSize( (Control**)&pAutoIncrement, m_nPos, 2 );
-
pAutoIncrement->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
pAutoIncrement->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1044,8 +1042,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
pTextLen->SetStrictFormat(TRUE);
pTextLen->SetHelpId(HID_TAB_ENT_TEXT_LEN);
- // SetPosSize( (Control**)&pTextLenText, m_nPos, 0 );
- // SetPosSize( (Control**)&pTextLen, m_nPos, 1 );
pTextLen->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
pTextLen->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1072,9 +1068,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
m_pType->SelectEntryPos(0);
m_pType->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl));
- // SetPosSize( (Control**)&m_pTypeText, m_nPos, 0 );
- // SetPosSize( (Control**)&m_pType, m_nPos, 2 );
-
m_pType->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
m_pType->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1101,9 +1094,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
m_pColumnName->setCheck( isSQL92CheckEnabled(getConnection()) );
}
- // SetPosSize( (Control**)&m_pColumnNameText, m_nPos, 0 );
- // SetPosSize( (Control**)&m_pColumnName, m_nPos, 1 );
-
m_pColumnName->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
m_pColumnName->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1129,9 +1119,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
pNumType->SelectEntryPos(2);
pNumType->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl));
- // SetPosSize( (Control**)&pNumTypeText, m_nPos, 0 );
- // SetPosSize( (Control**)&pNumType, m_nPos, 1 );
-
pNumType->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
pNumType->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1153,8 +1140,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
pLength->SetStrictFormat(TRUE);
pLength->SetHelpId(HID_TAB_ENT_LEN);
- // SetPosSize( (Control**)&pLengthText, m_nPos, 0 );
- // SetPosSize( (Control**)&pLength, m_nPos, 1 );
pLength->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
pLength->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1177,9 +1162,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
pScale->SetHelpId(HID_TAB_ENT_SCALE);
- // SetPosSize( (Control**)&pScaleText, m_nPos, 0 );
- // SetPosSize( (Control**)&pScale, m_nPos, 1 );
-
pScale->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
pScale->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1201,7 +1183,8 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
pFormat = new PushButton( this, ModuleRes(PB_FORMAT) );
pFormat->SetHelpId(HID_TAB_ENT_FORMAT);
- pFormat->SetSizePixel(Size(CONTROL_HEIGHT, CONTROL_HEIGHT));
+ const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height();
+ pFormat->SetSizePixel(Size(nControlHeight, nControlHeight));
pFormat->SetClickHdl( LINK( this, OFieldDescControl, FormatClickHdl ) );
pFormatSample->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
@@ -1229,8 +1212,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
pBoolDefault->InsertEntry(aYes);
pBoolDefault->InsertEntry(aNo);
pBoolDefault->SetHelpId(HID_TAB_ENT_BOOL_DEFAULT);
- // SetPosSize( (Control**)&pBoolDefaultText, m_nPos, 0 );
- // SetPosSize( (Control**)&pBoolDefault, m_nPos, 3 );
pBoolDefault->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot));
pBoolDefault->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost));
@@ -1406,47 +1387,48 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n
//////////////////////////////////////////////////////////////////////
// Groesse ermitteln
+ const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height();
Size aSize;
switch( nCol )
{
case 0:
aSize.Width() = CONTROL_WIDTH_1;
- aSize.Height() = CONTROL_HEIGHT;
+ aSize.Height() = nControlHeight;
break;
case 1:
if ( isRightAligned() )
aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width();
else
aSize.Width() = CONTROL_WIDTH_2;
- aSize.Height() = CONTROL_HEIGHT;
+ aSize.Height() = nControlHeight;
break;
case 2:
if ( isRightAligned() )
aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width();
else
aSize.Width() = CONTROL_WIDTH_2;
- aSize.Height() = long(1.5*CONTROL_HEIGHT);
+ aSize.Height() = long(1.5*nControlHeight);
break;
case 3:
if ( isRightAligned() )
aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width();
else
aSize.Width() = CONTROL_WIDTH_3;
- aSize.Height() = CONTROL_HEIGHT;
+ aSize.Height() = nControlHeight;
break;
case 4:
if ( isRightAligned() )
aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width();
else
aSize.Width() = CONTROL_WIDTH_4;
- aSize.Height() = CONTROL_HEIGHT;
+ aSize.Height() = nControlHeight;
break;
default:
if ( isRightAligned() )
aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width();
else
aSize.Width() = CONTROL_WIDTH_1;
- aSize.Height() = CONTROL_HEIGHT;
+ aSize.Height() = nControlHeight;
}
@@ -1475,12 +1457,18 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n
aPosition.X() = 0;
}
- aPosition.Y() += ((nRow+1)*CONTROL_SPACING_Y) +
- (nRow*CONTROL_HEIGHT);
+ (*ppControl)->SetSizePixel( aSize );
+ aSize = (*ppControl)->GetSizePixel( );
+
+ const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height();
+ aPosition.Y() += ((nRow+1)*nControl_Spacing_y) +
+ (nRow*nControlHeight);
//////////////////////////////////////////////////////////////////////
// Control anzeigen
(*ppControl)->SetPosSizePixel( aPosition, aSize );
+ aSize = (*ppControl)->GetSizePixel();
+
(*ppControl)->Show();
}
//------------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx
index a51bb191c..38e11309c 100644
--- a/dbaccess/source/ui/control/curledit.cxx
+++ b/dbaccess/source/ui/control/curledit.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: curledit.cxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.52.1 $
*
* This file is part of OpenOffice.org.
*
@@ -111,9 +111,9 @@ void OConnectionURLEdit::SetText(const String& _rStr, const Selection& /*_rNewSe
if (!bIsEmpty)
{
// determine the type of the new URL described by the new text
- DATASOURCE_TYPE eType = m_aTypeCollection.getType(_rStr);
+ ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(_rStr);
// and the prefix belonging to this type
- if (DST_UNKNOWN != eType)
+ if ( ::dbaccess::DST_UNKNOWN != eType)
sPrefix = m_aTypeCollection.getDatasourcePrefix(eType);
else {
DBG_ERROR("OConnectionURLEdit::SetText : the new text is no valid connection URL!");
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index 10bc11d63..ba5f0a025 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbtreelistbox.cxx,v $
- * $Revision: 1.20 $
+ * $Revision: 1.20.26.1 $
*
* This file is part of OpenOffice.org.
*
@@ -562,6 +562,10 @@ namespace
USHORT nCount = _rMenu.GetItemCount();
for ( USHORT pos = 0; pos < nCount; ++pos )
{
+ // do not adjust separators
+ if ( _rMenu.GetItemType( pos ) == MENUITEM_SEPARATOR )
+ continue;
+
USHORT nId = _rMenu.GetItemId(pos);
String aCommand = _rMenu.GetItemCommand( nId );
PopupMenu* pPopup = _rMenu.GetPopupMenu( nId );
@@ -572,7 +576,16 @@ namespace
}
USHORT nCommandId = _rCommandController.registerCommandURL( aCommand );
- _rMenu.InsertItem( nCommandId, _rMenu.GetItemText( nId ), _rMenu.GetItemBits( nId ), pos );
+ _rMenu.InsertItem( nCommandId, _rMenu.GetItemText( nId ), _rMenu.GetItemImage( nId ),
+ _rMenu.GetItemBits( nId ), pos );
+
+ // more things to preserve:
+ // - the help command
+ ::rtl::OUString sHelpURL = _rMenu.GetHelpCommand( nId );
+ if ( sHelpURL.getLength() )
+ _rMenu.SetHelpCommand( nCommandId, sHelpURL );
+
+ // remove the "old" item
_rMenu.RemoveItem( pos+1 );
}
}
diff --git a/dbaccess/source/ui/dlg/AdabasStatDlg.cxx b/dbaccess/source/ui/dlg/AdabasStatDlg.cxx
index ccf569a5b..225ef4135 100644
--- a/dbaccess/source/ui/dlg/AdabasStatDlg.cxx
+++ b/dbaccess/source/ui/dlg/AdabasStatDlg.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AdabasStatDlg.cxx,v $
- * $Revision: 1.15 $
+ * $Revision: 1.15.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -103,11 +103,11 @@ DBG_NAME(OAdabasStatPageDlg)
delete pExampleSet;
pExampleSet = new SfxItemSet(*GetInputSetImpl());
- DATASOURCE_TYPE eType = m_pImpl->getDatasourceType(*GetInputSetImpl());
+ ::dbaccess::DATASOURCE_TYPE eType = m_pImpl->getDatasourceType(*GetInputSetImpl());
switch ( eType )
{
- case DST_ADABAS:
+ case ::dbaccess::DST_ADABAS:
AddTabPage(TAB_PAG_ADABAS_SETTINGS, String(ModuleRes(STR_PAGETITLE_ADABAS_STATISTIC)), ODriversSettings::CreateAdabas,0, sal_False, 1);
break;
default:
@@ -179,7 +179,7 @@ DBG_NAME(OAdabasStatPageDlg)
return m_pImpl->getDriver();
}
// -----------------------------------------------------------------------------
- DATASOURCE_TYPE OAdabasStatPageDlg::getDatasourceType(const SfxItemSet& _rSet) const
+ ::dbaccess::DATASOURCE_TYPE OAdabasStatPageDlg::getDatasourceType(const SfxItemSet& _rSet) const
{
return m_pImpl->getDatasourceType(_rSet);
}
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index cca0105ff..031c3823b 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: CollectionView.cxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.11.50.1 $
*
* This file is part of OpenOffice.org.
*
@@ -366,10 +366,17 @@ void OCollectionView::initCurrentPath()
{
if ( m_xContent.is() )
{
- ::rtl::OUString sCID = m_xContent->getIdentifier()->getContentIdentifier();
- const static ::rtl::OUString sFormsCID(RTL_CONSTASCII_USTRINGPARAM("private:forms"));
- m_bCreateForm = sFormsCID.compareTo(sCID) == 0;
- m_aFTCurrentPath.SetText(sCID.copy(8));
+ const ::rtl::OUString sCID = m_xContent->getIdentifier()->getContentIdentifier();
+ const static ::rtl::OUString s_sFormsCID(RTL_CONSTASCII_USTRINGPARAM("private:forms"));
+ const static ::rtl::OUString s_sReportsCID(RTL_CONSTASCII_USTRINGPARAM("private:reports"));
+ m_bCreateForm = s_sFormsCID.compareTo(sCID) == 0;
+ ::rtl::OUString sPath(RTL_CONSTASCII_USTRINGPARAM("/"));
+ if ( m_bCreateForm && sCID.getLength() != s_sFormsCID.getLength())
+ sPath = sCID.copy(s_sFormsCID.getLength());
+ else if ( !m_bCreateForm && sCID.getLength() != s_sReportsCID.getLength() )
+ sPath = sCID.copy(s_sReportsCID.getLength());
+
+ m_aFTCurrentPath.SetText(sPath);
Reference<XChild> xChild(m_xContent,UNO_QUERY);
bEnable = xChild.is() && Reference<XNameAccess>(xChild->getParent(),UNO_QUERY).is();
}
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index f1baed90d..266b66262 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ConnectionHelper.cxx,v $
- * $Revision: 1.19 $
+ * $Revision: 1.19.48.1 $
*
* This file is part of OpenOffice.org.
*
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
+#include "dsnItem.hxx"
#ifndef DBAUI_CONNECTIONHELPER_HXX
#include "ConnectionHelper.hxx"
#endif
@@ -224,7 +225,7 @@ DBG_NAME(OConnectionHelper)
BOOL bEnableBrowseButton = m_pCollection->supportsBrowsing(m_eType);
m_aFT_Connection.Show();
m_aET_Connection.Show();
- m_aET_Connection.ShowPrefix(DST_JDBC == m_eType );
+ m_aET_Connection.ShowPrefix( ::dbaccess::DST_JDBC == m_eType );
m_aPB_Connection.Show(sal_True);
LocalResourceAccess aLocRes( PAGE_CONNECTION, RSC_TABPAGE );
@@ -255,7 +256,7 @@ DBG_NAME(OConnectionHelper)
switch ( m_eType )
{
- case DST_CALC:
+ case ::dbaccess::DST_CALC:
m_pAdminDialog->enableConfirmSettings( getURLNoPrefix().Len() > 0 );
break;
default:
@@ -269,8 +270,8 @@ DBG_NAME(OConnectionHelper)
OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
switch ( m_eType )
{
- case DST_DBASE:
- case DST_FLAT:
+ case ::dbaccess::DST_DBASE:
+ case ::dbaccess::DST_FLAT:
{
try
{
@@ -322,7 +323,7 @@ DBG_NAME(OConnectionHelper)
}
}
break;
- case DST_CALC:
+ case ::dbaccess::DST_CALC:
{
::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL | WB_OPEN
,SvtModuleOptions().GetFactoryEmptyDocumentURL(SvtModuleOptions::E_CALC)
@@ -330,7 +331,7 @@ DBG_NAME(OConnectionHelper)
askForFileName(aFileDlg);
}
break;
- case DST_MSACCESS:
+ case ::dbaccess::DST_MSACCESS:
{
::rtl::OUString sExt(RTL_CONSTASCII_USTRINGPARAM("*.mdb"));
String sFilterName(ModuleRes (STR_MSACCESS_FILTERNAME));
@@ -340,7 +341,7 @@ DBG_NAME(OConnectionHelper)
askForFileName(aFileDlg);
}
break;
- case DST_MSACCESS_2007:
+ case ::dbaccess::DST_MSACCESS_2007:
{
::rtl::OUString sAccdb(RTL_CONSTASCII_USTRINGPARAM("*.accdb"));
String sFilterName2(ModuleRes (STR_MSACCESS_2007_FILTERNAME));
@@ -350,7 +351,7 @@ DBG_NAME(OConnectionHelper)
askForFileName(aFileDlg);
}
break;
- case DST_ADABAS:
+ case ::dbaccess::DST_ADABAS:
{
// collect all names from the config dir
// and all dir's of the DBWORK/wrk or DBROOT/wrk dir
@@ -417,7 +418,7 @@ DBG_NAME(OConnectionHelper)
if (RET_OK == aSelector.Execute())
{
setURLNoPrefix(aSelector.GetSelected());
- // checkCreateDatabase(DST_ADABAS);
+ // checkCreateDatabase( ::dbaccess::DST_ADABAS);
SetRoadmapStateValue(sal_True);
callModifiedHdl();
}
@@ -431,8 +432,8 @@ DBG_NAME(OConnectionHelper)
}
}
break;
- case DST_MYSQL_ODBC:
- case DST_ODBC:
+ case ::dbaccess::DST_MYSQL_ODBC:
+ case ::dbaccess::DST_ODBC:
{
// collect all ODBC data source names
::rtl::OUString sCurrDatasource=getURLNoPrefix();
@@ -448,7 +449,7 @@ DBG_NAME(OConnectionHelper)
}
break;
#ifdef _ADO_DATALINK_BROWSE_
- case DST_ADO:
+ case ::dbaccess::DST_ADO:
{
::rtl::OUString sOldDataSource=getURLNoPrefix();
::rtl::OUString sNewDataSource;
@@ -465,11 +466,11 @@ DBG_NAME(OConnectionHelper)
}
break;
#endif
- case DST_MOZILLA:
- case DST_THUNDERBIRD:
+ case ::dbaccess::DST_MOZILLA:
+ case ::dbaccess::DST_THUNDERBIRD:
{
MozillaProductType profileType = MozillaProductType_Mozilla;
- if (m_eType == DST_THUNDERBIRD)
+ if (m_eType == ::dbaccess::DST_THUNDERBIRD)
profileType = MozillaProductType_Thunderbird;
Reference<XMultiServiceFactory> xFactory = ::comphelper::getProcessServiceFactory();
@@ -811,11 +812,11 @@ DBG_NAME(OConnectionHelper)
//-------------------------------------------------------------------------
long OConnectionHelper::PreNotify( NotifyEvent& _rNEvt )
{
- if ( (DST_DBASE == m_eType)
- || (DST_FLAT == m_eType)
- || (DST_MSACCESS == m_eType)
- || (DST_MSACCESS_2007 == m_eType)
- || (DST_CALC == m_eType) )
+ if ( ( ::dbaccess::DST_DBASE == m_eType)
+ || ( ::dbaccess::DST_FLAT == m_eType)
+ || ( ::dbaccess::DST_MSACCESS == m_eType)
+ || ( ::dbaccess::DST_MSACCESS_2007 == m_eType)
+ || ( ::dbaccess::DST_CALC == m_eType) )
switch (_rNEvt.GetType())
{
case EVENT_GETFOCUS:
@@ -932,11 +933,11 @@ DBG_NAME(OConnectionHelper)
String sOldPath;
sOldPath = m_aET_Connection.GetSavedValueNoPrefix();
sURL = m_aET_Connection.GetTextNoPrefix();
- if ( (DST_DBASE == m_eType)
- || (DST_FLAT == m_eType)
- || (DST_MSACCESS == m_eType)
- || (DST_MSACCESS_2007 == m_eType)
- || (DST_CALC == m_eType) )
+ if ( ( ::dbaccess::DST_DBASE == m_eType)
+ || ( ::dbaccess::DST_FLAT == m_eType)
+ || ( ::dbaccess::DST_MSACCESS == m_eType)
+ || ( ::dbaccess::DST_MSACCESS_2007 == m_eType)
+ || ( ::dbaccess::DST_CALC == m_eType) )
{
if ((sURL != sOldPath) && (0 != sURL.Len()))
{ // the text changed since entering the control
@@ -945,7 +946,7 @@ DBG_NAME(OConnectionHelper)
OFileNotation aTransformer(sURL);
sURL = aTransformer.get(OFileNotation::N_URL);
- if ( (DST_CALC == m_eType) || (DST_MSACCESS == m_eType) || (DST_MSACCESS_2007 == m_eType) )
+ if ( ( ::dbaccess::DST_CALC == m_eType) || ( ::dbaccess::DST_MSACCESS == m_eType) || ( ::dbaccess::DST_MSACCESS_2007 == m_eType) )
{ // #106016# --------------------------
if( pathExists(sURL, sal_True) == PATH_NOT_EXIST )
{
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
index 9e4a44cd9..470d849b3 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ConnectionHelper.hxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.66.1 $
*
* This file is part of OpenOffice.org.
*
@@ -77,13 +77,14 @@ namespace dbaui
FixedText m_aFT_Connection;
OConnectionURLEdit m_aET_Connection;
PushButton m_aPB_Connection;
- DATASOURCE_TYPE m_eType; // the type can't be changed in this class, so we hold it as member.
+ ::dbaccess::DATASOURCE_TYPE
+ m_eType; // the type can't be changed in this class, so we hold it as member.
public:
// setting/retrieving the current connection URL
// necessary because for some types, the URL must be decoded for display purposes
- ODsnTypeCollection* m_pCollection; /// the DSN type collection instance
+ ::dbaccess::ODsnTypeCollection* m_pCollection; /// the DSN type collection instance
virtual long PreNotify( NotifyEvent& _rNEvt );
// <method>OGenericAdministrationPage::fillControls</method>
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index 903e0014d..b69f6b979 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ConnectionPage.cxx,v $
- * $Revision: 1.25 $
+ * $Revision: 1.25.26.1 $
*
* This file is part of OpenOffice.org.
*
@@ -155,6 +155,7 @@
#ifndef _SFX_DOCFILT_HACK_HXX
#include <sfx2/docfilt.hxx>
#endif
+#include "dsnItem.hxx"
#if defined(WIN) || defined(WNT)
#define _ADO_DATALINK_BROWSE_
#endif
@@ -248,61 +249,61 @@ namespace dbaui
LocalResourceAccess aLocRes( PAGE_CONNECTION, RSC_TABPAGE );
switch( m_eType )
{
- case DST_DBASE:
+ case ::dbaccess::DST_DBASE:
m_aFT_Connection.SetText(String(ModuleRes(STR_DBASE_PATH_OR_FILE)));
m_aET_Connection.SetHelpId(HID_DSADMIN_DBASE_PATH);
break;
- case DST_FLAT:
+ case ::dbaccess::DST_FLAT:
m_aFT_Connection.SetText(String(ModuleRes(STR_FLAT_PATH_OR_FILE)));
m_aET_Connection.SetHelpId(HID_DSADMIN_FLAT_PATH);
break;
- case DST_CALC:
+ case ::dbaccess::DST_CALC:
m_aFT_Connection.SetText(String(ModuleRes(STR_CALC_PATH_OR_FILE)));
m_aET_Connection.SetHelpId(HID_DSADMIN_CALC_PATH);
break;
- case DST_ADABAS:
+ case ::dbaccess::DST_ADABAS:
m_aFT_Connection.SetText(String(ModuleRes(STR_ADABAS_DATABASE_NAME)));
m_aET_Connection.SetHelpId(HID_DSADMIN_ADABAS_DATABASE);
break;
- case DST_ADO:
+ case ::dbaccess::DST_ADO:
m_aFT_Connection.SetText(String(ModuleRes(STR_COMMONURL)));
break;
- case DST_MSACCESS:
- case DST_MSACCESS_2007:
+ case ::dbaccess::DST_MSACCESS:
+ case ::dbaccess::DST_MSACCESS_2007:
m_aFT_Connection.SetText(String(ModuleRes(STR_MSACCESS_MDB_FILE)));
m_aET_Connection.SetHelpId(HID_DSADMIN_MSACCESS_MDB_FILE);
break;
- case DST_MYSQL_NATIVE:
- case DST_MYSQL_JDBC:
+ case ::dbaccess::DST_MYSQL_NATIVE:
+ case ::dbaccess::DST_MYSQL_JDBC:
m_aFT_Connection.SetText(String(ModuleRes(STR_MYSQL_DATABASE_NAME)));
m_aET_Connection.SetHelpId(HID_DSADMIN_MYSQL_DATABASE);
break;
- case DST_ORACLE_JDBC:
+ case ::dbaccess::DST_ORACLE_JDBC:
m_aFT_Connection.SetText(String(ModuleRes(STR_ORACLE_DATABASE_NAME)));
m_aET_Connection.SetHelpId(HID_DSADMIN_ORACLE_DATABASE);
break;
- case DST_MYSQL_ODBC:
- case DST_ODBC:
+ case ::dbaccess::DST_MYSQL_ODBC:
+ case ::dbaccess::DST_ODBC:
m_aFT_Connection.SetText(String(ModuleRes(STR_NAME_OF_ODBC_DATASOURCE)));
- m_aET_Connection.SetHelpId( m_eType == DST_MYSQL_ODBC ? HID_DSADMIN_MYSQL_ODBC_DATASOURCE : HID_DSADMIN_ODBC_DATASOURCE);
+ m_aET_Connection.SetHelpId( m_eType == ::dbaccess::DST_MYSQL_ODBC ? HID_DSADMIN_MYSQL_ODBC_DATASOURCE : HID_DSADMIN_ODBC_DATASOURCE);
break;
- case DST_LDAP:
+ case ::dbaccess::DST_LDAP:
m_aFT_Connection.SetText(String(ModuleRes(STR_HOSTNAME)));
m_aET_Connection.SetHelpId( HID_DSADMIN_LDAP_HOSTNAME );
break;
- case DST_MOZILLA:
+ case ::dbaccess::DST_MOZILLA:
m_aFT_Connection.SetText(String(ModuleRes(STR_MOZILLA_PROFILE_NAME)));
m_aET_Connection.SetHelpId( HID_DSADMIN_MOZILLA_PROFILE_NAME );
break;
- case DST_THUNDERBIRD:
+ case ::dbaccess::DST_THUNDERBIRD:
m_aFT_Connection.SetText(String(ModuleRes(STR_THUNDERBIRD_PROFILE_NAME)));
m_aET_Connection.SetHelpId( HID_DSADMIN_THUNDERBIRD_PROFILE_NAME );
break;
- case DST_OUTLOOK:
- case DST_OUTLOOKEXP:
- case DST_EVOLUTION:
- case DST_KAB:
- case DST_MACAB:
+ case ::dbaccess::DST_OUTLOOK:
+ case ::dbaccess::DST_OUTLOOKEXP:
+ case ::dbaccess::DST_EVOLUTION:
+ case ::dbaccess::DST_KAB:
+ case ::dbaccess::DST_MACAB:
m_aFT_Connection.SetText(String(ModuleRes(STR_NO_ADDITIONAL_SETTINGS)));
{
String sText = m_aFT_Connection.GetText();
@@ -313,7 +314,7 @@ namespace dbaui
}
m_aET_Connection.Hide();
break;
- case DST_JDBC:
+ case ::dbaccess::DST_JDBC:
m_aFT_Connection.SetText(String(ModuleRes(STR_COMMONURL)));
// run through
default:
@@ -350,7 +351,7 @@ namespace dbaui
String sUrl = pUrlItem->GetValue();
setURL( sUrl );
- BOOL bEnableJDBC = m_eType == DST_JDBC;
+ BOOL bEnableJDBC = m_eType == ::dbaccess::DST_JDBC;
m_aJavaDriver.SetText(pJdbcDrvItem->GetValue());
m_aJavaDriverLabel.Show(bEnableJDBC);
@@ -404,7 +405,7 @@ namespace dbaui
fillBool(_rSet,&m_aPasswordRequired,DSID_PASSWORDREQUIRED,bChangedSomething);
- if ( m_eType == DST_JDBC )
+ if ( m_eType == ::dbaccess::DST_JDBC )
{
fillString(_rSet,&m_aJavaDriver, DSID_JDBCDRIVERCLASS, bChangedSomething);
}
@@ -440,7 +441,7 @@ namespace dbaui
{
OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
BOOL bEnableTestConnection = !m_aET_Connection.IsVisible() || (m_aET_Connection.GetTextNoPrefix().Len() != 0);
- if ( m_eType == DST_JDBC )
+ if ( m_eType == ::dbaccess::DST_JDBC )
bEnableTestConnection = bEnableTestConnection && (m_aJavaDriver.GetText().Len() != 0);
m_aTestConnection.Enable(bEnableTestConnection);
return true;
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx
index a428e5de0..d2c060a79 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ConnectionPage.hxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -58,7 +58,8 @@ namespace dbaui
*/
class OConnectionTabPage : public OConnectionHelper
{
- ODsnTypeCollection* m_pCollection; /// the DSN type collection instance
+ ::dbaccess::ODsnTypeCollection*
+ m_pCollection; /// the DSN type collection instance
sal_Bool m_bUserGrabFocus : 1;
protected:
// connection
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
index cd0940dc5..efd4f8865 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ConnectionPageSetup.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.12.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -272,12 +272,12 @@ namespace dbaui
m_eType = m_pAdminDialog->getDatasourceType(_rSet);
// special handling for oracle, this can only happen
// if the user enters the same url as used for Oracle and we are on the JDBC path
- if ( DST_ORACLE_JDBC == m_eType )
- m_eType = DST_JDBC;
+ if ( ::dbaccess::DST_ORACLE_JDBC == m_eType )
+ m_eType = ::dbaccess::DST_JDBC;
OConnectionHelper::implInitControls(_rSet, _bSaveValue);
- if ( m_eType >= DST_USERDEFINE1 )
+ if ( m_eType >= ::dbaccess::DST_USERDEFINE1 )
{
String sDisplayName = m_pCollection->getTypeDisplayName(m_eType);
FixedText* ppTextControls[] ={&m_aFT_Connection};
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index ce70606a0..639034f1e 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DBSetupConnectionPages.cxx,v $
- * $Revision: 1.19 $
+ * $Revision: 1.19.18.1 $
*
* This file is part of OpenOffice.org.
*
@@ -60,6 +60,7 @@
#ifndef _DBAUI_DATASOURCEITEMS_HXX_
#include "dsitems.hxx"
#endif
+#include "dsnItem.hxx"
#ifndef _DBA_DBACCESS_HELPID_HRC_
#include "dbaccess_helpid.hrc"
#endif
@@ -282,12 +283,12 @@ DBG_NAME(OTextConnectionPageSetup)
if ( m_aETHostServer.GetText() != m_aETHostServer.GetSavedValue() )
{
DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION));
- ODsnTypeCollection* pCollection = NULL;
+ ::dbaccess::ODsnTypeCollection* pCollection = NULL;
if (pCollectionItem)
pCollection = pCollectionItem->getCollection();
DBG_ASSERT(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !");
- String sUrl = pCollection->getDatasourcePrefix(DST_LDAP);
+ String sUrl = pCollection->getDatasourcePrefix( ::dbaccess::DST_LDAP);
sUrl += m_aETHostServer.GetText();
_rSet.Put(SfxStringItem(DSID_CONNECTURL, sUrl));
bChangedSomething = sal_True;
@@ -388,11 +389,11 @@ DBG_NAME(OMySQLIntroPageSetup)
void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool /*_bSaveValue*/)
{
DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION));
- ODsnTypeCollection* pCollection = NULL;
+ ::dbaccess::ODsnTypeCollection* pCollection = NULL;
if (pCollectionItem)
{
pCollection = pCollectionItem->getCollection();
- String sUrl = pCollection->getDatasourcePrefix(DST_MYSQL_NATIVE);
+ String sUrl = pCollection->getDatasourcePrefix( ::dbaccess::DST_MYSQL_NATIVE);
uno::Reference< sdbc::XDriverAccess > xDriverManager( m_xORB->createInstance( SERVICE_SDBC_DRIVERMANAGER ), uno::UNO_QUERY );
if ( xDriverManager.is() && xDriverManager->getDriverByURL( sUrl ).is() )
{
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 36bc4e93a..8a9e15af7 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DbAdminImpl.cxx,v $
- * $Revision: 1.26 $
+ * $Revision: 1.26.18.1 $
*
* This file is part of OpenOffice.org.
*
@@ -119,7 +119,7 @@
#ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_
#include <com/sun/star/frame/XStorable.hpp>
#endif
-
+#include "dsnItem.hxx"
#include <algorithm>
#include <functional>
@@ -471,19 +471,19 @@ Reference< XPropertySet > ODbDataSourceAdministrationHelper::getCurrentDataSourc
return m_xDatasource;
}
//-------------------------------------------------------------------------
-DATASOURCE_TYPE ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet )
+::dbaccess::DATASOURCE_TYPE ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet )
{
SFX_ITEMSET_GET( _rSet, pConnectURL, SfxStringItem, DSID_CONNECTURL, sal_True );
SFX_ITEMSET_GET( _rSet, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True );
DBG_ASSERT( pConnectURL && pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!" );
if ( !pConnectURL || !pTypeCollection )
- return DST_UNKNOWN;
+ return ::dbaccess::DST_UNKNOWN;
String sConnectURL = pConnectURL->GetValue();
- ODsnTypeCollection* pCollection = pTypeCollection->getCollection();
+ ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection();
DBG_ASSERT( pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!" );
if ( !pCollection )
- return DST_UNKNOWN;
+ return ::dbaccess::DST_UNKNOWN;
return pCollection->getType( sConnectURL );
}
@@ -498,25 +498,25 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const
{
String sNewUrl;
- DATASOURCE_TYPE eType = getDatasourceType(*m_pItemSetHelper->getOutputSet());
+ ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(*m_pItemSetHelper->getOutputSet());
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True);
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True);
OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!");
DBG_ASSERT(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!");
- ODsnTypeCollection* pCollection = pTypeCollection->getCollection();
+ ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection();
DBG_ASSERT(pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!");
switch( eType )
{
- case DST_DBASE:
- case DST_FLAT:
- case DST_CALC:
+ case ::dbaccess::DST_DBASE:
+ case ::dbaccess::DST_FLAT:
+ case ::dbaccess::DST_CALC:
break;
- case DST_ADABAS:
+ case ::dbaccess::DST_ADABAS:
{
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True);
sNewUrl = lcl_createHostWithPort(pHostName,NULL);
@@ -527,8 +527,8 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const
sNewUrl += sUrl;
}
break;
- case DST_MSACCESS:
- case DST_MSACCESS_2007:
+ case ::dbaccess::DST_MSACCESS:
+ case ::dbaccess::DST_MSACCESS_2007:
{
::rtl::OUString sFileName = pCollection->cutPrefix(pUrlItem->GetValue());
::rtl::OUString sNewFileName;
@@ -538,8 +538,8 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const
}
}
break;
- case DST_MYSQL_NATIVE:
- case DST_MYSQL_JDBC:
+ case ::dbaccess::DST_MYSQL_NATIVE:
+ case ::dbaccess::DST_MYSQL_JDBC:
{
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True);
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_MYSQL_PORTNUMBER, sal_True);
@@ -559,7 +559,7 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const
}
}
break;
- case DST_ORACLE_JDBC:
+ case ::dbaccess::DST_ORACLE_JDBC:
{
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True);
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_ORACLE_PORTNUMBER, sal_True);
@@ -583,7 +583,7 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const
}
}
break;
- case DST_LDAP:
+ case ::dbaccess::DST_LDAP:
{
// SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True);
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, sal_True);
@@ -591,7 +591,7 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const
sNewUrl += lcl_createHostWithPort(NULL,pPortNumber);
}
break;
- case DST_JDBC:
+ case ::dbaccess::DST_JDBC:
// run through
default:
break;
@@ -769,7 +769,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
// us)
// first determine which of all the items are relevant for the data source (depends on the connection url)
- DATASOURCE_TYPE eType = getDatasourceType(_rSource);
+ ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(_rSource);
::std::vector< sal_Int32> aDetailIds;
ODriversSettings::getSupportedIndirectSettings(eType,aDetailIds);
@@ -874,7 +874,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
}
// here we have a special entry for types from oracle
- if ( eType == DST_ORACLE_JDBC )
+ if ( eType == ::dbaccess::DST_ORACLE_JDBC )
{
Sequence< Any > aTypeSettings;
static const ::rtl::OUString s_sCondition(RTL_CONSTASCII_USTRINGPARAM("Column(2) = "));
@@ -1077,14 +1077,14 @@ String ODbDataSourceAdministrationHelper::getDocumentUrl(SfxItemSet& _rDest)
// -----------------------------------------------------------------------------
void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
{
- DATASOURCE_TYPE eType = getDatasourceType(_rDest);
+ ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(_rDest);
SFX_ITEMSET_GET(_rDest, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True);
SFX_ITEMSET_GET(_rDest, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True);
OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!");
DBG_ASSERT(pTypeCollection, "ODbAdminDialog::getDatasourceType: invalid items in the source set!");
- ODsnTypeCollection* pCollection = pTypeCollection->getCollection();
+ ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection();
DBG_ASSERT(pCollection, "ODbAdminDialog::getDatasourceType: invalid type collection!");
USHORT nPortNumberId = 0;
@@ -1097,14 +1097,14 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
switch( eType )
{
- case DST_MYSQL_NATIVE:
- case DST_MYSQL_JDBC:
+ case ::dbaccess::DST_MYSQL_NATIVE:
+ case ::dbaccess::DST_MYSQL_JDBC:
nPortNumberId = DSID_MYSQL_PORTNUMBER;
break;
- case DST_ORACLE_JDBC:
+ case ::dbaccess::DST_ORACLE_JDBC:
nPortNumberId = DSID_ORACLE_PORTNUMBER;
break;
- case DST_LDAP:
+ case ::dbaccess::DST_LDAP:
nPortNumberId = DSID_CONN_LDAP_PORTNUMBER;
break;
default:
@@ -1144,6 +1144,37 @@ void ODbDataSourceAdministrationHelper::setDataSourceOrName( const Any& _rDataSo
// hmm. We could reset m_xDatasource/m_xModel, probably, and continue working
m_aDataSourceOrName = _rDataSourceOrName;
}
+//=========================================================================
+//= DbuTypeCollectionItem
+//=========================================================================
+TYPEINIT1(DbuTypeCollectionItem, SfxPoolItem);
+//-------------------------------------------------------------------------
+DbuTypeCollectionItem::DbuTypeCollectionItem(sal_Int16 _nWhich, ::dbaccess::ODsnTypeCollection* _pCollection)
+ :SfxPoolItem(_nWhich)
+ ,m_pCollection(_pCollection)
+{
+}
+
+//-------------------------------------------------------------------------
+DbuTypeCollectionItem::DbuTypeCollectionItem(const DbuTypeCollectionItem& _rSource)
+ :SfxPoolItem(_rSource)
+ ,m_pCollection(_rSource.getCollection())
+{
+}
+
+//-------------------------------------------------------------------------
+int DbuTypeCollectionItem::operator==(const SfxPoolItem& _rItem) const
+{
+ DbuTypeCollectionItem* pCompare = PTR_CAST(DbuTypeCollectionItem, &_rItem);
+ return pCompare && (pCompare->getCollection() == getCollection());
+}
+
+//-------------------------------------------------------------------------
+SfxPoolItem* DbuTypeCollectionItem::Clone(SfxItemPool* /*_pPool*/) const
+{
+ return new DbuTypeCollectionItem(*this);
+}
+
//.........................................................................
} // namespace dbaui
//.........................................................................
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
index 05762d971..fa1990e53 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DbAdminImpl.hxx,v $
- * $Revision: 1.10 $
+ * $Revision: 1.10.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -64,6 +64,7 @@
#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
#include <com/sun/star/frame/XModel.hpp>
#endif
+#include <svtools/poolitem.hxx>
class Window;
//.........................................................................
@@ -141,7 +142,7 @@ namespace dbaui
/** extracts the connection type from the given set<p/>
The connection type is determined by the value of the DSN item, analyzed by the TypeCollection item.
*/
- static DATASOURCE_TYPE getDatasourceType( const SfxItemSet& _rSet );
+ static ::dbaccess::DATASOURCE_TYPE getDatasourceType( const SfxItemSet& _rSet );
/** returns the connection URL
@return
diff --git a/dbaccess/source/ui/dlg/DriverSettings.cxx b/dbaccess/source/ui/dlg/DriverSettings.cxx
index 2c20fd70c..7eea924e2 100644
--- a/dbaccess/source/ui/dlg/DriverSettings.cxx
+++ b/dbaccess/source/ui/dlg/DriverSettings.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DriverSettings.cxx,v $
- * $Revision: 1.17 $
+ * $Revision: 1.17.18.1 $
*
* This file is part of OpenOffice.org.
*
@@ -37,7 +37,7 @@
using namespace dbaui;
-void ODriversSettings::getSupportedIndirectSettings( DATASOURCE_TYPE _eType, ::std::vector< sal_Int32>& _out_rDetailsIds )
+void ODriversSettings::getSupportedIndirectSettings( ::dbaccess::DATASOURCE_TYPE _eType, ::std::vector< sal_Int32>& _out_rDetailsIds )
{
// for a number of settings, we do not need to use hard-coded here, but can ask a
// central DataSourceUI instance.
@@ -68,12 +68,12 @@ void ODriversSettings::getSupportedIndirectSettings( DATASOURCE_TYPE _eType, ::s
// the rest is hard-coded. On the long run, all of this should be done via DataSourceUI::hasSetting
switch ( _eType )
{
- case DST_DBASE:
+ case ::dbaccess::DST_DBASE:
_out_rDetailsIds.push_back(DSID_SHOWDELETEDROWS);
_out_rDetailsIds.push_back(DSID_CHARSET);
break;
- case DST_FLAT:
+ case ::dbaccess::DST_FLAT:
_out_rDetailsIds.push_back(DSID_FIELDDELIMITER);
_out_rDetailsIds.push_back(DSID_TEXTDELIMITER);
_out_rDetailsIds.push_back(DSID_DECIMALDELIMITER);
@@ -83,7 +83,7 @@ void ODriversSettings::getSupportedIndirectSettings( DATASOURCE_TYPE _eType, ::s
_out_rDetailsIds.push_back(DSID_CHARSET);
break;
- case DST_ADABAS:
+ case ::dbaccess::DST_ADABAS:
_out_rDetailsIds.push_back(DSID_CHARSET);
_out_rDetailsIds.push_back(DSID_CONN_SHUTSERVICE);
_out_rDetailsIds.push_back(DSID_CONN_DATAINC);
@@ -92,40 +92,40 @@ void ODriversSettings::getSupportedIndirectSettings( DATASOURCE_TYPE _eType, ::s
_out_rDetailsIds.push_back(DSID_CONN_CTRLPWD);
break;
- case DST_ADO:
+ case ::dbaccess::DST_ADO:
_out_rDetailsIds.push_back(DSID_CHARSET);
break;
- case DST_ODBC:
+ case ::dbaccess::DST_ODBC:
_out_rDetailsIds.push_back(DSID_ADDITIONALOPTIONS);
_out_rDetailsIds.push_back(DSID_CHARSET);
_out_rDetailsIds.push_back(DSID_USECATALOG);
break;
- case DST_MYSQL_NATIVE:
+ case ::dbaccess::DST_MYSQL_NATIVE:
_out_rDetailsIds.push_back(DSID_CHARSET);
_out_rDetailsIds.push_back(DSID_CONN_SOCKET);
break;
- case DST_MYSQL_JDBC:
+ case ::dbaccess::DST_MYSQL_JDBC:
_out_rDetailsIds.push_back(DSID_CHARSET);
_out_rDetailsIds.push_back(DSID_JDBCDRIVERCLASS);
break;
- case DST_MYSQL_ODBC:
+ case ::dbaccess::DST_MYSQL_ODBC:
_out_rDetailsIds.push_back(DSID_CHARSET);
break;
- case DST_LDAP:
+ case ::dbaccess::DST_LDAP:
_out_rDetailsIds.push_back(DSID_CONN_LDAP_BASEDN);
_out_rDetailsIds.push_back(DSID_CONN_LDAP_ROWCOUNT);
_out_rDetailsIds.push_back(DSID_CONN_LDAP_USESSL);
break;
- case DST_JDBC:
+ case ::dbaccess::DST_JDBC:
_out_rDetailsIds.push_back(DSID_JDBCDRIVERCLASS);
break;
- case DST_ORACLE_JDBC:
+ case ::dbaccess::DST_ORACLE_JDBC:
_out_rDetailsIds.push_back(DSID_JDBCDRIVERCLASS);
_out_rDetailsIds.push_back(DSID_IGNORECURRENCY);
break;
diff --git a/dbaccess/source/ui/dlg/DriverSettings.hxx b/dbaccess/source/ui/dlg/DriverSettings.hxx
index 419ca29f4..b4147368f 100644
--- a/dbaccess/source/ui/dlg/DriverSettings.hxx
+++ b/dbaccess/source/ui/dlg/DriverSettings.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DriverSettings.hxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -33,6 +33,7 @@
#ifndef _DBAUI_DSNTYPES_HXX_
#include "dsntypes.hxx"
#endif
+#include <svtools/poolitem.hxx>
#include <vector>
class SfxTabPage;
@@ -52,7 +53,7 @@ namespace dbaui
@param _out_rDetailsIds
Will be filled.
*/
- static void getSupportedIndirectSettings( DATASOURCE_TYPE _eType,::std::vector< sal_Int32>& _out_rDetailsIds );
+ static void getSupportedIndirectSettings( ::dbaccess::DATASOURCE_TYPE _eType,::std::vector< sal_Int32>& _out_rDetailsIds );
/** Creates the detail page for Dbase
*/
diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx
index 2eacbf00b..3a51d0af2 100644
--- a/dbaccess/source/ui/dlg/RelationDlg.cxx
+++ b/dbaccess/source/ui/dlg/RelationDlg.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RelationDlg.cxx,v $
- * $Revision: 1.29 $
+ * $Revision: 1.29.24.1 $
*
* This file is part of OpenOffice.org.
*
@@ -246,7 +246,7 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ )
try
{
ORelationTableConnectionData* pOrigConnData = static_cast<ORelationTableConnectionData*>(m_pOrigConnData.get());
- if (*pConnData != *pOrigConnData || pConnData->Update())
+ if ( *pConnData == *pOrigConnData || pConnData->Update())
{
m_pOrigConnData->CopyFrom( *m_pConnData );
EndDialog( RET_OK );
diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx
index 7fdaf3505..a98bc4146 100644
--- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx
+++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: UserAdminDlg.cxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -228,7 +228,7 @@ DBG_NAME(OUserAdminDlg)
return m_pImpl->getDriver();
}
// -----------------------------------------------------------------------------
- DATASOURCE_TYPE OUserAdminDlg::getDatasourceType(const SfxItemSet& _rSet) const
+ ::dbaccess::DATASOURCE_TYPE OUserAdminDlg::getDatasourceType(const SfxItemSet& _rSet) const
{
return m_pImpl->getDatasourceType(_rSet);
}
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 4cafce7a0..9f540e360 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: adminpages.cxx,v $
- * $Revision: 1.52 $
+ * $Revision: 1.52.40.1 $
*
* This file is part of OpenOffice.org.
*
@@ -183,7 +183,7 @@ namespace dbaui
return 0L;
}
// -----------------------------------------------------------------------
- sal_Bool OGenericAdministrationPage::getSelectedDataSource(DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn,::rtl::OUString& _sCurr)
+ sal_Bool OGenericAdministrationPage::getSelectedDataSource(::dbaccess::DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn,::rtl::OUString& _sCurr)
{
// collect all ODBC data source names
StringBag aOdbcDatasources;
diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx
index 93a63bff5..5b911a1e8 100644
--- a/dbaccess/source/ui/dlg/adminpages.hxx
+++ b/dbaccess/source/ui/dlg/adminpages.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: adminpages.hxx,v $
- * $Revision: 1.35 $
+ * $Revision: 1.35.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -166,7 +166,7 @@ namespace dbaui
@return
<FALSE/> if an error occured, otherwise <TRUE/>
*/
- sal_Bool getSelectedDataSource(DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn,::rtl::OUString& _sCurr);
+ sal_Bool getSelectedDataSource(::dbaccess::DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn,::rtl::OUString& _sCurr);
// svt::IWizardPage
virtual void initializePage();
diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx
index 319141bbc..975cf8878 100644
--- a/dbaccess/source/ui/dlg/adtabdlg.cxx
+++ b/dbaccess/source/ui/dlg/adtabdlg.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: adtabdlg.cxx,v $
- * $Revision: 1.30 $
+ * $Revision: 1.30.68.2 $
*
* This file is part of OpenOffice.org.
*
@@ -30,74 +30,36 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
-#ifndef DBAUI_QYDLGTAB_HXX
+
#include "adtabdlg.hxx"
-#endif
-#ifndef DBAUI_ADTABDLG_HRC
#include "adtabdlg.hrc"
-#endif
-#ifndef _DBAUI_SQLMESSAGE_HXX_
#include "sqlmessage.hxx"
-#endif
-#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
-#endif
-#ifndef TOOLS_DIAGNOSE_EX_H
#include <tools/diagnose_ex.h>
-#endif
-#ifndef _SVTOOLS_LOCALRESACCESS_HXX_
#include <svtools/localresaccess.hxx>
-#endif
-#ifndef _DBA_DBACCESS_HELPID_HRC_
#include "dbaccess_helpid.hrc"
-#endif
-#ifndef _DBU_RESOURCE_HRC_
#include "dbu_resource.hrc"
-#endif
-#ifndef _DBU_DLG_HRC_
#include "dbu_dlg.hrc"
-#endif
-#ifndef _SFXSIDS_HRC
#include <sfx2/sfxsids.hrc>
-#endif
-#ifndef DBAUI_QUERYTABLEVIEW_HXX
#include "QueryTableView.hxx"
-#endif
-#ifndef DBAUI_QUERYDESIGNVIEW_HXX
#include "QueryDesignView.hxx"
-#endif
-#ifndef DBAUI_QUERYCONTROLLER_HXX
#include "querycontroller.hxx"
-#endif
-#ifndef _CONNECTIVITY_DBTOOLS_HXX_
#include <connectivity/dbtools.hxx>
-#endif
-#ifndef DBACCESS_UI_BROWSER_ID_HXX
#include "browserids.hxx"
-#endif
-#ifndef _COM_SUN_STAR_SDB_XQUERIESSUPPLIER_HPP_
#include <com/sun/star/sdb/XQueriesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XVIEWSSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
-#endif
-#ifndef DBAUI_TOOLS_HXX
#include "UITools.hxx"
-#endif
-#ifndef DBACCESS_IMAGEPROVIDER_HXX
#include "imageprovider.hxx"
-#endif
+#include <comphelper/containermultiplexer.hxx>
+#include "cppuhelper/basemutex.hxx"
#include <algorithm>
// slot ids
using namespace dbaui;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdb;
@@ -115,23 +77,42 @@ TableObjectListFacade::~TableObjectListFacade()
//==============================================================================
//= TableListFacade
//==============================================================================
-class TableListFacade : public TableObjectListFacade
+class TableListFacade : public ::cppu::BaseMutex
+ , public TableObjectListFacade
+ , public ::comphelper::OContainerListener
{
OTableTreeListBox& m_rTableList;
Reference< XConnection > m_xConnection;
+ ::rtl::Reference< comphelper::OContainerListenerAdapter>
+ m_pContainerListener;
+ bool m_bAllowViews;
public:
TableListFacade( OTableTreeListBox& _rTableList, const Reference< XConnection >& _rxConnection )
- :m_rTableList( _rTableList )
+ : ::comphelper::OContainerListener(m_aMutex)
+ ,m_rTableList( _rTableList )
,m_xConnection( _rxConnection )
+ ,m_bAllowViews(true)
{
}
+ virtual ~TableListFacade();
+
+private:
virtual void updateTableObjectList( bool _bAllowViews );
virtual String getSelectedName( String& _out_rAliasName ) const;
virtual bool isLeafSelected() const;
+ // OContainerListener
+ virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
};
+TableListFacade::~TableListFacade()
+{
+ if ( m_pContainerListener.is() )
+ m_pContainerListener->dispose();
+}
//------------------------------------------------------------------------------
String TableListFacade::getSelectedName( String& _out_rAliasName ) const
{
@@ -174,22 +155,45 @@ String TableListFacade::getSelectedName( String& _out_rAliasName ) const
_out_rAliasName = aTableName;
return aComposedName;
}
-
+// -----------------------------------------------------------------------------
+void TableListFacade::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+ updateTableObjectList(m_bAllowViews);
+}
+// -----------------------------------------------------------------------------
+void TableListFacade::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+ updateTableObjectList(m_bAllowViews);
+}
+// -----------------------------------------------------------------------------
+void TableListFacade::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+}
//------------------------------------------------------------------------------
void TableListFacade::updateTableObjectList( bool _bAllowViews )
{
+ m_bAllowViews = _bAllowViews;
m_rTableList.Clear();
try
{
Reference< XTablesSupplier > xTableSupp( m_xConnection, UNO_QUERY_THROW );
+
Reference< XViewsSupplier > xViewSupp;
Reference< XNameAccess > xTables, xViews;
Sequence< ::rtl::OUString > sTables, sViews;
xTables = xTableSupp->getTables();
if ( xTables.is() )
+ {
+ if ( !m_pContainerListener.is() )
+ {
+ Reference< XContainer> xContainer(xTables,uno::UNO_QUERY);
+ if ( xContainer.is() )
+ m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer);
+ }
sTables = xTables->getElementNames();
-
+ } // if ( xTables.is() )
+
xViewSupp.set( xTableSupp, UNO_QUERY );
if ( xViewSupp.is() )
{
@@ -241,22 +245,53 @@ bool TableListFacade::isLeafSelected() const
//==============================================================================
//= QueryListFacade
//==============================================================================
-class QueryListFacade : public TableObjectListFacade
+class QueryListFacade : public ::cppu::BaseMutex
+ , public TableObjectListFacade
+ , public ::comphelper::OContainerListener
{
SvTreeListBox& m_rQueryList;
Reference< XConnection > m_xConnection;
+ ::rtl::Reference< comphelper::OContainerListenerAdapter>
+ m_pContainerListener;
public:
QueryListFacade( SvTreeListBox& _rQueryList, const Reference< XConnection >& _rxConnection )
- :m_rQueryList( _rQueryList )
+ : ::comphelper::OContainerListener(m_aMutex)
+ ,m_rQueryList( _rQueryList )
,m_xConnection( _rxConnection )
{
}
-
+ virtual ~QueryListFacade();
+private:
virtual void updateTableObjectList( bool _bAllowViews );
virtual String getSelectedName( String& _out_rAliasName ) const;
virtual bool isLeafSelected() const;
+ // OContainerListener
+ virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
};
+QueryListFacade::~QueryListFacade()
+{
+ if ( m_pContainerListener.is() )
+ m_pContainerListener->dispose();
+}
+// -----------------------------------------------------------------------------
+void QueryListFacade::_elementInserted( const container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::rtl::OUString sName;
+ if ( _rEvent.Accessor >>= sName )
+ m_rQueryList.InsertEntry( sName );
+}
+// -----------------------------------------------------------------------------
+void QueryListFacade::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+ updateTableObjectList(true);
+}
+// -----------------------------------------------------------------------------
+void QueryListFacade::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+}
//------------------------------------------------------------------------------
void QueryListFacade::updateTableObjectList( bool /*_bAllowViews*/ )
@@ -275,6 +310,11 @@ void QueryListFacade::updateTableObjectList( bool /*_bAllowViews*/ )
Reference< XQueriesSupplier > xSuppQueries( m_xConnection, UNO_QUERY_THROW );
Reference< XNameAccess > xQueries( xSuppQueries->getQueries(), UNO_QUERY_THROW );
+ if ( !m_pContainerListener.is() )
+ {
+ Reference< XContainer> xContainer(xQueries,UNO_QUERY_THROW);
+ m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer);
+ }
Sequence< ::rtl::OUString > aQueryNames = xQueries->getElementNames();
const ::rtl::OUString* pQuery = aQueryNames.getConstArray();
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index d0b425baf..83ec7c1de 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: advancedsettings.cxx,v $
- * $Revision: 1.4 $
+ * $Revision: 1.4.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -408,7 +408,7 @@ namespace dbaui
delete pExampleSet;
pExampleSet = new SfxItemSet(*GetInputSetImpl());
- DATASOURCE_TYPE eType = m_pImpl->getDatasourceType(*_pItems);
+ ::dbaccess::DATASOURCE_TYPE eType = m_pImpl->getDatasourceType(*_pItems);
DataSourceMetaData aMeta( eType );
const AdvancedSettingsSupport& rAdvancedSupport( aMeta.getAdvancedSettingsSupport() );
@@ -434,7 +434,7 @@ namespace dbaui
}
// -----------------------------------------------------------------------
- bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( DATASOURCE_TYPE _eType )
+ bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( ::dbaccess::DATASOURCE_TYPE _eType )
{
DataSourceMetaData aMeta( _eType );
const AdvancedSettingsSupport& rSupport( aMeta.getAdvancedSettingsSupport() );
@@ -501,7 +501,7 @@ namespace dbaui
}
// -----------------------------------------------------------------------------
- DATASOURCE_TYPE AdvancedSettingsDialog::getDatasourceType(const SfxItemSet& _rSet) const
+ ::dbaccess::DATASOURCE_TYPE AdvancedSettingsDialog::getDatasourceType(const SfxItemSet& _rSet) const
{
return m_pImpl->getDatasourceType(_rSet);
}
diff --git a/dbaccess/source/ui/dlg/datasourceui.cxx b/dbaccess/source/ui/dlg/datasourceui.cxx
index 630e2cfdd..e335bc1d9 100644
--- a/dbaccess/source/ui/dlg/datasourceui.cxx
+++ b/dbaccess/source/ui/dlg/datasourceui.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: datasourceui.cxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -52,7 +52,7 @@ namespace dbaui
//= DataSourceUI
//====================================================================
//--------------------------------------------------------------------
- DataSourceUI::DataSourceUI( DATASOURCE_TYPE _eType )
+ DataSourceUI::DataSourceUI( ::dbaccess::DATASOURCE_TYPE _eType )
:m_aDSMeta( DataSourceMetaData( _eType ) )
{
}
diff --git a/dbaccess/source/ui/dlg/datasourceui.hxx b/dbaccess/source/ui/dlg/datasourceui.hxx
index 2d67b3d78..cb88f3d90 100644
--- a/dbaccess/source/ui/dlg/datasourceui.hxx
+++ b/dbaccess/source/ui/dlg/datasourceui.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: datasourceui.hxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.3.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -52,7 +52,7 @@ namespace dbaui
class DataSourceUI
{
public:
- DataSourceUI( DATASOURCE_TYPE _eType );
+ DataSourceUI( ::dbaccess::DATASOURCE_TYPE _eType );
DataSourceUI( const DataSourceMetaData& _rDSMeta );
~DataSourceUI();
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 0657408fb..2c73185fc 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbadmin.cxx,v $
- * $Revision: 1.108 $
+ * $Revision: 1.108.18.1 $
*
* This file is part of OpenOffice.org.
*
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
+#include "dsnItem.hxx"
#ifndef _DBAUI_DBADMIN_HXX_
#include "dbadmin.hxx"
#endif
@@ -181,43 +182,43 @@ void ODbAdminDialog::implSelectDatasource(const ::com::sun::star::uno::Any& _aDa
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
resetPages(xDatasource);
- DATASOURCE_TYPE eType = getDatasourceType(*getOutputSet());
+ ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(*getOutputSet());
// and insert the new ones
switch ( eType )
{
- case DST_DBASE:
+ case ::dbaccess::DST_DBASE:
addDetailPage(PAGE_DBASE, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateDbase);
// bResetPasswordRequired = sal_True;
break;
- case DST_ADO:
+ case ::dbaccess::DST_ADO:
addDetailPage(PAGE_ADO, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateAdo);
break;
- case DST_FLAT:
+ case ::dbaccess::DST_FLAT:
addDetailPage(PAGE_TEXT, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateText);
// bResetPasswordRequired = sal_True;
break;
- case DST_ODBC:
+ case ::dbaccess::DST_ODBC:
addDetailPage(PAGE_ODBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateODBC);
break;
- case DST_MYSQL_ODBC:
+ case ::dbaccess::DST_MYSQL_ODBC:
addDetailPage(PAGE_MYSQL_ODBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateMySQLODBC);
break;
- case DST_MYSQL_JDBC:
+ case ::dbaccess::DST_MYSQL_JDBC:
addDetailPage(PAGE_MYSQL_JDBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateMySQLJDBC);
break;
- case DST_MYSQL_NATIVE:
+ case ::dbaccess::DST_MYSQL_NATIVE:
addDetailPage(PAGE_MYSQL_JDBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateMySQLNATIVE);
break;
- case DST_ORACLE_JDBC:
+ case ::dbaccess::DST_ORACLE_JDBC:
addDetailPage(PAGE_ORACLE_JDBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateOracleJDBC);
break;
- case DST_ADABAS:
+ case ::dbaccess::DST_ADABAS:
// for adabas we have more than one page
// CAUTION: the order of inserting pages matters.
// the major detail page should be inserted last always (thus, it becomes the first page after
@@ -225,19 +226,19 @@ void ODbAdminDialog::implSelectDatasource(const ::com::sun::star::uno::Any& _aDa
addDetailPage(PAGE_ADABAS, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateAdabas);
break;
- case DST_LDAP:
+ case ::dbaccess::DST_LDAP:
addDetailPage(PAGE_LDAP,STR_PAGETITLE_ADVANCED,ODriversSettings::CreateLDAP);
break;
- case DST_USERDEFINE1: /// first user defined driver
- case DST_USERDEFINE2:
- case DST_USERDEFINE3:
- case DST_USERDEFINE4:
- case DST_USERDEFINE5:
- case DST_USERDEFINE6:
- case DST_USERDEFINE7:
- case DST_USERDEFINE8:
- case DST_USERDEFINE9:
- case DST_USERDEFINE10:
+ case ::dbaccess::DST_USERDEFINE1: /// first user defined driver
+ case ::dbaccess::DST_USERDEFINE2:
+ case ::dbaccess::DST_USERDEFINE3:
+ case ::dbaccess::DST_USERDEFINE4:
+ case ::dbaccess::DST_USERDEFINE5:
+ case ::dbaccess::DST_USERDEFINE6:
+ case ::dbaccess::DST_USERDEFINE7:
+ case ::dbaccess::DST_USERDEFINE8:
+ case ::dbaccess::DST_USERDEFINE9:
+ case ::dbaccess::DST_USERDEFINE10:
{
LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG);
String aTitle(ModuleRes(STR_PAGETITLE_ADVANCED));
@@ -385,7 +386,7 @@ Reference< XDriver > ODbAdminDialog::getDriver()
return m_pImpl->getDriver();
}
// -----------------------------------------------------------------------------
-DATASOURCE_TYPE ODbAdminDialog::getDatasourceType(const SfxItemSet& _rSet) const
+::dbaccess::DATASOURCE_TYPE ODbAdminDialog::getDatasourceType(const SfxItemSet& _rSet) const
{
return m_pImpl->getDatasourceType(_rSet);
}
@@ -395,7 +396,7 @@ void ODbAdminDialog::clearPassword()
m_pImpl->clearPassword();
}
//-------------------------------------------------------------------------
-SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults, ODsnTypeCollection* _pTypeCollection)
+SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults, ::dbaccess::ODsnTypeCollection* _pTypeCollection)
{
// just to be sure ....
_rpSet = NULL;
@@ -408,7 +409,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp
SfxPoolItem** pCounter = _rppDefaults; // want to modify this without affecting the out param _rppDefaults
*pCounter++ = new SfxStringItem(DSID_NAME, String());
*pCounter++ = new SfxStringItem(DSID_ORIGINALNAME, String());
- *pCounter++ = new SfxStringItem(DSID_CONNECTURL, _pTypeCollection ? _pTypeCollection->getDatasourcePrefix( DST_ADABAS ) : String());
+ *pCounter++ = new SfxStringItem(DSID_CONNECTURL, _pTypeCollection ? _pTypeCollection->getDatasourcePrefix( ::dbaccess::DST_ADABAS ) : String());
*pCounter++ = new OStringListItem(DSID_TABLEFILTER, Sequence< ::rtl::OUString >(&sFilterAll, 1));
*pCounter++ = new DbuTypeCollectionItem(DSID_TYPECOLLECTION, _pTypeCollection);
*pCounter++ = new SfxBoolItem(DSID_INVALID_SELECTION, sal_False);
diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx
index de009b3b8..777e0533d 100644
--- a/dbaccess/source/ui/dlg/dbwiz.cxx
+++ b/dbaccess/source/ui/dlg/dbwiz.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbwiz.cxx,v $
- * $Revision: 1.21 $
+ * $Revision: 1.21.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -169,12 +169,12 @@ IMPL_LINK(ODbTypeWizDialog, OnTypeSelected, OGeneralPage*, _pTabPage)
m_eType = _pTabPage->GetSelectedType();
switch(m_eType)
{
- case DST_MOZILLA:
- case DST_OUTLOOK:
- case DST_OUTLOOKEXP:
- case DST_EVOLUTION:
- case DST_KAB:
- case DST_MACAB:
+ case ::dbaccess::DST_MOZILLA:
+ case ::dbaccess::DST_OUTLOOK:
+ case ::dbaccess::DST_OUTLOOKEXP:
+ case ::dbaccess::DST_EVOLUTION:
+ case ::dbaccess::DST_KAB:
+ case ::dbaccess::DST_MACAB:
enableButtons(WZB_NEXT,sal_False);
enableButtons(WZB_FINISH,sal_True);
break;
@@ -194,12 +194,12 @@ WizardTypes::WizardState ODbTypeWizDialog::determineNextState( WizardState _nCur
case START_PAGE:
switch(m_eType)
{
- case DST_MOZILLA:
- case DST_OUTLOOK:
- case DST_OUTLOOKEXP:
- case DST_EVOLUTION:
- case DST_KAB:
- case DST_MACAB:
+ case ::dbaccess::DST_MOZILLA:
+ case ::dbaccess::DST_OUTLOOK:
+ case ::dbaccess::DST_OUTLOOKEXP:
+ case ::dbaccess::DST_EVOLUTION:
+ case ::dbaccess::DST_KAB:
+ case ::dbaccess::DST_MACAB:
nNextState = WZS_INVALID_STATE;
break;
default:
@@ -210,47 +210,47 @@ WizardTypes::WizardState ODbTypeWizDialog::determineNextState( WizardState _nCur
case CONNECTION_PAGE:
switch(m_eType)
{
- case DST_MOZILLA:
- case DST_THUNDERBIRD:
- case DST_OUTLOOK:
- case DST_OUTLOOKEXP:
- case DST_EVOLUTION:
- case DST_KAB:
- case DST_MACAB:
- case DST_MSACCESS:
- case DST_MSACCESS_2007:
- case DST_JDBC:
- case DST_CALC:
+ case ::dbaccess::DST_MOZILLA:
+ case ::dbaccess::DST_THUNDERBIRD:
+ case ::dbaccess::DST_OUTLOOK:
+ case ::dbaccess::DST_OUTLOOKEXP:
+ case ::dbaccess::DST_EVOLUTION:
+ case ::dbaccess::DST_KAB:
+ case ::dbaccess::DST_MACAB:
+ case ::dbaccess::DST_MSACCESS:
+ case ::dbaccess::DST_MSACCESS_2007:
+ case ::dbaccess::DST_JDBC:
+ case ::dbaccess::DST_CALC:
nNextState = WZS_INVALID_STATE;
break;
- case DST_DBASE:
+ case ::dbaccess::DST_DBASE:
nNextState = ADDITIONAL_PAGE_DBASE;
break;
- case DST_FLAT:
+ case ::dbaccess::DST_FLAT:
nNextState = ADDITIONAL_PAGE_FLAT;
break;
- case DST_LDAP:
+ case ::dbaccess::DST_LDAP:
nNextState = ADDITIONAL_PAGE_LDAP;
break;
- case DST_ADABAS:
+ case ::dbaccess::DST_ADABAS:
nNextState = ADDITIONAL_PAGE_ADABAS;
break;
- case DST_MYSQL_NATIVE:
+ case ::dbaccess::DST_MYSQL_NATIVE:
nNextState = ADDITIONAL_PAGE_MYSQL_NATIVE;
break;
- case DST_MYSQL_JDBC:
+ case ::dbaccess::DST_MYSQL_JDBC:
nNextState = ADDITIONAL_PAGE_MYSQL_JDBC;
break;
- case DST_MYSQL_ODBC:
+ case ::dbaccess::DST_MYSQL_ODBC:
nNextState = ADDITIONAL_PAGE_MYSQL_ODBC;
break;
- case DST_ORACLE_JDBC:
+ case ::dbaccess::DST_ORACLE_JDBC:
nNextState = ADDITIONAL_PAGE_ORACLE_JDBC;
break;
- case DST_ADO:
+ case ::dbaccess::DST_ADO:
nNextState = ADDITIONAL_PAGE_ADO;
break;
- case DST_ODBC:
+ case ::dbaccess::DST_ODBC:
nNextState = ADDITIONAL_PAGE_ODBC;
break;
default:
@@ -289,7 +289,7 @@ Reference< XDriver > ODbTypeWizDialog::getDriver()
return m_pImpl->getDriver();
}
// -----------------------------------------------------------------------------
-DATASOURCE_TYPE ODbTypeWizDialog::getDatasourceType(const SfxItemSet& _rSet) const
+::dbaccess::DATASOURCE_TYPE ODbTypeWizDialog::getDatasourceType(const SfxItemSet& _rSet) const
{
return m_pImpl->getDatasourceType(_rSet);
}
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index e2b73f158..36993b528 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbwizsetup.cxx,v $
- * $Revision: 1.35 $
+ * $Revision: 1.35.8.1 $
*
* This file is part of OpenOffice.org.
*
@@ -37,6 +37,7 @@
#include "dbadminsetup.hrc"
#include "dbu_dlg.hrc"
#include "dsitems.hxx"
+#include "dsnItem.hxx"
#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
#include <svtools/pathoptions.hxx>
@@ -282,8 +283,8 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent
WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP )
, m_pOutSet(NULL)
- , m_eType( DST_UNKNOWN )
- , m_eOldType( DST_UNKNOWN )
+ , m_eType( ::dbaccess::DST_UNKNOWN )
+ , m_eOldType( ::dbaccess::DST_UNKNOWN )
, m_bResetting(sal_False)
, m_bApplied(sal_False)
, m_bUIEnabled( sal_True )
@@ -333,31 +334,31 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent
enableButtons(WZB_FINISH, sal_True);
enableAutomaticNextButtonState();
- declareAuthDepPath( DST_ADO, ADO_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ADO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_DBASE, DBASE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_DBASE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_FLAT, TEXT_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_TEXT, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_ADO, ADO_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ADO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_DBASE, DBASE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_DBASE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_FLAT, TEXT_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_TEXT, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
declarePath ( SPREADSHEET_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_SPREADSHEET, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_ODBC, ODBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ODBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_JDBC, JDBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_JDBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_MYSQL_ODBC, MYSQL_ODBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_ODBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_MYSQL_JDBC, MYSQL_JDBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_JDBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_MYSQL_NATIVE, MYSQL_NATIVE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_NATIVE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_ORACLE_JDBC, ORACLE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ORACLE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_ADABAS, ADABAS_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ADABAS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_LDAP, LDAP_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_LDAP, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_MSACCESS, MSACCESS_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MSACCESS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_MSACCESS_2007, MSACCESS2007_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MSACCESS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_OUTLOOKEXP, OUTLOOKEXP_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_OUTLOOK, OUTLOOK_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_MOZILLA, MOZILLA_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_THUNDERBIRD, THUNDERBIRD_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_EVOLUTION, EVOLUTION_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_EVOLUTION_GROUPWISE,EVOLUTION_PATH_GROUPWISE, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_EVOLUTION_LDAP, EVOLUTION_PATH_LDAP, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_KAB, KAB_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_MACAB, MACAB_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1);
+ declareAuthDepPath( ::dbaccess::DST_ODBC, ODBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ODBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_JDBC, JDBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_JDBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_MYSQL_ODBC, MYSQL_ODBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_ODBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_MYSQL_JDBC, MYSQL_JDBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_JDBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_MYSQL_NATIVE, MYSQL_NATIVE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_NATIVE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_ORACLE_JDBC, ORACLE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ORACLE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_ADABAS, ADABAS_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ADABAS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_LDAP, LDAP_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_LDAP, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_MSACCESS, MSACCESS_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MSACCESS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_MSACCESS_2007, MSACCESS2007_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MSACCESS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_OUTLOOKEXP, OUTLOOKEXP_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_OUTLOOK, OUTLOOK_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_MOZILLA, MOZILLA_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_THUNDERBIRD, THUNDERBIRD_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_EVOLUTION, EVOLUTION_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_EVOLUTION_GROUPWISE,EVOLUTION_PATH_GROUPWISE, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_EVOLUTION_LDAP, EVOLUTION_PATH_LDAP, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_KAB, KAB_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_MACAB, MACAB_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1);
declareAuthDepPath( getDefaultDatabaseType(),CREATENEW_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
- declareAuthDepPath( DST_USERDEFINE1, USERDEFINED_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_USERDEFINED,PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
+ declareAuthDepPath( ::dbaccess::DST_USERDEFINE1, USERDEFINED_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_USERDEFINED,PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 );
declarePath ( OPEN_DOC_PATH, PAGE_DBSETUPWIZARD_INTRO, -1 );
m_pPrevPage->SetHelpId(HID_DBWIZ_PREVIOUS);
@@ -369,7 +370,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent
ActivatePage();
}
-void ODbTypeWizDialogSetup::declareAuthDepPath( DATASOURCE_TYPE _eType, PathId _nPathId, WizardState _nFirstState, ... )
+void ODbTypeWizDialogSetup::declareAuthDepPath( ::dbaccess::DATASOURCE_TYPE _eType, PathId _nPathId, WizardState _nFirstState, ... )
{
bool bHasAuthentication = DataSourceMetaData::getAuthentication( _eType ) != AuthNone;
@@ -491,47 +492,47 @@ void ODbTypeWizDialogSetup::activateDatabasePath()
case OGeneralPage::eConnectExternal:
{
m_eType = VerifyDataSourceType(m_pGeneralPage->GetSelectedType());
- if (m_eType == DST_UNKNOWN)
+ if (m_eType == ::dbaccess::DST_UNKNOWN)
m_eType = m_eOldType;
struct _map_type_to_path
{
- DATASOURCE_TYPE eType;
+ ::dbaccess::DATASOURCE_TYPE eType;
RoadmapWizardTypes::PathId nPathId;
} aKnownTypesAndPaths[] = {
- { DST_DBASE, DBASE_PATH },
- { DST_ADO, ADO_PATH },
- { DST_FLAT, TEXT_PATH },
- { DST_CALC, SPREADSHEET_PATH },
- { DST_ODBC, ODBC_PATH },
- { DST_JDBC, JDBC_PATH },
- { DST_MYSQL_JDBC, MYSQL_JDBC_PATH },
- { DST_MYSQL_NATIVE, MYSQL_NATIVE_PATH },
- { DST_MYSQL_ODBC, MYSQL_ODBC_PATH },
- { DST_ORACLE_JDBC, ORACLE_PATH },
- { DST_ADABAS, ADABAS_PATH },
- { DST_LDAP, LDAP_PATH },
- { DST_MSACCESS, MSACCESS_PATH },
- { DST_MSACCESS_2007,MSACCESS2007_PATH },
- { DST_OUTLOOKEXP, OUTLOOKEXP_PATH },
- { DST_OUTLOOK, OUTLOOK_PATH },
- { DST_MOZILLA, MOZILLA_PATH },
- { DST_THUNDERBIRD, THUNDERBIRD_PATH },
- { DST_EVOLUTION, EVOLUTION_PATH },
- { DST_EVOLUTION_GROUPWISE, EVOLUTION_PATH_GROUPWISE },
- { DST_EVOLUTION_LDAP, EVOLUTION_PATH_LDAP },
- { DST_KAB, KAB_PATH },
- { DST_MACAB, MACAB_PATH },
- { DST_USERDEFINE1, USERDEFINED_PATH },
- { DST_USERDEFINE2, USERDEFINED_PATH },
- { DST_USERDEFINE3, USERDEFINED_PATH },
- { DST_USERDEFINE4, USERDEFINED_PATH },
- { DST_USERDEFINE5, USERDEFINED_PATH },
- { DST_USERDEFINE6, USERDEFINED_PATH },
- { DST_USERDEFINE7, USERDEFINED_PATH },
- { DST_USERDEFINE8, USERDEFINED_PATH },
- { DST_USERDEFINE9, USERDEFINED_PATH },
- { DST_USERDEFINE10, USERDEFINED_PATH }
+ { ::dbaccess::DST_DBASE, DBASE_PATH },
+ { ::dbaccess::DST_ADO, ADO_PATH },
+ { ::dbaccess::DST_FLAT, TEXT_PATH },
+ { ::dbaccess::DST_CALC, SPREADSHEET_PATH },
+ { ::dbaccess::DST_ODBC, ODBC_PATH },
+ { ::dbaccess::DST_JDBC, JDBC_PATH },
+ { ::dbaccess::DST_MYSQL_JDBC, MYSQL_JDBC_PATH },
+ { ::dbaccess::DST_MYSQL_NATIVE, MYSQL_NATIVE_PATH },
+ { ::dbaccess::DST_MYSQL_ODBC, MYSQL_ODBC_PATH },
+ { ::dbaccess::DST_ORACLE_JDBC, ORACLE_PATH },
+ { ::dbaccess::DST_ADABAS, ADABAS_PATH },
+ { ::dbaccess::DST_LDAP, LDAP_PATH },
+ { ::dbaccess::DST_MSACCESS, MSACCESS_PATH },
+ { ::dbaccess::DST_MSACCESS_2007,MSACCESS2007_PATH },
+ { ::dbaccess::DST_OUTLOOKEXP, OUTLOOKEXP_PATH },
+ { ::dbaccess::DST_OUTLOOK, OUTLOOK_PATH },
+ { ::dbaccess::DST_MOZILLA, MOZILLA_PATH },
+ { ::dbaccess::DST_THUNDERBIRD, THUNDERBIRD_PATH },
+ { ::dbaccess::DST_EVOLUTION, EVOLUTION_PATH },
+ { ::dbaccess::DST_EVOLUTION_GROUPWISE, EVOLUTION_PATH_GROUPWISE },
+ { ::dbaccess::DST_EVOLUTION_LDAP, EVOLUTION_PATH_LDAP },
+ { ::dbaccess::DST_KAB, KAB_PATH },
+ { ::dbaccess::DST_MACAB, MACAB_PATH },
+ { ::dbaccess::DST_USERDEFINE1, USERDEFINED_PATH },
+ { ::dbaccess::DST_USERDEFINE2, USERDEFINED_PATH },
+ { ::dbaccess::DST_USERDEFINE3, USERDEFINED_PATH },
+ { ::dbaccess::DST_USERDEFINE4, USERDEFINED_PATH },
+ { ::dbaccess::DST_USERDEFINE5, USERDEFINED_PATH },
+ { ::dbaccess::DST_USERDEFINE6, USERDEFINED_PATH },
+ { ::dbaccess::DST_USERDEFINE7, USERDEFINED_PATH },
+ { ::dbaccess::DST_USERDEFINE8, USERDEFINED_PATH },
+ { ::dbaccess::DST_USERDEFINE9, USERDEFINED_PATH },
+ { ::dbaccess::DST_USERDEFINE10, USERDEFINED_PATH }
};
size_t i = 0;
@@ -591,15 +592,15 @@ sal_Bool ODbTypeWizDialogSetup::IsConnectionUrlRequired()
{
switch ( m_eType )
{
- case DST_KAB:
- case DST_MACAB:
- case DST_EVOLUTION:
- case DST_EVOLUTION_GROUPWISE:
- case DST_EVOLUTION_LDAP:
- case DST_OUTLOOK:
- case DST_OUTLOOKEXP:
- case DST_MOZILLA:
- case DST_THUNDERBIRD:
+ case ::dbaccess::DST_KAB:
+ case ::dbaccess::DST_MACAB:
+ case ::dbaccess::DST_EVOLUTION:
+ case ::dbaccess::DST_EVOLUTION_GROUPWISE:
+ case ::dbaccess::DST_EVOLUTION_LDAP:
+ case ::dbaccess::DST_OUTLOOK:
+ case ::dbaccess::DST_OUTLOOKEXP:
+ case ::dbaccess::DST_MOZILLA:
+ case ::dbaccess::DST_THUNDERBIRD:
return sal_False;
default:
return sal_True;
@@ -650,21 +651,21 @@ Reference< XDriver > ODbTypeWizDialogSetup::getDriver()
}
-DATASOURCE_TYPE ODbTypeWizDialogSetup::VerifyDataSourceType(const DATASOURCE_TYPE _DatabaseType) const
+::dbaccess::DATASOURCE_TYPE ODbTypeWizDialogSetup::VerifyDataSourceType(const ::dbaccess::DATASOURCE_TYPE _DatabaseType) const
{
- DATASOURCE_TYPE LocDatabaseType = _DatabaseType;
- if ((LocDatabaseType == DST_MYSQL_JDBC) || (LocDatabaseType == DST_MYSQL_ODBC) || (LocDatabaseType == DST_MYSQL_NATIVE))
+ ::dbaccess::DATASOURCE_TYPE LocDatabaseType = _DatabaseType;
+ if ((LocDatabaseType == ::dbaccess::DST_MYSQL_JDBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_ODBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_NATIVE))
{
if (m_pMySQLIntroPage != NULL)
{
switch( m_pMySQLIntroPage->getMySQLMode() )
{
case OMySQLIntroPageSetup::VIA_JDBC:
- return DST_MYSQL_JDBC;
+ return ::dbaccess::DST_MYSQL_JDBC;
case OMySQLIntroPageSetup::VIA_NATIVE:
- return DST_MYSQL_NATIVE;
+ return ::dbaccess::DST_MYSQL_NATIVE;
case OMySQLIntroPageSetup::VIA_ODBC:
- return DST_MYSQL_ODBC;
+ return ::dbaccess::DST_MYSQL_ODBC;
}
}
}
@@ -674,9 +675,9 @@ DATASOURCE_TYPE ODbTypeWizDialogSetup::VerifyDataSourceType(const DATASOURCE_TYP
// -----------------------------------------------------------------------------
-DATASOURCE_TYPE ODbTypeWizDialogSetup::getDatasourceType(const SfxItemSet& _rSet) const
+::dbaccess::DATASOURCE_TYPE ODbTypeWizDialogSetup::getDatasourceType(const SfxItemSet& _rSet) const
{
- DATASOURCE_TYPE LocDatabaseType = m_pImpl->getDatasourceType(_rSet);
+ ::dbaccess::DATASOURCE_TYPE LocDatabaseType = m_pImpl->getDatasourceType(_rSet);
return VerifyDataSourceType(LocDatabaseType);
}
@@ -724,16 +725,16 @@ TabPage* ODbTypeWizDialogSetup::createPage(WizardState _nState)
break;
case PAGE_DBSETUPWIZARD_MYSQL_ODBC:
- m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix(DST_MYSQL_ODBC)));
+ m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix( ::dbaccess::DST_MYSQL_ODBC)));
pPage = OConnectionTabPageSetup::CreateODBCTabPage( this, *m_pOutSet);
break;
case PAGE_DBSETUPWIZARD_MYSQL_JDBC:
- m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix(DST_MYSQL_JDBC)));
+ m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix( ::dbaccess::DST_MYSQL_JDBC)));
pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( this, *m_pOutSet);
break;
case PAGE_DBSETUPWIZARD_MYSQL_NATIVE:
- m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix(DST_MYSQL_NATIVE)));
+ m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix( ::dbaccess::DST_MYSQL_NATIVE)));
pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLNATIVETabPage( this, *m_pOutSet);
break;
@@ -812,16 +813,16 @@ IMPL_LINK(ODbTypeWizDialogSetup, ImplModifiedHdl, OGenericAdministrationPage*, _
// -----------------------------------------------------------------------------
IMPL_LINK(ODbTypeWizDialogSetup, ImplClickHdl, OMySQLIntroPageSetup*, /*_pMySQLIntroPageSetup*/)
{
- const DATASOURCE_TYPE eType = getDatasourceType(*m_pOutSet);
+ const ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(*m_pOutSet);
switch( eType )
{
- case DST_MYSQL_ODBC:
+ case ::dbaccess::DST_MYSQL_ODBC:
activatePath( MYSQL_ODBC_PATH, sal_True);
break;
- case DST_MYSQL_JDBC:
+ case ::dbaccess::DST_MYSQL_JDBC:
activatePath( MYSQL_JDBC_PATH, sal_True);
break;
- case DST_MYSQL_NATIVE:
+ case ::dbaccess::DST_MYSQL_NATIVE:
activatePath( MYSQL_NATIVE_PATH, sal_True);
break;
default:
@@ -887,7 +888,7 @@ sal_Bool ODbTypeWizDialogSetup::leaveState(WizardState _nState)
return sal_True;
if ( _nState == PAGE_DBSETUPWIZARD_INTRO )
{
- OSL_ENSURE(m_eType != DST_UNKNOWN && m_eOldType != DST_UNKNOWN,"Type unknown");
+ OSL_ENSURE(m_eType != ::dbaccess::DST_UNKNOWN && m_eOldType != ::dbaccess::DST_UNKNOWN,"Type unknown");
if ( m_eType != m_eOldType )
resetPages(m_pImpl->getCurrentDataSource());
}
@@ -1023,14 +1024,14 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
}
//-------------------------------------------------------------------------
- DATASOURCE_TYPE ODbTypeWizDialogSetup::getDefaultDatabaseType() const
+ ::dbaccess::DATASOURCE_TYPE ODbTypeWizDialogSetup::getDefaultDatabaseType() const
{
- DATASOURCE_TYPE eRet = DST_DBASE;
+ ::dbaccess::DATASOURCE_TYPE eRet = ::dbaccess::DST_DBASE;
- ::rtl::OUString sURL = m_pCollection->getDatasourcePrefix( DST_EMBEDDED_HSQLDB );
+ ::rtl::OUString sURL = m_pCollection->getDatasourcePrefix( ::dbaccess::DST_EMBEDDED_HSQLDB );
Reference< XDriverAccess > xDriverManager( getORB()->createInstance( SERVICE_SDBC_DRIVERMANAGER ), UNO_QUERY );
if ( xDriverManager.is() && xDriverManager->getDriverByURL( sURL ).is() )
- eRet = DST_EMBEDDED_HSQLDB;
+ eRet = ::dbaccess::DST_EMBEDDED_HSQLDB;
return eRet;
}
@@ -1039,23 +1040,23 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
void ODbTypeWizDialogSetup::CreateDatabase()
{
::rtl::OUString sUrl;
- DATASOURCE_TYPE eType = getDefaultDatabaseType();
- if ( eType == DST_EMBEDDED_HSQLDB )
+ ::dbaccess::DATASOURCE_TYPE eType = getDefaultDatabaseType();
+ if ( eType == ::dbaccess::DST_EMBEDDED_HSQLDB )
{
- sUrl = m_pCollection->getDatasourcePrefix( DST_EMBEDDED_HSQLDB );
+ sUrl = m_pCollection->getDatasourcePrefix( ::dbaccess::DST_EMBEDDED_HSQLDB );
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
OSL_ENSURE(xDatasource.is(),"DataSource is null!");
if ( xDatasource.is() )
- xDatasource->setPropertyValue( PROPERTY_INFO, makeAny( m_pCollection->getDefaultDBSettings( DST_EMBEDDED_HSQLDB ) ) );
+ xDatasource->setPropertyValue( PROPERTY_INFO, makeAny( m_pCollection->getDefaultDBSettings( ::dbaccess::DST_EMBEDDED_HSQLDB ) ) );
m_pImpl->translateProperties(xDatasource,*m_pOutSet);
}
- if ( eType == DST_DBASE )
+ if ( eType == ::dbaccess::DST_DBASE )
{
Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" )), UNO_QUERY);
INetURLObject aDBPathURL(m_sWorkPath);
aDBPathURL.Append(m_aDocURL.getBase());
createUniqueFolderName(&aDBPathURL);
- ::rtl::OUString sPrefix = m_pCollection->getDatasourcePrefix(DST_DBASE);
+ ::rtl::OUString sPrefix = m_pCollection->getDatasourcePrefix( ::dbaccess::DST_DBASE);
sUrl = aDBPathURL.GetMainURL( INetURLObject::NO_DECODE);
xSimpleFileAccess->createFolder(sUrl);
//OFileNotation aFileNotation(sUrl);
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index ce041631a..e4ed10ebb 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: detailpages.cxx,v $
- * $Revision: 1.53 $
+ * $Revision: 1.53.18.1 $
*
* This file is part of OpenOffice.org.
*
@@ -39,6 +39,7 @@
#include "dsitems.hxx"
#include "dbfindex.hxx"
#include "localresaccess.hxx"
+#include "dsnItem.hxx"
#include "dbaccess_helpid.hrc"
#include "dbu_dlg.hrc"
@@ -311,7 +312,7 @@ namespace dbaui
// get the DSN string (needed for the index dialog)
SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True);
SFX_ITEMSET_GET(_rSet, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True);
- ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL;
+ ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL;
if (pTypeCollection && pUrlItem && pUrlItem->GetValue().Len())
m_sDsn = pTypeCollection->cutPrefix(pUrlItem->GetValue());
@@ -1058,7 +1059,7 @@ namespace dbaui
//------------------------------------------------------------------------
SfxTabPage* ODriversSettings::CreateSpecialSettingsPage( Window* _pParent, const SfxItemSet& _rAttrSet )
{
- DATASOURCE_TYPE eType = ODbDataSourceAdministrationHelper::getDatasourceType( _rAttrSet );
+ ::dbaccess::DATASOURCE_TYPE eType = ODbDataSourceAdministrationHelper::getDatasourceType( _rAttrSet );
DataSourceMetaData aMetaData( eType );
return new SpecialSettingsPage( _pParent, _rAttrSet, aMetaData );
}
diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx
index be4e87a04..c01e16d8f 100644
--- a/dbaccess/source/ui/dlg/dsselect.cxx
+++ b/dbaccess/source/ui/dlg/dsselect.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dsselect.cxx,v $
- * $Revision: 1.23 $
+ * $Revision: 1.23.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -107,7 +107,7 @@ using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::comphelper;
//==================================================================
-ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringBag& _rDatasources, DATASOURCE_TYPE _eType,SfxItemSet* _pOutputSet)
+ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringBag& _rDatasources, ::dbaccess::DATASOURCE_TYPE _eType,SfxItemSet* _pOutputSet)
:ModalDialog(_pParent, ModuleRes(DLG_DATASOURCE_SELECTION))
,m_aDescription (this, ModuleRes(FT_DESCRIPTION))
,m_aDatasource (this, ModuleRes(LB_DATASOURCE))
@@ -120,7 +120,7 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringB
,m_aCreateAdabasDB (this, ModuleRes(PB_CREATE))
,m_pOutputSet(_pOutputSet)
{
- if (DST_ADABAS == _eType)
+ if ( ::dbaccess::DST_ADABAS == _eType)
{ // set a new title (indicating that we're browsing local data sources only)
SetText(ModuleRes(STR_LOCAL_DATASOURCES));
m_aDescription.SetText(ModuleRes(STR_DESCRIPTION2));
@@ -158,7 +158,7 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringB
fillListBox(_rDatasources);
#ifdef HAVE_ODBC_ADMINISTRATION
// allow ODBC datasource managenment
- if ( DST_ODBC == _eType || DST_MYSQL_ODBC == _eType )
+ if ( ::dbaccess::DST_ODBC == _eType || ::dbaccess::DST_MYSQL_ODBC == _eType )
{
m_aManageDatasources.Show();
m_aManageDatasources.Enable();
diff --git a/dbaccess/source/ui/dlg/dsselect.hxx b/dbaccess/source/ui/dlg/dsselect.hxx
index e15a54c02..4adb8c0f2 100644
--- a/dbaccess/source/ui/dlg/dsselect.hxx
+++ b/dbaccess/source/ui/dlg/dsselect.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dsselect.hxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -72,7 +72,7 @@ protected:
#endif
public:
- ODatasourceSelectDialog( Window* _pParent, const StringBag& _rDatasources, DATASOURCE_TYPE _eType,SfxItemSet* _pOutputSet = NULL );
+ ODatasourceSelectDialog( Window* _pParent, const StringBag& _rDatasources, ::dbaccess::DATASOURCE_TYPE _eType,SfxItemSet* _pOutputSet = NULL );
~ODatasourceSelectDialog();
inline String GetSelected() const { return m_aDatasource.GetSelectEntry();}
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index d488647ee..b4cc4b273 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: generalpage.cxx,v $
- * $Revision: 1.57 $
+ * $Revision: 1.56.68.2 $
*
* This file is part of OpenOffice.org.
*
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
+#include "dsnItem.hxx"
#ifndef _DBAUI_GENERALPAGE_HXX_
#include "generalpage.hxx"
#endif
@@ -119,8 +120,8 @@ namespace dbaui
,m_sMySQLEntry (ModuleRes(STR_MYSQLENTRY))
,m_eOriginalCreationMode (eCreateNew)
,m_pCollection (NULL)
- ,m_eCurrentSelection (DST_UNKNOWN)
- ,m_eNotSupportedKnownType (DST_UNKNOWN)
+ ,m_eCurrentSelection ( ::dbaccess::DST_UNKNOWN)
+ ,m_eNotSupportedKnownType ( ::dbaccess::DST_UNKNOWN)
,m_eLastMessage (smNone)
,m_bDisplayingInvalid (sal_False)
,m_bUserGrabFocus (sal_True)
@@ -158,10 +159,10 @@ namespace dbaui
{
struct DisplayedType
{
- DATASOURCE_TYPE eType;
+ ::dbaccess::DATASOURCE_TYPE eType;
String sDisplayName;
- DisplayedType( DATASOURCE_TYPE _eType, const String& _rDisplayName ) : eType( _eType ), sDisplayName( _rDisplayName ) { }
+ DisplayedType( ::dbaccess::DATASOURCE_TYPE _eType, const String& _rDisplayName ) : eType( _eType ), sDisplayName( _rDisplayName ) { }
};
typedef ::std::vector< DisplayedType > DisplayedTypes;
@@ -201,12 +202,12 @@ namespace dbaui
{
DisplayedTypes aDisplayedTypes;
- for ( ODsnTypeCollection::TypeIterator aTypeLoop = m_pCollection->begin();
+ for ( ::dbaccess::ODsnTypeCollection::TypeIterator aTypeLoop = m_pCollection->begin();
aTypeLoop != m_pCollection->end();
++aTypeLoop
)
{
- DATASOURCE_TYPE eType = aTypeLoop.getType();
+ ::dbaccess::DATASOURCE_TYPE eType = aTypeLoop.getType();
if ( xDriverManager.is() )
{ // we have a driver manager to check
@@ -235,7 +236,7 @@ namespace dbaui
//-------------------------------------------------------------------------
- void OGeneralPage::setParentTitle(DATASOURCE_TYPE _eSelectedType)
+ void OGeneralPage::setParentTitle(::dbaccess::DATASOURCE_TYPE _eSelectedType)
{
if (!m_DBWizardMode)
{
@@ -271,7 +272,7 @@ namespace dbaui
}
//-------------------------------------------------------------------------
- void OGeneralPage::switchMessage(const DATASOURCE_TYPE _eType)
+ void OGeneralPage::switchMessage(const ::dbaccess::DATASOURCE_TYPE _eType)
{
SPECIAL_MESSAGE eMessage = smNone;
if ( _eType == m_eNotSupportedKnownType )
@@ -298,7 +299,7 @@ namespace dbaui
}
//-------------------------------------------------------------------------
- void OGeneralPage::onTypeSelected(const DATASOURCE_TYPE _eType)
+ void OGeneralPage::onTypeSelected(const ::dbaccess::DATASOURCE_TYPE _eType)
{
// the the new URL text as indicated by the selection history
implSetCurrentType( _eType );
@@ -381,9 +382,9 @@ namespace dbaui
sConnectURL = pUrlItem->GetValue();
}
- DATASOURCE_TYPE eOldSelection = m_eCurrentSelection;
- m_eNotSupportedKnownType = DST_UNKNOWN;
- implSetCurrentType( DST_UNKNOWN );
+ ::dbaccess::DATASOURCE_TYPE eOldSelection = m_eCurrentSelection;
+ m_eNotSupportedKnownType = ::dbaccess::DST_UNKNOWN;
+ implSetCurrentType( ::dbaccess::DST_UNKNOWN );
// compare the DSN prefix with the registered ones
String sDisplayName;
@@ -408,7 +409,7 @@ namespace dbaui
}
if (m_aRB_CreateDatabase.IsChecked() && m_DBWizardMode)
- sDisplayName = m_pCollection->getTypeDisplayName(DST_JDBC);
+ sDisplayName = m_pCollection->getTypeDisplayName( ::dbaccess::DST_JDBC);
m_pDatasourceType->SelectEntry(sDisplayName);
// notify our listener that our type selection has changed (if so)
@@ -427,22 +428,22 @@ namespace dbaui
// For the databaseWizard we only have one entry for the MySQL Database,
// because we have a seperate tabpage to retrieve the respective datasource type
- // (DST_MYSQL_ODBC || DST_MYSQL_JDBC). Therefore we use DST_MYSQL_JDBC as a temporary
+ // ( ::dbaccess::DST_MYSQL_ODBC || ::dbaccess::DST_MYSQL_JDBC). Therefore we use ::dbaccess::DST_MYSQL_JDBC as a temporary
// representative for all MySQl databases)
// Also, embedded databases (embedded HSQL, at the moment), are not to appear in the list of
// databases to connect to.
- bool OGeneralPage::approveDataSourceType( DATASOURCE_TYPE eType, String& _inout_rDisplayName )
+ bool OGeneralPage::approveDataSourceType( ::dbaccess::DATASOURCE_TYPE eType, String& _inout_rDisplayName )
{
- if ( m_DBWizardMode && ( eType == DST_MYSQL_JDBC ) )
+ if ( m_DBWizardMode && ( eType == ::dbaccess::DST_MYSQL_JDBC ) )
_inout_rDisplayName = m_sMySQLEntry;
- else if ( m_DBWizardMode && ( eType == DST_MYSQL_ODBC ) )
+ else if ( m_DBWizardMode && ( eType == ::dbaccess::DST_MYSQL_ODBC ) )
_inout_rDisplayName = String();
- else if ( m_DBWizardMode && ( eType == DST_MYSQL_NATIVE ) )
+ else if ( m_DBWizardMode && ( eType == ::dbaccess::DST_MYSQL_NATIVE ) )
_inout_rDisplayName = String();
- else if ( eType == DST_EMBEDDED_HSQLDB )
+ else if ( eType == ::dbaccess::DST_EMBEDDED_HSQLDB )
_inout_rDisplayName = String();
return _inout_rDisplayName.Len() > 0;
@@ -450,7 +451,7 @@ namespace dbaui
// -----------------------------------------------------------------------
- void OGeneralPage::insertDatasourceTypeEntryData(DATASOURCE_TYPE _eType, String sDisplayName)
+ void OGeneralPage::insertDatasourceTypeEntryData(::dbaccess::DATASOURCE_TYPE _eType, String sDisplayName)
{
// insert a (temporary) entry
sal_uInt16 nPos = m_pDatasourceType->InsertEntry(sDisplayName);
@@ -479,7 +480,7 @@ namespace dbaui
}
//-------------------------------------------------------------------------
- void OGeneralPage::implSetCurrentType( const DATASOURCE_TYPE _eType )
+ void OGeneralPage::implSetCurrentType( const ::dbaccess::DATASOURCE_TYPE _eType )
{
if ( _eType == m_eCurrentSelection )
return;
@@ -491,7 +492,7 @@ namespace dbaui
void OGeneralPage::Reset(const SfxItemSet& _rCoreAttrs)
{
// reset all locale data
- implSetCurrentType( DST_UNKNOWN );
+ implSetCurrentType( ::dbaccess::DST_UNKNOWN );
// this ensures that our type selection link will be called, even if the new is is the same as the
// current one
OGenericAdministrationPage::Reset(_rCoreAttrs);
@@ -507,7 +508,7 @@ namespace dbaui
{
if ( m_aRB_CreateDatabase.IsChecked() )
{
- _rCoreAttrs.Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix(DST_DBASE)));
+ _rCoreAttrs.Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix( ::dbaccess::DST_DBASE)));
bChangedSomething = sal_True;
bCommitTypeSelection = false;
}
@@ -524,7 +525,7 @@ namespace dbaui
if ( bCommitTypeSelection )
{
USHORT nEntry = m_pDatasourceType->GetSelectEntryPos();
- DATASOURCE_TYPE eSelectedType = static_cast<DATASOURCE_TYPE>(reinterpret_cast<sal_IntPtr>(m_pDatasourceType->GetEntryData(nEntry)));
+ ::dbaccess::DATASOURCE_TYPE eSelectedType = static_cast< ::dbaccess::DATASOURCE_TYPE>(reinterpret_cast<sal_IntPtr>(m_pDatasourceType->GetEntryData(nEntry)));
if (m_DBWizardMode)
{
if ( ( m_pDatasourceType->GetSavedValue() != nEntry )
@@ -554,7 +555,7 @@ namespace dbaui
{
// get the type from the entry data
sal_Int16 nSelected = _pBox->GetSelectEntryPos();
- DATASOURCE_TYPE eSelectedType = static_cast<DATASOURCE_TYPE>(reinterpret_cast<sal_IntPtr>(_pBox->GetEntryData(nSelected)));
+ ::dbaccess::DATASOURCE_TYPE eSelectedType = static_cast< ::dbaccess::DATASOURCE_TYPE>(reinterpret_cast<sal_IntPtr>(_pBox->GetEntryData(nSelected)));
setParentTitle(eSelectedType);
// let the impl method do all the stuff
diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx
index 1dfc87937..041572847 100644
--- a/dbaccess/source/ui/dlg/generalpage.hxx
+++ b/dbaccess/source/ui/dlg/generalpage.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: generalpage.hxx,v $
- * $Revision: 1.22 $
+ * $Revision: 1.22.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -104,9 +104,10 @@ namespace dbaui
m_aControlDependencies;
- ODsnTypeCollection* m_pCollection; /// the DSN type collection instance
- DATASOURCE_TYPE m_eCurrentSelection; /// currently selected type
- DATASOURCE_TYPE m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered ....
+ ::dbaccess::ODsnTypeCollection*
+ m_pCollection; /// the DSN type collection instance
+ ::dbaccess::DATASOURCE_TYPE m_eCurrentSelection; /// currently selected type
+ ::dbaccess::DATASOURCE_TYPE m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered ....
enum SPECIAL_MESSAGE
{
@@ -121,8 +122,8 @@ namespace dbaui
Link m_aChooseDocumentHandler; /// to be called when a recent document has been definately chosen
sal_Bool m_bDisplayingInvalid : 1; // the currently displayed data source is deleted
sal_Bool m_bUserGrabFocus : 1;
- bool approveDataSourceType( DATASOURCE_TYPE eType, String& _inout_rDisplayName );
- void insertDatasourceTypeEntryData(DATASOURCE_TYPE eType, String sDisplayName);
+ bool approveDataSourceType( ::dbaccess::DATASOURCE_TYPE eType, String& _inout_rDisplayName );
+ void insertDatasourceTypeEntryData(::dbaccess::DATASOURCE_TYPE eType, String sDisplayName);
public:
static SfxTabPage* Create(Window* pParent, const SfxItemSet& _rAttrSet, sal_Bool _bDBWizardMode = sal_False);
@@ -137,7 +138,7 @@ namespace dbaui
DocumentDescriptor GetSelectedDocument() const;
/// get the currently selected datasource type
- DATASOURCE_TYPE GetSelectedType() const { return m_eCurrentSelection; }
+ ::dbaccess::DATASOURCE_TYPE GetSelectedType() const { return m_eCurrentSelection; }
protected:
// SfxTabPage overridables
@@ -155,15 +156,15 @@ namespace dbaui
protected:
- void onTypeSelected(const DATASOURCE_TYPE _eType);
+ void onTypeSelected(const ::dbaccess::DATASOURCE_TYPE _eType);
void initializeTypeList();
- void implSetCurrentType( const DATASOURCE_TYPE _eType );
+ void implSetCurrentType( const ::dbaccess::DATASOURCE_TYPE _eType );
- void switchMessage(const DATASOURCE_TYPE _eType);
+ void switchMessage(const ::dbaccess::DATASOURCE_TYPE _eType);
/// sets the the title of the parent dialog
- void setParentTitle(DATASOURCE_TYPE _eSelectedType);
+ void setParentTitle(::dbaccess::DATASOURCE_TYPE _eSelectedType);
DECL_LINK(OnDatasourceTypeSelected, ListBox*);
DECL_LINK(OnSetupModeSelected, RadioButton*);
diff --git a/dbaccess/source/ui/inc/AdabasStatDlg.hxx b/dbaccess/source/ui/inc/AdabasStatDlg.hxx
index f5180d344..0d165d4db 100644
--- a/dbaccess/source/ui/inc/AdabasStatDlg.hxx
+++ b/dbaccess/source/ui/inc/AdabasStatDlg.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AdabasStatDlg.hxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -86,7 +86,7 @@ namespace dbaui
virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver();
- virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
+ virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
virtual void clearPassword();
virtual sal_Bool saveDatasource();
virtual void setTitle(const ::rtl::OUString& _sTitle);
diff --git a/dbaccess/source/ui/inc/IItemSetHelper.hxx b/dbaccess/source/ui/inc/IItemSetHelper.hxx
index 2ccbfb5e9..be1bbba13 100644
--- a/dbaccess/source/ui/inc/IItemSetHelper.hxx
+++ b/dbaccess/source/ui/inc/IItemSetHelper.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: IItemSetHelper.hxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -62,7 +62,7 @@ namespace dbaui
virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const = 0;
virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection() = 0;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver() = 0;
- virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const = 0;
+ virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const = 0;
virtual void clearPassword() = 0;
virtual sal_Bool saveDatasource() = 0;
virtual void setTitle(const ::rtl::OUString& _sTitle) = 0;
diff --git a/dbaccess/source/ui/inc/RelationTableView.hxx b/dbaccess/source/ui/inc/RelationTableView.hxx
index b325fa374..a7b80c4ba 100644
--- a/dbaccess/source/ui/inc/RelationTableView.hxx
+++ b/dbaccess/source/ui/inc/RelationTableView.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RelationTableView.hxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.11.26.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,18 +30,24 @@
#ifndef DBAUI_RELATION_TABLEVIEW_HXX
#define DBAUI_RELATION_TABLEVIEW_HXX
-#ifndef DBAUI_JOINTABLEVIEW_HXX
#include "JoinTableView.hxx"
-#endif
+#include <comphelper/containermultiplexer.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <rtl/ref.hxx>
namespace dbaui
{
class ORelationDesignView;
- class ORelationTableView : public OJoinTableView
+ class ORelationTableView : public ::cppu::BaseMutex
+ , public OJoinTableView
+ , public ::comphelper::OContainerListener
{
OTableConnection* m_pExistingConnection; // is set when a connection was draged on an existing connection
TTableConnectionData::value_type m_pCurrentlyTabConnData; // set when we creating a connection with more than one keycolumn
- protected:
+ ::rtl::Reference< comphelper::OContainerListenerAdapter>
+ m_pContainerListener;
+ bool m_bInRemove;
+
virtual void ConnDoubleClicked( OTableConnection* pConnection );
virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL bNewTable = FALSE);
@@ -51,6 +57,11 @@ namespace dbaui
*/
virtual bool allowQueries() const;
+ // OContainerListener
+ virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
public:
ORelationTableView( Window* pParent, ORelationDesignView* pView );
virtual ~ORelationTableView();
diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx
index 3f7a1f84e..a6b8c1e69 100644
--- a/dbaccess/source/ui/inc/TableController.hxx
+++ b/dbaccess/source/ui/inc/TableController.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableController.hxx,v $
- * $Revision: 1.40 $
+ * $Revision: 1.40.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -60,6 +60,7 @@
#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
#endif
+#include "dsntypes.hxx"
class FixedText;
namespace dbaui
@@ -70,10 +71,11 @@ namespace dbaui
class OTableController : public OTableController_BASE
{
private:
- OModuleClient m_aModuleClient;
+ OModuleClient m_aModuleClient;
::std::vector< ::boost::shared_ptr<OTableRow> > m_vRowList;
- OTypeInfoMap m_aTypeInfo;
- ::std::vector<OTypeInfoMap::iterator> m_aTypeInfoIndex;
+ OTypeInfoMap m_aTypeInfo;
+ ::std::vector<OTypeInfoMap::iterator> m_aTypeInfoIndex;
+ ::dbaccess::ODsnTypeCollection m_aTypeCollection;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xTable;
@@ -125,7 +127,7 @@ namespace dbaui
sal_Bool isAddAllowed() const;
sal_Bool isDropAllowed() const;
sal_Bool isAlterAllowed() const;
-
+ bool isAutoIncrementPrimaryKey() const;
inline sal_Bool isAutoIncrementValueEnabled() const { return m_bAllowAutoIncrementValue; }
inline const ::rtl::OUString& getAutoIncrementValue() const { return m_sAutoIncrementValue; }
diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx
index e21fb816e..03d3b5bf0 100644
--- a/dbaccess/source/ui/inc/TableWindow.hxx
+++ b/dbaccess/source/ui/inc/TableWindow.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableWindow.hxx,v $
- * $Revision: 1.19 $
+ * $Revision: 1.19.68.2 $
*
* This file is part of OpenOffice.org.
*
@@ -30,28 +30,17 @@
#ifndef DBAUI_TABLEWINDOW_HXX
#define DBAUI_TABLEWINDOW_HXX
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef DBAUI_TABLEWINDOWTITLE_HXX
#include "TableWindowTitle.hxx"
-#endif
-#ifndef _RTTI_HXX
#include <tools/rtti.hxx>
-#endif
-#ifndef DBAUI_TABLEWINDOWDATA_HXX
+#include <rtl/ref.hxx>
#include "TableWindowData.hxx"
-#endif
#include <vector>
-#ifndef _SV_WINDOW_HXX
#include <vcl/window.hxx>
-#endif
-#ifndef _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
-#include <unotools/eventlisteneradapter.hxx>
-#endif
+
+#include <comphelper/containermultiplexer.hxx>
+#include "cppuhelper/basemutex.hxx"
class SvLBoxEntry;
namespace dbaui
@@ -69,7 +58,9 @@ namespace dbaui
class OJoinTableView;
class OTableWindowAccess;
- class OTableWindow : public Window
+ class OTableWindow : public ::cppu::BaseMutex
+ ,public ::comphelper::OContainerListener
+ ,public Window
{
friend class OTableWindowTitle;
friend class OTableWindowListBox;
@@ -83,12 +74,18 @@ namespace dbaui
private:
TTableWindowData::value_type
m_pData;
+ ::rtl::Reference< comphelper::OContainerListenerAdapter>
+ m_pContainerListener;
sal_Int32 m_nMoveCount; // how often the arrow keys was pressed
sal_Int32 m_nMoveIncrement; // how many pixel we should move
UINT16 m_nSizingFlags;
BOOL m_bActive;
void Draw3DBorder( const Rectangle& rRect );
+ // OContainerListener
+ virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
protected:
virtual void Resize();
diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx
index 5e84b166e..3d053cae1 100644
--- a/dbaccess/source/ui/inc/TableWindowListBox.hxx
+++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableWindowListBox.hxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.11.68.2 $
*
* This file is part of OpenOffice.org.
*
@@ -30,13 +30,8 @@
#ifndef DBAUI_TABLEWINDOWLISTBOX_HXX
#define DBAUI_TABLEWINDOWLISTBOX_HXX
-#ifndef _SVTREEBOX_HXX
#include <svtools/svtreebx.hxx>
-#endif
-
-#ifndef _DBACCESS_UI_CALLBACKS_HXX_
#include "callbacks.hxx"
-#endif
struct AcceptDropEvent;
struct ExecuteDropEvent;
diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx
index 52f5259bb..479424891 100644
--- a/dbaccess/source/ui/inc/UITools.hxx
+++ b/dbaccess/source/ui/inc/UITools.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: UITools.hxx,v $
- * $Revision: 1.37 $
+ * $Revision: 1.37.26.1 $
*
* This file is part of OpenOffice.org.
*
@@ -105,7 +105,7 @@ class SvLBoxEntry;
namespace dbaui
{
// .........................................................................
- class ODsnTypeCollection;
+ //class ODsnTypeCollection;
class DBTreeListBox;
/** creates a new connection and appends the eventlistener
@@ -369,26 +369,7 @@ namespace dbaui
@return
the configuration node name of user defined drivers.
*/
- ::rtl::OUString getUserDefinedDriverNodeName();
-
- /** returns the configuration node name of user defined driver type display name.
- @return
- the configuration node name of user defined driver type display name.
- */
- ::rtl::OUString getDriverTypeDisplayNodeName();
-
- /** returns the configuration node name of user defined driver DSN prefix.
- @return
- the configuration node name of user defined driver DSN prefix.
- */
- ::rtl::OUString getDriverDsnPrefixNodeName();
-
- /** returns the configuration node name of user defined driver extension.
- @return
- the configuration node name of user defined driver extension.
- */
- ::rtl::OUString getDriverExtensionNodeName();
-
+
/** returns the result of the user action when view the query dialog.
@param _pParent
The parent of the dialog
diff --git a/dbaccess/source/ui/inc/UserAdminDlg.hxx b/dbaccess/source/ui/inc/UserAdminDlg.hxx
index 1a68efef8..88722c0b0 100644
--- a/dbaccess/source/ui/inc/UserAdminDlg.hxx
+++ b/dbaccess/source/ui/inc/UserAdminDlg.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: UserAdminDlg.hxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -90,7 +90,7 @@ namespace dbaui
virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver();
- virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
+ virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
virtual void clearPassword();
virtual sal_Bool saveDatasource();
virtual void setTitle(const ::rtl::OUString& _sTitle);
diff --git a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx
index 8d9da6de9..48d11c615 100644
--- a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx
+++ b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: advancedsettingsdlg.hxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.3.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -72,7 +72,7 @@ namespace dbaui
virtual ~AdvancedSettingsDialog();
/// determines whether or not the given data source type has any advanced setting
- static bool doesHaveAnyAdvancedSettings( DATASOURCE_TYPE _eType );
+ static bool doesHaveAnyAdvancedSettings( ::dbaccess::DATASOURCE_TYPE _eType );
virtual const SfxItemSet* getOutputSet() const;
virtual SfxItemSet* getWriteOutputSet();
@@ -83,7 +83,7 @@ namespace dbaui
virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver();
- virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
+ virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
virtual void clearPassword();
virtual sal_Bool saveDatasource();
virtual void setTitle(const ::rtl::OUString& _sTitle);
diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx
index d01925d70..5418777a6 100644
--- a/dbaccess/source/ui/inc/curledit.hxx
+++ b/dbaccess/source/ui/inc/curledit.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: curledit.hxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -55,7 +55,8 @@ namespace dbaui
*/
class OConnectionURLEdit : public Edit
{
- ODsnTypeCollection m_aTypeCollection;
+ ::dbaccess::ODsnTypeCollection
+ m_aTypeCollection;
FixedText* m_pForcedPrefix;
String m_sSaveValueNoPrefix;
BOOL m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not
diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx
index 2d73ac3b9..2c8546936 100644
--- a/dbaccess/source/ui/inc/dbadmin.hxx
+++ b/dbaccess/source/ui/inc/dbadmin.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbadmin.hxx,v $
- * $Revision: 1.36 $
+ * $Revision: 1.36.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -43,7 +43,6 @@
#ifndef _COMPHELPER_UNO3_HXX_
#include <comphelper/uno3.hxx>
#endif
-
#include <memory>
FORWARD_DECLARE_INTERFACE(beans,XPropertySet)
@@ -55,8 +54,6 @@ namespace dbaui
{
//.........................................................................
-class ODsnTypeCollection;
-
//=========================================================================
//= ODbAdminDialog
//=========================================================================
@@ -90,7 +87,7 @@ public:
@param _pTypeCollection pointer to an <type>ODatasourceMap</type>. May be NULL, in this case
the pool will not contain a typecollection default.
*/
- static SfxItemSet* createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults, ODsnTypeCollection* _pTypeCollection);
+ static SfxItemSet* createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults, ::dbaccess::ODsnTypeCollection* _pTypeCollection);
/** destroy and item set / item pool / pool defaults previously created by <method>createItemSet</method>
*/
static void destroyItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults);
@@ -108,7 +105,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver();
- virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
+ virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
virtual void clearPassword();
virtual sal_Bool saveDatasource();
virtual void setTitle(const ::rtl::OUString& _sTitle);
diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc
index 9c873f2a0..396451594 100644
--- a/dbaccess/source/ui/inc/dbu_resource.hrc
+++ b/dbaccess/source/ui/inc/dbu_resource.hrc
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbu_resource.hrc,v $
- * $Revision: 1.104 $
+ * $Revision: 1.104.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -390,7 +390,7 @@
//========================================================================
// untyped resources
-#define RSC_DATASOURCE_TYPES RID_UNTYPED_START + 1
+// free
#define RSC_CHARSETS RID_UNTYPED_START + 2
#define RSC_DATASOURCE_TYPE_UINAMES RID_UNTYPED_START + 3
#define RSC_QUERY_OBJECT_TYPE RID_UNTYPED_START + 4
diff --git a/dbaccess/source/ui/inc/dbwiz.hxx b/dbaccess/source/ui/inc/dbwiz.hxx
index f925352fb..9fc83513c 100644
--- a/dbaccess/source/ui/inc/dbwiz.hxx
+++ b/dbaccess/source/ui/inc/dbwiz.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbwiz.hxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -55,13 +55,15 @@ FORWARD_DECLARE_INTERFACE(beans,XPropertySet)
FORWARD_DECLARE_INTERFACE(sdbc,XConnection)
FORWARD_DECLARE_INTERFACE(lang,XMultiServiceFactory)
+namespace dbaccess
+{
+ class ODsnTypeCollection;
+}
//.........................................................................
namespace dbaui
{
//.........................................................................
-class ODsnTypeCollection;
-
//=========================================================================
//= ODbTypeWizDialog
//=========================================================================
@@ -75,7 +77,7 @@ private:
OModuleClient m_aModuleClient;
::std::auto_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
SfxItemSet* m_pOutSet;
- DATASOURCE_TYPE m_eType;
+ ::dbaccess::DATASOURCE_TYPE m_eType;
sal_Bool m_bResetting : 1; /// sal_True while we're resetting the pages
sal_Bool m_bApplied : 1; /// sal_True if any changes have been applied while the dialog was executing
@@ -99,7 +101,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver();
- virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
+ virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
virtual void clearPassword();
virtual sal_Bool saveDatasource();
virtual void setTitle(const ::rtl::OUString& _sTitle);
diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx
index ecf210783..9028756da 100644
--- a/dbaccess/source/ui/inc/dbwizsetup.hxx
+++ b/dbaccess/source/ui/inc/dbwizsetup.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbwizsetup.hxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -66,7 +66,6 @@ namespace dbaui
{
//.........................................................................
-class ODsnTypeCollection;
class OGenericAdministrationPage;
//=========================================================================
@@ -85,8 +84,8 @@ private:
OModuleClient m_aModuleClient;
::std::auto_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
SfxItemSet* m_pOutSet;
- DATASOURCE_TYPE m_eType;
- DATASOURCE_TYPE m_eOldType;
+ ::dbaccess::DATASOURCE_TYPE m_eType;
+ ::dbaccess::DATASOURCE_TYPE m_eOldType;
sal_Bool m_bResetting : 1; /// sal_True while we're resetting the pages
sal_Bool m_bApplied : 1; /// sal_True if any changes have been applied while the dialog was executing
sal_Bool m_bUIEnabled : 1; /// <TRUE/> if the UI is enabled, false otherwise. Cannot be switched back to <TRUE/>, once it is <FALSE/>
@@ -109,7 +108,8 @@ private:
String m_sWorkPath;
OGeneralPage* m_pGeneralPage;
OMySQLIntroPageSetup* m_pMySQLIntroPage;
- ODsnTypeCollection* m_pCollection; /// the DSN type collection instance
+ ::dbaccess::ODsnTypeCollection*
+ m_pCollection; /// the DSN type collection instance
@@ -131,7 +131,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver();
- virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
+ virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const;
virtual void clearPassword();
virtual void setTitle(const ::rtl::OUString& _sTitle);
virtual void enableConfirmSettings( bool _bEnable );
@@ -182,7 +182,7 @@ private:
the first state in this path, following by an arbitrary number of others, as in
RoadmapWizard::declarePath.
*/
- void declareAuthDepPath( DATASOURCE_TYPE _eType, PathId _nPathId, WizardState _nFirstState, ... );
+ void declareAuthDepPath( ::dbaccess::DATASOURCE_TYPE _eType, PathId _nPathId, WizardState _nFirstState, ... );
void RegisterDataSourceByLocation(const ::rtl::OUString& sPath);
sal_Bool SaveDatabaseDocument();
@@ -190,9 +190,9 @@ private:
String createUniqueFileName(const INetURLObject& rURL);
void CreateDatabase();
void createUniqueFolderName(INetURLObject* pURL);
- DATASOURCE_TYPE VerifyDataSourceType(const DATASOURCE_TYPE _DatabaseType) const;
+ ::dbaccess::DATASOURCE_TYPE VerifyDataSourceType(const ::dbaccess::DATASOURCE_TYPE _DatabaseType) const;
- DATASOURCE_TYPE getDefaultDatabaseType() const;
+ ::dbaccess::DATASOURCE_TYPE getDefaultDatabaseType() const;
void updateTypeDependentStates();
sal_Bool callSaveAsDialog();
diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx
index d6818ce9f..7dc7f788c 100644
--- a/dbaccess/source/ui/inc/dsmeta.hxx
+++ b/dbaccess/source/ui/inc/dsmeta.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dsmeta.hxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.68.2 $
*
* This file is part of OpenOffice.org.
*
@@ -70,7 +70,7 @@ namespace dbaui
class DataSourceMetaData
{
public:
- DataSourceMetaData( DATASOURCE_TYPE _eType );
+ DataSourceMetaData( ::dbaccess::DATASOURCE_TYPE _eType );
~DataSourceMetaData();
/// returns a struct describing this data source type's support for our known advanced settings
@@ -79,7 +79,7 @@ namespace dbaui
/// determines whether or not the data source requires authentication
AuthenticationMode getAuthentication() const;
- static AuthenticationMode getAuthentication( DATASOURCE_TYPE _eType );
+ static AuthenticationMode getAuthentication( ::dbaccess::DATASOURCE_TYPE _eType );
private:
::boost::shared_ptr< DataSourceMetaData_Impl > m_pImpl;
@@ -108,6 +108,7 @@ namespace dbaui
bool bBooleanComparisonMode;
bool bFormsCheckRequiredFields;
bool bIgnoreCurrency;
+ bool bAutoIncrementIsPrimaryKey;
// Note: If you extend this list, you need to adjust the ctor (of course)
// and (maybe) the implementation of supportsAnySpecialSetting
@@ -127,6 +128,7 @@ namespace dbaui
,bBooleanComparisonMode ( true )
,bFormsCheckRequiredFields ( true )
,bIgnoreCurrency ( false )
+ ,bAutoIncrementIsPrimaryKey ( false )
{
}
@@ -152,7 +154,9 @@ namespace dbaui
|| ( bUseDOSLineEnds == true )
|| ( bBooleanComparisonMode == true )
|| ( bFormsCheckRequiredFields == true )
- || ( bIgnoreCurrency == true );
+ || ( bIgnoreCurrency == true )
+ || ( bAutoIncrementIsPrimaryKey == true )
+ ;
}
//........................................................................
diff --git a/dbaccess/source/ui/inc/unoadmin.hxx b/dbaccess/source/ui/inc/unoadmin.hxx
index bba4a8821..21f4661e0 100644
--- a/dbaccess/source/ui/inc/unoadmin.hxx
+++ b/dbaccess/source/ui/inc/unoadmin.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: unoadmin.hxx,v $
- * $Revision: 1.13 $
+ * $Revision: 1.13.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -67,7 +67,8 @@ protected:
SfxItemSet* m_pDatasourceItems; // item set for the dialog
SfxItemPool* m_pItemPool; // item pool for the item set for the dialog
SfxPoolItem** m_pItemPoolDefaults; // pool defaults
- ODsnTypeCollection* m_pCollection; // datasource type collection
+ ::dbaccess::ODsnTypeCollection*
+ m_pCollection; // datasource type collection
::com::sun::star::uno::Any m_aInitialSelection;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection;
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index dfd4802be..38457fd01 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: UITools.cxx,v $
- * $Revision: 1.81 $
+ * $Revision: 1.81.24.1 $
*
* This file is part of OpenOffice.org.
*
@@ -1627,30 +1627,6 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType
return pTypeInfo;
}
// -----------------------------------------------------------------------------
-::rtl::OUString getUserDefinedDriverNodeName()
-{
- static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/UserDefinedDriverSettings"));
- return s_sNodeName;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString getDriverTypeDisplayNodeName()
-{
- static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("DriverTypeDisplayName"));
- return s_sNodeName;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString getDriverDsnPrefixNodeName()
-{
- static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("DriverDsnPrefix"));
- return s_sNodeName;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString getDriverExtensionNodeName()
-{
- static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("Extension"));
- return s_sNodeName;
-}
-// -----------------------------------------------------------------------------
sal_Int32 askForUserAction(Window* _pParent,USHORT _nTitle,USHORT _nText,sal_Bool _bAll,const ::rtl::OUString& _sName)
{
vos::OGuard aGuard( Application::GetSolarMutex() );
diff --git a/dbaccess/source/ui/misc/charsets.cxx b/dbaccess/source/ui/misc/charsets.cxx
index 943bd2471..de06d61f2 100644
--- a/dbaccess/source/ui/misc/charsets.cxx
+++ b/dbaccess/source/ui/misc/charsets.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: charsets.cxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -37,9 +37,6 @@
#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
#endif
-#ifndef _DBU_MISCRES_HRC_
-#include "dbumiscres.hrc"
-#endif
#ifndef _DBU_MISC_HRC_
#include "dbu_misc.hrc"
#endif
diff --git a/dbaccess/source/ui/misc/dbumiscres.src b/dbaccess/source/ui/misc/dbumiscres.src
index 6d59ff3af..3258c8375 100644
--- a/dbaccess/source/ui/misc/dbumiscres.src
+++ b/dbaccess/source/ui/misc/dbumiscres.src
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbumiscres.src,v $
- * $Revision: 1.80 $
+ * $Revision: 1.80.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -31,210 +31,7 @@
#ifndef _DBU_MISC_HRC_
#include "dbu_misc.hrc"
#endif
-#ifndef _DBU_MISCRES_HRC_
-#include "dbumiscres.hrc"
-#endif
-//-------------------------------------------------------------------------
-Resource RSC_DATASOURCE_TYPES
-{
- String STR_MYSQL_ODBC
- {
- Text ="sdbc:mysql:odbc:";
- };
- String STR_MYSQL_JDBC
- {
- Text ="sdbc:mysql:jdbc:";
- };
- String STR_ADABAS
- {
- Text ="sdbc:adabas:";
- };
- String STR_ORACLE_JDBC
- {
- Text ="jdbc:oracle:thin:";
- };
- String STR_JDBC
- {
- Text ="jdbc:";
- };
- String STR_ODBC
- {
- Text ="sdbc:odbc:";
- };
- String STR_DBASE
- {
- Text ="sdbc:dbase:";
- };
- String STR_MSACCESS
- {
- Text ="sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=";
- };
- String STR_MSACCESS2007
- {
- Text ="sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=";
- };
- String STR_ADO
- {
- Text ="sdbc:ado:";
- };
- String STR_FLAT
- {
- Text ="sdbc:flat:";
- };
- String STR_CALC
- {
- Text ="sdbc:calc:";
- };
- String STR_MOZILLA
- {
- Text ="sdbc:address:mozilla:";
- };
- String STR_LDAP
- {
- Text ="sdbc:address:ldap:";
- };
- String STR_OUTLOOK
- {
- Text ="sdbc:address:outlook";
- };
- String STR_OUTLOOKEXP
- {
- Text ="sdbc:address:outlookexp";
- };
- String STR_EVOLUTION
- {
- Text ="sdbc:address:evolution:local";
- };
- String STR_EVOLUTION_GROUPWISE
- {
- Text ="sdbc:address:evolution:groupwise";
- };
- String STR_EVOLUTION_LDAP
- {
- Text ="sdbc:address:evolution:ldap";
- };
- String STR_KAB
- {
- Text ="sdbc:address:kab";
- };
- String STR_EMBEDDED_HSQLDB
- {
- Text = "sdbc:embedded:hsqldb";
- };
- String STR_MACAB
- {
- Text ="sdbc:address:macab";
- };
- String STR_THUNDERBIRD
- {
- Text ="sdbc:address:thunderbird:";
- };
- String STR_MYSQL_NATIVE
- {
- Text ="sdbc:mysqlc:";
- };
-};
-Resource RSC_DATASOURCE_TYPE_UINAMES
-{
- String STR_MYSQL_ODBC
- {
- Text[ en-US ] = "MySQL (ODBC)";
- };
- String STR_MYSQL_JDBC
- {
- Text[ en-US ] = "MySQL (JDBC)";
- };
- String STR_ADABAS
- {
- Text[ en-US ] = "Adabas D";
- };
- String STR_ORACLE_JDBC
- {
- Text[ en-US ] = "Oracle JDBC";
- };
-
- String STR_JDBC
- {
- Text[ en-US ] = "JDBC";
- };
- String STR_ODBC
- {
- Text[ en-US ] = "ODBC";
- };
- String STR_DBASE
- {
- Text[ en-US ] = "dBASE";
- };
- String STR_MSACCESS
- {
- Text[ en-US ] = "Microsoft Access";
- };
- String STR_MSACCESS2007
- {
- Text[ en-US ] = "Microsoft Access 2007";
- };
- String STR_ADO
- {
- Text[ en-US ] = "ADO";
- };
- String STR_FLAT
- {
- Text[ en-US ] = "Text";
- };
- String STR_CALC
- {
- Text[ en-US ] = "Spreadsheet";
- };
- String STR_MOZILLA
- {
- Text[ en-US ] = "Mozilla Address Book";
- };
- String STR_LDAP
- {
- Text[ en-US ] = "LDAP Address Book";
- };
- String STR_OUTLOOK
- {
- Text[ en-US ] = "Microsoft Outlook Address Book";
- };
- String STR_OUTLOOKEXP
- {
- Text[ en-US ] = "Microsoft Windows Address Book";
- };
- String STR_EVOLUTION
- {
- Text[ en-US ] = "Evolution Local";
- };
- String STR_EVOLUTION_GROUPWISE
- {
- Text[ en-US ] = "Groupwise";
- };
- String STR_EVOLUTION_LDAP
- {
- Text[ en-US ] = "Evolution LDAP";
- };
- String STR_KAB
- {
- Text[ en-US ] = "KDE Address Book";
- };
- String STR_MACAB
- {
- Text[ en-US ] = "Mac OS X Address Book";
- };
- String STR_EMBEDDED_HSQLDB
- {
- Text[ en-US ] = "HSQL database engine";
- };
- String STR_THUNDERBIRD
- {
- Text[ en-US ] = "Thunderbird Address Book";
- };
- String STR_MYSQL_NATIVE
- {
- Text[ en-US ] = "MySQL (Native)";
- };
-};
Resource RSC_CHARSETS
{
diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx
index 9d6a2a73d..2a6f7374e 100644
--- a/dbaccess/source/ui/misc/dsmeta.cxx
+++ b/dbaccess/source/ui/misc/dsmeta.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dsmeta.cxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.8.2 $
*
* This file is part of OpenOffice.org.
*
@@ -47,7 +47,7 @@ namespace dbaui
{
// strange ctor, but makes instantiating this class more readable (see below)
InitAdvanced( short _Generated, short _SQL, short _Append, short _As, short _Outer, short _Priv, short _Param,
- short _Version, short _Catalog, short _Schema, short _Index, short _DOS, short _Required, short _Bool,short _IgnoreCur )
+ short _Version, short _Catalog, short _Schema, short _Index, short _DOS, short _Required, short _Bool,short _IgnoreCur,short _AutoPKey )
:AdvancedSettingsSupport()
{
bGeneratedValues = ( _Generated != 0 );
@@ -65,6 +65,7 @@ namespace dbaui
bBooleanComparisonMode = ( _Bool != 0 );
bFormsCheckRequiredFields = ( _Required != 0 );
bIgnoreCurrency = ( _IgnoreCur != 0 );
+ bAutoIncrementIsPrimaryKey = ( _AutoPKey != 0 );
}
enum Special { All, None };
@@ -87,6 +88,7 @@ namespace dbaui
bBooleanComparisonMode = ( _eType == All );
bFormsCheckRequiredFields = ( _eType == All );
bIgnoreCurrency = false; // Oracle special
+ bAutoIncrementIsPrimaryKey = false; // hsqldb special
}
};
@@ -110,95 +112,95 @@ namespace dbaui
//= global tables
//====================================================================
//--------------------------------------------------------------------
- static const AdvancedSettingsSupport& getAdvancedSettingsSupport( DATASOURCE_TYPE _eType )
+ static const AdvancedSettingsSupport& getAdvancedSettingsSupport( ::dbaccess::DATASOURCE_TYPE _eType )
{
- typedef ::std::map< DATASOURCE_TYPE, AdvancedSettingsSupport > AdvancedSupport;
+ typedef ::std::map< ::dbaccess::DATASOURCE_TYPE, AdvancedSettingsSupport > AdvancedSupport;
static AdvancedSupport s_aSupport;
if ( s_aSupport.empty() )
{
- s_aSupport[ DST_MSACCESS ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 );
- s_aSupport[ DST_MYSQL_ODBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 );
- s_aSupport[ DST_MYSQL_JDBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 );
- s_aSupport[ DST_MYSQL_NATIVE ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 );
- s_aSupport[ DST_ORACLE_JDBC ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_ADABAS ] = InitAdvanced( 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0 );
- s_aSupport[ DST_CALC ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_DBASE ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 );
- s_aSupport[ DST_FLAT ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
- s_aSupport[ DST_JDBC ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_ODBC ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_ADO ] = InitAdvanced( 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0 );
- s_aSupport[ DST_MOZILLA ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_THUNDERBIRD ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_LDAP ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_OUTLOOK ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_OUTLOOKEXP ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_EVOLUTION ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_EVOLUTION_GROUPWISE ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_EVOLUTION_LDAP ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_KAB ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_MACAB ] = InitAdvanced( InitAdvanced::None );
- s_aSupport[ DST_MSACCESS_2007 ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 );
- s_aSupport[ DST_EMBEDDED_HSQLDB ] = InitAdvanced( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0 );
- s_aSupport[ DST_USERDEFINE1 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_USERDEFINE2 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_USERDEFINE3 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_USERDEFINE4 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_USERDEFINE5 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_USERDEFINE6 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_USERDEFINE7 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_USERDEFINE8 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_USERDEFINE9 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_USERDEFINE10 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_MSACCESS ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0 );
+ s_aSupport[ ::dbaccess::DST_MYSQL_ODBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 );
+ s_aSupport[ ::dbaccess::DST_MYSQL_JDBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 );
+ s_aSupport[ ::dbaccess::DST_MYSQL_NATIVE ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 );
+ s_aSupport[ ::dbaccess::DST_ORACLE_JDBC ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_ADABAS ] = InitAdvanced( 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0 );
+ s_aSupport[ ::dbaccess::DST_CALC ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_DBASE ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 );
+ s_aSupport[ ::dbaccess::DST_FLAT ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
+ s_aSupport[ ::dbaccess::DST_JDBC ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_ODBC ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_ADO ] = InitAdvanced( 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 );
+ s_aSupport[ ::dbaccess::DST_MOZILLA ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_THUNDERBIRD ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_LDAP ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_OUTLOOK ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_OUTLOOKEXP ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_EVOLUTION ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_EVOLUTION_GROUPWISE ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_EVOLUTION_LDAP ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_KAB ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_MACAB ] = InitAdvanced( InitAdvanced::None );
+ s_aSupport[ ::dbaccess::DST_MSACCESS_2007 ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0 );
+ s_aSupport[ ::dbaccess::DST_EMBEDDED_HSQLDB ] = InitAdvanced( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1 );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE1 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE2 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE3 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE4 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE5 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE6 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE7 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE8 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE9 ] = InitAdvanced( InitAdvanced::All );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE10 ] = InitAdvanced( InitAdvanced::All );
- s_aSupport[ DST_ORACLE_JDBC ].bIgnoreCurrency = true;
+ s_aSupport[ ::dbaccess::DST_ORACLE_JDBC ].bIgnoreCurrency = true;
}
return s_aSupport[ _eType ];
}
//--------------------------------------------------------------------
- static AuthenticationMode getAuthenticationMode( DATASOURCE_TYPE _eType )
+ static AuthenticationMode getAuthenticationMode( ::dbaccess::DATASOURCE_TYPE _eType )
{
- typedef ::std::map< DATASOURCE_TYPE, FeatureSupport > Supported;
+ typedef ::std::map< ::dbaccess::DATASOURCE_TYPE, FeatureSupport > Supported;
static Supported s_aSupport;
if ( s_aSupport.empty() )
{
- s_aSupport[ DST_MSACCESS ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_MYSQL_NATIVE ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_MYSQL_ODBC ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_MYSQL_JDBC ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_ORACLE_JDBC ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_ADABAS ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_CALC ] = FeatureSupport( AuthPwd );
- s_aSupport[ DST_DBASE ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_FLAT ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_JDBC ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_ODBC ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_ADO ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_MOZILLA ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_THUNDERBIRD ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_LDAP ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_OUTLOOK ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_OUTLOOKEXP ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_EVOLUTION ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_EVOLUTION_GROUPWISE ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_EVOLUTION_LDAP ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_KAB ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_MACAB ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_MSACCESS_2007 ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_EMBEDDED_HSQLDB ] = FeatureSupport( AuthNone );
- s_aSupport[ DST_USERDEFINE1 ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_USERDEFINE2 ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_USERDEFINE3 ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_USERDEFINE4 ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_USERDEFINE5 ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_USERDEFINE6 ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_USERDEFINE7 ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_USERDEFINE8 ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_USERDEFINE9 ] = FeatureSupport( AuthUserPwd );
- s_aSupport[ DST_USERDEFINE10 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_MSACCESS ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_MYSQL_NATIVE ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_MYSQL_ODBC ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_MYSQL_JDBC ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_ORACLE_JDBC ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_ADABAS ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_CALC ] = FeatureSupport( AuthPwd );
+ s_aSupport[ ::dbaccess::DST_DBASE ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_FLAT ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_JDBC ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_ODBC ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_ADO ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_MOZILLA ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_THUNDERBIRD ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_LDAP ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_OUTLOOK ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_OUTLOOKEXP ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_EVOLUTION ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_EVOLUTION_GROUPWISE ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_EVOLUTION_LDAP ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_KAB ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_MACAB ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_MSACCESS_2007 ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_EMBEDDED_HSQLDB ] = FeatureSupport( AuthNone );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE1 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE2 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE3 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE4 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE5 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE6 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE7 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE8 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE9 ] = FeatureSupport( AuthUserPwd );
+ s_aSupport[ ::dbaccess::DST_USERDEFINE10 ] = FeatureSupport( AuthUserPwd );
}
return s_aSupport[ _eType ].eAuthentication;
}
@@ -209,16 +211,16 @@ namespace dbaui
class DataSourceMetaData_Impl
{
public:
- DataSourceMetaData_Impl( DATASOURCE_TYPE _eType );
+ DataSourceMetaData_Impl( ::dbaccess::DATASOURCE_TYPE _eType );
- inline DATASOURCE_TYPE getType() const { return m_eType; }
+ inline ::dbaccess::DATASOURCE_TYPE getType() const { return m_eType; }
private:
- DATASOURCE_TYPE m_eType;
+ ::dbaccess::DATASOURCE_TYPE m_eType;
};
//--------------------------------------------------------------------
- DataSourceMetaData_Impl::DataSourceMetaData_Impl( DATASOURCE_TYPE _eType )
+ DataSourceMetaData_Impl::DataSourceMetaData_Impl( ::dbaccess::DATASOURCE_TYPE _eType )
:m_eType( _eType )
{
}
@@ -227,7 +229,7 @@ namespace dbaui
//= DataSourceMetaData
//====================================================================
//--------------------------------------------------------------------
- DataSourceMetaData::DataSourceMetaData( DATASOURCE_TYPE _eType )
+ DataSourceMetaData::DataSourceMetaData( ::dbaccess::DATASOURCE_TYPE _eType )
:m_pImpl( new DataSourceMetaData_Impl( _eType ) )
{
}
@@ -250,7 +252,7 @@ namespace dbaui
}
//--------------------------------------------------------------------
- AuthenticationMode DataSourceMetaData::getAuthentication( DATASOURCE_TYPE _eType )
+ AuthenticationMode DataSourceMetaData::getAuthentication( ::dbaccess::DATASOURCE_TYPE _eType )
{
return getAuthenticationMode( _eType );
}
diff --git a/dbaccess/source/ui/misc/dsntypes.cxx b/dbaccess/source/ui/misc/dsntypes.cxx
index 9dcbdaefb..e69de29bb 100644
--- a/dbaccess/source/ui/misc/dsntypes.cxx
+++ b/dbaccess/source/ui/misc/dsntypes.cxx
@@ -1,732 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dsntypes.cxx,v $
- * $Revision: 1.41 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_dbaccess.hxx"
-#ifndef _DBAUI_DSNTYPES_HXX_
-#include "dsntypes.hxx"
-#endif
-#ifndef _DBU_MISC_HRC_
-#include "dbu_misc.hrc"
-#endif
-#ifndef _DBU_MISCRES_HRC_
-#include "dbumiscres.hrc"
-#endif
-#ifndef _UNOTOOLS_CONFIGNODE_HXX_
-#include <unotools/confignode.hxx>
-#endif
-#ifndef DBAUI_TOOLS_HXX
-#include "UITools.hxx"
-#endif
-#ifndef _TOOLS_RC_HXX
-#include <tools/rc.hxx>
-#endif
-// --- needed because of the solar mutex
-#ifndef _VOS_MUTEX_HXX_
-#include <vos/mutex.hxx>
-#endif
-#ifndef _SV_SVAPP_HXX
-#include <vcl/svapp.hxx>
-#endif
-#ifndef _OSL_FILE_HXX_
-#include <osl/file.hxx>
-#endif
-// ---
-#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
-#include "dbustrings.hrc"
-#endif
-#ifndef _DBAUI_MODULE_DBU_HXX_
-#include "moduledbu.hxx"
-#endif
-#include <comphelper/documentconstants.hxx>
-//.........................................................................
-namespace dbaui
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::sdbc;
-
- namespace
- {
- void lcl_extractHostAndPort(const String& _sUrl,String& _sHostname,sal_Int32& _nPortNumber)
- {
- if ( _sUrl.GetTokenCount(':') >= 2 )
- {
- _sHostname = _sUrl.GetToken(0,':');
- _nPortNumber = _sUrl.GetToken(1,':').ToInt32();
- }
- }
- class ODataSourceTypeStringListResource : public Resource
- {
- ::std::vector<String> m_aStrings;
- public:
- ODataSourceTypeStringListResource(USHORT _nResId ) : Resource(ModuleRes(_nResId))
- {
- m_aStrings.reserve(STR_END);
- for (int i = STR_MYSQL_ODBC; i < STR_END ; ++i)
- {
- m_aStrings.push_back(String(ModuleRes(sal::static_int_cast<USHORT>(i))));
- }
-
- }
- ~ODataSourceTypeStringListResource()
- {
- FreeResource();
- }
- /** fill the vector with our readed strings
- @param _rToFill
- Vector to fill.
- */
- inline void fill( ::std::vector<String>& _rToFill )
- {
- _rToFill = m_aStrings;
- }
-
-
- /** returns the String with a given resource id
- @param _nResId
- The resource id. It will not be checked if this id exists.
-
- @return String
- The string.
- */
- String getString(USHORT _nResId)
- {
- return String(ModuleRes(_nResId));
- }
- };
- }
-//=========================================================================
-//= ODsnTypeCollection
-//=========================================================================
-DBG_NAME(ODsnTypeCollection)
-//-------------------------------------------------------------------------
-ODsnTypeCollection::ODsnTypeCollection()
-#ifdef DBG_UTIL
-:m_nLivingIterators(0)
-#endif
-{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- DBG_CTOR(ODsnTypeCollection,NULL);
- ODataSourceTypeStringListResource aTypes(RSC_DATASOURCE_TYPES);
- aTypes.fill(m_aDsnPrefixes);
-
- ODataSourceTypeStringListResource aDisplayNames(RSC_DATASOURCE_TYPE_UINAMES);
- aDisplayNames.fill(m_aDsnTypesDisplayNames);
-
-
- DBG_ASSERT(m_aDsnTypesDisplayNames.size() == m_aDsnPrefixes.size(),
- "ODsnTypeCollection::ODsnTypeCollection : invalid resources !");
- String sCurrentType;
-
- for (StringVector::iterator aIter = m_aDsnPrefixes.begin();aIter != m_aDsnPrefixes.end();++aIter)
- {
- m_aDsnTypes.push_back(implDetermineType(*aIter));
- }
-}
-
-//-------------------------------------------------------------------------
-ODsnTypeCollection::~ODsnTypeCollection()
-{
- DBG_DTOR(ODsnTypeCollection,NULL);
- DBG_ASSERT(0 == m_nLivingIterators, "ODsnTypeCollection::~ODsnTypeCollection : there are still living iterator objects!");
-}
-// -----------------------------------------------------------------------------
-void ODsnTypeCollection::initUserDriverTypes(const Reference< XMultiServiceFactory >& _rxORB)
-{
- // read the user driver out of the configuration
- // the config node where all pooling relevant info are stored under
- ::utl::OConfigurationTreeRoot aUserDefinedDriverRoot = ::utl::OConfigurationTreeRoot::createWithServiceFactory(
- _rxORB, ::dbaui::getUserDefinedDriverNodeName(), -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
-
- if ( aUserDefinedDriverRoot.isValid() )
- {
- Sequence< ::rtl::OUString > aDriverKeys = aUserDefinedDriverRoot.getNodeNames();
- const ::rtl::OUString* pDriverKeys = aDriverKeys.getConstArray();
- const ::rtl::OUString* pDriverKeysEnd = pDriverKeys + aDriverKeys.getLength();
- for (sal_Int32 i=0;pDriverKeys != pDriverKeysEnd && i <= DST_USERDEFINE10; ++pDriverKeys)
- {
- ::utl::OConfigurationNode aThisDriverSettings = aUserDefinedDriverRoot.openNode(*pDriverKeys);
- if ( aThisDriverSettings.isValid() )
- {
- // read the needed information
- ::rtl::OUString sDsnPrefix,sDsnTypeDisplayName,sExtension;
- aThisDriverSettings.getNodeValue(getDriverTypeDisplayNodeName()) >>= sDsnTypeDisplayName;
- aThisDriverSettings.getNodeValue(getDriverDsnPrefixNodeName()) >>= sDsnPrefix;
- aThisDriverSettings.getNodeValue(getDriverExtensionNodeName()) >>= sExtension;
-
- m_aDsnTypesDisplayNames.push_back(sDsnTypeDisplayName);
- m_aDsnPrefixes.push_back(sDsnPrefix);
- m_aDsnTypes.push_back(static_cast<DATASOURCE_TYPE>(DST_USERDEFINE1 + i++));
- m_aUserExtensions.push_back(sExtension);
- }
- }
- }
-}
-
-//-------------------------------------------------------------------------
-DATASOURCE_TYPE ODsnTypeCollection::getType(const String& _rDsn) const
-{
- DATASOURCE_TYPE eType = DST_UNKNOWN;
- // look for user defined driver types
- StringVector::const_iterator aIter = m_aDsnPrefixes.begin();
- StringVector::const_iterator aEnd = m_aDsnPrefixes.end();
- for (; aIter != aEnd; ++aIter)
- {
- if ( _rDsn.Len() >= aIter->Len() && aIter->EqualsIgnoreCaseAscii(_rDsn,0, aIter->Len()) )
- {
- size_t nPos = (aIter - m_aDsnPrefixes.begin());
- if ( nPos < m_aDsnTypes.size() )
- {
- eType = m_aDsnTypes[nPos];
- break;
- }
- }
- }
- return eType;
-}
-
-//-------------------------------------------------------------------------
-String ODsnTypeCollection::getTypeDisplayName(DATASOURCE_TYPE _eType) const
-{
- String sDisplayName;
-
- sal_Int32 nIndex = implDetermineTypeIndex(_eType);
- if ((nIndex >= 0) && (nIndex < (sal_Int32)m_aDsnTypesDisplayNames.size()))
- sDisplayName = m_aDsnTypesDisplayNames[nIndex];
-
- return sDisplayName;
-}
-
-//-------------------------------------------------------------------------
-String ODsnTypeCollection::getDatasourcePrefix(DATASOURCE_TYPE _eType) const
-{
- String sPrefix;
- sal_Int32 nIndex = implDetermineTypeIndex(_eType);
- if ((nIndex >= 0) && (nIndex < (sal_Int32)m_aDsnPrefixes.size()))
- sPrefix = m_aDsnPrefixes[nIndex];
-
- return sPrefix;
-}
-
-//-------------------------------------------------------------------------
-String ODsnTypeCollection::cutPrefix(const String& _rDsn) const
-{
- DATASOURCE_TYPE eType = getType(_rDsn);
- String sPrefix = getDatasourcePrefix(eType);
- return _rDsn.Copy(sPrefix.Len());
-}
-// -----------------------------------------------------------------------------
-String ODsnTypeCollection::getMediaType(DATASOURCE_TYPE _eType) const
-{
- String sRet;
- switch (_eType)
- {
- case DST_DBASE:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("application/dbase"));
- break;
- case DST_FLAT:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/csv"));
- break;
- case DST_CALC:
- sRet = MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET;
- break;
- case DST_MSACCESS:
- case DST_MSACCESS_2007:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("application/msaccess"));
- break;
- default:
- break;
- }
- return sRet;
-}
-// -----------------------------------------------------------------------------
-String ODsnTypeCollection::getDatasourcePrefixFromMediaType(const String& _sMediaType,const String& _sExtension)
-{
- ::rtl::OUString sURL(RTL_CONSTASCII_USTRINGPARAM("sdbc:"));
- if ( _sMediaType.EqualsIgnoreCaseAscii( "text/csv" ) )
- {
- sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("flat:"));
- }
- else if ( _sMediaType.EqualsIgnoreCaseAscii( "application/dbase" ) )
- {
- sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dbase:"));
- }
- else if ( _sMediaType.EqualsIgnoreCaseAscii( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII ) )
- {
- sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("calc:"));
- }
- else if ( _sMediaType.EqualsIgnoreCaseAscii( "application/msaccess" ) )
- {
- if ( _sExtension.EqualsIgnoreCaseAscii( "mdb" ) )
- sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="));
- else
- sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE="));
- }
- return sURL;
-}
-// -----------------------------------------------------------------------------
-void ODsnTypeCollection::extractHostNamePort(const String& _rDsn,String& _sDatabaseName,String& _rsHostname,sal_Int32& _nPortNumber) const
-{
- DATASOURCE_TYPE eType = getType(_rDsn);
- String sUrl = cutPrefix(_rDsn);
- switch( eType )
- {
- case DST_ORACLE_JDBC:
- lcl_extractHostAndPort(sUrl,_rsHostname,_nPortNumber);
- if ( !_rsHostname.Len() && sUrl.GetTokenCount(':') == 2 )
- {
- _nPortNumber = -1;
- _rsHostname = sUrl.GetToken(0,':');
- }
- if ( _rsHostname.Len() )
- _rsHostname = _rsHostname.GetToken(_rsHostname.GetTokenCount('@') - 1,'@');
- _sDatabaseName = sUrl.GetToken(sUrl.GetTokenCount(':') - 1,':');
- break;
- case DST_LDAP:
- lcl_extractHostAndPort(sUrl,_sDatabaseName,_nPortNumber);
- break;
- case DST_ADABAS:
- if ( sUrl.GetTokenCount(':') == 2 )
- _rsHostname = sUrl.GetToken(0,':');
- _sDatabaseName = sUrl.GetToken(sUrl.GetTokenCount(':') - 1,':');
- break;
- case DST_MYSQL_NATIVE:
- case DST_MYSQL_JDBC:
- {
- lcl_extractHostAndPort(sUrl,_rsHostname,_nPortNumber);
-
- if ( _nPortNumber == -1 && !_rsHostname.Len() && sUrl.GetTokenCount('/') == 2 )
- _rsHostname = sUrl.GetToken(0,'/');
- _sDatabaseName = sUrl.GetToken(sUrl.GetTokenCount('/') - 1,'/');
- }
- break;
- case DST_MSACCESS:
- case DST_MSACCESS_2007:
- {
- ::rtl::OUString sNewFileName;
- if ( ::osl::FileBase::getFileURLFromSystemPath( sUrl, sNewFileName ) == ::osl::FileBase::E_None )
- {
- _sDatabaseName = sNewFileName;
- }
- }
- break;
- default:
- break;
- }
-}
-
-//-------------------------------------------------------------------------
-sal_Bool ODsnTypeCollection::isFileSystemBased(DATASOURCE_TYPE _eType) const
-{
- switch (_eType)
- {
- case DST_DBASE:
- case DST_FLAT:
- case DST_CALC:
- case DST_MSACCESS:
- case DST_MSACCESS_2007:
- return sal_True;
-
- case DST_USERDEFINE1:
- case DST_USERDEFINE2:
- case DST_USERDEFINE3:
- case DST_USERDEFINE4:
- case DST_USERDEFINE5:
- case DST_USERDEFINE6:
- case DST_USERDEFINE7:
- case DST_USERDEFINE8:
- case DST_USERDEFINE9:
- case DST_USERDEFINE10:
- {
- StringVector::size_type nPos = static_cast<sal_Int16>(_eType-DST_USERDEFINE1);
- return nPos < m_aUserExtensions.size() && m_aUserExtensions[nPos].Len() != 0;
- }
- default:
- return sal_False;
- }
-}
-
-
-sal_Bool ODsnTypeCollection::supportsTableCreation(DATASOURCE_TYPE _eType)
-{
- BOOL bSupportsTableCreation;
- switch( _eType )
- {
- case DST_MOZILLA:
- case DST_OUTLOOK:
- case DST_OUTLOOKEXP:
- case DST_FLAT:
- case DST_EVOLUTION:
- case DST_EVOLUTION_GROUPWISE:
- case DST_EVOLUTION_LDAP:
- case DST_KAB:
- case DST_THUNDERBIRD:
- case DST_CALC:
- bSupportsTableCreation = FALSE;
- break;
- case DST_DBASE:
- case DST_ADABAS:
- case DST_ADO:
- case DST_MSACCESS:
- case DST_MSACCESS_2007:
- case DST_MYSQL_ODBC:
- case DST_ODBC:
- case DST_MYSQL_JDBC:
- case DST_MYSQL_NATIVE:
- case DST_ORACLE_JDBC:
- case DST_LDAP:
- case DST_JDBC:
- default:
- bSupportsTableCreation = TRUE;
- break;
- }
- return bSupportsTableCreation;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODsnTypeCollection::supportsBrowsing(DATASOURCE_TYPE _eType)
-{
- sal_Bool bEnableBrowseButton = sal_False;
- switch( _eType )
- {
- case DST_DBASE:
- case DST_FLAT:
- case DST_CALC:
- case DST_ADABAS:
- case DST_ADO:
- case DST_MSACCESS:
- case DST_MSACCESS_2007:
- case DST_MYSQL_ODBC:
- case DST_ODBC:
- case DST_MOZILLA:
- case DST_THUNDERBIRD:
- bEnableBrowseButton = TRUE;
- break;
- case DST_MYSQL_NATIVE:
- case DST_MYSQL_JDBC:
- case DST_ORACLE_JDBC:
- case DST_LDAP:
- case DST_OUTLOOK:
- case DST_OUTLOOKEXP:
- case DST_JDBC:
- case DST_EVOLUTION:
- case DST_EVOLUTION_GROUPWISE:
- case DST_EVOLUTION_LDAP:
- case DST_KAB:
- bEnableBrowseButton = FALSE;
- break;
- default:
- bEnableBrowseButton = getTypeExtension(_eType).Len() != 0;
- break;
- }
- return bEnableBrowseButton;
-}
-
-
-//-------------------------------------------------------------------------
-DATASOURCE_TYPE ODsnTypeCollection::implDetermineType(const String& _rDsn) const
-{
- sal_uInt16 nSeparator = _rDsn.Search((sal_Unicode)':');
- if (STRING_NOTFOUND == nSeparator)
- {
- // there should be at least one such separator
- DBG_ERROR("ODsnTypeCollection::implDetermineType : missing the colon !");
- return DST_UNKNOWN;
- }
- // find first :
- sal_uInt16 nOracleSeparator = _rDsn.Search((sal_Unicode)':', nSeparator + 1);
- if ( nOracleSeparator != STRING_NOTFOUND )
- {
- nOracleSeparator = _rDsn.Search((sal_Unicode)':', nOracleSeparator + 1);
- if (nOracleSeparator != STRING_NOTFOUND && _rDsn.EqualsIgnoreCaseAscii("jdbc:oracle:thin", 0, nOracleSeparator))
- return DST_ORACLE_JDBC;
- }
-
- if (_rDsn.EqualsIgnoreCaseAscii("jdbc", 0, nSeparator))
- return DST_JDBC;
-
- // find second :
- nSeparator = _rDsn.Search((sal_Unicode)':', nSeparator + 1);
- if (STRING_NOTFOUND == nSeparator)
- {
- // at the moment only jdbc is allowed to have just one separator
- DBG_ERROR("ODsnTypeCollection::implDetermineType : missing the second colon !");
- return DST_UNKNOWN;
- }
-
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:adabas", 0, nSeparator))
- return DST_ADABAS;
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:odbc", 0, nSeparator))
- return DST_ODBC;
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:dbase", 0, nSeparator))
- return DST_DBASE;
-
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:ado:", 0, nSeparator))
- {
- nSeparator = _rDsn.Search((sal_Unicode)':', nSeparator + 1);
- if (STRING_NOTFOUND != nSeparator && _rDsn.EqualsIgnoreCaseAscii("sdbc:ado:access",0, nSeparator) )
- {
- nSeparator = _rDsn.Search((sal_Unicode)';', nSeparator + 1);
- if (STRING_NOTFOUND != nSeparator && _rDsn.EqualsIgnoreCaseAscii("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0",0, nSeparator) )
- return DST_MSACCESS_2007;
-
- return DST_MSACCESS;
- }
- return DST_ADO;
- }
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:flat:", 0, nSeparator))
- return DST_FLAT;
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:calc:", 0, nSeparator))
- return DST_CALC;
- if ( ( 11 <= nSeparator) && _rDsn.EqualsIgnoreCaseAscii("sdbc:mysqlc:", 0, nSeparator))
- return DST_MYSQL_NATIVE;
-
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:embedded:hsqldb", 0, _rDsn.Len()))
- return DST_EMBEDDED_HSQLDB;
-
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:address:", 0, nSeparator))
- {
- ++nSeparator;
- if (_rDsn.EqualsIgnoreCaseAscii("mozilla:", nSeparator,_rDsn.Len() - nSeparator))
- return DST_MOZILLA;
- if (_rDsn.EqualsIgnoreCaseAscii("thunderbird:", nSeparator,_rDsn.Len() - nSeparator))
- return DST_THUNDERBIRD;
- if (_rDsn.EqualsIgnoreCaseAscii("ldap:", nSeparator,_rDsn.Len() - nSeparator))
- return DST_LDAP;
- if (_rDsn.EqualsIgnoreCaseAscii("outlook", nSeparator,_rDsn.Len() - nSeparator))
- return DST_OUTLOOK;
- if (_rDsn.EqualsIgnoreCaseAscii("outlookexp", nSeparator,_rDsn.Len() - nSeparator))
- return DST_OUTLOOKEXP;
- if (_rDsn.EqualsIgnoreCaseAscii("evolution:ldap", nSeparator,_rDsn.Len() - nSeparator))
- return DST_EVOLUTION_LDAP;
- if (_rDsn.EqualsIgnoreCaseAscii("evolution:groupwise", nSeparator,_rDsn.Len() - nSeparator))
- return DST_EVOLUTION_GROUPWISE;
- if (_rDsn.EqualsIgnoreCaseAscii("evolution:local", nSeparator,_rDsn.Len() - nSeparator))
- return DST_EVOLUTION;
- if (_rDsn.EqualsIgnoreCaseAscii("kab", nSeparator,_rDsn.Len() - nSeparator))
- return DST_KAB;
- if (_rDsn.EqualsIgnoreCaseAscii("macab", nSeparator,_rDsn.Len() - nSeparator))
- return DST_MACAB;
- }
-
- // find third :
- nSeparator = _rDsn.Search((sal_Unicode)':', nSeparator + 1);
- if (STRING_NOTFOUND == nSeparator)
- {
- DBG_ERROR("ODsnTypeCollection::implDetermineType : missing the third colon !");
- return DST_UNKNOWN;
- }
-
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:mysql:odbc", 0, nSeparator))
- return DST_MYSQL_ODBC;
- if (_rDsn.EqualsIgnoreCaseAscii("sdbc:mysql:jdbc", 0, nSeparator))
- return DST_MYSQL_JDBC;
-
- DBG_ERROR("ODsnTypeCollection::implDetermineType : unrecognized data source type !");
- return DST_UNKNOWN;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 ODsnTypeCollection::implDetermineTypeIndex(DATASOURCE_TYPE _eType) const
-{
- DBG_ASSERT(
- (m_aDsnTypesDisplayNames.size() == m_aDsnPrefixes.size())
- && (m_aDsnTypesDisplayNames.size() == m_aDsnTypes.size()),
- "ODsnTypeCollection::implDetermineTypeIndex : inconsistent structures !");
-
- // the type of the datasource described by the DSN string
- if (DST_UNKNOWN == _eType)
- {
- return -1;
- }
-
- // search this type in our arrays
- sal_Int32 nIndex = 0;
- ConstTypeVectorIterator aSearch = m_aDsnTypes.begin();
-
- for (; aSearch != m_aDsnTypes.end(); ++nIndex, ++aSearch)
- if (*aSearch == _eType)
- return nIndex;
-
- DBG_ERROR("ODsnTypeCollection::implDetermineTypeIndex : recognized the DSN schema, but did not find the type!");
- return -1;
-}
-// -----------------------------------------------------------------------------
-Sequence<PropertyValue> ODsnTypeCollection::getDefaultDBSettings( DATASOURCE_TYPE _eType ) const
-{
- Sequence< PropertyValue > aSettings;
-
- switch ( _eType )
- {
- case DST_EMBEDDED_HSQLDB:
- aSettings.realloc( 3 );
-
- aSettings[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoIncrementCreation" ) );
- aSettings[0].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IDENTITY" ) );
-
- aSettings[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoRetrievingStatement" ) );
- aSettings[1].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CALL IDENTITY()" ) );
-
- aSettings[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutoRetrievingEnabled" ) );
- aSettings[2].Value <<= (sal_Bool)sal_True;
- break;
-
- default:
- DBG_ERROR( "ODsnTypeCollection::getDefaultDBSettings: type is unsupported by this method!" );
- break;
- }
-
- return aSettings;
-}
-
-// -----------------------------------------------------------------------------
-String ODsnTypeCollection::getTypeExtension(DATASOURCE_TYPE _eType) const
-{
- StringVector::size_type nPos = static_cast<sal_uInt16>(_eType-DST_USERDEFINE1);
- return nPos < m_aUserExtensions.size() ? m_aUserExtensions[nPos] : String();
-}
-//-------------------------------------------------------------------------
-ODsnTypeCollection::TypeIterator ODsnTypeCollection::begin() const
-{
- return TypeIterator(this, 0);
-}
-
-//-------------------------------------------------------------------------
-ODsnTypeCollection::TypeIterator ODsnTypeCollection::end() const
-{
- return TypeIterator(this, m_aDsnTypes.size());
-}
-
-//=========================================================================
-//= ODsnTypeCollection::TypeIterator
-//=========================================================================
-//-------------------------------------------------------------------------
-ODsnTypeCollection::TypeIterator::TypeIterator(const ODsnTypeCollection* _pContainer, sal_Int32 _nInitialPos)
- :m_pContainer(_pContainer)
- ,m_nPosition(_nInitialPos)
-{
- DBG_ASSERT(m_pContainer, "ODsnTypeCollection::TypeIterator::TypeIterator : invalid container!");
-#ifdef DBG_UTIL
- ++const_cast<ODsnTypeCollection*>(m_pContainer)->m_nLivingIterators;
-#endif
-}
-
-//-------------------------------------------------------------------------
-ODsnTypeCollection::TypeIterator::TypeIterator(const TypeIterator& _rSource)
- :m_pContainer(_rSource.m_pContainer)
- ,m_nPosition(_rSource.m_nPosition)
-{
-#ifdef DBG_UTIL
- ++const_cast<ODsnTypeCollection*>(m_pContainer)->m_nLivingIterators;
-#endif
-}
-
-//-------------------------------------------------------------------------
-ODsnTypeCollection::TypeIterator::~TypeIterator()
-{
-#ifdef DBG_UTIL
- --const_cast<ODsnTypeCollection*>(m_pContainer)->m_nLivingIterators;
-#endif
-}
-
-//-------------------------------------------------------------------------
-DATASOURCE_TYPE ODsnTypeCollection::TypeIterator::getType() const
-{
- DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypes.size(), "ODsnTypeCollection::TypeIterator::getType : invalid position!");
- return m_pContainer->m_aDsnTypes[m_nPosition];
-}
-
-//-------------------------------------------------------------------------
-String ODsnTypeCollection::TypeIterator::getDisplayName() const
-{
- DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(), "ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!");
- return m_pContainer->m_aDsnTypesDisplayNames[m_nPosition];
-}
-
-//-------------------------------------------------------------------------
-const ODsnTypeCollection::TypeIterator& ODsnTypeCollection::TypeIterator::operator++()
-{
- DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypes.size(), "ODsnTypeCollection::TypeIterator::operator++ : invalid position!");
- if (m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypes.size())
- ++m_nPosition;
- return *this;
-}
-
-//-------------------------------------------------------------------------
-const ODsnTypeCollection::TypeIterator& ODsnTypeCollection::TypeIterator::operator--()
-{
- DBG_ASSERT(m_nPosition >= 0, "ODsnTypeCollection::TypeIterator::operator-- : invalid position!");
- if (m_nPosition >= 0)
- --m_nPosition;
- return *this;
-}
-
-//-------------------------------------------------------------------------
-bool operator==(const ODsnTypeCollection::TypeIterator& lhs, const ODsnTypeCollection::TypeIterator& rhs)
-{
- return (lhs.m_pContainer == rhs.m_pContainer) && (lhs.m_nPosition == rhs.m_nPosition);
-}
-
-//=========================================================================
-//= DbuTypeCollectionItem
-//=========================================================================
-TYPEINIT1(DbuTypeCollectionItem, SfxPoolItem);
-//-------------------------------------------------------------------------
-DbuTypeCollectionItem::DbuTypeCollectionItem(sal_Int16 _nWhich, ODsnTypeCollection* _pCollection)
- :SfxPoolItem(_nWhich)
- ,m_pCollection(_pCollection)
-{
-}
-
-//-------------------------------------------------------------------------
-DbuTypeCollectionItem::DbuTypeCollectionItem(const DbuTypeCollectionItem& _rSource)
- :SfxPoolItem(_rSource)
- ,m_pCollection(_rSource.getCollection())
-{
-}
-
-//-------------------------------------------------------------------------
-int DbuTypeCollectionItem::operator==(const SfxPoolItem& _rItem) const
-{
- DbuTypeCollectionItem* pCompare = PTR_CAST(DbuTypeCollectionItem, &_rItem);
- return pCompare && (pCompare->getCollection() == getCollection());
-}
-
-//-------------------------------------------------------------------------
-SfxPoolItem* DbuTypeCollectionItem::Clone(SfxItemPool* /*_pPool*/) const
-{
- return new DbuTypeCollectionItem(*this);
-}
-//.........................................................................
-} // namespace dbaui
-//.........................................................................
-
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index 9473649ad..eb710273b 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: linkeddocuments.cxx,v $
- * $Revision: 1.32 $
+ * $Revision: 1.31.24.2 $
*
* This file is part of OpenOffice.org.
*
@@ -123,10 +123,6 @@
#ifndef _EHDL_HXX
#include <svtools/ehdl.hxx>
#endif
-// -----------------
-#ifndef _DBU_MISCRES_HRC_
-#include "dbumiscres.hrc"
-#endif
#ifndef _SVX_DATACCESSDESCRIPTOR_HXX_
#include <svx/dataaccessdescriptor.hxx>
#endif
diff --git a/dbaccess/source/ui/misc/makefile.mk b/dbaccess/source/ui/misc/makefile.mk
index 5cb048042..e5db6954e 100644
--- a/dbaccess/source/ui/misc/makefile.mk
+++ b/dbaccess/source/ui/misc/makefile.mk
@@ -8,7 +8,7 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.35 $
+# $Revision: 1.35.68.1 $
#
# This file is part of OpenOffice.org.
#
@@ -80,7 +80,6 @@ SLOFILES= \
$(SLO)$/ToolBoxHelper.obj \
$(SLO)$/stringlistitem.obj \
$(SLO)$/charsets.obj \
- $(SLO)$/dsntypes.obj \
$(SLO)$/defaultobjectnamecheck.obj \
$(SLO)$/dsmeta.obj \
$(SLO)$/controllerframe.obj \
diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx
index 9af0a8089..c9864725a 100644
--- a/dbaccess/source/ui/misc/singledoccontroller.cxx
+++ b/dbaccess/source/ui/misc/singledoccontroller.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: singledoccontroller.cxx,v $
- * $Revision: 1.30 $
+ * $Revision: 1.30.24.2 $
*
* This file is part of OpenOffice.org.
*
@@ -155,13 +155,15 @@ namespace dbaui
sal_Bool m_bSuspended; // is true when the controller was already suspended
sal_Bool m_bEditable; // is the control readonly or not
sal_Bool m_bModified; // is the data modified
+ bool m_bNotAttached;
OSingleDocumentControllerImpl()
:m_aDocScriptSupport()
- ,m_nDocStartNumber(1)
+ ,m_nDocStartNumber(0)
,m_bSuspended( sal_False )
,m_bEditable(sal_True)
,m_bModified(sal_False)
+ ,m_bNotAttached(true)
{
}
@@ -288,6 +290,14 @@ namespace dbaui
}
OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "OSingleDocumentController::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() );
@@ -471,9 +481,15 @@ namespace dbaui
// -----------------------------------------------------------------------------
sal_Bool SAL_CALL OSingleDocumentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException )
{
+ if ( !_rxModel.is() )
+ return sal_False;
if ( !OSingleDocumentController_Base::attachModel( _rxModel ) )
return sal_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() )
diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
index b215031bf..2e1d5d42c 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ConnectionLine.cxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.68.2 $
*
* This file is part of OpenOffice.org.
*
@@ -54,6 +54,7 @@
#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
#endif
+#include <vcl/lineinfo.hxx>
using namespace dbaui;
@@ -219,15 +220,17 @@ Rectangle OConnectionLine::GetBoundingRect()
aBottomRight.X() = m_aSourceDescrLinePos.X();
}
+ const OTableWindow* pSourceWin = m_pTabConn->GetSourceWin();
+ const OTableWindow* pDestWin = m_pTabConn->GetDestWin();
//////////////////////////////////////////////////////////////////////
// Linie verlaeuft in z-Form
- if( Abs(m_aSourceConnPos.X() - m_aDestConnPos.X()) > Abs(m_aSourceDescrLinePos.X() - m_aDestDescrLinePos.X()) )
+ if( pSourceWin == pDestWin || Abs(m_aSourceConnPos.X() - m_aDestConnPos.X()) > Abs(m_aSourceDescrLinePos.X() - m_aDestDescrLinePos.X()) )
{
aTopLeft.X() -= DESCRIPT_LINE_WIDTH;
aBottomRight.X() += DESCRIPT_LINE_WIDTH;
}
- aBoundingRect = Rectangle( aTopLeft-Point(0,17), aBottomRight+Point(0,2) );
+ aBoundingRect = Rectangle( aTopLeft-Point(2,17), aBottomRight+Point(2,2) );
return aBoundingRect;
}
@@ -283,7 +286,10 @@ BOOL OConnectionLine::RecalcLine()
pSecondDescrPos = &m_aDestDescrLinePos;
}
- calcPointX1(pFirstWin,*pFirstConPos,*pFirstDescrPos);
+ if ( pFirstWin == pSecondWin && pSourceEntry != pDestEntry )
+ calcPointX2(pFirstWin,*pFirstConPos,*pFirstDescrPos);
+ else
+ calcPointX1(pFirstWin,*pFirstConPos,*pFirstDescrPos);
calcPointX2(pSecondWin,*pSecondConPos,*pSecondDescrPos);
//////////////////////////////////////////////////////////////////////
@@ -315,31 +321,15 @@ void OConnectionLine::Draw( OutputDevice* pOutDev )
else
pOutDev->SetLineColor(Application::GetSettings().GetStyleSettings().GetWindowTextColor());
- pOutDev->DrawLine( m_aSourceDescrLinePos, m_aSourceConnPos );
- pOutDev->DrawLine( m_aDestDescrLinePos, m_aDestConnPos );
- pOutDev->DrawLine( m_aSourceConnPos, m_aDestConnPos );
- // wenn die Linie selektiert ist, sollte sie dicker erscheinen
- // da OutputDevice nach meinem Wissen (das ich nur aus dem Headerfile habe) kein
- // SetLineWidth (o.ä.) hat, ein Fake
- if (m_pTabConn->IsSelected())
- {
- UINT16 xOffset, yOffset;
- if (abs(m_aSourceConnPos.Y() - m_aDestConnPos.Y()) > abs(m_aSourceConnPos.X()-m_aDestConnPos.X()))
- {
- xOffset = 1;
- yOffset = 0;
- } else
- {
- xOffset = 0;
- yOffset = 1;
- }
-
- Point aPos1(-xOffset, -yOffset);
- Point aPos2(xOffset, yOffset);
- pOutDev->DrawLine(m_aSourceConnPos + aPos1, m_aDestConnPos + aPos1);
- pOutDev->DrawLine(m_aSourceConnPos + aPos2, m_aDestConnPos + aPos2);
- }
-
+ LineInfo aLineInfo;
+ if ( m_pTabConn->IsSelected() )
+ aLineInfo.SetWidth(3);
+ Polygon aPoly;
+ aPoly.Insert(0,m_aSourceDescrLinePos);
+ aPoly.Insert(1,m_aSourceConnPos);
+ aPoly.Insert(2,m_aDestConnPos);
+ aPoly.Insert(3,m_aDestDescrLinePos);
+ pOutDev->DrawPolyLine(aPoly,aLineInfo);
//////////////////////////////////////////////////////////////////////
// draw the connection rectangles
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 223ac7a41..51ead6bec 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: QueryDesignView.cxx,v $
- * $Revision: 1.96 $
+ * $Revision: 1.96.8.1 $
*
* This file is part of OpenOffice.org.
*
@@ -2182,12 +2182,11 @@ namespace
SqlParseError eErrorCode = eOk;
sal_Bool bFirstField = sal_True;
::rtl::OUString sAsterix(RTL_CONSTASCII_USTRINGPARAM("*"));
- OTableFieldDescRef aInfo = new OTableFieldDesc();
OJoinTableView::OTableWindowMap::iterator aIter = _pTabList->begin();
for(;aIter != _pTabList->end() && eOk == eErrorCode ;++aIter)
{
OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second);
-
+ OTableFieldDescRef aInfo = new OTableFieldDesc();
if (pTabWin->ExistsField( sAsterix, aInfo ))
{
eErrorCode = _pView->InsertField(aInfo, sal_True, bFirstField);
diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx
index c4afa9b6f..8f2b13437 100644
--- a/dbaccess/source/ui/querydesign/TableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindow.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableWindow.cxx,v $
- * $Revision: 1.41 $
+ * $Revision: 1.41.26.2 $
*
* This file is part of OpenOffice.org.
*
@@ -61,54 +61,26 @@
#include <vcl/wall.hxx>
#endif
-#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_KEYTYPE_HPP_
#include <com/sun/star/sdbcx/KeyType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
-#ifndef DBAUI_QUERYCONTROLLER_HXX
#include "querycontroller.hxx"
-#endif
-#ifndef _DBU_QRY_HRC_
#include "dbu_qry.hrc"
-#endif
-#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
#include "dbustrings.hrc"
-#endif
-#ifndef DBAUI_QUERY_HRC
#include "Query.hrc"
-#endif
-#ifndef _COMPHELPER_EXTRACT_HXX_
#include <comphelper/extract.hxx>
-#endif
-#ifndef DBAUI_TOOLS_HXX
#include "UITools.hxx"
-#endif
-#ifndef DBACCESS_TABLEWINDOWACCESS_HXX
#include "TableWindowAccess.hxx"
-#endif
-#ifndef DBACCESS_UI_BROWSER_ID_HXX
#include "browserids.hxx"
-#endif
+
using namespace dbaui;
using namespace ::utl;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
@@ -131,7 +103,8 @@ using namespace ::com::sun::star::accessibility;
DBG_NAME(OTableWindow)
//------------------------------------------------------------------------------
OTableWindow::OTableWindow( Window* pParent, const TTableWindowData::value_type& pTabWinData )
- :Window( pParent, WB_3DLOOK|WB_MOVEABLE )
+ : ::comphelper::OContainerListener(m_aMutex)
+ ,Window( pParent, WB_3DLOOK|WB_MOVEABLE )
,m_aTypeImage( this )
,m_aTitle( this )
,m_pListBox(NULL)
@@ -171,7 +144,10 @@ OTableWindow::~OTableWindow()
OSL_ENSURE(m_pListBox->GetEntryCount()==0,"Forgot to call EmptyListbox()!");
::std::auto_ptr<Window> aTemp(m_pListBox);
m_pListBox = NULL;
- }
+ } // if (m_pListBox)
+ if ( m_pContainerListener.is() )
+ m_pContainerListener->dispose();
+
m_pAccessible = NULL;
}
// -----------------------------------------------------------------------------
@@ -227,6 +203,13 @@ OTableWindowListBox* OTableWindow::CreateListBox()
//------------------------------------------------------------------------------
BOOL OTableWindow::FillListBox()
{
+ m_pListBox->Clear();
+ if ( !m_pContainerListener.is() )
+ {
+ Reference< XContainer> xContainer(m_pData->getColumns(),UNO_QUERY);
+ if ( xContainer.is() )
+ m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer);
+ }
// mark all primary keys with special image
ModuleRes TmpRes(isHiContrast(m_pListBox) ? IMG_JOINS_H : IMG_JOINS);
ImageList aImageList(TmpRes);
@@ -848,3 +831,19 @@ String OTableWindow::getTitle() const
return m_aTitle.GetText();
}
// -----------------------------------------------------------------------------
+void OTableWindow::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+ FillListBox();
+}
+// -----------------------------------------------------------------------------
+void OTableWindow::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+ FillListBox();
+}
+// -----------------------------------------------------------------------------
+void OTableWindow::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+ FillListBox();
+}
+// -----------------------------------------------------------------------------
+
diff --git a/dbaccess/source/ui/querydesign/TableWindowData.cxx b/dbaccess/source/ui/querydesign/TableWindowData.cxx
index 883ac35bb..13453a62b 100644
--- a/dbaccess/source/ui/querydesign/TableWindowData.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowData.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableWindowData.cxx,v $
- * $Revision: 1.15 $
+ * $Revision: 1.15.42.1 $
*
* This file is part of OpenOffice.org.
*
@@ -85,10 +85,6 @@ OTableWindowData::~OTableWindowData()
Reference<XComponent> xComponent( m_xTable, UNO_QUERY );
if ( xComponent.is() )
stopComponentListening( xComponent );
- // obtain the columns
- xComponent.set( m_xColumns, UNO_QUERY );
- if ( xComponent.is() )
- stopComponentListening( xComponent );
}
//------------------------------------------------------------------------------
@@ -107,8 +103,9 @@ void OTableWindowData::_disposing( const ::com::sun::star::lang::EventObject& /*
{
::osl::MutexGuard aGuard( m_aMutex );
// it doesn't matter which one was disposed
- m_xTable.clear();
- m_xColumns.clear();;
+ m_xColumns.clear();
+ m_xKeys.clear();
+ m_xTable.clear();
}
// -----------------------------------------------------------------------------
bool OTableWindowData::init(const Reference< XConnection >& _xConnection,bool _bAllowQueries)
@@ -126,9 +123,9 @@ bool OTableWindowData::init(const Reference< XConnection >& _xConnection,bool _
bool bIsKnownTable = xTables->hasByName( m_sComposedName );
if ( bIsKnownQuery )
- m_xTable.set( xQueries->getByName( m_sComposedName ), UNO_QUERY_THROW );
+ m_xTable.set( xQueries->getByName( m_sComposedName ), UNO_QUERY );
else if ( bIsKnownTable )
- m_xTable.set( xTables->getByName( m_sComposedName ), UNO_QUERY_THROW );
+ m_xTable.set( xTables->getByName( m_sComposedName ), UNO_QUERY );
else
m_bIsValid = false;
@@ -136,7 +133,6 @@ bool OTableWindowData::init(const Reference< XConnection >& _xConnection,bool _
m_bIsQuery = bIsKnownQuery;
listen();
-
Reference< XIndexAccess > xColumnsAsIndex( m_xColumns,UNO_QUERY );
return xColumnsAsIndex.is() && ( xColumnsAsIndex->getCount() > 0 );
@@ -152,11 +148,9 @@ void OTableWindowData::listen()
startComponentListening( xComponent );
// obtain the columns
- Reference< XColumnsSupplier > xColumnsSups( m_xTable, UNO_QUERY_THROW );
- m_xColumns = xColumnsSups->getColumns();
- xComponent.set( m_xColumns, UNO_QUERY );
- if ( xComponent.is() )
- startComponentListening( xComponent );
+ Reference< XColumnsSupplier > xColumnsSups( m_xTable, UNO_QUERY);
+ if ( xColumnsSups.is() )
+ m_xColumns = xColumnsSups->getColumns();
Reference<XKeysSupplier> xKeySup(m_xTable,UNO_QUERY);
if ( xKeySup.is() )
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index 42f20b99c..8b018b937 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableWindowListBox.cxx,v $
- * $Revision: 1.35 $
+ * $Revision: 1.35.26.2 $
*
* This file is part of OpenOffice.org.
*
@@ -85,7 +85,6 @@ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent )
,m_nDropEvent(0)
,m_nUiEvent(0)
,m_bReallyScrolled( sal_False )
- ,m_bDragSource( sal_False )
{
DBG_CTOR(OTableWindowListBox,NULL);
m_aScrollTimer.SetTimeout( SCROLLING_TIMESPAN );
@@ -99,7 +98,6 @@ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent )
//------------------------------------------------------------------------------
void OTableWindowListBox::dragFinished( )
{
- m_bDragSource = sal_False;
// first show the error msg when existing
m_pTabWin->getDesignView()->getController().showError(m_pTabWin->getDesignView()->getController().clearOccuredError());
// second look for ui activities which should happen after d&d
@@ -255,7 +253,6 @@ void OTableWindowListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPi
EndSelection();
// create a description of the source
OJoinExchangeData jxdSource(this);
- m_bDragSource = sal_True;
// put it into a exchange object
OJoinExchObj* pJoin = new OJoinExchObj(jxdSource,bFirstNotAllowed);
Reference< XTransferable > xEnsureDelete(pJoin);
@@ -268,8 +265,7 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt )
{
sal_Int8 nDND_Action = DND_ACTION_NONE;
// check the format
- if ( !m_bDragSource
- && !OJoinExchObj::isFormatAvailable(GetDataFlavorExVector(),SOT_FORMATSTR_ID_SBA_TABID) // this means that the first entry is to be draged
+ if ( !OJoinExchObj::isFormatAvailable(GetDataFlavorExVector(),SOT_FORMATSTR_ID_SBA_TABID) // this means that the first entry is to be draged
&& OJoinExchObj::isFormatAvailable(GetDataFlavorExVector(),SOT_FORMATSTR_ID_SBA_JOIN) )
{ // don't drop into the window if it's the drag source itself
@@ -360,7 +356,7 @@ IMPL_LINK( OTableWindowListBox, DropHdl, void *, /*EMPTY_ARG*/)
sal_Int8 OTableWindowListBox::ExecuteDrop( const ExecuteDropEvent& _rEvt )
{
TransferableDataHelper aDropped(_rEvt.maDropEvent.Transferable);
- if (!m_bDragSource && OJoinExchObj::isFormatAvailable(aDropped.GetDataFlavorExVector()))
+ if ( OJoinExchObj::isFormatAvailable(aDropped.GetDataFlavorExVector()))
{ // don't drop into the window if it's the drag source itself
m_aDropInfo.aSource = OJoinExchangeData(this);
m_aDropInfo.aDest = OJoinExchObj::GetSourceDescription(_rEvt.maDropEvent.Transferable);
@@ -428,4 +424,3 @@ void OTableWindowListBox::Command(const CommandEvent& rEvt)
}
}
// -----------------------------------------------------------------------------
-
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 159bb56d9..b23891451 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: querycontroller.cxx,v $
- * $Revision: 1.119 $
+ * $Revision: 1.119.24.1 $
*
* This file is part of OpenOffice.org.
*
@@ -76,6 +76,7 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/util/VetoException.hpp>
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
/** === end UNO includes === **/
#include <comphelper/basicio.hxx>
@@ -1248,7 +1249,12 @@ sal_Bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElement
if ( ( _bSaveAs && !bNew ) || ( bNew && m_sName.getLength() ) )
aDefaultName = String( m_sName );
else
- aDefaultName = getPrivateTitle( );
+ {
+ String sName = String( ModuleRes( editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE ) );
+ aDefaultName = sName.GetToken(0,' ');
+ //aDefaultName = getPrivateTitle( );
+ aDefaultName = ::dbtools::createUniqueName(_xElements,aDefaultName);
+ }
DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY );
OSaveAsDlg aDlg(
@@ -1419,11 +1425,19 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs)
// now check if our datasource has set a tablefilter and if so, append the new table name to it
::dbaui::appendToFilter( getConnection(), m_sName, getORB(), getView() );
+ } // if ( editingView() )
+ Reference< XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY);
+ if ( xEventListener.is() )
+ {
+ TitleChangedEvent aEvent;
+ xEventListener->titleChanged(aEvent);
}
+ releaseNumberForComponent();
}
setModified( sal_False );
bSuccess = true;
+
}
catch( const SQLException& )
{
diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx
index c22551e95..45adcb828 100644
--- a/dbaccess/source/ui/querydesign/querydlg.cxx
+++ b/dbaccess/source/ui/querydesign/querydlg.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: querydlg.cxx,v $
- * $Revision: 1.19 $
+ * $Revision: 1.19.24.1 $
*
* This file is part of OpenOffice.org.
*
@@ -216,8 +216,8 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ )
m_pTableControl->enableRelation(true);
- const String sFirstWinName = m_pConnData->getReferencingTable()->GetWinName();
- const String sSecondWinName = m_pConnData->getReferencedTable()->GetWinName();
+ String sFirstWinName = m_pConnData->getReferencingTable()->GetWinName();
+ String sSecondWinName = m_pConnData->getReferencedTable()->GetWinName();
const EJoinType eOldJoinType = eJoinType;
USHORT nResId = 0;
const USHORT nPos = m_pJoinControl->aLB_JoinType.GetSelectEntryPos();
@@ -236,8 +236,13 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ )
eJoinType = LEFT_JOIN;
break;
case ID_RIGHT_JOIN:
- nResId = STR_QUERY_LEFTRIGHT_JOIN;
- eJoinType = RIGHT_JOIN;
+ {
+ nResId = STR_QUERY_LEFTRIGHT_JOIN;
+ eJoinType = RIGHT_JOIN;
+ String sTemp = sFirstWinName;
+ sFirstWinName = sSecondWinName;
+ sSecondWinName = sTemp;
+ }
break;
case ID_FULL_JOIN:
nResId = STR_QUERY_FULL_JOIN;
diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
index 7325d8620..8a1f83339 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RTableConnection.cxx,v $
- * $Revision: 1.10 $
+ * $Revision: 1.10.68.1 $
*
* This file is part of OpenOffice.org.
*
@@ -91,8 +91,7 @@ void ORelationTableConnection::Draw( const Rectangle& rRect )
{
DBG_CHKTHIS(ORelationTableConnection,NULL);
OTableConnection::Draw( rRect );
- ORelationTableConnectionData* pData =
- static_cast< ORelationTableConnectionData* >(GetData().get());
+ ORelationTableConnectionData* pData = static_cast< ORelationTableConnectionData* >(GetData().get());
if ( pData && (pData->GetCardinality() == CARDINAL_UNDEFINED) )
return;
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index d860e6830..efc65ac74 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RelationController.cxx,v $
- * $Revision: 1.56 $
+ * $Revision: 1.56.24.1 $
*
* This file is part of OpenOffice.org.
*
@@ -232,7 +232,7 @@ FeatureState ORelationController::GetState(sal_uInt16 _nId) const
switch (_nId)
{
case SID_RELATION_ADD_RELATION:
- aReturn.bEnabled = m_vTableData.size() > 1 && isConnected() && isEditable();
+ aReturn.bEnabled = !m_vTableData.empty() && isConnected() && isEditable();
aReturn.bChecked = false;
break;
case ID_BROWSER_SAVEDOC:
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index f7b82dc44..6597ccf71 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RelationTableView.cxx,v $
- * $Revision: 1.30 $
+ * $Revision: 1.30.26.2 $
*
* This file is part of OpenOffice.org.
*
@@ -30,105 +30,60 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
-#ifndef DBAUI_RELATION_TABLEVIEW_HXX
+
#include "RelationTableView.hxx"
-#endif
-#ifndef DBAUI_JOINEXCHANGE_HXX
+
+
#include "JoinExchange.hxx"
-#endif
-#ifndef _COMPHELPER_EXTRACT_HXX_
+
+
#include <comphelper/extract.hxx>
-#endif
-#ifndef DBACCESS_UI_BROWSER_ID_HXX
+
+
#include "browserids.hxx"
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
+
+
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
+
+
#include <com/sun/star/sdbc/XConnection.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_
+
+
#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
+
+
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_KEYTYPE_HPP_
+
+
#include <com/sun/star/sdbcx/KeyType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
+
#include <com/sun/star/container/XIndexAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
#include "dbustrings.hrc"
-#endif
-#ifndef _CONNECTIVITY_DBTOOLS_HXX_
#include <connectivity/dbtools.hxx>
-#endif
-#ifndef _COMPHELPER_SEQUENCE_HXX_
#include <comphelper/sequence.hxx>
-#endif
-#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
-#endif
-#ifndef _DBA_DBACCESS_HELPID_HRC_
#include "dbaccess_helpid.hrc"
-#endif
-#ifndef DBAUI_RELATIONDESIGNVIEW_HXX
#include "RelationDesignView.hxx"
-#endif
-#ifndef DBAUI_JOINCONTROLLER_HXX
#include "JoinController.hxx"
-#endif
-#ifndef DBAUI_TABLEWINDOW_HXX
#include "TableWindow.hxx"
-#endif
-#ifndef DBAUI_TABLEWINDOWDATA_HXX
#include "TableWindowData.hxx"
-#endif
-#ifndef DBAUI_RTABLECONNECTION_HXX
#include "RTableConnection.hxx"
-#endif
-#ifndef DBAUI_RTABLECONNECTIONDATA_HXX
#include "RTableConnectionData.hxx"
-#endif
-#ifndef DBAUI_RELATIONDIALOG_HXX
#include "RelationDlg.hxx"
-#endif
-#ifndef _DBAUI_SQLMESSAGE_HXX_
#include "sqlmessage.hxx"
-#endif
-#ifndef _DBU_REL_HRC_
#include "dbu_rel.hrc"
-#endif
-#ifndef DBAUI_TOOLS_HXX
#include "UITools.hxx"
-#endif
-#ifndef _DBHELPER_DBEXCEPTION_HXX_
#include <connectivity/dbexception.hxx>
-#endif
-#ifndef DBAUI_RELTABLEWINDOW_HXX
#include "RTableWindow.hxx"
-#endif
-#ifndef DBACCESS_JACCESS_HXX
#include "JAccess.hxx"
-#endif
-#ifndef _UNDO_HXX
#include <svtools/undo.hxx>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
-#endif
using namespace dbaui;
using namespace ::dbtools;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
@@ -142,8 +97,11 @@ using namespace ::com::sun::star::accessibility;
DBG_NAME(ORelationTableView)
//------------------------------------------------------------------------
ORelationTableView::ORelationTableView( Window* pParent, ORelationDesignView* pView )
- : OJoinTableView( pParent, pView )
+ :OJoinTableView( pParent, pView )
+ , ::comphelper::OContainerListener(m_aMutex)
,m_pExistingConnection(NULL)
+ ,m_bInRemove(false)
+
{
DBG_CTOR(ORelationTableView,NULL);
SetHelpId(HID_CTL_RELATIONTAB);
@@ -153,12 +111,23 @@ ORelationTableView::ORelationTableView( Window* pParent, ORelationDesignView* pV
ORelationTableView::~ORelationTableView()
{
DBG_DTOR(ORelationTableView,NULL);
+ if ( m_pContainerListener.is() )
+ m_pContainerListener->dispose();
}
//------------------------------------------------------------------------
void ORelationTableView::ReSync()
{
DBG_CHKTHIS(ORelationTableView,NULL);
+ if ( !m_pContainerListener.is() )
+ {
+ Reference< XConnection> xConnection = m_pView->getController().getConnection();
+ Reference< XTablesSupplier > xTableSupp( xConnection, UNO_QUERY_THROW );
+ Reference< XNameAccess > xTables = xTableSupp->getTables();
+ Reference< XContainer> xContainer(xTables,uno::UNO_QUERY);
+ if ( xContainer.is() )
+ m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer);
+ }
// Es kann sein, dass in der DB Tabellen ausgeblendet wurden, die eigentlich Bestandteil einer Relation sind. Oder eine Tabelle
// befand sich im Layout (durchaus ohne Relation), existiert aber nicht mehr. In beiden Faellen wird das Anlegen des TabWins schief
// gehen, und alle solchen TabWinDatas oder darauf bezogenen ConnDatas muss ich dann loeschen.
@@ -343,7 +312,7 @@ bool ORelationTableView::RemoveConnection( OTableConnection* pConn ,sal_Bool /*_
ORelationTableConnectionData* pTabConnData = (ORelationTableConnectionData*)pConn->GetData().get();
try
{
- if (pTabConnData->DropRelation())
+ if ( m_bInRemove || pTabConnData->DropRelation())
return OJoinTableView::RemoveConnection( pConn ,sal_True);
}
catch(SQLException& e)
@@ -407,7 +376,7 @@ void ORelationTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const
void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin )
{
OSQLMessageBox aDlg(this,ModuleRes(STR_QUERY_REL_DELETE_WINDOW),String(),WB_YES_NO|WB_DEF_YES,OSQLMessageBox::Warning);
- if(aDlg.Execute() == RET_YES)
+ if ( m_bInRemove || aDlg.Execute() == RET_YES )
{
m_pView->getController().getUndoMgr()->Clear();
OJoinTableView::RemoveTabWin( pTabWin );
@@ -488,4 +457,33 @@ bool ORelationTableView::allowQueries() const
{
return false;
}
+// -----------------------------------------------------------------------------
+void ORelationTableView::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+
+}
+// -----------------------------------------------------------------------------
+void ORelationTableView::_elementRemoved( const container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException)
+{
+ m_bInRemove = true;
+ ::rtl::OUString sName;
+ if ( _rEvent.Accessor >>= sName )
+ {
+ OTableWindow* pTableWindow = GetTabWindow(sName);
+ if ( pTableWindow )
+ {
+ m_pView->getController().getUndoMgr()->Clear();
+ OJoinTableView::RemoveTabWin( pTableWindow );
+
+ m_pView->getController().InvalidateFeature(SID_RELATION_ADD_RELATION);
+ m_pView->getController().InvalidateFeature(ID_BROWSER_UNDO);
+ m_pView->getController().InvalidateFeature(ID_BROWSER_REDO);
+ }
+ } // if ( _rEvent.Accessor >>= sName )
+ m_bInRemove = false;
+}
+// -----------------------------------------------------------------------------
+void ORelationTableView::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+}
diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
index b3cc292d2..2104cc29a 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FieldDescriptions.cxx,v $
- * $Revision: 1.29 $
+ * $Revision: 1.29.50.1 $
*
* This file is part of OpenOffice.org.
*
@@ -519,10 +519,26 @@ sal_Int32 OFieldDescription::GetType() const
// -----------------------------------------------------------------------------
sal_Int32 OFieldDescription::GetPrecision() const
{
+ sal_Int32 nPrec = m_nPrecision;
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_PRECISION) )
- return ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_PRECISION));
- else
- return m_nPrecision;
+ nPrec = ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_PRECISION));
+
+ TOTypeInfoSP pTypeInfo = getTypeInfo();
+ if ( pTypeInfo )
+ {
+ switch ( pTypeInfo->nType )
+ {
+ case DataType::TINYINT:
+ case DataType::SMALLINT:
+ case DataType::INTEGER:
+ case DataType::BIGINT:
+ if ( !nPrec )
+ nPrec = pTypeInfo->nPrecision;
+ break;
+ } // switch ( pTypeInfo->nType )
+ }
+
+ return nPrec;
}
// -----------------------------------------------------------------------------
sal_Int32 OFieldDescription::GetScale() const
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 2854a12b9..b699dced7 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TEditControl.cxx,v $
- * $Revision: 1.60 $
+ * $Revision: 1.60.26.1 $
*
* This file is part of OpenOffice.org.
*
@@ -688,6 +688,17 @@ sal_Bool OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId)
case FIELD_PROPERTY_SCALE:
case FIELD_PROPERTY_BOOL_DEFAULT:
pDescrWin->SaveData(pActFieldDescr);
+
+ if ( FIELD_PROPERTY_AUTOINC == nColId && pActFieldDescr->IsAutoIncrement() )
+ {
+ OTableController& rController = GetView()->getController();
+ if ( rController.isAutoIncrementPrimaryKey() )
+ {
+ pActFieldDescr->SetPrimaryKey( true );
+ InvalidateHandleColumn();
+ Invalidate();
+ }
+ }
break;
}
return sal_True;
@@ -1553,8 +1564,8 @@ sal_Bool OTableEditorCtrl::IsPrimaryKeyAllowed( long /*nRow*/ )
// oder wenn Spalten nicht gedroped werden können und das Required Flag ist nicht gesetzt
// oder wenn eine ::com::sun::star::sdbcx::View vorhanden ist und das Required Flag nicht gesetzt ist
TOTypeInfoSP pTypeInfo = pFieldDescr->getTypeInfo();
- if( pTypeInfo->nSearchType == ColumnSearch::NONE ||
- (pFieldDescr->IsNullable() && pRow->IsReadOnly())
+ if( pTypeInfo->nSearchType == ColumnSearch::NONE
+ || (pFieldDescr->IsNullable() && pRow->IsReadOnly())
)
return sal_False;
}
@@ -1758,6 +1769,14 @@ void OTableEditorCtrl::AdjustFieldDescription(OFieldDescription* _pFieldDesc,
{
_pFieldDesc->SetIsNullable(ColumnValue::NO_NULLS);
_pFieldDesc->SetControlDefault(Any());
+ } // if(!_bSet && _pFieldDesc->getTypeInfo()->bNullable)
+ if ( _pFieldDesc->IsAutoIncrement() && !_bPrimaryKey )
+ {
+ OTableController& rController = GetView()->getController();
+ if ( rController.isAutoIncrementPrimaryKey() )
+ {
+ _pFieldDesc->SetAutoIncrement(false);
+ }
}
//////////////////////////////////////////////////////////////////////
// update field description
@@ -1777,13 +1796,12 @@ void OTableEditorCtrl::SetPrimaryKey( sal_Bool bSet )
long nIndex = 0;
::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aIter = m_pRowList->begin();
- for(;aIter != m_pRowList->end();++aIter)
+ for(sal_Int32 nRow = 0;aIter != m_pRowList->end();++aIter,++nRow)
{
OFieldDescription* pFieldDescr = (*aIter)->GetActFieldDescr();
- if( pFieldDescr && (*aIter)->IsPrimaryKey() )
+ if( pFieldDescr && (*aIter)->IsPrimaryKey() && (!bSet || !IsRowSelected(nRow)) )
{
- nIndex = aIter - m_pRowList->begin();
- AdjustFieldDescription(pFieldDescr,aDeletedPrimKeys,nIndex,bSet,sal_False);
+ AdjustFieldDescription(pFieldDescr,aDeletedPrimKeys,nRow,bSet,sal_False);
}
}
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 90014d63c..b55f5ae83 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableController.cxx,v $
- * $Revision: 1.122 $
+ * $Revision: 1.122.24.3 $
*
* This file is part of OpenOffice.org.
*
@@ -110,12 +110,14 @@
#ifndef _COM_SUN_STAR_SDBCX_XINDEXESSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
#endif
+#include <com/sun/star/frame/XTitleChangeListener.hpp>
#ifndef _DBHELPER_DBEXCEPTION_HXX_
#include <connectivity/dbexception.hxx>
#endif
#ifndef _COM_SUN_STAR_UI_XEXECUTABLEDIALOG_HPP_
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#endif
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
#ifndef _COMPHELPER_STREAMSECTION_HXX_
#include <comphelper/streamsection.hxx>
#endif
@@ -163,13 +165,14 @@
#ifndef _CPPUHELPER_EXC_HLP_HXX_
#include <cppuhelper/exc_hlp.hxx>
#endif
+#include "dsmeta.hxx"
extern "C" void SAL_CALL createRegistryInfo_OTableControl()
{
static ::dbaui::OMultiInstanceAutoRegistration< ::dbaui::OTableController > aAutoRegistration;
}
-
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::beans;
@@ -252,6 +255,7 @@ OTableController::OTableController(const Reference< XMultiServiceFactory >& _rM)
InvalidateAll();
m_pTypeInfo = TOTypeInfoSP(new OTypeInfo());
m_pTypeInfo->aUIName = m_sTypeNames.GetToken(TYPE_OTHER);
+ m_aTypeCollection.initUserDriverTypes(_rM);
}
// -----------------------------------------------------------------------------
OTableController::~OTableController()
@@ -422,7 +426,12 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs)
if (_bSaveAs && !bNew)
aDefaultName = String(m_sName);
else
- aDefaultName = getPrivateTitle();
+ {
+ String aName = String(ModuleRes(STR_TBL_TITLE));
+ aDefaultName = aName.GetToken(0,' ');
+ //aDefaultName = getPrivateTitle();
+ aDefaultName = ::dbtools::createUniqueName(xTables,aDefaultName);
+ }
DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE );
OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker );
@@ -492,6 +501,13 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs)
}
// now check if our datasource has set a tablefilter and if append the new table name to it
::dbaui::appendToFilter(getConnection(),m_sName,getORB(),getView()); // we are not interessted in the return value
+ Reference< frame::XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY);
+ if ( xEventListener.is() )
+ {
+ frame::TitleChangedEvent aEvent;
+ xEventListener->titleChanged(aEvent);
+ }
+ releaseNumberForComponent();
}
else if(m_xTable.is())
{
@@ -1075,7 +1091,8 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star::
::comphelper::UStringMixEqual bCase(xMetaData.is() ? xMetaData->supportsMixedCaseQuotedIdentifiers() : sal_True);
::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aIter = m_vRowList.begin();
- for(;aIter != m_vRowList.end();++aIter)
+ ::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aEnd = m_vRowList.end();
+ for(;aIter != aEnd;++aIter)
{
OFieldDescription* pFieldDesc = (*aIter)->GetActFieldDescr();
if (pFieldDesc && pFieldDesc->GetName().getLength())
@@ -1083,7 +1100,7 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star::
bFoundPKey |= (*aIter)->IsPrimaryKey();
// first check for duplicate names
::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aIter2 = aIter+1;
- for(;aIter2 != m_vRowList.end();++aIter2)
+ for(;aIter2 != aEnd;++aIter2)
{
OFieldDescription* pCompareDesc = (*aIter2)->GetActFieldDescr();
if (pCompareDesc && bCase(pCompareDesc->GetName(),pFieldDesc->GetName()))
@@ -1121,15 +1138,13 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star::
pActFieldDescr->SetAutoIncrement(sal_False); // #95927# pTypeInfo->bAutoIncrement
pActFieldDescr->SetIsNullable(ColumnValue::NO_NULLS);
-
pActFieldDescr->SetName( createUniqueName(::rtl::OUString::createFromAscii("ID") ));
pActFieldDescr->SetPrimaryKey( sal_True );
m_vRowList.insert(m_vRowList.begin(),pNewRow);
static_cast<OTableDesignView*>(getView())->GetEditorCtrl()->Invalidate();
- // static_cast<OTableDesignView*>(getView())->GetEditorCtrl()->DisplayData(0);
static_cast<OTableDesignView*>(getView())->GetEditorCtrl()->RowInserted(0);
- }
+ } // if ( pTypeInfo.get() )
}
else if (nReturn == RET_CANCEL)
bOk = sal_False;
@@ -1676,5 +1691,10 @@ sal_Int32 OTableController::getFirstEmptyRowPosition() const
return nRet;
}
// -----------------------------------------------------------------------------
-
-
+bool OTableController::isAutoIncrementPrimaryKey() const
+{
+ ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_URL)));
+ DataSourceMetaData aMeta(eType);
+ return aMeta.getAdvancedSettingsSupport().bAutoIncrementIsPrimaryKey;
+}
+// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx
index e16183b6e..a4e71435d 100644
--- a/dbaccess/source/ui/uno/unoadmin.cxx
+++ b/dbaccess/source/ui/uno/unoadmin.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: unoadmin.cxx,v $
- * $Revision: 1.20 $
+ * $Revision: 1.20.34.1 $
*
* This file is part of OpenOffice.org.
*
@@ -94,7 +94,7 @@ ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XM
{
DBG_CTOR(ODatabaseAdministrationDialog,NULL);
- m_pCollection = new ODsnTypeCollection();
+ m_pCollection = new ::dbaccess::ODsnTypeCollection();
m_pCollection->initUserDriverTypes(m_aContext.getLegacyServiceFactory());
ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection);
}