summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx6
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx31
-rw-r--r--desktop/test/deployment/options/leaf1mod.oxtbin0 -> 8310 bytes
-rw-r--r--desktop/test/deployment/options/readme.txt5
-rw-r--r--desktop/win32/source/guistdio/guistdio.inc28
5 files changed, 49 insertions, 21 deletions
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index b72c5e231647..afd44f83cff6 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -1009,6 +1009,12 @@ PackageManagerImpl::getDeployedPackages_(
OSL_ENSURE( 0, ::rtl::OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
+ catch (deployment::DeploymentException& exc) {
+ // ignore
+ (void) exc; // avoid warnings
+ OSL_ENSURE( 0, ::rtl::OUStringToOString(
+ exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
}
return comphelper::containerToSequence(packages);
}
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index e17d60ce9ab5..3bb119b73729 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -75,6 +75,7 @@
#include "com/sun/star/deployment/XPackageManager.hpp"
#include <vector>
+#include <stdio.h>
using namespace ::dp_misc;
@@ -251,6 +252,18 @@ public:
using ImplBaseT::disposing;
};
+//Used to find a XPackage with a particular URL
+class XPackage_eq : public std::unary_function<Reference<deployment::XPackage>, bool>
+{
+ OUString m_URL;
+public:
+ explicit XPackage_eq(const OUString & s) : m_URL(s) {}
+ bool operator() (const Reference<deployment::XPackage> & p) const
+ {
+ return m_URL.equals(p->getURL());
+ }
+};
+
//______________________________________________________________________________
BackendImpl::BackendImpl(
Sequence<Any> const & args,
@@ -1362,10 +1375,20 @@ void BackendImpl::PackageImpl::scanBundle(
checkAborted( abortChannel );
- const Reference<deployment::XPackage> xPackage(
- bindBundleItem( url, mediaType, xCmdEnv ) );
- if (xPackage.is())
- bundle.push_back( xPackage );
+ //We make sure that we only create one XPackage for a particular URL.
+ //Sometime programmers insert the same URL several times in the manifest
+ //which may lead to DisposedExceptions.
+ if (bundle.end() == std::find_if(bundle.begin(), bundle.end(), XPackage_eq(url)))
+ {
+ const Reference<deployment::XPackage> xPackage(
+ bindBundleItem( url, mediaType, xCmdEnv ) );
+ if (xPackage.is())
+ bundle.push_back( xPackage );
+ }
+ else
+ {
+ fprintf(stderr, "manifest.xml contains a duplicate entry!\n");
+ }
}
if (descrFile.getLength() > 0)
diff --git a/desktop/test/deployment/options/leaf1mod.oxt b/desktop/test/deployment/options/leaf1mod.oxt
new file mode 100644
index 000000000000..d5d9fe6896f8
--- /dev/null
+++ b/desktop/test/deployment/options/leaf1mod.oxt
Binary files differ
diff --git a/desktop/test/deployment/options/readme.txt b/desktop/test/deployment/options/readme.txt
index da576203972d..9879a72ceffa 100644
--- a/desktop/test/deployment/options/readme.txt
+++ b/desktop/test/deployment/options/readme.txt
@@ -8,6 +8,11 @@ extensionoptions.jar into the extension.
leaf1.oxt: Defines a leaf under the node WriterNode
================================================================================
+leaf1mod.oxt: Defines a leaf under the node WriterNode
+
+It has a douplicate entry in the manifest.xml (OptionsDialog.xcu). This would cause a DisposedException when uninstalling on OOo 3.0 and prevent the extension from being uninstalled. This is actually a bug of the extensions. However, the error is difficult to investigate. Therefore this was fixed to make OOo more robust (i96690).
+================================================================================
+
leaf2.oxt: Defines a leaf under a node that has a name which requires special
"xml encoding". The name is "My Writer's & Settings". The node is not assigned
to a Module and the Node/AllModules property is not true. This is a typical
diff --git a/desktop/win32/source/guistdio/guistdio.inc b/desktop/win32/source/guistdio/guistdio.inc
index 3cd650ad7c59..c8170e694844 100644
--- a/desktop/win32/source/guistdio/guistdio.inc
+++ b/desktop/win32/source/guistdio/guistdio.inc
@@ -45,6 +45,8 @@
#include <stdlib.h>
#include <systools/win32/uwinapi.h>
+#include <stdio.h>
+
//---------------------------------------------------------------------------
// Thread that reads from child process standard output pipe
//---------------------------------------------------------------------------
@@ -214,9 +216,7 @@ DWORD WINAPI WaitForUIThread( LPVOID pParam )
#ifndef UNOPKG
if ( !_tgetenv( TEXT("UNOPKG") ) )
WaitForInputIdle( hProcess, INFINITE );
- else
#endif
- WaitForSingleObject( hProcess, INFINITE );
return 0;
}
@@ -353,17 +353,19 @@ int _tmain( int, _TCHAR ** )
HANDLE hWaitForUIThread = CreateThread( NULL, 0, WaitForUIThread, (LPVOID)aProcessInfo.hProcess, 0, &dwWaitForUIThreadId );
DWORD dwWaitResult;
- bool bDetach = false;
- int nOpenPipes = 3;
HANDLE hObjects[] =
{
hTargetProcess,
hWaitForUIThread,
- hInputThread,
hOutputThread,
hErrorThread
};
+ #ifdef GUISTDIO_KEEPRUNNING
+ dwWaitResult = WaitForMultipleObjects( elementsof(hObjects), hObjects, TRUE, INFINITE );
+ #else
+ bool bDetach = false;
+ int nOpenPipes = 2;
do
{
dwWaitResult = WaitForMultipleObjects( elementsof(hObjects), hObjects, FALSE, INFINITE );
@@ -374,9 +376,8 @@ int _tmain( int, _TCHAR ** )
case WAIT_OBJECT_0 + 1: // The child process entered input idle
bDetach = true;
break;
- case WAIT_OBJECT_0 + 2: // The remote end of stdin pipe was closed
- case WAIT_OBJECT_0 + 3: // The remote end of stdout pipe was closed
- case WAIT_OBJECT_0 + 4: // The remote end of stderr pipe was closed
+ case WAIT_OBJECT_0 + 2: // The remote end of stdout pipe was closed
+ case WAIT_OBJECT_0 + 3: // The remote end of stderr pipe was closed
bDetach = --nOpenPipes <= 0;
break;
default: // Something went wrong
@@ -385,15 +386,8 @@ int _tmain( int, _TCHAR ** )
}
} while( !bDetach );
- //Even if the child process terminates it is not garanteed that all three pipe threads terminate
- //as tests have proven. The loop above will be typically terminate because the process has
- //terminated. Then the pipe threads may not have read all data from the pipes yet. When we close
- //the threads then data may be lost. For example running unopkg without arguments shall print out
- //the help text. Without this workaround some text would be missing.
- //ifdef only for unopkg
-#ifdef UNOPKG
- Sleep(1000);
-#endif
+#endif
+
CloseHandle( hOutputThread );
CloseHandle( hErrorThread );
CloseHandle( hInputThread );