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



Author: freuter
Date: Thu Oct  9 14:45:24 2008
New Revision: 14267
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14267&view=rev

Log:
n#364534: better way to do negative line spacing

Modified:
   trunk/ChangeLog
   trunk/patches/dev300/sw-allow-negative-spacing.diff

Modified: trunk/patches/dev300/sw-allow-negative-spacing.diff
==============================================================================
--- trunk/patches/dev300/sw-allow-negative-spacing.diff	(original)
+++ trunk/patches/dev300/sw-allow-negative-spacing.diff	Thu Oct  9 14:45:24 2008
@@ -1,16 +1,33 @@
---- sw_save/source/core/text/txtfrm.cxx	2007-11-26 18:30:32.000000000 +0100
-+++ sw/source/core/text/txtfrm.cxx	2008-02-26 05:27:17.000000000 +0100
-@@ -2401,10 +2401,13 @@
-             nTmp *= rSpace.GetPropLineSpace();
-             nTmp /= 100;
-             nTmp -= nRet;
-+	    nRet = nTmp;
+diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
+index 7feb1e1..a8afab7 100644
+--- sw/source/core/text/itrform2.cxx
++++ sw/source/core/text/itrform2.cxx
+@@ -1691,6 +1691,28 @@ void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine )
+             switch( pSpace->GetLineSpaceRule() )
+             {
+                 case SVX_LINE_SPACE_AUTO:
++		    if (pSpace->GetInterLineSpaceRule()==SVX_INTER_LINE_SPACE_PROP) { 
++                        long nTmp = pSpace->GetPropLineSpace();
++                        if (nTmp<100) { // code adaped from fixed line height
++                            nTmp *= nLineHeight;
++                            nTmp /= 100;
++                            if( !nTmp )
++                                ++nTmp;
++                            nLineHeight = (KSHORT)nTmp;
 +/*
-             if ( nTmp > 0 )
-                 nRet = nTmp;
-             else
-                 nRet = 0;
++                            //@TODO figure out how WW maps ascent and descent
++                            //in case of prop  line spacing <100%
++                            KSHORT nAsc = ( 4 * nLineHeight ) / 5;  // 80%
++                            if( nAsc < pCurr->GetAscent() ||
++                                nLineHeight - nAsc < pCurr->Height() -
++pCurr->GetAscent() )
++                                pCurr->SetClipping( sal_True );
++                            pCurr->SetAscent( nAsc );
 +*/
- 		}
- 			break;
- 		case SVX_INTER_LINE_SPACE_FIX:
++                            pCurr->Height( nLineHeight );
++                            pInf->GetParaPortion()->SetFixLineHeight();
++                        }
++                    }
+                 break;
+                 case SVX_LINE_SPACE_MIN:
+                 {



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