You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2012/10/12 23:29:49 UTC

svn commit: r1397728 [8/10] - in /incubator/ooo/branches/buildsys: ./ ext_sources/ extras/l10n/source/da/ extras/l10n/source/gd/ extras/l10n/source/pl/ main/ main/basctl/source/basicide/ main/basegfx/inc/basegfx/pixel/ main/basegfx/inc/basegfx/point/ m...

Modified: incubator/ooo/branches/buildsys/main/sc/inc/drwlayer.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/inc/drwlayer.hxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/inc/drwlayer.hxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/inc/drwlayer.hxx Fri Oct 12 21:29:36 2012
@@ -101,6 +101,7 @@ private:
 	sal_Bool			bRecording;
 	sal_Bool			bAdjustEnabled;
 	sal_Bool			bHyphenatorSet;
+    bool            mbUndoAllowed;
 
 private:
 	void			MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, const Point& rMove,
@@ -150,6 +151,21 @@ public:
 	sal_Bool			IsRecording() const			{ return bRecording; }
 	void			AddCalcUndo( SdrUndoAction* pUndo );
 
+    template< typename TUndoAction, typename TArg >
+    inline void			AddCalcUndo( const TArg & rArg )    {   if( this->IsUndoAllowed() )  this->AddCalcUndo( new TUndoAction( rArg ) ); }
+
+    template< typename TUndoAction, typename TArg >
+    inline void			AddCalcUndo( TArg & rArg )    {   if( this->IsUndoAllowed() )  this->AddCalcUndo( new TUndoAction( rArg ) ); }
+	
+    template< typename TUndoAction, typename TArg1, typename TArg2 >
+    inline void			AddCalcUndo( TArg1 & rArg1, TArg2 & rArg2 ) {   if( this->IsUndoAllowed() )  this->AddCalcUndo( new TUndoAction( rArg1, rArg2 ) ); }
+
+    template< typename TUndoAction, typename TArg1, typename TArg2 >
+    inline void			AddCalcUndo( const TArg1 & rArg1, const TArg2 & rArg2 ) {   if( this->IsUndoAllowed() )  this->AddCalcUndo( new TUndoAction( rArg1, rArg2 ) ); }
+
+    template< typename TUndoAction, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5 >
+    inline void			AddCalcUndo( const TArg1 & rArg1, const TArg2 & rArg2, const TArg3 & rArg3, const TArg4 & rArg4, const TArg5 & rArg5 )    {   if( this->IsUndoAllowed() )  this->AddCalcUndo( new TUndoAction( rArg1, rArg2, rArg3, rArg4, rArg5 ) ); }
+
 	void			MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
 								SCsCOL nDx,SCsROW nDy, sal_Bool bInsDel, bool bUpdateNoteCaptionPos = true );
 	void			WidthChanged( SCTAB nTab, SCCOL nCol, long nDifTwips );
@@ -221,6 +237,9 @@ public:
 	static void		SetGlobalDrawPersist(SfxObjectShell* pPersist);
 protected:
 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
+public:
+    inline void SetUndoAllowed( bool bUndoAllowed ){ mbUndoAllowed = bUndoAllowed; }
+    inline bool IsUndoAllowed() const{ return mbUndoAllowed; }
 };
 
 

Modified: incubator/ooo/branches/buildsys/main/sc/inc/helpids.h
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/inc/helpids.h?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/inc/helpids.h (original)
+++ incubator/ooo/branches/buildsys/main/sc/inc/helpids.h Fri Oct 12 21:29:36 2012
@@ -687,6 +687,10 @@
 #define HID_FUNC_LINKS                                          "SC_HID_FUNC_LINKS"
 #define HID_FUNC_RECHTS                                         "SC_HID_FUNC_RECHTS"
 #define HID_FUNC_TEIL                                           "SC_HID_FUNC_TEIL"
+#define HID_FUNC_LENB                                           "SC_HID_FUNC_LENB"
+#define HID_FUNC_RIGHTB                                         "SC_HID_FUNC_RIGHTB"
+#define HID_FUNC_LEFTB                                          "SC_HID_FUNC_LEFTB"
+#define HID_FUNC_MIDB                                           "SC_HID_FUNC_MIDB"
 #define HID_FUNC_WIEDERHOLEN                                    "SC_HID_FUNC_WIEDERHOLEN"
 #define HID_FUNC_WECHSELN                                       "SC_HID_FUNC_WECHSELN"
 #define HID_FUNC_BASIS                                          "SC_HID_FUNC_BASIS"
@@ -699,3 +703,4 @@
 #define HID_FUNC_UNICODE                                        "SC_HID_FUNC_UNICODE"
 #define HID_FUNC_UNICHAR                                        "SC_HID_FUNC_UNICHAR"
 #define HID_FUNC_NUMBERVALUE                                    "SC_HID_FUNC_NUMBERVALUE"
+

Modified: incubator/ooo/branches/buildsys/main/sc/inc/table.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/inc/table.hxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/inc/table.hxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/inc/table.hxx Fri Oct 12 21:29:36 2012
@@ -418,6 +418,10 @@ public:
 	sal_Bool		GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol,
 								SCROW& rEndRow, sal_Bool bNotes ) const;
 
+	/*
+	Get the last cell's postion, which has visual attribute or data and has max row number among all columns.
+	*/
+	void		GetLastAttrCell( SCCOL& rEndCol, SCROW& rEndRow ) const;
 	sal_Bool		GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const;
 
 	void		ExtendPrintArea( OutputDevice* pDev,
@@ -624,6 +628,7 @@ public:
 									const Fraction& rZoomX, const Fraction& rZoomY,
 									sal_Bool bWidth, sal_Bool bTotalSize );
 	void		SetColWidth( SCCOL nCol, sal_uInt16 nNewWidth );
+	void		SetColWidthOnly( SCCOL nCol, sal_uInt16 nNewWidth );
 	void		SetRowHeight( SCROW nRow, sal_uInt16 nNewHeight );
 	sal_Bool		SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight,
 									double nPPTX, double nPPTY );

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/attarray.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/attarray.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/attarray.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/attarray.cxx Fri Oct 12 21:29:36 2012
@@ -1920,6 +1920,30 @@ sal_Bool ScAttrArray::GetLastVisibleAttr
     return bFound;
 }
 
+sal_Bool ScAttrArray::GetLastAttr( SCROW& rLastRow, SCROW nLastData ) const
+{
+    if ( nLastData == MAXROW )
+    {
+        rLastRow = MAXROW;
+        return sal_True;
+    }
+	sal_Bool bFound = sal_False;
+    SCSIZE nEndPos = nCount - 1;
+    SCSIZE nStartPos = nEndPos;
+    while ( nStartPos > 0 && pData[nStartPos-1].nRow > nLastData &&
+            !pData[nStartPos].pPattern->IsVisible() )
+        --nStartPos;
+	
+	if(nStartPos >= 0 && pData[nStartPos].nRow > nLastData)
+	{
+		bFound = sal_True;
+		rLastRow = pData[nStartPos].nRow;
+	}
+	else
+		rLastRow = nLastData;
+    return bFound;
+}
+
 
 sal_Bool ScAttrArray::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const
 {

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/column2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/column2.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/column2.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/column2.cxx Fri Oct 12 21:29:36 2012
@@ -1564,6 +1564,19 @@ sal_Bool ScColumn::GetLastVisibleAttr( S
         return sal_False;
 }
 
+sal_Bool ScColumn::GetLastAttr( SCROW& rLastRow ) const
+{
+    if ( pAttrArray )
+    {
+        // Row of last cell is needed, always including notes, 0 if none.
+        SCROW nLastData = GetLastVisDataPos( sal_True );
+        return pAttrArray->GetLastAttr( rLastRow, nLastData );
+    }
+    else
+    {
+        return sal_False;
+    }
+}
 sal_Bool ScColumn::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const
 {
 	if (pAttrArray)

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/documen2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/documen2.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/documen2.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/documen2.cxx Fri Oct 12 21:29:36 2012
@@ -188,6 +188,7 @@ ScDocument::ScDocument( ScDocumentMode	e
 		bInsertingFromOtherDoc( sal_False ),
         bLoadingMedium( false ),
 		bImportingXML( false ),
+        mbImportingMSXML( false ),
         bXMLFromWrapper( sal_False ),
 		bCalcingAfterLoad( sal_False ),
 		bNoListening( sal_False ),

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/documen4.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/documen4.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/documen4.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/documen4.cxx Fri Oct 12 21:29:36 2012
@@ -417,6 +417,14 @@ void ScDocument::InvalidateTableArea()
 	}
 }
 
+void ScDocument::GetLastAttrCell( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const
+{
+	if ( ValidTab( nTab ) && pTab[nTab] )
+	{
+		pTab[nTab]->GetLastAttrCell( rEndCol, rEndRow );
+	}
+}
+
 sal_Int32 ScDocument::GetMaxStringLen( SCTAB nTab, SCCOL nCol,
         SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const
 {

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/documen9.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/documen9.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/documen9.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/documen9.cxx Fri Oct 12 21:29:36 2012
@@ -131,7 +131,7 @@ void ScDocument::TransferDrawPage(ScDocu
                     pNewPage->InsertObject( pNewObject );
 
                     if (pDrawLayer->IsRecording())
-                        pDrawLayer->AddCalcUndo( new SdrUndoInsertObj( *pNewObject ) );
+			pDrawLayer->AddCalcUndo< SdrUndoInsertObj >( *pNewObject );
                 }
 
 				pOldObject = aIter.Next();
@@ -197,6 +197,9 @@ void ScDocument::InitDrawLayer( SfxObjec
 		if (bImportingXML)
 			pDrawLayer->EnableAdjust(sal_False);
 
+		if( IsImportingMSXML( ) )
+			pDrawLayer->SetUndoAllowed( false );
+
 		pDrawLayer->SetForbiddenCharsTable( xForbiddenCharacters );
 		pDrawLayer->SetCharCompressType( GetAsianCompression() );
 		pDrawLayer->SetKernAsianPunctuation( GetAsianKerning() );
@@ -768,6 +771,14 @@ void ScDocument::SetImportingXML( bool b
     SetLoadingMedium(bVal);
 }
 
+void ScDocument::SetImportingMSXML( bool bVal )
+{
+    mbImportingMSXML = bVal;
+
+    if (pDrawLayer)
+        pDrawLayer->SetUndoAllowed( !mbImportingMSXML );
+}
+
 void ScDocument::SetXMLFromWrapper( sal_Bool bVal )
 {
     bXMLFromWrapper = bVal;

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/document.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/document.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/document.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/document.cxx Fri Oct 12 21:29:36 2012
@@ -3165,6 +3165,11 @@ void ScDocument::SetColWidth( SCCOL nCol
 		pTab[nTab]->SetColWidth( nCol, nNewWidth );
 }
 
+void ScDocument::SetColWidthOnly( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth )
+{
+	if ( ValidTab(nTab) && pTab[nTab] )
+		pTab[nTab]->SetColWidthOnly( nCol, nNewWidth );
+}
 
 void ScDocument::SetRowHeight( SCROW nRow, SCTAB nTab, sal_uInt16 nNewHeight )
 {

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/drwlayer.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/drwlayer.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/drwlayer.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/drwlayer.cxx Fri Oct 12 21:29:36 2012
@@ -213,7 +213,8 @@ ScDrawLayer::ScDrawLayer( ScDocument* pD
 	pUndoGroup( NULL ),
 	bRecording( sal_False ),
 	bAdjustEnabled( sal_True ),
-	bHyphenatorSet( sal_False )
+	bHyphenatorSet( sal_False ),
+        mbUndoAllowed( sal_True )
 {
 	pGlobalDrawPersist = NULL;			// nur einmal benutzen
 
@@ -379,7 +380,7 @@ sal_Bool ScDrawLayer::ScAddPage( SCTAB n
 	ScDrawPage* pPage = (ScDrawPage*)AllocPage( sal_False );
 	InsertPage(pPage, static_cast<sal_uInt16>(nTab));
 	if (bRecording)
-		AddCalcUndo(new SdrUndoNewPage(*pPage));
+	        AddCalcUndo< SdrUndoNewPage >(*pPage);
 
     return sal_True;        // inserted
 }
@@ -393,7 +394,7 @@ void ScDrawLayer::ScRemovePage( SCTAB nT
 	if (bRecording)
 	{
 		SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
-		AddCalcUndo(new SdrUndoDelPage(*pPage));		// Undo-Action wird Owner der Page
+        AddCalcUndo< SdrUndoDelPage >(*pPage);		// Undo-Action wird Owner der Page
 		RemovePage( static_cast<sal_uInt16>(nTab) );							// nur austragen, nicht loeschen
 	}
 	else
@@ -442,7 +443,7 @@ void ScDrawLayer::ScCopyPage( sal_uInt16
                 pNewObject->NbcMove(Size(0,0));
                 pNewPage->InsertObject( pNewObject );
                 if (bRecording)
-                    AddCalcUndo( new SdrUndoInsertObj( *pNewObject ) );
+	                AddCalcUndo< SdrUndoInsertObj >( *pNewObject );
             }
 
 			pOldObject = aIter.Next();
@@ -495,7 +496,7 @@ void ScDrawLayer::MoveCells( SCTAB nTab,
 			{
 				if ( pObj->ISA( SdrRectObj ) && pData->maStart.IsValid() && pData->maEnd.IsValid() )
                     pData->maStart.PutInOrder( pData->maEnd );
-				AddCalcUndo( new ScUndoObjData( pObj, aOldStt, aOldEnd, pData->maStart, pData->maEnd ) );
+                AddCalcUndo< ScUndoObjData >( pObj, aOldStt, aOldEnd, pData->maStart, pData->maEnd );				
                 RecalcPos( pObj, *pData, bNegativePage, bUpdateNoteCaptionPos );
 			}
 		}
@@ -588,7 +589,7 @@ void ScDrawLayer::RecalcPos( SdrObject* 
 		if ( pObj->GetLogicRect() != aRect )
 		{
 			if (bRecording)
-				AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+		                AddCalcUndo<SdrUndoGeoObj>( *pObj );
 			pObj->SetLogicRect(aRect);
 		}
 	}
@@ -613,7 +614,7 @@ void ScDrawLayer::RecalcPos( SdrObject* 
 			if ( pObj->GetPoint( 0 ) != aStartPos )
 			{
 				if (bRecording)
-					AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+		                    AddCalcUndo< SdrUndoGeoObj> ( *pObj );
 				pObj->SetPoint( aStartPos, 0 );
 			}
 
@@ -627,7 +628,7 @@ void ScDrawLayer::RecalcPos( SdrObject* 
 				if ( pObj->GetPoint( 1 ) != aEndPos )
 				{
 					if (bRecording)
-						AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+		                        AddCalcUndo< SdrUndoGeoObj >( *pObj );
 					pObj->SetPoint( aEndPos, 1 );
 				}
 			}
@@ -647,7 +648,7 @@ void ScDrawLayer::RecalcPos( SdrObject* 
 			if ( pObj->GetPoint( 1 ) != aEndPos )
 			{
 				if (bRecording)
-					AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+		                    AddCalcUndo< SdrUndoGeoObj> ( *pObj  );
 				pObj->SetPoint( aEndPos, 1 );
 			}
 
@@ -663,7 +664,7 @@ void ScDrawLayer::RecalcPos( SdrObject* 
 				if ( pObj->GetPoint( 0 ) != aStartPos )
 				{
 					if (bRecording)
-						AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+			                        AddCalcUndo< SdrUndoGeoObj >( *pObj );
 					pObj->SetPoint( aStartPos, 0 );
 				}
 			}
@@ -688,7 +689,7 @@ void ScDrawLayer::RecalcPos( SdrObject* 
 			if ( pObj->GetLogicRect() != aNew )
 			{
 				if (bRecording)
-					AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+		                    AddCalcUndo< SdrUndoGeoObj >( *pObj );
 				pObj->SetLogicRect(aNew);
 			}
 		}
@@ -699,7 +700,7 @@ void ScDrawLayer::RecalcPos( SdrObject* 
 			if ( pObj->GetRelativePos() != aPos )
 			{
 				if (bRecording)
-					AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+		                    AddCalcUndo< SdrUndoGeoObj >( *pObj );
 				pObj->SetRelativePos( aPos );
 			}
 		}
@@ -948,7 +949,7 @@ void ScDrawLayer::MoveAreaTwips( SCTAB n
 					}
 					if( bMoved )
 					{
-						AddCalcUndo( new SdrUndoGeoObj( *pObject ) );
+			                        AddCalcUndo< SdrUndoGeoObj >( *pObject );						
 						lcl_TwipsToMM( aPoint );
 						pObject->SetPoint( aPoint, i );
 					}
@@ -1002,7 +1003,7 @@ void ScDrawLayer::MoveAreaTwips( SCTAB n
 					lcl_TwipsToMM( aNewPos );
 					aMoveSize = Size( aNewPos.X() - aOldMMPos.X(), aNewPos.Y() - aOldMMPos.Y() );	// millimeters
 
-					AddCalcUndo( new SdrUndoMoveObj( *pObject, aMoveSize ) );
+			                    AddCalcUndo< SdrUndoMoveObj >( *pObject, aMoveSize );
 					pObject->Move( aMoveSize );
 				}
 				else if ( rArea.IsInside( bNegativePage ? aObjRect.BottomLeft() : aObjRect.BottomRight() ) &&
@@ -1010,7 +1011,7 @@ void ScDrawLayer::MoveAreaTwips( SCTAB n
 				{
 					//	geschuetzte Groessen werden nicht veraendert
 					//	(Positionen schon, weil sie ja an der Zelle "verankert" sind)
-					AddCalcUndo( new SdrUndoGeoObj( *pObject ) );
+		                    AddCalcUndo< 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
@@ -1235,7 +1236,7 @@ void ScDrawLayer::DeleteObjects( SCTAB n
 		long i;
 		if (bRecording)
 			for (i=1; i<=nDelCount; i++)
-				AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) );
+		                AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
 
 		for (i=1; i<=nDelCount; i++)
 			pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
@@ -1286,7 +1287,7 @@ void ScDrawLayer::DeleteObjectsInArea( S
 		long i;
 		if (bRecording)
 			for (i=1; i<=nDelCount; i++)
-				AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) );
+		                AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
 
 		for (i=1; i<=nDelCount; i++)
 			pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
@@ -1351,7 +1352,7 @@ void ScDrawLayer::DeleteObjectsInSelecti
 					long i;
 					if (bRecording)
 						for (i=1; i<=nDelCount; i++)
-							AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) );
+			                            AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
 
 					for (i=1; i<=nDelCount; i++)
 						pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
@@ -1582,7 +1583,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLa
 
 			pDestPage->InsertObject( pNewObject );
 			if (bRecording)
-				AddCalcUndo( new SdrUndoInsertObj( *pNewObject ) );
+		                AddCalcUndo< SdrUndoInsertObj >( *pNewObject );
 
 			//#i110034#	handle chart data references (after InsertObject)
 
@@ -1692,7 +1693,7 @@ void ScDrawLayer::MirrorRTL( SdrObject* 
 		Point aRef1( 0, 0 );
 		Point aRef2( 0, 1 );
 		if (bRecording)
-			AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+		            AddCalcUndo< SdrUndoGeoObj >( *pObj );
 		pObj->Mirror( aRef1, aRef2 );
 	}
 	else
@@ -1703,7 +1704,7 @@ void ScDrawLayer::MirrorRTL( SdrObject* 
 		Rectangle aObjRect = pObj->GetLogicRect();
 		Size aMoveSize( -(aObjRect.Left() + aObjRect.Right()), 0 );
 		if (bRecording)
-			AddCalcUndo( new SdrUndoMoveObj( *pObj, aMoveSize ) );
+		            AddCalcUndo< SdrUndoMoveObj >( *pObj, aMoveSize );
 		pObj->Move( aMoveSize );
 	}
 }

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/postit.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/postit.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/postit.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/postit.cxx Fri Oct 12 21:29:36 2012
@@ -347,8 +347,11 @@ void ScCaptionCreator::UpdateCaptionPos(
     if( rOldTailPos != aTailPos )
     {
         // create drawing undo action
-        if( pDrawLayer && pDrawLayer->IsRecording() )
-            pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoGeoObject( *mpCaption ) );
+        if( pDrawLayer )
+            if( pDrawLayer->IsUndoAllowed() )
+                if( pDrawLayer->IsRecording() )
+                    pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoGeoObject( *mpCaption ) );
+
         // calculate new caption rectangle (#i98141# handle LTR<->RTL switch correctly)
         Rectangle aCaptRect = mpCaption->GetLogicRect();
         long nDiffX = (rOldTailPos.X() >= 0) ? (aCaptRect.Left() - rOldTailPos.X()) : (rOldTailPos.X() - aCaptRect.Right());
@@ -368,7 +371,7 @@ void ScCaptionCreator::UpdateCaptionPos(
     {
         // create drawing undo action
         if( pDrawLayer && pDrawLayer->IsRecording() )
-            pDrawLayer->AddCalcUndo( new ScUndoObjData( mpCaption, pCaptData->maStart, pCaptData->maEnd, maPos, pCaptData->maEnd ) );
+            pDrawLayer->AddCalcUndo< ScUndoObjData >(mpCaption, pCaptData->maStart, pCaptData->maEnd, maPos, pCaptData->maEnd );
         // set new position
         pCaptData->maStart = maPos;
     }
@@ -737,8 +740,9 @@ void ScPostIt::CreateCaption( const ScAd
 
         // create undo action
         if( ScDrawLayer* pDrawLayer = mrDoc.GetDrawLayer() )
-            if( pDrawLayer->IsRecording() )
-                pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoNewObject( *maNoteData.mpCaption ) );
+                if( pDrawLayer->IsUndoAllowed() )
+                    if( pDrawLayer->IsRecording() )
+                        pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoNewObject( *maNoteData.mpCaption ) );
     }
 }
 
@@ -758,7 +762,7 @@ void ScPostIt::RemoveCaption()
         {
             pDrawPage->RecalcObjOrdNums();
             // create drawing undo action (before removing the object to have valid draw page in undo action)
-            bool bRecording = ( pDrawLayer && pDrawLayer->IsRecording() );
+            bool bRecording = ( pDrawLayer && pDrawLayer->IsUndoAllowed() && pDrawLayer->IsRecording() );
             if( bRecording )
                 pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoDeleteObject( *maNoteData.mpCaption ) );
             // remove the object from the drawing page, delete if undo is disabled

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/table1.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/table1.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/table1.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/table1.cxx Fri Oct 12 21:29:36 2012
@@ -432,6 +432,24 @@ sal_Bool ScTable::GetTableArea( SCCOL& r
 	return bRet;
 }
 
+void ScTable::GetLastAttrCell( SCCOL& rEndCol, SCROW& rEndRow ) const
+{
+	SCCOL nMaxX = 0;
+	SCROW nMaxY = 0;
+	SCCOL i;
+	for ( i = 0; i <= MAXCOL; i++ )
+	{
+		SCROW nLastRow;
+		aCol[i].GetLastAttr( nLastRow );
+		if ( nLastRow > nMaxY && nLastRow > 0 && nLastRow <= MAXROW )
+		{
+			nMaxY = nLastRow;
+			nMaxX = i;
+		}
+	}
+	rEndCol = nMaxX;
+	rEndRow = nMaxY;
+}
 /*		vorher:
 
 	sal_Bool bFound = sal_False;

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/data/table2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/data/table2.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/data/table2.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/data/table2.cxx Fri Oct 12 21:29:36 2012
@@ -2340,6 +2340,16 @@ void ScTable::SetRowHeightOnly( SCROW nS
     mpRowHeights->setValue(nStartRow, nEndRow, nNewHeight);
 }
 
+void ScTable::SetColWidthOnly( SCCOL nCol, sal_uInt16 nNewWidth )
+{
+	if (!VALIDCOL(nCol) || !pColWidth)
+        return;
+
+    if (!nNewWidth)
+        nNewWidth = STD_COL_WIDTH;
+
+    pColWidth[nCol] = nNewWidth;
+}
 void ScTable::SetManualHeight( SCROW nStartRow, SCROW nEndRow, sal_Bool bManual )
 {
 	if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && pRowFlags)

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/inc/interpre.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/inc/interpre.hxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/inc/interpre.hxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/inc/interpre.hxx Fri Oct 12 21:29:36 2012
@@ -787,6 +787,10 @@ void ScSTEXY();
 void ScSlope();
 void ScTrend();
 void ScInfo();
+void ScLenB();
+void ScRightB();
+void ScLeftB();
+void ScMidB();
 
 //------------------------ Functions in interpr6.cxx -------------------------
 

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/tool/detfunc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/tool/detfunc.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/tool/detfunc.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/tool/detfunc.cxx Fri Oct 12 21:29:36 2012
@@ -494,7 +494,7 @@ sal_Bool ScDetectiveFunc::InsertArrow( S
 		ScDrawLayer::SetAnchor( pBox, SCA_CELL );
 		pBox->SetLayer( SC_LAYER_INTERN );
 		pPage->InsertObject( pBox );
-		pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) );
+	        pModel->AddCalcUndo< SdrUndoInsertObj >( *pBox );
 
 		ScDrawObjData* pData = ScDrawLayer::GetObjData( pBox, sal_True );
 		pData->maStart.Set( nRefStartCol, nRefStartRow, nTab);
@@ -536,7 +536,7 @@ sal_Bool ScDetectiveFunc::InsertArrow( S
 	ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
 	pArrow->SetLayer( SC_LAYER_INTERN );
 	pPage->InsertObject( pArrow );
-	pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) );
+	    pModel->AddCalcUndo< SdrUndoInsertObj >( *pArrow );
 
 	ScDrawObjData* pData = ScDrawLayer::GetObjData( pArrow, sal_True );
 	if (bFromOtherTab)
@@ -568,7 +568,7 @@ sal_Bool ScDetectiveFunc::InsertToOtherT
 		ScDrawLayer::SetAnchor( pBox, SCA_CELL );
 		pBox->SetLayer( SC_LAYER_INTERN );
 		pPage->InsertObject( pBox );
-		pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) );
+	        pModel->AddCalcUndo< SdrUndoInsertObj >( *pBox );
 
 		ScDrawObjData* pData = ScDrawLayer::GetObjData( pBox, sal_True );
 		pData->maStart.Set( nStartCol, nStartRow, nTab);
@@ -603,7 +603,7 @@ sal_Bool ScDetectiveFunc::InsertToOtherT
 	ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
 	pArrow->SetLayer( SC_LAYER_INTERN );
 	pPage->InsertObject( pArrow );
-	pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) );
+	    pModel->AddCalcUndo< SdrUndoInsertObj >( *pArrow );
 
 	ScDrawObjData* pData = ScDrawLayer::GetObjData( pArrow, sal_True );
 	pData->maStart.Set( nStartCol, nStartRow, nTab);
@@ -672,7 +672,7 @@ void ScDetectiveFunc::DrawCircle( SCCOL 
 	ScDrawLayer::SetAnchor( pCircle, SCA_CELL );
 	pCircle->SetLayer( SC_LAYER_INTERN );
 	pPage->InsertObject( pCircle );
-	pModel->AddCalcUndo( new SdrUndoInsertObj( *pCircle ) );
+	    pModel->AddCalcUndo< SdrUndoInsertObj >( *pCircle );
 
 	ScDrawObjData* pData = ScDrawLayer::GetObjData( pCircle, sal_True );
 	pData->maStart.Set( nCol, nRow, nTab);
@@ -713,7 +713,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SC
 
 		long i;
 		for (i=1; i<=nDelCount; i++)
-			pModel->AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) );
+            pModel->AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
 
 		for (i=1; i<=nDelCount; i++)
 			pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
@@ -790,7 +790,7 @@ void ScDetectiveFunc::DeleteBox( SCCOL n
 
 		long i;
 		for (i=1; i<=nDelCount; i++)
-			pModel->AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) );
+	            pModel->AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
 
 		for (i=1; i<=nDelCount; i++)
 			pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
@@ -1334,7 +1334,7 @@ sal_Bool ScDetectiveFunc::DeleteAll( ScD
 
 		long i;
 		for (i=1; i<=nDelCount; i++)
-			pModel->AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) );
+	            pModel->AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
 
 		for (i=1; i<=nDelCount; i++)
 			pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/tool/interpr1.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/tool/interpr1.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/tool/interpr1.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/tool/interpr1.cxx Fri Oct 12 21:29:36 2012
@@ -40,6 +40,7 @@
 #include <unotools/transliterationwrapper.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/logfile.hxx>
+#include <unicode/uchar.h>
 
 #include "interpre.hxx"
 #include "patattr.hxx"
@@ -7632,6 +7633,182 @@ void ScInterpreter::ScLeft()
     }
 }
 
+typedef struct {
+	UBlockCode from;
+	UBlockCode to;
+} UBlockScript;
+
+static UBlockScript scriptList[] = {
+    {UBLOCK_HANGUL_JAMO, UBLOCK_HANGUL_JAMO},
+    {UBLOCK_CJK_RADICALS_SUPPLEMENT, UBLOCK_HANGUL_SYLLABLES},
+	{UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS,UBLOCK_CJK_RADICALS_SUPPLEMENT },
+	{UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS,UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS},
+    {UBLOCK_CJK_COMPATIBILITY_FORMS, UBLOCK_CJK_COMPATIBILITY_FORMS},
+    {UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS},
+    {UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT},
+    {UBLOCK_CJK_STROKES, UBLOCK_CJK_STROKES}
+};
+#define scriptListCount sizeof (scriptList) / sizeof (UBlockScript)
+bool SAL_CALL lcl_getScriptClass(sal_uInt32 currentChar)
+{
+	// for the locale of ja-JP, character U+0x005c and U+0x20ac should be ScriptType::Asian
+	if( (currentChar == 0x005c || currentChar == 0x20ac) && 
+		  (MsLangId::getSystemLanguage() == LANGUAGE_JAPANESE) )
+		return true;
+	sal_uInt16 i;
+    static sal_Int16 nRet = 0;
+    UBlockCode block = (UBlockCode)ublock_getCode((sal_uInt32)currentChar);
+    for ( i = 0; i < scriptListCount; i++) {
+        if (block <= scriptList[i].to) break;
+    }
+    nRet = (i < scriptListCount && block >= scriptList[i].from);
+    return nRet;
+}
+bool IsDBCS(sal_Unicode ch)
+{
+	return lcl_getScriptClass(ch);
+}
+sal_Int32 getLengthB(String &str)
+{
+	sal_Int32 index = 0;
+	sal_Int32 length = 0;
+	if(0 == str.Len())
+		return 0;
+	while(index < str.Len()){
+		if(IsDBCS(str.GetChar(index)))
+			length += 2;
+		else
+			length++;
+		index++;
+	}
+	return length;
+}
+void ScInterpreter::ScLenB()
+{
+	RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "luzhang", "ScInterpreter::ScLenB" );
+    String aStr( GetString() );
+    PushDouble( getLengthB(aStr) );
+}
+void lcl_RightB(String &aStr, sal_Int32 n)
+{
+	if( n < getLengthB(aStr) )
+	{
+		sal_Int32 index = aStr.Len();
+		while(index-- >= 0)
+		{
+			if(0 == n)
+			{
+				aStr.Erase( 0, index + 1);
+				break;
+			}
+			if(-1 == n)
+			{
+				aStr.Erase( 0, index + 2 );
+				aStr.InsertAscii(" ", 0);
+				break;
+			}
+			if(IsDBCS(aStr.GetChar(index)))
+				n -= 2;
+			else
+				n--;
+		}
+	}
+}
+void ScInterpreter::ScRightB()
+{
+    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "luzhang", "ScInterpreter::ScRightB" );
+    sal_uInt8 nParamCount = GetByte();
+    if ( MustHaveParamCount( nParamCount, 1, 2 ) )
+    {
+        sal_Int32 n;
+        if (nParamCount == 2)
+        {
+            double nVal = ::rtl::math::approxFloor(GetDouble());
+            if ( nVal < 0.0 || nVal > STRING_MAXLEN )
+            {
+                PushIllegalArgument();
+                return ;
+            }
+            else
+                n = (xub_StrLen) nVal;
+        }
+        else
+            n = 1;
+        String aStr( GetString() );
+		lcl_RightB(aStr, n);
+        PushString( aStr );
+    }
+}
+void lcl_LeftB(String &aStr, sal_Int32 n)
+{
+	if( n < getLengthB(aStr) )
+	{
+		sal_Int32 index = -1;
+		while(index++ < aStr.Len())
+		{
+			if(0 == n)
+			{
+				aStr.Erase( index );
+				break;
+			}
+			if(-1 == n)
+			{
+				aStr.Erase( index - 1 );
+				aStr.InsertAscii(" ");
+				break;
+			}
+			if(IsDBCS(aStr.GetChar(index)))
+				n -= 2;
+			else
+				n--;
+		}
+	}
+}
+void ScInterpreter::ScLeftB()
+{
+	RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "luzhang", "ScInterpreter::ScLeftB" );
+    sal_uInt8 nParamCount = GetByte();
+    if ( MustHaveParamCount( nParamCount, 1, 2 ) )
+    {
+        sal_Int32 n;
+        if (nParamCount == 2)
+        {
+            double nVal = ::rtl::math::approxFloor(GetDouble());
+            if ( nVal < 0.0 || nVal > STRING_MAXLEN )
+            {
+                PushIllegalArgument();
+                return ;
+            }
+            else
+                n = (xub_StrLen) nVal;
+        }
+        else
+            n = 1;
+        String aStr( GetString() );
+		lcl_LeftB(aStr, n);
+        PushString( aStr );
+    }
+}
+void ScInterpreter::ScMidB()
+{
+	RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "luzhang", "ScInterpreter::ScMidB" );
+    if ( MustHaveParamCount( GetByte(), 3 ) )
+    {
+        double fAnz    = ::rtl::math::approxFloor(GetDouble());
+        double fAnfang = ::rtl::math::approxFloor(GetDouble());
+        String rStr( GetString() );
+        if (fAnfang < 1.0 || fAnz < 0.0 || fAnfang > double(STRING_MAXLEN) || fAnz > double(STRING_MAXLEN))
+            PushIllegalArgument();
+        else
+		{
+			
+			lcl_LeftB(rStr, (xub_StrLen)fAnfang + (xub_StrLen)fAnz - 1);
+			sal_Int32 nCnt = getLengthB(rStr) - (xub_StrLen)fAnfang + 1;
+			lcl_RightB(rStr, nCnt>0 ? nCnt:0);
+            PushString(rStr);
+		}
+    }
+}
 
 void ScInterpreter::ScRight()
 {

Modified: incubator/ooo/branches/buildsys/main/sc/source/core/tool/interpr4.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/core/tool/interpr4.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/core/tool/interpr4.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/core/tool/interpr4.cxx Fri Oct 12 21:29:36 2012
@@ -3759,6 +3759,10 @@ StackVar ScInterpreter::Interpret()
                 case ocGetPivotData     : ScGetPivotData();             break;
                 case ocJis              : ScJis();                      break;
                 case ocAsc              : ScAsc();                      break;
+				case ocLenB             : ScLenB();                     break;
+				case ocRightB           : ScRightB();                   break;
+				case ocLeftB            : ScLeftB();                    break;
+				case ocMidB             : ScMidB();                     break;
                 case ocUnicode          : ScUnicode();                  break;
                 case ocUnichar          : ScUnichar();                  break;
                 case ocTTT              : ScTTT();                      break;

Modified: incubator/ooo/branches/buildsys/main/sc/source/filter/excel/colrowst.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/filter/excel/colrowst.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/filter/excel/colrowst.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/filter/excel/colrowst.cxx Fri Oct 12 21:29:36 2012
@@ -199,7 +199,7 @@ void XclImpColRowSettings::Convert( SCTA
             ::set_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN );
             nWidth = mnDefWidth;
         }
-        rDoc.SetColWidth( nScCol, nScTab, nWidth );
+        rDoc.SetColWidthOnly( nScCol, nScTab, nWidth );
 	}
 
     // row heights ------------------------------------------------------------

Modified: incubator/ooo/branches/buildsys/main/sc/source/filter/excel/excform.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/filter/excel/excform.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/filter/excel/excform.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/filter/excel/excform.cxx Fri Oct 12 21:29:36 2012
@@ -1551,8 +1551,8 @@ static DefTokenId missArgForZeroList[] =
 
 sal_Bool lcl_isInMissArgForZeroList(DefTokenId id)
 {
-	for(short index = 0; index < missArgForZeroCount; index++)
-		if(missArgForZeroList[index] == id)
+	for (sal_uInt32 nIndex = 0; nIndex < missArgForZeroCount; nIndex++)
+		if(missArgForZeroList[nIndex] == id)
 			return sal_True;
 	return sal_False;
 

Modified: incubator/ooo/branches/buildsys/main/sc/source/filter/excel/xetable.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/filter/excel/xetable.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/filter/excel/xetable.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/filter/excel/xetable.cxx Fri Oct 12 21:29:36 2012
@@ -2358,6 +2358,16 @@ XclExpCellTable::XclExpCellTable( const 
     // range for cell iterator
     SCCOL nLastIterScCol = nMaxScCol;
     SCROW nLastIterScRow = ulimit_cast< SCROW >( nLastUsedScRow + 128, nMaxScRow );
+	// modified for 119707 by zhanglu
+	SCCOL rEndColAtt = 0;
+	SCROW rEndRowAtt = 0;
+	rDoc.GetLastAttrCell( nScTab, rEndColAtt,rEndRowAtt ); // To get the real last cell's row number, which has visual data or attribute.
+	if( rEndRowAtt > nLastIterScRow )
+		nLastIterScRow = rEndRowAtt;
+
+	if (nLastIterScRow > nMaxScRow)
+		nLastIterScRow = nMaxScRow;
+	// modified for 119707 end
     ScUsedAreaIterator aIt( &rDoc, nScTab, 0, 0, nLastIterScCol, nLastIterScRow );
 
     // activate the correct segment and sub segment at the progress bar

Modified: incubator/ooo/branches/buildsys/main/sc/source/filter/excel/xlformula.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/filter/excel/xlformula.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/filter/excel/xlformula.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/filter/excel/xlformula.cxx Fri Oct 12 21:29:36 2012
@@ -208,6 +208,10 @@ static const XclFunctionInfo saFuncTable
     { ocIsLogical,          198,    1,  1,  V, { VR }, 0, 0 },
     { ocDBCount2,           199,    3,  3,  V, { RO, RR }, 0, 0 },
     { ocCurrency,           204,    1,  2,  V, { VR }, EXC_FUNCFLAG_IMPORTONLY, 0 },
+	{ ocLeftB,              208,    1,  2,  V, { VR }, 0, 0 },
+	{ ocRightB,             209,    1,  2,  V, { VR }, 0, 0 },
+	{ ocMidB,               210,    3,  3,  V, { VR }, 0, 0 },
+	{ ocLenB,               211,    1,  1,  V, { VR }, 0, 0 },
     { ocRoundUp,            212,    2,  2,  V, { VR }, 0, 0 },
     { ocRoundDown,          213,    2,  2,  V, { VR }, 0, 0 },
     { ocExternal,           255,    1,  MX, R, { RO_E, RO }, EXC_FUNCFLAG_IMPORTONLY, 0 }

Modified: incubator/ooo/branches/buildsys/main/sc/source/ui/docshell/docfunc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/ui/docshell/docfunc.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/ui/docshell/docfunc.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/ui/docshell/docfunc.cxx Fri Oct 12 21:29:36 2012
@@ -111,7 +111,7 @@ IMPL_LINK( ScDocFunc, NotifyDrawUndo, Sd
 {
     // #i101118# if drawing layer collects the undo actions, add it there
     ScDrawLayer* pDrawLayer = rDocShell.GetDocument()->GetDrawLayer();
-    if( pDrawLayer && pDrawLayer->IsRecording() )
+    if( pDrawLayer && pDrawLayer->IsUndoAllowed() && pDrawLayer->IsRecording() )
         pDrawLayer->AddCalcUndo( pUndoAction );
     else
         rDocShell.GetUndoManager()->AddUndoAction( new ScUndoDraw( pUndoAction, &rDocShell ) );

Modified: incubator/ooo/branches/buildsys/main/sc/source/ui/docshell/docsh.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/ui/docshell/docsh.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/ui/docshell/docsh.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/ui/docshell/docsh.cxx Fri Oct 12 21:29:36 2012
@@ -66,6 +66,7 @@
 #include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
 #include <com/sun/star/sheet/XSpreadsheetView.hpp>
 #include <com/sun/star/task/XJob.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
 #include <basic/sbstar.hxx>
 #include <basic/basmgr.hxx>
 
@@ -171,6 +172,97 @@ static const sal_Char __FAR_DATA pFilter
 #define ScDocShell
 #include "scslots.hxx"
 
+namespace
+{
+    template< bool bByName >
+    inline sal_uInt8 GetMediumFlag( const String & rName )
+    {
+        sal_uInt8 bResult = E_MEDIUM_FLAG_NONE;
+
+#define SFX2_FILTER_ENTRY( entry ) { #entry, (sizeof #entry)/sizeof((#entry)[0]) - 1 },
+        static const struct
+        {
+            const char * mpFilterTypeName;
+            unsigned mnFilterTypeLen;
+        } szMSFilterTypes [] = 
+        {
+            SFX2_FILTER_ENTRY(calc_MS_Excel_40)
+            SFX2_FILTER_ENTRY(calc_MS_Excel_40_VorlageTemplate)
+            SFX2_FILTER_ENTRY(calc_MS_Excel_5095)
+            SFX2_FILTER_ENTRY(calc_MS_Excel_5095_VorlageTemplate)
+            SFX2_FILTER_ENTRY(calc_MS_Excel_95)
+            SFX2_FILTER_ENTRY(calc_MS_Excel_95_VorlageTemplate)
+            SFX2_FILTER_ENTRY(calc_MS_Excel_97)
+            SFX2_FILTER_ENTRY(calc_MS_Excel_97_VorlageTemplate)
+            SFX2_FILTER_ENTRY(calc_MS_Excel_2003_XML)
+            SFX2_FILTER_ENTRY(MS Excel 2007 XML)
+            SFX2_FILTER_ENTRY(MS Excel 2007 XML Template)
+            SFX2_FILTER_ENTRY(MS Excel 2007 Binary)
+        };
+
+        static const struct
+        {
+            const char * mpFilterName;
+            unsigned mnFilterNameLen;
+        } szMSFilterNames [] = 
+        {
+            { pFilterExcel4, strlen( pFilterExcel4 ) },
+            { pFilterEx4Temp, strlen( pFilterEx4Temp ) },
+            { pFilterExcel95, strlen( pFilterExcel95 ) },
+            { pFilterEx95Temp, strlen( pFilterEx95Temp ) },
+            { pFilterExcel5, strlen( pFilterExcel5 ) },
+            { pFilterEx5Temp, strlen( pFilterEx5Temp ) },
+            { pFilterExcel97, strlen( pFilterExcel97 ) },
+            { pFilterEx97Temp, strlen( pFilterEx97Temp ) },
+            SFX2_FILTER_ENTRY(Microsoft Excel 2003 XML)
+            { pFilterEx07Xml, strlen( pFilterEx07Xml ) },
+            SFX2_FILTER_ENTRY(Microsoft Excel 2007 XML Template)
+            SFX2_FILTER_ENTRY(Microsoft Excel 2007 Binary)
+        };
+
+        enum{
+            e_calc_MS_Excel_40,
+            e_calc_MS_Excel_40_VorlageTemplate,
+            e_calc_MS_Excel_5095,
+            e_calc_MS_Excel_5095_VorlageTemplate,
+            e_calc_MS_Excel_95,
+            Se_calc_MS_Excel_95_VorlageTemplate,
+            e_calc_MS_Excel_97,
+            e_calc_MS_Excel_97_VorlageTemplate,
+            e_calc_MS_Excel_2003_XML,
+            e_MS_Excel_2007_XML,
+            e_MS_Excel_2007_XML_Template,
+            e_MS_Excel_2007_Binary
+        };
+
+#undef SFX2_FILTER_ENTRY
+
+        if( bByName )
+        {
+            for( unsigned i = 0; i < (sizeof szMSFilterNames)/sizeof(szMSFilterNames[0] ); i++ )
+                if( rName.Len() == szMSFilterNames[i].mnFilterNameLen 
+                    && std::equal( szMSFilterNames[i].mpFilterName, szMSFilterNames[i].mpFilterName + szMSFilterNames[i].mnFilterNameLen, rName.GetBuffer() ) )
+                    bResult |= ( E_MEDIUM_FLAG_EXCEL | ( ( i == e_MS_Excel_2007_XML ) * E_MEDIUM_FLAG_MSXML ) );
+        }
+        else
+        {
+            for( unsigned i = 0; i < (sizeof szMSFilterTypes)/sizeof(szMSFilterTypes[0] ); i++ )
+                if( rName.Len() == szMSFilterTypes[i].mnFilterTypeLen 
+                    && std::equal( szMSFilterTypes[i].mpFilterTypeName, szMSFilterTypes[i].mpFilterTypeName + szMSFilterTypes[i].mnFilterTypeLen, rName.GetBuffer() ) )
+                    bResult |= ( E_MEDIUM_FLAG_EXCEL | ( ( i == e_MS_Excel_2007_XML ) * E_MEDIUM_FLAG_MSXML ) );
+        }
+
+        return bResult;
+    }
+
+    inline sal_uInt8 GetMediumFlag( const SfxMedium * pMedium )
+    {
+        if( const SfxFilter * pFilter = pMedium ? pMedium->GetFilter() : NULL )
+            return GetMediumFlag<false>( pFilter->GetTypeName() );
+
+        return E_MEDIUM_FLAG_NONE;
+    }
+}
 
 SFX_IMPL_INTERFACE(ScDocShell,SfxObjectShell, ScResId(SCSTR_DOCSHELL))
 {
@@ -2907,4 +2999,53 @@ bool ScDocShell::GetProtectionHash( /*ou
     return bRes;
 }    
 
+void ScDocShell::BeforeLoading( SfxMedium& rMedium, const ::rtl::OUString & rstrTypeName, const ::rtl::OUString & rstrFilterName )
+{
+    const sal_uInt8 nMediumFlag = GetMediumFlag<false>( rstrTypeName );
+
+    if( nMediumFlag & E_MEDIUM_FLAG_MSXML )
+    {
+        aDocument.SetImportingMSXML( true );
+
+        if ( GetCreateMode() != SFX_CREATE_MODE_ORGANIZER )
+            ScColumn::bDoubleAlloc = sal_True;
+    }
+}
+
+void ScDocShell::AfterLoading( SfxMedium& rMedium, const ::rtl::OUString & rstrTypeName, const ::rtl::OUString & rstrFilterName )
+{
+    const sal_uInt8 nMediumFlag = GetMediumFlag<false>( rstrTypeName );
+
+	if( nMediumFlag & E_MEDIUM_FLAG_MSXML )
+	{
+        aDocument.SetImportingMSXML( false );
+
+        if ( GetCreateMode() != SFX_CREATE_MODE_ORGANIZER )
+            ScColumn::bDoubleAlloc = sal_False;
+    
+		// After loading, the XEmbeddedObject was probably set modified flag, so reset the flag to false.
+		uno::Sequence < ::rtl::OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
+		for ( sal_Int32 n = 0; n < aNames.getLength(); n++ )
+		{
+			::rtl::OUString	aName = aNames[n];
+			uno::Reference < embed::XEmbeddedObject > xObj = GetEmbeddedObjectContainer().GetEmbeddedObject( aName );
+			OSL_ENSURE( xObj.is(), "An empty entry in the embedded objects list!\n" );
+			if ( xObj.is() )
+			{
+				try
+				{
+					sal_Int32 nState = xObj->getCurrentState();
+					if ( nState != embed::EmbedStates::LOADED )
+					{
+						uno::Reference< util::XModifiable > xModifiable( xObj->getComponent(), uno::UNO_QUERY );
+						if ( xModifiable.is() )
+							xModifiable->setModified(sal_False);
+					}
+				}
+				catch( uno::Exception& )
+				{}
+			}
+		}
+	}
+}
         

Modified: incubator/ooo/branches/buildsys/main/sc/source/ui/inc/docsh.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/ui/inc/docsh.hxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/ui/inc/docsh.hxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/ui/inc/docsh.hxx Fri Oct 12 21:29:36 2012
@@ -420,6 +420,8 @@ public:
     virtual void    SetChangeRecording( bool bActivate );
     virtual bool    SetProtectionPassword( const String &rPassword );
     virtual bool    GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash );
+    void BeforeLoading( SfxMedium&, const ::rtl::OUString &, const ::rtl::OUString & );
+    void AfterLoading( SfxMedium&, const ::rtl::OUString &, const ::rtl::OUString & );
 };
 
 

Modified: incubator/ooo/branches/buildsys/main/sc/source/ui/src/scfuncs.src
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/ui/src/scfuncs.src?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/ui/src/scfuncs.src (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/ui/src/scfuncs.src Fri Oct 12 21:29:36 2012
@@ -9217,6 +9217,130 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
 			Text [ en-US ] = "Defines the character used as the decimal point." ;
 		};
 	};
+	Resource SC_OPCODE_LENB
+	{
+		String 1 // Description
+		{
+			Text [ en-US ] = "Calculates length of a text string, with DBCS" ;
+		};
+		ExtraData =
+		{
+            0;
+			ID_FUNCTION_GRP_TEXT;
+			U2S( HID_FUNC_LENB );
+			1;	0;
+            0;
+		};
+		String 2 // Name of Parameter 1
+		{
+			Text [ en-US ] = "text" ;
+		};
+		String 3 // Description of Parameter 1
+		{
+			Text [ en-US ] = "The text in which the length is to be determined." ;
+		};
+	};
+	Resource SC_OPCODE_RIGHTB
+	{
+		String 1 // Description
+		{
+            Text [ en-US ] = "Returns the last character or characters of a text,with DBCS" ;
+		};
+		ExtraData =
+		{
+            0;
+			ID_FUNCTION_GRP_TEXT;
+			U2S( HID_FUNC_RIGHTB );
+			2;	0;	1;
+            0;
+		};
+		String 2 // Name of Parameter 1
+		{
+			Text [ en-US ] = "text" ;
+		};
+		String 3 // Description of Parameter 1
+		{
+			Text [ en-US ] = "The text in which the end partial words are to be determined." ;
+		};
+		String 4 // Name of Parameter 2
+		{
+			Text [ en-US ] = "number" ;
+		};
+		String 5 // Description of Parameter 2
+		{
+			Text [ en-US ] = "The number of characters for the end text." ;
+		};
+	};
+	Resource SC_OPCODE_LEFTB
+	{
+		String 1 // Description
+		{
+            Text [ en-US ] = "Returns the first character or characters of a text,with DBCS" ;
+		};
+		ExtraData =
+		{
+            0;
+			ID_FUNCTION_GRP_TEXT;
+			U2S( HID_FUNC_LEFTB );
+			2;	0;	1;
+            0;
+		};
+		String 2 // Name of Parameter 1
+		{
+			Text [ en-US ] = "text" ;
+		};
+		String 3 // Description of Parameter 1
+		{
+			Text [ en-US ] = "The text where the initial partial words are to be determined." ;
+		};
+		String 4 // Name of Parameter 2
+		{
+			Text [ en-US ] = "number" ;
+		};
+		String 5 // Description of Parameter 2
+		{
+			Text [ en-US ] = "The number of characters for the start text." ;
+		};
+	};
+	Resource SC_OPCODE_MIDB
+	{
+		String 1 // Description
+		{
+			Text [ en-US ] = "Returns a partial text string of a text, with DBCS" ;
+		};
+		ExtraData =
+		{
+            0;
+			ID_FUNCTION_GRP_TEXT;
+			U2S( HID_FUNC_MIDB );
+			3;	0;	0;	0;
+            0;
+		};
+		String 2 // Name of Parameter 1
+		{
+			Text [ en-US ] = "text" ;
+		};
+		String 3 // Description of Parameter 1
+		{
+			Text [ en-US ] = "The text in which partial words are to be determined." ;
+		};
+		String 4 // Name of Parameter 2
+		{
+			Text [ en-US ] = "start" ;
+		};
+		String 5 // Description of Parameter 2
+		{
+			Text [ en-US ] = "The position from which the part word is to be determined." ;
+		};
+		String 6 // Name of Parameter 3
+		{
+			Text [ en-US ] = "number" ;
+		};
+		String 7 // Description of Parameter 3
+		{
+			Text [ en-US ] = "The number of characters for the text." ;
+		};
+	};
 };
 
 #if defined(U2S)

Modified: incubator/ooo/branches/buildsys/main/sc/source/ui/unoobj/chartuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/ui/unoobj/chartuno.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/ui/unoobj/chartuno.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/ui/unoobj/chartuno.cxx Fri Oct 12 21:29:36 2012
@@ -19,12 +19,9 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sc.hxx"
 
-
 #include <com/sun/star/embed/Aspects.hpp>
 #include <com/sun/star/awt/Size.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -460,8 +457,10 @@ ScChartObj::ScChartObj(ScDocShell* pDocS
 	,nTab( nT )
 	,aChartName( rN )
 {
-	pDocShell->GetDocument()->AddUnoObject(*this);
-
+    pDocShell->GetDocument()->AddUnoObject(*this);
+    SdrOle2Obj* pObject = lcl_FindChartObj( pDocShell, nTab, aChartName );
+    if ( pObject && svt::EmbeddedObjectRef::TryRunningState( pObject->GetObjRef() ) )
+        aObjectName = pObject->GetName();   // #i121178#: keep the OLE object's name
     uno::Sequence< table::CellRangeAddress > aInitialPropValue;
     registerPropertyNoMember( ::rtl::OUString::createFromAscii( "RelatedCellRanges" ),
         PROP_HANDLE_RELATED_CELLRANGES, beans::PropertyAttribute::MAYBEVOID,
@@ -801,6 +800,20 @@ void SAL_CALL ScChartObj::setName( const
 	throw uno::RuntimeException();		// name cannot be changed
 }
 
+// XNamedEx
+
+rtl::OUString SAL_CALL ScChartObj::getDisplayName() throw(uno::RuntimeException)
+{
+	ScUnoGuard aGuard;
+	return aObjectName;
+}
+
+void SAL_CALL ScChartObj::setDisplayName( const rtl::OUString& aName ) throw(uno::RuntimeException)
+{
+	ScUnoGuard aGuard;
+	aObjectName = aName;
+}
+
 // XPropertySet
 
 uno::Reference< beans::XPropertySetInfo > ScChartObj::getPropertySetInfo() throw (uno::RuntimeException)

Modified: incubator/ooo/branches/buildsys/main/sc/source/ui/unoobj/shapeuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/ui/unoobj/shapeuno.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/ui/unoobj/shapeuno.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/ui/unoobj/shapeuno.cxx Fri Oct 12 21:29:36 2012
@@ -819,7 +819,7 @@ uno::Any SAL_CALL ScShapeObj::getPropert
     }
 	else
 	{
-        GetShapePropertySet();
+        if(!pShapePropertySet)	GetShapePropertySet(); //performance consideration
         if (pShapePropertySet)
             aAny = pShapePropertySet->getPropertyValue( aPropertyName );
 	}

Modified: incubator/ooo/branches/buildsys/main/sc/source/ui/vba/vbachartobject.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/ui/vba/vbachartobject.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/ui/vba/vbachartobject.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/ui/vba/vbachartobject.cxx Fri Oct 12 21:29:36 2012
@@ -19,7 +19,6 @@
  * 
  *************************************************************/
 
-
 #include "vbachart.hxx"
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
@@ -37,13 +36,15 @@ const rtl::OUString PERSIST_NAME( RTL_CO
 
 ScVbaChartObject::ScVbaChartObject( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::table::XTableChart >& _xTableChart, const css::uno::Reference< css::drawing::XDrawPageSupplier >& _xDrawPageSupplier ) : ChartObjectImpl_BASE( _xParent, _xContext ), xTableChart( _xTableChart ), xDrawPageSupplier( _xDrawPageSupplier )
 {
-        xDrawPage = xDrawPageSupplier->getDrawPage();        
-        xEmbeddedObjectSupplier.set( xTableChart, uno::UNO_QUERY_THROW );
-        xNamed.set( xTableChart, uno::UNO_QUERY_THROW );
-        sPersistName = getPersistName();
-        xShape = setShape();
-        setName(sPersistName);
-        oShapeHelper.reset(new ShapeHelper(xShape));
+    xDrawPage = xDrawPageSupplier->getDrawPage();        
+    xEmbeddedObjectSupplier.set( xTableChart, uno::UNO_QUERY_THROW );
+    xNamed.set( xTableChart, uno::UNO_QUERY_THROW );
+    sPersistName = getPersistName();
+    xShape = setShape();
+// #i121178#: don't set the persist name to the object but the OLE object's name(displaying name)
+//    setName(sPersistName);
+    setName(xNamed->getDisplayName());
+    oShapeHelper.reset(new ShapeHelper(xShape));
 }
 
 rtl::OUString ScVbaChartObject::getPersistName()
@@ -88,7 +89,6 @@ ScVbaChartObject::setName( const rtl::OU
 	xNamedShape->setName(sName);
 }
 
-
 ::rtl::OUString SAL_CALL 
 ScVbaChartObject::getName() throw (css::uno::RuntimeException)
 {

Modified: incubator/ooo/branches/buildsys/main/sc/source/ui/vba/vbachartobject.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/ui/vba/vbachartobject.hxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/ui/vba/vbachartobject.hxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/ui/vba/vbachartobject.hxx Fri Oct 12 21:29:36 2012
@@ -19,14 +19,13 @@
  * 
  *************************************************************/
 
-
 #ifndef SC_VBA_CHARTOBJECT_HXX
 #define SC_VBA_CHARTOBJECT_HXX
 #include <cppuhelper/implbase1.hxx>
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/table/XTableChart.hpp>
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/container/XNamedEx.hpp>
 #include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
 #include <ooo/vba/excel/XChartObject.hpp>
 #include <vbahelper/vbahelperinterface.hxx>
@@ -36,14 +35,13 @@ typedef InheritedHelperInterfaceImpl1<ov
 
 class ScVbaChartObject : public ChartObjectImpl_BASE
 {		
-
 	css::uno::Reference< css::table::XTableChart  > xTableChart;
 	css::uno::Reference< css::document::XEmbeddedObjectSupplier > xEmbeddedObjectSupplier;
 	css::uno::Reference< css::beans::XPropertySet > xPropertySet;
 	css::uno::Reference< css::drawing::XDrawPageSupplier > xDrawPageSupplier;
 	css::uno::Reference< css::drawing::XDrawPage > xDrawPage;
 	css::uno::Reference< css::drawing::XShape > xShape;
-	css::uno::Reference< css::container::XNamed > xNamed;
+	css::uno::Reference< css::container::XNamedEx > xNamed;
 	rtl::OUString sPersistName;
 	std::auto_ptr<ov::ShapeHelper> oShapeHelper;
 	css::uno::Reference< css::container::XNamed > xNamedShape;

Modified: incubator/ooo/branches/buildsys/main/sc/source/ui/view/printfun.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/source/ui/view/printfun.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/source/ui/view/printfun.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sc/source/ui/view/printfun.cxx Fri Oct 12 21:29:36 2012
@@ -2991,8 +2991,9 @@ void lcl_SetHidden( ScDocument* pDoc, SC
 void ScPrintFunc::CalcPages()               // berechnet aPageRect und Seiten aus nZoom
 {
     if (!pPageEndX) pPageEndX = new SCCOL[MAXCOL+1];
-    if (!pPageEndY) pPageEndY = new SCROW[MAXROW+1];
-    if (!pPageRows) pPageRows = new ScPageRowEntry[MAXROW+1];   //! vorher zaehlen !!!!
+	//performance impact
+//	if (!pPageEndY) pPageEndY = new SCROW[MAXROW+1];
+//	if (!pPageRows) pPageRows = new ScPageRowEntry[MAXROW+1];	//! vorher zaehlen !!!!
 
     pDoc->SetPageSize( nPrintTab, GetDocPageSize() );
     if (aAreaParam.bPrintArea)
@@ -3002,7 +3003,9 @@ void ScPrintFunc::CalcPages()           
     }
     else
         pDoc->UpdatePageBreaks( nPrintTab, NULL );      // sonst wird das Ende markiert
-
+	SCROW nRealCnt = nEndRow-nStartRow+1;
+		if (!pPageEndY) pPageEndY = new SCROW[nRealCnt+1];
+	if (!pPageRows) pPageRows = new ScPageRowEntry[nRealCnt+1];	//! vorher zaehlen !!!!
     //
     //  Seiteneinteilung nach Umbruechen in Col/RowFlags
     //  Von mehreren Umbruechen in einem ausgeblendeten Bereich zaehlt nur einer.

Modified: incubator/ooo/branches/buildsys/main/sc/util/hidother.src
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/util/hidother.src?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/util/hidother.src (original)
+++ incubator/ooo/branches/buildsys/main/sc/util/hidother.src Fri Oct 12 21:29:36 2012
@@ -345,6 +345,10 @@ hidspecial HID_FUNC_LAENGE		 { HelpID = 
 hidspecial HID_FUNC_LINKS		 { HelpID = HID_FUNC_LINKS; };
 hidspecial HID_FUNC_RECHTS		 { HelpID = HID_FUNC_RECHTS; };
 hidspecial HID_FUNC_TEIL		 { HelpID = HID_FUNC_TEIL; };
+hidspecial HID_FUNC_LENB            { HelpID = HID_FUNC_LENB; };
+hidspecial HID_FUNC_RIGHTB          { HelpID = HID_FUNC_RIGHTB; };
+hidspecial HID_FUNC_LEFTB           { HelpID = HID_FUNC_LEFTB; };
+hidspecial HID_FUNC_MIDB            { HelpID = HID_FUNC_MIDB; };
 hidspecial HID_FUNC_WIEDERHOLEN		 { HelpID = HID_FUNC_WIEDERHOLEN; };
 hidspecial HID_FUNC_WECHSELN		 { HelpID = HID_FUNC_WECHSELN; };
 hidspecial HID_FUNC_BASIS		 { HelpID = HID_FUNC_BASIS; };

Modified: incubator/ooo/branches/buildsys/main/sc/util/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sc/util/makefile.mk?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sc/util/makefile.mk (original)
+++ incubator/ooo/branches/buildsys/main/sc/util/makefile.mk Fri Oct 12 21:29:36 2012
@@ -92,7 +92,10 @@ SHL1STDLIBS=       \
 	$(XMLOFFLIB)	\
 	$(AVMEDIALIB) \
 	$(FORLIB) \
-    $(FORUILIB)
+    $(FORUILIB) \
+    $(ICUINLIB) \
+	$(ICUUCLIB) \
+	$(ICUDATALIB)
 	
 SHL1LIBS=$(LIB3TARGET) $(LIB4TARGET)
 

Modified: incubator/ooo/branches/buildsys/main/sd/source/filter/eppt/eppt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sd/source/filter/eppt/eppt.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sd/source/filter/eppt/eppt.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sd/source/filter/eppt/eppt.cxx Fri Oct 12 21:29:36 2012
@@ -172,6 +172,7 @@ PPTWriter::PPTWriter( const std::vector<
     if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
         mAny >>= nHeight;
     maDestPageSize = ImplMapSize( ::com::sun::star::awt::Size( nWidth, nHeight ) );
+    maPageSize = Size(nWidth, nHeight);
 
     mrStg = rSvStorage;
     if ( !mrStg.Is() )
@@ -1704,8 +1705,10 @@ void PPTWriter::ImplWriteBackground( ::c
 
     mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
     mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 );                     // Flags: Connector | Background | HasSpt
-    Point aEmptyPoint = Point();
-    Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
+
+    // #121183# Use real PageSize in 100th mm
+    Rectangle aRect(Point(0, 0), maPageSize);
+
     EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
     aPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillSolid );
     ::com::sun::star::drawing::FillStyle aFS( ::com::sun::star::drawing::FillStyle_NONE );

Modified: incubator/ooo/branches/buildsys/main/sd/source/filter/eppt/eppt.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sd/source/filter/eppt/eppt.hxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sd/source/filter/eppt/eppt.hxx (original)
+++ incubator/ooo/branches/buildsys/main/sd/source/filter/eppt/eppt.hxx Fri Oct 12 21:29:36 2012
@@ -689,6 +689,7 @@ class PPTWriter : public GroupTable, pub
 		MapMode							maMapModeSrc;
 		MapMode							maMapModeDest;
 		::com::sun::star::awt::Size		maDestPageSize;
+        Size                            maPageSize; // #121183# Keep size in logic coordinates (100th mm)
 		::com::sun::star::awt::Size		maNotesPageSize;
 		PageType						meLatestPageType;
 		List							maSlideNameList;

Modified: incubator/ooo/branches/buildsys/main/set_soenv.in
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/set_soenv.in?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/set_soenv.in (original)
+++ incubator/ooo/branches/buildsys/main/set_soenv.in Fri Oct 12 21:29:36 2012
@@ -1539,11 +1539,11 @@ for my $repo (split(/ /,"@ADDITIONAL_REP
 #
 print "Setting the aliases... ";
 # 1. alias for a full product make. 
-	$mkout           = '"perl $SOLARENV/bin/mkout.pl"';
-	$deliver         = '"perl $SOLARENV/bin/deliver.pl"';
-	$build           = '"perl $SOLARENV/bin/build.pl"';
-	$build_client    = '"perl $SOLARENV/bin/build_client.pl"';
-	$zipdep          = '"perl $SOLARENV/bin/zipdep.pl"';
+	$mkout           = '"$PERL $SOLARENV/bin/mkout.pl"';
+	$deliver         = '"$PERL $SOLARENV/bin/deliver.pl"';
+	$build           = '"$PERL $SOLARENV/bin/build.pl"';
+	$build_client    = '"$PERL $SOLARENV/bin/build_client.pl"';
+	$zipdep          = '"$PERL $SOLARENV/bin/zipdep.pl"';
 # 3. alias for a full product make
 $nmake           = '"dmake"';
 print "done\n";

Modified: incubator/ooo/branches/buildsys/main/sfx2/inc/sfx2/objsh.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sfx2/inc/sfx2/objsh.hxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sfx2/inc/sfx2/objsh.hxx (original)
+++ incubator/ooo/branches/buildsys/main/sfx2/inc/sfx2/objsh.hxx Fri Oct 12 21:29:36 2012
@@ -204,6 +204,8 @@ private:
 	sal_Bool					bHasName :1,		// sal_True := bestehendes Objekt, sal_False := es ist ein neues Objekt
                                 bIsTmp :1;          // temp. Storage
         sal_Bool 		bIsInGenerateThumbnail;	//optimize thumbnail generate and store procedure to improve odt saving performance, i120030
+    virtual void BeforeLoading( SfxMedium&, const ::rtl::OUString &, const ::rtl::OUString & ){};
+    virtual void AfterLoading( SfxMedium&, const ::rtl::OUString &, const ::rtl::OUString & ){};
 
 private:
 //#if 0 // _SOLAR__PRIVATE

Modified: incubator/ooo/branches/buildsys/main/sfx2/source/doc/objstor.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sfx2/source/doc/objstor.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sfx2/source/doc/objstor.cxx (original)
+++ incubator/ooo/branches/buildsys/main/sfx2/source/doc/objstor.cxx Fri Oct 12 21:29:36 2012
@@ -2364,6 +2364,7 @@ sal_Bool SfxObjectShell::ImportFrom( Sfx
     ::rtl::OUString aTypeName( rMedium.GetFilter()->GetTypeName() );
     ::rtl::OUString aFilterName( rMedium.GetFilter()->GetFilterName() );
 
+        BeforeLoading( rMedium, aTypeName, aFilterName );
     uno::Reference< lang::XMultiServiceFactory >  xMan = ::comphelper::getProcessServiceFactory();
     uno::Reference < lang::XMultiServiceFactory > xFilterFact (
                 xMan->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.FilterFactory" ) ), uno::UNO_QUERY );
@@ -2463,6 +2464,8 @@ sal_Bool SfxObjectShell::ImportFrom( Sfx
                 }
             }
         }
+        AfterLoading( rMedium, aTypeName, aFilterName );
+
         return bRtn;
 //<- #i119492
         }catch(const uno::Exception&)

Modified: incubator/ooo/branches/buildsys/main/stlport/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/stlport/makefile.mk?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/stlport/makefile.mk (original)
+++ incubator/ooo/branches/buildsys/main/stlport/makefile.mk Fri Oct 12 21:29:36 2012
@@ -61,15 +61,9 @@ $(INCCOM)$/stlport$/vector: systemstl$/$
     TARFILE_MD5=18f577b374d60b3c760a3a3350407632
     PATCH_FILES=STLport-4.5.patch STLport-4.5-gcc43_warnings.patch
 .ELIF "$(GUI)"=="WNT"
-    .IF "$(CCNUMVER)"<="001300000000"
-        TARFILE_NAME=STLport-4.0
-        TARFILE_MD5=c441926f3a552ed3e5b274b62e86af16
-        PATCH_FILES=STLport-4.0.patch
-    .ELSE
-        TARFILE_NAME=STLport-4.5-0119
-        TARFILE_MD5=7376930b0d3f3d77a685d94c4a3acda8
-        PATCH_FILES=STLport-4.5-0119.patch
-    .ENDIF
+    TARFILE_NAME=STLport-4.5-0119
+    TARFILE_MD5=7376930b0d3f3d77a685d94c4a3acda8
+    PATCH_FILES=STLport-4.5-0119.patch
 .ELSE
     TARFILE_NAME=STLport-4.0
     TARFILE_MD5=c441926f3a552ed3e5b274b62e86af16
@@ -109,11 +103,7 @@ BUILD_DIR=src
 
 .IF "$(COM)"=="MSC"
 BUILD_ACTION=nmake
-.IF "$(CCNUMVER)"<="001400000000"
-BUILD_FLAGS=-f vc7.mak EXFLAGS="/EHsc"
-.ELSE			# "$(CCNUMVER)"<="001400000000"
 BUILD_FLAGS=-f vc7.mak EXFLAGS="/EHa /Zc:wchar_t-" CCNUMVER=$(CCNUMVER)
-.ENDIF			# "$(CCNUMVER)"<="001400000000"
 .ENDIF
 
 .IF "$(COM)"=="GCC"
@@ -212,31 +202,4 @@ all:
 .INCLUDE :	target.mk
 .INCLUDE :	tg_ext.mk
 
-.IF "$(GUI)"=="WNT"
-.IF "$(COM)"!="GCC"
-.IF "$(CCNUMVER)"<="001300000000"
-
-$(MISC)$/$(TARFILE_ROOTDIR) : avoid_win32_patches
-avoid_win32_patches :
-	@$(ECHONL)
-	@echo ERROR! this module can't use automated patch creation
-	@echo on windows.
-	@$(ECHONL)
-	force_dmake_to_error
-
-$(PACKAGE_DIR)$/so_custom_patch :  $(PACKAGE_DIR)$/$(PATCH_FLAG_FILE)
-    win32_custom.bat $(PACKAGE_DIR) $(BACK_PATH) && $(TOUCH) $@
-
-$(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/so_custom_patch
-
-.IF "$(USE_NEW_SDK)"!=""
-$(PACKAGE_DIR)$/win32_sdk_patch :  $(PACKAGE_DIR)$/$(PATCH_FLAG_FILE)
-    win32_sdk.bat $(PACKAGE_DIR) $(BACK_PATH) && $(TOUCH) $@
-
-$(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/win32_sdk_patch
-.ENDIF			# "$(USE_NEW_SDK)"!=""
-.ENDIF			# COMVER<=001300000000
-.ENDIF "$(COM)"=="GCC"
-.ENDIF          # "$(GUI)"=="WNT"
-
 .ENDIF # "$(USE_SYSTEM_STL)"

Modified: incubator/ooo/branches/buildsys/main/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx (original)
+++ incubator/ooo/branches/buildsys/main/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx Fri Oct 12 21:29:36 2012
@@ -218,15 +218,27 @@ namespace sdr
 				xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
 			}
 
-			// always append an invisible outline for the cases where no visible content exists
-			const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
-            const basegfx::B2DRange aObjectRange(
-				aObjectBound.Left(), aObjectBound.Top(), 
-				aObjectBound.Right(), aObjectBound.Bottom());
+			// #119863# always append an invisible outline for the cases where no visible content exists
+            if(true)
+            {
+			    const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
+                const basegfx::B2DRange aObjectRange(
+				    aObjectBound.Left(), aObjectBound.Top(), 
+				    aObjectBound.Right(), aObjectBound.Bottom());
 
-			drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, 
-				drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
-					false, aObjectRange));
+				// create object matrix
+				const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
+				const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+				const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
+				const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+					aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
+					aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+                drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, 
+				    drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+					    false, 
+                        aObjectMatrix));
+            }
 
 			return xRetval;
 		}

Modified: incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdedxv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdedxv.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdedxv.cxx (original)
+++ incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdedxv.cxx Fri Oct 12 21:29:36 2012
@@ -211,6 +211,7 @@ void SdrObjEditView::ModelHasChanged()
                 aMinArea1.Move(aPvOfs.X(),aPvOfs.Y());
                 Rectangle aNewArea(aMinArea1);
                 aNewArea.Union(aEditArea1);
+
                 if (aNewArea!=aOldArea || aEditArea1!=aTextEditArea || aMinArea1!=aMinTextEditArea ||
                     pTextEditOutliner->GetMinAutoPaperSize()!=aPaperMin1 || pTextEditOutliner->GetMaxAutoPaperSize()!=aPaperMax1) {
                     aTextEditArea=aEditArea1;

Modified: incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdotext.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdotext.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdotext.cxx (original)
+++ incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdotext.cxx Fri Oct 12 21:29:36 2012
@@ -862,6 +862,17 @@ void SdrTextObj::TakeTextRect( SdrOutlin
 				if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nWdt=1000000;
 				if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nHgt=1000000;
 			}
+
+            // #119885# Do not limit/force height to geometrical frame (vice versa for vertical writing)
+            if(IsVerticalWriting())
+            {
+                nWdt = 1000000;
+            }
+            else
+            {
+                nHgt = 1000000;
+            }
+
 			rOutliner.SetMaxAutoPaperSize(Size(nWdt,nHgt));
 		}
 

Modified: incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdotxed.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdotxed.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdotxed.cxx (original)
+++ incubator/ooo/branches/buildsys/main/svx/source/svdraw/svdotxed.cxx Fri Oct 12 21:29:36 2012
@@ -180,9 +180,20 @@ void SdrTextObj::TakeTextEditArea(Size* 
 		if (!bFitToSize) {
 			if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width())  nMaxWdt=aMaxSiz.Width();
 			if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height();
-			if (!IsAutoGrowWidth() ) { nMaxWdt=aAnkSiz.Width();  nMinWdt=nMaxWdt; }
-			if (!IsAutoGrowHeight()) { nMaxHgt=aAnkSiz.Height(); nMinHgt=nMaxHgt; }
-			SdrTextAniKind      eAniKind=GetTextAniKind();
+			
+            if (!IsAutoGrowWidth() ) 
+            { 
+                nMinWdt = aAnkSiz.Width();  
+                nMaxWdt = nMinWdt; 
+            }
+			
+            if (!IsAutoGrowHeight()) 
+            { 
+                nMinHgt = aAnkSiz.Height(); 
+                nMaxHgt = nMinHgt; 
+            }
+			
+            SdrTextAniKind      eAniKind=GetTextAniKind();
 			SdrTextAniDirection eAniDirection=GetTextAniDirection();
 
 			// #101684#
@@ -194,9 +205,22 @@ void SdrTextObj::TakeTextEditArea(Size* 
 				if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nMaxWdt=1000000;
 				if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nMaxHgt=1000000;
 			}
-			aPaperMax.Width()=nMaxWdt;
+            
+            // #119885# Do not limit/force height to geometrical frame (vice versa for vertical writing)
+            if(IsVerticalWriting())
+            {
+                nMaxWdt = 1000000;
+            }
+            else
+            {
+                nMaxHgt = 1000000;
+            }
+
+            aPaperMax.Width()=nMaxWdt;
 			aPaperMax.Height()=nMaxHgt;
-		} else {
+		} 
+        else 
+        {
 			aPaperMax=aMaxSiz;
 		}
 		aPaperMin.Width()=nMinWdt;

Modified: incubator/ooo/branches/buildsys/main/svx/source/xoutdev/_xoutbmp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/svx/source/xoutdev/_xoutbmp.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/svx/source/xoutdev/_xoutbmp.cxx (original)
+++ incubator/ooo/branches/buildsys/main/svx/source/xoutdev/_xoutbmp.cxx Fri Oct 12 21:29:36 2012
@@ -343,43 +343,74 @@ sal_uInt16 XOutBitmap::WriteGraphic( con
             aURL.setBase( aName );
 		}
 
-		if( ( nFlags & XOUTBMP_USE_NATIVE_IF_POSSIBLE ) &&
-			!( nFlags & XOUTBMP_MIRROR_HORZ ) &&
-			!( nFlags & XOUTBMP_MIRROR_VERT ) &&
-			( rGraphic.GetType() != GRAPHIC_GDIMETAFILE ) && rGraphic.IsLink() )
-		{
-			// try to write native link
-			const GfxLink aGfxLink( ( (Graphic&) rGraphic ).GetLink() );
-
-			switch( aGfxLink.GetType() )
-			{
-				case( GFX_LINK_TYPE_NATIVE_GIF ): aExt = FORMAT_GIF; break;
-				case( GFX_LINK_TYPE_NATIVE_JPG ): aExt = FORMAT_JPG; break;
-				case( GFX_LINK_TYPE_NATIVE_PNG ): aExt = FORMAT_PNG; break;
+        // #121128# use shortcut to write SVG data in original form (if possible)
+        const SvgDataPtr aSvgDataPtr(rGraphic.getSvgData());
 
-				default:
-				break;
-			}
+        if(aSvgDataPtr.get() 
+            && aSvgDataPtr->getSvgDataArrayLength()
+            && rFilterName.EqualsIgnoreCaseAscii("svg"))
+        {
+            if(!(nFlags & XOUTBMP_DONT_ADD_EXTENSION))
+            {
+                aURL.setExtension(rFilterName);
+            }
+
+            rFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
+            SfxMedium aMedium(aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE|STREAM_SHARE_DENYNONE|STREAM_TRUNC, true);
+            SvStream* pOStm = aMedium.GetOutStream();
+
+            if(pOStm)
+            {
+                pOStm->Write(aSvgDataPtr->getSvgDataArray().get(), aSvgDataPtr->getSvgDataArrayLength());
+                aMedium.Commit();
+
+                if(!aMedium.GetError())
+                {
+                    nErr = GRFILTER_OK;
+                }
+            }
+        }
 
-			if( aExt.Len() )
-			{
-                if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION))
-                    aURL.setExtension( aExt );
-				rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE );
+		if( GRFILTER_OK != nErr )
+		{
+		    if( ( nFlags & XOUTBMP_USE_NATIVE_IF_POSSIBLE ) &&
+			    !( nFlags & XOUTBMP_MIRROR_HORZ ) &&
+			    !( nFlags & XOUTBMP_MIRROR_VERT ) &&
+			    ( rGraphic.GetType() != GRAPHIC_GDIMETAFILE ) && rGraphic.IsLink() )
+		    {
+			    // try to write native link
+			    const GfxLink aGfxLink( ( (Graphic&) rGraphic ).GetLink() );
+
+			    switch( aGfxLink.GetType() )
+			    {
+				    case( GFX_LINK_TYPE_NATIVE_GIF ): aExt = FORMAT_GIF; break;
+				    case( GFX_LINK_TYPE_NATIVE_JPG ): aExt = FORMAT_JPG; break;
+				    case( GFX_LINK_TYPE_NATIVE_PNG ): aExt = FORMAT_PNG; break;
+
+				    default:
+				    break;
+			    }
 
-				SfxMedium	aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_SHARE_DENYNONE | STREAM_TRUNC, sal_True );
-				SvStream*	pOStm = aMedium.GetOutStream();
+			    if( aExt.Len() )
+			    {
+                    if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION))
+                        aURL.setExtension( aExt );
+				    rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE );
 
-				if( pOStm && aGfxLink.GetDataSize() && aGfxLink.GetData() )
-				{
-					pOStm->Write( aGfxLink.GetData(), aGfxLink.GetDataSize() );
-					aMedium.Commit();
+				    SfxMedium	aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_SHARE_DENYNONE | STREAM_TRUNC, sal_True );
+				    SvStream*	pOStm = aMedium.GetOutStream();
 
-					if( !aMedium.GetError() )
-						nErr = GRFILTER_OK;
-				}
-			}
-		}
+				    if( pOStm && aGfxLink.GetDataSize() && aGfxLink.GetData() )
+				    {
+					    pOStm->Write( aGfxLink.GetData(), aGfxLink.GetDataSize() );
+					    aMedium.Commit();
+
+					    if( !aMedium.GetError() )
+						    nErr = GRFILTER_OK;
+				    }
+			    }
+		    }
+        }
 
 		if( GRFILTER_OK != nErr )
 		{

Modified: incubator/ooo/branches/buildsys/main/sw/Library_swd.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/sw/Library_swd.mk?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/sw/Library_swd.mk (original)
+++ incubator/ooo/branches/buildsys/main/sw/Library_swd.mk Fri Oct 12 21:29:36 2012
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_add_linked_libs
 	sal \
 	sfx \
 	sot \
+	stl \
 	svl \
 	svt \
 	tl \