summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2013-10-11 16:19:47 +0200
committerThorsten Behrens <thb@documentfoundation.org>2013-11-01 01:28:14 +0100
commit339e182e1238caf24062d232493a16234ff6620f (patch)
treebf316092853dc08d2ae1821818246b65aaa6d2b0
parent85e6215de5c332f651502c58931af609986a89d3 (diff)
Cleanse sd of cppcanvas helper use.
In preparation of killing that very module. Change-Id: I728e585a972eecdfb51050492b0962a140afa3ec
-rw-r--r--sd/CppunitTest_sd_uimpress.mk1
-rw-r--r--sd/Library_sd.mk1
-rw-r--r--sd/Library_sdui.mk1
-rw-r--r--sd/source/ui/framework/factories/Pane.cxx16
-rw-r--r--sd/source/ui/presenter/PresenterCanvas.cxx2
-rw-r--r--sd/source/ui/presenter/PresenterHelper.cxx18
-rw-r--r--sd/source/ui/presenter/PresenterPreviewCache.cxx12
-rw-r--r--sd/source/ui/presenter/PresenterTextView.cxx22
-rw-r--r--sd/source/ui/presenter/SlideRenderer.cxx13
-rw-r--r--sd/source/ui/slideshow/slideshowviewimpl.cxx10
-rw-r--r--sd/source/ui/slideshow/slideshowviewimpl.hxx2
11 files changed, 33 insertions, 65 deletions
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index f232a917ce62..6c8497baf6ba 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\
basegfx \
canvastools \
comphelper \
- cppcanvas \
cppu \
cppuhelper \
drawinglayer \
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index be29e38262e6..007d6574eed2 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -72,7 +72,6 @@ $(eval $(call gb_Library_use_libraries,sd,\
basegfx \
canvastools \
comphelper \
- cppcanvas \
cppu \
cppuhelper \
drawinglayer \
diff --git a/sd/Library_sdui.mk b/sd/Library_sdui.mk
index 8eb3145aedd7..f25a1c4c32b2 100644
--- a/sd/Library_sdui.mk
+++ b/sd/Library_sdui.mk
@@ -39,7 +39,6 @@ $(eval $(call gb_Library_use_sdk_api,sdui))
$(eval $(call gb_Library_use_libraries,sdui,\
basegfx \
comphelper \
- cppcanvas \
cppu \
cppuhelper \
editeng \
diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx
index 30bcaa0f9c9f..44077bef682b 100644
--- a/sd/source/ui/framework/factories/Pane.cxx
+++ b/sd/source/ui/framework/factories/Pane.cxx
@@ -24,9 +24,11 @@
#include <osl/mutex.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/window.hxx>
-#include <cppcanvas/vclfactory.hxx>
#include <comphelper/servicehelper.hxx>
+#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/XSpriteCanvas.hpp>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework;
@@ -226,17 +228,7 @@ sal_Int64 SAL_CALL Pane::getSomething (const Sequence<sal_Int8>& rId)
Reference<rendering::XCanvas> Pane::CreateCanvas (void)
throw (RuntimeException)
{
- Reference<rendering::XCanvas> xCanvas;
-
- if (mpWindow != NULL)
- {
- ::cppcanvas::SpriteCanvasSharedPtr pCanvas (
- ::cppcanvas::VCLFactory::getInstance().createSpriteCanvas(*mpWindow));
- if (pCanvas.get() != NULL)
- xCanvas = Reference<rendering::XCanvas>(pCanvas->getUNOSpriteCanvas(), UNO_QUERY);
- }
-
- return xCanvas;
+ return mpWindow->GetSpriteCanvas();
}
diff --git a/sd/source/ui/presenter/PresenterCanvas.cxx b/sd/source/ui/presenter/PresenterCanvas.cxx
index 819f9eccc449..86b853ecd8d6 100644
--- a/sd/source/ui/presenter/PresenterCanvas.cxx
+++ b/sd/source/ui/presenter/PresenterCanvas.cxx
@@ -264,7 +264,7 @@ void SAL_CALL PresenterCanvas::initialize (
//----- XCanvas ---------------------------------------------------------------
-void SAL_CALL PresenterCanvas::clear (void)
+void SAL_CALL PresenterCanvas::erase (void)
throw (css::uno::RuntimeException)
{
ThrowIfDisposed();
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index d1180ccfe8bc..8b1d0d5dd48d 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -24,7 +24,6 @@
#include "PresenterHelper.hxx"
#include "CanvasUpdateRequester.hxx"
#include "PresenterCanvas.hxx"
-#include <cppcanvas/vclfactory.hxx>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/WindowClass.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
@@ -32,6 +31,7 @@
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
+#include <vcl/canvastools.hxx>
#include "res_bmp.hrc"
#include "sdresid.hxx"
@@ -450,18 +450,10 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap (
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
- const cppcanvas::CanvasSharedPtr pCanvas (
- cppcanvas::VCLFactory::getInstance().createCanvas(
- Reference<css::rendering::XBitmapCanvas>(rxCanvas,UNO_QUERY)));
-
- if (pCanvas.get()!=NULL)
- {
- BitmapEx aBitmapEx = SdResId(nid);
- return cppcanvas::VCLFactory::getInstance().createBitmap(
- pCanvas, aBitmapEx)->getUNOBitmap();
- }
-
- return NULL;
+ BitmapEx aBitmapEx = SdResId(nid);
+ return ::vcl::unotools::xBitmapFromBitmapEx(
+ rxCanvas->getDevice(),
+ aBitmapEx);
}
diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx b/sd/source/ui/presenter/PresenterPreviewCache.cxx
index 48101513c30e..78650ae22d5f 100644
--- a/sd/source/ui/presenter/PresenterPreviewCache.cxx
+++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx
@@ -23,9 +23,9 @@
#include "cache/SlsCacheContext.hxx"
#include "tools/IdleDetection.hxx"
#include "sdpage.hxx"
-#include <cppcanvas/vclfactory.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
+#include <vcl/canvastools.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -189,10 +189,6 @@ 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)));
-
const SdrPage* pPage = mpCacheContext->GetPage(nSlideIndex);
if (pPage == NULL)
throw RuntimeException();
@@ -201,9 +197,9 @@ Reference<rendering::XBitmap> SAL_CALL PresenterPreviewCache::getSlidePreview (
if (aPreview.IsEmpty())
return NULL;
else
- return cppcanvas::VCLFactory::getInstance().createBitmap(
- pCanvas,
- aPreview)->getUNOBitmap();
+ return ::vcl::unotools::xBitmapFromBitmapEx(
+ rxCanvas->getDevice(),
+ aPreview);
}
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 9498212b90a5..9857f441e2ca 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -21,7 +21,6 @@
#include "PresenterTextView.hxx"
#include <i18nlangtag/mslangid.hxx>
-#include <cppcanvas/vclfactory.hxx>
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
#include <unotools/linguprops.hxx>
@@ -36,6 +35,7 @@
#include <vcl/bitmapex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/virdev.hxx>
+#include <vcl/canvastools.hxx>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
@@ -96,7 +96,7 @@ public:
Implementation (void);
~Implementation (void);
- void SetCanvas (const cppcanvas::CanvasSharedPtr& rCanvas);
+ void SetCanvas (const Reference<rendering::XCanvas>& rCanvas);
void SetSize (const Size aSize);
void SetBackgroundColor (const Color aColor);
void SetTextColor (const Color aColor);
@@ -110,7 +110,7 @@ public:
private:
Reference<rendering::XBitmap> mxBitmap;
- cppcanvas::CanvasSharedPtr mpCanvas;
+ Reference<rendering::XCanvas> mxCanvas;
VirtualDevice* mpOutputDevice;
EditEngine* mpEditEngine;
SfxItemPool* mpEditEngineItemPool;
@@ -170,8 +170,7 @@ void SAL_CALL PresenterTextView::initialize (const Sequence<Any>& rArguments)
Reference<rendering::XBitmapCanvas> xCanvas (rArguments[0], UNO_QUERY_THROW);
if (xCanvas.is())
{
- mpImplementation->SetCanvas(
- cppcanvas::VCLFactory::getInstance().createCanvas(xCanvas));
+ mpImplementation->SetCanvas( xCanvas );
}
}
catch (RuntimeException&)
@@ -299,7 +298,7 @@ PresenterTextView::Implementation::Implementation (void)
msTopRelativePropertyName("RelativeTop"),
msTotalHeightPropertyName("TotalHeight"),
mxBitmap(),
- mpCanvas(),
+ mxCanvas(),
mpOutputDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0)),
mpEditEngine(NULL),
mpEditEngineItemPool(EditEngine::CreatePool()),
@@ -413,9 +412,9 @@ EditEngine* PresenterTextView::Implementation::CreateEditEngine (void)
-void PresenterTextView::Implementation::SetCanvas (const cppcanvas::CanvasSharedPtr& rpCanvas)
+void PresenterTextView::Implementation::SetCanvas (const Reference<rendering::XCanvas>& rCanvas)
{
- mpCanvas = rpCanvas;
+ mxCanvas = rCanvas;
mxBitmap = NULL;
}
@@ -580,10 +579,9 @@ Reference<rendering::XBitmap> PresenterTextView::Implementation::GetBitmap (void
mpEditEngine->Draw(mpOutputDevice, aWindowBox, Point(0,mnTop));
const BitmapEx aBitmap (mpOutputDevice->GetBitmapEx(Point(0,0), maSize));
- mxBitmap = cppcanvas::VCLFactory::getInstance().createBitmap(
- mpCanvas,
- aBitmap
- )->getUNOBitmap();
+ mxBitmap = ::vcl::unotools::xBitmapFromBitmapEx(
+ mxCanvas->getDevice(),
+ aBitmap);
}
return mxBitmap;
}
diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx
index 9cdfcf8cc19d..a708aaa876aa 100644
--- a/sd/source/ui/presenter/SlideRenderer.cxx
+++ b/sd/source/ui/presenter/SlideRenderer.cxx
@@ -24,7 +24,7 @@
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#include <cppcanvas/vclfactory.hxx>
+#include <vcl/canvastools.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -131,14 +131,9 @@ Reference<rendering::XBitmap> SlideRenderer::createPreviewForCanvas (
ThrowIfDisposed();
SolarMutexGuard aGuard;
- cppcanvas::BitmapCanvasSharedPtr pCanvas (cppcanvas::VCLFactory::getInstance().createCanvas(
- Reference<rendering::XBitmapCanvas>(rxCanvas, UNO_QUERY)));
- if (pCanvas.get() != NULL)
- return cppcanvas::VCLFactory::getInstance().createBitmap(
- pCanvas,
- CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor))->getUNOBitmap();
- else
- return NULL;
+ return ::vcl::unotools::xBitmapFromBitmapEx(
+ rxCanvas->getDevice(),
+ CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor));
}
diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx
index ec37c2028708..40f3c395b795 100644
--- a/sd/source/ui/slideshow/slideshowviewimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx
@@ -27,9 +27,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
-
-#include <cppcanvas/vclfactory.hxx>
-#include <cppcanvas/basegfxfactory.hxx>
+#include <vcl/canvastools.hxx>
using ::com::sun::star::uno::UNO_QUERY;
@@ -200,7 +198,7 @@ SlideShowView::SlideShowView( ShowWindow& rOutputWindow,
SlideshowImpl* pSlideShow,
bool bFullScreen )
: SlideShowView_Base( m_aMutex ),
- mpCanvas( ::cppcanvas::VCLFactory::getInstance().createSpriteCanvas( rOutputWindow ) ),
+ mxSpriteCanvas( rOutputWindow.GetSpriteCanvas() ),
mxWindow( VCLUnoHelper::GetInterface( &rOutputWindow ), uno::UNO_QUERY_THROW ),
mxWindowPeer( mxWindow, uno::UNO_QUERY_THROW ),
mxPointer(),
@@ -240,7 +238,7 @@ void SAL_CALL SlideShowView::dispose() throw (RuntimeException)
mxWindow->removeMouseMotionListener( this );
}
- mpCanvas.reset();
+ mxSpriteCanvas.clear();
mxWindow.clear();
// clear all listener containers
@@ -304,7 +302,7 @@ Reference< rendering::XSpriteCanvas > SAL_CALL SlideShowView::getCanvas( ) thro
{
::osl::MutexGuard aGuard( m_aMutex );
- return mpCanvas.get() ? mpCanvas->getUNOSpriteCanvas() : Reference< rendering::XSpriteCanvas >();
+ return mxSpriteCanvas;
}
void SAL_CALL SlideShowView::clear() throw (::com::sun::star::uno::RuntimeException)
diff --git a/sd/source/ui/slideshow/slideshowviewimpl.hxx b/sd/source/ui/slideshow/slideshowviewimpl.hxx
index 704d53c2dcf0..f7104353a738 100644
--- a/sd/source/ui/slideshow/slideshowviewimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowviewimpl.hxx
@@ -249,7 +249,7 @@ private:
void updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImpl* pSlideShow );
- ::cppcanvas::SpriteCanvasSharedPtr mpCanvas;
+ ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > mxSpriteCanvas;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > mxWindow;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > mxWindowPeer;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XPointer > mxPointer;