[Libreoffice-commits] .: Branch 'libreoffice-3-6-4' - 2 commits - desktop/source sot/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Nov 24 06:15:06 PST 2012
desktop/source/deployment/manager/dp_extensionmanager.cxx | 30 +++++++++++++-
sot/source/sdstor/stgelem.cxx | 14 +++++-
2 files changed, 40 insertions(+), 4 deletions(-)
New commits:
commit d3a46db1103fcec615fc9dcb60b13b09c90614a4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 22 22:29:11 2012 +0000
Resolves: fdo#53909 STG_FREE sector locations rejected
(cherry picked from commit ef9f9b750eac2966634c385a2021716c4de0e4cd)
Conflicts:
sot/source/sdstor/stgelem.cxx
Change-Id: I6f71c7e3cfeeba8a76096d5be68838b8d401c580
Reviewed-on: https://gerrit.libreoffice.org/1150
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
Tested-by: Stephan Bergmann <sbergman at redhat.com>
Signed-off-by: Petr Mladek <pmladek at suse.cz>
Signed-off-by: Michael Meeks <michael.meeks at suse.com>
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index 7048e77..c4a8c28 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -191,6 +191,14 @@ static bool lcl_wontoverflow(short shift)
return shift >= 0 && shift < (short)sizeof(short) * 8 - 1;
}
+static bool isKnownSpecial(sal_Int32 nLocation)
+{
+ return (nLocation == STG_FREE ||
+ nLocation == STG_EOF ||
+ nLocation == STG_FAT ||
+ nLocation == STG_MASTER);
+}
+
// Perform thorough checks also on unknown variables
sal_Bool StgHeader::Check()
{
@@ -202,8 +210,8 @@ sal_Bool StgHeader::Check()
&& nFATSize > 0
&& nTOCstrm >= 0
&& nThreshold > 0
- && ( nDataFAT == -2 || ( nDataFAT >= 0 && nDataFATSize > 0 ) )
- && ( nMasterChain == -2 || nMasterChain >=0 )
+ && ( isKnownSpecial(nDataFAT) || ( nDataFAT >= 0 && nDataFATSize > 0 ) )
+ && ( isKnownSpecial(nMasterChain) || nMasterChain >=0 )
&& nMaster >= 0;
}
@@ -397,7 +405,7 @@ sal_Bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize )
if (n > nMaxLegalStr)
return sal_False;
- if ((nSize < 0 && cType != STG_STORAGE) || (nPage1 < 0 && nPage1 != -2))
+ if ((nSize < 0 && cType != STG_STORAGE) || (nPage1 < 0 && !isKnownSpecial(nPage1)))
{
// the size makes no sense for the substorage
// TODO/LATER: actually the size should be an unsigned value, but in this case it would mean a stream of more than 2Gb
commit a41b7953f8af0b1d62d111514cd4613f40842e60
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Nov 19 14:14:50 2012 +0100
fdo#57224: Preserve disabled-state across reinstallDeployedExtensions
(cherry picked from commit 6f9c3bc8edc93be07273d9de13dda19ea6c1da4a plus follow-
up a05e1e4967a21f3dd5a49215d97df99a7ec84f18 "fdo#57224: Fix logic of considering
optional/ambiguous value as 'disabled'")
Change-Id: Ic4f6cda4de758df4789e80b48b30f11ef810d2bd
Reviewed-on: https://gerrit.libreoffice.org/1120
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index b3c21b4..cd09a9e 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -65,6 +65,7 @@
#include <list>
#include <boost/unordered_map.hpp>
#include <algorithm>
+#include <set>
namespace deploy = com::sun::star::deployment;
namespace lang = com::sun::star::lang;
@@ -1220,6 +1221,31 @@ void ExtensionManager::reinstallDeployedExtensions(
Reference<deploy::XPackageManager>
xPackageManager = getPackageManager(repository);
+ std::set< OUString > disabledExts;
+ {
+ const uno::Sequence< Reference<deploy::XPackage> > extensions(
+ xPackageManager->getDeployedPackages(xAbortChannel, xCmdEnv));
+ for ( sal_Int32 pos = 0; pos < extensions.getLength(); ++pos )
+ {
+ try
+ {
+ beans::Optional< beans::Ambiguous< sal_Bool > > registered(
+ extensions[pos]->isRegistered(xAbortChannel, xCmdEnv));
+ if (registered.IsPresent &&
+ !(registered.Value.IsAmbiguous ||
+ registered.Value.Value))
+ {
+ const OUString id = dp_misc::getIdentifier(extensions[ pos ]);
+ OSL_ASSERT(!id.isEmpty());
+ disabledExts.insert(id);
+ }
+ }
+ catch (const lang::DisposedException &)
+ {
+ }
+ }
+ }
+
::osl::MutexGuard guard(getMutex());
xPackageManager->reinstallDeployedPackages(
force, xAbortChannel, xCmdEnv);
@@ -1236,7 +1262,9 @@ void ExtensionManager::reinstallDeployedExtensions(
const OUString id = dp_misc::getIdentifier(extensions[ pos ]);
const OUString fileName = extensions[ pos ]->getName();
OSL_ASSERT(!id.isEmpty());
- activateExtension(id, fileName, false, true, xAbortChannel, xCmdEnv );
+ activateExtension(
+ id, fileName, disabledExts.find(id) != disabledExts.end(),
+ true, xAbortChannel, xCmdEnv );
}
catch (const lang::DisposedException &)
{
More information about the Libreoffice-commits
mailing list