sw/inc/swtable.hxx                  |    6 +++---
 sw/source/core/doc/tblrwcl.cxx      |   10 +++++-----
 sw/source/core/docnode/ndcopy.cxx   |    2 +-
 sw/source/core/layout/tabfrm.cxx    |    2 +-
 sw/source/core/table/swnewtable.cxx |    2 +-
 sw/source/core/table/swtable.cxx    |    4 ++--
 sw/source/filter/html/htmltab.cxx   |    8 ++++----
 sw/source/filter/xml/xmltbli.cxx    |    2 +-
 8 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 7abbdb5eb30d269fcdd97eab9dcf0b7f5526c880
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Sep 6 12:04:26 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Sep 6 14:07:22 2024 +0200

    return SwTableLineFormat from SwTableLine::GetFrameFormat
    
    since that is always the SwFrameFormat subclass we are attached to
    
    Change-Id: I02645ac4ab5078e5fd201fef5fdae5232652a9f0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172939
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 368665e5008c..7bc3ed0439ac 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -395,11 +395,11 @@ public:
     const SwTableBox *GetUpper() const { return m_pUpper; }
     void SetUpper( SwTableBox *pNew ) { m_pUpper = pNew; }
 
-    SwFrameFormat* GetFrameFormat()       { return 
static_cast<SwFrameFormat*>(GetRegisteredIn()); }
-    SwFrameFormat* GetFrameFormat() const { return 
const_cast<SwFrameFormat*>(static_cast<const 
SwFrameFormat*>(GetRegisteredIn())); }
+    SwTableLineFormat* GetFrameFormat()       { return 
static_cast<SwTableLineFormat*>(GetRegisteredIn()); }
+    SwTableLineFormat* GetFrameFormat() const { return 
const_cast<SwTableLineFormat*>(static_cast<const 
SwTableLineFormat*>(GetRegisteredIn())); }
 
     // Creates an own FrameFormat if more lines depend on it.
-    SwFrameFormat* ClaimFrameFormat();
+    SwTableLineFormat* ClaimFrameFormat();
     void ChgFrameFormat( SwTableLineFormat* pNewFormat );
 
     // Search next/previous box with content.
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index e71982fd6077..13dc1a20250b 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -349,7 +349,7 @@ static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const 
pCpyPara)
 static SwTableLine* lcl_CopyRow(FndLine_& rFndLine, CpyPara *const pCpyPara)
 {
     SwTableLine* pNewLine = new SwTableLine(
-                            
static_cast<SwTableLineFormat*>(rFndLine.GetLine()->GetFrameFormat()),
+                        rFndLine.GetLine()->GetFrameFormat(),
                         rFndLine.GetBoxes().size(), pCpyPara->pInsBox );
     if( pCpyPara->pInsBox )
     {
@@ -1096,7 +1096,7 @@ bool SwTable::OldSplitRow( SwDoc& rDoc, const SwSelBoxes& 
rBoxes, sal_uInt16 nCn
         {
             // Create a new Line in the new Box
             SwTableLine* pNewLine = new SwTableLine(
-                    
static_cast<SwTableLineFormat*>(pInsLine->GetFrameFormat()), 1, pNewBox );
+                    pInsLine->GetFrameFormat(), 1, pNewBox );
             if( bChgLineSz )
             {
                 pNewLine->ClaimFrameFormat()->SetFormatAttr( aFSz );
@@ -1471,7 +1471,7 @@ static void lcl_Merge_MoveLine(FndLine_& rFndLine, 
InsULPara *const pULPara)
             SwTableBox* pLMBox = new SwTableBox(
                 pULPara->pLeftBox->GetFrameFormat(), 0, pInsLine );
             SwTableLine* pLMLn = new SwTableLine(
-                        
static_cast<SwTableLineFormat*>(pInsLine->GetFrameFormat()), 2, pLMBox );
+                        pInsLine->GetFrameFormat(), 2, pLMBox );
             pLMLn->ClaimFrameFormat()->ResetFormatAttr( RES_FRM_SIZE );
 
             pLMBox->GetTabLines().insert( pLMBox->GetTabLines().begin(), pLMLn 
);
@@ -1505,7 +1505,7 @@ static void lcl_Merge_MoveLine(FndLine_& rFndLine, 
InsULPara *const pULPara)
     pLines = &pULPara->pInsBox->GetTabLines();
 
     SwTableLine* pNewLine = new SwTableLine(
-        static_cast<SwTableLineFormat*>(rFndLine.GetLine()->GetFrameFormat()), 
0, pULPara->pInsBox );
+        rFndLine.GetLine()->GetFrameFormat(), 0, pULPara->pInsBox );
     InsULPara aPara( *pULPara );       // copying
     aPara.pInsLine = pNewLine;
     FndBoxes_t & rLineBoxes = rFndLine.GetBoxes();
@@ -1566,7 +1566,7 @@ bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& 
rBoxes,
     }
 
     SwTableLine* pInsLine = new SwTableLine(
-                
static_cast<SwTableLineFormat*>(pFndBox->GetLines().front()->GetLine()->GetFrameFormat()),
 0,
+                pFndBox->GetLines().front()->GetLine()->GetFrameFormat(), 0,
                 !pFndBox->GetUpper() ? nullptr : pFndBox->GetBox() );
     pInsLine->ClaimFrameFormat()->ResetFormatAttr( RES_FRM_SIZE );
 
diff --git a/sw/source/core/docnode/ndcopy.cxx 
b/sw/source/core/docnode/ndcopy.cxx
index 142de524f5be..df894cda0aba 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -213,7 +213,7 @@ static void lcl_CopyTableBox( SwTableBox* pBox, CopyTable* 
pCT )
 
 static void lcl_CopyTableLine( const SwTableLine* pLine, CopyTable* pCT )
 {
-    SwTableLineFormat * pLineFormat = 
static_cast<SwTableLineFormat*>(pLine->GetFrameFormat());
+    SwTableLineFormat * pLineFormat = pLine->GetFrameFormat();
     for (const auto& rMap : pCT->m_rMapArr)
         if ( !lcl_SrchNew( rMap, 
reinterpret_cast<SwFrameFormat**>(&pLineFormat) ) )
             break;
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index fda91a289448..839f6aaa1330 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -5521,7 +5521,7 @@ bool SwRowFrame::IsRowSplitAllowed() const
     if ( IsForceRowSplitAllowed() )
         return true;
 
-    const SwTableLineFormat* pFrameFormat = 
static_cast<SwTableLineFormat*>(GetTabLine()->GetFrameFormat());
+    const SwTableLineFormat* pFrameFormat = GetTabLine()->GetFrameFormat();
     const SwFormatRowSplit& rLP = pFrameFormat->GetRowSplit();
     return rLP.GetValue();
 }
diff --git a/sw/source/core/table/swnewtable.cxx 
b/sw/source/core/table/swnewtable.cxx
index 21a684baca6a..5d0464c46e04 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -2184,7 +2184,7 @@ void SwTable::ConvertSubtableBox(sal_uInt16 const nRow, 
sal_uInt16 const nBox)
     {
         SwTableLine *const pSubLine(pSubTableBox->GetTabLines()[i]);
         SwTableLine *const pNewLine = new SwTableLine(
-            static_cast<SwTableLineFormat*>(pSourceLine->GetFrameFormat()),
+            pSourceLine->GetFrameFormat(),
             pSourceLine->GetTabBoxes().size() - 1 + 
pSubLine->GetTabBoxes().size(),
             nullptr);
         SwFrameFormat const& rSubLineFormat(*pSubLine->GetFrameFormat());
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 5225af1c0dd9..86ea1ae74488 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1477,13 +1477,13 @@ SwTableLine::~SwTableLine()
         delete pMod;    // and delete
 }
 
-SwFrameFormat* SwTableLine::ClaimFrameFormat()
+SwTableLineFormat* SwTableLine::ClaimFrameFormat()
 {
     // This method makes sure that this object is an exclusive SwTableLine 
client
     // of an SwTableLineFormat object
     // If other SwTableLine objects currently listen to the same 
SwTableLineFormat as
     // this one, something needs to be done
-    SwTableLineFormat *pRet = 
static_cast<SwTableLineFormat*>(GetFrameFormat());
+    SwTableLineFormat *pRet = GetFrameFormat();
     SwIterator<SwTableLine,SwFormat> aIter( *pRet );
     for( SwTableLine* pLast = aIter.First(); pLast; pLast = aIter.Next() )
     {
diff --git a/sw/source/filter/html/htmltab.cxx 
b/sw/source/filter/html/htmltab.cxx
index db6f125cc45c..92ca567aeeb0 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -1580,7 +1580,7 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper,
     }
     if( nTopRow==nBottomRow-1 && (nRowHeight || pBGBrushItem) )
     {
-        SwTableLineFormat *pFrameFormat = 
static_cast<SwTableLineFormat*>(pLine->ClaimFrameFormat());
+        SwTableLineFormat *pFrameFormat = pLine->ClaimFrameFormat();
         ResetLineFrameFormatAttrs( pFrameFormat );
 
         if( nRowHeight )
@@ -1602,7 +1602,7 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper,
     else if( !m_pLineFrameFormatNoHeight )
     {
         // else, we'll have to remove the height from the attribute and 
remember the format
-        m_pLineFrameFormatNoHeight = 
static_cast<SwTableLineFormat*>(pLine->ClaimFrameFormat());
+        m_pLineFrameFormatNoHeight = pLine->ClaimFrameFormat();
 
         ResetLineFrameFormatAttrs( m_pLineFrameFormatNoHeight );
     }
@@ -1739,7 +1739,7 @@ SwTableBox *HTMLTable::MakeTableBox( SwTableLine *pUpper,
                 if( !m_pLineFrameFormatNoHeight )
                 {
                     // If there's no line format without height yet, we can 
use that one
-                    m_pLineFrameFormatNoHeight = 
static_cast<SwTableLineFormat*>(pLine->ClaimFrameFormat());
+                    m_pLineFrameFormatNoHeight = pLine->ClaimFrameFormat();
 
                     ResetLineFrameFormatAttrs( m_pLineFrameFormatNoHeight );
                 }
@@ -2391,7 +2391,7 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 
nAbsAvail,
     m_xBox1.reset((pLine1->GetTabBoxes())[0]);
     pLine1->GetTabBoxes().erase(pLine1->GetTabBoxes().begin());
 
-    m_pLineFormat = static_cast<SwTableLineFormat*>(pLine1->GetFrameFormat());
+    m_pLineFormat = pLine1->GetFrameFormat();
     m_pBoxFormat = m_xBox1->GetFrameFormat();
 
     MakeTable_( pBox );
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 1ae9b8d8ef33..65819f0afb3d 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2613,7 +2613,7 @@ void SwXMLTableContext::MakeTable()
     pLine1->GetTabBoxes().erase( pLine1->GetTabBoxes().begin() );
     m_bOwnsBox1 = true;
 
-    m_pLineFormat = static_cast<SwTableLineFormat*>(pLine1->GetFrameFormat());
+    m_pLineFormat = pLine1->GetFrameFormat();
     m_pBoxFormat = m_pBox1->GetFrameFormat();
 
     MakeTable_();

Reply via email to