[Libreoffice-commits] core.git: editeng/source include/editeng include/svtools include/vcl svtools/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Sep 10 12:18:46 UTC 2021
editeng/source/items/borderline.cxx | 21 ++++++++++-----------
include/editeng/borderline.hxx | 17 +++++++----------
include/svtools/brwbox.hxx | 2 +-
include/vcl/commandevent.hxx | 5 ++---
include/vcl/outdevstate.hxx | 8 ++++----
include/vcl/print.hxx | 6 +++---
include/vcl/transfer.hxx | 8 ++++----
svtools/source/brwbox/datwin.cxx | 2 +-
8 files changed, 32 insertions(+), 37 deletions(-)
New commits:
commit 53ebbad48c8c2a71044917a5cbac9657126e5adc
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Sep 8 12:38:39 2021 +0100
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 10 14:18:09 2021 +0200
warning: Excessive padding in 'struct OutDevState'
experiment with optin.performance.Padding analyzer and tuning
AllowedPad to 2
with clang as compiler;
export ENVCFLAGSCXX="-Xclang -analyze -Xclang -analyzer-checker=optin.performance -Xclang -analyzer-config -Xclang optin.performance.Padding:AllowedPad=2"
and get a report of:
OutDevState (13 padding bytes, where 5 is optimal)
UIControlOptions (9 padding bytes, where 1 is optimal)
Change-Id: I174f6f62d6e32df057d5e0f21d4274166f6ed8c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121812
Tested-by: Jenkins
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 1b06258b20a8..42d61b5daa43 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -98,22 +98,21 @@ Color SvxBorderLine::threeDMediumColor( Color aMain )
SvxBorderLine::SvxBorderLine( const Color *pCol, tools::Long nWidth,
SvxBorderLineStyle nStyle,
Color (*pColorOutFn)( Color ), Color (*pColorInFn)( Color ) )
-: m_nWidth( nWidth )
-, m_bMirrorWidths( false )
-, m_aWidthImpl( SvxBorderLine::getWidthImpl( nStyle ) )
-, m_nMult( 1 )
-, m_nDiv( 1 )
-, m_nStyle( nStyle )
-, m_bUseLeftTop( false )
-, m_pColorOutFn( pColorOutFn )
-, m_pColorInFn( pColorInFn )
-, m_pColorGapFn( nullptr )
+ : m_nWidth(nWidth)
+ , m_nMult(1)
+ , m_nDiv(1)
+ , m_pColorOutFn(pColorOutFn)
+ , m_pColorInFn(pColorInFn)
+ , m_pColorGapFn(nullptr)
+ , m_aWidthImpl(SvxBorderLine::getWidthImpl(nStyle))
+ , m_nStyle(nStyle)
+ , m_bMirrorWidths(false)
+ , m_bUseLeftTop(false)
{
if ( pCol )
aColor = *pCol;
}
-
SvxBorderLineStyle
ConvertBorderStyleFromWord(int const nWordLineStyle)
{
diff --git a/include/editeng/borderline.hxx b/include/editeng/borderline.hxx
index e48b461a8b02..d22e0c586317 100644
--- a/include/editeng/borderline.hxx
+++ b/include/editeng/borderline.hxx
@@ -143,20 +143,17 @@ double EDITENG_DLLPUBLIC ConvertBorderWidthFromWord(SvxBorderLineStyle,
class EDITENG_DLLPUBLIC SvxBorderLine final
{
- Color aColor;
-
tools::Long m_nWidth;
- bool m_bMirrorWidths;
- BorderWidthImpl m_aWidthImpl;
tools::Long m_nMult;
tools::Long m_nDiv;
-
+ Color (*m_pColorOutFn)(Color);
+ Color (*m_pColorInFn)(Color);
+ Color (*m_pColorGapFn)(Color);
+ BorderWidthImpl m_aWidthImpl;
+ Color aColor;
SvxBorderLineStyle m_nStyle;
-
- bool m_bUseLeftTop;
- Color (*m_pColorOutFn)( Color );
- Color (*m_pColorInFn)( Color );
- Color (*m_pColorGapFn)( Color );
+ bool m_bMirrorWidths;
+ bool m_bUseLeftTop;
public:
SvxBorderLine( const Color *pCol = nullptr,
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 1c7d6e5404cc..60e37de7d432 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -118,8 +118,8 @@ namespace o3tl
class BrowseEvent
{
VclPtr<vcl::Window> pWin;
- sal_Int32 nRow;
tools::Rectangle aRect;
+ sal_Int32 nRow;
sal_uInt16 nCol;
sal_uInt16 nColId;
diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx
index 9edcdb4d6f13..883147fad491 100644
--- a/include/vcl/commandevent.hxx
+++ b/include/vcl/commandevent.hxx
@@ -309,16 +309,15 @@ class VCL_DLLPUBLIC CommandGestureData
public:
double const mfX;
double const mfY;
- GestureEventType const meEventType;
-
double const mfOffset;
+ GestureEventType const meEventType;
PanningOrientation const meOrientation;
CommandGestureData(double fX, double fY, GestureEventType eEventType, double fOffset, PanningOrientation eOrientation)
: mfX(fX)
, mfY(fY)
- , meEventType(eEventType)
, mfOffset(fOffset)
+ , meEventType(eEventType)
, meOrientation(eOrientation)
{}
};
diff --git a/include/vcl/outdevstate.hxx b/include/vcl/outdevstate.hxx
index 60d12ac523f5..a80620f957b6 100644
--- a/include/vcl/outdevstate.hxx
+++ b/include/vcl/outdevstate.hxx
@@ -79,22 +79,22 @@ struct OutDevState
OutDevState() = default;
OutDevState(OutDevState&&) = default;
- std::optional<MapMode> mpMapMode;
- bool mbMapActive = false;
std::unique_ptr<vcl::Region> mpClipRegion;
+ std::optional<MapMode> mpMapMode;
+ std::optional<vcl::Font> mpFont;
+ std::optional<Point> mpRefPoint;
std::optional<Color> mpLineColor;
std::optional<Color> mpFillColor;
- std::optional<vcl::Font> mpFont;
std::optional<Color> mpTextColor;
std::optional<Color> mpTextFillColor;
std::optional<Color> mpTextLineColor;
std::optional<Color> mpOverlineColor;
- std::optional<Point> mpRefPoint;
TextAlign meTextAlign = ALIGN_TOP;
RasterOp meRasterOp = RasterOp::OverPaint;
ComplexTextLayoutFlags mnTextLayoutMode = ComplexTextLayoutFlags::Default;
LanguageType meTextLanguage = LANGUAGE_SYSTEM;
PushFlags mnFlags = PushFlags::NONE;
+ bool mbMapActive = false;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index dba696eebf18..e487e8aa82b5 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -533,13 +533,13 @@ public:
struct UIControlOptions
{
OUString maDependsOnName;
+ OUString maGroupHint;
+ std::vector< css::beans::PropertyValue >
+ maAddProps;
sal_Int32 mnDependsOnEntry;
bool mbAttachToDependency;
- OUString maGroupHint;
bool mbInternalOnly;
bool mbEnabled;
- std::vector< css::beans::PropertyValue >
- maAddProps;
UIControlOptions( const OUString& i_rDependsOnName = OUString(),
sal_Int32 i_nDependsOnEntry = -1, bool i_bAttachToDependency = false)
diff --git a/include/vcl/transfer.hxx b/include/vcl/transfer.hxx
index 99413ad189e3..45fa55176e3a 100644
--- a/include/vcl/transfer.hxx
+++ b/include/vcl/transfer.hxx
@@ -90,9 +90,9 @@ struct TransferableObjectDescriptor
struct AcceptDropEvent
{
- sal_Int8 mnAction;
Point maPosPixel;
const css::datatransfer::dnd::DropTargetDragEvent maDragEvent;
+ sal_Int8 mnAction;
bool mbLeaving;
bool mbDefault;
@@ -104,26 +104,26 @@ struct AcceptDropEvent
AcceptDropEvent( sal_Int8 nAction,
const Point& rPosPixel,
const css::datatransfer::dnd::DropTargetDragEvent& rDragEvent ) :
- mnAction( nAction ),
maPosPixel( rPosPixel ),
maDragEvent( rDragEvent ),
+ mnAction( nAction ),
mbLeaving( false ),
mbDefault( false ) {}
};
struct ExecuteDropEvent
{
- sal_Int8 mnAction;
Point maPosPixel;
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent;
+ sal_Int8 mnAction;
bool mbDefault;
ExecuteDropEvent( sal_Int8 nAction,
const Point& rPosPixel,
const css::datatransfer::dnd::DropTargetDropEvent& rDropEvent ) :
- mnAction( nAction ),
maPosPixel( rPosPixel ),
maDropEvent( rDropEvent ),
+ mnAction( nAction ),
mbDefault( false ) {}
};
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index a7bbde76fe28..87ae8ef1d92c 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -575,8 +575,8 @@ BrowseEvent::BrowseEvent( vcl::Window* pWindow,
sal_Int32 nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
const tools::Rectangle& rRect ):
pWin(pWindow),
- nRow(nAbsRow),
aRect(rRect),
+ nRow(nAbsRow),
nCol(nColumn),
nColId(nColumnId)
{
More information about the Libreoffice-commits
mailing list