[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.0' - 17 commits - filter/source instsetoo_native/util oox/inc oox/source sal/rtl sd/inc sd/source solenv/inc svl/inc svl/source svx/source tools/source vcl/source vcl/win

Andras Timar andras.timar at collabora.com
Thu Apr 3 05:39:53 PDT 2014


 filter/source/graphicfilter/itiff/lzwdecom.cxx          |   42 +++++--
 instsetoo_native/util/openoffice.lst                    |   24 ++--
 oox/inc/oox/drawingml/shapepropertymap.hxx              |    3 
 oox/inc/oox/drawingml/textbodyproperties.hxx            |    1 
 oox/inc/oox/drawingml/textcharacterproperties.hxx       |    2 
 oox/source/drawingml/fillproperties.cxx                 |    4 
 oox/source/drawingml/shapepropertymap.cxx               |   16 ++
 oox/source/drawingml/textbodyproperties.cxx             |    4 
 oox/source/drawingml/textbodypropertiescontext.cxx      |    4 
 oox/source/drawingml/textcharacterproperties.cxx        |    3 
 oox/source/drawingml/textcharacterpropertiescontext.cxx |    6 -
 oox/source/drawingml/transform2dcontext.cxx             |    3 
 sal/rtl/source/strtmpl.cxx                              |   51 --------
 sd/inc/sdpage.hxx                                       |    2 
 sd/inc/stlpool.hxx                                      |    5 
 sd/source/core/drawdoc3.cxx                             |   40 ++++++
 sd/source/core/sdpage2.cxx                              |   14 --
 sd/source/core/stlpool.cxx                              |   93 +++++++++++++++-
 solenv/inc/minor.mk                                     |    4 
 svl/inc/svl/itemset.hxx                                 |    2 
 svl/source/items/itemset.cxx                            |   23 +++
 svx/source/xoutdev/xattrbmp.cxx                         |    7 -
 tools/source/generic/poly.cxx                           |   17 ++
 vcl/source/gdi/metaact.cxx                              |   41 +++----
 vcl/win/source/gdi/winlayout.cxx                        |   17 ++
 25 files changed, 308 insertions(+), 120 deletions(-)

New commits:
commit 6266a15520282462e6692791856b2756230ca45d
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu Apr 3 05:37:48 2014 -0700

    Bump for 4.0-23
    
    Change-Id: I0b147a43b85de8f0c025abf6abc176e8e185d902

diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index d17ecb8..c25c332 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -33,7 +33,7 @@ Globals
             CREATE_MSP_INSTALLSET 1
             UPDATE_DATABASE_LISTNAME finals_instsetoo.txt
             PACKAGEMAP package_names.txt,package_names_ext.txt
-            WINDOWSPATCHLEVEL 22
+            WINDOWSPATCHLEVEL 23
             OOOVENDOR The Document Foundation
             OOODOWNLOADNAME 1
             BUILDIDCWS {buildidcws}
@@ -50,13 +50,13 @@ LibreOffice
         {
             PRODUCTNAME LibreOffice
             PRODUCTVERSION 4.0
-            PRODUCTEXTENSION -22
+            PRODUCTEXTENSION -23
             POSTVERSIONEXTENSION
             POSTVERSIONEXTENSIONUNIX
             BRANDPACKAGEVERSION 4.0
             USERDIRPRODUCTVERSION 4
             ABOUTBOXPRODUCTVERSION 4.0
-            ABOUTBOXPRODUCTVERSIONSUFFIX :build-322
+            ABOUTBOXPRODUCTVERSIONSUFFIX :build-323
             BASEPRODUCTVERSION 4.0
             PCPFILENAME libreoffice.pcp
             UPDATEURL http://update.libreoffice.org/check.php
@@ -100,14 +100,14 @@ LibreOffice_Dev
         {
             PRODUCTNAME LOdev
             PRODUCTVERSION 4.0
-            PRODUCTEXTENSION -22
+            PRODUCTEXTENSION -23
             UNIXBASISROOTNAME lodev4.0
             POSTVERSIONEXTENSION
             POSTVERSIONEXTENSIONUNIX
             BRANDPACKAGEVERSION 4.0
             USERDIRPRODUCTVERSION 4
             ABOUTBOXPRODUCTVERSION 4.0
-            ABOUTBOXPRODUCTVERSIONSUFFIX :build-322
+            ABOUTBOXPRODUCTVERSIONSUFFIX :build-323
             BASEPRODUCTVERSION 4.0
             DEVELOPMENTPRODUCT 1
             BASISPACKAGEPREFIX lodevbasis
@@ -161,7 +161,7 @@ URE
             PRODUCTVERSION 4.0
             PACKAGEVERSION 4.0
             PACKAGEREVISION 1
-            PRODUCTEXTENSION -22
+            PRODUCTEXTENSION -23
             BRANDPACKAGEVERSION 4.0
             LICENSENAME LGPL
             NOVERSIONINDIRNAME 1
@@ -192,7 +192,7 @@ LibreOffice_SDK
         {
             PRODUCTNAME LibreOffice
             PRODUCTVERSION 4.0
-            PRODUCTEXTENSION -22
+            PRODUCTEXTENSION -23
             POSTVERSIONEXTENSION SDK
             POSTVERSIONEXTENSIONUNIX sdk
             BRANDPACKAGEVERSION 4.0
@@ -231,7 +231,7 @@ LibreOffice_Dev_SDK
         {
             PRODUCTNAME LOdev
             PRODUCTVERSION 4.0
-            PRODUCTEXTENSION -22
+            PRODUCTEXTENSION -23
             UNIXBASISROOTNAME lodev4.0
             POSTVERSIONEXTENSION SDK
             POSTVERSIONEXTENSIONUNIX sdk
@@ -276,7 +276,7 @@ LibreOffice_Test
         {
             PRODUCTNAME LibreOffice
             PRODUCTVERSION 4.0
-            PRODUCTEXTENSION -22
+            PRODUCTEXTENSION -23
             POSTVERSIONEXTENSION TEST
             POSTVERSIONEXTENSIONUNIX test
             BRANDPACKAGEVERSION 4.0
@@ -315,7 +315,7 @@ LibreOffice_Dev_Test
         {
             PRODUCTNAME LOdev
             PRODUCTVERSION 4.0
-            PRODUCTEXTENSION -22
+            PRODUCTEXTENSION -23
             UNIXBASISROOTNAME lodev4.0
             POSTVERSIONEXTENSION TEST
             POSTVERSIONEXTENSIONUNIX test
@@ -359,13 +359,13 @@ OxygenOffice
         {
             PRODUCTNAME OxygenOffice
             PRODUCTVERSION 4.0
-            PRODUCTEXTENSION -22
+            PRODUCTEXTENSION -23
             POSTVERSIONEXTENSION
             POSTVERSIONEXTENSIONUNIX
             BRANDPACKAGEVERSION 4.0
             USERDIRPRODUCTVERSION 4
             ABOUTBOXPRODUCTVERSION 4.0
-            ABOUTBOXPRODUCTVERSIONSUFFIX :build-322
+            ABOUTBOXPRODUCTVERSIONSUFFIX :build-323
             BASEPRODUCTVERSION 4.0
             PCPFILENAME openoffice.pcp
             UPDATEURL http://update.libreoffice.org/check.php
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index 87b14c5..f09795f 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,6 +1,6 @@
 RSCVERSION=400
-RSCREVISION=400m1(Build:322)
-BUILD=322
+RSCREVISION=400m1(Build:323)
+BUILD=323
 LAST_MINOR=m0
 SOURCEVERSION=OOO400
 
commit 4939d0c337e5010ac7d10fa8097e741757cb7e08
Author: Herbert Dürr <hdu at apache.org>
Date:   Thu Mar 27 16:07:37 2014 +0000

    Related: #i124516# handle bad surrogate pairs gracefully on Windows
    
    When running into invalid Unicode surrogate pairs the text layout code on
    Windows ran into massive problems like crashes. This change detects the
    situation of an invalid surrogate pair and falls back to treat it as
    a simple character instead of requesting a complex glyph fallback.
    
    (cherry picked from commit 913f1fc4b1362f6e91595af5ae10c4cba79fd355)
    
    Change-Id: I2988f4b64061d0a5df211f6f0f04b1f235fcd6a5
    (cherry picked from commit 67688d3118b1a361d5dbdaa78e918815c163d75c)

diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 5a55387..e7bdc11 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -385,12 +385,19 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
         bool bSurrogate = ((nCharCode >= 0xD800) && (nCharCode <= 0xDFFF));
         if( bSurrogate )
         {
-            if( nCharCode >= 0xDC00 ) // this part of a surrogate pair was already processed
+            // ignore high surrogates, they were already processed with their low surrogates
+            if( nCharCode >= 0xDC00 )
                 continue;
-            nCharCode = 0x10000 + ((pCodes[0] - 0xD800) << 10) + (pCodes[1] - 0xDC00);
-    }
+            // check the second half of the surrogate pair
+            bSurrogate &= (0xDC00 <= pCodes[1]) && (pCodes[1] <= 0xDFFF);
+            // calculate the UTF-32 code of valid surrogate pairs
+            if( bSurrogate )
+                nCharCode = 0x10000 + ((pCodes[0] - 0xD800) << 10) + (pCodes[1] - 0xDC00);
+            else // or fall back to a replacement character
+                nCharCode = '?';
+        }
 
-        // get the advance width for the current UCS-4 code point
+        // get the advance width for the current UTF-32 code point
         int nGlyphWidth = mrWinFontEntry.GetCachedGlyphWidth( nCharCode );
         if( nGlyphWidth == -1 )
         {
@@ -408,7 +415,7 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
         mpGlyphAdvances[ i ] = nGlyphWidth;
         mnWidth += nGlyphWidth;
 
-        // remaining codes of surrogate pair get a zero width
+        // the second half of surrogate pair gets a zero width
         if( bSurrogate && ((i+1) < mnGlyphCount) )
             mpGlyphAdvances[ i+1 ] = 0;
 
commit 01631edbe40c40c9146f9e165e852edcd96d41af
Author: Jürgen Schmidt <jsc at apache.org>
Date:   Fri Mar 28 10:52:29 2014 +0000

    Resolves: #i124453# check if the resulting polygon...
    
    has already exceeded the number of points (2^16) that can be handled by a tools
    polygon
    
    (cherry picked from commit 804e547d70552fd64e1344d538427f8898824b43)
    
    Change-Id: I437a84493e264f7b650561599170e831da20c9aa
    (cherry picked from commit a9582c05f854cad02710178ab7fa79498573269e)
    (cherry picked from commit ab71a4512557b7290cd7b1b4923463052acf164e)

diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 585e915..6f2805b 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -910,6 +910,19 @@ void Polygon::AdaptiveSubdivide( Polygon& rResult, const double d ) const
             }
 
             *aPointIter++ = mpImplPolygon->mpPointAry[ i++ ];
+
+            if (aPoints.size() >= SAL_MAX_UINT16)
+            {
+                OSL_ENSURE(aPoints.size() < SAL_MAX_UINT16,
+                    "Polygon::AdapativeSubdivision created polygon too many points;"
+                    " using original polygon instead");
+
+                // The resulting polygon can not hold all the points
+                // that we have created so far.  Stop the subdivision
+                // and return a copy of the unmodified polygon.
+                rResult = *this;
+                return;
+            }
         }
 
         // fill result polygon
commit b255c6242bbc636956a785446fc7fa21a21f56b0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 2 09:33:03 2014 +0100

    init a few more stream-read svm elements
    
    (cherry picked from commit 67c6ea0c426c2796fc1b80cbe2cb0347686db90d)
    
    Conflicts:
    	vcl/source/gdi/metaact.cxx
    
    Change-Id: I3dfa2485afbe66131b86764374d53181b55c2346
    (cherry picked from commit 21212a65c5653bdc38cea426710e68ed40c66eb8)

diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 73a93e3..585e915 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1553,7 +1553,7 @@ SvStream& operator>>( SvStream& rIStream, Polygon& rPoly )
     DBG_ASSERTWARNING( rIStream.GetVersion(), "Polygon::>> - Solar-Version not set on rIStream" );
 
     sal_uInt16          i;
-    sal_uInt16          nPoints;
+    sal_uInt16          nPoints(0);
 
     // read all points and create array
     rIStream >> nPoints;
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index c349061..5be33a9 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -982,7 +982,7 @@ void MetaPolyLineAction::Read( SvStream& rIStm, ImplMetaReadData* )
         rIStm >> maLineInfo;
     if ( aCompat.GetVersion() >= 3 )
     {
-        sal_uInt8 bHasPolyFlags;
+        sal_uInt8 bHasPolyFlags(0);
         rIStm >> bHasPolyFlags;
         if ( bHasPolyFlags )
             maPoly.Read( rIStm );
@@ -1164,10 +1164,11 @@ void MetaPolyPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
 
     if ( aCompat.GetVersion() >= 2 )    // Version 2
     {
-        sal_uInt16 i, nIndex, nNumberOfComplexPolygons;
+        sal_uInt16 nNumberOfComplexPolygons(0);
         rIStm >> nNumberOfComplexPolygons;
-        for ( i = 0; i < nNumberOfComplexPolygons; i++ )
+        for (sal_uInt16 i = 0; i < nNumberOfComplexPolygons; ++i)
         {
+            sal_uInt16 nIndex(0);
             rIStm >> nIndex;
             Polygon aPoly;
             aPoly.Read( rIStm );
@@ -1697,18 +1698,20 @@ void MetaTextLineAction::Read( SvStream& rIStm, ImplMetaReadData* )
     COMPAT( rIStm );
 
     //#fdo39428 SvStream no longer supports operator>>(long&)
-    sal_uInt32 nTemp;
-    sal_Int32 nTemp2;
     rIStm >> maPos;
-    rIStm >> nTemp2;
-    mnWidth = nTemp2;
-    rIStm >> nTemp;
-    meStrikeout = (FontStrikeout)nTemp;
-    rIStm >> nTemp;
-    meUnderline = (FontUnderline)nTemp;
+    sal_Int32 nTempWidth(0);
+    rIStm >> nTempWidth;
+    mnWidth = nTempWidth;
+    sal_uInt32 nTempStrikeout(0);
+    rIStm >> nTempStrikeout;
+    meStrikeout = (FontStrikeout)nTempStrikeout;
+    sal_uInt32 nTempUnderline(0);
+    rIStm >> nTempUnderline;
+    meUnderline = (FontUnderline)nTempUnderline;
     if ( aCompat.GetVersion() >= 2 ) {
-        rIStm >> nTemp;
-        meUnderline = (FontUnderline)nTemp;
+        sal_uInt32 nTempUnderline2(0);
+        rIStm >> nTempUnderline2;
+        meUnderline = (FontUnderline)nTempUnderline2;
     }
 }
 
@@ -3357,7 +3360,7 @@ void MetaTextAlignAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
 
 void MetaTextAlignAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
-    sal_uInt16 nTmp16;
+    sal_uInt16 nTmp16(0);
 
     COMPAT( rIStm );
     rIStm >> nTmp16; maAlign = (TextAlign) nTmp16;
@@ -3632,7 +3635,7 @@ void MetaRasterOpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
 
 void MetaRasterOpAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
-    sal_uInt16 nTmp16;
+    sal_uInt16 nTmp16(0);
 
     COMPAT( rIStm );
     rIStm >> nTmp16; meRasterOp = (RasterOp) nTmp16;
@@ -4088,9 +4091,9 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
                 SvMemoryStream  aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
                 SvMemoryStream  aDest;
 
-                sal_Int32 nLeft, nRight, nTop, nBottom;
-                sal_Int32 nPixX, nPixY, nMillX, nMillY;
-                float m11, m12, m21, m22, mdx, mdy;
+                sal_Int32 nLeft(0), nRight(0), nTop(0), nBottom(0);
+                sal_Int32 nPixX(0), nPixY(0), nMillX(0), nMillY(0);
+                float m11(0), m12(0), m21(0), m22(0), mdx(0), mdy(0);
 
                 // read data
                 aMemStm >> nLeft >> nTop >> nRight >> nBottom;
commit f56713e3d1ba966a10b5a39663fb735631947ac8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 2 09:13:37 2014 +0100

    valgrind: Conditional jump or move depends on uninitialised value
    
    Change-Id: I1939d376afe5dd5c67f378ffb2520a066dc99077
    (cherry picked from commit 6efbc4598aea1e87c1569c7beef13d44b1a4202c)
    (cherry picked from commit 1742008dd0d83f3e69b6e09d9e3223d0c5d28096)

diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 9f66f90..73a93e3 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1636,7 +1636,7 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
 
 void Polygon::ImplRead( SvStream& rIStream )
 {
-    sal_uInt8   bHasPolyFlags;
+    sal_uInt8 bHasPolyFlags(0);
 
     rIStream >> *this
              >> bHasPolyFlags;
commit 740c7c69aa91240a86fa4d143048de089fbf90ab
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 2 09:02:19 2014 +0100

    detect add to table beyond MAX_TABLE_SIZE
    
    Change-Id: I9b1357e583620c59898cd7a649a5b39a6d7e3739
    (cherry picked from commit e326b5e06d74685b1853d61c465e5be0b5bf1595)
    (cherry picked from commit 4e2c5ffa89b77e4d6b0a1dc964d330d2ae3636d6)

diff --git a/filter/source/graphicfilter/itiff/lzwdecom.cxx b/filter/source/graphicfilter/itiff/lzwdecom.cxx
index 2fdb054..4ac9d4c 100644
--- a/filter/source/graphicfilter/itiff/lzwdecom.cxx
+++ b/filter/source/graphicfilter/itiff/lzwdecom.cxx
@@ -20,14 +20,16 @@
 
 #include "lzwdecom.hxx"
 
+#define MAX_TABLE_SIZE 4096
+
 LZWDecompressor::LZWDecompressor()
     : pOutBufData(NULL)
 {
     sal_uInt16 i;
 
-    pTable=new LZWTableEntry[4096];
-    pOutBuf=new sal_uInt8[4096];
-    for (i=0; i<4096; i++)
+    pTable=new LZWTableEntry[MAX_TABLE_SIZE];
+    pOutBuf=new sal_uInt8[MAX_TABLE_SIZE];
+    for (i=0; i<MAX_TABLE_SIZE; i++)
     {
         pTable[i].nPrevCode=0;
         pTable[i].nDataCount=1;
@@ -144,6 +146,15 @@ sal_uInt16 LZWDecompressor::GetNextCode()
 
 void LZWDecompressor::AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData)
 {
+    if (nTableSize >= MAX_TABLE_SIZE)
+    {
+        //It might be possible to force emit a 256 to flush the buffer and try
+        //to continue later?
+        SAL_WARN("filter.tiff", "Too much data at scanline");
+        bEOIFound = sal_True;
+        return;
+    }
+
     while (pTable[nCodeFirstData].nDataCount>1)
         nCodeFirstData=pTable[nCodeFirstData].nPrevCode;
 
@@ -160,20 +171,33 @@ void LZWDecompressor::DecompressSome()
     sal_uInt16 i,nCode;
 
     nCode=GetNextCode();
-    if (nCode==256) {
+    if (nCode==256)
+    {
         nTableSize=258;
         nCode=GetNextCode();
-        if (nCode==257) { bEOIFound=sal_True; return; }
+        if (nCode==257)
+        {
+            bEOIFound=sal_True;
+        }
+    }
+    else if (nCode<nTableSize)
+        AddToTable(nOldCode,nCode);
+    else if (nCode==nTableSize)
+        AddToTable(nOldCode,nOldCode);
+    else
+    {
+        bEOIFound=sal_True;
     }
-    else if (nCode<nTableSize) AddToTable(nOldCode,nCode);
-    else if (nCode==nTableSize) AddToTable(nOldCode,nOldCode);
-    else { bEOIFound=sal_True; return; }
+
+    if (bEOIFound)
+        return;
 
     nOldCode=nCode;
 
     nOutBufDataLen=pTable[nCode].nDataCount;
     pOutBufData=pOutBuf+nOutBufDataLen;
-    for (i=0; i<nOutBufDataLen; i++) {
+    for (i=0; i<nOutBufDataLen; i++)
+    {
         *(--pOutBufData)=pTable[nCode].nData;
         nCode=pTable[nCode].nPrevCode;
     }
commit d03f3b2795773070da6b80cdf4e6d05b30aaf35a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 1 16:52:21 2014 +0100

    valgrind: Conditional jump or move depends on uninitialised value
    
    (cherry picked from commit e3dad060929de9beeeed2978f1b1427a91152073)
    
    Conflicts:
    	vcl/source/gdi/metaact.cxx
    
    Change-Id: Ia0b22f7c394d1c2387d1cad7e3d99c79eaeca81a
    (cherry picked from commit a37f474a2272c505778774cd1d92897d8a744863)

diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 448d420..c349061 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1064,7 +1064,7 @@ void MetaPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
 
     if( aCompat.GetVersion() >= 2 )     // Version 2
     {
-        sal_uInt8 bHasPolyFlags;
+        sal_uInt8 bHasPolyFlags(0);
         rIStm >> bHasPolyFlags;
         if ( bHasPolyFlags )
             maPoly.Read( rIStm );
commit 35f3cec61cb33b76a82bee9e4a31a2750a087f36
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Mon Mar 31 15:13:51 2014 +0530

    n#870234: Import gradfill for text colors.
    
    Uses the first color from the gradfill list.
    (Which is better than plain black!)
    
    Ported from: cfc76de83e3c0a56abd30a8f3bd7c69d3500d223
    
    Change-Id: I57a3a54a8053a8ce320acbd02940f10941165d1c

diff --git a/oox/inc/oox/drawingml/textcharacterproperties.hxx b/oox/inc/oox/drawingml/textcharacterproperties.hxx
index 1073fa6..35943da 100644
--- a/oox/inc/oox/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/oox/drawingml/textcharacterproperties.hxx
@@ -24,6 +24,7 @@
 #include "oox/helper/propertymap.hxx"
 #include "oox/drawingml/color.hxx"
 #include "oox/drawingml/textfont.hxx"
+#include "oox/drawingml/fillproperties.hxx"
 
 namespace oox { class PropertySet; }
 
@@ -53,6 +54,7 @@ struct TextCharacterProperties
     OptValue< bool >    moItalic;
     OptValue< bool >    moUnderlineLineFollowText;
     OptValue< bool >    moUnderlineFillFollowText;
+    GradientFillProperties      maGradientProps; /// Properties for gradient text colors
 
     /** Overwrites all members that are explicitly set in rSourceProps. */
     void                assignUsed( const TextCharacterProperties& rSourceProps );
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index bc23204..4800630 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -60,6 +60,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
     moItalic.assignIfUsed( rSourceProps.moItalic );
     moUnderlineLineFollowText.assignIfUsed( rSourceProps.moUnderlineLineFollowText );
     moUnderlineFillFollowText.assignIfUsed( rSourceProps.moUnderlineFillFollowText );
+    maGradientProps.assignUsed( rSourceProps.maGradientProps );
 }
 
 void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter, bool bUseOptional ) const
@@ -93,6 +94,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
 
     if( maCharColor.isUsed() )
         rPropMap[ PROP_CharColor ] <<= maCharColor.getColor( rFilter.getGraphicHelper() );
+    if( maGradientProps.maGradientStops.size() > 0 )
+        rPropMap[ PROP_CharColor ] <<= maGradientProps.maGradientStops.begin()->second.getColor( rFilter.getGraphicHelper() );
 
     if( moLang.has() && !moLang.get().isEmpty() )
     {
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 13af2cd..ec37a07 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -161,6 +161,10 @@ Reference< XFastContextHandler > TextCharacterPropertiesContext::createFastChild
         case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink
             xRet.set( new HyperLinkContext( *this, xAttributes,  mrTextCharacterProperties.maHyperlinkPropertyMap ) );
         break;
+
+        case A_TOKEN( gradFill ):
+            xRet.set( new GradientFillContext( *this, xAttributes, mrTextCharacterProperties.maGradientProps ) );
+        break;
     }
     if( !xRet.is() )
         xRet.set( this );
commit e496a24b444946c0309d3d1144970417e7b0a876
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Mon Mar 31 15:04:31 2014 +0530

    n#862510: anchorCtr controls the anchoring as well.
    
    Ported from: c17eb67460293fbe72ffa8e80cd10743df493afa
    
    Change-Id: I7b5885c3ac9ec30970bdb8b2c9318dc181dda5bd

diff --git a/oox/inc/oox/drawingml/textbodyproperties.hxx b/oox/inc/oox/drawingml/textbodyproperties.hxx
index f8800be..c026b4e 100644
--- a/oox/inc/oox/drawingml/textbodyproperties.hxx
+++ b/oox/inc/oox/drawingml/textbodyproperties.hxx
@@ -34,6 +34,7 @@ struct TextBodyProperties
 {
     PropertyMap                                     maPropertyMap;
     OptValue< sal_Int32 >                           moRotation;
+    bool                                            mbAnchorCtr;
     OptValue< sal_Int32 >                           moVert;
     boost::optional< sal_Int32 >                    moInsets[4];
     boost::optional< sal_Int32 >                    moTextOffX;
diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx
index 36f39d9..9e53897 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -80,8 +80,8 @@ void TextBodyProperties::pushRotationAdjustments( sal_Int32 nRotation )
         // Hack for n#760986
         // TODO: Preferred method would be to have a textbox on top
         // of the shape and the place it according to the (off,ext)
-        if( nOff == 0 && moTextOffX ) nVal = *moTextOffX;
-        if( nOff == 1 && moTextOffY ) nVal = *moTextOffY;
+        if( nOff == 0 && moTextOffX && mbAnchorCtr ) nVal = *moTextOffX;
+        if( nOff == 1 && moTextOffY && mbAnchorCtr ) nVal = *moTextOffY;
         if( nVal < 0 ) nVal = 0;
 
         if( moInsets[i] )
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index 273c5cf..f8e0594 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -61,9 +61,9 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
             mrTextBodyProp.moInsets[i] = GetCoordinate( sValue );
     }
 
-    bool bAnchorCenter = aAttribs.getBool( XML_anchorCtr, false );
+    mrTextBodyProp.mbAnchorCtr = aAttribs.getBool( XML_anchorCtr, false );
     if( xAttributes->hasAttribute( XML_anchorCtr ) ) {
-        if( bAnchorCenter )
+        if( mrTextBodyProp.mbAnchorCtr )
             mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
                 TextHorizontalAdjust_CENTER;
     }
commit d3ce557d214ec8452c905a602ed85adb54e5f4e5
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Mon Mar 31 15:00:13 2014 +0530

    n#862510: Fix text rotation.
    
    Fix breaks document in n#783433 - the one there is
    damaged - resaving it using mso 2010 should fix the problem there.
    Ported from: e3e12b1d1e36e1a0d4fc4c6423b584d677693897
    
    Change-Id: I56fbefa9de6b0714592cc64dffc011b27d1907f4

diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx
index d35c5d3..4976351 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -50,7 +50,8 @@ Transform2DContext::Transform2DContext( ContextHandler& rParent, const Reference
     }
     else
     {
-        mrShape.getTextBody()->getTextProperties().moRotation = aAttributeList.getInteger( XML_rot );
+        if( aAttributeList.hasAttribute( XML_rot ) )
+            mrShape.getTextBody()->getTextProperties().moRotation = -aAttributeList.getInteger( XML_rot ).get();
     }
 }
 
commit 8f0e912cd1b93aff6eb940729971af94fa35e742
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Fri Mar 14 20:03:45 2014 +0530

    n#862510: Ignore baseline attributes with zero.
    
    Ported from 19abfaffe74b925e4428943d14187a7008797982
    
    Change-Id: I5447c16193f7c3e619ce10658c9696014d3d5a22

diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 2119dc6..13af2cd 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -56,7 +56,7 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext(
         mrTextCharacterProperties.moUnderline = aAttribs.getToken( XML_u );
     if ( aAttribs.hasAttribute( XML_strike ) )
         mrTextCharacterProperties.moStrikeout = aAttribs.getToken( XML_strike );
-    if ( aAttribs.hasAttribute( XML_baseline ) )
+    if ( aAttribs.hasAttribute( XML_baseline ) && aAttribs.getInteger( XML_baseline ).get() != 0 )
         mrTextCharacterProperties.moBaseline = aAttribs.getInteger( XML_baseline );
 
 //  mrTextCharacterProperties.moCaseMap     = aAttribs.getToken( XML_cap );
commit c18dfafe5d28bed43398bd6468f5c3ffdc8ba9e8
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Fri Mar 7 13:36:50 2014 +0530

    n#821567: Use BitmapURL only if its valid.
    
    Ported from bf2ff0468e06770f9320c652a2332f7ec137d061

diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index 6f6fe94..77db862 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -720,8 +720,11 @@ bool XFillBitmapItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt
     if( bSetURL )
     {
         GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) );
-        XOBitmap aBMP( aGrafObj );
-        SetBitmapValue( aBMP );
+        if( aGrafObj.GetType() != GRAPHIC_NONE )
+        {
+            XOBitmap aBMP( aGrafObj );
+            SetBitmapValue( aBMP );
+        }
     }
     if( bSetBitmap )
     {
commit 610277bb162227a4481e007323b0e430dfb448fb
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Fri Mar 7 13:30:43 2014 +0530

    n#821567: Import PPTX background images with table-name.
    
    Ported from 2ec4d410de5bd98527336a9dc49abb76656373df

diff --git a/oox/inc/oox/drawingml/shapepropertymap.hxx b/oox/inc/oox/drawingml/shapepropertymap.hxx
index 00f8c4d..8b5e4d7 100644
--- a/oox/inc/oox/drawingml/shapepropertymap.hxx
+++ b/oox/inc/oox/drawingml/shapepropertymap.hxx
@@ -63,6 +63,7 @@ enum ShapePropertyId
     SHAPEPROP_FillBitmapRectanglePoint,
     SHAPEPROP_FillHatch,
     SHAPEPROP_ShadowXDistance,
+    SHAPEPROP_FillBitmapNameFromUrl,
     SHAPEPROP_END
 };
 
@@ -128,6 +129,8 @@ private:
     bool                setGradientTrans( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
     /** Sets an explicit fill bitmap URL, or creates a named fill bitmap URL. */
     bool                setFillBitmapUrl( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+    /** Sets an explicit fill bitmap URL and pushes the name to FillBitmapName */
+    bool                setFillBitmapNameFromUrl( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
 
     // not implemented, to prevent implicit conversion from enum to int
     ::com::sun::star::uno::Any& operator[]( ShapePropertyId ePropId );
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index c4f58a8..5051932 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -393,7 +393,9 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
 
                     OUString aGraphicUrl = rGraphicHelper.createGraphicObject( xGraphic );
                     // push bitmap or named bitmap to property map
-                    if( !aGraphicUrl.isEmpty() && rPropMap.setProperty( SHAPEPROP_FillBitmapUrl, aGraphicUrl ) )
+                    if( !aGraphicUrl.isEmpty() && rPropMap.supportsProperty( SHAPEPROP_FillBitmapNameFromUrl ) && rPropMap.setProperty( SHAPEPROP_FillBitmapNameFromUrl, aGraphicUrl ) )
+                        eFillStyle = FillStyle_BITMAP;
+                    else if( !aGraphicUrl.isEmpty() && rPropMap.setProperty( SHAPEPROP_FillBitmapUrl, aGraphicUrl ) )
                         eFillStyle = FillStyle_BITMAP;
 
                     // set other bitmap properties, if bitmap has been inserted into the map
diff --git a/oox/source/drawingml/shapepropertymap.cxx b/oox/source/drawingml/shapepropertymap.cxx
index c945a53..eb8a5b4 100644
--- a/oox/source/drawingml/shapepropertymap.cxx
+++ b/oox/source/drawingml/shapepropertymap.cxx
@@ -49,7 +49,8 @@ static const sal_Int32 spnDefaultShapeIds[ SHAPEPROP_END ] =
     PROP_FillBitmapURL, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY,
     PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint,
     PROP_FillHatch,
-    PROP_ShadowXDistance
+    PROP_ShadowXDistance,
+    PROP_FillBitmapName
 };
 
 } // namespace
@@ -110,6 +111,9 @@ bool ShapePropertyMap::setAnyProperty( ShapePropertyId ePropId, const Any& rValu
         case SHAPEPROP_FillBitmapUrl:
             return setFillBitmapUrl( nPropId, rValue );
 
+        case SHAPEPROP_FillBitmapNameFromUrl:
+            return setFillBitmapNameFromUrl( nPropId, rValue );
+
         default:;   // suppress compiler warnings
     }
 
@@ -197,6 +201,16 @@ bool ShapePropertyMap::setFillBitmapUrl( sal_Int32 nPropId, const Any& rValue )
     return false;
 }
 
+bool ShapePropertyMap::setFillBitmapNameFromUrl( sal_Int32 /*nPropId*/, const Any& rValue )
+{
+    if( rValue.has< OUString >() )
+    {
+        OUString aBitmapUrlName = mrModelObjHelper.insertFillBitmapUrl( rValue.get< OUString >() );
+        return !aBitmapUrlName.isEmpty() && setProperty( PROP_FillBitmapName, aBitmapUrlName );
+    }
+    return false;
+}
+
 // ============================================================================
 
 } // namespace drawingml
commit 5e6fc9b1ffa55f8d1d1db38caeb411d15f168b2d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 20 09:23:20 2014 +0530

    Stick to a single O[U]String hash function
    
    Ported from: 042725a5dadc9f2c6368ca451b6d20046129b8af
    
    Change-Id: I87f11d9101e21bdadaaffb719a762d0030639cb1

diff --git a/sal/inc/rtl/string.h b/sal/inc/rtl/string.h
index 3def4c1..9f3c69a 100644
--- a/sal/inc/rtl/string.h
+++ b/sal/inc/rtl/string.h
@@ -277,24 +277,6 @@ SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_hashCode(
 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_hashCode_WithLength(
         const sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
 
-/** Return a hash code (64bit) for a string.
-
-    It is not allowed to store the hash code persistently, because later
-    versions could return other hash codes.
-
-    @param str
-    a string.  Need not be null-terminated, but must be at least as long as
-    the specified len.
-
-    @param len
-    the length of the string.
-
-    @return
-    a hash code for the given string.
- */
-SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_str_hashCode64_WithLength(
-        const sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
-
 /** Search for the first occurrence of a character within a string.
 
     The string must be null-terminated.
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index e9a9342..cbd4b9a 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -866,21 +866,6 @@ public:
     }
 
     /**
-      Returns a 64bit hash of the string data.
-      This hashes the entire data, while hashCode would do sampling for larger string sizes.
-
-      @return   a hash code value of the string data
-
-      @see hashCode() for simple hashes
-
-      @since LibreOffice 4.3
-    */
-    sal_uInt64 hashCode64() const SAL_THROW(())
-    {
-        return rtl_str_hashCode64_WithLength( pData->buffer, pData->length );
-    }
-
-    /**
       Returns a hashcode for this string.
 
       @return   a hash code value for this object.
diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h
index 24a7dd8..0352e59 100644
--- a/sal/inc/rtl/ustring.h
+++ b/sal/inc/rtl/ustring.h
@@ -551,24 +551,6 @@ SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_hashCode(
 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_hashCode_WithLength(
         const sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
 
-/** Return a hash code (64bit) for a string.
-
-    It is not allowed to store the hash code persistently, because later
-    versions could return other hash codes.
-
-    @param str
-    a string.  Need not be null-terminated, but must be at least as long as
-    the specified len.
-
-    @param len
-    the length of the string.
-
-    @return
-    a hash code for the given string.
- */
-SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_ustr_hashCode64_WithLength(
-        const sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
-
 /** Search for the first occurrence of a character within a string.
 
     The string must be null-terminated.
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 1f75101..36295116 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -1168,21 +1168,6 @@ public:
     }
 
     /**
-      Returns a 64bit hash of the string data.
-      This hashes the entire data, while hashCode would do sampling for larger string sizes.
-
-      @return   a hash code value of the string data
-
-      @see hashCode() for simple hashes
-
-      @since LibreOffice 4.3
-    */
-    sal_uInt64 hashCode64() const SAL_THROW(())
-    {
-        return rtl_ustr_hashCode64_WithLength( pData->buffer, pData->length );
-    }
-
-    /**
       Returns a hashcode for this string.
 
       @return   a hash code value for this object.
diff --git a/sal/rtl/source/strtmpl.cxx b/sal/rtl/source/strtmpl.cxx
index 60d6064..ba77b86 100644
--- a/sal/rtl/source/strtmpl.cxx
+++ b/sal/rtl/source/strtmpl.cxx
@@ -272,72 +272,18 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode )( const IMPL_RTL_STRCODE* pStr )
 
 /* ----------------------------------------------------------------------- */
 
-sal_uInt64 SAL_CALL IMPL_RTL_STRNAME( hashCode64_WithLength )( const IMPL_RTL_STRCODE* pStr,
-                                                               sal_Int32 nLen )
-    SAL_THROW_EXTERN_C()
-{
-    sal_uInt64 nHash = 0;
-
-    for( sal_Int32 i = 0; i < nLen; i++ )
-        nHash = (nHash << 5) - nHash + *pStr++;
-    return nHash;
-}
-
-/* ----------------------------------------------------------------------- */
-
 sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode_WithLength )( const IMPL_RTL_STRCODE* pStr,
                                                             sal_Int32 nLen )
     SAL_THROW_EXTERN_C()
 {
-    sal_Int32 h = nLen;
-
-    if ( nLen < 256 )
-    {
-        while ( nLen > 0 )
-        {
-            h = (h*37) + IMPL_RTL_USTRCODE( *pStr );
-            pStr++;
-            nLen--;
-        }
-    }
-    else
+    sal_uInt32 h = static_cast<sal_uInt32>(nLen);
+    while ( nLen > 0 )
     {
-        sal_Int32               nSkip;
-        const IMPL_RTL_STRCODE* pEndStr = pStr+nLen-5;
-
-        /* only sample some characters */
-        /* the first 3, some characters between, and the last 5 */
-        h = (h*39) + IMPL_RTL_USTRCODE( *pStr );
+        h = (h*37U) + IMPL_RTL_USTRCODE( *pStr );
         pStr++;
-        h = (h*39) + IMPL_RTL_USTRCODE( *pStr );
-        pStr++;
-        h = (h*39) + IMPL_RTL_USTRCODE( *pStr );
-        pStr++;
-
-        if ( nLen < 32 )
-            nSkip = nLen / 4;
-        else
-            nSkip = nLen / 8;
-        nLen -= 8;
-        while ( nLen > 0 )
-        {
-            h = (h*39) + IMPL_RTL_USTRCODE( *pStr );
-            pStr += nSkip;
-            nLen -= nSkip;
-        }
-
-        h = (h*39) + IMPL_RTL_USTRCODE( *pEndStr );
-        pEndStr++;
-        h = (h*39) + IMPL_RTL_USTRCODE( *pEndStr );
-        pEndStr++;
-        h = (h*39) + IMPL_RTL_USTRCODE( *pEndStr );
-        pEndStr++;
-        h = (h*39) + IMPL_RTL_USTRCODE( *pEndStr );
-        pEndStr++;
-        h = (h*39) + IMPL_RTL_USTRCODE( *pEndStr );
+        nLen--;
     }
-
-    return h;
+    return static_cast<sal_Int32>(h);
 }
 
 /* ----------------------------------------------------------------------- */
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 7ab421f..ade61cd 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -652,12 +652,6 @@ LIBO_UDK_4.0 { # symbols available in >= LibO 4.0
         rtl_uString_newReplaceAllFromIndex;
 } LIBO_UDK_3.6;
 
-LIBO_UDK_4.3 { #symbols available in >= LibO 4.3
-    global:
-         rtl_str_hashCode64_WithLength;
-         rtl_ustr_hashCode64_WithLength;
-} LIBO_UDK_4.2;
-
 PRIVATE_1.0 {
     global:
         osl_detail_ObjectRegistry_storeAddresses;
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 0c99930..422b667 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -382,7 +382,7 @@ public:
     void removeAnnotation( const ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation );
     const sd::AnnotationVector& getAnnotations() const { return maAnnotations; }
     bool hasAnnotations() const { return !maAnnotations.empty(); }
-    sal_uInt64 getHash() const;
+    sal_Int32 getHash() const;
     virtual OString stringify() const;
 
 
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 37b16e2..b1475e6 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -599,9 +599,9 @@ OString SdPage::stringify() const
     return aString.makeStringAndClear();
 }
 
-sal_uInt64 SdPage::getHash() const
+sal_Int32 SdPage::getHash() const
 {
-    return stringify().hashCode64();
+    return stringify().hashCode();
 }
 
 
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index bf8d0c3..ea4d5cf 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -674,7 +674,7 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
             SfxStyleSheetBase* pExistingSheet = Find(aName, eFamily);
             if( pExistingSheet && !rRenameSuffix.isEmpty() )
             {
-                sal_uInt64 nHash = xSheet->GetItemSet().getHash();
+                sal_Int32 nHash = xSheet->GetItemSet().getHash();
                 if( pExistingSheet->GetItemSet().getHash() != nHash )
                 {
                     OUString aTmpName = aName + rRenameSuffix;
diff --git a/svl/inc/svl/itemset.hxx b/svl/inc/svl/itemset.hxx
index 89ad83d..13b6988 100644
--- a/svl/inc/svl/itemset.hxx
+++ b/svl/inc/svl/itemset.hxx
@@ -151,7 +151,7 @@ public:
     virtual SvStream &          Store( SvStream &, bool bDirect = false ) const;
 
     virtual int                 operator==(const SfxItemSet &) const;
-    virtual sal_uInt64          getHash() const;
+    sal_Int32                   getHash() const;
     virtual OString             stringify() const;
 };
 
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 0037552..aa1a0ac 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -2054,9 +2054,9 @@ SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const
 
 // -----------------------------------------------------------------------
 
-sal_uInt64 SfxItemSet::getHash() const
+sal_Int32 SfxItemSet::getHash() const
 {
-    return stringify().hashCode64();
+    return stringify().hashCode();
 }
 
 // -----------------------------------------------------------------------
commit acfe40223bd5f328ba657236392698aee59a6462
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Tue Feb 18 12:49:05 2014 +0530

    String cleanups.
    
    Change-Id: Ia4a9630822678a7b9ea6e5af87e58cfd0ebacff3

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 4b7b072..e9a9342 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -872,6 +872,8 @@ public:
       @return   a hash code value of the string data
 
       @see hashCode() for simple hashes
+
+      @since LibreOffice 4.3
     */
     sal_uInt64 hashCode64() const SAL_THROW(())
     {
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 36295116..1f75101 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -1168,6 +1168,21 @@ public:
     }
 
     /**
+      Returns a 64bit hash of the string data.
+      This hashes the entire data, while hashCode would do sampling for larger string sizes.
+
+      @return   a hash code value of the string data
+
+      @see hashCode() for simple hashes
+
+      @since LibreOffice 4.3
+    */
+    sal_uInt64 hashCode64() const SAL_THROW(())
+    {
+        return rtl_ustr_hashCode64_WithLength( pData->buffer, pData->length );
+    }
+
+    /**
       Returns a hashcode for this string.
 
       @return   a hash code value for this object.
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 83d824c..7ab421f 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -221,7 +221,6 @@ UDK_3_0_0 {
         rtl_str_shortenedCompareIgnoreAsciiCase_WithLength;
         rtl_str_hashCode;
         rtl_str_hashCode_WithLength;
-        rtl_str_hashCode64_WithLength;
         rtl_str_indexOfChar;
         rtl_str_indexOfChar_WithLength;
         rtl_str_indexOfStr;
@@ -653,6 +652,12 @@ LIBO_UDK_4.0 { # symbols available in >= LibO 4.0
         rtl_uString_newReplaceAllFromIndex;
 } LIBO_UDK_3.6;
 
+LIBO_UDK_4.3 { #symbols available in >= LibO 4.3
+    global:
+         rtl_str_hashCode64_WithLength;
+         rtl_ustr_hashCode64_WithLength;
+} LIBO_UDK_4.2;
+
 PRIVATE_1.0 {
     global:
         osl_detail_ObjectRegistry_storeAddresses;
commit 9bf022e4de7050848a05ad7951f2e9607758ba65
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Thu Feb 13 21:54:19 2014 +0530

    n#757432: Styles (rename &) copy to different decks.
    
    Ported from: a4cd841541a729d7b8126d27d91fa28e30b01403
    
    Change-Id: I73ebaec651a195afbf60f5338c487c7750298fef

diff --git a/sd/inc/stlpool.hxx b/sd/inc/stlpool.hxx
index 4833dd8..e5f374f 100644
--- a/sd/inc/stlpool.hxx
+++ b/sd/inc/stlpool.hxx
@@ -82,6 +82,8 @@ public:
     void                CopyTableStyles(SdStyleSheetPool& rSourcePool);
     void                CopyGraphicSheets(SdStyleSheetPool& rSourcePool, SdStyleSheetVector& rCreatedSheets);
     void                CopyCellSheets(SdStyleSheetPool& rSourcePool, SdStyleSheetVector& rCreatedSheets);
+    void                RenameAndCopyGraphicSheets(SdStyleSheetPool& rSourcePool, OUString &rRenameSuffix);
+    void                RenameAndCopyGraphicSheets(SdStyleSheetPool& rSourcePool, SdStyleSheetVector& rCreatedSheets, OUString &rRenameSuffix);
 
     void                CreatePseudosIfNecessary();
     void                UpdateStdNames();
@@ -122,8 +124,11 @@ public:
     virtual void SAL_CALL acquire (void) throw ();
     virtual void SAL_CALL release (void) throw ();
 protected:
+    void RenameAndCopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, SdStyleSheetVector& rCreatedSheets, OUString &rRenameSuffix);
+    void RenameAndCopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, OUString &rRenameSuffix);
     void CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily );
     void CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, SdStyleSheetVector& rCreatedSheets );
+    void CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, SdStyleSheetVector& rCreatedSheets, OUString &rRenameSuffix );
 
     virtual SfxStyleSheetBase* Create(const String& rName, SfxStyleFamily eFamily, sal_uInt16 nMask);
     virtual SfxStyleSheetBase* Create(const SdStyleSheet& rStyle);
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 7f493d8..38663eb 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -385,6 +385,16 @@ lcl_removeUnusedStyles(SfxStyleSheetBasePool* const pStyleSheetPool, SdStyleShee
     rStyles = aUsedStyles;
 }
 
+SfxStyleSheet *lcl_findStyle(SdStyleSheetVector& rStyles, OUString aStyleName)
+{
+    for(SdStyleSheetVector::const_iterator aIt(rStyles.begin()), aLast(rStyles.end()); aIt != aLast; ++aIt)
+    {
+        if(OUString((*aIt)->GetName()).startsWith(aStyleName))
+            return (*aIt).get();
+    }
+    return NULL;
+}
+
 }
 
 sal_Bool SdDrawDocument::InsertBookmarkAsPage(
@@ -545,7 +555,10 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
     // are then removed at the end of the function, where we also create
     // undo records for the inserted styles.
     SdStyleSheetVector aNewGraphicStyles;
-    pStyleSheetPool->CopyGraphicSheets(*pBookmarkStyleSheetPool, aNewGraphicStyles);
+    OUString aRenameStr;
+    if(!bReplace && !bNoDialogs)
+        aRenameStr = OUString("_");
+    pStyleSheetPool->RenameAndCopyGraphicSheets(*pBookmarkStyleSheetPool, aNewGraphicStyles, aRenameStr);
     SdStyleSheetVector aNewCellStyles;
     pStyleSheetPool->CopyCellSheets(*pBookmarkStyleSheetPool, aNewCellStyles);
 
@@ -952,6 +965,31 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
     // Make absolutely sure no double masterpages are there
     RemoveUnnecessaryMasterPages(NULL, sal_True, sal_True);
 
+    // Rename object styles if necessary
+    if(!aRenameStr.isEmpty())
+    {
+        try
+        {
+            for(sal_uInt32 p = nInsertPos; p < (nInsertPos + nBMSdPageCount); p++)
+            {
+                SdPage *pPg = (SdPage *) GetPage(p);
+                for(sal_uIntPtr i = 0; i < pPg->GetObjCount(); i++)
+                {
+                    if(pPg->GetObj(i)->GetStyleSheet())
+                    {
+                        OUString aStyleName = pPg->GetObj(i)->GetStyleSheet()->GetName();
+                        SfxStyleSheet *pSheet = lcl_findStyle(aNewGraphicStyles, aStyleName + aRenameStr);
+                        if(pSheet != NULL)
+                            pPg->GetObj(i)->SetStyleSheet(pSheet, true);
+                    }
+                }
+            }
+        }
+        catch(...)
+        {
+            OSL_FAIL("Exception while renaming styles @ SdDrawDocument::InsertBookmarkAsPage");
+        }
+    }
     // remove copied styles not used on any inserted page and create
     // undo records
     // WARNING: SdMoveStyleSheetsUndoAction clears the passed list of
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 7c06d27..bf8d0c3 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -70,6 +70,34 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::style;
 using namespace ::com::sun::star::container;
 
+namespace
+{
+
+OUString lcl_findRenamedStyleName(std::vector< std::pair< OUString, OUString > > &rRenamedList, OUString aOriginalName )
+{
+    std::vector< std::pair< OUString, OUString > >::iterator aIter;
+    for( aIter = rRenamedList.begin(); aIter != rRenamedList.end(); ++aIter )
+    {
+        if((*aIter).first == aOriginalName )
+            return (*aIter).second;
+    }
+    return OUString();
+}
+
+SfxStyleSheet *lcl_findStyle(SdStyleSheetVector& rStyles, OUString aStyleName)
+{
+    if( aStyleName.isEmpty() )
+        return NULL;
+    for(SdStyleSheetVector::const_iterator aIt(rStyles.begin()), aLast(rStyles.end()); aIt != aLast; ++aIt)
+    {
+        if(OUString((*aIt)->GetName()) == aStyleName)
+            return (*aIt).get();
+    }
+    return NULL;
+}
+
+}
+
 // ----------------------------------------------------------
 
 SdStyleSheetPool::SdStyleSheetPool(SfxItemPool const& _rPool, SdDrawDocument* pDocument)
@@ -521,6 +549,11 @@ void SdStyleSheetPool::CopyGraphicSheets(SdStyleSheetPool& rSourcePool)
     CopySheets( rSourcePool, SD_STYLE_FAMILY_GRAPHICS );
 }
 
+void SdStyleSheetPool::RenameAndCopyGraphicSheets(SdStyleSheetPool& rSourcePool, OUString &rRenameSuffix)
+{
+    RenameAndCopySheets( rSourcePool, SD_STYLE_FAMILY_GRAPHICS, rRenameSuffix );
+}
+
 void SdStyleSheetPool::CopyCellSheets(SdStyleSheetPool& rSourcePool)
 {
     CopySheets( rSourcePool, SD_STYLE_FAMILY_CELL );
@@ -593,19 +626,42 @@ void SdStyleSheetPool::CopyCellSheets(SdStyleSheetPool& rSourcePool, SdStyleShee
     CopySheets( rSourcePool, SD_STYLE_FAMILY_CELL, rCreatedSheets );
 }
 
+void SdStyleSheetPool::RenameAndCopyGraphicSheets(SdStyleSheetPool& rSourcePool, SdStyleSheetVector& rCreatedSheets, OUString &rRenameSuffix)
+{
+    RenameAndCopySheets( rSourcePool, SD_STYLE_FAMILY_GRAPHICS, rCreatedSheets, rRenameSuffix );
+}
+
+void SdStyleSheetPool::RenameAndCopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, OUString &rRenameSuffix)
+{
+    SdStyleSheetVector aTmpSheets;
+    RenameAndCopySheets( rSourcePool, eFamily, aTmpSheets, rRenameSuffix );
+}
+
 void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily )
 {
     SdStyleSheetVector aTmpSheets;
     CopySheets(rSourcePool, eFamily, aTmpSheets);
 }
 
+void SdStyleSheetPool::RenameAndCopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, SdStyleSheetVector& rCreatedSheets, OUString &rRenameSuffix)
+{
+    CopySheets( rSourcePool, eFamily, rCreatedSheets, rRenameSuffix );
+}
+
 void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, SdStyleSheetVector& rCreatedSheets)
 {
+    OUString emptyName;
+    CopySheets(rSourcePool, eFamily, rCreatedSheets, emptyName);
+}
+
+void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, SdStyleSheetVector& rCreatedSheets, OUString& rRenameSuffix)
+{
     String aHelpFile;
 
     sal_uInt32 nCount = rSourcePool.aStyles.size();
 
     std::vector< std::pair< rtl::Reference< SfxStyleSheetBase >, String > > aNewStyles;
+    std::vector< std::pair< OUString, OUString > > aRenamedList;
 
     for (sal_uInt32 n = 0; n < nCount; n++)
     {
@@ -613,8 +669,27 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
 
         if( xSheet->GetFamily() == eFamily )
         {
+            bool bAddToList = false;
             String aName( xSheet->GetName() );
-            if ( !Find( aName, eFamily ) )
+            SfxStyleSheetBase* pExistingSheet = Find(aName, eFamily);
+            if( pExistingSheet && !rRenameSuffix.isEmpty() )
+            {
+                sal_uInt64 nHash = xSheet->GetItemSet().getHash();
+                if( pExistingSheet->GetItemSet().getHash() != nHash )
+                {
+                    OUString aTmpName = aName + rRenameSuffix;
+                    sal_Int32 nSuffix = 1;
+                    do
+                    {
+                        aTmpName = aName + rRenameSuffix + OUString::valueOf(nSuffix);
+                        pExistingSheet = Find(aTmpName, eFamily);
+                        nSuffix++;
+                    } while( pExistingSheet && pExistingSheet->GetItemSet().getHash() != nHash );
+                    aName = aTmpName;
+                    bAddToList = true;
+                }
+            }
+            if ( !pExistingSheet )
             {
                 rtl::Reference< SfxStyleSheetBase > xNewSheet( &Make( aName, eFamily ) );
 
@@ -629,6 +704,13 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
                 xNewSheet->GetItemSet().Put( xSheet->GetItemSet() );
 
                 rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( xNewSheet.get() ) ) );
+                aRenamedList.push_back( std::pair< OUString, OUString >( xSheet->GetName(), aName ) );
+            }
+            else if( bAddToList )
+            {
+                // Add to list - used for renaming
+                rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( pExistingSheet ) ) );
+                aRenamedList.push_back( std::pair< OUString, OUString >( xSheet->GetName(), aName ) );
             }
         }
     }
@@ -637,6 +719,15 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
     std::vector< std::pair< rtl::Reference< SfxStyleSheetBase >, String > >::iterator aIter;
     for( aIter = aNewStyles.begin(); aIter != aNewStyles.end(); ++aIter )
     {
+        if( !rRenameSuffix.isEmpty() )
+        {
+            SfxStyleSheet *pParent = lcl_findStyle(rCreatedSheets, lcl_findRenamedStyleName(aRenamedList, (*aIter).second));
+            if( pParent )
+            {
+                (*aIter).first->SetParent( pParent->GetName() );
+                continue;
+            }
+        }
         DBG_ASSERT( rSourcePool.Find( (*aIter).second, eFamily ), "StyleSheet has invalid parent: Family mismatch" );
         (*aIter).first->SetParent( (*aIter).second );
     }
diff --git a/svl/inc/svl/itemset.hxx b/svl/inc/svl/itemset.hxx
index 47ed7ef..89ad83d 100644
--- a/svl/inc/svl/itemset.hxx
+++ b/svl/inc/svl/itemset.hxx
@@ -151,6 +151,8 @@ public:
     virtual SvStream &          Store( SvStream &, bool bDirect = false ) const;
 
     virtual int                 operator==(const SfxItemSet &) const;
+    virtual sal_uInt64          getHash() const;
+    virtual OString             stringify() const;
 };
 
 // --------------- Inline Implementierungen ------------------------
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index c531048..0037552 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -31,6 +31,7 @@
 
 #include <tools/stream.hxx>
 #include <tools/solar.h>
+#include <rtl/strbuf.hxx>
 
 // STATIC DATA -----------------------------------------------------------
 
@@ -2051,4 +2052,26 @@ SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const
         return bItems ? new SfxAllItemSet(*this) : new SfxAllItemSet(*_pPool);
 }
 
+// -----------------------------------------------------------------------
+
+sal_uInt64 SfxItemSet::getHash() const
+{
+    return stringify().hashCode64();
+}
+
+// -----------------------------------------------------------------------
+
+OString SfxItemSet::stringify() const
+{
+    rtl::OStringBuffer aString(100);
+    SvMemoryStream aStream;
+    OString aLine;
+    SfxItemSet aSet(*this);
+    aSet.InvalidateDefaultItems();
+    aSet.Store(aStream, true);
+    aStream.Flush();
+    aString.append((const char *)aStream.GetData(), aStream.GetEndOfData());
+
+    return aString.makeStringAndClear();
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit bfb7729b9b93f64959afc9c9bf77ac665ea40abc
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Thu Feb 13 21:49:18 2014 +0530

    Move string hash function into String class.
    
    Change-Id: If229f3a8c4b4fd1e5f0c28618e29eded7b7853da

diff --git a/sal/inc/rtl/string.h b/sal/inc/rtl/string.h
index 9f3c69a..3def4c1 100644
--- a/sal/inc/rtl/string.h
+++ b/sal/inc/rtl/string.h
@@ -277,6 +277,24 @@ SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_hashCode(
 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_hashCode_WithLength(
         const sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
 
+/** Return a hash code (64bit) for a string.
+
+    It is not allowed to store the hash code persistently, because later
+    versions could return other hash codes.
+
+    @param str
+    a string.  Need not be null-terminated, but must be at least as long as
+    the specified len.
+
+    @param len
+    the length of the string.
+
+    @return
+    a hash code for the given string.
+ */
+SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_str_hashCode64_WithLength(
+        const sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
+
 /** Search for the first occurrence of a character within a string.
 
     The string must be null-terminated.
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index cbd4b9a..4b7b072 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -866,6 +866,19 @@ public:
     }
 
     /**
+      Returns a 64bit hash of the string data.
+      This hashes the entire data, while hashCode would do sampling for larger string sizes.
+
+      @return   a hash code value of the string data
+
+      @see hashCode() for simple hashes
+    */
+    sal_uInt64 hashCode64() const SAL_THROW(())
+    {
+        return rtl_str_hashCode64_WithLength( pData->buffer, pData->length );
+    }
+
+    /**
       Returns a hashcode for this string.
 
       @return   a hash code value for this object.
diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h
index 0352e59..24a7dd8 100644
--- a/sal/inc/rtl/ustring.h
+++ b/sal/inc/rtl/ustring.h
@@ -551,6 +551,24 @@ SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_hashCode(
 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_hashCode_WithLength(
         const sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
 
+/** Return a hash code (64bit) for a string.
+
+    It is not allowed to store the hash code persistently, because later
+    versions could return other hash codes.
+
+    @param str
+    a string.  Need not be null-terminated, but must be at least as long as
+    the specified len.
+
+    @param len
+    the length of the string.
+
+    @return
+    a hash code for the given string.
+ */
+SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_ustr_hashCode64_WithLength(
+        const sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
+
 /** Search for the first occurrence of a character within a string.
 
     The string must be null-terminated.
diff --git a/sal/rtl/source/strtmpl.cxx b/sal/rtl/source/strtmpl.cxx
index b303e10..60d6064 100644
--- a/sal/rtl/source/strtmpl.cxx
+++ b/sal/rtl/source/strtmpl.cxx
@@ -272,6 +272,19 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode )( const IMPL_RTL_STRCODE* pStr )
 
 /* ----------------------------------------------------------------------- */
 
+sal_uInt64 SAL_CALL IMPL_RTL_STRNAME( hashCode64_WithLength )( const IMPL_RTL_STRCODE* pStr,
+                                                               sal_Int32 nLen )
+    SAL_THROW_EXTERN_C()
+{
+    sal_uInt64 nHash = 0;
+
+    for( sal_Int32 i = 0; i < nLen; i++ )
+        nHash = (nHash << 5) - nHash + *pStr++;
+    return nHash;
+}
+
+/* ----------------------------------------------------------------------- */
+
 sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode_WithLength )( const IMPL_RTL_STRCODE* pStr,
                                                             sal_Int32 nLen )
     SAL_THROW_EXTERN_C()
diff --git a/sal/util/sal.map b/sal/util/sal.map
index ade61cd..83d824c 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -221,6 +221,7 @@ UDK_3_0_0 {
         rtl_str_shortenedCompareIgnoreAsciiCase_WithLength;
         rtl_str_hashCode;
         rtl_str_hashCode_WithLength;
+        rtl_str_hashCode64_WithLength;
         rtl_str_indexOfChar;
         rtl_str_indexOfChar_WithLength;
         rtl_str_indexOfStr;
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index f61cab0..37b16e2 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -54,16 +54,6 @@ using namespace ::com::sun::star::office;
 
 extern void NotifyDocumentEvent( SdDrawDocument* pDocument, const rtl::OUString& rEventName, const Reference< XInterface >& xSource );
 
-static sal_uInt64 lcl_getHash( OString aString )
-{
-    sal_Int32  len = aString.getLength();
-    sal_uInt64 nHash = 0;
-
-    for( sal_Int32 i = 0; i < len; i++ )
-        nHash = (nHash << 5) - nHash + aString[i];
-    return nHash;
-}
-
 /*************************************************************************
 |*
 |* SetPresentationLayout, setzt: Layoutnamen, Masterpage-Verkn�pfung und
@@ -611,7 +601,7 @@ OString SdPage::stringify() const
 
 sal_uInt64 SdPage::getHash() const
 {
-    return lcl_getHash( stringify() );
+    return stringify().hashCode64();
 }
 
 


More information about the Libreoffice-commits mailing list