[Libreoffice-commits] core.git: 2 commits - include/svl svl/source svx/source
Michael Stahl
mstahl at redhat.com
Fri Jul 17 08:37:06 PDT 2015
include/svl/currencytable.hxx | 8 ++++---
svl/source/numbers/currencytable.cxx | 8 +++----
svl/source/numbers/zforlist.cxx | 39 +++++++++++++++++++----------------
svx/source/xml/xmlgrhlp.cxx | 2 -
4 files changed, 32 insertions(+), 25 deletions(-)
New commits:
commit 5351f621d5eb599757af95213c4b391c0f34df2e
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jul 17 17:27:56 2015 +0200
svx: this was supposed to be "image/x-eps"
Change-Id: Ieb9d7f23a0ef1e4546c488a678dbfde085156216
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index ffb5c40..b193887 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -473,7 +473,7 @@ OUString SvXMLGraphicHelper::ImplGetGraphicMimeType( const OUString& rFileName )
{ "tif", "image/tiff" },
{ "svg", "image/svg+xml" },
{ "wmf", "image/x-wmf" },
- { "eps", "image/eps" },
+ { "eps", "image/x-eps" },
{ "bmp", "image/bmp" },
{ "pct", "image/x-pict" }
};
commit 50cf52bd0eb45a2f8ca91bbd64def942ef191f2f
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jul 17 13:11:32 2015 +0200
svl: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: Ie1174d57b696f49c05010ece1b721185b0904fd6
diff --git a/include/svl/currencytable.hxx b/include/svl/currencytable.hxx
index 44ead72..b7a074b 100644
--- a/include/svl/currencytable.hxx
+++ b/include/svl/currencytable.hxx
@@ -12,11 +12,13 @@
#include <svl/svldllapi.h>
#include <svl/zforlist.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
+
+#include <vector>
+#include <memory>
class SVL_DLLPUBLIC NfCurrencyTable
{
- typedef boost::ptr_vector<NfCurrencyEntry> DataType;
+ typedef std::vector<std::unique_ptr<NfCurrencyEntry>> DataType;
DataType maData;
public:
typedef DataType::iterator iterator;
@@ -29,7 +31,7 @@ public:
size_t size() const;
- void insert( iterator it, NfCurrencyEntry* p );
+ void insert(iterator it, std::unique_ptr<NfCurrencyEntry> p);
};
#endif
diff --git a/svl/source/numbers/currencytable.cxx b/svl/source/numbers/currencytable.cxx
index 91be75e..17e362d 100644
--- a/svl/source/numbers/currencytable.cxx
+++ b/svl/source/numbers/currencytable.cxx
@@ -16,12 +16,12 @@ NfCurrencyTable::iterator NfCurrencyTable::begin()
NfCurrencyEntry& NfCurrencyTable::operator[] ( size_t i )
{
- return maData[i];
+ return *maData[i];
}
const NfCurrencyEntry& NfCurrencyTable::operator[] ( size_t i ) const
{
- return maData[i];
+ return *maData[i];
}
size_t NfCurrencyTable::size() const
@@ -29,9 +29,9 @@ size_t NfCurrencyTable::size() const
return maData.size();
}
-void NfCurrencyTable::insert( iterator it, NfCurrencyEntry* p )
+void NfCurrencyTable::insert(iterator it, std::unique_ptr<NfCurrencyEntry> p)
{
- maData.insert(it, p);
+ maData.insert(it, std::move(p));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index afca600..38bdce0 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3615,11 +3615,12 @@ void SvNumberFormatter::ImpInitCurrencyTable()
aConfiguredCurrencyAbbrev, eConfiguredCurrencyLanguage );
sal_uInt16 nSecondarySystemCurrencyPosition = 0;
sal_uInt16 nMatchingSystemCurrencyPosition = 0;
- NfCurrencyEntry* pEntry;
-
+ std::unique_ptr<NfCurrencyEntry> pEntry(
// first entry is SYSTEM
- pEntry = new NfCurrencyEntry( *pLocaleData, LANGUAGE_SYSTEM );
- theCurrencyTable::get().insert( theCurrencyTable::get().begin(), pEntry );
+ new NfCurrencyEntry( *pLocaleData, LANGUAGE_SYSTEM ));
+
+ theCurrencyTable::get().insert(
+ theCurrencyTable::get().begin(), std::move(pEntry));
sal_uInt16 nCurrencyPos = 1;
::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > xLoc =
@@ -3649,28 +3650,29 @@ void SvNumberFormatter::ImpInitCurrencyTable()
}
if ( nDefault < nCurrencyCount )
{
- pEntry = new NfCurrencyEntry( pCurrencies[nDefault], *pLocaleData, eLang );
+ pEntry.reset(new NfCurrencyEntry(pCurrencies[nDefault], *pLocaleData, eLang));
}
else
- {
- pEntry = new NfCurrencyEntry( *pLocaleData, eLang ); // first or ShellsAndPebbles
+ { // first or ShellsAndPebbles
+ pEntry.reset(new NfCurrencyEntry(*pLocaleData, eLang));
}
if (LocaleDataWrapper::areChecksEnabled())
{
lcl_CheckCurrencySymbolPosition( *pEntry );
}
- rCurrencyTable.insert( rCurrencyTable.begin() + nCurrencyPos++, pEntry );
if ( !nSystemCurrencyPosition && !aConfiguredCurrencyAbbrev.isEmpty() &&
pEntry->GetBankSymbol() == aConfiguredCurrencyAbbrev &&
pEntry->GetLanguage() == eConfiguredCurrencyLanguage )
{
- nSystemCurrencyPosition = nCurrencyPos-1;
+ nSystemCurrencyPosition = nCurrencyPos;
}
if ( !nMatchingSystemCurrencyPosition &&
pEntry->GetLanguage() == eSysLang )
{
- nMatchingSystemCurrencyPosition = nCurrencyPos-1;
+ nMatchingSystemCurrencyPosition = nCurrencyPos;
}
+ rCurrencyTable.insert(
+ rCurrencyTable.begin() + nCurrencyPos++, std::move(pEntry));
// all remaining currencies for each locale
if ( nCurrencyCount > 1 )
{
@@ -3679,12 +3681,14 @@ void SvNumberFormatter::ImpInitCurrencyTable()
{
if (pCurrencies[nCurrency].LegacyOnly)
{
- pEntry = new NfCurrencyEntry( pCurrencies[nCurrency], *pLocaleData, eLang );
- rLegacyOnlyCurrencyTable.insert( rLegacyOnlyCurrencyTable.begin() + nLegacyOnlyCurrencyPos++, pEntry );
+ pEntry.reset(new NfCurrencyEntry(pCurrencies[nCurrency], *pLocaleData, eLang));
+ rLegacyOnlyCurrencyTable.insert(
+ rLegacyOnlyCurrencyTable.begin() + nLegacyOnlyCurrencyPos++,
+ std::move(pEntry));
}
else if ( nCurrency != nDefault )
{
- pEntry = new NfCurrencyEntry( pCurrencies[nCurrency], *pLocaleData, eLang );
+ pEntry.reset(new NfCurrencyEntry(pCurrencies[nCurrency], *pLocaleData, eLang));
// no dupes
bool bInsert = true;
sal_uInt16 n = rCurrencyTable.size();
@@ -3699,23 +3703,24 @@ void SvNumberFormatter::ImpInitCurrencyTable()
}
if ( !bInsert )
{
- delete pEntry;
+ pEntry.reset();
}
else
{
- rCurrencyTable.insert( rCurrencyTable.begin() + nCurrencyPos++, pEntry );
if ( !nSecondarySystemCurrencyPosition &&
(!aConfiguredCurrencyAbbrev.isEmpty() ?
pEntry->GetBankSymbol() == aConfiguredCurrencyAbbrev :
pEntry->GetLanguage() == eConfiguredCurrencyLanguage) )
{
- nSecondarySystemCurrencyPosition = nCurrencyPos-1;
+ nSecondarySystemCurrencyPosition = nCurrencyPos;
}
if ( !nMatchingSystemCurrencyPosition &&
pEntry->GetLanguage() == eSysLang )
{
- nMatchingSystemCurrencyPosition = nCurrencyPos-1;
+ nMatchingSystemCurrencyPosition = nCurrencyPos;
}
+ rCurrencyTable.insert(
+ rCurrencyTable.begin() + nCurrencyPos++, std::move(pEntry));
}
}
}
More information about the Libreoffice-commits
mailing list