summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/dlg/ConnectionHelper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/dlg/ConnectionHelper.cxx')
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx51
1 files changed, 18 insertions, 33 deletions
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 490d654a88cc..efb8a38dcfd2 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.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.
@@ -30,7 +31,6 @@
#include "dsnItem.hxx"
#include "ConnectionHelper.hxx"
-#include "AutoControlsDef.hrc"
#include "dbu_dlg.hrc"
#include "dbu_misc.hrc"
#include <svl/itemset.hxx>
@@ -44,6 +44,7 @@
#include "dbaccess_helpid.hrc"
#include "localresaccess.hxx"
#include <osl/process.h>
+#include <osl/diagnose.h>
#include <vcl/msgbox.hxx>
#include <sfx2/filedlghelper.hxx>
#include "dbadmin.hxx"
@@ -57,7 +58,6 @@
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/awt/XWindow.hpp>
-// #106016# ------------------------------------
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/ucb/XProgressHandler.hpp>
#include "UITools.hxx"
@@ -69,27 +69,13 @@
#include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h>
#include <sfx2/docfilt.hxx>
-#if !defined(WINDOWS_VISTA_PSDK) && defined(WNT)
-#define _ADO_DATALINK_BROWSE_
-#endif
#ifdef _ADO_DATALINK_BROWSE_
-#if defined( WNT )
- #include <tools/prewin.h>
- #include <windows.h>
- #include <tools/postwin.h>
-#endif
-#ifndef _SV_SYSDATA_HXX
#include <vcl/sysdata.hxx>
-#endif
-#ifndef _DBAUI_ADO_DATALINK_HXX_
#include "adodatalinks.hxx"
-#endif
#endif //_ADO_DATALINK_BROWSE_
-#ifndef _COM_SUN_STAR_MOZILLA_XMOZILLABOOTSTRAP_HPP_
#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
-#endif
#include <unotools/processfactory.hxx>
@@ -125,7 +111,7 @@ DBG_NAME(OConnectionHelper)
if (pCollectionItem)
m_pCollection = pCollectionItem->getCollection();
m_aPB_Connection.SetClickHdl(LINK(this, OConnectionHelper, OnBrowseConnections));
- DBG_ASSERT(m_pCollection, "OConnectionHelper::OConnectionHelper : really need a DSN type collection !");
+ OSL_ENSURE(m_pCollection, "OConnectionHelper::OConnectionHelper : really need a DSN type collection !");
m_aConnectionURL.SetTypeCollection(m_pCollection);
}
@@ -189,7 +175,7 @@ DBG_NAME(OConnectionHelper)
{
try
{
- ::rtl::OUString sFolderPickerService = ::rtl::OUString::createFromAscii(SERVICE_UI_FOLDERPICKER);
+ ::rtl::OUString sFolderPickerService(SERVICE_UI_FOLDERPICKER);
Reference< XFolderPicker > xFolderPicker(m_xORB->createInstance(sFolderPickerService), UNO_QUERY);
if (!xFolderPicker.is())
{
@@ -333,7 +319,6 @@ DBG_NAME(OConnectionHelper)
if (RET_OK == aSelector.Execute())
{
setURLNoPrefix(aSelector.GetSelected());
- // checkCreateDatabase( ::dbaccess::DST_ADABAS);
SetRoadmapStateValue(sal_True);
callModifiedHdl();
}
@@ -411,7 +396,7 @@ DBG_NAME(OConnectionHelper)
aProfiles.insert(pArray[index]);
- // excute the select dialog
+ // execute the select dialog
ODatasourceSelectDialog aSelector(GetParent(), aProfiles, eType);
::rtl::OUString sOldProfile=getURLNoPrefix();
@@ -445,13 +430,13 @@ DBG_NAME(OConnectionHelper)
void OConnectionHelper::impl_setURL( const String& _rURL, sal_Bool _bPrefix )
{
String sURL( _rURL );
- DBG_ASSERT( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" );
+ OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" );
if ( m_pCollection && sURL.Len() )
{
if ( m_pCollection->isFileSystemBased( m_eType ) )
{
- // get the tow parts: prefix and file URL
+ // get the two parts: prefix and file URL
String sTypePrefix, sFileURLEncoded;
if ( _bPrefix )
{
@@ -491,13 +476,13 @@ DBG_NAME(OConnectionHelper)
// get the pure text
String sURL = _bPrefix ? m_aConnectionURL.GetText() : m_aConnectionURL.GetTextNoPrefix();
- DBG_ASSERT( m_pCollection, "OConnectionHelper::impl_getURL: have no interpreter for the URLs!" );
+ OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_getURL: have no interpreter for the URLs!" );
if ( m_pCollection && sURL.Len() )
{
if ( m_pCollection->isFileSystemBased( m_eType ) )
{
- // get the tow parts: prefix and file URL
+ // get the two parts: prefix and file URL
String sTypePrefix, sFileURLDecoded;
if ( _bPrefix )
{
@@ -589,7 +574,6 @@ DBG_NAME(OConnectionHelper)
break;
case RET_NO:
- // SetRoadmapStateValue(sal_False);
callModifiedHdl();
return RET_OK;
@@ -658,7 +642,7 @@ DBG_NAME(OConnectionHelper)
}
catch(Exception&)
{
- DBG_ERROR("OConnectionHelper::getInstalledAdabasDBDirs: could not enumerate the adabas config files!");
+ OSL_FAIL("OConnectionHelper::getInstalledAdabasDBDirs: could not enumerate the adabas config files!");
}
}
@@ -702,7 +686,7 @@ DBG_NAME(OConnectionHelper)
}
return aInstalledDBs;
}
- // #106016# -------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
IS_PATH_EXIST OConnectionHelper::pathExists(const ::rtl::OUString& _rURL, sal_Bool bIsFile) const
{
::ucbhelper::Content aCheckExistence;
@@ -747,7 +731,7 @@ DBG_NAME(OConnectionHelper)
return 1L; // handled
}
break;
- } // switch (_rNEvt.GetType())
+ }
}
return OGenericAdministrationPage::PreNotify( _rNEvt );
@@ -768,7 +752,6 @@ DBG_NAME(OConnectionHelper)
::std::vector< ::rtl::OUString > aToBeCreated; // the to-be-created levels
// search a level which exists
- // #106016# ---------------------
IS_PATH_EXIST eParentExists = PATH_NOT_EXIST;
while ( eParentExists == PATH_NOT_EXIST && aParser.getSegmentCount())
{
@@ -790,18 +773,18 @@ DBG_NAME(OConnectionHelper)
::rtl::OUString sContentType;
if ( INET_PROT_FILE == eProtocol )
{
- sContentType = ::rtl::OUString::createFromAscii( "application/vnd.sun.staroffice.fsys-folder" );
+ sContentType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.staroffice.fsys-folder"));
// the file UCP currently does not support the ContentType property
}
else
{
- Any aContentType = aParent.getPropertyValue( ::rtl::OUString::createFromAscii( "ContentType" ) );
+ Any aContentType = aParent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType")) );
aContentType >>= sContentType;
}
// the properties which need to be set on the new content
Sequence< ::rtl::OUString > aNewDirectoryProperties(1);
- aNewDirectoryProperties[0] = ::rtl::OUString::createFromAscii("Title");
+ aNewDirectoryProperties[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title"));
// the values to be set
Sequence< Any > aNewDirectoryAttributes(1);
@@ -861,7 +844,7 @@ DBG_NAME(OConnectionHelper)
const ::dbaccess::DATASOURCE_TYPE eType = m_pCollection->determineType(m_eType);
if ( ( ::dbaccess::DST_CALC == eType) || ( ::dbaccess::DST_MSACCESS == eType) || ( ::dbaccess::DST_MSACCESS_2007 == eType) )
- { // #106016# --------------------------
+ {
if( pathExists(sURL, sal_True) == PATH_NOT_EXIST )
{
String sFile = String( ModuleRes( STR_FILE_DOES_NOT_EXIST ) );
@@ -914,3 +897,5 @@ DBG_NAME(OConnectionHelper)
//.........................................................................
} // namespace dbaui
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */