[Libreoffice-commits] core.git: sc/source starmath/source svl/source

Stephan Bergmann sbergman at redhat.com
Tue Jun 14 16:19:55 UTC 2016


 sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx    |   10 ++++------
 sc/source/ui/Accessibility/AccessiblePreviewCell.cxx       |   10 ++++------
 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx |   12 +++++-------
 starmath/source/parse.cxx                                  |    3 +--
 svl/source/numbers/zforlist.cxx                            |   13 +++++++------
 5 files changed, 21 insertions(+), 27 deletions(-)

New commits:
commit 83360372383fdcbab18560a5113c92115b166cd5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 14 18:19:04 2016 +0200

    tdf#94205: Some remaining new+std::move -> o3tl::make_unique
    
    Change-Id: I6a9a46d37bf09f6b497d591498c40103f4c96f59

diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
index 40555e2..4b6f9bc 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
@@ -19,9 +19,6 @@
 
 #include <sal/config.h>
 
-#include <memory>
-#include <utility>
-
 #include <tools/gen.hxx>
 #include "AccessiblePageHeaderArea.hxx"
 #include "AccessibleText.hxx"
@@ -300,9 +297,10 @@ void ScAccessiblePageHeaderArea::CreateTextHelper()
 {
     if (!mpTextHelper)
     {
-        ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(o3tl::make_unique<ScAccessibleHeaderTextData>(mpViewShell, mpEditObj, mbHeader, meAdjust)));
-
-        mpTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource));
+        mpTextHelper = new ::accessibility::AccessibleTextHelper(
+            o3tl::make_unique<ScAccessibilityEditSource>(
+                o3tl::make_unique<ScAccessibleHeaderTextData>(
+                    mpViewShell, mpEditObj, mbHeader, meAdjust)));
         mpTextHelper->SetEventSource(this);
     }
 }
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index 89c735c..5383e68 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -19,9 +19,6 @@
 
 #include <sal/config.h>
 
-#include <memory>
-#include <utility>
-
 #include "scitems.hxx"
 #include <editeng/eeitem.hxx>
 #include <tools/gen.hxx>
@@ -283,9 +280,10 @@ void ScAccessiblePreviewCell::CreateTextHelper()
 {
     if (!mpTextHelper)
     {
-        ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(o3tl::make_unique<ScAccessiblePreviewCellTextData>(mpViewShell, maCellAddress)));
-
-        mpTextHelper = new ::accessibility::AccessibleTextHelper( std::move(pEditSource) );
+        mpTextHelper = new ::accessibility::AccessibleTextHelper(
+            o3tl::make_unique<ScAccessibilityEditSource>(
+                o3tl::make_unique<ScAccessiblePreviewCellTextData>(
+                    mpViewShell, maCellAddress)));
         mpTextHelper->SetEventSource( this );
 
         // paragraphs in preview are transient
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index 816a78d..3aed647 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -19,9 +19,6 @@
 
 #include <sal/config.h>
 
-#include <memory>
-#include <utility>
-
 /* Somehow, under same circumstances, MSVC creates object code for 2
  * inlined functions. Nobody here uses them, so simply define them away
  * so that there be no dupplicate symbols anymore.
@@ -420,10 +417,11 @@ void ScAccessiblePreviewHeaderCell::CreateTextHelper()
 {
     if (!mpTextHelper)
     {
-
-        ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(o3tl::make_unique<ScAccessiblePreviewHeaderCellTextData>(mpViewShell, OUString(getAccessibleName()), maCellPos, mbColumnHeader, mbRowHeader)));
-
-        mpTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource));
+        mpTextHelper = new ::accessibility::AccessibleTextHelper(
+            o3tl::make_unique<ScAccessibilityEditSource>(
+                o3tl::make_unique<ScAccessiblePreviewHeaderCellTextData>(
+                    mpViewShell, OUString(getAccessibleName()), maCellPos,
+                    mbColumnHeader, mbRowHeader)));
         mpTextHelper->SetEventSource(this);
     }
 }
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 5674e3d..26f6f45 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1566,8 +1566,7 @@ void SmParser::DoEscape()
             Error(PE_UNEXPECTED_TOKEN);
     }
 
-    std::unique_ptr<SmNode> pNode(new SmMathSymbolNode(m_aCurToken));
-    m_aNodeStack.push_front(std::move(pNode));
+    m_aNodeStack.push_front(o3tl::make_unique<SmMathSymbolNode>(m_aCurToken));
 
     NextToken();
 }
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 9cfe4cc..06dc916 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -24,6 +24,7 @@
 #include <svl/currencytable.hxx>
 
 #include <comphelper/string.hxx>
+#include <o3tl/make_unique.hxx>
 #include <tools/debug.hxx>
 #include <unotools/charclass.hxx>
 #include <unotools/configmgr.hxx>
@@ -3737,12 +3738,11 @@ void SvNumberFormatter::ImpInitCurrencyTable()
         aConfiguredCurrencyAbbrev, eConfiguredCurrencyLanguage );
     sal_uInt16 nSecondarySystemCurrencyPosition = 0;
     sal_uInt16 nMatchingSystemCurrencyPosition = 0;
-    std::unique_ptr<NfCurrencyEntry> pEntry(
-    // first entry is SYSTEM
-        new NfCurrencyEntry( *pLocaleData, LANGUAGE_SYSTEM ));
 
+    // First entry is SYSTEM:
     theCurrencyTable::get().insert(
-            theCurrencyTable::get().begin(), std::move(pEntry));
+        theCurrencyTable::get().begin(),
+        o3tl::make_unique<NfCurrencyEntry>(*pLocaleData, LANGUAGE_SYSTEM));
     sal_uInt16 nCurrencyPos = 1;
 
     css::uno::Sequence< css::lang::Locale > xLoc = LocaleDataWrapper::getInstalledLocaleNames();
@@ -3769,6 +3769,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
             if ( pCurrencies[nDefault].Default )
                 break;
         }
+        std::unique_ptr<NfCurrencyEntry> pEntry;
         if ( nDefault < nCurrencyCount )
         {
             pEntry.reset(new NfCurrencyEntry(pCurrencies[nDefault], *pLocaleData, eLang));
@@ -3802,10 +3803,10 @@ void SvNumberFormatter::ImpInitCurrencyTable()
             {
                 if (pCurrencies[nCurrency].LegacyOnly)
                 {
-                    pEntry.reset(new NfCurrencyEntry(pCurrencies[nCurrency], *pLocaleData, eLang));
                     rLegacyOnlyCurrencyTable.insert(
                         rLegacyOnlyCurrencyTable.begin() + nLegacyOnlyCurrencyPos++,
-                        std::move(pEntry));
+                        o3tl::make_unique<NfCurrencyEntry>(
+                            pCurrencies[nCurrency], *pLocaleData, eLang));
                 }
                 else if ( nCurrency != nDefault )
                 {


More information about the Libreoffice-commits mailing list