update dev300-m58
[ooovba.git] / applied_patches / 0518-lockfile-less-symbols.diff
blobc3a31a7a72a2e107bb36e60e139455338b5bcf75
1 diff --git desktop/source/app/lockfile.cxx desktop/source/app/lockfile.cxx
2 index a026115..058d66a 100644
3 --- desktop/source/app/lockfile.cxx
4 +++ desktop/source/app/lockfile.cxx
5 @@ -88,24 +88,6 @@ static rtl::OString impl_getHostname()
7 namespace desktop {
9 - // initialize static members...
10 - // lock suffix
11 - const OUString Lockfile::Suffix()
12 - { return OUString::createFromAscii( "/.lock" ); }
13 - // values for datafile
14 - const ByteString Lockfile::Group()
15 - { return ByteString( "Lockdata" ); }
16 - const ByteString Lockfile::Userkey()
17 - { return ByteString( "User" ); }
18 - const ByteString Lockfile::Hostkey()
19 - { return ByteString( "Host" ); }
20 - const ByteString Lockfile::Stampkey()
21 - { return ByteString( "Stamp" ); }
22 - const ByteString Lockfile::Timekey()
23 - { return ByteString( "Time" ); }
24 - const ByteString Lockfile::IPCkey()
25 - { return ByteString( "IPCServer" ); }
27 Lockfile::Lockfile( bool bIPCserver )
28 :m_bIPCserver(bIPCserver)
29 ,m_bRemove(sal_False)
30 @@ -114,7 +96,7 @@ namespace desktop {
31 // build the file-url to use for the lock
32 OUString aUserPath;
33 utl::Bootstrap::locateUserInstallation( aUserPath );
34 - m_aLockname = aUserPath + Suffix();
35 + m_aLockname = aUserPath + LOCKFILE_SUFFIX;
37 // generate ID
38 const int nIdBytes = 16;
39 @@ -184,13 +166,13 @@ namespace desktop {
40 // to assume that it is a stale lockfile which can be overwritten
41 String aLockname = m_aLockname;
42 Config aConfig(aLockname);
43 - aConfig.SetGroup(Group());
44 - ByteString aIPCserver = aConfig.ReadKey( IPCkey() );
45 + aConfig.SetGroup(LOCKFILE_GROUP);
46 + ByteString aIPCserver = aConfig.ReadKey( LOCKFILE_IPCKEY );
47 if (! aIPCserver.EqualsIgnoreCaseAscii( "true" ))
48 return false;
50 - ByteString aHost = aConfig.ReadKey( Hostkey() );
51 - ByteString aUser = aConfig.ReadKey( Userkey() );
52 + ByteString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY );
53 + ByteString aUser = aConfig.ReadKey( LOCKFILE_USERKEY );
55 // lockfile from same host?
56 ByteString myHost( impl_getHostname() );
57 @@ -210,7 +192,7 @@ namespace desktop {
59 String aLockname = m_aLockname;
60 Config aConfig(aLockname);
61 - aConfig.SetGroup(Group());
62 + aConfig.SetGroup(LOCKFILE_GROUP);
64 // get information
65 ByteString aHost( impl_getHostname() );
66 @@ -222,12 +204,12 @@ namespace desktop {
67 ByteString aStamp = OUStringToOString( m_aId, RTL_TEXTENCODING_ASCII_US );
69 // write information
70 - aConfig.WriteKey( Userkey(), aUser );
71 - aConfig.WriteKey( Hostkey(), aHost );
72 - aConfig.WriteKey( Stampkey(), aStamp );
73 - aConfig.WriteKey( Timekey(), aTime );
74 + aConfig.WriteKey( LOCKFILE_USERKEY, aUser );
75 + aConfig.WriteKey( LOCKFILE_HOSTKEY, aHost );
76 + aConfig.WriteKey( LOCKFILE_STAMPKEY, aStamp );
77 + aConfig.WriteKey( LOCKFILE_TIMEKEY, aTime );
78 aConfig.WriteKey(
79 - IPCkey(),
80 + LOCKFILE_IPCKEY,
81 m_bIPCserver ? ByteString("true") : ByteString("false") );
82 aConfig.Flush( );
84 diff --git desktop/source/app/lockfile.hxx desktop/source/app/lockfile.hxx
85 index dca72d7..8194b48 100644
86 --- desktop/source/app/lockfile.hxx
87 +++ desktop/source/app/lockfile.hxx
88 @@ -48,6 +48,14 @@
90 class ByteString;
92 +#define LOCKFILE_SUFFIX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/.lock" ) )
93 +#define LOCKFILE_GROUP ByteString( "Lockdata" )
94 +#define LOCKFILE_USERKEY ByteString( "User" )
95 +#define LOCKFILE_HOSTKEY ByteString( "Host" )
96 +#define LOCKFILE_STAMPKEY ByteString( "Stamp" )
97 +#define LOCKFILE_TIMEKEY ByteString( "Time" )
98 +#define LOCKFILE_IPCKEY ByteString( "IPCServer" )
100 namespace desktop {
102 class Lockfile;
103 @@ -74,15 +82,6 @@ namespace desktop {
104 ~Lockfile(void);
106 private:
107 - // data in lockfile
108 - static const ByteString Group();
109 - static const ByteString Userkey();
110 - static const ByteString Hostkey();
111 - static const ByteString Stampkey();
112 - static const ByteString Timekey();
113 - static const ByteString IPCkey();
114 - // lockfilename
115 - static const rtl::OUString Suffix();
116 bool m_bIPCserver;
117 // full qualified name (file://-url) of the lockfile
118 rtl::OUString m_aLockname;
119 diff --git desktop/source/app/lockfile2.cxx desktop/source/app/lockfile2.cxx
120 index f03271f..ce9cc1e 100644
121 --- desktop/source/app/lockfile2.cxx
122 +++ desktop/source/app/lockfile2.cxx
123 @@ -45,11 +45,11 @@ bool Lockfile_execWarning( Lockfile * that )
124 // read information from lock
125 String aLockname = that->m_aLockname;
126 Config aConfig(aLockname);
127 - aConfig.SetGroup(that->Group());
128 - ByteString aHost = aConfig.ReadKey( that->Hostkey() );
129 - ByteString aUser = aConfig.ReadKey( that->Userkey() );
130 - ByteString aStamp = aConfig.ReadKey( that->Stampkey() );
131 - ByteString aTime = aConfig.ReadKey( that->Timekey() );
132 + aConfig.SetGroup( LOCKFILE_GROUP );
133 + ByteString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY );
134 + ByteString aUser = aConfig.ReadKey( LOCKFILE_USERKEY );
135 + ByteString aStamp = aConfig.ReadKey( LOCKFILE_STAMPKEY );
136 + ByteString aTime = aConfig.ReadKey( LOCKFILE_TIMEKEY );
138 // display warning and return response
139 QueryBox aBox( NULL, DesktopResId( QBX_USERDATALOCKED ) );