incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wangz...@apache.org
Subject svn commit: r1381875 - in /incubator/ooo/trunk/main: editeng/source/editeng/impedit3.cxx filter/source/msfilter/svdfppt.cxx
Date Fri, 07 Sep 2012 05:13:25 GMT
Author: wangzcdl
Date: Fri Sep  7 05:13:25 2012
New Revision: 1381875

URL: http://svn.apache.org/viewvc?rev=1381875&view=rev
Log:
   Fix issue #i120344#: The line spacing of the paragraphs is incorrectly if open the .ppt
doc 
   * subversion/main/filter/source/msfilter/svdfppt.cxx 
   []if the line space type is SVX_LINE_SPACE_FIX, set it
   * subversion/main/editeng/source/editeng/impedit3.cxx  
   []reset the text height and max ascent of the line when type is SVX_LINE_SPACE_FIX.

   Patch by: Ma Bingbing <jiazema@gmail.com>
   Suggested by: Wang Zhe <kingwisemmx@gmail.com>
   Found by: Ma Bingbing <jiazema@gmail.com>
   Review by: Wang Zhe <kingwisemmx@gmail.com>

Modified:
    incubator/ooo/trunk/main/editeng/source/editeng/impedit3.cxx
    incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx

Modified: incubator/ooo/trunk/main/editeng/source/editeng/impedit3.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/editeng/source/editeng/impedit3.cxx?rev=1381875&r1=1381874&r2=1381875&view=diff
==============================================================================
--- incubator/ooo/trunk/main/editeng/source/editeng/impedit3.cxx (original)
+++ incubator/ooo/trunk/main/editeng/source/editeng/impedit3.cxx Fri Sep  7 05:13:25 2012
@@ -1343,6 +1343,19 @@ sal_Bool ImpEditEngine::CreateLines( sal
                     }
 				}
 			}
+			else if( rLSItem.GetLineSpaceRule() == SVX_LINE_SPACE_FIX )
+			{
+				sal_uInt16 nTxtHeight = pLine->GetHeight();
+				sal_uInt32 nH = rLSItem.GetLineHeight();
+				if ( nH != nTxtHeight )
+				{
+					long nMaxAscent = pLine->GetMaxAscent() - nTxtHeight + nH;
+					if ( nMaxAscent < 0 )
+						nMaxAscent = 0 ;
+					pLine->SetMaxAscent( (sal_uInt16)nMaxAscent );
+					pLine->SetHeight( (sal_uInt16)nH, nTxtHeight );
+				}
+			}
 		}
 
 
@@ -1688,6 +1701,19 @@ void ImpEditEngine::CreateAndInsertEmpty
                 }
 			}
 		}
+		else if( rLSItem.GetLineSpaceRule() == SVX_LINE_SPACE_FIX )
+		{
+			sal_uInt16 nTxtHeight = pTmpLine->GetHeight();
+			sal_uInt32 nH = rLSItem.GetLineHeight();
+			if ( nH != nTxtHeight )
+			{
+				long nMaxAscent = pTmpLine->GetMaxAscent() - nTxtHeight + nH;
+				if ( nMaxAscent < 0 )
+					nMaxAscent = 0 ;
+				pTmpLine->SetMaxAscent( (sal_uInt16)nMaxAscent );
+				pTmpLine->SetHeight( (sal_uInt16)nH, nTxtHeight );
+			}
+		}
 	}
 
 	if ( !bLineBreak )

Modified: incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx?rev=1381875&r1=1381874&r2=1381875&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx Fri Sep  7 05:13:25 2012
@@ -6443,7 +6443,10 @@ void PPTParagraphObj::ApplyTo( SfxItemSe
 		rSet.Put( SdrTextFixedCellHeightItem( sal_True ), SDRATTR_TEXT_USEFIXEDCELLHEIGHT );
 		SvxLineSpacingItem aItem( 200, EE_PARA_SBL );
 		if ( nVal2 <= 0 )
+		{
 			aItem.SetLineHeight( (sal_uInt16)( rManager.ScalePoint( -nVal2 ) / 8 ) );
+			aItem.GetLineSpaceRule() = SVX_LINE_SPACE_FIX;  
+		}
 		else
 		{
             sal_uInt8 nPropLineSpace = (sal_uInt8)nVal2;



Mime
View raw message