diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 8fb3d904d485..2d4d2ed35c7f 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #if 0 @@ -40,7 +41,7 @@ class DemoBase : public WorkWindow // hide OutputDevice if necessary { public: - DemoBase() : WorkWindow( NULL, WB_APP | WB_STDWORK) + DemoBase() : WorkWindow(NULL, WB_APP | WB_STDWORK) { } OutputDevice &getOutDev() { return *this; } @@ -88,8 +89,9 @@ public: { if (!Application::LoadBrandBitmap("intro", maIntro)) Application::Abort("Failed to load intro image"); + maIntroBW = maIntro.GetBitmap(); - maIntroBW.Filter( BMP_FILTER_EMBOSS_GREY ); + maIntroBW.Filter(BMP_FILTER_EMBOSS_GREY); InitRenderers(); } @@ -101,9 +103,9 @@ public: int mnBounceX, mnBounceY; DECL_LINK(BounceTimerCb, void *); - virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; + virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE; - virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE + virtual void Paint(const Rectangle& rRect) SAL_OVERRIDE { fprintf(stderr, "DemoWin::Paint(%ld,%ld,%ld,%ld)\n", rRect.getX(), rRect.getY(), rRect.getWidth(), rRect.getHeight()); drawToDevice(getOutDev(), false); @@ -119,9 +121,9 @@ public: long nBorderSize = aSize.Width() / 32; long nBoxWidth = (aSize.Width() - nBorderSize*(nX+1)) / nX; long nBoxHeight = (aSize.Height() - nBorderSize*(nY+1)) / nY; - for (int y = 0; y < nY; y++ ) + for (int y = 0; y < nY; y++) { - for (int x = 0; x < nX; x++ ) + for (int x = 0; x < nX; x++) { r.SetPos(Point(nBorderSize + (nBorderSize + nBoxWidth) * x, nBorderSize + (nBorderSize + nBoxHeight) * y)); @@ -224,15 +226,15 @@ public: { rDev.SetFillColor(Color(COL_LIGHTRED)); rDev.SetLineColor(Color(COL_BLACK)); - rDev.DrawRect( r ); + rDev.DrawRect(r); for(int i=0; i> 2) % 8) / 8); + aTransform.shearY((double)((i >> 4) % 8) / 8); + break; + case 3: + aTransform.translate(-aSize.Width()/2, -aSize.Height()/2); + aTransform.rotate(i); + if (i & 0x100) + { + aTransform.shearX((double)((i >> 2) % 8) / 8); + aTransform.shearY((double)((i >> 4) % 8) / 8); + } + aTransform.translate(aSize.Width()/2, aSize.Height()/2); + break; + default: + aTransform.translate(-aSize.Width()/2, -aSize.Height()/2); + aTransform.rotate(2 * F_2PI * i / nToRender); + aTransform.translate(aSize.Width()/2, aSize.Height()/2); + break; + } + aTransform.translate(p.X(), p.Y()); rDev.DrawTransformedBitmapEx(aTransform, maIcons[i]); - break; - case 2: - aTransform.shearX(10); - rDev.DrawTransformedBitmapEx(aTransform, maIcons[i]); - break; - case 3: - aTransform.rotate(i); - rDev.DrawTransformedBitmapEx(aTransform, maIcons[i]); - break; } + // next position p.Move(aSize.Width(), 0); if (aSize.Height() > nMaxH) nMaxH = aSize.Height(); @@ -743,7 +757,7 @@ IMPL_LINK_NOARG(DemoWin,BounceTimerCb) return 0; } -void DemoWin::MouseButtonDown( const MouseEvent& rMEvt ) +void DemoWin::MouseButtonDown(const MouseEvent& rMEvt) { // click to zoom out if (mnSelectedRenderer >= 0) @@ -816,7 +830,7 @@ public: try { DemoWin aMainWin; - aMainWin.SetText( "Interactive VCL demo" ); + aMainWin.SetText("Interactive VCL demo"); aMainWin.Show(); Application::Execute(); } @@ -842,11 +856,11 @@ protected: uno::Reference xComponentContext = ::cppu::defaultBootstrap_InitialComponentContext(); xMSF = uno::Reference - ( xComponentContext->getServiceManager(), uno::UNO_QUERY ); - if( !xMSF.is() ) + (xComponentContext->getServiceManager(), uno::UNO_QUERY); + if(!xMSF.is()) Application::Abort("Bootstrap failure - no service manager"); - ::comphelper::setProcessServiceFactory( xMSF ); + ::comphelper::setProcessServiceFactory(xMSF); } catch (const uno::Exception &e) { @@ -857,8 +871,8 @@ protected: { uno::Reference< lang::XComponent >( comphelper::getProcessComponentContext(), - uno::UNO_QUERY_THROW )-> dispose(); - ::comphelper::setProcessServiceFactory( NULL ); + uno::UNO_QUERY_THROW)-> dispose(); + ::comphelper::setProcessServiceFactory(NULL); } };