[Libreoffice-commits] core.git: 2 commits - comphelper/source include/comphelper sw/source

Caolán McNamara caolanm at redhat.com
Mon Oct 6 07:28:57 PDT 2014


 comphelper/source/misc/random.cxx |    4 ++++
 include/comphelper/random.hxx     |    4 ++++
 sw/source/core/bastyp/breakit.cxx |    3 +++
 3 files changed, 11 insertions(+)

New commits:
commit 946ea643185af680508a0333f63c086ed3f454a3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 6 15:27:37 2014 +0100

    Resolves: fdo#84649 can have negative values from ConvertToModelPosition
    
    Change-Id: I570ee54e15a4cd4b11da26004164d9e6a1d8cdb9

diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index 0e3aeea..f3b229c 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -103,6 +103,9 @@ sal_uInt16 SwBreakIt::GetRealScriptOfText( const OUString& rTxt, sal_Int32 nPos
     {
         if( nPos && nPos == rTxt.getLength() )
             --nPos;
+        else if( nPos < 0)
+            nPos = 0;
+
         nScript = xBreak->getScriptType( rTxt, nPos );
         sal_Int32 nChgPos = 0;
         if ( i18n::ScriptType::WEAK == nScript && nPos + 1 < rTxt.getLength() )
commit de78b2ca3c24a822ad9b8456323b9d2210ae0487
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 6 15:26:13 2014 +0100

    when size_t == unsigned int
    
    Change-Id: If8cd3632d69f6456b0e1351efac0e428e0093e3b

diff --git a/comphelper/source/misc/random.cxx b/comphelper/source/misc/random.cxx
index 4fb4a1f..c695ed1 100644
--- a/comphelper/source/misc/random.cxx
+++ b/comphelper/source/misc/random.cxx
@@ -66,6 +66,8 @@ unsigned int uniform_int_distribution(unsigned int a, unsigned int b)
     return dist(theRandomNumberGenerator::get().global_rng);
 }
 
+#if SAL_TYPES_SIZEOFLONG == 8
+
 // uniform size_t [a,b] distribution
 size_t uniform_int_distribution(size_t a, size_t b)
 {
@@ -73,6 +75,8 @@ size_t uniform_int_distribution(size_t a, size_t b)
     return dist(theRandomNumberGenerator::get().global_rng);
 }
 
+#endif
+
 // uniform size_t [a,b) distribution
 double uniform_real_distribution(double a, double b)
 {
diff --git a/include/comphelper/random.hxx b/include/comphelper/random.hxx
index e7051a8..7c149fb 100644
--- a/include/comphelper/random.hxx
+++ b/include/comphelper/random.hxx
@@ -34,9 +34,13 @@ COMPHELPER_DLLPUBLIC int uniform_int_distribution(int a, int b);
 /// uniform distribution in [a,b]
 COMPHELPER_DLLPUBLIC unsigned int uniform_int_distribution(unsigned int a, unsigned int b);
 
+#if SAL_TYPES_SIZEOFLONG == 8
+
 /// uniform distribution in [a,b]
 COMPHELPER_DLLPUBLIC size_t uniform_int_distribution(size_t a, size_t b);
 
+#endif
+
 } // namespace
 
 } // namespace


More information about the Libreoffice-commits mailing list