[Libreoffice-commits] core.git: sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 11 09:07:58 UTC 2019


 sw/source/core/doc/tblrwcl.cxx |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 36c931eaebdeff85e579c2b233174f34455c4c07
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Dec 10 15:31:10 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Dec 11 10:06:55 2019 +0100

    this union not necessary anymore
    
    the nSize field is never used
    
    Change-Id: I5186999a48152606de721ee96f71ccfa9ed27df3
    Reviewed-on: https://gerrit.libreoffice.org/84856
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 3c701ffc52cb..0ff6475968cc 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -75,19 +75,16 @@ namespace {
 // up the current one in the array. If it's already there return the new one.
 struct CpyTabFrame
 {
-    union {
-        SwFrameFormat* pFrameFormat; // for CopyCol
-        SwTwips nSize;               // for DelCol
-    } Value;
+    SwFrameFormat* pFrameFormat;
     SwTableBoxFormat *pNewFrameFormat;
 
     explicit CpyTabFrame(SwFrameFormat* pCurrentFrameFormat) : pNewFrameFormat( nullptr )
-    {   Value.pFrameFormat = pCurrentFrameFormat; }
+    {   pFrameFormat = pCurrentFrameFormat; }
 
     bool operator==( const CpyTabFrame& rCpyTabFrame ) const
-        { return  static_cast<sal_uLong>(Value.nSize) == static_cast<sal_uLong>(rCpyTabFrame.Value.nSize); }
+        { return pFrameFormat == rCpyTabFrame.pFrameFormat; }
     bool operator<( const CpyTabFrame& rCpyTabFrame ) const
-        { return  static_cast<sal_uLong>(Value.nSize) < static_cast<sal_uLong>(rCpyTabFrame.Value.nSize); }
+        { return pFrameFormat < rCpyTabFrame.pFrameFormat; }
 };
 
 struct CR_SetBoxWidth
@@ -303,7 +300,7 @@ static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const pCpyPara)
 
                 aFindFrame.pNewFrameFormat = pNewFormat;
                 pCpyPara->rTabFrameArr.insert( aFindFrame );
-                aFindFrame.Value.pFrameFormat = pNewFormat;
+                aFindFrame.pFrameFormat = pNewFormat;
                 pCpyPara->rTabFrameArr.insert( aFindFrame );
             }
         }
@@ -351,7 +348,7 @@ static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const pCpyPara)
                     ? rBoxItem.GetTop()
                     : rBoxItem.GetRight() )
             {
-                aFindFrame.Value.pFrameFormat = pBox->GetFrameFormat();
+                aFindFrame.pFrameFormat = pBox->GetFrameFormat();
 
                 SvxBoxItem aNew( rBoxItem );
                 if( 8 > pCpyPara->nDelBorderFlag )
@@ -1241,7 +1238,7 @@ bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
             {
                 const CpyTabFrame& rCTF = aFrameArr[ --i ];
                 if( rCTF.pNewFrameFormat == aFindFrame.pNewFrameFormat ||
-                    rCTF.Value.pFrameFormat == aFindFrame.pNewFrameFormat )
+                    rCTF.pFrameFormat == aFindFrame.pNewFrameFormat )
                 {
                     aFrameArr.erase( aFrameArr.begin() + i );
                     aLastBoxArr.erase( aLastBoxArr.begin() + i );


More information about the Libreoffice-commits mailing list