summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-23 21:34:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-23 22:04:49 +0100
commitdbe73c8df874d0970e3d05159c796dfe67b81e8e (patch)
treee22df36e2a04e3a6f52ebfdbf0e96798fb470f9c /sw
parent063db6b5a011c48fd4f04048a292747f33418a82 (diff)
coverity#1415615 avoid Dereference null return value warning
Change-Id: I248dcafbb2cfdd7a8dd9270ef56bcccc1b9b0ee5
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/docnode/ndtbl.cxx2
-rw-r--r--sw/source/core/inc/UndoTable.hxx2
-rw-r--r--sw/source/core/undo/untbl.cxx8
3 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 2ad58d1081be..e65d24c2692b 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4705,7 +4705,7 @@ void SwDoc::ChgTableStyle(const OUString& rName, const SwTableAutoFormat& rNewFo
if (GetIDocumentUndoRedo().DoesUndo())
{
- SwUndo * pUndo = new SwUndoTableStyleUpdate(rName, aOldFormat, this);
+ SwUndo * pUndo = new SwUndoTableStyleUpdate(*pFormat, aOldFormat, this);
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index a83434660497..2cd09342f408 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -419,7 +419,7 @@ class SwUndoTableStyleUpdate : public SwUndo
{
std::unique_ptr<SwTableAutoFormat> m_pOldFormat, m_pNewFormat;
public:
- SwUndoTableStyleUpdate(const OUString& rName, const SwTableAutoFormat& rOldFormat, const SwDoc* pDoc);
+ SwUndoTableStyleUpdate(const SwTableAutoFormat& rNewFormat, const SwTableAutoFormat& rOldFormat, const SwDoc* pDoc);
virtual ~SwUndoTableStyleUpdate() override;
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 7c16abe9b9b3..3da877ae390a 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -3215,10 +3215,10 @@ SwRewriter SwUndoTableStyleDelete::GetRewriter() const
return aResult;
}
-SwUndoTableStyleUpdate::SwUndoTableStyleUpdate(const OUString& rName, const SwTableAutoFormat& rOldFormat, const SwDoc* pDoc)
- : SwUndo(SwUndoId::TBLSTYLE_UPDATE, pDoc),
- m_pOldFormat(new SwTableAutoFormat(rOldFormat)),
- m_pNewFormat(new SwTableAutoFormat(*pDoc->GetTableStyles().FindAutoFormat(rName)))
+SwUndoTableStyleUpdate::SwUndoTableStyleUpdate(const SwTableAutoFormat& rNewFormat, const SwTableAutoFormat& rOldFormat, const SwDoc* pDoc)
+ : SwUndo(SwUndoId::TBLSTYLE_UPDATE, pDoc)
+ , m_pOldFormat(new SwTableAutoFormat(rOldFormat))
+ , m_pNewFormat(new SwTableAutoFormat(rNewFormat))
{ }
SwUndoTableStyleUpdate::~SwUndoTableStyleUpdate()