summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/access/accselectionhelper.cxx13
-rw-r--r--sw/source/core/doc/tblrwcl.cxx6
-rw-r--r--sw/source/core/docnode/ndtbl.cxx22
-rw-r--r--sw/source/core/undo/untbl.cxx3
-rw-r--r--sw/source/core/unocore/unotbl.cxx3
-rw-r--r--sw/source/ui/vba/vbadocumentproperties.cxx5
-rw-r--r--sw/source/ui/vba/vbaselection.cxx5
-rw-r--r--sw/source/uibase/app/docst.cxx7
-rw-r--r--sw/source/uibase/shells/textsh1.cxx3
9 files changed, 37 insertions, 30 deletions
diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx
index 3372f434c5a1..96a622ece9f7 100644
--- a/sw/source/core/access/accselectionhelper.cxx
+++ b/sw/source/core/access/accselectionhelper.cxx
@@ -87,8 +87,7 @@ void SwAccessibleSelectionHelper::selectAccessibleChild(
// we can only select fly frames, so we ignore (should: return
// false) all other attempts at child selection
- SwFEShell* pFEShell = GetFEShell();
- if( pFEShell != nullptr )
+ if (GetFEShell())
{
const SdrObject *pObj = aChild.GetDrawObject();
if( pObj )
@@ -141,8 +140,7 @@ bool SwAccessibleSelectionHelper::isAccessibleChildSelected(
// ... and compare to the currently selected frame
bool bRet = false;
- const SwFEShell* pFEShell = GetFEShell();
- if( pFEShell )
+ if (const SwFEShell* pFEShell = GetFEShell())
{
if ( aChild.GetSwFrame() != nullptr )
{
@@ -171,7 +169,7 @@ void SwAccessibleSelectionHelper::selectAllAccessibleChildren( )
// the first we can select, and select it.
SwFEShell* pFEShell = GetFEShell();
- if( !pFEShell )
+ if (!pFEShell)
return;
std::list< SwAccessibleChild > aChildren;
@@ -197,8 +195,7 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
sal_Int32 nCount = 0;
// Only one frame can be selected at a time, and we only frames
// for selectable children.
- const SwFEShell* pFEShell = GetFEShell();
- if( pFEShell != nullptr )
+ if (const SwFEShell* pFEShell = GetFEShell())
{
const SwFlyFrame* pFlyFrame = pFEShell->GetSelectedFlyFrame();
if( pFlyFrame )
@@ -250,7 +247,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
// be 0, and a selection must exist, otherwise we have to throw an
// lang::IndexOutOfBoundsException
SwFEShell* pFEShell = GetFEShell();
- if( nullptr == pFEShell )
+ if (!pFEShell)
throwIndexOutOfBoundsException();
SwAccessibleChild aChild;
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 4dde7b3e6192..b169b9d8391b 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -506,7 +506,8 @@ bool SwTable::InsertCol( SwDoc& rDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt,
pPCD->AddRowCols( *this, rBoxes, nCnt, bBehind );
rDoc.UpdateCharts( GetFrameFormat()->GetName() );
- rDoc.GetDocShell()->GetFEShell()->UpdateTableStyleFormatting();
+ if (SwFEShell* pFEShell = rDoc.GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting();
return bRes;
}
@@ -625,7 +626,8 @@ bool SwTable::InsertRow_( SwDoc* pDoc, const SwSelBoxes& rBoxes,
pPCD->AddRowCols( *this, rBoxes, nCnt, bBehind );
pDoc->UpdateCharts( GetFrameFormat()->GetName() );
- pDoc->GetDocShell()->GetFEShell()->UpdateTableStyleFormatting(pTableNd);
+ if (SwFEShell* pFEShell = pDoc->GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting(pTableNd);
return true;
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 4a6ee962f65a..edeb5b7cb2ba 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -2101,7 +2101,8 @@ bool SwDoc::DeleteRowCol(const SwSelBoxes& rBoxes, RowColMode const eMode)
getIDocumentContentOperations().DeleteSection( pTableNd );
}
- GetDocShell()->GetFEShell()->UpdateTableStyleFormatting();
+ if (SwFEShell* pFEShell = GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting();
getIDocumentState().SetModified();
getIDocumentFieldsAccess().SetFieldsDirty( true, nullptr, SwNodeOffset(0) );
@@ -2135,7 +2136,8 @@ bool SwDoc::DeleteRowCol(const SwSelBoxes& rBoxes, RowColMode const eMode)
bRet = rTable.DeleteSel( this, aSelBoxes, nullptr, pUndo.get(), true, true );
if (bRet)
{
- GetDocShell()->GetFEShell()->UpdateTableStyleFormatting();
+ if (SwFEShell* pFEShell = GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting();
getIDocumentState().SetModified();
getIDocumentFieldsAccess().SetFieldsDirty( true, nullptr, SwNodeOffset(0) );
@@ -2200,7 +2202,8 @@ bool SwDoc::SplitTable( const SwSelBoxes& rBoxes, bool bVert, sal_uInt16 nCnt,
if (bRet)
{
- GetDocShell()->GetFEShell()->UpdateTableStyleFormatting();
+ if (SwFEShell* pFEShell = GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting();
getIDocumentState().SetModified();
getIDocumentFieldsAccess().SetFieldsDirty( true, nullptr, SwNodeOffset(0) );
@@ -3248,8 +3251,11 @@ void SwDoc::SplitTable( const SwPosition& rPos, SplitTable_HeadlineOption eHdlnM
UpdateCharts( rTable.GetFrameFormat()->GetName() );
// update table style formatting of both the tables
- GetDocShell()->GetFEShell()->UpdateTableStyleFormatting(pTNd);
- GetDocShell()->GetFEShell()->UpdateTableStyleFormatting(pNew);
+ if (SwFEShell* pFEShell = GetDocShell()->GetFEShell())
+ {
+ pFEShell->UpdateTableStyleFormatting(pTNd);
+ pFEShell->UpdateTableStyleFormatting(pNew);
+ }
getIDocumentFieldsAccess().SetFieldsDirty( true, nullptr, SwNodeOffset(0) );
}
@@ -3527,7 +3533,8 @@ bool SwDoc::MergeTable( const SwPosition& rPos, bool bWithPrev, sal_uInt16 nMode
}
if( bRet )
{
- GetDocShell()->GetFEShell()->UpdateTableStyleFormatting();
+ if (SwFEShell* pFEShell = GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting();
getIDocumentState().SetModified();
getIDocumentFieldsAccess().SetFieldsDirty( true, nullptr, SwNodeOffset(0) );
@@ -4658,7 +4665,8 @@ void SwDoc::ChgTableStyle(const OUString& rName, const SwTableAutoFormat& rNewFo
SwFrameFormat* pFrameFormat = &GetTableFrameFormat(i, true);
SwTable* pTable = SwTable::FindTable(pFrameFormat);
if (pTable->GetTableStyleName() == rName)
- GetDocShell()->GetFEShell()->UpdateTableStyleFormatting(pTable->GetTableNode());
+ if (SwFEShell* pFEShell = GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting(pTable->GetTableNode());
}
getIDocumentState().SetModified();
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 2b97f8dbfbdb..49453108b2be 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1793,7 +1793,8 @@ void SwUndoTableNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
// TL_CHART2: need to inform chart of probably changed cell names
rDoc.UpdateCharts( pTableNd->GetTable().GetFrameFormat()->GetName() );
- rDoc.GetDocShell()->GetFEShell()->UpdateTableStyleFormatting(pTableNd);
+ if (SwFEShell* pFEShell = rDoc.GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting(pTableNd);
if( IsDelBox() )
m_nSttNode = pTableNd->GetIndex();
ClearFEShellTabCols(rDoc, nullptr);
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 90df0f543428..801f6cc954c6 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2690,7 +2690,8 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An
SwStyleNameMapper::FillUIName(sName, sName, SwGetPoolIdFromName::TabStyle);
pTable->SetTableStyleName(sName);
SwDoc* pDoc = pFormat->GetDoc();
- pDoc->GetDocShell()->GetFEShell()->UpdateTableStyleFormatting(pTable->GetTableNode());
+ if (SwFEShell* pFEShell = pDoc->GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting(pTable->GetTableNode());
}
break;
diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx
index 10ae56ab2d88..0e82611c926a 100644
--- a/sw/source/ui/vba/vbadocumentproperties.cxx
+++ b/sw/source/ui/vba/vbadocumentproperties.cxx
@@ -311,11 +311,8 @@ public:
{
if ( mpDocShell )
{
- SwFEShell* pFEShell = mpDocShell->GetFEShell();
- if(pFEShell)
- {
+ if (SwFEShell* pFEShell = mpDocShell->GetFEShell())
aReturn <<= pFEShell->GetLineCount();
- }
}
}
else
diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx
index dde7d4e21fb5..4e471525425f 100644
--- a/sw/source/ui/vba/vbaselection.cxx
+++ b/sw/source/ui/vba/vbaselection.cxx
@@ -1104,11 +1104,8 @@ void SAL_CALL SwVbaSelection::SplitTable()
SwDocShell* pDocShell = word::getDocShell( mxModel );
if( pDocShell )
{
- SwFEShell* pFEShell = pDocShell->GetFEShell();
- if( pFEShell )
- {
+ if (SwFEShell* pFEShell = pDocShell->GetFEShell())
pFEShell->SplitTable( SplitTable_HeadlineOption::ContentCopy );
- }
}
}
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 6ab7e659ae92..f624ff377ac6 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -1338,9 +1338,12 @@ void SwDocShell::UpdateStyle(const OUString &rName, SfxStyleFamily nFamily, SwWr
break;
case SfxStyleFamily::Table:
{
- if(GetFEShell()->IsTableMode())
+ if (SwFEShell* pFEShell = GetFEShell())
{
- GetFEShell()->TableCursorToCursor();
+ if(pFEShell->IsTableMode())
+ {
+ pFEShell->TableCursorToCursor();
+ }
}
SwTableAutoFormat aFormat(rName);
if (pCurrWrtShell->GetTableAutoFormat(aFormat))
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 37b321383a55..e28877c91f17 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -643,7 +643,8 @@ void SwTextShell::Execute(SfxRequest &rReq)
rWrtSh.ResetAttr( aAttribs );
// also clear the direct formatting flag inside SwTableBox(es)
- GetView().GetDocShell()->GetFEShell()->UpdateTableStyleFormatting(nullptr, true);
+ if (SwFEShell* pFEShell = GetView().GetDocShell()->GetFEShell())
+ pFEShell->UpdateTableStyleFormatting(nullptr, true);
rReq.Done();
break;