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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jul 24 08:48:32 UTC 2018


 compilerplugins/clang/useuniqueptr.cxx   |    3 +++
 reportdesign/source/ui/dlg/Condition.cxx |   20 ++++++++++----------
 reportdesign/source/ui/dlg/Condition.hxx |    8 ++++----
 3 files changed, 17 insertions(+), 14 deletions(-)

New commits:
commit 8a592a5c6a0fbfb831569a7c03ac75b91ce013c4
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 23 15:35:42 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 24 10:48:08 2018 +0200

    loplugin:useuniqueptr in rptui::Condition
    
    Change-Id: I1197be1f7ea8b621dedef41fdd0a664cb6d90374
    Reviewed-on: https://gerrit.libreoffice.org/57879
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx
index f41b55a5eb0f..ab254920b6c9 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -107,6 +107,9 @@ public:
         // RedlineInfo::pNextRedline
         if (fn == SRCDIR "/sw/source/filter/xml/XMLRedlineImportHelper.cxx")
             return;
+        // SfxObjectShell::pMedium
+        if (fn == SRCDIR "/sfx2/source/doc/objxtor.cxx")
+            return;
 
         TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
     }
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
index 8d4e76ba23b2..5aa87cd98d03 100644
--- a/reportdesign/source/ui/dlg/Condition.cxx
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -118,9 +118,9 @@ Condition::Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction,
     get(m_pHeader, "headerLabel");
     get(m_pConditionType, "typeCombobox");
     get(m_pOperationList, "opCombobox");
-    m_pCondLHS = new ConditionField(this, get<Edit>("lhsEntry"), get<PushButton>("lhsButton"));
+    m_pCondLHS.reset( new ConditionField(this, get<Edit>("lhsEntry"), get<PushButton>("lhsButton")) );
     get(m_pOperandGlue, "andLabel");
-    m_pCondRHS = new ConditionField(this, get<Edit>("rhsEntry"), get<PushButton>("rhsButton"));
+    m_pCondRHS.reset( new ConditionField(this, get<Edit>("rhsEntry"), get<PushButton>("rhsButton")) );
     get(m_pActions, "formatToolbox");
     get(m_pPreview, "previewDrawingarea");
     get(m_pMoveUp, "upButton");
@@ -162,10 +162,10 @@ Condition::Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction,
     m_nFontColorId = m_pActions->GetItemId(".uno:FontColor");
     m_nFontDialogId = m_pActions->GetItemId(".uno:FontDialog");
 
-    m_pBtnUpdaterBackgroundColor = new svx::ToolboxButtonColorUpdater(
-                                            SID_BACKGROUND_COLOR, m_nBackgroundColorId, m_pActions );
-    m_pBtnUpdaterFontColor = new svx::ToolboxButtonColorUpdater(
-                                            SID_ATTR_CHAR_COLOR2, m_nFontColorId, m_pActions );
+    m_pBtnUpdaterBackgroundColor.reset( new svx::ToolboxButtonColorUpdater(
+                                            SID_BACKGROUND_COLOR, m_nBackgroundColorId, m_pActions ) );
+    m_pBtnUpdaterFontColor.reset( new svx::ToolboxButtonColorUpdater(
+                                            SID_ATTR_CHAR_COLOR2, m_nFontColorId, m_pActions ) );
 
     Show();
 
@@ -198,10 +198,10 @@ void Condition::dispose()
 {
     m_bInDestruction = true;
 
-    delete m_pBtnUpdaterFontColor;
-    delete m_pCondLHS;
-    delete m_pCondRHS;
-    delete m_pBtnUpdaterBackgroundColor;
+    m_pBtnUpdaterFontColor.reset();
+    m_pCondLHS.reset();
+    m_pCondRHS.reset();
+    m_pBtnUpdaterBackgroundColor.reset();
     m_pHeader.clear();
     m_pConditionType.clear();
     m_pOperationList.clear();
diff --git a/reportdesign/source/ui/dlg/Condition.hxx b/reportdesign/source/ui/dlg/Condition.hxx
index f770928ee7e5..04e228707b22 100644
--- a/reportdesign/source/ui/dlg/Condition.hxx
+++ b/reportdesign/source/ui/dlg/Condition.hxx
@@ -96,9 +96,9 @@ namespace rptui
         VclPtr<FixedText>                  m_pHeader;
         VclPtr<ListBox>                    m_pConditionType;
         VclPtr<ListBox>                    m_pOperationList;
-        ConditionField*                    m_pCondLHS;
+        std::unique_ptr<ConditionField>    m_pCondLHS;
         VclPtr<FixedText>                  m_pOperandGlue;
-        ConditionField*                    m_pCondRHS;
+        std::unique_ptr<ConditionField>    m_pCondRHS;
         VclPtr<ToolBox>                    m_pActions;
         VclPtr<SvxFontPrevWindow>          m_pPreview;
         VclPtr<PushButton>                 m_pMoveUp;
@@ -107,8 +107,8 @@ namespace rptui
         VclPtr<PushButton>                 m_pRemoveCondition;
         VclPtr<SvxColorWindow>             m_pColorFloat;
 
-        svx::ToolboxButtonColorUpdater*   m_pBtnUpdaterFontColor; // updates the color below the toolbar icon
-        svx::ToolboxButtonColorUpdater*   m_pBtnUpdaterBackgroundColor;
+        std::unique_ptr<svx::ToolboxButtonColorUpdater> m_pBtnUpdaterFontColor; // updates the color below the toolbar icon
+        std::unique_ptr<svx::ToolboxButtonColorUpdater> m_pBtnUpdaterBackgroundColor;
 
 
         size_t                          m_nCondIndex;


More information about the Libreoffice-commits mailing list