diff options
-rw-r--r-- | include/svtools/grfmgr.hxx | 44 | ||||
-rw-r--r-- | include/svx/svdpntv.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 2 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr.cxx | 14 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 22 | ||||
-rw-r--r-- | svx/source/svdraw/svdpntv.cxx | 2 | ||||
-rw-r--r-- | sw/inc/ndgrf.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 2 |
9 files changed, 53 insertions, 44 deletions
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx index f75db3dfb471..7527d804d120 100644 --- a/include/svtools/grfmgr.hxx +++ b/include/svtools/grfmgr.hxx @@ -22,13 +22,21 @@ #include <vcl/graph.hxx> #include <svtools/svtdllapi.h> +#include <o3tl/typed_flags_set.hxx> -#define GRFMGR_DRAW_CACHED 0x00000001UL -#define GRFMGR_DRAW_SMOOTHSCALE 0x00000002UL -#define GRFMGR_DRAW_USE_DRAWMODE_SETTINGS 0x00000004UL -#define GRFMGR_DRAW_SUBSTITUTE 0x00000008UL -#define GRFMGR_DRAW_NO_SUBSTITUTE 0x00000010UL -#define GRFMGR_DRAW_STANDARD (GRFMGR_DRAW_CACHED|GRFMGR_DRAW_SMOOTHSCALE) +enum class GraphicManagerDrawFlags +{ + CACHED = 0x01, + SMOOTHSCALE = 0x02, + USE_DRAWMODE_SETTINGS = 0x04, + SUBSTITUTE = 0x08, + NO_SUBSTITUTE = 0x10, + STANDARD = (CACHED|SMOOTHSCALE), +}; +namespace o3tl +{ + template<> struct typed_flags<GraphicManagerDrawFlags> : is_typed_flags<GraphicManagerDrawFlags, 0x1f> {}; +} // AutoSwap defines @@ -253,7 +261,7 @@ private: int nNumTilesY, const Size& rTileSizePixel, const GraphicAttr* pAttr, - sal_uLong nFlags + GraphicManagerDrawFlags nFlags ); /// internally called by ImplRenderTempTile() @@ -267,7 +275,7 @@ private: int nRemainderTilesY, const Size& rTileSizePixel, const GraphicAttr* pAttr, - sal_uLong nFlags, + GraphicManagerDrawFlags nFlags, ImplTileInfo& rTileInfo ); @@ -277,7 +285,7 @@ private: const Size& rSizePixel, const Size& rOffset, const GraphicAttr* pAttr, - sal_uLong nFlags, + GraphicManagerDrawFlags nFlags, int nTileCacheSize1D ); @@ -288,7 +296,7 @@ private: int nNumTilesY, const Size& rTileSize, const GraphicAttr* pAttr, - sal_uLong nFlags + GraphicManagerDrawFlags nFlags ); void SVT_DLLPRIVATE ImplTransformBitmap( @@ -348,7 +356,7 @@ public: const Point& rPt, const Size& rSz, const GraphicAttr* pAttr = NULL, - sal_uLong nFlags = GRFMGR_DRAW_STANDARD + GraphicManagerDrawFlags nFlags = GraphicManagerDrawFlags::STANDARD ) const; const Graphic& GetGraphic() const; @@ -426,7 +434,7 @@ public: const Point& rPt, const Size& rSz, const GraphicAttr* pAttr = NULL, - sal_uLong nFlags = GRFMGR_DRAW_STANDARD + GraphicManagerDrawFlags nFlags = GraphicManagerDrawFlags::STANDARD ); /** Draw the graphic repeatedly into the given output rectangle @@ -468,7 +476,7 @@ public: const Size& rSize, const Size& rOffset, const GraphicAttr* pAttr = NULL, - sal_uLong nFlags = GRFMGR_DRAW_STANDARD, + GraphicManagerDrawFlags nFlags = GraphicManagerDrawFlags::STANDARD, int nTileCacheSize1D=128 ); @@ -478,7 +486,7 @@ public: const Size& rSz, long nExtraData = 0L, const GraphicAttr* pAttr = NULL, - sal_uLong nFlags = GRFMGR_DRAW_STANDARD, + GraphicManagerDrawFlags nFlags = GraphicManagerDrawFlags::STANDARD, OutputDevice* pFirstFrameOutDev = NULL ); @@ -531,7 +539,7 @@ private: const Size& rSz, GraphicObject& rObj, const GraphicAttr& rAttr, - const sal_uLong nFlags, + const GraphicManagerDrawFlags nFlags, bool& rCached ); @@ -541,7 +549,7 @@ private: const Size& rSz, const BitmapEx& rBmpEx, const GraphicAttr& rAttr, - const sal_uLong nFlags, + const GraphicManagerDrawFlags nFlags, BitmapEx* pBmpEx = NULL ); static bool SVT_DLLPRIVATE ImplCreateOutput( @@ -550,7 +558,7 @@ private: const Size& rSz, const GDIMetaFile& rMtf, const GraphicAttr& rAttr, - const sal_uLong nFlags, + const GraphicManagerDrawFlags nFlags, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx ); @@ -632,7 +640,7 @@ public: const Size& rSz, GraphicObject& rObj, const GraphicAttr& rAttr, - const sal_uLong nFlags, + const GraphicManagerDrawFlags nFlags, bool& rCached ); }; diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index 2bde92fcb243..2540c44ff51f 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -53,6 +53,7 @@ class SfxStyleSheet; class SdrOle2Obj; class SdrModel; class SdrObject; +enum class GraphicManagerDrawFlags; #ifdef DBG_UTIL class SdrItemBrowser; @@ -161,7 +162,7 @@ protected: sal_uInt16 nMinMovPix; sal_uInt16 nHitTolLog; sal_uInt16 nMinMovLog; - sal_uIntPtr nGraphicManagerDrawMode; + GraphicManagerDrawFlags nGraphicManagerDrawMode; // hold an incarnation of Drawinglayer configuration options SvtOptionsDrawinglayer maDrawinglayerOpt; @@ -467,8 +468,8 @@ public: void MergeNotPersistDefaultAttr(SfxItemSet& rAttr, bool bOnlyHardAttr) const; // use this mode as mode to draw all internal GraphicManager objects with - sal_uIntPtr GetGraphicManagerDrawMode() const { return nGraphicManagerDrawMode; } - void SetGraphicManagerDrawMode( sal_uIntPtr nMode ) { nGraphicManagerDrawMode = nMode; } + GraphicManagerDrawFlags GetGraphicManagerDrawMode() const { return nGraphicManagerDrawMode; } + void SetGraphicManagerDrawMode( GraphicManagerDrawFlags nMode ) { nGraphicManagerDrawMode = nMode; } // SwapIn (z.B. von Grafiken) asynchron durchfuehren. Also nicht // beim Paint sofort nachladen, sondern dort das Nachladen anstossen. diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 9db4ecced79d..55bfb1d6b5a9 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1188,7 +1188,7 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, Out const double Abitmap( k1/k2 * aSize.Width()*aSize.Height() ); aObject.DrawTiled( pOut, rOrg, aGrfSize, Size(0,0), - NULL, GRFMGR_DRAW_STANDARD, + NULL, GraphicManagerDrawFlags::STANDARD, ::std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) ); } else diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 0ee4ff9bcdbf..2c2a72fd3d5b 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -487,11 +487,11 @@ void GraphicObject::GraphicManagerDestroyed() } bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GraphicAttr* pAttr, sal_uLong nFlags ) const + const GraphicAttr* pAttr, GraphicManagerDrawFlags nFlags ) const { bool bRet; - if( nFlags & GRFMGR_DRAW_CACHED ) + if( nFlags & GraphicManagerDrawFlags::CACHED ) { Point aPt( rPt ); Size aSz( rSz ); @@ -510,7 +510,7 @@ bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& } bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GraphicAttr* pAttr, sal_uLong nFlags ) + const GraphicAttr* pAttr, GraphicManagerDrawFlags nFlags ) { GraphicAttr aAttr( pAttr ? *pAttr : GetAttr() ); Point aPt( rPt ); @@ -523,7 +523,7 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, // #i29534# Provide output rects for PDF writer Rectangle aCropRect; - if( !( GRFMGR_DRAW_USE_DRAWMODE_SETTINGS & nFlags ) ) + if( !( GraphicManagerDrawFlags::USE_DRAWMODE_SETTINGS & nFlags ) ) pOut->SetDrawMode( nOldDrawMode & ( ~( DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ) ) ); // mirrored horizontically @@ -587,7 +587,7 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, } bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, - const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D ) + const Size& rOffset, const GraphicAttr* pAttr, GraphicManagerDrawFlags nFlags, int nTileCacheSize1D ) { if( pOut == NULL || rSize.Width() == 0 || rSize.Height() == 0 ) return false; @@ -609,7 +609,7 @@ bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const } bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, - long nExtraData, const GraphicAttr* pAttr, sal_uLong /*nFlags*/, + long nExtraData, const GraphicAttr* pAttr, GraphicManagerDrawFlags /*nFlags*/, OutputDevice* pFirstFrameOutDev ) { bool bRet = false; @@ -660,7 +660,7 @@ bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const bRet = true; } else - bRet = Draw( pOut, rPt, rSz, &aAttr, GRFMGR_DRAW_STANDARD ); + bRet = Draw( pOut, rPt, rSz, &aAttr, GraphicManagerDrawFlags::STANDARD ); } return bRet; diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index a8daae01f1b0..a77d26ffef05 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -89,7 +89,7 @@ bool GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt, bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, GraphicObject& rObj, const GraphicAttr& rAttr, - const sal_uLong nFlags, bool& rCached ) + const GraphicManagerDrawFlags nFlags, bool& rCached ) { Point aPt( rPt ); Size aSz( rSz ); @@ -102,9 +102,9 @@ bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& // create output and fill cache if( rObj.IsAnimated() || ( pOut->GetOutDevType() == OUTDEV_PRINTER ) || - ( !( nFlags & GRFMGR_DRAW_NO_SUBSTITUTE ) && - ( ( nFlags & GRFMGR_DRAW_SUBSTITUTE ) || - !( nFlags & GRFMGR_DRAW_CACHED ) || + ( !( nFlags & GraphicManagerDrawFlags::NO_SUBSTITUTE ) && + ( ( nFlags & GraphicManagerDrawFlags::SUBSTITUTE ) || + !( nFlags & GraphicManagerDrawFlags::CACHED ) || ( pOut->GetConnectMetaFile() && !pOut->IsOutputEnabled() ) ) ) ) { // simple output of transformed graphic @@ -243,7 +243,7 @@ void GraphicManager::ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj ) bool GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz, GraphicObject& rObj, const GraphicAttr& rAttr, - const sal_uLong nFlags, bool& rCached ) + const GraphicManagerDrawFlags nFlags, bool& rCached ) { const Graphic& rGraphic = rObj.GetGraphic(); bool bRet = false; @@ -870,7 +870,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice, const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx, const GraphicAttr& rAttributes, - const sal_uLong /*nFlags*/, BitmapEx* pBmpEx ) + const GraphicManagerDrawFlags /*nFlags*/, BitmapEx* pBmpEx ) { sal_uInt16 nRot10 = rAttributes.GetRotation() % 3600; @@ -1088,7 +1088,7 @@ static BitmapEx checkMetadataBitmap( const BitmapEx& rBmpEx, bool GraphicManager::ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GDIMetaFile& rMtf, const GraphicAttr& rAttr, - const sal_uLong /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx ) + const GraphicManagerDrawFlags /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx ) { const Size aNewSize( rMtf.GetPrefSize() ); @@ -1661,7 +1661,7 @@ struct ImplTileInfo bool GraphicObject::ImplRenderTempTile( VirtualDevice& rVDev, int nExponent, int nNumTilesX, int nNumTilesY, const Size& rTileSizePixel, - const GraphicAttr* pAttr, sal_uLong nFlags ) + const GraphicAttr* pAttr, GraphicManagerDrawFlags nFlags ) { if( nExponent <= 1 ) return false; @@ -1703,7 +1703,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent int nNumOrigTilesX, int nNumOrigTilesY, int nRemainderTilesX, int nRemainderTilesY, const Size& rTileSizePixel, const GraphicAttr* pAttr, - sal_uLong nFlags, ImplTileInfo& rTileInfo ) + GraphicManagerDrawFlags nFlags, ImplTileInfo& rTileInfo ) { // gets loaded with our tile bitmap GraphicObject aTmpGraphic; @@ -1876,7 +1876,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent } bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSizePixel, - const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D ) + const Size& rOffset, const GraphicAttr* pAttr, GraphicManagerDrawFlags nFlags, int nTileCacheSize1D ) { // how many tiles to generate per recursion step enum{ SubdivisionExponent=2 }; @@ -1985,7 +1985,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, int nNumTilesX, int nNumTilesY, - const Size& rTileSizePixel, const GraphicAttr* pAttr, sal_uLong nFlags ) + const Size& rTileSizePixel, const GraphicAttr* pAttr, GraphicManagerDrawFlags nFlags ) { Point aCurrPos( rPosPixel ); Size aTileSizeLogic( rOut.PixelToLogic( rTileSizePixel ) ); diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index d92b437a4210..aa96a6c58eff 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -190,7 +190,7 @@ void SdrPaintView::ImpClearVars() bRestoreColors=true; pDefaultStyleSheet=NULL; bSomeObjChgdFlag=false; - nGraphicManagerDrawMode = GRFMGR_DRAW_STANDARD; + nGraphicManagerDrawMode = GraphicManagerDrawFlags::STANDARD; aComeBackIdle.SetPriority(SchedulerPriority::REPAINT); aComeBackIdle.SetIdleHdl(LINK(this,SdrPaintView,ImpComeBackHdl)); diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx index daa18f604cb5..2ec771555ef3 100644 --- a/sw/inc/ndgrf.hxx +++ b/sw/inc/ndgrf.hxx @@ -131,7 +131,7 @@ public: void SetGraphic(const Graphic& rGraphic, const OUString& rLink); /// wrappers for non-const calls at GraphicObject - void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0, const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD, OutputDevice* pFirstFrameOutDev = NULL) { maGrfObj.StartAnimation(pOut, rPt, rSz, nExtraData, pAttr, nFlags, pFirstFrameOutDev); } + void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0, const GraphicAttr* pAttr = NULL, GraphicManagerDrawFlags nFlags = GraphicManagerDrawFlags::STANDARD, OutputDevice* pFirstFrameOutDev = NULL) { maGrfObj.StartAnimation(pOut, rPt, rSz, nExtraData, pAttr, nFlags, pFirstFrameOutDev); } void StopGraphicAnimation(OutputDevice* pOut = NULL, long nExtraData = 0) { maGrfObj.StopAnimation(pOut, nExtraData); } virtual Size GetTwipSize() const SAL_OVERRIDE; diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 483936614192..fc799f0f67de 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -935,7 +935,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons pGrfNd->StartGraphicAnimation(pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), sal_IntPtr(this), - 0, GRFMGR_DRAW_STANDARD, pVout ); + 0, GraphicManagerDrawFlags::STANDARD, pVout ); } else { diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 292730f1d91f..64713bdacd82 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2119,7 +2119,7 @@ void DrawGraphic( aAlignedPaintRect.SVRect(), aGrf.SSize(), Size( aPaintOffset.X(), aPaintOffset.Y() ), - NULL, GRFMGR_DRAW_STANDARD, + NULL, GraphicManagerDrawFlags::STANDARD, ::std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) ); } // reset clipping at output device |