compilerplugins/clang/rendercontext.cxx | 54 +++++++++++++++++---- sc/source/ui/view/gridwin4.cxx | 2 sc/source/ui/view/notemark.cxx | 2 sc/source/ui/view/output.cxx | 6 +- sc/source/ui/view/printfun.cxx | 4 - sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx | 4 - starmath/source/dialog.cxx | 2 starmath/source/rect.cxx | 2 sw/inc/viewsh.hxx | 5 + sw/source/core/bastyp/swtypes.cxx | 2 sw/source/core/doc/notxtfrm.cxx | 10 +-- sw/source/core/inc/drawfont.hxx | 5 + sw/source/core/inc/notxtfrm.hxx | 3 - sw/source/core/layout/paintfrm.cxx | 22 ++++---- sw/source/core/layout/virtoutp.cxx | 4 - sw/source/core/text/inftxt.hxx | 8 +-- sw/source/core/txtnode/fntcache.cxx | 6 +- sw/source/core/txtnode/swfont.cxx | 4 - sw/source/core/view/viewsh.cxx | 2 sw/source/core/view/vprint.cxx | 2 sw/source/ui/chrdlg/drpcps.cxx | 2 sw/source/ui/misc/outline.cxx | 4 - sw/source/uibase/uiview/srcview.cxx | 2 sw/source/uibase/uiview/viewfunc.hxx | 2 sw/source/uibase/uiview/viewport.cxx | 2 vcl/source/app/svapp.cxx | 5 + 26 files changed, 105 insertions(+), 61 deletions(-)
New commits: commit fc9e78c78864cbfa67ddea646da4aa4677d99b0c Author: Noel Grandin <n...@peralex.com> Date: Mon May 11 08:37:50 2015 +0200 sw,sc,sd,starmath: convert to vcl::RenderContext Change-Id: I5d0a3b8ed1c49ba2806e0fa528d908da45afd58c diff --git a/compilerplugins/clang/rendercontext.cxx b/compilerplugins/clang/rendercontext.cxx index a1e7018..bc34629 100644 --- a/compilerplugins/clang/rendercontext.cxx +++ b/compilerplugins/clang/rendercontext.cxx @@ -16,7 +16,8 @@ // Check for calls to OutputDevice methods that are not passing through RenderContext -namespace { +namespace +{ class RenderContext: public RecursiveASTVisitor<RenderContext>, public loplugin::Plugin @@ -24,7 +25,9 @@ class RenderContext: public: explicit RenderContext(InstantiationData const & data): Plugin(data) {} - virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } + virtual void run() override { + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + } bool TraverseFunctionDecl(const FunctionDecl * decl); @@ -34,7 +37,8 @@ private: bool mbChecking = false; }; -bool RenderContext::TraverseFunctionDecl(const FunctionDecl * pFunctionDecl) { +bool RenderContext::TraverseFunctionDecl(const FunctionDecl * pFunctionDecl) +{ if (ignoreLocation(pFunctionDecl)) { return true; } @@ -67,22 +71,56 @@ bool RenderContext::VisitCXXMemberCallExpr(const CXXMemberCallExpr* pCXXMemberCa if (pCXXRecordDecl->getQualifiedNameAsString() != "OutputDevice") { return true; } + // ignore a handful of methods. They will most probably still be present in Window for use during processing outside of the Paint() + // method lifecycle + const CXXMethodDecl *pCXXMethodDecl = pCXXMemberCallExpr->getMethodDecl(); + if (pCXXMethodDecl->isInstance()) { + StringRef name = pCXXMethodDecl->getName(); + if (name == "LogicToPixel" || name == "GetMapMode" || name == "GetFontMetric" || name == "LogicToLogic" + || name == "PixelToLogic" || name == "SetDigitLanguage") + { + return true; + } + } + // for calling through a pointer const ImplicitCastExpr *pImplicitCastExpr = dyn_cast<ImplicitCastExpr>(pCXXMemberCallExpr->getImplicitObjectArgument()); - std::string t2 = "0"; + std::string x = "0"; // for debugging if (pImplicitCastExpr) { - t2 = "2"; + x += "1"; QualType aType = pImplicitCastExpr->getSubExpr()->getType(); if (aType->isPointerType()) aType = aType->getPointeeType(); - t2 = aType.getAsString(); - if (t2 == "vcl::RenderContext") + std::string t2 = aType.getAsString(); + if (t2 == "vcl::RenderContext" || t2 == "const vcl::RenderContext") + return true; + } + // for calling through a reference + const DeclRefExpr *pDeclRefExpr = dyn_cast<DeclRefExpr>(pCXXMemberCallExpr->getImplicitObjectArgument()); + if (pDeclRefExpr) { + x += "2"; + QualType aType = pDeclRefExpr->getType(); + std::string t2 = aType.getAsString(); + if (t2 == "vcl::RenderContext" || t2 == "const vcl::RenderContext") + return true; + } + // for calling through a chain of methods + const CXXMemberCallExpr *pMemberExpr = dyn_cast<CXXMemberCallExpr>(pCXXMemberCallExpr->getImplicitObjectArgument()); + if (pMemberExpr) { + x += "3"; + QualType aType = pMemberExpr->getType(); + if (aType->isPointerType()) + aType = aType->getPointeeType(); + std::string t2 = aType.getAsString(); + x += t2; + if (t2 == "vcl::RenderContext" || t2 == "const vcl::RenderContext") return true; } report( DiagnosticsEngine::Warning, + // + x + pCXXMemberCallExpr->getImplicitObjectArgument()->getStmtClassName() "Should be calling OutputDevice method through RenderContext.", pCXXMemberCallExpr->getLocStart()) - << pCXXMemberCallExpr->getSourceRange(); + << pCXXMemberCallExpr->getSourceRange(); return true; } diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 6ec461d..2f291d7 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -76,7 +76,7 @@ static void lcl_LimitRect( Rectangle& rRect, const Rectangle& rVisible ) // Wenn's weit daneben liegt, wird lcl_DrawOneFrame erst gar nicht gerufen. } -static void lcl_DrawOneFrame( OutputDevice* pDev, const Rectangle& rInnerPixel, +static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const Rectangle& rInnerPixel, const OUString& rTitle, const Color& rColor, bool bTextBelow, double nPPTX, double nPPTY, const Fraction& rZoomY, ScDocument* pDoc, ScViewData* pButtonViewData, bool bLayoutRTL ) diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx index d04644e..2ed269a 100644 --- a/sc/source/ui/view/notemark.cxx +++ b/sc/source/ui/view/notemark.cxx @@ -111,7 +111,7 @@ IMPL_LINK_NOARG_TYPED(ScNoteMarker, TimeHdl, Timer *, void) Draw(); } -static void lcl_DrawWin( SdrObject* pObject, vcl::Window* pWindow, const MapMode& rMap ) +static void lcl_DrawWin( SdrObject* pObject, vcl::RenderContext* pWindow, const MapMode& rMap ) { MapMode aOld = pWindow->GetMapMode(); pWindow->SetMapMode( rMap ); diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 316e12f..b195e34 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -780,7 +780,7 @@ namespace { static const double lclCornerRectTransparency = 40.0; -void drawDataBars( const ScDataBarInfo* pOldDataBarInfo, OutputDevice* pDev, const Rectangle& rRect) +void drawDataBars( const ScDataBarInfo* pOldDataBarInfo, vcl::RenderContext* pDev, const Rectangle& rRect) { long nPosZero = 0; Rectangle aPaintRect = rRect; @@ -856,7 +856,7 @@ BitmapEx& getIcon( ScIconSetType eType, sal_Int32 nIndex ) return ScIconSetFormat::getBitmap( eType, nIndex ); } -void drawIconSets( const ScIconSetInfo* pOldIconSetInfo, OutputDevice* pDev, const Rectangle& rRect ) +void drawIconSets( const ScIconSetInfo* pOldIconSetInfo, vcl::RenderContext* pDev, const Rectangle& rRect ) { //long nSize = 16; ScIconSetType eType = pOldIconSetInfo->eIconSetType; @@ -867,7 +867,7 @@ void drawIconSets( const ScIconSetInfo* pOldIconSetInfo, OutputDevice* pDev, con } void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color*& pOldColor, const SvxBrushItem*& pOldBackground, - Rectangle& rRect, long nPosX, long nSignedOneX, OutputDevice* pDev, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo, + Rectangle& rRect, long nPosX, long nSignedOneX, vcl::RenderContext* pDev, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo, const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo) { diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index ff34a7b..1e9f4d0 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1074,7 +1074,7 @@ void ScPrintFunc::SetDateTime( const Date& rDate, const tools::Time& rTime ) aFieldData.aTime = rTime; } -static void lcl_DrawGraphic( const Graphic &rGraphic, OutputDevice *pOut, +static void lcl_DrawGraphic( const Graphic &rGraphic, vcl::RenderContext *pOut, const Rectangle &rGrf, const Rectangle &rOut ) { const bool bNotInside = !rOut.IsInside( rGrf ); @@ -1090,7 +1090,7 @@ static void lcl_DrawGraphic( const Graphic &rGraphic, OutputDevice *pOut, pOut->Pop(); } -static void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevice* pRefDev, +static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOut, OutputDevice* pRefDev, const Rectangle &rOrg, const Rectangle &rOut, OUString const & referer ) { diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx index 65086d7..d22f5cf 100644 --- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx +++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx @@ -63,8 +63,8 @@ private: }; void DeviceCopy ( - OutputDevice& rTargetDevice, - OutputDevice& rSourceDevice, + vcl::RenderContext& rTargetDevice, + vcl::RenderContext& rSourceDevice, const Rectangle& rBox) { rTargetDevice.DrawOutDev( diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index e62257b..d185333 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -398,7 +398,7 @@ void SmFontDialog::dispose() namespace { - void getColors(vcl::Window &rRef, ColorData &rBgCol, ColorData &rTxtCol) + void getColors(vcl::RenderContext &rRef, ColorData &rBgCol, ColorData &rTxtCol) { const StyleSettings &rS = rRef.GetSettings().GetStyleSettings(); if (rS.GetHighContrastMode()) diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index f0f5a75..ad8a2e4 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -593,7 +593,7 @@ SmRect SmRect::AsGlyphRect() const return aRect; } -bool SmGetGlyphBoundRect(const OutputDevice &rDev, +bool SmGetGlyphBoundRect(const vcl::RenderContext &rDev, const OUString &rText, Rectangle &rRect) // basically the same as 'GetTextBoundRect' (in class 'OutputDevice') // but with a string as argument. diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 714e9d2..fb1f9c7 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 6a4eea1..35daca4 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 60711a8..1485579 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 a601ce4..7b7c57b 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 b27642b..04a6708 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 c6b660c..93737e5 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 d8ea404..8d69905 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 3354df5..1925310 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 452e43a..a344a7e 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 a33b8ec..4849954 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 bbed011..c9b92fb 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 92ad716..4a56f0d 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 774fcad..cb0f411 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 38fa785..83c0e92 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 76f1732..7eb1db9 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 c66822e..9bf8b37 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 00e3142..d803103 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, diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 4edae11..decd8e7 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1006,6 +1006,11 @@ OutputDevice* Application::GetDefaultDevice() return ImplGetDefaultWindow(); } +vcl::RenderContext* Application::GetDefaultRenderContext() +{ + return ImplGetDefaultWindow(); +} + vcl::Window* Application::GetFirstTopLevelWindow() { ImplSVData* pSVData = ImplGetSVData(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits