ooo-build r11850 - trunk/patches/src680



Author: ameliaw
Date: Mon Mar 10 02:35:06 2008
New Revision: 11850
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11850&view=rev

Log:
submit two diff files :cjk-character-units-fix.diff and
cjk-punctuation-compress.diff


Added:
   trunk/patches/src680/cjk-character-units-fix.diff
   trunk/patches/src680/cjk-punctuation-compress.diff

Added: trunk/patches/src680/cjk-character-units-fix.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/cjk-character-units-fix.diff	Mon Mar 10 02:35:06 2008
@@ -0,0 +1,170 @@
+diff -uNpr officecfg-orig/registry/schema/org/openoffice/Office/Writer.xcs officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+--- officecfg-orig/registry/schema/org/openoffice/Office/Writer.xcs	2008-03-07 12:01:16.000000000 +0800
++++ officecfg/registry/schema/org/openoffice/Office/Writer.xcs	2008-03-03 14:49:15.000000000 +0800
+@@ -1515,18 +1515,6 @@
+ 					</info>
+ 					<value>false</value>
+ 				</prop>
+-				<!-- added for apply char unit 2006-12-1 -->
+-				<prop oor:name="ApplyCharUnit" oor:type="xs:boolean">
+-					<!-- OldPath: Writer/Layout -->
+-					<!-- OldLocation: Soffice.cfg -->
+-					<!-- UIHints: Tools - Options - Text document - Layout - [Section] Apply char unit -->
+-					<info>
+-						<author>OS</author>
+-						<desc>apply char unit to calculate the paragraph's indent</desc>
+-						<label>apply char unit</label>
+-					</info>
+-					<value>true</value>
+-				</prop>
+ 			</group>
+ 			<group oor:name="Other">
+ 				<info>
+@@ -1608,6 +1596,18 @@
+ 					</info>
+ 					<value>true</value>
+ 				</prop>	
++				<!-- added for apply char unit 2006-12-1 -->
++				<prop oor:name="ApplyCharUnit" oor:type="xs:boolean">
++					<!-- OldPath: Writer/Layout -->
++					<!-- OldLocation: Soffice.cfg -->
++					<!-- UIHints: Tools - Options - Text document - Layout - [Section] Apply char unit -->
++					<info>
++						<author>OS</author>
++						<desc>apply char unit to calculate the paragraph's indent</desc>
++						<label>apply char unit</label>
++					</info>
++					<value>true</value>
++				</prop>
+ 			</group>
+ 			<group oor:name="Zoom">
+ 				<info>
+diff -uNpr sw-orig/source/ui/app/appopt.cxx sw/source/ui/app/appopt.cxx
+--- sw-orig/source/ui/app/appopt.cxx	2008-02-22 11:55:53.000000000 +0800
++++ sw/source/ui/app/appopt.cxx	2008-03-04 22:18:51.000000000 +0800
+@@ -288,6 +288,7 @@ SfxItemSet*	 SwModule::CreateItemSet( US
+         pAppView->GetVLinealMetric(eUnit);
+     pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< UINT16 >(eUnit) ));
+     pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< UINT16 >(pPref->GetMetric()) ));
++    pRet->Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit()));
+     if(bTextDialog)
+ 	{
+ 		if(pAppView)
+diff -uNpr sw-orig/source/ui/app/swmodul1.cxx sw/source/ui/app/swmodul1.cxx
+--- sw-orig/source/ui/app/swmodul1.cxx	2008-02-22 11:55:53.000000000 +0800
++++ sw/source/ui/app/swmodul1.cxx	2008-03-04 22:18:25.000000000 +0800
+@@ -384,8 +384,10 @@ void SwModule::ApplyUserCharUnit(BOOL bA
+ 	}
+ 	else
+ 	{
+-		eHScrollMetric = FUNIT_CM;
+-		eVScrollMetric = FUNIT_CM;
++		if ( eHScrollMetric == FUNIT_CHAR )
++			eHScrollMetric == FUNIT_CM;
++		if ( eVScrollMetric == FUNIT_LINE )
++			eVScrollMetric == FUNIT_CM;
+ 	}
+ 	SwView* pTmpView = SwModule::GetFirstView();
+ 	// fuer alle MDI-Fenster das Lineal umschalten
+diff -uNpr sw-orig/source/ui/config/optload.cxx sw/source/ui/config/optload.cxx
+--- sw-orig/source/ui/config/optload.cxx	2008-02-25 17:22:20.000000000 +0800
++++ sw/source/ui/config/optload.cxx	2008-03-04 22:22:18.000000000 +0800
+@@ -184,7 +184,10 @@ SwLoadOptPage::SwLoadOptPage( Window* pP
+ 	
+ 	SvtCJKOptions aCJKOptions;
+ 	if(!aCJKOptions.IsAsianTypographyEnabled())
++        {
+ 		aUseSquaredPageMode.Hide();
++                aUseCharUnit.Hide();
++        }
+ }
+ 
+ /*-----------------18.01.97 12.43-------------------
+diff -uNpr sw-orig/source/ui/config/optload.src sw/source/ui/config/optload.src
+--- sw-orig/source/ui/config/optload.src	2008-02-22 11:55:53.000000000 +0800
++++ sw/source/ui/config/optload.src	2008-03-05 15:12:21.000000000 +0800
+@@ -152,8 +152,7 @@ TabPage TP_OPTLOAD_PAGE
+     {
+         Pos = MAP_APPFONT ( 12 , 130) ;
+         Size = MAP_APPFONT ( 109 , 10 ) ;
+-        Text [ de ] = "appy char unit" ;
+-        Text [ en-US ] = "apply char unit";
++        Text [ en-US ] = "Enable char unit";
+         Text [ x-comment ] = " ";
+     };
+ 
+diff -uNpr sw-orig/source/ui/config/usrpref.cxx sw/source/ui/config/usrpref.cxx
+--- sw-orig/source/ui/config/usrpref.cxx	2008-02-22 11:55:53.000000000 +0800
++++ sw/source/ui/config/usrpref.cxx	2008-03-04 22:20:44.000000000 +0800
+@@ -85,6 +85,7 @@ SwMasterUsrPref::SwMasterUsrPref(BOOL bW
+     bIsVScrollMetricSet(sal_False),
+     nDefTab( MM50 * 4 ),
+     bIsSquaredPageMode(sal_False),
++    bApplyCharUnit(sal_False),
+     aContentConfig(bWeb, *this),
+     aLayoutConfig(bWeb, *this),
+     aGridConfig(bWeb, *this),
+@@ -351,7 +352,7 @@ void SwLayoutViewConfig::Commit()
+             case 14: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(rParent.GetDefTab())); break;// "Other/TabStop",
+             case 15: bSet = rParent.IsVRulerRight(); break;// "Window/IsVerticalRulerRight",
+             case 16: bSet = rParent.IsSquaredPageMode(); break;// "Other/IsSquaredPageMode",
+-            case 17: bSet = rParent.IsApplyCharUnit(); break;// "Other/IsApplyCharUnit",
++            case 17: bSet = rParent.IsApplyCharUnit(); break;// "Other/ApplyCharUnit",
+         }
+         if(nProp < 8 || nProp == 10 || nProp == 16 || nProp == 17)
+ 			pValues[nProp].setValue(&bSet, ::getBooleanCppuType());
+diff -uNpr sw-orig/source/ui/misc/pggrid.cxx sw/source/ui/misc/pggrid.cxx
+--- sw-orig/source/ui/misc/pggrid.cxx	2008-02-22 11:55:53.000000000 +0800
++++ sw/source/ui/misc/pggrid.cxx	2008-03-06 17:09:01.000000000 +0800
+@@ -357,17 +357,17 @@ void SwTextGridPage::PutGridItem(SfxItem
+         aGridItem.SetColor(aColorLB.GetSelectEntryColor());
+         rSet.Put(aGridItem);
+ /// Amelia
++            SwView * pView = ::GetActiveView();
+         if ( aGridItem.GetGridType() != GRID_NONE )
+         {
+-            SwView * pView = ::GetActiveView();
+             if ( aGridItem.GetGridType() == GRID_LINES_CHARS )
+             {
+-                pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7));
+                 m_bHRulerChanged = sal_True;
+             }
+-            pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7));
+             m_bVRulerChanged = sal_True;
+         }
++        pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7));
++        pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7));
+ }
+ /* -----------------------------08.02.2002 10:54------------------------------
+ 
+diff -uNpr sw-orig/source/ui/uiview/view.cxx sw/source/ui/uiview/view.cxx
+--- sw-orig/source/ui/uiview/view.cxx	2008-02-25 17:22:20.000000000 +0800
++++ sw/source/ui/uiview/view.cxx	2008-02-28 16:03:47.000000000 +0800
+@@ -266,7 +266,9 @@
+ #endif
+ 
+ #include <unomid.h>
+-
++#ifndef _SVTOOLS_CJKOPTIONS_HXX
++#include <svtools/cjkoptions.hxx>
++#endif
+ 
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+@@ -1065,13 +1067,14 @@ SwView::SwView( SfxViewFrame *_pFrame, S
+     FieldUnit eMetric = pUsrPref->GetHScrollMetric();
+ 
+     BOOL bApplyCharUnit = pUsrPref->IsApplyCharUnit();
+-    if ( bApplyCharUnit )
++    SvtCJKOptions aCJKOptions;
++    if ( aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit )
+         pHRuler->SetUnit( FUNIT_CHAR );
+     else
+         pHRuler->SetUnit( eMetric );
+ 
+     eMetric = pUsrPref->GetVScrollMetric();
+-    if ( bApplyCharUnit )
++    if ( aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit )
+         pVRuler->SetUnit(FUNIT_LINE);
+     else
+         pVRuler->SetUnit( eMetric );

Added: trunk/patches/src680/cjk-punctuation-compress.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/cjk-punctuation-compress.diff	Mon Mar 10 02:35:06 2008
@@ -0,0 +1,69 @@
+diff -uNpr vcl-orig/source/gdi/sallayout.cxx vcl/source/gdi/sallayout.cxx
+--- vcl-orig/source/gdi/sallayout.cxx	2008-03-07 12:01:50.000000000 +0800
++++ vcl/source/gdi/sallayout.cxx	2008-02-26 20:35:04.000000000 +0800
+@@ -817,13 +817,20 @@ int SalLayout::CalcAsianKerning( sal_UCS
+         nResult = nTable[ c - 0x3000 ];
+     else switch( c )
+     {
+-        case ':': case ';': case '!':
++        /*case ':': case ';': case '!':
+             if( !bVertical )
+                 nResult = bLeft ? -1 : +1;  // 25% left and right
+             break;
++        */
+         case 0x30FB:
+             nResult = bLeft ? -1 : +1;      // 25% left/right/top/bottom
+             break;
++        case 0xFF09 : case 0xFF0C : case 0xFF1A : case 0xFF1B : case 0x2019 : case 0x201D : case 0xFF01 :
++            nResult = -2;
++            break;
++        case 0xFF08 : case 0x201C : case 0x2018 : 
++            nResult = +2;
++            break;
+         default:
+             break;
+     }
+@@ -1240,8 +1247,9 @@ void GenericSalLayout::ApplyAsianKerning
+     {
+         int n = pG->mnCharPos;
+         if( (n < nLength - 1)
+-        &&  (0x3000 == (0xFF00 & pStr[n]))
+-        &&  (0x3000 == (0xFF00 & pStr[n+1])) )
++        && ((0x3000 == (0xFF00 & pStr[n])) || (0x2010 == (0xFFF0 & pStr[n])) || (0xFF00 == (0xFF00 & pStr[n])))
++        &&  ((0x3000 == (0xFF00 & pStr[n+1])) || (0x2010 == (0xFFF0 & pStr[n+1])) || (0xFF00 == (0xFF00 & pStr[n+1])))
++        )
+         {
+             const bool bVertical = false;
+             long nKernFirst = +CalcAsianKerning( pStr[n], true, bVertical );
+@@ -1252,14 +1260,14 @@ void GenericSalLayout::ApplyAsianKerning
+             {
+                 int nGlyphWidth = pG->mnOrigWidth;
+                 nDelta = (nDelta * nGlyphWidth + 2) / 4;
+-                if( pG+1 == pGEnd )
++                //if( pG+1 == pGEnd )
+                     pG->mnNewWidth += nDelta;
+                 nOffset += nDelta;
+             }
+         }
+ 
+         if( pG+1 != pGEnd )
+-            pG->maLinearPos.X() += nOffset;
++            (pG+1)->maLinearPos.X() += nOffset;
+     }
+ }
+ 
+diff -uNpr vcl-orig/source/glyphs/gcach_layout.cxx vcl/source/glyphs/gcach_layout.cxx
+--- vcl-orig/source/glyphs/gcach_layout.cxx	2008-03-07 12:01:51.000000000 +0800
++++ vcl/source/glyphs/gcach_layout.cxx	2008-02-27 17:45:43.000000000 +0800
+@@ -98,9 +98,9 @@ void ServerFontLayout::AdjustLayout( Imp
+     GenericSalLayout::AdjustLayout( rArgs );
+ 
+     // apply asian kerning if the glyphs are not already formatted
+-    if( (rArgs.mnFlags & SAL_LAYOUT_KERNING_ASIAN)
++    if( /*(rArgs.mnFlags & SAL_LAYOUT_KERNING_ASIAN) &&*/ !rArgs.mpDXArray
+     && !(rArgs.mnFlags & SAL_LAYOUT_VERTICAL) )
+-        if( (rArgs.mpDXArray != NULL) || (rArgs.mnLayoutWidth != 0) )
++        //if( (rArgs.mpDXArray != NULL) || (rArgs.mnLayoutWidth != 0) )
+             ApplyAsianKerning( rArgs.mpStr, rArgs.mnLength );
+ 
+     // insert kashidas where requested by the formatting array



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