[Libreoffice-commits] .: Branch 'libreoffice-4-0' - desktop/source

2013-01-26 Thread Libreoffice Gerrit user
 desktop/source/migration/migration.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 04f2233c6c8a503147105af86ad447f70d33ec71
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Jan 25 18:30:23 2013 +0100

fdo#57061: Use a new MIGRATION4 flag file for profile migration LO 3 - 4

...to avoid missing migrations on Windows and Mac OS X, where existing 3 
user
profiles got the MIGRATED flag file erroneously added when running LO 3
already, presumably due to 6b522673373797bbf53d795d53e0ec45175a5d67 default
config location has changed, look in old config dir when migrating.

(cherry picked from commit 67d23e3a99bbaaa5a4dff1f8f3a10bd8abd198fb)
Conflicts:
desktop/source/migration/migration.cxx

Change-Id: I8dd50a36450c167d47411834cc06a754affadf6d
Reviewed-on: https://gerrit.libreoffice.org/1867
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/desktop/source/migration/migration.cxx 
b/desktop/source/migration/migration.cxx
index 1b4115a..f56fd24 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -169,7 +169,7 @@ static const char ITEM_DESCRIPTOR_LABEL[] = Label;
 
 bool MigrationImpl::alreadyMigrated()
 {
-rtl::OUString 
MIGRATION_STAMP_NAME(RTL_CONSTASCII_USTRINGPARAM(/MIGRATED));
+rtl::OUString 
MIGRATION_STAMP_NAME(RTL_CONSTASCII_USTRINGPARAM(/MIGRATED4));
 rtl::OUString aStr = m_aInfo.userdata + MIGRATION_STAMP_NAME;
 File aFile(aStr);
 // create migration stamp, and/or check its existence
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-4-0' - desktop/source scp2/source

2013-01-10 Thread Libreoffice Gerrit user
 desktop/source/deployment/manager/dp_manager.cxx |2 +-
 scp2/source/ooo/common_brand.scp |8 
 scp2/source/ooo/profileitem_ooo.scp  |9 +
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 147ce2ebeeac686d0a8e9e3d6d804aeba0fcbcdc
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Jan 10 11:54:28 2013 +0100

fdo#58909: Missing BAK_EXTENSIONS bootstrap variable

daeed90f4586eb9533041fb89bee163a5193596c re-base on ALv2 code had 
incorporated
from http://svn.apache.org/viewvc?view=revisionrevision=1172102 imported
patch extensions_i117681.patch the parts using BAK_EXTENSIONS in
desktop/source/deployment/manager/, but not the parts setting 
BAK_EXTENSIONS in
scp2/source/ooo/.

Also, setting the stamp for bak in PackageManagerImpl::create needed to be
adapted to bee742eb7a0d5dfe23e61d9ee49a29286de90256 Fix sense of r/o 
detection
code, and clean up and 61eeb689d7605a23c3e71c652b57ee65cf5b28dc fix 
smoketest
- need to check read-only-ness of non-existent paths.

(cherry picked from commit 8dd405d32cb331818dc8f9bd1af3c5a074100f0f)
Conflicts:
desktop/source/deployment/manager/dp_manager.cxx

Change-Id: Ie73ce50b6c26bbee6f3b7230a4d163715180ef52
Reviewed-on: https://gerrit.libreoffice.org/1626
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/desktop/source/deployment/manager/dp_manager.cxx 
b/desktop/source/deployment/manager/dp_manager.cxx
index ba67f9e..b9949df 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -398,7 +398,7 @@ Referencedeployment::XPackageManager 
PackageManagerImpl::create(
 vnd.sun.star.expand:$BAK_EXTENSIONS);
 that-m_registryCache = OUSTR(
 vnd.sun.star.expand:$BAK_EXTENSIONS/registry);
-stamp = OUSTR(vnd.sun.star.expand:$BAK_EXTENSIONS/stamp.sys);
+stamp = OUSTR($BAK_EXTENSIONS);
 }
 
 else if (! context.matchAsciiL(
diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index 7ba7e76..0c21df8 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -1198,6 +1198,14 @@ ProfileItem 
gid_Brand_Profileitem_Fundamental_Uno_Tmp_Extensions
 Value = ${$ORIGIN/ PROFILENAME(uno) :TMP_EXTENSIONS};
 End
 
+ProfileItem gid_Brand_Profileitem_Fundamental_Uno_Bak_Extensions
+ModuleID = gid_Module_Root_Brand;
+ProfileID = gid_Brand_Profile_Fundamental_Ini;
+Section = Bootstrap;
+Key = BAK_EXTENSIONS;
+Value = ${$ORIGIN/ PROFILENAME(uno) :TMP_EXTENSIONS};
+End
+
 ProfileItem gid_Brand_Profileitem_Fundamental_Ure_More_Types
 ModuleID = gid_Module_Root_Brand;
 ProfileID = gid_Brand_Profile_Fundamental_Ini;
diff --git a/scp2/source/ooo/profileitem_ooo.scp 
b/scp2/source/ooo/profileitem_ooo.scp
index 69ca5c6..abe5df4 100644
--- a/scp2/source/ooo/profileitem_ooo.scp
+++ b/scp2/source/ooo/profileitem_ooo.scp
@@ -166,6 +166,15 @@ ProfileItem gid_Profileitem_Uno_Uno_Bundled_Tmp_Extensions
 Value = ${$BRAND_BASE_DIR/program/ PROFILENAME(bootstrap) 
:UserInstallation}/user/extensions/tmp;
 End
 
+ProfileItem gid_Profileitem_Uno_Uno_Bundled_Bak_Extensions
+ProfileID = gid_Profile_Uno_Ini;
+ModuleID = gid_Module_Root;
+Section = Bootstrap;
+Order = 1;
+Key = BAK_EXTENSIONS;
+Value = ${$BRAND_BASE_DIR/program/ PROFILENAME(bootstrap) 
:UserInstallation}/user/extensions/bak;
+End
+
 ProfileItem gid_Profileitem_Uno_Uno_User_Packages_Cache
 ProfileID = gid_Profile_Uno_Ini;
 ModuleID = gid_Module_Root;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-4-0' - desktop/source

2012-12-19 Thread Libreoffice Gerrit user
 desktop/source/deployment/registry/package/dp_package.cxx |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit d1f56fe90c99bdff83990035f5518266916b980b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Dec 19 13:52:56 2012 +0100

fdo#58331: Handle IllegalArgumentException routinely thrown for legacy exts

...that was no longer handled properly when installing such a legacy .zip
extension due to 31170413ae3786bf44564e813d7291354e939a77 API CHANGE:
com.sun.star.lang.IllegalArgumentException.

Change-Id: I6f5f4be0eed16496d8d3c3623d6676c7c669c5c4
(cherry picked from commit eaf3c60194e440e8a9bebac46f8d55ba6246001a)

diff --git a/desktop/source/deployment/registry/package/dp_package.cxx 
b/desktop/source/deployment/registry/package/dp_package.cxx
index 3e5d31c..e2cdfad 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -866,7 +866,7 @@ void BackendImpl::PackageImpl::processPackage_(
 try {
 xPackage-registerPackage( startup, xSubAbortChannel, xCmdEnv 
);
 }
-catch (const Exception )
+catch (const Exception  e)
 {
//We even try a rollback if the user cancelled the action 
(CommandAbortedException)
 //in order to prevent invalid database entries.
@@ -1366,9 +1366,15 @@ Referencedeployment::XPackage 
BackendImpl::PackageImpl::bindBundleItem(
 
 Referencedeployment::XPackagexPackage;
 try {
-xPackage.set( getMyBackend()-m_xRootRegistry-bindPackage(
-  url, mediaType, bRemoved, identifier, xCmdEnv ) );
-OSL_ASSERT( xPackage.is() );
+try {
+xPackage.set( getMyBackend()-m_xRootRegistry-bindPackage(
+  url, mediaType, bRemoved, identifier, xCmdEnv ) 
);
+OSL_ASSERT( xPackage.is() );
+} catch (css::lang::IllegalArgumentException  e) {
+css::uno::Any exc(cppu::getCaughtException());
+throw css::lang::WrappedTargetException(
+wrapped:  + e.Message, e.Context, exc);
+}
 }
 catch (const RuntimeException ) {
 throw;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-4-0' - desktop/source

2012-12-17 Thread Libreoffice Gerrit user
 desktop/source/app/officeipcthread.cxx |   54 ++---
 desktop/source/app/officeipcthread.hxx |1 
 2 files changed, 23 insertions(+), 32 deletions(-)

New commits:
commit 6527b8a135c20e223a6fcf7c49835205a99ff02a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Dec 13 15:41:10 2012 +0100

Related fdo#33484: Terminate OfficeIPCThread by closing the accepting pipe

... (and setting mbDowning to indicate an error returned from accept() is 
due to
termination) instead of setting up an extra pipe connection to send an
InternalIPC::TerminateThread message (which allegedly caused deadlocks, 
see
https://gerrit.libreoffice.org/#/c/1311/ Change Idf933915: office ipc: 
use
timeout pipe feature when connecting to self).

Change-Id: Id302ca13112fc409685e7665b38f1030704a0ccf
(cherry picked from commit 4ce2602befd59e69264d8e4ced8730b40c2b947c)

Conflicts:
desktop/source/app/officeipcthread.cxx
desktop/source/app/officeipcthread.hxx

diff --git a/desktop/source/app/officeipcthread.cxx 
b/desktop/source/app/officeipcthread.cxx
index 7d477a7..56e54db 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -51,8 +51,6 @@ 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;
 const int OfficeIPCThread::sc_nShSeqLength = 5;
 const char  *OfficeIPCThread::sc_aConfirmationSequence = 
InternalIPC::ProcessingDone;
@@ -427,8 +425,6 @@ OfficeIPCThread::Status 
OfficeIPCThread::EnableOfficeIPCThread()
 
 rtl::Reference OfficeIPCThread  pThread(new OfficeIPCThread);
 
-pThread-maPipeIdent = OUString( SingleOfficeIPC_  );
-
 // The name of the named pipe is created with the hashcode of the user 
installation directory (without /user). We have to retrieve
 // this information from a unotools implementation.
 ::utl::Bootstrap::PathStatus aLocateResult = 
::utl::Bootstrap::locateUserInstallation( aUserInstallPath );
@@ -485,19 +481,19 @@ OfficeIPCThread::Status 
OfficeIPCThread::EnableOfficeIPCThread()
 if ( aUserInstallPathHashCode.isEmpty() )
 return IPC_STATUS_BOOTSTRAP_ERROR; // Something completely broken, we 
cannot create a valid hash code!
 
-pThread-maPipeIdent = pThread-maPipeIdent + aUserInstallPathHashCode;
+OUString aPipeIdent( SingleOfficeIPC_ + aUserInstallPathHashCode );
 
 PipeMode nPipeMode = PIPEMODE_DONTKNOW;
 do
 {
 osl::Security rSecurity = Security::get();
 // Try to create pipe
-if ( pThread-maPipe.create( pThread-maPipeIdent.getStr(), 
osl_Pipe_CREATE, rSecurity ))
+if ( pThread-maPipe.create( aPipeIdent.getStr(), osl_Pipe_CREATE, 
rSecurity ))
 {
 // Pipe created
 nPipeMode = PIPEMODE_CREATED;
 }
-else if( pThread-maPipe.create( pThread-maPipeIdent.getStr(), 
osl_Pipe_OPEN, rSecurity )) // Creation not successfull, now we try to connect
+else if( pThread-maPipe.create( aPipeIdent.getStr(), osl_Pipe_OPEN, 
rSecurity )) // Creation not successfull, now we try to connect
 {
 osl::StreamPipe aStreamPipe(pThread-maPipe.getHandle());
 char pReceiveBuffer[sc_nCSASeqLength + 1];
@@ -601,18 +597,8 @@ void OfficeIPCThread::DisableOfficeIPCThread(bool join)
 pGlobalOfficeIPCThread);
 pGlobalOfficeIPCThread.clear();
 
-// send thread a termination message
-// this is done so the subsequent join will not hang
-// because the thread hangs in accept of pipe
-osl::StreamPipe aPipe ( pOfficeIPCThread-maPipeIdent, osl_Pipe_OPEN, 
Security::get() );
-if (aPipe.is())
-{
-aPipe.send( sc_aTerminationSequence, sc_nTSeqLength+1 ); // also 
send 0-byte
-
-// close the pipe so that the streampipe on the other
-// side produces EOF
-aPipe.close();
-}
+pOfficeIPCThread-mbDowning = true;
+pOfficeIPCThread-maPipe.close();
 
 // release mutex to avoid deadlocks
 aMutex.clear();
@@ -680,22 +666,23 @@ void OfficeIPCThread::execute()
 // down during wait
 osl::ClearableMutexGuard aGuard( GetMutex() );
 
-if (!mbDowning)
+if ( mbDowning )
 {
-// notify client we're ready to process its args
-int nBytes = 0;
-int nResult = 0;
-while (
-(nResult = 
maStreamPipe.send(sc_aSendArgumentsSequence+nBytes, sc_nCSASeqLength-nBytes))0 

-((nBytes += nResult)  sc_nCSASeqLength) ) ;
+break;
 }
+
+// notify client we're ready to process its args
+int nBytes = 0;
+   

[Libreoffice-commits] .: Branch 'libreoffice-4-0' - desktop/source desktop/unx desktop/win32

2012-12-13 Thread Libreoffice Gerrit user
 desktop/source/app/officeipcthread.cxx |   40 +-
 desktop/source/app/officeipcthread.hxx |2 
 desktop/unx/source/start.c |   17 -
 desktop/win32/source/officeloader/officeloader.cxx |   60 -
 4 files changed, 88 insertions(+), 31 deletions(-)

New commits:
commit 8376da60d5d272cf6b3ebee91934bbcd970c7658
Author: Pierre-Eric Pelloux-Prayer pierre-e...@lanedo.com
Date:   Tue Nov 20 11:03:03 2012 +0100

startup: more reliable startup of multiple instances

Until now, when a new soffice instance (S2) started and tried to
connect to an existing soffice process (S1), S2 may have failed to
boostrap due to race condition in communication over the shared pipe.

S1 can be shutdown after S2 connected to it but _before_ S1 handled its
arguments (code run after 'accept' method in OfficeIPCThread).
This patch introduces a new message, sent by the main soffice after it
has called accept if and only if it's not shutting down (see mbDowning
 member).
The other soffice waits for this message before enabling going in
 PIPE_CONNECTED mode. If soffice fails to receive this message, pipe mode is
left unchanged and after a quick pause, it will try again.

Change-Id: I2e099a5804e1e8dd535cfd31ef454cffa44efa62
Signed-off-by: Stephan Bergmann sberg...@redhat.com
(cherry picked from commit 0dce7eae55bf90d2a7171a1fb8663d66ba4ac6d3)

diff --git a/desktop/source/app/officeipcthread.cxx 
b/desktop/source/app/officeipcthread.cxx
index 7047d69..7d477a7 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -57,6 +57,8 @@ const char  *OfficeIPCThread::sc_aShowSequence = -tofront;
 const int OfficeIPCThread::sc_nShSeqLength = 5;
 const char  *OfficeIPCThread::sc_aConfirmationSequence = 
InternalIPC::ProcessingDone;
 const int OfficeIPCThread::sc_nCSeqLength = 27;
+const char  *OfficeIPCThread::sc_aSendArgumentsSequence = 
InternalIPC::SendArguments;
+const int OfficeIPCThread::sc_nCSASeqLength = 26;
 
 namespace { static char const ARGUMENT_PREFIX[] = InternalIPC::Arguments; }
 
@@ -497,8 +499,31 @@ OfficeIPCThread::Status 
OfficeIPCThread::EnableOfficeIPCThread()
 }
 else if( pThread-maPipe.create( pThread-maPipeIdent.getStr(), 
osl_Pipe_OPEN, rSecurity )) // Creation not successfull, now we try to connect
 {
-// Pipe connected to first office
-nPipeMode = PIPEMODE_CONNECTED;
+osl::StreamPipe aStreamPipe(pThread-maPipe.getHandle());
+char pReceiveBuffer[sc_nCSASeqLength + 1];
+int nResult = 0;
+int nBytes = 0;
+int nBufSz = sc_nCSASeqLength + 1;
+// read byte per byte
+while ((nResult=aStreamPipe.recv( pReceiveBuffer+nBytes, 
nBufSz-nBytes))0) {
+nBytes += nResult;
+if (pReceiveBuffer[nBytes-1]=='\0') {
+break;
+}
+}
+if (rtl::OString(sc_aSendArgumentsSequence).equals(pReceiveBuffer))
+{
+// Pipe connected to first office
+nPipeMode = PIPEMODE_CONNECTED;
+}
+else
+{
+// Pipe connection failed (other office exited or crashed)
+TimeValue tval;
+tval.Seconds = 0;
+tval.Nanosec = 5;
+salhelper::Thread::wait( tval );
+}
 }
 else
 {
@@ -655,6 +680,17 @@ void OfficeIPCThread::execute()
 // down during wait
 osl::ClearableMutexGuard aGuard( GetMutex() );
 
+if (!mbDowning)
+{
+// notify client we're ready to process its args
+int nBytes = 0;
+int nResult = 0;
+while (
+(nResult = 
maStreamPipe.send(sc_aSendArgumentsSequence+nBytes, sc_nCSASeqLength-nBytes))0 

+((nBytes += nResult)  sc_nCSASeqLength) ) ;
+}
+maStreamPipe.write(\0, 1);
+
 // test byte by byte
 const int nBufSz = 2048;
 char pBuf[nBufSz];
diff --git a/desktop/source/app/officeipcthread.hxx 
b/desktop/source/app/officeipcthread.hxx
index 734119d..3dd7eac 100644
--- a/desktop/source/app/officeipcthread.hxx
+++ b/desktop/source/app/officeipcthread.hxx
@@ -94,6 +94,8 @@ class OfficeIPCThread : public salhelper::Thread
 static const int sc_nShSeqLength;
 static const char *sc_aConfirmationSequence;
 static const int sc_nCSeqLength;
+static const char *sc_aSendArgumentsSequence;
+static const int sc_nCSASeqLength;
 
 OfficeIPCThread();
 
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 2d12d89..0e32c59 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -839,10 +839,19 @@ 

[Libreoffice-commits] .: Branch 'libreoffice-4-0' - desktop/source

2012-12-04 Thread Libreoffice Gerrit user
 desktop/source/migration/services/oo3extensionmigration.cxx |   25 ++--
 1 file changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 1ec09234241ac0d952559a104dfa5abfd4474954
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Dec 4 18:11:58 2012 +0100

Take extra cache/uno_packages/*.tmp_/*properties files into account

...when migrating user extensions from an old user profile.

Change-Id: I4425eba1e840bfdb33782bb3ed0542ce48b2f75f
(cherry picked from commit bd9c4510ff13ab7e935ed12c5b6d1f132c6f2b79)

diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx 
b/desktop/source/migration/services/oo3extensionmigration.cxx
index d994e0d..aed03fa 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -137,22 +137,25 @@ void OO3ExtensionMigration::scanUserExtensions( const 
::rtl::OUString sSourceDi
 //Check next folder as the real extension folder is below a 
temp folder!
 ::rtl::OUString sExtensionFolderURL = fs.getFileURL();
 
-osl::DirectoryItem aExtDirItem;
 osl::Directory aExtensionRootDir( sExtensionFolderURL );
 
 nRetCode = aExtensionRootDir.open();
-if (( nRetCode == osl::Directory::E_None ) 
-( aExtensionRootDir.getNextItem( aExtDirItem, nHint ) == 
osl::Directory::E_None ))
+if ( nRetCode == osl::Directory::E_None )
 {
-bool bFileStatus = aExtDirItem.getFileStatus(fs) == 
osl::FileBase::E_None;
-bool bIsDir  = fs.getFileType() == 
osl::FileStatus::Directory;
-
-if ( bFileStatus  bIsDir )
+osl::DirectoryItem aExtDirItem;
+while ( aExtensionRootDir.getNextItem( aExtDirItem, nHint 
) == osl::Directory::E_None )
 {
-sExtensionFolderURL = fs.getFileURL();
-ScanResult eResult = scanExtensionFolder( 
sExtensionFolderURL );
-if ( eResult == SCANRESULT_MIGRATE_EXTENSION )
-aMigrateExtensions.push_back( sExtensionFolderURL 
);
+bool bFileStatus = aExtDirItem.getFileStatus(fs) == 
osl::FileBase::E_None;
+bool bIsDir  = fs.getFileType() == 
osl::FileStatus::Directory;
+
+if ( bFileStatus  bIsDir )
+{
+sExtensionFolderURL = fs.getFileURL();
+ScanResult eResult = scanExtensionFolder( 
sExtensionFolderURL );
+if ( eResult == SCANRESULT_MIGRATE_EXTENSION )
+aMigrateExtensions.push_back( 
sExtensionFolderURL );
+break;
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits