[Libreoffice-commits] core.git: 2 commits - svl/source
Jochen Nitschke
j.nitschke+logerrit at ok.de
Fri Sep 23 06:56:51 UTC 2016
svl/source/items/itempool.cxx | 19 -------------------
svl/source/items/poolio.cxx | 19 +++++++++++++++++++
svl/source/numbers/zformat.cxx | 4 ++--
3 files changed, 21 insertions(+), 21 deletions(-)
New commits:
commit 70c7e82003a539ed7f7ccbe596bde5ac9031d15c
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date: Thu Sep 22 13:53:57 2016 +0200
move SfxPoolItemArray_Impl::ReHash to poolio.cxx ...
... it's declared in poolio.hxx
Change-Id: I8cc4a7152f66cf89fb01cd7a718974d76825ec04
Reviewed-on: https://gerrit.libreoffice.org/29181
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index eb78949..dca583c 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -730,25 +730,6 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
return *pNewItem;
}
-/// Re-build our free list and pointer hash.
-void SfxPoolItemArray_Impl::ReHash()
-{
- maFree.clear();
- maPtrToIndex.clear();
-
- for (size_t nIdx = 0; nIdx < size(); ++nIdx)
- {
- SfxPoolItem *pItem = (*this)[nIdx];
- if (!pItem)
- maFree.push_back(nIdx);
- else
- {
- maPtrToIndex.insert(std::make_pair(pItem,nIdx));
- assert(maPtrToIndex.find(pItem) != maPtrToIndex.end());
- }
- }
-}
-
void SfxItemPool::Remove( const SfxPoolItem& rItem )
{
assert(!IsPoolDefaultItem(&rItem) && "cannot remove Pool Default");
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 0068fcd..30056e3 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -40,6 +40,25 @@ void SfxPoolItemArray_Impl::clear()
maPtrToIndex.clear();
}
+/// Re-build our free list and pointer hash.
+void SfxPoolItemArray_Impl::ReHash()
+{
+ maFree.clear();
+ maPtrToIndex.clear();
+
+ for (size_t nIdx = 0; nIdx < size(); ++nIdx)
+ {
+ SfxPoolItem *pItem = (*this)[nIdx];
+ if (!pItem)
+ maFree.push_back(nIdx);
+ else
+ {
+ maPtrToIndex.insert(std::make_pair(pItem,nIdx));
+ assert(maPtrToIndex.find(pItem) != maPtrToIndex.end());
+ }
+ }
+}
+
/**
* Returns the <SfxItemPool> that is being saved.
* This should only be used in very exceptional cases e.g.
commit 792da744f3a360b2336fde3c9796e8e22db61308
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date: Thu Sep 22 22:34:15 2016 +0200
Fix Cppcheck report: reduce scope of the variable 'fTemp'
Change-Id: I935de8e287f94f3219542dfe67f7bb4a05be14da
Reviewed-on: https://gerrit.libreoffice.org/29200
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 67f38ee..eb0f048 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2476,13 +2476,13 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
{
sal_uInt64 nBasis = ((sal_uInt64)floor( pow(10.0,rInfo.nCntExp))) - 1; // 9, 99, 999 ,...
sal_uInt64 nFracPrev = 1L, nDivPrev = 0, nFracNext, nDivNext, nPartialDenom;
- double fRemainder = fNumber, fTemp;
+ double fRemainder = fNumber;
// Use continued fraction representation of fNumber
// See https://en.wikipedia.org/wiki/Continued_fraction#Best_rational_approximations
while ( fRemainder > 0.0 )
{
- fTemp = 1.0 / fRemainder; // 64bits precision required when fRemainder is very weak
+ double fTemp = 1.0 / fRemainder; // 64bits precision required when fRemainder is very weak
nPartialDenom = (sal_uInt64) floor(fTemp); // due to floating point notation with double precision
fRemainder = fTemp - (double)nPartialDenom;
nDivNext = nPartialDenom * nDiv + nDivPrev;
More information about the Libreoffice-commits
mailing list