diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-11 08:37:50 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-11 09:17:41 +0200 |
commit | fc9e78c78864cbfa67ddea646da4aa4677d99b0c (patch) | |
tree | b04d03aa08ef442f456202d31ff9d9b13e8a1f0a /sw | |
parent | 80244bff5f1fb5cad4638ed0b661f0c0f7776b07 (diff) |
sw,sc,sd,starmath: convert to vcl::RenderContext
Change-Id: I5d0a3b8ed1c49ba2806e0fa528d908da45afd58c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/viewsh.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/bastyp/swtypes.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/inc/drawfont.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/inc/notxtfrm.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 22 | ||||
-rw-r--r-- | sw/source/core/layout/virtoutp.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/inftxt.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/txtnode/swfont.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/view/vprint.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/chrdlg/drpcps.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/misc/outline.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/srcview.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewfunc.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewport.cxx | 2 |
17 files changed, 43 insertions, 42 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 714e9d2ee8f2..fb1f9c79eec4 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -81,6 +81,7 @@ class SwAccessibleMap; namespace vcl { + typedef OutputDevice RenderContext; class OldStylePrintAdaptor; } @@ -348,9 +349,9 @@ public: // 1. GetRefDev: Either the printer or the virtual device from the doc // 2. GetWin: Available if we not printing // 3. GetOut: Printer, Window or Virtual device - OutputDevice& GetRefDev() const; + vcl::RenderContext& GetRefDev() const; inline vcl::Window* GetWin() const { return mpWin; } - inline OutputDevice* GetOut() const { return mpOut; } + inline vcl::RenderContext* GetOut() const { return mpOut; } void SetWin(vcl::Window* win) { mpWin = win; } static inline bool IsLstEndAction() { return SwViewShell::mbLstAct; } diff --git a/sw/source/core/bastyp/swtypes.cxx b/sw/source/core/bastyp/swtypes.cxx index 6a4eea1c011b..35daca4d8a3b 100644 --- a/sw/source/core/bastyp/swtypes.cxx +++ b/sw/source/core/bastyp/swtypes.cxx @@ -78,7 +78,7 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwTableLineFmt ) IMPL_FIXEDMEMPOOL_NEWDEL( SwTableBoxFmt ) IMPL_FIXEDMEMPOOL_NEWDEL( _SwCursor_SavePos ) -Size GetGraphicSizeTwip( const Graphic& rGraphic, OutputDevice* pOutDev ) +Size GetGraphicSizeTwip( const Graphic& rGraphic, vcl::RenderContext* pOutDev ) { const MapMode aMapTwip( MAP_TWIP ); Size aSize( rGraphic.GetPrefSize() ); diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 60711a8fde3c..1485579ceace 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -177,7 +177,7 @@ void SetOutDev( SwViewShell *pSh, OutputDevice *pOut ) } static void lcl_ClearArea( const SwFrm &rFrm, - OutputDevice &rOut, const SwRect& rPtArea, + vcl::RenderContext &rOut, const SwRect& rPtArea, const SwRect &rGrfArea ) { SwRegionRects aRegion( rPtArea, 4 ); @@ -676,7 +676,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) } } -static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, OutputDevice* pOut ) +static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, vcl::RenderContext* pOut ) { if(!pOut) @@ -706,7 +706,7 @@ static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInAr } bool paintUsingPrimitivesHelper( - OutputDevice& rOutputDevice, + vcl::RenderContext& rOutputDevice, const drawinglayer::primitive2d::Primitive2DSequence& rSequence, const basegfx::B2DRange& rSourceRange, const basegfx::B2DRange& rTargetRange) @@ -753,7 +753,7 @@ bool paintUsingPrimitivesHelper( return false; } -void paintGraphicUsingPrimitivesHelper(OutputDevice & rOutputDevice, +void paintGraphicUsingPrimitivesHelper(vcl::RenderContext & rOutputDevice, GraphicObject const& rGrfObj, GraphicAttr const& rGraphicAttr, SwRect const& rAlignedGrfArea) { @@ -832,7 +832,7 @@ void paintGraphicUsingPrimitivesHelper(OutputDevice & rOutputDevice, @todo use aligned rectangle for drawing graphic. @todo pixel-align coordinations for drawing graphic. */ -void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const +void SwNoTxtFrm::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea ) const { SwViewShell* pShell = getRootFrm()->GetCurrShell(); diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx index a601ce4aa20c..7b7c57b17caf 100644 --- a/sw/source/core/inc/drawfont.hxx +++ b/sw/source/core/inc/drawfont.hxx @@ -35,6 +35,7 @@ class SwFont; namespace vcl { class Font; class TextLayoutCache; + typedef OutputDevice RenderContext; } class SwUnderlineFont; @@ -176,12 +177,12 @@ public: return pSh; } - OutputDevice& GetOut() const + vcl::RenderContext& GetOut() const { return *pOut; } - OutputDevice *GetpOut() const + vcl::RenderContext *GetpOut() const { return pOut; } diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx index b27642ba40a0..04a670897aaa 100644 --- a/sw/source/core/inc/notxtfrm.hxx +++ b/sw/source/core/inc/notxtfrm.hxx @@ -35,8 +35,7 @@ class SwNoTxtFrm: public SwCntntFrm void InitCtor(); void Format ( const SwBorderAttrs *pAttrs = 0 ) SAL_OVERRIDE; - void PaintCntnt ( OutputDevice*, const SwRect&, const SwRect& ) const; - void PaintPicture( OutputDevice*, const SwRect& ) const; + void PaintPicture( vcl::RenderContext*, const SwRect& ) const; virtual void DestroyImpl() SAL_OVERRIDE; virtual ~SwNoTxtFrm(); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index c6b660c4e0c6..93737e5b1254 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -333,7 +333,7 @@ bool isTableBoundariesEnabled() * For 'small' twip-to-pixel relations (less then 2:1) * values of <gProp.nSHalfPixelSzW> and <gProp.nSHalfPixelSzH> are set to ZERO */ -void SwCalcPixStatics( OutputDevice *pOut ) +void SwCalcPixStatics( vcl::RenderContext *pOut ) { // determine 'small' twip-to-pixel relation bool bSmallTwipToPxRelW = false; @@ -1247,7 +1247,7 @@ void SwAlignRect( SwRect &rRect, const SwViewShell *pSh ) return; } - const OutputDevice *pOut = gProp.bSFlyMetafile ? + const vcl::RenderContext *pOut = gProp.bSFlyMetafile ? gProp.pSFlyMetafileOut.get() : pSh->GetOut(); // Hold original rectangle in pixel @@ -1332,7 +1332,7 @@ void SwAlignRect( SwRect &rRect, const SwViewShell *pSh ) * If the x-/y-pixel positions are the same, the x-/y-pixel position of * the second twip point is adjusted by a given amount of pixels */ -static void lcl_CompPxPosAndAdjustPos( const OutputDevice& _rOut, +static void lcl_CompPxPosAndAdjustPos( const vcl::RenderContext& _rOut, const Point& _rRefPt, Point& _rCompPt, const bool _bChkXPos, @@ -1376,7 +1376,7 @@ static void lcl_CompPxPosAndAdjustPos( const OutputDevice& _rOut, * * NOTE: Call this method before each <GraphicObject.Draw(...)> */ -void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut ) +void SwAlignGrfRect( SwRect *pGrfRect, const vcl::RenderContext &rOut ) { Rectangle aPxRect = rOut.LogicToPixel( pGrfRect->SVRect() ); pGrfRect->Pos( rOut.PixelToLogic( aPxRect.TopLeft() ) ); @@ -1697,7 +1697,7 @@ static void lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage, } static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush, - OutputDevice* _pOut, + vcl::RenderContext* _pOut, const SwRect& _rAlignedPaintRect, const GraphicObject& _rGraphicObj, SwPaintProperties& properties) @@ -1814,7 +1814,7 @@ static inline void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush, * * Also, change type of <bGrfNum> and <bClip> from <bool> to <bool> */ -static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut, +static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext *pOut, SwViewShell &rSh, const SwRect &rGrf, const SwRect &rOut, bool bClip, bool bGrfNum, SwPaintProperties& properties, @@ -1857,7 +1857,7 @@ bool DrawFillAttributes( const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes, const SwRect& rOriginalLayoutRect, const SwRegionRects& rPaintRegion, - OutputDevice& rOut) + vcl::RenderContext& rOut) { if(rFillAttributes.get() && rFillAttributes->isUsed()) { @@ -1961,7 +1961,7 @@ bool DrawFillAttributes( void DrawGraphic( const SvxBrushItem *pBrush, - OutputDevice *pOutDev, + vcl::RenderContext *pOutDev, const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum, @@ -2316,7 +2316,7 @@ void DrawGraphic( * and other changes to the to be painted rectangle, this method is called for the * rectangle to be painted in order to adjust it to the pixel it is overlapping */ -static void lcl_AdjustRectToPixelSize( SwRect& io_aSwRect, const OutputDevice &aOut ) +static void lcl_AdjustRectToPixelSize( SwRect& io_aSwRect, const vcl::RenderContext &aOut ) { // local constant object of class <Size> to determine number of Twips // representing a pixel. @@ -4585,7 +4585,7 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect, break; } - OutputDevice *pOut = properties.pSGlobalShell->GetOut(); + vcl::RenderContext *pOut = properties.pSGlobalShell->GetOut(); sal_uLong nOldDrawMode = pOut->GetDrawMode(); Color aShadowColor( rShadow.GetColor().GetRGBColor() ); @@ -6062,7 +6062,7 @@ bool SwPageFrm::IsLeftShadowNeeded() const enum PaintArea {LEFT, RIGHT, TOP, BOTTOM}; /// Wrapper around pOut->DrawBitmapEx. -static void lcl_paintBitmapExToRect(OutputDevice *pOut, const Point& aPoint, const Size& aSize, const BitmapEx& rBitmapEx, PaintArea eArea) +static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoint, const Size& aSize, const BitmapEx& rBitmapEx, PaintArea eArea) { // The problem is that if we get called multiple times and the color is // partly transparent, then the result will get darker and darker. To avoid diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx index d8ea404f17fd..8d69905e947f 100644 --- a/sw/source/core/layout/virtoutp.cxx +++ b/sw/source/core/layout/virtoutp.cxx @@ -100,8 +100,8 @@ bool SwRootFrm::HasSameRect( const SwRect& rRect ) // an virtual output device is used. void SetMappingForVirtDev( const Point& _rNewOrigin, MapMode* , - const OutputDevice* _pOrgOutDev, - VirtualDevice* _pVirDev ) + const vcl::RenderContext* _pOrgOutDev, + vcl::RenderContext* _pVirDev ) { // new solution: set pixel offset at virtual output device Point aPixelOffset = _pOrgOutDev->LogicToPixel( _rNewOrigin ); diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 3354df5e45e4..192531027059 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -274,12 +274,12 @@ public: inline SwViewShell *GetVsh() { return m_pVsh; } inline const SwViewShell *GetVsh() const { return m_pVsh; } - inline OutputDevice *GetOut() { return m_pOut; } - inline const OutputDevice *GetOut() const { return m_pOut; } + inline vcl::RenderContext *GetOut() { return m_pOut; } + inline const vcl::RenderContext *GetOut() const { return m_pOut; } inline void SetOut( OutputDevice* pNewOut ) { m_pOut = pNewOut; } - inline OutputDevice *GetRefDev() { return m_pRef; } - inline const OutputDevice *GetRefDev() const { return m_pRef; } + inline vcl::RenderContext *GetRefDev() { return m_pRef; } + inline const vcl::RenderContext *GetRefDev() const { return m_pRef; } inline SwFont *GetFont() { return m_pFnt; } inline const SwFont *GetFont() const { return m_pFnt; } diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 452e43a7ce72..a344a7e956da 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -167,8 +167,8 @@ void SwFntObj::CreatePrtFont( const OutputDevice& rPrt ) * 2. PDF export from online layout * 3. Prospect/PagePreview pringing */ -static bool lcl_IsFontAdjustNecessary( const OutputDevice& rOutDev, - const OutputDevice& rRefDev ) +static bool lcl_IsFontAdjustNecessary( const vcl::RenderContext& rOutDev, + const vcl::RenderContext& rRefDev ) { return &rRefDev != &rOutDev && OUTDEV_WINDOW != rRefDev.GetOutDevType() && @@ -619,7 +619,7 @@ static sal_uInt8 lcl_WhichPunctuation( sal_Unicode cChar ) return SwScriptInfo::SPECIAL_LEFT; } -static bool lcl_IsMonoSpaceFont( const OutputDevice& rOut ) +static bool lcl_IsMonoSpaceFont( const vcl::RenderContext& rOut ) { const OUString aStr1( sal_Unicode( 0x3008 ) ); const OUString aStr2( sal_Unicode( 0x307C ) ); diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index a33b8ec6737d..4849954ba3c8 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -1521,7 +1521,7 @@ SwUnderlineFont::~SwUnderlineFont() /// Helper for filters to find true lineheight of a font long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess, const SwAttrSet &rSet, - const OutputDevice &rOut, sal_Int16 nScript) + const vcl::RenderContext &rOut, sal_Int16 nScript) { SwFont aFont(&rSet, &rIDocumentSettingAccess); sal_uInt8 nActual; @@ -1540,7 +1540,7 @@ long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess, } aFont.SetActual(nActual); - OutputDevice &rMutableOut = const_cast<OutputDevice &>(rOut); + vcl::RenderContext &rMutableOut = const_cast<vcl::RenderContext &>(rOut); const vcl::Font aOldFont(rMutableOut.GetFont()); rMutableOut.SetFont(aFont.GetActualFont()); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index bbed011bf66a..c9b92fb58582 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -146,7 +146,7 @@ lcl_PaintTransparentFormControls(SwViewShell & rShell, SwRect const& rRect) if (rShell.GetWin()) { vcl::Window& rWindow = *(rShell.GetWin()); - const Rectangle aRectanglePixel(rWindow.LogicToPixel(rRect.SVRect())); + const Rectangle aRectanglePixel(rShell.GetOut()->LogicToPixel(rRect.SVRect())); PaintTransparentChildren(rWindow, aRectanglePixel); } } diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 92ad716a076e..4a56f0d14306 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -188,7 +188,7 @@ void SetSwVisArea( SwViewShell *pSh, const SwRect &rRect ) // at the same position aPt.X() = -aPt.X(); aPt.Y() = -aPt.Y(); - OutputDevice *pOut = pSh->GetOut(); + vcl::RenderContext *pOut = pSh->GetOut(); MapMode aMapMode( pOut->GetMapMode() ); aMapMode.SetOrigin( aPt ); diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 774fcada0506..cb0f41123051 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -190,7 +190,7 @@ OUString GetDefaultString(sal_Int32 nChars) return aStr; } -static void calcFontHeightAnyAscent( OutputDevice* _pWin, vcl::Font& _rFont, long& _nHeight, long& _nAscent ) +static void calcFontHeightAnyAscent( vcl::RenderContext* _pWin, vcl::Font& _rFont, long& _nHeight, long& _nAscent ) { if ( !_nHeight ) { diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 38fa785ef4b9..83c0e9294491 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -879,7 +879,7 @@ void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType m_pStartEdit->GetModifyHdl().Call(m_pStartEdit); } -static long lcl_DrawBullet(VirtualDevice* pVDev, +static long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFmt& rFmt, long nXStart, long nYStart, const Size& rSize) { @@ -897,7 +897,7 @@ static long lcl_DrawBullet(VirtualDevice* pVDev, return nRet; } -static long lcl_DrawGraphic(VirtualDevice* pVDev, const SwNumFmt &rFmt, long nXStart, +static long lcl_DrawGraphic(vcl::RenderContext* pVDev, const SwNumFmt &rFmt, long nXStart, long nYStart, long nDivision) { const SvxBrushItem* pBrushItem = rFmt.GetBrush(); diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 76f17325268f..7eb1db935f03 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -128,7 +128,7 @@ void SwSrcView::InitInterface_Impl() TYPEINIT1(SwSrcView, SfxViewShell) -static void lcl_PrintHeader( OutputDevice &rOutDev, sal_Int32 nPages, sal_Int32 nCurPage, const OUString& rTitle ) +static void lcl_PrintHeader( vcl::RenderContext &rOutDev, sal_Int32 nPages, sal_Int32 nCurPage, const OUString& rTitle ) { short nLeftMargin = LMARGPRN; Size aSz = rOutDev.GetOutputSize(); diff --git a/sw/source/uibase/uiview/viewfunc.hxx b/sw/source/uibase/uiview/viewfunc.hxx index c66822e95a26..9bf8b37a1bb8 100644 --- a/sw/source/uibase/uiview/viewfunc.hxx +++ b/sw/source/uibase/uiview/viewfunc.hxx @@ -37,7 +37,7 @@ VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window*, const SfxItemSet& ); void SetAppPrintOptions( SwViewShell* pSh, bool bWeb ); // The following functions are available in viewport.cxx -void ViewResizePixel( const vcl::Window &rRef, +void ViewResizePixel( const vcl::RenderContext &rRef, const Point &rOfst, const Size &rSize, const Size &rEditSz, diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index 00e31429a9e0..d803103f0692 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -832,7 +832,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, bool /*bInner*/ ) SetBorderPixel( rToFill ); } -void ViewResizePixel( const vcl::Window &rRef, +void ViewResizePixel( const vcl::RenderContext &rRef, const Point &rOfst, const Size &rSize, const Size &rEditSz, |