You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ja...@apache.org on 2013/02/03 14:24:38 UTC
svn commit: r1441909 [41/45] - in /openoffice/branches/l10n: ./
ext_libraries/apr-util/ ext_libraries/apr/ ext_libraries/hunspell/
ext_sources/ extras/l10n/source/ast/ extras/l10n/source/da/
extras/l10n/source/eu/ extras/l10n/source/gd/ extras/l10n/sou...
Modified: openoffice/branches/l10n/main/vcl/inc/vcl/spin.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/vcl/spin.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/vcl/spin.hxx (original)
+++ openoffice/branches/l10n/main/vcl/inc/vcl/spin.hxx Sun Feb 3 13:23:59 2013
@@ -60,9 +60,9 @@ private:
DECL_DLLPRIVATE_LINK( ImplTimeout, Timer* );
public:
- SpinButton( Window* pParent, WinBits nStyle = 0 );
- SpinButton( Window* pParent, const ResId& rResId );
- ~SpinButton();
+ explicit SpinButton( Window* pParent, WinBits nStyle = 0 );
+ explicit SpinButton( Window* pParent, const ResId& );
+ virtual ~SpinButton();
virtual void Up();
virtual void Down();
@@ -111,3 +111,4 @@ private:
};
#endif // _SV_SPIN_HXX
+
Modified: openoffice/branches/l10n/main/vcl/inc/vcl/spinfld.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/vcl/spinfld.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/vcl/spinfld.hxx (original)
+++ openoffice/branches/l10n/main/vcl/inc/vcl/spinfld.hxx Sun Feb 3 13:23:59 2013
@@ -63,7 +63,7 @@ private:
SAL_DLLPRIVATE void ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rectangle& rDDArea, Rectangle& rSpinUpArea, Rectangle& rSpinDownArea );
protected:
- SpinField( WindowType nTyp );
+ explicit SpinField( WindowType nTyp );
virtual long Notify( NotifyEvent& rNEvt );
virtual void Command( const CommandEvent& rCEvt );
@@ -73,9 +73,9 @@ protected:
virtual void FillLayoutData() const;
Rectangle * ImplFindPartRect( const Point& rPt );
public:
- SpinField( Window* pParent, WinBits nWinStyle = 0 );
- SpinField( Window* pParent, const ResId& rResId );
- ~SpinField();
+ explicit SpinField( Window* pParent, WinBits nWinStyle = 0 );
+ explicit SpinField( Window* pParent, const ResId& );
+ virtual ~SpinField();
virtual sal_Bool ShowDropDown( sal_Bool bShow );
@@ -109,3 +109,4 @@ public:
};
#endif // _SV_SPINFLD_HXX
+
Modified: openoffice/branches/l10n/main/vcl/inc/vcl/split.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/vcl/split.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/vcl/split.hxx (original)
+++ openoffice/branches/l10n/main/vcl/inc/vcl/split.hxx Sun Feb 3 13:23:59 2013
@@ -70,9 +70,9 @@ protected:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nWinStyle );
public:
- Splitter( Window* pParent, WinBits nStyle = WB_VSCROLL );
- Splitter( Window* pParent, const ResId& rResId );
- ~Splitter();
+ explicit Splitter( Window* pParent, WinBits nStyle = WB_VSCROLL );
+ explicit Splitter( Window* pParent, const ResId& );
+ virtual ~Splitter();
virtual void StartSplit();
virtual void EndSplit();
@@ -120,3 +120,4 @@ public:
};
#endif // _SV_SPLIT_HXX
+
Modified: openoffice/branches/l10n/main/vcl/inc/vcl/status.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/vcl/status.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/vcl/status.hxx (original)
+++ openoffice/branches/l10n/main/vcl/inc/vcl/status.hxx Sun Feb 3 13:23:59 2013
@@ -147,6 +147,8 @@ public:
void HideItems();
sal_Bool AreItemsVisible() const { return mbVisibleItems; }
+ void RedrawItem( sal_uInt16 nItemId );
+
void CopyItems( const StatusBar& rStatusBar );
void Clear();
Modified: openoffice/branches/l10n/main/vcl/inc/vcl/syschild.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/vcl/syschild.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/vcl/syschild.hxx (original)
+++ openoffice/branches/l10n/main/vcl/inc/vcl/syschild.hxx Sun Feb 3 13:23:59 2013
@@ -47,11 +47,11 @@ private:
SAL_DLLPRIVATE SystemChildWindow & operator= (const SystemChildWindow &);
public:
- SystemChildWindow( Window* pParent, WinBits nStyle = 0 );
+ explicit SystemChildWindow( Window* pParent, WinBits nStyle = 0 );
// create a SystemChildWindow using the given SystemWindowData
- SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow = sal_True );
- SystemChildWindow( Window* pParent, const ResId& rResId );
- ~SystemChildWindow();
+ explicit SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData* pData, sal_Bool bShow = sal_True );
+ explicit SystemChildWindow( Window* pParent, const ResId& );
+ virtual ~SystemChildWindow();
const SystemEnvData* GetSystemData() const;
Modified: openoffice/branches/l10n/main/vcl/inc/vcl/tabpage.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/vcl/tabpage.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/vcl/tabpage.hxx (original)
+++ openoffice/branches/l10n/main/vcl/inc/vcl/tabpage.hxx Sun Feb 3 13:23:59 2013
@@ -40,8 +40,8 @@ private:
SAL_DLLPRIVATE void ImplInitSettings();
public:
- TabPage( Window* pParent, WinBits nStyle = 0 );
- TabPage( Window* pParent, const ResId& rResId );
+ explicit TabPage( Window* pParent, WinBits nStyle = 0 );
+ explicit TabPage( Window* pParent, const ResId& );
virtual void Paint( const Rectangle& rRect );
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
@@ -56,3 +56,4 @@ public:
};
#endif // _SV_TABPAGE_HXX
+
Modified: openoffice/branches/l10n/main/vcl/inc/vcl/virdev.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/vcl/virdev.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/vcl/virdev.hxx (original)
+++ openoffice/branches/l10n/main/vcl/inc/vcl/virdev.hxx Sun Feb 3 13:23:59 2013
@@ -68,8 +68,8 @@ private:
SAL_DLLPRIVATE bool ForceZeroExtleadBug() const
{ return ((meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD) != 0); }
public:
- VirtualDevice( sal_uInt16 nBitCount = 0 );
- VirtualDevice( const OutputDevice& rCompDev,
+ explicit VirtualDevice( sal_uInt16 nBitCount = 0 );
+ explicit VirtualDevice( const OutputDevice& rCompDev,
sal_uInt16 nBitCount = 0 );
/** Create a virtual device with alpha channel
@@ -94,7 +94,7 @@ public:
Any rendering will happen directly on the context and not on any intermediate bitmap.
Note: This might not be suported on all platforms !
*/
- VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount );
+ explicit VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount );
virtual ~VirtualDevice();
@@ -123,3 +123,4 @@ private:
};
#endif // _SV_VIRDEV_HXX
+
Modified: openoffice/branches/l10n/main/vcl/inc/vcl/wall.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/vcl/wall.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/vcl/wall.hxx (original)
+++ openoffice/branches/l10n/main/vcl/inc/vcl/wall.hxx Sun Feb 3 13:23:59 2013
@@ -97,7 +97,7 @@ public:
Wallpaper();
Wallpaper( const Wallpaper& rWallpaper );
Wallpaper( const Color& rColor );
- Wallpaper( const BitmapEx& rBmpEx );
+ explicit Wallpaper( const BitmapEx& rBmpEx );
Wallpaper( const Gradient& rGradient );
~Wallpaper();
Modified: openoffice/branches/l10n/main/vcl/inc/vcl/wrkwin.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/vcl/wrkwin.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/vcl/wrkwin.hxx (original)
+++ openoffice/branches/l10n/main/vcl/inc/vcl/wrkwin.hxx Sun Feb 3 13:23:59 2013
@@ -67,11 +67,11 @@ protected:
SAL_DLLPRIVATE void ImplSetFrameState( sal_uLong aFrameState );
public:
- WorkWindow( Window* pParent, const ResId& rResId );
- WorkWindow( Window* pParent, WinBits nStyle = WB_STDWORK );
- WorkWindow( Window* pParent, const ::com::sun::star::uno::Any& aSystemWorkWindowToken, WinBits nStyle = WB_STDWORK );
- WorkWindow( SystemParentData* pParent ); // Not in the REMOTE-Version
- ~WorkWindow();
+ explicit WorkWindow( Window* pParent, const ResId& );
+ explicit WorkWindow( Window* pParent, WinBits nStyle = WB_STDWORK );
+ explicit WorkWindow( Window* pParent, const ::com::sun::star::uno::Any& aSystemWorkWindowToken, WinBits nStyle = WB_STDWORK );
+ explicit WorkWindow( SystemParentData* pParent ); // Not in the REMOTE-Version
+ virtual ~WorkWindow();
virtual sal_Bool Close();
@@ -102,3 +102,4 @@ public:
};
#endif // _SV_WRKWIN_HXX
+
Modified: openoffice/branches/l10n/main/vcl/inc/win/salbmp.h
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/win/salbmp.h?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/win/salbmp.h (original)
+++ openoffice/branches/l10n/main/vcl/inc/win/salbmp.h Sun Feb 3 13:23:59 2013
@@ -27,6 +27,7 @@
#include <tools/gen.hxx>
#include <win/wincomp.hxx>
#include <salbmp.hxx>
+#include <boost/shared_ptr.hpp>
// --------------
// - SalBitmap -
@@ -36,24 +37,38 @@ struct BitmapBuffer;
class BitmapColor;
class BitmapPalette;
class SalGraphics;
+namespace Gdiplus { class Bitmap; }
+typedef boost::shared_ptr< Gdiplus::Bitmap > GdiPlusBmpPtr;
class WinSalBitmap : public SalBitmap
{
private:
+ friend class GdiPlusBuffer; // allow buffer to remove maGdiPlusBitmap eventually
Size maSize;
HGLOBAL mhDIB;
HBITMAP mhDDB;
- sal_uInt16 mnBitCount;
+
+ // the buffered evtl. used Gdiplus::Bitmap instance. It is managed by
+ // GdiPlusBuffer. To make this safe, it is only handed out as shared
+ // pointer; the GdiPlusBuffer may delete the local instance
+ GdiPlusBmpPtr maGdiPlusBitmap;
+
+ sal_uInt16 mnBitCount;
+
+ Gdiplus::Bitmap* ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlphaSource);
+ Gdiplus::Bitmap* ImplCreateGdiPlusBitmap();
public:
HGLOBAL ImplGethDIB() const { return mhDIB; }
HBITMAP ImplGethDDB() const { return mhDDB; }
+
+ GdiPlusBmpPtr ImplGetGdiPlusBitmap(const WinSalBitmap* pAlphaSource = 0) const;
static HGLOBAL ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB );
- static sal_uInt16 ImplGetDIBColorCount( HGLOBAL hDIB );
+ static sal_uInt16 ImplGetDIBColorCount( HGLOBAL hDIB );
static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
const Size& rSizePixel, bool bRLE4 );
Modified: openoffice/branches/l10n/main/vcl/inc/win/salgdi.h
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/win/salgdi.h?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/win/salgdi.h (original)
+++ openoffice/branches/l10n/main/vcl/inc/win/salgdi.h Sun Feb 3 13:23:59 2013
@@ -128,8 +128,14 @@ public:
class WinSalGraphics : public SalGraphics
{
+private:
+ HDC mhLocalDC; // HDC
+
+public:
+ HDC getHDC() { return mhLocalDC; }
+ void setHDC(HDC aNew) { mhLocalDC = aNew; }
+
public:
- HDC mhDC; // HDC
HWND mhWnd; // Window-Handle, when Window-Graphics
HFONT mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks
const ImplWinFontData* mpWinFontData[ MAX_FALLBACK ]; // pointer to the most recent font face
@@ -155,15 +161,17 @@ public:
KERNINGPAIR* mpFontKernPairs; // Kerning Pairs of the current Font
sal_uIntPtr mnFontKernPairCount;// Number of Kerning Pairs of the current Font
int mnPenWidth; // Linienbreite
- sal_Bool mbStockPen; // is Pen a stockpen
- sal_Bool mbStockBrush; // is Brush a stcokbrush
- sal_Bool mbPen; // is Pen (FALSE == NULL_PEN)
- sal_Bool mbBrush; // is Brush (FALSE == NULL_BRUSH)
- sal_Bool mbPrinter; // is Printer
- sal_Bool mbVirDev; // is VirDev
- sal_Bool mbWindow; // is Window
- sal_Bool mbScreen; // is Screen compatible
- bool mbXORMode; // _every_ output with RasterOp XOR
+
+ /// bitfield
+ bool mbStockPen : 1; // is Pen a stockpen
+ bool mbStockBrush : 1; // is Brush a stcokbrush
+ bool mbPen : 1; // is Pen (FALSE == NULL_PEN)
+ bool mbBrush : 1; // is Brush (FALSE == NULL_BRUSH)
+ bool mbPrinter : 1; // is Printer
+ bool mbVirDev : 1; // is VirDev
+ bool mbWindow : 1; // is Window
+ bool mbScreen : 1; // is Screen compatible
+ bool mbXORMode : 1; // _every_ output with RasterOp XOR
// remember RGB values for SetLineColor/SetFillColor
SalColor maLineColor;
@@ -202,15 +210,15 @@ protected:
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics );
+ virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap );
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
@@ -239,8 +247,18 @@ protected:
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
+ virtual bool drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap);
virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
+private:
+ // local helpers
+ bool tryDrawBitmapGdiPlus(const SalTwoRect& rTR, const SalBitmap& rSrcBitmap);
+
public:
// public SalGraphics methods, the interface to teh independent vcl part
Modified: openoffice/branches/l10n/main/vcl/inc/win/salvd.h
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/inc/win/salvd.h?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/inc/win/salvd.h (original)
+++ openoffice/branches/l10n/main/vcl/inc/win/salvd.h Sun Feb 3 13:23:59 2013
@@ -34,8 +34,14 @@ class WinSalGraphics;
class WinSalVirtualDevice : public SalVirtualDevice
{
+private:
+ HDC mhLocalDC; // HDC or 0 for Cache Device
+
+public:
+ HDC getHDC() { return mhLocalDC; }
+ void setHDC(HDC aNew) { mhLocalDC = aNew; }
+
public:
- HDC mhDC; // HDC or 0 for Cache Device
HBITMAP mhBmp; // Memory Bitmap
HBITMAP mhDefBmp; // Default Bitmap
WinSalGraphics* mpGraphics; // current VirDev graphics
Modified: openoffice/branches/l10n/main/vcl/os2/source/gdi/salgdi2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/os2/source/gdi/salgdi2.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/os2/source/gdi/salgdi2.cxx (original)
+++ openoffice/branches/l10n/main/vcl/os2/source/gdi/salgdi2.cxx Sun Feb 3 13:23:59 2013
@@ -51,7 +51,7 @@ bool Os2SalGraphics::supportsOperation(
}
-void Os2SalGraphics::copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics )
+void Os2SalGraphics::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics )
{
HPS hSrcPS;
POINTL thePoints[4];
@@ -71,22 +71,22 @@ void Os2SalGraphics::copyBits( const Sal
}
// lower-left corner of target
- thePoints[0].x = pPosAry->mnDestX;
- thePoints[0].y = TY( pPosAry->mnDestY + pPosAry->mnDestHeight - 1 );
+ thePoints[0].x = rPosAry.mnDestX;
+ thePoints[0].y = TY( rPosAry.mnDestY + rPosAry.mnDestHeight - 1 );
// upper-right corner of target
- thePoints[1].x = pPosAry->mnDestX + pPosAry->mnDestWidth;
- thePoints[1].y = TY( pPosAry->mnDestY - 1 );
+ thePoints[1].x = rPosAry.mnDestX + rPosAry.mnDestWidth;
+ thePoints[1].y = TY( rPosAry.mnDestY - 1 );
// lower-left corner of source
- thePoints[2].x = pPosAry->mnSrcX;
- thePoints[2].y = nSrcHeight - ( pPosAry->mnSrcY + pPosAry->mnSrcHeight );
+ thePoints[2].x = rPosAry.mnSrcX;
+ thePoints[2].y = nSrcHeight - ( rPosAry.mnSrcY + rPosAry.mnSrcHeight );
- if ( ( pPosAry->mnDestWidth != pPosAry->mnSrcWidth ) || ( pPosAry->mnDestHeight != pPosAry->mnSrcHeight ) )
+ if ( ( rPosAry.mnDestWidth != rPosAry.mnSrcWidth ) || ( rPosAry.mnDestHeight != rPosAry.mnSrcHeight ) )
{
// upper-right corner of Source
- thePoints[3].x = pPosAry->mnSrcX + pPosAry->mnSrcWidth;
- thePoints[3].y = nSrcHeight - pPosAry->mnSrcY + pPosAry->mnSrcHeight;
+ thePoints[3].x = rPosAry.mnSrcX + rPosAry.mnSrcWidth;
+ thePoints[3].y = nSrcHeight - rPosAry.mnSrcY + rPosAry.mnSrcHeight;
GpiBitBlt( mhPS, hSrcPS, 4, thePoints,
mbXORMode ? ROP_SRCINVERT : ROP_SRCCOPY, BBO_IGNORE );
@@ -275,7 +275,7 @@ void Os2SalGraphics::copyArea( long nDes
// -----------------------------------------------------------------------
void ImplDrawBitmap( HPS hPS, long nScreenHeight,
- const SalTwoRect* pPosAry, const Os2SalBitmap& rSalBitmap,
+ const SalTwoRect& rPosAry, const Os2SalBitmap& rSalBitmap,
PM_BOOL bPrinter, int nDrawMode )
{
if( hPS )
@@ -305,15 +305,15 @@ void ImplDrawBitmap( HPS hPS, long nScre
long nInfoSize = *(ULONG*) pBI + rSalBitmap.ImplGetDIBColorCount( hDrawDIB ) * sizeof( RGB2 );
PM_BYTE* pBits = (PM_BYTE*) pBI + nInfoSize;
- pts[0].x = pPosAry->mnDestX;
- pts[0].y = nScreenHeight - pPosAry->mnDestY - pPosAry->mnDestHeight;
- pts[1].x = pPosAry->mnDestX + pPosAry->mnDestWidth - 1;
- pts[1].y = nScreenHeight - pPosAry->mnDestY - 1;
-
- pts[2].x = pPosAry->mnSrcX;
- pts[2].y = nHeight - ( pPosAry->mnSrcY + pPosAry->mnSrcHeight );
- pts[3].x = pPosAry->mnSrcX + pPosAry->mnSrcWidth;
- pts[3].y = nHeight - pPosAry->mnSrcY;
+ pts[0].x = rPosAry.mnDestX;
+ pts[0].y = nScreenHeight - rPosAry.mnDestY - rPosAry.mnDestHeight;
+ pts[1].x = rPosAry.mnDestX + rPosAry.mnDestWidth - 1;
+ pts[1].y = nScreenHeight - rPosAry.mnDestY - 1;
+
+ pts[2].x = rPosAry.mnSrcX;
+ pts[2].y = nHeight - ( rPosAry.mnSrcY + rPosAry.mnSrcHeight );
+ pts[3].x = rPosAry.mnSrcX + rPosAry.mnSrcWidth;
+ pts[3].y = nHeight - rPosAry.mnSrcY;
// if we've got a 1Bit DIB, we create a 4Bit substitute
if( ( pBIH->cBitCount == 1 ) && !hSubst )
@@ -400,15 +400,15 @@ void ImplDrawBitmap( HPS hPS, long nScre
{
POINTL pts[ 4 ];
- pts[0].x = pPosAry->mnDestX;
- pts[0].y = nScreenHeight - pPosAry->mnDestY - pPosAry->mnDestHeight;
- pts[1].x = pPosAry->mnDestX + pPosAry->mnDestWidth - 1;
- pts[1].y = nScreenHeight - pPosAry->mnDestY - 1;
-
- pts[2].x = pPosAry->mnSrcX;
- pts[2].y = rSalBitmap.GetSize().Height() - ( pPosAry->mnSrcY + pPosAry->mnSrcHeight );
- pts[3].x = pPosAry->mnSrcX + pPosAry->mnSrcWidth;
- pts[3].y = rSalBitmap.GetSize().Height() - pPosAry->mnSrcY;
+ pts[0].x = rPosAry.mnDestX;
+ pts[0].y = nScreenHeight - rPosAry.mnDestY - rPosAry.mnDestHeight;
+ pts[1].x = rPosAry.mnDestX + rPosAry.mnDestWidth - 1;
+ pts[1].y = nScreenHeight - rPosAry.mnDestY - 1;
+
+ pts[2].x = rPosAry.mnSrcX;
+ pts[2].y = rSalBitmap.GetSize().Height() - ( rPosAry.mnSrcY + rPosAry.mnSrcHeight );
+ pts[3].x = rPosAry.mnSrcX + rPosAry.mnSrcWidth;
+ pts[3].y = rSalBitmap.GetSize().Height() - rPosAry.mnSrcY;
GpiWCBitBlt( hPS, hDrawDDB, 4L, pts, nDrawMode, BBO_IGNORE );
/*
@@ -425,30 +425,29 @@ void ImplDrawBitmap( HPS hPS, long nScre
// -----------------------------------------------------------------------
-void Os2SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
- const SalBitmap& rSalBitmap )
+void Os2SalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap )
{
ImplDrawBitmap( mhPS, mnHeight,
- pPosAry, static_cast<const Os2SalBitmap&>(rSalBitmap),
+ rPosAry, static_cast<const Os2SalBitmap&>(rSalBitmap),
mbPrinter,
mbXORMode ? ROP_SRCINVERT : ROP_SRCCOPY );
}
// -----------------------------------------------------------------------
-void Os2SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
+void Os2SalGraphics::drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor )
{
DBG_ASSERT( !mbPrinter, "No transparency print possible!" );
//const Os2SalBitmap& rSalBitmap = static_cast<const Os2SalBitmap&>(rSSalBitmap);
// an FM: kann erst einmal unberuecksichtigt bleiben
- drawBitmap( pPosAry, rSalBitmap );
+ drawBitmap( rPosAry, rSalBitmap );
}
// -----------------------------------------------------------------------
-void Os2SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
+void Os2SalGraphics::drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSSalBitmap,
const SalBitmap& rSTransparentBitmap )
{
@@ -459,12 +458,12 @@ void Os2SalGraphics::drawBitmap( const S
if( bFastTransparent )
{
- ImplDrawBitmap( mhPS, mnHeight, pPosAry, rTransparentBitmap, FALSE, ROP_SRCAND );
- ImplDrawBitmap( mhPS, mnHeight, pPosAry, rSalBitmap, FALSE, ROP_SRCPAINT );
+ ImplDrawBitmap( mhPS, mnHeight, rPosAry, rTransparentBitmap, FALSE, ROP_SRCAND );
+ ImplDrawBitmap( mhPS, mnHeight, rPosAry, rSalBitmap, FALSE, ROP_SRCPAINT );
}
else
{
- SalTwoRect aPosAry = *pPosAry;
+ SalTwoRect aPosAry = rPosAry;
int nDstX = (int) aPosAry.mnDestX;
int nDstY = (int) aPosAry.mnDestY;
int nDstWidth = (int) aPosAry.mnDestWidth;
@@ -497,13 +496,13 @@ void Os2SalGraphics::drawBitmap( const S
aPtL[ 2 ].y = TY( nDstY + nDstHeight - 1 );
GpiBitBlt( hMemPS, hPS, 3, aPtL, ROP_SRCCOPY, BBO_IGNORE );
- ImplDrawBitmap( hMaskPS, nDstHeight, &aPosAry, rTransparentBitmap, FALSE, ROP_SRCCOPY );
+ ImplDrawBitmap( hMaskPS, nDstHeight, aPosAry, rTransparentBitmap, FALSE, ROP_SRCCOPY );
aPtL[ 2 ].x = 0;
aPtL[ 2 ].y = 0;
GpiBitBlt( hMemPS, hMaskPS, 3, aPtL, ROP_SRCAND, BBO_IGNORE );
- ImplDrawBitmap( hMaskPS, nDstHeight, &aPosAry, rSalBitmap, FALSE, ROP_SRCERASE );
+ ImplDrawBitmap( hMaskPS, nDstHeight, aPosAry, rSalBitmap, FALSE, ROP_SRCERASE );
GpiBitBlt( hMemPS, hMaskPS, 3, aPtL, ROP_SRCPAINT, BBO_IGNORE );
aPtL[ 0 ].x = nDstX;
@@ -542,6 +541,20 @@ bool Os2SalGraphics::drawAlphaBitmap( co
// -----------------------------------------------------------------------
+bool Os2SalGraphics::drawTransformedBitmap(
+ const basegfx::B2DPoint& rNull,
+ const basegfx::B2DPoint& rX,
+ const basegfx::B2DPoint& rY,
+ const SalBitmap& rSourceBitmap,
+ const SalBitmap* pAlphaBitmap)
+{
+ // here direct support for transformed bitmaps can be impemented
+ (void)rNull; (void)rX; (void)rY; (void)rSourceBitmap; (void)pAlphaBitmap;
+ return false;
+}
+
+// -----------------------------------------------------------------------
+
bool Os2SalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency )
{
@@ -551,7 +564,7 @@ bool Os2SalGraphics::drawAlphaRect( long
// -----------------------------------------------------------------------
-void Os2SalGraphics::drawMask( const SalTwoRect* pPosAry,
+void Os2SalGraphics::drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSSalBitmap,
SalColor nMaskColor )
{
@@ -559,7 +572,7 @@ void Os2SalGraphics::drawMask( const Sal
const Os2SalBitmap& rSalBitmap = static_cast<const Os2SalBitmap&>(rSSalBitmap);
- SalTwoRect aPosAry = *pPosAry;
+ SalTwoRect aPosAry = rPosAry;
HPS hPS = mhPS;
IMAGEBUNDLE aBundle, aOldBundle;
AREABUNDLE aAreaBundle, aOldAreaBundle;
@@ -582,7 +595,7 @@ void Os2SalGraphics::drawMask( const Sal
Ft2SetAttrs( hPS, PRIM_AREA, ABB_COLOR | ABB_BACK_COLOR | ABB_SYMBOL |
ABB_MIX_MODE | ABB_BACK_MIX_MODE, 0, &aAreaBundle );
- ImplDrawBitmap( hPS, mnHeight, &aPosAry, rSalBitmap, FALSE, 0x00B8L );
+ ImplDrawBitmap( hPS, mnHeight, aPosAry, rSalBitmap, FALSE, 0x00B8L );
Ft2SetAttrs( hPS, PRIM_IMAGE, IBB_COLOR | IBB_BACK_COLOR, 0, &aOldBundle );
Ft2SetAttrs( hPS, PRIM_AREA, ABB_COLOR | ABB_BACK_COLOR | ABB_SYMBOL |
Modified: openoffice/branches/l10n/main/vcl/source/app/settings.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/app/settings.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/app/settings.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/app/settings.cxx Sun Feb 3 13:23:59 2013
@@ -1167,7 +1167,7 @@ sal_Bool MiscSettings::GetEnableATToolSu
HKEY hkey;
if( ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER,
- "Software\\OpenOffice.org\\Accessibility\\AtToolSupport",
+ "Software\\Aapche OpenOffice\\Accessibility\\AtToolSupport",
&hkey) )
{
DWORD dwType;
@@ -1245,7 +1245,7 @@ void MiscSettings::SetEnableATToolSuppor
// If the accessibility key in the Windows registry exists, change it synchronously
if( ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER,
- "Software\\OpenOffice.org\\Accessibility\\AtToolSupport",
+ "Software\\Apache OpenOffice\\Accessibility\\AtToolSupport",
&hkey) )
{
DWORD dwType;
Modified: openoffice/branches/l10n/main/vcl/source/app/svdata.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/app/svdata.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/app/svdata.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/app/svdata.cxx Sun Feb 3 13:23:59 2013
@@ -570,7 +570,7 @@ bool ImplInitAccessBridge(sal_Bool bAllo
// -----------------------------------------------------------------------
-Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos )
+Window* ImplFindWindow( const SalFrame* pFrame, ::Point& rSalFramePos )
{
ImplSVData* pSVData = ImplGetSVData();
Window* pFrameWindow = pSVData->maWinData.mpFirstFrame;
Modified: openoffice/branches/l10n/main/vcl/source/control/imgctrl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/control/imgctrl.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/control/imgctrl.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/control/imgctrl.cxx Sun Feb 3 13:23:59 2013
@@ -36,7 +36,7 @@ namespace ImageScaleMode = ::com::sun::s
ImageControl::ImageControl( Window* pParent, WinBits nStyle )
:FixedImage( pParent, nStyle )
- ,mnScaleMode( ImageScaleMode::Anisotropic )
+ ,mnScaleMode( ImageScaleMode::ANISOTROPIC )
{
}
@@ -44,7 +44,7 @@ ImageControl::ImageControl( Window* pPar
ImageControl::ImageControl( Window* pParent, const ResId& rResId )
:FixedImage( pParent, rResId )
- ,mnScaleMode( ImageScaleMode::Anisotropic )
+ ,mnScaleMode( ImageScaleMode::ANISOTROPIC )
{
}
@@ -128,13 +128,13 @@ void ImageControl::ImplDraw( OutputDevic
switch ( mnScaleMode )
{
- case ImageScaleMode::None:
+ case ImageScaleMode::NONE:
{
rDev.DrawImage( lcl_centerWithin( aDrawRect, rBitmapSize ), *pImage, nStyle );
}
break;
- case ImageScaleMode::Isotropic:
+ case ImageScaleMode::ISOTROPIC:
{
const Size aPaintSize = lcl_calcPaintSize( aDrawRect, rBitmapSize );
rDev.DrawImage(
@@ -144,7 +144,7 @@ void ImageControl::ImplDraw( OutputDevic
}
break;
- case ImageScaleMode::Anisotropic:
+ case ImageScaleMode::ANISOTROPIC:
{
rDev.DrawImage(
aDrawRect.TopLeft(),
Modified: openoffice/branches/l10n/main/vcl/source/control/throbber.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/control/throbber.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/control/throbber.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/control/throbber.cxx Sun Feb 3 13:23:59 2013
@@ -59,7 +59,7 @@ Throbber::Throbber( Window* i_parentWind
maWaitTimer.SetTimeout( mnStepTime );
maWaitTimer.SetTimeoutHdl( LINK( this, Throbber, TimeOutHdl ) );
- SetScaleMode( ImageScaleMode::None );
+ SetScaleMode( ImageScaleMode::NONE );
initImages();
}
@@ -75,7 +75,7 @@ Throbber::Throbber( Window* i_parentWind
maWaitTimer.SetTimeout( mnStepTime );
maWaitTimer.SetTimeoutHdl( LINK( this, Throbber, TimeOutHdl ) );
- SetScaleMode( ImageScaleMode::None );
+ SetScaleMode( ImageScaleMode::NONE );
initImages();
}
Modified: openoffice/branches/l10n/main/vcl/source/gdi/alpha.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/alpha.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/alpha.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/alpha.cxx Sun Feb 3 13:23:59 2013
@@ -282,7 +282,7 @@ sal_Bool AlphaMask::Mirror( sal_uLong nM
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
+sal_Bool AlphaMask::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag )
{
sal_Bool bRet = Bitmap::Scale( rNewSize, nScaleFlag );
@@ -294,7 +294,7 @@ sal_Bool AlphaMask::Scale( const Size& r
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
+sal_Bool AlphaMask::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
{
sal_Bool bRet = Bitmap::Scale( rScaleX, rScaleY, nScaleFlag );
Modified: openoffice/branches/l10n/main/vcl/source/gdi/animate.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/animate.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/animate.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/animate.cxx Sun Feb 3 13:23:59 2013
@@ -32,6 +32,8 @@
#include <vcl/virdev.hxx>
#include <vcl/window.hxx>
#include <impanmvw.hxx>
+#include <vcl/dibtools.hxx>
+
DBG_NAME( Animation )
// -----------
@@ -830,9 +832,9 @@ SvStream& operator<<( SvStream& rOStm, c
// Falls keine BitmapEx gesetzt wurde, schreiben wir
// einfach die erste Bitmap der Animation
if( !rAnimation.GetBitmapEx().GetBitmap() )
- rOStm << rAnimation.Get( 0 ).aBmpEx;
+ WriteDIBBitmapEx(rAnimation.Get( 0 ).aBmpEx, rOStm);
else
- rOStm << rAnimation.GetBitmapEx();
+ WriteDIBBitmapEx(rAnimation.GetBitmapEx(), rOStm);
// Kennung schreiben ( SDANIMA1 )
rOStm << (sal_uInt32) 0x5344414e << (sal_uInt32) 0x494d4931;
@@ -843,7 +845,7 @@ SvStream& operator<<( SvStream& rOStm, c
const sal_uInt16 nRest = nCount - i - 1;
// AnimationBitmap schreiben
- rOStm << rAnimBmp.aBmpEx;
+ WriteDIBBitmapEx(rAnimBmp.aBmpEx, rOStm);
rOStm << rAnimBmp.aPosPix;
rOStm << rAnimBmp.aSizePix;
rOStm << rAnimation.maGlobalSize;
@@ -886,7 +888,7 @@ SvStream& operator>>( SvStream& rIStm, A
else
{
rIStm.Seek( nStmPos );
- rIStm >> rAnimation.maBitmapEx;
+ ReadDIBBitmapEx(rAnimation.maBitmapEx, rIStm);
nStmPos = rIStm.Tell();
rIStm >> nAnimMagic1 >> nAnimMagic2;
@@ -908,7 +910,7 @@ SvStream& operator>>( SvStream& rIStm, A
do
{
- rIStm >> aAnimBmp.aBmpEx;
+ ReadDIBBitmapEx(aAnimBmp.aBmpEx, rIStm);
rIStm >> aAnimBmp.aPosPix;
rIStm >> aAnimBmp.aSizePix;
rIStm >> rAnimation.maGlobalSize;
Modified: openoffice/branches/l10n/main/vcl/source/gdi/bitmap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/bitmap.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/bitmap.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/bitmap.cxx Sun Feb 3 13:23:59 2013
@@ -289,9 +289,12 @@ Size Bitmap::GetSizePixel() const
}
// ------------------------------------------------------------------
-void Bitmap::SetSizePixel( const Size& rNewSize )
+void Bitmap::SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag )
{
- Scale( rNewSize );
+ if(GetSizePixel() != rNewSize)
+ {
+ Scale( rNewSize, nScaleFlag );
+ }
}
// ------------------------------------------------------------------
Modified: openoffice/branches/l10n/main/vcl/source/gdi/bitmap3.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/bitmap3.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/bitmap3.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/bitmap3.cxx Sun Feb 3 13:23:59 2013
@@ -904,9 +904,19 @@ sal_Bool Bitmap::ImplConvertGhosted()
// ------------------------------------------------------------------------
-sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
+sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
{
- bool bRetval(false);
+ if(basegfx::fTools::equalZero(rScaleX) || basegfx::fTools::equalZero(rScaleY))
+ {
+ // no scale
+ return true;
+ }
+
+ if(basegfx::fTools::equal(rScaleX, 1.0) && basegfx::fTools::equal(rScaleY, 1.0))
+ {
+ // no scale
+ return true;
+ }
#ifdef DBG_UTIL
// #121233# allow to test the different scalers in debug build with source
@@ -929,84 +939,78 @@ sal_Bool Bitmap::Scale( const double& rS
}
#endif // DBG_UTIL
- if(basegfx::fTools::equalZero(rScaleX) && basegfx::fTools::equalZero(rScaleY))
+ bool bRetval(false);
+
+ if(BMP_SCALE_BESTQUALITY == nScaleFlag)
{
- // no scale
- bRetval = true;
+ // Use LANCZOS when best quality is requested
+ nScaleFlag = BMP_SCALE_LANCZOS;
+ }
+ else if(BMP_SCALE_FASTESTINTERPOLATE == nScaleFlag)
+ {
+ // Use BMP_SCALE_SUPER when speed is requested, but not worst quality
+ nScaleFlag = BMP_SCALE_SUPER;
}
- else
+
+ switch(nScaleFlag)
{
- if(BMP_SCALE_BESTQUALITY == nScaleFlag)
+ default:
+ case BMP_SCALE_NONE :
{
- // Use LANCZOS when best quality is requested
- nScaleFlag = BMP_SCALE_LANCZOS;
+ bRetval = false;
+ break;
}
- else if(BMP_SCALE_FASTESTINTERPOLATE == nScaleFlag)
+ case BMP_SCALE_FAST :
{
- // Use BMP_SCALE_SUPER when speed is requested, but not worst quality
- nScaleFlag = BMP_SCALE_SUPER;
+ bRetval = ImplScaleFast( rScaleX, rScaleY );
+ break;
}
-
- switch(nScaleFlag)
+ case BMP_SCALE_INTERPOLATE :
{
- default:
- case BMP_SCALE_NONE :
- {
- bRetval = false;
- break;
- }
- case BMP_SCALE_FAST :
+ bRetval = ImplScaleInterpolate( rScaleX, rScaleY );
+ break;
+ }
+ case BMP_SCALE_SUPER :
+ {
+ if(GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2)
{
+ // fallback to ImplScaleFast
bRetval = ImplScaleFast( rScaleX, rScaleY );
- break;
}
- case BMP_SCALE_INTERPOLATE :
+ else
{
- bRetval = ImplScaleInterpolate( rScaleX, rScaleY );
- break;
+ // #121233# use method from symphony
+ bRetval = ImplScaleSuper( rScaleX, rScaleY );
}
- case BMP_SCALE_SUPER :
- {
- if(GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2)
- {
- // fallback to ImplScaleFast
- bRetval = ImplScaleFast( rScaleX, rScaleY );
- }
- else
- {
- // #121233# use method from symphony
- bRetval = ImplScaleSuper( rScaleX, rScaleY );
- }
- break;
- }
- case BMP_SCALE_LANCZOS :
- {
- const Lanczos3Kernel kernel;
+ break;
+ }
+ case BMP_SCALE_LANCZOS :
+ {
+ const Lanczos3Kernel kernel;
- bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel);
- break;
- }
- case BMP_SCALE_BICUBIC :
- {
- const BicubicKernel kernel;
+ bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel);
+ break;
+ }
+ case BMP_SCALE_BICUBIC :
+ {
+ const BicubicKernel kernel;
- bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
- break;
- }
- case BMP_SCALE_BILINEAR :
- {
- const BilinearKernel kernel;
+ bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ break;
+ }
+ case BMP_SCALE_BILINEAR :
+ {
+ const BilinearKernel kernel;
- bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
- break;
- }
- case BMP_SCALE_BOX :
- {
- const BoxKernel kernel;
+ bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ break;
+ }
+ case BMP_SCALE_BOX :
+ {
+ const BoxKernel kernel;
- bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
- break;
- }
+ bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ break;
}
}
@@ -1022,7 +1026,7 @@ sal_Bool Bitmap::Scale( const double& rS
// ------------------------------------------------------------------------
-sal_Bool Bitmap::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
+sal_Bool Bitmap::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag )
{
const Size aSize( GetSizePixel() );
sal_Bool bRet;
@@ -2481,29 +2485,42 @@ sal_Bool Bitmap::ImplScaleConvolution(
{
const sal_uInt32 nInBetweenSizeHorFirst(nHeight * nNewWidth);
const sal_uInt32 nInBetweenSizeVerFirst(nNewHeight * nWidth);
+ Bitmap aSource(*this);
if(nInBetweenSizeHorFirst < nInBetweenSizeVerFirst)
{
if(bScaleHor)
{
- bResult = ImplScaleConvolutionHor(*this, aResult, fScaleX, aKernel);
+ bResult = ImplScaleConvolutionHor(aSource, aResult, fScaleX, aKernel);
}
if(bResult && bScaleVer)
{
- bResult = ImplScaleConvolutionVer(*this, aResult, fScaleY, aKernel);
+ if(bScaleHor)
+ {
+ // copy partial result, independent of color depth
+ aSource = aResult;
+ }
+
+ bResult = ImplScaleConvolutionVer(aSource, aResult, fScaleY, aKernel);
}
}
else
{
if(bScaleVer)
{
- bResult = ImplScaleConvolutionVer(*this, aResult, fScaleY, aKernel);
+ bResult = ImplScaleConvolutionVer(aSource, aResult, fScaleY, aKernel);
}
if(bResult && bScaleHor)
{
- bResult = ImplScaleConvolutionHor(*this, aResult, fScaleX, aKernel);
+ if(bScaleVer)
+ {
+ // copy partial result, independent of color depth
+ aSource = aResult;
+ }
+
+ bResult = ImplScaleConvolutionHor(aSource, aResult, fScaleX, aKernel);
}
}
}
Modified: openoffice/branches/l10n/main/vcl/source/gdi/bitmapex.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/bitmapex.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/bitmapex.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/bitmapex.cxx Sun Feb 3 13:23:59 2013
@@ -19,19 +19,14 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
#include <ctype.h>
-
#include <rtl/crc.h>
-
#include <tools/stream.hxx>
#include <tools/debug.hxx>
#include <tools/rc.h>
-
#include <vcl/salbtype.hxx>
#include <vcl/outdev.hxx>
#include <vcl/alpha.hxx>
@@ -39,9 +34,10 @@
#include <vcl/pngread.hxx>
#include <vcl/svapp.hxx>
#include <vcl/bmpacc.hxx>
-
+#include <vcl/dibtools.hxx>
#include <image.h>
#include <impimagetree.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
// ------------
// - BitmapEx -
@@ -393,9 +389,12 @@ sal_uLong BitmapEx::GetChecksum() const
// ------------------------------------------------------------------
-void BitmapEx::SetSizePixel( const Size& rNewSize )
+void BitmapEx::SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag )
{
- Scale( rNewSize );
+ if(GetSizePixel() != rNewSize)
+ {
+ Scale( rNewSize, nScaleFlag );
+ }
}
// ------------------------------------------------------------------
@@ -434,7 +433,7 @@ sal_Bool BitmapEx::Mirror( sal_uLong nMi
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
+sal_Bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
{
sal_Bool bRet = sal_False;
@@ -458,7 +457,7 @@ sal_Bool BitmapEx::Scale( const double&
// ------------------------------------------------------------------------
-sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
+sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag )
{
sal_Bool bRet;
@@ -836,84 +835,370 @@ sal_uInt8 BitmapEx::GetTransparency(sal_
// ------------------------------------------------------------------
-SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx )
+namespace
{
- rBitmapEx.aBitmap.Write( rOStm );
+ void impSmoothPoint(BitmapColor& rValue, const basegfx::B2DPoint& rSource, sal_Int32 nIntX, sal_Int32 nIntY, BitmapReadAccess& rRead)
+ {
+ double fDeltaX(rSource.getX() - nIntX);
+ double fDeltaY(rSource.getY() - nIntY);
+ sal_Int32 nIndX(0L);
+ sal_Int32 nIndY(0L);
+
+ if(fDeltaX > 0.0 && nIntX + 1L < rRead.Width())
+ {
+ nIndX++;
+ }
+ else if(fDeltaX < 0.0 && nIntX >= 1L)
+ {
+ fDeltaX = -fDeltaX;
+ nIndX--;
+ }
+
+ if(fDeltaY > 0.0 && nIntY + 1L < rRead.Height())
+ {
+ nIndY++;
+ }
+ else if(fDeltaY < 0.0 && nIntY >= 1L)
+ {
+ fDeltaY = -fDeltaY;
+ nIndY--;
+ }
+
+ if(nIndX || nIndY)
+ {
+ const double fColorToReal(1.0 / 255.0);
+ double fR(rValue.GetRed() * fColorToReal);
+ double fG(rValue.GetGreen() * fColorToReal);
+ double fB(rValue.GetBlue() * fColorToReal);
+ double fRBottom(0.0), fGBottom(0.0), fBBottom(0.0);
+
+ if(nIndX)
+ {
+ const double fMulA(fDeltaX * fColorToReal);
+ double fMulB(1.0 - fDeltaX);
+ const BitmapColor aTopPartner(rRead.GetColor(nIntY, nIntX + nIndX));
+
+ fR = (fR * fMulB) + (aTopPartner.GetRed() * fMulA);
+ fG = (fG * fMulB) + (aTopPartner.GetGreen() * fMulA);
+ fB = (fB * fMulB) + (aTopPartner.GetBlue() * fMulA);
+
+ if(nIndY)
+ {
+ fMulB *= fColorToReal;
+ const BitmapColor aBottom(rRead.GetColor(nIntY + nIndY, nIntX));
+ const BitmapColor aBottomPartner(rRead.GetColor(nIntY + nIndY, nIntX + nIndX));
+
+ fRBottom = (aBottom.GetRed() * fMulB) + (aBottomPartner.GetRed() * fMulA);
+ fGBottom = (aBottom.GetGreen() * fMulB) + (aBottomPartner.GetGreen() * fMulA);
+ fBBottom = (aBottom.GetBlue() * fMulB) + (aBottomPartner.GetBlue() * fMulA);
+ }
+ }
+
+ if(nIndY)
+ {
+ if(!nIndX)
+ {
+ const BitmapColor aBottom(rRead.GetColor(nIntY + nIndY, nIntX));
+
+ fRBottom = aBottom.GetRed() * fColorToReal;
+ fGBottom = aBottom.GetGreen() * fColorToReal;
+ fBBottom = aBottom.GetBlue() * fColorToReal;
+ }
+
+ const double fMulB(1.0 - fDeltaY);
+
+ fR = (fR * fMulB) + (fRBottom * fDeltaY);
+ fG = (fG * fMulB) + (fGBottom * fDeltaY);
+ fB = (fB * fMulB) + (fBBottom * fDeltaY);
+ }
+
+ rValue.SetRed((sal_uInt8)(fR * 255.0));
+ rValue.SetGreen((sal_uInt8)(fG * 255.0));
+ rValue.SetBlue((sal_uInt8)(fB * 255.0));
+ }
+ }
+
+ Bitmap impTransformBitmap(
+ const Bitmap& rSource,
+ const Size aDestinationSize,
+ const basegfx::B2DHomMatrix& rTransform,
+ bool bSmooth)
+ {
+ Bitmap aDestination(aDestinationSize, 24);
+ BitmapWriteAccess* pWrite = aDestination.AcquireWriteAccess();
+
+ if(pWrite)
+ {
+ const Size aContentSizePixel(rSource.GetSizePixel());
+ BitmapReadAccess* pRead = (const_cast< Bitmap& >(rSource)).AcquireReadAccess();
- rOStm << (sal_uInt32) 0x25091962;
- rOStm << (sal_uInt32) 0xACB20201;
- rOStm << (sal_uInt8) rBitmapEx.eTransparent;
+ if(pRead)
+ {
+ const Size aDestinationSizePixel(aDestination.GetSizePixel());
+ bool bWorkWithIndex(rSource.GetBitCount() <= 8);
+ BitmapColor aOutside(BitmapColor(0xff, 0xff, 0xff));
+
+ for(sal_Int32 y(0L); y < aDestinationSizePixel.getHeight(); y++)
+ {
+ for(sal_Int32 x(0L); x < aDestinationSizePixel.getWidth(); x++)
+ {
+ const basegfx::B2DPoint aSourceCoor(rTransform * basegfx::B2DPoint(x, y));
+ const sal_Int32 nIntX(basegfx::fround(aSourceCoor.getX()));
- if( rBitmapEx.eTransparent == TRANSPARENT_BITMAP )
- rBitmapEx.aMask.Write( rOStm );
- else if( rBitmapEx.eTransparent == TRANSPARENT_COLOR )
- rOStm << rBitmapEx.aTransparentColor;
+ if(nIntX >= 0L && nIntX < aContentSizePixel.getWidth())
+ {
+ const sal_Int32 nIntY(basegfx::fround(aSourceCoor.getY()));
+
+ if(nIntY >= 0L && nIntY < aContentSizePixel.getHeight())
+ {
+ // inside pixel
+ BitmapColor aValue;
- return rOStm;
+ if(bWorkWithIndex)
+ {
+ aValue = pRead->GetPaletteColor(pRead->GetPixelIndex(nIntY, nIntX));
+ }
+ else
+ {
+ aValue = pRead->GetPixel(nIntY, nIntX);
+ }
+
+ if(bSmooth)
+ {
+ impSmoothPoint(aValue, aSourceCoor, nIntX, nIntY, *pRead);
+ }
+
+ pWrite->SetPixel(y, x, aValue);
+ continue;
+ }
+ }
+
+ // here are outside pixels. Complete mask
+ if(bWorkWithIndex)
+ {
+ pWrite->SetPixel(y, x, aOutside);
+ }
+ }
+ }
+
+ delete pRead;
+ }
+
+ delete pWrite;
+ }
+
+ rSource.AdaptBitCount(aDestination);
+
+ return aDestination;
+ }
+} // end of anonymous namespace
+BitmapEx BitmapEx::TransformBitmapEx(
+ double fWidth,
+ double fHeight,
+ const basegfx::B2DHomMatrix& rTransformation) const
+{
+ if(fWidth <= 1 || fHeight <= 1)
+ return BitmapEx();
+
+ // force destination to 24 bit, we want to smooth output
+ const Size aDestinationSize(basegfx::fround(fWidth), basegfx::fround(fHeight));
+ static bool bDoSmoothAtAll(true);
+ const Bitmap aDestination(impTransformBitmap(GetBitmap(), aDestinationSize, rTransformation, bDoSmoothAtAll));
+
+ // create mask
+ if(IsTransparent())
+ {
+ if(IsAlpha())
+ {
+ const Bitmap aAlpha(impTransformBitmap(GetAlpha().GetBitmap(), aDestinationSize, rTransformation, bDoSmoothAtAll));
+ return BitmapEx(aDestination, AlphaMask(aAlpha));
+ }
+ else
+ {
+ const Bitmap aMask(impTransformBitmap(GetMask(), aDestinationSize, rTransformation, false));
+ return BitmapEx(aDestination, aMask);
+ }
+ }
+
+ return BitmapEx(aDestination);
}
// ------------------------------------------------------------------
-SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
+BitmapEx BitmapEx::getTransformed(
+ const basegfx::B2DHomMatrix& rTransformation,
+ double fMaximumArea) const
{
- Bitmap aBmp;
+ BitmapEx aRetval;
- rIStm >> aBmp;
+ if(IsEmpty())
+ return aRetval;
- if( !rIStm.GetError() )
- {
- const sal_uLong nStmPos = rIStm.Tell();
- sal_uInt32 nMagic1 = 0;
- sal_uInt32 nMagic2 = 0;
+ const sal_uInt32 nSourceWidth(GetSizePixel().Width());
+ const sal_uInt32 nSourceHeight(GetSizePixel().Height());
- rIStm >> nMagic1 >> nMagic2;
+ if(!nSourceWidth || !nSourceHeight)
+ return aRetval;
- if( ( nMagic1 != 0x25091962 ) || ( nMagic2 != 0xACB20201 ) || rIStm.GetError() )
- {
- rIStm.ResetError();
- rIStm.Seek( nStmPos );
- rBitmapEx = aBmp;
- }
- else
- {
- sal_uInt8 bTransparent = false;
+ // Get dest range
+ basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
+ aOutlineRange.transform(rTransformation);
- rIStm >> bTransparent;
+ // get target size
+ double fWidth(aOutlineRange.getWidth());
+ double fHeight(aOutlineRange.getHeight());
- if( bTransparent == (sal_uInt8) TRANSPARENT_BITMAP )
- {
- Bitmap aMask;
+ if(fWidth < 1.0 || fHeight < 1.0)
+ return aRetval;
+
+ // test if discrete size (pixel) maybe too big and limit it
+ const double fArea(fWidth * fHeight);
+ const bool bNeedToReduce(fArea > fMaximumArea);
+ double fReduceFactor(1.0);
- rIStm >> aMask;
+ if(bNeedToReduce)
+ {
+ fReduceFactor = sqrt(fMaximumArea / fArea);
+ fWidth *= fReduceFactor;
+ fHeight *= fReduceFactor;
+ }
- if( !!aMask)
+ // Build complete transform from source pixels to target pixels.
+ // Start by scaling from source pixel size to unit coordinates
+ basegfx::B2DHomMatrix aTransform(
+ basegfx::tools::createScaleB2DHomMatrix(
+ 1.0 / nSourceWidth,
+ 1.0 / nSourceHeight));
+
+ // multiply with given transform which leads from unit coordinates inside
+ // aOutlineRange
+ aTransform = rTransformation * aTransform;
+
+ // substract top-left of aOutlineRange
+ aTransform.translate(-aOutlineRange.getMinX(), -aOutlineRange.getMinY());
+
+ // scale to target pixels (if needed)
+ if(bNeedToReduce)
+ {
+ aTransform.scale(fReduceFactor, fReduceFactor);
+ }
+
+ // invert to get transformation from target pixel coordiates to source pixels
+ aTransform.invert();
+
+ // create bitmap using source, destination and linear back-transformation
+ aRetval = TransformBitmapEx(fWidth, fHeight, aTransform);
+
+ return aRetval;
+}
+
+// ------------------------------------------------------------------
+
+BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorModifierStack) const
+{
+ Bitmap aChangedBitmap(GetBitmap());
+ bool bDone(false);
+
+ for(sal_uInt32 a(rBColorModifierStack.count()); a && !bDone; )
+ {
+ const basegfx::BColorModifier& rModifier = rBColorModifierStack.getBColorModifier(--a);
+
+ switch(rModifier.getMode())
+ {
+ case basegfx::BCOLORMODIFYMODE_REPLACE :
+ {
+ // complete replace
+ if(IsTransparent())
{
- // do we have an alpha mask?
- if( ( 8 == aMask.GetBitCount() ) && aMask.HasGreyPalette() )
- {
- AlphaMask aAlpha;
+ // clear bitmap with dest color
+ if(aChangedBitmap.GetBitCount() <= 8)
+ {
+ // do NOT use erase; for e.g. 8bit Bitmaps, the nearest color to the given
+ // erase color is determined and used -> this may be different from what is
+ // wanted here. Better create a new bitmap with the needed color explicitely
+ BitmapReadAccess* pReadAccess = aChangedBitmap.AcquireReadAccess();
+ OSL_ENSURE(pReadAccess, "Got no Bitmap ReadAccess ?!?");
- // create alpha mask quickly (without greyscale conversion)
- aAlpha.ImplSetBitmap( aMask );
- rBitmapEx = BitmapEx( aBmp, aAlpha );
- }
- else
- rBitmapEx = BitmapEx( aBmp, aMask );
+ if(pReadAccess)
+ {
+ BitmapPalette aNewPalette(pReadAccess->GetPalette());
+ aNewPalette[0] = BitmapColor(Color(rModifier.getBColor()));
+ aChangedBitmap = Bitmap(
+ aChangedBitmap.GetSizePixel(),
+ aChangedBitmap.GetBitCount(),
+ &aNewPalette);
+ delete pReadAccess;
+ }
+ }
+ else
+ {
+ aChangedBitmap.Erase(Color(rModifier.getBColor()));
+ }
}
else
- rBitmapEx = aBmp;
+ {
+ // erase bitmap, caller will know to paint direct
+ aChangedBitmap.SetEmpty();
+ }
+
+ bDone = true;
+ break;
}
- else if( bTransparent == (sal_uInt8) TRANSPARENT_COLOR )
+
+ default : // BCOLORMODIFYMODE_INTERPOLATE, BCOLORMODIFYMODE_GRAY, BCOLORMODIFYMODE_BLACKANDWHITE
{
- Color aTransparentColor;
+ BitmapWriteAccess* pContent = aChangedBitmap.AcquireWriteAccess();
+
+ if(pContent)
+ {
+ const double fConvertColor(1.0 / 255.0);
+
+ for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++)
+ {
+ for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++)
+ {
+ const BitmapColor aBMCol(pContent->GetColor(y, x));
+ const basegfx::BColor aBSource(
+ (double)aBMCol.GetRed() * fConvertColor,
+ (double)aBMCol.GetGreen() * fConvertColor,
+ (double)aBMCol.GetBlue() * fConvertColor);
+ const basegfx::BColor aBDest(rModifier.getModifiedColor(aBSource));
+
+ pContent->SetPixel(y, x, BitmapColor(Color(aBDest)));
+ }
+ }
- rIStm >> aTransparentColor;
- rBitmapEx = BitmapEx( aBmp, aTransparentColor );
+ delete pContent;
+ }
+
+ break;
}
- else
- rBitmapEx = aBmp;
}
}
- return rIStm;
+ if(aChangedBitmap.IsEmpty())
+ {
+ return BitmapEx();
+ }
+ else
+ {
+ if(IsTransparent())
+ {
+ if(IsAlpha())
+ {
+ return BitmapEx(aChangedBitmap, GetAlpha());
+ }
+ else
+ {
+ return BitmapEx(aChangedBitmap, GetMask());
+ }
+ }
+ else
+ {
+ return BitmapEx(aChangedBitmap);
+ }
+ }
}
+
+// ------------------------------------------------------------------
+// eof
Modified: openoffice/branches/l10n/main/vcl/source/gdi/bmpacc2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/bmpacc2.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/bmpacc2.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/bmpacc2.cxx Sun Feb 3 13:23:59 2013
@@ -315,7 +315,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _32BIT_TC_R
IMPL_FORMAT_GETPIXEL( _32BIT_TC_MASK )
{
BitmapColor aColor;
- rMask.GetColorFor32Bit( aColor, pScanline + ( nX << 2UL ) );
+ rMask.GetColorFor32Bit( aColor, pScanline + ( nX << 2UL ) );
return aColor;
}
Modified: openoffice/branches/l10n/main/vcl/source/gdi/bmpconv.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/bmpconv.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/bmpconv.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/bmpconv.cxx Sun Feb 3 13:23:59 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -32,7 +30,7 @@
#include "com/sun/star/script/XInvocation.hpp"
#include "com/sun/star/awt/XBitmap.hpp"
#include "cppuhelper/compbase1.hxx"
-
+#include <vcl/dibtools.hxx>
using namespace com::sun::star::uno;
using namespace com::sun::star::script;
@@ -149,7 +147,9 @@ Any SAL_CALL BmpConverter::invoke(
SvMemoryStream aStream( aDIB.getArray(), aDIB.getLength(), STREAM_READ | STREAM_WRITE );
Bitmap aBM;
- aBM.Read( aStream, sal_True );
+
+ ReadDIB(aBM, aStream, true);
+
if( nTargetDepth < 4 )
nTargetDepth = 1;
else if( nTargetDepth < 8 )
@@ -183,8 +183,11 @@ BmpTransporter::BmpTransporter( const Bi
{
m_aSize.Width = rBM.GetSizePixel().Width();
m_aSize.Height = rBM.GetSizePixel().Height();
+
SvMemoryStream aStream;
- rBM.Write( aStream, sal_False, sal_True );
+
+ WriteDIB(rBM, aStream, false, true);
+
m_aBM = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aStream.GetData()),
aStream.GetEndOfData());
}
Modified: openoffice/branches/l10n/main/vcl/source/gdi/cvtsvm.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/cvtsvm.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/cvtsvm.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/cvtsvm.cxx Sun Feb 3 13:23:59 2013
@@ -36,6 +36,7 @@
#include <vcl/lineinfo.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/cvtsvm.hxx>
+#include <vcl/dibtools.hxx>
// -----------
// - Defines -
@@ -983,7 +984,8 @@ void SVMConverter::ImplConvertFromSVM1(
{
Bitmap aBmp;
- rIStm >> aPt >> aBmp;
+ rIStm >> aPt;
+ ReadDIB(aBmp, rIStm, true);
rMtf.AddAction( new MetaBmpAction( aPt, aBmp ) );
}
break;
@@ -992,7 +994,8 @@ void SVMConverter::ImplConvertFromSVM1(
{
Bitmap aBmp;
- rIStm >> aPt >> aSz >> aBmp;
+ rIStm >> aPt >> aSz;
+ ReadDIB(aBmp, rIStm, true);
rMtf.AddAction( new MetaBmpScaleAction( aPt, aSz, aBmp ) );
}
break;
@@ -1002,7 +1005,8 @@ void SVMConverter::ImplConvertFromSVM1(
Bitmap aBmp;
Size aSz2;
- rIStm >> aPt >> aSz >> aPt1 >> aSz2 >> aBmp;
+ rIStm >> aPt >> aSz >> aPt1 >> aSz2;
+ ReadDIB(aBmp, rIStm, true);
rMtf.AddAction( new MetaBmpScalePartAction( aPt, aSz, aPt1, aSz2, aBmp ) );
}
break;
@@ -1827,7 +1831,7 @@ sal_uLong SVMConverter::ImplWriteActions
rOStm << (sal_Int16) GDI_BITMAP_ACTION;
rOStm << (sal_Int32) 12;
rOStm << pAct->GetPoint();
- rOStm << pAct->GetBitmap();
+ WriteDIB(pAct->GetBitmap(), rOStm, false, true);
nCount++;
}
break;
@@ -1840,7 +1844,7 @@ sal_uLong SVMConverter::ImplWriteActions
rOStm << (sal_Int32) 20;
rOStm << pAct->GetPoint();
rOStm << pAct->GetSize();
- rOStm << pAct->GetBitmap();
+ WriteDIB(pAct->GetBitmap(), rOStm, false, true);
nCount++;
}
break;
@@ -1855,7 +1859,7 @@ sal_uLong SVMConverter::ImplWriteActions
rOStm << pAct->GetDestSize();
rOStm << pAct->GetSrcPoint();
rOStm << pAct->GetSrcSize();
- rOStm << pAct->GetBitmap();
+ WriteDIB(pAct->GetBitmap(), rOStm, false, true);
nCount++;
}
break;
@@ -1868,7 +1872,7 @@ sal_uLong SVMConverter::ImplWriteActions
rOStm << (sal_Int16) GDI_BITMAP_ACTION;
rOStm << (sal_Int32) 12;
rOStm << pAct->GetPoint();
- rOStm << aBmp;
+ WriteDIB(aBmp, rOStm, false, true);
nCount++;
}
break;
@@ -1882,7 +1886,7 @@ sal_uLong SVMConverter::ImplWriteActions
rOStm << (sal_Int32) 20;
rOStm << pAct->GetPoint();
rOStm << pAct->GetSize();
- rOStm << aBmp;
+ WriteDIB(aBmp, rOStm, false, true);
nCount++;
}
break;
@@ -1898,7 +1902,7 @@ sal_uLong SVMConverter::ImplWriteActions
rOStm << pAct->GetDestSize();
rOStm << pAct->GetSrcPoint();
rOStm << pAct->GetSrcSize();
- rOStm << aBmp;
+ WriteDIB(aBmp, rOStm, false, true);
nCount++;
}
break;
Modified: openoffice/branches/l10n/main/vcl/source/gdi/impgraph.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/impgraph.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/impgraph.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/impgraph.cxx Sun Feb 3 13:23:59 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -40,6 +38,7 @@
#include <vcl/metaact.hxx>
#include <impgraph.hxx>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#include <vcl/dibtools.hxx>
// -----------
// - Defines -
@@ -1794,7 +1793,7 @@ SvStream& operator>>( SvStream& rIStm, I
rIStm.SeekRel( -4 );
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rIStm >> aBmpEx;
+ ReadDIBBitmapEx(aBmpEx, rIStm);
if( !rIStm.GetError() )
{
@@ -1937,7 +1936,7 @@ SvStream& operator<<( SvStream& rOStm, c
}
else
{
- rOStm << rImpGraphic.maEx;
+ WriteDIBBitmapEx(rImpGraphic.maEx, rOStm);
}
}
break;
Modified: openoffice/branches/l10n/main/vcl/source/gdi/impimagetree.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/impimagetree.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/impimagetree.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/impimagetree.cxx Sun Feb 3 13:23:59 2013
@@ -19,18 +19,14 @@
*
*************************************************************/
-
-
#include "precompiled_vcl.hxx"
#include "sal/config.h"
-
#include <list>
#include <memory>
#include <utility>
#include <vector>
#include <hash_map>
-
#include "com/sun/star/container/XNameAccess.hpp"
#include "com/sun/star/io/XInputStream.hpp"
#include "com/sun/star/lang/Locale.hpp"
@@ -39,30 +35,24 @@
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/RuntimeException.hpp"
#include "com/sun/star/uno/Sequence.hxx"
-
#include "comphelper/processfactory.hxx"
-
#include "osl/file.hxx"
#include "osl/diagnose.h"
-
#include "rtl/bootstrap.hxx"
#include "rtl/string.h"
#include "rtl/textenc.h"
#include "rtl/ustrbuf.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
-
#include "sal/types.h"
-
#include "tools/stream.hxx"
#include "tools/urlobj.hxx"
-
#include "vcl/bitmapex.hxx"
#include "vcl/pngread.hxx"
#include "vcl/settings.hxx"
#include "vcl/svapp.hxx"
-
#include "impimagetree.hxx"
+#include <vcl/dibtools.hxx>
namespace {
@@ -109,8 +99,10 @@ void loadFromStream(
vcl::PNGReader aPNGReader( *s );
aPNGReader.SetIgnoreGammaChunk( sal_True );
bitmap = aPNGReader.Read();
- } else {
- *s >> bitmap;
+ }
+ else
+ {
+ ReadDIBBitmapEx(bitmap, *s);
}
}
Modified: openoffice/branches/l10n/main/vcl/source/gdi/metaact.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/vcl/source/gdi/metaact.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/vcl/source/gdi/metaact.cxx (original)
+++ openoffice/branches/l10n/main/vcl/source/gdi/metaact.cxx Sun Feb 3 13:23:59 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
@@ -34,8 +32,8 @@
#include <vcl/salbtype.hxx>
#include <vcl/metaact.hxx>
#include <vcl/graphictools.hxx>
-//#include <svgio/svgreader/svgreader.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <vcl/dibtools.hxx>
// ========================================================================
@@ -1832,7 +1830,8 @@ void MetaBmpAction::Write( SvStream& rOS
if( !!maBmp )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maBmp << maPt;
+ WriteDIB(maBmp, rOStm, false, true);
+ rOStm << maPt;
}
}
@@ -1841,7 +1840,8 @@ void MetaBmpAction::Write( SvStream& rOS
void MetaBmpAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maBmp >> maPt;
+ ReadDIB(maBmp, rIStm, true);
+ rIStm >> maPt;
}
// ========================================================================
@@ -1908,7 +1908,8 @@ void MetaBmpScaleAction::Write( SvStream
if( !!maBmp )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maBmp << maPt << maSz;
+ WriteDIB(maBmp, rOStm, false, true);
+ rOStm << maPt << maSz;
}
}
@@ -1917,7 +1918,8 @@ void MetaBmpScaleAction::Write( SvStream
void MetaBmpScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maBmp >> maPt >> maSz;
+ ReadDIB(maBmp, rIStm, true);
+ rIStm >> maPt >> maSz;
}
// ========================================================================
@@ -1989,7 +1991,8 @@ void MetaBmpScalePartAction::Write( SvSt
if( !!maBmp )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maBmp << maDstPt << maDstSz << maSrcPt << maSrcSz;
+ WriteDIB(maBmp, rOStm, false, true);
+ rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
}
}
@@ -1998,7 +2001,8 @@ void MetaBmpScalePartAction::Write( SvSt
void MetaBmpScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maBmp >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
+ ReadDIB(maBmp, rIStm, true);
+ rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
}
// ========================================================================
@@ -2059,7 +2063,8 @@ void MetaBmpExAction::Write( SvStream& r
if( !!maBmpEx.GetBitmap() )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maBmpEx << maPt;
+ WriteDIBBitmapEx(maBmpEx, rOStm);
+ rOStm << maPt;
}
}
@@ -2068,7 +2073,8 @@ void MetaBmpExAction::Write( SvStream& r
void MetaBmpExAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maBmpEx >> maPt;
+ ReadDIBBitmapEx(maBmpEx, rIStm);
+ rIStm >> maPt;
}
// ========================================================================
@@ -2135,7 +2141,8 @@ void MetaBmpExScaleAction::Write( SvStre
if( !!maBmpEx.GetBitmap() )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maBmpEx << maPt << maSz;
+ WriteDIBBitmapEx(maBmpEx, rOStm);
+ rOStm << maPt << maSz;
}
}
@@ -2144,7 +2151,8 @@ void MetaBmpExScaleAction::Write( SvStre
void MetaBmpExScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maBmpEx >> maPt >> maSz;
+ ReadDIBBitmapEx(maBmpEx, rIStm);
+ rIStm >> maPt >> maSz;
}
// ========================================================================
@@ -2216,7 +2224,8 @@ void MetaBmpExScalePartAction::Write( Sv
if( !!maBmpEx.GetBitmap() )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maBmpEx << maDstPt << maDstSz << maSrcPt << maSrcSz;
+ WriteDIBBitmapEx(maBmpEx, rOStm);
+ rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
}
}
@@ -2225,7 +2234,8 @@ void MetaBmpExScalePartAction::Write( Sv
void MetaBmpExScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maBmpEx >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
+ ReadDIBBitmapEx(maBmpEx, rIStm);
+ rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
}
// ========================================================================
@@ -2290,7 +2300,8 @@ void MetaMaskAction::Write( SvStream& rO
if( !!maBmp )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maBmp << maPt;
+ WriteDIB(maBmp, rOStm, false, true);
+ rOStm << maPt;
}
}
@@ -2299,7 +2310,8 @@ void MetaMaskAction::Write( SvStream& rO
void MetaMaskAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maBmp >> maPt;
+ ReadDIB(maBmp, rIStm, true);
+ rIStm >> maPt;
}
// ========================================================================
@@ -2369,7 +2381,8 @@ void MetaMaskScaleAction::Write( SvStrea
if( !!maBmp )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maBmp << maPt << maSz;
+ WriteDIB(maBmp, rOStm, false, true);
+ rOStm << maPt << maSz;
}
}
@@ -2378,7 +2391,8 @@ void MetaMaskScaleAction::Write( SvStrea
void MetaMaskScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maBmp >> maPt >> maSz;
+ ReadDIB(maBmp, rIStm, true);
+ rIStm >> maPt >> maSz;
}
// ========================================================================
@@ -2453,7 +2467,7 @@ void MetaMaskScalePartAction::Write( SvS
if( !!maBmp )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maBmp;
+ WriteDIB(maBmp, rOStm, false, true);
maColor.Write( rOStm, sal_True );
rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
}
@@ -2464,7 +2478,7 @@ void MetaMaskScalePartAction::Write( SvS
void MetaMaskScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maBmp;
+ ReadDIB(maBmp, rIStm, true);
maColor.Read( rIStm, sal_True );
rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
}