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



Author: kyoshida
Date: Wed Oct 22 02:26:36 2008
New Revision: 14385
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14385&view=rev

Log:
2008-10-21  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/sc-no-apply-pattern-for-cursor.diff: implemented it
	a different way to fix regression caused by the original 
	implementation.  We can't rely only on the bCursorOnly parameter of
	ScViewFunc::ApplySelectionPattern(...) since that caused the 
	regression reported in n#437137.


Modified:
   trunk/ChangeLog
   trunk/patches/dev300/sc-no-apply-pattern-for-cursor.diff

Modified: trunk/patches/dev300/sc-no-apply-pattern-for-cursor.diff
==============================================================================
--- trunk/patches/dev300/sc-no-apply-pattern-for-cursor.diff	(original)
+++ trunk/patches/dev300/sc-no-apply-pattern-for-cursor.diff	Wed Oct 22 02:26:36 2008
@@ -1,17 +1,33 @@
-Index: sc/source/ui/view/viewfunc.cxx
-===================================================================
-RCS file: /cvs/sc/sc/source/ui/view/viewfunc.cxx,v
-retrieving revision 1.38
-diff -u -p -r1.38 viewfunc.cxx
---- sc/source/ui/view/viewfunc.cxx	2 Oct 2007 15:22:22 -0000	1.38
-+++ sc/source/ui/view/viewfunc.cxx	26 Feb 2008 23:17:48 -0000
-@@ -1334,7 +1334,8 @@ void ScViewFunc::ApplySelectionPattern( 
- 		SCTAB nTab = pViewData->GetTabNo();
- 		ScPatternAttr* pOldPat = new ScPatternAttr(*pDoc->GetPattern( nCol, nRow, nTab ));
+diff --git sc/source/ui/app/inputhdl.cxx sc/source/ui/app/inputhdl.cxx
+index 7a4e452..90bd8e3 100644
+--- sc/source/ui/app/inputhdl.cxx
++++ sc/source/ui/app/inputhdl.cxx
+@@ -2108,13 +2108,27 @@ void ScInputHandler::EnterHandler( BYTE nBlockMode )
+ 		USHORT nParCnt = pEngine->GetParagraphCount();
+ 		if ( nParCnt == 0 )
+ 			nParCnt = 1;
++
++        bool bUniformAttribs = true;
++        SfxItemSet aPara1Attribs = pEngine->GetAttribs(0, 0, pEngine->GetTextLen(0));
++        for (USHORT nPara = 1; nPara < nParCnt; ++nPara)
++        {
++            SfxItemSet aPara2Attribs = pEngine->GetAttribs(nPara, 0, pEngine->GetTextLen(nPara));
++            if (!(aPara1Attribs == aPara2Attribs))
++            {    
++                // paragraph format different from that of the 1st paragraph.
++                bUniformAttribs = false;
++                break;
++            }
++        }
++
+ 		ESelection aSel( 0, 0, nParCnt-1, pEngine->GetTextLen(nParCnt-1) );
+ 		SfxItemSet aOldAttribs = pEngine->GetAttribs( aSel );
+ 		const SfxPoolItem* pItem = NULL;
  
--		pDoc->ApplyPattern( nCol, nRow, nTab, rAttr );
-+		if (!bCursorOnly)
-+			pDoc->ApplyPattern( nCol, nRow, nTab, rAttr );
- 
- 		const ScPatternAttr* pNewPat = pDoc->GetPattern( nCol, nRow, nTab );
+ 		//	find common (cell) attributes before RemoveAdjust
  
+-		if ( pActiveViewSh )
++		if ( pActiveViewSh && bUniformAttribs )
+ 		{
+ 			SfxItemSet* pCommonAttrs = NULL;
+ 			for (USHORT nId = EE_CHAR_START; nId <= EE_CHAR_END; nId++)



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