ooo-build r12267 - in trunk: . patches/dev300



Author: jiaojh
Date: Tue Apr 22 02:12:47 2008
New Revision: 12267
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12267&view=rev

Log:
    * patches/dev300/plus-minus-sw-navigator.diff:
    * patches/dev300/plus-minus-sw-navigator2.diff:
    * patches/dev300/apply:
      adjust plus/minus patch to dev300 and apply them.


Added:
   trunk/patches/dev300/plus-minus-sw-navigator.diff
   trunk/patches/dev300/plus-minus-sw-navigator2.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Tue Apr 22 02:12:47 2008
@@ -160,8 +160,8 @@
 testtool-more-defaults.diff, martink
 
 #Fix plus/minus in to each heading in Navigator
-#FIXME dev300: plus-minus-sw-navigator.diff, i#64886, n#129410, jianhua
-#FIXME dev300: plus-minus-sw-navigator2.diff, i#64886, n#129410, jianhua
+plus-minus-sw-navigator.diff, i#64886, n#129410, jianhua
+plus-minus-sw-navigator2.diff, i#64886, n#129410, jianhua
 
 #set default varchar lenght to 100.
 dbaccess-default-varchar-lenght.diff, i#62664, jianhua

Added: trunk/patches/dev300/plus-minus-sw-navigator.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/plus-minus-sw-navigator.diff	Tue Apr 22 02:12:47 2008
@@ -0,0 +1,221 @@
+--- sw/source/ui/utlui/content.cxx.orig	2008-02-26 18:49:38.000000000 +0800
++++ sw/source/ui/utlui/content.cxx	2008-04-22 10:14:40.000000000 +0800
+@@ -1271,19 +1271,64 @@ void  SwContentTree::RequestingChilds( S
+ 			SwContentType* pCntType = (SwContentType*)pParent->GetUserData();
+ 
+ 			sal_uInt16 nCount = pCntType->GetMemberCount();
+-			for(sal_uInt16 i = 0; i < nCount; i++)
+-			{
+-				const SwContent* pCnt = pCntType->GetMember(i);
+-				if(pCnt)
+-				{
+-					String sEntry = pCnt->GetName();
+-					if(!sEntry.Len())
+-						sEntry = sSpace;
+-                    InsertEntry(sEntry, pParent,
+-							sal_False, LIST_APPEND, (void*)pCnt);
+-				}
+-
+-			}
++             /**************************************************************
++                 Add for outline plus/minus
++             ***************************************************************/
++             if(pCntType->GetType() == CONTENT_TYPE_OUTLINE)
++             {
++                 SvLBoxEntry* pChild = 0;
++                 for(sal_uInt16 i = 0; i < nCount; i++)
++                 {
++                     const SwContent* pCnt = pCntType->GetMember(i);
++                     if(pCnt)
++                     {
++                         sal_uInt16 nLevel = ((SwOutlineContent*)pCnt)->GetOutlineLevel();
++                         String sEntry = pCnt->GetName();
++                         if(!sEntry.Len())
++                             sEntry = sSpace;
++                         if(!pChild || (nLevel == 0))
++                             pChild = InsertEntry(sEntry, pParent,
++                                         sal_False, LIST_APPEND,(void*)pCnt);
++                         else
++                         {
++                             //back search parent.
++                             if(((SwOutlineContent*)pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel)
++                                 pChild = InsertEntry(sEntry, pChild,
++                                         sal_False, LIST_APPEND, (void*)pCnt);
++                             else
++                             {
++                                 pChild = Prev(pChild);
++                                 while(pChild &&
++                                         lcl_IsContent(pChild) &&
++                                         !(((SwOutlineContent*)pChild->GetUserData())->GetOutlineLevel() < nLevel)
++                                      )
++                                 {
++                                     pChild = Prev(pChild);
++                                 }
++                                 if(pChild)
++                                     pChild = InsertEntry(sEntry, pChild,
++                                                 sal_False, LIST_APPEND, (void*)pCnt);
++                             }
++                        }
++                     }
++                 }
++             }
++             else
++             {
++ 			    for(sal_uInt16 i = 0; i < nCount; i++)
++ 			    {
++ 				    const SwContent* pCnt = pCntType->GetMember(i);
++ 				    if(pCnt)
++ 				    {
++ 					    String sEntry = pCnt->GetName();
++ 					    if(!sEntry.Len())
++  						sEntry = sSpace;
++ 					    InsertEntry(sEntry, pParent,
++ 							    sal_False, LIST_APPEND, (void*)pCnt);
++ 				    }
++  
++ 			    }
++            }
+ 		}
+ 	}
+ }
+@@ -1294,7 +1339,7 @@ void  SwContentTree::RequestingChilds( S
+ 
+ sal_Bool  SwContentTree::Expand( SvLBoxEntry* pParent )
+ {
+-	if(!bIsRoot)
++	if(!bIsRoot || ((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)
+ 	{
+ 		if(lcl_IsContentType(pParent))
+ 		{
+@@ -1307,6 +1352,19 @@ sal_Bool  SwContentTree::Expand( SvLBoxE
+ 			}
+ 			else
+ 				nHiddenBlock |= nOr;
++            if((pCntType->GetType() == CONTENT_TYPE_OUTLINE))
++            {
++                sal_Bool bBool = SvTreeListBox::Expand(pParent);
++                SvLBoxEntry* pChild = Next(pParent);
++                while(pChild && lcl_IsContent(pChild) && pParent->HasChilds())
++                {
++                    if(pChild->HasChilds())
++                        SvTreeListBox::Expand(pChild);
++                    pChild = Next(pChild);
++                }
++                return bBool;
++            }
++
+ 		}
+ 	}
+ 	return SvTreeListBox::Expand(pParent);
+@@ -1319,10 +1377,12 @@ sal_Bool  SwContentTree::Expand( SvLBoxE
+ sal_Bool  SwContentTree::Collapse( SvLBoxEntry* pParent )
+ {
+ 	sal_Bool bRet;
+-	if(!bIsRoot)
++	if(!bIsRoot || ((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)
+ 	{
+ 		if(lcl_IsContentType(pParent))
+ 		{
++            if(bIsRoot)
++                return bRet = sal_False;
+ 			SwContentType* pCntType = (SwContentType*)pParent->GetUserData();
+ 			sal_uInt16 nAnd = 1 << pCntType->GetType();
+ 			nAnd = ~nAnd;
+@@ -1337,7 +1397,8 @@ sal_Bool  SwContentTree::Collapse( SvLBo
+ 			bRet = SvTreeListBox::Collapse(pParent);
+ 	}
+ 	else
+-		bRet = sal_False;
++//		bRet = sal_False;
++		bRet = SvTreeListBox::Collapse(pParent);
+ 	return bRet;
+ }
+ 
+@@ -1354,9 +1415,9 @@ IMPL_LINK( SwContentTree, ContentDoubleC
+ 	DBG_ASSERT(pEntry, "kein aktueller Eintrag!")
+ 	if(pEntry)
+ 	{
+-		if(lcl_IsContentType(pEntry))
++		if(lcl_IsContentType(pEntry) && !pEntry->HasChilds())
+ 			RequestingChilds(pEntry);
+-		else if(bIsActive || bIsConstant)
++		else if(!lcl_IsContentType(pEntry) && (bIsActive || bIsConstant))
+ 		{
+ 			if(bIsConstant)
+ 			{
+@@ -1400,9 +1461,14 @@ void SwContentTree::Display( sal_Bool bA
+             nOldScrollPos = pVScroll->GetThumbPos();
+ 
+         sEntryName = GetEntryText(pOldSelEntry);
++        SvLBoxEntry* pParantEntry = pOldSelEntry;
++        while( GetParent(pParantEntry))
++        {
++            pParantEntry = GetParent(pParantEntry);
++        }
+ 		if(GetParent(pOldSelEntry))
+ 		{
+-			nEntryRelPos = (sal_uInt16)(GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(GetParent(pOldSelEntry)));
++			nEntryRelPos = (sal_uInt16)(GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(pParantEntry));
+ 		}
+ 	}
+ 	Clear();
+@@ -1496,18 +1562,24 @@ void SwContentTree::Display( sal_Bool bA
+ 					(*ppRootContentT)->GetName(), rImage, rImage,
+ 						0, sal_False, LIST_APPEND, *ppRootContentT);
+ 
+-			for(sal_uInt16 i = 0; i < (*ppRootContentT)->GetMemberCount(); i++ )
+-			{
+-				const SwContent* pCnt = (*ppRootContentT)->GetMember(i);
+-				if(pCnt)
+-				{
+-					String sEntry = pCnt->GetName();
+-					if(!sEntry.Len())
+-						sEntry = sSpace;
+-                    InsertEntry( sEntry, pParent,
+-								sal_False, LIST_APPEND, (void*)pCnt);
+-				}
+-			}
++            if(nRootType != CONTENT_TYPE_OUTLINE)
++  			{
++                SvLBoxEntry* pEntry;
++ 			    for(sal_uInt16 i = 0; i < (*ppRootContentT)->GetMemberCount(); i++ )
++ 			    {
++ 				    const SwContent* pCnt = (*ppRootContentT)->GetMember(i);
++ 				    if(pCnt)
++ 				    {
++ 					    String sEntry = pCnt->GetName();
++ 					    if(!sEntry.Len())
++ 						    sEntry = sSpace;
++ 					    InsertEntry( sEntry, pParent,
++ 						    		sal_False, LIST_APPEND, (void*)pCnt);
++ 				    }
++ 			    }
++             }
++             else
++                 RequestingChilds(pParent);
+ 			Expand(pParent);
+ 			if( nRootType == CONTENT_TYPE_OUTLINE && bIsActive )
+ 			{
+@@ -1882,9 +1954,9 @@ sal_Bool SwContentTree::HasContentChange
+ 					// or if the visibility of objects (frames, sections, tables) has changed
+ 					// i.e. in header/footer
+ 					pArrType->FillMemberList(&bLevelOrVisibiblityChanged);
+-					if(bLevelOrVisibiblityChanged)
+-						bInvalidate = sal_True;
+ 					sal_uInt16 nChildCount = (sal_uInt16)GetChildCount(pEntry);
++                    if((nType == CONTENT_TYPE_OUTLINE) && bLevelOrVisibiblityChanged)
++                        bRepaint = sal_True;
+ 					if(bLevelOrVisibiblityChanged)
+ 						bInvalidate = sal_True;
+ 
+@@ -2789,6 +2861,10 @@ sal_Bool  SwContentTree::Select( SvLBoxE
+ 		return sal_False;
+ 	sal_Bool bEnable = sal_False;
+ 	SvLBoxEntry* pParentEntry = GetParent(pEntry);
++    while(pParentEntry && (!lcl_IsContentType(pParentEntry)))
++    {
++        pParentEntry = GetParent(pParentEntry);
++    }
+ 	if(!bIsLastReadOnly && (!IsVisible() ||
+ 		(bIsRoot && nRootType == CONTENT_TYPE_OUTLINE && pParentEntry ||
+ 			lcl_IsContent(pEntry) && ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)))

Added: trunk/patches/dev300/plus-minus-sw-navigator2.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/plus-minus-sw-navigator2.diff	Tue Apr 22 02:12:47 2008
@@ -0,0 +1,152 @@
+--- sw/source/ui/inc/conttree.hxx.orig	2008-02-19 21:56:13.000000000 +0800
++++ sw/source/ui/inc/conttree.hxx	2008-04-22 10:19:21.000000000 +0800
+@@ -43,6 +43,9 @@
+ #include "swcont.hxx"
+ #endif
+ 
++#include<map>
++//using namespace std;
++
+ class SwWrtShell;
+ class SwContentType;
+ class SwNavigationPI;
+@@ -87,6 +90,8 @@ class SwContentTree : public SvTreeListB
+ 	SwWrtShell* 		pActiveShell;   // die aktive oder eine konst. offene View
+ 	SwNavigationConfig*	pConfig;
+ 
++    std::map< void*, sal_Bool > mOutLineNodeMap;
++
+     sal_Int32           nActiveBlock;
+ 	USHORT				nHiddenBlock;
+ 	USHORT 				nRootType;
+--- sw/source/ui/utlui/content.cxx.bak	2008-04-22 10:16:09.000000000 +0800
++++ sw/source/ui/utlui/content.cxx	2008-04-22 10:19:21.000000000 +0800
+@@ -999,7 +999,6 @@ SwContentTree::~SwContentTree()
+ /***************************************************************************
+ 	Drag&Drop methods
+ ***************************************************************************/
+-
+ void SwContentTree::StartDrag( sal_Int8 nAction, const Point& rPosPixel )
+ {
+ 	if( !bIsRoot || nRootType != CONTENT_TYPE_OUTLINE )
+@@ -1049,8 +1048,45 @@ sal_Int8 SwContentTree::AcceptDrop( cons
+ /***************************************************************************
+ 	Beschreibung:	Drop wird im Navigator ausgefuehrt
+ ***************************************************************************/
++void* lcl_GetOutlineKey( SwContentTree* pTree, SwOutlineContent* pContent)
++{
++    void* key = 0;
++    if( pTree && pContent )
++    {
++        SwWrtShell* pShell = pTree->GetWrtShell();
++        sal_Int32 nPos = pContent->GetYPos();
++        if( nPos )
++        {
++            key = (void*)pShell->GetOutlineNode( nPos );
++        }
++    }
++    return key;
++}
++
+ sal_Int8 SwContentTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
+ {
++    SvLBoxEntry* pEntry = pTargetEntry;
++    if( pEntry && ( nRootType == CONTENT_TYPE_OUTLINE ) && lcl_IsContent( pEntry ) )
++    {
++        SwOutlineContent* pOutlineContent = ( SwOutlineContent* )( pEntry->GetUserData() );
++        if( pOutlineContent )
++        {
++            void* key = lcl_GetOutlineKey(this, pOutlineContent);
++            if( !mOutLineNodeMap[key] )
++            {
++                while( pEntry->HasChilds() )
++                {
++                    SvLBoxEntry* pChildEntry = FirstChild( pEntry );
++                    while( pChildEntry )
++                    {
++                        pEntry = pChildEntry;
++                        pChildEntry = NextSibling( pChildEntry );
++                    }
++                }
++                pTargetEntry = pEntry;
++            }
++        }
++    }
+ 	if( bIsRoot )
+ 		return SvTreeListBox::ExecuteDrop( rEvt );
+ 	return bIsInDrag ? DND_ACTION_NONE : GetParentWindow()->ExecuteDrop(rEvt);
+@@ -1339,7 +1375,8 @@ void  SwContentTree::RequestingChilds( S
+ 
+ sal_Bool  SwContentTree::Expand( SvLBoxEntry* pParent )
+ {
+-	if(!bIsRoot || ((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)
++	if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) || 
++            (nRootType == CONTENT_TYPE_OUTLINE))
+ 	{
+ 		if(lcl_IsContentType(pParent))
+ 		{
+@@ -1354,18 +1391,39 @@ sal_Bool  SwContentTree::Expand( SvLBoxE
+ 				nHiddenBlock |= nOr;
+             if((pCntType->GetType() == CONTENT_TYPE_OUTLINE))
+             {
++                std::map< void*, sal_Bool > mCurrOutLineNodeMap;
++
++                SwWrtShell* pShell = GetWrtShell();
+                 sal_Bool bBool = SvTreeListBox::Expand(pParent);
+                 SvLBoxEntry* pChild = Next(pParent);
+                 while(pChild && lcl_IsContent(pChild) && pParent->HasChilds())
+                 {
+                     if(pChild->HasChilds())
+-                        SvTreeListBox::Expand(pChild);
++                    {
++                        sal_Int32 nPos = ((SwContent*)pChild->GetUserData())->GetYPos();
++                        void* key = (void*)pShell->GetOutlineNode( nPos );
++                        mCurrOutLineNodeMap.insert(std::map<void*, sal_Bool>::value_type( key, sal_False ) );
++                        std::map<void*,sal_Bool>::iterator iter = mOutLineNodeMap.find( key );
++                        if( iter != mOutLineNodeMap.end() && mOutLineNodeMap[key])
++                        {
++                            mCurrOutLineNodeMap[key] = sal_True;
++                            SvTreeListBox::Expand(pChild);
++                        }
++                    }
+                     pChild = Next(pChild);
+                 }
++                mOutLineNodeMap = mCurrOutLineNodeMap;
+                 return bBool;
+             }
+ 
+ 		}
++        else if( lcl_IsContent(pParent) )
++        {
++            SwWrtShell* pShell = GetWrtShell();
++            sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos();
++            void* key = (void*)pShell->GetOutlineNode( nPos );
++            mOutLineNodeMap[key] = sal_True;
++        }
+ 	}
+ 	return SvTreeListBox::Expand(pParent);
+ }
+@@ -1377,7 +1435,8 @@ sal_Bool  SwContentTree::Expand( SvLBoxE
+ sal_Bool  SwContentTree::Collapse( SvLBoxEntry* pParent )
+ {
+ 	sal_Bool bRet;
+-	if(!bIsRoot || ((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)
++	if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) || 
++            (nRootType == CONTENT_TYPE_OUTLINE))
+ 	{
+ 		if(lcl_IsContentType(pParent))
+ 		{
+@@ -1394,6 +1453,13 @@ sal_Bool  SwContentTree::Collapse( SvLBo
+ 			else
+ 				nHiddenBlock &= nAnd;
+ 		}
++        else if( lcl_IsContent(pParent) )
++        {
++            SwWrtShell* pShell = GetWrtShell();
++            sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos();
++            void* key = (void*)pShell->GetOutlineNode( nPos );
++            mOutLineNodeMap[key] = sal_False;
++        }
+ 			bRet = SvTreeListBox::Collapse(pParent);
+ 	}
+ 	else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]