[Libreoffice-commits] core.git: 2 commits - include/sfx2 sfx2/source xmloff/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Sep 11 15:24:24 UTC 2021


 include/sfx2/childwin.hxx          |   14 +++++++-------
 include/sfx2/ctrlitem.hxx          |    2 +-
 sfx2/source/appl/childwin.cxx      |    4 ++--
 sfx2/source/control/ctrlitem.cxx   |    8 ++++----
 xmloff/source/core/xmltoken.cxx    |    9 ++++++++-
 xmloff/source/draw/animexp.cxx     |   14 +++++++-------
 xmloff/source/draw/shapeimport.cxx |    2 +-
 7 files changed, 30 insertions(+), 23 deletions(-)

New commits:
commit d114a341bc9e891b2e10ff60ddadb0b5f58e6381
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Sep 11 15:51:39 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Sep 11 17:24:02 2021 +0200

    clang:optin.performance.Padding in sfx2
    
    Excessive padding in 'class SfxControllerItem' (10 padding bytes, where
    2 is optimal).
    Excessive padding in 'struct SfxChildWinInfo' (11 padding bytes, where 3
    is optimal).
    Excessive padding in 'struct SfxChildWinFactory' (12 padding bytes,
    where 4 is optimal).
    Excessive padding in 'class SfxChildWindow' (10 padding bytes, where 2
    is optimal).
    
    Change-Id: I435cfcf8a199bcab4612d671e1900ba659b8e383
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121941
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index e21832b575c4..cccfa4d87a0b 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -60,13 +60,13 @@ namespace o3tl
 // ChildWindow Configuration
 struct SAL_DLLPUBLIC_RTTI SfxChildWinInfo
 {
-    bool                bVisible;
-    Point               aPos;
-    Size                aSize;
-    SfxChildWindowFlags nFlags;
     OUString            aExtraString;
     OUString            aModule;
     OString             aWinState;
+    Point               aPos;
+    Size                aSize;
+    SfxChildWindowFlags nFlags;
+    bool                bVisible;
 
                         SfxChildWinInfo()
                         {
@@ -85,8 +85,8 @@ typedef std::unique_ptr<SfxChildWindow> (*SfxChildWinCtor)( vcl::Window *pParent
 struct SFX2_DLLPUBLIC SfxChildWinFactory
 {
     SfxChildWinCtor             pCtor;  // Factory method
-    sal_uInt16                  nId;    // ChildWindow-Id ( SlotId )
     SfxChildWinInfo             aInfo;  // Configuration
+    sal_uInt16                  nId;    // ChildWindow-Id ( SlotId )
     sal_uInt16                  nPos;   // Position in UI
 
     SfxChildWinFactory( SfxChildWinCtor pTheCtor, sal_uInt16 nID, sal_uInt16 n );
@@ -99,12 +99,12 @@ extern SFX2_DLLPUBLIC bool ParentIsFloatingWindow(const vcl::Window *pParent);
 class SFX2_DLLPUBLIC SfxChildWindow
 {
     VclPtr<vcl::Window>        pParent;         // parent window ( Topwindow )
-    sal_uInt16                 nType;           // ChildWindow-Id
     VclPtr<vcl::Window>        pWindow;         // actual contents
+    std::unique_ptr< SfxChildWindow_Impl>       pImpl;            // Implementation data
     std::shared_ptr<SfxDialogController> xController;     // actual contents
     SfxChildAlignment          eChildAlignment; // Current css::drawing::Alignment
-    std::unique_ptr< SfxChildWindow_Impl>       pImpl;            // Implementation data
                                                  // Another window in pWindow
+    sal_uInt16                 nType;           // ChildWindow-Id
     SAL_DLLPRIVATE void ClearWorkwin();
 
 protected:
diff --git a/include/sfx2/ctrlitem.hxx b/include/sfx2/ctrlitem.hxx
index 27f2d69422ea..03e530c782d8 100644
--- a/include/sfx2/ctrlitem.hxx
+++ b/include/sfx2/ctrlitem.hxx
@@ -30,10 +30,10 @@ class SfxBindings;
 class SFX2_DLLPUBLIC SfxControllerItem
 {
 private:
-    sal_uInt16          nId;
     SfxControllerItem*  pNext; // to notify next ControllerItem
     SfxBindings*        pBindings;
     MapUnit             eFallbackCoreMetric;
+    sal_uInt16          nId;
 
 public:
     SfxBindings &       GetBindings() {
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 404d912d9d3e..b00f70a3afb3 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -143,9 +143,9 @@ bool GetSplitSizeFromString( const OUString& rStr, Size& rSize )
 
 SfxChildWindow::SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId)
     : pParent(pParentWindow)
-    , nType(nId)
-    , eChildAlignment(SfxChildAlignment::NOALIGNMENT)
     , pImpl(new SfxChildWindow_Impl)
+    , eChildAlignment(SfxChildAlignment::NOALIGNMENT)
+    , nType(nId)
 {
     pImpl->pFact = nullptr;
     pImpl->bHideNotDelete = false;
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
index b55ceda7d349..28edfec666de 100644
--- a/sfx2/source/control/ctrlitem.cxx
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -170,19 +170,19 @@ void SfxControllerItem::SetId( sal_uInt16 nItemId )
 
 // creates an atomic item for a controller without registration.
 SfxControllerItem::SfxControllerItem()
-    : nId(0)
-    , pNext(this)
+    : pNext(this)
     , pBindings(nullptr)
     , eFallbackCoreMetric(MapUnit::Map100thMM)
+    , nId(0)
 {
 }
 
 // creates a representation of the function nId and registers it
 SfxControllerItem::SfxControllerItem(sal_uInt16 nID, SfxBindings &rBindings)
-    : nId(nID)
-    , pNext(this)
+    : pNext(this)
     , pBindings(&rBindings)
     , eFallbackCoreMetric(MapUnit::Map100thMM)
+    , nId(nID)
 {
     Bind(nId, &rBindings);
 }
commit 580b314a797917def3ce0f52abc02700a2768120
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Sep 11 15:51:05 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Sep 11 17:23:48 2021 +0200

    clang:optin.performance.Padding in xmloff
    
    Excessive padding in 'struct (anonymous namespace)::ConnectionHint' (11
    padding bytes, where 3 is optimal).
    Excessive padding in 'struct (anonymous namespace)::XMLEffectHint' (12
    padding bytes, where 4 is optimal).
    Excessive padding in 'struct xmloff::token::(anonymous
    namespace)::XMLTokenEntry' (10 padding bytes, where 2 is optimal).
    
    Change-Id: I176378d7cd6aa441856fce1b20c3af78bd5804c2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121940
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index f2f3495671f7..1e682a39fcb1 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -33,11 +33,18 @@ namespace xmloff::token {
     {
         struct XMLTokenEntry
         {
-            sal_Int32 nLength;
             const char* pChar;
             std::optional<OUString> xOUString;
+            sal_Int32 nLength;
 #if OSL_DEBUG_LEVEL > 0
             XMLTokenEnum eToken;
+#endif
+#if OSL_DEBUG_LEVEL > 0
+            XMLTokenEntry(sal_Int32 nLen, const char* p, std::optional<OUString> xStr, XMLTokenEnum eTok)
+                : pChar(p), xOUString(std::move(xStr)), nLength(nLen), eToken(eTok) {}
+#else
+            XMLTokenEntry(sal_Int32 nLen, const char* p, std::optional<OUString> xStr)
+                : pChar(p), xOUString(std::move(xStr)), nLength(nLen) {}
 #endif
         };
     }
diff --git a/xmloff/source/draw/animexp.cxx b/xmloff/source/draw/animexp.cxx
index 65b791e2455e..f839506dbdd4 100644
--- a/xmloff/source/draw/animexp.cxx
+++ b/xmloff/source/draw/animexp.cxx
@@ -192,7 +192,7 @@ void SdXMLImplSetEffect( AnimationEffect eEffect, XMLEffect& eKind, XMLEffectDir
 
 namespace {
 
-enum XMLActionKind
+enum XMLActionKind : sal_Int8
 {
     XMLE_SHOW,
     XMLE_HIDE,
@@ -202,27 +202,27 @@ enum XMLActionKind
 
 struct XMLEffectHint
 {
-    XMLActionKind   meKind;
-    bool        mbTextEffect;
     Reference<XShape> mxShape;
+    XMLActionKind   meKind;
+    bool            mbTextEffect;
 
     XMLEffect       meEffect;
     XMLEffectDirection  meDirection;
     sal_Int16       mnStartScale;
 
     AnimationSpeed  meSpeed;
-    sal_Int32       maDimColor;
     OUString        maSoundURL;
-    bool        mbPlayFull;
+    sal_Int32       maDimColor;
     sal_Int32       mnPresId;
+    bool        mbPlayFull;
 
     bool operator<(const XMLEffectHint& rComp) const { return mnPresId < rComp.mnPresId; }
 
     XMLEffectHint()
     :   meKind( XMLE_SHOW ), mbTextEffect( false ),
         meEffect( EK_none ), meDirection( ED_none ), mnStartScale( -1 ),
-        meSpeed( AnimationSpeed_SLOW ), maDimColor(0), mbPlayFull( false ),
-        mnPresId( 0 )
+        meSpeed( AnimationSpeed_SLOW ), maDimColor(0),
+        mnPresId( 0 ), mbPlayFull( false )
         {}
 };
 
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index cc114a8f636b..c338c15c724a 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -64,9 +64,9 @@ namespace {
 struct ConnectionHint
 {
     css::uno::Reference< css::drawing::XShape > mxConnector;
-    bool      bStart;
     OUString  aDestShapeId;
     sal_Int32 nDestGlueId;
+    bool      bStart;
 };
 
 }


More information about the Libreoffice-commits mailing list