summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-16 15:23:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-17 08:25:47 +0200
commitccb2a1f650bc505f8a4f1abebf8ce4f9396562a8 (patch)
tree2ee2fd4f300ae95cf23bade1f242e02f9b276c07 /sw
parentda5c3a1ee43dd1a07cbd1b8005488bf05432593d (diff)
clang-tidy readability-redundant-smartptr-get
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/bastyp/calc.cxx4
-rw-r--r--sw/source/core/crsr/findattr.cxx5
-rw-r--r--sw/source/core/crsr/findtxt.cxx7
-rw-r--r--sw/source/core/doc/docfly.cxx2
-rw-r--r--sw/source/core/doc/docnew.cxx2
-rw-r--r--sw/source/core/doc/tblcpy.cxx2
-rw-r--r--sw/source/core/docnode/ndtbl.cxx4
-rw-r--r--sw/source/core/frmedt/fecopy.cxx2
-rw-r--r--sw/source/core/graphic/ndgrf.cxx2
-rw-r--r--sw/source/core/table/swnewtable.cxx2
-rw-r--r--sw/source/core/txtnode/atrfld.cxx2
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx4
-rw-r--r--sw/source/core/txtnode/thints.cxx4
-rw-r--r--sw/source/core/undo/rolbck.cxx10
-rw-r--r--sw/source/core/undo/unattr.cxx19
-rw-r--r--sw/source/core/undo/unsect.cxx20
-rw-r--r--sw/source/core/undo/untbl.cxx4
-rw-r--r--sw/source/core/unocore/unofield.cxx2
-rw-r--r--sw/source/core/unocore/unoobj.cxx10
-rw-r--r--sw/source/core/unocore/unorefmk.cxx4
-rw-r--r--sw/source/core/unocore/unosect.cxx52
-rw-r--r--sw/source/core/view/vnew.cxx5
-rw-r--r--sw/source/filter/html/htmlatr.cxx6
-rw-r--r--sw/source/filter/html/htmltab.cxx2
-rw-r--r--sw/source/filter/writer/writer.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx4
-rw-r--r--sw/source/filter/ww8/ww8toolbar.cxx2
-rw-r--r--sw/source/filter/xml/xmlexp.cxx2
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx2
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx3
-rw-r--r--sw/source/uibase/app/docsh.cxx2
-rw-r--r--sw/source/uibase/app/docsh2.cxx5
-rw-r--r--sw/source/uibase/app/docshini.cxx17
-rw-r--r--sw/source/uibase/app/docst.cxx4
-rw-r--r--sw/source/uibase/app/docstyle.cxx2
-rw-r--r--sw/source/uibase/app/swdll.cxx2
-rw-r--r--sw/source/uibase/dialog/regionsw.cxx2
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControlAcc.cxx4
-rw-r--r--sw/source/uibase/misc/glosdoc.cxx2
-rw-r--r--sw/source/uibase/shells/txtcrsr.cxx2
-rw-r--r--sw/source/uibase/wrtsh/navmgr.cxx4
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx2
46 files changed, 133 insertions, 130 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 6084df6abb5a..050bf145d995 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -1334,8 +1334,8 @@ bool SwCalc::Str2Double( const OUString& rCommand, sal_Int32& rCommandPos,
}
}
- bool const bRet = lcl_Str2Double( rCommand, rCommandPos, rVal,
- (pLclD.get()) ? pLclD.get() : aSysLocale.GetLocaleDataPtr() );
+ bool const bRet = lcl_Str2Double(rCommand, rCommandPos, rVal,
+ pLclD ? pLclD.get() : aSysLocale.GetLocaleDataPtr());
return bRet;
}
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 6aca102e00e3..fa258e82ae53 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -1160,9 +1160,8 @@ int SwFindParaAttr::Find( SwPaM* pCursor, SwMoveFnCollection const & fnMove, con
std::unique_ptr<OUString> pRepl( bRegExp ?
ReplaceBackReferences( *pSearchOpt, pCursor ) : nullptr );
- m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange( *pCursor,
- (pRepl.get()) ? *pRepl : pSearchOpt->replaceString,
- bRegExp );
+ m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange(
+ *pCursor, pRepl ? *pRepl : pSearchOpt->replaceString, bRegExp);
m_rCursor.SaveTableBoxContent( pCursor->GetPoint() );
if( bRegExp )
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 60654d3aace7..73f6feee297a 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -679,11 +679,8 @@ int SwFindParaText::Find( SwPaM* pCursor, SwMoveFnCollection const & fnMove,
std::unique_ptr<OUString> pRepl( bRegExp
? ReplaceBackReferences( m_rSearchOpt, pCursor ) : nullptr );
- bool const bReplaced =
- m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange(
- *pCursor,
- (pRepl.get()) ? *pRepl : m_rSearchOpt.replaceString,
- bRegExp );
+ bool const bReplaced = m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange(
+ *pCursor, pRepl ? *pRepl : m_rSearchOpt.replaceString, bRegExp);
m_rCursor.SaveTableBoxContent( pCursor->GetPoint() );
if( bRegExp )
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 63d437e77f42..ad1f406933a9 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -561,7 +561,7 @@ bool SwDoc::SetFlyFrameAttr( SwFrameFormat& rFlyFormat, SfxItemSet& rSet )
bool const bRet = lcl_SetFlyFrameAttr(*this, &SwDoc::SetFlyFrameAnchor, rFlyFormat, rSet);
- if ( pSaveUndo.get() )
+ if (pSaveUndo)
{
if ( pSaveUndo->GetUndo() )
{
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index c75b2fd76f30..efd6218731a4 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -804,7 +804,7 @@ IGrammarContact* getGrammarContact( const SwTextNode& rTextNode )
SwDoc::GetXmlIdRegistry()
{
// UGLY: this relies on SetClipBoard being called before GetXmlIdRegistry!
- if (!m_pXmlIdRegistry.get())
+ if (!m_pXmlIdRegistry)
{
m_pXmlIdRegistry.reset( ::sfx2::createXmlIdRegistry( IsClipBoard() ) );
}
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index bd63396d6340..c43c8fa668ef 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -530,7 +530,7 @@ static void lcl_CpyBox( const SwTable& rCpyTable, const SwTableBox* pCpyBox,
::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNodeIndex aSavePos( aInsIdx, -1 );
- if( pRg.get() )
+ if (pRg)
pCpyDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly( *pRg, 0, aInsIdx, nullptr, false );
else
pDoc->GetNodes().MakeTextNode( aInsIdx, pDoc->GetDfltTextFormatColl() );
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 1fc5606eaff3..d94e62c75200 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -3871,7 +3871,7 @@ SwTableAutoFormatTable& SwDoc::GetTableStyles()
m_pTableStyles.reset(new SwTableAutoFormatTable);
m_pTableStyles->Load();
}
- return *m_pTableStyles.get();
+ return *m_pTableStyles;
}
OUString SwDoc::GetUniqueTableName() const
@@ -4602,7 +4602,7 @@ std::unique_ptr<SwTableAutoFormat> SwDoc::DelTableStyle(const OUString& rName, b
std::unique_ptr<SwTableAutoFormat> pReleasedFormat = GetTableStyles().ReleaseAutoFormat(rName);
std::vector<SwTable*> vAffectedTables;
- if (pReleasedFormat.get())
+ if (pReleasedFormat)
{
size_t nTableCount = GetTableFrameFormatCount(true);
for (size_t i=0; i < nTableCount; ++i)
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index e51fab869e2a..f4dfc7994637 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1491,7 +1491,7 @@ void SwFEShell::Paste( SvStream& rStrm, SwPasteSdr nAction, const Point* pPt )
// #i50824#
// method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
- lcl_ConvertSdrOle2ObjsToSdrGrafObjs( *pModel.get() );
+ lcl_ConvertSdrOle2ObjsToSdrGrafObjs(*pModel);
pView->Paste(*pModel, aPos, nullptr, SdrInsertFlags::NONE);
const size_t nCnt = pView->GetMarkedObjectList().GetMarkCount();
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 8a36ededbe31..46598f206082 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -807,7 +807,7 @@ void SwGrfNode::TriggerAsyncRetrieveInputStream()
return;
}
- if ( mpThreadConsumer.get() == nullptr )
+ if (mpThreadConsumer == nullptr)
{
mpThreadConsumer.reset(new SwAsyncRetrieveInputStreamThreadConsumer(*this), o3tl::default_delete<SwAsyncRetrieveInputStreamThreadConsumer>());
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index f407a0eec839..5dff4890393d 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -815,7 +815,7 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
CHECK_TABLE( *this )
// We have to assert a "rectangular" box selection before we start to merge
std::unique_ptr< SwBoxSelection > pSel( CollectBoxSelection( rPam ) );
- if( !pSel.get() || pSel->isEmpty() )
+ if (!pSel || pSel->isEmpty())
return false;
// Now we should have a rectangle of boxes,
// i.e. contiguous cells in contiguous rows
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 060ae4cf3995..6741375ee4ad 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -512,7 +512,7 @@ void SwTextField::DeleteTextField( const SwTextField& rTextField )
{
std::shared_ptr< SwPaM > pPamForTextField;
GetPamForTextField(rTextField, pPamForTextField);
- if (pPamForTextField.get() != nullptr)
+ if (pPamForTextField != nullptr)
{
rTextField.GetTextNode().GetDoc()->getIDocumentContentOperations().DeleteAndJoin(*pPamForTextField);
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index d5aa051ef7fb..30bfd26ac35f 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1301,7 +1301,7 @@ void SwTextNode::Update(
}
else if( bNoExp )
{
- if ( !pCollector.get() )
+ if (!pCollector)
{
pCollector.reset( new SwpHts );
}
@@ -1515,7 +1515,7 @@ void SwTextNode::Update(
// base class
SwIndexReg::Update( rPos, nChangeLen, bNegative, bDelete );
- if ( pCollector.get() )
+ if (pCollector)
{
const size_t nCount = pCollector->size();
for ( size_t i = 0; i < nCount; ++i )
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index d7e98e87eee6..024824f60733 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2173,7 +2173,7 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
OSL_ENSURE(!isUNKNOWNATR(nHintWhich),
"SwTextNode::GetAttr(): unknown attribute?");
- if ( !pAttrArr.get() )
+ if (!pAttrArr)
{
pAttrArr.reset(
new std::vector< SwPoolItemEndPair >(coArrSz));
@@ -2230,7 +2230,7 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
}
}
- if ( pAttrArr.get() )
+ if (pAttrArr)
{
for (size_t n = 0; n < coArrSz; ++n)
{
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index df199cd5a472..b8048539f459 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -220,7 +220,7 @@ SwHistorySetText::~SwHistorySetText()
void SwHistorySetText::SetInDoc( SwDoc* pDoc, bool )
{
- if ( !m_pAttr.get() )
+ if (!m_pAttr)
return;
if ( RES_TXTATR_CHARFMT == m_pAttr->Which() )
@@ -283,7 +283,7 @@ SwHistorySetTextField::~SwHistorySetTextField()
void SwHistorySetTextField::SetInDoc( SwDoc* pDoc, bool )
{
- if ( !m_pField.get() )
+ if (!m_pField)
return;
SwFieldType* pNewFieldType = m_pFieldType.get();
@@ -461,7 +461,7 @@ void SwHistorySetFootnote::SetInDoc( SwDoc* pDoc, bool )
if ( !pTextNd )
return;
- if ( m_pUndo.get() )
+ if (m_pUndo)
{
// set the footnote in the TextNode
SwFormatFootnote aTemp( m_bEndNote );
@@ -622,7 +622,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
"<SwHistoryBookmark::SetInDoc(..)>"
" - wrong node for a mark");
- if(pPam.get() != nullptr && pContentNd)
+ if (pPam != nullptr && pContentNd)
{
pPam->SetMark();
pPam->GetMark()->nNode = m_nOtherNode;
@@ -640,7 +640,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
*pPam->GetMark() = pMark->GetOtherMarkPos();
}
- if(pPam.get())
+ if (pPam)
{
if ( pMark != nullptr )
{
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 514e4aaa1d13..d3b88108a725 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -161,7 +161,7 @@ void SwUndoFormatAttr::UndoImpl(::sw::UndoRedoContext & rContext)
// OD 2004-10-26 #i35443#
// Important note: <Undo(..)> also called by <ReDo(..)>
- if ( !m_pOldSet.get() || !m_pFormat || !IsFormatInDoc( &rContext.GetDoc() ))
+ if (!m_pOldSet || !m_pFormat || !IsFormatInDoc(&rContext.GetDoc()))
return;
// #i35443# - If anchor attribute has been successful
@@ -290,7 +290,7 @@ void SwUndoFormatAttr::RedoImpl(::sw::UndoRedoContext & rContext)
void SwUndoFormatAttr::RepeatImpl(::sw::RepeatContext & rContext)
{
- if ( !m_pOldSet.get() )
+ if (!m_pOldSet)
return;
SwDoc & rDoc(rContext.GetDoc());
@@ -535,14 +535,16 @@ SwUndoFormatResetAttr::~SwUndoFormatResetAttr()
void SwUndoFormatResetAttr::UndoImpl(::sw::UndoRedoContext &)
{
- if ( m_pOldItem.get() ) {
+ if (m_pOldItem)
+ {
m_pChangedFormat->SetFormatAttr( *m_pOldItem );
}
}
void SwUndoFormatResetAttr::RedoImpl(::sw::UndoRedoContext &)
{
- if ( m_pOldItem.get() ) {
+ if (m_pOldItem)
+ {
m_pChangedFormat->ResetFormatAttr( m_nWhichId );
}
}
@@ -726,7 +728,8 @@ void SwUndoAttr::UndoImpl(::sw::UndoRedoContext & rContext)
// remove all format redlines, will be recreated if needed
SetPaM(aPam);
pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, nsRedlineType_t::REDLINE_FORMAT);
- if ( m_pRedlineSaveData.get() ) {
+ if (m_pRedlineSaveData)
+ {
SetSaveData( *pDoc, *m_pRedlineSaveData );
}
}
@@ -849,7 +852,8 @@ SwUndoDefaultAttr::~SwUndoDefaultAttr()
void SwUndoDefaultAttr::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
- if ( m_pOldSet.get() ) {
+ if (m_pOldSet)
+ {
SwUndoFormatAttrHelper aTmp(
*rDoc.GetDfltTextFormatColl() );
rDoc.SetDefault( *m_pOldSet );
@@ -859,7 +863,8 @@ void SwUndoDefaultAttr::UndoImpl(::sw::UndoRedoContext & rContext)
m_pOldSet = std::move(aTmp.GetUndo()->m_pOldSet);
}
}
- if ( m_pTabStop.get() ) {
+ if (m_pTabStop)
+ {
SvxTabStopItem* pOld = static_cast<SvxTabStopItem*>(
rDoc.GetDefault( RES_PARATR_TABSTOP ).Clone() );
rDoc.SetDefault( *m_pTabStop );
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index de7fa973ca9e..8f59781ae009 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -148,7 +148,7 @@ void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext)
Join( rDoc, nEndNode );
}
- if (m_pHistory.get())
+ if (m_pHistory)
{
m_pHistory->TmpRollback( &rDoc, 0, false );
}
@@ -160,7 +160,7 @@ void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext)
AddUndoRedoPaM(rContext);
- if( m_pRedlineSaveData.get())
+ if (m_pRedlineSaveData)
SetSaveData( rDoc, *m_pRedlineSaveData );
}
@@ -170,7 +170,7 @@ void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext)
SwPaM & rPam( AddUndoRedoPaM(rContext) );
const SwTOXBaseSection* pUpdateTOX = nullptr;
- if (m_pTOXBase.get())
+ if (m_pTOXBase)
{
pUpdateTOX = rDoc.InsertTableOf( *rPam.GetPoint(),
*m_pTOXBase, m_pAttrSet.get(), true);
@@ -180,7 +180,7 @@ void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext)
rDoc.InsertSwSection(rPam, *m_pSectionData, nullptr, m_pAttrSet.get());
}
- if (m_pHistory.get())
+ if (m_pHistory)
{
m_pHistory->SetTmpEnd( m_pHistory->Count() );
}
@@ -219,7 +219,7 @@ void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext)
void SwUndoInsSection::RepeatImpl(::sw::RepeatContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
- if (m_pTOXBase.get())
+ if (m_pTOXBase)
{
rDoc.InsertTableOf(*rContext.GetRepeatPaM().GetPoint(),
*m_pTOXBase, m_pAttrSet.get(), true);
@@ -244,7 +244,7 @@ void SwUndoInsSection::Join( SwDoc& rDoc, sal_uLong nNode )
}
pTextNd->JoinNext();
- if (m_pHistory.get())
+ if (m_pHistory)
{
SwIndex aCntIdx( pTextNd, 0 );
pTextNd->RstTextAttr( aCntIdx, pTextNd->Len(), 0, nullptr, true );
@@ -256,7 +256,7 @@ SwUndoInsSection::SaveSplitNode(SwTextNode *const pTextNd, bool const bAtStart)
{
if( pTextNd->GetpSwpHints() )
{
- if (!m_pHistory.get())
+ if (!m_pHistory)
{
m_pHistory.reset( new SwHistory );
}
@@ -318,7 +318,7 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
- if (m_pTOXBase.get())
+ if (m_pTOXBase)
{
rDoc.InsertTableOf(m_nStartNode, m_nEndNode-2, *m_pTOXBase,
m_pAttrSet.get());
@@ -328,7 +328,7 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext)
SwNodeIndex aStt( rDoc.GetNodes(), m_nStartNode );
SwNodeIndex aEnd( rDoc.GetNodes(), m_nEndNode-2 );
SwSectionFormat* pFormat = rDoc.MakeSectionFormat();
- if (m_pAttrSet.get())
+ if (m_pAttrSet)
{
pFormat->SetFormatAttr( *m_pAttrSet );
}
@@ -424,7 +424,7 @@ void SwUndoUpdateSection::UndoImpl(::sw::UndoRedoContext & rContext)
SwFormat* pFormat = rNdSect.GetFormat();
SfxItemSet* pCur = ::lcl_GetAttrSet( rNdSect );
- if (m_pAttrSet.get())
+ if (m_pAttrSet)
{
// The Content and Protect items must persist
const SfxPoolItem* pItem;
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index c772f6c40da9..aa4ff1cfdcf4 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1651,7 +1651,7 @@ void SwUndoTableNdsChg::SaveNewBoxes( const SwTableNode& rTableNd,
void SwUndoTableNdsChg::SaveSection( SwStartNode* pSttNd )
{
OSL_ENSURE( IsDelBox(), "wrong Action" );
- if (m_pDelSects.get() == nullptr)
+ if (m_pDelSects == nullptr)
m_pDelSects.reset(new SwUndoSaveSections);
SwTableNode* pTableNd = pSttNd->FindTableNode();
@@ -3161,7 +3161,7 @@ void SwUndoTableStyleMake::UndoImpl(::sw::UndoRedoContext & rContext)
void SwUndoTableStyleMake::RedoImpl(::sw::UndoRedoContext & rContext)
{
- if (m_pAutoFormat.get())
+ if (m_pAutoFormat)
{
SwTableAutoFormat* pFormat = rContext.GetDoc().MakeTableStyle(m_sName, true);
if (pFormat)
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 81a3b1453eee..bfde7f014f88 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2040,7 +2040,7 @@ SwXTextField::getAnchor()
std::shared_ptr< SwPaM > pPamForTextField;
SwTextField::GetPamForTextField(*pTextField, pPamForTextField);
- if (pPamForTextField.get() == nullptr)
+ if (pPamForTextField == nullptr)
return nullptr;
// If this is a postit field, then return the range of its annotation mark if it has one.
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 83bd9f22c850..6594a6d00d96 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -306,7 +306,7 @@ SwUnoCursorHelper::SetPageDesc(
pNewDesc.reset(new SwFormatPageDesc(
*static_cast<const SwFormatPageDesc*>(pItem)));
}
- if (!pNewDesc.get())
+ if (!pNewDesc)
{
pNewDesc.reset(new SwFormatPageDesc());
}
@@ -324,7 +324,7 @@ SwUnoCursorHelper::SetPageDesc(
{
throw lang::IllegalArgumentException();
}
- pNewDesc.get()->RegisterToPageDesc( *pPageDesc );
+ pNewDesc->RegisterToPageDesc(*pPageDesc);
bPut = true;
}
if(!bPut)
@@ -425,7 +425,7 @@ lcl_setDropcapCharStyle(SwPaM const & rPam, SfxItemSet & rItemSet,
{
pDrop.reset(new SwFormatDrop(*static_cast<const SwFormatDrop*>(pItem)));
}
- if (!pDrop.get())
+ if (!pDrop)
{
pDrop.reset(new SwFormatDrop);
}
@@ -450,7 +450,7 @@ lcl_setRubyCharstyle(SfxItemSet & rItemSet, uno::Any const& rValue)
{
pRuby.reset(new SwFormatRuby(*static_cast<const SwFormatRuby*>(pItem)));
}
- if (!pRuby.get())
+ if (!pRuby)
{
pRuby.reset(new SwFormatRuby(OUString()));
}
@@ -1906,7 +1906,7 @@ SwUnoCursorHelper::GetPropertyStates(
}
else
{
- if (!pSet.get())
+ if (!pSet)
{
switch ( eCaller )
{
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 12608d77cb15..ac7d5d88f423 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -714,7 +714,7 @@ SwXMeta::CreateXMeta(::sw::Meta & rMeta,
uno::Reference<rdf::XMetadatable> xMeta(rMeta.GetXMeta());
if (xMeta.is())
{
- if (pPortions.get()) // set cache in the XMeta to the given portions
+ if (pPortions) // set cache in the XMeta to the given portions
{
const uno::Reference<lang::XUnoTunnel> xUT(xMeta, uno::UNO_QUERY);
SwXMeta *const pXMeta(
@@ -1218,7 +1218,7 @@ SwXMeta::createEnumeration()
SwPaM aPam(*pTextNode, nMetaStart);
- if (!m_pImpl->m_pTextPortions.get())
+ if (!m_pImpl->m_pTextPortions)
{
return new SwXTextPortionEnumeration(
aPam, GetParentText(), nMetaStart, nMetaEnd);
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index e7a2ca50481e..bbbac6aedbba 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -365,35 +365,35 @@ SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange)
RES_COL, RES_COL,
RES_FTN_AT_TXTEND, RES_FRAMEDIR,
RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER>{});
- if (m_pImpl->m_pProps->m_pBrushItem.get())
+ if (m_pImpl->m_pProps->m_pBrushItem)
{
aSet.Put(*m_pImpl->m_pProps->m_pBrushItem);
}
- if (m_pImpl->m_pProps->m_pColItem.get())
+ if (m_pImpl->m_pProps->m_pColItem)
{
aSet.Put(*m_pImpl->m_pProps->m_pColItem);
}
- if (m_pImpl->m_pProps->m_pFootnoteItem.get())
+ if (m_pImpl->m_pProps->m_pFootnoteItem)
{
aSet.Put(*m_pImpl->m_pProps->m_pFootnoteItem);
}
- if (m_pImpl->m_pProps->m_pEndItem.get())
+ if (m_pImpl->m_pProps->m_pEndItem)
{
aSet.Put(*m_pImpl->m_pProps->m_pEndItem);
}
- if (m_pImpl->m_pProps->m_pXMLAttr.get())
+ if (m_pImpl->m_pProps->m_pXMLAttr)
{
aSet.Put(*m_pImpl->m_pProps->m_pXMLAttr);
}
- if (m_pImpl->m_pProps->m_pNoBalanceItem.get())
+ if (m_pImpl->m_pProps->m_pNoBalanceItem)
{
aSet.Put(*m_pImpl->m_pProps->m_pNoBalanceItem);
}
- if (m_pImpl->m_pProps->m_pFrameDirItem.get())
+ if (m_pImpl->m_pProps->m_pFrameDirItem)
{
aSet.Put(*m_pImpl->m_pProps->m_pFrameDirItem);
}
- if (m_pImpl->m_pProps->m_pLRSpaceItem.get())
+ if (m_pImpl->m_pProps->m_pLRSpaceItem)
{
aSet.Put(*m_pImpl->m_pProps->m_pLRSpaceItem);
}
@@ -828,7 +828,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
SfxPoolItem* pPutItem = nullptr;
if (RES_COL == pEntry->nWID)
{
- if (!m_pProps->m_pColItem.get())
+ if (!m_pProps->m_pColItem)
{
m_pProps->m_pColItem.reset(new SwFormatCol);
}
@@ -836,7 +836,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
}
else if (RES_BACKGROUND == pEntry->nWID)
{
- if (!m_pProps->m_pBrushItem.get())
+ if (!m_pProps->m_pBrushItem)
{
m_pProps->m_pBrushItem.reset(
new SvxBrushItem(RES_BACKGROUND));
@@ -845,7 +845,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
}
else if (RES_FTN_AT_TXTEND == pEntry->nWID)
{
- if (!m_pProps->m_pFootnoteItem.get())
+ if (!m_pProps->m_pFootnoteItem)
{
m_pProps->m_pFootnoteItem.reset(new SwFormatFootnoteAtTextEnd);
}
@@ -853,7 +853,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
}
else if (RES_END_AT_TXTEND == pEntry->nWID)
{
- if (!m_pProps->m_pEndItem.get())
+ if (!m_pProps->m_pEndItem)
{
m_pProps->m_pEndItem.reset(new SwFormatEndAtTextEnd);
}
@@ -861,7 +861,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
}
else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID)
{
- if (!m_pProps->m_pXMLAttr.get())
+ if (!m_pProps->m_pXMLAttr)
{
m_pProps->m_pXMLAttr.reset(
new SvXMLAttrContainerItem(
@@ -871,7 +871,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
}
else if (RES_COLUMNBALANCE== pEntry->nWID)
{
- if (!m_pProps->m_pNoBalanceItem.get())
+ if (!m_pProps->m_pNoBalanceItem)
{
m_pProps->m_pNoBalanceItem.reset(
new SwFormatNoBalancedColumns(true));
@@ -880,7 +880,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
}
else if (RES_FRAMEDIR == pEntry->nWID)
{
- if (!m_pProps->m_pFrameDirItem.get())
+ if (!m_pProps->m_pFrameDirItem)
{
m_pProps->m_pFrameDirItem.reset(
new SvxFrameDirectionItem(
@@ -890,7 +890,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
}
else if (RES_LR_SPACE == pEntry->nWID)
{
- if (!m_pProps->m_pLRSpaceItem.get())
+ if (!m_pProps->m_pLRSpaceItem)
{
m_pProps->m_pLRSpaceItem.reset(
new SvxLRSpaceItem( RES_LR_SPACE ));
@@ -1169,7 +1169,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
const SfxPoolItem* pQueryItem = nullptr;
if (RES_COL == pEntry->nWID)
{
- if (!m_pProps->m_pColItem.get())
+ if (!m_pProps->m_pColItem)
{
m_pProps->m_pColItem.reset(new SwFormatCol);
}
@@ -1177,7 +1177,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
}
else if (RES_BACKGROUND == pEntry->nWID)
{
- if (!m_pProps->m_pBrushItem.get())
+ if (!m_pProps->m_pBrushItem)
{
m_pProps->m_pBrushItem.reset(
new SvxBrushItem(RES_BACKGROUND));
@@ -1186,7 +1186,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
}
else if (RES_FTN_AT_TXTEND == pEntry->nWID)
{
- if (!m_pProps->m_pFootnoteItem.get())
+ if (!m_pProps->m_pFootnoteItem)
{
m_pProps->m_pFootnoteItem.reset(new SwFormatFootnoteAtTextEnd);
}
@@ -1194,7 +1194,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
}
else if (RES_END_AT_TXTEND == pEntry->nWID)
{
- if (!m_pProps->m_pEndItem.get())
+ if (!m_pProps->m_pEndItem)
{
m_pProps->m_pEndItem.reset(new SwFormatEndAtTextEnd);
}
@@ -1202,7 +1202,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
}
else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID)
{
- if (!m_pProps->m_pXMLAttr.get())
+ if (!m_pProps->m_pXMLAttr)
{
m_pProps->m_pXMLAttr.reset(
new SvXMLAttrContainerItem);
@@ -1211,7 +1211,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
}
else if (RES_COLUMNBALANCE== pEntry->nWID)
{
- if (!m_pProps->m_pNoBalanceItem.get())
+ if (!m_pProps->m_pNoBalanceItem)
{
m_pProps->m_pNoBalanceItem.reset(
new SwFormatNoBalancedColumns);
@@ -1220,7 +1220,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
}
else if (RES_FRAMEDIR == pEntry->nWID)
{
- if (!m_pProps->m_pFrameDirItem.get())
+ if (!m_pProps->m_pFrameDirItem)
{
m_pProps->m_pFrameDirItem.reset(
new SvxFrameDirectionItem(
@@ -1230,7 +1230,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
}
else if (RES_LR_SPACE == pEntry->nWID)
{
- if (!m_pProps->m_pLRSpaceItem.get())
+ if (!m_pProps->m_pLRSpaceItem)
{
m_pProps->m_pLRSpaceItem.reset(
new SvxLRSpaceItem( RES_LR_SPACE ));
@@ -1402,7 +1402,7 @@ SwXTextSection::getPropertyStates(
{
if (RES_COL == pEntry->nWID)
{
- if (!m_pImpl->m_pProps->m_pColItem.get())
+ if (!m_pImpl->m_pProps->m_pColItem)
{
pStates[i] = beans::PropertyState_DEFAULT_VALUE;
}
@@ -1413,7 +1413,7 @@ SwXTextSection::getPropertyStates(
}
else
{
- if (!m_pImpl->m_pProps->m_pBrushItem.get())
+ if (!m_pImpl->m_pProps->m_pBrushItem)
{
pStates[i] = beans::PropertyState_DEFAULT_VALUE;
}
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 3397127ac23c..f3ae2154993e 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -281,7 +281,8 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window *pWindow,
SwViewShell::~SwViewShell()
{
- IDocumentLayoutAccess * const pLayoutAccess = mxDoc.get() ? &mxDoc->getIDocumentLayoutAccess() : nullptr;
+ IDocumentLayoutAccess* const pLayoutAccess
+ = mxDoc ? &mxDoc->getIDocumentLayoutAccess() : nullptr;
{
SET_CURR_SHELL( this );
@@ -320,7 +321,7 @@ SwViewShell::~SwViewShell()
mpImp.reset();
- if ( mxDoc.get() )
+ if (mxDoc)
{
if( mxDoc->getReferenceCount() > 1 )
GetLayout()->ResetNewLayout();
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 3cc9826e2785..836e7db42cfa 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -560,14 +560,14 @@ static void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat,
// If necessary, take the hard attribute from the style
if( pFormatInfo->pItemSet )
{
- OSL_ENSURE( !rInfo.pItemSet.get(), "Where does this ItemSet come from?" );
+ OSL_ENSURE(!rInfo.pItemSet, "Where does this ItemSet come from?");
rInfo.pItemSet.reset(new SfxItemSet( *pFormatInfo->pItemSet ));
}
// additionally, add the hard attribute from the paragraph
if( pNodeItemSet )
{
- if( rInfo.pItemSet.get() )
+ if (rInfo.pItemSet)
rInfo.pItemSet->Put( *pNodeItemSet );
else
rInfo.pItemSet.reset(new SfxItemSet( *pNodeItemSet ));
@@ -591,7 +591,7 @@ static void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat,
else
aULSpaceItem.SetUpper( rHWrt.m_nHeaderFooterSpace );
- if (!rInfo.pItemSet.get())
+ if (!rInfo.pItemSet)
{
rInfo.pItemSet.reset(new SfxItemSet(*rFormat.GetAttrSet().GetPool(), svl::Items<RES_UL_SPACE, RES_UL_SPACE>{}));
}
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index a056d8dca4d2..313e161c4573 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2279,7 +2279,7 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail,
OSL_ENSURE( m_nRows>0 && m_nCols>0 && m_nCurrentRow==m_nRows,
"Was CloseTable not called?" );
- OSL_ENSURE(m_xLayoutInfo.get() == nullptr, "Table already has layout info");
+ OSL_ENSURE(m_xLayoutInfo == nullptr, "Table already has layout info");
// Calculate borders of the table and all contained tables
SetBorders();
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index e86a01d70f3b..e0a92c344d8b 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -317,7 +317,7 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm )
INetProtocol::VndSunStarWebdav >= aTargetUrl.GetProtocol() ) )
return bRet;
- if (m_pImpl->pFileNameMap.get())
+ if (m_pImpl->pFileNameMap)
{
// has the file been moved?
std::map<OUString, OUString>::iterator it = m_pImpl->pFileNameMap->find( rFileNm );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index ca6c7dc4db8f..6451b5c92377 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -4117,7 +4117,7 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode )
const NfKeywordTable & MSWordExportBase::GetNfKeywordTable()
{
- if (m_pKeyMap.get() == nullptr)
+ if (m_pKeyMap == nullptr)
{
m_pKeyMap.reset(new NfKeywordTable);
NfKeywordTable & rKeywordTable = *m_pKeyMap;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 3435ae2e7292..d06d1de741ed 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -302,17 +302,17 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell const * pDocS
xTextMark.reset(new OUString(read_uInt32_lenPrefixed_uInt16s_ToOUString(rStrm)));
}
- if( !xLongName.get() && xShortName.get() )
+ if (!xLongName && xShortName.get())
{
xLongName.reset( new OUString );
*xLongName += *xShortName;
}
- else if( !xLongName.get() && xTextMark.get() )
+ else if (!xLongName && xTextMark.get())
xLongName.reset( new OUString );
- if( xLongName.get() )
+ if (xLongName)
{
- if( xTextMark.get() )
+ if (xTextMark)
{
if (xLongName->isEmpty())
*xTextMark = xTextMark->replace('!', '.');
@@ -488,7 +488,7 @@ SdrObject* SwMSDffManager::ImportOLE( sal_uInt32 nOLEId,
if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg ))
{
tools::SvRef<SotStorage> xSrc = xSrcStg->OpenSotStorage( sStorageName );
- OSL_ENSURE(rReader.m_xFormImpl.get(), "No Form Implementation!");
+ OSL_ENSURE(rReader.m_xFormImpl, "No Form Implementation!");
css::uno::Reference< css::drawing::XShape > xShape;
if ( (!(rReader.m_bIsHeader || rReader.m_bIsFooter)) &&
rReader.m_xFormImpl->ReadOCXStream(xSrc,&xShape,true))
@@ -6252,7 +6252,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportWW2(SvStream &rStream)
ErrCode WW8Reader::OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_uInt16& rBuffSize )
{
ErrCode nRet = ERR_SWG_READ_ERROR;
- OSL_ENSURE( m_pStorage.get(), "Where is my Storage?" );
+ OSL_ENSURE(m_pStorage, "Where is my Storage?");
rRef = m_pStorage->OpenSotStream( "WordDocument", StreamMode::READ | StreamMode::SHARE_DENYALL);
if( rRef.is() )
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 29343e0d092f..87e3ee83c78c 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -480,7 +480,7 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd,
{
if (!m_xTableDesc)
{
- OSL_ENSURE(m_xTableDesc.get(), "What!");
+ OSL_ENSURE(m_xTableDesc, "What!");
bTestAllowed = false;
}
else
@@ -3481,7 +3481,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp)
delete pTableWFlyPara;
delete pTableSFlyPara;
- return m_xTableDesc.get() != nullptr;
+ return m_xTableDesc != nullptr;
}
void SwWW8ImplReader::TabCellEnd()
@@ -3522,7 +3522,7 @@ void SwWW8ImplReader::PopTableDesc()
void SwWW8ImplReader::StopTable()
{
- OSL_ENSURE(m_xTableDesc.get(), "Panic, stop table with no table!");
+ OSL_ENSURE(m_xTableDesc, "Panic, stop table with no table!");
if (!m_xTableDesc)
return;
@@ -3997,7 +3997,7 @@ void WW8RStyle::ScanStyles() // investigate style dependencies
rSI.m_nFilePos = mpStStrm->Tell(); // remember FilePos
sal_uInt16 nSkip;
std::unique_ptr<WW8_STD> xStd(Read1Style(nSkip, nullptr)); // read STD
- rSI.m_bValid = xStd.get() != nullptr;
+ rSI.m_bValid = xStd != nullptr;
if (rSI.m_bValid)
{
rSI.m_nBase = xStd->istdBase; // remember Basis
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 4732c0c16081..8749367ac965 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -393,7 +393,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
{
//Can't put them in headers/footers :-(
uno::Reference< drawing::XShape > xRef;
- OSL_ENSURE(m_xFormImpl.get(), "Impossible");
+ OSL_ENSURE(m_xFormImpl, "Impossible");
if (m_xFormImpl && m_xFormImpl->ReadOCXStream(xSrc1, &xRef))
{
pRet = GetSdrObjectFromXShape(xRef);
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 0547fb105046..145daf9a60e7 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2531,7 +2531,7 @@ void SwWW8ImplReader::StopApo()
{
if (!m_xSFlyPara->xMainTextPos)
{
- OSL_ENSURE(m_xSFlyPara->xMainTextPos.get(), "StopApo: xMainTextPos is nullptr");
+ OSL_ENSURE(m_xSFlyPara->xMainTextPos, "StopApo: xMainTextPos is nullptr");
return;
}
@@ -2573,7 +2573,7 @@ void SwWW8ImplReader::StopApo()
if (rBrush.GetColor() != COL_AUTO)
aBg = rBrush.GetColor();
- if (m_pLastAnchorPos.get())
+ if (m_pLastAnchorPos)
{
//If the last anchor pos is here, then clear the anchor pos.
//This "last anchor pos" is only used for fixing up the
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx
index b13d36bbe7b1..2487cbb0f9f9 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -643,7 +643,7 @@ bool Tcg::Read(SvStream &rS)
bool Tcg::ImportCustomToolBar( SfxObjectShell& rDocSh )
{
- if ( tcg.get() )
+ if (tcg)
return tcg->ImportCustomToolBar( rDocSh );
return false;
}
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 99bba3d0d05b..24073bd25a03 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -312,7 +312,7 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
XMLTextParagraphExport* SwXMLExport::CreateTextParagraphExport()
{
- return new SwXMLTextParagraphExport( *this, *GetAutoStylePool().get() );
+ return new SwXMLTextParagraphExport(*this, *GetAutoStylePool());
}
XMLShapeExport* SwXMLExport::CreateShapeExport()
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index f49b4c259c1a..2c13bf47dc32 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -243,7 +243,7 @@ void SwParagraphNumTabPage::Reset(const SfxItemSet* rSet)
NewStartHdl_Impl(*m_xNewStartCB);
m_xNewStartNF->save_value();
m_xNewStartNumberCB->save_state();
- StyleHdl_Impl(*m_xNumberStyleLB.get());
+ StyleHdl_Impl(*m_xNumberStyleLB);
if( SfxItemState::DEFAULT <= rSet->GetItemState(RES_LINENUMBER))
{
const SwFormatLineNumber& rNum = rSet->Get(RES_LINENUMBER);
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index db55f59555ae..008aa7869990 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1469,8 +1469,7 @@ void SwInsertSectionTabDialog::SetSectionData(SwSectionData const& rSect)
short SwInsertSectionTabDialog::Ok()
{
short nRet = SfxTabDialog::Ok();
- OSL_ENSURE(m_pSectionData.get(),
- "SwInsertSectionTabDialog: no SectionData?");
+ OSL_ENSURE(m_pSectionData, "SwInsertSectionTabDialog: no SectionData?");
const SfxItemSet* pOutputItemSet = GetOutputItemSet();
rWrtSh.InsertSection(*m_pSectionData, pOutputItemSet);
SfxViewFrame* pViewFrame = rWrtSh.GetView().GetViewFrame();
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index d1410e668abd..1ccc19651629 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1353,7 +1353,7 @@ OUString SwDocShell::GetEventName( sal_Int32 nIndex )
const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const
{
- return m_xDoc.get() ? &m_xDoc->GetXmlIdRegistry() : nullptr;
+ return m_xDoc ? &m_xDoc->GetXmlIdRegistry() : nullptr;
}
bool SwDocShell::IsChangeRecording() const
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index a2df020257fd..283406ea6ed0 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -202,7 +202,8 @@ void SwDocShell::ToggleLayoutMode(SwView* pView)
// update text fields on document properties changes
void SwDocShell::DoFlushDocInfo()
{
- if (!m_xDoc.get()) return;
+ if (!m_xDoc)
+ return;
bool bUnlockView(true);
if (m_pWrtShell)
@@ -246,7 +247,7 @@ static void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVB
// Notification on DocInfo changes
void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if (!m_xDoc.get())
+ if (!m_xDoc)
{
return ;
}
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index be850b70611c..76a2acdba069 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -377,7 +377,7 @@ SwDocShell::SwDocShell( SwDoc *const pD, SfxObjectCreateMode const eMode )
SwDocShell::~SwDocShell()
{
// disable chart related objects now because in ~SwDoc it may be to late for this
- if (m_xDoc.get())
+ if (m_xDoc)
{
m_xDoc->getIDocumentChartDataProviderAccess().GetChartControllerHelper().Disconnect();
SwChartDataProvider *pPCD = m_xDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider();
@@ -411,7 +411,7 @@ void SwDocShell::Init_Impl()
void SwDocShell::AddLink()
{
- if (!m_xDoc.get())
+ if (!m_xDoc)
{
SwDocFac aFactory;
m_xDoc = aFactory.GetDoc();
@@ -433,8 +433,8 @@ void SwDocShell::UpdateFontList()
if (!m_IsInUpdateFontList)
{
m_IsInUpdateFontList = true;
- OSL_ENSURE(m_xDoc.get(), "No Doc no FontList");
- if (m_xDoc.get())
+ OSL_ENSURE(m_xDoc, "No Doc no FontList");
+ if (m_xDoc)
{
m_pFontList.reset( new FontList( m_xDoc->getIDocumentDeviceAccess().getReferenceDevice(true) ) );
PutItem( SvxFontListItem( m_pFontList.get(), SID_ATTR_CHAR_FONTLIST ) );
@@ -448,7 +448,7 @@ void SwDocShell::RemoveLink()
// disconnect Uno-Object
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
static_cast<SwXTextDocument*>(xDoc.get())->Invalidate();
- if (m_xDoc.get())
+ if (m_xDoc)
{
if (m_xBasePool.is())
{
@@ -484,7 +484,7 @@ bool SwDocShell::Load( SfxMedium& rMedium )
rEmbeddedObjectContainer.setUserAllowsLinkUpdate(false);
SAL_INFO( "sw.ui", "after SfxInPlaceObject::Load" );
- if (m_xDoc.get()) // for last version!!
+ if (m_xDoc) // for last version!!
RemoveLink(); // release the existing
AddLink(); // set Link and update Data!!
@@ -570,7 +570,8 @@ bool SwDocShell::Load( SfxMedium& rMedium )
}
UpdateFontList();
- InitDrawModelAndDocShell(this, m_xDoc.get() ? m_xDoc->getIDocumentDrawModelAccess().GetDrawModel() : nullptr);
+ InitDrawModelAndDocShell(this, m_xDoc ? m_xDoc->getIDocumentDrawModelAccess().GetDrawModel()
+ : nullptr);
SetError(nErr);
bRet = !nErr.IsError();
@@ -591,7 +592,7 @@ bool SwDocShell::Load( SfxMedium& rMedium )
bool SwDocShell::LoadFrom( SfxMedium& rMedium )
{
bool bRet = false;
- if (m_xDoc.get())
+ if (m_xDoc)
RemoveLink();
AddLink(); // set Link and update Data!!
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index ba4b554f935d..47f65f43f774 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -630,7 +630,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
pView->InvalidateRulerPos();
if( m_bNew )
- m_xBasePool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *m_xTmp.get() ) );
+ m_xBasePool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *m_xTmp));
pDoc->getIDocumentState().SetModified();
if( !m_bModified )
@@ -884,7 +884,7 @@ void SwDocShell::Edit(
m_pView->InvalidateRulerPos();
if( bNew )
- m_xBasePool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *xTmp.get() ) );
+ m_xBasePool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *xTmp));
m_xDoc->getIDocumentState().SetModified();
if( !bModified ) // Bug 57028
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index fc4fec6896a8..7bd4c97ac1cf 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -2415,7 +2415,7 @@ SfxStyleSheetBase& SwDocStyleSheetPool::Make( const OUString& rName,
mxStyleSheet->SetPhysical(true);
mxStyleSheet->Create();
- return *mxStyleSheet.get();
+ return *mxStyleSheet;
}
SfxStyleSheetBase* SwDocStyleSheetPool::Create( const SfxStyleSheetBase& /*rOrg*/)
diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx
index 33adb20335ab..59e95d141295 100644
--- a/sw/source/uibase/app/swdll.cxx
+++ b/sw/source/uibase/app/swdll.cxx
@@ -168,7 +168,7 @@ SwDLL::~SwDLL() COVERITY_NOEXCEPT_FALSE
sw::Filters & SwDLL::getFilters()
{
assert(filters_);
- return *filters_.get();
+ return *filters_;
}
#ifndef DISABLE_DYNLOADING
diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx
index e0f25330ddd4..516f50074e07 100644
--- a/sw/source/uibase/dialog/regionsw.cxx
+++ b/sw/source/uibase/dialog/regionsw.cxx
@@ -173,7 +173,7 @@ IMPL_LINK( SwWrtShell, InsertRegionDialog, void*, p, void )
{
SwSectionData* pSect = static_cast<SwSectionData*>(p);
std::unique_ptr<SwSectionData> xSectionData(pSect);
- if (!xSectionData.get())
+ if (!xSectionData)
return;
SfxItemSet aSet(
diff --git a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
index f6fc2e693271..40bee0951c16 100644
--- a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
@@ -117,9 +117,9 @@ IMPL_LINK(SidebarTextEditSource, NotifyHdl, EENotify&, rNotify, void)
{
std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( &rNotify ) );
- if( aHint.get() )
+ if (aHint)
{
- Broadcast( *aHint.get() );
+ Broadcast(*aHint);
}
}
diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx
index 5adc7629a37c..30365661e9be 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -611,7 +611,7 @@ Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry(
bool bCreate = ( rCompleteGroupName == GetDefName() );
std::unique_ptr< SwTextBlocks > pGlosGroup( GetGroupDoc( rCompleteGroupName, bCreate ) );
- if ( !pGlosGroup.get() || pGlosGroup->GetError() )
+ if (!pGlosGroup || pGlosGroup->GetError())
throw lang::WrappedTargetException();
sal_uInt16 nIdx = pGlosGroup->GetIndex( rEntryName );
diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx
index 3ecf385bd9f3..93df8a6694a2 100644
--- a/sw/source/uibase/shells/txtcrsr.cxx
+++ b/sw/source/uibase/shells/txtcrsr.cxx
@@ -330,7 +330,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
std::unique_ptr< svx::ISdrObjectFilter > pFilter( FmFormShell::CreateFocusableControlFilter(
*pDrawView, *pWindow ) );
- if ( !pFilter.get() )
+ if (!pFilter)
break;
const SdrObject* pNearestControl = rSh.GetBestObject( true, GotoObjFlags::DrawControl, false, pFilter.get() );
diff --git a/sw/source/uibase/wrtsh/navmgr.cxx b/sw/source/uibase/wrtsh/navmgr.cxx
index 39c718e6f726..e2adc872ebbe 100644
--- a/sw/source/uibase/wrtsh/navmgr.cxx
+++ b/sw/source/uibase/wrtsh/navmgr.cxx
@@ -51,7 +51,7 @@ SwNavigationMgr::~SwNavigationMgr()
SolarMutexGuard g;
for (auto & it : m_entries)
{
- EndListening(it.get()->m_aNotifier);
+ EndListening(it->m_aNotifier);
}
m_entries.clear();
}
@@ -64,7 +64,7 @@ void SwNavigationMgr::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
for (auto it = m_entries.begin(); it != m_entries.end(); ++it)
{
- if (!it->get() || & rBC == & it->get()->m_aNotifier)
+ if (!*it || &rBC == &it->get()->m_aNotifier)
{
EndListening(rBC);
m_entries.erase(it);
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index f97a0daf62ad..8d5bc9902f84 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1729,7 +1729,7 @@ OUString SwWrtShell::GetSelDescr() const
}
break;
default:
- if (mxDoc.get())
+ if (mxDoc)
aResult = GetCursorDescr();
}