basctl/source/basicide/basidesh.cxx | 2 compilerplugins/clang/constantparam.py | 67 ++++++++++++++++++++++++++++++++- include/sfx2/objsh.hxx | 11 ++--- include/sfx2/viewsh.hxx | 3 - include/toolkit/awt/vclxgraphics.hxx | 7 +-- sc/source/ui/view/prevwsh.cxx | 2 sc/source/ui/view/tabvwsh4.cxx | 2 sd/source/ui/view/ViewShellBase.cxx | 4 - sfx2/source/doc/objmisc.cxx | 8 +-- sfx2/source/view/viewfrm2.cxx | 3 - sfx2/source/view/viewimp.hxx | 1 sfx2/source/view/viewsh.cxx | 4 - starmath/source/view.cxx | 2 sw/source/uibase/uiview/pview.cxx | 2 sw/source/uibase/uiview/srcview.cxx | 2 sw/source/uibase/uiview/view.cxx | 2 toolkit/source/awt/vclxgraphics.cxx | 50 ++++++++++-------------- 17 files changed, 109 insertions(+), 63 deletions(-)
New commits: commit e3eadc96cc05135880b72c42358eb3fe51ea94c4 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Tue Apr 4 16:35:25 2017 +0200 teach constantparam plugin to find always on and always off bitmask values Change-Id: If56a483494bd3d7feb3fa67c01000dddd0d34421 Reviewed-on: https://gerrit.libreoffice.org/36085 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 9ef5777177db..804e0e3ecdc1 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -150,7 +150,7 @@ void basctl_Shell::InitInterface_Impl() unsigned Shell::nShellCount = 0; Shell::Shell( SfxViewFrame* pFrame_, SfxViewShell* /* pOldShell */ ) : - SfxViewShell( pFrame_, SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::NO_NEWWINDOW ), + SfxViewShell( pFrame_, SfxViewShellFlags::NO_NEWWINDOW ), m_aCurDocument( ScriptDocument::getApplicationScriptDocument() ), aHScrollBar( VclPtr<ScrollBar>::Create(&GetViewFrame()->GetWindow(), WinBits( WB_HSCROLL | WB_DRAG )) ), aVScrollBar( VclPtr<ScrollBar>::Create(&GetViewFrame()->GetWindow(), WinBits( WB_VSCROLL | WB_DRAG )) ), diff --git a/compilerplugins/clang/constantparam.py b/compilerplugins/clang/constantparam.py index 2f930187666f..5550c51c34f3 100755 --- a/compilerplugins/clang/constantparam.py +++ b/compilerplugins/clang/constantparam.py @@ -4,7 +4,7 @@ import sys import re import io -callDict = dict() +callDict = dict() # callInfo tuple -> callValue # clang does not always use exactly the same numbers in the type-parameter vars it generates # so I need to substitute them to ensure we can match correctly. @@ -38,7 +38,7 @@ for callInfo, callValues in callDict.iteritems(): sourceLoc = callInfo[4] functionSig = callInfo[0] + " " + callInfo[1] - # try and ignore setter methods + # try to ignore setter methods if ("," not in nameAndParams) and (("::set" in nameAndParams) or ("::Set" in nameAndParams)): continue # ignore code that follows a common pattern @@ -67,4 +67,67 @@ with open("loplugin.constantparam.report", "wt") as f: f.write(" " + v[1] + "\n") f.write(" " + v[2] + "\n") +# ------------------------------------------------------------- +# Now a fun set of heuristics to look for methods that +# take bitmask parameters where one or more of the bits in the +# bitmask is always one or always zero +# integer to hext str +def hex(i): + return "0x%x" % i +# I can't use python's ~ operator, because that produces negative numbers +def negate(i): + return (1 << 32) - 1 - i + +tmp2list = list() +for callInfo, callValues in callDict.iteritems(): + nameAndParams = callInfo[1] + if len(callValues) < 2: + continue + # we are only interested in enum parameters + if not "enum" in callInfo[3]: continue + if not "Flag" in callInfo[3] and not "flag" in callInfo[3] and not "Bit" in callInfo[3] and not "State" in callInfo[3]: continue + # try to ignore setter methods + if ("," not in nameAndParams) and (("::set" in nameAndParams) or ("::Set" in nameAndParams)): + continue + + setBits = 0 + clearBits = 0 + continue_flag = False + first = True + for callValue in callValues: + if "unknown" == callValue or not callValue.isdigit(): + continue_flag = True + break + if first: + setBits = int(callValue) + clearBits = negate(int(callValue)) + first = False + else: + setBits = setBits & int(callValue) + clearBits = clearBits & negate(int(callValue)) + + # estimate allBits by using the highest bit we have seen + # TODO dump more precise information about the allBits values of enums + allBits = (1 << setBits.bit_length()) - 1 + clearBits = clearBits & allBits + if continue_flag or (setBits == 0 and clearBits == 0): continue + + sourceLoc = callInfo[4] + functionSig = callInfo[0] + " " + callInfo[1] + + v2 = callInfo[3] + " " + callInfo[2] + if setBits != 0: v2 += " setBits=" + hex(setBits) + if clearBits != 0: v2 += " clearBits=" + hex(clearBits) + tmp2list.append((sourceLoc, functionSig, v2)) + + +# sort results by filename:lineno +tmp2list.sort(key=lambda v: natural_sort_key(v[0])) + +# print out the results +with open("loplugin.constantparam.report-bitmask-params", "wt") as f: + for v in tmp2list: + f.write(v[0] + "\n") + f.write(" " + v[1] + "\n") + f.write(" " + v[2] + "\n") diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index d8a74fcbf307..716da53f9db3 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -119,16 +119,15 @@ namespace com { namespace sun { namespace star { enum class SfxObjectShellFlags { - HASOPENDOC = 0x01L, - HASMENU = 0x04L, - DONTCLOSE = 0x10L, - NODOCINFO = 0x20L, - STD_NORMAL = HASOPENDOC, + STD_NORMAL = 0x0000000, + HASMENU = 0x0000004, + DONTCLOSE = 0x0000010, + NODOCINFO = 0x0000020, UNDEFINED = 0xf000000 }; namespace o3tl { - template<> struct typed_flags<SfxObjectShellFlags> : is_typed_flags<SfxObjectShellFlags, 0xf000035> {}; + template<> struct typed_flags<SfxObjectShellFlags> : is_typed_flags<SfxObjectShellFlags, 0xf000034> {}; } #define SFX_TITLE_TITLE 0 diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 72fed2785283..54a300b7eab7 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -96,13 +96,12 @@ enum class SfxViewShellFlags { NONE = 0x0000, HAS_PRINTOPTIONS = 0x0010, /* Options-Button and Options-Dialog in PrintDialog */ - CAN_PRINT = 0x0020, /* Printing enabled without having to create a Printer */ NO_SHOW = 0x0040, /* Window of the ViewShell shall not be showed automatically */ NO_NEWWINDOW = 0x0100, /* Allow N View */ }; namespace o3tl { - template<> struct typed_flags<SfxViewShellFlags> : is_typed_flags<SfxViewShellFlags, 0x0170> {}; + template<> struct typed_flags<SfxViewShellFlags> : is_typed_flags<SfxViewShellFlags, 0x0150> {}; } /* [Description] diff --git a/include/toolkit/awt/vclxgraphics.hxx b/include/toolkit/awt/vclxgraphics.hxx index 21a8609c00bf..059e774042fb 100644 --- a/include/toolkit/awt/vclxgraphics.hxx +++ b/include/toolkit/awt/vclxgraphics.hxx @@ -40,14 +40,13 @@ namespace vcl { class Region; } enum class InitOutDevFlags { + NONE = 0x0000, FONT = 0x0001, COLORS = 0x0002, - RASTEROP = 0x0004, - CLIPREGION = 0x0008, }; namespace o3tl { - template<> struct typed_flags<InitOutDevFlags> : is_typed_flags<InitOutDevFlags, 0x0f> {}; + template<> struct typed_flags<InitOutDevFlags> : is_typed_flags<InitOutDevFlags, 0x03> {}; } @@ -70,7 +69,7 @@ private: Color maLineColor; Color maFillColor; RasterOp meRasterOp; - vcl::Region* mpClipRegion; + vcl::Region* mpClipRegion; void initAttrs(); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 810e60c5fc55..c4bf44f6c84a 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -148,7 +148,7 @@ void ScPreviewShell::Construct( vcl::Window* pParent ) ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame, SfxViewShell* pOldSh ) : - SfxViewShell( pViewFrame, SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS ), + SfxViewShell( pViewFrame, SfxViewShellFlags::HAS_PRINTOPTIONS ), pDocShell( static_cast<ScDocShell*>(pViewFrame->GetObjectShell()) ), mpFrameWindow(nullptr), nSourceDesignMode( TRISTATE_INDET ), diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 07e63223d429..dd08716d7198 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1634,7 +1634,7 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, SfxViewShell* pOldSh ) : - SfxViewShell( pViewFrame, SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS ), + SfxViewShell( pViewFrame, SfxViewShellFlags::HAS_PRINTOPTIONS ), ScDBFunc( &pViewFrame->GetWindow(), static_cast<ScDocShell&>(*pViewFrame->GetObjectShell()), this ), eCurOST(OST_NONE), nDrawSfxId(0), diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index a2263c38c9e6..6c55b8c8a9e3 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -241,9 +241,7 @@ void ViewShellBase::InitInterface_Impl() ViewShellBase::ViewShellBase ( SfxViewFrame* _pFrame, SfxViewShell*) - : SfxViewShell (_pFrame, - SfxViewShellFlags::CAN_PRINT - | SfxViewShellFlags::HAS_PRINTOPTIONS), + : SfxViewShell (_pFrame, SfxViewShellFlags::HAS_PRINTOPTIONS), mpImpl(), mpDocShell (nullptr), mpDocument (nullptr) diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 4947999969dc..cfccb7d7fc41 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -928,14 +928,12 @@ void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame ) void SfxObjectShell::SetActivateEvent_Impl(SfxEventHintId nId ) { - if ( GetFactory().GetFlags() & SfxObjectShellFlags::HASOPENDOC ) - pImpl->nEventId = nId; + pImpl->nEventId = nId; } void SfxObjectShell::PrepareReload( ) -/* [Description] - - Is called before the Reload and gives the opportunity to clear any caches. +/* + Is called before the Reload and gives the opportunity to clear any caches. */ { } diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 294e64f2ad91..ec40c13bf6fa 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -371,9 +371,8 @@ void SfxViewFrame::INetState_Impl( SfxItemSet &rItemSet ) // Add/SaveToBookmark at BASIC-IDE, QUERY-EDITOR etc. disable SfxObjectShell *pDocSh = GetObjectShell(); - bool bPseudo = pDocSh && !( pDocSh->GetFactory().GetFlags() & SfxObjectShellFlags::HASOPENDOC ); bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED; - if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() ) + if ( !pDocSh || bEmbedded || !pDocSh->HasName() ) rItemSet.DisableItem( SID_CREATELINK ); } diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index bbf0eb30a48f..af98ebe14a72 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -45,7 +45,6 @@ struct SfxViewShell_Impl bool m_bControllerSet; SfxShellArr_Impl aArr; Size aMargin; - bool m_bCanPrint; bool m_bHasPrintOptions; bool m_bIsShowView; bool m_bGotOwnership; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 0ccc006926c3..a8ba5f70adc3 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -233,7 +233,6 @@ sal_uInt32 SfxViewShell_Impl::m_nLastViewShellId = 0; SfxViewShell_Impl::SfxViewShell_Impl(SfxViewShellFlags const nFlags) : aInterceptorContainer( aMutex ) , m_bControllerSet(false) -, m_bCanPrint(nFlags & SfxViewShellFlags::CAN_PRINT) , m_bHasPrintOptions(nFlags & SfxViewShellFlags::HAS_PRINTOPTIONS) , m_bIsShowView(!(nFlags & SfxViewShellFlags::NO_SHOW)) , m_bGotOwnership(false) @@ -699,8 +698,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) case SID_SETUPPRINTER: case SID_PRINTER_NAME: { - bool bEnabled = pImpl->m_bCanPrint - && !Application::GetSettings().GetMiscSettings().GetDisablePrinting(); + bool bEnabled = !Application::GetSettings().GetMiscSettings().GetDisablePrinting(); if ( bEnabled ) { SfxPrinter *pPrinter = GetPrinter(); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index fcc9db61414c..50a1a5f7b616 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1921,7 +1921,7 @@ void SmViewShell::GetState(SfxItemSet &rSet) } SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *) - : SfxViewShell(pFrame_, SfxViewShellFlags::HAS_PRINTOPTIONS | SfxViewShellFlags::CAN_PRINT) + : SfxViewShell(pFrame_, SfxViewShellFlags::HAS_PRINTOPTIONS) , mpImpl(new SmViewShell_Impl) , mpGraphic(VclPtr<SmGraphicWindow>::Create(this)) , maGraphicController(*mpGraphic.get(), SID_GAPHIC_SM, pFrame_->GetBindings()) diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 8cc1aa5bf376..a5bb54adecdf 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -100,7 +100,7 @@ void SwPagePreview::InitInterface_Impl() } -#define SWVIEWFLAGS ( SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS ) +#define SWVIEWFLAGS SfxViewShellFlags::HAS_PRINTOPTIONS #define MIN_PREVIEW_ZOOM 25 #define MAX_PREVIEW_ZOOM 600 diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 2d0e7093195c..31967bd56ed2 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -94,7 +94,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ui::dialogs; using namespace ::sfx2; -#define SWSRCVIEWFLAGS ( SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::NO_NEWWINDOW ) +#define SWSRCVIEWFLAGS SfxViewShellFlags::NO_NEWWINDOW #define SRC_SEARCHOPTIONS (SearchOptionFlags::ALL & ~SearchOptionFlags(SearchOptionFlags::FORMAT|SearchOptionFlags::FAMILIES|SearchOptionFlags::SEARCHALL)) diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index d630906a3b13..cc3dc2d81de4 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -122,7 +122,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::scanner; -#define SWVIEWFLAGS ( SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS) +#define SWVIEWFLAGS SfxViewShellFlags::HAS_PRINTOPTIONS // Statics. OMG. diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index dcc587c6c536..b4cb91244a69 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -138,18 +138,12 @@ void VCLXGraphics::InitOutputDevice( InitOutDevFlags nFlags ) mpOutputDevice->SetFillColor( maFillColor ); } - if ( nFlags & InitOutDevFlags::RASTEROP ) - { - mpOutputDevice->SetRasterOp( meRasterOp ); - } + mpOutputDevice->SetRasterOp( meRasterOp ); - if ( nFlags & InitOutDevFlags::CLIPREGION ) - { - if( mpClipRegion ) - mpOutputDevice->SetClipRegion( *mpClipRegion ); - else - mpOutputDevice->SetClipRegion(); - } + if( mpClipRegion ) + mpOutputDevice->SetClipRegion( *mpClipRegion ); + else + mpOutputDevice->SetClipRegion(); } } @@ -293,7 +287,7 @@ void VCLXGraphics::copy( const uno::Reference< awt::XDevice >& rxSource, sal_Int DBG_ASSERT( pFromDev, "VCLXGraphics::copy - invalid device" ); if ( pFromDev ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP ); + InitOutputDevice( InitOutDevFlags::NONE ); mpOutputDevice->DrawOutDev( Point( nDestX, nDestY ), Size( nDestWidth, nDestHeight ), Point( nSourceX, nSourceY ), Size( nSourceWidth, nSourceHeight ), *pFromDev->GetOutputDevice() ); } @@ -306,7 +300,7 @@ void VCLXGraphics::draw( const uno::Reference< awt::XDisplayBitmap >& rxBitmapHa if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP); + InitOutputDevice( InitOutDevFlags::NONE); uno::Reference< awt::XBitmap > xBitmap( rxBitmapHandle, uno::UNO_QUERY ); BitmapEx aBmpEx = VCLUnoHelper::GetBitmap( xBitmap ); @@ -338,7 +332,7 @@ void VCLXGraphics::drawPixel( sal_Int32 x, sal_Int32 y ) if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawPixel( Point( x, y ) ); } } @@ -349,7 +343,7 @@ void VCLXGraphics::drawLine( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawLine( Point( x1, y1 ), Point( x2, y2 ) ); } } @@ -360,7 +354,7 @@ void VCLXGraphics::drawRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int3 if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawRect( tools::Rectangle( Point( x, y ), Size( width, height ) ) ); } } @@ -371,7 +365,7 @@ void VCLXGraphics::drawRoundedRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, s if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawRect( tools::Rectangle( Point( x, y ), Size( width, height ) ), nHorzRound, nVertRound ); } } @@ -382,7 +376,7 @@ void VCLXGraphics::drawPolyLine( const uno::Sequence< sal_Int32 >& DataX, const if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawPolyLine( VCLUnoHelper::CreatePolygon( DataX, DataY ) ); } } @@ -393,7 +387,7 @@ void VCLXGraphics::drawPolygon( const uno::Sequence< sal_Int32 >& DataX, const u if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawPolygon( VCLUnoHelper::CreatePolygon( DataX, DataY ) ); } } @@ -404,7 +398,7 @@ void VCLXGraphics::drawPolyPolygon( const uno::Sequence< uno::Sequence< sal_Int3 if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); sal_uInt16 nPolys = (sal_uInt16) DataX.getLength(); tools::PolyPolygon aPolyPoly( nPolys ); for ( sal_uInt16 n = 0; n < nPolys; n++ ) @@ -420,7 +414,7 @@ void VCLXGraphics::drawEllipse( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_I if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawEllipse( tools::Rectangle( Point( x, y ), Size( width, height ) ) ); } } @@ -431,7 +425,7 @@ void VCLXGraphics::drawArc( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawArc( tools::Rectangle( Point( x, y ), Size( width, height ) ), Point( x1, y1 ), Point( x2, y2 ) ); } } @@ -442,7 +436,7 @@ void VCLXGraphics::drawPie( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawPie( tools::Rectangle( Point( x, y ), Size( width, height ) ), Point( x1, y1 ), Point( x2, y2 ) ); } } @@ -453,7 +447,7 @@ void VCLXGraphics::drawChord( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawChord( tools::Rectangle( Point( x, y ), Size( width, height ) ), Point( x1, y1 ), Point( x2, y2 ) ); } } @@ -464,7 +458,7 @@ void VCLXGraphics::drawGradient( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_ if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); Gradient aGradient((GradientStyle)rGradient.Style, rGradient.StartColor, rGradient.EndColor); aGradient.SetAngle(rGradient.Angle); aGradient.SetBorder(rGradient.Border); @@ -483,7 +477,7 @@ void VCLXGraphics::drawText( sal_Int32 x, sal_Int32 y, const OUString& rText ) if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS |InitOutDevFlags::FONT); + InitOutputDevice( InitOutDevFlags::COLORS |InitOutDevFlags::FONT); mpOutputDevice->DrawText( Point( x, y ), rText ); } } @@ -494,7 +488,7 @@ void VCLXGraphics::drawTextArray( sal_Int32 x, sal_Int32 y, const OUString& rTex if( mpOutputDevice ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS|InitOutDevFlags::FONT ); + InitOutputDevice( InitOutDevFlags::COLORS|InitOutDevFlags::FONT ); std::unique_ptr<long []> pDXA(new long[rText.getLength()]); for(int i = 0; i < rText.getLength(); i++) { @@ -514,7 +508,7 @@ void VCLXGraphics::drawImage( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int Image aImage( xGraphic ); if ( !!aImage ) { - InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS ); + InitOutputDevice( InitOutDevFlags::COLORS ); mpOutputDevice->DrawImage( Point( x, y ), Size( width, height ), aImage, static_cast<DrawImageFlags>(nStyle) ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits