summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/dlg/dbwizsetup.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/dlg/dbwizsetup.cxx')
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx94
1 files changed, 12 insertions, 82 deletions
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index ce1988ad5..48f5ec294 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,63 +61,25 @@
#include <cppuhelper/exc_hlp.hxx>
/** === begin UNO includes === **/
-#ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_
#include <com/sun/star/frame/XStorable.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UNO_XNAMINGSERVICE_HPP_
#include <com/sun/star/uno/XNamingService.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_
#include <com/sun/star/sdbc/XDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XDOCUMENTDATASOURCE_HPP_
#include <com/sun/star/sdb/XDocumentDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
#include <com/sun/star/frame/XComponentLoader.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
#include <com/sun/star/frame/XModel.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UCB_XSIMPLEFILEACCESS_HPP_
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_TASK_XJOBEXECUTOR_HPP_
#include <com/sun/star/task/XJobExecutor.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
#include <com/sun/star/lang/XInitialization.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
#include <com/sun/star/sdb/CommandType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UCB_INTERACTIVEIOEXCEPTION_HPP_
#include <com/sun/star/ucb/InteractiveIOException.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_IOEXCEPTION_HPP_
#include <com/sun/star/io/IOException.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XTERMINATELISTENER_HPP_
#include <com/sun/star/frame/XTerminateListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
#include <com/sun/star/frame/XDesktop.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_
#include <com/sun/star/sdbc/XDriverAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_DOCUMENT_MACROEXECMODE_HPP_
#include <com/sun/star/document/MacroExecMode.hpp>
-#endif
#include <com/sun/star/ucb/IOErrorCode.hpp>
#include <com/sun/star/task/XInteractionHandler2.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
@@ -129,6 +92,7 @@
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <connectivity/DriversConfig.hxx>
#include <memory>
@@ -160,40 +124,8 @@ using namespace ::cppu;
#define START_PAGE 0
#define CONNECTION_PAGE 1
-
-
-
-//#define DBASE_PATH 1
-//#define TEXT_PATH 2
-//#define MSACCESS_PATH 3
-//#define LDAP_PATH 4
-//#define ADABAS_PATH 5
-//#define ADO_PATH 6
-//#define JDBC_PATH 7
-//#define ORACLE_PATH 8
-//#define MYSQL_JDBC_PATH 9
-//#define MYSQL_ODBC_PATH 10
-//#define ODBC_PATH 11
-//#define SPREADSHEET_PATH 12
-//#define OUTLOOKEXP_PATH 13
-//#define OUTLOOK_PATH 14
-//#define MOZILLA_PATH 15
-//#define EVOLUTION_PATH 16
-//#define EVOLUTION_PATH_GROUPWISE 17
-//#define EVOLUTION_PATH_LDAP 18
-//#define KAB_PATH 19
-//#define MACAB_PATH 20
-//#define THUNDERBIRD_PATH 21
-//#define CREATENEW_PATH 22
-//#define USERDEFINED_PATH 23
-//#define OPEN_DOC_PATH 24
-//#define MSACCESS2007_PATH 25
-//#define MYSQL_NATIVE_PATH 26
-
OFinalDBPageSetup* pFinalPage;
-
-
DBG_NAME(ODbTypeWizDialogSetup)
//=========================================================================
//= ODbTypeWizDialogSetup
@@ -240,7 +172,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent
if (pCollectionItem)
m_pCollection = pCollectionItem->getCollection();
- DBG_ASSERT(m_pCollection, "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !");
+ OSL_ENSURE(m_pCollection, "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !");
FreeResource();
@@ -250,7 +182,6 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent
m_pOutSet = new SfxItemSet( *_pItems->GetPool(), _pItems->GetRanges() );
m_pImpl->translateProperties(xDatasource, *m_pOutSet);
-// eType = m_pImpl->getDatasourceType(*m_pOutSet);
SetPageSizePixel(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MAP_APPFONT));
ShowButtonFixedLine(sal_True);
@@ -298,7 +229,7 @@ void ODbTypeWizDialogSetup::declareAuthDepPath( const ::rtl::OUString& _sURL, Pa
{
if ( bHasAuthentication || ( *aIter != PAGE_DBSETUPWIZARD_AUTHENTIFICATION ) )
aPath.push_back( *aIter );
- } // for(;aIter != aEnd;++aIter)
+ }
// call base method
::svt::RoadmapWizard::declarePath( _nPathId, aPath );
@@ -428,7 +359,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath()
{
sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pCollection->getEmbeddedDatabase() );
if ( nCreateNewDBIndex == -1 )
- nCreateNewDBIndex = m_pCollection->getIndexOf( ::rtl::OUString::createFromAscii( "sdbc:dbase:" ) );
+ nCreateNewDBIndex = m_pCollection->getIndexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:")) );
OSL_ENSURE( nCreateNewDBIndex != -1, "ODbTypeWizDialogSetup::activateDatabasePath: the GeneralPage should have prevented this!" );
activatePath( static_cast< PathId >( nCreateNewDBIndex + 1 ), sal_True );
@@ -457,7 +388,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath()
}
break;
default:
- DBG_ERROR( "ODbTypeWizDialogSetup::activateDatabasePath: unknown creation mode!" );
+ OSL_FAIL( "ODbTypeWizDialogSetup::activateDatabasePath: unknown creation mode!" );
}
enableButtons( WZB_NEXT, m_pGeneralPage->GetDatabaseCreationMode() != OGeneralPage::eOpenExisting );
@@ -724,7 +655,7 @@ IMPL_LINK(ODbTypeWizDialogSetup, ImplClickHdl, OMySQLIntroPageSetup*, _pMySQLInt
case OMySQLIntroPageSetup::VIA_NATIVE:
sURLPrefix = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:mysql:mysqlc:"));
break;
- } // switch( _pMySQLIntroPageSetup->getMySQLMode() )
+ }
activatePath( static_cast<PathId>(m_pCollection->getIndexOf(sURLPrefix) + 1), sal_True);
return sal_True;
}
@@ -795,7 +726,7 @@ sal_Bool ODbTypeWizDialogSetup::leaveState(WizardState _nState)
// -----------------------------------------------------------------------------
void ODbTypeWizDialogSetup::setTitle(const ::rtl::OUString& /*_sTitle*/)
{
- DBG_ERROR( "ODbTypeWizDialogSetup::setTitle: not implemented!" );
+ OSL_FAIL( "ODbTypeWizDialogSetup::setTitle: not implemented!" );
// why?
}
@@ -929,15 +860,13 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
}
else if ( m_pCollection->isFileSystemBased(eType) )
{
- Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" )), UNO_QUERY);
+ Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))), UNO_QUERY);
INetURLObject aDBPathURL(m_sWorkPath);
aDBPathURL.Append(m_aDocURL.getBase());
createUniqueFolderName(&aDBPathURL);
::rtl::OUString sPrefix = eType;
sUrl = aDBPathURL.GetMainURL( INetURLObject::NO_DECODE);
xSimpleFileAccess->createFolder(sUrl);
- //OFileNotation aFileNotation(sUrl);
- //sUrl = aFileNotation.get(OFileNotation::N_SYSTEM);
sUrl = sPrefix.concat(sUrl);
}
m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, sUrl));
@@ -998,7 +927,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
//-------------------------------------------------------------------------
void ODbTypeWizDialogSetup::createUniqueFolderName(INetURLObject* pURL)
{
- Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" )), UNO_QUERY);
+ Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))), UNO_QUERY);
:: rtl::OUString sLastSegmentName = pURL->getName();
sal_Bool bFolderExists = sal_True;
sal_Int32 i = 1;
@@ -1016,7 +945,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
//-------------------------------------------------------------------------
String ODbTypeWizDialogSetup::createUniqueFileName(const INetURLObject& _rURL)
{
- Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" )), UNO_QUERY);
+ Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))), UNO_QUERY);
:: rtl::OUString sFilename = _rURL.getName();
::rtl::OUString BaseName = _rURL.getBase();
::rtl::OUString sExtension = _rURL.getExtension();
@@ -1207,3 +1136,4 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
} // namespace dbaui
//.........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */