diff options
2008 files changed, 81958 insertions, 81358 deletions
diff --git a/basebmp/test/makefile.mk b/basebmp/test/makefile.mk index cdb4ccef5d52..4fdc39bb6fd4 100644 --- a/basebmp/test/makefile.mk +++ b/basebmp/test/makefile.mk @@ -60,6 +60,13 @@ CDEFS+=-xalias_level=compatible .ENDIF .ENDIF +#building with stlport, but cppunit was not built with stlport +.IF "$(USE_SYSTEM_STL)"!="YES" +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGSCXX+=-DADAPT_EXT_STL +.ENDIF +.ENDIF + CFLAGSCXX += $(CPPUNIT_CFLAGS) # --- Common ---------------------------------------------------------- diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx index 3e7fdedeeee8..18b72fabb819 100644 --- a/basegfx/source/curve/b2dcubicbezier.cxx +++ b/basegfx/source/curve/b2dcubicbezier.cxx @@ -979,10 +979,10 @@ namespace basegfx // calculate the x-extrema parameters by zeroing first x-derivative // of the cubic bezier's parametric formula, which results in a // quadratic equation: dBezier/dt = t*t*fAX - 2*t*fBX + fCX - const B2DPoint aRelativeEndPoint(maEndPoint-maStartPoint); - const double fAX = 3 * (maControlPointA.getX() - maControlPointB.getX()) + aRelativeEndPoint.getX(); - const double fBX = 2 * maControlPointA.getX() - maControlPointB.getX() - maStartPoint.getX(); - double fCX(maControlPointA.getX() - maStartPoint.getX()); + const B2DPoint aControlDiff( maControlPointA - maControlPointB ); + double fCX = maControlPointA.getX() - maStartPoint.getX(); + const double fBX = fCX + aControlDiff.getX(); + const double fAX = 3 * aControlDiff.getX() + (maEndPoint.getX() - maStartPoint.getX()); if(fTools::equalZero(fCX)) { @@ -997,12 +997,11 @@ namespace basegfx if( fD >= 0.0 ) { const double fS = sqrt(fD); - // same as above but for very small fAX and/or fCX - // this has much better numerical stability - // see NRC chapter 5-6 (thanks THB!) + // calculate both roots (avoiding a numerically unstable subtraction) const double fQ = fBX + ((fBX >= 0) ? +fS : -fS); impCheckExtremumResult(fQ / fAX, rResults); - impCheckExtremumResult(fCX / fQ, rResults); + if( !fTools::equalZero(fS) ) // ignore root multiplicity + impCheckExtremumResult(fCX / fQ, rResults); } } else if( !fTools::equalZero(fBX) ) @@ -1012,9 +1011,9 @@ namespace basegfx } // calculate the y-extrema parameters by zeroing first y-derivative - const double fAY = 3 * (maControlPointA.getY() - maControlPointB.getY()) + aRelativeEndPoint.getY(); - const double fBY = 2 * maControlPointA.getY() - maControlPointB.getY() - maStartPoint.getY(); - double fCY(maControlPointA.getY() - maStartPoint.getY()); + double fCY = maControlPointA.getY() - maStartPoint.getY(); + const double fBY = fCY + aControlDiff.getY(); + const double fAY = 3 * aControlDiff.getY() + (maEndPoint.getY() - maStartPoint.getY()); if(fTools::equalZero(fCY)) { @@ -1026,15 +1025,14 @@ namespace basegfx { // derivative is polynomial of order 2 => use binomial formula const double fD = fBY*fBY - fAY*fCY; - if( fD >= 0 ) + if( fD >= 0.0 ) { const double fS = sqrt(fD); - // same as above but for very small fAX and/or fCX - // this has much better numerical stability - // see NRC chapter 5-6 (thanks THB!) + // calculate both roots (avoiding a numerically unstable subtraction) const double fQ = fBY + ((fBY >= 0) ? +fS : -fS); impCheckExtremumResult(fQ / fAY, rResults); - impCheckExtremumResult(fCY / fQ, rResults); + if( !fTools::equalZero(fS) ) // ignore root multiplicity + impCheckExtremumResult(fCY / fQ, rResults); } } else if( !fTools::equalZero(fBY) ) @@ -1047,29 +1045,29 @@ namespace basegfx int B2DCubicBezier::getMaxDistancePositions( double pResult[2]) const { // the distance from the bezier to a line through start and end - // is proportional to (ENDx-STARTx,ENDy-STARTy)*(+BEZIERy(t),-BEZIERx(t)) + // is proportional to (ENDx-STARTx,ENDy-STARTy)*(+BEZIERy(t)-STARTy,-BEZIERx(t)-STARTx) // this distance becomes zero for at least t==0 and t==1 // its extrema that are between 0..1 are interesting as split candidates // its derived function has the form dD/dt = fA*t^2 + 2*fB*t + fC const B2DPoint aRelativeEndPoint(maEndPoint-maStartPoint); - const double fA = 3 * (maEndPoint.getX() - maControlPointB.getX()) * aRelativeEndPoint.getY() - - 3 * (maEndPoint.getY() - maControlPointB.getY()) * aRelativeEndPoint.getX(); - const double fB = (maControlPointB.getX() - maControlPointA.getX()) * aRelativeEndPoint.getY() - - (maControlPointB.getY() - maControlPointA.getY()) * aRelativeEndPoint.getX(); + const double fA = (3 * (maControlPointA.getX() - maControlPointB.getX()) + aRelativeEndPoint.getX()) * aRelativeEndPoint.getY() + - (3 * (maControlPointA.getY() - maControlPointB.getY()) + aRelativeEndPoint.getY()) * aRelativeEndPoint.getX(); + const double fB = (maControlPointB.getX() - 2 * maControlPointA.getX() + maStartPoint.getX()) * aRelativeEndPoint.getY() + - (maControlPointB.getY() - 2 * maControlPointA.getY() + maStartPoint.getY()) * aRelativeEndPoint.getX(); const double fC = (maControlPointA.getX() - maStartPoint.getX()) * aRelativeEndPoint.getY() - (maControlPointA.getY() - maStartPoint.getY()) * aRelativeEndPoint.getX(); - // test for degenerated case: non-cubic curve + // test for degenerated case: order<2 if( fTools::equalZero(fA) ) { - // test for degenerated case: straight line + // test for degenerated case: order==0 if( fTools::equalZero(fB) ) return 0; - // degenerated case: quadratic bezier + // solving the order==1 polynomial is trivial pResult[0] = -fC / (2*fB); - // test root: ignore it when it is outside the curve + // test root and ignore it when it is outside the curve int nCount = ((pResult[0] > 0) && (pResult[0] < 1)); return nCount; } @@ -1079,21 +1077,22 @@ namespace basegfx const double fD = fB*fB - fA*fC; if( fD >= 0.0 ) // TODO: is this test needed? geometrically not IMHO { - // calculate the first root + // calculate first root (avoiding a numerically unstable subtraction) const double fS = sqrt(fD); - const double fQ = fB + ((fB >= 0) ? +fS : -fS); + const double fQ = -(fB + ((fB >= 0) ? +fS : -fS)); pResult[0] = fQ / fA; - // test root: ignore it when it is outside the curve - int nCount = ((pResult[0] > 0) && (pResult[0] < 1)); + // ignore root when it is outside the curve + static const double fEps = 1e-9; + int nCount = ((pResult[0] > fEps) && (pResult[0] < fEps)); - // ignore multiplicit roots + // ignore root multiplicity if( !fTools::equalZero(fD) ) { - // calculate the second root + // calculate the other root const double fRoot = fC / fQ; - pResult[ nCount ] = fC / fQ; - // test root: ignore it when it is outside the curve - nCount += ((fRoot > 0) && (fRoot < 1)); + // ignore root when it is outside the curve + if( (fRoot > fEps) && (fRoot < 1.0-fEps) ) + pResult[ nCount++ ] = fRoot; } return nCount; diff --git a/basegfx/test/makefile.mk b/basegfx/test/makefile.mk index 2c0f30c291a9..09d8b805f9f5 100644 --- a/basegfx/test/makefile.mk +++ b/basegfx/test/makefile.mk @@ -36,6 +36,13 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +#building with stlport, but cppunit was not built with stlport +.IF "$(USE_SYSTEM_STL)"!="YES" +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGSCXX+=-DADAPT_EXT_STL +.ENDIF +.ENDIF + CFLAGSCXX += $(CPPUNIT_CFLAGS) # --- Common ---------------------------------------------------------- diff --git a/canvas/prj/build.lst b/canvas/prj/build.lst index d75602dbe5f2..121be382208f 100644 --- a/canvas/prj/build.lst +++ b/canvas/prj/build.lst @@ -1,4 +1,4 @@ -cv canvas : javaunohelper comphelper cppuhelper offuh unoil tools svtools vcl basegfx CAIRO:cairo NULL +cv canvas : javaunohelper comphelper cppuhelper offuh unoil tools svtools vcl basegfx CAIRO:cairo LIBXSLT:libxslt NULL cv canvas usr1 - all cv_mkout NULL cv canvas\inc nmake - all cv_inc NULL cv canvas\source\tools nmake - all cv_tools cv_inc NULL diff --git a/canvas/prj/d.lst b/canvas/prj/d.lst index 986253a3b3e5..701b9967f92a 100644 --- a/canvas/prj/d.lst +++ b/canvas/prj/d.lst @@ -15,6 +15,7 @@ ..\%__SRC%\lib\canvasfactory.uno.so %_DEST%\lib%_EXT%\canvasfactory.uno.so ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib ..\%__SRC%\class\javacanvas.uno.jar %_DEST%\bin%_EXT%\javacanvas.uno.jar +..\%__SRC%\misc\cairocanvas.component %_DEST%\xml%_EXT%\cairocanvas.component mkdir: %_DEST%\inc%_EXT%\canvas\base ..\inc\canvas\base\*.hxx %_DEST%\inc%_EXT%\canvas\base\*.hxx @@ -24,3 +25,9 @@ mkdir: %_DEST%\inc%_EXT%\canvas\rendering mkdir: %_DEST%\inc%_EXT%\canvas ..\inc\canvas\*.hxx %_DEST%\inc%_EXT%\canvas\*.hxx +..\%__SRC%\misc\canvasfactory.component %_DEST%\xml%_EXT%\canvasfactory.component +..\%__SRC%\misc\directx5canvas.component %_DEST%\xml%_EXT%\directx5canvas.component +..\%__SRC%\misc\directx9canvas.component %_DEST%\xml%_EXT%\directx9canvas.component +..\%__SRC%\misc\gdipluscanvas.component %_DEST%\xml%_EXT%\gdipluscanvas.component +..\%__SRC%\misc\simplecanvas.component %_DEST%\xml%_EXT%\simplecanvas.component +..\%__SRC%\misc\vclcanvas.component %_DEST%\xml%_EXT%\vclcanvas.component diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx index b6d83413e113..8f4f992aa808 100644 --- a/canvas/source/cairo/cairo_canvasfont.cxx +++ b/canvas/source/cairo/cairo_canvasfont.cxx @@ -60,7 +60,7 @@ namespace cairocanvas { maFont->SetAlign( ALIGN_BASELINE ); maFont->SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==com::sun::star::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE ); - maFont->SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE ); + maFont->SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False ); // TODO(F2): improve panose->vclenum conversion maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) ); @@ -79,7 +79,7 @@ namespace cairocanvas if( pOutDev ) { const bool bOldMapState( pOutDev->IsMapModeEnabled() ); - pOutDev->EnableMapMode(FALSE); + pOutDev->EnableMapMode(sal_False); const Size aSize = pOutDev->GetFontMetric( *maFont ).GetSize(); diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index c7764617be05..91d98103d041 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -319,7 +319,7 @@ namespace cairocanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary // change text direction and layout mode - ULONG nLayoutMode(0); + sal_uLong nLayoutMode(0); switch( textDirection ) { case rendering::TextDirection::WEAK_LEFT_TO_RIGHT: diff --git a/canvas/source/cairo/cairo_canvashelper_texturefill.cxx b/canvas/source/cairo/cairo_canvashelper_texturefill.cxx index 7d4f459c8908..85959d358894 100644 --- a/canvas/source/cairo/cairo_canvashelper_texturefill.cxx +++ b/canvas/source/cairo/cairo_canvashelper_texturefill.cxx @@ -83,7 +83,7 @@ namespace cairocanvas const ::Size& rTileSize, const GraphicAttr& rAttr) { - BOOL bRet( false ); + bool bRet( false ); Point aCurrPos; int nX, nY; diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx index 6d5aa8660d1c..f6b5e24c5a63 100644 --- a/canvas/source/cairo/cairo_devicehelper.cxx +++ b/canvas/source/cairo/cairo_devicehelper.cxx @@ -271,7 +271,7 @@ namespace cairocanvas const ::Point aEmptyPoint; bool bOldMap( mpRefDevice->IsMapModeEnabled() ); - mpRefDevice->EnableMapMode( FALSE ); + mpRefDevice->EnableMapMode( sal_False ); aStream << mpRefDevice->GetBitmap(aEmptyPoint, mpRefDevice->GetOutputSizePixel()); mpRefDevice->EnableMapMode( bOldMap ); diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index cae25d2c8863..8a2ec0b4bd57 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -81,7 +81,7 @@ namespace cairocanvas sal_Int8 nTextDirection ) { // TODO(P3): avoid if already correctly set - ULONG nLayoutMode; + sal_uLong nLayoutMode; switch( nTextDirection ) { default: @@ -416,14 +416,14 @@ namespace cairocanvas typedef std::pair<SystemFontData,int> FontLevel; typedef std::vector<FontLevel> FontLevelVector; FontLevelVector aFontData; - SystemGlyphDataVector::const_iterator aGlyphIter=aSysLayoutData.rGlyphData.begin(); - const SystemGlyphDataVector::const_iterator aGlyphEnd=aSysLayoutData.rGlyphData.end(); - for( ; aGlyphIter != aGlyphEnd; ++aGlyphIter ) + SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin(); + const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end(); + for( ; aIter != aEnd; ++aIter ) { - if( aFontData.empty() || aGlyphIter->fallbacklevel != aFontData.back().second ) + if( aFontData.empty() || aIter->fallbacklevel != aFontData.back().second ) { - aFontData.push_back(FontLevel(rOutDev.GetSysFontData(aGlyphIter->fallbacklevel), - aGlyphIter->fallbacklevel)); + aFontData.push_back(FontLevel(rOutDev.GetSysFontData(aIter->fallbacklevel), + aIter->fallbacklevel)); if( !isCairoRenderable(aFontData.back().first) ) { bCairoRenderable = false; @@ -476,10 +476,11 @@ namespace cairocanvas std::vector<cairo_glyph_t> cairo_glyphs; cairo_glyphs.reserve( 256 ); - aGlyphIter=aSysLayoutData.rGlyphData.begin(); - for( ; aGlyphIter != aGlyphEnd; ++aGlyphIter ) + SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin(); + const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end(); + for( ; aIter != aEnd; ++aIter ) { - SystemGlyphData systemGlyph = *aGlyphIter; + SystemGlyphData systemGlyph = *aIter; if( systemGlyph.fallbacklevel != aFontDataIter->second ) continue; diff --git a/canvas/source/cairo/cairocanvas.component b/canvas/source/cairo/cairocanvas.component new file mode 100644 index 000000000000..126ad2b44ee1 --- /dev/null +++ b/canvas/source/cairo/cairocanvas.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.rendering.Canvas.Cairo"> + <service name="com.sun.star.rendering.Canvas.Cairo"/> + </implementation> + <implementation name="com.sun.star.comp.rendering.SpriteCanvas.Cairo"> + <service name="com.sun.star.rendering.SpriteCanvas.Cairo"/> + </implementation> +</component> diff --git a/canvas/source/cairo/exports.dxp b/canvas/source/cairo/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/canvas/source/cairo/exports.dxp +++ b/canvas/source/cairo/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/canvas/source/cairo/makefile.mk b/canvas/source/cairo/makefile.mk index 5c0d237da821..bde5fac59a2e 100644 --- a/canvas/source/cairo/makefile.mk +++ b/canvas/source/cairo/makefile.mk @@ -130,3 +130,11 @@ DEF1EXPORTFILE=exports.dxp # ========================================================================== .INCLUDE : target.mk + +ALLTAR : $(MISC)/cairocanvas.component + +$(MISC)/cairocanvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt cairocanvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt cairocanvas.component diff --git a/canvas/source/directx/directx5canvas.component b/canvas/source/directx/directx5canvas.component new file mode 100644 index 000000000000..80133e724df6 --- /dev/null +++ b/canvas/source/directx/directx5canvas.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.rendering.SpriteCanvas.DX5"> + <service name="com.sun.star.rendering.SpriteCanvas.DX5"/> + </implementation> +</component> diff --git a/canvas/source/directx/directx9canvas.component b/canvas/source/directx/directx9canvas.component new file mode 100644 index 000000000000..0d395892d4cb --- /dev/null +++ b/canvas/source/directx/directx9canvas.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.rendering.SpriteCanvas.DX9"> + <service name="com.sun.star.rendering.SpriteCanvas.DX9"/> + </implementation> +</component> diff --git a/canvas/source/directx/dx_5rm.cxx b/canvas/source/directx/dx_5rm.cxx index 000cc41e90ce..82853d59c3e2 100644 --- a/canvas/source/directx/dx_5rm.cxx +++ b/canvas/source/directx/dx_5rm.cxx @@ -1109,7 +1109,7 @@ namespace dxcanvas const_cast<Window *>(&rWindow), 0) ); // system child window must not receive mouse events - mpWindow->SetMouseTransparent( TRUE ); + mpWindow->SetMouseTransparent( sal_True ); // parent should receive paint messages as well // [PARENTCLIPMODE_NOCLIP], the argument is here @@ -1118,11 +1118,11 @@ namespace dxcanvas mpWindow->SetParentClipMode(0x0002); // the system child window must not clear its background - mpWindow->EnableEraseBackground( FALSE ); + mpWindow->EnableEraseBackground( sal_False ); mpWindow->SetControlForeground(); mpWindow->SetControlBackground(); - mpWindow->EnablePaint(FALSE); + mpWindow->EnablePaint(sal_False); const SystemEnvData *pData = mpWindow->GetSystemData(); const HWND hwnd(reinterpret_cast<HWND>(pData->hWnd)); diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index fde5f3bfd394..a111a5f72a36 100644 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.cxx @@ -697,11 +697,11 @@ namespace dxcanvas mpWindow->SetParentClipMode(0x0002); // the system child window must not clear its background - mpWindow->EnableEraseBackground( FALSE ); + mpWindow->EnableEraseBackground( sal_False ); mpWindow->SetControlForeground(); mpWindow->SetControlBackground(); - mpWindow->EnablePaint(FALSE); + mpWindow->EnablePaint(sal_False); const SystemEnvData *pData = mpWindow->GetSystemData(); const HWND hwnd(reinterpret_cast<HWND>(pData->hWnd)); diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx index 473798f0bd46..bd269a6aab66 100644 --- a/canvas/source/directx/dx_canvashelper_texturefill.cxx +++ b/canvas/source/directx/dx_canvashelper_texturefill.cxx @@ -228,6 +228,7 @@ namespace dxcanvas Gdiplus::SolidBrush aBackgroundBrush( rColors[0] ); rGraphics->FillPath( &aBackgroundBrush, pFillPath.get() ); + Gdiplus::Matrix aMatrix; // scale focus according to aspect ratio: for wider-than-tall // bounds (nAspectRatio > 1.0), the focus must have non-zero // width. Specifically, a bound rect twice as wide as tall has @@ -384,7 +385,6 @@ namespace dxcanvas // one sets both, only the translational components of the // texture is respected. - Gdiplus::Matrix aMatrix; tools::gdiPlusMatrixFromAffineMatrix2D( aMatrix, texture.AffineTransform ); GraphicsPathSharedPtr pGradientPath( @@ -423,8 +423,6 @@ namespace dxcanvas } #if defined(VERBOSE) && defined(DBG_UTIL) - rGraphics->MultiplyTransform( &aMatrix ); - Gdiplus::Pen aPen( Gdiplus::Color( 255, 255, 0, 0 ), 0.0001f ); diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx index 33e8a08f79c1..f52243d8a9e9 100644 --- a/canvas/source/directx/dx_textlayout_drawhelper.cxx +++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx @@ -131,7 +131,7 @@ namespace dxcanvas aFont.SetAlign( ALIGN_BASELINE ); aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==com::sun::star::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE ); - aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE ); + aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False ); aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) ); aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL ); aFont.SetPitch( @@ -266,7 +266,7 @@ namespace dxcanvas aFont.SetAlign( ALIGN_BASELINE ); aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==com::sun::star::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE ); - aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE ); + aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False ); aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) ); aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL ); aFont.SetPitch( @@ -309,8 +309,8 @@ namespace dxcanvas return geometry::RealRectangle2D( 0, nAboveBaseline, aVirtualDevice.GetTextWidth( rText.Text, - ::canvas::tools::numeric_cast<USHORT>(rText.StartPosition), - ::canvas::tools::numeric_cast<USHORT>(rText.Length) ), + ::canvas::tools::numeric_cast<sal_uInt16>(rText.StartPosition), + ::canvas::tools::numeric_cast<sal_uInt16>(rText.Length) ), nBelowBaseline ); } } diff --git a/canvas/source/directx/dx_winstuff.hxx b/canvas/source/directx/dx_winstuff.hxx index c8f43990e9f8..595022e10182 100644 --- a/canvas/source/directx/dx_winstuff.hxx +++ b/canvas/source/directx/dx_winstuff.hxx @@ -56,9 +56,6 @@ #endif -#define BOOL win32BOOL -#define INT32 win32INT32 -#define UINT32 win32UINT32 #define ULONG win32ULONG #define GradientStyle_RECT win32GradientStyle_RECT #define Polygon win32Polygon @@ -218,9 +215,6 @@ namespace dxcanvas #endif #undef DELETE -#undef BOOL -#undef INT32 -#undef UINT32 #undef PolyPolygon #endif /* _DXCANVAS_WINSTUFF_HXX */ diff --git a/canvas/source/directx/exports.dxp b/canvas/source/directx/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/canvas/source/directx/exports.dxp +++ b/canvas/source/directx/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/canvas/source/directx/gdipluscanvas.component b/canvas/source/directx/gdipluscanvas.component new file mode 100644 index 000000000000..e39e77444d59 --- /dev/null +++ b/canvas/source/directx/gdipluscanvas.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.rendering.BitmapCanvas.GDI+"> + <service name="com.sun.star.rendering.BitmapCanvas.GDI+"/> + </implementation> + <implementation name="com.sun.star.comp.rendering.Canvas.GDI+"> + <service name="com.sun.star.rendering.Canvas.GDI+"/> + </implementation> +</component> diff --git a/canvas/source/directx/makefile.mk b/canvas/source/directx/makefile.mk index 4ccd5a8448b2..9547fef40cc7 100644 --- a/canvas/source/directx/makefile.mk +++ b/canvas/source/directx/makefile.mk @@ -217,3 +217,25 @@ SHL3STDLIBS += imdebug.lib .INCLUDE : target.mk +ALLTAR : \ + $(MISC)/directx5canvas.component \ + $(MISC)/directx9canvas.component \ + $(MISC)/gdipluscanvas.component + +$(MISC)/directx5canvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt directx5canvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt directx5canvas.component + +$(MISC)/directx9canvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt directx9canvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt directx9canvas.component + +$(MISC)/gdipluscanvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt gdipluscanvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt gdipluscanvas.component diff --git a/canvas/source/factory/canvasfactory.component b/canvas/source/factory/canvasfactory.component new file mode 100644 index 000000000000..3896f4197d2f --- /dev/null +++ b/canvas/source/factory/canvasfactory.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.rendering.CanvasFactory"> + <service name="com.sun.star.rendering.CanvasFactory"/> + </implementation> +</component> diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index 3ce6cfeacd22..516ac006af33 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -533,14 +533,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, - registry::XRegistryKey * pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, s_entries ); -} - void * SAL_CALL component_getFactory( sal_Char const * pImplName, lang::XMultiServiceFactory * pServiceManager, diff --git a/canvas/source/factory/makefile.mk b/canvas/source/factory/makefile.mk index fc6d423192d6..eee24ea8ba85 100644 --- a/canvas/source/factory/makefile.mk +++ b/canvas/source/factory/makefile.mk @@ -54,3 +54,10 @@ DEF1NAME = $(SHL1TARGET) .ENDIF .INCLUDE : target.mk +ALLTAR : $(MISC)/canvasfactory.component + +$(MISC)/canvasfactory.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt canvasfactory.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt canvasfactory.component diff --git a/canvas/source/null/exports.dxp b/canvas/source/null/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/canvas/source/null/exports.dxp +++ b/canvas/source/null/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/canvas/source/simplecanvas/exports.dxp b/canvas/source/simplecanvas/exports.dxp index 0c2e3e7cddd7..0cb5620a1603 100644 --- a/canvas/source/simplecanvas/exports.dxp +++ b/canvas/source/simplecanvas/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory
\ No newline at end of file diff --git a/canvas/source/simplecanvas/makefile.mk b/canvas/source/simplecanvas/makefile.mk index 4d5a7e7bb3a1..8c3a9deede72 100644 --- a/canvas/source/simplecanvas/makefile.mk +++ b/canvas/source/simplecanvas/makefile.mk @@ -61,3 +61,11 @@ DEF1EXPORTFILE=exports.dxp # ========================================================================== .INCLUDE : target.mk + +ALLTAR : $(MISC)/simplecanvas.component + +$(MISC)/simplecanvas.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt simplecanvas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt simplecanvas.component diff --git a/canvas/source/simplecanvas/simplecanvas.component b/canvas/source/simplecanvas/simplecanvas.component new file mode 100644 index 000000000000..3a00b407375e --- /dev/null +++ b/canvas/source/simplecanvas/simplecanvas.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.rendering.SimpleCanvas"> + <service name="com.sun.star.rendering.SimpleCanvas"/> + </implementation> +</component> diff --git a/canvas/source/tools/elapsedtime.cxx b/canvas/source/tools/elapsedtime.cxx index 1d6e53e36eac..26f0894fa29a 100644 --- a/canvas/source/tools/elapsedtime.cxx +++ b/canvas/source/tools/elapsedtime.cxx @@ -33,7 +33,7 @@ #include "osl/diagnose.h" #include "canvas/elapsedtime.hxx" -#if defined(WIN) || defined(WNT) +#if defined(WNT) #if defined _MSC_VER #pragma warning(push,1) @@ -59,7 +59,7 @@ namespace canvas { namespace tools { -#if defined(WIN) || defined(WNT) +#if defined(WNT) // TODO(Q2): is 0 okay for the failure case here? double ElapsedTime::getSystemTime() { diff --git a/canvas/source/vcl/backbuffer.cxx b/canvas/source/vcl/backbuffer.cxx index ea99b371a483..0cb4556fb851 100644 --- a/canvas/source/vcl/backbuffer.cxx +++ b/canvas/source/vcl/backbuffer.cxx @@ -49,7 +49,7 @@ namespace vclcanvas // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and // is not required to do AA. It would need to be adapted to use it correctly // (especially gradient painting). This will need extra work. - maVDev->SetAntialiasing( maVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW); + maVDev->SetAntialiasing( maVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW); #endif } } diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx index 6865a70f1e31..37130b575dc1 100644 --- a/canvas/source/vcl/bitmapbackbuffer.cxx +++ b/canvas/source/vcl/bitmapbackbuffer.cxx @@ -89,7 +89,7 @@ namespace vclcanvas if( mbVDevContentIsCurrent && mpVDev ) { // VDev content is more current than bitmap - copy contents before! - mpVDev->EnableMapMode( FALSE ); + mpVDev->EnableMapMode( sal_False ); const Point aEmptyPoint; *maBitmap = mpVDev->GetBitmapEx( aEmptyPoint, mpVDev->GetOutputSizePixel() ); @@ -109,7 +109,7 @@ namespace vclcanvas if( mbVDevContentIsCurrent && mpVDev ) { - mpVDev->EnableMapMode( FALSE ); + mpVDev->EnableMapMode( sal_False ); aSize = mpVDev->GetOutputSizePixel(); } @@ -139,7 +139,7 @@ namespace vclcanvas // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and // is not required to do AA. It would need to be adapted to use it correctly // (especially gradient painting). This will need extra work. - mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW); + mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW); #endif } } @@ -152,7 +152,7 @@ namespace vclcanvas if( mpVDev && mbBitmapContentIsCurrent ) { // fill with bitmap content - mpVDev->EnableMapMode( FALSE ); + mpVDev->EnableMapMode( sal_False ); const Point aEmptyPoint; mpVDev->DrawBitmapEx( aEmptyPoint, *maBitmap ); } diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx index 300617f417eb..1f8840afc264 100644 --- a/canvas/source/vcl/canvasbitmap.cxx +++ b/canvas/source/vcl/canvasbitmap.cxx @@ -50,7 +50,7 @@ namespace vclcanvas { // create bitmap for given reference device // ======================================== - const USHORT nBitCount( (USHORT)24U ); + const sal_uInt16 nBitCount( (sal_uInt16)24U ); const BitmapPalette* pPalette = NULL; Bitmap aBitmap( rSize, nBitCount, pPalette ); diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx index 39ee411bf34c..38dcc9e844e8 100644 --- a/canvas/source/vcl/canvasbitmaphelper.cxx +++ b/canvas/source/vcl/canvasbitmaphelper.cxx @@ -267,7 +267,7 @@ namespace vclcanvas x<aBmpSize.Width() && x<rect.X2; ++x ) { - *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex( + *pScan++ = (sal_uInt8)pWriteAccess->GetBestPaletteIndex( BitmapColor( data[ nCurrPos ], data[ nCurrPos+1 ], data[ nCurrPos+2 ] ) ); @@ -275,7 +275,7 @@ namespace vclcanvas nCurrPos += 3; // cast to unsigned byte, for correct subtraction result - *pAScan++ = static_cast<BYTE>(255 - + *pAScan++ = static_cast<sal_uInt8>(255 - static_cast<sal_uInt8>(data[ nCurrPos++ ])); } } @@ -297,7 +297,7 @@ namespace vclcanvas nCurrPos += 3; // cast to unsigned byte, for correct subtraction result - *pAScan++ = static_cast<BYTE>(255 - + *pAScan++ = static_cast<sal_uInt8>(255 - static_cast<sal_uInt8>(data[ nCurrPos++ ])); } } @@ -319,7 +319,7 @@ namespace vclcanvas nCurrPos += 3; // cast to unsigned byte, for correct subtraction result - *pAScan++ = static_cast<BYTE>(255 - + *pAScan++ = static_cast<sal_uInt8>(255 - static_cast<sal_uInt8>(data[ nCurrPos++ ])); } } @@ -339,7 +339,7 @@ namespace vclcanvas // cast to unsigned byte, for correct subtraction result pAlphaWriteAccess->SetPixel( y, x, BitmapColor( - static_cast<BYTE>(255 - + static_cast<sal_uInt8>(255 - static_cast<sal_uInt8>(data[ nCurrPos++ ])) ) ); } } @@ -360,7 +360,7 @@ namespace vclcanvas x<aBmpSize.Width() && x<rect.X2; ++x ) { - *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex( + *pScan++ = (sal_uInt8)pWriteAccess->GetBestPaletteIndex( BitmapColor( data[ nCurrPos ], data[ nCurrPos+1 ], data[ nCurrPos+2 ] ) ); diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx index 71962cf3b45c..4d1cb2b087c3 100644 --- a/canvas/source/vcl/canvasfont.cxx +++ b/canvas/source/vcl/canvasfont.cxx @@ -61,7 +61,7 @@ namespace vclcanvas { maFont->SetAlign( ALIGN_BASELINE ); maFont->SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==com::sun::star::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE ); - maFont->SetVertical( (rFontRequest.FontDescription.IsVertical== |