summaryrefslogtreecommitdiff
path: root/desktop/source/deployment
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2009-01-22 17:12:19 +0000
committerVladimir Glazounov <vg@openoffice.org>2009-01-22 17:12:19 +0000
commitd49f2b5bfd79749e448b45fdab9d98313af48356 (patch)
tree5f87382b9207e8db744fde3b9232c718dd4c6a86 /desktop/source/deployment
parent0e18fd2829069f1b8ec018ccfbf2fc4c4e7698b1 (diff)
#i10000# missing changes from jl111
Diffstat (limited to 'desktop/source/deployment')
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx11
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatability.cxx8
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx4
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx7
-rw-r--r--desktop/source/deployment/inc/dp_descriptioninfoset.hxx7
-rw-r--r--desktop/source/deployment/inc/dp_misc.h49
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx4
-rw-r--r--desktop/source/deployment/misc/dp_descriptioninfoset.cxx8
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx122
-rw-r--r--desktop/source/deployment/misc/dp_platform.cxx6
-rw-r--r--desktop/source/deployment/registry/dp_registry.cxx15
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx63
-rw-r--r--desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx18
-rw-r--r--desktop/source/deployment/registry/sfwk/dp_sfwk.cxx17
14 files changed, 252 insertions, 87 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 3c28ebd1ba..07c0fbca21 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -373,11 +373,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
{
uno::Any request( xRequest->getRequest() );
OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION );
-#if OSL_DEBUG_LEVEL > 1
- OSL_TRACE( "[dp_gui_cmdenv.cxx] incoming request:\n%s\n",
- ::rtl::OUStringToOString( ::comphelper::anyToString(request),
- RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
+ dp_misc::TRACE( OUSTR("[dp_gui_cmdenv.cxx] incoming request:\n")
+ + ::comphelper::anyToString(request) + OUSTR("\n"));
lang::WrappedTargetException wtExc;
deployment::DependencyException depExc;
@@ -790,8 +787,8 @@ void ExtensionCmdQueue::Thread::execute()
{
if ( m_wakeup.wait() != osl::Condition::result_ok )
{
- OSL_TRACE( "dp_gui::ExtensionCmdQueue::Thread::run: ignored "
- "osl::Condition::wait failure" );
+ dp_misc::TRACE( "dp_gui::ExtensionCmdQueue::Thread::run: ignored "
+ "osl::Condition::wait failure\n" );
}
m_wakeup.reset();
diff --git a/desktop/source/deployment/gui/dp_gui_updatability.cxx b/desktop/source/deployment/gui/dp_gui_updatability.cxx
index 46fffabac4..d78ade6a8f 100644
--- a/desktop/source/deployment/gui/dp_gui_updatability.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatability.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_gui_updatability.cxx,v $
- * $Revision: 1.6 $
+ * $Revision: 1.6.86.1 $
*
* This file is part of OpenOffice.org.
*
@@ -151,10 +151,10 @@ Updatability::Thread::~Thread() {}
void Updatability::Thread::execute() {
for (;;) {
+
if (m_wakeup.wait() != osl::Condition::result_ok) {
- OSL_TRACE(
- "dp_gui::Updatability::Thread::run: ignored "
- "osl::Condition::wait failure");
+ dp_misc::TRACE("dp_gui::Updatability::Thread::run: ignored \n");
+ dp_misc::TRACE("osl::Condition::wait failure\n");
}
m_wakeup.reset();
Input input;
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index bbdc62c309..82ee9e0c6f 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -903,8 +903,8 @@ void UpdateDialog::createNotifyJob( bool bPrepareOnly,
}
catch( const css::uno::Exception& e )
{
- OSL_TRACE( "Caught exception: %s\n thread terminated.\n",
- rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ dp_misc::TRACE( OUSTR("Caught exception: ")
+ + e.Message + OUSTR("\n thread terminated.\n\n"));
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
index 3536fc679e..d58f744286 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
@@ -658,11 +658,8 @@ void UpdateCommandEnv::handle(
{
cssu::Any request( xRequest->getRequest() );
OSL_ASSERT( request.getValueTypeClass() == cssu::TypeClass_EXCEPTION );
-#if OSL_DEBUG_LEVEL > 1
- OSL_TRACE( "[dp_gui_cmdenv.cxx] incoming request:\n%s\n",
- ::rtl::OUStringToOString( ::comphelper::anyToString(request),
- RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
+ dp_misc::TRACE(OUSTR("[dp_gui_cmdenv.cxx] incoming request:\n")
+ + ::comphelper::anyToString(request) + OUSTR("\n\n"));
css::deployment::VersionException verExc;
bool approve = false;
diff --git a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
index f1b298ffca..3ee49627ef 100644
--- a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
+++ b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_descriptioninfoset.hxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.34.1 $
*
* This file is part of OpenOffice.org.
*
@@ -162,6 +162,11 @@ public:
*/
::boost::optional< ::rtl::OUString > getLocalizedUpdateWebsiteURL() const;
+ /** returns the relative URL to the description.
+
+ The URL is relative to the root directory of the extensions.
+ */
+ ::rtl::OUString getLocalizedDescriptionURL() const;
/**
Return the dependencies.
diff --git a/desktop/source/deployment/inc/dp_misc.h b/desktop/source/deployment/inc/dp_misc.h
index ee67569f34..20437d0391 100644
--- a/desktop/source/deployment/inc/dp_misc.h
+++ b/desktop/source/deployment/inc/dp_misc.h
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_misc.h,v $
- * $Revision: 1.13 $
+ * $Revision: 1.13.86.2 $
*
* This file is part of OpenOffice.org.
*
@@ -106,7 +106,54 @@ oslProcess raiseProcess( ::rtl::OUString const & appURL,
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
::rtl::OUString getExtensionDefaultUpdateURL();
+/** writes the argument string to the console.
+ On Linux/Unix/etc. it converts the UTF16 string to an ANSI string using
+ osl_getThreadTextEncoding() as target encoding. On Windows it uses WriteFile
+ with the standard out stream. unopkg.com reads the data and prints them out using
+ WriteConsoleW.
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+void writeConsole(::rtl::OUString const & sText);
+
+/** writes the argument string to the console.
+ On Linux/Unix/etc. the string is passed into fprintf without any conversion.
+ On Windows the string is converted to UTF16 assuming the argument is UTF8
+ encoded. The UTF16 string is written to stdout with WriteFile. unopkg.com
+ reads the data and prints them out using WriteConsoleW.
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+void writeConsole(::rtl::OString const & sText);
+/** writes the argument to the console using the error stream.
+ Otherwise the same as writeConsole.
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+void writeConsoleError(::rtl::OUString const & sText);
+
+
+/** writes the argument to the console using the error stream.
+ Otherwise the same as writeConsole.
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+void writeConsoleError(::rtl::OString const & sText);
+
+
+/** reads from the console.
+ On Linux/Unix/etc. it uses fgets to read char values and converts them to OUString
+ using osl_getThreadTextEncoding as target encoding. The returned string has a maximum
+ size of 1024 and does NOT include leading and trailing white space(applied OUString::trim())
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+::rtl::OUString readConsole();
+
+/** print the text to the console in a debug build.
+ The argument is forwarded to writeConsole. The function does not add new line.
+ The code is only executed if OSL_DEBUG_LEVEL > 1
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+void TRACE(::rtl::OUString const & sText);
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+void TRACE(::rtl::OString const & sText);
}
#endif
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 1138514af1..ed5e11a98b 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_manager.cxx,v $
- * $Revision: 1.34 $
+ * $Revision: 1.33.8.2 $
*
* This file is part of OpenOffice.org.
*
@@ -627,7 +627,7 @@ bool PackageManagerImpl::checkInstall(
{
Any request(
deployment::InstallException(
- OUSTR("Extension ") + id + OUSTR("is about to be installed."),
+ OUSTR("Extension ") + id + OUSTR(" is about to be installed."),
static_cast<OWeakObject *>(this), package));
bool approve = false, abort = false;
if (! interactContinuation(
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 9898bd69ed..d3c7f28115 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_descriptioninfoset.cxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.34.1 $
*
* This file is part of OpenOffice.org.
*
@@ -373,6 +373,12 @@ css::uno::Sequence< ::rtl::OUString > DescriptionInfoset::getUrls(
}
+::rtl::OUString DescriptionInfoset::getLocalizedDescriptionURL() const
+{
+ return getLocalizedHREFAttrFromChild(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "/desc:description/desc:extension-description")), NULL);
+}
+
css::uno::Reference< css::xml::dom::XNode >
DescriptionInfoset::getLocalizedChild( const ::rtl::OUString & sParent) const
{
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index bc94fde3fc..c067b26d1a 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_misc.cxx,v $
- * $Revision: 1.20 $
+ * $Revision: 1.19.8.4 $
*
* This file is part of OpenOffice.org.
*
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+
#include "dp_misc.h"
#include "dp_interact.h"
#include "rtl/uri.hxx"
@@ -49,10 +50,19 @@
#include "boost/scoped_array.hpp"
#include "boost/shared_ptr.hpp"
+#ifdef WNT
+//#include "tools/prewin.h"
+#define UNICODE
+#define _UNICODE
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h>
+//#include "tools/postwin.h"
+#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using ::rtl::OUString;
+using ::rtl::OString;
#define SOFFICE1 "soffice.exe"
@@ -350,4 +360,114 @@ OUString getExtensionDefaultUpdateURL()
}
+#ifdef WNT
+void writeConsoleWithStream(::rtl::OUString const & sText, HANDLE stream)
+{
+ DWORD nWrittenChars = 0;
+ WriteFile(stream, sText.getStr(),
+ sText.getLength() * 2, &nWrittenChars, NULL);
+}
+#else
+void writeConsoleWithStream(::rtl::OUString const & sText, FILE * stream)
+{
+ OString s = OUStringToOString(sText, osl_getThreadTextEncoding());
+ fprintf(stream, "%s", s.getStr());
+ fflush(stream);
+}
+#endif
+
+#ifdef WNT
+void writeConsoleWithStream(::rtl::OString const & sText, HANDLE stream)
+{
+ writeConsoleWithStream(OStringToOUString(
+ sText, RTL_TEXTENCODING_UTF8), stream);
+}
+#else
+void writeConsoleWithStream(::rtl::OString const & sText, FILE * stream)
+{
+ fprintf(stream, "%s", sText.getStr());
+ fflush(stream);
+}
+#endif
+
+void writeConsole(::rtl::OUString const & sText)
+{
+#ifdef WNT
+ writeConsoleWithStream(sText, GetStdHandle(STD_OUTPUT_HANDLE));
+#else
+ writeConsoleWithStream(sText, stdout);
+#endif
+}
+
+void writeConsole(::rtl::OString const & sText)
+{
+#ifdef WNT
+ writeConsoleWithStream(sText, GetStdHandle(STD_OUTPUT_HANDLE));
+#else
+ writeConsoleWithStream(sText, stdout);
+#endif
+}
+
+void writeConsoleError(::rtl::OUString const & sText)
+{
+#ifdef WNT
+ writeConsoleWithStream(sText, GetStdHandle(STD_ERROR_HANDLE));
+#else
+ writeConsoleWithStream(sText, stderr);
+#endif
+}
+
+
+void writeConsoleError(::rtl::OString const & sText)
+{
+#ifdef WNT
+ writeConsoleWithStream(sText, GetStdHandle(STD_ERROR_HANDLE));
+#else
+ writeConsoleWithStream(sText, stderr);
+#endif
+}
+
+
+
+OUString readConsole()
+{
+#ifdef WNT
+ sal_Unicode aBuffer[1024];
+ DWORD dwRead = 0;
+ //unopkg.com feeds unopkg.exe with wchar_t|s
+ if (ReadFile( GetStdHandle(STD_INPUT_HANDLE), &aBuffer, sizeof(aBuffer), &dwRead, NULL ) )
+ {
+ OSL_ASSERT((dwRead % 2) == 0);
+ OUString value( aBuffer, dwRead / 2);
+ value = value.trim();
+ return value;
+ }
+ return OUString();
+
+#else
+ char buf[1024];
+ rtl_zeroMemory(buf, 1024);
+ // read one char less so that the last char in buf is always zero
+ fgets(buf, 1024, stdin);
+ OUString value = ::rtl::OStringToOUString(::rtl::OString(buf), osl_getThreadTextEncoding());
+ return value.trim();
+#endif
+}
+
+void TRACE(::rtl::OUString const & sText)
+{
+ (void) sText;
+#if OSL_DEBUG_LEVEL > 1
+ writeConsole(sText);
+#endif
+}
+
+void TRACE(::rtl::OString const & sText)
+{
+ (void) sText;
+#if OSL_DEBUG_LEVEL > 1
+ writeConsole(sText);
+#endif
+}
+
}
diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx
index bbf3d2bc0f..a61fd6c4af 100644
--- a/desktop/source/deployment/misc/dp_platform.cxx
+++ b/desktop/source/deployment/misc/dp_platform.cxx
@@ -8,7 +8,7 @@
*
* $RCSfile: dp_platform.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.2.86.2 $
*
* This file is part of OpenOffice.org.
*
@@ -63,7 +63,7 @@
#define PLATFORM_FREEBSD_X86_64 "freebsd_x86_64"
#define PLATFORM_MACOSX_X86 "macosx_x86"
#define PLATFORM_MACOSX_PPC "macosx_powerpc"
-#define PLATFORM_OS2_X86 "os/2_x86"
+#define PLATFORM_OS2_X86 "os2_x86"
@@ -165,7 +165,7 @@ namespace
else if (token.equals(OUSTR(PLATFORM_MACOSX_PPC)))
ret = checkOSandCPU(OUSTR("MacOSX"), OUSTR("PowerPC"));
else if (token.equals(OUSTR(PLATFORM_OS2_X86)))
- ret = checkOSandCPU(OUSTR("OS/2"), OUSTR("x86"));
+ ret = checkOSandCPU(OUSTR("OS2"), OUSTR("x86"));
else
{
OSL_ENSURE(0, "Extension Manager: The extension supports an unknown platform. "
diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx
index 3ea6d7d7fd..543bb4fd6c 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_registry.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.12.86.1 $
*
* This file is part of OpenOffice.org.
*
@@ -63,6 +63,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
using ::rtl::OUString;
+
namespace dp_registry {
namespace backend {
@@ -362,7 +363,7 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create(
// dump tables:
{
t_registryset allBackends;
- OSL_TRACE( "> [dp_registry.cxx] media-type detection:" );
+ dp_misc::TRACE("> [dp_registry.cxx] media-type detection:\n\n" );
for ( t_string2string::const_iterator iPos(
that->m_filter2mediaType.begin() );
iPos != that->m_filter2mediaType.end(); ++iPos )
@@ -381,11 +382,9 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create(
buf.append( Reference<lang::XServiceInfo>(
xBackend, UNO_QUERY_THROW )
->getImplementationName() );
- OSL_TRACE( ::rtl::OUStringToOString(
- buf.makeStringAndClear(),
- RTL_TEXTENCODING_UTF8 ).getStr() );
+ dp_misc::writeConsole( buf.makeStringAndClear() + OUSTR("\n"));
}
- OSL_TRACE( "> [dp_registry.cxx] ambiguous backends:" );
+ dp_misc::TRACE( "> [dp_registry.cxx] ambiguous backends:\n\n" );
for ( t_registryset::const_iterator iPos(
that->m_ambiguousBackends.begin() );
iPos != that->m_ambiguousBackends.end(); ++iPos )
@@ -410,9 +409,7 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create(
if (pos < (types.getLength() - 1))
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") );
}
- OSL_TRACE( ::rtl::OUStringToOString(
- buf.makeStringAndClear(),
- RTL_TEXTENCODING_UTF8 ).getStr() );
+ dp_misc::TRACE(buf.makeStringAndClear() + OUSTR("\n\n"));
}
allBackends.insert( that->m_ambiguousBackends.begin(),
that->m_ambiguousBackends.end() );
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 8f9b551852..a1452ee782 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_package.cxx,v $
- * $Revision: 1.35 $
+ * $Revision: 1.34.16.2 $
*
* This file is part of OpenOffice.org.
*
@@ -99,8 +99,10 @@ class BackendImpl : public ImplBaseT
class PackageImpl : public ::dp_registry::backend::Package
{
BackendImpl * getMyBackend() const;
-
- OUString m_description;
+ /** constains the old tooltip description for the Extension Manager GUI in OOo v.2.x
+ We keep it for backward compatibility.
+ */
+ OUString m_oldDescription;
OUString m_url_expanded;
const bool m_legacyBundle;
Sequence< Reference<deployment::XPackage> > m_bundle;
@@ -141,7 +143,8 @@ class BackendImpl : public ImplBaseT
css::ucb::CommandFailedException,
css::ucb::CommandAbortedException,
css::uno::RuntimeException);
- OUString getLicenseText(
+ // @throws DeploymentException
+ OUString getTextFromURL(
const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv,
const OUString& licenseUrl);
@@ -446,44 +449,22 @@ BackendImpl::PackageImpl::isRegistered_(
present, beans::Ambiguous<sal_Bool>(reg, ambig) );
}
-OUString BackendImpl::PackageImpl::getLicenseText(
+OUString BackendImpl::PackageImpl::getTextFromURL(
const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv,
const OUString& licenseUrl)
{
try
{
::ucbhelper::Content descContent(licenseUrl, xCmdEnv);
- css::uno::Reference<css::io::XInputStream> xInput = descContent.openStream();
-
- //read out the complete content and create a string
- const sal_Int32 nConstBufferSize = 32000;
- sal_Int32 nRead = 0;
- css::uno::Sequence<sal_Int8> seqTemp(nConstBufferSize);
- css::uno::Sequence<sal_Int8> seqAll(0);
-
- do
- {
- nRead = xInput->readBytes ( seqTemp, nConstBufferSize );
- sal_Int32 lenAll = seqAll.getLength();
- seqAll.realloc(seqAll.getLength() + nRead);
- sal_Int8 const * arTemp = seqTemp.getConstArray();
- sal_Int8 * arAll = seqAll.getArray();
- rtl_copyMemory(arAll + lenAll, arTemp, nRead);
- }
- while ( nRead == nConstBufferSize );
-
- xInput->closeInput();
-
- OUString sLic(reinterpret_cast<sal_Char const *>(seqAll.getConstArray()),
- seqAll.getLength(), RTL_TEXTENCODING_UTF8);
-
- return sLic;
+ ::rtl::ByteSequence seq = dp_misc::readFile(descContent);
+ return OUString( reinterpret_cast<sal_Char const *>(
+ seq.getConstArray()), seq.getLength(), RTL_TEXTENCODING_UTF8);
}
catch (css::uno::Exception&)
{
Any exc( ::cppu::getCaughtException() );
throw css::deployment::DeploymentException(
- OUSTR("Could not read license text in ") + licenseUrl, 0, exc);
+ OUSTR("Could not read file ") + licenseUrl, 0, exc);
}
}
@@ -600,7 +581,7 @@ bool BackendImpl::PackageImpl::checkDependencies(
throw css::deployment::DeploymentException(
OUSTR("Could not obtain path to license. Possible error in description.xml"), 0, Any());
OUString sHref = desc.getExtensionRootUrl() + OUSTR("/") + sLic;
- OUString sLicense = getLicenseText(xCmdEnv, sHref);
+ OUString sLicense = getTextFromURL(xCmdEnv, sHref);
//determine who has to agree to the license
css::uno::Reference<css::xml::xpath::XXPathObject> nodeAttribWho3 =
xPath->eval(nodeSimpleLic,
@@ -904,7 +885,21 @@ void BackendImpl::PackageImpl::processPackage_(
//______________________________________________________________________________
OUString BackendImpl::PackageImpl::getDescription() throw (RuntimeException)
{
- return m_description;
+ const OUString sRelativeURL(getDescriptionInfoset().getLocalizedDescriptionURL());
+ OUString sDescription;
+ if (sRelativeURL.getLength())
+ {
+ OUString sURL = m_url_expanded + OUSTR("/") + sRelativeURL;
+ sDescription = getTextFromURL(
+ css::uno::Reference< css::ucb::XCommandEnvironment >(), sURL);
+
+ }
+ if (sDescription.getLength())
+ return sDescription;
+ else if(m_oldDescription.getLength() == 0)
+ return m_oldDescription;
+ else
+ return OUString();
}
//______________________________________________________________________________
@@ -1392,7 +1387,7 @@ void BackendImpl::PackageImpl::scanBundle(
{
buf.append( Package::getDescription() );
}
- m_description = buf.makeStringAndClear();
+ m_oldDescription = buf.makeStringAndClear();
}
}
}
diff --git a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx b/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx
index 607c2caec7..0653934af9 100644
--- a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_parceldesc.cxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.86.1 $
*
* This file is part of OpenOffice.org.
*
@@ -30,8 +30,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+#include "dp_misc.h"
#include "dp_parceldesc.hxx"
+
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -93,8 +96,9 @@ ParcelDescDocHandler::startElement( const OUString& aName,
throw ( xml::sax::SAXException,
RuntimeException )
{
- OSL_TRACE("ParcelDescDocHandler::startElement() for %s",
- rtl::OUStringToOString( aName, RTL_TEXTENCODING_ASCII_US ).getStr() );
+
+ dp_misc::TRACE(OUSTR("ParcelDescDocHandler::startElement() for ") +
+ aName + OUSTR("\n"));
if ( !skipIndex )
{
if ( aName.equals( OUString::createFromAscii( "parcel" ) ) )
@@ -105,8 +109,8 @@ ParcelDescDocHandler::startElement( const OUString& aName,
}
else
{
- OSL_TRACE("ParcelDescDocHandler::startElement() skipping for %s",
- rtl::OUStringToOString( aName, RTL_TEXTENCODING_ASCII_US ).getStr() );
+ dp_misc::TRACE(OUSTR("ParcelDescDocHandler::startElement() skipping for ")
+ + aName + OUSTR("\n"));
}
}
@@ -117,8 +121,8 @@ void SAL_CALL ParcelDescDocHandler::endElement( const OUString & aName )
if ( skipIndex )
{
--skipIndex;
- OSL_TRACE("ParcelDescDocHandler::endElement() skipping for %s",
- rtl::OUStringToOString( aName, RTL_TEXTENCODING_ASCII_US ).getStr() );
+ dp_misc::TRACE(OUSTR("ParcelDescDocHandler::endElement() skipping for ")
+ + aName + OUSTR("\n"));
}
}
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index 64dec79ee3..c460409890 100644
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dp_sfwk.cxx,v $
- * $Revision: 1.16 $
+ * $Revision: 1.16.66.1 $
*
* This file is part of OpenOffice.org.
*
@@ -153,8 +153,7 @@ BackendImpl::PackageImpl::PackageImpl(
rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
m_name = m_displayName;
- OSL_TRACE("PakageImpl displayName is %s",
- ::rtl::OUStringToOString( m_displayName , RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+ dp_misc::TRACE(OUSTR("PakageImpl displayName is ") + m_displayName);
}
//______________________________________________________________________________
@@ -294,12 +293,10 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
sal_Int32 startOfReplace = sfwkLibType.indexOf( MACRONAME );
sal_Int32 charsToReplace = MACRONAME.getLength();
sfwkLibType = sfwkLibType.replaceAt( startOfReplace, charsToReplace, lang );
- OSL_TRACE("******************************");
- OSL_TRACE(" BackEnd detected lang = %s ",
- rtl::OUStringToOString( lang, RTL_TEXTENCODING_ASCII_US ).getStr() );
- OSL_TRACE(" for url %s",
- rtl::OUStringToOString( sParcelDescURL, RTL_TEXTENCODING_ASCII_US ).getStr() );
- OSL_TRACE("******************************");
+ dp_misc::TRACE("******************************\n");
+ dp_misc::TRACE(OUSTR(" BackEnd detected lang = ") + lang + OUSTR("\n"));
+ dp_misc::TRACE(OUSTR(" for url ") + sParcelDescURL + OUSTR("\n") );
+ dp_misc::TRACE("******************************\n");
return new PackageImpl( this, url, sfwkLibType );
}
}
@@ -374,7 +371,7 @@ void BackendImpl::PackageImpl::processPackage_(
{
if ( !m_xNameCntrPkgHandler.is() )
{
- OSL_TRACE("no package handler!!!!");
+ dp_misc::TRACE("no package handler!!!!\n");
throw RuntimeException( OUSTR("No package Handler " ),
Reference< XInterface >() );
}