diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-06 12:31:00 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-09-07 06:48:56 +0000 |
commit | 702496391b2b9ef53f83752b34feb3c33d7fb4e9 (patch) | |
tree | b8049cb54a4a0b8724d8bf6b45b9d176511bf9cf | |
parent | ec47e78fee143a3f1705c35300003cb2369013c6 (diff) |
loplugin:constantparam in vcl..xmlscript
Change-Id: Icf66c08071b154259c9e551342d30331caf2b15a
Reviewed-on: https://gerrit.libreoffice.org/28685
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
44 files changed, 169 insertions, 252 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 9f63f136cbf1..e7d7b1c72b08 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1951,8 +1951,7 @@ public: /** Query the native control to determine if it was acted upon */ - bool HitTestNativeControl( - ControlType nType, + bool HitTestNativeScrollbar( ControlPart nPart, const Rectangle& rControlRegion, const Point& aPos, diff --git a/include/vcl/popupmenuwindow.hxx b/include/vcl/popupmenuwindow.hxx index bcff61640767..9184c3875838 100644 --- a/include/vcl/popupmenuwindow.hxx +++ b/include/vcl/popupmenuwindow.hxx @@ -28,7 +28,7 @@ private: struct ImplData; ImplData* mpImplData; public: - PopupMenuFloatingWindow( vcl::Window* pParent, WinBits nStyle = (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER) ); + PopupMenuFloatingWindow( vcl::Window* pParent ); virtual ~PopupMenuFloatingWindow(); virtual void dispose() override; diff --git a/include/vcl/ppdparser.hxx b/include/vcl/ppdparser.hxx index dd8afb060361..134bb9bf49fa 100644 --- a/include/vcl/ppdparser.hxx +++ b/include/vcl/ppdparser.hxx @@ -253,7 +253,7 @@ class VCL_DLLPUBLIC PPDContext bool checkConstraints( const PPDKey*, const PPDValue*, bool bDoReset ); bool resetValue( const PPDKey*, bool bDefaultable = false ); public: - PPDContext( const PPDParser* pParser = nullptr ); + PPDContext(); PPDContext( const PPDContext& rContext ) { operator=( rContext ); } PPDContext& operator=( const PPDContext& rContext ); PPDContext& operator=( PPDContext&& rContext ); diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx index 54b42093de4e..61609ab4acd1 100644 --- a/include/vcl/salnativewidgets.hxx +++ b/include/vcl/salnativewidgets.hxx @@ -150,16 +150,16 @@ enum class ControlPart /* #i77549# HACK: for scrollbars in case of thumb rect, page up and page down rect we - abuse the HitTestNativeControl interface. All theming engines but aqua + abuse the HitTestNativeScrollbar interface. All theming engines but aqua are actually able to draw the thumb according to our internal representation. However aqua draws a little outside. The canonical way would be to enhance the - HitTestNativeControl passing a ScrollbarValue additionally so all necessary + HitTestNativeScrollbar passing a ScrollbarValue additionally so all necessary information is available in the call. . However since there is only this one small exception we will deviate a little and instead pass the respective rect as control region to allow for a small correction. - So all places using HitTestNativeControl on ControlPart::ThumbHorz, ControlPart::ThumbVert, + So all places using HitTestNativeScrollbar on ControlPart::ThumbHorz, ControlPart::ThumbVert, ControlPart::TrackHorzLeft, ControlPart::TrackHorzRight, ControlPart::TrackVertUpper, ControlPart::TrackVertLower do not use the control rectangle as region but the actuall part rectangle, making only small deviations feasible. diff --git a/include/vcl/scrbar.hxx b/include/vcl/scrbar.hxx index 126701518d64..dd06512e1359 100644 --- a/include/vcl/scrbar.hxx +++ b/include/vcl/scrbar.hxx @@ -75,7 +75,7 @@ private: SAL_DLLPRIVATE long ImplCalcThumbPos( long nPixPos ); SAL_DLLPRIVATE long ImplCalcThumbPosPix( long nPos ); SAL_DLLPRIVATE void ImplCalc( bool bUpdate = true ); - SAL_DLLPRIVATE void ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags); + SAL_DLLPRIVATE void ImplDraw(vcl::RenderContext& rRenderContext); using Window::ImplScroll; SAL_DLLPRIVATE long ImplScroll( long nNewPos, bool bCallEndScroll ); SAL_DLLPRIVATE long ImplDoAction( bool bCallEndScroll ); diff --git a/include/vcl/seleng.hxx b/include/vcl/seleng.hxx index 32625a74aaaf..140952b10b0d 100644 --- a/include/vcl/seleng.hxx +++ b/include/vcl/seleng.hxx @@ -93,8 +93,7 @@ private: public: SelectionEngine( vcl::Window* pWindow, - FunctionSet* pFunctions = nullptr, - sal_uLong nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL ); + FunctionSet* pFunctions = nullptr ); ~SelectionEngine(); // true: Event was processed by Selection Engine diff --git a/include/vcl/textview.hxx b/include/vcl/textview.hxx index f757651db086..bf9d229c114d 100644 --- a/include/vcl/textview.hxx +++ b/include/vcl/textview.hxx @@ -69,7 +69,7 @@ protected: TextPaM ImpDelete( sal_uInt8 nMode, sal_uInt8 nDelMode ); bool IsInSelection( const TextPaM& rPaM ); - void ImpPaint(vcl::RenderContext& rRenderContext, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange, TextSelection const* pSelection = nullptr); + void ImpPaint(vcl::RenderContext& rRenderContext, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pSelection); void ImpPaint(vcl::RenderContext& rRenderContext, const Rectangle& rRect); void ImpShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bEndKey ); void ImpHighlight( const TextSelection& rSel ); diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 0be3f77688d9..d69a66ce360c 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1188,8 +1188,6 @@ public: // transparent background for selected or checked items in toolboxes etc. void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder ); - // support rounded edges in the selection rect - void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder, Color* pSelectionTextColor, Color* pPaintColor ); void ShowTracking( const Rectangle& rRect, ShowTrackFlags nFlags = ShowTrackFlags::Small ); diff --git a/include/xmloff/XMLEventExport.hxx b/include/xmloff/XMLEventExport.hxx index ae3bb90befd5..a411e6dfd877 100644 --- a/include/xmloff/XMLEventExport.hxx +++ b/include/xmloff/XMLEventExport.hxx @@ -68,8 +68,7 @@ class XMLOFF_DLLPUBLIC XMLEventExport bool bExtNamespace; public: - XMLEventExport(SvXMLExport& rExport, - const XMLEventNameTranslation* pTranslationTable = nullptr); + XMLEventExport(SvXMLExport& rExport); ~XMLEventExport(); /// register an EventExportHandler for a particular script type diff --git a/include/xmloff/nmspmap.hxx b/include/xmloff/nmspmap.hxx index 0a2849df7d8c..b2926d9f9293 100644 --- a/include/xmloff/nmspmap.hxx +++ b/include/xmloff/nmspmap.hxx @@ -147,11 +147,9 @@ public: /* deprecated */ sal_uInt16 GetKeyByAttrName( const OUString& rAttrName, OUString *pPrefix, OUString *pLocalName, - OUString *pNamespace, - sal_uInt16 nIdxGuess = USHRT_MAX ) const; + OUString *pNamespace ) const; /* deprecated */ sal_uInt16 GetKeyByAttrName( const OUString& rAttrName, - OUString *pLocalName = nullptr, - sal_uInt16 nIdxGuess = USHRT_MAX ) const; + OUString *pLocalName = nullptr ) const; }; #endif // INCLUDED_XMLOFF_NMSPMAP_HXX diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx index 09d0796ae95f..e0d6344d30ab 100644 --- a/vcl/inc/brdwin.hxx +++ b/vcl/inc/brdwin.hxx @@ -64,23 +64,6 @@ namespace o3tl { template<> struct typed_flags<BorderWindowHitTest> : is_typed_flags<BorderWindowHitTest, 0xffff> {}; }; -enum class BorderWindowDraw { - Title = 0x0001, - Border = 0x0002, - Frame = 0x0004, - Close = 0x0008, - Roll = 0x0010, - Dock = 0x0020, - Hide = 0x0040, - Help = 0x0080, - Pin = 0x0100, - Menu = 0x0200, - All = Title | Border | Frame | Close | Roll | Dock | Hide | Help | Pin | Menu -}; -namespace o3tl { - template<> struct typed_flags<BorderWindowDraw> : is_typed_flags<BorderWindowDraw, 0x03ff> {}; -}; - enum class BorderWindowTitleType { Normal = 0x0001, Small = 0x0002, @@ -249,7 +232,7 @@ public: virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const = 0; virtual long CalcTitleWidth() const = 0; - virtual void DrawWindow(vcl::RenderContext& rRenderContext, BorderWindowDraw nDrawFlags, const Point* pOffset = nullptr) = 0; + virtual void DrawWindow(vcl::RenderContext& rRenderContext, const Point* pOffset = nullptr) = 0; virtual Rectangle GetMenuRect() const; static void ImplInitTitle( ImplBorderFrameData* pData ); @@ -268,7 +251,7 @@ public: virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const override; virtual long CalcTitleWidth() const override; - virtual void DrawWindow(vcl::RenderContext& rRenderContext, BorderWindowDraw nDrawFlags, const Point* pOffset = nullptr) override; + virtual void DrawWindow(vcl::RenderContext& rRenderContext, const Point* pOffset = nullptr) override; }; class ImplSmallBorderWindowView : public ImplBorderWindowView @@ -290,7 +273,7 @@ public: virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const override; virtual long CalcTitleWidth() const override; - virtual void DrawWindow(vcl::RenderContext& rRenderContext, BorderWindowDraw nDrawFlags, const Point* pOffset = nullptr) override; + virtual void DrawWindow(vcl::RenderContext& rRenderContext, const Point* pOffset = nullptr) override; }; class ImplStdBorderWindowView : public ImplBorderWindowView @@ -313,7 +296,7 @@ public: virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const override; virtual long CalcTitleWidth() const override; - virtual void DrawWindow(vcl::RenderContext& rRenderContext, BorderWindowDraw nDrawFlags, const Point* pOffset = nullptr) override; + virtual void DrawWindow(vcl::RenderContext& rRenderContext, const Point* pOffset = nullptr) override; }; #endif // INCLUDED_VCL_INC_BRDWIN_HXX diff --git a/vcl/inc/graphite_layout.hxx b/vcl/inc/graphite_layout.hxx index 83141fddd9a2..9d2211244b52 100644 --- a/vcl/inc/graphite_layout.hxx +++ b/vcl/inc/graphite_layout.hxx @@ -103,8 +103,7 @@ private: const grutils::GrFeatureParser * mpFeatures; public: - GraphiteLayout(const gr_face * pFace, gr_font * pFont = nullptr, - const grutils::GrFeatureParser * features = nullptr) throw(); + GraphiteLayout(const gr_face * pFace) throw(); // used by upper layers virtual bool LayoutText( ImplLayoutArgs& ) override; // first step of layout diff --git a/vcl/inc/listbox.hxx b/vcl/inc/listbox.hxx index 6e61d93011fc..0ce452ef6081 100644 --- a/vcl/inc/listbox.hxx +++ b/vcl/inc/listbox.hxx @@ -102,7 +102,7 @@ public: ImplEntryType* GetMutableEntryPtr( sal_Int32 nPos ) const { return GetEntry( nPos ); } void Clear(); - sal_Int32 FindMatchingEntry( const OUString& rStr, sal_Int32 nStart = 0, bool bForward = true, bool bLazy = true ) const; + sal_Int32 FindMatchingEntry( const OUString& rStr, sal_Int32 nStart, bool bLazy ) const; sal_Int32 FindEntry( const OUString& rStr, bool bSearchMRUArea = false ) const; sal_Int32 FindEntry( const void* pData ) const; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 1760760ad04d..0a151d25ae21 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -362,8 +362,7 @@ public: virtual bool IsNativeControlSupported( ControlType nType, ControlPart nPart ); // Query the native control to determine if it was acted upon - bool HitTestNativeControl( - ControlType nType, + bool HitTestNativeScrollbar( ControlPart nPart, const Rectangle& rControlRegion, const Point& aPos, diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index b6f44d43d8dc..7b044fb5e412 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -243,8 +243,7 @@ public: virtual bool GetOutline( SalGraphics&, basegfx::B2DPolyPolygonVector& ) const override; // used only by OutputDevice::ImplLayout, TODO: make friend - explicit MultiSalLayout( SalLayout& rBaseLayout, - const PhysicalFontFace* pBaseFont = nullptr ); + explicit MultiSalLayout( SalLayout& rBaseLayout ); void AddFallback( SalLayout& rFallbackLayout, ImplLayoutRuns&, const PhysicalFontFace* pFallbackFont ); virtual bool LayoutText( ImplLayoutArgs& ) override; diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index 8189d37c0809..bc0f390d0fc1 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -293,7 +293,7 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n } /* - * HitTestNativeControl() + * HitTestNativeScrollbar() * * If the return value is true, bIsInside contains information whether * aPos was or was not inside the native widget specified by the diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 9c5aa7c62bd0..4eceb395eb8c 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -355,18 +355,18 @@ IMPL_LINK_TYPED(ComboBox::Impl, ImplAutocompleteHdl, Edit&, rEdit, void) if (!m_isMatchCase) { // Try match case insensitive from current position - nPos = m_pImplLB->GetEntryList()->FindMatchingEntry(aStartText, nStart); + nPos = m_pImplLB->GetEntryList()->FindMatchingEntry(aStartText, nStart, true); if ( nPos == LISTBOX_ENTRY_NOTFOUND ) // Try match case insensitive, but from start - nPos = m_pImplLB->GetEntryList()->FindMatchingEntry(aStartText); + nPos = m_pImplLB->GetEntryList()->FindMatchingEntry(aStartText, 0, true); } if ( nPos == LISTBOX_ENTRY_NOTFOUND ) // Try match full from current position - nPos = m_pImplLB->GetEntryList()->FindMatchingEntry(aStartText, nStart, true, false); + nPos = m_pImplLB->GetEntryList()->FindMatchingEntry(aStartText, nStart, false); if ( nPos == LISTBOX_ENTRY_NOTFOUND ) // Match full, but from start - nPos = m_pImplLB->GetEntryList()->FindMatchingEntry(aStartText, 0, true, false); + nPos = m_pImplLB->GetEntryList()->FindMatchingEntry(aStartText, 0, false); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { @@ -870,7 +870,7 @@ void ComboBox::Impl::ImplUpdateFloatSelection() nSelect = m_pImplLB->GetEntryList()->FindEntry( aSearchStr ); if ( nSelect == LISTBOX_ENTRY_NOTFOUND ) { - nSelect = m_pImplLB->GetEntryList()->FindMatchingEntry( aSearchStr ); + nSelect = m_pImplLB->GetEntryList()->FindMatchingEntry( aSearchStr, 0, true ); bSelect = false; } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 02103dfe5a11..304494e98068 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -241,19 +241,14 @@ sal_Int32 ImplEntryList::FindEntry( const OUString& rString, bool bSearchMRUArea return LISTBOX_ENTRY_NOTFOUND; } -sal_Int32 ImplEntryList::FindMatchingEntry( const OUString& rStr, sal_Int32 nStart, bool bForward, bool bLazy ) const +sal_Int32 ImplEntryList::FindMatchingEntry( const OUString& rStr, sal_Int32 nStart, bool bLazy ) const { sal_Int32 nPos = LISTBOX_ENTRY_NOTFOUND; sal_Int32 nEntryCount = GetEntryCount(); - if ( !bForward ) - nStart++; // decrements right away const vcl::I18nHelper& rI18nHelper = mpWindow->GetSettings().GetLocaleI18nHelper(); - for ( sal_Int32 n = nStart; bForward ? n < nEntryCount : n != 0; ) + for ( sal_Int32 n = nStart; n < nEntryCount; ) { - if ( !bForward ) - n--; - ImplEntryType* pImplEntry = GetEntry( n ); bool bMatch; if ( bLazy ) @@ -270,8 +265,7 @@ sal_Int32 ImplEntryList::FindMatchingEntry( const OUString& rStr, sal_Int32 nSta break; } - if ( bForward ) - n++; + n++; } return nPos; diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 5ac987e5dd8b..79f8c6bdef31 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -30,16 +30,16 @@ /* #i77549# HACK: for scrollbars in case of thumb rect, page up and page down rect we - abuse the HitTestNativeControl interface. All theming engines but OS X + abuse the HitTestNativeScrollbar interface. All theming engines but OS X are actually able to draw the thumb according to our internal representation. However OS X draws a little outside. The canonical way would be to enhance the - HitTestNativeControl passing a ScrollbarValue additionally so all necessary + HitTestNativeScrollbar passing a ScrollbarValue additionally so all necessary information is available in the call. . However since there is only this one small exception we will deviate a little and instead pass the respective rect as control region to allow for a small correction. - So all places using HitTestNativeControl on ControlPart::ThumbHorz, ControlPart::ThumbVert, + So all places using HitTestNativeScrollbar on ControlPart::ThumbHorz, ControlPart::ThumbVert, ControlPart::TrackHorzLeft, ControlPart::TrackHorzRight, ControlPart::TrackVertUpper, ControlPart::TrackVertLower do not use the control rectangle as region but the actuall part rectangle, making only small deviations feasible. @@ -53,9 +53,6 @@ #define SCRBAR_DRAW_PAGE2 ((sal_uInt16)0x0008) #define SCRBAR_DRAW_THUMB ((sal_uInt16)0x0010) #define SCRBAR_DRAW_BACKGROUND ((sal_uInt16)0x0020) -#define SCRBAR_DRAW_ALL (SCRBAR_DRAW_BTN1 | SCRBAR_DRAW_BTN2 | \ - SCRBAR_DRAW_PAGE1 | SCRBAR_DRAW_PAGE2 |\ - SCRBAR_DRAW_THUMB | SCRBAR_DRAW_BACKGROUND ) #define SCRBAR_STATE_BTN1_DOWN ((sal_uInt16)0x0001) #define SCRBAR_STATE_BTN1_DISABLE ((sal_uInt16)0x0002) @@ -428,7 +425,7 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& /* rSiz maPage1Rect+=aPos; maPage2Rect+=aPos; - ImplDraw(*pDev, SCRBAR_DRAW_ALL); + ImplDraw(*pDev); pDev->Pop(); mbCalcSize = true; @@ -607,7 +604,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD return bNativeOK; } -void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags) +void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext) { DecorationView aDecoView(&rRenderContext); Rectangle aTempRect; @@ -625,13 +622,13 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla // pWin = static_cast<vcl::Window*>(&rRenderContext); // Draw the entire control if the native theme engine needs it - if (nDrawFlags && rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, ControlPart::DrawBackgroundHorz)) + if (rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, ControlPart::DrawBackgroundHorz)) { ImplDrawNative(rRenderContext, SCRBAR_DRAW_BACKGROUND); return; } - if ((nDrawFlags & SCRBAR_DRAW_BTN1) && (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_BTN1))) + if (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_BTN1)) { nStyle = DrawButtonFlags::NoLightBorder; if (mnStateFlags & SCRBAR_STATE_BTN1_DOWN) @@ -648,7 +645,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla aDecoView.DrawSymbol(aTempRect, eSymbolType, rStyleSettings.GetButtonTextColor(), nSymbolStyle); } - if ((nDrawFlags & SCRBAR_DRAW_BTN2) && (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_BTN2))) + if (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_BTN2)) { nStyle = DrawButtonFlags::NoLightBorder; if (mnStateFlags & SCRBAR_STATE_BTN2_DOWN) @@ -667,7 +664,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla rRenderContext.SetLineColor(); - if ((nDrawFlags & SCRBAR_DRAW_THUMB) && (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_THUMB))) + if (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_THUMB)) { if (!maThumbRect.IsEmpty()) { @@ -684,7 +681,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla } } - if ((nDrawFlags & SCRBAR_DRAW_PAGE1) && (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_PAGE1))) + if (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_PAGE1)) { if (mnStateFlags & SCRBAR_STATE_PAGE1_DOWN) rRenderContext.SetFillColor(rStyleSettings.GetShadowColor()); @@ -692,7 +689,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla rRenderContext.SetFillColor(rStyleSettings.GetCheckedColor()); rRenderContext.DrawRect(PixelToLogic(maPage1Rect)); } - if ((nDrawFlags & SCRBAR_DRAW_PAGE2) && (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_PAGE2))) + if (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_PAGE2)) { if (mnStateFlags & SCRBAR_STATE_PAGE2_DOWN) rRenderContext.SetFillColor(rStyleSettings.GetShadowColor()); @@ -759,7 +756,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) switch ( meScrollType ) { case ScrollType::LineUp: - if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp, + if ( HitTestNativeScrollbar( bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp, aControlRegion, rMousePos, bIsInside )? bIsInside: maBtn1Rect.IsInside( rMousePos ) ) @@ -772,7 +769,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) break; case ScrollType::LineDown: - if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown, + if ( HitTestNativeScrollbar( bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown, aControlRegion, rMousePos, bIsInside )? bIsInside: maBtn2Rect.IsInside( rMousePos ) ) @@ -785,8 +782,8 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) break; case ScrollType::PageUp: - // HitTestNativeControl, see remark at top of file - if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzLeft: ControlPart::TrackVertUpper, + // HitTestNativeScrollbar, see remark at top of file + if ( HitTestNativeScrollbar( bHorizontal? ControlPart::TrackHorzLeft: ControlPart::TrackVertUpper, maPage1Rect, rMousePos, bIsInside )? bIsInside: maPage1Rect.IsInside( rMousePos ) ) @@ -799,8 +796,8 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) break; case ScrollType::PageDown: - // HitTestNativeControl, see remark at top of file - if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzRight: ControlPart::TrackVertLower, + // HitTestNativeScrollbar, see remark at top of file + if ( HitTestNativeScrollbar( bHorizontal? ControlPart::TrackHorzRight: ControlPart::TrackVertLower, maPage2Rect, rMousePos, bIsInside )? bIsInside: maPage2Rect.IsInside( rMousePos ) ) @@ -845,7 +842,7 @@ void ScrollBar::ImplDragThumb( const Point& rMousePos ) // When dragging in windows the repaint request gets starved so dragging // the scrollbar feels slower than it actually is. Let's force an immediate // repaint of the scrollbar. - ImplDraw(*this, SCRBAR_DRAW_ALL); + ImplDraw(*this); mnDelta = mnThumbPos-nOldPos; Scroll(); @@ -884,7 +881,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) Point aPoint( 0, 0 ); Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); - if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp, + if ( HitTestNativeScrollbar( bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp, aControlRegion, rMousePos, bIsInside )? bIsInside: maBtn1Rect.IsInside( rMousePos ) ) @@ -896,7 +893,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) mnDragDraw = SCRBAR_DRAW_BTN1; } } - else if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown, + else if ( HitTestNativeScrollbar( bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown, aControlRegion, rMousePos, bIsInside )? bIsInside: maBtn2Rect.IsInside( rMousePos ) ) @@ -910,7 +907,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) } else { - bool bThumbHit = HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::ThumbHorz : ControlPart::ThumbVert, + bool bThumbHit = HitTestNativeScrollbar( bHorizontal? ControlPart::ThumbHorz : ControlPart::ThumbVert, maThumbRect, rMousePos, bIsInside ) ? bIsInside : maThumbRect.IsInside( rMousePos ); @@ -956,14 +953,14 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) Invalidate(); } } - else if(bPage && (!HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzArea : ControlPart::TrackVertArea, + else if(bPage && (!HitTestNativeScrollbar( bHorizontal? ControlPart::TrackHorzArea : ControlPart::TrackVertArea, aControlRegion, rMousePos, bIsInside ) || bIsInside) ) { nTrackFlags = StartTrackingFlags::ButtonRepeat; - // HitTestNativeControl, see remark at top of file - if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzLeft : ControlPart::TrackVertUpper, + // HitTestNativeScrollbar, see remark at top of file + if ( HitTestNativeScrollbar( bHorizontal? ControlPart::TrackHorzLeft : ControlPart::TrackVertUpper, maPage1Rect, rMousePos, bIsInside )? bIsInside: maPage1Rect.IsInside( rMousePos ) ) @@ -1117,7 +1114,7 @@ void ScrollBar::ApplySettings(vcl::RenderContext& rRenderContext) void ScrollBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) { - ImplDraw(rRenderContext, SCRBAR_DRAW_ALL); + ImplDraw(rRenderContext); } void ScrollBar::Resize() @@ -1237,30 +1234,30 @@ Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt ) Point aPoint( 0, 0 ); Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); - if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp, + if( HitTestNativeScrollbar( bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp, aControlRegion, rPt, bIsInside )? bIsInside: maBtn1Rect.IsInside( rPt ) ) return &maBtn1Rect; - else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown, + else if( HitTestNativeScrollbar( bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown, aControlRegion, rPt, bIsInside )? bIsInside: maBtn2Rect.IsInside( rPt ) ) return &maBtn2Rect; - // HitTestNativeControl, see remark at top of file - else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal ? ControlPart::TrackHorzLeft : ControlPart::TrackVertUpper, + // HitTestNativeScrollbar, see remark at top of file + else if( HitTestNativeScrollbar( bHorizontal ? ControlPart::TrackHorzLeft : ControlPart::TrackVertUpper, maPage1Rect, rPt, bIsInside)? bIsInside: maPage1Rect.IsInside( rPt ) ) return &maPage1Rect; - // HitTestNativeControl, see remark at top of file - else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal ? ControlPart::TrackHorzRight : ControlPart::TrackVertLower, + // HitTestNativeScrollbar, see remark at top of file + else if( HitTestNativeScrollbar( bHorizontal ? ControlPart::TrackHorzRight : ControlPart::TrackVertLower, maPage2Rect, rPt, bIsInside)? bIsInside: maPage2Rect.IsInside( rPt ) ) return &maPage2Rect; - // HitTestNativeControl, see remark at top of file - else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal ? ControlPart::ThumbHorz : ControlPart::ThumbVert, + // HitTestNativeScrollbar, see remark at top of file + else if( HitTestNativeScrollbar( bHorizontal ? ControlPart::ThumbHorz : ControlPart::ThumbVert, maThumbRect, rPt, bIsInside)? bIsInside: maThumbRect.IsInside( rPt ) ) diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 99f83fc0edf0..790077b4b086 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -292,7 +292,7 @@ void TextView::DeleteSelected() ShowCursor(); } -void TextView::ImpPaint(vcl::RenderContext& rRenderContext, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange, TextSelection const* pSelection) +void TextView::ImpPaint(vcl::RenderContext& rRenderContext, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pSelection) { if (!mpImpl->mbPaintSelection) { @@ -314,7 +314,7 @@ void TextView::ImpPaint(vcl::RenderContext& rRenderContext, const Point& rStartP } } - mpImpl->mpTextEngine->ImpPaint(&rRenderContext, rStartPos, pPaintArea, pPaintRange, pSelection); + mpImpl->mpTextEngine->ImpPaint(&rRenderContext, rStartPos, pPaintArea, nullptr, pSelection); } void TextView::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) @@ -332,7 +332,7 @@ void TextView::ImpPaint(vcl::RenderContext& rRenderContext, const Rectangle& rRe pDrawSelection = &mpImpl->maSelection; Point aStartPos = ImpGetOutputStartPos(mpImpl->maStartDocPos); - ImpPaint(rRenderContext, aStartPos, &rRect, nullptr, pDrawSelection); + ImpPaint(rRenderContext, aStartPos, &rRect, pDrawSelection); if (mpImpl->mbHighlightSelection) ImpHighlight(mpImpl->maSelection); } diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx index 50ecf8caedd2..d83e94202c73 100644 --- a/vcl/source/filter/ixbm/xbmread.cxx +++ b/vcl/source/filter/ixbm/xbmread.cxx @@ -48,8 +48,7 @@ class XBMReader : public GraphicReader bool bStatus; void InitTable(); - OString FindTokenLine( SvStream* pInStm, const char* pTok1, - const char* pTok2, const char* pTok3 = nullptr ); + OString FindTokenLine( SvStream* pInStm, const char* pTok1, const char* pTok2 ); long ParseDefine( const sal_Char* pDefine ); bool ParseData( SvStream* pInStm, const OString& aLastLine, XBMFormat eFormat ); @@ -119,10 +118,10 @@ void XBMReader::InitTable() } OString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1, - const char* pTok2, const char* pTok3 ) + const char* pTok2 ) { OString aRet; - sal_Int32 nPos1, nPos2, nPos3; + sal_Int32 nPos1, nPos2; bStatus = false; @@ -145,14 +144,6 @@ OString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1, ( nPos2 > nPos1 ) ) { bStatus = true; - - if( pTok3 ) - { - bStatus = false; - - if( ( ( nPos3 = aRet.indexOf( pTok3 ) ) != -1 ) && ( nPos3 > nPos2 ) ) - bStatus = true; - } } } } diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 3c9e6a0e38af..4d0746fd2107 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -612,7 +612,7 @@ bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pP return drawEPS( nX, nY, nWidth, nHeight, pPtr, nSize ); } -bool SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, +bool SalGraphics::HitTestNativeScrollbar( ControlPart nPart, const Rectangle& rControlRegion, const Point& aPos, bool& rIsInside, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) @@ -621,10 +621,10 @@ bool SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, co Rectangle rgn( rControlRegion ); mirror( pt.X(), pOutDev ); mirror( rgn, pOutDev ); - return hitTestNativeControl( nType, nPart, rgn, pt, rIsInside ); + return hitTestNativeControl( ControlType::Scrollbar, nPart, rgn, pt, rIsInside ); } else - return hitTestNativeControl( nType, nPart, rControlRegion, aPos, rIsInside ); + return hitTestNativeControl( ControlType::Scrollbar, nPart, rControlRegion, aPos, rIsInside ); } void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev ) const diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 2227def1b8e6..8aaefbfdb4ee 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1433,13 +1433,13 @@ void GenericSalLayout::SortGlyphItems() } } -MultiSalLayout::MultiSalLayout( SalLayout& rBaseLayout, const PhysicalFontFace* pBaseFont ) +MultiSalLayout::MultiSalLayout( SalLayout& rBaseLayout ) : SalLayout() , mnLevel( 1 ) , mbIncomplete( false ) { //maFallbackRuns[0].Clear(); - mpFallbackFonts[ 0 ] = pBaseFont; + mpFallbackFonts[ 0 ] = nullptr; mpLayouts[ 0 ] = &rBaseLayout; mnUnitsPerPixel = rBaseLayout.GetUnitsPerPixel(); } diff --git a/vcl/source/gdi/salnativewidgets-none.cxx b/vcl/source/gdi/salnativewidgets-none.cxx index baa2cb398930..99e8882c9a5f 100644 --- a/vcl/source/gdi/salnativewidgets-none.cxx +++ b/vcl/source/gdi/salnativewidgets-none.cxx @@ -35,7 +35,7 @@ bool SalGraphics::IsNativeControlSupported( ControlType, ControlPart ) } /* - * HitTestNativeControl() + * HitTestNativeScrollbar() * * If the return value is true, bIsInside contains information whether * aPos was or was not inside the native widget specified by the diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index f1eb4618d368..188ee727d82f 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -362,14 +362,13 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs, // An implementation of the SalLayout interface to enable Graphite enabled fonts to be used. -GraphiteLayout::GraphiteLayout(const gr_face * face, gr_font * font, - const grutils::GrFeatureParser * pFeatures) throw() +GraphiteLayout::GraphiteLayout(const gr_face * face) throw() : mpFace(face) - , mpFont(font) + , mpFont(nullptr) , mnSegCharOffset(0) , mnWidth(0) , mfScaling(1.0) - , mpFeatures(pFeatures) + , mpFeatures(nullptr) { } diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx index 947e5cc177f2..01bcb85f78a3 100644 --- a/vcl/source/outdev/nativecontrols.cxx +++ b/vcl/source/outdev/nativecontrols.cxx @@ -168,7 +168,7 @@ bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPar return( mpGraphics->IsNativeControlSupported(nType, nPart) ); } -bool OutputDevice::HitTestNativeControl( ControlType nType, +bool OutputDevice::HitTestNativeScrollbar( ControlPart nPart, const Rectangle& rControlRegion, const Point& aPos, @@ -185,8 +185,8 @@ bool OutputDevice::HitTestNativeControl( ControlType nType, Rectangle screenRegion( rControlRegion ); screenRegion.Move( aWinOffs.X(), aWinOffs.Y()); - return( mpGraphics->HitTestNativeControl(nType, nPart, screenRegion, Point( aPos.X() + mnOutOffX, aPos.Y() + mnOutOffY ), - rIsInside, this ) ); + return mpGraphics->HitTestNativeScrollbar( nPart, screenRegion, Point( aPos.X() + mnOutOffX, aPos.Y() + mnOutOffY ), + rIsInside, this ); } static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplControlValue& rVal, const OutputDevice& rDev ) diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index a17f085140be..842fe831cf65 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -432,7 +432,7 @@ long ImplNoBorderWindowView::CalcTitleWidth() const return 0; } -void ImplNoBorderWindowView::DrawWindow(vcl::RenderContext&, BorderWindowDraw, const Point*) +void ImplNoBorderWindowView::DrawWindow(vcl::RenderContext&, const Point*) { } @@ -626,7 +626,7 @@ long ImplSmallBorderWindowView::CalcTitleWidth() const return 0; } -void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, BorderWindowDraw nDrawFlags, const Point*) +void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, const Point*) { WindowBorderStyle nBorderStyle = mpBorderWindow->GetBorderStyle(); if (nBorderStyle & WindowBorderStyle::NOBORDER) @@ -759,30 +759,27 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B if (bNativeOK) return; - if (nDrawFlags & BorderWindowDraw::Frame) - { - DrawFrameStyle nStyle = DrawFrameStyle::NONE; - DrawFrameFlags nFlags = DrawFrameFlags::NONE; - // move border outside if border was converted or if the border window is a frame window, - if (mpBorderWindow->mbSmallOutBorder) - nStyle = DrawFrameStyle::DoubleOut; - else if (nBorderStyle & WindowBorderStyle::NWF) - nStyle = DrawFrameStyle::NWF; - else - nStyle = DrawFrameStyle::DoubleIn; - if (nBorderStyle & WindowBorderStyle::MONO) - nFlags |= DrawFrameFlags::Mono; - if (nBorderStyle & WindowBorderStyle::MENU) - nFlags |= DrawFrameFlags::Menu; - // tell DrawFrame that we're drawing a window border of a frame window to avoid round corners - if (mpBorderWindow == mpBorderWindow->ImplGetFrameWindow()) - nFlags |= DrawFrameFlags::WindowBorder; - - DecorationView aDecoView(&rRenderContext); - Point aTmpPoint; - Rectangle aInRect(aTmpPoint, Size(mnWidth, mnHeight)); - aDecoView.DrawFrame(aInRect, nStyle, nFlags); - } + DrawFrameStyle nStyle = DrawFrameStyle::NONE; + DrawFrameFlags nFlags = DrawFrameFlags::NONE; + // move border outside if border was converted or if the border window is a frame window, + if (mpBorderWindow->mbSmallOutBorder) + nStyle = DrawFrameStyle::DoubleOut; + else if (nBorderStyle & WindowBorderStyle::NWF) + nStyle = DrawFrameStyle::NWF; + else + nStyle = DrawFrameStyle::DoubleIn; + if (nBorderStyle & WindowBorderStyle::MONO) + nFlags |= DrawFrameFlags::Mono; + if (nBorderStyle & WindowBorderStyle::MENU) + nFlags |= DrawFrameFlags::Menu; + // tell DrawFrame that we're drawing a window border of a frame window to avoid round corners + if (mpBorderWindow == mpBorderWindow->ImplGetFrameWindow()) + nFlags |= DrawFrameFlags::WindowBorder; + + DecorationView aDecoView(&rRenderContext); + Point aTmpPoint; + Rectangle aInRect(aTmpPoint, Size(mnWidth, mnHeight)); + aDecoView.DrawFrame(aInRect, nStyle, nFlags); } @@ -1527,7 +1524,7 @@ long ImplStdBorderWindowView::CalcTitleWidth() const return ImplCalcTitleWidth( &maFrameData ); } -void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, BorderWindowDraw nDrawFlags, const Point* pOffset) +void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, const Point* pOffset) { ImplBorderFrameData* pData = &maFrameData; ImplBorderWindow* pBorderWindow = pData->mpBorderWindow; @@ -1541,47 +1538,42 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, Bor aFrameColor.DecreaseContrast(sal_uInt8(0.5 * 255)); // Draw Frame - if (nDrawFlags & BorderWindowDraw::Frame) - { - vcl::Region oldClipRgn(rRenderContext.GetClipRegion()); + vcl::Region oldClipRgn(rRenderContext.GetClipRegion()); - // for popups, don't draw part of the frame - if (pData->mnTitleType == BorderWindowTitleType::Popup) + // for popups, don't draw part of the frame + if (pData->mnTitleType == BorderWindowTitleType::Popup) + { + FloatingWindow* pWin = dynamic_cast<FloatingWindow*>(pData->mpBorderWindow->GetWindow(GetWindowType::Client)); + if (pWin) { - FloatingWindow* pWin = dynamic_cast<FloatingWindow*>(pData->mpBorderWindow->GetWindow(GetWindowType::Client)); - if (pWin) + vcl::Region aClipRgn(aInRect); + Rectangle aItemClipRect(pWin->ImplGetItemEdgeClipRect()); + if (!aItemClipRect.IsEmpty()) { - vcl::Region aClipRgn(aInRect); - Rectangle aItemClipRect(pWin->ImplGetItemEdgeClipRect()); - if (!aItemClipRect.IsEmpty()) - { - aItemClipRect.SetPos(pData->mpBorderWindow->AbsoluteScreenToOutputPixel(aItemClipRect.TopLeft())); - aClipRgn.Exclude(aItemClipRect); - rRenderContext.SetClipRegion(aClipRgn); - } + aItemClipRect.SetPos(pData->mpBorderWindow->AbsoluteScreenToOutputPixel(aItemClipRect.TopLeft())); + aClipRgn.Exclude(aItemClipRect); + rRenderContext.SetClipRegion(aClipRgn); } } - - // single line frame - rRenderContext.SetLineColor(aFrameColor); - rRenderContext.SetFillColor(); - rRenderContext.DrawRect(aInRect); - ++aInRect.Left(); - --aInRect.Right(); - ++aInRect.Top(); - --aInRect.Bottom(); - - // restore - if (pData->mnTitleType == BorderWindowTitleType::Popup) - rRenderContext.SetClipRegion(oldClipRgn); } - else - aInRect = aDecoView.DrawFrame(aInRect, DrawFrameStyle::DoubleOut, DrawFrameFlags::NoDraw); + + // single line frame + rRenderContext.SetLineColor(aFrameColor); + rRenderContext.SetFillColor(); + rRenderContext.DrawRect(aInRect); + ++aInRect.Left(); + --aInRect.Right(); + ++aInRect.Top(); + --aInRect.Bottom(); + + // restore + if (pData->mnTitleType == BorderWindowTitleType::Popup) + rRenderContext.SetClipRegion(oldClipRgn); // Draw Border rRenderContext.SetLineColor(); long nBorderSize = pData->mnBorderSize; - if ((nDrawFlags & BorderWindowDraw::Border) && nBorderSize) + if (nBorderSize) { rRenderContext.SetFillColor(rStyleSettings.GetFaceColor()); rRenderContext.DrawRect(Rectangle(Point(aInRect.Left(), aInRect.Top()), @@ -1595,7 +1587,7 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, Bor } // Draw Title - if ((nDrawFlags & BorderWindowDraw::Title) && !pData->maTitleRect.IsEmpty()) + if (!pData->maTitleRect.IsEmpty()) { aInRect = pData->maTitleRect; @@ -1646,40 +1638,35 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, Bor } } - if (((nDrawFlags & BorderWindowDraw::Close) || (nDrawFlags & BorderWindowDraw::Title)) - && !pData->maCloseRect.IsEmpty()) + if (!pData->maCloseRect.IsEmpty()) { Rectangle aSymbolRect(pData->maCloseRect); if (pOffset) aSymbolRect.Move(pOffset->X(), pOffset->Y()); ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::CLOSE, pData->mnCloseState); } - if (((nDrawFlags & BorderWindowDraw::Dock) || (nDrawFlags & BorderWindowDraw::Title)) - && !pData->maDockRect.IsEmpty()) + if (!pData->maDockRect.IsEmpty()) { Rectangle aSymbolRect(pData->maDockRect); if (pOffset) aSymbolRect.Move(pOffset->X(), pOffset->Y()); ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::DOCK, pData->mnDockState); } - if (((nDrawFlags & BorderWindowDraw::Menu) || (nDrawFlags & BorderWindowDraw::Title)) - && !pData->maMenuRect.IsEmpty()) + if (!pData->maMenuRect.IsEmpty()) { Rectangle aSymbolRect(pData->maMenuRect); if (pOffset) aSymbolRect.Move(pOffset->X(), pOffset->Y()); ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::MENU, pData->mnMenuState); } - if (((nDrawFlags & BorderWindowDraw::Hide) || (nDrawFlags & BorderWindowDraw::Title)) - && !pData->maHideRect.IsEmpty()) + if (!pData->maHideRect.IsEmpty()) { Rectangle aSymbolRect(pData->maHideRect); if (pOffset) aSymbolRect.Move(pOffset->X(), pOffset->Y()); ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::HIDE, pData->mnHideState); } - if (((nDrawFlags & BorderWindowDraw::Roll) || (nDrawFlags & BorderWindowDraw::Title)) - && !pData->maRollRect.IsEmpty()) + if (!pData->maRollRect.IsEmpty()) { SymbolType eType; if (pBorderWindow->mbRollUp) @@ -1692,16 +1679,14 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, Bor ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, eType, pData->mnRollState); } - if (((nDrawFlags & BorderWindowDraw::Help) || (nDrawFlags & BorderWindowDraw::Title)) - && !pData->maHelpRect.IsEmpty()) + if (!pData->maHelpRect.IsEmpty()) { Rectangle aSymbolRect(pData->maHelpRect); if (pOffset) aSymbolRect.Move(pOffset->X(), pOffset->Y()); ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::HELP, pData->mnHelpState); } - if (((nDrawFlags & BorderWindowDraw::Pin) || (nDrawFlags & BorderWindowDraw::Title)) - && !pData->maPinRect.IsEmpty()) + if (!pData->maPinRect.IsEmpty()) { Image aImage; ImplGetPinImage(pData->mnPinState, pBorderWindow->mbPinned, aImage); @@ -1857,13 +1842,13 @@ void ImplBorderWindow::Tracking( const TrackingEvent& rTEvt ) void ImplBorderWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) { if (mpBorderView) - mpBorderView->DrawWindow(rRenderContext, BorderWindowDraw::All); + mpBorderView->DrawWindow(rRenderContext); } void ImplBorderWindow::Draw( const Rectangle&, OutputDevice* pOutDev, const Point& rPos ) { if (mpBorderView) - mpBorderView->DrawWindow(*pOutDev, BorderWindowDraw::All, &rPos); + mpBorderView->DrawWindow(*pOutDev, &rPos); } void ImplBorderWindow::Activate() diff --git a/vcl/source/window/popupmenuwindow.cxx b/vcl/source/window/popupmenuwindow.cxx index e9388732ae6c..310d7550b202 100644 --- a/vcl/source/window/popupmenuwindow.cxx +++ b/vcl/source/window/popupmenuwindow.cxx @@ -38,8 +38,8 @@ PopupMenuFloatingWindow::ImplData::~ImplData() { } -PopupMenuFloatingWindow::PopupMenuFloatingWindow( vcl::Window* pParent, WinBits nStyle ) : - FloatingWindow(pParent, nStyle), +PopupMenuFloatingWindow::PopupMenuFloatingWindow( vcl::Window* pParent ) : + FloatingWindow(pParent, WB_SYSTEMFLOATWIN | WB_SYSTEMWINDOW | WB_NOBORDER ), mpImplData(new ImplData) { } diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx index 05899554205d..b9f09fc30088 100644 --- a/vcl/source/window/seleng.cxx +++ b/vcl/source/window/seleng.cxx @@ -33,10 +33,9 @@ inline bool SelectionEngine::ShouldDeselect( bool bModifierKey1 ) const // TODO: throw out FunctionSet::SelectAtPoint -SelectionEngine::SelectionEngine( vcl::Window* pWindow, FunctionSet* pFuncSet, - sal_uLong nAutoRepeatInterval ) : +SelectionEngine::SelectionEngine( vcl::Window* pWindow, FunctionSet* pFuncSet ) : pWin( pWindow ), - nUpdateInterval( nAutoRepeatInterval ) + nUpdateInterval( SELENG_AUTOREPEAT_INTERVAL ) { eSelMode = SelectionMode::Single; pFunctionSet = pFuncSet; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index ac14dd2c4f09..2e1b9d527101 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3293,17 +3293,10 @@ void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& mpOutDevData->mpRecordLayout = nullptr; } -void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder ) -{ - DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, nullptr, nullptr ); -} - void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, bool bChecked, - bool bDrawBorder, - Color* pSelectionTextColor, - Color* pPaintColor + bool bDrawBorder ) { if( rRect.IsEmpty() ) @@ -3312,7 +3305,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, const StyleSettings& rStyles = GetSettings().GetStyleSettings(); // colors used for item highlighting - Color aSelectionBorderCol( pPaintColor ? *pPaintColor : rStyles.GetHighlightColor() ); + Color aSelectionBorderCol( rStyles.GetHighlightColor() ); Color aSelectionFillCol( aSelectionBorderCol ); bool bDark = rStyles.GetFaceColor().IsDark(); @@ -3321,7 +3314,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, int c1 = aSelectionBorderCol.GetLuminance(); int c2 = GetDisplayBackground().GetColor().GetLuminance(); - if( !bDark && !bBright && abs( c2-c1 ) < (pPaintColor ? 40 : 75) ) + if( !bDark && !bBright && abs( c2-c1 ) < 75 ) { // constrast too low sal_uInt16 h,s,b; @@ -3396,14 +3389,6 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, } SetFillColor( aSelectionFillCol ); - if( pSelectionTextColor ) - { - Color aTextColor = IsControlBackground() ? GetControlForeground() : rStyles.GetButtonTextColor(); - Color aHLTextColor = rStyles.GetHighlightTextColor(); - int nTextDiff = abs(aSelectionFillCol.GetLuminance() - aTextColor.GetLuminance()); - int nHLDiff = abs(aSelectionFillCol.GetLuminance() - aHLTextColor.GetLuminance()); - *pSelectionTextColor = (nHLDiff >= nTextDiff) ? aHLTextColor : aTextColor; - } if( bDark ) { diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 18de0da3a981..bef9ab36e3fd 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -1572,8 +1572,8 @@ PPDValue* PPDKey::insertValue(const OUString& rOption, PPDValueType eType, bool * PPDContext */ -PPDContext::PPDContext( const PPDParser* pParser ) : - m_pParser( pParser ) +PPDContext::PPDContext() : + m_pParser( nullptr ) { } diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx index d096423d263b..b5810a87926d 100644 --- a/vcl/unx/gtk/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx @@ -742,7 +742,7 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP } /* - * HitTestNativeControl() + * HitTestNativeScrollbar() * * bIsInside is set to true if aPos is contained within the * given part of the control, whose bounding region is diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index c8e3b38cdc3e..7c0864cfb151 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -341,7 +341,7 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP } /* - * HitTestNativeControl() + * HitTestNativeScrollbar() * * If the return value is TRUE, bIsInside contains information whether * aPos was or was not inside the native widget specified by the diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx index e86b65908583..8f6cb4801aca 100644 --- a/xmloff/source/core/nmspmap.cxx +++ b/xmloff/source/core/nmspmap.cxx @@ -424,8 +424,7 @@ sal_uInt16 SvXMLNamespaceMap::GetIndexByPrefix( const OUString& rPrefix ) const } sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName( const OUString& rAttrName, - OUString *pLocalName, - sal_uInt16 /*nIdxGuess*/) const + OUString *pLocalName) const { return GetKeyByAttrName_( rAttrName, nullptr, pLocalName ); } @@ -433,8 +432,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName( sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName( const OUString& rAttrName, OUString *pPrefix, OUString *pLocalName, - OUString *pNamespace, - sal_uInt16 /*nIdxGuess*/ ) const + OUString *pNamespace ) const { return GetKeyByAttrName_ ( rAttrName, pPrefix, pLocalName, pNamespace ); } diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 8ed21181dff9..2123dff241d4 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -2026,7 +2026,7 @@ XMLEventExport& SvXMLExport::GetEventExport() if( nullptr == mpEventExport) { // create EventExport on demand - mpEventExport = new XMLEventExport(*this, nullptr); + mpEventExport = new XMLEventExport(*this); // and register standard handlers + names OUString sStarBasic("StarBasic"); diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index 2091232f2b98..c7cb41dabd22 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -41,13 +41,11 @@ using ::com::sun::star::container::XNameAccess; using ::xmloff::token::XML_EVENT_LISTENERS; -XMLEventExport::XMLEventExport(SvXMLExport& rExp, - const XMLEventNameTranslation* pTranslationTable) : +XMLEventExport::XMLEventExport(SvXMLExport& rExp) : sEventType("EventType"), rExport(rExp), bExtNamespace(false) { - AddTranslationTable(pTranslationTable); } XMLEventExport::~XMLEventExport() diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 743b5ee239f6..9802f87b195c 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -529,8 +529,8 @@ public: inline WindowElement( OUString const & rLocalName, css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, - ElementBase * pParent, DialogImport * pImport ) - : ControlElement( rLocalName, xAttributes, pParent, pImport ) + DialogImport * pImport ) + : ControlElement( rLocalName, xAttributes, nullptr, pImport ) {} }; diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 3b53820b090c..8bec171b0478 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -1747,7 +1747,7 @@ Reference< xml::input::XElement > DialogImport::startRootElement( // window else if ( rLocalName == "window" ) { - return new WindowElement( rLocalName, xAttributes, nullptr, this ); + return new WindowElement( rLocalName, xAttributes, this ); } else { diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx index 7ef444abaeae..316b3a0d4007 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx @@ -144,9 +144,9 @@ void BasicElementBase::processingInstruction( const OUString& /*rTarget*/, const BasicLibrariesElement::BasicLibrariesElement( const OUString& rLocalName, const Reference< xml::input::XAttributes >& xAttributes, - BasicElementBase* pParent, BasicImport* pImport, + BasicImport* pImport, const Reference< script::XLibraryContainer2 >& rxLibContainer ) - :BasicElementBase( rLocalName, xAttributes, pParent, pImport ) + :BasicElementBase( rLocalName, xAttributes, nullptr, pImport ) ,m_xLibContainer( rxLibContainer ) { } @@ -478,7 +478,7 @@ void BasicImport::setDocumentLocator( const Reference< xml::sax::XLocator >& /*x if ( xLibContainer.is() ) { - xElement.set( new BasicLibrariesElement( rLocalName, xAttributes, nullptr, this, xLibContainer ) ); + xElement.set( new BasicLibrariesElement( rLocalName, xAttributes, this, xLibContainer ) ); } } else diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx index 41219d7fb4c0..d4f12c784266 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx @@ -94,7 +94,7 @@ namespace xmlscript public: BasicLibrariesElement( const OUString& rLocalName, const css::uno::Reference< css::xml::input::XAttributes >& xAttributes, - BasicElementBase* pParent, BasicImport* pImport, + BasicImport* pImport, const css::uno::Reference< css::script::XLibraryContainer2 >& rxLibContainer ); // XElement diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx index bf69df696386..ec02ffe9278a 100644 --- a/xmlscript/source/xmllib_imexp/imp_share.hxx +++ b/xmlscript/source/xmllib_imexp/imp_share.hxx @@ -212,8 +212,8 @@ public: LibrariesElement( OUString const & rLocalName, css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, - LibElementBase * pParent, LibraryImport * pImport ) - : LibElementBase( rLocalName, xAttributes, pParent, pImport ) + LibraryImport * pImport ) + : LibElementBase( rLocalName, xAttributes, nullptr, pImport ) {} }; diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx b/xmlscript/source/xmllib_imexp/xmllib_import.cxx index c81edf6f36c0..4dfe36501aef 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx @@ -138,7 +138,7 @@ Reference< xml::input::XElement > LibraryImport::startRootElement( } else if ( mpLibArray && rLocalName == "libraries" ) { - return new LibrariesElement( rLocalName, xAttributes, nullptr, this ); + return new LibrariesElement( rLocalName, xAttributes, this ); } else if ( mpLibDesc && rLocalName == "library" ) { diff --git a/xmlscript/source/xmlmod_imexp/imp_share.hxx b/xmlscript/source/xmlmod_imexp/imp_share.hxx index 6a1bede592fb..969a56d6d609 100644 --- a/xmlscript/source/xmlmod_imexp/imp_share.hxx +++ b/xmlscript/source/xmlmod_imexp/imp_share.hxx @@ -87,7 +87,6 @@ class ModuleElement { protected: rtl::Reference<ModuleImport> mxImport; - rtl::Reference<ModuleElement> mxParent; OUString _aLocalName; css::uno::Reference< css::xml::input::XAttributes > _xAttributes; @@ -97,7 +96,7 @@ public: ModuleElement( OUString const & rLocalName, css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, - ModuleElement * pParent, ModuleImport * pImport ); + ModuleImport * pImport ); virtual ~ModuleElement(); // XElement diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx index e9f9869ef6cf..cb562815d7c4 100644 --- a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx +++ b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx @@ -33,7 +33,7 @@ namespace xmlscript Reference< xml::input::XElement > ModuleElement::getParent() throw (RuntimeException, std::exception) { - return mxParent.get(); + return nullptr; } OUString ModuleElement::getLocalName() throw (RuntimeException, std::exception) @@ -87,9 +87,8 @@ Reference< xml::input::XElement > ModuleElement::startChildElement( ModuleElement::ModuleElement( OUString const & rLocalName, Reference< xml::input::XAttributes > const & xAttributes, - ModuleElement * pParent, ModuleImport * pImport ) + ModuleImport * pImport ) : mxImport( pImport ) - , mxParent( pParent ) , _aLocalName( rLocalName ) , _xAttributes( xAttributes ) { @@ -145,7 +144,7 @@ Reference< xml::input::XElement > ModuleImport::startRootElement( mrModuleDesc.aLanguage = xAttributes->getValueByUidName( XMLNS_SCRIPT_UID, "language" ); mrModuleDesc.aModuleType = xAttributes->getValueByUidName( XMLNS_SCRIPT_UID, "moduleType" ); - return new ModuleElement( rLocalName, xAttributes, nullptr, this ); + return new ModuleElement( rLocalName, xAttributes, this ); } else { |