[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source svx/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 27 12:39:06 UTC 2019


 sc/inc/conditio.hxx                  |    2 +-
 sc/source/core/data/conditio.cxx     |   12 ++++++------
 sc/source/filter/excel/xecontent.cxx |    6 +++---
 svx/source/form/fmshimp.cxx          |    4 ++--
 svx/source/form/navigatortree.cxx    |    2 +-
 svx/source/inc/fmshimp.hxx           |    2 +-
 6 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 9852f09b467e3c7f8058b931010b91f447905051
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Mar 27 10:58:14 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Mar 27 13:38:51 2019 +0100

    return unique_ptr from FmXFormShell::GetConversionMenu_Lock
    
    Change-Id: I8b262c18862429f8b6822742fb8fa454af1090a6
    Reviewed-on: https://gerrit.libreoffice.org/69802
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 11250b4b7827..171621ce0310 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -1030,9 +1030,9 @@ void FmXFormShell::ForceUpdateSelection_Lock()
     }
 }
 
-VclBuilder* FmXFormShell::GetConversionMenu_Lock()
+std::unique_ptr<VclBuilder> FmXFormShell::GetConversionMenu_Lock()
 {
-    VclBuilder* pBuilder = new VclBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "svx/ui/convertmenu.ui", "");
+    std::unique_ptr<VclBuilder> pBuilder(new VclBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "svx/ui/convertmenu.ui", ""));
     VclPtr<PopupMenu> pNewMenu(pBuilder->get_menu("menu"));
     for (size_t i = 0; i < SAL_N_ELEMENTS(aConvertSlots); ++i)
     {
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index c73bb9b01e10..bbe61c0e4e3c 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -410,7 +410,7 @@ namespace svxform
                     const sal_Int16 nChangeId = aContextMenu->GetItemId("change");
                     if (!m_bRootSelected && !m_nFormsSelected && (m_nControlsSelected == 1))
                     {
-                        xBuilder.reset(FmXFormShell::GetConversionMenu_Lock());
+                        xBuilder = FmXFormShell::GetConversionMenu_Lock();
                         xConversionMenu = xBuilder->get_menu("menu");
                         aContextMenu->SetPopupMenu(nChangeId, xConversionMenu);
 #if OSL_DEBUG_LEVEL > 0
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index beedf5973d3a..7a9c452f866b 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -411,7 +411,7 @@ public:
     SAL_DLLPRIVATE void stopFiltering_Lock(bool bSave);
 
         // a menu that contains all ControlConversion entries
-    SAL_DLLPRIVATE static VclBuilder* GetConversionMenu_Lock();
+    SAL_DLLPRIVATE static std::unique_ptr<VclBuilder> GetConversionMenu_Lock();
 
     /// checks whether a given control conversion slot can be applied to the current selection
     SAL_DLLPRIVATE bool canConvertCurrentSelectionToControl_Lock(const OString& rIdent);
commit 16676ea2e86b1b50ba653b736c5db4eb9f32acf9
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Mar 27 11:24:41 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Mar 27 13:38:42 2019 +0100

    return unique_ptr in CreateFlatCopiedTokenArray
    
    Change-Id: I0d44ad1eca45b0b77d5a898a553aab61b1f479a9
    Reviewed-on: https://gerrit.libreoffice.org/69805
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index ae1097078c15..4651f7453b04 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -380,7 +380,7 @@ public:
 
                     /** Create a flat copy using ScTokenArray copy-ctor with
                         shared tokens. */
-    ScTokenArray*   CreateFlatCopiedTokenArray( sal_uInt16 nPos ) const;
+    std::unique_ptr<ScTokenArray> CreateFlatCopiedTokenArray( sal_uInt16 nPos ) const;
 
     void            CompileAll();
     void            CompileXML();
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index c992bd6f3ec3..359a76986da9 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1277,18 +1277,18 @@ OUString ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uInt16 n
     return aRet;
 }
 
-ScTokenArray* ScConditionEntry::CreateFlatCopiedTokenArray( sal_uInt16 nIndex ) const
+std::unique_ptr<ScTokenArray> ScConditionEntry::CreateFlatCopiedTokenArray( sal_uInt16 nIndex ) const
 {
     assert(nIndex <= 1);
-    ScTokenArray* pRet = nullptr;
+    std::unique_ptr<ScTokenArray> pRet;
 
     if ( nIndex==0 )
     {
         if ( pFormula1 )
-            pRet = new ScTokenArray( *pFormula1 );
+            pRet.reset(new ScTokenArray( *pFormula1 ));
         else
         {
-            pRet = new ScTokenArray();
+            pRet.reset(new ScTokenArray());
             if (bIsStr1)
             {
                 svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool();
@@ -1301,10 +1301,10 @@ ScTokenArray* ScConditionEntry::CreateFlatCopiedTokenArray( sal_uInt16 nIndex )
     else if ( nIndex==1 )
     {
         if ( pFormula2 )
-            pRet = new ScTokenArray( *pFormula2 );
+            pRet.reset(new ScTokenArray( *pFormula2 ));
         else
         {
-            pRet = new ScTokenArray();
+            pRet.reset(new ScTokenArray());
             if (bIsStr2)
             {
                 svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool();
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 1bc2697aa518..779f5d710ddd 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -719,7 +719,7 @@ void XclExpCFImpl::WriteBody( XclExpStream& rStrm )
 
     if (mbFormula2)
     {
-        xScTokArr.reset( mrFormatEntry.CreateFlatCopiedTokenArray( 1 ) );
+        xScTokArr = mrFormatEntry.CreateFlatCopiedTokenArray( 1 );
         mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_CONDFMT, *xScTokArr );
     }
 
@@ -1712,7 +1712,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
         std::unique_ptr< ScTokenArray > xScTokArr;
 
         // first formula
-        xScTokArr.reset( pValData->CreateFlatCopiedTokenArray( 0 ) );
+        xScTokArr = pValData->CreateFlatCopiedTokenArray( 0 );
         if (xScTokArr)
         {
             if( pValData->GetDataMode() == SC_VALID_LIST )
@@ -1785,7 +1785,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
         }
 
         // second formula
-        xScTokArr.reset( pValData->CreateFlatCopiedTokenArray( 1 ) );
+        xScTokArr = pValData->CreateFlatCopiedTokenArray( 1 );
         if (xScTokArr)
         {
             if(GetOutput() == EXC_OUTPUT_BINARY)


More information about the Libreoffice-commits mailing list