summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx12
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx11
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx22
-rw-r--r--sw/source/uibase/shells/basesh.cxx7
-rw-r--r--sw/source/uibase/shells/grfsh.cxx9
-rw-r--r--sw/source/uibase/utlui/tmplctrl.cxx4
6 files changed, 36 insertions, 29 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 09e6dfd3f893..53d782b2e5e7 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1035,10 +1035,11 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
for( int nLoop = 0; nLoop < 2; ++nLoop )
{
- const sal_uInt8* pParams;
- while( aSprmIter.GetSprms()
- && (nullptr != (pParams = aSprmIter.GetAktParams())) )
+ while (aSprmIter.GetSprms())
{
+ const sal_uInt8 *const pParams(aSprmIter.GetAktParams());
+ if (nullptr == pParams)
+ break;
sal_uInt16 nAktId = aSprmIter.GetAktId();
switch( nAktId )
{
@@ -2033,8 +2034,9 @@ SwWW8ImplReader::SetAttributesAtGrfNode(SvxMSDffImportRec const*const pRecord,
SwFrameFormat *pFlyFormat, WW8_FSPA *pF )
{
const SwNodeIndex* pIdx = pFlyFormat->GetContent(false).GetContentIdx();
- SwGrfNode* pGrfNd;
- if( pIdx && nullptr != (pGrfNd = m_rDoc.GetNodes()[pIdx->GetIndex() + 1]->GetGrfNode() ))
+ SwGrfNode *const pGrfNd(
+ pIdx ? m_rDoc.GetNodes()[pIdx->GetIndex() + 1]->GetGrfNode() : nullptr);
+ if (pGrfNd)
{
Size aSz(pGrfNd->GetTwipSize());
// use type <sal_uInt64> instead of sal_uLong to get correct results
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index df1b7d04a0b2..286f0d4f83cf 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -242,11 +242,14 @@ IMPL_LINK( SwCondCollPage, AssignRemoveHdl, ListBox&, rBox, void)
void SwCondCollPage::AssignRemove(void* pBtn)
{
SvTreeListEntry* pE = m_pTbLinks->FirstSelected();
- sal_uLong nPos;
- if( !pE || LISTBOX_ENTRY_NOTFOUND ==
- ( nPos = m_pTbLinks->GetModel()->GetAbsPos( pE ) ) )
+ if (!pE)
+ {
+ OSL_ENSURE(false, "where's the empty entry from?");
+ return;
+ }
+ sal_uLong const nPos(m_pTbLinks->GetModel()->GetAbsPos(pE));
+ if (LISTBOX_ENTRY_NOTFOUND == nPos)
{
- OSL_ENSURE( pE, "where's the empty entry from?" );
return;
}
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 8899e5bbfd61..26e501496fcb 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4047,9 +4047,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
// event processing for resizing
if (pSdrView && pSdrView->AreObjectsMarked())
{
- const SwFrameFormat* pFlyFormat;
- const SvxMacro* pMacro;
-
const Point aSttPt( PixelToLogic( m_aStartPos ) );
// can we start?
@@ -4059,13 +4056,16 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
g_eSdrMoveHdl = pHdl ? pHdl->GetKind() : SdrHdlKind::Move;
}
+ const SwFrameFormat *const pFlyFormat(rSh.GetFlyFrameFormat());
+ const SvxMacro* pMacro = nullptr;
+
sal_uInt16 nEvent = SdrHdlKind::Move == g_eSdrMoveHdl
? SW_EVENT_FRM_MOVE
: SW_EVENT_FRM_RESIZE;
- if( nullptr != ( pFlyFormat = rSh.GetFlyFrameFormat() ) &&
- nullptr != ( pMacro = pFlyFormat->GetMacro().GetMacroTable().
- Get( nEvent )) &&
+ if (nullptr != pFlyFormat)
+ pMacro = pFlyFormat->GetMacro().GetMacroTable().Get(nEvent);
+ if (nullptr != pMacro &&
// or notify only e.g. every 20 Twip?
m_aRszMvHdlPt != aDocPt )
{
@@ -4520,16 +4520,16 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
else
{
{
- const SwFrameFormat* pFlyFormat;
- const SvxMacro* pMacro;
+ const SwFrameFormat *const pFlyFormat(rSh.GetFlyFrameFormat());
+ const SvxMacro* pMacro = nullptr;
sal_uInt16 nEvent = SdrHdlKind::Move == eOldSdrMoveHdl
? SW_EVENT_FRM_MOVE
: SW_EVENT_FRM_RESIZE;
- if( nullptr != ( pFlyFormat = rSh.GetFlyFrameFormat() ) &&
- nullptr != ( pMacro = pFlyFormat->GetMacro().GetMacroTable().
- Get( nEvent )) )
+ if (nullptr != pFlyFormat)
+ pMacro = pFlyFormat->GetMacro().GetMacroTable().Get(nEvent);
+ if (nullptr != pMacro)
{
const Point aSttPt( PixelToLogic( m_aStartPos ) );
m_aRszMvHdlPt = aDocPt;
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 3127b1f25beb..66cc701c4951 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1273,10 +1273,11 @@ void SwBaseShell::Execute(SfxRequest &rReq)
IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void)
{
- GraphicType nGrfType;
SwWrtShell &rSh = GetShell();
- if( CNT_GRF == rSh.SwEditShell::GetCntType() &&
- GraphicType::NONE != ( nGrfType = rSh.GetGraphicType() ) &&
+ if (CNT_GRF != rSh.SwEditShell::GetCntType())
+ return;
+ GraphicType const nGrfType(rSh.GetGraphicType());
+ if (GraphicType::NONE != nGrfType &&
!aGrfUpdateSlots.empty() )
{
bool bProtect = FlyProtectFlags::NONE != rSh.IsSelObjProtected(FlyProtectFlags::Content|FlyProtectFlags::Parent);
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 6d9b706ad0b3..7b51f393c291 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -495,10 +495,11 @@ void SwGrfShell::Execute(SfxRequest &rReq)
void SwGrfShell::ExecAttr( SfxRequest &rReq )
{
- GraphicType nGrfType;
- if( CNT_GRF == GetShell().GetCntType() &&
- ( GraphicType::Bitmap == ( nGrfType = GetShell().GetGraphicType()) ||
- GraphicType::GdiMetafile == nGrfType ))
+ GraphicType nGrfType = GraphicType::NONE;
+ if (CNT_GRF == GetShell().GetCntType())
+ nGrfType = GetShell().GetGraphicType();
+ if (GraphicType::Bitmap == nGrfType ||
+ GraphicType::GdiMetafile == nGrfType)
{
SfxItemSet aGrfSet( GetShell().GetAttrPool(), RES_GRFATR_BEGIN,
RES_GRFATR_END -1 );
diff --git a/sw/source/uibase/utlui/tmplctrl.cxx b/sw/source/uibase/utlui/tmplctrl.cxx
index 3578e5fae214..112535907939 100644
--- a/sw/source/uibase/utlui/tmplctrl.cxx
+++ b/sw/source/uibase/utlui/tmplctrl.cxx
@@ -97,8 +97,8 @@ void SwTemplateControl::Command( const CommandEvent& rCEvt )
ScopedVclPtrInstance<SwTemplatePopup_Impl> aPop;
{
SwView* pView = ::GetActiveView();
- SwWrtShell* pWrtShell;
- if( pView && nullptr != (pWrtShell = pView->GetWrtShellPtr()) &&
+ SwWrtShell *const pWrtShell(pView ? pView->GetWrtShellPtr() : nullptr);
+ if (nullptr != pWrtShell &&
!pWrtShell->SwCursorShell::HasSelection()&&
!pWrtShell->IsSelFrameMode() &&
!pWrtShell->IsObjSelected())