incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1386501 [7/10] - in /incubator/ooo/branches/writer001: ./ ext_libraries/ratscan/ ext_sources/ main/ main/autodoc/source/display/html/ main/basegfx/inc/basegfx/numeric/ main/basegfx/source/numeric/ main/basegfx/source/tools/ main/basic/sour...
Date Mon, 17 Sep 2012 08:06:23 GMT
Modified: incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/appluno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/appluno.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/appluno.cxx (original)
+++ incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/appluno.cxx Mon Sep 17 08:06:09 2012
@@ -762,10 +762,14 @@ static void lcl_FillSequence( uno::Seque
 	if (rDesc.ppDefArgNames && rDesc.ppDefArgDescs && rDesc.pDefArgFlags )
 	{
 		sal_uInt16 nCount = rDesc.nArgCount;
-        if (nCount >= VAR_ARGS)
+		if (nCount >= PAIRED_VAR_ARGS)
+		    nCount -= PAIRED_VAR_ARGS - 2;
+        else if (nCount >= VAR_ARGS)
             nCount -= VAR_ARGS - 1;
         sal_uInt16 nSeqCount = rDesc.GetSuppressedArgCount();
-        if (nSeqCount >= VAR_ARGS)
+        if (nSeqCount >= PAIRED_VAR_ARGS)
+            nSeqCount -= PAIRED_VAR_ARGS - 2;
+        else if (nSeqCount >= VAR_ARGS)
             nSeqCount -= VAR_ARGS - 1;
 
         if (nSeqCount)

Modified: incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/docuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/docuno.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/docuno.cxx (original)
+++ incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/docuno.cxx Mon Sep 17 08:06:09 2012
@@ -50,6 +50,7 @@
 
 #include <com/sun/star/util/Date.hpp>
 #include <com/sun/star/sheet/XNamedRanges.hpp>
+#include <com/sun/star/sheet/XNamedRanges2.hpp>
 #include <com/sun/star/sheet/XLabelRanges.hpp>
 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
 #include <com/sun/star/script/XLibraryContainer.hpp>
@@ -135,6 +136,7 @@ const SfxItemPropertyMapEntry* lcl_GetDo
         {MAP_CHAR_LEN(SC_UNO_LOOKUPLABELS),      PROP_UNO_LOOKUPLABELS, &getBooleanCppuType(),                                    0, 0},
         {MAP_CHAR_LEN(SC_UNO_MATCHWHOLE),        PROP_UNO_MATCHWHOLE, &getBooleanCppuType(),                                    0, 0},
         {MAP_CHAR_LEN(SC_UNO_NAMEDRANGES),       0, &getCppuType((uno::Reference<sheet::XNamedRanges>*)0),    0, 0},
+        {MAP_CHAR_LEN(SC_UNO_NAMEDRANGES2),       0, &getCppuType((uno::Reference<sheet::XNamedRanges2>*)0),    0, 0},
         {MAP_CHAR_LEN(SC_UNO_DATABASERNG),       0, &getCppuType((uno::Reference<sheet::XDatabaseRanges>*)0), 0, 0},
         {MAP_CHAR_LEN(SC_UNO_NULLDATE),          PROP_UNO_NULLDATE, &getCppuType((util::Date*)0),                             0, 0},
         {MAP_CHAR_LEN(SC_UNO_ROWLABELRNG),       0, &getCppuType((uno::Reference<sheet::XLabelRanges>*)0),    0, 0},
@@ -1846,6 +1848,10 @@ uno::Any SAL_CALL ScModelObj::getPropert
 			ScUnoConversion::FillLocale( aLocale, eCtl );
 			aRet <<= aLocale;
 		}
+		else if ( aString.EqualsAscii( SC_UNO_NAMEDRANGES2 ) )
+		{
+			aRet <<= uno::Reference<sheet::XNamedRanges2>(new ScNamedRangesObj( pDocShell ));
+		}
 		else if ( aString.EqualsAscii( SC_UNO_NAMEDRANGES ) )
 		{
 			aRet <<= uno::Reference<sheet::XNamedRanges>(new ScNamedRangesObj( pDocShell ));

Modified: incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/nameuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/nameuno.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/nameuno.cxx (original)
+++ incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/nameuno.cxx Mon Sep 17 08:06:09 2012
@@ -85,9 +85,10 @@ sal_Bool lcl_UserVisibleName( const ScRa
 
 //------------------------------------------------------------------------
 
-ScNamedRangeObj::ScNamedRangeObj(ScDocShell* pDocSh, const String& rNm) :
+ScNamedRangeObj::ScNamedRangeObj(ScDocShell* pDocSh, const String& rNm, const String& rScopeName) :
 	pDocShell( pDocSh ),
-	aName( rNm )
+	aName( rNm ),
+	aScopeName(rScopeName)
 {
 	pDocShell->GetDocument()->AddUnoObject(*this);
 }
@@ -117,7 +118,12 @@ ScRangeData* ScNamedRangeObj::GetRangeDa
 		if (pNames)
 		{
 			sal_uInt16 nPos = 0;
-			if (pNames->SearchName( aName, nPos ))
+			SCTAB nameScope = MAXTABCOUNT;
+			if ( aScopeName != EMPTY_STRING )
+			{
+				pDocShell->GetDocument()->GetTable( aScopeName, nameScope );
+			}
+			if (pNames->SearchName( aName, nPos, nameScope ))
 			{
 				pRet = (*pNames)[nPos];
 				pRet->ValidateTabRefs();		// adjust relative tab refs to valid tables
@@ -129,59 +135,72 @@ ScRangeData* ScNamedRangeObj::GetRangeDa
 
 // sheet::XNamedRange
 
-void ScNamedRangeObj::Modify_Impl( const String* pNewName, const ScTokenArray* pNewTokens, const String* pNewContent,
+void ScNamedRangeObj::Modify_Impl( const String* pNewRangeName, const ScTokenArray* pNewTokens, const String* pNewContent,
 									const ScAddress* pNewPos, const sal_uInt16* pNewType,
-                                    const formula::FormulaGrammar::Grammar eGrammar )
+                                    const formula::FormulaGrammar::Grammar eGrammar, const String* pNewScopeName )
 {
-	if (pDocShell)
-	{
-		ScDocument* pDoc = pDocShell->GetDocument();
-		ScRangeName* pNames = pDoc->GetRangeName();
-		if (pNames)
-		{
-			sal_uInt16 nPos = 0;
-            if (pNames->SearchName( aName, nPos ))
-			{
-                ScRangeName* pNewRanges = new ScRangeName( *pNames );
-				ScRangeData* pOld = (*pNames)[nPos];
-
-				String aInsName(pOld->GetName());
-				if (pNewName)
-					aInsName = *pNewName;
-				String aContent;                            // Content string based =>
-				pOld->GetSymbol( aContent, eGrammar);   // no problems with changed positions and such.
-				if (pNewContent)
-					aContent = *pNewContent;
-				ScAddress aPos(pOld->GetPos());
-				if (pNewPos)
-					aPos = *pNewPos;
-				sal_uInt16 nType = pOld->GetType();
-				if (pNewType)
-					nType = *pNewType;
-
-                ScRangeData* pNew = NULL;
-                if ( pNewTokens )
-                    pNew = new ScRangeData( pDoc, aInsName, *pNewTokens, aPos, nType );
-                else
-                    pNew = new ScRangeData( pDoc, aInsName, aContent, aPos, nType, eGrammar );
-				pNew->SetIndex( pOld->GetIndex() );
-
-                pNewRanges->AtFree( nPos );
-                if ( pNewRanges->Insert(pNew) )
-				{
-					ScDocFunc aFunc(*pDocShell);
-                    aFunc.SetNewRangeNames( pNewRanges, sal_True );
-
-					aName = aInsName;	//! broadcast?
-				}
-				else
-                {
-					delete pNew;		//! uno::Exception/Fehler oder so
-                    delete pNewRanges;
-                }
-			}
-		}
-	}
+       if (pDocShell)
+       {
+              ScDocument* pDoc = pDocShell->GetDocument();
+              ScRangeName* pNames = pDoc->GetRangeName();
+              if (pNames)
+              {
+                     sal_uInt16 nPos = 0;
+                     SCTAB nameScope = MAXTABCOUNT;
+                     if (aScopeName != EMPTY_STRING ) 
+                         pDoc->GetTable(aScopeName, nameScope);
+					 
+                     if (pNames->SearchName( aName, nPos, nameScope ))
+                     {
+                            SCTAB newNameScope = MAXTABCOUNT;
+                            if (pNewScopeName && *pNewScopeName != EMPTY_STRING && !pDoc->GetTable(*pNewScopeName, newNameScope))
+                                return;
+							//added for namerange renew
+							else if (!pNewScopeName || *pNewScopeName == EMPTY_STRING )
+								newNameScope = nameScope;
+							//end of add
+
+                            ScRangeName* pNewRanges = new ScRangeName( *pNames );
+                            ScRangeData* pOld = (*pNames)[nPos];
+
+                            String aInsName(pOld->GetName());
+                            if (pNewRangeName)
+                                aInsName = *pNewRangeName;
+                            String aContent;                            // Content string based =>
+                            pOld->GetSymbol( aContent, eGrammar);   // no problems with changed positions and such.
+                            if (pNewContent)
+                                aContent = *pNewContent;
+                            ScAddress aPos(pOld->GetPos());
+                            if (pNewPos)
+                                aPos = *pNewPos;
+                            sal_uInt16 nType = pOld->GetType();
+                            if (pNewType)
+                                nType = *pNewType;
+
+                            ScRangeData* pNew = NULL;
+                            if ( pNewTokens )
+                                pNew = new ScRangeData( pDoc, aInsName, *pNewTokens, aPos, nType );
+                            else
+                                pNew = new ScRangeData( pDoc, aInsName, aContent, aPos, nType, eGrammar );
+                            pNew->SetIndex( pOld->GetIndex() );
+                            pNew->SetRangeScope(newNameScope);
+						   	
+                            pNewRanges->AtFree( nPos );
+                            if ( pNewRanges->Insert(pNew) )
+                            {
+                                 ScDocFunc aFunc(*pDocShell);
+                                 aFunc.SetNewRangeNames( pNewRanges, sal_True );
+                                 aName = aInsName;	//! broadcast?
+                                 aScopeName = pNewScopeName ? *pNewScopeName : aScopeName;
+                            }
+                            else
+                            {
+                                 delete pNew;		//! uno::Exception/Fehler oder so
+                                 delete pNewRanges;
+                            }
+                       }
+              }
+       }
 }
 
 
@@ -204,6 +223,27 @@ void SAL_CALL ScNamedRangeObj::setName( 
 	if ( aName != aNewStr )					// some error occured...
 		throw uno::RuntimeException();		// no other exceptions specified
 }
+rtl::OUString SAL_CALL ScNamedRangeObj::getScopeName() throw(uno::RuntimeException)
+{
+	ScUnoGuard aGuard;
+	return aScopeName;
+}
+
+void SAL_CALL ScNamedRangeObj::setScopeAndRangeName( const rtl::OUString& aNewScopeName, const rtl::OUString& aNewRangeName )
+												throw(uno::RuntimeException)
+{
+	ScUnoGuard aGuard;
+	//!	Formeln anpassen ?????
+
+	String aNewRangeStr(aNewRangeName);
+	String aNewScopeStr(aNewScopeName);
+    // GRAM_PODF_A1 for API compatibility.
+	Modify_Impl( &aNewRangeStr, NULL, NULL, NULL, NULL,formula::FormulaGrammar::GRAM_PODF_A1,  aNewScopeName.getLength() == 0 ? NULL : &aNewScopeStr);
+
+	if ( aScopeName != aNewScopeStr || aName != aNewRangeStr  )					// some error occured...
+		throw uno::RuntimeException();		// no other exceptions specified
+}
+
 
 rtl::OUString SAL_CALL ScNamedRangeObj::getContent() throw(uno::RuntimeException)
 {
@@ -513,7 +553,7 @@ ScNamedRangeObj* ScNamedRangesObj::GetOb
 				if (lcl_UserVisibleName(pData))			// interne weglassen
 				{
 					if ( nPos == nIndex )
-						return new ScNamedRangeObj( pDocShell, pData->GetName() );
+						return new ScNamedRangeObj( pDocShell, pData->GetName(), pData->GetScopeSheetName() );
 					++nPos;
 				}
 			}
@@ -529,13 +569,15 @@ ScNamedRangeObj* ScNamedRangesObj::GetOb
 	return NULL;
 }
 
-void SAL_CALL ScNamedRangesObj::addNewByName( const rtl::OUString& aName,
-		const rtl::OUString& aContent, const table::CellAddress& aPosition,
-		sal_Int32 nUnoType ) throw(uno::RuntimeException)
+ScNamedRangeObj* ScNamedRangesObj::GetObjectByScopeName_Impl(const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName)
+{
+     if ( pDocShell && hasByScopeName(aScopeName, aRangeName) )
+		return new ScNamedRangeObj( pDocShell, String(aRangeName),String(aScopeName) );
+	return NULL;
+}
+void ScNamedRangesObj::ImplAddNewByScopeAndName(SCTAB aScope, const ::rtl::OUString& aRangeName, const ::rtl::OUString& aContent,
+								const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nUnoType) throw(uno::RuntimeException)
 {
-	ScUnoGuard aGuard;
-	String aNameStr(aName);
-	String aContStr(aContent);
 	ScAddress aPos( (SCCOL)aPosition.Column, (SCROW)aPosition.Row, aPosition.Sheet );
 
 	sal_uInt16 nNewType = RT_NAME;
@@ -544,29 +586,34 @@ void SAL_CALL ScNamedRangesObj::addNewBy
 	if ( nUnoType & sheet::NamedRangeFlag::COLUMN_HEADER )		nNewType |= RT_COLHEADER;
 	if ( nUnoType & sheet::NamedRangeFlag::ROW_HEADER )			nNewType |= RT_ROWHEADER;
 
-	sal_Bool bDone = sal_False;
+	bool bDone = false;
 	if (pDocShell)
 	{
 		ScDocument* pDoc = pDocShell->GetDocument();
 		ScRangeName* pNames = pDoc->GetRangeName();
-        sal_uInt16 nIndex = 0;
-		if (pNames && !pNames->SearchName(aNameStr, nIndex))
+              sal_uInt16 nIndex = 0;
+              String aNameStr(aRangeName);
+	       String aContStr(aContent);
+		if (pNames && !pNames->SearchName(aNameStr, nIndex,aScope))
 		{
-            ScRangeName* pNewRanges = new ScRangeName( *pNames );
+                   ScRangeName* pNewRanges = new ScRangeName( *pNames );
             // GRAM_PODF_A1 for API compatibility.
-			ScRangeData* pNew = new ScRangeData( pDoc, aNameStr, aContStr,
-												aPos, nNewType,formula::FormulaGrammar::GRAM_PODF_A1 );
-            if ( pNewRanges->Insert(pNew) )
-			{
+                   ScRangeData* pNew = new ScRangeData( pDoc, aNameStr, aContStr,
+												aPos, nNewType,formula::FormulaGrammar::GRAM_PODF_A1 );//GRAM_ODFF,//
+
+                   pNew->SetRangeScope(aScope);
+			
+                   if ( pNewRanges->Insert(pNew) )
+                   {
 				ScDocFunc aFunc(*pDocShell);
-                aFunc.SetNewRangeNames( pNewRanges, sal_True );
-				bDone = sal_True;
-			}
-			else
-            {
+                            aFunc.SetNewRangeNames( pNewRanges, sal_True );
+				bDone = true;
+                   }
+                   else
+                   {
 				delete pNew;
-                delete pNewRanges;
-            }
+                            delete pNewRanges;
+                   }
 		}
 	}
 
@@ -574,6 +621,29 @@ void SAL_CALL ScNamedRangesObj::addNewBy
 		throw uno::RuntimeException();		// no other exceptions specified
 }
 
+void SAL_CALL ScNamedRangesObj::addNewByName( const rtl::OUString& aName,
+		const rtl::OUString& aContent, const table::CellAddress& aPosition,
+		sal_Int32 nUnoType ) throw(uno::RuntimeException)
+{
+       ScUnoGuard aGuard;
+       ImplAddNewByScopeAndName(MAXTABCOUNT, aName, aContent, aPosition, nUnoType);
+}
+
+
+void SAL_CALL ScNamedRangesObj::addNewByScopeName( const rtl::OUString& aScopeName,const rtl::OUString& aRangeName,
+		const rtl::OUString& aContent, const table::CellAddress& aPosition,
+		sal_Int32 nUnoType ) throw(uno::RuntimeException)
+{
+       ScUnoGuard aGuard;
+       SCTAB scope = MAXTABCOUNT;
+       if (aScopeName.getLength() != 0 && pDocShell && 
+		          !pDocShell->GetDocument()->GetTable( String(aScopeName), scope ) )
+           throw uno::RuntimeException();
+       ImplAddNewByScopeAndName(scope, aRangeName, aContent, aPosition, nUnoType);
+		
+		
+}
+
 void SAL_CALL ScNamedRangesObj::addNewFromTitles( const table::CellRangeAddress& aSource,
 									sheet::Border aBorder ) throw(uno::RuntimeException)
 {
@@ -601,26 +671,24 @@ void SAL_CALL ScNamedRangesObj::addNewFr
 	}
 }
 
-void SAL_CALL ScNamedRangesObj::removeByName( const rtl::OUString& aName )
-												throw(uno::RuntimeException)
+void ScNamedRangesObj::ImplRemoveByScopeAndName(SCTAB aScope, const ::rtl::OUString& aRangeName)
+								throw(uno::RuntimeException)
 {
-	ScUnoGuard aGuard;
-	sal_Bool bDone = sal_False;
+	bool bDone = false;
 	if (pDocShell)
 	{
 		ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
 		if (pNames)
 		{
-			String aString(aName);
 			sal_uInt16 nPos = 0;
-			if (pNames->SearchName( aString, nPos ))
+			if (pNames->SearchName( String(aRangeName), nPos, aScope ))
 				if ( lcl_UserVisibleName((*pNames)[nPos]) )
 				{
-                    ScRangeName* pNewRanges = new ScRangeName(*pNames);
+                                   ScRangeName* pNewRanges = new ScRangeName(*pNames);
 					pNewRanges->AtFree(nPos);
 					ScDocFunc aFunc(*pDocShell);
-                    aFunc.SetNewRangeNames( pNewRanges, sal_True );
-					bDone = sal_True;
+                                   aFunc.SetNewRangeNames( pNewRanges, sal_True );
+					bDone = true;
 				}
 		}
 	}
@@ -629,6 +697,26 @@ void SAL_CALL ScNamedRangesObj::removeBy
 		throw uno::RuntimeException();		// no other exceptions specified
 }
 
+void SAL_CALL ScNamedRangesObj::removeByName( const rtl::OUString& aName )
+												throw(uno::RuntimeException)
+{
+     ScUnoGuard aGuard;
+     ImplRemoveByScopeAndName(MAXTABCOUNT, aName);	
+}
+
+
+void SAL_CALL ScNamedRangesObj::removeByScopeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName )
+								throw(uno::RuntimeException)
+{
+       ScUnoGuard aGuard;
+       SCTAB scope = MAXTABCOUNT;
+	if (aScopeName.getLength() != 0 && pDocShell && 
+		                 !pDocShell->GetDocument()->GetTable( String(aScopeName), scope ))
+           throw uno::RuntimeException();
+	ImplRemoveByScopeAndName(scope, aRangeName);	
+}
+
+
 void SAL_CALL ScNamedRangesObj::outputList( const table::CellAddress& aOutputPosition )
 												throw(uno::RuntimeException)
 {
@@ -675,7 +763,7 @@ uno::Any SAL_CALL ScNamedRangesObj::getB
 									lang::WrappedTargetException, uno::RuntimeException)
 {
 	ScUnoGuard aGuard;
-	uno::Reference< sheet::XNamedRange >  xRange(GetObjectByIndex_Impl((sal_uInt16)nIndex));
+	uno::Reference< sheet::XNamedRange2 >  xRange(GetObjectByIndex_Impl((sal_uInt16)nIndex));
 	if ( xRange.is() )
         return uno::makeAny(xRange);
 	else
@@ -686,7 +774,7 @@ uno::Any SAL_CALL ScNamedRangesObj::getB
 uno::Type SAL_CALL ScNamedRangesObj::getElementType() throw(uno::RuntimeException)
 {
 	ScUnoGuard aGuard;
-	return ::getCppuType((const uno::Reference< sheet::XNamedRange >*)0);	// muss zu getByIndex passen
+	return ::getCppuType((const uno::Reference< sheet::XNamedRange2 >*)0);	// muss zu getByIndex passen
 }
 
 sal_Bool SAL_CALL ScNamedRangesObj::hasElements() throw(uno::RuntimeException)
@@ -700,7 +788,7 @@ uno::Any SAL_CALL ScNamedRangesObj::getB
 					lang::WrappedTargetException, uno::RuntimeException)
 {
 	ScUnoGuard aGuard;
-	uno::Reference< sheet::XNamedRange >  xRange(GetObjectByName_Impl(aName));
+	uno::Reference< sheet::XNamedRange2 >  xRange(GetObjectByName_Impl(aName));
 	if ( xRange.is() )
         return uno::makeAny(xRange);
 	else
@@ -708,6 +796,18 @@ uno::Any SAL_CALL ScNamedRangesObj::getB
 //    return uno::Any();
 }
 
+uno::Any SAL_CALL ScNamedRangesObj::getByScopeName( const rtl::OUString& aScopeName, const rtl::OUString& aRangeName )
+			throw(container::NoSuchElementException,
+					lang::WrappedTargetException, uno::RuntimeException)
+{
+	ScUnoGuard aGuard;
+	uno::Reference< sheet::XNamedRange2 >  xRange(GetObjectByScopeName_Impl(aScopeName, aRangeName));
+	if ( xRange.is() )
+        return uno::makeAny(xRange);
+	else
+		throw container::NoSuchElementException();
+//    return uno::Any();
+}
 uno::Sequence<rtl::OUString> SAL_CALL ScNamedRangesObj::getElementNames()
 												throw(uno::RuntimeException)
 {
@@ -736,6 +836,36 @@ uno::Sequence<rtl::OUString> SAL_CALL Sc
 	return uno::Sequence<rtl::OUString>(0);
 }
 
+uno::Sequence< sheet::RangeScopeName > SAL_CALL ScNamedRangesObj::getElementScopeNames()
+												throw(uno::RuntimeException)
+{
+       ScUnoGuard aGuard;
+	if (pDocShell)
+	{
+		ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
+		if (pNames)
+		{
+			long nVisCount = getCount();			// Namen mit lcl_UserVisibleName
+			uno::Sequence<sheet::RangeScopeName> aSeq(nVisCount);
+			sheet::RangeScopeName * pAry = aSeq.getArray();
+
+			sal_uInt16 nCount = pNames->GetCount();
+			sal_uInt16 nVisPos = 0;
+			for (sal_uInt16 i=0; i<nCount; i++)
+			{
+				ScRangeData* pData = (*pNames)[i];
+				if ( lcl_UserVisibleName(pData) )
+				{
+					pAry[nVisPos].RangeName = pData->GetName();
+					pAry[nVisPos++].ScopeName = pData->GetScopeSheetName();
+				}
+			}
+//			DBG_ASSERT(nVisPos == nVisCount, "huch, verzaehlt?");
+			return aSeq;
+		}
+	}
+	return uno::Sequence< sheet::RangeScopeName >(0);
+}
 sal_Bool SAL_CALL ScNamedRangesObj::hasByName( const rtl::OUString& aName )
 										throw(uno::RuntimeException)
 {
@@ -754,6 +884,27 @@ sal_Bool SAL_CALL ScNamedRangesObj::hasB
 	return sal_False;
 }
 
+sal_Bool SAL_CALL ScNamedRangesObj::hasByScopeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName)
+										throw(uno::RuntimeException)
+{
+	ScUnoGuard aGuard;
+	if (pDocShell)
+	{
+	       SCTAB scope = MAXTABCOUNT;
+	       if (aScopeName.getLength() != 0 && !pDocShell->GetDocument()->GetTable( String(aScopeName), scope ) )
+	           return sal_False; 
+			
+		ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
+		if (pNames)
+		{
+			sal_uInt16 nPos = 0;
+			if (pNames->SearchName( String(aRangeName), nPos, scope ))
+				if ( lcl_UserVisibleName((*pNames)[nPos]) )
+					return sal_True;
+		}
+	}
+	return sal_False;
+}
 /** called from the XActionLockable interface methods on initial locking */
 void ScNamedRangesObj::lock()
 {

Modified: incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/styleuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/styleuno.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/styleuno.cxx (original)
+++ incubator/ooo/branches/writer001/main/sc/source/ui/unoobj/styleuno.cxx Mon Sep 17 08:06:09 2012
@@ -1531,8 +1531,13 @@ void SAL_CALL ScStyleObj::setPropertyVal
 		for (sal_Int32 i = 0; i < nCount; i++)
 		{
             const SfxItemPropertySimpleEntry*  pEntry = pPropertyMap->getByName( pNames[i] );
-            SetOnePropertyValue( pNames[i], pEntry, &pValues[i] );
+
+            // enhance ODS load performance
+            SetOnePropertyValueWithoutUpdate( pNames[i], pEntry, &pValues[i] );
 		}
+
+        // enhance ODS load performance
+        StyleSheetChangedUpdate();
 	}
 }
 
@@ -1691,6 +1696,13 @@ void SAL_CALL ScStyleObj::setPropertyVal
 void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, const SfxItemPropertySimpleEntry* pEntry, const uno::Any* pValue )
 								throw(lang::IllegalArgumentException, uno::RuntimeException)
 {
+    SetOnePropertyValueWithoutUpdate(rPropertyName, pEntry, pValue);
+    StyleSheetChangedUpdate();
+}
+
+void ScStyleObj::SetOnePropertyValueWithoutUpdate( const ::rtl::OUString& rPropertyName, const SfxItemPropertySimpleEntry* pEntry, const uno::Any* pValue )
+								throw(lang::IllegalArgumentException, uno::RuntimeException)
+{
 	SfxStyleSheetBase* pStyle = GetStyle_Impl();
     if ( pStyle && pEntry )
 	{
@@ -1943,31 +1955,43 @@ void ScStyleObj::SetOnePropertyValue( co
             }
 		}
 
-		//!	DocFunc-Funktion??
-		//!	Undo ?????????????
+        if(SFX_STYLE_FAMILY_PARA != eFamily)
+        {
+            //!	ModifyStyleSheet am Dokument (alte Werte merken)
 
-		ScDocument* pDoc = pDocShell->GetDocument();
-		if ( eFamily == SFX_STYLE_FAMILY_PARA )
-		{
-			//	Zeilenhoehen anpassen...
+            pDocShell->PageStyleModified( aStyleName, sal_True );
+		}
+	}
+}
 
-			VirtualDevice aVDev;
-			Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
-			double nPPTX = aLogic.X() / 1000.0;
-			double nPPTY = aLogic.Y() / 1000.0;
-			Fraction aZoom(1,1);
-			pDoc->StyleSheetChanged( pStyle, sal_False, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+bool ScStyleObj::StyleSheetChangedUpdate()
+{
+    SfxStyleSheetBase* pStyle = GetStyle_Impl();
 
-			pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
-			pDocShell->SetDocumentModified();
-		}
-		else
-		{
-			//!	ModifyStyleSheet am Dokument (alte Werte merken)
+    if(pStyle)
+    {
+        //!	DocFunc-Funktion??
+        //!	Undo ?????????????
 
-			pDocShell->PageStyleModified( aStyleName, sal_True );
-		}
-	}
+        if(SFX_STYLE_FAMILY_PARA == eFamily)
+        {
+            // adapt line heights
+            VirtualDevice aVDev;
+            const Point aLogic(aVDev.LogicToPixel(Point(1000,1000), MAP_TWIP));
+            const double nPPTX(aLogic.X() / 1000.0);
+            const double nPPTY(aLogic.Y() / 1000.0);
+            const Fraction aZoom(1,1);
+            ScDocument* pDoc = pDocShell->GetDocument();
+
+            pDoc->StyleSheetChanged(pStyle, sal_False, &aVDev, nPPTX, nPPTY, aZoom, aZoom);
+            pDocShell->PostPaint(0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT);
+            pDocShell->SetDocumentModified();
+        }
+
+        return true;
+    }
+
+    return false;
 }
 
 uno::Any SAL_CALL ScStyleObj::getPropertyValue( const rtl::OUString& aPropertyName )

Modified: incubator/ooo/branches/writer001/main/sc/source/ui/vba/vbarange.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sc/source/ui/vba/vbarange.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sc/source/ui/vba/vbarange.cxx (original)
+++ incubator/ooo/branches/writer001/main/sc/source/ui/vba/vbarange.cxx Mon Sep 17 08:06:09 2012
@@ -124,6 +124,7 @@
 #include <cellsuno.hxx>
 #include <dbcolect.hxx>
 #include "docfunc.hxx"
+#include <docuno.hxx>
 #include "transobj.hxx"
 
 #include <sfx2/dispatch.hxx>
@@ -1408,6 +1409,19 @@ lcl_setupBorders( const uno::Reference< 
 	return borders;
 }
 
+void lcl_NotifyRangeChanges( const uno::Reference< frame::XModel >& xModel, ScCellRangesBase* pUnoRangesBase ) // i108874
+{
+	if ( xModel.is() && pUnoRangesBase )
+	{
+		ScModelObj* pModelObj = ScModelObj::getImplementation( xModel );
+		const ScRangeList& aCellRanges = pUnoRangesBase->GetRangeList();
+		if ( pModelObj && pModelObj->HasChangesListeners() )
+		{
+			pModelObj->NotifyChanges( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cell-change" ) ), aCellRanges );
+		}
+	}
+}
+
 ScVbaRange::ScVbaRange( uno::Sequence< uno::Any> const & args,
     uno::Reference< uno::XComponentContext> const & xContext )  throw ( lang::IllegalArgumentException ) : ScVbaRange_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< beans::XPropertySet >( args, 1, false ), getModelFromXIf( getXSomethingFromArgs< uno::XInterface >( args, 1 ) ), true ), mbIsRows( sal_False ), mbIsColumns( sal_False )
 {
@@ -1571,6 +1585,8 @@ ScVbaRange::setValue( const uno::Any  &a
 	}	
 	CellValueSetter valueSetter( aValue );
 	setValue( aValue, valueSetter, true );
+	// Fire the range change event.
+	lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
 }
 
 void SAL_CALL
@@ -1579,6 +1595,8 @@ ScVbaRange::Clear() throw (uno::RuntimeE
     using namespace ::com::sun::star::sheet::CellFlags;
 	sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED;
 	ClearContents( nFlags, true );
+	// Fire the range change event
+	lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
 }
 
 //helper ClearContent
@@ -1631,6 +1649,8 @@ ScVbaRange::ClearFormats() throw (uno::R
     using namespace ::com::sun::star::sheet::CellFlags;
 	sal_Int32 nFlags = HARDATTR | FORMATTED | EDITATTR;
 	ClearContents( nFlags, false );
+	// Fire the range change event.
+	lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
 }
 
 void
@@ -1646,6 +1666,8 @@ ScVbaRange::setFormulaValue( const uno::
 	}	
 	CellFormulaValueSetter formulaValueSetter( rFormula, getScDocument(), eGram );
 	setValue( rFormula, formulaValueSetter, bFireEvent );
+	// Fire the range change event.
+	lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
 }
 
 uno::Any 
@@ -1805,6 +1827,9 @@ ScVbaRange::fillSeries( sheet::FillDirec
 	
 	uno::Reference< sheet::XCellSeries > xCellSeries(mxRange, uno::UNO_QUERY_THROW );
 	xCellSeries->fillSeries( nFillDirection, nFillMode, nFillDateMode, fStep, fEndValue );
+
+	// Fire the range change event.
+	lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
 }
 
 void 
@@ -3050,7 +3075,17 @@ ScVbaRange::Replace( const ::rtl::OUStri
 		// OOo.org afaik
 
 		uno::Reference< util::XSearchDescriptor > xSearch( xDescriptor, uno::UNO_QUERY );
+		// Find all cells that being replaced, used to fire the range changed event.
+		uno::Reference< container::XIndexAccess > xIndexAccess = xReplace->findAll( xSearch );
 		xReplace->replaceAll( xSearch );
+
+		if ( xIndexAccess.is() && xIndexAccess->getCount() > 0 )
+		{
+			// Fire the range change event.
+			ScCellRangesBase* pScCellRangesBase = ScCellRangesBase::getImplementation( xIndexAccess );
+			// i108874 - the original convert method will fail in SUSE
+			lcl_NotifyRangeChanges( getScDocShell()->GetModel(), pScCellRangesBase ); 
+		}
 	}
 	return sal_True; // always
 }

Modified: incubator/ooo/branches/writer001/main/sc/util/hidother.src
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sc/util/hidother.src?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sc/util/hidother.src (original)
+++ incubator/ooo/branches/writer001/main/sc/util/hidother.src Mon Sep 17 08:06:09 2012
@@ -144,9 +144,9 @@ hidspecial HID_FUNC_ISTTEXT		 { HelpID =
 hidspecial HID_FUNC_ISTZAHL		 { HelpID = HID_FUNC_ISTZAHL; };
 hidspecial HID_FUNC_ISTFORMEL		 { HelpID = HID_FUNC_ISTFORMEL; };
 hidspecial HID_FUNC_FORMEL		 { HelpID = HID_FUNC_FORMEL; };
-hidspecial HID_FUNC_N		 { HelpID = HID_FUNC_N; };
-hidspecial HID_FUNC_NV		 { HelpID = HID_FUNC_NV; };
-hidspecial HID_FUNC_TYP		 { HelpID = HID_FUNC_TYP; };
+hidspecial HID_FUNC_N		 	 { HelpID = HID_FUNC_N; };
+hidspecial HID_FUNC_NV		 	 { HelpID = HID_FUNC_NV; };
+hidspecial HID_FUNC_TYP		 	 { HelpID = HID_FUNC_TYP; };
 hidspecial HID_FUNC_ZELLE		 { HelpID = HID_FUNC_ZELLE; };
 hidspecial HID_FUNC_AKTUELL		 { HelpID = HID_FUNC_AKTUELL; };
 hidspecial HID_FUNC_FALSCH		 { HelpID = HID_FUNC_FALSCH; };
@@ -154,16 +154,20 @@ hidspecial HID_FUNC_NICHT		 { HelpID = H
 hidspecial HID_FUNC_WAHR		 { HelpID = HID_FUNC_WAHR; };
 hidspecial HID_FUNC_WENN		 { HelpID = HID_FUNC_WENN; };
 hidspecial HID_FUNC_ODER		 { HelpID = HID_FUNC_ODER; };
-hidspecial HID_FUNC_UND		 { HelpID = HID_FUNC_UND; };
-hidspecial HID_FUNC_ABS		 { HelpID = HID_FUNC_ABS; };
+hidspecial HID_FUNC_UND		 	 { HelpID = HID_FUNC_UND; };
+hidspecial HID_FUNC_ABS		 	 { HelpID = HID_FUNC_ABS; };
 hidspecial HID_FUNC_POTENZ		 { HelpID = HID_FUNC_POTENZ; };
-hidspecial HID_FUNC_ANZAHLLEEREZELLEN		 { HelpID = HID_FUNC_ANZAHLLEEREZELLEN; };
-hidspecial HID_FUNC_PI		 { HelpID = HID_FUNC_PI; };
+hidspecial HID_FUNC_ANZAHLLEEREZELLEN	 { HelpID = HID_FUNC_ANZAHLLEEREZELLEN; };
+hidspecial HID_FUNC_PI		 	 { HelpID = HID_FUNC_PI; };
 hidspecial HID_FUNC_SUMME		 { HelpID = HID_FUNC_SUMME; };
-hidspecial HID_FUNC_QUADRATESUMME		 { HelpID = HID_FUNC_QUADRATESUMME; };
+hidspecial HID_FUNC_QUADRATESUMME	 { HelpID = HID_FUNC_QUADRATESUMME; };
 hidspecial HID_FUNC_PRODUKT		 { HelpID = HID_FUNC_PRODUKT; };
 hidspecial HID_FUNC_SUMMEWENN		 { HelpID = HID_FUNC_SUMMEWENN; };
 hidspecial HID_FUNC_ZAEHLENWENN		 { HelpID = HID_FUNC_ZAEHLENWENN; };
+hidspecial HID_FUNC_AVERAGEIF		 { HelpID = HID_FUNC_AVERAGEIF; };
+hidspecial HID_FUNC_SUMIFS		 { HelpID = HID_FUNC_SUMIFS; };
+hidspecial HID_FUNC_AVERAGEIFS		 { HelpID = HID_FUNC_AVERAGEIFS; };
+hidspecial HID_FUNC_COUNTIFS		 { HelpID = HID_FUNC_COUNTIFS; };
 hidspecial HID_FUNC_WURZEL		 { HelpID = HID_FUNC_WURZEL; };
 hidspecial HID_FUNC_ZUFALLSZAHL		 { HelpID = HID_FUNC_ZUFALLSZAHL; };
 hidspecial HID_FUNC_ISTGERADE		 { HelpID = HID_FUNC_ISTGERADE; };

Modified: incubator/ooo/branches/writer001/main/scp2/prj/build.lst
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/scp2/prj/build.lst?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/scp2/prj/build.lst (original)
+++ incubator/ooo/branches/writer001/main/scp2/prj/build.lst Mon Sep 17 08:06:09 2012
@@ -19,10 +19,9 @@ cp    scp2\source\ooo             nmake 
 cp    scp2\source\python          nmake    -    all    cp_python cp_langmacros cp_langtemplates NULL
 cp    scp2\source\quickstart      nmake    -    all    cp_quickstart cp_langmacros cp_langtemplates NULL
 cp    scp2\source\sdkoo           nmake    -    all    cp_sdkoo cp_langmacros cp_langtemplates NULL
-cp    scp2\source\testtool        nmake    -    all    cp_testtool cp_langmacros cp_langtemplates NULL
 cp    scp2\source\writer          nmake    -    all    cp_writer cp_langmacros cp_langtemplates NULL
 cp    scp2\source\base            nmake    -    all    cp_base cp_langmacros cp_langtemplates NULL
 cp    scp2\source\xsltfilter      nmake    -    all    cp_xsltfilter cp_langmacros cp_langtemplates NULL
 cp    scp2\source\winexplorerext  nmake    -    all    cp_winexplorerext cp_langmacros cp_langtemplates NULL
 cp    scp2\source\onlineupdate    nmake    -    all    cp_update cp_langmacros cp_langtemplates NULL
-cp    scp2\util                   nmake    -    all    cp_util cp_activex cp_binfilter cp_calc cp_canvas cp_crashrep cp_draw cp_gnome cp_graphicfilter cp_impress cp_javafilter cp_kde cp_layout cp_math cp_ooo cp_python cp_quickstart cp_testtool cp_writer cp_base cp_xsltfilter cp_winexplorerext cp_sdkoo cp_update NULL
+cp    scp2\util                   nmake    -    all    cp_util cp_activex cp_binfilter cp_calc cp_canvas cp_crashrep cp_draw cp_gnome cp_graphicfilter cp_impress cp_javafilter cp_kde cp_layout cp_math cp_ooo cp_python cp_quickstart cp_writer cp_base cp_xsltfilter cp_winexplorerext cp_sdkoo cp_update NULL

Modified: incubator/ooo/branches/writer001/main/scp2/source/ooo/module_langpack.ulf
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/scp2/source/ooo/module_langpack.ulf?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/scp2/source/ooo/module_langpack.ulf (original)
+++ incubator/ooo/branches/writer001/main/scp2/source/ooo/module_langpack.ulf Mon Sep 17 08:06:09 2012
@@ -526,10 +526,10 @@ en-US = "Sanskrit"
 en-US = "Installs Sanskrit support in %PRODUCTNAME %PRODUCTVERSION"
 
 [STR_NAME_MODULE_LANGPACK_FA]
-en-US = "Farsi"
+en-US = "Persian"
 
 [STR_DESC_MODULE_LANGPACK_FA]
-en-US = "Installs Farsi support in %PRODUCTNAME %PRODUCTVERSION"
+en-US = "Installs Persian support in %PRODUCTNAME %PRODUCTVERSION"
 
 [STR_NAME_MODULE_LANGPACK_FO]
 en-US = "Faroese"

Modified: incubator/ooo/branches/writer001/main/scp2/util/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/scp2/util/makefile.mk?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/scp2/util/makefile.mk (original)
+++ incubator/ooo/branches/writer001/main/scp2/util/makefile.mk Mon Sep 17 08:06:09 2012
@@ -69,8 +69,6 @@ SCP1FILES  = installation_ooo.par       
              module_systemint.par          \
              module_graphicfilter.par      \
              file_graphicfilter.par        \
-             module_testtool.par           \
-             file_testtool.par             \
              module_xsltfilter.par         \
              file_xsltfilter.par           \
              module_python.par             \
@@ -226,8 +224,6 @@ SCP2FILES  = installation_ooo.par       
              module_systemint.par          \
              module_graphicfilter.par      \
              file_graphicfilter.par        \
-             module_testtool.par           \
-             file_testtool.par             \
              module_xsltfilter.par         \
              file_xsltfilter.par           \
              module_python.par             \

Modified: incubator/ooo/branches/writer001/main/sd/source/core/sdpage.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/core/sdpage.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/core/sdpage.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/core/sdpage.cxx Mon Sep 17 08:06:09 2012
@@ -1188,6 +1188,7 @@ static void CalcAutoLayoutRectangles( Sd
 	{
 		SdPage& rMasterPage = static_cast<SdPage&>(rPage.TRG_GetMasterPage());
 		SdrObject* pMasterTitle = rMasterPage.GetPresObj( PRESOBJ_TITLE );
+		SdrObject* pMasterSubTitle = rMasterPage.GetPresObj( PRESOBJ_TEXT );        
 		SdrObject* pMasterOutline = rMasterPage.GetPresObj( rPage.GetPageKind()==PK_NOTES ? PRESOBJ_NOTES : PRESOBJ_OUTLINE );
 
 		if( pMasterTitle )
@@ -1195,8 +1196,9 @@ static void CalcAutoLayoutRectangles( Sd
 
 		if (aTitleRect.IsEmpty() )
 			aTitleRect = rPage.GetTitleRect();
-
-		if( pMasterOutline )
+		if( pMasterSubTitle )                                           
+			aLayoutRect = pMasterSubTitle->GetLogicRect();
+		else if( pMasterOutline )
 			aLayoutRect = pMasterOutline->GetLogicRect();
 
 		if (aLayoutRect.IsEmpty() )

Modified: incubator/ooo/branches/writer001/main/sd/source/filter/eppt/eppt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/filter/eppt/eppt.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/filter/eppt/eppt.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/filter/eppt/eppt.cxx Mon Sep 17 08:06:09 2012
@@ -1826,7 +1826,8 @@ void PPTWriter::ImplWriteOLE( sal_uInt32
                 if ( pPtr->xControlModel.is() )
                 {
                     String aName;
-                    ::com::sun::star::awt::Size aSize;
+                    //Initialize the graphic size which will be used on export
+                    ::com::sun::star::awt::Size  aSize( pPtr->xShape->getSize() );
                     SvStorageRef xDest( new SvStorage( new SvMemoryStream(), sal_True ) );
                     sal_Bool bOk = SvxMSConvertOCXControls::WriteOCXStream( xDest, pPtr->xControlModel, aSize, aName );
                     if ( bOk )

Modified: incubator/ooo/branches/writer001/main/sd/source/filter/eppt/eppt.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/filter/eppt/eppt.hxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/filter/eppt/eppt.hxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/filter/eppt/eppt.hxx Mon Sep 17 08:06:09 2012
@@ -820,7 +820,7 @@ class PPTWriter : public GroupTable, pub
 													PageType ePageType,
 														sal_Bool bMaster,
 															int nPageNumber = 0 );
-		void				ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 );
+		sal_Bool			ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 );
 		void				ImplCreateTable( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rXShape, EscherSolverContainer& aSolverContainer,
 								EscherPropertyContainer& aPropOpt );
 		::com::sun::star::awt::Point		ImplMapPoint( const ::com::sun::star::awt::Point& );

Modified: incubator/ooo/branches/writer001/main/sd/source/filter/eppt/epptso.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/filter/eppt/epptso.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/filter/eppt/epptso.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/filter/eppt/epptso.cxx Mon Sep 17 08:06:09 2012
@@ -2672,6 +2672,11 @@ void ParagraphObj::ImplGetNumberingLevel
                     case SVX_NUM_BITMAP :
                     case SVX_NUM_CHARS_UPPER_LETTER_N :     // zaehlt von  a-z, aa-zz, aaa-zzz
                     case SVX_NUM_CHARS_LOWER_LETTER_N :
+					case SVX_NUM_NUMBER_UPPER_ZH:
+					case SVX_NUM_CIRCLE_NUMBER:
+					case SVX_NUM_NUMBER_UPPER_ZH_TW:
+					case SVX_NUM_NUMBER_LOWER_ZH:
+					case SVX_NUM_FULL_WIDTH_ARABIC:
                     {
                         if ( nNumberingType != SVX_NUM_CHAR_SPECIAL )
                         {
@@ -2757,6 +2762,45 @@ void ParagraphObj::ImplGetNumberingLevel
                                     }
                                 }
                                 break;
+								case SVX_NUM_NUMBER_UPPER_ZH :
+								{
+									if ( sSuffix.Len() )			
+										nMappedNumType = 0x110001;   // Simplified Chinese with single-byte period.
+									else
+										nMappedNumType = 0x100001;   // Simplified Chinese.
+								}
+								break;
+								case SVX_NUM_CIRCLE_NUMBER :
+                                {
+									nMappedNumType = 0x120001;   // Double byte circle numbers.
+                                }
+                                break;								
+								case SVX_NUM_NUMBER_UPPER_ZH_TW :
+								{
+									if ( sSuffix.Len() )			
+										nMappedNumType = 0x160001;   // Traditional Chinese with single-byte period.
+									else
+										nMappedNumType = 0x150001;   // Traditional Chinese.
+								}
+								break;
+								case SVX_NUM_NUMBER_LOWER_ZH :
+								{
+									if ( sSuffix == String( sal_Unicode(0xff0e)) )
+										nMappedNumType = 0x260001;   // Japanese with double-byte period.
+									else if ( sSuffix.Len() )
+										nMappedNumType = 0x1B0001;   // Japanese/Korean with single-byte period.
+									else
+										nMappedNumType = 0x1A0001;   // Japanese/Korean.
+								}
+								break;
+								case SVX_NUM_FULL_WIDTH_ARABIC :
+								{
+									if ( sSuffix.Len() )			
+										nMappedNumType = 0x1D0001;   // Double-byte Arabic numbers with double-byte period.
+									else
+										nMappedNumType = 0x1C0001;   // Double-byte Arabic numbers.
+								}
+								break;
 								default:
 									break;
                             }
@@ -2766,6 +2810,7 @@ void ParagraphObj::ImplGetNumberingLevel
                         if ( mbIsBullet && bNumberingIsNumber )
                             nBulletFlags |= 1;
                     }
+		default: break;
                 }
             }
         }
@@ -3397,6 +3442,11 @@ void PPTWriter::ImplWriteTextStyleAtom( 
                             case SVX_NUM_ROMAN_UPPER :
                             case SVX_NUM_ROMAN_LOWER :
                             case SVX_NUM_ARABIC :
+							case SVX_NUM_NUMBER_UPPER_ZH:
+							case SVX_NUM_CIRCLE_NUMBER:
+							case SVX_NUM_NUMBER_UPPER_ZH_TW:
+							case SVX_NUM_NUMBER_LOWER_ZH:
+							case SVX_NUM_FULL_WIDTH_ARABIC:
                                 nNumberingType = pBulletPara->nMappedNumType;
                             break;
 
@@ -4543,6 +4593,7 @@ void PPTWriter::ImplWritePage( const PHL
                             << nPageId;
                 PPTExOleObjEntry* pEntry = new PPTExOleObjEntry( OCX_CONTROL, mpExEmbed->Tell() );
                 pEntry->xControlModel = aXControlModel;
+                pEntry->xShape = mXShape;
                 maExOleObj.Insert( pEntry );
 
                 mnExEmbed++;
@@ -4616,6 +4667,9 @@ void PPTWriter::ImplWritePage( const PHL
                 ImplCreateShape( ESCHER_ShpInst_HostControl, nSpFlags, aSolverContainer );
                 if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False  ) )
                     aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
+                //export form control graphic
+                else if ( aPropOpt.CreateBlipPropertiesforOLEControl(mXPropSet,mXShape))
+                    aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
                 aPropOpt.AddOpt( ESCHER_Prop_pictureId, mnExEmbed );
                 aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0x10000 );
 
@@ -5038,6 +5092,13 @@ void PPTWriter::ImplWritePage( const PHL
                 }
                 if ( !mbPresObj )
                 {
+					if (ePageType == MASTER )
+					{
+						SdrObject* pObj = GetSdrObjectFromXShape( mXShape );
+						if (pObj && pObj->IsNotVisibleAsMaster())
+							continue;
+					}
+					
                     mType = "drawing.Text";
 	                ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
                 }
@@ -5195,7 +5256,8 @@ void PPTWriter::ImplWritePage( const PHL
 				mnAngle = 0;
                 mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
                 ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
-
+				if ( aPropOpt.CreateMediaGraphicProperties( mXShape ) )
+					aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
 				::com::sun::star::uno::Any aAny;
 				if ( PropValue::GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MediaURL" ) ), sal_True ) )
 				{
@@ -5246,6 +5308,18 @@ void PPTWriter::ImplWritePage( const PHL
 									 << (sal_uInt16)EPP_ExObjRefAtom
 									 << (sal_uInt32)4
 									 << nRefId;
+						// write EPP_InteractiveInfo container for no_action
+						*pClientData << (sal_uInt32)( ( EPP_InteractiveInfo << 16 ) | 0xf ) << (sal_uInt32)24;
+						*pClientData << (sal_uInt16)0
+									 << (sal_uInt16)EPP_InteractiveInfoAtom
+									 << (sal_uInt32)16
+									 << (sal_uInt32) 0
+									 << (sal_uInt32) 0
+									 << (sal_uInt8) 6
+									 << (sal_uInt8) 0
+									 << (sal_uInt8) 0
+									 << (sal_uInt8) 0
+									 << (sal_uInt32) 0;
 					}
 				}
 			}
@@ -5579,11 +5653,12 @@ struct CellBorder
 	CellBorder() : mnPos ( 0 ), mnLength( 0 ){};
 };
 
-void PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 )
+sal_Bool PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2)
 {
 	sal_Int32 nLineWidth = pCellBorder->maCellBorder.OuterLineWidth + pCellBorder->maCellBorder.InnerLineWidth;
 	if ( nLineWidth )
 	{
+		nLineWidth *= 2;
 		mnAngle = 0;
 		mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
 		EscherPropertyContainer aPropOptSp;
@@ -5608,7 +5683,44 @@ void PPTWriter::ImplCreateCellBorder( co
 					<< nX2
 					<< nY2;
 		mpPptEscherEx->CloseContainer();
+		return sal_True;
+	}
+	return sal_False;
+}
+
+//get merged cell's width
+sal_Int32 GetCellRight( sal_Int32 nColumn,  
+	Rectangle& rect,
+	std::vector< std::pair< sal_Int32, sal_Int32 > >& aColumns,
+	uno::Reference< table::XMergeableCell >& xCell )
+{
+	sal_Int32 nRight = aColumns[ nColumn ].first + aColumns[ nColumn ].second;
+	for ( sal_Int32 nColumnSpan = 1; nColumnSpan < xCell->getColumnSpan(); nColumnSpan++ )
+	{
+		sal_uInt32 nC = nColumnSpan + nColumn;
+		if ( nC < aColumns.size() )
+			nRight += aColumns[ nC ].second;
+		else
+			nRight = rect.Right();
+	}
+	return nRight;
+}
+//get merged cell's height
+sal_Int32 GetCellBottom( sal_Int32 nRow, 
+	Rectangle& rect,
+	std::vector< std::pair< sal_Int32, sal_Int32 > >& aRows,
+	uno::Reference< table::XMergeableCell >& xCell )
+{
+	sal_Int32 nBottom = aRows[nRow].first + aRows[nRow].second;
+	for ( sal_Int32 nRowSpan = 1; nRowSpan < xCell->getRowSpan(); nRowSpan++ )
+	{
+		sal_uInt32 nR = nRowSpan + nRow;
+		if ( nR < aRows.size() )
+			nBottom += aRows[ nR ].second;
+		else
+			nBottom = rect.Bottom();
 	}
+	return nBottom;
 }
 
 void PPTWriter::WriteCString( SvStream& rSt, const String& rString, sal_uInt32 nInstance )
@@ -5714,26 +5826,9 @@ void PPTWriter::ImplCreateTable( uno::Re
 						{
 							sal_Int32 nLeft   = aColumns[ nColumn ].first;
 							sal_Int32 nTop    = aRows[ nRow ].first;
-							sal_Int32 nRight  = nLeft + aColumns[ nColumn ].second;
-							sal_Int32 nBottom = nTop + aRows[ nRow ].second;
-
-							for ( sal_Int32 nColumnSpan = 1; nColumnSpan < xCell->getColumnSpan(); nColumnSpan++ )
-							{
-								sal_uInt32 nC = nColumnSpan + nColumn;
-								if ( nC < aColumns.size() )
-									nRight += aColumns[ nC ].second;
-								else
-									nRight = maRect.Right();
-							}
-							for ( sal_Int32 nRowSpan = 1; nRowSpan < xCell->getRowSpan(); nRowSpan++ )
-							{
-								sal_uInt32 nR = nRowSpan + nRow;
-								if ( nR < aColumns.size() )
-									nBottom += aRows[ nR ].second;
-								else
-									nBottom = maRect.Bottom();
-							}
-
+							sal_Int32 nRight  = GetCellRight( nColumn, maRect,aColumns,xCell );
+							sal_Int32 nBottom = GetCellBottom( nRow,  maRect,aRows,xCell );
+							
 							mbFontIndependentLineSpacing = sal_False;
 							mXPropSet = uno::Reference< beans::XPropertySet >( xCell, uno::UNO_QUERY_THROW );
 							mXText = uno::Reference< text::XSimpleText >( xCell, uno::UNO_QUERY_THROW );
@@ -5792,106 +5887,112 @@ void PPTWriter::ImplCreateTable( uno::Re
 				static const rtl::OUString	sDiagonalBLTR( RTL_CONSTASCII_USTRINGPARAM ( "DiagonalBLTR" ) );
 
 				// creating horz lines
-				sal_Int32 nYPos = ImplMapPoint( rXShape->getPosition() ).Y;
 				for( sal_Int32 nLine = 0; nLine < ( xRows->getCount() + 1 ); nLine++ )
 				{
-					sal_Int32 nXPos = ImplMapPoint( rXShape->getPosition() ).X;
-					std::vector< CellBorder > vCellBorders;
 					for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ )
 					{
-						uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( nColumn ), uno::UNO_QUERY_THROW );
-						awt::Size aS( 0, 0 );
-						xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
-						awt::Size aM( ImplMapSize( aS ) );
-
 						CellBorder aCellBorder;
-						aCellBorder.mnPos = nXPos;
-						aCellBorder.mnLength = aM.Width;
+						aCellBorder.mnPos = aColumns[ nColumn ].first;
+						aCellBorder.mnLength = aColumns[ nColumn ].second;
+						sal_Bool bTop = sal_False;
+						//write nLine*nColumn cell's top border
 						if ( nLine < xRows->getCount() )
 						{	// top border
 							uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nLine ), uno::UNO_QUERY_THROW );
-							uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW );
-							table::BorderLine aBorderLine;
-							if ( xPropSet2->getPropertyValue( sTopBorder ) >>= aBorderLine )
-								aCellBorder.maCellBorder = aBorderLine;
+							if ( !xCell->isMerged()  )
+							{
+								uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW );
+								table::BorderLine aBorderLine;
+								if ( xPropSet2->getPropertyValue( sTopBorder ) >>= aBorderLine )
+									aCellBorder.maCellBorder = aBorderLine;
+								sal_Int32 nRight  = GetCellRight( nColumn, maRect,aColumns,xCell );
+								bTop = ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos,
+									aRows[ nLine ].first, nRight,  aRows[ nLine ].first );
+							}
 						}
-						if ( nLine )
+
+						//if nLine*nColumn cell's top border is empty, check (nLine-1)*nColumn cell's bottom border
+						//and write the last row's bottom border
+						if (( nLine && !bTop ) || (nLine == xRows->getCount()))
 						{	// bottom border
-							uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nLine - 1 ), uno::UNO_QUERY_THROW );
-							uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW );
-							table::BorderLine aBorderLine;
-							if ( xPropSet2->getPropertyValue( sBottomBorder ) >>= aBorderLine )
-								aCellBorder.maCellBorder = aBorderLine;
+							sal_Int32 nRow =  nLine;
+							
+							while( nRow )
+							{   //find last no merged cell
+								uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW );
+								if ( !xCell->isMerged()  )
+								{
+									sal_Int32 nRight  = GetCellRight( nColumn,  maRect,aColumns,xCell );
+									sal_Int32 nBottom = GetCellBottom( nRow - 1, maRect,aRows,xCell );
+									if ( nBottom == ( aRows[ nLine-1 ].first + aRows[ nLine-1 ].second ) )
+									{
+										uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW );
+										uno::Reference< beans::XPropertySet > xPropSet2( xCellOwn, uno::UNO_QUERY_THROW );
+										table::BorderLine aBorderLine;
+										if ( xPropSet2->getPropertyValue( sBottomBorder ) >>= aBorderLine )
+											aCellBorder.maCellBorder = aBorderLine;
+										ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos,
+											nBottom, nRight, nBottom);
+									}
+									nRow=0;
+								}
+								else
+									nRow--;
+							}
 						}
-						vCellBorders.push_back( aCellBorder );
-						nXPos += aM.Width;
-					}
-					std::vector< CellBorder >::const_iterator aCellBorderIter( vCellBorders.begin() );
-					while( aCellBorderIter != vCellBorders.end() )
-					{
-						ImplCreateCellBorder( &*aCellBorderIter, aCellBorderIter->mnPos, nYPos,
-							static_cast< sal_Int32 >( aCellBorderIter->mnPos + aCellBorderIter->mnLength ), nYPos );
-						aCellBorderIter++;
-					}
-					if ( nLine < xRows->getCount() )
-					{
-						uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( nLine ), uno::UNO_QUERY_THROW );
-						awt::Size aS( 0, 0 );
-						xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
-						awt::Size aM( ImplMapSize( aS ) );
-						nYPos += aM.Height;
 					}
 				}
 
 				// creating vertical lines
-				sal_Int32 nXPos = ImplMapPoint( rXShape->getPosition() ).X;
 				for( sal_Int32 nLine = 0; nLine < ( xColumns->getCount() + 1 ); nLine++ )
 				{
-					nYPos = ImplMapPoint( rXShape->getPosition() ).Y;
-					std::vector< CellBorder > vCellBorders;
 					for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ )
 					{
-						uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( nRow ), uno::UNO_QUERY_THROW );
-						awt::Size aS( 0, 0 );
-						xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
-						awt::Size aM( ImplMapSize( aS ) );
 
 						CellBorder aCellBorder;
-						aCellBorder.mnPos = nYPos;
-						aCellBorder.mnLength = aM.Height;
+						aCellBorder.mnPos = aRows[ nRow].first;
+						aCellBorder.mnLength = aRows[ nRow].second;
+						sal_Bool bLeft = sal_False;
 						if ( nLine < xColumns->getCount() )
 						{	// left border
 							uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nLine, nRow ), uno::UNO_QUERY_THROW );
-							uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW );
-							table::BorderLine aBorderLine;
-							if ( xCellSet->getPropertyValue( sLeftBorder ) >>= aBorderLine )
-								aCellBorder.maCellBorder = aBorderLine;
+							if (!xCell->isMerged() )
+							{
+								uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW );
+								table::BorderLine aBorderLine;
+								if ( xCellSet->getPropertyValue( sLeftBorder ) >>= aBorderLine )
+									aCellBorder.maCellBorder = aBorderLine;
+								sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows,xCell );
+								bLeft = ImplCreateCellBorder( &aCellBorder, aColumns[nLine].first, aCellBorder.mnPos,
+									aColumns[nLine].first, nBottom );
+							}
 						}
-						if ( nLine )
+						if ( ( nLine && !bLeft )||(nLine == xColumns->getCount()))
 						{	// right border
-							uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nLine - 1, nRow ), uno::UNO_QUERY_THROW );
-							uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW );
-							table::BorderLine aBorderLine;
-							if ( xCellSet->getPropertyValue( sRightBorder ) >>= aBorderLine )
-								aCellBorder.maCellBorder = aBorderLine;
+							sal_Int32 nColumn = nLine;
+							while ( nColumn )
+							{
+								uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW );
+								if (!xCell->isMerged() )
+								{
+									sal_Int32 nRight  = GetCellRight( nColumn-1, maRect, aColumns,xCell );
+									sal_Int32 nBottom = GetCellBottom( nRow,   maRect, aRows, xCell );
+									if ( nRight == (aColumns[nLine-1].first + aColumns[nLine-1].second) )
+									{
+										uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW );
+										uno::Reference< beans::XPropertySet > xCellSet( xCellOwn, uno::UNO_QUERY_THROW );
+										table::BorderLine aBorderLine;
+										if ( xCellSet->getPropertyValue( sRightBorder ) >>= aBorderLine )
+											aCellBorder.maCellBorder = aBorderLine;
+										ImplCreateCellBorder( &aCellBorder, nRight, aCellBorder.mnPos,
+											nRight,  nBottom );
+									}
+									nColumn = 0;
+								}
+								else 
+									nColumn --;
+							}
 						}
-						vCellBorders.push_back( aCellBorder );
-						nYPos += aM.Height;
-					}
-					std::vector< CellBorder >::const_iterator aCellBorderIter( vCellBorders.begin() );
-					while( aCellBorderIter != vCellBorders.end() )
-					{
-						ImplCreateCellBorder( &*aCellBorderIter, nXPos, aCellBorderIter->mnPos,
-							nXPos, static_cast< sal_Int32 >( aCellBorderIter->mnPos + aCellBorderIter->mnLength ) );
-						aCellBorderIter++;
-					}
-					if ( nLine < xColumns->getCount() )
-					{
-						uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( nLine ), uno::UNO_QUERY_THROW );
-						awt::Size aS( 0, 0 );
-						xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
-						awt::Size aM( ImplMapSize( aS ) );
-						nXPos += aM.Width;
 					}
 				}
 			}

Modified: incubator/ooo/branches/writer001/main/sd/source/filter/eppt/pptexanimations.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/filter/eppt/pptexanimations.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/filter/eppt/pptexanimations.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/filter/eppt/pptexanimations.cxx Mon Sep 17 08:06:09 2012
@@ -1377,8 +1377,7 @@ void AnimationExporter::exportAnimEvent(
 				else if ( aAny >>= fTiming )
 				{
 					bCreateEvent = sal_True;
-					if ( eTiming == Timing_INDEFINITE )
-						nBegin = (sal_Int32)( fTiming * 1000.0 );
+					nBegin = (sal_Int32)( fTiming * 1000.0 );
 				}
 			}
 			break;
@@ -2073,7 +2072,7 @@ sal_Bool AnimationExporter::getColorAny(
 	Sequence< double > aHSL( 3 );
 	if ( rAny >>= nColor )		// RGB color
 	{
-		rA = (sal_uInt8)( nColor >> 24 );
+		rA = (sal_uInt8)( nColor >> 16 );
 		rB = (sal_uInt8)( nColor >> 8 );
 		rC = (sal_uInt8)( nColor );
 	}

Modified: incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptin.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptin.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptin.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptin.cxx Mon Sep 17 08:06:09 2012
@@ -578,6 +578,10 @@ sal_Bool ImplSdPPTImport::Import()
 				sal_Bool bStarDrawFiller = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bStarDrawFiller;
 
 				PageKind ePgKind = ( bNotesMaster ) ? PK_NOTES : PK_STANDARD;
+				sal_Bool bHandout = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bHandoutMaster;
+				if ( bHandout )
+					ePgKind = PK_HANDOUT;
+
 				pPage->SetPageKind( ePgKind );
 				pSdrModel->InsertMasterPage( (SdrPage*)pPage );
 				if ( bNotesMaster && bStarDrawFiller )
@@ -724,7 +728,7 @@ sal_Bool ImplSdPPTImport::Import()
 	}
 	SdPage* pMPage;
 	sal_uInt16 i;
-	for ( i = 1; i < mpDoc->GetMasterPageCount() && ( (pMPage = (SdPage*)mpDoc->GetMasterPage( i )) != 0 ); i++ )
+	for ( i = 0; i < mpDoc->GetMasterPageCount() && ( (pMPage = (SdPage*)mpDoc->GetMasterPage( i )) != 0 ); i++ )
 	{
 		SetPageNum( i, PPT_MASTERPAGE );
 		/////////////////////////////////////////////
@@ -2051,6 +2055,8 @@ String ImplSdPPTImport::ReadMedia( sal_u
 												if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aStr, aRetVal ) )
 												{
 													aRetVal = INetURLObject( aRetVal ).GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
+												}else{ 
+													aRetVal = aStr;
 												}
 											}
 										}
@@ -2337,7 +2343,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj
 				if ( aPresentationText.Len() )
 					pPage->SetObjText( (SdrTextObj*)pText, pOutl, ePresKind, aPresentationText );
 
-				if ( pPage->GetPageKind() != PK_NOTES )
+				if ( pPage->GetPageKind() != PK_NOTES && pPage->GetPageKind() != PK_HANDOUT)
 				{
 					SfxStyleSheet* pSheet2( pPage->GetStyleSheetForPresObj( ePresKind ) );
 					if ( pSheet2 )
@@ -2385,7 +2391,11 @@ SdrObject* ImplSdPPTImport::ApplyTextObj
 							break;
 					}
 				}
-				if ( i < 8 )
+// [Bug 119962] Placeholder in ppt file created by MS 2007 is lost if load in Impress 
+				unsigned int nParaCount = pTextObj->Count();
+				PPTParagraphObj *pFirstPara = nParaCount == 0 ? NULL : pTextObj->First();
+				unsigned int nFirstParaTextcount = pFirstPara == NULL ? 0 : pFirstPara->GetTextSize();
+				if ( i < 8 || (nParaCount == 1 && nFirstParaTextcount == 0 || nParaCount == 0))
 				{
 					PresObjKind ePresObjKind = PRESOBJ_NONE;
 					sal_Bool    bEmptyPresObj = sal_True;

Modified: incubator/ooo/branches/writer001/main/sd/source/ui/framework/tools/FrameworkHelper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/framework/tools/FrameworkHelper.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/framework/tools/FrameworkHelper.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/framework/tools/FrameworkHelper.cxx Mon Sep 17 08:06:09 2012
@@ -384,7 +384,6 @@ FrameworkHelper::InstanceMap FrameworkHe
             pHelper = ::boost::shared_ptr<FrameworkHelper>(new FrameworkHelper(rBase));
             pHelper->Initialize();
             OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
-            SdGlobalResourceContainer::Instance().AddResource(pHelper);
             maInstanceMap[&rBase] = pHelper;
         }
     }

Modified: incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx Mon Sep 17 08:06:09 2012
@@ -169,6 +169,8 @@ SlideSorterViewShell::~SlideSorterViewSh
 		(void)e;
 		DBG_ERROR("sd::SlideSorterViewShell::~SlideSorterViewShell(), exception caught!" );
 	}
+
+	GetFrameView()->Disconnect(); // i120663, release the FrameView object 
 }
 
 

Modified: incubator/ooo/branches/writer001/main/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/toolpanel/ToolPanelViewShell.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/toolpanel/ToolPanelViewShell.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/toolpanel/ToolPanelViewShell.cxx Mon Sep 17 08:06:09 2012
@@ -550,6 +550,8 @@ ToolPanelViewShell::~ToolPanelViewShell(
     // disposed/destroyed, too
     mpImpl.reset();
     GetViewShellBase().GetViewShellManager()->RemoveSubShellFactory(this, mpSubShellManager);
+
+    GetFrameView()->Disconnect(); // i120663, release the FrameView object
 }
 
 // ---------------------------------------------------------------------------------------------------------------------

Modified: incubator/ooo/branches/writer001/main/sd/source/ui/unoidl/unomodel.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/unoidl/unomodel.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/unoidl/unomodel.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/unoidl/unomodel.cxx Mon Sep 17 08:06:09 2012
@@ -802,7 +802,8 @@ uno::Reference< drawing::XDrawPages > SA
 
 	if( !xMasterPages.is() )
 	{
-		initializeDocument();
+		if ( !hasControllersLocked() )
+			initializeDocument();
 		mxMasterPagesAccess = xMasterPages = new SdMasterPagesAccess(*this);
 	}
 

Modified: incubator/ooo/branches/writer001/main/set_soenv.in
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/set_soenv.in?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/set_soenv.in (original)
+++ incubator/ooo/branches/writer001/main/set_soenv.in Mon Sep 17 08:06:09 2012
@@ -2015,6 +2015,7 @@ ToFile( "SYSTEM_GETTEXT",    "@SYSTEM_GE
 ToFile( "SYSTEM_PANGO",      "@SYSTEM_PANGO@",   "e" );
 ToFile( "SYSTEM_LIBPNG",     "@SYSTEM_LIBPNG@",   "e" );
 ToFile( "SYSTEM_LIBJPEG",    "@SYSTEM_LIBJPEG@",   "e" );
+ToFile( "RAT_JAR_HOME",      "@RAT_JAR_HOME@",     "e" );
 ToFile( "DISABLE_XAW",       "@DISABLE_XAW@",      "e" );
 ToFile( "DMAKE_URL",         "@DMAKE_URL@",        "e" );
 ToFile( "DMAKE_PATH",        "@DMAKE_PATH@",       "e" );

Modified: incubator/ooo/branches/writer001/main/sfx2/source/bastyp/fltfnc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/bastyp/fltfnc.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/bastyp/fltfnc.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/bastyp/fltfnc.cxx Mon Sep 17 08:06:09 2012
@@ -187,6 +187,7 @@ SfxFilterContainer::SfxFilterContainer( 
 
 SfxFilterContainer::~SfxFilterContainer()
 {
+	delete pImpl;
 }
 
 //----------------------------------------------------------------

Modified: incubator/ooo/branches/writer001/main/slideshow/qa/tools/mktransitions.pl
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/slideshow/qa/tools/mktransitions.pl?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/slideshow/qa/tools/mktransitions.pl (original)
+++ incubator/ooo/branches/writer001/main/slideshow/qa/tools/mktransitions.pl Mon Sep 17 08:06:09 2012
@@ -31,6 +31,8 @@ use File::Temp;
 use File::Path;
 
 $TempDir = "";
+my $FirstTransitionIndex = 0;
+my $LastTransitionIndex = -1;
 
 
 # all the XML package generation is a blatant rip from AF's
@@ -98,7 +100,7 @@ sub	zip_dirtree
 		#	Remove .. directories from the middle of the path.
 		while ($zip_name =~ /\/[^\/][^\.\/][^\/]*\/\.\.\//)
 		{
-			$zip_name = $` . "/" . $';
+			$zip_name = $` . "/" . $'; # $'
 		}
 	}
 
@@ -143,6 +145,8 @@ sub writeSlideStyles
 	my $transitionType = pop @_;
 	my $slideNum = pop @_;
 
+    return if $slideNum<$FirstTransitionIndex || ($LastTransitionIndex>=0 && $slideNum>$LastTransitionIndex);
+
 	print $OUT "  <style:style style:name=\"dp",$slideNum,"\" style:family=\"drawing-page\">\n";
 	print $OUT "   <style:drawing-page-properties presentation:transition-type=\"automatic\" presentation:duration=\"PT00H00M01S\" presentation:background-visible=\"true\" presentation:background-objects-visible=\"true\" draw:fill=\"solid\" draw:fill-color=\"#ff",$slideNum % 2 ? "ff99" : "cc99","\" smil:type=\"",$transitionType,"\" smil:subtype=\"",$transitionSubType,"\" ",$direction == 0 ? "" : "smil:direction=\"reverse\" ",$mode == 0 ? "" : "smil:mode=\"out\"","/>\n";
 	print $OUT "  </style:style>\n";
@@ -217,6 +221,8 @@ sub writeSlide
 	my $transitionType = pop @_;
 	my $slideNum = pop @_;
 
+    return if $slideNum<$FirstTransitionIndex || ($LastTransitionIndex>=0 && $slideNum>$LastTransitionIndex);
+
 	print $OUT "   <draw:page draw:name=\"page",$slideNum,"\" draw:style-name=\"dp",$slideNum,"\" draw:master-page-name=\"Default\" presentation:presentation-page-layout-name=\"AL1T19\">";
 
 	print $OUT "    <draw:frame presentation:style-name=\"pr1\" draw:layer=\"layout\" svg:width=\"25.199cm\" svg:height=\"3.256cm\" svg:x=\"1.4cm\" svg:y=\"0.962cm\" presentation:class=\"title\">\n";
@@ -555,6 +561,8 @@ output-file-name defaults to alltransiti
 options: -a    Generate _all_ combinations of type, subtype,
                direction, and mode
          -h    Print this usage information.
+         -f    First transition to include, defaults to 0
+         -l    Last transition to include
 END_OF_USAGE
 }
 
@@ -582,6 +590,14 @@ sub	process_command_line
 		{
 			$global_gen_all=1;
 		}
+		elsif ($ARGV[$i] eq "-f")
+        {
+            $FirstTransitionIndex = $ARGV[++$i];
+        }
+		elsif ($ARGV[$i] eq "-l")
+        {
+            $LastTransitionIndex = $ARGV[++$i];
+        }
 		elsif ($ARGV[$i] =~ /^-/)
 		{
 		    print "Unknown option $ARGV[$i]\n";

Modified: incubator/ooo/branches/writer001/main/slideshow/source/engine/activities/activitiesfactory.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/slideshow/source/engine/activities/activitiesfactory.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/slideshow/source/engine/activities/activitiesfactory.cxx (original)
+++ incubator/ooo/branches/writer001/main/slideshow/source/engine/activities/activitiesfactory.cxx Mon Sep 17 08:06:09 2012
@@ -166,7 +166,6 @@ public:
           maEndValue(),
           mpAnim( rAnim ),
           maInterpolator( rInterpolator ),
-          mbDynamicStartValue( false ),
           mbCumulative( bCumulative )
     {
         ENSURE_OR_THROW( mpAnim, "Invalid animation object" );
@@ -223,12 +222,7 @@ public:
             if( maTo ) 
             {
                 // To animation
-                
-                // According to the SMIL spec
-                // (http://www.w3.org/TR/smil20/animation.html#animationNS-ToAnimation),
-                // the to animation interpolates between
-                // the _running_ underlying value and the to value (as the end value)
-                mbDynamicStartValue = true;
+                maStartValue = aAnimationStartValue;
                 maEndValue = *maTo;
             }
             else if( maBy ) 
@@ -256,9 +250,7 @@ public:
             getPresentationValue(
                 accumulate( maEndValue, 
                             mbCumulative * nRepeatCount, // means: mbCumulative ? nRepeatCount : 0,
-                            maInterpolator( (mbDynamicStartValue
-                                             ? mpAnim->getUnderlyingValue()
-                                             : maStartValue),
+                            maInterpolator( maStartValue,
                                             maEndValue,
                                             nModifiedTime ) ) ) );
     }
@@ -274,9 +266,7 @@ public:
             getPresentationValue(
                 accumulate( maEndValue, mbCumulative ? nRepeatCount : 0,
                             lerp( maInterpolator,
-                                  (mbDynamicStartValue
-                                   ? mpAnim->getUnderlyingValue()
-                                   : maStartValue),
+                                  maStartValue,
                                   maEndValue,
                                   nFrame, 
                                   BaseType::getNumberOfKeyTimes() ) ) ) );
@@ -315,7 +305,6 @@ private:
     
     ::boost::shared_ptr< AnimationType >    mpAnim;
     Interpolator< ValueType >               maInterpolator;
-    bool                                    mbDynamicStartValue;
     bool                                    mbCumulative;
 };
 

Modified: incubator/ooo/branches/writer001/main/slideshow/source/engine/animationnodes/animationbasenode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/slideshow/source/engine/animationnodes/animationbasenode.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/slideshow/source/engine/animationnodes/animationbasenode.cxx (original)
+++ incubator/ooo/branches/writer001/main/slideshow/source/engine/animationnodes/animationbasenode.cxx Mon Sep 17 08:06:09 2012
@@ -396,8 +396,36 @@ AnimationBaseNode::fillCommonParameters(
     
     boost::optional<double> aRepeats;
     double nRepeats = 0;
-    if( (mxAnimateNode->getRepeatCount() >>= nRepeats) ) {
-        aRepeats.reset( nRepeats );
+	bool bRepeatIndefinite = false;
+    animations::Timing eTiming;
+
+    // Search parent nodes for an explicitly stated repeat count.
+    BaseNodeSharedPtr const pSelf( getSelf() );
+    for ( boost::shared_ptr<BaseNode> pNode( pSelf );
+          pNode;
+          pNode = pNode->getParentNode() )
+    {
+        uno::Reference<animations::XAnimationNode> const xAnimationNode(
+            pNode->getXAnimationNode() );
+        if( (xAnimationNode->getRepeatCount() >>= nRepeats) )
+        {
+            // Found an explicit repeat count.
+            break;
+        }
+        if( (xAnimationNode->getRepeatCount() >>= eTiming) &&
+            (eTiming == animations::Timing_INDEFINITE ))
+        {
+            // Found an explicit repeat count of Timing::INDEFINITE.
+            bRepeatIndefinite = true;
+            break;
+        }
+    }
+
+    if( nRepeats || bRepeatIndefinite ) {
+        if (nRepeats)
+        {
+            aRepeats.reset( nRepeats );
+        }
     }
     else {
         if( (mxAnimateNode->getRepeatDuration() >>= nRepeats) ) {
@@ -430,11 +458,10 @@ AnimationBaseNode::fillCommonParameters(
             }
         }
     }
-    
+
     // calc accel/decel:
     double nAcceleration = 0.0;
     double nDeceleration = 0.0;
-    BaseNodeSharedPtr const pSelf( getSelf() );
     for ( boost::shared_ptr<BaseNode> pNode( pSelf );
           pNode; pNode = pNode->getParentNode() )
     {

Modified: incubator/ooo/branches/writer001/main/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx (original)
+++ incubator/ooo/branches/writer001/main/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx Mon Sep 17 08:06:09 2012
@@ -149,7 +149,7 @@ namespace slideshow
                 return ParametricPolyPolygonSharedPtr(
                     new SnakeWipe(
                         // elements:
-                        64 * 64,
+                        8 * 8,
                         // diagonal:
                         nSubType == TOPLEFTDIAGONAL ||
                         nSubType == TOPRIGHTDIAGONAL ||
@@ -164,7 +164,7 @@ namespace slideshow
                 return ParametricPolyPolygonSharedPtr(
                     new ParallelSnakesWipe(
                         // elements:
-                        64 * 64,
+                        8 * 8,
                         // diagonal:
                         nSubType == DIAGONALBOTTOMLEFTOPPOSITE ||
                         nSubType == DIAGONALTOPLEFTOPPOSITE,
@@ -184,7 +184,7 @@ namespace slideshow
                 return ParametricPolyPolygonSharedPtr(
                     new SpiralWipe(
                         // elements:
-                        64 * 64,
+                        8 * 8,
                         // flipOnYAxis:
                         nSubType == TOPLEFTCOUNTERCLOCKWISE ||
                         nSubType == TOPRIGHTCOUNTERCLOCKWISE ||
@@ -194,7 +194,7 @@ namespace slideshow
                 return ParametricPolyPolygonSharedPtr(
                     new BoxSnakesWipe(
                         // elements:
-                        64 * 64,
+                        8 * 8,
                         // fourBox:
                         nSubType == FOURBOXVERTICAL ||
                         nSubType == FOURBOXHORIZONTAL ) );

Modified: incubator/ooo/branches/writer001/main/solenv/bin/build.pl
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/solenv/bin/build.pl?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/solenv/bin/build.pl (original)
+++ incubator/ooo/branches/writer001/main/solenv/bin/build.pl Mon Sep 17 08:06:09 2012
@@ -2017,7 +2017,10 @@ sub run_job {
         if (!-d $log_dir) {
              system("$perl $mkout");
         };
-        $error_code = system ("$job_to_do 2>&1 | tee $log_file");
+        $error_code = system ("$job_to_do > $log_file 2>&1");
+        if (!$grab_output && -f $log_file) {
+            system("cat $log_file");
+        };
     } else {
         $error_code = system ("$job_to_do");
     };

Modified: incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgstyleattributes.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgstyleattributes.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgstyleattributes.cxx (original)
+++ incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgstyleattributes.cxx Mon Sep 17 08:06:09 2012
@@ -370,6 +370,7 @@ namespace svgio
                             aSvgGradientEntryVector,
                             aStart,
                             aEnd,
+                            userSpaceOnUse != rFillGradient.getGradientUnits(),
                             rFillGradient.getSpreadMethod()));
                 }
                 else
@@ -430,6 +431,7 @@ namespace svgio
                             aSvgGradientEntryVector,
                             aStart,
                             fRadius,
+                            userSpaceOnUse != rFillGradient.getGradientUnits(),
                             rFillGradient.getSpreadMethod(),
                             bFocal ? &aFocal : 0));
                 }

Modified: incubator/ooo/branches/writer001/main/svl/inc/svl/itemset.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/svl/inc/svl/itemset.hxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/svl/inc/svl/itemset.hxx (original)
+++ incubator/ooo/branches/writer001/main/svl/inc/svl/itemset.hxx Mon Sep 17 08:06:09 2012
@@ -78,6 +78,16 @@ class SVL_DLLPUBLIC SfxItemSet
 	sal_uInt16*                     _pWhichRanges;  // Array von Which-Bereichen
 	sal_uInt16                      _nCount;        // Anzahl Items
 
+	//optimize a comparing operation from 'memcmp' to 'hash compare' to improve xls loading performance, i120575
+	sal_Int32 _aHashKey; //hash result of array of points: _aItems.
+	
+	void UpdateHashKey();
+	//Need invlidate the hashkey at every possible place where the array _aItems may be changed.
+	//thread safe : there is always solarmutex outter, so no need to add mutex here.
+	void InvalidateHashKey() { _aHashKey = 0;} //treat '0' as an invalidate key.
+	sal_Bool IsValidateHashKey() const { return (0!=_aHashKey);} 
+	sal_Int32 GetHashKey() const { return _aHashKey; }
+	//end:i120575
 	//---------------------------------------------------------------------
 #ifndef _SFXITEMS_HXX
 
@@ -91,7 +101,14 @@ private:
 	SVL_DLLPRIVATE void						InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2);
 
 public:
-	SfxItemArray				GetItems_Impl() const { return _aItems; }
+	//optimize a comparing operation from 'memcmp' to 'hash compare' to improve xls loading performance, i120575
+	//Make this method public is dangerous, may disrupt the item array. so invalidate the hash key here.
+	//currently this method is never called, pls also do not do it in future.
+	SfxItemArray	GetItems_Impl() const 
+	{
+		const_cast<SfxItemSet &>(*this).InvalidateHashKey();
+		return _aItems;
+	}//end:i120575
 
 #endif
 	//---------------------------------------------------------------------
@@ -169,6 +186,13 @@ public:
 	virtual SvStream &			Store( SvStream &, FASTBOOL bDirect = sal_False ) const;
 
 	virtual int                 operator==(const SfxItemSet &) const;
+	
+	//optimize a comparing operation from 'memcmp' to 'hash compare' to improve xls loading performance, i120575
+	//in some situation (e.g.. ScPatternAttr::operator== ), 
+	//two sfxitemset can be compared 'quickly' by the Hashkey only.
+	//may also update the hashkey in this method.
+	sal_Bool QuickCompare( SfxItemSet & rCmp);
+	//end:i120575
 };
 
 // --------------- Inline Implementierungen ------------------------

Modified: incubator/ooo/branches/writer001/main/svl/source/items/itemset.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/svl/source/items/itemset.cxx?rev=1386501&r1=1386500&r2=1386501&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/svl/source/items/itemset.cxx (original)
+++ incubator/ooo/branches/writer001/main/svl/source/items/itemset.cxx Mon Sep 17 08:06:09 2012
@@ -134,7 +134,8 @@ SfxItemSet::SfxItemSet
 
 :	_pPool( &rPool ),
 	_pParent( 0 ),
-	_nCount( 0 )
+	_nCount( 0 ),
+	_aHashKey( 0 ) //i120575
 {
 	DBG_CTOR(SfxItemSet, DbgCheckItemSet);
 	DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
@@ -163,7 +164,8 @@ SfxItemSet::SfxItemSet
 SfxItemSet::SfxItemSet( SfxItemPool& rPool, sal_uInt16 nWhich1, sal_uInt16 nWhich2 ):
 	_pPool( &rPool ),
 	_pParent( 0 ),
-	_nCount( 0 )
+	_nCount( 0 ),
+	_aHashKey( 0 ) //i120575
 {
 	DBG_CTOR(SfxItemSet, DbgCheckItemSet);
 	DBG_ASSERT( nWhich1 <= nWhich2, "Ungueltiger Bereich" );
@@ -205,7 +207,8 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPo
 	_pPool( &rPool ),
 	_pParent( 0 ),
 	_pWhichRanges( 0 ),
-	_nCount( 0 )
+	_nCount( 0 ),
+	_aHashKey( 0 ) //i120575
 {
 	DBG_CTOR(SfxItemSet, DbgCheckItemSet);
 	DBG_ASSERT( nWh1 <= nWh2, "Ungueltiger Bereich" );
@@ -256,7 +259,8 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPo
 	_pPool( &rPool ),
 	_pParent( 0 ),
 	_pWhichRanges(0),
-	_nCount( 0 )
+	_nCount( 0 ),
+	_aHashKey( 0 ) //i120575
 {
 	DBG_CTOR(SfxItemSet, 0);
 	DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
@@ -272,7 +276,8 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPo
 SfxItemSet::SfxItemSet( const SfxItemSet& rASet ):
 	_pPool( rASet._pPool ),
 	_pParent( rASet._pParent ),
-	_nCount( rASet._nCount )
+	_nCount( rASet._nCount ),
+	_aHashKey( 0 ) //i120575
 {
 	DBG_CTOR(SfxItemSet, DbgCheckItemSet);
 	DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
@@ -455,6 +460,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uI
 			pPtr += 2;
 		}
 	}
+	InvalidateHashKey();	//i120575
 	return nDel;
 }
 
@@ -484,6 +490,7 @@ void SfxItemSet::ClearInvalidItems( sal_
 				}
 			pPtr += 2;
 		}
+	InvalidateHashKey();	//i120575
 }
 
 //------------------------------------------------------------------------
@@ -495,6 +502,7 @@ void SfxItemSet::InvalidateAllItems()
 	DBG_ASSERT( !_nCount, "Es sind noch Items gesetzt" );
 
 	memset( (void*)_aItems, -1, ( _nCount = TotalCount() ) * sizeof( SfxPoolItem*) );
+	InvalidateHashKey();	//i120575
 }
 
 // -----------------------------------------------------------------------
@@ -582,6 +590,7 @@ const SfxPoolItem* SfxItemSet::Put( cons
 				if ( rItem.Which() && ( IsInvalidItem(*ppFnd) || !(*ppFnd)->Which() ) )
 				{
 					*ppFnd = &_pPool->Put( rItem, nWhich );
+					InvalidateHashKey();	//i120575
 					return *ppFnd;
 				}
 
@@ -589,6 +598,7 @@ const SfxPoolItem* SfxItemSet::Put( cons
 				if( !rItem.Which() )
 				{
 					*ppFnd = rItem.Clone(_pPool);
+					InvalidateHashKey();	//i120575
 					return 0;
 				}
 				else
@@ -626,11 +636,14 @@ const SfxPoolItem* SfxItemSet::Put( cons
 			SFX_ASSERT( !_pPool->IsItemFlag(nWhich, SFX_ITEM_POOLABLE) ||
 						rItem.ISA(SfxSetItem) || **ppFnd == rItem,
 						nWhich, "putted Item unequal" );
+			
+			InvalidateHashKey();	//i120575
 			return *ppFnd;
 		}
 		ppFnd += *(pPtr+1) - *pPtr + 1;
 		pPtr += 2;
 	}
+	InvalidateHashKey();	//i120575
 	return 0;
 }
 
@@ -864,6 +877,7 @@ void SfxItemSet::SetRanges( const sal_uI
 		_pWhichRanges = new sal_uInt16[ nCount ];
 		memcpy( _pWhichRanges, pNewRanges, sizeof( sal_uInt16 ) * nCount );
 	}
+	InvalidateHashKey();	//i120575
 }
 
 // -----------------------------------------------------------------------
@@ -1137,6 +1151,7 @@ void SfxItemSet::Intersect( const SfxIte
 			pItem = aIter.NextItem();
 		}
 	}
+	InvalidateHashKey();	//i120575	
 }
 
 // -----------------------------------------------------------------------
@@ -1209,6 +1224,7 @@ void SfxItemSet::Differentiate( const Sf
 		}
 
 	}
+	InvalidateHashKey();	//i120575	
 }
 
 // -----------------------------------------------------------------------
@@ -1412,6 +1428,7 @@ void SfxItemSet::MergeValues( const SfxI
 				MergeValue( *pItem, bIgnoreDefaults );
 		}
 	}
+	InvalidateHashKey();	//i120575	
 }
 
 // -----------------------------------------------------------------------
@@ -1434,6 +1451,7 @@ void SfxItemSet::MergeValue( const SfxPo
 		ppFnd += *(pPtr+1) - *pPtr + 1;
 		pPtr += 2;
 	}
+	InvalidateHashKey();	//i120575	
 }
 
 // -----------------------------------------------------------------------
@@ -1468,6 +1486,7 @@ void SfxItemSet::InvalidateItem( sal_uIn
 		ppFnd += *(pPtr+1) - *pPtr + 1;
 		pPtr += 2;
 	}
+	InvalidateHashKey();	//i120575	
 }
 
 // -----------------------------------------------------------------------
@@ -1629,6 +1648,8 @@ SvStream &SfxItemSet::Load
 		}
 	}
 
+	
+	InvalidateHashKey();	//i120575
 	return rStream;
 }
 
@@ -1768,6 +1789,7 @@ int	SfxItemSet::PutDirect(const SfxPoolI
 					rItem.AddRef();
 			}
 
+			InvalidateHashKey();	//i120575
 			return sal_True;
 		}
 		ppFnd += *(pPtr+1) - *pPtr + 1;
@@ -2007,6 +2029,8 @@ const SfxPoolItem* SfxAllItemSet::Put( c
 
     if ( bIncrementCount )
         ++_nCount;
+	
+	InvalidateHashKey();	//i120575
 
 	return &rNew;
 }
@@ -2116,3 +2140,51 @@ SfxItemSet *SfxAllItemSet::Clone(sal_Boo
 		return bItems ? new SfxAllItemSet(*this) : new SfxAllItemSet(*_pPool);
 }
 
+//for i120575
+//align with the rtl_hash, return signed int result and input len limited to 2G.
+//can be replaced with other hash function in future for better performance, e.g. fnv hash.
+inline sal_Int32 myhash(void * buf, sal_Int32 buf_len)
+{
+	return rtl_str_hashCode_WithLength( reinterpret_cast<const sal_Char *>(buf), buf_len);
+}
+
+inline void SfxItemSet::UpdateHashKey()
+{
+	_aHashKey= myhash(_aItems,TotalCount()* sizeof(_aItems[0]));
+
+	//always treat '0' as invalidate hash key, not using addtional bool data field for saving space.
+	if (!IsValidateHashKey() )
+	{
+		_aHashKey = 1;
+	}
+}
+
+sal_Bool SfxItemSet::QuickCompare( SfxItemSet & rCmp)
+{
+	if ( _pParent != rCmp._pParent ||
+		 _pPool != rCmp._pPool ||
+		 Count() != rCmp.Count() )
+		return sal_False;
+
+	if ((0==Count())&&(0==rCmp.Count())) 
+		return sal_True;
+
+	if (!IsValidateHashKey()) 
+	{
+		UpdateHashKey();
+	}
+	if (!rCmp.IsValidateHashKey()) 
+	{
+		rCmp.UpdateHashKey();
+	}
+
+	//improved performance here, in most cases, the hashkey is not equal.
+	if (GetHashKey() != rCmp.GetHashKey()) 
+		return sal_False;
+
+	if ( 0 == memcmp( _aItems, rCmp._aItems,  TotalCount() * sizeof(_aItems[0]) ) )
+		return sal_True;
+	else
+		return sal_False;
+}
+//end: i120575



Mime
View raw message