Index: tools/source/generic/fract.cxx
===================================================================
RCS file: /cvs/util/tools/source/generic/fract.cxx,v
retrieving revision 1.5
retrieving revision 1.5.6.1
diff -u -p -u -p -r1.5 -r1.5.6.1
--- tools/source/generic/fract.cxx	17 Sep 2006 00:55:42 -0000	1.5
+++ tools/source/generic/fract.cxx	21 Sep 2006 08:33:53 -0000	1.5.6.1
@@ -534,22 +534,22 @@ void Fraction::ReduceInaccurate( unsigne
         return;
 
     // Zaehler und Nenner auf den Stack fuer schnelleren Zugriff
-    UINT32 nMul;
-    UINT32 nDiv;
+    unsigned long nMul;
+    unsigned long nDiv;
     BOOL   bNeg;
     if ( nNumerator >= 0 )
     {
-        nMul = (UINT32)nNumerator;
+        nMul = (unsigned long)nNumerator;
         bNeg = FALSE;
     }
     else
     {
-        nMul = (UINT32)(-nNumerator);
+        nMul = (unsigned long)(-nNumerator);
         bNeg = TRUE;
     }
-    nDiv=(UINT32)nDenominator;
+    nDiv=(unsigned long)nDenominator;
 
-    UINT32 a=nMul; unsigned nMulZ=0; // Fuehrende Nullen zaehlen
+    unsigned long a=nMul; unsigned nMulZ=0; // Fuehrende Nullen zaehlen
     while (a<0x00800000) { nMulZ+=8; a<<=8; }
     while (a<0x80000000) { nMulZ++; a<<=1; }
     a=nDiv; unsigned nDivZ=0; // Fuehrende Nullen zaehlen
@@ -557,8 +557,8 @@ void Fraction::ReduceInaccurate( unsigne
     while (a<0x80000000) { nDivZ++; a<<=1; }
     // Anzahl der verwendeten Digits bestimmen
     // Auch hier gehe ich davon aus, dass es sich um 32Bit-Werte handelt
-    int nMulDigits=32-nMulZ;
-    int nDivDigits=32-nDivZ;
+    int nMulDigits=(sizeof(long) * 8)-nMulZ;
+    int nDivDigits=(sizeof(long) * 8)-nDivZ;
     // Nun bestimmen, wieviele Stellen hinten weg koennen
     // Hier koennte man das Ergebnis noch etwas optimieren...
     int nMulWeg=nMulDigits-nSignificantBits; if (nMulWeg<0) nMulWeg=0;
Index: sw/source/core/doc/docfld.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/doc/docfld.cxx,v
retrieving revision 1.27
retrieving revision 1.27.6.1
diff -u -p -u -p -r1.27 -r1.27.6.1
--- sw/source/core/doc/docfld.cxx	16 Sep 2006 20:52:09 -0000	1.27
+++ sw/source/core/doc/docfld.cxx	22 Sep 2006 07:17:12 -0000	1.27.6.1
@@ -1225,7 +1225,7 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, c
 	pMgr->CloseAll(FALSE);
 }
 
-void SwDoc::FldsToCalc( SwCalc& rCalc, ULONG nLastNd, USHORT nLastCnt )
+void SwDoc::FldsToCalc( SwCalc& rCalc, ULONG nLastNd, sal_uInt16 nLastCnt )
 {
 	// erzeuge die Sortierteliste aller SetFelder
 	pUpdtFlds->MakeFldList( *this, mbNewFldLst, GETFLD_CALC );
Index: sw/source/filter/html/swhtml.hxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/html/swhtml.hxx,v
retrieving revision 1.13
retrieving revision 1.13.48.1
diff -u -p -u -p -r1.13 -r1.13.48.1
--- sw/source/filter/html/swhtml.hxx	14 Aug 2006 17:07:18 -0000	1.13
+++ sw/source/filter/html/swhtml.hxx	21 Sep 2006 10:07:58 -0000	1.13.48.1
@@ -438,7 +438,7 @@ class SwHTMLParser : public SfxHTMLParse
 
 	sal_uInt32 	aFontHeights[7];	// die Font-Hoehen 1-7
 	sal_uInt32	nScriptStartLineNr;	// Zeilennummer eines Script-Blocks
-	sal_uInt32					nEventId;
+	ULONG		nEventId;
 
 	sal_uInt16	nBaseFontStMin;		//
 	sal_uInt16	nFontStMin; 		//
Index: sw/source/filter/ww8/ww8scan.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8scan.cxx,v
retrieving revision 1.128
retrieving revision 1.128.6.1
diff -u -p -u -p -r1.128 -r1.128.6.1
--- sw/source/filter/ww8/ww8scan.cxx	16 Sep 2006 22:25:28 -0000	1.128
+++ sw/source/filter/ww8/ww8scan.cxx	21 Sep 2006 09:44:22 -0000	1.128.6.1
@@ -6470,7 +6470,7 @@ WW8Dop::WW8Dop(SvStream& rSt, INT16 nFib
             cDBC = Get_Long( pData );
             cDBCFtnEdn = Get_Long( pData );
 
-            pData += 1 * sizeof( long );
+            pData += 1 * sizeof( INT32);
 
             nfcFtnRef = Get_Short( pData );
             nfcEdnRef = Get_Short( pData );
@@ -6762,7 +6762,7 @@ bool WW8Dop::Write(SvStream& rStrm, WW8F
         Set_UInt32( pData, cDBC );
         Set_UInt32( pData, cDBCFtnEdn );
 
-        pData += 1 * sizeof( long );
+        pData += 1 * sizeof( INT32);
 
         Set_UInt16( pData, nfcFtnRef );
         Set_UInt16( pData, nfcEdnRef );
Index: dtrans/source/X11/X11_selection.cxx
===================================================================
RCS file: /cvs/gsl/dtrans/source/X11/X11_selection.cxx,v
retrieving revision 1.81
retrieving revision 1.81.2.1
diff -u -p -u -p -r1.81 -r1.81.2.1
--- dtrans/source/X11/X11_selection.cxx	17 Sep 2006 16:53:18 -0000	1.81
+++ dtrans/source/X11/X11_selection.cxx	21 Sep 2006 10:05:24 -0000	1.81.2.1
@@ -119,7 +119,7 @@ extern "C"
 }
 
 
-static const int nXdndProtocolRevision = 5;
+static const long nXdndProtocolRevision = 5;
 
 // mapping between mime types (or what the office thinks of mime types)
 // and X convention types
@@ -1341,7 +1341,7 @@ bool SelectionManager::getPasteDataTypes
 	std::vector< Atom > aNativeTypes;
 	if( aAtoms.getLength() )
 	{
-		int nAtoms = aAtoms.getLength() / 4;
+		sal_Int32 nAtoms = aAtoms.getLength() / sizeof(Atom);
 		Atom* pAtoms = (Atom*)aAtoms.getArray();
 		rTypes.realloc( nAtoms );
 		aNativeTypes.resize( nAtoms );
@@ -1460,6 +1460,12 @@ PixmapHolder* SelectionManager::getPixma
     return it->second->m_pPixmap;
 }
 
+static sal_Size GetTrueFormatSize(int nFormat)
+{
+	// http://mail.gnome.org/archives/wm-spec-list/2003-March/msg00067.html
+	return nFormat == 32 ? sizeof(long) : nFormat/8;	
+}
+
 bool SelectionManager::sendData( SelectionAdaptor* pAdaptor,
                                  Window requestor,
                                  Atom target,
@@ -1595,13 +1601,15 @@ bool SelectionManager::sendData( Selecti
             rInc.m_nTransferStartTime	= time( NULL );
 
             // use incr protocol, signal start to requestor
-            int nMinSize = m_nIncrementalThreshold;
+            long nMinSize = m_nIncrementalThreshold;
             XSelectInput( m_pDisplay, requestor, PropertyChangeMask );
             XChangeProperty( m_pDisplay, requestor, property,
                              m_nINCRAtom, 32,  PropModeReplace, (unsigned char*)&nMinSize, 1 );
             XFlush( m_pDisplay );
         }
         else
+        {
+            sal_Size nUnitSize = GetTrueFormatSize(nFormat);
             XChangeProperty( m_pDisplay,
                              requestor,
                              property,
@@ -1609,7 +1617,8 @@ bool SelectionManager::sendData( Selecti
                              nFormat,
                              PropModeReplace,
                              (const unsigned char*)aData.getConstArray(),
-                             aData.getLength()/(nFormat/8) );
+                             aData.getLength()/nUnitSize );
+            }
     }
 #if OSL_DEBUG_LEVEL > 1
     else
@@ -1677,7 +1686,7 @@ bool SelectionManager::handleSelectionRe
 		}
         else if( rRequest.target == m_nTIMESTAMPAtom )
         {
-            sal_uInt32 nTimeStamp = (sal_uInt32)m_aSelections[rRequest.selection]->m_nOrigTimestamp;
+            long nTimeStamp = (long)m_aSelections[rRequest.selection]->m_nOrigTimestamp;
             XChangeProperty( m_pDisplay, rRequest.requestor, rRequest.property,
                              XA_INTEGER, 32, PropModeReplace, (const unsigned char*)&nTimeStamp, 1 );
             aNotify.xselection.property = rRequest.property;
@@ -1907,11 +1916,14 @@ bool SelectionManager::handleReceiveProp
 					 OUStringToOString( getString( nType ), RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
 					 nFormat, nBytes );
 #endif
+	
+			sal_Size nUnitSize = GetTrueFormatSize(nFormat);
+
 			if( it->second->m_eState == Selection::WaitingForData ||
 				it->second->m_eState == Selection::WaitingForResponse )
 			{
 				// copy data
-				it->second->m_aData = Sequence< sal_Int8 >( (sal_Int8*)pData, nItems*nFormat/8 );
+				it->second->m_aData = Sequence< sal_Int8 >( (sal_Int8*)pData, nItems*nUnitSize );
 				it->second->m_eState = Selection::Inactive;
 				it->second->m_aDataArrived.set();
 			}
@@ -1920,9 +1932,9 @@ bool SelectionManager::handleReceiveProp
                 if( nItems )
                 {
                     // append data
-                    Sequence< sal_Int8 > aData( it->second->m_aData.getLength() + nItems*nFormat/8 );
+                    Sequence< sal_Int8 > aData( it->second->m_aData.getLength() + nItems*nUnitSize );
                     memcpy( aData.getArray(), it->second->m_aData.getArray(), it->second->m_aData.getLength() );
-                    memcpy( aData.getArray() + it->second->m_aData.getLength(), pData, nItems*nFormat/8 );
+                    memcpy( aData.getArray() + it->second->m_aData.getLength(), pData, nItems*nUnitSize );
                     it->second->m_aData = aData;
                 }
                 else
@@ -2008,6 +2020,8 @@ bool SelectionManager::handleSendPropert
                          nBytes, nBytes > 32 ? 32 : nBytes,
                          (const unsigned char*)rInc.m_aData.getConstArray()+rInc.m_nBufferPos );
 #endif
+
+				sal_Size nUnitSize = GetTrueFormatSize(rInc.m_nFormat);
                 
                 XChangeProperty( m_pDisplay,
                                  rInc.m_aRequestor,
@@ -2016,7 +2030,7 @@ bool SelectionManager::handleSendPropert
                                  rInc.m_nFormat,
                                  PropModeReplace,
                                  (const unsigned char*)rInc.m_aData.getConstArray()+rInc.m_nBufferPos,
-                                 nBytes/(rInc.m_nFormat/8) );
+                                 nBytes/nUnitSize );
                 rInc.m_nBufferPos += nBytes;
                 rInc.m_nTransferStartTime = nCurrentTime;
 
@@ -2103,7 +2117,8 @@ bool SelectionManager::handleSelectionNo
                                     &pData );
             }
             it->second->m_eState		= Selection::Inactive;
-            it->second->m_aData			= Sequence< sal_Int8 >((sal_Int8*)pData, nFormat/8 * nItems );
+            sal_Size nUnitSize = GetTrueFormatSize(nFormat);
+            it->second->m_aData			= Sequence< sal_Int8 >((sal_Int8*)pData, nItems * nUnitSize);
             it->second->m_aDataArrived.set();
             if( pData )
                 XFree( pData );
Index: vcl/source/gdi/bmpacc.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/gdi/bmpacc.cxx,v
retrieving revision 1.13
retrieving revision 1.13.14.1
diff -u -p -u -p -r1.13 -r1.13.14.1
--- vcl/source/gdi/bmpacc.cxx	17 Sep 2006 11:58:08 -0000	1.13
+++ vcl/source/gdi/bmpacc.cxx	21 Sep 2006 10:00:20 -0000	1.13.14.1
@@ -304,7 +304,7 @@ void BitmapReadAccess::ImplZeroInitUnuse
 			nMask = SWAPLONG( nMask );
 #endif
 			for( sal_uInt32 i = 0; i < nHeight; i++, pLast4Bytes += nScanSize )
-				( *(long*) pLast4Bytes ) &= nMask;
+				( *(sal_uInt32*) pLast4Bytes ) &= nMask;
 		}
 	}
 }
Index: vcl/unx/source/gdi/pspgraphics.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/source/gdi/pspgraphics.cxx,v
retrieving revision 1.20
retrieving revision 1.20.14.1
diff -u -p -u -p -r1.20 -r1.20.14.1
--- vcl/unx/source/gdi/pspgraphics.cxx	17 Sep 2006 12:38:04 -0000	1.20
+++ vcl/unx/source/gdi/pspgraphics.cxx	21 Sep 2006 09:57:00 -0000	1.20.14.1
@@ -66,7 +66,7 @@ class SalPrinterBmp : public psp::Printe
 
     FncGetPixel			mpFncGetPixel;
     Scanline			mpScanAccess;
-    sal_Int32			mnScanOffset;
+    sal_PtrDiff			mnScanOffset;
 
     sal_uInt32			ColorOf (BitmapColor& rColor) const;
     sal_uInt8			GrayOf  (BitmapColor& rColor) const;
Index: jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
===================================================================
RCS file: /cvs/udk/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -p -u -p -r1.11 -r1.11.2.1
--- jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx	16 Sep 2006 17:45:28 -0000	1.11
+++ jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx	21 Sep 2006 09:34:17 -0000	1.11.2.1
@@ -86,7 +86,9 @@ bool GnuInfo::initialize(vector<pair<OUS
         RTL_CONSTASCII_USTRINGPARAM("java.vendor"));
     OUString sVersionProperty(
         RTL_CONSTASCII_USTRINGPARAM("java.version"));
-    OUString sHomeProperty(
+    OUString sJavaHomeProperty(
+        RTL_CONSTASCII_USTRINGPARAM("java.home"));
+    OUString sGNUHomeProperty(
         RTL_CONSTASCII_USTRINGPARAM("gnu.classpath.home.url"));
     OUString sAccessProperty(
         RTL_CONSTASCII_USTRINGPARAM("javax.accessibility.assistive_technologies"));
@@ -94,6 +96,7 @@ bool GnuInfo::initialize(vector<pair<OUS
     bool bVersion = false;
     bool bVendor = false;
     bool bHome = false;
+    bool bJavaHome = false;
     bool bAccess = false;
     
     typedef vector<pair<OUString, OUString> >::const_iterator it_prop;
@@ -109,11 +112,27 @@ bool GnuInfo::initialize(vector<pair<OUS
             m_sVersion = i->second;
             bVersion = true;
         }
-        else if (!bHome && sHomeProperty.equals(i->first))
+        else if (!bHome && sGNUHomeProperty.equals(i->first))
         {
             m_sHome = i->second;
             bHome = true;
         }
+        else if (!bJavaHome && sJavaHomeProperty.equals(i->first))
+        {
+           OUString fileURL;
+           if (osl_getFileURLFromSystemPath(i->second.pData,& fileURL.pData) ==
+               osl_File_E_None)
+           {
+               //make sure that the drive letter have all the same case
+               //otherwise file:///c:/jre and file:///C:/jre produce two
+               //different objects!!!
+               if (makeDriveLetterSame( & fileURL))
+               {
+                   m_sJavaHome = fileURL;
+                   bJavaHome = true;
+               }
+           }
+        }
         else if (!bAccess && sAccessProperty.equals(i->first))
         {
             if (i->second.getLength() > 0)
@@ -128,7 +147,10 @@ bool GnuInfo::initialize(vector<pair<OUS
     }
     if (!bVersion || !bVendor || !bHome)
         return false;
-    
+
+    if (!m_sJavaHome.getLength())
+        m_sJavaHome = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///usr/lib"));
+
     // init m_sRuntimeLibrary
     OSL_ASSERT(m_sHome.getLength());
     //call virtual function to get the possible paths to the runtime library.
@@ -155,7 +177,7 @@ bool GnuInfo::initialize(vector<pair<OUS
 
     if (!bRt)
     {
-        m_sHome = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///usr/lib"));
+        m_sHome = m_sJavaHome;
         for(i_path ip = libpaths.begin(); ip != libpaths.end(); ip++)
         {
             //Construct an absolute path to the possible runtime
Index: jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
===================================================================
RCS file: /cvs/udk/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx,v
retrieving revision 1.4
retrieving revision 1.4.30.1
diff -u -p -u -p -r1.4 -r1.4.30.1
--- jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx	28 Feb 2006 10:31:12 -0000	1.4
+++ jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx	21 Sep 2006 09:34:17 -0000	1.4.30.1
@@ -44,6 +44,8 @@ namespace jfw_plugin
 
 class GnuInfo: public VendorBase
 {
+private:
+    rtl::OUString m_sJavaHome;
 public:
     static char const* const* getJavaExePaths(int * size);
 
