[Libreoffice-commits] .: 2 commits - sot/source
Caolán McNamara
caolan at kemper.freedesktop.org
Thu May 3 08:59:48 PDT 2012
sot/source/sdstor/stgstrms.cxx | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
New commits:
commit cede5686f6b622686f6f5c5a3b69e1af7e086741
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 3 16:59:43 2012 +0100
should have been SAL_WARN
Change-Id: I3f5fd059ecd5b6c4278ffe0f3a2d69b6526d2d01
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index ec57730..88bc416 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -437,7 +437,7 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos )
//subsequent seeks
if (m_aPagesCache.empty())
{
- fprintf(stderr, "kicking off large seek helper\n");
+ SAL_WARN("sot", "kicking off large seek helper\n");
buildPageChainCache();
}
commit 4afd260197d3db27cd7ac46c0e2bff6d4bc84536
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 3 16:59:01 2012 +0100
std::is_sorted is C++11 or C++0X sgi extension
Change-Id: I3039bb172beb21ebafc60a431692b58793cb1538
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 3441b82..ec57730 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -334,6 +334,27 @@ void StgStrm::SetEntry( StgDirEntry& r )
r.SetDirty();
}
+namespace lcl
+{
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
+ using std::is_sorted;
+#else
+ template <typename iter> bool is_sorted(iter aStart, iter aEnd)
+ {
+ if (aStart == aEnd)
+ return true;
+
+ for (iter aNext = aStart + 1; aNext != aEnd; aStart = aNext, ++aNext)
+ {
+ if (*aNext < *aStart)
+ return false;
+ }
+
+ return true;
+ }
+#endif
+}
+
bool StgStrm::buildPageChainCache()
{
if (nSize > 0)
@@ -349,7 +370,7 @@ bool StgStrm::buildPageChainCache()
return false;
}
- m_bSortedPageChain = std::is_sorted(m_aPagesCache.begin(), m_aPagesCache.end());
+ m_bSortedPageChain = lcl::is_sorted(m_aPagesCache.begin(), m_aPagesCache.end());
SAL_WARN_IF(!m_bSortedPageChain, "sot", "unsorted page chain, that's suspicious");
More information about the Libreoffice-commits
mailing list