[Libreoffice-commits] .: 2 commits - basic/source oox/source

Tor Lillqvist tml at kemper.freedesktop.org
Thu Sep 15 05:43:14 PDT 2011


 basic/source/app/app.cxx              |    2 --
 oox/source/helper/containerhelper.cxx |    9 ++++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit db2d9b4076d5e15b433d1bdcaed0fe629b78e52b
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Thu Sep 15 15:40:10 2011 +0300

    Fix lower_bound() comparator class problem for MSVC with _DEBUG

diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx
index b4af735..23bad22 100644
--- a/oox/source/helper/containerhelper.cxx
+++ b/oox/source/helper/containerhelper.cxx
@@ -52,7 +52,10 @@ namespace {
 
 struct ValueRangeComp
 {
-    inline bool         operator()( const ValueRange& rRange, sal_Int32 nValue ) const { return rRange.mnLast < nValue; }
+    inline bool operator()( const ValueRange& rLHS, const ValueRange& rRHS ) const
+    {
+        return rLHS.mnLast < rRHS.mnFirst;
+    }
 };
 
 } // namespace
@@ -64,7 +67,7 @@ void ValueRangeSet::insert( const ValueRange& rRange )
     // find the first range that contains or follows the starting point of the passed range
     ValueRangeVector::iterator aBeg = maRanges.begin();
     ValueRangeVector::iterator aEnd = maRanges.end();
-    ValueRangeVector::iterator aIt = ::std::lower_bound( aBeg, aEnd, rRange.mnFirst, ValueRangeComp() );
+    ValueRangeVector::iterator aIt = ::std::lower_bound( aBeg, aEnd, rRange, ValueRangeComp() );
     // nothing to do if found range contains passed range
     if( (aIt != aEnd) && aIt->contains( rRange ) ) return;
     // check if previous range can be used to merge with the passed range
@@ -93,7 +96,7 @@ ValueRangeVector ValueRangeSet::getIntersection( const ValueRange& rRange ) cons
 {
     ValueRangeVector aRanges;
     // find the range that contains nFirst or the first range that follows nFirst
-    ValueRangeVector::const_iterator aIt = ::std::lower_bound( maRanges.begin(), maRanges.end(), rRange.mnFirst, ValueRangeComp() );
+    ValueRangeVector::const_iterator aIt = ::std::lower_bound( maRanges.begin(), maRanges.end(), rRange, ValueRangeComp() );
     for( ValueRangeVector::const_iterator aEnd = maRanges.end(); (aIt != aEnd) && (aIt->mnFirst <= rRange.mnLast); ++aIt )
         aRanges.push_back( ValueRange( ::std::max( aIt->mnFirst, rRange.mnFirst ), ::std::min( aIt->mnLast, rRange.mnLast ) ) );
     return aRanges;
commit 9b5c26fe2d9f25dbbe51e92b0f261dd89072dca9
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Thu Sep 15 15:31:17 2011 +0300

    I think IMPL_GEN_RES_STR is not needed here
    
    It causes duplicate symbols over in automation when linking testool,
    as the same functions that IMPL_GEN_RES_STR expands to also are in the
    sts library.

diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index de61a3e..71a826a 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -84,8 +84,6 @@ using namespace com::sun::star::beans;
 using ::rtl::OUString;
 using ::rtl::OUStringToOString;
 
-IMPL_GEN_RES_STR;
-
 SttResId::SttResId( sal_uInt32 nId ) :
     ResId( nId, *((*(BasicDLL**)GetAppData(SHL_BASIC))->GetSttResMgr()) )
 {


More information about the Libreoffice-commits mailing list