[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sw/source vcl/inc

2023-10-14 Thread Caolán McNamara (via logerrit)
 compilerplugins/clang/unnecessaryvirtual.results |2 --
 sw/source/uibase/utlui/navipi.cxx|6 ++
 vcl/inc/salvtables.hxx   |2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 025372363e5310ffe0e729648f97faef2fe784eb
Author: Caolán McNamara 
AuthorDate: Sat Oct 14 19:01:48 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 14 21:51:32 2023 +0200

get_iter_abs_pos doesn't neeed to be virtual

Change-Id: If69768ffac37aa7b39a806b3c67ad8cbdafc5d2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157981
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/compilerplugins/clang/unnecessaryvirtual.results 
b/compilerplugins/clang/unnecessaryvirtual.results
index 7404a1cffd85..96c0ef52a9b5 100644
--- a/compilerplugins/clang/unnecessaryvirtual.results
+++ b/compilerplugins/clang/unnecessaryvirtual.results
@@ -448,8 +448,6 @@ vcl/inc/salobj.hxx:49
 void SalObject::Enable(_Bool,)
 vcl/inc/salprn.hxx:116
 enum SalPrinterError SalPrinter::GetErrorCode()
-vcl/inc/salvtables.hxx:1771
-_Bool SalInstanceTreeView::get_iter_abs_pos(class weld::TreeIter 
&,int,)const
 vcl/inc/skia/gdiimpl.hxx:230
 void SkiaSalGraphicsImpl::createSurface()
 vcl/inc/skia/gdiimpl.hxx:240
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 09186972a3ab..8648db8e5143 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1770,7 +1770,7 @@ public:
 
 virtual bool get_iter_first(weld::TreeIter& rIter) const override;
 
-virtual bool get_iter_abs_pos(weld::TreeIter& rIter, int nPos) const;
+bool get_iter_abs_pos(weld::TreeIter& rIter, int nPos) const;
 
 virtual bool iter_next_sibling(weld::TreeIter& rIter) const override;
 
commit 5bdcd30a64ef814e63d1548ab798cc8a81944b49
Author: Attila Szűcs 
AuthorDate: Thu May 18 10:36:38 2023 +0200
Commit: Caolán McNamara 
CommitDate: Sat Oct 14 21:51:22 2023 +0200

LOK: Navigator: headings expanded by default

Called an expand_row for the first element of the contetnTree
in the navigator constructor.
Right now contructor is called every time when navigator is
opened, it may change later. (desktop app do it only if navigator
opens in a new window, not on sidebar)

Change-Id: Ibe4b71e6a6ddb573269178f83c295b0c2cbd53b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151939
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
(cherry picked from commit 09c40d669cac5f167fa68cb5c6ad94a6a9e2a844)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157960
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index ad89c6b1a7bb..67807c69f8bc 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -734,6 +734,12 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
 m_xGlobalBox->hide();
 m_xGlobalToolBox->hide();
 m_xGlobalTree->HideTree();
+
+//Open Headings by default
+auto& pTreeView = m_xContentTree->get_widget();
+std::unique_ptr itEntry(pTreeView.make_iterator());
+pTreeView.get_iter_first(*itEntry);
+pTreeView.expand_row(*itEntry);
 }
 }
 


[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sw/source

2021-10-15 Thread Armin Le Grand (Allotropia) (via logerrit)
 compilerplugins/clang/test/unnecessaryoverride-dtor.cxx |2 +-
 compilerplugins/clang/unnecessaryoverride.cxx   |7 ---
 sw/source/core/docnode/ndtbl1.cxx   |2 ++
 sw/source/uibase/shells/basesh.cxx  |3 ++-
 4 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit e299f1f5e6097d9e5857dba65a65c33ac31974ae
Author: Armin Le Grand (Allotropia) 
AuthorDate: Thu Oct 14 17:56:22 2021 +0200
Commit: Armin Le Grand 
CommitDate: Fri Oct 15 17:15:31 2021 +0200

tdf#144843 call to GetBoxBackground requires incarnated item

Change-Id: Id47f26a762804cd8c1b5742966ec54b71a26ab09

Added assert/warning to SwDoc::GetBoxAttr - that is the
method used by GetBoxBackground && GetBoxDirection

Change-Id: I59e8dfb790e3872810885a8f888cea57be27e80c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123619
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Armin Le Grand 

diff --git a/sw/source/core/docnode/ndtbl1.cxx 
b/sw/source/core/docnode/ndtbl1.cxx
index ef44f23ca57f..964b2cb610f2 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -1250,6 +1250,8 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const 
SfxPoolItem  )
 
 bool SwDoc::GetBoxAttr( const SwCursor& rCursor, std::unique_ptr& 
rToFill )
 {
+// tdf#144843 calling GetBoxAttr *requires* object
+assert(rToFill && "requires object here");
 bool bRet = false;
 SwTableNode* pTableNd = 
rCursor.GetPoint()->nNode.GetNode().FindTableNode();
 SwSelBoxes aBoxes;
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 292b1f10c851..da474db91901 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2713,7 +2713,8 @@ void SwBaseShell::ExecDlg(SfxRequest )
 if ( rSh.IsTableMode() )
 {
 // Get background attributes of the table and put it in the set
-std::unique_ptr aBrush;
+// tdf#144843 calling GetBoxBackground *requires* an 
incarnation to be handed over
+std::unique_ptr 
aBrush(std::make_unique(RES_BACKGROUND));
 rSh.GetBoxBackground( aBrush );
 pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, 
aSet));
 aSet.Put( *aBrush );
commit 7dc2ac46be574b59cac7923ac55cf650c4fd1168
Author: Stephan Bergmann 
AuthorDate: Fri Oct 15 15:01:00 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 15 17:15:21 2021 +0200

loplugin:unnecessaryoverride corner case is subsumed now

...by modifications done to the plugin in
af908d9f18fbb83a5c393f856026cebefd821f18 "Avoid usage of incomplete types in
member functions defined in-class" (if the dtor's definition is spelled
`= default;` rather than `{}`, but which should always be possible)

Change-Id: Iddce2baf3635a12131854e86a609951309ffbc26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123656
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx 
b/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx
index 8ed472749105..960909b4ea4c 100644
--- a/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx
+++ b/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx
@@ -125,7 +125,7 @@ struct CompleteBase {
 // a class defined in a .hxx with the dtor declared (but not defined) as 
inline in the .hxx,
 // and then defined in the cxx (making it effectively only callable from 
within the cxx);
 // removing the dtor declaration from the class definition would change the 
dtor to be callable from everywhere
-MarkedInlineButNotDefined::~MarkedInlineButNotDefined() {}
+MarkedInlineButNotDefined::~MarkedInlineButNotDefined() = default;
 
 // avoid loplugin:unreffun:
 int main() {
diff --git a/compilerplugins/clang/unnecessaryoverride.cxx 
b/compilerplugins/clang/unnecessaryoverride.cxx
index 0641339d4e6f..7e7d39a0a5d8 100644
--- a/compilerplugins/clang/unnecessaryoverride.cxx
+++ b/compilerplugins/clang/unnecessaryoverride.cxx
@@ -193,13 +193,6 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const 
CXXMethodDecl* methodDecl)
 return true;
 }
 }
-// corner case
-if (methodDecl->isInlined()
-&& 
compiler.getSourceManager().isInMainFile(methodDecl->getLocation())
-&& 
!compiler.getSourceManager().isInMainFile(methodDecl->getCanonicalDecl()->getLocation()))
-{
-return true;
-}
 if (methodDecl->isExplicitlyDefaulted()) {
 if (methodDecl->getPreviousDecl() != nullptr) {
 return true;


[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sw/source

2018-11-24 Thread Libreoffice Gerrit user
 compilerplugins/clang/unusedenumconstants.readonly.results |8 
 sw/source/filter/html/css1atr.cxx  |   12 
 sw/source/uibase/inc/numberingtypelistbox.hxx  |7 ++-
 sw/source/uibase/misc/numberingtypelistbox.cxx |6 +++---
 4 files changed, 9 insertions(+), 24 deletions(-)

New commits:
commit 0742d5d3ec630c5237eb2bee28d926fb90bef706
Author: Noel Grandin 
AuthorDate: Thu Nov 22 13:04:04 2018 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 24 11:19:10 2018 +0100

remove unused VarHeight from Css1FrameSize

Change-Id: I3ac901a6eaa733a0a8b85a9e8ed8b71ff6ff8f96
Reviewed-on: https://gerrit.libreoffice.org/63921
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results 
b/compilerplugins/clang/unusedenumconstants.readonly.results
index 7f1b510b2bcc..74a84edad117 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -1476,8 +1476,6 @@ sw/source/core/unocore/unosett.cxx:1580
 enum (anonymous at 
/home/noel/libo2/sw/source/core/unocore/unosett.cxx:1577:5) InChapterFirst
 sw/source/core/unocore/unosett.cxx:1581
 enum (anonymous at 
/home/noel/libo2/sw/source/core/unocore/unosett.cxx:1577:5) InChapterLast
-sw/source/filter/html/css1atr.cxx:114
-enum Css1FrameSize VarHeight
 sw/source/filter/html/css1atr.cxx:117
 enum Css1FrameSize AnyHeight
 sw/source/filter/ww8/ww8scan.hxx:604
diff --git a/sw/source/filter/html/css1atr.cxx 
b/sw/source/filter/html/css1atr.cxx
index 630f3d611221..09302c33651a 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -111,14 +111,13 @@ enum class Css1Background {
 enum class Css1FrameSize {
 NONE   = 0x00,
 Width  = 0x01,
-VarHeight  = 0x02,
-MinHeight  = 0x04,
-FixHeight  = 0x08,
-AnyHeight  = 0x0e,
+MinHeight  = 0x02,
+FixHeight  = 0x04,
+AnyHeight  = 0x06,
 Pixel  = 0x10,
 };
 namespace o3tl {
-template<> struct typed_flags : 
is_typed_flags {};
+template<> struct typed_flags : 
is_typed_flags {};
 }
 
 #define DOT_LEADERS_MAX_WIDTH   18
@@ -2884,9 +2883,6 @@ static Writer& OutCSS1_SwFormatFrameSize( Writer& rWrt, 
const SfxPoolItem& rHt,
 case ATT_MIN_SIZE:
 bOutHeight = bool(nMode & Css1FrameSize::MinHeight);
 break;
-case ATT_VAR_SIZE:
-bOutHeight = bool(nMode & Css1FrameSize::VarHeight);
-break;
 default:
 OSL_ENSURE( bOutHeight, "Height will not be exported" );
 break;
commit 6b8cd04144cbafd32450e9ab98a7b25d816cf6e2
Author: Noel Grandin 
AuthorDate: Thu Nov 22 12:56:56 2018 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 24 11:19:04 2018 +0100

remove unused SwInsertNumTypes

Change-Id: Iede167882414e77f54218e8458f5315c1e16f245
Reviewed-on: https://gerrit.libreoffice.org/63912
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results 
b/compilerplugins/clang/unusedenumconstants.readonly.results
index 46d07937c843..7f1b510b2bcc 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -1490,12 +1490,6 @@ sw/source/uibase/inc/envimg.hxx:33
 enum SwEnvAlign ENV_VER_LEFT
 sw/source/uibase/inc/envimg.hxx:34
 enum SwEnvAlign ENV_VER_CNTR
-sw/source/uibase/inc/numberingtypelistbox.hxx:32
-enum SwInsertNumTypes PageStyleNumbering
-sw/source/uibase/inc/numberingtypelistbox.hxx:33
-enum SwInsertNumTypes Bitmap
-sw/source/uibase/inc/numberingtypelistbox.hxx:34
-enum SwInsertNumTypes Bullet
 tools/source/generic/poly.cxx:1122
 enum (anonymous at /home/noel/libo2/tools/source/generic/poly.cxx:1122:5) 
maxRecursionDepth
 ucbhelper/source/client/proxydecider.cxx:119
diff --git a/sw/source/uibase/inc/numberingtypelistbox.hxx 
b/sw/source/uibase/inc/numberingtypelistbox.hxx
index 6ceec6355c2a..593185708d9c 100644
--- a/sw/source/uibase/inc/numberingtypelistbox.hxx
+++ b/sw/source/uibase/inc/numberingtypelistbox.hxx
@@ -29,14 +29,11 @@
 enum class SwInsertNumTypes
 {
 NoNumbering  = 0x01,
-PageStyleNumbering   = 0x02,
-Bitmap   = 0x04,
-Bullet   = 0x08,
-Extended = 0x10
+Extended = 0x02
 };
 
 namespace o3tl {
-   template<> struct typed_flags : 
is_typed_flags {};
+   template<> struct typed_flags : 
is_typed_flags {};
 };
 
 struct SwNumberingTypeListBox_Impl;
diff --git a/sw/source/uibase/misc/numberingtypelistbox.cxx 
b/sw/source/uibase/misc/numberingtypelistbox.cxx
index f51f735822e6..83aa07940e71 100644
--- a/sw/source/uibase/misc/numberingtypelistbox.cxx
+++ b/sw/source/uibase/misc/numberingtypelistbox.cxx
@@ -79,15 +79,15 @@ void 

[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sw/source toolkit/source

2018-11-21 Thread Libreoffice Gerrit user
 compilerplugins/clang/unusedenumconstants.untouched.results |8 --
 sw/source/uibase/inc/wrtsh.hxx  |2 -
 sw/source/uibase/wrtsh/wrtsh2.cxx   |   14 ++--
 toolkit/source/controls/grid/defaultgriddatamodel.cxx   |2 -
 4 files changed, 8 insertions(+), 18 deletions(-)

New commits:
commit 49d074451c58932f4193169fabcc2256b49977f4
Author: Noel Grandin 
AuthorDate: Wed Nov 21 14:23:22 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 22 07:36:10 2018 +0100

convert FieldDialogPressedButton to scoped enum

and removed unused EDIT

Change-Id: I1bd4ac135f280e19ffbf51364f406f8068130874
Reviewed-on: https://gerrit.libreoffice.org/63743
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedenumconstants.untouched.results 
b/compilerplugins/clang/unusedenumconstants.untouched.results
index e2149c99eb2d..3697556b248a 100644
--- a/compilerplugins/clang/unusedenumconstants.untouched.results
+++ b/compilerplugins/clang/unusedenumconstants.untouched.results
@@ -512,8 +512,6 @@ sw/source/uibase/inc/tautofmt.hxx:36
 enum AutoFormatLine RIGHT_LINE
 sw/source/uibase/inc/tautofmt.hxx:36
 enum AutoFormatLine TOP_LINE
-sw/source/uibase/inc/wrtsh.hxx:365
-enum SwWrtShell::FieldDialogPressedButton BTN_EDIT
 sw/source/uibase/utlui/content.cxx:824
 enum STR_CONTEXT_IDX IDX_STR_LINK_REGION
 sw/source/uibase/utlui/content.cxx:825
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 8e5717e5e045..6697fd01bd03 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -362,7 +362,7 @@ typedef bool (SwWrtShell:: *FNSimpleMove)();
 
 enum DoType { UNDO, REDO, REPEAT };
 
-enum FieldDialogPressedButton { BTN_NONE, BTN_EDIT, BTN_PREV, BTN_NEXT };
+enum class FieldDialogPressedButton { NONE, Previous, Next };
 
 voidDo( DoType eDoType, sal_uInt16 nCnt = 1 );
 OUString  GetDoString( DoType eDoType ) const;
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx 
b/sw/source/uibase/wrtsh/wrtsh2.cxx
index 8d1707761ab6..bff262badbf3 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -146,7 +146,7 @@ void SwWrtShell::UpdateInputFields( SwInputFieldList* pLst )
 bool bCancel = false;
 
 size_t nIndex = 0;
-FieldDialogPressedButton ePressedButton = BTN_NONE;
+FieldDialogPressedButton ePressedButton = 
FieldDialogPressedButton::NONE;
 
 SwField* pField = GetCurField();
 if (pField)
@@ -179,9 +179,9 @@ void SwWrtShell::UpdateInputFields( SwInputFieldList* pLst )
 // Otherwise update error at multi-selection:
 pTmp->GetField(nIndex)->GetTyp()->UpdateFields();
 
-if (ePressedButton == BTN_PREV && nIndex > 0)
+if (ePressedButton == FieldDialogPressedButton::Previous && 
nIndex > 0)
 nIndex--;
-else if (ePressedButton == BTN_NEXT && nIndex < nCnt - 1)
+else if (ePressedButton == FieldDialogPressedButton::Next && 
nIndex < nCnt - 1)
 nIndex++;
 else
 bCancel = true;
@@ -268,9 +268,9 @@ bool SwWrtShell::StartInputFieldDlg(SwField* pField, bool 
bPrevButton, bool bNex
 if (pPressedButton)
 {
 if (pDlg->PrevButtonPressed())
-*pPressedButton = BTN_PREV;
+*pPressedButton = FieldDialogPressedButton::Previous;
 else if (pDlg->NextButtonPressed())
-*pPressedButton = BTN_NEXT;
+*pPressedButton = FieldDialogPressedButton::Next;
 }
 
 pDlg.disposeAndClear();
@@ -288,9 +288,9 @@ bool SwWrtShell::StartDropDownFieldDlg(SwField* pField, 
bool bPrevButton, bool b
 if (pPressedButton)
 {
 if (pDlg->PrevButtonPressed())
-*pPressedButton = BTN_PREV;
+*pPressedButton = FieldDialogPressedButton::Previous;
 else if (pDlg->NextButtonPressed())
-*pPressedButton = BTN_NEXT;
+*pPressedButton = FieldDialogPressedButton::Next;
 }
 
 pDlg.disposeAndClear();
commit 54addc81ded0cc70a8e179b26141834e75be8e8e
Author: Noel Grandin 
AuthorDate: Wed Nov 21 13:59:06 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 22 07:35:57 2018 +0100

remove unused broadcast_type enum

Change-Id: I2939928e393ef2e306e840488053ca50957c10ce
Reviewed-on: https://gerrit.libreoffice.org/63742
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedenumconstants.untouched.results 
b/compilerplugins/clang/unusedenumconstants.untouched.results
index 4cd99c3ed3e9..e2149c99eb2d 100644
--- a/compilerplugins/clang/unusedenumconstants.untouched.results
+++ b/compilerplugins/clang/unusedenumconstants.untouched.results
@@ -526,12 +526,6 @@ sw/source/uibase/utlui/glbltree.cxx:147
 enum 

[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sw/source

2018-07-30 Thread Libreoffice Gerrit user
 compilerplugins/clang/useuniqueptr.cxx |6 ++
 sw/source/ui/frmdlg/cption.cxx |2 +-
 sw/source/ui/frmdlg/frmpage.cxx|6 +++---
 sw/source/uibase/inc/cption.hxx|2 +-
 sw/source/uibase/inc/frmpage.hxx   |2 +-
 5 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit cfe896e7b811d4c2777531efcca8065a0d2fbf54
Author: Noel Grandin 
AuthorDate: Thu Jul 26 16:22:07 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 30 08:21:01 2018 +0200

loplugin:useuniqueptr in SwGrfExtPage

Change-Id: Ic71cf09b6a443f6918b074010fe53ea0843bf246
Reviewed-on: https://gerrit.libreoffice.org/58238
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/useuniqueptr.cxx 
b/compilerplugins/clang/useuniqueptr.cxx
index ab254920b6c9..d93c40205a8d 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -110,6 +110,12 @@ public:
 // SfxObjectShell::pMedium
 if (fn == SRCDIR "/sfx2/source/doc/objxtor.cxx")
 return;
+// various
+if (fn == SRCDIR "/sw/source/filter/ww8/wrtww8.cxx")
+return;
+// WW8TabBandDesc
+if (fn == SRCDIR "/sw/source/filter/ww8/ww8par2.cxx")
+return;
 
 TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
 }
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index a0d58c8a34d9..8925187a4a7a 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2406,7 +2406,7 @@ SwGrfExtPage::~SwGrfExtPage()
 
 void SwGrfExtPage::dispose()
 {
-delete pGrfDlg;
+pGrfDlg.reset();
 m_pMirror.clear();
 m_pMirrorVertBox.clear();
 m_pMirrorHorzBox.clear();
@@ -2603,9 +2603,9 @@ IMPL_LINK_NOARG(SwGrfExtPage, BrowseHdl, Button*, void)
 {
 if(!pGrfDlg)
 {
-pGrfDlg = new FileDialogHelper(
+pGrfDlg.reset(new FileDialogHelper(
 ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW,
-FileDialogFlags::Graphic, GetFrameWeld());
+FileDialogFlags::Graphic, GetFrameWeld()));
 pGrfDlg->SetTitle(get("linkframe")->get_label());
 }
 pGrfDlg->SetDisplayDirectory( m_pConnectED->GetText() );
diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index 1b191e0e2279..6196cb3409da 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -222,7 +222,7 @@ class SwGrfExtPage: public SfxTabPage
 OUStringaFilterName;
 OUStringaGrfName, aNewGrfName;
 
-::sfx2::FileDialogHelper* pGrfDlg;
+std::unique_ptr<::sfx2::FileDialogHelper> pGrfDlg;
 
 boolbHtmlMode;
 
commit 95d7dc537e8979b67ed0928237404fd552880095
Author: Noel Grandin 
AuthorDate: Thu Jul 26 16:18:04 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 30 08:20:53 2018 +0200

loplugin:useuniqueptr in SwCaptionDialog

Change-Id: Ibf49f18ed43bb24a3ef79a0c7862b0dbd2698f3d
Reviewed-on: https://gerrit.libreoffice.org/58237
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 1d62d1277e20..cc42c9a993f3 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -418,7 +418,7 @@ SwCaptionDialog::~SwCaptionDialog()
 
 void SwCaptionDialog::dispose()
 {
-delete pMgr;
+pMgr.reset();
 m_pTextEdit.clear();
 m_pCategoryBox.clear();
 m_pFormatText.clear();
diff --git a/sw/source/uibase/inc/cption.hxx b/sw/source/uibase/inc/cption.hxx
index 037debb11369..abf3855c52e1 100644
--- a/sw/source/uibase/inc/cption.hxx
+++ b/sw/source/uibase/inc/cption.hxx
@@ -58,7 +58,7 @@ class SwCaptionDialog : public SvxStandardDialog
 VclPtr m_pPreview;
 
 SwView// search per active, avoid View
-SwFieldMgr *pMgr;  // pointer to save the include
+std::unique_ptr pMgr;  // pointer to save the include
 
 OUString sCharacterStyle;
 bool bCopyAttributes;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sw/source

2018-07-24 Thread Libreoffice Gerrit user
 compilerplugins/clang/test/useuniqueptr.cxx |5 +
 compilerplugins/clang/useuniqueptr.cxx  |2 +-
 sw/source/uibase/config/dbconfig.cxx|   13 +
 sw/source/uibase/inc/dbconfig.hxx   |4 ++--
 4 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 4089e1d9f67a61322b1fa4330ee10f62b3684f7f
Author: Noel Grandin 
AuthorDate: Mon Jul 23 12:21:25 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 24 08:34:32 2018 +0200

loplugin:useuniqueptr fix check for DELETEZ inside compound stmt

Change-Id: Id748b8b0c9cfe8c288dfafb5d0c2a83a8de2c91c
Reviewed-on: https://gerrit.libreoffice.org/57871
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/test/useuniqueptr.cxx 
b/compilerplugins/clang/test/useuniqueptr.cxx
index 24a34c0e54b9..844f7fb65d7e 100644
--- a/compilerplugins/clang/test/useuniqueptr.cxx
+++ b/compilerplugins/clang/test/useuniqueptr.cxx
@@ -154,11 +154,16 @@ class Foo12 {
 class Foo13 {
 int * m_pbar1; // expected-note {{member is here [loplugin:useuniqueptr]}}
 int * m_pbar2; // expected-note {{member is here [loplugin:useuniqueptr]}}
+int * m_pbar3; // expected-note {{member is here [loplugin:useuniqueptr]}}
 ~Foo13()
 {
 if (m_pbar1)
 DELETEZ(m_pbar1); // expected-error {{unconditional call to delete 
on a member, should be using std::unique_ptr [loplugin:useuniqueptr]}}
 DELETEZ(m_pbar2); // expected-error {{unconditional call to delete on 
a member, should be using std::unique_ptr [loplugin:useuniqueptr]}}
+if (m_pbar3)
+{
+DELETEZ(m_pbar3); // expected-error {{unconditional call to delete 
on a member, should be using std::unique_ptr [loplugin:useuniqueptr]}}
+}
 }
 };
 // check for unconditional inner compound statements
diff --git a/compilerplugins/clang/useuniqueptr.cxx 
b/compilerplugins/clang/useuniqueptr.cxx
index c7f6d7a2444c..f41b55a5eb0f 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -228,7 +228,7 @@ void UseUniquePtr::CheckForSimpleDelete(const 
CXXMethodDecl* methodDecl, const C
 auto ifDeleteExpr = dyn_cast(*j);
 if (ifDeleteExpr)
 CheckDeleteExpr(methodDecl, ifDeleteExpr);
-ParenExpr const * parenExpr = dyn_cast(*i);
+ParenExpr const * parenExpr = dyn_cast(*j);
 if (parenExpr)
 CheckParenExpr(methodDecl, parenExpr);
 }
commit fbd757349ea0dd2e9daecc2b6d1aa2e80aa7a319
Author: Noel Grandin 
AuthorDate: Mon Jul 23 12:08:56 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 24 08:34:21 2018 +0200

loplugin:useuniqueptr in SwDBConfig

Change-Id: Ibf9cdf4e09275325a876b81067245f76597ae08e
Reviewed-on: https://gerrit.libreoffice.org/57870
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/uibase/config/dbconfig.cxx 
b/sw/source/uibase/config/dbconfig.cxx
index 91b24488bf36..34d0650dcde0 100644
--- a/sw/source/uibase/config/dbconfig.cxx
+++ b/sw/source/uibase/config/dbconfig.cxx
@@ -42,16 +42,14 @@ const Sequence& SwDBConfig::GetPropertyNames()
 
 SwDBConfig::SwDBConfig() :
 ConfigItem("Office.DataAccess",
-ConfigItemMode::DelayedUpdate|ConfigItemMode::ReleaseTree),
-pAdrImpl(nullptr),
-pBibImpl(nullptr)
+ConfigItemMode::DelayedUpdate|ConfigItemMode::ReleaseTree)
 {
 };
 
 SwDBConfig::~SwDBConfig()
 {
-delete pAdrImpl;
-delete pBibImpl;
+pAdrImpl.reset();
+pBibImpl.reset();
 }
 
 void SwDBConfig::Load()
@@ -59,10 +57,9 @@ void SwDBConfig::Load()
 const Sequence& rNames = GetPropertyNames();
 if(!pAdrImpl)
 {
-
-pAdrImpl = new SwDBData;
+pAdrImpl.reset(new SwDBData);
 pAdrImpl->nCommandType = 0;
-pBibImpl = new SwDBData;
+pBibImpl.reset(new SwDBData);
 pBibImpl->nCommandType = 0;
 }
 Sequence aValues = GetProperties(rNames);
diff --git a/sw/source/uibase/inc/dbconfig.hxx 
b/sw/source/uibase/inc/dbconfig.hxx
index 5ea79f423853..5a611f5d8be0 100644
--- a/sw/source/uibase/inc/dbconfig.hxx
+++ b/sw/source/uibase/inc/dbconfig.hxx
@@ -30,8 +30,8 @@ private:
 SAL_DLLPRIVATE static const css::uno::Sequence& 
GetPropertyNames();
 virtual void ImplCommit() override;
 
-SwDBData*   pAdrImpl;
-SwDBData*   pBibImpl;
+std::unique_ptr pAdrImpl;
+std::unique_ptr pBibImpl;
 
 public:
 SwDBConfig();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sw/source

2018-07-24 Thread Libreoffice Gerrit user
 compilerplugins/clang/useuniqueptr.cxx  |3 +++
 sw/source/filter/html/htmlatr.cxx   |   14 +++---
 sw/source/filter/html/htmlflywriter.cxx |5 ++---
 sw/source/filter/html/wrthtml.cxx   |   15 ++-
 sw/source/filter/html/wrthtml.hxx   |6 +++---
 sw/source/filter/xml/xmlexp.cxx |1 +
 sw/source/filter/xml/xmlexp.hxx |6 +++---
 sw/source/filter/xml/xmliteme.cxx   |   12 ++--
 sw/source/filter/xml/xmltble.cxx|9 +++--
 9 files changed, 34 insertions(+), 37 deletions(-)

New commits:
commit 94e3568d3d1aa399d13c53f53a699c49da3e929c
Author: Noel Grandin 
AuthorDate: Mon Jul 23 09:35:43 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 24 08:33:07 2018 +0200

loplugin:useuniqueptr in SwXMLExport

Change-Id: Id0354b73b0ff14b6a168b672f25483c07988494e
Reviewed-on: https://gerrit.libreoffice.org/57864
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 8a7da0693df1..1f86cd989b28 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -51,6 +51,7 @@
 #include 
 #include "xmltexte.hxx"
 #include "xmlexp.hxx"
+#include "xmlexpit.hxx"
 #include 
 #include 
 #include 
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index 211f50840da6..22e6a42368a7 100644
--- a/sw/source/filter/xml/xmlexp.hxx
+++ b/sw/source/filter/xml/xmlexp.hxx
@@ -47,9 +47,9 @@ typedef std::vector< SwXMLTableLines_Impl* > 
SwXMLTableLinesCache_Impl;
 
 class SwXMLExport : public SvXMLExport
 {
-SvXMLUnitConverter* m_pTwipUnitConverter;
-SvXMLExportItemMapper*  m_pTableItemMapper;
-SwXMLTableLinesCache_Impl*  m_pTableLines;
+std::unique_ptrm_pTwipUnitConverter;
+std::unique_ptr m_pTableItemMapper;
+std::unique_ptr m_pTableLines;
 
 SvXMLItemMapEntriesRef  m_xTableItemMap;
 SvXMLItemMapEntriesRef  m_xTableRowItemMap;
diff --git a/sw/source/filter/xml/xmliteme.cxx 
b/sw/source/filter/xml/xmliteme.cxx
index 60eaedd1f562..7ba4db9501d2 100644
--- a/sw/source/filter/xml/xmliteme.cxx
+++ b/sw/source/filter/xml/xmliteme.cxx
@@ -207,25 +207,25 @@ inline void SwXMLTableItemMapper_Impl::SetAbsWidth( 
sal_uInt32 nAbs )
 
 void SwXMLExport::InitItemExport()
 {
-m_pTwipUnitConverter = new SvXMLUnitConverter(getComponentContext(),
-util::MeasureUnit::TWIP, GetMM100UnitConverter().GetXMLMeasureUnit());
+m_pTwipUnitConverter.reset(new SvXMLUnitConverter(getComponentContext(),
+util::MeasureUnit::TWIP, GetMM100UnitConverter().GetXMLMeasureUnit()));
 
 m_xTableItemMap = new SvXMLItemMapEntries( aXMLTableItemMap );
 m_xTableRowItemMap = new SvXMLItemMapEntries( aXMLTableRowItemMap );
 m_xTableCellItemMap = new SvXMLItemMapEntries( aXMLTableCellItemMap );
 
-m_pTableItemMapper = new SwXMLTableItemMapper_Impl( m_xTableItemMap, *this 
);
+m_pTableItemMapper.reset(new SwXMLTableItemMapper_Impl( m_xTableItemMap, 
*this ));
 }
 
 void SwXMLExport::FinitItemExport()
 {
-delete m_pTableItemMapper;
-delete m_pTwipUnitConverter;
+m_pTableItemMapper.reset();
+m_pTwipUnitConverter.reset();
 }
 
 void SwXMLExport::ExportTableFormat( const SwFrameFormat& rFormat, sal_uInt32 
nAbsWidth )
 {
-static_cast(m_pTableItemMapper)
+static_cast(m_pTableItemMapper.get())
 ->SetAbsWidth( nAbsWidth );
 ExportFormat( rFormat, XML_TABLE );
 }
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 4077ce852723..9dbc82d0e92a 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -569,7 +569,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const 
SwTableLines& rLines,
 // pass 1: calculate columns
 SwXMLTableLines_Impl *pLines = new SwXMLTableLines_Impl( rLines );
 if( !m_pTableLines )
-m_pTableLines = new SwXMLTableLinesCache_Impl;
+m_pTableLines.reset(new SwXMLTableLinesCache_Impl);
 
 m_pTableLines->push_back( pLines );
 
@@ -995,10 +995,7 @@ void SwXMLExport::ExportTableLines( const SwTableLines& 
rLines,
 m_pTableLines->erase( it );
 
 if( m_pTableLines->empty() )
-{
-delete m_pTableLines ;
-m_pTableLines = nullptr;
-}
+m_pTableLines.reset();
 
 // pass 2: export columns
 const SwXMLTableColumns_Impl& rCols = pLines->GetColumns();
@@ -1201,7 +1198,7 @@ void SwXMLExport::DeleteTableLines()
 for (SwXMLTableLines_Impl* p : *m_pTableLines)
 delete p;
 m_pTableLines->clear();
-delete m_pTableLines;
+m_pTableLines.reset();
 }
 }
 
commit dba5dccfc5606ed6c6c888524460c9546143aaef
Author: Noel Grandin 
AuthorDate: Mon Jul 23 09:24:24 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 24 08:32:56 2018 +0200

loplugin:useuniqueptr in SwHTMLWriter

Change-Id: I67f3dd615e798f8ac865b57332f6153530d81929
 

[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sw/source

2018-07-16 Thread Libreoffice Gerrit user
 compilerplugins/clang/useuniqueptr.cxx |6 +-
 sw/source/core/inc/UndoDraw.hxx|4 ++--
 sw/source/core/undo/undraw.cxx |   12 +---
 sw/source/core/undo/unovwr.cxx |   16 +++-
 4 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 8bcea1698c6ec45923a7675ab1250204e952527d
Author: Noel Grandin 
AuthorDate: Fri Jul 13 11:36:09 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 16 08:38:49 2018 +0200

loplugin:useuniqueptr in SwSdrUndo

Change-Id: I67276f2cd13cce8a7cb047216ead40c5afc384bd
Reviewed-on: https://gerrit.libreoffice.org/57423
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/inc/UndoDraw.hxx b/sw/source/core/inc/UndoDraw.hxx
index 8229c2a8e77e..7df31833a46a 100644
--- a/sw/source/core/inc/UndoDraw.hxx
+++ b/sw/source/core/inc/UndoDraw.hxx
@@ -36,8 +36,8 @@ class SwDoc;
 // Undo for Draw Objects
 class SwSdrUndo : public SwUndo
 {
-SdrUndoAction* pSdrUndo;
-SdrMarkList* pMarkList; // MarkList for all selected SdrObjects
+std::unique_ptr pSdrUndo;
+std::unique_ptr pMarkList; // MarkList for all selected 
SdrObjects
 
 public:
 SwSdrUndo( SdrUndoAction* , const SdrMarkList* pMarkList, const SwDoc* 
pDoc );
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index f007d86eee08..9d164095ac5d 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -75,27 +75,25 @@ SwSdrUndo::SwSdrUndo( SdrUndoAction* pUndo, const 
SdrMarkList* pMrkLst, const Sw
 : SwUndo( SwUndoId::DRAWUNDO, pDoc ), pSdrUndo( pUndo )
 {
 if( pMrkLst && pMrkLst->GetMarkCount() )
-pMarkList = new SdrMarkList( *pMrkLst );
-else
-pMarkList = nullptr;
+pMarkList.reset( new SdrMarkList( *pMrkLst ) );
 }
 
 SwSdrUndo::~SwSdrUndo()
 {
-delete pSdrUndo;
-delete pMarkList;
+pSdrUndo.reset();
+pMarkList.reset();
 }
 
 void SwSdrUndo::UndoImpl(::sw::UndoRedoContext & rContext)
 {
 pSdrUndo->Undo();
-rContext.SetSelections(nullptr, pMarkList);
+rContext.SetSelections(nullptr, pMarkList.get());
 }
 
 void SwSdrUndo::RedoImpl(::sw::UndoRedoContext & rContext)
 {
 pSdrUndo->Redo();
-rContext.SetSelections(nullptr, pMarkList);
+rContext.SetSelections(nullptr, pMarkList.get());
 }
 
 OUString SwSdrUndo::GetComment() const
commit e7a252166e2d88b4e16f25a04f1d5072236e8c5e
Author: Noel Grandin 
AuthorDate: Fri Jul 13 11:27:23 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 16 08:38:38 2018 +0200

loplugin:useuniqueptr in UndoTransliterate_Data

Change-Id: I1c6e865a6f59ce7f31c42d28b2b463a577b3cc28
Reviewed-on: https://gerrit.libreoffice.org/57421
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/useuniqueptr.cxx 
b/compilerplugins/clang/useuniqueptr.cxx
index 0520546052a4..1cb392f718f8 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -70,11 +70,15 @@ public:
 if (fn == SRCDIR "/sc/source/ui/unoobj/funcuno.cxx")
 return;
 // SwAttrIter::m_pFont
-if (fn == SRCDIR "/sw/source/core/text/itratr.cxx")
+if (fn == SRCDIR "/sw/source/core/text/itratr.cxx"
+|| fn == SRCDIR "/sw/source/core/text/redlnitr.cxx")
 return;
 // SwWrongList
 if (fn == SRCDIR "/sw/source/core/text/wrong.cxx")
 return;
+// SwLineLayout::m_pNext
+if (fn == SRCDIR "/sw/source/core/text/porlay.cxx")
+return;
 
 TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
 }
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index beafde6a4773..e2fb76a19f63 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -322,16 +322,15 @@ SwRewriter SwUndoOverwrite::GetRewriter() const
 struct UndoTransliterate_Data
 {
 OUStringsText;
-SwHistory*  pHistory;
-Sequence< sal_Int32 >*  pOffsets;
+std::unique_ptr pHistory;
+std::unique_ptr> pOffsets;
 sal_uLong   nNdIdx;
 sal_Int32  nStart, nLen;
 
 UndoTransliterate_Data( sal_uLong nNd, sal_Int32 nStt, sal_Int32 nStrLen, 
const OUString& rText )
-: sText( rText ), pHistory( nullptr ), pOffsets( nullptr ),
+: sText( rText ),
 nNdIdx( nNd ), nStart( nStt ), nLen( nStrLen )
 {}
-~UndoTransliterate_Data() { delete pOffsets; delete pHistory; }
 
 void SetChangeAtNode( SwDoc& rDoc );
 };
@@ -396,7 +395,7 @@ void SwUndoTransliterate::AddChanges( SwTextNode& rTNd,
 if( *p != ( nStart + n ))
 {
 // create the Offset array
-pNew->pOffsets = new Sequence  ( nLen );
+pNew->pOffsets.reset( new Sequence  ( nLen ) );
 sal_Int32* pIdx = pNew->pOffsets->getArray();
 p = pOffsets;
 long nMyOff, nNewVal = nStart;
@@ -428,16 +427,15 @@ void 

[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sw/source

2018-07-13 Thread Noel Grandin
 compilerplugins/clang/useuniqueptr.cxx  |6 ++
 sw/source/core/inc/UndoTable.hxx|8 
 sw/source/core/txtnode/SwGrammarContact.cxx |   22 +-
 sw/source/core/undo/untbl.cxx   |   26 --
 4 files changed, 31 insertions(+), 31 deletions(-)

New commits:
commit c79bd83818dbd49dfd77ab82457057eff6a5d3d7
Author: Noel Grandin 
Date:   Thu Jul 12 16:57:07 2018 +0200

loplugin:useuniqueptr in SwUndoInsTable

Change-Id: If3f0f51415d0cae910fded9f1391219a8b5b7309
Reviewed-on: https://gerrit.libreoffice.org/57364
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 269644245dd0..88cece131191 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -48,10 +48,10 @@ class SwUndoInsTable : public SwUndo
 {
 OUString sTableNm;
 SwInsertTableOptions aInsTableOpts;
-SwDDEFieldType* pDDEFieldType;
-std::vector *pColWidth;
-SwRedlineData*  pRedlData;
-SwTableAutoFormat* pAutoFormat;
+std::unique_ptr pDDEFieldType;
+std::unique_ptr> pColWidth;
+std::unique_ptr  pRedlData;
+std::unique_ptr pAutoFormat;
 sal_uLong nSttNode;
 sal_uInt16 nRows, nCols;
 sal_uInt16 nAdjust;
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 1f03b2e57441..927b489eba31 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -226,16 +226,16 @@ SwUndoInsTable::SwUndoInsTable( const SwPosition& rPos, 
sal_uInt16 nCl, sal_uInt
 {
 if( pColArr )
 {
-pColWidth = new std::vector(*pColArr);
+pColWidth.reset( new std::vector(*pColArr) );
 }
 if( pTAFormat )
-pAutoFormat = new SwTableAutoFormat( *pTAFormat );
+pAutoFormat.reset( new SwTableAutoFormat( *pTAFormat ) );
 
 // consider redline
 SwDoc& rDoc = *rPos.nNode.GetNode().GetDoc();
 if( rDoc.getIDocumentRedlineAccess().IsRedlineOn() )
 {
-pRedlData = new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, 
rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() );
+pRedlData.reset( new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, 
rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ) );
 SetRedlineFlags( rDoc.getIDocumentRedlineAccess().GetRedlineFlags() );
 }
 
@@ -244,10 +244,10 @@ SwUndoInsTable::SwUndoInsTable( const SwPosition& rPos, 
sal_uInt16 nCl, sal_uInt
 
 SwUndoInsTable::~SwUndoInsTable()
 {
-delete pDDEFieldType;
-delete pColWidth;
-delete pRedlData;
-delete pAutoFormat;
+pDDEFieldType.reset();
+pColWidth.reset();
+pRedlData.reset();
+pAutoFormat.reset();
 }
 
 void SwUndoInsTable::UndoImpl(::sw::UndoRedoContext & rContext)
@@ -280,9 +280,8 @@ void SwUndoInsTable::UndoImpl(::sw::UndoRedoContext & 
rContext)
 }
 
 sTableNm = pTableNd->GetTable().GetFrameFormat()->GetName();
-if( dynamic_cast(>GetTable()) != nullptr )
-pDDEFieldType = 
static_cast(static_cast(pTableNd->GetTable()).
-GetDDEFieldType()->Copy());
+if( auto pDDETable = dynamic_cast(>GetTable()) )
+pDDEFieldType.reset( 
static_cast(pDDETable->GetDDEFieldType()->Copy()) );
 
 rDoc.GetNodes().Delete( aIdx, pTableNd->EndOfSectionIndex() -
 aIdx.GetIndex() + 1 );
@@ -300,7 +299,7 @@ void SwUndoInsTable::RedoImpl(::sw::UndoRedoContext & 
rContext)
 SwPosition const aPos(SwNodeIndex(rDoc.GetNodes(), nSttNode));
 const SwTable* pTable = rDoc.InsertTable( aInsTableOpts, aPos, nRows, 
nCols,
 nAdjust,
-pAutoFormat, pColWidth );
+pAutoFormat.get(), pColWidth.get() 
);
 static_cast(pTable->GetFrameFormat())->SetName( sTableNm );
 SwTableNode* pTableNode = rDoc.GetNodes()[nSttNode]->GetTableNode();
 
@@ -310,8 +309,7 @@ void SwUndoInsTable::RedoImpl(::sw::UndoRedoContext & 
rContext)
 *pDDEFieldType));
 std::unique_ptr pDDETable(new SwDDETable( 
pTableNode->GetTable(), pNewType ));
 pTableNode->SetNewTable( std::move(pDDETable) );
-delete pDDEFieldType;
-pDDEFieldType = nullptr;
+pDDEFieldType.reset();
 }
 
 if( (pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() 
)) ||
@@ -340,7 +338,7 @@ void SwUndoInsTable::RepeatImpl(::sw::RepeatContext & 
rContext)
 {
 rContext.GetDoc().InsertTable(
 aInsTableOpts, *rContext.GetRepeatPaM().GetPoint(),
-nRows, nCols, nAdjust, pAutoFormat, pColWidth );
+nRows, nCols, nAdjust, pAutoFormat.get(), pColWidth.get() );
 }
 
 SwRewriter SwUndoInsTable::GetRewriter() const
commit c75f597722608732d991619f550063e7c5d7c485
Author: Noel Grandin 
Date:   Thu Jul 12