[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - cppcanvas/source include/cppcanvas sdext/source sd/source
Thorsten Behrens
thb at documentfoundation.org
Mon Dec 2 03:27:25 PST 2013
cppcanvas/source/uno/uno_mtfrenderer.cxx | 2 +-
cppcanvas/source/wrapper/vclfactory.cxx | 8 +++++++-
include/cppcanvas/vclfactory.hxx | 5 ++++-
sd/source/ui/presenter/PresenterHelper.cxx | 2 +-
sd/source/ui/presenter/PresenterPreviewCache.cxx | 6 ++----
sd/source/ui/presenter/PresenterTextView.cxx | 2 +-
sd/source/ui/presenter/SlideRenderer.cxx | 14 ++++----------
sdext/source/presenter/PresenterSlideSorter.cxx | 4 ++--
8 files changed, 22 insertions(+), 21 deletions(-)
New commits:
commit 0f080297e9c176f221e20c422ba77080eee8e21c
Author: Thorsten Behrens <thb at documentfoundation.org>
Date: Thu Nov 28 15:27:30 2013 +0000
Resolves: fdo#71527 make presenter console not crash/useless
Basically reverts the pieces of
21ec9beae29b19b8ec6f0a16fd0e708e4f210208 to make XSpriteCanvas a
XBitmapCanvas again
Otherwise PresenterHelper::loadBitmap is not an XBitmapCanvas
and so VclFactory::createBitmap cannot succeed
(cherry picked from commit 639aa8e72639fd01e9004977f1cfaafc13b1e45f)
Revert "Resolves: fdo#71527 make presenter console not crash/useless"
This reverts commit 639aa8e72639fd01e9004977f1cfaafc13b1e45f.
(cherry picked from commit 72aa51185fb7b1ff2ad9006f2067a680b70ab66d)
Revert "Resolves: fdo#71527 don't crash in presenter console"
This reverts commit bae01385c895a100b5371879889e606927cff877.
(cherry picked from commit b807b2d9291a2328a55de55d67c4874803d8b7fd)
Fix fdo#71527 no unguarded ptr dereference here.
This is the real problem - mxPane can be validly NULL.
(cherry picked from commit 1b10205c2cb952ab43e30706c05f78d6e8f642c3)
Further XCanvas != XBitmapCanvas cleanup.
It seems I missed a few places in
21ec9beae29b19b8ec6f0a16fd0e708e4f210208, getting that straight
now hopefully.
(cherry picked from commit 05d2994c136650deca2d80fedf6b14d10109986e)
0ac1a7ada530791e2d34d2f0802213c869ea48a1
d149bae0904fd6c2120209d69490d0b257ac3f64
e8d055db9bfb68cb9031fa970518343f5aec6619
34fc8df2d1ee65bef0639b3de9487ff311bed89a
Change-Id: I197adf98e915102f383ee050a8ea16d1e41cecf2
diff --git a/cppcanvas/source/uno/uno_mtfrenderer.cxx b/cppcanvas/source/uno/uno_mtfrenderer.cxx
index 63271d7..8fa7199 100644
--- a/cppcanvas/source/uno/uno_mtfrenderer.cxx
+++ b/cppcanvas/source/uno/uno_mtfrenderer.cxx
@@ -23,7 +23,7 @@ void MtfRenderer::draw (double fScaleX, double fScaleY) throw (uno::RuntimeExcep
{
if (mpMetafile && mxCanvas.get()) {
cppcanvas::VCLFactory& factory = cppcanvas::VCLFactory::getInstance();
- cppcanvas::BitmapCanvasSharedPtr canvas = factory.createCanvas (mxCanvas);
+ cppcanvas::BitmapCanvasSharedPtr canvas = factory.createBitmapCanvas (mxCanvas);
cppcanvas::RendererSharedPtr renderer = factory.createRenderer (canvas, *mpMetafile, cppcanvas::Renderer::Parameters ());
::basegfx::B2DHomMatrix aMatrix;
aMatrix.scale( fScaleX, fScaleY );
diff --git a/cppcanvas/source/wrapper/vclfactory.cxx b/cppcanvas/source/wrapper/vclfactory.cxx
index a24025e..d27afa1 100644
--- a/cppcanvas/source/wrapper/vclfactory.cxx
+++ b/cppcanvas/source/wrapper/vclfactory.cxx
@@ -59,7 +59,13 @@ namespace cppcanvas
{
}
- BitmapCanvasSharedPtr VCLFactory::createCanvas( const uno::Reference< rendering::XBitmapCanvas >& xCanvas )
+ CanvasSharedPtr VCLFactory::createCanvas( const uno::Reference< rendering::XCanvas >& xCanvas )
+ {
+ return CanvasSharedPtr(
+ new internal::ImplCanvas( xCanvas ) );
+ }
+
+ BitmapCanvasSharedPtr VCLFactory::createBitmapCanvas( const uno::Reference< rendering::XBitmapCanvas >& xCanvas )
{
return BitmapCanvasSharedPtr(
new internal::ImplBitmapCanvas( xCanvas ) );
diff --git a/include/cppcanvas/vclfactory.hxx b/include/cppcanvas/vclfactory.hxx
index 3b2b498..cb42627 100644
--- a/include/cppcanvas/vclfactory.hxx
+++ b/include/cppcanvas/vclfactory.hxx
@@ -43,6 +43,7 @@ class Animation;
namespace com { namespace sun { namespace star { namespace rendering
{
+ class XCanvas;
class XBitmapCanvas;
class XSpriteCanvas;
} } } }
@@ -64,7 +65,9 @@ namespace cppcanvas
public:
static VCLFactory& getInstance();
- BitmapCanvasSharedPtr createCanvas( const ::com::sun::star::uno::Reference<
+ CanvasSharedPtr createCanvas( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XCanvas >& xCanvas );
+ BitmapCanvasSharedPtr createBitmapCanvas( const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XBitmapCanvas >& xCanvas );
SpriteCanvasSharedPtr createSpriteCanvas( const ::Window& rVCLWindow ) const;
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index eb5b185..52cce14 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -452,7 +452,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap (
const cppcanvas::CanvasSharedPtr pCanvas (
cppcanvas::VCLFactory::getInstance().createCanvas(
- Reference<css::rendering::XBitmapCanvas>(rxCanvas,UNO_QUERY)));
+ Reference<css::rendering::XCanvas>(rxCanvas,UNO_QUERY)));
if (pCanvas.get() != NULL)
{
diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx b/sd/source/ui/presenter/PresenterPreviewCache.cxx
index 4810151..162ca55 100644
--- a/sd/source/ui/presenter/PresenterPreviewCache.cxx
+++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx
@@ -25,7 +25,6 @@
#include "sdpage.hxx"
#include <cppcanvas/vclfactory.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
-#include <com/sun/star/rendering/XBitmapCanvas.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -189,9 +188,8 @@ Reference<rendering::XBitmap> SAL_CALL PresenterPreviewCache::getSlidePreview (
ThrowIfDisposed();
OSL_ASSERT(mpCacheContext.get()!=NULL);
- cppcanvas::BitmapCanvasSharedPtr pCanvas (
- cppcanvas::VCLFactory::getInstance().createCanvas(
- Reference<rendering::XBitmapCanvas>(rxCanvas, UNO_QUERY)));
+ cppcanvas::CanvasSharedPtr pCanvas (
+ cppcanvas::VCLFactory::getInstance().createCanvas(rxCanvas));
const SdrPage* pPage = mpCacheContext->GetPage(nSlideIndex);
if (pPage == NULL)
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 9498212..c26d5aa 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -167,7 +167,7 @@ void SAL_CALL PresenterTextView::initialize (const Sequence<Any>& rArguments)
{
try
{
- Reference<rendering::XBitmapCanvas> xCanvas (rArguments[0], UNO_QUERY_THROW);
+ Reference<rendering::XCanvas> xCanvas (rArguments[0], UNO_QUERY_THROW);
if (xCanvas.is())
{
mpImplementation->SetCanvas(
diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx
index 98db0b1..bb3e3f5 100644
--- a/sd/source/ui/presenter/SlideRenderer.cxx
+++ b/sd/source/ui/presenter/SlideRenderer.cxx
@@ -131,18 +131,12 @@ Reference<rendering::XBitmap> SlideRenderer::createPreviewForCanvas (
ThrowIfDisposed();
SolarMutexGuard aGuard;
- cppcanvas::BitmapCanvasSharedPtr pCanvas (cppcanvas::VCLFactory::getInstance().createCanvas(
- Reference<rendering::XBitmapCanvas>(rxCanvas, UNO_QUERY)));
+ cppcanvas::CanvasSharedPtr pCanvas (
+ cppcanvas::VCLFactory::getInstance().createCanvas(rxCanvas));
if (pCanvas.get() != NULL)
- {
- cppcanvas::BitmapSharedPtr xBitmap(
- cppcanvas::VCLFactory::getInstance().createBitmap(
+ return cppcanvas::VCLFactory::getInstance().createBitmap(
pCanvas,
- CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor)));
- if (xBitmap.get() == NULL)
- return NULL;
- return xBitmap->getUNOBitmap();
- }
+ CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor))->getUNOBitmap();
else
return NULL;
}
diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx
index d8ab281..c1a2706 100644
--- a/sdext/source/presenter/PresenterSlideSorter.cxx
+++ b/sdext/source/presenter/PresenterSlideSorter.cxx
@@ -180,7 +180,7 @@ private:
const OUString& rsText) const;
OUString GetFittingText (const OUString& rsText, const double nMaximalWidth) const;
void PaintButtonBackground (
- const Reference<rendering::XBitmapCanvas>& rxCanvas,
+ const Reference<rendering::XCanvas>& rxCanvas,
const geometry::IntegerSize2D& rSize) const;
};
@@ -1742,7 +1742,7 @@ geometry::IntegerSize2D PresenterSlideSorter::MouseOverManager::CalculateLabelSi
}
void PresenterSlideSorter::MouseOverManager::PaintButtonBackground (
- const Reference<rendering::XBitmapCanvas>& rxCanvas,
+ const Reference<rendering::XCanvas>& rxCanvas,
const geometry::IntegerSize2D& rSize) const
{
// Get the bitmaps for painting the label background.
More information about the Libreoffice-commits
mailing list