[Libreoffice-commits] .: 3 commits - canvas/source desktop/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Oct 26 07:21:21 PDT 2012
canvas/source/cairo/cairo_textlayout.cxx | 5 +
desktop/source/deployment/manager/dp_extensionmanager.cxx | 37 ++++++--------
desktop/source/deployment/manager/dp_extensionmanager.hxx | 5 -
desktop/source/deployment/registry/dp_backend.cxx | 4 +
4 files changed, 23 insertions(+), 28 deletions(-)
New commits:
commit c9a27eb938b98d7812d3ab965fc88bb511e0b996
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Oct 26 16:14:06 2012 +0200
Work around premature disposing of PackageRegistryBackends
With ucbhelper::Content now requiring an XComponentContext during construction,
calling "unopkg add" with an .oxt that requires license acceptance would lead to
an assertion about a null XComponentContext, as doChecksForAddExtension calls
the XPackage's checkPrerequisites -> checkLicnese -> getTextFromURL, which
creates an ucbhelper::Content with getMyBackend()->getComponentContext(), but
early release of the "tmp" manager would already have caused disposing of that
backend, which clears m_xComponentContext.
I assume this problem had always been lurking silently in the code.
Change-Id: I9f59c612fe3831b2f6dd832ef2f0505b6590b8e0
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index de78275..4ba5584 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -655,8 +655,22 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
//would remove the first one.
::osl::MutexGuard addGuard(m_addMutex);
- Reference<deploy::XPackage> xTmpExtension =
- getTempExtension(url, xAbortChannel, xCmdEnv);
+ Reference<deploy::XPackageManager> xTmpRepository(getTmpRepository());
+ // make sure xTmpRepository is alive as long as xTmpExtension is; as
+ // the "tmp" manager is only held weakly by m_xPackageManagerFactory, it
+ // could otherwise be disposed early, which would in turn dispose
+ // xTmpExtension's PackageRegistryBackend behind its back
+ Reference<deploy::XPackage> xTmpExtension(
+ xTmpRepository->addPackage(
+ url, uno::Sequence<beans::NamedValue>(), OUString(), xAbortChannel,
+ new TmpRepositoryCommandEnv()));
+ if (!xTmpExtension.is()) {
+ throw deploy::DeploymentException(
+ ("Extension Manager: Failed to create temporary XPackage for url: "
+ + url),
+ static_cast<OWeakObject*>(this), uno::Any());
+ }
+
//Make sure the extension is removed from the tmp repository in case
//of an exception
ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, getTmpRepository());
@@ -1404,25 +1418,6 @@ void ExtensionManager::checkUpdate(
static_cast<OWeakObject *>(this), request );
}
-Reference<deploy::XPackage> ExtensionManager::getTempExtension(
- OUString const & url,
- Reference<task::XAbortChannel> const & xAbortChannel,
- Reference<ucb::XCommandEnvironment> const & /*xCmdEnv*/)
-
-{
- Reference<ucb::XCommandEnvironment> tmpCmdEnvA(new TmpRepositoryCommandEnv());
- Reference<deploy::XPackage> xTmpPackage = getTmpRepository()->addPackage(
- url, uno::Sequence<beans::NamedValue>(),OUString(), xAbortChannel, tmpCmdEnvA);
- if (!xTmpPackage.is())
- {
- throw deploy::DeploymentException(
- OUSTR("Extension Manager: Failed to create temporary XPackage for url: ") + url,
- static_cast<OWeakObject*>(this), uno::Any());
-
- }
- return xTmpPackage;
-}
-
uno::Sequence<Reference<deploy::XPackage> > SAL_CALL
ExtensionManager::getExtensionsWithUnacceptedLicenses(
OUString const & repository,
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx
index c8d8b30..584f01c 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.hxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx
@@ -280,11 +280,6 @@ private:
css::uno::Reference<css::deployment::XPackage> const & oldExtension,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
- css::uno::Reference<css::deployment::XPackage> getTempExtension(
- ::rtl::OUString const & url,
- css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
- css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
-
void addExtensionsToMap(
id2extensions & mapExt,
css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > const & seqExt,
commit 89e875b50a275512c5732557c1d09d1e1f1cbfe9
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Oct 26 16:13:45 2012 +0200
Add sanity-check assertion
Change-Id: I119f008734e4978d6bcf5f786ae3604db5c0f8a9
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 57703d5..ad6c2a8 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -26,6 +26,9 @@
*
************************************************************************/
+#include "sal/config.h"
+
+#include <cassert>
#include "dp_backend.h"
#include "dp_ucb.h"
@@ -85,6 +88,7 @@ PackageRegistryBackend::PackageRegistryBackend(
m_eContext( CONTEXT_UNKNOWN ),
m_readOnly( false )
{
+ assert(xContext.is());
boost::optional<OUString> cachePath;
boost::optional<bool> readOnly;
comphelper::unwrapArgs( args, m_context, cachePath, readOnly );
commit b6aa58c4d8af8b960b085646d97f73c912503a96
Author: Flex Liu <winddss at gmail.com>
Date: Fri Oct 26 15:18:35 2012 +0100
Resolves: fdo#47432 Improve the "faux bold" in cairo canvas
The "faux bold" make the bold font in Asian ugly & unacceptable,
Adjust & improve the "faux bold" to make the bold font better.
Change-Id: I2e02156ffc30629476b80134ffb0b50e793f7ead
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index 383b0ff..6fa5562 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -609,14 +609,15 @@ namespace cairocanvas
if (rSysFontData.bFakeBold)
{
double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetHeight() );
- int total_steps = 2 * ((int) (bold_dx + 0.5));
+ int total_steps = 1 * ((int) (bold_dx + 0.5));
// loop to draw the text for every half pixel of displacement
for (int nSteps = 0; nSteps < total_steps; nSteps++)
{
for(int nGlyphIdx = 0; nGlyphIdx < (int) cairo_glyphs.size(); nGlyphIdx++)
{
- cairo_glyphs[nGlyphIdx].x += bold_dx * nSteps / total_steps;
+ cairo_glyphs[nGlyphIdx].x += (bold_dx * nSteps / total_steps) / 4;
+ cairo_glyphs[nGlyphIdx].y -= (bold_dx * nSteps / total_steps) / 4;
}
cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
}
More information about the Libreoffice-commits
mailing list