ooo-build r12566 - in branches/ooo-build-2-4-1: . patches/src680



Author: pmladek
Date: Fri May 16 17:05:58 2008
New Revision: 12566
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12566&view=rev

Log:
2008-05-16  Jan Holesovsky  <kendy suse cz>

	* patches/dev300/lockfile-dont-do-dns-lookup.diff: Don't do dns lookup
	  just to write something nice to .lock file, n#389257




Added:
   branches/ooo-build-2-4-1/patches/src680/lockfile-dont-do-dns-lookup.diff
Modified:
   branches/ooo-build-2-4-1/ChangeLog
   branches/ooo-build-2-4-1/patches/src680/apply
   branches/ooo-build-2-4-1/patches/src680/sw-field-patch.diff

Modified: branches/ooo-build-2-4-1/patches/src680/apply
==============================================================================
--- branches/ooo-build-2-4-1/patches/src680/apply	(original)
+++ branches/ooo-build-2-4-1/patches/src680/apply	Fri May 16 17:05:58 2008
@@ -2312,6 +2312,9 @@
 sd-inplace-deselection-fix.diff, i#89283, n#384506, thorsten
 cairocanvas-fix-image-cache.diff, rodo
 
+# don't do dns lookup on startup
+lockfile-dont-do-dns-lookup.diff, n#389257, jholesov
+
 [ LinkWarningDlg ]
 linkwarn-dlg-in-apps.diff, n#348149, thorsten
 linkwarn-sfx2-disable-cb-persistency.diff, n#348149, thorsten

Added: branches/ooo-build-2-4-1/patches/src680/lockfile-dont-do-dns-lookup.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-2-4-1/patches/src680/lockfile-dont-do-dns-lookup.diff	Fri May 16 17:05:58 2008
@@ -0,0 +1,105 @@
+diff --git desktop/source/app/lockfile.cxx desktop/source/app/lockfile.cxx
+index b1bba75..a026115 100644
+--- desktop/source/app/lockfile.cxx
++++ desktop/source/app/lockfile.cxx
+@@ -36,6 +36,8 @@
+ #include <tools/prewin.h>
+ #include <windows.h>
+ #include <tools/postwin.h>
++#else
++#include <unistd.h>
+ #endif
+ #include <sal/types.h>
+ #include <osl/file.hxx>
+@@ -53,6 +55,37 @@ using namespace ::rtl;
+ using namespace ::utl;
+ 
+ 
++static rtl::OString impl_getHostname()
++{
++    rtl::OString aHost;
++#ifdef WNT
++    /*
++       prevent windows from connecting to the net to get it's own
++       hostname by using the netbios name
++       */
++    sal_Int32 sz = MAX_COMPUTERNAME_LENGTH + 1;
++    char* szHost = new char[sz];
++    if (GetComputerName(szHost, (LPDWORD)&sz))
++        aHost = OString(szHost);
++    else
++        aHost = OString("UNKNOWN");
++    delete[] szHost;
++#else
++    /* Don't do dns lookup on Linux either */
++    sal_Char pHostName[1024];
++
++    if ( gethostname( pHostName, sizeof( pHostName ) - 1 ) == 0 )
++    {
++        pHostName[sizeof( pHostName ) - 1] = '\0';
++        aHost = OString( pHostName );
++    }
++    else
++        aHost = OString("UNKNOWN");
++#endif
++
++    return aHost;
++}
++
+ namespace desktop {
+ 
+ 	// initialize static members...
+@@ -158,25 +191,9 @@ namespace desktop {
+         
+ 		ByteString aHost  = aConfig.ReadKey( Hostkey() );
+ 		ByteString aUser  = aConfig.ReadKey( Userkey() );
++
+ 		// lockfile from same host?
+-		ByteString myHost;
+-#ifdef WNT
+-        /*
+-          prevent windows from connecting to the net to get it's own
+-          hostname by using the netbios name
+-        */
+-        sal_Int32 sz = MAX_COMPUTERNAME_LENGTH + 1;
+-        char* szHost = new char[sz];
+-        if (GetComputerName(szHost, (LPDWORD)&sz))
+-            myHost = OString(szHost);
+-        else
+-            myHost = OString("UNKNOWN");
+-        delete[] szHost;
+-#else
+-		oslSocketResult sRes;
+-        myHost  = OUStringToOString(
+-			SocketAddr::getLocalHostname( &sRes ), RTL_TEXTENCODING_ASCII_US );
+-#endif
++		ByteString myHost( impl_getHostname() );
+ 		if (aHost == myHost) {
+ 			// lockfile by same UID
+ 			OUString myUserName;
+@@ -196,24 +213,7 @@ namespace desktop {
+ 		aConfig.SetGroup(Group());
+ 
+ 		// get information
+-        ByteString aHost;
+-#ifdef WNT
+-        /*
+-          prevent windows from connecting to the net to get it's own
+-          hostname by using the netbios name
+-        */
+-        sal_Int32 sz = MAX_COMPUTERNAME_LENGTH + 1;
+-        char* szHost = new char[sz];
+-        if (GetComputerName(szHost, (LPDWORD)&sz))
+-            aHost = OString(szHost);
+-        else
+-            aHost = OString("UNKNOWN");
+-        delete[] szHost;
+-#else
+-		oslSocketResult sRes;
+-		aHost  = OUStringToOString(
+-			SocketAddr::getLocalHostname( &sRes ), RTL_TEXTENCODING_ASCII_US );
+-#endif
++		ByteString aHost( impl_getHostname() );
+ 		OUString aUserName;
+ 		Security aSecurity;
+ 		aSecurity.getUserName( aUserName );

Modified: branches/ooo-build-2-4-1/patches/src680/sw-field-patch.diff
==============================================================================
--- branches/ooo-build-2-4-1/patches/src680/sw-field-patch.diff	(original)
+++ branches/ooo-build-2-4-1/patches/src680/sw-field-patch.diff	Fri May 16 17:05:58 2008
@@ -720,7 +720,7 @@
 +		const SwTxtNode* pStartTxtNode=pDoc->GetNodes()[pBM->GetPos().nNode]->GetTxtNode();
 +		const SwTxtNode* pEndTxtNode=pDoc->GetNodes()[pBM->GetOtherPos()->nNode]->GetTxtNode();
 +		xub_StrLen ch_start_pos=pBM->GetPos().nContent.GetIndex();
-+		xub_StrLen ch_end_pos=pBM->GetOtherPos()->nContent.GetIndex()
++		xub_StrLen ch_end_pos=pBM->GetOtherPos()->nContent.GetIndex();
 +		if (ch_end_pos==0 || ch_end_pos<=ch_start_pos) {
 +		    ch_end_pos=ch_start_pos;
 +		} else {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]