summaryrefslogtreecommitdiff
path: root/desktop/source/app
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/app')
-rw-r--r--desktop/source/app/app.cxx107
-rw-r--r--desktop/source/app/appinit.cxx9
-rw-r--r--desktop/source/app/appsys.cxx7
-rw-r--r--desktop/source/app/checkinstall.cxx3
-rw-r--r--desktop/source/app/cmdlineargs.cxx3
-rw-r--r--desktop/source/app/desktopcontext.cxx3
-rw-r--r--desktop/source/app/dispatchwatcher.cxx2
-rw-r--r--desktop/source/app/dispatchwatcher.hxx4
-rw-r--r--desktop/source/app/langselect.cxx5
-rw-r--r--desktop/source/app/lockfile.cxx5
-rw-r--r--desktop/source/app/officeipcthread.cxx7
11 files changed, 81 insertions, 74 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 923ff20fd4c6..996fc6cf36ef 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -195,12 +195,10 @@ ResMgr* Desktop::GetDesktopResManager()
{
if ( !Desktop::pResMgr )
{
- String aMgrName = String::CreateFromAscii( "dkt" );
-
// Create desktop resource manager and bootstrap process
// was successful. Use default way to get language specific message.
if ( Application::IsInExecute() )
- Desktop::pResMgr = ResMgr::CreateResMgr( U2S( aMgrName ));
+ Desktop::pResMgr = ResMgr::CreateResMgr("dkt");
if ( !Desktop::pResMgr )
{
@@ -215,7 +213,7 @@ ResMgr* Desktop::GetDesktopResManager()
::com::sun::star::lang::Locale aLocale( aLanguage, aCountry, aVariant );
- Desktop::pResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLocale);
+ Desktop::pResMgr = ResMgr::SearchCreateResMgr( "dkt", aLocale);
AllSettings as = GetSettings();
as.SetUILocale(aLocale);
SetSettings(as);
@@ -572,64 +570,67 @@ throw()
}
else if( TypeToCopy == +1 ) // Folder
{
- osl::Directory aDir( srcUnqPath );
- aDir.open();
-
err = osl::Directory::create( dstUnqPath );
osl::FileBase::RC next = err;
- if( err == osl::FileBase::E_None ||
- err == osl::FileBase::E_EXIST )
+ if( err == osl::FileBase::E_None || err == osl::FileBase::E_EXIST )
{
err = osl::FileBase::E_None;
- sal_Int32 n_Mask = FileStatusMask_FileURL | FileStatusMask_FileName | FileStatusMask_Type;
-
- osl::DirectoryItem aDirItem;
- while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None )
+ osl::Directory aDir( srcUnqPath );
+ if (aDir.open() == osl::FileBase::E_None)
{
- sal_Bool IsDoc = false;
- sal_Bool bFilter = false;
- osl::FileStatus aFileStatus( n_Mask );
- aDirItem.getFileStatus( aFileStatus );
- if( aFileStatus.isValid( FileStatusMask_Type ) )
- IsDoc = aFileStatus.getFileType() == osl::FileStatus::Regular;
-
- // Getting the information for the next recursive copy
- sal_Int32 newTypeToCopy = IsDoc ? -1 : +1;
-
- rtl::OUString newSrcUnqPath;
- if( aFileStatus.isValid( FileStatusMask_FileURL ) )
- newSrcUnqPath = aFileStatus.getFileURL();
-
- rtl::OUString newDstUnqPath = dstUnqPath;
- rtl::OUString tit;
- if( aFileStatus.isValid( FileStatusMask_FileName ) )
+ sal_Int32 n_Mask = FileStatusMask_FileURL |
+ FileStatusMask_FileName |
+ FileStatusMask_Type;
+
+ osl::DirectoryItem aDirItem;
+ while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None )
{
- ::rtl::OUString aFileName = aFileStatus.getFileName();
- tit = rtl::Uri::encode( aFileName,
- rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 );
-
- // Special treatment for "lastsychronized" file. Must not be
- // copied from the bundled folder!
- if ( IsDoc && aFileName.equalsAscii( pLastSyncFileName ))
- bFilter = true;
- }
+ sal_Bool IsDoc = false;
+ sal_Bool bFilter = false;
+ osl::FileStatus aFileStatus( n_Mask );
+ aDirItem.getFileStatus( aFileStatus );
+ if( aFileStatus.isValid( FileStatusMask_Type ) )
+ IsDoc = aFileStatus.getFileType() == osl::FileStatus::Regular;
+
+ // Getting the information for the next recursive copy
+ sal_Int32 newTypeToCopy = IsDoc ? -1 : +1;
+
+ rtl::OUString newSrcUnqPath;
+ if( aFileStatus.isValid( FileStatusMask_FileURL ) )
+ newSrcUnqPath = aFileStatus.getFileURL();
+
+ rtl::OUString newDstUnqPath = dstUnqPath;
+ rtl::OUString tit;
+ if( aFileStatus.isValid( FileStatusMask_FileName ) )
+ {
+ ::rtl::OUString aFileName = aFileStatus.getFileName();
+ tit = rtl::Uri::encode( aFileName,
+ rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+
+ // Special treatment for "lastsychronized" file. Must not be
+ // copied from the bundled folder!
+ if ( IsDoc && aFileName.equalsAscii( pLastSyncFileName ))
+ bFilter = true;
+ }
- if( newDstUnqPath.lastIndexOf( sal_Unicode('/') ) != newDstUnqPath.getLength()-1 )
- newDstUnqPath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ if( newDstUnqPath.lastIndexOf( sal_Unicode('/') ) != newDstUnqPath.getLength()-1 )
+ newDstUnqPath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- newDstUnqPath += tit;
+ newDstUnqPath += tit;
- if (( newSrcUnqPath != dstUnqPath ) && !bFilter )
- err = copy_bundled_recursive( newSrcUnqPath,newDstUnqPath, newTypeToCopy );
- }
+ if (( newSrcUnqPath != dstUnqPath ) && !bFilter )
+ err = copy_bundled_recursive( newSrcUnqPath,newDstUnqPath, newTypeToCopy );
+ }
- if( err == osl::FileBase::E_None && next != osl::FileBase::E_NOENT )
- err = next;
+ if( err == osl::FileBase::E_None && next != osl::FileBase::E_NOENT )
+ err = next;
+
+ aDir.close();
+ }
}
- aDir.close();
}
return err;
@@ -1603,13 +1604,11 @@ int Desktop::Main()
// create title string
sal_Bool bCheckOk = sal_False;
::com::sun::star::lang::Locale aLocale;
- String aMgrName = String::CreateFromAscii( "iso" );
- ResMgr* pLabelResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLocale );
+ ResMgr* pLabelResMgr = ResMgr::SearchCreateResMgr( "iso", aLocale );
if ( !pLabelResMgr )
{
// no "iso" resource -> search for "ooo" resource
- aMgrName = String::CreateFromAscii( "ooo" );
- pLabelResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLocale);
+ pLabelResMgr = ResMgr::SearchCreateResMgr( "ooo", aLocale);
}
String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, *pLabelResMgr ) ) : String();
delete pLabelResMgr;
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 40b987c79aa1..973a88357f46 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -82,7 +82,6 @@
#define DESKTOP_TEMPDIRNAME "soffice.tmp"
-using namespace rtl;
using namespace desktop;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -90,6 +89,8 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::registry;
using namespace ::com::sun::star::ucb;
+using ::rtl::OUString;
+
namespace desktop
{
@@ -102,7 +103,7 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect)
xServiceFactory( comphelper::getProcessServiceFactory() );
if (!xServiceFactory.is())
{
- DBG_ERROR("configureUcb(): No XMultiServiceFactory");
+ OSL_FAIL("configureUcb(): No XMultiServiceFactory");
return false;
}
@@ -173,7 +174,7 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect)
}
}
}
- } catch (RuntimeException e) {
+ } catch (RuntimeException &e) {
}
}
#endif // GNOME_VFS_ENABLED
@@ -276,7 +277,7 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr )
pCmdLine->GetPortalConnectString( aPortalConnect );
if ( !configureUcb( bServer, aPortalConnect ) )
{
- DBG_ERROR( "Can't configure UCB" );
+ OSL_FAIL( "Can't configure UCB" );
throw com::sun::star::uno::Exception(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RegisterServices, configureUcb")), NULL);
}
diff --git a/desktop/source/app/appsys.cxx b/desktop/source/app/appsys.cxx
index ac01ec2dd669..287a9464793e 100644
--- a/desktop/source/app/appsys.cxx
+++ b/desktop/source/app/appsys.cxx
@@ -35,9 +35,8 @@
#include <rtl/ustring.hxx>
#include <tools/solar.h>
-#include <tools/prewin.h>
-#include <winreg.h>
-#include <tools/postwin.h>
+#include <prewin.h>
+#include <postwin.h>
#include <tools/urlobj.hxx>
@@ -55,7 +54,7 @@ void FATToVFat_Impl( String& aName )
HANDLE h = FindFirstFile( U2S(aName).getStr(), &aData );
if ( h )
{
- // FAT-Kurzname in VFAT-Langname wandeln
+ // Change FAT short filename into VFAT long filename
aObj.removeSegment();
aObj.insertName( String::CreateFromAscii( aData.cFileName ) );
aName = aObj.PathToFileName();
diff --git a/desktop/source/app/checkinstall.cxx b/desktop/source/app/checkinstall.cxx
index 0777eda34592..c0e853d9eef5 100644
--- a/desktop/source/app/checkinstall.cxx
+++ b/desktop/source/app/checkinstall.cxx
@@ -39,11 +39,12 @@
#include <vcl/msgbox.hxx>
#include <tools/date.hxx>
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
+using ::rtl::OUString;
+
namespace desktop
{
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index d0bb6c3d87be..6798e8ede85a 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -43,11 +43,12 @@
#include <cstdio>
-using namespace rtl;
using namespace com::sun::star::lang;
using namespace com::sun::star::uri;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
namespace desktop
{
diff --git a/desktop/source/app/desktopcontext.cxx b/desktop/source/app/desktopcontext.cxx
index bed77fae9f69..2a8ed7ef628c 100644
--- a/desktop/source/app/desktopcontext.cxx
+++ b/desktop/source/app/desktopcontext.cxx
@@ -33,10 +33,11 @@
#include <vcl/svapp.hxx>
#include <svtools/javainteractionhandler.hxx>
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::task;
+using ::rtl::OUString;
+
namespace desktop
{
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 858e4e9acf0b..501fdc19bfd5 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -634,7 +634,7 @@ throw(::com::sun::star::uno::RuntimeException)
void SAL_CALL DispatchWatcher::dispatchFinished( const DispatchResultEvent& ) throw( RuntimeException )
{
osl::ClearableMutexGuard aGuard( GetMutex() );
- sal_Int16 nCount = m_nRequestCount;
+ sal_Int16 nCount = --m_nRequestCount;
aGuard.clear();
OfficeIPCThread::RequestsCompleted( 1 );
if ( !nCount && !OfficeIPCThread::AreRequestsPending() )
diff --git a/desktop/source/app/dispatchwatcher.hxx b/desktop/source/app/dispatchwatcher.hxx
index d8b08747dd45..0fde60da603f 100644
--- a/desktop/source/app/dispatchwatcher.hxx
+++ b/desktop/source/app/dispatchwatcher.hxx
@@ -34,7 +34,7 @@
#include <com/sun/star/frame/XDispatchResultListener.hpp>
#include "officeipcthread.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <vector>
namespace desktop
@@ -56,7 +56,7 @@ struct OUStringHashCode
}
};
-class DispatchWatcherHashMap : public ::std::hash_map< ::rtl::OUString, sal_Int32, OUStringHashCode, ::std::equal_to< ::rtl::OUString > >
+class DispatchWatcherHashMap : public ::boost::unordered_map< ::rtl::OUString, sal_Int32, OUStringHashCode, ::std::equal_to< ::rtl::OUString > >
{
public:
inline void free()
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index 11c5c6a25919..d70703103967 100644
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -54,13 +54,16 @@
#include <osl/process.h>
#include <osl/file.hxx>
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::container;
using namespace com::sun::star::beans;
using namespace com::sun::star::util;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+using ::rtl::OString;
+
namespace desktop {
static char const SOFFICE_BOOTSTRAP[] = "Bootstrap";
diff --git a/desktop/source/app/lockfile.cxx b/desktop/source/app/lockfile.cxx
index d75e5b8bc5f8..5e534f2b2107 100644
--- a/desktop/source/app/lockfile.cxx
+++ b/desktop/source/app/lockfile.cxx
@@ -31,9 +31,8 @@
#include <stdlib.h>
#include <time.h>
#ifdef WNT
-#include <tools/prewin.h>
-#include <windows.h>
-#include <tools/postwin.h>
+#include <prewin.h>
+#include <postwin.h>
#else
#include <unistd.h>
#endif
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index b441d6d32f80..f699463ec089 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -53,12 +53,15 @@
#include "rtl/process.h"
#include "tools/getprocessworkingdir.hxx"
-using namespace rtl;
using namespace desktop;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
+using ::rtl::OString;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
const char *OfficeIPCThread::sc_aTerminationSequence = "InternalIPC::TerminateThread";
const int OfficeIPCThread::sc_nTSeqLength = 28;
const char *OfficeIPCThread::sc_aShowSequence = "-tofront";
@@ -555,7 +558,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
return IPC_STATUS_BOOTSTRAP_ERROR;
}
}
- // finaly, write the string onto the pipe
+ // finally, write the string onto the pipe
aStreamPipe.write( aArguments.GetBuffer(), aArguments.Len() );
aStreamPipe.write( "\0", 1 );