[Libreoffice-commits] core.git: include/vcl vcl/source

Noel Grandin noel at peralex.com
Fri Feb 26 10:53:55 UTC 2016


 include/vcl/BitmapTools.hxx               |    2 
 include/vcl/alpha.hxx                     |    2 
 include/vcl/bitmapex.hxx                  |   13 -----
 include/vcl/button.hxx                    |   12 ++---
 include/vcl/commandinfoprovider.hxx       |    5 --
 include/vcl/cursor.hxx                    |    2 
 include/vcl/decoview.hxx                  |    2 
 include/vcl/dockwin.hxx                   |    4 -
 include/vcl/edit.hxx                      |    2 
 include/vcl/field.hxx                     |    4 -
 include/vcl/fixed.hxx                     |    2 
 include/vcl/gdimtf.hxx                    |    6 +-
 vcl/source/bitmap/BitmapTools.cxx         |    8 +--
 vcl/source/control/button.cxx             |   69 ++++++++++--------------------
 vcl/source/control/edit.cxx               |   13 -----
 vcl/source/control/field.cxx              |    8 +--
 vcl/source/control/fixed.cxx              |   38 ++++++----------
 vcl/source/gdi/alpha.cxx                  |    4 -
 vcl/source/gdi/bitmapex.cxx               |    8 +--
 vcl/source/gdi/gdimtf.cxx                 |   28 +++++-------
 vcl/source/helper/commandinfoprovider.cxx |   11 +---
 vcl/source/window/cursor.cxx              |    4 -
 vcl/source/window/decoview.cxx            |   25 +++-------
 23 files changed, 100 insertions(+), 172 deletions(-)

New commits:
commit f23c0dbe00bcdc13ff65fbe8a312416d0bc92599
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Feb 26 10:36:34 2016 +0200

    loplugin:unuseddefaultparms in include/vcl (part2)
    
    including a fix for a rather glaring bug in BitmapTools.cxx
    
    Change-Id: Id9db990b993cfeea9039c5fbaaa91996adeae22a
    Reviewed-on: https://gerrit.libreoffice.org/22713
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx
index b156424..d12e9e1 100644
--- a/include/vcl/BitmapTools.hxx
+++ b/include/vcl/BitmapTools.hxx
@@ -20,7 +20,7 @@ class VCL_DLLPUBLIC BitmapTools
 {
 public:
     static void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx,
-                            double fScaleFactor = 1.0, const Size& aSize = Size());
+                            double fScaleFactor = 1.0);
 };
 
 }
diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx
index 9b7e6b4..950e82d 100644
--- a/include/vcl/alpha.hxx
+++ b/include/vcl/alpha.hxx
@@ -55,7 +55,7 @@ public:
 
     bool        Erase( sal_uInt8 cTransparency );
     bool        Replace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency );
-    bool        Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong nTol = 0UL );
+    bool        Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency );
 
     BitmapReadAccess*  AcquireReadAccess() { return Bitmap::AcquireReadAccess(); }
     BitmapWriteAccess* AcquireWriteAccess() { return Bitmap::AcquireWriteAccess(); }
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index a4dea75..cdf1414 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -123,11 +123,8 @@ public:
         This method dithers the bitmap inplace, i.e. a true color
         bitmap is converted to a paletted bitmap, reducing the color
         deviation by error diffusion.
-
-        @param nDitherFlags
-        The algorithm to be used for dithering
      */
-    bool                Dither( BmpDitherFlags nDitherFlags = BmpDitherFlags::Matrix );
+    bool                Dither();
 
     /** Crop the bitmap
 
@@ -277,17 +274,11 @@ public:
         @param rReplaceColor
         Color to be placed in all changed pixel
 
-        @param nTol
-        Tolerance value. Specifies the maximal difference between
-        rSearchColor and the individual pixel values, such that the
-        corresponding pixel is still regarded a match.
-
         @return true, if the operation was completed successfully.
      */
     bool                Replace(
                             const Color& rSearchColor,
-                            const Color& rReplaceColor,
-                            sal_uLong nTol = 0 );
+                            const Color& rReplaceColor );
 
     /** Replace all pixel having one the search colors with the corresponding replace color
 
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 2cea456..91ba1e3 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -91,7 +91,7 @@ public:
 
     void                SetFocusRect( const Rectangle& rFocusRect );
     bool                IsSmallSymbol() const;
-    void                SetSmallSymbol(bool bSmall = true);
+    void                SetSmallSymbol();
     virtual bool        set_property(const OString &rKey, const OString &rValue) override;
 
     /// Sets the button state according to the FeatureStateEvent emitted by an Uno state change.
@@ -127,7 +127,7 @@ protected:
     SAL_DLLPRIVATE void            ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
     SAL_DLLPRIVATE void            ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFlags,
                                                              const Rectangle& rRect, bool bLayout, bool bMenuBtnSep);
-    SAL_DLLPRIVATE void            ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLayout = false);
+    SAL_DLLPRIVATE void            ImplDrawPushButton(vcl::RenderContext& rRenderContext);
     using Button::ImplGetTextStyle;
     SAL_DLLPRIVATE DrawTextFlags   ImplGetTextStyle( DrawFlags nDrawFlags ) const;
     SAL_DLLPRIVATE bool            IsSymbol() const { return ( (meSymbol != SymbolType::DONTKNOW) && (meSymbol != SymbolType::IMAGE) ); }
@@ -195,7 +195,7 @@ public:
     void            SaveValue() { meSaveValue = GetState(); }
     bool            IsValueChangedFromSaved() const { return meSaveValue != GetState(); }
 
-    Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
+    Size            CalcMinimumSize() const;
     virtual Size    GetOptimalSize() const override;
 
     virtual bool    set_property(const OString &rKey, const OString &rValue) override;
@@ -298,7 +298,7 @@ private:
                               const Point& rPos, const Size& rSize,
                               const Size& rImageSize, Rectangle& rStateRect,
                               Rectangle& rMouseRect, bool bLayout = false );
-    SAL_DLLPRIVATE void     ImplDrawRadioButton(vcl::RenderContext& rRenderContext, bool bLayout = false );
+    SAL_DLLPRIVATE void     ImplDrawRadioButton(vcl::RenderContext& rRenderContext );
     SAL_DLLPRIVATE void     ImplUncheckAllOther();
     SAL_DLLPRIVATE Size     ImplGetRadioImageSize() const;
     SAL_DLLPRIVATE long     ImplGetImageToTextDistance() const;
@@ -369,7 +369,7 @@ public:
 
     static Image    GetRadioImage( const AllSettings& rSettings, DrawButtonFlags nFlags );
 
-    Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
+    Size            CalcMinimumSize() const;
     virtual Size    GetOptimalSize() const override;
 
     void            SetToggleHdl( const Link<RadioButton&,void>& rLink ) { maToggleHdl = rLink; }
@@ -420,7 +420,7 @@ private:
                                     const Point& rPos, const Size& rSize,
                                     const Size& rImageSize, Rectangle& rStateRect,
                                     Rectangle& rMouseRect, bool bLayout );
-    SAL_DLLPRIVATE void         ImplDrawCheckBox(vcl::RenderContext& rRenderContext, bool bLayout = false );
+    SAL_DLLPRIVATE void         ImplDrawCheckBox(vcl::RenderContext& rRenderContext );
     SAL_DLLPRIVATE long         ImplGetImageToTextDistance() const;
     SAL_DLLPRIVATE Size         ImplGetCheckImageSize() const;
 
diff --git a/include/vcl/commandinfoprovider.hxx b/include/vcl/commandinfoprovider.hxx
index 8871de6..d6aa358 100644
--- a/include/vcl/commandinfoprovider.hxx
+++ b/include/vcl/commandinfoprovider.hxx
@@ -72,16 +72,13 @@ public:
             The command name is expected to start with .uno:
         @param rxFrame
             The frame is used to identify the module and document.
-        @param bIncludeShortcut
-            Whether the shortcut should be appended in brackets
         @return
             The returned label contains the keyboard accelerator, if
             one is defined and bIncludeShortcut is true.
     */
     OUString GetTooltipForCommand (
         const OUString& rsCommandName,
-        const css::uno::Reference<css::frame::XFrame>& rxFrame,
-        bool bIncludeShortcut = true);
+        const css::uno::Reference<css::frame::XFrame>& rxFrame);
 
     /** Returns the shortcut for a command in human-readable form */
     OUString GetCommandShortcut (const OUString& rCommandName,
diff --git a/include/vcl/cursor.hxx b/include/vcl/cursor.hxx
index 038e18f..d71d387 100644
--- a/include/vcl/cursor.hxx
+++ b/include/vcl/cursor.hxx
@@ -56,7 +56,7 @@ private:
 public:
     SAL_DLLPRIVATE void         ImplDraw();
     DECL_DLLPRIVATE_LINK_TYPED( ImplTimerHdl, Timer*, void );
-    SAL_DLLPRIVATE void         ImplShow( bool bDrawDirect = true );
+    SAL_DLLPRIVATE void         ImplShow();
     SAL_DLLPRIVATE void         ImplHide( bool bStopTimer );
     SAL_DLLPRIVATE void         ImplResume( bool bRestore = false );
     SAL_DLLPRIVATE bool         ImplSuspend();
diff --git a/include/vcl/decoview.hxx b/include/vcl/decoview.hxx
index 4a5bd17..1b11d91 100644
--- a/include/vcl/decoview.hxx
+++ b/include/vcl/decoview.hxx
@@ -115,7 +115,7 @@ public:
     Rectangle           DrawFrame( const Rectangle& rRect, DrawFrameStyle nStyle = DrawFrameStyle::Out, DrawFrameFlags nFlags = DrawFrameFlags::NONE );
     Rectangle           DrawButton( const Rectangle& rRect, DrawButtonFlags nStyle );
     void                DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical = true );
-    void                DrawHandle(const Rectangle& rRectangle, bool bVertical = true);
+    void                DrawHandle(const Rectangle& rRectangle);
 };
 
 #endif // INCLUDED_VCL_DECOVIEW_HXX
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index 7da7263..23a5220 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -117,8 +117,8 @@ private:
                     mbLocked:1;
 
                     DECL_LINK_TYPED( PopupModeEnd, FloatingWindow*, void );
-    void            ImplEnableStartDocking( bool bEnable = true )  { mbStartDockingEnabled = bEnable; }
-    bool            ImplStartDockingEnabled()               { return mbStartDockingEnabled; }
+    void            ImplEnableStartDocking()  { mbStartDockingEnabled = true; }
+    bool            ImplStartDockingEnabled() { return mbStartDockingEnabled; }
 
 public:
     ImplDockingWindowWrapper( const vcl::Window *pWindow );
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index 628ada5..57a8e07 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -106,7 +106,7 @@ private:
     SAL_DLLPRIVATE void        ImplInitEditData();
     SAL_DLLPRIVATE void        ImplModified();
     SAL_DLLPRIVATE OUString    ImplGetText() const;
-    SAL_DLLPRIVATE void        ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRectangle, bool bLayout = false);
+    SAL_DLLPRIVATE void        ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRectangle);
     SAL_DLLPRIVATE void        ImplInvalidateOrRepaint();
     SAL_DLLPRIVATE void        ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode );
     SAL_DLLPRIVATE void        ImplSetText( const OUString& rStr, const Selection* pNewSelection = nullptr );
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index 641a3ab..62db9fb 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -238,7 +238,7 @@ public:
     using NumericFormatter::GetMin;
     sal_Int64               GetMin( FieldUnit eOutUnit ) const;
     void                    SetBaseValue( sal_Int64 nNewBase, FieldUnit eInUnit = FUNIT_NONE );
-    sal_Int64               GetBaseValue( FieldUnit eOutUnit = FUNIT_NONE ) const;
+    sal_Int64               GetBaseValue() const;
 
     virtual void            SetValue( sal_Int64 nNewValue, FieldUnit eInUnit );
     virtual void            SetValue( sal_Int64 nValue ) override;
@@ -679,7 +679,7 @@ public:
 
     void                    InsertValue( sal_Int64 nValue, FieldUnit eInUnit = FUNIT_NONE,
                                          sal_Int32  nPos = COMBOBOX_APPEND );
-    sal_Int64               GetValue( sal_Int32  nPos, FieldUnit eOutUnit = FUNIT_NONE ) const;
+    sal_Int64               GetValue( sal_Int32  nPos ) const;
     sal_Int32               GetValuePos( sal_Int64 nValue,
                                          FieldUnit eInUnit = FUNIT_NONE ) const;
 
diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx
index cfbddb5..ccedac4 100644
--- a/include/vcl/fixed.hxx
+++ b/include/vcl/fixed.hxx
@@ -96,7 +96,7 @@ private:
     using Window::ImplInit;
     SAL_DLLPRIVATE void    ImplInit( vcl::Window* pParent, WinBits nStyle );
     SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
-    SAL_DLLPRIVATE void    ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout = false);
+    SAL_DLLPRIVATE void    ImplDraw(vcl::RenderContext& rRenderContext);
 
 protected:
     virtual void    FillLayoutData() const override;
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 5c4b8ac..47d78a4 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -138,17 +138,17 @@ public:
 
     void            Convert( MtfConversion eConversion );
     void            ReplaceColors( const Color* pSearchColors, const Color* rReplaceColors,
-                                   sal_uLong nColorCount, sal_uLong* pTols = nullptr );
+                                   sal_uLong nColorCount );
 
     GDIMetaFile     GetMonochromeMtf( const Color& rCol ) const;
 
     void            Record( OutputDevice* pOutDev );
     bool            IsRecord() const { return bRecord; }
 
-    void            Play( GDIMetaFile& rMtf, size_t nPos = GDI_METAFILE_END );
+    void            Play( GDIMetaFile& rMtf );
     void            Play( OutputDevice* pOutDev, size_t nPos = GDI_METAFILE_END );
     void            Play( OutputDevice* pOutDev, const Point& rPos,
-                          const Size& rSize, size_t nPos = GDI_METAFILE_END );
+                          const Size& rSize );
 
     void            Pause( bool bPause );
     bool            IsPause() const { return bPause; }
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index a82b95c..f476ca0 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -29,7 +29,7 @@ using drawinglayer::primitive2d::Primitive2DReference;
 namespace vcl
 {
 
-void BitmapTools::loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx, double fScalingFactor, const Size& aSize)
+void BitmapTools::loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx, double fScalingFactor)
 {
     uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
     const uno::Reference<graphic::XSvgParser> xSvgParser = graphic::SvgTools::create(xContext);
@@ -62,12 +62,10 @@ void BitmapTools::loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx
             }
         }
 
-        bool bIsSizeEmpty = (aSize.Width() == 0 && aSize.Height() == 0);
-
         aRealRect.X1 = 0;
         aRealRect.Y1 = 0;
-        aRealRect.X2 = bIsSizeEmpty ? (aSize.Width() * 2540 / 90)  : aRange.getMaxX() - aRange.getMinX();
-        aRealRect.Y2 = bIsSizeEmpty ? (aSize.Height() * 2540 / 90) : aRange.getMaxY() - aRange.getMinY();
+        aRealRect.X2 = aRange.getMaxX() - aRange.getMinX();
+        aRealRect.Y2 = aRange.getMaxY() - aRange.getMinY();
 
         double nDPI = 90 * fScalingFactor;
 
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 68b3695..97808a3 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -571,9 +571,9 @@ void Button::ImplSetSymbolAlign( SymbolAlign eAlign )
     }
 }
 
-void Button::SetSmallSymbol(bool bSmall)
+void Button::SetSmallSymbol()
 {
-    mpButtonData->mbSmallSymbol = bSmall;
+    mpButtonData->mbSmallSymbol = true;
 }
 
 void Button::EnableImageDisplay( bool bEnable )
@@ -938,10 +938,9 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl
     pDev->Pop();  // restore clipregion
 }
 
-void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLayout)
+void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
 {
-    if (!bLayout)
-        HideFocus();
+    HideFocus();
 
     DrawButtonFlags nButtonStyle = ImplGetButtonState();
     Point aPoint;
@@ -1088,7 +1087,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLa
 
         // draw content using the same aInRect as non-native VCL would do
         ImplDrawPushButtonContent(&rRenderContext, (nState&ControlState::ROLLOVER) ? DrawFlags::NoRollover : DrawFlags::NONE,
-                                  aInRect, bLayout, bDrawMenuSep);
+                                  aInRect, false/*bLayout*/, bDrawMenuSep);
 
         if (HasFocus())
             ShowFocus(ImplGetFocusRect());
@@ -1100,7 +1099,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLa
         if (GetStyle() & WB_FLATBUTTON)
         {
             Rectangle aTempRect(aInRect);
-            if (!bLayout && bRollOver)
+            if (bRollOver)
                 ImplDrawPushButtonFrame(rRenderContext, aTempRect, nButtonStyle);
             aInRect.Left()   += 2;
             aInRect.Top()    += 2;
@@ -1109,14 +1108,13 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLa
         }
         else
         {
-            if (!bLayout)
-                ImplDrawPushButtonFrame(rRenderContext, aInRect, nButtonStyle);
+            ImplDrawPushButtonFrame(rRenderContext, aInRect, nButtonStyle);
         }
 
         // draw content
-        ImplDrawPushButtonContent(&rRenderContext, DrawFlags::NONE, aInRect, bLayout, bDrawMenuSep);
+        ImplDrawPushButtonContent(&rRenderContext, DrawFlags::NONE, aInRect, false/*bLayout*/, bDrawMenuSep);
 
-        if (!bLayout && HasFocus())
+        if (HasFocus())
         {
             ShowFocus(ImplGetFocusRect());
         }
@@ -1634,7 +1632,7 @@ void PushButton::EndSelection()
     }
 }
 
-Size PushButton::CalcMinimumSize( long nMaxWidth ) const
+Size PushButton::CalcMinimumSize() const
 {
     Size aSize;
 
@@ -1654,7 +1652,7 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
     }
     if ( !PushButton::GetText().isEmpty() && ! (ImplGetButtonState() & DrawButtonFlags::NoText) )
     {
-        Size textSize = GetTextRect( Rectangle( Point(), Size( nMaxWidth ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ),
+        Size textSize = GetTextRect( Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ),
                                      PushButton::GetText(), ImplGetTextStyle( DrawFlags::NONE ) ).GetSize();
         aSize.Width() += textSize.Width();
         aSize.Height() = std::max( aSize.Height(), long( textSize.Height() * 1.15 ) );
@@ -2152,10 +2150,9 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
     pDev->Pop();
 }
 
-void RadioButton::ImplDrawRadioButton(vcl::RenderContext& rRenderContext, bool bLayout)
+void RadioButton::ImplDrawRadioButton(vcl::RenderContext& rRenderContext)
 {
-    if (!bLayout)
-        HideFocus();
+    HideFocus();
 
     Size aImageSize;
     if (!maImage)
@@ -2168,15 +2165,12 @@ void RadioButton::ImplDrawRadioButton(vcl::RenderContext& rRenderContext, bool b
 
     // Draw control text
     ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel(),
-             aImageSize, maStateRect, maMouseRect, bLayout);
+             aImageSize, maStateRect, maMouseRect);
 
-    if (!bLayout || rRenderContext.IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL))
-    {
-        if (!maImage && HasFocus())
-            ShowFocus(ImplGetFocusRect());
+    if (!maImage && HasFocus())
+        ShowFocus(ImplGetFocusRect());
 
-        ImplDrawRadioButtonState(rRenderContext);
-    }
+    ImplDrawRadioButtonState(rRenderContext);
 }
 
 void RadioButton::group(RadioButton &rOther)
@@ -2887,7 +2881,7 @@ void RadioButton::ImplSetMinimumNWFSize()
     Pop();
 }
 
-Size RadioButton::CalcMinimumSize( long nMaxWidth ) const
+Size RadioButton::CalcMinimumSize() const
 {
     Size aSize;
     if ( !maImage )
@@ -2904,16 +2898,7 @@ Size RadioButton::CalcMinimumSize( long nMaxWidth ) const
     {
         bool bTopImage = (GetStyle() & WB_TOP) != 0;
 
-        if (!bTopImage)
-        {
-            nMaxWidth -= aSize.Width();
-            nMaxWidth -= ImplGetImageToTextDistance();
-        }
-
-        // subtract what will be added later
-        nMaxWidth-=2;
-
-        Size aTextSize = GetTextRect( Rectangle( Point(), Size( nMaxWidth > 0 ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ),
+        Size aTextSize = GetTextRect( Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ),
                                       aText, FixedText::ImplGetTextStyle( GetStyle() ) ).GetSize();
 
         aSize.Width()+=2;   // for focus rect
@@ -3191,24 +3176,20 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
     pDev->Pop();
 }
 
-void CheckBox::ImplDrawCheckBox(vcl::RenderContext& rRenderContext, bool bLayout)
+void CheckBox::ImplDrawCheckBox(vcl::RenderContext& rRenderContext)
 {
     Size aImageSize = ImplGetCheckImageSize();
     aImageSize.Width()  = CalcZoom( aImageSize.Width() );
     aImageSize.Height() = CalcZoom( aImageSize.Height() );
 
-    if (!bLayout)
-        HideFocus();
+    HideFocus();
 
     ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel(),
-             aImageSize, maStateRect, maMouseRect, bLayout);
+             aImageSize, maStateRect, maMouseRect, false/*bLayout*/);
 
-    if (!bLayout)
-    {
-        ImplDrawCheckBoxState(rRenderContext);
-        if (HasFocus())
-            ShowFocus(ImplGetFocusRect());
-    }
+    ImplDrawCheckBoxState(rRenderContext);
+    if (HasFocus())
+        ShowFocus(ImplGetFocusRect());
 }
 
 void CheckBox::ImplCheck()
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 5af9723..d59d2b5 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -491,7 +491,7 @@ long Edit::ImplGetTextYPosition() const
     return ( GetOutputSizePixel().Height() - GetTextHeight() ) / 2;
 }
 
-void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRectangle, bool bLayout)
+void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRectangle)
 {
     if (!IsReallyVisible())
         return;
@@ -519,17 +519,6 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec
     long nTH = GetTextHeight();
     Point aPos(mnXOffset, ImplGetTextYPosition());
 
-    if (bLayout)
-    {
-        aPos.X() = mnXOffset + ImplGetExtraXOffset();
-
-        MetricVector* pVector = &mpControlData->mpLayoutData->m_aUnicodeBoundRects;
-        OUString* pDisplayText = &mpControlData->mpLayoutData->m_aDisplayText;
-
-        rRenderContext.DrawText(aPos, aText, 0, nLen, pVector, pDisplayText);
-        return;
-    }
-
     vcl::Cursor* pCursor = GetCursor();
     bool bVisCursor = pCursor && pCursor->IsVisible();
     if (pCursor)
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 99ac514..75565c5 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1560,11 +1560,11 @@ void MetricFormatter::SetBaseValue( sal_Int64 nNewBase, FieldUnit eInUnit )
                                              eInUnit, meUnit );
 }
 
-sal_Int64 MetricFormatter::GetBaseValue( FieldUnit eOutUnit ) const
+sal_Int64 MetricFormatter::GetBaseValue() const
 {
     // convert to requested units
     return MetricField::ConvertValue( mnBaseValue, mnBaseValue, GetDecimalDigits(),
-                                      meUnit, eOutUnit );
+                                      meUnit, FUNIT_NONE );
 }
 
 void MetricFormatter::Reformat()
@@ -1889,7 +1889,7 @@ void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, sal_Int32 nPos
     ComboBox::InsertEntry( CreateFieldText( nValue ), nPos );
 }
 
-sal_Int64 MetricBox::GetValue( sal_Int32 nPos, FieldUnit eOutUnit ) const
+sal_Int64 MetricBox::GetValue( sal_Int32 nPos ) const
 {
     double nValue = 0;
     ImplMetricGetValue( ComboBox::GetEntry( nPos ), nValue, mnBaseValue,
@@ -1897,7 +1897,7 @@ sal_Int64 MetricBox::GetValue( sal_Int32 nPos, FieldUnit eOutUnit ) const
 
     // convert to previously configured units
     sal_Int64 nRetValue = MetricField::ConvertValue( (sal_Int64)nValue, mnBaseValue, GetDecimalDigits(),
-                                                     meUnit, eOutUnit );
+                                                     meUnit, FUNIT_NONE );
 
     return nRetValue;
 }
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 2c0a62a..98532d8 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -513,7 +513,7 @@ const Color& FixedLine::GetCanonicalTextColor( const StyleSettings& _rStyle ) co
     return _rStyle.GetGroupTextColor();
 }
 
-void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
+void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext)
 {
     // we need to measure according to the window, not according to the
     // RenderContext we paint to
@@ -521,24 +521,19 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
 
     OUString aText = GetText();
     WinBits nWinStyle = GetStyle();
-    MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : nullptr;
-    OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : nullptr;
 
     DecorationView aDecoView(&rRenderContext);
     if (aText.isEmpty())
     {
-        if (!pVector)
+        if (nWinStyle & WB_VERT)
         {
-            if (nWinStyle & WB_VERT)
-            {
-                long nX = (aOutSize.Width() - 1) / 2;
-                aDecoView.DrawSeparator(Point(nX, 0), Point(nX, aOutSize.Height() - 1));
-            }
-            else
-            {
-                long nY = (aOutSize.Height() - 1) / 2;
-                aDecoView.DrawSeparator(Point(0, nY), Point(aOutSize.Width() - 1, nY), false);
-            }
+            long nX = (aOutSize.Width() - 1) / 2;
+            aDecoView.DrawSeparator(Point(nX, 0), Point(nX, aOutSize.Height() - 1));
+        }
+        else
+        {
+            long nY = (aOutSize.Height() - 1) / 2;
+            aDecoView.DrawSeparator(Point(0, nY), Point(aOutSize.Width() - 1, nY), false);
         }
     }
     else if (nWinStyle & WB_VERT)
@@ -553,7 +548,7 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
             aStartPt.Y() -= (aOutSize.Height() - nWidth) / 2;
         Point aTextPt(aStartPt);
         aTextPt.X() -= GetTextHeight() / 2;
-        rRenderContext.DrawText(aTextPt, aText, 0, aText.getLength(), pVector, pDisplayText);
+        rRenderContext.DrawText(aTextPt, aText, 0, aText.getLength());
         rRenderContext.Pop();
         if (aOutSize.Height() - aStartPt.Y() > FIXEDLINE_TEXT_BORDER)
             aDecoView.DrawSeparator(Point(aStartPt.X(), aOutSize.Height() - 1),
@@ -577,15 +572,12 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
         if (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono)
             nStyle |= DrawTextFlags::Mono;
 
-        DrawControlText(*this, aRect, aText, nStyle, pVector, pDisplayText);
+        DrawControlText(*this, aRect, aText, nStyle, nullptr, nullptr);
 
-        if (!pVector)
-        {
-            long nTop = aRect.Top() + ((aRect.GetHeight() - 1) / 2);
-            aDecoView.DrawSeparator(Point(aRect.Right() + FIXEDLINE_TEXT_BORDER, nTop), Point(aOutSize.Width() - 1, nTop), false);
-            if (aRect.Left() > FIXEDLINE_TEXT_BORDER)
-                aDecoView.DrawSeparator(Point(0, nTop), Point(aRect.Left() - FIXEDLINE_TEXT_BORDER, nTop), false);
-        }
+        long nTop = aRect.Top() + ((aRect.GetHeight() - 1) / 2);
+        aDecoView.DrawSeparator(Point(aRect.Right() + FIXEDLINE_TEXT_BORDER, nTop), Point(aOutSize.Width() - 1, nTop), false);
+        if (aRect.Left() > FIXEDLINE_TEXT_BORDER)
+            aDecoView.DrawSeparator(Point(0, nTop), Point(aRect.Left() - FIXEDLINE_TEXT_BORDER, nTop), false);
     }
 }
 
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index f3217b2..614eb40 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -106,13 +106,11 @@ bool AlphaMask::Replace( const Bitmap& rMask, sal_uInt8 cReplaceTransparency )
     return bRet;
 }
 
-bool AlphaMask::Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong nTol )
+bool AlphaMask::Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency )
 {
     BitmapWriteAccess*  pAcc = AcquireWriteAccess();
     bool                bRet = false;
 
-    DBG_ASSERT( !nTol, "AlphaMask::Replace: nTol not used yet" );
-
     if( pAcc && pAcc->GetBitCount() == 8 )
     {
         const long nWidth = pAcc->Width(), nHeight = pAcc->Height();
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index c98acdd..cef43f7 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -616,14 +616,14 @@ bool BitmapEx::Erase( const Color& rFillColor )
     return bRet;
 }
 
-bool BitmapEx::Dither( BmpDitherFlags nDitherFlags )
+bool BitmapEx::Dither()
 {
-    return !!aBitmap && aBitmap.Dither( nDitherFlags );
+    return !!aBitmap && aBitmap.Dither();
 }
 
-bool BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
+bool BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor )
 {
-    return !!aBitmap && aBitmap.Replace( rSearchColor, rReplaceColor, nTol );
+    return !!aBitmap && aBitmap.Replace( rSearchColor, rReplaceColor );
 }
 
 bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uLong* pTols )
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 4c58687..0fea0d0 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -306,7 +306,7 @@ void GDIMetaFile::Record( OutputDevice* pOut )
     Linker( pOut, true );
 }
 
-void GDIMetaFile::Play( GDIMetaFile& rMtf, size_t nPos )
+void GDIMetaFile::Play( GDIMetaFile& rMtf )
 {
     if ( !bRecord && !rMtf.bRecord )
     {
@@ -315,10 +315,7 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf, size_t nPos )
 
         rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas );
 
-        if( nPos > nObjCount )
-            nPos = nObjCount;
-
-        for( size_t nCurPos = nCurrentActionElement; nCurPos < nPos; nCurPos++ )
+        for( size_t nCurPos = nCurrentActionElement; nCurPos < nObjCount; nCurPos++ )
         {
             if( pAction )
             {
@@ -525,7 +522,7 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct,
 }
 
 void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
-                        const Size& rSize, size_t nPos )
+                        const Size& rSize )
 {
     vcl::Region  aDrawClipRegion;
     MapMode aDrawMap( GetPrefMapMode() );
@@ -582,7 +579,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
         pOut->SetLayoutMode( TEXT_LAYOUT_DEFAULT );
         pOut->SetDigitLanguage( 0 );
 
-        Play( pOut, nPos );
+        Play( pOut );
 
         pOut->Pop();
     }
@@ -2284,7 +2281,7 @@ void GDIMetaFile::Convert( MtfConversion eConversion )
     }
 }
 
-void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, sal_uLong* pTols )
+void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount )
 {
     ImplColReplaceParam aColParam;
     ImplBmpReplaceParam aBmpParam;
@@ -2298,20 +2295,19 @@ void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pRepla
 
     for( sal_uLong i = 0; i < nColorCount; i++ )
     {
-        const long  nTol = pTols ? ( pTols[ i ] * 255 ) / 100 : 0;
         long        nVal;
 
         nVal = pSearchColors[ i ].GetRed();
-        aColParam.pMinR[ i ] = (sal_uLong) std::max( nVal - nTol, 0L );
-        aColParam.pMaxR[ i ] = (sal_uLong) std::min( nVal + nTol, 255L );
+        aColParam.pMinR[ i ] = (sal_uLong) std::max( nVal, 0L );
+        aColParam.pMaxR[ i ] = (sal_uLong) std::min( nVal, 255L );
 
         nVal = pSearchColors[ i ].GetGreen();
-        aColParam.pMinG[ i ] = (sal_uLong) std::max( nVal - nTol, 0L );
-        aColParam.pMaxG[ i ] = (sal_uLong) std::min( nVal + nTol, 255L );
+        aColParam.pMinG[ i ] = (sal_uLong) std::max( nVal, 0L );
+        aColParam.pMaxG[ i ] = (sal_uLong) std::min( nVal, 255L );
 
         nVal = pSearchColors[ i ].GetBlue();
-        aColParam.pMinB[ i ] = (sal_uLong) std::max( nVal - nTol, 0L );
-        aColParam.pMaxB[ i ] = (sal_uLong) std::min( nVal + nTol, 255L );
+        aColParam.pMinB[ i ] = (sal_uLong) std::max( nVal, 0L );
+        aColParam.pMaxB[ i ] = (sal_uLong) std::min( nVal, 255L );
     }
 
     aColParam.pDstCols = pReplaceColors;
@@ -2320,7 +2316,7 @@ void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pRepla
     aBmpParam.pSrcCols = pSearchColors;
     aBmpParam.pDstCols = pReplaceColors;
     aBmpParam.nCount = nColorCount;
-    aBmpParam.pTols = pTols;
+    aBmpParam.pTols = nullptr;
 
     ImplExchangeColors( ImplColReplaceFnc, &aColParam, ImplBmpReplaceFnc, &aBmpParam );
 
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx
index 95f252a..6cf0adf 100644
--- a/vcl/source/helper/commandinfoprovider.cxx
+++ b/vcl/source/helper/commandinfoprovider.cxx
@@ -158,8 +158,7 @@ OUString CommandInfoProvider::GetPopupLabelForCommand (
 
 OUString CommandInfoProvider::GetTooltipForCommand (
     const OUString& rsCommandName,
-    const Reference<frame::XFrame>& rxFrame,
-    bool bIncludeShortcut)
+    const Reference<frame::XFrame>& rxFrame)
 {
     SetFrame(rxFrame);
 
@@ -167,11 +166,9 @@ OUString CommandInfoProvider::GetTooltipForCommand (
     if (sLabel.isEmpty())
         sLabel = GetCommandProperty("Name", rsCommandName);
 
-    if (bIncludeShortcut) {
-        const OUString sShortCut(GetCommandShortcut(rsCommandName, rxFrame));
-        if (!sShortCut.isEmpty())
-            return sLabel + " (" + sShortCut + ")";
-    }
+    const OUString sShortCut(GetCommandShortcut(rsCommandName, rxFrame));
+    if (!sShortCut.isEmpty())
+        return sLabel + " (" + sShortCut + ")";
     return sLabel;
 }
 
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 738ff0d..0e8a677 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -222,9 +222,9 @@ bool vcl::Cursor::ImplDoHide( bool bSuspend )
     return bWasCurVisible;
 }
 
-void vcl::Cursor::ImplShow( bool bDrawDirect )
+void vcl::Cursor::ImplShow()
 {
-    ImplDoShow( bDrawDirect, false );
+    ImplDoShow( true/*bDrawDirect*/, false );
 }
 
 void vcl::Cursor::ImplHide( bool i_bStopTimer )
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index d7d6b23..6741171 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -1092,7 +1092,7 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo
     mpOutDev->Pop();
 }
 
-void DecorationView::DrawHandle(const Rectangle& rRect, bool bVertical)
+void DecorationView::DrawHandle(const Rectangle& rRect)
 {
     const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
 
@@ -1104,31 +1104,20 @@ void DecorationView::DrawHandle(const Rectangle& rRect, bool bVertical)
     const sal_Int32 nNumberOfPoints = 3;
 
     long nHalfWidth = aOutputSize.Width() / 2.0f;
-    long nHalfHeight = aOutputSize.Height() / 2.0f;
 
-    float fDistance = bVertical ? aOutputSize.Height() : aOutputSize.Width();
+    float fDistance = aOutputSize.Height();
     fDistance /= (nNumberOfPoints + 1);
 
-    long nRadius = bVertical ? aOutputSize.Width() : aOutputSize.Height();
+    long nRadius = aOutputSize.Width();
     nRadius /= (nNumberOfPoints + 2);
 
     for (long i = 1; i <= nNumberOfPoints; i++)
     {
         Rectangle aLocation;
-        if (bVertical)
-        {
-            aLocation = Rectangle(nHalfWidth - nRadius,
-                                  round(fDistance * i) - nRadius,
-                                  nHalfWidth + nRadius,
-                                  round(fDistance * i) + nRadius);
-        }
-        else
-        {
-            aLocation = Rectangle(round(fDistance * i) - nRadius,
-                                  nHalfHeight - nRadius,
-                                  round(fDistance * i) + nRadius,
-                                  nHalfHeight + nRadius);
-        }
+        aLocation = Rectangle(nHalfWidth - nRadius,
+                              round(fDistance * i) - nRadius,
+                              nHalfWidth + nRadius,
+                              round(fDistance * i) + nRadius);
         mpOutDev->DrawEllipse(aLocation);
     }
 }


More information about the Libreoffice-commits mailing list