rpms/openoffice.org/F-11 openoffice.org-2.0.0.ooo46270.svx.search-dialog.no-find-all-in-draw.patch, NONE, 1.1 openoffice.org-3.1.0.ooo102061.sc.cellanchoring.patch, NONE, 1.1 openoffice.org-3.1.0.ooo102142.sd.resleak.patch, NONE, 1.1 openoffice.org-3.1.0.ooo104280.xmloff.lcl_IsAtEnd.wrong.patch, NONE, 1.1 openoffice.org-3.1.1.ooo104157.svx.crashonencryptparse.patch, NONE, 1.1 workspace.calc51.patch, NONE, 1.1 workspace.cmcfixes59.patch, NONE, 1.1 workspace.cmcfixes60.patch, NONE, 1.1 workspace.cmcfixes61.patch, NONE, 1.1 workspace.cmcfixes62.patch, NONE, 1.1 workspace.defaultdoclang.patch, NONE, 1.1 workspace.dr72.patch, NONE, 1.1 workspace.evoab2def.patch, NONE, 1.1 workspace.hb32bugs01.patch, NONE, 1.1 workspace.impress171.patch, NONE, 1.1 workspace.impress174.patch, NONE, 1.1 workspace.kso32fixes.patch, NONE, 1.1 workspace.locales32.patch, NONE, 1.1 workspace.sb113.patch, NONE, 1.1 workspace.unifypaper01.patch, NONE, 1.1 workspace.vcl103.patch, NONE, 1.1 workspace.vcl104.patch, NONE, 1.1 openoffice.org.spec, 1.1930, 1.1931 sources, 1.362, 1.363 openoffice.org-2.2.0.ooo63159.sal.dtype.patch, 1.4, NONE openoffice.org-2.2.0.ooo76393.sal.dynamicsection.patch, 1.3, NONE openoffice.org-3.0.0.ooo88033.svx.a11ycrash.patch, 1.1, NONE openoffice.org-3.1.0.ooo100353.svx.rtfbrackets.patch, 1.1, NONE openoffice.org-3.1.0.ooo100469.sal.ia64_arm.patch, 1.1, NONE openoffice.org-3.1.0.ooo101074.sd.bad.nothrow.patch, 1.1, NONE openoffice.org-3.1.0.ooo101105.sw.reorder.boundscheck.patch, 1.1, NONE openoffice.org-3.1.0.ooo101379.vcl.qstart.SM.patch, 1.1, NONE openoffice.org-3.1.0.ooo101439.connectivity.evodupl.patch, 1.1, NONE openoffice.org-3.1.0.ooo101566.svtools.nodefaultwmfwidth.patch, 1.1, NONE openoffice.org-3.1.0.ooo102566.sc.less.frenetic.progress.patch, 1.1, NONE openoffice.org-3.1.0.ooo102920.i18npool.utf16bustage.patch, 1.1, NONE openoffice.org-3.1.0.ooo103277.vcl.kwinworkaround.patch, 1.1, NONE openoffice.org-3.1.0.ooo103651.canvas.nosubpixel.patch, 1.1, NONE openoffice.org-3.1.0.ooo99250.sc.autooutline-reflists.patch, 1.3, NONE openoffice.org-3.1.0.oooXXXXX.svx.64bit.patch, 1.2, NONE openoffice.org-3.1.1.ooo102932.sw.mailmerge.busted-integer-conversion.patch, 1.1, NONE openoffice.org-3.1.1.ooo104306.moverecentlyused.patch, 1.1, NONE planned.workspace.defaultdoclang.patch, 1.10, NONE workspace.aw073.patch, 1.1, NONE workspace.calc311fixes.patch, 1.1, NONE workspace.pdfextfix02.patch, 1.1, NONE workspace.sb109.patch, 1.1, NONE

Caolan McNamara caolanm at fedoraproject.org
Fri Aug 28 09:43:32 UTC 2009


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8510

Modified Files:
	openoffice.org.spec sources 
Added Files:
	openoffice.org-2.0.0.ooo46270.svx.search-dialog.no-find-all-in-draw.patch 
	openoffice.org-3.1.0.ooo102061.sc.cellanchoring.patch 
	openoffice.org-3.1.0.ooo102142.sd.resleak.patch 
	openoffice.org-3.1.0.ooo104280.xmloff.lcl_IsAtEnd.wrong.patch 
	openoffice.org-3.1.1.ooo104157.svx.crashonencryptparse.patch 
	workspace.calc51.patch workspace.cmcfixes59.patch 
	workspace.cmcfixes60.patch workspace.cmcfixes61.patch 
	workspace.cmcfixes62.patch workspace.defaultdoclang.patch 
	workspace.dr72.patch workspace.evoab2def.patch 
	workspace.hb32bugs01.patch workspace.impress171.patch 
	workspace.impress174.patch workspace.kso32fixes.patch 
	workspace.locales32.patch workspace.sb113.patch 
	workspace.unifypaper01.patch workspace.vcl103.patch 
	workspace.vcl104.patch 
Removed Files:
	openoffice.org-2.2.0.ooo63159.sal.dtype.patch 
	openoffice.org-2.2.0.ooo76393.sal.dynamicsection.patch 
	openoffice.org-3.0.0.ooo88033.svx.a11ycrash.patch 
	openoffice.org-3.1.0.ooo100353.svx.rtfbrackets.patch 
	openoffice.org-3.1.0.ooo100469.sal.ia64_arm.patch 
	openoffice.org-3.1.0.ooo101074.sd.bad.nothrow.patch 
	openoffice.org-3.1.0.ooo101105.sw.reorder.boundscheck.patch 
	openoffice.org-3.1.0.ooo101379.vcl.qstart.SM.patch 
	openoffice.org-3.1.0.ooo101439.connectivity.evodupl.patch 
	openoffice.org-3.1.0.ooo101566.svtools.nodefaultwmfwidth.patch 
	openoffice.org-3.1.0.ooo102566.sc.less.frenetic.progress.patch 
	openoffice.org-3.1.0.ooo102920.i18npool.utf16bustage.patch 
	openoffice.org-3.1.0.ooo103277.vcl.kwinworkaround.patch 
	openoffice.org-3.1.0.ooo103651.canvas.nosubpixel.patch 
	openoffice.org-3.1.0.ooo99250.sc.autooutline-reflists.patch 
	openoffice.org-3.1.0.oooXXXXX.svx.64bit.patch 
	openoffice.org-3.1.1.ooo102932.sw.mailmerge.busted-integer-conversion.patch 
	openoffice.org-3.1.1.ooo104306.moverecentlyused.patch 
	planned.workspace.defaultdoclang.patch workspace.aw073.patch 
	workspace.calc311fixes.patch workspace.pdfextfix02.patch 
	workspace.sb109.patch 
Log Message:
update to 3.1.1

openoffice.org-2.0.0.ooo46270.svx.search-dialog.no-find-all-in-draw.patch:
 srchdlg.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- NEW FILE openoffice.org-2.0.0.ooo46270.svx.search-dialog.no-find-all-in-draw.patch ---
Index: svx/source/dialog/srchdlg.cxx
===================================================================
--- svx/source/dialog/srchdlg.cxx	(revision 272843)
+++ svx/source/dialog/srchdlg.cxx	(working copy)
@@ -873,6 +873,18 @@
         pMoreBtn->AddWindow( &aNoFormatBtn );
     }
 
+    if (bDrawApp || bImpressApp)
+    {
+        // "Find All" button is hidden--align "Find" vertically to the
+        // search listbox
+        Point aNewPt(aSearchBtn.GetPosPixel());
+        const Size aBtnSz(aSearchBtn.GetSizePixel());
+        const Size aLBSz(aSearchLB.GetSizePixel());
+        const int nOff((aLBSz.Height() - aBtnSz.Height()) / 2);
+        aNewPt.Y() = aSearchLB.GetPosPixel().Y() + nOff;
+        aSearchBtn.SetPosPixel(aNewPt);
+    }
+
     if ( bDrawApp )
     {
         // Draw App: "Regular expressions" and "Search for Styles" check boxes are hidden
@@ -1058,6 +1070,8 @@
 
 		if ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_DRAW )
 		{
+            aSearchAllBtn.Hide();
+
 			aRegExpBtn.Hide();
 			aLayoutBtn.Hide();
 

openoffice.org-3.1.0.ooo102061.sc.cellanchoring.patch:
 inc/document.hxx                                |    4 
 inc/drwlayer.hxx                                |   11 
 inc/userdat.hxx                                 |    5 
 source/core/data/documen3.cxx                   |    4 
 source/core/data/drwlayer.cxx                   |  373 +++++++++++-------------
 source/core/data/postit.cxx                     |    1 
 source/core/tool/detfunc.cxx                    |    5 
 source/filter/xml/XMLExportIterator.hxx         |    2 
 source/filter/xml/XMLTableShapeImportHelper.cxx |   58 +--
 source/filter/xml/XMLTableShapeResizer.cxx      |  298 ++-----------------
 source/filter/xml/XMLTableShapeResizer.hxx      |   37 --
 source/filter/xml/xmlexprt.cxx                  |   60 ---
 source/filter/xml/xmlimprt.cxx                  |    2 
 source/filter/xml/xmlsubti.cxx                  |   10 
 source/filter/xml/xmlsubti.hxx                  |   13 
 source/ui/Accessibility/AccessibleDocument.cxx  |   32 --
 source/ui/drawfunc/drawsh2.cxx                  |    2 
 source/ui/drawfunc/drawsh5.cxx                  |   10 
 source/ui/inc/drawview.hxx                      |    5 
 source/ui/unoobj/shapeuno.cxx                   |   63 +---
 source/ui/view/drawvie3.cxx                     |   43 ++
 source/ui/view/drawview.cxx                     |   37 --
 22 files changed, 382 insertions(+), 693 deletions(-)

--- NEW FILE openoffice.org-3.1.0.ooo102061.sc.cellanchoring.patch ---
diff -ru sc.orig/inc/document.hxx sc/inc/document.hxx
--- sc.orig/inc/document.hxx	2009-06-04 12:39:48.000000000 +0100
+++ sc/inc/document.hxx	2009-06-04 12:40:23.000000000 +0100
@@ -1319,8 +1319,8 @@
 	void			RestorePrintRanges( const ScPrintRangeSaver& rSaver );
 
 	SC_DLLPUBLIC Rectangle		GetMMRect( SCCOL nStartCol, SCROW nStartRow,
-								SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
-	SC_DLLPUBLIC ScRange			GetRange( SCTAB nTab, const Rectangle& rMMRect );
+								SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const;
+	SC_DLLPUBLIC ScRange			GetRange( SCTAB nTab, const Rectangle& rMMRect ) const;
 
 	void			UpdStlShtPtrsFrmNms();
 	void			StylesToNames();
diff -ru sc.orig/inc/drwlayer.hxx sc/inc/drwlayer.hxx
--- sc.orig/inc/drwlayer.hxx	2009-06-04 12:39:49.000000000 +0100
+++ sc/inc/drwlayer.hxx	2009-06-04 12:40:23.000000000 +0100
@@ -110,13 +110,11 @@
 	BOOL			bHyphenatorSet;
 
 private:
-	void			MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, const Point& rMove,
-								const Point& rTopLeft );
 	void			MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
 								SCsCOL nDx,SCsROW nDy );
 
 	void			RecalcPos( SdrObject* pObj,
-                        const ScDrawObjData& rData,
+                        ScDrawObjData& rData,
                         const ScAddress& rOldStart,
                         const ScAddress& rOldEnd,
                         bool bNegativePage );
@@ -201,8 +199,11 @@
 	void			EnsureGraphicNames();
 
 	// Verankerung setzen und ermitteln
-	static void		SetAnchor( SdrObject*, ScAnchorType );
-	static ScAnchorType	GetAnchor( const SdrObject* );
+	static void		SetPageAnchored( SdrObject& );
+	static void		SetCellAnchored( SdrObject&, const ScDrawObjData &rAnchor );
+	static void		SetCellAnchoredFromPosition( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab );
+	static void		UpdateCellAnchorFromPositionEnd( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab );
+	static ScAnchorType	GetAnchorType( const SdrObject& );
 
 	// Positionen fuer Detektivlinien
 	static ScDrawObjData* GetObjData( SdrObject* pObj, BOOL bCreate=FALSE );
diff -ru sc.orig/inc/userdat.hxx sc/inc/userdat.hxx
--- sc.orig/inc/userdat.hxx	2009-06-04 12:39:49.000000000 +0100
+++ sc/inc/userdat.hxx	2009-06-04 12:40:23.000000000 +0100
@@ -63,12 +63,15 @@
 public:
     ScAddress           maStart;
     ScAddress           maEnd;
+    Point               maStartOffset;
+    Point               maEndOffset;
     bool                mbNote;
+    Rectangle           maLastRect;
 
     explicit            ScDrawObjData();
 
 private:
-	virtual ScDrawObjData* Clone( SdrObject* pObj ) const;
+     virtual ScDrawObjData* Clone( SdrObject* pObj ) const;
 };
 
 //-------------------------------------------------------------------------
diff -ru sc.orig/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx
--- sc.orig/source/core/data/documen3.cxx	2009-06-04 12:39:09.000000000 +0100
+++ sc/source/core/data/documen3.cxx	2009-06-04 12:40:23.000000000 +0100
@@ -1510,7 +1510,7 @@
 	aEmbedRange = ScRange();
 }
 
-ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect )
+ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) const
 {
 	ScTable* pTable = pTab[nTab];
 	if (!pTable)
@@ -1801,7 +1801,7 @@
 }
 
 Rectangle ScDocument::GetMMRect( SCCOL nStartCol, SCROW nStartRow,
-								SCCOL nEndCol, SCROW nEndRow, SCTAB nTab )
+								SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const
 {
 	if (!ValidTab(nTab) || !pTab[nTab])
 	{
diff -ru sc.orig/source/core/data/drwlayer.cxx sc/source/core/data/drwlayer.cxx
--- sc.orig/source/core/data/drwlayer.cxx	2009-06-04 12:39:09.000000000 +0100
+++ sc/source/core/data/drwlayer.cxx	2009-06-05 12:28:12.000000000 +0100
@@ -69,6 +69,9 @@
 #include <vcl/svapp.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+
 #include "drwlayer.hxx"
 #include "drawpage.hxx"
 #include "global.hxx"
@@ -526,7 +529,41 @@
 	}
 }
 
-void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData,
+namespace
+{
+    //Can't have a zero width dimension
+    Rectangle lcl_makeSafeRectangle(const Rectangle &rNew)
+    {
+        Rectangle aRect = rNew;
+        if (aRect.Bottom() == aRect.Top())
+            aRect.Bottom() = aRect.Top()+1;
+        if (aRect.Right() == aRect.Left())
+            aRect.Right() = aRect.Left()+1;
+        return aRect;
+    }
+
+    Point lcl_calcAvailableDiff(ScDocument &rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const Point &aWantedDiff)
+    {
+        Point aAvailableDiff(aWantedDiff);
+        long nHeight = rDoc.GetRowHeight( nRow, nTab ) * HMM_PER_TWIPS;
+        long nWidth = rDoc.GetColWidth( nCol, nTab ) * HMM_PER_TWIPS;
+        if (aAvailableDiff.Y() > nHeight)
+            aAvailableDiff.Y() = nHeight;
+        if (aAvailableDiff.X() > nWidth)
+            aAvailableDiff.X() = nWidth;
+        return aAvailableDiff;
+    }
+
+    Rectangle lcl_UpdateCalcPoly(basegfx::B2DPolygon &rCalcPoly, int nWhichPoint, const Point &rPos)
+    {
+        rCalcPoly.setB2DPoint(nWhichPoint, basegfx::B2DPoint(rPos.X(), rPos.Y()));
+        basegfx::B2DRange aRange(basegfx::tools::getRange(rCalcPoly));
+        return Rectangle(aRange.getMinX(), aRange.getMinY(),
+            aRange.getMaxX(), aRange.getMaxY());
+    }
+}
+
+void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData,
         const ScAddress& rOldStart, const ScAddress& /*rOldEnd*/, bool bNegativePage )
 {
 	DBG_ASSERT( pDoc, "ScDrawLayer::RecalcPos - missing document" );
@@ -562,6 +599,8 @@
 
 	if( bCircle )
 	{
+		rData.maLastRect = pObj->GetLogicRect();
+
 		Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
 		TwipsToMM( aPos.X() );
 		TwipsToMM( aPos.Y() );
@@ -582,11 +621,18 @@
 		{
 			if (bRecording)
 				AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
-			pObj->SetLogicRect(aRect);
+			rData.maLastRect = lcl_makeSafeRectangle(aRect);
+			pObj->SetLogicRect(rData.maLastRect);
 		}
 	}
 	else if( bArrow )
 	{
+		rData.maLastRect = pObj->GetLogicRect();
+		basegfx::B2DPolygon aCalcPoly;
+		Point aOrigStartPos(pObj->GetPoint(0));
+		Point aOrigEndPos(pObj->GetPoint(1));
+		aCalcPoly.append(basegfx::B2DPoint(aOrigStartPos.X(), aOrigStartPos.Y()));
+		aCalcPoly.append(basegfx::B2DPoint(aOrigEndPos.X(), aOrigEndPos.Y()));
 		//!	nicht mehrere Undos fuer ein Objekt erzeugen (hinteres kann dann weggelassen werden)
 
 		if( bValid1 )
@@ -605,6 +651,8 @@
 			{
 				if (bRecording)
 					AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+
+				rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 0, aStartPos);
 				pObj->SetPoint( aStartPos, 0 );
 			}
 
@@ -619,6 +667,8 @@
 				{
 					if (bRecording)
 						AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+
+					rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 1, aEndPos);
 					pObj->SetPoint( aEndPos, 1 );
 				}
 			}
@@ -639,6 +689,8 @@
 			{
 				if (bRecording)
 					AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+
+				rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 1, aEndPos);
 				pObj->SetPoint( aEndPos, 1 );
 			}
 
@@ -655,45 +707,68 @@
 				{
 					if (bRecording)
 						AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+
+					rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 0, aStartPos);
 					pObj->SetPoint( aStartPos, 0 );
 				}
 			}
 		}
 	}
-	else								// Referenz-Rahmen
+	else
 	{
+		bool bCanResize = bValid2 && !pObj->IsResizeProtect();
+
+		//First time positioning, must be able to at least move it
+		if (rData.maLastRect.IsEmpty())
+			rData.maLastRect = pObj->GetLogicRect();
+
 		DBG_ASSERT( bValid1, "ScDrawLayer::RecalcPos - invalid start position" );
 		Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
 		TwipsToMM( aPos.X() );
 		TwipsToMM( aPos.Y() );
+		aPos += lcl_calcAvailableDiff(*pDoc, nCol1, nRow1, nTab1, rData.maStartOffset);
 
-		if( bValid2 )
+		if( bCanResize )
 		{
-			Point aEnd( pDoc->GetColOffset( nCol2 + 1, nTab2 ), pDoc->GetRowOffset( nRow2 + 1, nTab2 ) );
+			Point aEnd( pDoc->GetColOffset( nCol2, nTab2 ), pDoc->GetRowOffset( nRow2, nTab2 ) );
 			TwipsToMM( aEnd.X() );
 			TwipsToMM( aEnd.Y() );
+			aEnd += lcl_calcAvailableDiff(*pDoc, nCol2, nRow2, nTab2, rData.maEndOffset);
 
 			Rectangle aNew( aPos, aEnd );
 			if ( bNegativePage )
 				MirrorRectRTL( aNew );
 			if ( pObj->GetLogicRect() != aNew )
 			{
+				Rectangle aOld(pObj->GetLogicRect());
+
 				if (bRecording)
 					AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
-				pObj->SetLogicRect(aNew);
+			    rData.maLastRect = lcl_makeSafeRectangle(aNew);
+			    pObj->SetLogicRect(rData.maLastRect);
 			}
 		}
 		else
 		{
 			if ( bNegativePage )
-				aPos.X() = -aPos.X();
+				aPos.X() = -aPos.X() - rData.maLastRect.GetWidth();
 			if ( pObj->GetRelativePos() != aPos )
 			{
 				if (bRecording)
 					AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+				rData.maLastRect.SetPos( aPos );
 				pObj->SetRelativePos( aPos );
 			}
 		}
+
+		/*
+		 * If we were not allowed resize the object, then the end cell anchor
+		 * is possibly incorrect now, and if the object has no end-cell (e.g.
+		 * missing in original .xml) we are also forced to generate one
+		*/
+		bool bEndAnchorIsBad = !bValid2 || pObj->IsResizeProtect();
+		if (bEndAnchorIsBad)
+			ScDrawLayer::UpdateCellAnchorFromPositionEnd(*pObj, *pDoc, nTab1);
 	}
 }
 
@@ -868,151 +943,6 @@
 	return pRet;
 }
 
-//	MoveAreaTwips: all measures are kept in twips
-void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea,
-		const Point& rMove, const Point& rTopLeft )
-{
-	if (!rMove.X() && !rMove.Y())
-		return; 									// nix
-
-	SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
-	DBG_ASSERT(pPage,"Page nicht gefunden");
-	if (!pPage)
-		return;
-
-	BOOL bNegativePage = pDoc && pDoc->IsNegativePage( nTab );
-
-	// fuer Shrinking!
-	Rectangle aNew( rArea );
-	BOOL bShrink = FALSE;
-	if ( rMove.X() < 0 || rMove.Y() < 0 )		// verkleinern
-	{
-		if ( rTopLeft != rArea.TopLeft() )		// sind gleich beim Verschieben von Zellen
-		{
-			bShrink = TRUE;
-			aNew.Left() = rTopLeft.X();
-			aNew.Top() = rTopLeft.Y();
-		}
-	}
-	SdrObjListIter aIter( *pPage, IM_FLAT );
-	SdrObject* pObject = aIter.Next();
-	while (pObject)
-	{
-		if( GetAnchor( pObject ) == SCA_CELL )
-		{
-			if ( GetObjData( pObject ) )					// Detektiv-Pfeil ?
-			{
-				// hier nichts
-			}
-			else if ( pObject->ISA( SdrEdgeObj ) )			// Verbinder?
-			{
-				//	hier auch nichts
-				//!	nicht verbundene Enden wie bei Linien (s.u.) behandeln?
-			}
-			else if ( pObject->IsPolyObj() && pObject->GetPointCount()==2 )
-			{
-				for (USHORT i=0; i<2; i++)
-				{
-					BOOL bMoved = FALSE;
-					Point aPoint = pObject->GetPoint(i);
-					lcl_ReverseTwipsToMM( aPoint );
-					if (rArea.IsInside(aPoint))
-					{
-						aPoint += rMove; bMoved = TRUE;
-					}
-					else if (bShrink && aNew.IsInside(aPoint))
-					{
-						//	Punkt ist in betroffener Zelle - Test auf geloeschten Bereich
-						if ( rMove.X() && aPoint.X() >= rArea.Left() + rMove.X() )
-						{
-							aPoint.X() = rArea.Left() + rMove.X() - SHRINK_DIST_TWIPS;
-							if ( aPoint.X() < 0 ) aPoint.X() = 0;
-							bMoved = TRUE;
-						}
-						if ( rMove.Y() && aPoint.Y() >= rArea.Top() + rMove.Y() )
-						{
-							aPoint.Y() = rArea.Top() + rMove.Y() - SHRINK_DIST_TWIPS;
-							if ( aPoint.Y() < 0 ) aPoint.Y() = 0;
-							bMoved = TRUE;
-						}
-					}
-					if( bMoved )
-					{
-						AddCalcUndo( new SdrUndoGeoObj( *pObject ) );
-						lcl_TwipsToMM( aPoint );
-						pObject->SetPoint( aPoint, i );
-					}
-				}
-			}
-			else
-			{
-				Rectangle aObjRect = pObject->GetLogicRect();
-				// aOldMMPos: not converted, millimeters
-				Point aOldMMPos = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft();
-				lcl_ReverseTwipsToMM( aObjRect );
-				Point aTopLeft = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft();	// logical left
-				Size aMoveSize;
-				BOOL bDoMove = FALSE;
-				if (rArea.IsInside(aTopLeft))
-				{
-					aMoveSize = Size(rMove.X(),rMove.Y());
-					bDoMove = TRUE;
-				}
-				else if (bShrink && aNew.IsInside(aTopLeft))
-				{
-					//	Position ist in betroffener Zelle - Test auf geloeschten Bereich
-					if ( rMove.X() && aTopLeft.X() >= rArea.Left() + rMove.X() )
-					{
-						aMoveSize.Width() = rArea.Left() + rMove.X() - SHRINK_DIST - aTopLeft.X();
-						bDoMove = TRUE;
-					}
-					if ( rMove.Y() && aTopLeft.Y() >= rArea.Top() + rMove.Y() )
-					{
-						aMoveSize.Height() = rArea.Top() + rMove.Y() - SHRINK_DIST - aTopLeft.Y();
-						bDoMove = TRUE;
-					}
-				}
-				if ( bDoMove )
-				{
-					if ( bNegativePage )
-					{
-						if ( aTopLeft.X() + aMoveSize.Width() > 0 )
-							aMoveSize.Width() = -aTopLeft.X();
-					}
-					else
-					{
-						if ( aTopLeft.X() + aMoveSize.Width() < 0 )
-							aMoveSize.Width() = -aTopLeft.X();
-					}
-					if ( aTopLeft.Y() + aMoveSize.Height() < 0 )
-						aMoveSize.Height() = -aTopLeft.Y();
-
-					//	get corresponding move size in millimeters:
-					Point aNewPos( aTopLeft.X() + aMoveSize.Width(), aTopLeft.Y() + aMoveSize.Height() );
-					lcl_TwipsToMM( aNewPos );
-					aMoveSize = Size( aNewPos.X() - aOldMMPos.X(), aNewPos.Y() - aOldMMPos.Y() );	// millimeters
-
-					AddCalcUndo( new SdrUndoMoveObj( *pObject, aMoveSize ) );
-					pObject->Move( aMoveSize );
-				}
-				else if ( rArea.IsInside( bNegativePage ? aObjRect.BottomLeft() : aObjRect.BottomRight() ) &&
-							!pObject->IsResizeProtect() )
-				{
-					//	geschuetzte Groessen werden nicht veraendert
-					//	(Positionen schon, weil sie ja an der Zelle "verankert" sind)
-					AddCalcUndo( new SdrUndoGeoObj( *pObject ) );
-					long nOldSizeX = aObjRect.Right() - aObjRect.Left() + 1;
-					long nOldSizeY = aObjRect.Bottom() - aObjRect.Top() + 1;
-					long nLogMoveX = rMove.X() * ( bNegativePage ? -1 : 1 );	// logical direction
-					pObject->Resize( aOldMMPos, Fraction( nOldSizeX+nLogMoveX, nOldSizeX ),
-												Fraction( nOldSizeY+rMove.Y(), nOldSizeY ) );
-				}
-			}
-		}
-		pObject = aIter.Next();
-	}
-}
-
 void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
 							SCsCOL nDx,SCsROW nDy, BOOL bInsDel )
 {
@@ -1054,11 +984,6 @@
 			aTopLeft.Y() += aMove.Y();
 	}
 
-	//	drawing objects are now directly included in cut&paste
-	//	-> only update references when inserting/deleting (or changing widths or heights)
-	if ( bInsDel )
-		MoveAreaTwips( nTab, aRect, aMove, aTopLeft );
-
 		//
 		//		Detektiv-Pfeile: Zellpositionen anpassen
 		//
@@ -1096,8 +1021,6 @@
 		aTopLeft.X() = -aTopLeft.X();
 		nDifTwips = -nDifTwips;
 	}
-
-	MoveAreaTwips( nTab, aRect, Point( nDifTwips,0 ), aTopLeft );
 }
 
 void ScDrawLayer::HeightChanged( SCTAB nTab, SCROW nRow, long nDifTwips )
@@ -1128,8 +1051,6 @@
 		MirrorRectRTL( aRect );
 		aTopLeft.X() = -aTopLeft.X();
 	}
-
-	MoveAreaTwips( nTab, aRect, Point( 0,nDifTwips ), aTopLeft );
 }
 
 BOOL ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow )
@@ -1807,30 +1728,105 @@
 	}
 }
 
-void ScDrawLayer::SetAnchor( SdrObject* pObj, ScAnchorType eType )
+namespace
 {
-	// Ein an der Seite verankertes Objekt zeichnet sich durch eine Anker-Pos
-	// von (0,1) aus. Das ist ein shabby Trick, der aber funktioniert!
-	Point aAnchor( 0, eType == SCA_PAGE ? 1 : 0 );
-	pObj->SetAnchorPos( aAnchor );
+    SdrObjUserData* GetFirstUserDataOfType(const SdrObject *pObj, UINT16 nId)
+    {
+        USHORT nCount = pObj ? pObj->GetUserDataCount() : 0;
+        for( USHORT i = 0; i < nCount; i++ )
+        {
+            SdrObjUserData* pData = pObj->GetUserData( i );
+            if( pData && pData->GetInventor() == SC_DRAWLAYER && pData->GetId() == nId )
+                return pData;
+        }
+        return NULL;
+    }
+
+    void DeleteFirstUserDataOfType(SdrObject *pObj, UINT16 nId)
+    {
+        USHORT nCount = pObj ? pObj->GetUserDataCount() : 0;
+        for( USHORT i = nCount; i > 0; i-- )
+        {
+            SdrObjUserData* pData = pObj->GetUserData( i-1 );
+            if( pData && pData->GetInventor() == SC_DRAWLAYER && pData->GetId() == nId )
+                pObj->DeleteUserData(i-1);
+        }
+    }
+}
+
+void ScDrawLayer::SetCellAnchored( SdrObject &rObj, const ScDrawObjData &rAnchor )
+{
+    ScDrawObjData* pAnchor = GetObjData( &rObj, true );
+    pAnchor->maStart = rAnchor.maStart;
+    pAnchor->maEnd = rAnchor.maEnd;
+    pAnchor->maStartOffset = rAnchor.maStartOffset;
+    pAnchor->maEndOffset = rAnchor.maEndOffset;
+}
+
+void ScDrawLayer::SetCellAnchoredFromPosition( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab )
+{
+    Rectangle aObjRect(rObj.GetLogicRect());
+    ScRange aRange = rDoc.GetRange( nTab, aObjRect );
+
+    Rectangle aCellRect;
+
+    ScDrawObjData aAnchor;
+    aAnchor.maStart = aRange.aStart;
+    aCellRect = rDoc.GetMMRect( aRange.aStart.Col(), aRange.aStart.Row(), 
+      aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab() );
+    aAnchor.maStartOffset.Y() = aObjRect.Top()-aCellRect.Top();
+    if (!rDoc.IsNegativePage(nTab))
+        aAnchor.maStartOffset.X() = aObjRect.Left()-aCellRect.Left();
+    else
+        aAnchor.maStartOffset.X() = aCellRect.Right()-aObjRect.Right();
+
+    aAnchor.maEnd = aRange.aEnd;
+    aCellRect = rDoc.GetMMRect( aRange.aEnd.Col(), aRange.aEnd.Row(), 
+      aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aEnd.Tab() );
+    aAnchor.maEndOffset.Y() = aObjRect.Bottom()-aCellRect.Top();
+    if (!rDoc.IsNegativePage(nTab))
+        aAnchor.maEndOffset.X() = aObjRect.Right()-aCellRect.Left();
+    else
+        aAnchor.maEndOffset.X() = aCellRect.Right()-aObjRect.Left();
+
+    SetCellAnchored( rObj, aAnchor );
+}
+
+void ScDrawLayer::UpdateCellAnchorFromPositionEnd( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab )
+{
+    Rectangle aObjRect(rObj.GetLogicRect());
+    ScRange aRange = rDoc.GetRange( nTab, aObjRect );
+
+    ScDrawObjData* pAnchor = GetObjData( &rObj, true );
+    pAnchor->maEnd = aRange.aEnd;
+
+    Rectangle aCellRect;
+    aCellRect = rDoc.GetMMRect( aRange.aEnd.Col(), aRange.aEnd.Row(), 
+      aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aEnd.Tab() );
+    pAnchor->maEndOffset.Y() = aObjRect.Bottom()-aCellRect.Top();
+    if (!rDoc.IsNegativePage(nTab))
+        pAnchor->maEndOffset.X() = aObjRect.Right()-aCellRect.Left();
+    else
+        pAnchor->maEndOffset.X() = aCellRect.Right()-aObjRect.Left();
+}
+
+void ScDrawLayer::SetPageAnchored( SdrObject &rObj )
+{
+    DeleteFirstUserDataOfType(&rObj, SC_UD_OBJDATA);
 }
 
-ScAnchorType ScDrawLayer::GetAnchor( const SdrObject* pObj )
+ScAnchorType ScDrawLayer::GetAnchorType( const SdrObject &rObj )
 {
-	Point aAnchor( pObj->GetAnchorPos() );
-	return ( aAnchor.Y() != 0 ) ? SCA_PAGE : SCA_CELL;
+	//If this object has a cell anchor associated with it
+	//then its cell-anchored, otherwise its page-anchored
+	return ScDrawLayer::GetObjData(const_cast<SdrObject*>(&rObj)) ? SCA_CELL : SCA_PAGE;
 }
 
 ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, BOOL bCreate )		// static
 {
-	USHORT nCount = pObj ? pObj->GetUserDataCount() : 0;
-	for( USHORT i = 0; i < nCount; i++ )
-	{
-		SdrObjUserData* pData = pObj->GetUserData( i );
-		if( pData && pData->GetInventor() == SC_DRAWLAYER
-					&& pData->GetId() == SC_UD_OBJDATA )
-			return (ScDrawObjData*) pData;
-	}
+	if (SdrObjUserData *pData = GetFirstUserDataOfType(pObj, SC_UD_OBJDATA))
+		return (ScDrawObjData*) pData;
+
 	if( pObj && bCreate )
 	{
 		ScDrawObjData* pData = new ScDrawObjData;
@@ -1867,15 +1863,7 @@
 
 ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj )				// static
 {
-	USHORT nCount = pObj->GetUserDataCount();
-	for( USHORT i = 0; i < nCount; i++ )
-	{
-		SdrObjUserData* pData = pObj->GetUserData( i );
-		if( pData && pData->GetInventor() == SC_DRAWLAYER
-					&& pData->GetId() == SC_UD_IMAPDATA )
-			return (ScIMapInfo*) pData;
-	}
-	return NULL;
+	return (ScIMapInfo*)GetFirstUserDataOfType(pObj, SC_UD_IMAPDATA);
 }
 
 // static:
@@ -1928,7 +1916,7 @@
 		else if ( pObj->ISA( SdrOle2Obj ) ) // OLE-Objekt
 		{
             // TODO/LEAN: working with visual area needs running state
-			aGraphSize = ((SdrOle2Obj*)pObj)->GetOrigObjSize();
+			aGraphSize = ((const SdrOle2Obj*)pObj)->GetOrigObjSize();
 			bObjSupported = TRUE;
 		}
 
@@ -1946,14 +1934,9 @@
 
 ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, BOOL bCreate )             // static
 {
-    USHORT nCount = pObj->GetUserDataCount();
-    for( USHORT i = 0; i < nCount; i++ )
-    {
-        SdrObjUserData* pData = pObj->GetUserData( i );
-        if( pData && pData->GetInventor() == SC_DRAWLAYER
-                    && pData->GetId() == SC_UD_MACRODATA )
-            return (ScMacroInfo*) pData;
-    }
+    if (SdrObjUserData *pData = GetFirstUserDataOfType(pObj, SC_UD_MACRODATA))
+        return (ScMacroInfo*) pData;
+
     if ( bCreate )
     {
         ScMacroInfo* pData = new ScMacroInfo;
diff -ru sc.orig/source/core/data/postit.cxx sc/source/core/data/postit.cxx
--- sc.orig/source/core/data/postit.cxx	2009-06-04 12:39:10.000000000 +0100
+++ sc/source/core/data/postit.cxx	2009-06-04 12:40:23.000000000 +0100
@@ -125,7 +125,6 @@
     mpCaption = new SdrCaptionObj( aTextRect, aTailPos );
 
     // basic settings
-    ScDrawLayer::SetAnchor( mpCaption, SCA_PAGE );
     mpCaption->SetLayer( bShown ? SC_LAYER_INTERN : SC_LAYER_HIDDEN );
     mpCaption->SetFixedTail();
     mpCaption->SetSpecialTextBoxShadow();
diff -ru sc.orig/source/core/tool/detfunc.cxx sc/source/core/tool/detfunc.cxx
--- sc.orig/source/core/tool/detfunc.cxx	2009-06-04 12:39:11.000000000 +0100
+++ sc/source/core/tool/detfunc.cxx	2009-06-04 12:40:23.000000000 +0100
@@ -492,7 +492,6 @@
 
 		pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
 
-		ScDrawLayer::SetAnchor( pBox, SCA_CELL );
 		pBox->SetLayer( SC_LAYER_INTERN );
 		pPage->InsertObject( pBox );
 		pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) );
@@ -534,7 +533,6 @@
 	pArrow->NbcSetLogicRect(Rectangle(aStartPos,aEndPos));	//! noetig ???
 	pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
 
-	ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
 	pArrow->SetLayer( SC_LAYER_INTERN );
 	pPage->InsertObject( pArrow );
 	pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) );
@@ -565,7 +563,6 @@
 
 		pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
 
-		ScDrawLayer::SetAnchor( pBox, SCA_CELL );
 		pBox->SetLayer( SC_LAYER_INTERN );
 		pPage->InsertObject( pBox );
 		pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) );
@@ -600,7 +597,6 @@
 
 	pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
 
-	ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
 	pArrow->SetLayer( SC_LAYER_INTERN );
 	pPage->InsertObject( pArrow );
 	pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) );
@@ -668,7 +664,6 @@
 
 	pCircle->SetMergedItemSetAndBroadcast(rAttrSet);
 
-	ScDrawLayer::SetAnchor( pCircle, SCA_CELL );
 	pCircle->SetLayer( SC_LAYER_INTERN );
 	pPage->InsertObject( pCircle );
 	pModel->AddCalcUndo( new SdrUndoInsertObj( *pCircle ) );
diff -ru sc.orig/source/filter/xml/XMLExportIterator.hxx sc/source/filter/xml/XMLExportIterator.hxx
--- sc.orig/source/filter/xml/XMLExportIterator.hxx	2009-06-04 12:39:13.000000000 +0100
+++ sc/source/filter/xml/XMLExportIterator.hxx	2009-06-04 12:40:23.000000000 +0100
@@ -72,6 +72,8 @@
 {
 	ScAddress	aAddress;
 	ScAddress	aEndAddress;
+	sal_Int32       nEndX;
+	sal_Int32       nEndY;
 	com::sun::star::uno::Reference<com::sun::star::drawing::XShape> xShape;
 
 	sal_Bool operator<(const ScMyShape& aShape) const;
diff -ru sc.orig/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx
--- sc.orig/source/filter/xml/xmlexprt.cxx	2009-06-04 12:39:13.000000000 +0100
+++ sc/source/filter/xml/xmlexprt.cxx	2009-06-04 12:51:46.000000000 +0100
@@ -599,39 +599,21 @@
 												else
 												{
 													++nShapesCount;
-													SvxShape* pShapeImp(SvxShape::getImplementation(xShape));
-													if (pShapeImp)
+													if (SvxShape* pShapeImp = SvxShape::getImplementation(xShape))
 													{
-														SdrObject *pSdrObj(pShapeImp->GetSdrObject());
-														if (pSdrObj)
+														if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
 														{
-															if (ScDrawLayer::GetAnchor(pSdrObj) == SCA_CELL)
+															if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData( pSdrObj ))
 															{
-																if (pDoc)
-																{
-
-																	awt::Point aPoint(xShape->getPosition());
-																	awt::Size aSize(xShape->getSize());
-																	rtl::OUString sType(xShape->getShapeType());
-																	Rectangle aRectangle(aPoint.X, aPoint.Y, aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
-																	if ( sType.equals(sCaptionShape) )
-																	{
-                                                                        awt::Point aRelativeCaptionPoint;
-                                                                        xShapeProp->getPropertyValue( sCaptionPoint ) >>= aRelativeCaptionPoint;
-                                                                        Point aCoreRelativeCaptionPoint(aRelativeCaptionPoint.X, aRelativeCaptionPoint.Y);
-                                                                        Point aCoreAbsoluteCaptionPoint(aPoint.X, aPoint.Y);
-                                                                        aCoreAbsoluteCaptionPoint += aCoreRelativeCaptionPoint;
-                                                                        aRectangle.Union(Rectangle(aCoreAbsoluteCaptionPoint, aCoreAbsoluteCaptionPoint));
-																	}
-																	ScRange aRange(pDoc->GetRange(static_cast<SCTAB>(nTable), aRectangle));
-																	ScMyShape aMyShape;
-																	aMyShape.aAddress = aRange.aStart;
-																	aMyShape.aEndAddress = aRange.aEnd;
-																	aMyShape.xShape = xShape;
-																	pSharedData->AddNewShape(aMyShape);
-																	pSharedData->SetLastColumn(nTable, aRange.aStart.Col());
-																	pSharedData->SetLastRow(nTable, aRange.aStart.Row());
-																}
+																ScMyShape aMyShape;
+																aMyShape.aAddress = pAnchor->maStart;
+																aMyShape.aEndAddress = pAnchor->maEnd;
+																aMyShape.nEndX = pAnchor->maEndOffset.X();
+																aMyShape.nEndY = pAnchor->maEndOffset.Y();
+																aMyShape.xShape = xShape;
+																pSharedData->AddNewShape(aMyShape);
+																pSharedData->SetLastColumn(nTable, pAnchor->maStart.Col());
+																pSharedData->SetLastRow(nTable, pAnchor->maStart.Row());
 															}
 															else
 																pSharedData->AddTableShape(nTable, xShape);
@@ -2585,29 +2567,15 @@
                     aPoint.X = 2 * aItr->xShape->getPosition().X + aItr->xShape->getSize().Width - aPoint.X;
 				if ( !aItr->xShape->getShapeType().equals(sCaptionShape) )
 				{
-					awt::Point aEndPoint;
 					Rectangle aEndRec(pDoc->GetMMRect(aItr->aEndAddress.Col(), aItr->aEndAddress.Row(),
 						aItr->aEndAddress.Col(), aItr->aEndAddress.Row(), aItr->aEndAddress.Tab()));
 					rtl::OUString sEndAddress;
 					ScRangeStringConverter::GetStringFromAddress(sEndAddress, aItr->aEndAddress, pDoc, FormulaGrammar::CONV_OOO);
 					AddAttribute(XML_NAMESPACE_TABLE, XML_END_CELL_ADDRESS, sEndAddress);
-                    if (bNegativePage)
-                        aEndPoint.X = -aEndRec.Right();
-                    else
-					    aEndPoint.X = aEndRec.Left();
-					aEndPoint.Y = aEndRec.Top();
-					awt::Point aStartPoint(aItr->xShape->getPosition());
-					awt::Size aSize(aItr->xShape->getSize());
-                    sal_Int32 nEndX;
-                    if (bNegativePage)
-					    nEndX = -aStartPoint.X - aEndPoint.X;
-                    else
-					    nEndX = aStartPoint.X + aSize.Width - aEndPoint.X;
-					sal_Int32 nEndY(aStartPoint.Y + aSize.Height - aEndPoint.Y);
 					rtl::OUStringBuffer sBuffer;
-					GetMM100UnitConverter().convertMeasure(sBuffer, nEndX);
+					GetMM100UnitConverter().convertMeasure(sBuffer, aItr->nEndX);
 					AddAttribute(XML_NAMESPACE_TABLE, XML_END_X, sBuffer.makeStringAndClear());
-					GetMM100UnitConverter().convertMeasure(sBuffer, nEndY);
+					GetMM100UnitConverter().convertMeasure(sBuffer, aItr->nEndY);
 					AddAttribute(XML_NAMESPACE_TABLE, XML_END_Y, sBuffer.makeStringAndClear());
 				}
 				ExportShape(aItr->xShape, &aPoint);
diff -ru sc.orig/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx
--- sc.orig/source/filter/xml/xmlimprt.cxx	2009-06-04 12:39:13.000000000 +0100
+++ sc/source/filter/xml/xmlimprt.cxx	2009-06-04 15:23:47.000000000 +0100
@@ -2772,7 +2772,7 @@
         if (pDoc)
             pDoc->CompileXML();
         aTables.UpdateRowHeights();
-        aTables.ResizeShapes();
+        aTables.FixupOLEs();
     }
     if (GetModel().is())
     {
diff -ru sc.orig/source/filter/xml/xmlsubti.cxx sc/source/filter/xml/xmlsubti.cxx
--- sc.orig/source/filter/xml/xmlsubti.cxx	2009-06-04 12:39:13.000000000 +0100
+++ sc/source/filter/xml/xmlsubti.cxx	2009-06-04 15:17:25.000000000 +0100
@@ -145,7 +145,7 @@
 
 ScMyTables::ScMyTables(ScXMLImport& rTempImport)
 	: rImport(rTempImport),
-	aResizeShapes(rTempImport),
+	aFixupOLEs(rTempImport),
 	nCurrentColStylePos(0),
 	nCurrentDrawPage( -1 ),
 	nCurrentXShapes( -1 ),
@@ -715,12 +715,10 @@
 	return !((nCurrentSheet != nCurrentXShapes) || !xShapes.is());
 }
 
-void ScMyTables::AddShape(uno::Reference <drawing::XShape>& rShape,
-	rtl::OUString* pRangeList,
-	table::CellAddress& rStartAddress, table::CellAddress& rEndAddress,
-	sal_Int32 nEndX, sal_Int32 nEndY)
+void ScMyTables::AddOLE(uno::Reference <drawing::XShape>& rShape,
+	const rtl::OUString &rRangeList)
 {
-	aResizeShapes.AddShape(rShape, pRangeList, rStartAddress, rEndAddress, nEndX, nEndY);
+	aFixupOLEs.AddOLE(rShape, rRangeList);
 }
 
 void ScMyTables::AddMatrixRange(sal_Int32 nStartColumn, sal_Int32 nStartRow, sal_Int32 nEndColumn, sal_Int32 nEndRow, const rtl::OUString& rFormula, const formula::FormulaGrammar::Grammar eGrammar)
diff -ru sc.orig/source/filter/xml/xmlsubti.hxx sc/source/filter/xml/xmlsubti.hxx
--- sc.orig/source/filter/xml/xmlsubti.hxx	2009-06-04 12:39:13.000000000 +0100
+++ sc/source/filter/xml/xmlsubti.hxx	2009-06-04 15:23:00.000000000 +0100
@@ -114,7 +114,7 @@
 
 	ScXMLImport&						rImport;
 
-	ScMyShapeResizer                    aResizeShapes;
+	ScMyOLEFixer                        aFixupOLEs;
 
 	::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > xCurrentSheet;
 	::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > xCurrentCellRange;
@@ -151,7 +151,9 @@
 	void								AddColumn(sal_Bool bIsCovered);
 	void								NewTable(sal_Int32 nTempSpannedCols);
 	void								UpdateRowHeights();
-	void								ResizeShapes() { aResizeShapes.ResizeShapes(); }
+	void								FixupOLEs() { aFixupOLEs.FixupOLEs(); }
+	sal_Bool							IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape) const
+        { return ScMyOLEFixer::IsOLE(rShape); }
 	void								DeleteTable();
 	com::sun::star::table::CellAddress	GetRealCellPos();
 	void								AddColCount(sal_Int32 nTempColCount);
@@ -170,11 +172,8 @@
 										GetCurrentXShapes();
 	sal_Bool							HasDrawPage();
 	sal_Bool							HasXShapes();
-	void								AddShape(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
-												rtl::OUString* pRangeList,
-												com::sun::star::table::CellAddress& rStartAddress,
-												com::sun::star::table::CellAddress& rEndAddress,
-												sal_Int32 nEndX, sal_Int32 nEndY);
+	void								AddOLE(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
+												const rtl::OUString &rRangeList);
 
     void                                AddMatrixRange( sal_Int32 nStartColumn,
                                                 sal_Int32 nStartRow,
diff -ru sc.orig/source/filter/xml/XMLTableShapeImportHelper.cxx sc/source/filter/xml/XMLTableShapeImportHelper.cxx
--- sc.orig/source/filter/xml/XMLTableShapeImportHelper.cxx	2009-06-04 12:39:13.000000000 +0100
+++ sc/source/filter/xml/XMLTableShapeImportHelper.cxx	2009-06-04 15:17:38.000000000 +0100
@@ -36,6 +36,7 @@
 #include "drwlayer.hxx"
 #include "xmlannoi.hxx"
 #include "rangeutl.hxx"
+#include "userdat.hxx"
 #include <xmloff/nmspmap.hxx>
 #include <xmloff/xmlnmspe.hxx>
 #include <xmloff/xmluconv.hxx>
@@ -86,6 +87,11 @@
 	{
         if (!pAnnotationContext)
         {
+			ScDrawObjData aAnchor;
+			aAnchor.maStart = ScAddress(aStartCell.Column, aStartCell.Row, aStartCell.Sheet);
+			awt::Point aStartPoint(rShape->getPosition());
+			aAnchor.maStartOffset = Point(aStartPoint.X, aStartPoint.Y);
+
 		    sal_Int32 nEndX(-1);
 		    sal_Int32 nEndY(-1);
 		    sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -107,11 +113,18 @@
 				    {
 					    sal_Int32 nOffset(0);
 					    ScRangeStringConverter::GetAddressFromString(aEndCell, rValue, static_cast<ScXMLImport&>(mrImporter).GetDocument(), ::formula::FormulaGrammar::CONV_OOO, nOffset);
+					    aAnchor.maEnd = ScAddress(aEndCell.Column, aEndCell.Row, aEndCell.Sheet);
 				    }
 				    else if (IsXMLToken(aLocalName, XML_END_X))
+				    {
 					    static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndX, rValue);
+					    aAnchor.maEndOffset.X() = nEndX;
+				    }
 				    else if (IsXMLToken(aLocalName, XML_END_Y))
+				    {
 					    static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndY, rValue);
+					    aAnchor.maEndOffset.Y() = nEndY;
+				    }
 				    else if (IsXMLToken(aLocalName, XML_TABLE_BACKGROUND))
 					    if (IsXMLToken(rValue, XML_TRUE))
 						    nLayerID = SC_LAYER_BACK;
@@ -124,39 +137,28 @@
 		    }
             SetLayer(rShape, nLayerID, rShape->getShapeType());
 
-		    if (!bOnTable)
+		    if (SvxShape* pShapeImp = SvxShape::getImplementation(rShape))
 		    {
-			    static_cast<ScXMLImport&>(mrImporter).GetTables().AddShape(rShape,
-				    pRangeList, aStartCell, aEndCell, nEndX, nEndY);
-			    SvxShape* pShapeImp = SvxShape::getImplementation(rShape);
-			    if (pShapeImp)
+			    if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
 			    {
-				    SdrObject *pSdrObj = pShapeImp->GetSdrObject();
-				    if (pSdrObj)
-					    ScDrawLayer::SetAnchor(pSdrObj, SCA_CELL);
+				    if (!bOnTable)
+                        ScDrawLayer::SetCellAnchored(*pSdrObj, aAnchor);
+                    else
+				        ScDrawLayer::SetPageAnchored(*pSdrObj);
 			    }
 		    }
-		    else
-		    {
-                if ( pRangeList )
-                {
-                    // #i78086# If there are notification ranges, the ChartListener must be created
-                    // also when anchored to the sheet
-                    // -> call AddShape with invalid cell position (checked in ScMyShapeResizer::ResizeShapes)
-
-                    table::CellAddress aInvalidPos( -1, -1, -1 );
-                    static_cast<ScXMLImport&>(mrImporter).GetTables().AddShape(rShape,
-                        pRangeList, aInvalidPos, aInvalidPos, 0, 0);
-                }
 
-			    SvxShape* pShapeImp = SvxShape::getImplementation(rShape);
-			    if (pShapeImp)
-			    {
-				    SdrObject *pSdrObj = pShapeImp->GetSdrObject();
-				    if (pSdrObj)
-					    ScDrawLayer::SetAnchor(pSdrObj, SCA_PAGE);
-			    }
-		    }
+            if ( bOnTable && pRangeList )
+            {
+                // #i78086# If there are notification ranges, the ChartListener must be created
+                // also when anchored to the sheet
+                // -> call AddOLE (fixed up in ScMyShapeResizer::FixupOLEs)
+
+                if (static_cast<ScXMLImport&>(mrImporter).GetTables().IsOLE(rShape))
+                    static_cast<ScXMLImport&>(mrImporter).GetTables().AddOLE(rShape, *pRangeList);
+            }
+
+            delete pRangeList;
         }
         else // shape is annotation
         {
diff -ru sc.orig/source/filter/xml/XMLTableShapeResizer.cxx sc/source/filter/xml/XMLTableShapeResizer.cxx
--- sc.orig/source/filter/xml/XMLTableShapeResizer.cxx	2009-06-04 12:39:13.000000000 +0100
+++ sc/source/filter/xml/XMLTableShapeResizer.cxx	2009-06-04 15:27:39.000000000 +0100
@@ -51,38 +51,38 @@
 using ::std::vector;
 using ::rtl::OUString;
 
-ScMyShapeResizer::ScMyShapeResizer(ScXMLImport& rTempImport)
+ScMyOLEFixer::ScMyOLEFixer(ScXMLImport& rTempImport)
     : rImport(rTempImport),
     aShapes(),
 	pCollection(NULL)
 {
 }
 
-ScMyShapeResizer::~ScMyShapeResizer()
+ScMyOLEFixer::~ScMyOLEFixer()
 {
 }
 
-sal_Bool ScMyShapeResizer::IsOLE(uno::Reference< drawing::XShape >& rShape) const
+sal_Bool ScMyOLEFixer::IsOLE(uno::Reference< drawing::XShape >& rShape)
 {
 	return rShape->getShapeType().equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")));
 }
 
-void ScMyShapeResizer::CreateChartListener(ScDocument* pDoc,
+void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc,
 	const rtl::OUString& rName,
-	const rtl::OUString* pRangeList)
+	const rtl::OUString& rRangeList)
 {
-    if (!pDoc || !pRangeList)
-        // These are minimum required.
+    // This is the minimum required.
+    if (!pDoc)
         return;
 
-    if (!pRangeList->getLength())
+    if (!rRangeList.getLength())
     {
         pDoc->AddOLEObjectToCollection(rName);
         return;
     }
 
     OUString aRangeStr;
-    ScRangeStringConverter::GetStringFromXMLRangeString(aRangeStr, *pRangeList, pDoc);
+    ScRangeStringConverter::GetStringFromXMLRangeString(aRangeStr, rRangeList, pDoc);
     if (!aRangeStr.getLength())
     {
         pDoc->AddOLEObjectToCollection(rName);
@@ -112,271 +112,45 @@
     }
 }
 
-void ScMyShapeResizer::AddShape(uno::Reference <drawing::XShape>& rShape,
-	rtl::OUString* pRangeList,
-	table::CellAddress& rStartAddress, table::CellAddress& rEndAddress,
-	sal_Int32 nEndX, sal_Int32 nEndY)
+void ScMyOLEFixer::AddOLE(uno::Reference <drawing::XShape>& rShape,
+	const rtl::OUString &rRangeList)
 {
-	ScMyToResizeShape aShape;
+	ScMyToFixupOLE aShape;
 	aShape.xShape.set(rShape);
-	aShape.pRangeList = pRangeList;
-	aShape.aEndCell = rEndAddress;
-	aShape.aStartCell = rStartAddress;
-	aShape.nEndY = nEndY;
-	aShape.nEndX = nEndX;
+	aShape.sRangeList = rRangeList;
 	aShapes.push_back(aShape);
 }
 
-void ScMyShapeResizer::GetNewShapeSizePos(ScDocument* pDoc, const Rectangle& rStartRect,
-                                          const table::CellAddress& rEndCell,
-                                          awt::Point& rPoint, awt::Size& rSize,
-                                          sal_Int32& rEndX, sal_Int32& rEndY) const
-{
-	awt::Point aRefPoint;
-    BOOL bNegativePage(pDoc->IsNegativePage(rEndCell.Sheet));
-    if (bNegativePage)
-        aRefPoint.X = rStartRect.Right();
-    else
-	    aRefPoint.X = rStartRect.Left();
-	aRefPoint.Y = rStartRect.Top();
-	Rectangle aRect(pDoc->GetMMRect(
-		static_cast<SCCOL>(rEndCell.Column), static_cast<SCROW>(rEndCell.Row),
-		static_cast<SCCOL>(rEndCell.Column), static_cast<SCROW>(rEndCell.Row), rEndCell.Sheet ));
-    if (bNegativePage)
-        rEndX = -rEndX + aRect.Right();
-    else
-	    rEndX += aRect.Left();
-	rEndY += aRect.Top();
-	rPoint.X += aRefPoint.X;
-    if (bNegativePage)
-    {
-	    if (rPoint.X < rStartRect.Left())
-		    rPoint.X = rStartRect.Left() + 2; // increment by 2 100th_mm because the cellwidth is internal in twips
-    }
-    else
-    {
-	    if (rPoint.X > rStartRect.Right())
-		    rPoint.X = rStartRect.Right() - 2; // decrement by 2 100th_mm because the cellwidth is internal in twips
-    }
-	rPoint.Y += aRefPoint.Y;
-	if (rPoint.Y > rStartRect.Bottom())
-		rPoint.Y = rStartRect.Bottom() - 2; // decrement by 2 100th_mm because the cellheight is internal in twips
-    if (bNegativePage)
-    {
-        rSize.Width = -(rEndX - rPoint.X);
-    }
-    else
-	    rSize.Width = rEndX - rPoint.X;
-	rSize.Height = rEndY - rPoint.Y;
-}
-
-void ScMyShapeResizer::ResizeShapes()
+void ScMyOLEFixer::FixupOLEs()
 {
 	if (!aShapes.empty() && rImport.GetModel().is())
 	{
-		rtl::OUString sRowHeight(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CELLHGT));
 		rtl::OUString sPersistName (RTL_CONSTASCII_USTRINGPARAM("PersistName"));
-		rtl::OUString sCaptionPoint( RTL_CONSTASCII_USTRINGPARAM( "CaptionPoint" ));
-        rtl::OUString sConnectorShape( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ConnectorShape") );
-        rtl::OUString sCaptionShape( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape") );
-        rtl::OUString sStartShape(RTL_CONSTASCII_USTRINGPARAM("StartShape"));
-        rtl::OUString sEndShape(RTL_CONSTASCII_USTRINGPARAM("EndShape"));
-        rtl::OUString sStartPosition(RTL_CONSTASCII_USTRINGPARAM("StartPosition"));
-        rtl::OUString sEndPosition(RTL_CONSTASCII_USTRINGPARAM("EndPosition"));
-		uno::Reference<table::XCellRange> xTableRow;
-		uno::Reference<sheet::XSpreadsheet> xSheet;
-		uno::Reference<table::XTableRows> xTableRows;
-		sal_Int32 nOldRow(-1);
-		sal_Int32 nOldSheet(-1);
-		ScMyToResizeShapes::iterator aItr(aShapes.begin());
-		ScMyToResizeShapes::iterator aEndItr(aShapes.end());
-		uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( rImport.GetModel(), uno::UNO_QUERY );
-		if ( xSpreadDoc.is() )
+		ScMyToFixupOLEs::iterator aItr(aShapes.begin());
+		ScMyToFixupOLEs::iterator aEndItr(aShapes.end());
+		ScDocument* pDoc(rImport.GetDocument());
+
+		rImport.LockSolarMutex();
+
+		while (aItr != aEndItr)
 		{
-			uno::Reference<container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
-			ScDocument* pDoc(rImport.GetDocument());
-			if ( pDoc && xIndex.is() )
+            // #i78086# also call CreateChartListener for invalid position (anchored to sheet)
+			if (!IsOLE(aItr->xShape))
+                DBG_ERROR("Only OLEs should be in here now");
+
+			if (IsOLE(aItr->xShape))
 			{
-				rImport.LockSolarMutex();
-				while (aItr != aEndItr)
-				{
-                    // #i78086# invalid cell position is used to call CreateChartListener only
-                    if ( aItr->aEndCell.Sheet >= 0 )
-                    {
-    					if ((nOldSheet != aItr->aEndCell.Sheet) || !xSheet.is())
-    					{
-    						nOldSheet = aItr->aEndCell.Sheet;
-                            xSheet.set(xIndex->getByIndex(nOldSheet), uno::UNO_QUERY);
-    						if (xSheet.is())
-    						{
-    							uno::Reference<table::XColumnRowRange> xColumnRowRange (xSheet, uno::UNO_QUERY);
-    							if (xColumnRowRange.is())
-    								xTableRows = xColumnRowRange->getRows();
-    						}
-    					}
-    					if (xTableRows.is())
-    					{
-    						if (nOldRow != aItr->aEndCell.Row || !xTableRow.is())
-    						{
-    							nOldRow = aItr->aEndCell.Row;
-    							xTableRows->getByIndex(nOldRow) >>= xTableRow;
-    						}
-    						if (xTableRow.is())
-    						{
-    							uno::Reference <beans::XPropertySet> xRowProperties(xTableRow, uno::UNO_QUERY);
-    							if (xRowProperties.is())
-    							{
-    								sal_Int32 nHeight;
-    								if (xRowProperties->getPropertyValue(sRowHeight) >>= nHeight)
-    								{
-    									Rectangle aRec = pDoc->GetMMRect(static_cast<SCCOL>(aItr->aStartCell.Column), static_cast<SCROW>(aItr->aStartCell.Row),
-    										static_cast<SCCOL>(aItr->aStartCell.Column), static_cast<SCROW>(aItr->aStartCell.Row), aItr->aStartCell.Sheet);
-    									awt::Point aPoint(aItr->xShape->getPosition());
-    									awt::Size aSize(aItr->xShape->getSize());
-                                        if (pDoc->IsNegativePage(static_cast<SCTAB>(nOldSheet)))
-                                            aPoint.X += aSize.Width;
-    									if (aItr->nEndY >= 0 && aItr->nEndX >= 0)
-    									{
-                                            if (aItr->xShape->getShapeType().equals(sConnectorShape))
-                                            {
-                                                //#103122#; handle connected Connectorshapes
-                                                uno::Reference<beans::XPropertySet> xShapeProps (aItr->xShape, uno::UNO_QUERY);
-                                                if(xShapeProps.is())
-                                                {
-                                                    uno::Reference<drawing::XShape> xStartShape(xShapeProps->getPropertyValue(	sStartShape ), uno::UNO_QUERY);
-                                                    uno::Reference<drawing::XShape> xEndShape(xShapeProps->getPropertyValue( sEndShape ), uno::UNO_QUERY);
-                                                    if (!xStartShape.is() && !xEndShape.is())
-                                                    {
-    										            awt::Size aOldSize(aSize);
-                                                        GetNewShapeSizePos(pDoc, aRec, aItr->aEndCell, aPoint, aSize, aItr->nEndX, aItr->nEndY);
-    	                                                aItr->xShape->setPosition(aPoint);
-    	                                                if( (aSize.Width != aOldSize.Width) ||
-    		                                                (aSize.Height != aOldSize.Height) )
-    		                                                aItr->xShape->setSize(aSize);
-                                                    }
-                                                    else if (xStartShape.is() && xEndShape.is())
-                                                    {
-                                                        // do nothing, because they are connected
-                                                    }
-                                                    else
-                                                    {
-                                                        // only one point is connected, the other should be moved
-
-                                                        rtl::OUString sProperty;
-                                                        if (xStartShape.is())
-                                                        {
-                                                            awt::Point aEndPoint;
-                                                            xShapeProps->getPropertyValue(sEndPosition) >>= aEndPoint;
-                                                            aPoint.X = aRec.Left() + aEndPoint.X;
-                                                            aPoint.Y = aRec.Top() + aEndPoint.Y;
-                                                            sProperty = sEndPosition;
-                                                        }
-                                                        else
-                                                        {
-                                                            awt::Point aStartPoint;
-                                                            xShapeProps->getPropertyValue(sStartPosition) >>= aStartPoint;
-                                                            aPoint.X = aRec.Left() + aStartPoint.X;
-                                                            aPoint.Y = aRec.Top() + aStartPoint.Y;
-                                                            sProperty = sStartPosition;
-                                                        }
-                                                        xShapeProps->setPropertyValue(sProperty, uno::makeAny(aPoint));
-                                                    }
-                                                }
-                                            }
-                                            else
-                                            {
-    										    awt::Size aOldSize(aSize);
-                                                GetNewShapeSizePos(pDoc, aRec, aItr->aEndCell, aPoint, aSize, aItr->nEndX, aItr->nEndY);
-                                                if (pDoc->IsNegativePage(static_cast<SCTAB>(nOldSheet)))
-                                                    aPoint.X -= aSize.Width;
-    	                                        aItr->xShape->setPosition(aPoint);
-    	                                        if( (aSize.Width != aOldSize.Width) ||
-    		                                        (aSize.Height != aOldSize.Height) )
-    		                                        aItr->xShape->setSize(aSize);
-                                            }
-    									}
-    									else
-    									{
-    										if (aItr->xShape->getShapeType().equals(sCaptionShape))
-    										{
-    											Rectangle aRectangle(aPoint.X, aPoint.Y, aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
-
-    											awt::Point aCaptionPoint;
-    											uno::Reference< beans::XPropertySet > xShapeProps(aItr->xShape, uno::UNO_QUERY);
-    											if (xShapeProps.is())
-    											{
-    												try
-    												{
-    													xShapeProps->getPropertyValue( sCaptionPoint ) >>= aCaptionPoint;
-    												}
-    												catch ( uno::Exception& )
-    												{
-    													DBG_ERROR("This Captionshape has no CaptionPoint property.");
-    												}
-    											}
-    											Point aCorePoint(aPoint.X, aPoint.Y);
-    											Point aCoreCaptionPoint(aCaptionPoint.X, aCaptionPoint.Y);
-    											aCoreCaptionPoint += aCorePoint;
-    											aRectangle.Union(Rectangle(aCoreCaptionPoint, aCoreCaptionPoint));
-
-    											Point aBeforeRightBottomPoint(aRectangle.BottomRight());
-
-    											aRectangle += aRec.TopLeft();
-    											if (aRectangle.Left() > aRec.Right())
-    												aRectangle -= (Point(aRectangle.Left() - aRec.Right() + 2, 0));
-    											if (aRectangle.Top() > aRec.Bottom())
-    												aRectangle -= (Point(0, aRectangle.Top() - aRec.Bottom() + 2));
-
-    											Point aDifferencePoint(aRectangle.BottomRight() - aBeforeRightBottomPoint);
-    											aPoint.X += aDifferencePoint.X();
-    											aPoint.Y += aDifferencePoint.Y();
-
-    											aItr->xShape->setPosition(aPoint);
-    										}
-    										else
-    										{
-    											// #96159# it is possible, that shapes have a negative position
-    											// this is now handled here
-    											DBG_ERROR("no or negative end address of this shape");
-    											awt::Point aRefPoint;
-    											aRefPoint.X = aRec.Left();
-    											aRefPoint.Y = aRec.Top();
-    											aPoint.X += aRefPoint.X;
-    											if (aPoint.X > aRec.Right())
-    												aPoint.X = aRec.Right() - 2; // decrement by 2 100th_mm because the cellheight is internal in twips
-    											aPoint.Y += aRefPoint.Y;
-    											if (aPoint.Y > aRec.Bottom())
-    												aPoint.Y = aRec.Bottom() - 2; // decrement by 2 100th_mm because the cellheight is internal in twips
-    											aItr->xShape->setPosition(aPoint);
-    										}
-    									}
-    								}
-    							}
-    						}
-    					}
-    					else
-					{
-    						DBG_ERROR("something wents wrong");
-					}
-                    }
-                    // #i78086# call CreateChartListener also for invalid position (anchored to sheet)
-					if (IsOLE(aItr->xShape))
-					{
-						uno::Reference < beans::XPropertySet > xShapeProps ( aItr->xShape, uno::UNO_QUERY );
-						uno::Reference < beans::XPropertySetInfo > xShapeInfo(xShapeProps->getPropertySetInfo());
-                        rtl::OUString sName;
-						if (xShapeProps.is() && xShapeInfo.is() && xShapeInfo->hasPropertyByName(sPersistName) &&
-                            (xShapeProps->getPropertyValue(sPersistName) >>= sName))
-							CreateChartListener(pDoc, sName, aItr->pRangeList);
-					}
-					if (aItr->pRangeList)
-						delete aItr->pRangeList;
-					aItr = aShapes.erase(aItr);
-				}
-				rImport.UnlockSolarMutex();
-//				if (pCollection)
-//					pDoc->SetChartListenerCollection(pCollection);
+				uno::Reference < beans::XPropertySet > xShapeProps ( aItr->xShape, uno::UNO_QUERY );
+				uno::Reference < beans::XPropertySetInfo > xShapeInfo(xShapeProps->getPropertySetInfo());
+                rtl::OUString sName;
+
+				if (pDoc && xShapeProps.is() && xShapeInfo.is() && xShapeInfo->hasPropertyByName(sPersistName) &&
+                  (xShapeProps->getPropertyValue(sPersistName) >>= sName))
+				    CreateChartListener(pDoc, sName, aItr->sRangeList);
 			}
+			aItr = aShapes.erase(aItr);
 		}
+
+		rImport.UnlockSolarMutex();
 	}
 }
diff -ru sc.orig/source/filter/xml/XMLTableShapeResizer.hxx sc/source/filter/xml/XMLTableShapeResizer.hxx
--- sc.orig/source/filter/xml/XMLTableShapeResizer.hxx	2009-06-04 12:39:13.000000000 +0100
+++ sc/source/filter/xml/XMLTableShapeResizer.hxx	2009-06-04 15:22:38.000000000 +0100
@@ -41,44 +41,31 @@
 class ScDocument;
 class Rectangle;
 
-struct ScMyToResizeShape
+struct ScMyToFixupOLE
 {
 	com::sun::star::uno::Reference <com::sun::star::drawing::XShape> xShape;
-	rtl::OUString* pRangeList;
-	com::sun::star::table::CellAddress	aEndCell;
-	com::sun::star::table::CellAddress	aStartCell;
-	sal_Int32 nEndX;
-	sal_Int32 nEndY;
-
-	ScMyToResizeShape() : pRangeList(NULL) {}
+	rtl::OUString sRangeList;
 };
 
-typedef std::list<ScMyToResizeShape> ScMyToResizeShapes;
+typedef std::list<ScMyToFixupOLE> ScMyToFixupOLEs;
 
-class ScMyShapeResizer
+class ScMyOLEFixer
 {
 	ScXMLImport&				rImport;
-	ScMyToResizeShapes			aShapes;
+	ScMyToFixupOLEs				aShapes;
 	ScChartListenerCollection*	pCollection;
 
-	sal_Bool IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape) const;
 	void CreateChartListener(ScDocument* pDoc,
 		const rtl::OUString& rName,
-		const rtl::OUString* pRangeList);
-    void GetNewShapeSizePos(ScDocument* pDoc, const Rectangle& rStartRect,
-                            const com::sun::star::table::CellAddress& rEndCell,
-                            com::sun::star::awt::Point& rPoint, com::sun::star::awt::Size& rSize,
-                            sal_Int32& rEndX, sal_Int32& rEndY) const;
+		const rtl::OUString& rRangeList);
 public:
-	ScMyShapeResizer(ScXMLImport& rImport);
-	~ScMyShapeResizer();
+	ScMyOLEFixer(ScXMLImport& rImport);
+	~ScMyOLEFixer();
 
-	void	AddShape(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
-					rtl::OUString* pRangeList,
-					com::sun::star::table::CellAddress& rStartAddress,
-					com::sun::star::table::CellAddress& rEndAddress,
-					sal_Int32 nEndX, sal_Int32 nEndY);
-	void	ResizeShapes();
+	static sal_Bool IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape);
+	void	AddOLE(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
+					const rtl::OUString &rRangeList);
+	void	FixupOLEs();
 };
 
 #endif
diff -ru sc.orig/source/ui/Accessibility/AccessibleDocument.cxx sc/source/ui/Accessibility/AccessibleDocument.cxx
--- sc.orig/source/ui/Accessibility/AccessibleDocument.cxx	2009-06-04 12:39:41.000000000 +0100
+++ sc/source/ui/Accessibility/AccessibleDocument.cxx	2009-06-04 12:40:23.000000000 +0100
@@ -44,6 +44,7 @@
 #include "drawview.hxx"
 #include "gridwin.hxx"
 #include "AccessibleEditObject.hxx"
+#include "userdat.hxx"
 #include "scresid.hxx"
 #ifndef SC_SC_HRC
 #include "sc.hrc"
@@ -1017,35 +1018,10 @@
         uno::Reference<beans::XPropertySet> xShapeProp(xShape, uno::UNO_QUERY);
 	    if (pShapeImp && xShapeProp.is())
 	    {
-		    SdrObject *pSdrObj = pShapeImp->GetSdrObject();
-		    if (pSdrObj)
+		    if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
 		    {
-			    if (ScDrawLayer::GetAnchor(pSdrObj) == SCA_CELL)
-			    {
-                    ScDocument* pDoc = mpViewShell->GetViewData()->GetDocument();
-				    if (pDoc)
-				    {
-                        rtl::OUString sCaptionShape(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape"));
-					    awt::Point aPoint(xShape->getPosition());
-					    awt::Size aSize(xShape->getSize());
-					    rtl::OUString sType(xShape->getShapeType());
-					    Rectangle aRectangle(aPoint.X, aPoint.Y, aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
-					    if ( sType.equals(sCaptionShape) )
-					    {
-						    awt::Point aRelativeCaptionPoint;
-                            rtl::OUString sCaptionPoint( RTL_CONSTASCII_USTRINGPARAM( "CaptionPoint" ));
-						    xShapeProp->getPropertyValue( sCaptionPoint ) >>= aRelativeCaptionPoint;
-						    Point aCoreRelativeCaptionPoint(aRelativeCaptionPoint.X, aRelativeCaptionPoint.Y);
-						    Point aCoreAbsoluteCaptionPoint(aPoint.X, aPoint.Y);
-						    aCoreAbsoluteCaptionPoint += aCoreRelativeCaptionPoint;
-						    aRectangle.Union(Rectangle(aCoreAbsoluteCaptionPoint, aCoreAbsoluteCaptionPoint));
-					    }
-					    ScRange aRange = pDoc->GetRange(mpAccessibleDocument->getVisibleTable(), aRectangle);
-                        pAddress = new ScAddress(aRange.aStart);
-				    }
-			    }
-//			    else
-//				    do nothing, because it is always a NULL Pointer
+				if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData(pSdrObj))
+					return new ScAddress(pAnchor->maStart);
 		    }
 	    }
     }
diff -ru sc.orig/source/ui/drawfunc/drawsh2.cxx sc/source/ui/drawfunc/drawsh2.cxx
--- sc.orig/source/ui/drawfunc/drawsh2.cxx	2009-06-04 12:39:40.000000000 +0100
+++ sc/source/ui/drawfunc/drawsh2.cxx	2009-06-04 12:40:23.000000000 +0100
@@ -115,7 +115,7 @@
 
 	if ( !bDisableAnchor )
 	{
-	    switch( pView->GetAnchor() )
+	    switch( pView->GetAnchorType() )
 	    {
 		case SCA_PAGE:
 	        rSet.Put( SfxBoolItem( SID_ANCHOR_PAGE, TRUE ) );
diff -ru sc.orig/source/ui/drawfunc/drawsh5.cxx sc/source/ui/drawfunc/drawsh5.cxx
--- sc.orig/source/ui/drawfunc/drawsh5.cxx	2009-06-04 12:39:40.000000000 +0100
+++ sc/source/ui/drawfunc/drawsh5.cxx	2009-06-04 12:40:23.000000000 +0100
@@ -397,26 +397,26 @@
             break;
 
         case SID_ANCHOR_PAGE:
-            pView->SetAnchor( SCA_PAGE );
+            pView->SetPageAnchored();
             rBindings.Invalidate( SID_ANCHOR_PAGE );
             rBindings.Invalidate( SID_ANCHOR_CELL );
             break;
 
         case SID_ANCHOR_CELL:
-            pView->SetAnchor( SCA_CELL );
+            pView->SetCellAnchored();
             rBindings.Invalidate( SID_ANCHOR_PAGE );
             rBindings.Invalidate( SID_ANCHOR_CELL );
             break;
 
         case SID_ANCHOR_TOGGLE:
             {
-                switch( pView->GetAnchor() )
+                switch( pView->GetAnchorType() )
                 {
                     case SCA_CELL:
-                    pView->SetAnchor( SCA_PAGE );
+                    pView->SetPageAnchored();
                     break;
                     default:
-                    pView->SetAnchor( SCA_CELL );
+                    pView->SetCellAnchored();
                     break;
                 }
             }
diff -ru sc.orig/source/ui/inc/drawview.hxx sc/source/ui/inc/drawview.hxx
--- sc.orig/source/ui/inc/drawview.hxx	2009-06-04 12:39:46.000000000 +0100
+++ sc/source/ui/inc/drawview.hxx	2009-06-04 12:40:23.000000000 +0100
@@ -100,8 +100,9 @@
 
 	void			CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const;
 
-	void			SetAnchor( ScAnchorType );
-	ScAnchorType	GetAnchor() const;
+	void			SetPageAnchored();
+	void			SetCellAnchored();
+	ScAnchorType	GetAnchorType() const;
 
 	void			VCAddWin( Window* pWin );
 	void			VCRemoveWin( Window* pWin );
diff -ru sc.orig/source/ui/unoobj/shapeuno.cxx sc/source/ui/unoobj/shapeuno.cxx
--- sc.orig/source/ui/unoobj/shapeuno.cxx	2009-06-04 12:39:29.000000000 +0100
+++ sc/source/ui/unoobj/shapeuno.cxx	2009-06-04 12:40:23.000000000 +0100
@@ -365,20 +365,9 @@
                                 table::CellRangeAddress aAddress = xRangeAdd->getRangeAddress();
                                 if (nTab == aAddress.Sheet)
                                 {
-                                    if (aAddress.StartRow != aAddress.EndRow) //should be a Spreadsheet
-                                    {
-                                        DBG_ASSERT(aAddress.StartRow == 0 && aAddress.EndRow == MAXROW &&
-                                            aAddress.StartColumn == 0 && aAddress.EndColumn == MAXCOL, "here should be a XSpreadsheet");
-			                            ScDrawLayer::SetAnchor(pObj, SCA_PAGE);
-                                    }
-                                    else
-                                    {
-                                        DBG_ASSERT(aAddress.StartRow == aAddress.EndRow &&
-                                            aAddress.StartColumn == aAddress.EndColumn, "here should be a XCell");
-			                            ScDrawLayer::SetAnchor(pObj, SCA_CELL);
-                                    }
                                     Rectangle aRect(pDoc->GetMMRect( static_cast<SCCOL>(aAddress.StartColumn), static_cast<SCROW>(aAddress.StartRow),
                                         static_cast<SCCOL>(aAddress.EndColumn), static_cast<SCROW>(aAddress.EndRow), aAddress.Sheet ));
+                                    awt::Point aRelPoint;
                                     uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
                                     if (xShape.is())
                                     {
@@ -397,7 +386,8 @@
                                         awt::Size aUnoSize;
                                         awt::Point aCaptionPoint;
                                         ScRange aRange;
-                                        awt::Point aUnoPoint(lcl_GetRelativePos( xShape, pDoc, nTab, aRange, aUnoSize, aCaptionPoint ));
+                                        aRelPoint = lcl_GetRelativePos( xShape, pDoc, nTab, aRange, aUnoSize, aCaptionPoint );
+                                        awt::Point aUnoPoint(aRelPoint);
 
                                         aUnoPoint.X += aPoint.X();
                                         aUnoPoint.Y += aPoint.Y();
@@ -426,6 +416,24 @@
                                         xShape->setPosition(aUnoPoint);
                                         pDocSh->SetModified();
                                     }
+
+                                    if (aAddress.StartRow != aAddress.EndRow) //should be a Spreadsheet
+                                    {
+                                        DBG_ASSERT(aAddress.StartRow == 0 && aAddress.EndRow == MAXROW &&
+                                            aAddress.StartColumn == 0 && aAddress.EndColumn == MAXCOL, "here should be a XSpreadsheet");
+			                            ScDrawLayer::SetPageAnchored(*pObj);
+                                    }
+                                    else
+                                    {
+                                        DBG_ASSERT(aAddress.StartRow == aAddress.EndRow &&
+                                            aAddress.StartColumn == aAddress.EndColumn, "here should be a XCell");
+			                            ScDrawObjData aAnchor;
+										aAnchor.maStart = ScAddress(aAddress.StartColumn, aAddress.StartRow, aAddress.Sheet);
+										aAnchor.maStartOffset = Point(aRelPoint.X, aRelPoint.Y);
+			                            ScDrawLayer::SetCellAnchored(*pObj, aAnchor);
+			                            //Currently we've only got a start anchor, not an end-anchor, so generate that now
+			                            ScDrawLayer::UpdateCellAnchorFromPositionEnd(*pObj, *pDoc, aAddress.Sheet);
+                                    }
                                 }
 					        }
 				        }
@@ -485,7 +493,7 @@
                                 uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
                                 if (xShape.is())
                                 {
-                                    if (ScDrawLayer::GetAnchor(pObj) == SCA_PAGE)
+                                    if (ScDrawLayer::GetAnchorType(*pObj) == SCA_PAGE)
                                     {
                                         awt::Point aPoint(xShape->getPosition());
                                         awt::Size aSize(xShape->getSize());
@@ -512,7 +520,7 @@
                                         xShape->setPosition(aPoint);
                                         pDocSh->SetModified();
                                     }
-                                    else if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+                                    else if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
                                     {
                                         awt::Size aUnoSize;
                                         awt::Point aCaptionPoint;
@@ -583,7 +591,7 @@
                                 uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
                                 if (xShape.is())
                                 {
-                                    if (ScDrawLayer::GetAnchor(pObj) == SCA_PAGE)
+                                    if (ScDrawLayer::GetAnchorType(*pObj) == SCA_PAGE)
                                     {
                                         awt::Point aPoint = xShape->getPosition();
                                         awt::Point aCaptionPoint;
@@ -596,7 +604,7 @@
                                         xShape->setPosition(aPoint);
                                         pDocSh->SetModified();
                                     }
-                                    else if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+                                    else if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
                                     {
                                         awt::Size aUnoSize;
                                         awt::Point aCaptionPoint;
@@ -663,23 +671,10 @@
 				        {
 					        ScDocShell* pDocSh = (ScDocShell*)pObjSh;
                 		    uno::Reference< uno::XInterface > xAnchor;
-			                if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
-                            {
-                                uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
-                                if (xShape.is())
-                                {
-                                    awt::Size aUnoSize;
-                                    awt::Point aCaptionPoint;
-                                    ScRange aRange;
-                                    awt::Point aUnoPoint(lcl_GetRelativePos( xShape, pDoc, nTab, aRange, aUnoSize, aCaptionPoint ));
-
-    						        xAnchor.set(static_cast<cppu::OWeakObject*>(new ScCellObj( pDocSh, aRange.aStart )));
-                                }
-                            }
+			                if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjDataTab(pObj, nTab))
+    						    xAnchor.set(static_cast<cppu::OWeakObject*>(new ScCellObj( pDocSh, pAnchor->maStart)));
                             else
-                            {
     						    xAnchor.set(static_cast<cppu::OWeakObject*>(new ScTableSheetObj( pDocSh, nTab )));
-                            }
                             aAny <<= xAnchor;
                         }
 					}
@@ -722,7 +717,7 @@
                         uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
                         if (xShape.is())
                         {
-			                if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+			                if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
                             {
                                 awt::Size aUnoSize;
                                 awt::Point aCaptionPoint;
@@ -782,7 +777,7 @@
                         if (xShape.is())
                         {
                 		    uno::Reference< uno::XInterface > xAnchor;
-			                if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+			                if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
                             {
                                 awt::Size aUnoSize;
                                 awt::Point aCaptionPoint;
diff -ru sc.orig/source/ui/view/drawvie3.cxx sc/source/ui/view/drawvie3.cxx
--- sc.orig/source/ui/view/drawvie3.cxx	2009-06-04 12:39:42.000000000 +0100
+++ sc/source/ui/view/drawvie3.cxx	2009-06-05 08:47:05.000000000 +0100
@@ -77,7 +77,7 @@
 
 // Verankerung setzen
 
-void ScDrawView::SetAnchor( ScAnchorType eType )
+void ScDrawView::SetPageAnchored()
 {
 	SdrObject* pObj = NULL;
 	if( AreObjectsMarked() )
@@ -87,7 +87,7 @@
 		for( ULONG i=0; i<nCount; i++ )
 		{
 			pObj = pMark->GetMark(i)->GetMarkedSdrObj();
-			ScDrawLayer::SetAnchor( pObj, eType );
+			ScDrawLayer::SetPageAnchored( *pObj );
 		}
 
 		if ( pViewData )
@@ -95,7 +95,28 @@
 	}
 }
 
-ScAnchorType ScDrawView::GetAnchor() const
+void ScDrawView::SetCellAnchored()
+{
+    if (!pDoc)
+        return;
+
+	SdrObject* pObj = NULL;
+	if( AreObjectsMarked() )
+	{
+		const SdrMarkList* pMark = &GetMarkedObjectList();
+		ULONG nCount = pMark->GetMarkCount();
+		for( ULONG i=0; i<nCount; i++ )
+		{
+			pObj = pMark->GetMark(i)->GetMarkedSdrObj();
+			ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, nTab);
+		}
+
+		if ( pViewData )
+			pViewData->GetDocShell()->SetDrawModified();
+	}
+}
+
+ScAnchorType ScDrawView::GetAnchorType() const
 {
 	BOOL bPage = FALSE;
 	BOOL bCell = FALSE;
@@ -108,7 +129,7 @@
 		for( ULONG i=0; i<nCount; i++ )
 		{
 			pObj = pMark->GetMark(i)->GetMarkedSdrObj();
-			if( ScDrawLayer::GetAnchor( pObj ) == SCA_CELL )
+			if( ScDrawLayer::GetAnchorType( *pObj ) == SCA_CELL )
 				bCell =TRUE;
 			else
 				bPage = TRUE;
@@ -138,6 +159,20 @@
 		if ( nTab == ((ScTabSizeChangedHint&)rHint).GetTab() )
 			UpdateWorkArea();
 	}
+	else if ( rHint.ISA( SdrHint ) )
+	{
+		if (const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint ))
+		{
+			//Update the anchors of any object that is cell anchored which has
+			//been moved since the last anchors for its position was calculated
+			if (pSdrHint->GetKind() == HINT_OBJCHG || pSdrHint->GetKind() == HINT_OBJINSERTED)
+				if (SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject()))
+					if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData(pObj))
+						if (pAnchor->maLastRect != pObj->GetLogicRect())
+							ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, nTab);
+		}
+		FmFormView::Notify( rBC,rHint );
+	}
 	else
 		FmFormView::Notify( rBC,rHint );
 }
diff -ru sc.orig/source/ui/view/drawview.cxx sc/source/ui/view/drawview.cxx
--- sc.orig/source/ui/view/drawview.cxx	2009-06-04 12:39:41.000000000 +0100
+++ sc/source/ui/view/drawview.cxx	2009-06-04 12:40:23.000000000 +0100
@@ -164,40 +164,11 @@
 	UINT32 nCount = rMrkList.GetMarkCount();
 	for(UINT32 nPos=0; nPos<nCount; nPos++ )
 	{
-		const SdrObject* pObj = rMrkList.GetMark(nPos)->GetMarkedSdrObj();
-		if(ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+		SdrObject* pObj = rMrkList.GetMark(nPos)->GetMarkedSdrObj();
+		if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjDataTab(pObj, nTab))
 		{
-			const INT32 nDelta = 1;
-
-			Rectangle aBoundRect = pObj->GetCurrentBoundRect();
-			Point aPos;
-			if (bNegativePage)
-			{
-				aPos = aBoundRect.TopRight();
-				aPos.X() = -aPos.X();			// so the loop below is the same
-			}
-			else
-				aPos = aBoundRect.TopLeft();
-			long nPosX = (long) (aPos.X() / HMM_PER_TWIPS) + nDelta;
-			long nPosY = (long) (aPos.Y() / HMM_PER_TWIPS) + nDelta;
-
-			SCCOL nCol;
-			INT32 nWidth = 0;
-
-			for(nCol=0; nCol<=MAXCOL && nWidth<=nPosX; nCol++)
-				nWidth += pDoc->GetColWidth(nCol,nTab);
-
-			if(nCol > 0)
-				--nCol;
-
-            SCROW nRow = nPosY <= 0 ? 0 : pDoc->FastGetRowForHeight( nTab,
-                    (ULONG) nPosY);
-			if(nRow > 0)
-				--nRow;
-
-			ScTabView* pView = pViewData->GetView();
-			ScAddress aScAddress(nCol, nRow, nTab);
-			pView->CreateAnchorHandles(aHdl, aScAddress);
+			if (ScTabView* pView = pViewData->GetView())
+				pView->CreateAnchorHandles(aHdl, pAnchor->maStart);
 		}
 	}
 }

openoffice.org-3.1.0.ooo102142.sd.resleak.patch:
 BasicViewFactory.cxx |    3 ++-
 BasicViewFactory.hxx |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

--- NEW FILE openoffice.org-3.1.0.ooo102142.sd.resleak.patch ---
diff -ru sd.orig/source/ui/framework/factories/BasicViewFactory.cxx sd/source/ui/framework/factories/BasicViewFactory.cxx
--- sd.orig/source/ui/framework/factories/BasicViewFactory.cxx	2009-05-25 09:21:53.000000000 +0100
+++ sd/source/ui/framework/factories/BasicViewFactory.cxx	2009-05-25 10:03:48.000000000 +0100
@@ -145,7 +145,8 @@
       mpBase(NULL),
       mpFrameView(NULL),
       mpViewCache(new ViewCache()),
-      mxLocalPane(new Pane(Reference<XResourceId>(), new WorkWindow(NULL,WB_STDWORK)))
+      mpWindow(new WorkWindow(NULL,WB_STDWORK)),
+      mxLocalPane(new Pane(Reference<XResourceId>(), mpWindow.get()))
 {
     (void)rxContext;
 }
diff -ru sd.orig/source/ui/framework/factories/BasicViewFactory.hxx sd/source/ui/framework/factories/BasicViewFactory.hxx
--- sd.orig/source/ui/framework/factories/BasicViewFactory.hxx	2009-05-25 09:21:53.000000000 +0100
+++ sd/source/ui/framework/factories/BasicViewFactory.hxx	2009-05-25 11:20:23.000000000 +0100
@@ -123,6 +123,7 @@
     FrameView* mpFrameView;
 
     class ViewCache;
+    ::boost::shared_ptr<Window> mpWindow;
     ::boost::shared_ptr<ViewCache> mpViewCache;
 
     css::uno::Reference<css::drawing::framework::XPane> mxLocalPane;

openoffice.org-3.1.0.ooo104280.xmloff.lcl_IsAtEnd.wrong.patch:
 xmlnumfi.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE openoffice.org-3.1.0.ooo104280.xmloff.lcl_IsAtEnd.wrong.patch ---
--- xmloff/source/style/xmlnumfi.cxx.orig	2009-08-17 12:01:14.000000000 +0100
+++ xmloff/source/style/xmlnumfi.cxx	2009-08-17 12:01:17.000000000 +0100
@@ -2144,7 +2144,7 @@
     if ( nTokLen > nBufLen )
     	return sal_False;
 
-	sal_Int32 nStartPos = nTokLen - nBufLen;
+	sal_Int32 nStartPos = nBufLen - nTokLen;
 	for ( xub_StrLen nTokPos = 0; nTokPos < nTokLen; nTokPos++ )
 		if ( rToken.GetChar( nTokPos ) != rBuffer.charAt( nStartPos + nTokPos ) )
 			return sal_False;

openoffice.org-3.1.1.ooo104157.svx.crashonencryptparse.patch:
 svdfppt.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- NEW FILE openoffice.org-3.1.1.ooo104157.svx.crashonencryptparse.patch ---
--- svx.orig/source/svdraw/svdfppt.cxx	2009-08-27 17:13:39.000000000 +0100
+++ svx/source/svdraw/svdfppt.cxx	2009-08-27 17:13:43.000000000 +0100
@@ -1429,9 +1429,11 @@
     ePageColorsKind		( PPT_MASTERPAGE ),
     eAktPageKind		( PPT_MASTERPAGE )
 {
-	DffRecordHeader* pHd;
+    if (rParam.aCurrentUserAtom.nMagic == 0xF3D1C4Df) //encrypted                                               │
+        bOk = false;          
     if ( bOk )
 	{
+	    DffRecordHeader* pHd;
         rStCtrl.Seek( STREAM_SEEK_TO_END );
         nStreamLen = rStCtrl.Tell();
 

workspace.calc51.patch:
 sc/inc/cell.hxx                  |    9 +
 sc/inc/pch/precompiled_sc.hxx    |    3 
 sc/inc/progress.hxx              |   11 +
 sc/source/core/data/cell.cxx     |    2 
 sc/source/core/data/cell2.cxx    |  267 +++++++++++++++++++++++++++++++++++++++
 sc/source/core/data/table2.cxx   |    4 
 sc/source/core/tool/progress.cxx |    2 
 source/ui/view/viewfunc.cxx      |   16 +-
 8 files changed, 302 insertions(+), 12 deletions(-)

--- NEW FILE workspace.calc51.patch ---
diff -ru sc.orig/inc/progress.hxx sc/inc/progress.hxx
--- sc.orig/inc/progress.hxx	2009-06-09 11:02:35.000000000 +0100
+++ sc/inc/progress.hxx	2009-06-09 11:03:37.000000000 +0100
@@ -36,6 +36,17 @@
 
 class ScDocument;
 
+/*
+ * #i102566
+ * Drawing a progress bar update is not cheap, so if we draw it on every
+ * percentage change of 200 calculations we get one progress draw per 2
+ * calculations which is slower than doing the calculations themselves. So as a
+ * rough guide only do an update per MIN_NO_CODES_PER_PROGRESS_UPDATE
+ * calculations
+ */
+#define MIN_NO_CODES_PER_PROGRESS_UPDATE 100
+
+
 class SC_DLLPUBLIC ScProgress
 {
 private:
diff -ru sc.orig/source/core/data/cell.cxx sc/source/core/data/cell.cxx
--- sc.orig/source/core/data/cell.cxx	2009-06-09 11:01:11.000000000 +0100
+++ sc/source/core/data/cell.cxx	2009-06-09 11:04:45.000000000 +0100
@@ -1701,7 +1701,7 @@
 
         // Reschedule verlangsamt das ganze erheblich, nur bei Prozentaenderung ausfuehren
         ScProgress::GetInterpretProgress()->SetStateCountDownOnPercent(
-            pDocument->GetFormulaCodeInTree() );
+            pDocument->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE );
     }
     else
     {
diff -ru sc.orig/source/core/tool/progress.cxx sc/source/core/tool/progress.cxx
--- sc.orig/source/core/tool/progress.cxx	2009-06-09 11:01:11.000000000 +0100
+++ sc/source/core/tool/progress.cxx	2009-06-09 11:04:14.000000000 +0100
@@ -162,7 +162,7 @@
             if ( !pGlobalProgress )
                 pInterpretProgress = new ScProgress( pDoc->GetDocumentShell(),
                     ScGlobal::GetRscString( STR_PROGRESS_CALCULATING ),
-                    pDoc->GetFormulaCodeInTree(), FALSE, bWait );
+                    pDoc->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE, FALSE, bWait );
 			pInterpretDoc = pDoc;
 		}
 	}
--- sc.orig/source/ui/view/viewfunc.cxx	2009-06-10 13:59:18.000000000 +0100
+++ sc/source/ui/view/viewfunc.cxx	2009-06-10 13:59:23.000000000 +0100
@@ -753,12 +751,13 @@
 		ScPatternAttr* pCellAttrs = NULL;
 		EditTextObject* pNewData = NULL;
 		String aString;
+
+		const ScPatternAttr* pOldPattern = pDoc->GetPattern( nCol, nRow, nTab );
+		ScTabEditEngine aEngine( *pOldPattern, pDoc->GetEnginePool() );
+		aEngine.SetText(*pData);
+
 		if (bTestSimple)					// Testen, ob einfacher String ohne Attribute
 		{
-			const ScPatternAttr* pOldPattern = pDoc->GetPattern( nCol, nRow, nTab );
-			ScTabEditEngine aEngine( *pOldPattern, pDoc->GetEnginePool() );
-			aEngine.SetText(*pData);
-
 			ScEditAttrTester aAttrTester( &aEngine );
 			bSimple = !aAttrTester.NeedsObject();
 			bCommon = aAttrTester.NeedsCellAttr();
@@ -779,10 +778,9 @@
 				pCellAttrs->GetFromEditItemSet( &aAttrTester.GetAttribs() );
 				//!	remove common attributes from EditEngine?
 			}
+		}
 
-			if (bSimple)
-				aString = aEngine.GetText();
-		}
+		aString = ScEditUtil::GetSpaceDelimitedString(aEngine);
 
 		//
 		// 		Undo
@@ -840,7 +838,7 @@
 			{	// wg. ChangeTrack erst jetzt
 				pDocSh->GetUndoManager()->AddUndoAction(
 					new ScUndoEnterData( pDocSh, nCol, nRow, nTab, nPos, pTabs,
-										ppOldCells, NULL, NULL, String(),
+										ppOldCells, NULL, NULL, aString,
 										pUndoData ) );
 			}
 
Index: sc/source/core/data/table2.cxx
===================================================================
--- sc/source/core/data/table2.cxx	(revision 272843)
+++ sc/source/core/data/table2.cxx	(working copy)
@@ -2667,7 +2667,7 @@
 					pCell = aCol[nCol].GetCell( nRow );
 					if (pCell)
 						if ( pCell->GetCellType() == CELLTYPE_FORMULA )
-							if (((ScFormulaCell*)pCell)->HasOneReference( aRef ))
+							if (((ScFormulaCell*)pCell)->HasRefListExpressibleAsOneReference( aRef ))
 								if ( aRef.aStart.Col() == nCol && aRef.aEnd.Col() == nCol &&
 									 aRef.aStart.Tab() == nTab && aRef.aEnd.Tab() == nTab &&
 									 DiffSign( aRef.aStart.Row(), nRow ) ==
@@ -2698,7 +2698,7 @@
 			while ( aIter.Next( nRow, pCell ) && !bFound )
 			{
 				if ( pCell->GetCellType() == CELLTYPE_FORMULA )
-					if (((ScFormulaCell*)pCell)->HasOneReference( aRef ))
+					if (((ScFormulaCell*)pCell)->HasRefListExpressibleAsOneReference( aRef ))
 						if ( aRef.aStart.Row() == nRow && aRef.aEnd.Row() == nRow &&
 							 aRef.aStart.Tab() == nTab && aRef.aEnd.Tab() == nTab &&
 							 DiffSign( aRef.aStart.Col(), nCol ) ==
Index: sc/source/core/data/cell2.cxx
===================================================================
--- sc/source/core/data/cell2.cxx	(revision 272843)
+++ sc/source/core/data/cell2.cxx	(working copy)
@@ -34,6 +34,11 @@
 
 
 // INCLUDE ---------------------------------------------------------------
+#include <algorithm>
+#include <deque>
+
+#include <boost/bind.hpp>
+
 #include <vcl/mapmod.hxx>
 #include <svx/editobj.hxx>
 #include <svx/editstat.hxx>
@@ -175,6 +180,222 @@
 
 // ============================================================================
 
+namespace
+{
+
+using std::deque;
+
+typedef SCCOLROW(*DimensionSelector)(const ScSingleRefData&);
+
+
+static SCCOLROW lcl_GetCol(const ScSingleRefData& rData)
+{
+    return rData.nCol;
+}
+
+
+static SCCOLROW lcl_GetRow(const ScSingleRefData& rData)
+{
+    return rData.nRow;
+}
+
+
+static SCCOLROW lcl_GetTab(const ScSingleRefData& rData)
+{
+    return rData.nTab;
+}
+
+
+/** Check if both references span the same range in selected dimension.
+ */
+static bool
+lcl_checkRangeDimension(
+        const SingleDoubleRefProvider& rRef1,
+        const SingleDoubleRefProvider& rRef2,
+        const DimensionSelector aWhich)
+{
+    return
+        aWhich(rRef1.Ref1) == aWhich(rRef2.Ref1)
+        && aWhich(rRef1.Ref2) == aWhich(rRef2.Ref2);
+}
+
+
+static bool
+lcl_checkRangeDimensions(
+        const SingleDoubleRefProvider& rRef1,
+        const SingleDoubleRefProvider& rRef2,
+        bool& bCol, bool& bRow, bool& bTab)
+{
+    const bool bSameCols(lcl_checkRangeDimension(rRef1, rRef2, lcl_GetCol));
+    const bool bSameRows(lcl_checkRangeDimension(rRef1, rRef2, lcl_GetRow));
+    const bool bSameTabs(lcl_checkRangeDimension(rRef1, rRef2, lcl_GetTab));
+        
+    // Test if exactly two dimensions are equal
+    if (!(bSameCols ^ bSameRows ^ bSameTabs)
+            && (bSameCols || bSameRows || bSameTabs))
+    {
+        bCol = !bSameCols;
+        bRow = !bSameRows;
+        bTab = !bSameTabs;
+        return true;
+    }
+    return false;
+}
+
+
+/** Check if references in given reference list can possibly
+    form a range. To do that, two of their dimensions must be the same.
+ */
+static bool
+lcl_checkRangeDimensions(
+        const deque<ScToken*>::const_iterator aBegin,
+        const deque<ScToken*>::const_iterator aEnd,
+        bool& bCol, bool& bRow, bool& bTab)
+{
+    deque<ScToken*>::const_iterator aCur(aBegin);
+    ++aCur;
+    const SingleDoubleRefProvider aRef(**aBegin);
+    bool bOk(false);
+    {
+        const SingleDoubleRefProvider aRefCur(**aCur);
+        bOk = lcl_checkRangeDimensions(aRef, aRefCur, bCol, bRow, bTab);
+    }
+    while (bOk && aCur != aEnd)
+    {
+        const SingleDoubleRefProvider aRefCur(**aCur);
+        bool bColTmp(false);
+        bool bRowTmp(false);
+        bool bTabTmp(false);
+        bOk = lcl_checkRangeDimensions(aRef, aRefCur, bColTmp, bRowTmp, bTabTmp);
+        bOk = bOk && (bCol == bColTmp && bRow == bRowTmp && bTab == bTabTmp);
+        ++aCur;
+    }
+
+    if (bOk && aCur == aEnd)
+    {
+        bCol = bCol;
+        bRow = bRow;
+        bTab = bTab;
+        return true;
+    }
+    return false;
+}
+
+
+bool
+lcl_lessReferenceBy(
+        const ScToken* const pRef1, const ScToken* const pRef2,
+        const DimensionSelector aWhich)
+{
+    const SingleDoubleRefProvider rRef1(*pRef1);
+    const SingleDoubleRefProvider rRef2(*pRef2);
+    return aWhich(rRef1.Ref1) < aWhich(rRef2.Ref1);
+}
+
+
+/** Returns true if range denoted by token pRef2 starts immediately after
+    range denoted by token pRef1. Dimension, in which the comparison takes
+    place, is given by aWhich.
+ */
+bool
+lcl_isImmediatelyFollowing(
+        const ScToken* const pRef1, const ScToken* const pRef2,
+        const DimensionSelector aWhich)
+{
+    const SingleDoubleRefProvider rRef1(*pRef1);
+    const SingleDoubleRefProvider rRef2(*pRef2);
+    return aWhich(rRef2.Ref1) - aWhich(rRef1.Ref2) == 1;
+}
+
+
+static bool
+lcl_checkIfAdjacent(
+        const deque<ScToken*>& rReferences,
+        const DimensionSelector aWhich)
+{
+    typedef deque<ScToken*>::const_iterator Iter;
+    Iter aBegin(rReferences.begin());
+    Iter aEnd(rReferences.end());
+    Iter aBegin1(aBegin);
+    ++aBegin1, --aEnd;
+    return std::equal(
+            aBegin, aEnd, aBegin1,
+            boost::bind(lcl_isImmediatelyFollowing, _1, _2, aWhich));
+}
+
+
+static void
+lcl_fillRangeFromRefList(
+        const deque<ScToken*>& rReferences, ScRange& rRange)
+{
+    const ScSingleRefData aStart(
+            SingleDoubleRefProvider(*rReferences.front()).Ref1);
+    rRange.aStart.Set(aStart.nCol, aStart.nRow, aStart.nTab);
+    const ScSingleRefData aEnd(
+            SingleDoubleRefProvider(*rReferences.back()).Ref2);
+    rRange.aEnd.Set(aEnd.nCol, aEnd.nRow, aEnd.nTab);
+}
+
+
+static bool
+lcl_refListFormsOneRange(
+        const ScAddress& aPos, deque<ScToken*>& rReferences,
+        ScRange& rRange)
+{
+    std::for_each(
+            rReferences.begin(), rReferences.end(),
+            bind(&ScToken::CalcAbsIfRel, _1, aPos))
+        ;
+    if (rReferences.size() == 1) {
+        lcl_fillRangeFromRefList(rReferences, rRange);
+        return true;
+    }
+
+    bool bCell(false);
+    bool bRow(false);
+    bool bTab(false);
+    if (lcl_checkRangeDimensions(rReferences.begin(), rReferences.end(),
+            bCell, bRow, bTab))
+    {
+        DimensionSelector aWhich;
+        if (bCell)
+        {
+            aWhich = lcl_GetCol;
+        }
+        else if (bRow)
+        {
+            aWhich = lcl_GetRow;
+        }
+        else if (bTab)
+        {
+            aWhich = lcl_GetTab;
+        }
+        else
+        {
+            OSL_ENSURE(false, "lcl_checkRangeDimensions shouldn't allow that!");
+        }
+        // Sort the references by start of range
+        std::sort(rReferences.begin(), rReferences.end(),
+                boost::bind(lcl_lessReferenceBy, _1, _2, aWhich));
+        if (lcl_checkIfAdjacent(rReferences, aWhich))
+        {
+            lcl_fillRangeFromRefList(rReferences, rRange);
+            return true;
+        }
+    }
+    return false;
+}
+
+
+bool lcl_isReference(const FormulaToken& rToken)
+{
+    return
+        rToken.GetType() == svSingleRef ||
+        rToken.GetType() == svDoubleRef;
+}
+
+}
+
 BOOL ScFormulaCell::IsEmpty()
 {
     if (IsDirtyOrInTableOpDirty() && pDocument->GetAutoCalc())
@@ -449,6 +670,52 @@
         return FALSE;
 }
 
+bool
+ScFormulaCell::HasRefListExpressibleAsOneReference(ScRange& rRange) const
+{
+    /* If there appears just one reference in the formula, it's the same
+       as HasOneReference(). If there are more of them, they can denote
+       one range if they are (sole) arguments of one function.
+       Union of these references must form one range and their
+       intersection must be empty set.
+    */
+    pCode->Reset();
+    // Get first reference, if any
+    ScToken* const pFirstReference(
+            dynamic_cast<ScToken*>(pCode->GetNextReferenceRPN()));
+    if (pFirstReference)
+    {
+        // Collect all consecutive references, starting by the one
+        // already found
+        std::deque<ScToken*> aReferences;
+        aReferences.push_back(pFirstReference);
+        FormulaToken* pToken(pCode->NextRPN());
+        FormulaToken* pFunction(0);
+        while (pToken)
+        {
+            if (lcl_isReference(*pToken))
+            {
+                aReferences.push_back(dynamic_cast<ScToken*>(pToken));
+                pToken = pCode->NextRPN();
+            }
+            else
+            {
+                if (pToken->IsFunction())
+                {
+                    pFunction = pToken;
+                }
+                break;
+            }
+        }
+        if (pFunction && !pCode->GetNextReferenceRPN()
+                && (pFunction->GetParamCount() == aReferences.size()))
+        {
+            return lcl_refListFormsOneRange(aPos, aReferences, rRange);
+        }
+    }
+    return false;
+}
+
 BOOL ScFormulaCell::HasRelNameReference() const
 {
     pCode->Reset();
Index: sc/inc/cell.hxx
===================================================================
--- sc/inc/cell.hxx	(revision 272843)
+++ sc/inc/cell.hxx	(working copy)
@@ -387,6 +387,15 @@
     inline USHORT   GetSeenInIteration() const { return nSeenInIteration; }
 
 	BOOL			HasOneReference( ScRange& r ) const;
+    /* Checks if the formula contains reference list that can be
+       expressed by one reference (like A1;A2;A3:A5 -> A1:A5). The
+       reference list is not required to be sorted (i.e. A3;A1;A2 is
+       still recognized as A1:A3), but no overlapping is allowed.
+       If one reference is recognized, the rRange is filled.
+
+       It is similar to HasOneReference(), but more general.
+     */
+    bool HasRefListExpressibleAsOneReference(ScRange& rRange) const;
 	BOOL			HasRelNameReference() const;
 	BOOL			HasColRowName() const;
 
Index: sc/inc/pch/precompiled_sc.hxx
===================================================================
--- sc/inc/pch/precompiled_sc.hxx	(revision 272843)
+++ sc/inc/pch/precompiled_sc.hxx	(working copy)
@@ -36,6 +36,7 @@
 
 #include <algorithm>
 #include <assert.h>
+#include <deque>
 #include <stdarg.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -49,6 +50,8 @@
 #include <new>
 #include <cfloat>
 
+#include <boost/bind.hpp>
+
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b3dpolygon.hxx>
 #include <basegfx/polygon/b3dpolypolygon.hxx>

workspace.cmcfixes59.patch:
 typesconfig.c |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

--- NEW FILE workspace.cmcfixes59.patch ---
Index: typesconfig/typesconfig.c
===================================================================
--- sal.orig/typesconfig/typesconfig.c	(revision 269860)
+++ sal/typesconfig/typesconfig.c	(working copy)
@@ -163,20 +163,26 @@
 |*	Letzte Aenderung
 |*
 *************************************************************************/
-static int dummy(void* unused);
+#if defined(IA64) || defined(ARM32)
 
 int GetAtAddress( Type eT, void* p )
 {
-#if defined(IA64) || defined(ARM32)
   switch ( eT )
   {
   case t_char:		return *((char*)p);
-  case t_short:		if ((long)p % sizeof(short)) abort(); else return *((short*)p);
-  case t_int:		if ((long)p % sizeof(int)) abort(); else return *((int*)p);
-  case t_long:		if ((long)p % sizeof(long)) abort(); else return *((long*)p);
-  case t_double:	if ((long)p % sizeof(double)) abort(); else return *((double*)p);
+  case t_short:		if ((long)p % sizeof(short)) raise(SIGBUS); else return *((short*)p);
+  case t_int:		if ((long)p % sizeof(int)) raise(SIGBUS); else return *((int*)p);
+  case t_long:		if ((long)p % sizeof(long)) raise(SIGBUS); else return *((long*)p);
+  case t_double:	if ((long)p % sizeof(double)) raise(SIGBUS); else return *((double*)p);
   }
+  abort();
+}
+
 #else
+static int dummy(void* unused);
+
+int GetAtAddress( Type eT, void* p )
+{
   switch ( eT )
   {
   case t_char: { char x = *(char*)p; return dummy(&x); }
@@ -185,7 +191,6 @@
   case t_long: { long x = *(long*)p; return dummy(&x); }
   case t_double: { double x = *(double*)p; return dummy(&x); }
   }
-#endif
   abort();
 }
 
@@ -195,6 +200,7 @@
     return 0;
 }
 
+#endif
 /*************************************************************************
 |*
 |*	SetAtAddress()

workspace.cmcfixes60.patch:
 mailmrge.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

--- NEW FILE workspace.cmcfixes60.patch ---
Index: sw/source/ui/envelp/mailmrge.cxx
===================================================================
--- sw/source/ui/envelp/mailmrge.cxx	(revision 272843)
+++ sw/source/ui/envelp/mailmrge.cxx	(working copy)
@@ -402,6 +402,8 @@
     aLk = LINK(this, SwMailMergeDlg, ModifyHdl);
 	aFromNF.SetModifyHdl(aLk);
 	aToNF.SetModifyHdl(aLk);
+    aFromNF.SetMax(SAL_MAX_INT32);
+    aToNF.SetMax(SAL_MAX_INT32);
 
     SwNewDBMgr* pNewDBMgr = rSh.GetNewDBMgr();
     if(_xConnection.is())
@@ -783,19 +785,20 @@
 
 	if (aFromRB.IsChecked())	// Liste Einfuegen
 	{
-        ULONG nStart = static_cast< ULONG >(aFromNF.GetValue());
-        ULONG nEnd   = static_cast< ULONG >(aToNF.GetValue());
+        // Safe: the maximal value of the fields is limited
+        sal_Int32 nStart = sal::static_int_cast<sal_Int32>(aFromNF.GetValue());
+        sal_Int32 nEnd   = sal::static_int_cast<sal_Int32>(aToNF.GetValue());
 
 		if (nEnd < nStart)
 		{
-			ULONG nZw = nEnd;
+			const sal_Int32 nZw = nEnd;
 			nEnd = nStart;
 			nStart = nZw;
 		}
 
 		m_aSelection.realloc(nEnd - nStart + 1);
 		Any* pSelection = m_aSelection.getArray();
-		for (ULONG i = nStart; i <= nEnd; ++i, ++pSelection)
+		for (sal_Int32 i = nStart; i != nEnd; ++i, ++pSelection)
 			*pSelection <<= i;
 	}
     else if (aAllRB.IsChecked() )

workspace.cmcfixes61.patch:
 canvas/source/cairo/cairo_canvashelper.cxx |    2 -
 svx/inc/svx/xcolit.hxx                     |    2 -
 svx/inc/svx/xflclit.hxx                    |    2 -
 svx/inc/svx/xflftrit.hxx                   |    2 -
 svx/inc/svx/xflgrit.hxx                    |    2 -
 svx/inc/svx/xflhtit.hxx                    |    2 -
 svx/inc/svx/xftshcit.hxx                   |    2 -
 svx/inc/svx/xit.hxx                        |    8 ++--
 svx/inc/svx/xlnclit.hxx                    |    2 -
 svx/inc/svx/xlndsit.hxx                    |    2 -
 svx/inc/svx/xlnedit.hxx                    |    2 -
 svx/inc/svx/xlnstit.hxx                    |    2 -
 svx/inc/svx/xsflclit.hxx                   |    2 -
 svx/source/xoutdev/xattr.cxx               |   50 +++++++++++++++--------------
 14 files changed, 42 insertions(+), 40 deletions(-)

--- NEW FILE workspace.cmcfixes61.patch ---
Avoid subpixel clipping for cairocanvas. nobody is expecting this.

From: Thorsten Behrens <thb at openoffice.org>


---

 canvas/source/cairo/cairo_canvashelper.cxx |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git canvas/source/cairo/cairo_canvashelper.cxx canvas/source/cairo/cairo_canvashelper.cxx
index 3b3571a..9684b8d 100644
--- canvas/source/cairo/cairo_canvashelper.cxx
+++ canvas/source/cairo/cairo_canvashelper.cxx
@@ -888,7 +888,7 @@ namespace cairocanvas
 		    nY = aP.getY();
 		    cairo_matrix_transform_point( &aOrigMatrix, &nX, &nY );
 
- 		    if( ! bIsBezier && bIsRectangle ) {
+ 		    if( ! bIsBezier && (bIsRectangle || aOperation == Clip) ) {
                 nX = basegfx::fround( nX );
                 nY = basegfx::fround( nY );
 		    }
diff -ru svx.orig/inc/svx/xcolit.hxx svx/inc/svx/xcolit.hxx
--- svx.orig/inc/svx/xcolit.hxx	2009-07-09 15:28:15.000000000 +0100
+++ svx/inc/svx/xcolit.hxx	2009-07-09 16:34:22.000000000 +0100
@@ -48,7 +48,7 @@
 public:
 			TYPEINFO();
 			XColorItem() {}
-			XColorItem(USHORT nWhich, long nIndex, const Color& rTheColor);
+			XColorItem(USHORT nWhich, INT32 nIndex, const Color& rTheColor);
 
 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
diff -ru svx.orig/inc/svx/xflclit.hxx svx/inc/svx/xflclit.hxx
--- svx.orig/inc/svx/xflclit.hxx	2009-07-09 15:28:15.000000000 +0100
+++ svx/inc/svx/xflclit.hxx	2009-07-09 16:32:16.000000000 +0100
@@ -46,7 +46,7 @@
 public:
 			TYPEINFO();
 			XFillColorItem() {}
-			XFillColorItem(long nIndex, const Color& rTheColor);
+			XFillColorItem(INT32 nIndex, const Color& rTheColor);
 			XFillColorItem(const String& rName, const Color& rTheColor);
 			XFillColorItem(SvStream& rIn);
 
diff -ru svx.orig/inc/svx/xflftrit.hxx svx/inc/svx/xflftrit.hxx
--- svx.orig/inc/svx/xflftrit.hxx	2009-07-09 15:28:15.000000000 +0100
+++ svx/inc/svx/xflftrit.hxx	2009-07-09 16:11:19.000000000 +0100
@@ -50,7 +50,7 @@
 							TYPEINFO();
 
 							XFillFloatTransparenceItem();
-							XFillFloatTransparenceItem( long nIndex, const XGradient& rGradient, BOOL bEnable = TRUE );
+							XFillFloatTransparenceItem( INT32 nIndex, const XGradient& rGradient, BOOL bEnable = TRUE );
 							XFillFloatTransparenceItem(const String& rName, const XGradient& rGradient, BOOL bEnable = TRUE );
 							XFillFloatTransparenceItem(SfxItemPool* pPool, const XGradient& rTheGradient, BOOL bEnable = TRUE );
 							XFillFloatTransparenceItem(SfxItemPool* pPool );
diff -ru svx.orig/inc/svx/xflgrit.hxx svx/inc/svx/xflgrit.hxx
--- svx.orig/inc/svx/xflgrit.hxx	2009-07-09 15:28:12.000000000 +0100
+++ svx/inc/svx/xflgrit.hxx	2009-07-09 16:31:03.000000000 +0100
@@ -47,7 +47,7 @@
 public:
 			TYPEINFO();
 			XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {}
-			XFillGradientItem(long nIndex, const XGradient& rTheGradient);
+			XFillGradientItem(INT32 nIndex, const XGradient& rTheGradient);
 			XFillGradientItem(const UniString& rName, const XGradient& rTheGradient);
 			XFillGradientItem(SfxItemPool* pPool, const XGradient& rTheGradient);
 			XFillGradientItem(SfxItemPool* pPool );
diff -ru svx.orig/inc/svx/xflhtit.hxx svx/inc/svx/xflhtit.hxx
--- svx.orig/inc/svx/xflhtit.hxx	2009-07-09 15:28:13.000000000 +0100
+++ svx/inc/svx/xflhtit.hxx	2009-07-09 16:11:08.000000000 +0100
@@ -47,7 +47,7 @@
 public:
 							TYPEINFO();
 							XFillHatchItem() : NameOrIndex(XATTR_FILLHATCH, -1) {}
-							XFillHatchItem(long nIndex, const XHatch& rTheHatch);
+							XFillHatchItem(INT32 nIndex, const XHatch& rTheHatch);
 							XFillHatchItem(const String& rName, const XHatch& rTheHatch);
 							XFillHatchItem(SfxItemPool* pPool, const XHatch& rTheHatch);
 							XFillHatchItem(SfxItemPool* pPool );
diff -ru svx.orig/inc/svx/xftshcit.hxx svx/inc/svx/xftshcit.hxx
--- svx.orig/inc/svx/xftshcit.hxx	2009-07-09 15:28:12.000000000 +0100
+++ svx/inc/svx/xftshcit.hxx	2009-07-09 16:10:52.000000000 +0100
@@ -45,7 +45,7 @@
 public:
 			TYPEINFO();
 			XFormTextShadowColorItem() {}
-			XFormTextShadowColorItem(long nIndex, const Color& rTheColor);
+			XFormTextShadowColorItem(INT32 nIndex, const Color& rTheColor);
 			XFormTextShadowColorItem(const String& rName, const Color& rTheColor);
 			XFormTextShadowColorItem(SvStream& rIn);
 
diff -ru svx.orig/inc/svx/xit.hxx svx/inc/svx/xit.hxx
--- svx.orig/inc/svx/xit.hxx	2009-07-09 15:28:12.000000000 +0100
+++ svx/inc/svx/xit.hxx	2009-07-09 15:29:13.000000000 +0100
@@ -54,7 +54,7 @@
 //-------------------
 class SVX_DLLPUBLIC NameOrIndex : public SfxStringItem
 {
-	long    nPalIndex;
+	INT32    nPalIndex;
 
 protected:
 	void    Detach()    { nPalIndex = -1; }
@@ -62,7 +62,7 @@
 public:
 			TYPEINFO();
 			NameOrIndex() { nPalIndex = -1; }
-			NameOrIndex(USHORT nWhich, long nIndex);
+			NameOrIndex(USHORT nWhich, INT32 nIndex);
 			NameOrIndex(USHORT nWhich,
 						const String& rName= String());
 			NameOrIndex(USHORT nWhich, SvStream& rIn);
@@ -76,8 +76,8 @@
 
 			String       GetName() const              { return GetValue();   }
 			void         SetName(const String& rName) { SetValue(rName);     }
-			long         GetIndex() const             { return nPalIndex;    }
-			void         SetIndex(long nIndex)        { nPalIndex = nIndex;  }
+			INT32        GetIndex() const             { return nPalIndex;    }
+			void         SetIndex(INT32 nIndex)        { nPalIndex = nIndex;  }
 			BOOL         IsIndex() const          { return (nPalIndex >= 0); }
 
 	/** this static checks if the given NameOrIndex item has a unique name for its value.
diff -ru svx.orig/inc/svx/xlnclit.hxx svx/inc/svx/xlnclit.hxx
--- svx.orig/inc/svx/xlnclit.hxx	2009-07-09 15:28:15.000000000 +0100
+++ svx/inc/svx/xlnclit.hxx	2009-07-09 16:34:06.000000000 +0100
@@ -42,7 +42,7 @@
 public:
 			TYPEINFO();
 			XLineColorItem() {}
-			XLineColorItem(long nIndex, const Color& rTheColor);
+			XLineColorItem(INT32 nIndex, const Color& rTheColor);
 			XLineColorItem(const String& rName, const Color& rTheColor);
 			XLineColorItem(SvStream& rIn);
 
diff -ru svx.orig/inc/svx/xlndsit.hxx svx/inc/svx/xlndsit.hxx
--- svx.orig/inc/svx/xlndsit.hxx	2009-07-09 15:28:12.000000000 +0100
+++ svx/inc/svx/xlndsit.hxx	2009-07-09 16:34:14.000000000 +0100
@@ -50,7 +50,7 @@
 public:
 							TYPEINFO();
 							XLineDashItem() : NameOrIndex(XATTR_LINEDASH, -1) {}
-							XLineDashItem(long nIndex, const XDash& rTheDash);
+							XLineDashItem(INT32 nIndex, const XDash& rTheDash);
 							XLineDashItem(const String& rName, const XDash& rTheDash);
 							XLineDashItem(SfxItemPool* pPool, const XDash& rTheDash);
 							XLineDashItem(SfxItemPool* pPool );
diff -ru svx.orig/inc/svx/xlnedit.hxx svx/inc/svx/xlnedit.hxx
--- svx.orig/inc/svx/xlnedit.hxx	2009-07-09 15:28:14.000000000 +0100
+++ svx/inc/svx/xlnedit.hxx	2009-07-09 16:31:26.000000000 +0100
@@ -46,7 +46,7 @@
 
 public:
 			TYPEINFO();
-			XLineEndItem(long nIndex = -1);
+			XLineEndItem(INT32 nIndex = -1);
 			XLineEndItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon);
 			XLineEndItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon);
 			XLineEndItem(SfxItemPool* pPool );
diff -ru svx.orig/inc/svx/xlnstit.hxx svx/inc/svx/xlnstit.hxx
--- svx.orig/inc/svx/xlnstit.hxx	2009-07-09 15:28:14.000000000 +0100
+++ svx/inc/svx/xlnstit.hxx	2009-07-09 16:32:26.000000000 +0100
@@ -46,7 +46,7 @@
 
 public:
 			TYPEINFO();
-			XLineStartItem(long nIndex = -1);
+			XLineStartItem(INT32 nIndex = -1);
 			XLineStartItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon);
 			XLineStartItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon);
 			XLineStartItem(SfxItemPool* pPool );
diff -ru svx.orig/inc/svx/xsflclit.hxx svx/inc/svx/xsflclit.hxx
--- svx.orig/inc/svx/xsflclit.hxx	2009-07-09 15:28:15.000000000 +0100
+++ svx/inc/svx/xsflclit.hxx	2009-07-09 16:31:12.000000000 +0100
@@ -41,7 +41,7 @@
 public:
 			TYPEINFO();
 			XSecondaryFillColorItem() {}
-			XSecondaryFillColorItem(long nIndex, const Color& rTheColor);
+			XSecondaryFillColorItem(INT32 nIndex, const Color& rTheColor);
 			XSecondaryFillColorItem(const String& rName, const Color& rTheColor);
 			XSecondaryFillColorItem(SvStream& rIn);
 
diff -ru svx.orig/source/xoutdev/xattr.cxx svx/source/xoutdev/xattr.cxx
--- svx.orig/source/xoutdev/xattr.cxx	2009-07-09 15:26:56.000000000 +0100
+++ svx/source/xoutdev/xattr.cxx	2009-07-09 16:32:04.000000000 +0100
@@ -66,6 +66,8 @@
 #include <basegfx/point/b2dpoint.hxx>
 #include <basegfx/vector/b2dvector.hxx>
 
+#include <stdio.h>
+
 using namespace ::rtl;
 using namespace ::com::sun::star;
 
@@ -108,7 +110,7 @@
 
 /*************************************************************************
 |*
-|*	  NameOrIndex::NameOrIndex(USHORT nWhich, long nIndex)
+|*	  NameOrIndex::NameOrIndex(USHORT nWhich, INT32 nIndex)
 |*
 |*	  Beschreibung
 |*	  Ersterstellung	14.11.94
@@ -116,7 +118,7 @@
 |*
 *************************************************************************/
 
-NameOrIndex::NameOrIndex(USHORT _nWhich, long nIndex) :
+NameOrIndex::NameOrIndex(USHORT _nWhich, INT32 nIndex) :
 	SfxStringItem(_nWhich, aNameOrIndexEmptyString),
 	nPalIndex(nIndex)
 {
@@ -134,7 +136,7 @@
 
 NameOrIndex::NameOrIndex(USHORT _nWhich, const XubString& rName) :
 	SfxStringItem(_nWhich, rName),
-	nPalIndex((long)-1)
+	nPalIndex(-1)
 {
 }
 
@@ -230,7 +233,7 @@
 SvStream& NameOrIndex::Store( SvStream& rOut, USHORT nItemVersion ) const
 {
 	SfxStringItem::Store( rOut, nItemVersion );
-	rOut << (INT32)nPalIndex;
+	rOut << nPalIndex;
 	return rOut;
 }
 
@@ -369,11 +373,11 @@
 
 /*************************************************************************
 |*
-|*	  XColorItem::XColorItem(USHORT nWhich, long nIndex, const Color& rTheColor)
+|*	  XColorItem::XColorItem(USHORT nWhich, INT32 nIndex, const Color& rTheColor)
 |*
 \************************************************************************/
 
-XColorItem::XColorItem(USHORT _nWhich, long nIndex, const Color& rTheColor) :
+XColorItem::XColorItem(USHORT _nWhich, INT32 nIndex, const Color& rTheColor) :
 	NameOrIndex(_nWhich, nIndex),
 	aColor(rTheColor)
 {
@@ -884,7 +888,7 @@
 
 /*************************************************************************
 |*
-|*	  XLineDashItem::XLineDashItem(long nIndex, const XDash& rTheDash)
+|*	  XLineDashItem::XLineDashItem(INT32 nIndex, const XDash& rTheDash)
 |*
 |*	  Beschreibung
 |*	  Ersterstellung	15.11.94
@@ -892,7 +896,7 @@
 |*
 *************************************************************************/
 
-XLineDashItem::XLineDashItem(long nIndex, const XDash& rTheDash) :
+XLineDashItem::XLineDashItem(INT32 nIndex, const XDash& rTheDash) :
 	NameOrIndex(XATTR_LINEDASH, nIndex),
 	aDash(rTheDash)
 {
@@ -1501,7 +1505,7 @@
 
 /*************************************************************************
 |*
-|*	  XLineColorItem::XLineColorItem(long nIndex, const Color& rTheColor)
+|*	  XLineColorItem::XLineColorItem(INT32 nIndex, const Color& rTheColor)
 |*
 |*	  Beschreibung
 |*	  Ersterstellung	15.11.94
@@ -1509,7 +1513,7 @@
 |*
 *************************************************************************/
 
-XLineColorItem::XLineColorItem(long nIndex, const Color& rTheColor) :
+XLineColorItem::XLineColorItem(INT32 nIndex, const Color& rTheColor) :
 	XColorItem(XATTR_LINECOLOR, nIndex, rTheColor)
 {
 }
@@ -1720,7 +1724,7 @@
 
 /*************************************************************************
 |*
-|*	  XLineStartItem::XLineStartItem(long nIndex)
+|*	  XLineStartItem::XLineStartItem(INT32 nIndex)
 |*
 |*	  Beschreibung
 |*	  Ersterstellung	15.11.94
@@ -1728,7 +1732,7 @@
 |*
 *************************************************************************/
 
-XLineStartItem::XLineStartItem(long nIndex) 
+XLineStartItem::XLineStartItem(INT32 nIndex) 
 :	NameOrIndex(XATTR_LINESTART, nIndex)
 {
 }
@@ -2192,7 +2196,7 @@
 
 /*************************************************************************
 |*
-|*	  XLineEndItem::XLineEndItem(long nIndex)
+|*	  XLineEndItem::XLineEndItem(INT32 nIndex)
 |*
 |*	  Beschreibung
 |*	  Ersterstellung	15.11.94
@@ -2200,7 +2204,7 @@
 |*
 *************************************************************************/
 
-XLineEndItem::XLineEndItem(long nIndex) 
+XLineEndItem::XLineEndItem(INT32 nIndex) 
 :	NameOrIndex(XATTR_LINEEND, nIndex)
 {
 }
@@ -2664,7 +2668,7 @@
 
 /*************************************************************************
 |*
-|*	  XLineStartWidthItem::XLineStartWidthItem(long nWidth)
+|*	  XLineStartWidthItem::XLineStartWidthItem(INT32 nWidth)
 |*
 |*	  Beschreibung
 |*	  Ersterstellung	15.11.94
@@ -3249,7 +3253,7 @@
 
 /*************************************************************************
 |*
-|*	  XFillColorItem::XFillColorItem(long nIndex, const Color& rTheColor)
+|*	  XFillColorItem::XFillColorItem(INT32 nIndex, const Color& rTheColor)
 |*
 |*	  Beschreibung
 |*	  Ersterstellung	15.11.94
@@ -3257,7 +3261,7 @@
 |*
 *************************************************************************/
 
-XFillColorItem::XFillColorItem(long nIndex, const Color& rTheColor) :
+XFillColorItem::XFillColorItem(INT32 nIndex, const Color& rTheColor) :
 	XColorItem(XATTR_FILLCOLOR, nIndex, rTheColor)
 {
 }
@@ -3372,7 +3376,7 @@
 // -----------------------------
 TYPEINIT1_AUTOFACTORY(XSecondaryFillColorItem, XColorItem);
 
-XSecondaryFillColorItem::XSecondaryFillColorItem(long nIndex, const Color& rTheColor) :
+XSecondaryFillColorItem::XSecondaryFillColorItem(INT32 nIndex, const Color& rTheColor) :
 	XColorItem(XATTR_SECONDARYFILLCOLOR, nIndex, rTheColor)
 {
 }
@@ -3510,7 +3514,7 @@
 
 /*************************************************************************
 |*
-|*	  XFillGradientItem::XFillGradientItem(long nIndex,
+|*	  XFillGradientItem::XFillGradientItem(INT32 nIndex,
 |*										 const XGradient& rTheGradient)
 |*
 |*	  Beschreibung
@@ -3519,7 +3523,7 @@
 |*
 *************************************************************************/
 
-XFillGradientItem::XFillGradientItem(long nIndex,
+XFillGradientItem::XFillGradientItem(INT32 nIndex,
 								   const XGradient& rTheGradient) :
 	NameOrIndex(XATTR_FILLGRADIENT, nIndex),
 	aGradient(rTheGradient)
@@ -4042,7 +4046,7 @@
 
 //------------------------------------------------------------------------
 
-XFillFloatTransparenceItem::XFillFloatTransparenceItem( long nIndex, const XGradient& rGradient, BOOL bEnable ) :
+XFillFloatTransparenceItem::XFillFloatTransparenceItem( INT32 nIndex, const XGradient& rGradient, BOOL bEnable ) :
 	XFillGradientItem	( nIndex, rGradient ),
 	bEnabled			( bEnable )
 {
@@ -4246,7 +4250,7 @@
 
 /*************************************************************************
 |*
-|*	  XFillHatchItem::XFillHatchItem(long nIndex,
+|*	  XFillHatchItem::XFillHatchItem(INT32 nIndex,
 |*								   const XHatch& rTheHatch)
 |*
 |*	  Beschreibung
@@ -4255,7 +4259,7 @@
 |*
 *************************************************************************/
 
-XFillHatchItem::XFillHatchItem(long nIndex,
+XFillHatchItem::XFillHatchItem(INT32 nIndex,
 							 const XHatch& rTheHatch) :
 	NameOrIndex(XATTR_FILLHATCH, nIndex),
 	aHatch(rTheHatch)
@@ -5258,7 +5262,7 @@
 |*
 *************************************************************************/
 
-XFormTextShadowColorItem::XFormTextShadowColorItem(long nIndex,
+XFormTextShadowColorItem::XFormTextShadowColorItem(INT32 nIndex,
 													 const Color& rTheColor) :
 	XColorItem(XATTR_FORMTXTSHDWCOLOR, nIndex, rTheColor)
 {

workspace.cmcfixes62.patch:
 binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx               |    1 
 binfilter/prj/build.lst                                     |    2 
 connectivity/source/drivers/odbcbase/OConnection.cxx        |    2 
 connectivity/source/drivers/odbcbase/OPreparedStatement.cxx |   16 -
 connectivity/source/drivers/odbcbase/OResultSet.cxx         |    6 
 connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx |    8 
 connectivity/source/drivers/odbcbase/OStatement.cxx         |    8 
 connectivity/source/drivers/odbcbase/OTools.cxx             |   70 ++---
 connectivity/source/inc/odbc/OFunctiondefs.hxx              |    8 
 connectivity/source/inc/odbc/OFunctions.hxx                 |   44 +--
 connectivity/source/inc/odbc/OResultSet.hxx                 |    2 
 connectivity/source/inc/odbc/OResultSetMetaData.hxx         |    4 
 connectivity/source/inc/odbc/OStatement.hxx                 |    2 
 connectivity/source/inc/odbc/OTools.hxx                     |   12 
 dbaccess/source/ui/dlg/odbcconfig.cxx                       |    8 
 dmake/dag.c                                                 |    9 
 dmake/expand.c                                              |   26 +-
 dmake/getinp.c                                              |    6 
 dmake/make.c                                                |   15 -
 dmake/path.c                                                |   10 
 dmake/rulparse.c                                            |    5 
 postprocess/prj/build.lst                                   |    2 
 sfx2/inc/pch/precompiled_sfx2.hxx                           |    1 
 sfx2/source/appl/sfxpicklist.cxx                            |    4 
 sfx2/source/doc/objstor.cxx                                 |    3 
 sfx2/util/makefile.mk                                       |    1 
 shell/inc/systemshell.hxx                                   |   53 ----
 shell/prj/build.lst                                         |    3 
 shell/prj/d.lst                                             |    4 
 shell/source/unix/sysshell/makefile.mk                      |    4 
 shell/source/unix/sysshell/recently_used_file_handler.cxx   |    1 
 shell/source/unix/sysshell/systemshell.cxx                  |  151 ------------
 solenv/inc/libs.mk                                          |    2 
 vcl/aqua/inc/salinst.h                                      |    2 
 vcl/aqua/source/app/salinst.cxx                             |   55 ++++
 vcl/inc/vcl/salinst.hxx                                     |    1 
 vcl/inc/vcl/svapp.hxx                                       |   14 +
 vcl/os2/inc/salinst.h                                       |    1 
 vcl/os2/source/app/salinst.cxx                              |    4 
 vcl/source/app/svapp.cxx                                    |    6 
 vcl/unx/gtk/app/gtkinst.cxx                                 |   21 +
 vcl/unx/headless/svpinst.cxx                                |    4 
 vcl/unx/headless/svpinst.hxx                                |    2 
 vcl/unx/inc/plugins/gtk/gtkinst.hxx                         |    1 
 vcl/unx/inc/salinst.h                                       |    1 
 vcl/unx/source/app/salinst.cxx                              |   20 +
 vcl/win/inc/salinst.h                                       |    1 
 vcl/win/source/app/salinst.cxx                              |   23 +
 48 files changed, 298 insertions(+), 351 deletions(-)

--- NEW FILE workspace.cmcfixes62.patch ---
Index: dbaccess/source/ui/dlg/odbcconfig.cxx
===================================================================
--- dbaccess/source/ui/dlg/odbcconfig.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ dbaccess/source/ui/dlg/odbcconfig.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -82,7 +82,7 @@
 // so don't touch this
 #if defined(WIN) || defined(WNT)
 #define SQL_API __stdcall
-// At least under some circumstances, the below #include <odbc/sqlext.h> re-
+// At least under some circumstances, the below #include <sqlext.h> re-
 // defines SQL_API to an empty string, leading to a compiler warning on MSC; to
 // not break the current behavior, this is worked around by locally disabling
 // that warning:
@@ -97,13 +97,7 @@
 #define DONT_TD_VOID
 #endif
 
-#ifdef SYSTEM_ODBC_HEADERS
 #include <sqlext.h>
-#else
-#ifndef __SQLEXT_H
-#include <odbc/sqlext.h>
-#endif
-#endif
 
 #if defined(WIN) || defined(WNT)
 #if defined _MSC_VER
Index: sfx2/source/doc/objstor.cxx
===================================================================
--- sfx2/source/doc/objstor.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ sfx2/source/doc/objstor.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -99,7 +99,6 @@
 #include <sot/storinfo.hxx>
 #include <sot/exchange.hxx>
 #include <sot/formats.hxx>
-#include <shell/systemshell.hxx>
 #include <comphelper/storagehelper.hxx>
 #include <comphelper/seqstream.hxx>
 #include <comphelper/documentconstants.hxx>
@@ -821,7 +820,7 @@
                 if ( aUrl.GetProtocol() == INET_PROT_FILE )
                 {
                     const SfxFilter* pOrgFilter = pMedium->GetOrigFilter();
-                    SystemShell::AddToRecentDocumentList(
+                    Application::AddToRecentDocumentList(
                         aUrl.GetURLNoPass( INetURLObject::NO_DECODE ),
                         (pOrgFilter) ? pOrgFilter->GetMimeType() : String() );
                 }
Index: sfx2/source/appl/sfxpicklist.cxx
===================================================================
--- sfx2/source/appl/sfxpicklist.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ sfx2/source/appl/sfxpicklist.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -43,8 +43,6 @@
 #include <unotools/localfilehelper.hxx>
 #include <cppuhelper/implbase1.hxx>
 
-#include <shell/systemshell.hxx>
-
 // ----------------------------------------------------------------------------
 
 #include <sfx2/app.hxx>
@@ -470,7 +468,7 @@
                 pDocSh->Get_Impl()->bWaitingForPicklist = sal_False;
 
                 if ( aURL.GetProtocol() == INET_PROT_FILE )
-                    SystemShell::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), (pFilter) ? pFilter->GetMimeType() : String() );
+                    Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), (pFilter) ? pFilter->GetMimeType() : String() );
 			}
             break;
 		}
Index: sfx2/inc/pch/precompiled_sfx2.hxx
===================================================================
--- sfx2/inc/pch/precompiled_sfx2.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ sfx2/inc/pch/precompiled_sfx2.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -484,7 +484,6 @@
 #include "sal/config.h"
 #include "sal/types.h"
 #include "setup_native/qswin32.h"
-#include "shell/systemshell.hxx"
 #include "sj2/sjapplet.hxx"
 #include "sot/clsids.hxx"
 #include "sot/exchange.hxx"
Index: sfx2/util/makefile.mk
===================================================================
--- sfx2/util/makefile.mk	(.../tags/DEV300_m55)	(revision 275310)
+++ sfx2/util/makefile.mk	(.../cws/cmcfixes62)	(revision 275310)
@@ -91,7 +91,6 @@
 		$(TOOLSLIB) \
 		$(I18NISOLANGLIB) \
 		$(SAXLIB) \
-		$(SYSSHELLLIB) \
 		$(COMPHELPERLIB) \
         $(UCBHELPERLIB) \
 		$(CPPUHELPERLIB) \
Index: vcl/source/app/svapp.cxx
===================================================================
--- vcl/source/app/svapp.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/source/app/svapp.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -1989,6 +1989,12 @@
     return SalGetDesktopEnvironment();
 }
 
+void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType);
+}
+
 BOOL Application::IsAccessibilityEnabled()
 {
     return FALSE;
Index: vcl/os2/source/app/salinst.cxx
===================================================================
--- vcl/os2/source/app/salinst.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/os2/source/app/salinst.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -811,6 +811,10 @@
 	return (void*) "";
 }
 
+void Os2SalInstance::AddToRecentDocumentList(const rtl::OUString& /*rFileUrl*/, const rtl::OUString& /*rMimeType*/)
+{
+}
+
 // -----------------------------------------------------------------------
 
 SalTimer* Os2SalInstance::CreateSalTimer()
Index: vcl/os2/inc/salinst.h
===================================================================
--- vcl/os2/inc/salinst.h	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/os2/inc/salinst.h	(.../cws/cmcfixes62)	(revision 275310)
@@ -96,6 +96,7 @@
     virtual void				DestroyMenuItem( SalMenuItem* );
     virtual SalSession*                         CreateSalSession();
     virtual void*				GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+    virtual void				AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
 };
 
 SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSalFrameStyle );
Index: vcl/aqua/source/app/salinst.cxx
===================================================================
--- vcl/aqua/source/app/salinst.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/aqua/source/app/salinst.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -55,6 +55,14 @@
 #include "saltimer.h"
 #include "vclnsapp.h"
 
+#include <comphelper/processfactory.hxx>
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
+#include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
 #include "premac.h"
 #include <Foundation/Foundation.h>
 #include <ApplicationServices/ApplicationServices.h>
@@ -64,6 +72,7 @@
 
 
 using namespace std;
+using namespace ::com::sun::star;
 
 extern BOOL ImplSVMain();
 
@@ -1017,6 +1026,52 @@
 	return (void*)"";
 }
 
+// We need to re-encode file urls because osl_getFileURLFromSystemPath converts
+// to UTF-8 before encoding non ascii characters, which is not what other apps expect.
+static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl)
+{
+    rtl::OUString extUrl;
+        
+    uno::Reference< lang::XMultiServiceFactory > sm = comphelper::getProcessServiceFactory();
+    if (sm.is())
+    {
+        uno::Reference< beans::XPropertySet > pset;
+        sm->queryInterface( getCppuType( &pset )) >>= pset;
+        if (pset.is())
+        {
+            uno::Reference< uno::XComponentContext > context;
+            static const rtl::OUString DEFAULT_CONTEXT( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) );
+            pset->getPropertyValue(DEFAULT_CONTEXT) >>= context;
+            if (context.is())
+                extUrl = uri::ExternalUriReferenceTranslator::create(context)->translateToExternal(internalUrl);
+        }
+    }
+    return extUrl;
+}
+
+void AquaSalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& /*rMimeType*/)
+{
+    // Convert file URL for external use (see above)
+    rtl::OUString externalUrl = translateToExternalUrl(rFileUrl);
+    if( 0 == externalUrl.getLength() )
+        externalUrl = rFileUrl;
+    
+    if( externalUrl.getLength() )
+    {
+        NSString* pString = [[NSString alloc] initWithCharacters: externalUrl.getStr() length: externalUrl.getLength()];
+        NSURL* pURL = [NSURL URLWithString: pString];
+
+        if( pURL )
+        {
+            NSDocumentController* pCtrl = [NSDocumentController sharedDocumentController];
+            [pCtrl noteNewRecentDocumentURL: pURL];
+        }
+        if( pString )
+            [pString release];
+    }
+}
+
+
 // -----------------------------------------------------------------------
 
 SalTimer* AquaSalInstance::CreateSalTimer()
Index: vcl/aqua/inc/salinst.h
===================================================================
--- vcl/aqua/inc/salinst.h	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/aqua/inc/salinst.h	(.../cws/cmcfixes62)	(revision 275310)
@@ -143,9 +143,11 @@
     virtual void				DestroyMenuItem( SalMenuItem* );
     virtual SalSession*         CreateSalSession();
     virtual void*				GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+    virtual void                AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
     virtual void            SetEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) );
     virtual void            SetErrorEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) );
 
+
     static void handleAppDefinedEvent( NSEvent* pEvent );
     
     // check whether a particular string is passed on the command line
Index: vcl/inc/vcl/salinst.hxx
===================================================================
--- vcl/inc/vcl/salinst.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/inc/vcl/salinst.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -171,6 +171,7 @@
 
     enum ConnectionIdentifierType { AsciiCString, Blob };
     virtual void*				GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) = 0;
+    virtual void        AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType) = 0;
 };
 
 // called from SVMain
Index: vcl/inc/vcl/svapp.hxx
===================================================================
--- vcl/inc/vcl/svapp.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/inc/vcl/svapp.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -479,6 +479,20 @@
      */
     static const ::rtl::OUString& GetDesktopEnvironment();
 
+    /** Add a file to the system shells recent document list if there is any.
+          This function may have no effect under Unix because there is no 
+          standard API among the different desktop managers.
+          
+          @param rFileUrl
+                    The file url of the document.
+                    
+          @param rMimeType
+          The mime content type of the document specified by aFileUrl.
+          If an empty string will be provided "application/octet-stream"
+          will be used.
+    */
+    static void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
+
 private:
 
     DECL_STATIC_LINK( Application, PostEventHandler, void* );
Index: vcl/unx/source/app/salinst.cxx
===================================================================
--- vcl/unx/source/app/salinst.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/unx/source/app/salinst.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -34,7 +34,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
-
+#include <osl/module.hxx>
 #include <salunx.h>
 
 #ifndef _VOS_MUTEX_HXX
@@ -276,3 +276,21 @@
 {
 	delete pFrame;
 }
+
+extern "C" { static void SAL_CALL thisModule() {} }
+
+void X11SalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
+{
+    const rtl::OUString SYM_ADD_TO_RECENTLY_USED_FILE_LIST(RTL_CONSTASCII_USTRINGPARAM("add_to_recently_used_file_list"));
+    const rtl::OUString LIB_RECENT_FILE(RTL_CONSTASCII_USTRINGPARAM("librecentfile.so"));
+    typedef void (*PFUNC_ADD_TO_RECENTLY_USED_LIST)(const rtl::OUString&, const rtl::OUString&);
+
+    PFUNC_ADD_TO_RECENTLY_USED_LIST add_to_recently_used_file_list = 0;
+
+    osl::Module module;
+    module.loadRelative( &thisModule, LIB_RECENT_FILE );
+    if (module.is())
+        add_to_recently_used_file_list = (PFUNC_ADD_TO_RECENTLY_USED_LIST)module.getFunctionSymbol(SYM_ADD_TO_RECENTLY_USED_FILE_LIST);
+    if (add_to_recently_used_file_list)
+        add_to_recently_used_file_list(rFileUrl, rMimeType);
+}
Index: vcl/unx/gtk/app/gtkinst.cxx
===================================================================
--- vcl/unx/gtk/app/gtkinst.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/unx/gtk/app/gtkinst.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -206,6 +206,27 @@
     return new GtkSalObject( static_cast<GtkSalFrame*>(pParent), bShow );
 }
 
+void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
+{
+#if GTK_CHECK_VERSION(2,10,0)
+    GtkRecentManager *manager = gtk_recent_manager_get_default ();
+    gtk_recent_manager_add_item (manager, rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+    (void)rMimeType;
+#else
+    static void * (* sym_gtk_recent_manager_get_default) () =
+        (void * (*)())dlsym(NULL, "gtk_recent_manager_get_default");
+    static void   (* sym_gtk_recent_manager_add_item) (void *, const char *) = 
+        (void (*)(void *, const char*))dlsym(NULL, "gtk_recent_manager_add_item");
+    if (sym_gtk_recent_manager_get_default && sym_gtk_recent_manager_add_item)
+    {
+        sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(),
+            rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+    }
+    else
+        X11SalInstance::AddToRecentDocumentList(rFileUrl, rMimeType);
+#endif
+}
+
 GtkYieldMutex::GtkYieldMutex()
 {
 }
Index: vcl/unx/headless/svpinst.cxx
===================================================================
--- vcl/unx/headless/svpinst.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/unx/headless/svpinst.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -504,6 +504,10 @@
 	}
 }
 
+void SvpSalInstance::AddToRecentDocumentList(const rtl::OUString&, const rtl::OUString&)
+{
+}
+
 SvpSalTimer::~SvpSalTimer()
 {
 }
Index: vcl/unx/headless/svpinst.hxx
===================================================================
--- vcl/unx/headless/svpinst.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/unx/headless/svpinst.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -193,6 +193,8 @@
     virtual SalSession*		CreateSalSession();
 
     virtual void*			GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+
+    virtual void            AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
 };
 
 #endif // _SV_SALINST_HXX
Index: vcl/unx/inc/plugins/gtk/gtkinst.hxx
===================================================================
--- vcl/unx/inc/plugins/gtk/gtkinst.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/unx/inc/plugins/gtk/gtkinst.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -91,6 +91,7 @@
     virtual SalFrame*           CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
     virtual SalObject*			CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
     virtual SalSystem*			CreateSalSystem();
+    virtual void                AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
 };
 
 class GtkSalSystem : public X11SalSystem
Index: vcl/unx/inc/salinst.h
===================================================================
--- vcl/unx/inc/salinst.h	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/unx/inc/salinst.h	(.../cws/cmcfixes62)	(revision 275310)
@@ -115,6 +115,7 @@
 
     virtual void*				GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
 
+    virtual void            AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
 
     bool isPrinterInit() const 
     {
Index: vcl/win/source/app/salinst.cxx
===================================================================
--- vcl/win/source/app/salinst.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/win/source/app/salinst.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -39,7 +39,7 @@
 #ifdef __MINGW32__
 #include <excpt.h>
 #endif
-
+#include <osl/file.hxx>
 #include <vos/mutex.hxx>
 #include <tools/debug.hxx>
 #include <wincomp.hxx>
@@ -70,6 +70,7 @@
 #include <GdiPlus.h>
 #include <GdiPlusEnums.h>
 #include <GdiPlusColor.h>
+#include <Shlobj.h>
 
 #if defined _MSC_VER
 #pragma warning(pop)
@@ -1089,6 +1090,26 @@
 
 // -----------------------------------------------------------------------
 
+/** Add a file to the system shells recent document list if there is any.
+      This function may have no effect under Unix because there is no 
+      standard API among the different desktop managers.
+      
+      @param aFileUrl
+                The file url of the document.
+*/
+void WinSalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& /*rMimeType*/)
+{
+    rtl::OUString system_path;
+    osl::FileBase::RC rc = osl::FileBase::getSystemPathFromFileURL(rFileUrl, system_path);
+    
+    OSL_ENSURE(osl::FileBase::E_None == rc, "Invalid file url");
+    
+    if (osl::FileBase::E_None == rc)
+        SHAddToRecentDocs(SHARD_PATHW, system_path.getStr());        
+}
+
+// -----------------------------------------------------------------------
+
 SalTimer* WinSalInstance::CreateSalTimer()
 {
 	return new WinSalTimer();
Index: vcl/win/inc/salinst.h
===================================================================
--- vcl/win/inc/salinst.h	(.../tags/DEV300_m55)	(revision 275310)
+++ vcl/win/inc/salinst.h	(.../cws/cmcfixes62)	(revision 275310)
@@ -88,6 +88,7 @@
     virtual void				DestroyMenuItem( SalMenuItem* );
     virtual SalSession*                         CreateSalSession();
     virtual void*				GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+    virtual void                AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
 
     static int WorkaroundExceptionHandlingInUSER32Lib(int nExcept, LPEXCEPTION_POINTERS pExceptionInfo);
 };
Index: shell/source/unix/sysshell/systemshell.cxx
===================================================================
--- shell/source/unix/sysshell/systemshell.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ shell/source/unix/sysshell/systemshell.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -1,151 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: systemshell.cxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "systemshell.hxx"
-
-#include <comphelper/processfactory.hxx>
-
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_Hpp_
-#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
-#include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#include "osl/module.hxx"
-
-using namespace ::com::sun::star;
-
-#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
-
-const rtl::OUString SYM_ADD_TO_RECENTLY_USED_FILE_LIST = UNISTRING("add_to_recently_used_file_list");
-const rtl::OUString LIB_RECENT_FILE = UNISTRING("librecentfile.so");
-const rtl::OUString DEFAULT_CONTEXT = UNISTRING("DefaultContext");
-
-void * (* sym_gtk_recent_manager_get_default) () = NULL;
-void   (* sym_gtk_recent_manager_add_item) (void *, const char *) = NULL;
-
-// We need to re-encode file urls because osl_getFileURLFromSystemPath converts
-// to UTF-8 before encoding non ascii characters, which is not what other apps expect.
-static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl)
-{
-	rtl::OUString extUrl;
-		
-	uno::Reference< lang::XMultiServiceFactory > sm = comphelper::getProcessServiceFactory();
-	if (sm.is())
-	{
-		uno::Reference< beans::XPropertySet > pset;
-		sm->queryInterface( getCppuType( &pset )) >>= pset;
-		if (pset.is())
-		{
-			uno::Reference< uno::XComponentContext > context;
-			pset->getPropertyValue(DEFAULT_CONTEXT) >>= context;
-			if (context.is())
-				extUrl = uri::ExternalUriReferenceTranslator::create(context)->translateToExternal(internalUrl);
-		}
-	}
-	return extUrl;
-}
-
-namespace SystemShell {
-    
-    typedef void (*PFUNC_ADD_TO_RECENTLY_USED_LIST)(const rtl::OUString&, const rtl::OUString&);
-        
-    //##############################
-    rtl::OUString get_absolute_library_url(const rtl::OUString& /*lib_name*/)
-    {
-        rtl::OUString url;
-        if (osl::Module::getUrlFromAddress(reinterpret_cast<oslGenericFunction>(AddToRecentDocumentList), url))
-        {        
-            sal_Int32 index = url.lastIndexOf('/');
-            url = url.copy(0, index + 1);
-            url += LIB_RECENT_FILE;
-        }
-        return url;
-    }
-    
-    bool init_recent_manager_api()
-    {
-        oslModule hDefault;
-        if( osl_getModuleHandle( NULL, &hDefault ) )
-        {
-            sym_gtk_recent_manager_get_default = (void * (*)())
-                osl_getAsciiFunctionSymbol(hDefault, "gtk_recent_manager_get_default");
-            sym_gtk_recent_manager_add_item = (void (*)(void *, const char *)) 
-                osl_getAsciiFunctionSymbol(hDefault, "gtk_recent_manager_add_item");
-            
-        }
-        bool ret = (NULL != sym_gtk_recent_manager_get_default) && (NULL != sym_gtk_recent_manager_add_item);
-        return ret;
-    }
-            
-    
-    //##############################
-    void AddToRecentDocumentList(const rtl::OUString& aFileUrl, const rtl::OUString& aMimeType)
-    {
-        static bool bIsRecentManagerPresent = init_recent_manager_api();
-        
-        // Convert file URL for external use (see above)
-        rtl::OUString externalUrl = translateToExternalUrl(aFileUrl);
-        if( 0 == externalUrl.getLength() )
-            externalUrl = aFileUrl;
-        
-        if( bIsRecentManagerPresent )
-        {
-            void * recent_manager = sym_gtk_recent_manager_get_default();
-            sym_gtk_recent_manager_add_item(recent_manager, rtl::OUStringToOString(aFileUrl, RTL_TEXTENCODING_UTF8).getStr());
-        }
-        else
-        {
-            rtl::OUString librecentfile_url = get_absolute_library_url(LIB_RECENT_FILE);
-        
-            if (librecentfile_url.getLength())
-            {
-                osl::Module module(librecentfile_url);
-
-                if (module.is())
-                {
-                    // convert from reinterpret_cast<PFUNC_ADD_TO_RECENTLY_USED_LIST>
-                    // not allowed in gcc 3.3 without permissive.
-                    PFUNC_ADD_TO_RECENTLY_USED_LIST add_to_recently_used_file_list = 
-                        reinterpret_cast<PFUNC_ADD_TO_RECENTLY_USED_LIST>(module.getFunctionSymbol(SYM_ADD_TO_RECENTLY_USED_FILE_LIST));
-                
-                    if (add_to_recently_used_file_list)
-                        add_to_recently_used_file_list(aFileUrl, aMimeType);
-                }
-            }
-        }        
-    }
-    
-} // namespace SystemShell
-
Index: shell/source/unix/sysshell/recently_used_file_handler.cxx
===================================================================
--- shell/source/unix/sysshell/recently_used_file_handler.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ shell/source/unix/sysshell/recently_used_file_handler.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -31,7 +31,6 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_shell.hxx"
  
-#include "systemshell.hxx"
 #include "osl/process.h"
 #include "rtl/ustring.hxx"
 #include "rtl/string.hxx"
Index: shell/source/unix/sysshell/makefile.mk
===================================================================
--- shell/source/unix/sysshell/makefile.mk	(.../tags/DEV300_m55)	(revision 275310)
+++ shell/source/unix/sysshell/makefile.mk	(.../cws/cmcfixes62)	(revision 275310)
@@ -48,10 +48,6 @@
 
 .IF "$(OS)" != "MACOSX"
 
-LIB1OBJFILES=$(SLO)$/systemshell.obj
-LIB1TARGET=$(SLB)$/$(TARGET).lib
-LIB1ARCHIV=$(SLB)$/lib$(TARGET).a
-
 SLOFILES=$(SLO)$/recently_used_file.obj \
          $(SLO)$/recently_used_file_handler.obj
 
Index: shell/inc/systemshell.hxx
===================================================================
--- shell/inc/systemshell.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ shell/inc/systemshell.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -1,53 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: systemshell.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SYSTEMSHELL_HXX_
-#define _SYSTEMSHELL_HXX_
-
-#include <rtl/ustring.hxx>
-
-namespace SystemShell
-{
-    /** Add a file to the system shells recent document list if there is any.
-          This function may have no effect under Unix because there is no 
-          standard API among the different desktop managers.
-          
-          @param aFileUrl
-                    The file url of the document.
-					
-		  @param aMimeType
-		  The mime content type of the document specified by aFileUrl.
-		  If an empty string will be provided "application/octet-stream"
-		  will be used.
-    */
-    void AddToRecentDocumentList(const rtl::OUString& aFileUrl, const rtl::OUString& aMimeType);
-}
-
-#endif
Index: shell/prj/build.lst
===================================================================
--- shell/prj/build.lst	(.../tags/DEV300_m55)	(revision 275310)
+++ shell/prj/build.lst	(.../cws/cmcfixes62)	(revision 275310)
@@ -10,9 +10,6 @@
 sl    shell\source\cmdmail                         nmake   -   p   sl_cmdmail sl_inc NULL
 sl    shell\source\all                             nmake   -   all sl_all sl_inc NULL
 sl    shell\source\unix\sysshell                   nmake   -   u   sl_unix_sysshell sl_all sl_inc NULL
-sl    shell\source\aqua\sysshell                   nmake   -   u   sl_aqua_sysshell sl_all sl_inc NULL
-sl    shell\source\win32\sysshell                  nmake   -   w   sl_win32_sysshell sl_inc NULL
-sl    shell\source\os2\sysshell                    nmake   -   p   sl_os2_sysshell sl_inc NULL
 sl    shell\source\tools\lngconvex                 nmake   -   w   sl_win32_lngconv sl_inc NULL
 sl    shell\source\tools\regsvrex                  nmake   -   w   sl_win32_regsvrex  sl_inc NULL
 sl    shell\source\all\zipfile                     nmake   -   w   sl_all_zipfile  sl_inc NULL
Index: shell/prj/d.lst
===================================================================
--- shell/prj/d.lst	(.../tags/DEV300_m55)	(revision 275310)
+++ shell/prj/d.lst	(.../cws/cmcfixes62)	(revision 275310)
@@ -1,7 +1,3 @@
-mkdir: %_DEST%\inc%_EXT%\shell
-
-..\inc\*.hxx %_DEST%\inc%_EXT%\shell\*.hxx
-
 ..\%__SRC%\slb\*.lib %_DEST%\lib%_EXT%\*.lib
 ..\%__SRC%\slb\*.a %_DEST%\lib%_EXT%\*.a
 ..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
Index: connectivity/source/inc/odbc/OResultSet.hxx
===================================================================
--- connectivity/source/inc/odbc/OResultSet.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/inc/odbc/OResultSet.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -128,7 +128,7 @@
 			typedef ::std::vector<ORowSetValue>			TDataRow;
 
 			TVoidVector									m_aBindVector;
-			::std::vector<sal_Int32>					m_aLengthVector;
+			::std::vector<SQLLEN>						m_aLengthVector;
             ::std::map<sal_Int32,SWORD>					m_aODBCColumnTypes;
 			::com::sun::star::uno::Sequence<sal_Int8>	m_aBookmark;
 
Index: connectivity/source/inc/odbc/OResultSetMetaData.hxx
===================================================================
--- connectivity/source/inc/odbc/OResultSetMetaData.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/inc/odbc/OResultSetMetaData.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -80,13 +80,13 @@
 			virtual ~OResultSetMetaData();
 
 
-            static  SWORD getNumColAttrib(OConnection* _pConnection
+            static SQLLEN getNumColAttrib(OConnection* _pConnection
                                               ,SQLHANDLE _aStatementHandle
                                               ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
                                               ,sal_Int32 _column
                                               ,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
 
-            static SWORD getColumnODBCType(OConnection* _pConnection
+            static SQLSMALLINT getColumnODBCType(OConnection* _pConnection
                                               ,SQLHANDLE _aStatementHandle
                                               ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
                                               ,sal_Int32 column)
Index: connectivity/source/inc/odbc/OTools.hxx
===================================================================
--- connectivity/source/inc/odbc/OTools.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/inc/odbc/OTools.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -197,7 +197,7 @@
 			static ::rtl::OUString getStringValue(	OConnection* _pConnection,	
 													SQLHANDLE _aStatementHandle,
 													sal_Int32 columnIndex,
-													SWORD  _fSqlType,
+													SQLSMALLINT _fSqlType,
 													sal_Bool &_bWasNull,
 													const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
 													rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
@@ -205,7 +205,7 @@
 			static  ::com::sun::star::uno::Sequence<sal_Int8> getBytesValue(OConnection* _pConnection,	
 																			SQLHANDLE _aStatementHandle,
 																			sal_Int32 columnIndex,
-																			SWORD  _fSqlType,
+																			SQLSMALLINT _fSqlType,
 																			sal_Bool &_bWasNull,
 																			const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
 			static void getValue(	OConnection* _pConnection,	
@@ -215,7 +215,7 @@
 									sal_Bool &_bWasNull,
 									const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
 									void* _pValue,
-									SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+									SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
 
 			/** 
 				bindData copies the from pValue to pData
@@ -229,10 +229,10 @@
 			static void bindData(	SQLSMALLINT _nOdbcType,
 									sal_Bool _bUseWChar,
 									sal_Int8 *&_pData,
-									SQLINTEGER*& pLen,
+									SQLLEN*& pLen,
 									const void* _pValue,
 									rtl_TextEncoding _nTextEncoding,
-									SQLUINTEGER& _nColumnSize);
+									SQLULEN& _nColumnSize);
 
 			static void bindParameter(	OConnection* _pConnection,	
 										SQLHANDLE _hStmt,
@@ -254,7 +254,7 @@
 									SQLSMALLINT _nMaxLen,
 									const void* _pValue,
 									void*		_pData,
-									SQLINTEGER *pLen,
+									SQLLEN *pLen,
 									const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
 									rtl_TextEncoding _nTextEncoding,
 									sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
Index: connectivity/source/inc/odbc/OStatement.hxx
===================================================================
--- connectivity/source/inc/odbc/OStatement.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/inc/odbc/OStatement.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -130,7 +130,7 @@
 			*/
 			virtual OResultSet* createResulSet();
 
-            sal_Int32 getRowCount () throw( ::com::sun::star::sdbc::SQLException);
+            SQLLEN getRowCount () throw( ::com::sun::star::sdbc::SQLException);
 
 
 			void disposeResultSet();
Index: connectivity/source/inc/odbc/OFunctiondefs.hxx
===================================================================
--- connectivity/source/inc/odbc/OFunctiondefs.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/inc/odbc/OFunctiondefs.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -41,7 +41,7 @@
 
 // just to go with calling convention of windows
 #define SQL_API __stdcall
-#include <odbc/sqlext.h>
+#include <sqlext.h>
 #undef SQL_API
 #define SQL_API __stdcall
 
@@ -67,7 +67,7 @@
 #define ALLREADY_HAVE_OS2_TYPES
 #define DONT_TD_VOID
 #include <svpm.h>
-#include <odbc/sqlext.h>
+#include <sqlext.h>
 #define SDB_ODBC_CHAR UCHAR
 #endif // OS2
 
@@ -135,11 +135,7 @@
 #endif
 #define CALLBACK
 #define EXPORT
-#ifdef SYSTEM_ODBC_HEADERS
 #include <sqlext.h>
-#else
-#include <odbc/sqlext.h>
-#endif
 #undef sal_Bool // Ist in qeodbc.h definiert, wird aber von solar.h noch einmal
 			// definiert.
 
Index: connectivity/source/inc/odbc/OFunctions.hxx
===================================================================
--- connectivity/source/inc/odbc/OFunctions.hxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/inc/odbc/OFunctions.hxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -187,7 +187,7 @@
 													SQLSMALLINT *		StringLengthPtr,
 													SQLSMALLINT *		TypePtr,
 													SQLSMALLINT *		SubTypePtr,
-													SQLINTEGER *		LengthPtr,
+													SQLLEN *			LengthPtr,
 													SQLSMALLINT *		PrecisionPtr,
 													SQLSMALLINT *		ScalePtr,
 													SQLSMALLINT *		NullablePtr);
@@ -203,8 +203,8 @@
 													SQLSMALLINT			Precision,
 													SQLSMALLINT			Scale,
 													SQLPOINTER			DataPtr,
-													SQLINTEGER *		StringLengthPtr,
-													SQLINTEGER *		IndicatorPtr);
+													SQLLEN *			StringLengthPtr,
+													SQLLEN *			IndicatorPtr);
 
 	#define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSetDescRec)getOdbcFunction(ODBC3SQLSetDescRec))(a,b,c,d,e,f,g,h,i,j)
 	*/
@@ -221,11 +221,11 @@
 													SQLSMALLINT			InputOutputType,
 													SQLSMALLINT			ValueType,
 													SQLSMALLINT			ParameterType,
-													SQLUINTEGER			ColumnSize,
+													SQLULEN				ColumnSize,
 													SQLSMALLINT			DecimalDigits,
 													SQLPOINTER			ParameterValuePtr,
-													SQLINTEGER			BufferLength,
-													SQLINTEGER *		StrLen_or_IndPtr);
+													SQLLEN				BufferLength,
+													SQLLEN *			StrLen_or_IndPtr);
 
 	#define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*(T3SQLBindParameter)getOdbcFunction(ODBC3SQLBindParameter))(a,b,c,d,e,f,g,h,i,j)
 
@@ -266,7 +266,7 @@
 	typedef SQLRETURN (SQL_API  *T3SQLDescribeParam) (SQLHSTMT			StatementHandle,
 													SQLUSMALLINT		ParameterNumber,
 													SQLSMALLINT *		DataTypePtr,
-													SQLUINTEGER *		ParameterSizePtr,
+													SQLULEN *			ParameterSizePtr,
 													SQLSMALLINT *		DecimalDigitsPtr,
 													SQLSMALLINT *		NullablePtr);
 
@@ -284,13 +284,13 @@
 
 	typedef SQLRETURN  (SQL_API  *T3SQLPutData) (		SQLHSTMT			StatementHandle,
 													SQLPOINTER			DataPtr,
-													SQLINTEGER			StrLen_or_Ind);
+													SQLLEN				StrLen_or_Ind);
 
 	#define N3SQLPutData(a,b,c) (*(T3SQLPutData)getOdbcFunction(ODBC3SQLPutData))(a,b,c)
 
 	// Retrieving results and information about results
 	typedef SQLRETURN  (SQL_API  *T3SQLRowCount) (	SQLHSTMT			StatementHandle,
-													SQLINTEGER *		RowCountPtr);
+													SQLLEN *			RowCountPtr);
 
 	#define N3SQLRowCount(a,b) (*(T3SQLRowCount)getOdbcFunction(ODBC3SQLRowCount))(a,b)
 
@@ -300,12 +300,12 @@
 	#define N3SQLNumResultCols(a,b) (*(T3SQLNumResultCols)getOdbcFunction(ODBC3SQLNumResultCols))(a,b)
 
 	typedef SQLRETURN  (SQL_API  *T3SQLDescribeCol) (	SQLHSTMT			StatementHandle,
-													SQLSMALLINT			ColumnNumber,
+													SQLUSMALLINT		ColumnNumber,
 													SQLCHAR *			ColumnName,
 													SQLSMALLINT			BufferLength,
 													SQLSMALLINT *		NameLengthPtr,
 													SQLSMALLINT *		DataTypePtr,
-													SQLUINTEGER *		ColumnSizePtr,
+													SQLULEN *			ColumnSizePtr,
 													SQLSMALLINT *		DecimalDigitsPtr,
 													SQLSMALLINT *		NullablePtr);
 
@@ -317,7 +317,7 @@
 													SQLPOINTER			CharacterAttributePtr,
 													SQLSMALLINT			BufferLength,
 													SQLSMALLINT *		StringLengthPtr,
-													SQLPOINTER			NumericAttributePtr);
+													SQLLEN *			NumericAttributePtr);
 
 	#define N3SQLColAttribute(a,b,c,d,e,f,g) (*(T3SQLColAttribute)getOdbcFunction(ODBC3SQLColAttribute))(a,b,c,d,e,f,g)
 
@@ -325,8 +325,8 @@
 													SQLUSMALLINT		ColumnNumber,
 													SQLSMALLINT			TargetType,
 													SQLPOINTER			TargetValuePtr,
-													SQLINTEGER			BufferLength,
-													SQLINTEGER *		StrLen_or_IndPtr);
+													SQLLEN				BufferLength,
+													SQLLEN *			StrLen_or_IndPtr);
 
 	#define N3SQLBindCol(a,b,c,d,e,f) (*(T3SQLBindCol)getOdbcFunction(ODBC3SQLBindCol))(a,b,c,d,e,f)
 
@@ -336,7 +336,7 @@
 
 	typedef SQLRETURN  (SQL_API  *T3SQLFetchScroll) (	SQLHSTMT			StatementHandle,
 													SQLSMALLINT			FetchOrientation,
-													SQLINTEGER			FetchOffset);
+													SQLLEN				FetchOffset);
 
 	#define N3SQLFetchScroll(a,b,c) (*(T3SQLFetchScroll)getOdbcFunction(ODBC3SQLFetchScroll))(a,b,c)
 
@@ -344,20 +344,20 @@
 													SQLUSMALLINT		ColumnNumber,
 													SQLSMALLINT			TargetType,
 													SQLPOINTER			TargetValuePtr,
-													SQLINTEGER			BufferLength,
-													SQLINTEGER *		StrLen_or_IndPtr);
+													SQLLEN				BufferLength,
+													SQLLEN *			StrLen_or_IndPtr);
 
 	#define N3SQLGetData(a,b,c,d,e,f) (*(T3SQLGetData)getOdbcFunction(ODBC3SQLGetData))(a,b,c,d,e,f)
 
 	typedef SQLRETURN  (SQL_API  *T3SQLSetPos) (		SQLHSTMT			StatementHandle,
-													SQLUSMALLINT		RowNumber,
+													SQLSETPOSIROW		RowNumber,
 													SQLUSMALLINT		Operation,
 													SQLUSMALLINT		LockType);
 
 	#define N3SQLSetPos(a,b,c,d) (*(T3SQLSetPos)getOdbcFunction(ODBC3SQLSetPos))(a,b,c,d)
 
 	typedef SQLRETURN  (SQL_API  *T3SQLBulkOperations) (	SQLHSTMT		StatementHandle,
-														SQLUSMALLINT	Operation);
+														SQLSMALLINT	Operation);
 
 	#define N3SQLBulkOperations(a,b) (*(T3SQLBulkOperations)getOdbcFunction(ODBC3SQLBulkOperations))(a,b)
 
@@ -461,15 +461,15 @@
 	#define N3SQLProcedures(a,b,c,d,e,f,g) (*(T3SQLProcedures)getOdbcFunction(ODBC3SQLProcedures))(a,b,c,d,e,f,g)
 
 	typedef SQLRETURN  (SQL_API  *T3SQLSpecialColumns) (SQLHSTMT			StatementHandle,
-													SQLSMALLINT			IdentifierType,
+													SQLUSMALLINT		IdentifierType,
 													SQLCHAR *			CatalogName,
 													SQLSMALLINT			NameLength1,
 													SQLCHAR *			SchemaName,
 													SQLSMALLINT			NameLength2,
 													SQLCHAR *			TableName,
 													SQLSMALLINT			NameLength3,
-													SQLSMALLINT			Scope,
-													SQLSMALLINT			Nullable);
+													SQLUSMALLINT		Scope,
+													SQLUSMALLINT		Nullable);
 
 	#define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSpecialColumns)getOdbcFunction(ODBC3SQLSpecialColumns))(a,b,c,d,e,f,g,h,i,j)
 
Index: connectivity/source/drivers/odbcbase/OConnection.cxx
===================================================================
--- connectivity/source/drivers/odbcbase/OConnection.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/drivers/odbcbase/OConnection.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -108,7 +108,7 @@
 	SQLRETURN nSQLRETURN = 0;
 	SDB_ODBC_CHAR szConnStrOut[4096];
 	SDB_ODBC_CHAR szConnStrIn[2048];
-	SWORD cbConnStrOut;
+	SQLSMALLINT cbConnStrOut;
 	memset(szConnStrOut,'\0',4096);
 	memset(szConnStrIn,'\0',2048);
 	::rtl::OString aConStr(::rtl::OUStringToOString(aConnectStr,getTextEncoding()));
Index: connectivity/source/drivers/odbcbase/OTools.cxx
===================================================================
--- connectivity/source/drivers/odbcbase/OTools.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/drivers/odbcbase/OTools.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -56,16 +56,16 @@
 						sal_Bool &_bWasNull,
 						const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
 						void* _pValue,
-						SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
+						SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen at sun.com", "OTools::getValue" );
-	SQLINTEGER pcbValue = SQL_NULL_DATA;
+	SQLLEN pcbValue = SQL_NULL_DATA;
 	OTools::ThrowException(_pConnection,
 							(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
 										(SQLUSMALLINT)columnIndex,
 										_nType,
 										_pValue,
-										(SQLINTEGER)_rSize,
+										_nSize,
 										&pcbValue),
 							_aStatementHandle,SQL_HANDLE_STMT,_xInterface,sal_False);
 	_bWasNull = pcbValue == SQL_NULL_DATA;
@@ -86,12 +86,12 @@
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen at sun.com", "OTools::bindParameter" );
 	SQLRETURN nRetcode;
-	SWORD   fSqlType;
-	SWORD   fCType;
-	SDWORD  nMaxLen = 0;
+	SQLSMALLINT fSqlType;
+	SQLSMALLINT fCType;
+	SQLLEN  nMaxLen = 0;
 	//	void*&   pData   = pDataBuffer;
-	SQLINTEGER* pLen    = (SQLINTEGER*)pLenBuffer;
-	SQLUINTEGER nColumnSize=0;
+	SQLLEN* pLen    = (SQLLEN*)pLenBuffer;
+	SQLULEN nColumnSize=0;
 	SQLSMALLINT	nDecimalDigits=0;
 
 	OTools::getBindTypes(_bUseWChar,_bUseOldTimeDate,_nODBCtype,fCType,fSqlType);
@@ -123,10 +123,10 @@
 void OTools::bindData(	SQLSMALLINT _nOdbcType,
 						sal_Bool _bUseWChar,
 						sal_Int8 *&_pData,
-						SQLINTEGER*& pLen,
+						SQLLEN*& pLen,
 						const void* _pValue,
 						rtl_TextEncoding _nTextEncoding,
-						SQLUINTEGER& _nColumnSize)
+						SQLULEN& _nColumnSize)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen at sun.com", "OTools::bindData" );
 	_nColumnSize = 0;
@@ -222,7 +222,7 @@
 			{
 				sal_Int32 nLen = 0;
                 nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength();
-				*pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
+				*pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
 			}
 			break;
 		case SQL_LONGVARCHAR:
@@ -235,21 +235,21 @@
 				::rtl::OString aString(::rtl::OUStringToOString(*(::rtl::OUString*)_pValue,_nTextEncoding));
 				nLen = aString.getLength();
 			}
-			*pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
+			*pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
 		}   break;
 		case SQL_DATE:
 			*(DATE_STRUCT*)_pData = *(DATE_STRUCT*)_pValue;
-			*pLen = (SDWORD)sizeof(DATE_STRUCT);
+			*pLen = (SQLLEN)sizeof(DATE_STRUCT);
 			_nColumnSize = 10;
 			break;
 		case SQL_TIME:
 			*(TIME_STRUCT*)_pData = *(TIME_STRUCT*)_pValue;
-			*pLen = (SDWORD)sizeof(TIME_STRUCT);
+			*pLen = (SQLLEN)sizeof(TIME_STRUCT);
 			_nColumnSize = 8;
 			break;
 		case SQL_TIMESTAMP:
 			*(TIMESTAMP_STRUCT*)_pData = *(TIMESTAMP_STRUCT*)_pValue;
-			*pLen = (SDWORD)sizeof(TIMESTAMP_STRUCT);
+			*pLen = (SQLLEN)sizeof(TIMESTAMP_STRUCT);
 			_nColumnSize = 19;
 			break;
 	}
@@ -262,7 +262,7 @@
 						SQLSMALLINT _nMaxLen,
 						const void* _pValue,
 						void* _pData,
-						SQLINTEGER *pLen,
+						SQLLEN *pLen,
 						const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
 						rtl_TextEncoding _nTextEncoding,
 						sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
@@ -271,7 +271,7 @@
 	SQLRETURN nRetcode;
 	SQLSMALLINT   fSqlType;
 	SQLSMALLINT   fCType;
-	SQLSMALLINT   nMaxLen = _nMaxLen;
+	SQLLEN nMaxLen = _nMaxLen;
 
 	OTools::getBindTypes(	sal_False,
 							_bUseOldTimeDate,
@@ -375,7 +375,7 @@
 					_pData = (void*)(columnIndex);
 					sal_Int32 nLen = 0;
                     nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength();
-					*pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
+					*pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
 				}
 					break;
 				case SQL_LONGVARCHAR:
@@ -383,7 +383,7 @@
 					_pData = (void*)(columnIndex);
 					sal_Int32 nLen = 0;
 					nLen = ((::rtl::OUString*)_pValue)->getLength();
-					*pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
+					*pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
 				}   break;
 				case SQL_DATE:
 					*pLen = sizeof(DATE_STRUCT);
@@ -446,10 +446,10 @@
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen at sun.com", "OTools::ThrowException" );
 
 	SDB_ODBC_CHAR szSqlState[5];
-	SDWORD pfNativeError;
+	SQLINTEGER pfNativeError;
 	SDB_ODBC_CHAR szErrorMessage[SQL_MAX_MESSAGE_LENGTH];
 	szErrorMessage[0] = '\0';
-	SWORD pcbErrorMsg = 0;
+	SQLSMALLINT pcbErrorMsg = 0;
 
 	// Informationen zur letzten Operation:
 	// wenn hstmt != SQL_NULL_HSTMT ist (Benutzung von SetStatus in SdbCursor, SdbTable, ...),
@@ -478,7 +478,7 @@
 Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
 										 SQLHANDLE _aStatementHandle,
 										 sal_Int32 columnIndex,
-										 SWORD  _fSqlType,
+										 SQLSMALLINT _fSqlType,
 										 sal_Bool &_bWasNull,
 										 const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
 {
@@ -486,14 +486,14 @@
 	char aCharArray[2048];
 	// Erstmal versuchen, die Daten mit dem kleinen Puffer
 	// abzuholen:
-	SQLINTEGER nMaxLen = sizeof aCharArray - 1;
+	SQLLEN nMaxLen = sizeof aCharArray - 1;
 	//	GETDATA(SQL_C_CHAR,aCharArray,nMaxLen);
-	SQLINTEGER pcbValue = 0;
+	SQLLEN pcbValue = 0;
 	OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
 										(SQLUSMALLINT)columnIndex,
 										_fSqlType,
 										(SQLPOINTER)aCharArray,
-										(SQLINTEGER)nMaxLen,
+										nMaxLen,
 										&pcbValue),
 							_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
 
@@ -540,7 +540,7 @@
 ::rtl::OUString OTools::getStringValue(OConnection* _pConnection,
 									   SQLHANDLE _aStatementHandle,
 									   sal_Int32 columnIndex,
-									   SWORD  _fSqlType,
+									   SQLSMALLINT _fSqlType,
 									   sal_Bool &_bWasNull,
 									   const Reference< XInterface >& _xInterface,
 									   rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
@@ -555,15 +555,15 @@
 		{
 			sal_Unicode waCharArray[2048];
 			// read the unicode data
-			sal_Int32 nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1;
+			SQLLEN nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1;
 			//	GETDATA(SQL_C_WCHAR, waCharArray, nMaxLen + sizeof(sal_Unicode));
 
-			SQLINTEGER pcbValue=0;
+			SQLLEN pcbValue=0;
 			OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
 												(SQLUSMALLINT)columnIndex,
 												SQL_C_WCHAR,
 												&waCharArray,
-												(SQLINTEGER)nMaxLen*sizeof(sal_Unicode),
+												(SQLLEN)nMaxLen*sizeof(sal_Unicode),
 												&pcbValue),
 									_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
 			_bWasNull = pcbValue == SQL_NULL_DATA;
@@ -571,7 +571,7 @@
 				return ::rtl::OUString();
 			// Bei Fehler bricht der GETDATA-Makro mit return ab,
 			// bei NULL mit break!
-			SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
+			SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
 			waCharArray[nLen] = 0;
 			aData = ::rtl::OUString(waCharArray);
 
@@ -595,7 +595,7 @@
 												(SQLUSMALLINT)columnIndex,
 												SQL_C_WCHAR,
 												&waCharArray,
-												(SQLINTEGER)nLen+1,
+												(SQLLEN)nLen+1,
 												&pcbValue),
 									_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
 				nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
@@ -610,21 +610,21 @@
 			char aCharArray[2048];
 			// Erstmal versuchen, die Daten mit dem kleinen Puffer
 			// abzuholen:
-			SDWORD nMaxLen = sizeof aCharArray - 1;
+			SQLLEN nMaxLen = sizeof aCharArray - 1;
 			//	GETDATA(SQL_C_CHAR,aCharArray,nMaxLen);
-			SQLINTEGER pcbValue = 0;
+			SQLLEN pcbValue = 0;
 			OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
 												(SQLUSMALLINT)columnIndex,
 												SQL_C_CHAR,
 												&aCharArray,
-												(SQLINTEGER)nMaxLen,
+												nMaxLen,
 												&pcbValue),
 									_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
 			_bWasNull = pcbValue == SQL_NULL_DATA;
 			if(_bWasNull)
 				return ::rtl::OUString();
 
-			SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
+			SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
 			aCharArray[nLen] = 0;
 			if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nLen-1] == 0 && nLen > 0 )
 				--nLen;
Index: connectivity/source/drivers/odbcbase/OStatement.cxx
===================================================================
--- connectivity/source/drivers/odbcbase/OStatement.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/drivers/odbcbase/OStatement.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -250,13 +250,13 @@
     m_xResultSet = Reference< XResultSet >();
 }
 //--------------------------------------------------------------------
-sal_Int32 OStatement_Base::getRowCount () throw( SQLException)
+SQLLEN OStatement_Base::getRowCount () throw( SQLException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
 	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
 
 
-	sal_Int32	numRows = 0;
+	SQLLEN numRows = 0;
 
 	try {
 		THROW_SQL(N3SQLRowCount(m_aStatementHandle,&numRows));
@@ -523,7 +523,9 @@
 		SQLRETURN nError = N3SQLMoreResults(m_aStatementHandle);
 		if(nError == SQL_SUCCESS)
 		{
-			N3SQLRowCount(m_aStatementHandle,&pArray[j]);
+			SQLLEN nRowCount=0;
+			N3SQLRowCount(m_aStatementHandle,&nRowCount);
+			pArray[j] = nRowCount;
 		}
 	}
 	return aRet;
Index: connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
===================================================================
--- connectivity/source/drivers/odbcbase/OPreparedStatement.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/drivers/odbcbase/OPreparedStatement.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -446,11 +446,11 @@
 	checkParameterIndex(parameterIndex);
 
 	sal_Int8* lenBuf = getLengthBuf (parameterIndex);
-	*(SDWORD*)lenBuf = SQL_NULL_DATA;
+	*(SQLLEN*)lenBuf = SQL_NULL_DATA;
 
 
-	SQLINTEGER	prec = 0;
-	SQLUINTEGER nColumnSize = 0;
+	SQLLEN prec = 0;
+	SQLULEN nColumnSize = 0;
 	if (sqlType == SQL_CHAR || sqlType == SQL_VARCHAR || sqlType == SQL_LONGVARCHAR)
 	{
 		prec = 1;
@@ -476,7 +476,7 @@
 											nDecimalDigits,
 											NULL,
 											prec,
-											(SDWORD*)lenBuf
+											(SQLLEN*)lenBuf
 											);
 	OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
 }
@@ -861,7 +861,7 @@
 
     // Bind the parameter with SQL_LEN_DATA_AT_EXEC
 	SQLSMALLINT   Ctype = SQL_C_CHAR;
-	SDWORD	atExec = SQL_LEN_DATA_AT_EXEC (length);
+	SQLLEN	atExec = SQL_LEN_DATA_AT_EXEC (length);
 	memcpy (dataBuf, &ParameterIndex, sizeof(ParameterIndex));
 	memcpy (lenBuf, &atExec, sizeof (atExec));
 
@@ -872,14 +872,14 @@
 	OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
 	N3SQLBindParameter(m_aStatementHandle,
 						(SQLUSMALLINT)ParameterIndex,
-						(SQLSMALLINT)SQL_PARAM_INPUT,
+						(SQLUSMALLINT)SQL_PARAM_INPUT,
 						Ctype,
 						(SQLSMALLINT)SQLtype,
-						(SQLUINTEGER)length,
+						(SQLULEN)length,
 						0,
 						dataBuf,
 						sizeof(ParameterIndex),
-						(SDWORD*)lenBuf);
+						(SQLLEN*)lenBuf);
 
 	// Save the input stream
 	boundParams[ParameterIndex - 1].setInputStream (x, length);
Index: connectivity/source/drivers/odbcbase/OResultSet.cxx
===================================================================
--- connectivity/source/drivers/odbcbase/OResultSet.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/drivers/odbcbase/OResultSet.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -843,8 +843,8 @@
 	checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
 
 
-	SQLSMALLINT nMaxLen = 20;
-	SQLINTEGER nRealLen = 0;
+	SQLLEN nMaxLen = 20;
+	SQLLEN nRealLen = 0;
 	Sequence<sal_Int8> aBookmark(nMaxLen);
 
 	SQLRETURN nRet = N3SQLBindCol(m_aStatementHandle,
@@ -925,7 +925,7 @@
     sal_Bool bPositionByBookmark = ( NULL != getOdbcFunction( ODBC3SQLBulkOperations ) );
 	if ( bPositionByBookmark )
 	{
-		SQLINTEGER nRealLen = 0;
+		SQLLEN nRealLen = 0;
 		nRet = N3SQLBindCol(m_aStatementHandle,
 							0,
 							SQL_C_VARBOOKMARK,
Index: connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
===================================================================
--- connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -86,13 +86,13 @@
 	return  sValue;
 }
 // -------------------------------------------------------------------------
-SWORD OResultSetMetaData::getNumColAttrib(OConnection* _pConnection
+SQLLEN OResultSetMetaData::getNumColAttrib(OConnection* _pConnection
                                               ,SQLHANDLE _aStatementHandle
                                               ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
                                               ,sal_Int32 _column
                                               ,sal_Int32 _ident) throw(SQLException, RuntimeException)
 {
-	SWORD nValue=0;
+	SQLLEN nValue=0;
 	OTools::ThrowException(_pConnection,(*(T3SQLColAttribute)_pConnection->getOdbcFunction(ODBC3SQLColAttribute))(_aStatementHandle,
 										 (SQLUSMALLINT)_column,
 										 (SQLUSMALLINT)_ident,
@@ -117,13 +117,13 @@
 	return getNumColAttrib(column,SQL_DESC_DISPLAY_SIZE);
 }
 // -------------------------------------------------------------------------
-SWORD OResultSetMetaData::getColumnODBCType(OConnection* _pConnection
+SQLSMALLINT OResultSetMetaData::getColumnODBCType(OConnection* _pConnection
                                               ,SQLHANDLE _aStatementHandle
                                               ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
                                               ,sal_Int32 column)
                                                throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
 {
-    SWORD nType = 0;
+    SQLSMALLINT nType = 0;
     try
 	{
 		nType = getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE);
Index: solenv/inc/libs.mk
===================================================================
--- solenv/inc/libs.mk	(.../tags/DEV300_m55)	(revision 275310)
+++ solenv/inc/libs.mk	(.../cws/cmcfixes62)	(revision 275310)
@@ -266,7 +266,6 @@
 ISDLIB=-lsd$(DLLPOSTFIX)
 PKGCHKLIB=-lpkgchk$(DLLPOSTFIX)
 HELPLINKERLIB=-lhelplinker$(DLLPOSTFIX)
-SYSSHELLLIB=-lsysshell
 .IF "$(GUI)$(COM)"=="WNTGCC"
 JVMACCESSLIB = -ljvmaccess$(UDK_MAJOR)$(COMID)
 .ELSE			# "$(GUI)$(COM)"=="WNTGCC"
@@ -475,7 +474,6 @@
 FREETYPELIB=freetype.lib
 PKGCHKLIB=ipkgchk.lib
 HELPLINKERLIB=ihelplinker.lib
-SYSSHELLLIB=sysshell.lib
 JVMACCESSLIB = ijvmaccess.lib
 CPPUNITLIB = cppunit.lib
 XSLTLIB = libxslt.lib $(ZLIB3RDLIB) $(LIBXML2LIB)
Index: binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx
===================================================================
--- binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx	(.../tags/DEV300_m55)	(revision 275310)
+++ binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx	(.../cws/cmcfixes62)	(revision 275310)
@@ -138,7 +138,6 @@
 #include <unotools/tempfile.hxx>
 #include <ucbhelper/content.hxx>
 #include <sot/storinfo.hxx>
-#include <shell/systemshell.hxx>
 
 #include "objsh.hxx"
 #include "request.hxx"
Index: binfilter/prj/build.lst
===================================================================
--- binfilter/prj/build.lst	(.../tags/DEV300_m55)	(revision 275310)
+++ binfilter/prj/build.lst	(.../cws/cmcfixes62)	(revision 275310)
@@ -1,4 +1,4 @@
-bf      binfilter :     idl basic goodies xmlscript connectivity framework stoc uui offuh shell NULL
+bf      binfilter :     idl basic goodies xmlscript connectivity framework stoc uui offuh NULL
 bf	binfilter											usr1	-	all	bf_mkout NULL
 bf	binfilter\bf_svtools\source\inc						get		-	all	bf_svt_sinc NULL
 bf  binfilter\bf_svtools\source\config					nmake	-	all bf_svt_config NULL
Index: dmake/dag.c
===================================================================
--- dmake/dag.c	(.../tags/DEV300_m55)	(revision 275310)
+++ dmake/dag.c	(.../cws/cmcfixes62)	(revision 275310)
@@ -369,14 +369,17 @@
 	 /* strip out any \<nl> combinations where \ is the current
 	  * CONTINUATION char */
 	 for(p=q; (p=strchr(p,CONTINUATION_CHAR))!=NIL(char); )
-	    if( p[1] == '\n' )
-	       strcpy( p, p+2 );
+	    if( p[1] == '\n' ) {
+	       size_t len = strlen(p+2)+1;
+	       memmove ( p, p+2, len );
+	    }
 	    else
 	       p++;
 
 	 p = DmStrSpn(q ," \t");	/* Strip white space before ... */
 	 if( p != q ) {
-	    strcpy( q, p);
+	    size_t len = strlen(p)+1;
+	    memmove( q, p, len );
 	    p = q;
 	 }
 
Index: dmake/make.c
===================================================================
--- dmake/make.c	(.../tags/DEV300_m55)	(revision 275310)
+++ dmake/make.c	(.../cws/cmcfixes62)	(revision 275310)
@@ -1352,8 +1352,10 @@
        * Nothing in Expand() should be able to change dynamic macros. */
       cmnd = Expand( rp->st_string );
 
-      if( new_attr && (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd )
-	 strcpy(cmnd,p);
+      if( new_attr && (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd ) {
+	 size_t len = strlen(p)+1;
+	 memmove(cmnd,p,len);
+      }
 
       /* COMMAND macro is set to "$(CMNDNAME) $(CMNDARGS)" by default, it is
        * possible for the user to reset it to, for example
@@ -1381,8 +1383,10 @@
 	 shell  = ((l_attr & A_SHELL) != 0);
 
 	 /* clean up the attributes that we may have just added. */
-	 if( (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd )
-	    strcpy(cmnd,p);
+	 if( (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd ) {
+	    size_t len = strlen(p)+1;
+	    memmove(cmnd,p,len);
+	 }
       }
 
 #if defined(MSDOS)
@@ -1477,8 +1481,9 @@
    for( p=cmnd; *(n = DmStrPbrk(p,tmp)) != '\0'; )
       /* Remove the \<nl> sequences. */
       if(*n == CONTINUATION_CHAR && n[1] == '\n') {
+	 size_t len = strlen(n+2)+1;
 	 DB_PRINT( "make", ("fixing [%s]", p) );
-	 strcpy( n, n+2 );
+	 memmove( n, n+2, len );
 	 p = n;
       }
       /* Look for an escape sequence and replace it by it's corresponding
Index: dmake/expand.c
===================================================================
--- dmake/expand.c	(.../tags/DEV300_m55)	(revision 275310)
+++ dmake/expand.c	(.../cws/cmcfixes62)	(revision 275310)
@@ -230,6 +230,7 @@
 char *tok;
 {
    if( strchr( "\"\\vantbrf01234567", tok[1] ) ) {
+      size_t len;
       switch( tok[1] ) {
 	 case 'a' : *tok = 0x07; break;
 	 case 'b' : *tok = '\b'; break;
@@ -246,13 +247,15 @@
 	    register int j = 0;
 	    for( ; i<2 && isdigit(tok[2]); i++ ) {
 	       j = (j << 3) + (tok[1] - '0');
-	       strcpy( tok+1, tok+2 );
+	       len = strlen(tok+2)+1;
+	       memmove( tok+1, tok+2, len );
 	    }
 	    j = (j << 3) + (tok[1] - '0');
 	    *tok = j;
 	 }
       }
-      strcpy( tok+1, tok+2 );
+      len = strlen(tok+2)+1;
+      memmove( tok+1, tok+2, len );
    }
 }
 
@@ -365,7 +368,8 @@
       if( (e = Basename(s)) != s) {
 	 if( !(mod & DIRECTORY_FLAG) ) {
 	    /* Move the basename to the start. */
-	    strcpy(s, e);
+	    size_t len = strlen(e)+1;
+	    memmove(s, e, len);
 	 }
 	 else
 	    s = e;
@@ -382,7 +386,8 @@
 
       if( !(mod & FILE_FLAG) ) {
 	 /* Move the suffix to the start. */
-	 strcpy( s, e );
+	 size_t len = strlen(e)+1;
+         memmove(s, e, len);
       }
       else
 	 s = e;
@@ -725,8 +730,10 @@
 	      done = !lev;
 	      break;
             } else {
+              size_t len;
 	      s[1] = ' ';
-	      strcpy( s, s+1 );
+              len = strlen(s+1)+1;
+	      memmove( s, s+1, len );
 	    }
 	    /*FALLTHRU*/
 	 case ' ':
@@ -835,8 +842,10 @@
        * converted them to a real space. Let's verify this. */
       for( p=s; *p && *p != edelim && *p; p++ ) {
 	if( p[0] == '\\' && p[1] == '\n' ) {
+	  size_t len;
 	  p[1] = ' ';
-	  strcpy( p, p+1 );
+	  len = strlen(p+1)+1;
+	  memmove( p, p+1, len );
 	}
       }
       if( !*p )
@@ -1120,7 +1129,10 @@
       *flag = 1;
       res   = Expand( start );
 
-      if( (t = DmStrSpn( res, " \t" )) != res ) strcpy( res, t );
+      if( (t = DmStrSpn( res, " \t" )) != res ) {
+          size_t len = strlen(t)+1;
+          memmove( res, t, len );
+      }
    }
 
    FREE( start );       /* this is ok! start is assigned a DmSubStr above */
Index: dmake/getinp.c
===================================================================
--- dmake/getinp.c	(.../tags/DEV300_m55)	(revision 275310)
+++ dmake/getinp.c	(.../cws/cmcfixes62)	(revision 275310)
@@ -169,7 +169,8 @@
 	  * text lines on input.  The maximum size of this is governened by
 	  * Buffer_size */
 	    if( q != p && q[-1] == CONTINUATION_CHAR ) {
-	       strcpy( q, q+1 );
+	       size_t len = strlen(q+1)+1;
+	       memmove( q, q+1, len );
 	       q--;
 	       cont = FALSE;
 	    }
@@ -290,7 +291,8 @@
    while( (c = strchr(c, COMMENT_CHAR)) != NIL(char) ) {
       if( Comment || State == NORMAL_SCAN )
 	 if( c != str && c[-1] == ESCAPE_CHAR ) {
-	    strcpy( c-1, c );        /* copy it left, due to \# */
+	    size_t len = strlen(c)+1;
+	    memmove( c-1, c, len );  /* copy it left, due to \# */
 	    if( pend ) (*pend)--;    /* shift tail pointer left */
 	 }
 	 else {
Index: dmake/path.c
===================================================================
--- dmake/path.c	(.../tags/DEV300_m55)	(revision 275310)
+++ dmake/path.c	(.../cws/cmcfixes62)	(revision 275310)
@@ -172,6 +172,7 @@
    char *tpath;
    int hasdriveletter = 0;
    int delentry;
+   size_t len;
 
    DB_ENTER( "Clean_path" );
 
@@ -231,14 +232,16 @@
 	    p++;
 	 }
 	 while( *p == *DirSepStr);
-	 strcpy(t+1,p);
+	 len = strlen(p)+1;
+	 memmove(t+1,p,len);
 	 continue;
       }
 
       /* Remove './'. If OOODMAKEMODE is set do this only if it is not at
        * the start of the path. */
       if ( p-q == 1 && *q == '.' && (q != path || !STOBOOL(OOoDmMode)) ) {
-	 strcpy(q,p+1);
+	 len = strlen(p+1)+1;
+	 memmove(q,p+1,len);
 	 q = tpath;
 	 continue;
       }
@@ -268,7 +271,8 @@
 	 }
 	 while( *t == *DirSepStr);
 	 /* q points to first letter of the current directory/file. */
-	 strcpy(q,t);
+	 len = strlen(t)+1;
+	 memmove(q,t,len);
 	 q = tpath;
       }
       else
Index: dmake/rulparse.c
===================================================================
--- dmake/rulparse.c	(.../tags/DEV300_m55)	(revision 275310)
+++ dmake/rulparse.c	(.../cws/cmcfixes62)	(revision 275310)
@@ -897,7 +897,7 @@
 	 /* Handle %-targets. */
 	 CELLPTR cur;
 	 CELLPTR tpq = NIL(CELL);
-	 CELLPTR nprq;
+	 CELLPTR nprq = NULL;
 
 #ifdef DBUG
 	 DB_PRINT( "%", ("Handling %%-target [%s : : <prerequisites follow, maybe empty>]",
@@ -915,7 +915,8 @@
 
 	    if( *name == '\'' && name[len-1]=='\'' ){
 	       name[len-1] = '\0';
-	       strcpy(name,name+1);
+	       len = strlen(name+1)+1;
+	       memmove(name,name+1,len);
 	       /* add indirect prerequisite */
 	       _add_indirect_prereq( cur );
 	    }
Index: postprocess/prj/build.lst
===================================================================
--- postprocess/prj/build.lst	(.../tags/DEV300_m55)	(revision 275310)
+++ postprocess/prj/build.lst	(.../cws/cmcfixes62)	(revision 275310)
@@ -1,4 +1,4 @@
-po	postprocess	::	accessibility automation basctl bean fondu BINFILTER:binfilter chart2 configmgr CRASHREP:crashrep dbaccess desktop dtrans embeddedobj embedserv EPM:epm eventattacher extensions extras fileaccess filter forms fpicker helpcontent2 hwpfilter io JAVAINSTALLER2:javainstaller2 lingucomponent MATHMLDTD:MathMLDTD MSFONTEXTRACT:msfontextract ODK:odk officecfg package padmin psprint_config remotebridges sc scaddins sccomp scp2 scripting sd setup_native slideshow starmath sw sysui testshl2 testtools ucb UnoControls unoxml ure wizards xmerge xmlsecurity BITSTREAM_VERA_FONTS:bitstream_vera_fonts DICTIONARIES:dictionaries OOo:pyuno OOo:readlicense_oo SO:top unodevtools JFREEREPORT:jfreereport REPORTBUILDER:reportbuilder reportdesign SDEXT:sdext SWEXT:swext writerfilter oox NULL
+po	postprocess	::	accessibility automation basctl bean fondu BINFILTER:binfilter chart2 configmgr CRASHREP:crashrep dbaccess desktop dtrans embeddedobj embedserv EPM:epm eventattacher extensions extras fileaccess filter forms fpicker helpcontent2 hwpfilter io JAVAINSTALLER2:javainstaller2 lingucomponent MATHMLDTD:MathMLDTD MSFONTEXTRACT:msfontextract ODK:odk officecfg package padmin psprint_config remotebridges sc scaddins sccomp scp2 scripting sd setup_native shell slideshow starmath sw sysui testshl2 testtools ucb UnoControls unoxml ure wizards xmerge xmlsecurity BITSTREAM_VERA_FONTS:bitstream_vera_fonts DICTIONARIES:dictionaries OOo:pyuno OOo:readlicense_oo SO:top unodevtools JFREEREPORT:jfreereport REPORTBUILDER:reportbuilder reportdesign SDEXT:sdext SWEXT:swext writerfilter oox NULL
 po	postprocess			    	usr1	-	all	po_mkout NULL
 po	postprocess\checkxml		nmake	-	all	po_checkxml NULL
 po	postprocess\packconfig		nmake	-	all	po_packconfig po_checkxml NULL

workspace.defaultdoclang.patch:
 chart2/source/tools/CharacterProperties.cxx      |   15 ++-
 desktop/source/app/langselect.cxx                |   97 ++++-------------------
 desktop/source/app/langselect.hxx                |    2 
 i18npool/inc/i18npool/mslangid.hxx               |   10 ++
 i18npool/source/isolang/mslangid.cxx             |   55 +++++++++++++
 linguistic/source/lngopt.cxx                     |   18 ++--
 linguistic/source/lngopt.hxx                     |    2 
 reportdesign/source/core/api/ReportComponent.cxx |   10 +-
 reportdesign/util/makefile.mk                    |    1 
 sc/source/ui/app/scmod2.cxx                      |    9 +-
 sd/source/core/drawdoc.cxx                       |   10 +-
 sd/source/ui/notes/EditWindow.cxx                |    8 +
 sd/source/ui/presenter/PresenterTextView.cxx     |    9 +-
 svtools/source/config/lingucfg.cxx               |   78 +++++-------------
 svx/inc/svx/langbox.hxx                          |    2 
 svx/source/dialog/langbox.cxx                    |   28 ++++++
 svx/source/dialog/optgdlg.cxx                    |   76 +++++++++++++-----
 sw/source/ui/app/appopt.cxx                      |   18 +++-
 sw/source/ui/app/docshini.cxx                    |    8 +
 sw/source/ui/config/fontcfg.cxx                  |   31 ++++---
 sw/source/ui/dialog/ascfldlg.cxx                 |    8 +
 sw/source/ui/lingu/olmenu.cxx                    |    3 
 sw/util/makefile.mk                              |    1 
 23 files changed, 292 insertions(+), 207 deletions(-)

--- NEW FILE workspace.defaultdoclang.patch ---
Index: reportdesign/source/core/api/ReportComponent.cxx
===================================================================
--- reportdesign/source/core/api/ReportComponent.cxx	(revision 267481)
+++ reportdesign/source/core/api/ReportComponent.cxx	(working copy)
@@ -41,10 +41,12 @@
 #include "ReportControlModel.hxx"
 #include <com/sun/star/reflection/XProxyFactory.hpp>
 #include <com/sun/star/text/ParagraphVertAlign.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
 // #include <svx/unoshape.hxx>
 #include <svx/unolingu.hxx>
 #include <svtools/syslocale.hxx>
 #include <svtools/lingucfg.hxx>
+#include <i18npool/mslangid.hxx>
 // =============================================================================
 namespace reportdesign
 {
@@ -96,12 +98,14 @@
     try
     {
         SvtLinguConfig aLinguConfig;
+        using namespace ::com::sun::star::i18n::ScriptType;
+
         aLinguConfig.GetProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale"))) >>= aCharLocale;
-        LanguageType eCurLang = SvxLocaleToLanguage( aCharLocale );
+        LanguageType eCurLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aCharLocale), LATIN);
         aLinguConfig.GetProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CJK")))  >>= aCharLocaleAsian;
-        LanguageType eCurLangCJK = SvxLocaleToLanguage( aCharLocaleAsian );
+        LanguageType eCurLangCJK = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aCharLocaleAsian), ASIAN);
         aLinguConfig.GetProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CTL")))  >>= aCharLocaleComplex;
-        LanguageType eCurLangCTL = SvxLocaleToLanguage( aCharLocaleComplex );
+        LanguageType eCurLangCTL = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aCharLocaleComplex), COMPLEX);
 
         Font aLatin,aCJK,aCTL;
         lcl_getDefaultFonts(aLatin,aCJK,aCTL,eCurLang,eCurLangCJK,eCurLangCTL);
Index: linguistic/source/lngopt.cxx
===================================================================
--- linguistic/source/lngopt.cxx	(revision 267481)
+++ linguistic/source/lngopt.cxx	(working copy)
@@ -46,7 +46,9 @@
 #include <com/sun/star/registry/XSimpleRegistry.hpp>
 #include <com/sun/star/registry/XRegistryKey.hpp>
 #include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
 #include <unotools/processfactory.hxx>
+#include <i18npool/mslangid.hxx>
 
 using namespace utl;
 using namespace osl;
@@ -100,13 +102,13 @@
 }
 
 
-BOOL LinguOptions::SetLocale_Impl( INT16 &rLanguage, Any &rOld, const Any &rVal)
+BOOL LinguOptions::SetLocale_Impl( INT16 &rLanguage, Any &rOld, const Any &rVal, sal_Int16 nType)
 {
 	BOOL bRes = FALSE;
 
 	Locale	aNew;
 	rVal >>= aNew;
-	INT16 nNew = LocaleToLanguage( aNew );
+        INT16 nNew = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aNew), nType);
 	if (nNew != rLanguage)
 	{
 		Locale	aLocale( CreateLocale( rLanguage ) );
@@ -149,17 +151,17 @@
 		case WID_HYPH_MIN_WORD_LENGTH :		pnVal = &pData->nHyphMinWordLength;	break;
 		case WID_DEFAULT_LOCALE :
 		{
-			bRes = SetLocale_Impl( pData->nDefaultLanguage, rOld, rVal );
+			bRes = SetLocale_Impl( pData->nDefaultLanguage, rOld, rVal, ::com::sun::star::i18n::ScriptType::LATIN );
 			break;
 		}
 		case WID_DEFAULT_LOCALE_CJK :
 		{
-			bRes = SetLocale_Impl( pData->nDefaultLanguage_CJK, rOld, rVal );
+			bRes = SetLocale_Impl( pData->nDefaultLanguage_CJK, rOld, rVal, ::com::sun::star::i18n::ScriptType::ASIAN );
 			break;
 		}
 		case WID_DEFAULT_LOCALE_CTL :
 		{
-			bRes = SetLocale_Impl( pData->nDefaultLanguage_CTL, rOld, rVal );
+			bRes = SetLocale_Impl( pData->nDefaultLanguage_CTL, rOld, rVal, ::com::sun::star::i18n::ScriptType::COMPLEX );
 			break;
 		}
 		default :
@@ -226,19 +228,19 @@
 		case WID_HYPH_MIN_WORD_LENGTH :		pnVal = &pData->nHyphMinWordLength;	break;
 		case WID_DEFAULT_LOCALE :
 		{
-			Locale aLocale( CreateLocale( pData->nDefaultLanguage ) );
+			Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage ) );
 			rVal.setValue( &aLocale, ::getCppuType((Locale*)0 ));
 			break;
 		}
 		case WID_DEFAULT_LOCALE_CJK :
 		{
-			Locale aLocale( CreateLocale( pData->nDefaultLanguage_CJK ) );
+			Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage_CJK ) );
 			rVal.setValue( &aLocale, ::getCppuType((Locale*)0 ));
 			break;
 		}
 		case WID_DEFAULT_LOCALE_CTL :
 		{
-			Locale aLocale( CreateLocale( pData->nDefaultLanguage_CTL ) );
+			Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage_CTL ) );
 			rVal.setValue( &aLocale, ::getCppuType((Locale*)0 ));
 			break;
 		}
Index: linguistic/source/lngopt.hxx
===================================================================
--- linguistic/source/lngopt.hxx	(revision 267481)
+++ linguistic/source/lngopt.hxx	(working copy)
@@ -77,7 +77,7 @@
 
 	BOOL SetLocale_Impl( INT16 &rLanguage,
 			::com::sun::star::uno::Any &rOld,
-			const ::com::sun::star::uno::Any &rVal);
+			const ::com::sun::star::uno::Any &rVal, sal_Int16 nType );
 
 public:
 	LinguOptions();
Index: sc/source/ui/app/scmod2.cxx
===================================================================
--- sc/source/ui/app/scmod2.cxx	(revision 267481)
+++ sc/source/ui/app/scmod2.cxx	(working copy)
@@ -37,7 +37,8 @@
 
 #include <svx/unolingu.hxx>
 #include <svtools/lingucfg.hxx>
-
+#include <i18npool/mslangid.hxx>
+#include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/linguistic2/XThesaurus.hpp>
 #include <com/sun/star/lang/Locale.hpp>
 
@@ -62,9 +63,9 @@
 	SvtLinguOptions aOptions;
 	aConfig.GetOptions( aOptions );
 
-	rDefLang = aOptions.nDefaultLanguage;
-	rCjkLang = aOptions.nDefaultLanguage_CJK;
-	rCtlLang = aOptions.nDefaultLanguage_CTL;
+	rDefLang = MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN);
+	rCjkLang = MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN);
+	rCtlLang = MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
 	rAutoSpell = aOptions.bIsSpellAuto;
 }
 
Index: sd/source/core/drawdoc.cxx
===================================================================
--- sd/source/core/drawdoc.cxx	(revision 267481)
+++ sd/source/core/drawdoc.cxx	(working copy)
@@ -34,6 +34,7 @@
 #include "PageListWatcher.hxx"
 #include <com/sun/star/text/WritingMode.hpp>
 #include <com/sun/star/document/PrinterIndependentLayout.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
 #include <svx/forbiddencharacterstable.hxx>
 
 #include <svx/svxids.hrc>
@@ -230,9 +231,12 @@
 		SvtLinguOptions			aOptions;
 		aLinguConfig.GetOptions( aOptions );
 
-		SetLanguage( aOptions.nDefaultLanguage, EE_CHAR_LANGUAGE );
-		SetLanguage( aOptions.nDefaultLanguage_CJK, EE_CHAR_LANGUAGE_CJK );
-		SetLanguage( aOptions.nDefaultLanguage_CTL, EE_CHAR_LANGUAGE_CTL );
+		SetLanguage( MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage, 
+            ::com::sun::star::i18n::ScriptType::LATIN), EE_CHAR_LANGUAGE );
+		SetLanguage( MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage_CJK,
+            ::com::sun::star::i18n::ScriptType::ASIAN), EE_CHAR_LANGUAGE_CJK );
+		SetLanguage( MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage_CTL, 
+            ::com::sun::star::i18n::ScriptType::COMPLEX), EE_CHAR_LANGUAGE_CTL );
 
 		mbOnlineSpell = aOptions.bIsSpellAuto;
 	}
Index: sd/source/ui/notes/EditWindow.cxx
===================================================================
--- sd/source/ui/notes/EditWindow.cxx	(revision 267481)
+++ sd/source/ui/notes/EditWindow.cxx	(working copy)
@@ -34,6 +34,8 @@
 #include "EditWindow.hxx"
 
 #include "sdmod.hxx"
+#include <i18npool/mslangid.hxx>
+#include <com/sun/star/i18n/ScriptType.hpp>
 #include <svx/editeng.hxx>
 #include <svx/editview.hxx>
 #include <vcl/scrbar.hxx>
@@ -174,9 +176,9 @@
             {   LANGUAGE_ARABIC_SAUDI_ARABIA,  LANGUAGE_NONE,
                 DEFAULTFONT_CTL_TEXT,   EE_CHAR_FONTINFO_CTL }
         };
-        aTable[0].nLang = aOpt.nDefaultLanguage;
-        aTable[1].nLang = aOpt.nDefaultLanguage_CJK;
-        aTable[2].nLang = aOpt.nDefaultLanguage_CTL;
+        aTable[0].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN);
+        aTable[1].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN);
+        aTable[2].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
         //
         for (int i = 0;  i < 3;  ++i)
         {
Index: sd/source/ui/presenter/PresenterTextView.cxx
===================================================================
--- sd/source/ui/presenter/PresenterTextView.cxx	(revision 267481)
+++ sd/source/ui/presenter/PresenterTextView.cxx	(working copy)
@@ -33,6 +33,7 @@
 
 #include "PresenterTextView.hxx"
 
+#include <i18npool/mslangid.hxx>
 #include <cppcanvas/vclfactory.hxx>
 #include <svtools/itempool.hxx>
 #include <svtools/itemset.hxx>
@@ -52,7 +53,9 @@
 #include <com/sun/star/awt/Size.hpp>
 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
 #include <com/sun/star/util/Color.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
 
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
@@ -381,9 +384,9 @@
             {   LANGUAGE_ARABIC_SAUDI_ARABIA,  LANGUAGE_NONE,
                 DEFAULTFONT_CTL_TEXT,   EE_CHAR_FONTINFO_CTL }
         };
-        aTable[0].nLang = aOpt.nDefaultLanguage;
-        aTable[1].nLang = aOpt.nDefaultLanguage_CJK;
-        aTable[2].nLang = aOpt.nDefaultLanguage_CTL;
+        aTable[0].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN);
+        aTable[1].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN);
+        aTable[2].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
         //
         for (int i = 0;  i < 3;  ++i)
         {
Index: i18npool/source/isolang/mslangid.cxx
===================================================================
--- i18npool/source/isolang/mslangid.cxx	(revision 267481)
+++ i18npool/source/isolang/mslangid.cxx	(working copy)
@@ -41,6 +41,9 @@
 LanguageType MsLangId::nConfiguredSystemLanguage   = LANGUAGE_SYSTEM;
 LanguageType MsLangId::nConfiguredSystemUILanguage = LANGUAGE_SYSTEM;
 
+LanguageType MsLangId::nConfiguredWesternFallback  = LANGUAGE_SYSTEM;
+LanguageType MsLangId::nConfiguredAsianFallback    = LANGUAGE_SYSTEM;
+LanguageType MsLangId::nConfiguredComplexFallback  = LANGUAGE_SYSTEM;
 
 // static
 void MsLangId::setConfiguredSystemLanguage( LanguageType nLang )
@@ -55,8 +58,25 @@
     nConfiguredSystemUILanguage = nLang;
 }
 
+// static
+void MsLangId::setConfiguredWesternFallback( LanguageType nLang )
+{
+    nConfiguredWesternFallback = nLang;
+}
 
 // static
+void MsLangId::setConfiguredAsianFallback( LanguageType nLang )
+{
+    nConfiguredAsianFallback = nLang;
+}
+
+// static
+void MsLangId::setConfiguredComplexFallback( LanguageType nLang )
+{
+    nConfiguredComplexFallback = nLang;
+}
+
+// static
 inline LanguageType MsLangId::simplifySystemLanguages( LanguageType nLang )
 {
     switch (nLang)
@@ -120,6 +140,41 @@
 
 
 // static
+LanguageType MsLangId::resolveSystemLanguageByScriptType( LanguageType nLang, sal_Int16 nType )
+{
+    if (nLang == LANGUAGE_NONE)
+        return nLang;
+
+    nLang = getRealLanguage(nLang);
+    if (nType != ::com::sun::star::i18n::ScriptType::WEAK && getScriptType(nLang) != nType)
+    {
+        switch(nType)
+        {
+            case ::com::sun::star::i18n::ScriptType::ASIAN:
+                if (nConfiguredAsianFallback == LANGUAGE_SYSTEM)
+                    nLang = LANGUAGE_CHINESE_SIMPLIFIED;
+                else
+                    nLang = nConfiguredComplexFallback;
+                break;
+            case ::com::sun::star::i18n::ScriptType::COMPLEX:
+                if (nConfiguredComplexFallback == LANGUAGE_SYSTEM)
+                    nLang = LANGUAGE_HINDI;
+                else
+                    nLang = nConfiguredComplexFallback;
+                break;
+            default:
+                if (nConfiguredWesternFallback == LANGUAGE_SYSTEM)
+                    nLang = LANGUAGE_ENGLISH_US;
+                else
+                    nLang = nConfiguredWesternFallback;
+                break;
+                break;
+        }
+    }
+    return nLang;
+}
+
+// static
 void MsLangId::convertLanguageToLocale( LanguageType nLang,
         ::com::sun::star::lang::Locale & rLocale )
 {
Index: i18npool/inc/i18npool/mslangid.hxx
===================================================================
--- i18npool/inc/i18npool/mslangid.hxx	(revision 267481)
+++ i18npool/inc/i18npool/mslangid.hxx	(working copy)
@@ -216,6 +216,9 @@
     static LanguageType getRealLanguageWithoutConfig( LanguageType nLang );
 
 
+    static LanguageType resolveSystemLanguageByScriptType( LanguageType nLang, sal_Int16 nType );
+
+
     /** Whether locale has a Right-To-Left orientation. */
     static bool isRightToLeft( LanguageType nLang );
 
@@ -246,6 +249,9 @@
         configuration! */
     static void setConfiguredSystemLanguage( LanguageType nLang );
     static void setConfiguredSystemUILanguage( LanguageType nLang );
+    static void setConfiguredWesternFallback( LanguageType nLang );
+    static void setConfiguredComplexFallback( LanguageType nLang );
+    static void setConfiguredAsianFallback( LanguageType nLang );
 
 // ---------------------------------------------------------------------------
 
@@ -274,6 +280,10 @@
     static LanguageType         nConfiguredSystemLanguage;
     static LanguageType         nConfiguredSystemUILanguage;
 
+    static LanguageType         nConfiguredWesternFallback;
+    static LanguageType         nConfiguredAsianFallback;
+    static LanguageType         nConfiguredComplexFallback;
+
     static LanguageType getPlatformSystemLanguage();
     static LanguageType getPlatformSystemUILanguage();
 
Index: sw/source/ui/app/docshini.cxx
===================================================================
--- sw/source/ui/app/docshini.cxx	(revision 267481)
+++ sw/source/ui/app/docshini.cxx	(working copy)
@@ -37,6 +37,7 @@
 #ifndef _SVX_DIALOGS_HRC
 #include <svx/dialogs.hrc>
 #endif
+#include <i18npool/mslangid.hxx>
 #include <sot/storinfo.hxx>
 #include <sot/storage.hxx>
 #include <svtools/zforlist.hxx>
@@ -58,6 +59,7 @@
 #endif
 #include <linguistic/lngprops.hxx>
 #include <com/sun/star/document/UpdateDocMode.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
 #include <rtl/logfile.hxx>
 #include <sfx2/docfilt.hxx>
 #include <svx/xtable.hxx>
@@ -791,9 +793,9 @@
 
     SvtLinguConfig().GetOptions( aLinguOpt );
 
-    sal_Int16   nVal = aLinguOpt.nDefaultLanguage,
-                eCJK = aLinguOpt.nDefaultLanguage_CJK,
-                eCTL = aLinguOpt.nDefaultLanguage_CTL;
+    sal_Int16   nVal = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
+                eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
+                eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
 	aDfltSet.Put( SvxLanguageItem( nVal, RES_CHRATR_LANGUAGE ) );
     aDfltSet.Put( SvxLanguageItem( eCJK, RES_CHRATR_CJK_LANGUAGE ) );
     aDfltSet.Put( SvxLanguageItem( eCTL, RES_CHRATR_CTL_LANGUAGE ) );
Index: sw/source/ui/app/appopt.cxx
===================================================================
--- sw/source/ui/app/appopt.cxx	(revision 267481)
+++ sw/source/ui/app/appopt.cxx	(working copy)
@@ -35,6 +35,8 @@
 #include <cmdid.h>		  	// Funktion-Ids
 #endif
 
+#include <com/sun/star/i18n/ScriptType.hpp>
+
 #define _SVSTDARR_STRINGSDTOR
 #include <svtools/svstdarr.hxx>
 
@@ -54,6 +56,7 @@
 #include <svx/optgrid.hxx>
 #include <svx/svxdlg.hxx>
 #include <svx/dialogs.hrc>
+#include <i18npool/mslangid.hxx>
 #include <fontcfg.hxx>
 #include <optload.hxx>
 #include <optcomp.hxx>
@@ -191,16 +194,25 @@
 		pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));*/
 
         SvtLinguConfig aLinguCfg;
+        Locale aLocale;
+        LanguageType nLang;
 
+        using namespace ::com::sun::star::i18n::ScriptType;
+
         Any aLang = aLinguCfg.GetProperty(C2U("DefaultLocale"));
-        Locale aLocale;
         aLang >>= aLocale;
-        pRet->Put(SvxLanguageItem(SvxLocaleToLanguage( aLocale ), SID_ATTR_LANGUAGE));
+        nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), LATIN);
+        pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
 
         aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CJK"));
         aLang >>= aLocale;
-        pRet->Put(SvxLanguageItem(SvxLocaleToLanguage( aLocale ), SID_ATTR_CHAR_CJK_LANGUAGE));
+        nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), ASIAN);
+        pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
 
+        aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CTL"));
+        aLang >>= aLocale;
+        nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), COMPLEX);
+        pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
     }
 	if(bTextDialog)
 		pRet->Put(SwPtrItem(FN_PARAM_STDFONTS, GetStdFontConfig()));
Index: sw/source/ui/dialog/ascfldlg.cxx
===================================================================
--- sw/source/ui/dialog/ascfldlg.cxx	(revision 267481)
+++ sw/source/ui/dialog/ascfldlg.cxx	(working copy)
@@ -35,6 +35,8 @@
 #endif
 #include <hintids.hxx>
 #include <rtl/textenc.h>
+#include <i18npool/mslangid.hxx>
+#include <com/sun/star/i18n/ScriptType.hpp>
 #include <svtools/lingucfg.hxx>
 #include <fontcfg.hxx>
 #include <swmodule.hxx>
@@ -234,14 +236,14 @@
                     switch(nAppScriptType)
                     {
                         case SCRIPTTYPE_ASIAN:
-                            aOpt.SetLanguage(aLinguOpt.nDefaultLanguage_CJK);
+                            aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, SCRIPTTYPE_ASIAN));
                         break;
                         case SCRIPTTYPE_COMPLEX:
-                            aOpt.SetLanguage(aLinguOpt.nDefaultLanguage_CTL);
+                            aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, SCRIPTTYPE_COMPLEX));
                         break;
                         //SCRIPTTYPE_LATIN:
                         default:
-                            aOpt.SetLanguage(aLinguOpt.nDefaultLanguage);
+                            aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, SCRIPTTYPE_LATIN));
                     }
                 }
 			}
Index: sw/source/ui/config/fontcfg.cxx
===================================================================
--- sw/source/ui/config/fontcfg.cxx	(revision 267481)
+++ sw/source/ui/config/fontcfg.cxx	(working copy)
@@ -33,10 +33,12 @@
 
 
 #include <fontcfg.hxx>
+#include <i18npool/mslangid.hxx>
 #include <vcl/outdev.hxx>
 #include <svtools/lingucfg.hxx>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/i18n/ScriptType.hpp>
 #include <swtypes.hxx>
 
 #include <unomid.h>
@@ -116,9 +118,10 @@
 
     SvtLinguConfig().GetOptions( aLinguOpt );
 
-	sal_Int16   eWestern = aLinguOpt.nDefaultLanguage,
-                eCJK = aLinguOpt.nDefaultLanguage_CJK,
-                eCTL = aLinguOpt.nDefaultLanguage_CTL;
+    sal_Int16   eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
+                eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
+                eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
+
     for(sal_Int16 i = 0; i < DEF_FONT_COUNT; i++)
     {
         sDefaultFonts[i] = GetDefaultFor(i,
@@ -163,9 +166,10 @@
 
     SvtLinguConfig().GetOptions( aLinguOpt );
 
-	sal_Int16   eWestern = aLinguOpt.nDefaultLanguage,
-                eCJK = aLinguOpt.nDefaultLanguage_CJK,
-                eCTL = aLinguOpt.nDefaultLanguage_CTL;
+    sal_Int16   eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
+                eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
+                eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
+
     for(sal_uInt16 nProp = 0;
         nProp < sal::static_int_cast< sal_uInt16, sal_Int32 >( aNames.getLength() );
             nProp++)
@@ -198,9 +202,10 @@
 
     SvtLinguConfig().GetOptions( aLinguOpt );
 
-	sal_Int16   eWestern = aLinguOpt.nDefaultLanguage,
-                eCJK = aLinguOpt.nDefaultLanguage_CJK,
-                eCTL = aLinguOpt.nDefaultLanguage_CTL;
+    sal_Int16   eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
+                eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
+                eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
+
     String sDefFont(GetDefaultFor(FONT_STANDARD, eWestern));
     String sDefFontCJK(GetDefaultFor(FONT_STANDARD_CJK, eCJK));
     String sDefFontCTL(GetDefaultFor(FONT_STANDARD_CTL, eCTL));
@@ -320,9 +325,11 @@
     {
         SvtLinguOptions aLinguOpt;
         SvtLinguConfig().GetOptions( aLinguOpt );
-        sal_Int16   eWestern = aLinguOpt.nDefaultLanguage,
-                    eCJK = aLinguOpt.nDefaultLanguage_CJK,
-                    eCTL = aLinguOpt.nDefaultLanguage_CTL;
+
+        sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
+                  eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
+                  eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
+
         // #i92090# default height value sets back to -1
         const sal_Int32 nDefaultHeight = GetDefaultHeightFor(nFontType, lcl_LanguageOfType(nFontType, eWestern, eCJK, eCTL));
         const bool bIsDefaultHeight = nHeight == nDefaultHeight;
Index: sw/source/ui/lingu/olmenu.cxx
===================================================================
--- sw/source/ui/lingu/olmenu.cxx	(revision 267481)
+++ sw/source/ui/lingu/olmenu.cxx	(working copy)
@@ -62,6 +62,7 @@
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/frame/XModuleManager.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
 #include <svx/dlgutil.hxx>
 #include <svtools/itemset.hxx>
 #include <svx/langitem.hxx>
@@ -168,7 +169,7 @@
 		SvtLinguOptions aLinguOpt;
 		SvtLinguConfig().GetOptions( aLinguOpt );
 		// The default document language from "Tools/Options - Language Settings - Languages: Western"
-		aLangList[0] = aLinguOpt.nDefaultLanguage;
+		aLangList[0] = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN);
 		// The one from "Tools/Options - Language Settings - Languages: User interface"
 		aLangList[1] = rSettings.GetUILanguage();
 		// The one from "Tools/Options - Language Settings - Languages: Locale setting"
Index: sw/util/makefile.mk
===================================================================
--- sw/util/makefile.mk	(revision 267481)
+++ sw/util/makefile.mk	(working copy)
@@ -190,6 +190,7 @@
 			$(SVLLIB) \
 			$(UNOTOOLSLIB) \
             $(TOOLSLIB) \
+			$(I18NISOLANGLIB) \
 			$(COMPHELPERLIB) \
 			$(UCBHELPERLIB)	\
 			$(CPPUHELPERLIB)	\
Index: chart2/source/tools/CharacterProperties.cxx
===================================================================
--- chart2/source/tools/CharacterProperties.cxx	(revision 267481)
+++ chart2/source/tools/CharacterProperties.cxx	(working copy)
@@ -51,9 +51,11 @@
 #include <com/sun/star/text/RubyAdjust.hpp>
 #include <com/sun/star/awt/FontStrikeout.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
 
 #include <comphelper/InlineContainer.hxx>
 
+
 // header for struct SvtLinguConfig
 #ifndef _SVTOOLS_LINGUCFG_HXX_
 #include <svtools/lingucfg.hxx>
@@ -471,16 +473,21 @@
     const float fDefaultFontHeight = 13.0;
 
     SvtLinguConfig aLinguConfig;
-    lang::Locale aDefaultLocale( C2U( "en" ), C2U( "US" ), OUString() );
+    lang::Locale aDefaultLocale;
     aLinguConfig.GetProperty(C2U("DefaultLocale")) >>= aDefaultLocale;
     lang::Locale aDefaultLocale_CJK;
     aLinguConfig.GetProperty(C2U("DefaultLocale_CJK")) >>= aDefaultLocale_CJK;
     lang::Locale aDefaultLocale_CTL;
     aLinguConfig.GetProperty(C2U("DefaultLocale_CTL")) >>= aDefaultLocale_CTL;
 
-    Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, MsLangId::convertLocaleToLanguage( aDefaultLocale ), DEFAULTFONT_FLAGS_ONLYONE, 0 );   
-    Font aFontCJK = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_SPREADSHEET, MsLangId::convertLocaleToLanguage( aDefaultLocale_CJK ), DEFAULTFONT_FLAGS_ONLYONE, 0 );
-    Font aFontCTL = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_SPREADSHEET, MsLangId::convertLocaleToLanguage( aDefaultLocale_CTL ), DEFAULTFONT_FLAGS_ONLYONE, 0 );
+    using namespace ::com::sun::star::i18n::ScriptType;
+    LanguageType nLang;
+    nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aDefaultLocale), LATIN);
+    Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 );   
+    nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CJK), ASIAN);
+    Font aFontCJK = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 );
+    nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CTL), COMPLEX);
+    Font aFontCTL = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 );
 
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_NAME, OUString( aFont.GetName() ) );
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_STYLE_NAME, OUString(aFont.GetStyleName()) );
Index: desktop/source/app/langselect.cxx
===================================================================
--- desktop/source/app/langselect.cxx	(revision 267481)
+++ desktop/source/app/langselect.cxx	(working copy)
@@ -104,7 +104,7 @@
         ::rtl::OUString sWin16SysLocale;
         aWin16SysLocale >>= sWin16SysLocale;
         if( sWin16SysLocale.getLength())
-            setDefaultLocale(sWin16SysLocale);
+            setDefaultLanguage(sWin16SysLocale);
     }
     catch(const Exception&)
     {
@@ -116,9 +116,8 @@
         OUString usLocale;
         Reference< XPropertySet > xLocaleProp(getConfigAccess(
             "org.openoffice.System/L10N", sal_True), UNO_QUERY_THROW);
-           // "org.openoffice.Office.Linguistic/General", sal_True), UNO_QUERY_THROW);
         xLocaleProp->getPropertyValue(OUString::createFromAscii("Locale")) >>= usLocale;     
-            setDefaultLocale(usLocale);
+            setDefaultLanguage(usLocale);
     } 
     catch (Exception&) 
     {
@@ -160,89 +159,33 @@
 
     // #i32939# setting of default document locale
     // #i32939# this should not be based on the UI language
-    setDefaultLocale(aLocaleString);
+    setDefaultLanguage(aLocaleString);
 
-    // fallback: set en-US as default Western locale if no Western locale is set
-    OUString usWesternName = OUString::createFromAscii("DefaultLocale");
-    try
-    {       
-        Reference< XPropertySet > xProp(getConfigAccess(
-            "org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW);
-        OUString usValue;
-        xProp->getPropertyValue(usWesternName) >>= usValue;
-        if (usValue.getLength() == 0)
-        {
-            // there is no western document language selected
-            // if the selected locale is a western locale, this
-            // will become the default western docuemnt language
-            // otherwise, fall back to en-US
-            OUString usDefault = OUString::createFromAscii("en-US");
-            try
-            {
-                xProp->setPropertyValue(usWesternName, makeAny(usDefault));
-                Reference< XChangesBatch >(xProp,UNO_QUERY_THROW)->commitChanges();
-            }
-            catch ( PropertyVetoException )
-            {
-                // we are not allowed to change this
-            }
-        }
-    }
-    catch ( Exception& )
-    {
-    }
-
     return bSuccess;
 }
 
-void LanguageSelection::setDefaultLocale(const OUString& usUILocale)
+void LanguageSelection::setDefaultLanguage(const OUString& sLocale)
 {
-    // #i32939# setting of default document locale
-    // org.openoffice.Office.Linguistic/General/DefaultLocale
-    // org.openoffice.Office.Linguistic/General/DefaultLocale_CJK
-    // org.openoffice.Office.Linguistic/General/DefaultLocale_CTL
+    // #i32939# setting of default document language
+    //
+    // See #i42730# for rules for determining source of settings
 
-    // determine script type of UI locale
-    LanguageType ltUILocale = MsLangId::convertIsoStringToLanguage(usUILocale);
-    sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(ltUILocale);
+    // determine script type of locale
+    LanguageType nLang = MsLangId::convertIsoStringToLanguage(sLocale);
+    sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(nLang);
 
-    try
+    switch (nScriptType)
     {
-        Reference< XPropertySet > xProp(getConfigAccess(
-                                            "org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW);
-        OUString usName = OUString::createFromAscii("DefaultLocale");
-        switch (nScriptType)
-        {
-            case SCRIPTTYPE_ASIAN:
-                usName = OUString::createFromAscii("DefaultLocale_CJK");
-                break;
-            case SCRIPTTYPE_COMPLEX:
-                usName = OUString::createFromAscii("DefaultLocale_CTL");
-                break;
-        }
-        OUString usValue;
-        xProp->getPropertyValue(usName) >>= usValue;
-        if (usValue.getLength() == 0)
-        {
-            // there is no document language set, for the script type selected
-            // in the UI
-            // covert the LanguageType we've got from the LanguageTable back to
-            // an iso string and store it
-            OUString usDefault = MsLangId::convertLanguageToIsoString(ltUILocale);
-            try
-            {
-                xProp->setPropertyValue(usName, makeAny(usDefault));
-                Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
-            }
-            catch ( PropertyVetoException )
-            {
-                // we are not allowed to change this
-            }
-        }
+        case SCRIPTTYPE_ASIAN:
+            MsLangId::setConfiguredAsianFallback( nLang );
+            break;
+        case SCRIPTTYPE_COMPLEX:
+            MsLangId::setConfiguredComplexFallback( nLang );
+            break;
+        default:
+            MsLangId::setConfiguredWesternFallback( nLang );
+            break;
     }
-    catch ( Exception& )
-    {
-    }
 }
 
 OUString LanguageSelection::getLanguageString()
Index: desktop/source/app/langselect.hxx
===================================================================
--- desktop/source/app/langselect.hxx	(revision 267481)
+++ desktop/source/app/langselect.hxx	(working copy)
@@ -60,7 +60,7 @@
     static rtl::OUString getUserLanguage();
     static rtl::OUString getSystemLanguage();
     static void resetUserLanguage();
-    static void setDefaultLocale(const rtl::OUString&);
+    static void setDefaultLanguage(const rtl::OUString&);
 
 public:
     static com::sun::star::lang::Locale IsoStringToLocale(const rtl::OUString& str);
Index: svx/source/dialog/optgdlg.cxx
===================================================================
--- svx/source/dialog/optgdlg.cxx	(revision 267481)
+++ svx/source/dialog/optgdlg.cxx	(working copy)
@@ -103,6 +103,7 @@
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
 #include <com/sun/star/container/XSet.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
 
 #include <vcl/svapp.hxx>
 
@@ -1201,8 +1202,13 @@
 
     // initialize user interface language selection
     SvtLanguageTable* pLanguageTable = new SvtLanguageTable;
-    String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) );
-    aUserInterfaceLB.InsertEntry(aStr);
+    const String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) );
+
+    String aUILang(aStr);
+    aUILang += String::CreateFromAscii(" - ");
+    aUILang += pLanguageTable->GetString( Application::GetSettings().GetUILanguage() );
+
+    aUserInterfaceLB.InsertEntry(aUILang);
     aUserInterfaceLB.SetEntryData(0, 0);
     aUserInterfaceLB.SelectEntryPos(0);
     try
@@ -1264,16 +1270,24 @@
     }
 
     aWesternLanguageLB.SetLanguageList( LANG_LIST_WESTERN | LANG_LIST_ONLY_KNOWN, TRUE,  FALSE, TRUE );
-    aAsianLanguageLB  .SetLanguageList( LANG_LIST_CJK     | LANG_LIST_ONLY_KNOWN, TRUE,  FALSE, TRUE );
+    aWesternLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::LATIN );
+    aAsianLanguageLB.SetLanguageList( LANG_LIST_CJK     | LANG_LIST_ONLY_KNOWN, TRUE,  FALSE, TRUE );
+    aAsianLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::ASIAN );
     aComplexLanguageLB.SetLanguageList( LANG_LIST_CTL     | LANG_LIST_ONLY_KNOWN, TRUE,  FALSE, TRUE );
-    aLocaleSettingLB  .SetLanguageList( LANG_LIST_ALL     | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE);
-    aLocaleSettingLB.InsertLanguage( LANGUAGE_SYSTEM );
+    aComplexLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::COMPLEX );
 
-    // insert SYSTEM entry, no specific currency
-    aCurrencyLB.InsertEntry( aStr );
+    aLocaleSettingLB.SetLanguageList( LANG_LIST_ALL     | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE);
+    aLocaleSettingLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::WEAK );
+
+    const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable();
+    const NfCurrencyEntry& rCurr = SvNumberFormatter::GetCurrencyEntry( LANGUAGE_SYSTEM );
+    // insert SYSTEM entry
+    String aDefaultCurr(aStr);
+    aDefaultCurr += String::CreateFromAscii(" - ");
+    aDefaultCurr += rCurr.GetBankSymbol();
+    aCurrencyLB.InsertEntry( aDefaultCurr );
     // all currencies
     String aTwoSpace( RTL_CONSTASCII_USTRINGPARAM( "  " ) );
-    const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable();
     USHORT nCurrCount = rCurrTab.Count();
     // first entry is SYSTEM, skip it
     for ( USHORT j=1; j < nCurrCount; ++j )
@@ -1282,7 +1296,7 @@
         String aStr_( pCurr->GetBankSymbol() );
         aStr_ += aTwoSpace;
         aStr_ += pCurr->GetSymbol();
-        aStr = ApplyLreOrRleEmbedding( aStr_ );
+        aStr_ = ApplyLreOrRleEmbedding( aStr_ );
         aStr_ += aTwoSpace;
         aStr_ += ApplyLreOrRleEmbedding( pLanguageTable->GetString( pCurr->GetLanguage() ) );
         USHORT nPos = aCurrencyLB.InsertEntry( aStr_ );
@@ -1496,7 +1510,7 @@
 		if(!bCurrentDocCBChecked)
 		{
 			Any aValue;
-			Locale aLocale = SvxCreateLocale( eSelectLang );
+			Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
 			aValue <<= aLocale;
 			OUString aPropName( C2U("DefaultLocale") );
             pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
@@ -1505,7 +1519,8 @@
 		}
 		if(pCurrentDocShell)
 		{
-			rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_LANGUAGE));
+			rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::LATIN),
+                SID_ATTR_LANGUAGE));
 			bRet = TRUE;
 		}
 	}
@@ -1516,7 +1531,7 @@
 		if(!bCurrentDocCBChecked)
 		{
 			Any aValue;
-			Locale aLocale = SvxCreateLocale( eSelectLang );
+			Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
 			aValue <<= aLocale;
 			OUString aPropName( C2U("DefaultLocale_CJK") );
             pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
@@ -1525,7 +1540,8 @@
 		}
 		if(pCurrentDocShell)
 		{
-			rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CJK_LANGUAGE));
+			rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::ASIAN),
+                SID_ATTR_CHAR_CJK_LANGUAGE));
 			bRet = TRUE;
 		}
 	}
@@ -1536,7 +1552,7 @@
 		if(!bCurrentDocCBChecked)
 		{
 			Any aValue;
-			Locale aLocale = SvxCreateLocale( eSelectLang );
+			Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
 			aValue <<= aLocale;
 			OUString aPropName( C2U("DefaultLocale_CTL") );
             pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
@@ -1545,7 +1561,8 @@
 		}
 		if(pCurrentDocShell)
 		{
-			rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CTL_LANGUAGE));
+			rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::COMPLEX),
+                SID_ATTR_CHAR_CTL_LANGUAGE));
 			bRet = TRUE;
 		}
 	}
@@ -1645,13 +1662,18 @@
         aWestLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale"));
         Locale aLocale;
         aWestLang >>= aLocale;
-        eCurLang = SvxLocaleToLanguage( aLocale );
+
+        eCurLang = MsLangId::convertLocaleToLanguage( aLocale );
+
         aCJKLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CJK"));
+        aLocale = Locale();
         aCJKLang >>= aLocale;
-        eCurLangCJK = SvxLocaleToLanguage( aLocale );
+        eCurLangCJK = MsLangId::convertLocaleToLanguage( aLocale );
+
         aCTLLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CTL"));
+        aLocale = Locale();
         aCTLLang >>= aLocale;
-        eCurLangCTL = SvxLocaleToLanguage( aLocale );
+        eCurLangCTL = MsLangId::convertLocaleToLanguage( aLocale );
     }
     catch(Exception&)
     {
@@ -1663,13 +1685,25 @@
         aCurrentDocCB.Check(bLanguageCurrentDoc_Impl);
 		const SfxPoolItem* pLang;
 		if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_LANGUAGE, FALSE, &pLang))
-			eCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+        {
+	        LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+            if (MsLangId::resolveSystemLanguageByScriptType(eCurLang, ::com::sun::star::i18n::ScriptType::LATIN) != eTempCurLang)
+                eCurLang = eTempCurLang;
+        }
 
 		if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, FALSE, &pLang))
-			eCurLangCJK = ((const SvxLanguageItem*)pLang)->GetValue();
+        {
+			LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+            if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCJK, ::com::sun::star::i18n::ScriptType::ASIAN) != eTempCurLang)
+                eCurLangCJK = eTempCurLang;
+        }
 
 		if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, FALSE, &pLang))
-			eCurLangCTL = ((const SvxLanguageItem*)pLang)->GetValue();
+        {
+			LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+            if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCTL, ::com::sun::star::i18n::ScriptType::COMPLEX) != eTempCurLang)
+                eCurLangCTL = eTempCurLang;
+        }
 	}
     if(LANGUAGE_NONE == eCurLang || LANGUAGE_DONTKNOW == eCurLang)
         aWesternLanguageLB.SelectLanguage(LANGUAGE_NONE);
Index: svx/source/dialog/langbox.cxx
===================================================================
--- svx/source/dialog/langbox.cxx	(revision 267481)
+++ svx/source/dialog/langbox.cxx	(working copy)
@@ -37,8 +37,9 @@
 #include <com/sun/star/linguistic2/XLinguServiceManager.hdl>
 #endif
 #include <com/sun/star/linguistic2/XAvailableLocales.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
 #include <linguistic/misc.hxx>
-#include<rtl/ustring.hxx>
+#include <rtl/ustring.hxx>
 #include <unotools/localedatawrapper.hxx>
 
 #include <svtools/langtab.hxx>
@@ -315,6 +316,13 @@
 
 USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType, USHORT nPos )
 {
+    return ImplInsertLanguage( nLangType, nPos, ::com::sun::star::i18n::ScriptType::WEAK );
+}
+
+//------------------------------------------------------------------------
+
+USHORT SvxLanguageBox::ImplInsertLanguage( const LanguageType nLangType, USHORT nPos, sal_Int16 nType )
+{
     LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( nLangType);
     // For obsolete and to be replaced languages check whether an entry of the 
     // replacement already exists and if so don't add an entry with identical 
@@ -329,6 +337,15 @@
 	String aStrEntry = m_pLangTable->GetString( nLang );
 	if (LANGUAGE_NONE == nLang && m_bHasLangNone && m_bLangNoneIsLangAll)
 		aStrEntry = m_aAllString;
+
+    LanguageType nRealLang = nLang;
+    if (nRealLang == LANGUAGE_SYSTEM)
+    {
+        nRealLang = MsLangId::resolveSystemLanguageByScriptType(nRealLang, nType);
+        aStrEntry.AppendAscii(" - ");
+        aStrEntry.Append(m_pLangTable->GetString( nRealLang ));
+    }
+
     aStrEntry = ApplyLreOrRleEmbedding( aStrEntry );
 
 	USHORT nAt = 0;
@@ -343,7 +360,7 @@
                 m_pSpellUsedLang = new Sequence< INT16 >( xSpell->getLanguages() );
         }
         bFound = m_pSpellUsedLang ?
-                    lcl_SeqHasLang( *m_pSpellUsedLang, nLang ) : FALSE;
+                    lcl_SeqHasLang( *m_pSpellUsedLang, nRealLang ) : FALSE;
 
         nAt = ImplInsertImgEntry( aStrEntry, nPos, bFound );
 	}
@@ -356,6 +373,13 @@
 
 //------------------------------------------------------------------------
 
+USHORT SvxLanguageBox::InsertDefaultLanguage( sal_Int16 nType, USHORT nPos )
+{
+    return ImplInsertLanguage( LANGUAGE_SYSTEM, nPos, nType );
+}
+
+//------------------------------------------------------------------------
+
 USHORT SvxLanguageBox::InsertLanguage( const LanguageType nLangType,
         BOOL bCheckEntry, USHORT nPos )
 {
Index: svx/inc/svx/langbox.hxx
===================================================================
--- svx/inc/svx/langbox.hxx	(revision 267481)
+++ svx/inc/svx/langbox.hxx	(working copy)
@@ -77,6 +77,7 @@
 
     SVX_DLLPRIVATE void                    Init();
     SVX_DLLPRIVATE USHORT                  ImplInsertImgEntry( const String& rEntry, USHORT nPos, bool bChecked );
+    SVX_DLLPRIVATE USHORT                  ImplInsertLanguage(LanguageType, USHORT, sal_Int16 );
 
 public:
     SvxLanguageBox( Window* pParent, WinBits nWinStyle, BOOL bCheck = FALSE);
@@ -88,6 +89,7 @@
 							BOOL bCheckSpellAvail = FALSE );
 
 	USHORT			InsertLanguage( const LanguageType eLangType, USHORT nPos = LISTBOX_APPEND );
+	USHORT			InsertDefaultLanguage( sal_Int16 nType, USHORT nPos = LISTBOX_APPEND );
     USHORT          InsertLanguage( const LanguageType eLangType,
                             BOOL bCheckEntry, USHORT nPos = LISTBOX_APPEND );
 	void			RemoveLanguage( const LanguageType eLangType );
Index: svtools/source/config/lingucfg.cxx
===================================================================
--- svtools/source/config/lingucfg.cxx	(revision 267481)
+++ svtools/source/config/lingucfg.cxx	(working copy)
@@ -72,69 +72,38 @@
 ///////////////////////////////////////////////////////////////////////////
 
 
-static lang::Locale lcl_CreateLocale( LanguageType eLang )
-{
-    lang::Locale aLocale;
-	if ( eLang != LANGUAGE_NONE )
-		MsLangId::convertLanguageToLocale( eLang, aLocale );
-
-	return aLocale;
-}
-
-
-static INT16 lcl_LocaleToLanguage( const lang::Locale& rLocale )
-{
-	//	empty Locale -> LANGUAGE_NONE
-	if ( rLocale.Language.getLength() == 0 )
-		return LANGUAGE_NONE;
-
-	//	Variant of Locale is ignored
-	return MsLangId::convertLocaleToLanguage( rLocale );
-}
-
-
 static BOOL lcl_SetLocale( INT16 &rLanguage, const uno::Any &rVal )
 {
-	BOOL bSucc = FALSE;
+    BOOL bSucc = FALSE;
 
     lang::Locale aNew;
-	if (rVal >>= aNew)	// conversion successful?
-	{
-		INT16 nNew = lcl_LocaleToLanguage( aNew );
-		if (nNew != rLanguage)
-		{
-			rLanguage = nNew;
-			bSucc = TRUE;
-		}
-	}
-
-	return bSucc;
+    if (rVal >>= aNew)	// conversion successful?
+    {
+        INT16 nNew = MsLangId::convertLocaleToLanguage( aNew );
+        if (nNew != rLanguage)
+        {
+            rLanguage = nNew;
+            bSucc = TRUE;
+        }
+    }
+    return bSucc;
 }
 
 
-static inline INT16 lcl_CfgLocaleStrToLanguage( const OUString &rCfgLocaleStr )
-{
-	INT16 nRes = LANGUAGE_NONE;
-    if (0 != rCfgLocaleStr.getLength())
-        nRes = MsLangId::convertIsoStringToLanguage( rCfgLocaleStr );
-    return nRes;
-}
-
-
 static inline const OUString lcl_LanguageToCfgLocaleStr( INT16 nLanguage )
 {
     OUString aRes;
-    if (LANGUAGE_NONE != nLanguage)
+    if (LANGUAGE_SYSTEM != nLanguage)
         aRes = MsLangId::convertLanguageToIsoString( nLanguage );
     return aRes;
 }
 
 
-static void lcl_CfgAnyToLanguage( const uno::Any &rVal, INT16& rLanguage )
+static INT16 lcl_CfgAnyToLanguage( const uno::Any &rVal )
 {
-	OUString aTmp;
-    if ((rVal >>= aTmp)  &&  0 != aTmp.getLength())
-       rLanguage = MsLangId::convertIsoStringToLanguage( aTmp );
+    OUString aTmp;
+    rVal >>= aTmp;
+    return (aTmp.getLength() == 0) ? LANGUAGE_SYSTEM : MsLangId::convertIsoStringToLanguage( aTmp );
 }
 
 
@@ -143,10 +112,9 @@
 SvtLinguOptions::SvtLinguOptions()
 {
     nDefaultLanguage = LANGUAGE_NONE;
-
 	nDefaultLanguage_CJK = LANGUAGE_NONE;
 	nDefaultLanguage_CTL = LANGUAGE_NONE;
-
+    
 	// general options
 	bIsUseDictionaryList	=
 	bIsIgnoreControlCharacters	= TRUE;
@@ -428,19 +396,19 @@
         }
         case UPH_DEFAULT_LOCALE :
         {
-            lang::Locale aLocale( lcl_CreateLocale( rOpt.nDefaultLanguage ) );
+            lang::Locale aLocale( MsLangId::convertLanguageToLocale( rOpt.nDefaultLanguage, false ) );
             aRes.setValue( &aLocale, ::getCppuType((lang::Locale*)0 ));
             break;
         }
         case UPH_DEFAULT_LOCALE_CJK :
         {
-            lang::Locale aLocale( lcl_CreateLocale( rOpt.nDefaultLanguage_CJK ) );
+            lang::Locale aLocale( MsLangId::convertLanguageToLocale( rOpt.nDefaultLanguage_CJK, false ) );
             aRes.setValue( &aLocale, ::getCppuType((lang::Locale*)0 ));
             break;
         }
         case UPH_DEFAULT_LOCALE_CTL :
         {
-            lang::Locale aLocale( lcl_CreateLocale( rOpt.nDefaultLanguage_CTL ) );
+            lang::Locale aLocale( MsLangId::convertLanguageToLocale( rOpt.nDefaultLanguage_CTL, false ) );
             aRes.setValue( &aLocale, ::getCppuType((lang::Locale*)0 ));
             break;
         }
@@ -654,7 +622,7 @@
             switch ( nPropertyHandle )
             {
                 case UPH_DEFAULT_LOCALE : 
-                    { rOpt.bRODefaultLanguage = pROStates[i]; lcl_CfgAnyToLanguage( rVal, rOpt.nDefaultLanguage ); } break;
+                    { rOpt.bRODefaultLanguage = pROStates[i]; rOpt.nDefaultLanguage = lcl_CfgAnyToLanguage( rVal ); } break;
                 case UPH_ACTIVE_DICTIONARIES : 
                     { rOpt.bROActiveDics = pROStates[i]; rVal >>= rOpt.aActiveDics;   } break;
                 case UPH_IS_USE_DICTIONARY_LIST : 
@@ -662,9 +630,9 @@
                 case UPH_IS_IGNORE_CONTROL_CHARACTERS : 
                     { rOpt.bROIsIgnoreControlCharacters = pROStates[i]; rVal >>= rOpt.bIsIgnoreControlCharacters;    } break;
                 case UPH_DEFAULT_LOCALE_CJK : 
-                    { rOpt.bRODefaultLanguage_CJK = pROStates[i]; lcl_CfgAnyToLanguage( rVal, rOpt.nDefaultLanguage_CJK );    } break;
+                    { rOpt.bRODefaultLanguage_CJK = pROStates[i]; rOpt.nDefaultLanguage_CJK = lcl_CfgAnyToLanguage( rVal );    } break;
                 case UPH_DEFAULT_LOCALE_CTL : 
-                    { rOpt.bRODefaultLanguage_CTL = pROStates[i]; lcl_CfgAnyToLanguage( rVal, rOpt.nDefaultLanguage_CTL );    } break;
+                    { rOpt.bRODefaultLanguage_CTL = pROStates[i]; rOpt.nDefaultLanguage_CTL = lcl_CfgAnyToLanguage( rVal );    } break;
 
                 case UPH_IS_SPELL_UPPER_CASE : 
                     { rOpt.bROIsSpellUpperCase = pROStates[i]; rVal >>= rOpt.bIsSpellUpperCase; } break;
--- reportdesign/util/makefile.mk	2009-03-12 23:12:05.000000000 +0000
+++ reportdesign/util/makefile.mk	2009-03-12 23:10:02.000000000 +0000
@@ -58,6 +58,7 @@
 		$(FWELIB)				\
 		$(SFXLIB)				\
 		$(TOOLSLIB) 			\
+		$(I18NISOLANGLIB) \
 		$(SVLLIB)				\
 		$(SVTOOLLIB)			\
 		$(UNOTOOLSLIB)			\

workspace.dr72.patch:
 prj/build.lst                |    2 
 source/core/filterdetect.cxx |  244 +++++++++++++++++++++++++++++++++++++++----
 util/makefile.mk             |    3 
 3 files changed, 226 insertions(+), 23 deletions(-)

--- NEW FILE workspace.dr72.patch ---
diff -ru oox.orig/prj/build.lst oox/prj/build.lst
--- oox.orig/prj/build.lst	2009-06-25 12:29:27.000000000 +0100
+++ oox/prj/build.lst	2009-06-26 11:02:26.000000000 +0100
@@ -1,4 +1,4 @@
-oox	oox : vos cppu cppuhelper comphelper sal offapi sax basegfx tools BOOST:boost NULL
+oox	oox : vos cppu cppuhelper comphelper sal offapi sax basegfx tools BOOST:boost OPENSSL:openssl NULL
 oox	oox				usr1	-   all	oox_mkout NULL
 oox	oox\prj				get	-   all	oox_prj NULL
 oox	oox\source\token		nmake	-   all	oox_token NULL
diff -ru oox.orig/source/core/filterdetect.cxx oox/source/core/filterdetect.cxx
--- oox.orig/source/core/filterdetect.cxx	2009-06-25 12:30:35.000000000 +0100
+++ oox/source/core/filterdetect.cxx	2009-06-26 11:01:15.000000000 +0100
@@ -37,12 +37,20 @@
 #include <com/sun/star/xml/sax/XFastContextHandler.hpp>
 #include <com/sun/star/xml/sax/XFastParser.hpp>
 
+#include <com/sun/star/io/XTempFile.hpp>
+
 #include <comphelper/mediadescriptor.hxx>
 #include <cppuhelper/implbase1.hxx>
 #include <cppuhelper/implbase2.hxx>
 
+#include <rtl/digest.h>
+#include <openssl/evp.h>
+
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/zipstorage.hxx"
+#include "oox/helper/olestorage.hxx"
+#include "oox/helper/binaryinputstream.hxx"
+#include "oox/helper/binaryoutputstream.hxx"
 #include "oox/core/fasttokenhandler.hxx"
 #include "oox/core/namespaces.hxx"
 #include "tokens.hxx"
@@ -317,6 +325,97 @@
 {
 }
 
+/*
+ * Derive Key
+ */
+void DeriveKey(const sal_uInt8 *pHash, sal_uInt32 cbHash, sal_uInt8 *keyDerived, sal_uInt32 cbRequiredKeyLength)
+{
+    sal_uInt8 aBuffer[64];
+
+    memset(aBuffer, 0x36, sizeof(aBuffer));
+    for (sal_uInt32 i = 0; i < cbHash; ++i)
+        aBuffer[i] ^= pHash[i];
+
+    rtlDigest aDigest;
+    rtlDigestError aError;
+
+    aDigest = rtl_digest_create(rtl_Digest_AlgorithmSHA1);
+    aError = rtl_digest_update(aDigest, aBuffer, sizeof(aBuffer));
+    sal_uInt8 X1[RTL_DIGEST_LENGTH_SHA1];
+    aError = rtl_digest_get(aDigest, X1, RTL_DIGEST_LENGTH_SHA1);
+    rtl_digest_destroy(aDigest);
+
+    memset(aBuffer, 0x5C, sizeof(aBuffer));
+    for (sal_uInt32 i = 0; i < cbHash; ++i)
+        aBuffer[i] ^= pHash[i];
+
+    aDigest = rtl_digest_create(rtl_Digest_AlgorithmSHA1);
+    aError = rtl_digest_update(aDigest, aBuffer, sizeof(aBuffer));
+    sal_uInt8 X2[RTL_DIGEST_LENGTH_SHA1];
+    aError = rtl_digest_get(aDigest, X2, RTL_DIGEST_LENGTH_SHA1);
+    rtl_digest_destroy(aDigest);
+
+    if (cbRequiredKeyLength > RTL_DIGEST_LENGTH_SHA1)
+    {
+        memcpy(keyDerived+RTL_DIGEST_LENGTH_SHA1, X2, cbRequiredKeyLength-RTL_DIGEST_LENGTH_SHA1);
+        cbRequiredKeyLength=RTL_DIGEST_LENGTH_SHA1;
+    }
+    memcpy(keyDerived, X1, cbRequiredKeyLength);
+}
+
+/*
+ * Generate an encryption key
+ */
+
+void GenerateEncryptionKey(sal_uInt32 SaltSize, const sal_uInt8 *Salt, const rtl::OUString &rPassword,
+    sal_uInt8 *key, sal_uInt32 cbRequiredKeyLength)
+{
+    size_t nBufferSize = (SaltSize + (rPassword.getLength() * sizeof(sal_uInt16)));
+    sal_uInt8 *pBuffer = new sal_uInt8[nBufferSize];
+
+    memcpy(pBuffer, Salt, SaltSize);
+
+    sal_uInt8 *pPasswordLoc = pBuffer+SaltSize;
+    sal_Int32 nLen = rPassword.getLength();
+    const sal_Unicode *pStr = rPassword.getStr();
+
+    for (sal_Int32 i = 0; i < nLen; ++i, ++pStr)
+    {
+        *pPasswordLoc++ = (*pStr & 0x00FF);
+        *pPasswordLoc++ = ((*pStr & 0xFF00) >> 8);
+    }
+
+    rtlDigest aDigest = rtl_digest_create(rtl_Digest_AlgorithmSHA1);
+    rtlDigestError aError;
+    aError = rtl_digest_update(aDigest, pBuffer, nBufferSize);
+    delete [] pBuffer;
+    size_t nHashSize = RTL_DIGEST_LENGTH_SHA1+sizeof(sal_uInt32);
+    sal_uInt8 aHash[nHashSize];
+    aError = rtl_digest_get(aDigest, aHash+sizeof(sal_uInt32), RTL_DIGEST_LENGTH_SHA1);
+    rtl_digest_destroy(aDigest);
+
+    for (sal_uInt32 i = 0; i < 50000; ++i)
+    {
+        aHash[0] = (i & 0x000000FF);
+        aHash[1] = (i & 0x0000FF00) >> 8;
+        aHash[2] = (i & 0x00FF0000) >> 16;
+        aHash[3] = (i & 0xFF000000) >> 24;
+        aDigest = rtl_digest_create(rtl_Digest_AlgorithmSHA1);
+        aError = rtl_digest_update(aDigest, aHash, nHashSize);
+        aError = rtl_digest_get(aDigest, aHash+sizeof(sal_uInt32), RTL_DIGEST_LENGTH_SHA1);
+        rtl_digest_destroy(aDigest);
+    }
+
+    memmove(aHash, aHash+sizeof(sal_uInt32), RTL_DIGEST_LENGTH_SHA1);
+    memset(aHash+RTL_DIGEST_LENGTH_SHA1, 0, sizeof(sal_uInt32));
+    aDigest = rtl_digest_create(rtl_Digest_AlgorithmSHA1);
+    aError = rtl_digest_update(aDigest, aHash, nHashSize);
+    aError = rtl_digest_get(aDigest, aHash, RTL_DIGEST_LENGTH_SHA1);
+    rtl_digest_destroy(aDigest);
+
+    DeriveKey(aHash, RTL_DIGEST_LENGTH_SHA1, key, cbRequiredKeyLength);
+}
+
 // com.sun.star.document.XExtendedFilterDetect interface ----------------------
 
 OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& lDescriptor ) throw( RuntimeException )
@@ -325,31 +424,134 @@
 
     if( mxFactory.is() ) try
     {
-        Reference< XFastParser > xParser( mxFactory->createInstance(
-            CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW );
-
-        xParser->setFastDocumentHandler( new FilterDetectDocHandler( aFilter ) );
-        xParser->setTokenHandler( new FastTokenHandler );
-
-        xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS );
-        xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS );
-        xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/content-types" ), NMSP_CONTENT_TYPES );
-
         MediaDescriptor aDescriptor( lDescriptor );
         aDescriptor.addInputStream();
         Reference< XInputStream > xInputStream( aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY_THROW );
-        StorageRef xStorage( new ZipStorage( mxFactory, xInputStream ) );
+        StorageRef xZipStorage( new ZipStorage( mxFactory, xInputStream ) );
 
-        // Parse _rels/.rels to get the target path.
-        InputSource aParserInput;
-        aParserInput.sSystemId = CREATE_OUSTRING( "_rels/.rels" );
-        aParserInput.aInputStream = xStorage->openInputStream( aParserInput.sSystemId );
-        xParser->parseStream( aParserInput );
-
-        // Parse [Content_Types].xml to determine the content type of the part at the target path.
-        aParserInput.sSystemId = CREATE_OUSTRING( "[Content_Types].xml" );
-        aParserInput.aInputStream = xStorage->openInputStream( aParserInput.sSystemId );
-        xParser->parseStream( aParserInput );
+        if (xZipStorage->isStorage())
+        {
+            Reference< XFastParser > xParser( mxFactory->createInstance(
+                CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW );
+
+            xParser->setFastDocumentHandler( new FilterDetectDocHandler( aFilter ) );
+            xParser->setTokenHandler( new FastTokenHandler );
+
+            xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS );
+            xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS );
+            xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/content-types" ), NMSP_CONTENT_TYPES );
+
+            // Parse _rels/.rels to get the target path.
+            InputSource aParserInput;
+            aParserInput.sSystemId = CREATE_OUSTRING( "_rels/.rels" );
+            aParserInput.aInputStream = xZipStorage->openInputStream( aParserInput.sSystemId );
+            xParser->parseStream( aParserInput );
+
+            // Parse [Content_Types].xml to determine the content type of the part at the target path.
+            aParserInput.sSystemId = CREATE_OUSTRING( "[Content_Types].xml" );
+            aParserInput.aInputStream = xZipStorage->openInputStream( aParserInput.sSystemId );
+            xParser->parseStream( aParserInput );
+        }
+        else
+        {
+            StorageRef xOLEStorage ( new OleStorage( mxFactory, xInputStream, false ) );
+            if (xOLEStorage->isStorage())
+            {
+                Reference< XInputStream > xEncryptionInfo = xOLEStorage->openInputStream( CREATE_OUSTRING( "EncryptionInfo") );
+                Reference< XInputStream > xEncryptedPackage = xOLEStorage->openInputStream( CREATE_OUSTRING( "EncryptedPackage") );
+                BinaryXInputStream aInfo(xEncryptionInfo, true);
+                aInfo.skip(0x00000008);
+                sal_uInt32 EncryptionHeaderSize = aInfo.readuInt32();
+                aInfo.skip(0x00000008);
+                sal_uInt32 AlgID = aInfo.readuInt32();
+                sal_uInt32 AlgIDHash = aInfo.readuInt32();
+                sal_uInt32 KeySize = aInfo.readuInt32();
+                aInfo.skip(EncryptionHeaderSize-0x00000014);
+                sal_uInt32 SaltSize = aInfo.readuInt32();
+                sal_uInt8 Salt[16];
+                aInfo.readMemory(Salt, 16);
+                sal_uInt8 EncryptedVerifier[16];
+                aInfo.readMemory(EncryptedVerifier, 16);
+                sal_uInt32 VerifierHashSize = aInfo.readuInt32();
+                sal_uInt8 EncryptedVerifierHash[32];
+                aInfo.readMemory(EncryptedVerifierHash, 32);
+
+                bool bCorrectPassword = false;
+                //aes128 && sha1 && expected hash size
+                bool bImplemented = ((AlgID == 0x0000660E) && (AlgIDHash == 0x00008004) && (VerifierHashSize == 0x14));
+
+                if (bImplemented)
+                {
+                    sal_uInt8 cbRequiredKeyLength = KeySize/8;
+                    sal_uInt8 *key = new sal_uInt8[cbRequiredKeyLength];
+                    //VelvetSweatshop is the default .xlsx "protection" password, so out-of-the-box we should
+                    //be able to open those immediately. For other passwords we need to pass down that data, or query
+                    //for it, however its normall done, to here.
+                    //Unlike other formats, we can't really detect what's inside this wrapper until *after* 
+                    //decryption
+                    GenerateEncryptionKey(SaltSize, Salt, CREATE_OUSTRING("VelvetSweatshop"), key, cbRequiredKeyLength);
+
+                    EVP_CIPHER_CTX aes_ctx;
+                    int outlen=0;
+
+                    EVP_CIPHER_CTX_init(&aes_ctx);
+                    EVP_DecryptInit_ex(&aes_ctx, EVP_aes_128_ecb(), NULL, key, NULL);
+                    EVP_CIPHER_CTX_set_padding(&aes_ctx, 0);
+                    sal_uInt8 Verifier[16]= {0};
+                    /*int*/ EVP_DecryptUpdate(&aes_ctx, Verifier, &outlen, EncryptedVerifier, sizeof(EncryptedVerifier));
+                    EVP_CIPHER_CTX_cleanup(&aes_ctx);
+
+                    EVP_CIPHER_CTX_init(&aes_ctx);
+                    EVP_DecryptInit_ex(&aes_ctx, EVP_aes_128_ecb(), NULL, key, NULL);
+                    EVP_CIPHER_CTX_set_padding(&aes_ctx, 0);
+                    sal_uInt8 VerifierHash[32] = {0};
+                    /*int*/ EVP_DecryptUpdate(&aes_ctx, VerifierHash, &outlen, EncryptedVerifierHash, sizeof(EncryptedVerifierHash));
+                    EVP_CIPHER_CTX_cleanup(&aes_ctx);
+
+                    rtlDigest aDigest = rtl_digest_create(rtl_Digest_AlgorithmSHA1);
+                    rtlDigestError aError = rtl_digest_update(aDigest, Verifier, sizeof(Verifier));
+                    sal_uInt8 sha1Hash[RTL_DIGEST_LENGTH_SHA1];
+                    aError = rtl_digest_get(aDigest, sha1Hash, RTL_DIGEST_LENGTH_SHA1);
+                    rtl_digest_destroy(aDigest);
+
+                    bCorrectPassword = memcmp(sha1Hash, VerifierHash, RTL_DIGEST_LENGTH_SHA1) == 0;
+
+                    if (bCorrectPassword)
+                    {
+                        Reference<XTempFile> xTemp(
+                            mxFactory->createInstance(CREATE_OUSTRING("com.sun.star.io.TempFile")),
+                              UNO_QUERY_THROW);
+                        BinaryXInputStream aEncryptedPackage(xEncryptedPackage, true);
+                        BinaryXOutputStream aDecryptedPackage(xTemp->getOutputStream(), true);
+
+                        EVP_CIPHER_CTX_init(&aes_ctx);
+                        EVP_DecryptInit_ex(&aes_ctx, EVP_aes_128_ecb(), NULL, key, NULL);
+                        EVP_CIPHER_CTX_set_padding(&aes_ctx, 0);
+
+                        sal_uInt8 inbuf[1024];
+                        sal_uInt8 outbuf[1024];
+                        sal_Int32 inlen;
+                        aEncryptedPackage.skip(sizeof(sal_uInt64)); /*decrypted size*/
+                        while ((inlen = aEncryptedPackage.readMemory(inbuf, sizeof(inbuf))))
+                        {
+                            /*int*/ EVP_DecryptUpdate(&aes_ctx, outbuf, &outlen, inbuf, inlen);
+                            aDecryptedPackage.writeMemory(outbuf, outlen);
+                        }
+                        EVP_DecryptFinal_ex(&aes_ctx, outbuf, &outlen);
+                        aDecryptedPackage.writeMemory(outbuf, outlen);
+
+                        EVP_CIPHER_CTX_cleanup(&aes_ctx);
+                        delete [] key;
+
+                        aDecryptedPackage.seekToStart();
+                        xTemp->getOutputStream()->flush();
+                        aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ] <<= xTemp;
+                        aDescriptor >> lDescriptor;
+                        aFilter = detect( lDescriptor );
+                    }
+                }
+            }
+        }
     }
     catch ( const Exception& )
     {
diff -ru oox.orig/util/makefile.mk oox/util/makefile.mk
--- oox.orig/util/makefile.mk	2009-06-25 12:30:40.000000000 +0100
+++ oox/util/makefile.mk	2009-06-25 16:35:08.000000000 +0100
@@ -73,7 +73,8 @@
 		$(RTLLIB)		\
 		$(SALLIB)		\
 		$(BASEGFXLIB)	\
-		$(SAXLIB)
+		$(SAXLIB) \
+		$(OPENSSLLIB)
 
 SHL1DEF=    $(MISC)$/$(SHL1TARGET).def
 SHL1LIBS=   $(LIB1TARGET)

workspace.evoab2def.patch:
 makefile.mk |    6 ++++++
 1 file changed, 6 insertions(+)

--- NEW FILE workspace.evoab2def.patch ---
--- connectivity.orig/source/drivers/evoab/makefile.mk	2008-12-30 15:32:01.000000000 +0100
+++ connectivity/source/drivers/evoab/makefile.mk	2009-04-29 20:51:57.000000000 +0200
@@ -36,6 +36,11 @@ TARGET=evoab
 
 VISIBILITY_HIDDEN=TRUE
 
+.IF "$(ENABLE_EVOAB2)"=="TRUE"
+dummy:
+	@echo "Evolution 1.x Addressbook build disabled in favour of Evolution 2.x Addressbook"
+.ELSE
+
 # --- Settings ----------------------------------
 .IF "$(DBGUTIL_OJ)"!=""
 ENVCFLAGS+=/FR$(SLO)$/
@@ -103,6 +108,7 @@ SHL1DEF=	$(MISC)$/$(SHL1TARGET).def
 DEF1NAME=	$(SHL1TARGET)
 
 .ENDIF
+.ENDIF
 # --- Targets ----------------------------------
 
 .INCLUDE : target.mk

workspace.hb32bugs01.patch:
 source/filter/ww8/wrtw8num.cxx   |    6 ++++--
 source/svrtf/rtfitem.cxx         |   12 ++++++++----
 sw/source/filter/ww8/ww8par6.cxx |   11 +++++++++++
 3 files changed, 23 insertions(+), 6 deletions(-)

--- NEW FILE workspace.hb32bugs01.patch ---
Index: source/svrtf/rtfitem.cxx
===================================================================
RCS file: /cvs/graphics/svx/source/svrtf/rtfitem.cxx,v
retrieving revision 1.35
diff -u -r1.35 rtfitem.cxx
--- svx.orig/source/svrtf/rtfitem.cxx	11 Apr 2008 03:19:51 -0000	1.35
+++ svx/source/svrtf/rtfitem.cxx	18 Mar 2009 17:17:27 -0000
@@ -1164,12 +1164,16 @@
 								ReadTabAttr( nToken, *pSet );
 
                                 /*
-                                cmc: #i76140, he who reads the { must read the }
+                                cmc: #i76140, he who consumed the { must consume the }
                                 We rewound to a state of { being the current 
-                                token so it is our responsibility to read the } 
-                                token.
+                                token so it is our responsibility to consume the } 
+                                token if we consumed the {. We will not have consumed
+                                the { if it belonged to our caller, i.e. if the { we
+                                are handling is the "firsttoken" passed to us then
+                                the *caller* must consume it, not us. Otherwise *we*
+                                should consume it.
                                 */
-                                if (nToken == BRACELEFT)
+                                if (nToken == BRACELEFT && !bFirstToken)
                                 {
                                     nToken = GetNextToken();
                                     DBG_ASSERT( nToken == BRACERIGHT, 
diff -ru sw.orig/source/filter/ww8/ww8par6.cxx sw/source/filter/ww8/ww8par6.cxx
--- sw.orig/source/filter/ww8/ww8par6.cxx	2009-06-03 12:33:28.000000000 +0100
+++ sw/source/filter/ww8/ww8par6.cxx	2009-06-03 13:02:09.000000000 +0100
@@ -778,6 +778,11 @@
            )
         {
             SwFmtLineNumber aLN;
+            if (const SwFmtLineNumber* pLN
+                = (const SwFmtLineNumber*)GetFmtAttr(RES_LINENUMBER))
+            {
+                aLN.SetCountLines( pLN->IsCount() );
+            }
             aLN.SetStartValue(1 + rSection.maSep.lnnMin);
             NewAttr(aLN);
             pCtrlStck->SetAttr(*pPaM->GetPoint(), RES_LINENUMBER);
@@ -3878,6 +3883,12 @@
         return;
     }
     SwFmtLineNumber aLN;
+    if (const SwFmtLineNumber* pLN
+        = (const SwFmtLineNumber*)GetFmtAttr(RES_LINENUMBER))
+    {
+        aLN.SetStartValue( pLN->GetStartValue() );
+    }
+
     aLN.SetCountLines( pData && (0 == *pData) );
     NewAttr( aLN );
 }
diff -ru ww8/wrtw8num.cxx ww8/wrtw8num.cxx
--- sw.orig/source/filter/ww8/wrtw8num.cxx	2009-06-03 15:34:09.000000000 +0100
+++ sw/source/filter/ww8/wrtw8num.cxx	2009-06-04 09:32:06.000000000 +0100
@@ -247,12 +247,14 @@
                 {
                     case SvxNumberFormat::LISTTAB:
                     {
-                        nFlags = 0;
+			// 0 (tab) unless there would be no content before the tab, in which case 2 (nothing)
+			nFlags = (SVX_NUM_NUMBER_NONE != rFmt.GetNumberingType()) ? 0 : 2;
                     }
                     break;
                     case SvxNumberFormat::SPACE:
                     {
-                        nFlags = 1;
+			// 1 (space) unless there would be no content before the space in which case 2 (nothing)
+			nFlags = (SVX_NUM_NUMBER_NONE != rFmt.GetNumberingType()) ? 1 : 2;
                     }
                     break;
                     case SvxNumberFormat::NOTHING:

workspace.impress171.patch:
 unopback.cxx |    2 +-
 unopback.hxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- NEW FILE workspace.impress171.patch ---
diff -ru sd.orig/source/ui/unoidl/unopback.cxx sd/source/ui/unoidl/unopback.cxx
--- openoffice.org.orig/sd/source/ui/unoidl/unopback.cxx	2009-04-14 11:28:37.000000000 +0100
+++ openoffice.org/sd/source/ui/unoidl/unopback.cxx	2009-04-14 11:30:56.000000000 +0100
@@ -119,7 +119,7 @@
 
 }
 
-void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) throw()
+void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet )
 {
 	rSet.ClearItem();
 
diff -ru sd.orig/source/ui/unoidl/unopback.hxx sd/source/ui/unoidl/unopback.hxx
--- openoffice.org.orig/sd/source/ui/unoidl/unopback.hxx	2009-04-14 11:28:37.000000000 +0100
+++ openoffice.org/sd/source/ui/unoidl/unopback.hxx	2009-04-14 11:30:41.000000000 +0100
@@ -67,7 +67,7 @@
 	~SdUnoPageBackground() throw();
 
 	// internal
-	void fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) throw();
+	void fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet );
 	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
 
 	// uno helper

workspace.impress174.patch:
 wmfwr.cxx |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

--- NEW FILE workspace.impress174.patch ---
diff -ru svtools.orig/source/filter.vcl/wmf/wmfwr.cxx svtools/source/filter.vcl/wmf/wmfwr.cxx
--- svtools.orig/source/filter.vcl/wmf/wmfwr.cxx	2009-05-05 12:57:34.000000000 +0100
+++ svtools/source/filter.vcl/wmf/wmfwr.cxx	2009-05-05 13:55:47.000000000 +0100
@@ -439,14 +439,7 @@
 
 	WriteRecordHeader(0x00000000,W_META_CREATEFONTINDIRECT);
 
-    if ( !rFont.GetSize().Width() )
-    {
-        VirtualDevice aDev;
-        FontMetric aMetric( aDev.GetFontMetric( rFont ) );
-        WriteHeightWidth(Size(aMetric.GetWidth(),-rFont.GetSize().Height()));
-    }
-    else
-        WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height()));
+	WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height()));
 
 	*pWMF << (short)rFont.GetOrientation() << (short)rFont.GetOrientation();
 

workspace.kso32fixes.patch:
 openoffice.org/sal/osl/unx/file_impl.hxx |   18 ++++++++
 sal/osl/unx/file.cxx                     |   64 ++++++++++++++++++++++++++++++
 sal/osl/unx/file_stat.cxx                |   66 +++++++++++++++++++++++++++++--
 3 files changed, 145 insertions(+), 3 deletions(-)

--- NEW FILE workspace.kso32fixes.patch ---
Index: sal/osl/unx/file.cxx
===================================================================
RCS file: /cvs/porting/sal/osl/unx/file.cxx,v
retrieving revision 1.10
diff -u -p -r1.10 file.cxx
--- openoffice.org.orig/sal/osl/unx/file.cxx	8 Sep 2005 14:53:53 -0000	1.10
+++ openoffice.org/sal/osl/unx/file.cxx	18 Jan 2006 14:38:41 -0000
@@ -156,6 +156,42 @@
 
 #endif
 
+#ifdef _DIRENT_HAVE_D_TYPE
+#include "file_impl.hxx"
+	oslDirectoryItemImpl* oslDirectoryItemImpl_CreateNew( rtl_uString* _ustrFilePath, bool _bHasDType, unsigned char _DType )
+	{
+		oslDirectoryItemImpl *pItemObject = (oslDirectoryItemImpl*) malloc( sizeof( oslDirectoryItemImpl ) );
+		pItemObject->RefCount = 1;
+		pItemObject->bHasType = _bHasDType;
+		pItemObject->DType = _DType;
+		pItemObject->ustrFilePath = _ustrFilePath;
+
+		return pItemObject;
+	}
+
+	void oslDirectoryItemImpl_Destroy( oslDirectoryItemImpl* pItem )
+	{
+		if( pItem->ustrFilePath ) {
+			rtl_uString_release( pItem->ustrFilePath );
+			pItem->ustrFilePath = NULL;
+		}
+		free( pItem );
+	}
+
+	void oslDirectoryItemImpl_acquire( oslDirectoryItemImpl* pItem )
+	{
+		pItem->RefCount ++;
+	}
+
+	void oslDirectoryItemImpl_release( oslDirectoryItemImpl* pItem )
+	{
+		pItem->RefCount --;
+
+		if( pItem->RefCount <= 0 )
+			oslDirectoryItemImpl_Destroy( pItem );
+	}
+#endif
+
 #if OSL_DEBUG_LEVEL > 1
 
 	extern void debug_ustring(rtl_uString*);
@@ -484,8 +520,14 @@
 	osl_systemPathMakeAbsolutePath(pDirImpl->ustrPath, ustrFileName, &ustrFilePath);
     rtl_uString_release( ustrFileName );
 
+#ifdef _DIRENT_HAVE_D_TYPE
+    if(*pItem)
+      oslDirectoryItemImpl_release( ( oslDirectoryItemImpl* )( *pItem ) );
+    *pItem = (oslDirectoryItem) oslDirectoryItemImpl_CreateNew( ustrFilePath, true, pEntry->d_type );
+#else
     /* use path as directory item */
     *pItem = (oslDirectoryItem) ustrFilePath;
+#endif
 
     return osl_File_E_None;
 }
@@ -514,7 +556,11 @@
 
 	if (0 == access_u(ustrSystemPath, F_OK))
 	{
+#ifdef _DIRENT_HAVE_D_TYPE
+		*pItem = (oslDirectoryItem) oslDirectoryItemImpl_CreateNew( ustrSystemPath, false );
+#else
 		*pItem = (oslDirectoryItem)ustrSystemPath;
+#endif
 		osl_error = osl_File_E_None;
 	}
 	else
@@ -532,12 +578,21 @@
 
 oslFileError osl_acquireDirectoryItem( oslDirectoryItem Item )
 {
+#ifdef _DIRENT_HAVE_D_TYPE
+	oslDirectoryItemImpl* pImpl = (oslDirectoryItemImpl*) Item;
+#else
     rtl_uString* ustrFilePath = (rtl_uString *) Item;
+#endif
 
     OSL_ASSERT( Item );
 
+#ifdef _DIRENT_HAVE_D_TYPE
+	if( pImpl )
+		oslDirectoryItemImpl_acquire( pImpl );
+#else
     if( ustrFilePath )
         rtl_uString_acquire( ustrFilePath );
+#endif
 
     return osl_File_E_None;
 }
@@ -548,12 +603,21 @@
 
 oslFileError osl_releaseDirectoryItem( oslDirectoryItem Item )
 {
+#ifdef _DIRENT_HAVE_D_TYPE
+	oslDirectoryItemImpl* pImpl = (oslDirectoryItemImpl*) Item;
+#else
     rtl_uString* ustrFilePath = (rtl_uString *) Item;
+#endif
 
     OSL_ASSERT( Item );
 
+#ifdef _DIRENT_HAVE_D_TYPE
+	if( pImpl )
+		oslDirectoryItemImpl_release( pImpl );
+#else
     if( ustrFilePath )
         rtl_uString_release( ustrFilePath );
+#endif
 
     return osl_File_E_None;
 }
Index: sal/osl/unx/file_stat.cxx
===================================================================
RCS file: /cvs/porting/sal/osl/unx/file_stat.cxx,v
retrieving revision 1.6
diff -u -p -r1.6 file_stat.cxx
--- openoffice.org.orig/sal/osl/unx/file_stat.cxx	8 Sep 2005 14:56:14 -0000	1.6
+++ openoffice.org/sal/osl/unx/file_stat.cxx	18 Jan 2006 14:38:41 -0000
@@ -42,6 +42,7 @@
 #ifndef _UNISTD_H
 #include <unistd.h>
 #endif
+#include <dirent.h>
 #include <osl/file.h>
 
 #ifndef _ERRNO_H
@@ -56,6 +57,9 @@
 #include "file_path_helper.hxx"
 #include "file_error_transl.h"
 
+#ifdef _DIRENT_HAVE_D_TYPE
+#include "file_impl.hxx"
+#endif
 
 namespace /* private */
 {
@@ -223,9 +227,19 @@
 	
 	/* we only need to call stat or lstat if one of the 
        following flags is set */
+#ifdef _DIRENT_HAVE_D_TYPE
+	inline bool is_stat_call_necessary(sal_uInt32 field_mask, oslDirectoryItemImpl *pImpl)
+#else
 	inline bool is_stat_call_necessary(sal_uInt32 field_mask)
+#endif
 	{
-		return ((field_mask & osl_FileStatus_Mask_Type) ||
+		return (
+/* on linux the dirent might have d_type */
+#ifdef _DIRENT_HAVE_D_TYPE
+				((field_mask & osl_FileStatus_Mask_Type) && (!pImpl->bHasType || pImpl->DType == DT_UNKNOWN)) ||
+#else
+				(field_mask & osl_FileStatus_Mask_Type) ||
+#endif
 				(field_mask & osl_FileStatus_Mask_Attributes) ||
 				(field_mask & osl_FileStatus_Mask_CreationTime) ||
 				(field_mask & osl_FileStatus_Mask_AccessTime) ||
@@ -254,7 +268,11 @@
     	if ((NULL == Item) || (NULL == pStat))
         	return osl_File_E_INVAL;
 							
+#ifdef _DIRENT_HAVE_D_TYPE
+		file_path = rtl::OUString(reinterpret_cast<rtl_uString*>(((oslDirectoryItemImpl* ) Item)->ustrFilePath));
+#else
 		file_path = rtl::OUString(reinterpret_cast<rtl_uString*>(Item));    
+#endif
 
 		OSL_ASSERT(file_path.getLength() > 0);
 		
@@ -285,10 +303,18 @@
 #else
 	struct stat file_stat;
 #endif
-	if (is_stat_call_necessary(uFieldMask) && (0 != osl::lstat(file_path, file_stat)))
+
+#ifdef _DIRENT_HAVE_D_TYPE
+	oslDirectoryItemImpl* pImpl = (oslDirectoryItemImpl*) Item;
+	bool bStatNeeded = is_stat_call_necessary(uFieldMask, pImpl);
+#else
+	bool bStatNeeded = is_stat_call_necessary(uFieldMask);
+#endif
+
+	if (bStatNeeded && (0 != osl::lstat(file_path, file_stat)))
     	return oslTranslateFileError(OSL_FET_ERROR, errno);
 	
-	if (is_stat_call_necessary(uFieldMask))
+	if (bStatNeeded)
 	{
 		// we set all these attributes because it's cheap				
 		set_file_type(file_stat, pStat);
@@ -305,6 +331,40 @@
 				return osl_error;
 		}
     }
+#ifdef _DIRENT_HAVE_D_TYPE
+    else if (uFieldMask & osl_FileStatus_Mask_Type)
+    {
+		OSL_ASSERT(pImpl->bHasType);
+
+		switch(pImpl->DType)
+		{
+		case DT_LNK:
+			pStat->eType = osl_File_Type_Link;              
+			break;
+		case DT_DIR:
+			pStat->eType = osl_File_Type_Directory;       
+			break;
+		case DT_REG:
+			pStat->eType = osl_File_Type_Regular;
+			break;
+		case DT_FIFO:
+			pStat->eType = osl_File_Type_Fifo;
+			break;
+		case DT_SOCK:
+			pStat->eType = osl_File_Type_Socket;
+			break;
+		case DT_CHR:
+		case DT_BLK:
+			pStat->eType = osl_File_Type_Special;
+			break;
+		default:
+			OSL_ASSERT(0);
+			pStat->eType = osl_File_Type_Unknown;
+		}
+
+       pStat->uValidFields |= osl_FileStatus_Mask_Type;
+	}
+#endif
 			
     if (uFieldMask & osl_FileStatus_Mask_FileURL)
     {
Index: sal/osl/unx/file_impl.hxx
===================================================================
--- /dev/null	2006-01-10 21:26:33.568399000 +0100
+++ openoffice.org/sal/osl/unx/file_impl.hxx	2006-01-17 20:05:30.000000000 +0100
@@ -0,0 +1,18 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef struct
+{
+	rtl_uString* ustrFilePath;       /* holds native file name */
+	unsigned char DType;
+	bool bHasType;
+	sal_uInt32 RefCount;
+} oslDirectoryItemImpl;
+
+	oslDirectoryItemImpl* oslDirectoryItemImpl_CreateNew( rtl_uString* _ustrFilePath, bool _bHasDType, unsigned char _DType=0 );
+	void oslDirectoryItemImpl_Destroy( oslDirectoryItemImpl* pItem );
+	void oslDirectoryItemImpl_acquire( oslDirectoryItemImpl* pItem );
+	void oslDirectoryItemImpl_release( oslDirectoryItemImpl* pItem );
+#ifdef __cplusplus
+} /* extern "C" */
+#endif

workspace.locales32.patch:
 i18npool/source/breakiterator/xdictionary.cxx |   75 +++++++++++++++++---------
 inc/xdictionary.hxx                           |    4 -
 2 files changed, 53 insertions(+), 26 deletions(-)

--- NEW FILE workspace.locales32.patch ---
diff -ru i18npool.orig/source/breakiterator/xdictionary.cxx i18npool/source/breakiterator/xdictionary.cxx
--- i18npool.orig/source/breakiterator/xdictionary.cxx	2009-05-28 10:03:10.000000000 +0100
+++ i18npool/source/breakiterator/xdictionary.cxx	2009-06-18 17:02:37.000000000 +0100
@@ -111,8 +112,9 @@
         japaneseWordBreak = sal_True;
 }
 
-sal_Bool xdictionary::exists(const sal_Unicode c) {
-        sal_Bool exist = existMark ? sal::static_int_cast<sal_Bool>((existMark[c>>3] & (1<<(c&0x07))) != 0) : sal_False;
+sal_Bool xdictionary::exists(const sal_uInt32 c) {
+        // 0x1FFF is the hardcoded limit in gendict for existMarks
+        sal_Bool exist = (existMark && ((c>>3) < 0x1FFF)) ? sal::static_int_cast<sal_Bool>((existMark[c>>3] & (1<<(c&0x07))) != 0) : sal_False;
         if (!exist && japaneseWordBreak)
             return BreakIteratorImpl::getScriptClass(c) == ScriptType::ASIAN;
         else
@@ -169,20 +171,35 @@
  * @param pos : Position of the given character.
  * @return true if CJK.
  */
-sal_Bool xdictionary::seekSegment(const sal_Unicode *text, sal_Int32 pos, 
-                sal_Int32 len, Boundary& segBoundary) {
-        for (segBoundary.startPos = pos - 1; 
-            segBoundary.startPos >= 0 && 
-                (u_isWhitespace((sal_uInt32)text[segBoundary.startPos]) || exists(text[segBoundary.startPos]));
-            segBoundary.startPos--) ;
-        segBoundary.startPos++;
-
-        for (segBoundary.endPos = pos;
-            segBoundary.endPos < len &&
-                    (u_isWhitespace((sal_uInt32)text[segBoundary.endPos]) || exists(text[segBoundary.endPos]));
-            segBoundary.endPos++) ;
+sal_Bool xdictionary::seekSegment(const rtl::OUString &rText, sal_Int32 pos, 
+	Boundary& segBoundary)
+{
+    sal_Int32 indexUtf16;
+    segBoundary.endPos = segBoundary.startPos = pos;
+
+    indexUtf16 = pos;
+    while (indexUtf16 > 0)
+    {
+        sal_uInt32 ch = rText.iterateCodePoints(&indexUtf16, -1);
+        if (u_isWhitespace(ch) || exists(ch))
+            segBoundary.startPos = indexUtf16;
+        else
+            break;
+    }
 
-        return segBoundary.endPos > segBoundary.startPos + 1;
+    indexUtf16 = pos;
+    while (indexUtf16 < rText.getLength())
+    {
+        sal_uInt32 ch = rText.iterateCodePoints(&indexUtf16, 1);
+        if (u_isWhitespace(ch) || exists(ch))
+            segBoundary.endPos = indexUtf16;
+        else
+            break;
+    }
+
+    indexUtf16 = segBoundary.startPos;
+    rText.iterateCodePoints(&indexUtf16, 1);
+    return segBoundary.endPos > indexUtf16;
 }
 
 #define KANJA       1
@@ -312,19 +329,24 @@
         sal_Int32 len=rText.getLength();
         if (anyPos >= len || anyPos < 0) {
             boundary.startPos = boundary.endPos = anyPos < 0 ? 0 : len;
-        } else if (seekSegment(text, anyPos, len, boundary)) {          // character in dict
+        } else if (seekSegment(rText, anyPos, boundary)) {          // character in dict
             WordBreakCache& aCache = getCache(text, boundary);
             sal_Int32 i = 0;
 
-            while (aCache.wordboundary[i] <= (sal_Int32)anyPos - boundary.startPos) i++;
+            while (aCache.wordboundary[i] <= anyPos - boundary.startPos) i++;
 
             sal_Int32 startPos = aCache.wordboundary[i - 1];
             // if bDirection is false
-            if (!bDirection && startPos > 0 && startPos == (anyPos - boundary.startPos) &&
-                                                u_isWhitespace((sal_uInt32) text[anyPos - 1]))
-                i--;
-            boundary.endPos = aCache.wordboundary[i] + boundary.startPos;
-            boundary.startPos += aCache.wordboundary[i - 1];
+            if (!bDirection && startPos > 0 && startPos == (anyPos - boundary.startPos))
+            {
+                sal_Int32 indexUtf16 = anyPos-1;
+                sal_uInt32 ch = rText.iterateCodePoints(&indexUtf16, 1);
+                if (u_isWhitespace(ch))
+                    i--;
+            }
+            boundary.endPos = boundary.startPos;
+            rText.iterateCodePoints(&boundary.endPos, aCache.wordboundary[i]);
+            rText.iterateCodePoints(&boundary.startPos, aCache.wordboundary[i-1]);
         } else {
             boundary.startPos = anyPos;
             if (anyPos < len) rText.iterateCodePoints(&anyPos, 1);
@@ -332,8 +354,14 @@
         }
         if (wordType == WordType::WORD_COUNT) {
             // skip punctuation for word count.
-            while (boundary.endPos < len && u_ispunct((sal_uInt32)text[boundary.endPos])) 
-                boundary.endPos++;
+            while (boundary.endPos < len)
+            {
+                sal_Int32 indexUtf16 = boundary.endPos;
+                if (u_ispunct(rText.iterateCodePoints(&indexUtf16, 1)))
+                    boundary.endPos = indexUtf16;
+                else
+                    break;
+            }
         }
 
         return boundary;
--- i18npool.orig/inc/xdictionary.hxx	2009-05-28 10:03:15.000000000 +0100
+++ i18npool/inc/xdictionary.hxx	2009-06-18 16:46:15.000000000 +0100
@@ -85,9 +85,9 @@
 private:
 	WordBreakCache cache[CACHE_MAX];
 
-	sal_Bool        seekSegment(const sal_Unicode *text, sal_Int32 pos, sal_Int32 len, Boundary& boundary);
+	sal_Bool        seekSegment(const rtl::OUString& rText, sal_Int32 pos, Boundary& boundary);
 	WordBreakCache& getCache(const sal_Unicode *text, Boundary& boundary);
-    sal_Bool        exists(const sal_Unicode u);
+	sal_Bool        exists(const sal_uInt32 u);
 	sal_Int32       getLongestMatch(const sal_Unicode *text, sal_Int32 len);
 };
 

workspace.sb113.patch:
 signal.c |   91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

--- NEW FILE workspace.sb113.patch ---
Index: osl/unx/signal.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/signal.c,v
retrieving revision 1.32.14.1
diff -u -r1.32.14.1 signal.c
--- openoffice.org.orig/sal/osl/unx/signal.c	19 Jan 2007 11:43:41 -0000	1.32.14.1
+++ openoffice.org/sal/osl/unx/signal.c	18 Apr 2007 08:37:08 -0000
@@ -41,6 +41,7 @@
 
 #ifdef LINUX
 #include <execinfo.h>
+#include <link.h>
 #define INCLUDE_BACKTRACE
 #define STACKTYPE "Linux"
 #endif
@@ -393,6 +394,87 @@
 
 #define REPORTENV_PARAM		"-crashreportenv:"
 
+#ifdef LINUX
+
+typedef struct
+{
+    const char *name;
+    ElfW(Off) offset;
+} dynamic_entry;
+
+static int
+callback(struct dl_phdr_info *info, size_t size, void *data)
+{
+    const ElfW(Phdr) *pDynamic = NULL;
+
+    if (size == sizeof(struct dl_phdr_info))
+    {
+        int i;
+        for (i = 0; i < info->dlpi_phnum; ++i)
+        {
+            if (info->dlpi_phdr[i].p_type == PT_DYNAMIC)
+            {
+                pDynamic = &(info->dlpi_phdr[i]);
+                break;
+            }
+        }
+    }
+
+    if (pDynamic)
+    {
+        char buffer[100];
+        int len;
+        char exe[PATH_MAX];
+        const char *dsoname = info->dlpi_name;
+
+        dynamic_entry* entry = (dynamic_entry*)data;
+
+        if (strcmp(dsoname, "") == 0)
+        { 
+            snprintf(buffer, sizeof(buffer), "/proc/%d/exe", getpid());
+            if ((len = readlink(buffer, exe, PATH_MAX)) != -1)
+            {
+                exe[len] = '\0';
+                dsoname = exe;
+            }
+        }
+
+        if (strcmp(dsoname, entry->name) == 0)
+        {
+            entry->offset = pDynamic->p_offset;
+            return 1;
+        }
+    }
+    return 0;
+}
+
+/* Get the location of the .dynamic section offset for the given elf file.
+ * i.e. same as the "Offset" value shown for DYNAMIC from readelf -l foo 
+ *
+ * We want to know this value so that if the binaries have been modifed
+ * by prelink then we can still process the call stack on server side 
+ * by comparing this value to that of an "un-prelinked but known to be
+ * otherwise equivalent" version of those binaries and adjust the call 
+ * stack addresses by the differences between .dynamic addresses so as 
+ * to be able to map the prelinked addresses back to the unprelinked 
+ * addresses
+ *
+ * cmc at openoffice.org
+ */
+static ElfW(Off)
+dynamic_section_offset(const char *name)
+{
+    dynamic_entry entry;
+
+    entry.name = name;
+    entry.offset = 0;
+
+    dl_iterate_phdr(callback, &entry);
+
+    return entry.offset;
+}
+#endif
+
 static int ReportCrash( int Signal )
 {
 #ifdef SAL_ENABLE_CRASH_REPORT
@@ -573,6 +655,11 @@
 
 							if ( dl_info.dli_fbase && dl_info.dli_fname )
 							{
+#ifdef LINUX
+								ElfW(Off) dynamic_offset = dynamic_section_offset(dl_info.dli_fname);
+								fprintf( stackout, " 0x%" SAL_PRI_SIZET "x:", dynamic_offset);
+#endif
+
 								fprintf( stackout, " %s + 0x%" SAL_PRI_PTRDIFFT "x",
 									dl_info.dli_fname,
 									(char*)stackframes[iFrame] - (char*)dl_info.dli_fbase
@@ -584,6 +671,10 @@
 
 								if ( dli_fdir )
 									fprintf( xmlout, " path=\"%s\"", dli_fdir );
+
+#ifdef LINUX
+								fprintf( xmlout, " dynamicoffset=\"0x%" SAL_PRI_SIZET "x\"", dynamic_offset );
+#endif
 							}
 							else
 								fprintf( stackout, " ????????" );

workspace.unifypaper01.patch:
 i18npool/inc/i18npool/paper.hxx                    |  155 
 i18npool/prj/build.lst                             |    3 
 i18npool/prj/d.lst                                 |    6 
 i18npool/source/paper/makefile.mk                  |   75 
 i18npool/source/paper/paper.cxx                    |  473 +
 psprint/source/printer/printerinfomanager.cxx      |   75 
 psprint/util/makefile.mk                           |    1 
 reportdesign/source/core/api/ReportDefinition.cxx  |    2 
 reportdesign/source/ui/report/ReportController.cxx |    4 
 sc/source/core/data/stlsheet.cxx                   |    8 
 sc/source/filter/excel/biffdump.cxx                | 9864 +++++++++++++++++++++
 sc/source/filter/excel/xlpage.cxx                  |  206 
 sc/source/filter/html/htmlimp.cxx                  |    4 
 sc/source/ui/app/transobj.cxx                      |    2 
 sc/source/ui/inc/printfun.hxx                      |    2 
 sc/source/ui/view/printfun.cxx                     |    4 
 scp2/source/ooo/file_library_ooo.scp               |    2 
 scp2/source/ooo/module_hidden_ooo.scp              |    1 
 sd/source/core/drawdoc2.cxx                        |    5 
 sd/source/ui/app/sdmod1.cxx                        |    4 
 sd/source/ui/dlg/dlgpage.cxx                       |    4 
 sd/source/ui/view/PrintManager.cxx                 |    4 
 sfx2/source/doc/printhelper.cxx                    |   89 
 solenv/inc/libs.mk                                 |    2 
 starmath/source/unomodel.cxx                       |   28 
 svx/inc/svx/dialogs.hrc                            |   42 
 svx/inc/svx/paperinf.hxx                           |  116 
 svx/inc/svx/svxenum.hxx                            |   43 
 svx/source/dialog/page.cxx                         |   32 
 svx/source/dialog/page.h                           |   42 
 svx/source/dialog/page.hxx                         |    9 
 svx/source/dialog/page.src                         |  138 
 svx/source/items/paperinf.cxx                      |  298 
 svx/source/items/paraitem.cxx                      |    1 
 svx/util/makefile.mk                               |    1 
 sw/inc/bookmrk.hxx                                 |  218 
 sw/source/core/doc/docdesc.cxx                     |    6 
 sw/source/core/doc/poolfmt.cxx                     |    2 
 sw/source/core/unocore/unostyle.cxx                |    5 
 sw/source/core/view/vprint.cxx                     |    2 
 sw/source/filter/basflt/shellio.cxx                |    7 
 sw/source/filter/rtf/swparrtf.cxx                  |   10 
 sw/source/filter/rtf/wrtrtf.cxx                    |    5 
 sw/source/filter/ww8/dump/ww8scan.cxx              |    2 
 sw/source/filter/ww8/writerwordglue.cxx            |   49 
 sw/source/filter/ww8/writerwordglue.hxx            |   19 
 sw/source/filter/ww8/ww8atr.cxx                    |    9 
 sw/source/filter/ww8/ww8par6.cxx                   |   13 
 sw/source/filter/ww8/ww8scan.cxx                   |    2 
 sw/source/filter/ww8/ww8scan.hxx                   |    5 
 sw/source/ui/app/appenv.cxx                        |    5 
 sw/source/ui/dochdl/swdtflvr.cxx                   |    2 
 sw/source/ui/envelp/envfmt.cxx                     |   26 
 sw/source/ui/envelp/envimg.cxx                     |    5 
 sw/source/ui/frmdlg/colex.cxx                      |    2 
 sw/source/ui/inc/colex.hxx                         |    3 
 sw/source/ui/uiview/pview.cxx                      |    6 
 sw/source/ui/uiview/viewport.cxx                   |    5 
 swext/mediawiki/build.xml                          |    6 
 vcl/aqua/source/gdi/salprn.cxx                     |    8 
 vcl/inc/vcl/jobset.h                               |    2 
 vcl/inc/vcl/print.hxx                              |    9 
 vcl/inc/vcl/prntypes.hxx                           |   28 
 vcl/inc/vcl/salprn.hxx                             |    2 
 vcl/source/gdi/print.cxx                           |  154 
 vcl/unx/headless/svpprn.cxx                        |   42 
 vcl/unx/source/gdi/salprnpsp.cxx                   |   44 
 vcl/util/linksvp/makefile.mk                       |    1 
 vcl/util/makefile.mk                               |    4 
 vcl/win/source/gdi/salprn.cxx                      |  325 
 writerfilter/source/dmapper/ConversionHelper.cxx   |   51 
 writerfilter/source/dmapper/ConversionHelper.hxx   |    1 
 writerfilter/source/dmapper/DomainMapper.cxx       |   24 
 writerfilter/source/dmapper/PropertyMap.cxx        |   10 
 writerfilter/util/makefile.mk                      |    1 
 75 files changed, 11642 insertions(+), 1223 deletions(-)

--- NEW FILE workspace.unifypaper01.patch ---
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/i18npool/prj/build.lst OOO310_m12/i18npool/prj/build.lst
--- OOO310_m12.orig/i18npool/prj/build.lst	2009-05-27 14:29:21.000000000 +0100
+++ OOO310_m12/i18npool/prj/build.lst	2009-05-27 14:40:28.000000000 +0100
@@ -9,6 +9,7 @@
 inp  i18npool\source\isolang                    nmake   -   all inp_isolang inp_inc NULL
 inp  i18npool\source\localedata                 nmake   -   all inp_localedata inp_isolang inp_inc NULL
 inp  i18npool\source\localedata\data            nmake   -   all inp_locdata_data inp_localedata inp_inc NULL
+inp  i18npool\source\paper	                nmake   -   all inp_paper inp_isolang inp_inc NULL
 inp  i18npool\source\calendar                   nmake   -   all inp_cal inp_inc NULL
 inp  i18npool\source\numberformatcode           nmake   -   all inp_numformat inp_inc NULL
 inp  i18npool\source\defaultnumberingprovider   nmake   -   all inp_dnum inp_inc NULL
@@ -22,4 +23,4 @@
 inp  i18npool\source\textconversion\data        nmake   -   all inp_textconv_dict inp_textconversion inp_inc NULL
 inp  i18npool\source\search                     nmake   -   all inp_search inp_inc NULL
 inp  i18npool\source\ordinalsuffix              nmake   -   all inp_ordinalsuffix NULL
-inp  i18npool\util                              nmake   -   all inp_util inp_brkit inp_dict inp_chclass inp_translit inp_cal inp_dnum inp_natnum inp_localedata inp_locdata_data inp_numformat inp_rserv inp_index inp_index_data inp_collator inp_collator_data inp_inputchecker inp_textconversion inp_textconv_dict inp_search inp_isolang inp_ordinalsuffix NULL
+inp  i18npool\util                              nmake   -   all inp_util inp_brkit inp_dict inp_chclass inp_translit inp_cal inp_dnum inp_natnum inp_localedata inp_locdata_data inp_numformat inp_rserv inp_index inp_index_data inp_collator inp_collator_data inp_inputchecker inp_textconversion inp_textconv_dict inp_search inp_isolang inp_paper inp_ordinalsuffix NULL
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/i18npool/prj/d.lst OOO310_m12/i18npool/prj/d.lst
--- OOO310_m12.orig/i18npool/prj/d.lst	2009-05-27 14:29:21.000000000 +0100
+++ OOO310_m12/i18npool/prj/d.lst	2009-05-27 14:40:28.000000000 +0100
@@ -40,3 +40,9 @@
 ..\%__SRC%\bin\i18nisol*.dll %_DEST%\bin%_EXT%\i18nisol*.dll
 ..\%__SRC%\lib\libi18nisolang*.so %_DEST%\lib%_EXT%\libi18nisolang*.so
 ..\%__SRC%\lib\libi18nisolang*.dylib %_DEST%\lib%_EXT%\libi18nisolang*.dylib
+
+..\%__SRC%\lib\ii18npaper*.lib %_DEST%\lib%_EXT%\ii18npaper*.lib
+..\%__SRC%\bin\i18npaper*.dll %_DEST%\bin%_EXT%\i18npaper*.dll
+..\%__SRC%\lib\libi18npaper*.so %_DEST%\lib%_EXT%\libi18npaper*.so
+..\%__SRC%\lib\libi18npaper*.dylib %_DEST%\lib%_EXT%\libi18npaper*.dylib
+
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/psprint/source/printer/printerinfomanager.cxx OOO310_m12/psprint/source/printer/printerinfomanager.cxx
--- OOO310_m12.orig/psprint/source/printer/printerinfomanager.cxx	2009-05-27 14:26:36.000000000 +0100
+++ OOO310_m12/psprint/source/printer/printerinfomanager.cxx	2009-05-27 15:22:48.000000000 +0100
@@ -43,6 +43,7 @@
 #include <psprint/fontmanager.hxx>
 #include <psprint/strhelper.hxx>
 #include <rtl/strbuf.hxx>
+#include <i18npool/paper.hxx>
 
 #include <osl/thread.hxx>
 #include <osl/mutex.hxx>
@@ -156,77 +157,9 @@
 
 void PrinterInfoManager::initSystemDefaultPaper()
 {
-    bool bSuccess = false;
-
-    // try libpaper
-
-    // #i78617# workaround missing paperconf command
-    FILE* pPipe = popen( "sh -c paperconf 2>/dev/null", "r" );
-    if( pPipe )
-    {
-        char pBuffer[ 1024 ];
-        *pBuffer = 0;
-        fgets( pBuffer, sizeof(pBuffer)-1, pPipe );
-        pclose( pPipe );
-        
-        ByteString aPaper( pBuffer );
-        aPaper = WhitespaceToSpace( aPaper );
-        if( aPaper.Len() )
-        {
-            m_aSystemDefaultPaper = OUString( OStringToOUString( aPaper, osl_getThreadTextEncoding() ) );
-            bSuccess = true;
-            #if OSL_DEBUG_LEVEL > 1
-            fprintf( stderr, "paper from paperconf = %s\n", aPaper.GetBuffer() );
-            #endif
-        }
-        if( bSuccess )
-            return;
-    }
-
-    // default value is Letter for US (en_US), Cannada (en_CA, fr_CA); else A4
-    // en will be interpreted as en_US
-    
-    // note: at this point m_aSystemDefaultPaper is set to "A4" from the constructor
-    
-    // check for LC_PAPER
-    const char* pPaperLang = getenv( "LC_PAPER" );
-    if( pPaperLang && *pPaperLang )
-    {
-        OString aLang( pPaperLang );
-        if( aLang.getLength() > 5 )
-            aLang = aLang.copy( 0, 5 );
-        if( aLang.getLength() == 5 )
-        {
-            if(    aLang.equalsIgnoreAsciiCase( "en_us" )
-                || aLang.equalsIgnoreAsciiCase( "en_ca" )
-            || aLang.equalsIgnoreAsciiCase( "fr_ca" )
-            )
-                m_aSystemDefaultPaper = OUString( RTL_CONSTASCII_USTRINGPARAM( "Letter" ) );
-        }
-        else if( aLang.getLength() == 2 && aLang.equalsIgnoreAsciiCase( "en" ) )
-            m_aSystemDefaultPaper = OUString( RTL_CONSTASCII_USTRINGPARAM( "Letter" ) );
-        return;
-    }
-    
-    // use process locale to determine paper
-    rtl_Locale* pLoc = NULL;
-    osl_getProcessLocale( &pLoc );
-    if( pLoc )
-    {
-        if( 0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Language->buffer, pLoc->Language->length, "en") )
-        {
-            if(    0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Country->buffer, pLoc->Country->length, "us")
-                || 0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Country->buffer, pLoc->Country->length, "ca")
-                || pLoc->Country->length == 0
-                )
-                m_aSystemDefaultPaper = OUString( RTL_CONSTASCII_USTRINGPARAM( "Letter" ) );
-        }
-        else if( 0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Language->buffer, pLoc->Language->length, "fr") )
-        {
-            if( 0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Country->buffer, pLoc->Country->length, "ca") )
-                m_aSystemDefaultPaper = OUString( RTL_CONSTASCII_USTRINGPARAM( "Letter" ) );
-        }
-    }
+    m_aSystemDefaultPaper = rtl::OStringToOUString(
+        PaperInfo::toPSName(PaperInfo::getSystemDefaultPaper().getPaper()),
+        RTL_TEXTENCODING_UTF8);
 }
 
 // -----------------------------------------------------------------
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/psprint/util/makefile.mk OOO310_m12/psprint/util/makefile.mk
--- OOO310_m12.orig/psprint/util/makefile.mk	2009-05-27 14:26:36.000000000 +0100
+++ OOO310_m12/psprint/util/makefile.mk	2009-05-27 15:22:47.000000000 +0100
@@ -67,6 +67,7 @@
 
 SHL1STDLIBS=$(UNOTOOLSLIB)		\
 			$(I18NISOLANGLIB) 	\
+			$(I18NPAPERLIB) 	\
 			$(TOOLSLIB) 		\
             $(COMPHELPERLIB)    \
             $(CPPULIB)          \
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/reportdesign/source/core/api/ReportDefinition.cxx OOO310_m12/reportdesign/source/core/api/ReportDefinition.cxx
--- OOO310_m12.orig/reportdesign/source/core/api/ReportDefinition.cxx	2009-05-27 14:27:46.000000000 +0100
+++ OOO310_m12/reportdesign/source/core/api/ReportDefinition.cxx	2009-05-27 14:40:27.000000000 +0100
@@ -289,7 +289,7 @@
 :OStyle_PBASE(m_aBHelper)
 ,m_aSize(21000,29700)
 {
-    const ::Size aDefaultSize = SvxPaperInfo::GetPaperSize(SvxPaperInfo::GetDefaultSvxPaper(Application::GetSettings().GetLanguage()),MAP_100TH_MM);
+    const ::Size aDefaultSize = SvxPaperInfo::GetDefaultPaperSize( MAP_100TH_MM );
     m_aSize.Height = aDefaultSize.Height();
     m_aSize.Width = aDefaultSize.Width();
 
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/reportdesign/source/ui/report/ReportController.cxx OOO310_m12/reportdesign/source/ui/report/ReportController.cxx
--- OOO310_m12.orig/reportdesign/source/ui/report/ReportController.cxx	2009-05-27 14:27:46.000000000 +0100
+++ OOO310_m12/reportdesign/source/ui/report/ReportController.cxx	2009-05-27 14:40:27.000000000 +0100
@@ -2339,8 +2339,8 @@
 		new SvxPageItem(RPTUI_ID_PAGE),
 		new SvxSizeItem(RPTUI_ID_SIZE),
 		new SfxAllEnumItem(RPTUI_ID_PAGE_MODE,SVX_PAGE_MODE_STANDARD),
-		new SfxAllEnumItem(RPTUI_ID_START,SVX_PAPER_A4),
-		new SfxAllEnumItem(RPTUI_ID_END,SVX_PAPER_E),
+		new SfxAllEnumItem(RPTUI_ID_START,PAPER_A4),
+		new SfxAllEnumItem(RPTUI_ID_END,PAPER_E),
 		new SvxBrushItem(ITEMID_BRUSH),
 		new SfxUInt16Item(RPTUI_ID_METRIC,static_cast<UINT16>(eUserMetric))
 	};
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/sc/source/core/data/stlsheet.cxx OOO310_m12/sc/source/core/data/stlsheet.cxx
--- OOO310_m12.orig/sc/source/core/data/stlsheet.cxx	2009-05-27 14:26:41.000000000 +0100
+++ OOO310_m12/sc/source/core/data/stlsheet.cxx	2009-05-27 14:40:27.000000000 +0100
@@ -176,14 +176,8 @@
 					if ( pDoc && pDoc->IsLoadingDone() )
 					{
 						// Setzen von sinnvollen Default-Werten:
-						// SfxPrinter*		pPrinter = pDoc->GetPrinter();
 						SvxPageItem		aPageItem( ATTR_PAGE );
-						// #50536# PaperBin auf Default lassen,
-						// nicht auf aktuelle Drucker-Einstellung umsetzen
-						// SvxSizeItem		aPaperSizeItem(ATTR_PAGE_SIZE,SvxPaperInfo::GetPaperSize(pPrinter) );
-
-						SvxPaper		aDefaultPaper = SvxPaperInfo::GetDefaultSvxPaper( Application::GetSettings().GetLanguage() );
-						SvxSizeItem		aPaperSizeItem( ATTR_PAGE_SIZE, SvxPaperInfo::GetPaperSize(aDefaultPaper) );
+						SvxSizeItem		aPaperSizeItem( ATTR_PAGE_SIZE, SvxPaperInfo::GetDefaultPaperSize() );
 
 						SvxSetItem		aHFSetItem(
 											(const SvxSetItem&)
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/sc/source/filter/excel/biffdump.cxx OOO310_m12/sc/source/filter/excel/biffdump.cxx
--- OOO310_m12.orig/sc/source/filter/excel/biffdump.cxx	2009-05-27 14:26:42.000000000 +0100
+++ OOO310_m12/sc/source/filter/excel/biffdump.cxx	2009-05-27 14:40:27.000000000 +0100
@@ -9862,3 +9862,9867 @@
 
 #endif
 
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: biffdump.cxx,v $
+ * $Revision: 1.91 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
[...13983 lines suppressed...]
+                {
+                    { "B0",   PAPER_B0_ISO },
+                    { "B1",   PAPER_B1_ISO },
+                    { "B2",   PAPER_B2_ISO },
+                    { "B3",   PAPER_B3_ISO },
+                    { "B4",   PAPER_B4_ISO },
+                    { "B5",   PAPER_B5_ISO },
+                    { "B6",   PAPER_B6_ISO },
+                    { "B7",   PAPER_B7_ISO },
+                    { "B8",   PAPER_B8_ISO },
+                    { "B9",   PAPER_B9_ISO },
+                    { "B10",  PAPER_B10_ISO },
+                    { "folio", PAPER_FANFOLD_LEGAL_DE },
+                    { "flsa",  PAPER_FANFOLD_LEGAL_DE },
+                    { "flse",  PAPER_FANFOLD_LEGAL_DE }
+                };
+
+                bool bHalve = false;
+
+                size_t nExtraTabSize = sizeof(aCustoms) / sizeof(aCustoms[0]);
+                for (size_t i = 0; i < nExtraTabSize; ++i)
+                {
+                    if (rtl_str_compareIgnoreAsciiCase(aCustoms[i].pName, aPaper.getStr()) == 0)
+                    {
+                        ePaper = aCustoms[i].ePaper;
+                        break;
+                    }
+                }
+
+                if (ePaper == PAPER_USER)
+                {
+                    bHalve = !rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
+                        aPaper.getStr(), aPaper.getLength(),  "half", 4, 4);
+                    if (bHalve)
+                        aPaper = aPaper.copy(4);
+                    ePaper = PaperInfo::fromPSName(aPaper);
+                }
+
+                if (ePaper != PAPER_USER)
+                {
+                    aInstance = PaperInfo(ePaper);
+                    if (bHalve)
+                        aInstance = PaperInfo(aInstance.getHeight()/2, aInstance.getWidth());
+                    bInitialized = true;
+                    return aInstance;
+                }
+            }
+        }
+
+#if defined(LC_PAPER) && defined(_GNU_SOURCE)
+
+        union paperword { char *string; int word; };
+
+        // try LC_PAPER
+        paperword w, h;
+        w.string = nl_langinfo(_NL_PAPER_WIDTH);
+        h.string = nl_langinfo(_NL_PAPER_HEIGHT);
+
+        //glibc stores sizes as integer mm units
+        w.word *= 100;
+        h.word *= 100;
+
+        for ( size_t i = 0; i < nTabSize; ++i )
+        {
+            if (i == PAPER_USER) continue;
+            
+            //glibc stores sizes as integer mm units, and so is inaccurate. To
+            //find a standard paper size we calculate the standard paper sizes
+            //into equally inaccurate mm and compare
+            long width = (aDinTab[i].m_nWidth + 50) / 100;
+            long height = (aDinTab[i].m_nHeight + 50) / 100;
+    
+            if (width == w.word/100 && height == h.word/100)
+            {
+                w.word = aDinTab[i].m_nWidth;
+                h.word = aDinTab[i].m_nHeight;
+                break;
+            }
+        }
+
+        aInstance = PaperInfo(w.word, h.word);
+        bInitialized = true;
+        return aInstance;
+#endif
+    }
+#endif
+
+    try
+    {
+        // if set to "use system", try to get locale from system
+        if( aLocaleStr.getLength() == 0 )
+            xConfigNA->getByName( CREATE_OUSTRING( "Locale" ) ) >>= aLocaleStr;
+    }
+    catch( Exception& ) {}
+
+
+    if (aLocaleStr.getLength() == 0)
+        aLocaleStr = CREATE_OUSTRING("en-US");
+
+    // convert locale string to locale struct
+    ::com::sun::star::lang::Locale aSysLocale;
+    sal_Int32 nDashPos = aLocaleStr.indexOf( '-' );
+    if( nDashPos < 0 ) nDashPos = aLocaleStr.getLength();
+    aSysLocale.Language = aLocaleStr.copy( 0, nDashPos );
+    if( nDashPos + 1 < aLocaleStr.getLength() )
+        aSysLocale.Country = aLocaleStr.copy( nDashPos + 1 );
+
+    return PaperInfo::getDefaultPaperForLocale(aSysLocale);
+}
+
+PaperInfo::PaperInfo(Paper eType) : m_eType(eType)
+{
+    m_nPaperWidth = aDinTab[m_eType].m_nWidth;
+    m_nPaperHeight = aDinTab[m_eType].m_nHeight;
+}
+
+PaperInfo::PaperInfo(long nPaperWidth, long nPaperHeight)
+    : m_eType(PAPER_USER),
+      m_nPaperWidth(nPaperWidth),
+      m_nPaperHeight(nPaperHeight)
+{
+    for ( size_t i = 0; i < nTabSize; ++i )
+    {
+        if ( 
+             (nPaperWidth == aDinTab[i].m_nWidth) &&
+             (nPaperHeight == aDinTab[i].m_nHeight)
+           )
+        {
+            m_eType = static_cast<Paper>(i);
+            break;
+        }
+    }
+}
+
+rtl::OString PaperInfo::toPSName(Paper ePaper)
+{
+    return static_cast<size_t>(ePaper) < nTabSize ?
+        rtl::OString(aDinTab[ePaper].m_pPSName) : rtl::OString();
+}
+
+Paper PaperInfo::fromPSName(const rtl::OString &rName)
+{
+    if (!rName.getLength())
+        return PAPER_USER;
+
+    for ( size_t i = 0; i < nTabSize; ++i )
+    {
+        if (aDinTab[i].m_pPSName && 
+          !rtl_str_compareIgnoreAsciiCase(aDinTab[i].m_pPSName, rName.getStr()))
+        {
+            return static_cast<Paper>(i);
+        }
+        else if (aDinTab[i].m_pAltPSName &&
+          !rtl_str_compareIgnoreAsciiCase(aDinTab[i].m_pAltPSName, rName.getStr()))
+        {
+            return static_cast<Paper>(i);
+        }
+    }
+
+    return PAPER_USER;
+}
+
+//http://wiki.services.openoffice.org/wiki/DefaultPaperSize
+//http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/localedata/locales/?cvsroot=glibc
+//http://www.unicode.org/cldr/data/charts/supplemental/territory_language_information.html
+//http://en.wikipedia.org/wiki/Paper_size
+//http://msdn.microsoft.com/en-us/library/cc195164.aspx
+PaperInfo PaperInfo::getDefaultPaperForLocale(
+    const ::com::sun::star::lang::Locale & rLocale)
+{
+    Paper eType = PAPER_A4;
+
+    if (
+        //United States, Letter
+        !rLocale.Country.compareToAscii("US") ||
+        //Puerto Rico, http://sources.redhat.com/ml/libc-hacker/2001-07/msg00046.html
+        !rLocale.Country.compareToAscii("PR") ||
+        //Canada, http://sources.redhat.com/ml/libc-hacker/2001-07/msg00053.html
+        !rLocale.Country.compareToAscii("CA") ||
+        //Venuzuela, https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00019.html
+        !rLocale.Country.compareToAscii("VE") ||
+        //Chile, https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00240.html
+        !rLocale.Country.compareToAscii("CL") ||
+        //Mexico, http://qa.openoffice.org/issues/show_bug.cgi?id=49739
+        !rLocale.Country.compareToAscii("MX") ||
+        //Colombia, http://qa.openoffice.org/issues/show_bug.cgi?id=69703
+        !rLocale.Country.compareToAscii("CO") ||
+        //Philippines, 
+        //    http://ubuntuliving.blogspot.com/2008/07/default-paper-size-in-evince.html
+        //    http://www.gov.ph/faqs/driverslicense.asp
+        !rLocale.Country.compareToAscii("PH")
+       )
+    {
+        eType = PAPER_LETTER;
+    }
+
+    return eType;
+}
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */

workspace.vcl103.patch:
 inc/vcl/sndstyle.hxx           |    3 +--
 unx/gtk/window/gtkframe.cxx    |    7 ++++++-
 win/source/window/salframe.cxx |    3 ++-
 3 files changed, 9 insertions(+), 4 deletions(-)

--- NEW FILE workspace.vcl103.patch ---
diff -ru vcl.orig/inc/vcl/sndstyle.hxx vcl/inc/vcl/sndstyle.hxx
--- vcl.orig/inc/vcl/sndstyle.hxx	2009-07-02 10:10:49.000000000 +0100
+++ vcl/inc/vcl/sndstyle.hxx	2009-07-03 16:08:55.000000000 +0100
@@ -43,7 +43,6 @@
 #define SOUND_WARNING                   ((SoundType)2)
 #define SOUND_ERROR                     ((SoundType)3)
 #define SOUND_QUERY                     ((SoundType)4)
-
-#define SOUND_DISABLE                   (SOUND_DEFAULT)
+#define SOUND_DISABLE                   ((SoundType)5)
 
 #endif // _SV_SNDSTYLE_HXX
diff -ru vcl.orig/win/source/window/salframe.cxx vcl/win/source/window/salframe.cxx
--- vcl.orig/win/source/window/salframe.cxx	2009-07-02 10:10:22.000000000 +0100
+++ vcl/win/source/window/salframe.cxx	2009-07-03 16:10:27.000000000 +0100
@@ -3157,7 +3157,8 @@
         MB_ICONASTERISK,                // SOUND_INFO
         MB_ICONEXCLAMATION,             // SOUND_WARNING
         MB_ICONHAND,                    // SOUND_ERROR
-        MB_ICONQUESTION                 // SOUND_QUERY
+        MB_ICONQUESTION,                // SOUND_QUERY
+        0	                        // SOUND_DISABLE
     };
 
     MessageBeep( aImplSoundTab[eSoundType] );
diff -ru vcl.orig/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkframe.cxx
--- vcl.orig/unx/gtk/window/gtkframe.cxx	2009-07-02 10:10:48.000000000 +0100
+++ vcl/unx/gtk/window/gtkframe.cxx	2009-07-02 10:13:01.000000000 +0100
@@ -824,7 +824,12 @@
         }
         if( (nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ) )
         {
-            eType = GDK_WINDOW_TYPE_HINT_DOCK;
+	    //KWin apparently gets very confused with a DOCK hint on such a
+	    //full-screen window shown on one monitor of many
+            if (getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("KWin"))
+                eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
+            else
+                eType = GDK_WINDOW_TYPE_HINT_DOCK;
             gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), true );
         }
         

workspace.vcl104.patch:
 sm.cxx |   40 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)

--- NEW FILE workspace.vcl104.patch ---
diff -ru vcl.orig/unx/source/app/sm.cxx vcl/unx/source/app/sm.cxx
--- vcl.orig/unx/source/app/sm.cxx	2009-04-27 08:31:01.000000000 +0100
+++ vcl/unx/source/app/sm.cxx	2009-04-27 14:38:55.000000000 +0100
@@ -48,6 +48,7 @@
 #include <saldisp.hxx>
 #include <salframe.h>
 #include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
 #include <salinst.h>
 
 #include <osl/conditn.h>
@@ -187,6 +188,7 @@
 static SmProp*	pSmProps = NULL;
 static SmProp**	ppSmProps = NULL;
 static int		nSmProps = 0;
+static unsigned char   *pSmRestartHint = NULL;
 
 
 static void BuildSmPropertyList()
@@ -195,7 +197,7 @@
 	{
 		ByteString aExec( SessionManagerClient::getExecName(), osl_getThreadTextEncoding() );
 
-		nSmProps = 4;
+		nSmProps = 5;
 		pSmProps = new SmProp[ nSmProps ];
 
 		pSmProps[ 0 ].name		= const_cast<char*>(SmCloneCommand);
@@ -243,6 +245,15 @@
 		pSmProps[ 3 ].vals->value	= strdup( aUser.getStr() );
 		pSmProps[ 3 ].vals->length	= strlen( (char *)pSmProps[ 3 ].vals->value )+1;
 
+		pSmProps[ 4 ].name		= const_cast<char*>(SmRestartStyleHint);
+		pSmProps[ 4 ].type		= const_cast<char*>(SmCARD8);
+		pSmProps[ 4 ].num_vals	= 1;
+		pSmProps[ 4 ].vals		= new SmPropValue;
+		pSmProps[ 4 ].vals->value	= malloc(1);
+		pSmRestartHint = (unsigned char *)pSmProps[ 4 ].vals->value;
+		*pSmRestartHint = SmRestartIfRunning;
+		pSmProps[ 4 ].vals->length	= 1;
+
 		ppSmProps = new SmProp*[ nSmProps ];
 		for( int i = 0; i < nSmProps; i++ )
 			ppSmProps[ i ] = &pSmProps[i];
@@ -257,6 +268,31 @@
 IMPL_STATIC_LINK( SessionManagerClient, SaveYourselfHdl, void*, EMPTYARG )
 {
     SMprintf( "posting save documents event shutdown = %s\n", (pThis!=0) ? "true" : "false" );
+
+    static bool bFirstShutdown=true;
+    if (pThis != 0 && bFirstShutdown) //first shutdown request
+    {
+        bFirstShutdown = false;
+        /*
+          If we have no actual frames open, e.g. we launched a quickstarter,
+          and then shutdown all our frames leaving just a quickstarter running,
+          then we don't want to launch an empty toplevel frame on the next 
+          start. (The job of scheduling the restart of the quick-starter is a 
+          task of the quick-starter)
+        */
+        *pSmRestartHint = SmRestartNever;
+        const std::list< SalFrame* >& rFrames = GetX11SalData()->GetDisplay()->getFrames();
+        for( std::list< SalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it )
+        {
+            Window *pWindow = (*it)->GetWindow();
+            if (pWindow && pWindow->IsVisible())
+            {
+                *pSmRestartHint = SmRestartIfRunning;
+                break;
+            }
+        }
+    }
+
     if( pOneInstance )
     {
         SalSessionSaveRequestEvent aEvent( pThis != 0, false );
@@ -385,7 +421,7 @@
         ICEConnectionObserver::lock();
         SmcSetProperties( aSmcConnection, nSmProps, ppSmProps );
         SmcSaveYourselfDone( aSmcConnection, True );
-        SMprintf( "sent SaveYourselfDone\n" );
+        SMprintf( "sent SaveYourselfDone SmRestartHint of %d\n", *pSmRestartHint );
         bDocSaveDone = true;
         ICEConnectionObserver::unlock();
     }


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/F-11/openoffice.org.spec,v
retrieving revision 1.1930
retrieving revision 1.1931
diff -u -p -r1.1930 -r1.1931
--- openoffice.org.spec	26 Aug 2009 13:11:56 -0000	1.1930
+++ openoffice.org.spec	28 Aug 2009 09:43:31 -0000	1.1931
@@ -1,6 +1,6 @@
 %define oootag OOO310
-%define ooomilestone 11
-%define rh_rpm_release 6
+%define ooomilestone 19
+%define rh_rpm_release 1
 
 # rhbz#465664 jar-repacking breaks help by reordering META-INF/MANIFEST.MF
 %define __jar_repack %{nil}
@@ -34,7 +34,7 @@
 
 Summary:        OpenOffice.org comprehensive office suite.
 Name:           openoffice.org
-Version:        3.1.0
+Version:        3.1.1
 Release: 	%{ooomilestone}.%{rh_rpm_release}%{?dist}
 Epoch:		1
 License:	LGPLv3 and LGPLv2+ and MPLv1.1 and BSD
@@ -70,7 +70,7 @@ BuildRequires:  pentaho-reporting-flow-e
 
 Patch0:  openoffice.org-simple-crash_report.sh
 Patch1:  openoffice.org-multiliblauncher.sh
-Patch2:  planned.workspace.defaultdoclang.patch
+Patch2:  workspace.defaultdoclang.patch
 %if %{gtkprintui}
 Patch3:  openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch
 %endif
@@ -86,8 +86,8 @@ Patch11: openoffice.org-2.0.3.rh127576.g
 %endif
 Patch12: openoffice.org-2.2.0.ooo74188.sw.cursorinsideglyph.patch
 Patch13: ooo-build.ooo68717.gstreamer.video.patch
-Patch14: openoffice.org-2.2.0.ooo63159.sal.dtype.patch
-Patch15: openoffice.org-2.2.0.ooo76393.sal.dynamicsection.patch
+Patch14: workspace.kso32fixes.patch
+Patch15: workspace.sb113.patch
 Patch16: openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch
 Patch17: openoffice.org-2.3.0.ooo76649.httpencoding.patch
 Patch18: openoffice.org-2.3.1.ooo83878.unopkg.enablelinking.patch
@@ -107,54 +107,55 @@ Patch31: workspace.mav46.patch
 Patch32: openoffice.org-3.0.1.ooo97088.sd.accel-fallback.patch
 Patch33: workspace.transogl03redux.patch
 Patch34: openoffice.org-3.0.1.oooXXXXX.extensions.npapi.patch
-Patch35: workspace.sb109.patch
-Patch36: openoffice.org-3.0.1.ooo97488.sw.ww8toc.patch
-Patch37: openoffice.org-3.0.1.oooXXXXX.fpicker.allformatsonsave.patch
-Patch38: openoffice.org-3.1.0.ooo98137.filter.redeclared-variables.patch
-Patch39: workspace.cmcfixes54.patch
-Patch40: openoffice.org-2.2.0.gccXXXXX.solenv.javaregistration.patch
-Patch41: workspace.fwk103.patch
-Patch42: workspace.hb18.patch
-Patch43: openoffice.org-3.1.0.oooXXXXX.gcc44.buildfixes.patch
-Patch44: openoffice.org-3.1.0.ooo99250.sc.autooutline-reflists.patch
-Patch45: workspace.vcl100.patch
-Patch46: workspace.xmergeclean.patch
-Patch47: workspace.mba32issues02.patch
-Patch48: workspace.impress169.patch
-Patch49: workspace.os130.patch
-Patch50: openoffice.org-3.1.0.ooo99541.sw.reopen.flat.addrbooks.patch
-Patch51: openoffice.org-3.1.0.oooXXXXX.solenv.allowmissing.patch
-Patch52: workspace.cmcfixes57.patch
-Patch53: openoffice.org-3.1.0.ooo100273.fix-utf8-hyphenation.patch
-Patch54: ooo-build.ooo2497.filter.svg.patch
-Patch55: openoffice.org-3.1.0.ooo100353.svx.rtfbrackets.patch
-Patch56: openoffice.org-3.1.0.ooo61927.sw.ww6.unicodefontencoding.patch
-Patch57: openoffice.org-3.1.0.ooo101074.sd.bad.nothrow.patch
-Patch58: workspace.vcl101.patch
-Patch59: workspace.slideshow1.patch
-Patch60: openoffice.org-3.1.0.ooo90439.sfx2.qstart.hackaround.patch
-Patch61: openoffice.org-3.1.0.ooo101274.opening-a-directory.patch
-Patch62: openoffice.org-3.1.0.ooo101354.filter.xhtml.do-not-label-list-headers.patch
-Patch63: openoffice.org-3.1.0.ooo101355.filter.no-variables-in-keys.patch
-Patch64: openoffice.org-3.1.0.ooo101379.vcl.qstart.SM.patch
-Patch65: openoffice.org-3.1.0.ooo101439.connectivity.evodupl.patch
-Patch66: openoffice.org-3.1.0.ooo100469.sal.ia64_arm.patch
-Patch67: openoffice.org-3.1.0.ooo101566.svtools.nodefaultwmfwidth.patch
-Patch68: openoffice.org-3.1.0.ooo101567.i18npool.mailocaledata.patch
-Patch69: openoffice.org-3.1.0.ooo102566.sc.less.frenetic.progress.patch
-Patch70: workspace.pdfextfix02.patch
-Patch71: openoffice.org-3.1.0.ooo102920.i18npool.utf16bustage.patch
-Patch72: workspace.aw073.patch
-Patch73: openoffice.org-3.1.1.ooo102932.sw.mailmerge.busted-integer-conversion.patch
-Patch74: openoffice.org-3.1.0.ooo103277.vcl.kwinworkaround.patch
-Patch75: workspace.calc311fixes.patch
-Patch76: openoffice.org-3.1.0.oooXXXXX.svx.64bit.patch
-Patch77: openoffice.org-3.1.0.ooo103651.canvas.nosubpixel.patch
-Patch78: workspace.os132.patch
-Patch79: openoffice.org-3.1.1.ooo104306.moverecentlyused.patch
+Patch35: openoffice.org-3.0.1.ooo97488.sw.ww8toc.patch
+Patch36: openoffice.org-3.0.1.oooXXXXX.fpicker.allformatsonsave.patch
+Patch37: openoffice.org-3.1.0.ooo98137.filter.redeclared-variables.patch
+Patch38: workspace.cmcfixes54.patch
+Patch39: openoffice.org-2.2.0.gccXXXXX.solenv.javaregistration.patch
+Patch40: workspace.fwk103.patch
+Patch41: workspace.hb18.patch
+Patch42: openoffice.org-3.1.0.oooXXXXX.gcc44.buildfixes.patch
+Patch43: workspace.vcl100.patch
+Patch44: workspace.xmergeclean.patch
+Patch45: workspace.mba32issues02.patch
+Patch46: workspace.impress169.patch
+Patch47: workspace.os130.patch
+Patch48: openoffice.org-3.1.0.ooo99541.sw.reopen.flat.addrbooks.patch
+Patch49: openoffice.org-3.1.0.oooXXXXX.solenv.allowmissing.patch
+Patch50: workspace.cmcfixes57.patch
+Patch51: openoffice.org-3.1.0.ooo100273.fix-utf8-hyphenation.patch
+Patch52: ooo-build.ooo2497.filter.svg.patch
+Patch53: workspace.hb32bugs01.patch
+Patch54: openoffice.org-3.1.0.ooo61927.sw.ww6.unicodefontencoding.patch
+Patch55: workspace.impress171.patch
+Patch56: workspace.vcl101.patch
+Patch57: workspace.slideshow1.patch
+Patch58: openoffice.org-3.1.0.ooo90439.sfx2.qstart.hackaround.patch
+Patch59: openoffice.org-3.1.0.ooo101274.opening-a-directory.patch
+Patch60: openoffice.org-3.1.0.ooo101354.filter.xhtml.do-not-label-list-headers.patch
+Patch61: openoffice.org-3.1.0.ooo101355.filter.no-variables-in-keys.patch
+Patch62: workspace.vcl104.patch
+Patch63: workspace.evoab2def.patch
+Patch64: workspace.cmcfixes59.patch
+Patch65: workspace.impress174.patch
+Patch66: openoffice.org-3.1.0.ooo101567.i18npool.mailocaledata.patch
+Patch67: workspace.unifypaper01.patch
+Patch68: openoffice.org-3.1.0.ooo102061.sc.cellanchoring.patch
+Patch69: openoffice.org-3.1.0.ooo102142.sd.resleak.patch
+Patch70: workspace.calc51.patch
+Patch71: openoffice.org-2.0.0.ooo46270.svx.search-dialog.no-find-all-in-draw.patch
+Patch72: workspace.locales32.patch
+Patch73: workspace.cmcfixes60.patch
+Patch74: workspace.dr72.patch
+Patch75: workspace.vcl103.patch
+Patch76: workspace.cmcfixes61.patch
+Patch77: workspace.os132.patch
+Patch78: workspace.cmcfixes62.patch
+Patch79: openoffice.org-3.1.0.ooo104280.xmloff.lcl_IsAtEnd.wrong.patch
 Patch80: openoffice.org-3.1.1.ooo104329.dbaccess.primarykeys.patch
 Patch81: workspace.os131.patch
 Patch82: workspace.vcl102.patch
+Patch83: openoffice.org-3.1.1.ooo104157.svx.crashonencryptparse.patch
 
 %define python_py_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")
 %define instdir %{_libdir}
@@ -1599,8 +1600,8 @@ cat %{PATCH11} >> svtools/source/dialogs
 %endif
 %patch12 -p1 -b .ooo74188.sw.cursorinsideglyph.patch
 %patch13 -p0 -b .ooo68717.gstreamer.video.patch
-%patch14 -p1 -b .ooo63159.sal.dtype.patch
-%patch15 -p1 -b .ooo76393.sal.dynamicsection.patch
+%patch14 -p1 -b .workspace.kso32fixes.patch
+%patch15 -p1 -b .workspace.sb113.patch
 %patch16 -p1 -b .ooo7065.sw.titlepagedialog.patch
 %patch17 -p1 -b .ooo76649.httpencoding.patch
 %patch18 -p1 -b .ooo83878.unopkg.enablelinking.patch
@@ -1620,54 +1621,55 @@ cat %{PATCH11} >> svtools/source/dialogs
 %patch32 -p1
 %patch33 -p0 -b .workspace.transogl03redux.patch
 %patch34 -p1 -b .oooXXXXX.extensions.npapi.patch
-%patch35 -p1 -b .workspace.sb109.patch
-%patch36 -p1 -b .ooo97488.sw.ww8toc.patch
-%patch37 -p1 -b .oooXXXXX.fpicker.allformatsonsave.patch
-%patch38 -p0 -b .ooo98137.filter.redeclared-variables.patch
-%patch39 -p1 -b .workspace.cmcfixes54.patch
-%patch40 -p1 -b .gccXXXXX.solenv.javaregistration.patch
-%patch41 -p1 -b .workspace.fwk103.patch
-%patch42 -p0 -b .workspace.hb18.patch
-%patch43 -p1 -b .oooXXXXX.gcc44.buildfixes.patch
-%patch44 -p0 -b .ooo99250.sc.autooutline-reflists.patch
-%patch45 -p0 -b .workspace.vcl100.patch
-%patch46 -p0 -b .workspace.xmergeclean.patch
-%patch47 -p0 -b .workspace.mba32issues02.patch
-%patch48 -p0 -b .workspace.impress169.patch
-%patch49 -p0 -b .workspace.os130.patch
-%patch50 -p0 -b .ooo99541.sw.reopen.flat.addrbooks.patch
-%patch51 -p1 -b .oooXXXXX.solenv.allowmissing.patch
-%patch52 -p0 -b .workspace.cmcfixes57.patch
-%patch53 -p0 -b .ooo100273.fix-utf8-hyphenation.patch
-%patch54 -p1 -b .ooo2497.filter.svg.patch
-%patch55 -p0 -b .ooo100353.svx.rtfbrackets.patch
-%patch56 -p1 -b .ooo61927.sw.ww6.unicodefontencoding.patch
-%patch57 -p1 -b .ooo101074.sd.bad.nothrow.patch
-%patch58 -p1 -b .workspace.vcl101.patch
-%patch59 -p2 -b .workspace.slideshow1.patch
-%patch60 -p0 -b .ooo90439.sfx2.qstart.hackaround.patch
-%patch61 -p0 -b .ooo101274.opening-a-directory.patch
-%patch62 -p0 -b .ooo101354.filter.xhtml.do-not-label-list-headers.patch
-%patch63 -p0 -b .ooo101355.filter.no-variables-in-keys.patch
-%patch64 -p0 -b .ooo101379.vcl.qstart.SM.patch
-%patch65 -p0 -b .ooo101439.connectivity.evodupl.patch
-%patch66 -p0 -b .ooo100469.sal.ia64_arm.patch
-%patch67 -p0 -b .ooo101566.svtools.nodefaultwmfwidth.patch
-%patch68 -p0 -b .ooo101567.i18npool.mailocaledata.patch
-%patch69 -p0 -b .ooo102566.sc.less.frenetic.progress.patch
-%patch70 -p0 -b .workspace.pdfextfix02.patch
-%patch71 -p0 -b .ooo102920.i18npool.utf16bustage.patch
-%patch72 -p0 -b .workspace.aw073.patch
-%patch73 -p0 -b .ooo102932.sw.mailmerge.busted-integer-conversion.patch
-%patch74 -p0 -b .ooo103277.vcl.kwinworkaround.patch
-%patch75 -p0 -b .workspace.calc311fixes.patch
-%patch76 -p0 -b .oooXXXXX.svx.64bit.patch
-%patch77 -p0 -b .ooo103651.canvas.nosubpixel.patch
-%patch78 -p0 -b .workspace.os132.patch
-%patch79 -p0 -b .ooo104306.moverecentlyused.patch
+%patch35 -p1 -b .ooo97488.sw.ww8toc.patch
+%patch36 -p1 -b .oooXXXXX.fpicker.allformatsonsave.patch
+%patch37 -p0 -b .ooo98137.filter.redeclared-variables.patch
+%patch38 -p1 -b .workspace.cmcfixes54.patch
+%patch39 -p1 -b .gccXXXXX.solenv.javaregistration.patch
+%patch40 -p1 -b .workspace.fwk103.patch
+%patch41 -p0 -b .workspace.hb18.patch
+%patch42 -p1 -b .oooXXXXX.gcc44.buildfixes.patch
+%patch43 -p0 -b .workspace.vcl100.patch
+%patch44 -p0 -b .workspace.xmergeclean.patch
+%patch45 -p0 -b .workspace.mba32issues02.patch
+%patch46 -p0 -b .workspace.impress169.patch
+%patch47 -p0 -b .workspace.os130.patch
+%patch48 -p0 -b .ooo99541.sw.reopen.flat.addrbooks.patch
+%patch49 -p1 -b .oooXXXXX.solenv.allowmissing.patch
+%patch50 -p0 -b .workspace.cmcfixes57.patch
+%patch51 -p0 -b .ooo100273.fix-utf8-hyphenation.patch
+%patch52 -p1 -b .ooo2497.filter.svg.patch
+%patch53 -p0 -b .workspace.hb32bugs01.patch
+%patch54 -p1 -b .ooo61927.sw.ww6.unicodefontencoding.patch
+%patch55 -p1 -b .workspace.impress171.patch
+%patch56 -p1 -b .workspace.vcl101.patch
+%patch57 -p2 -b .workspace.slideshow1.patch
+%patch58 -p0 -b .ooo90439.sfx2.qstart.hackaround.patch
+%patch59 -p0 -b .ooo101274.opening-a-directory.patch
+%patch60 -p0 -b .ooo101354.filter.xhtml.do-not-label-list-headers.patch
+%patch61 -p0 -b .ooo101355.filter.no-variables-in-keys.patch
+%patch62 -p0 -b .workspace.vcl104.patch
+%patch63 -p0 -b .workspace.evoab2def.patch
+%patch64 -p0 -b .workspace.cmcfixes59.patch
+%patch65 -p0 -b .workspace.impress174.patch
+%patch66 -p0 -b .ooo101567.i18npool.mailocaledata.patch
+%patch67 -p1
+%patch68 -p0 -b .ooo102061.sc.cellanchoring.patch
+%patch69 -p0 -b .ooo102142.sd.resleak.patch
+%patch70 -p0 -b .workspace.calc51.patch
+%patch71 -p0 -b .ooo46270.svx.search-dialog.no-find-all-in-draw.patch
+%patch72 -p0 -b .workspace.locales32.patch
+%patch73 -p0 -b .workspace.cmcfixes60.patch
+%patch74 -p0 -b .workspace.dr72.patch
+%patch75 -p0 -b .workspace.vcl103.patch
+%patch76 -p0 -b .workspace.cmcfixes61.patch
+%patch77 -p0 -b .workspace.os132.patch
+%patch78 -p0 -b .workspace.cmcfixes62.patch
+%patch79 -p0 -b .ooo104280.xmloff.lcl_IsAtEnd.wrong.patch
 %patch80 -p0 -b .ooo104329.dbaccess.primarykeys.patch
 %patch81 -p0 -b .workspace.os131.patch
 %patch82 -p0 -b .workspace.vcl102.patch
+%patch83 -p0 -b .ooo104157.svx.crashonencryptparse.patch
 
 %build
 echo build start time is `date`, diskspace: `df -h . | tail -n 1`
@@ -4170,13 +4172,16 @@ fi
     unopkg list --shared > /dev/null 2>&1 || :
 
 %changelog
-* Wed Aug 26 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.1.0-11.6-UNBUILT
+* Fri Aug 28 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.1.1-19.1
+- update to 3.1.1
 - Resolves: rhbz#512355 add openoffice.org-3.1.0.ooo103651.canvas.nosubpixel.patc
 - add workspace.os132.patch to avoid switch html view overwrite horror
 - Resolves: rhbz#517843 add openoffice.org-3.1.1.ooo104306.moverecentlyused.patch
 - Resolves: rhbz#514683 add openoffice.org-3.1.1.ooo104329.dbaccess.primarykeys.patch
-- Resolves: rbhz#501141 Images and Frames disappear in sequential
-  printing
+- Resolves: rbhz#501141 Images and Frames disappear in sequential printing
+- backport workspace.vcl102.patch to fix xdg support
+- add workspace.cmcfixes62.patch for 64bit odbc goodness and rebuild
+  against now 64bit-safe unixODBC headers
 
 * Thu Jul 09 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.1.0-11.5
 - Resolves: rhbz#506984 openoffice.org-3.1.0.ooo103277.vcl.kwinworkaround.patch


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/F-11/sources,v
retrieving revision 1.362
retrieving revision 1.363
diff -u -p -r1.362 -r1.363
--- sources	24 Apr 2009 15:10:52 -0000	1.362
+++ sources	28 Aug 2009 09:43:31 -0000	1.363
@@ -7,4 +7,4 @@ eaf47e2e3d3586f6156c61379cc34df9  redhat
 f501a4d62ed251d360ea6c544177a94f  redhat-registry.tar.gz
 6c28507e29056a3afb4baffdadab8499  openoffice.org-javafilter.desktop
 7d7eb194a61b3b1c59e3c82da889ac27  or-IN_DEV300_m40.sdf
-5c2ea75bb826f5d807d74e176b7048ec  OOO310_m11.tar.bz2
+e95de733b1ac6e885515ee8bcca87998  OOO310_m19.tar.bz2


--- openoffice.org-2.2.0.ooo63159.sal.dtype.patch DELETED ---


--- openoffice.org-2.2.0.ooo76393.sal.dynamicsection.patch DELETED ---


--- openoffice.org-3.0.0.ooo88033.svx.a11ycrash.patch DELETED ---


--- openoffice.org-3.1.0.ooo100353.svx.rtfbrackets.patch DELETED ---


--- openoffice.org-3.1.0.ooo100469.sal.ia64_arm.patch DELETED ---


--- openoffice.org-3.1.0.ooo101074.sd.bad.nothrow.patch DELETED ---


--- openoffice.org-3.1.0.ooo101105.sw.reorder.boundscheck.patch DELETED ---


--- openoffice.org-3.1.0.ooo101379.vcl.qstart.SM.patch DELETED ---


--- openoffice.org-3.1.0.ooo101439.connectivity.evodupl.patch DELETED ---


--- openoffice.org-3.1.0.ooo101566.svtools.nodefaultwmfwidth.patch DELETED ---


--- openoffice.org-3.1.0.ooo102566.sc.less.frenetic.progress.patch DELETED ---


--- openoffice.org-3.1.0.ooo102920.i18npool.utf16bustage.patch DELETED ---


--- openoffice.org-3.1.0.ooo103277.vcl.kwinworkaround.patch DELETED ---


--- openoffice.org-3.1.0.ooo103651.canvas.nosubpixel.patch DELETED ---


--- openoffice.org-3.1.0.ooo99250.sc.autooutline-reflists.patch DELETED ---


--- openoffice.org-3.1.0.oooXXXXX.svx.64bit.patch DELETED ---


--- openoffice.org-3.1.1.ooo102932.sw.mailmerge.busted-integer-conversion.patch DELETED ---


--- openoffice.org-3.1.1.ooo104306.moverecentlyused.patch DELETED ---


--- planned.workspace.defaultdoclang.patch DELETED ---


--- workspace.aw073.patch DELETED ---


--- workspace.calc311fixes.patch DELETED ---


--- workspace.pdfextfix02.patch DELETED ---


--- workspace.sb109.patch DELETED ---




More information about the fedora-extras-commits mailing list