ooo-build r12210 - in trunk: . patches/src680



Author: ameliaw
Date: Fri Apr 18 01:44:05 2008
New Revision: 12210
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12210&view=rev

Log:
fix bug #376788, to set that swriter paragraph dialog uses character unit when
local languague environment belongs to CJK languages.



Added:
   trunk/patches/src680/cjk-character-units-fix-376788.diff
Modified:
   trunk/ChangeLog
   trunk/patches/src680/apply

Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply	(original)
+++ trunk/patches/src680/apply	Fri Apr 18 01:44:05 2008
@@ -234,10 +234,11 @@
 cws-cjksp1-xmloff.diff, Fong Lin
 
 # add a new unit 'character unit'
-#cjk-character-units-ui.diff, Amelia Wang
-#cjk-character-units-imp.diff, Amelia Wang
-#cjk-character-units-rulers-sync-with-pggrid-fix.diff, Amelia Wang
-#cjk-character-units-fix.diff, i#356101, Amelia Wang 
+cjk-character-units-ui.diff, Amelia Wang
+cjk-character-units-imp.diff, Amelia Wang
+cjk-character-units-rulers-sync-with-pggrid-fix.diff, Amelia Wang
+cjk-character-units-fix.diff, i#356101, Amelia Wang 
+cjk-character-units-fix-376788.diff, i#376788, Amelia Wang
 
 # text layout enhancement for better CJK support
 #cjk-punctuation-compress.diff, Amelia Wang

Added: trunk/patches/src680/cjk-character-units-fix-376788.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/cjk-character-units-fix-376788.diff	Fri Apr 18 01:44:05 2008
@@ -0,0 +1,220 @@
+--- sw/source/ui/app/swmodul1.cxx	2008-04-14 14:05:13.000000000 +0800
++++ sw/source/ui/app/swmodul1.cxx	2008-04-17 13:51:11.000000000 +0800
+@@ -91,6 +91,9 @@
+ #ifndef _SV_MSGBOX_HXX
+ #include <vcl/msgbox.hxx>
+ #endif
++#ifndef _SVTOOLS_CJKOPTIONS_HXX
++#include <svtools/cjkoptions.hxx>
++#endif
+ #ifndef _SWMODULE_HXX
+ #include <swmodule.hxx>
+ #endif
+@@ -384,10 +387,15 @@ void SwModule::ApplyUserCharUnit(BOOL bA
+ 	}
+ 	else
+ 	{
+-		if ( eHScrollMetric == FUNIT_CHAR )
+-			eHScrollMetric == FUNIT_CM;
+-		if ( eVScrollMetric == FUNIT_LINE )
+-			eVScrollMetric == FUNIT_CM;
++		SvtCJKOptions aCJKOptions;
++		if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eHScrollMetric == FUNIT_CHAR ))
++			eHScrollMetric = FUNIT_INCH;
++		else if ( eHScrollMetric == FUNIT_CHAR )
++			eHScrollMetric = FUNIT_CM;
++		if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eVScrollMetric == FUNIT_LINE ))
++			eVScrollMetric = FUNIT_INCH;
++		else if ( eVScrollMetric == FUNIT_LINE )
++			eVScrollMetric = FUNIT_CM;
+ 	}
+ 	SwView* pTmpView = SwModule::GetFirstView();
+ 	// fuer alle MDI-Fenster das Lineal umschalten
+--- sw/source/ui/config/optload.cxx	2008-04-14 14:05:13.000000000 +0800
++++ sw/source/ui/config/optload.cxx	2008-04-17 14:07:36.000000000 +0800
+@@ -163,7 +163,6 @@ SwLoadOptPage::SwLoadOptPage( Window* pP
+ 			case FUNIT_POINT:
+ 			case FUNIT_PICA:
+ 			case FUNIT_INCH:
+-			case FUNIT_CHAR:
+ 			{
+ 				// nur diese Metriken benutzen
+ 				USHORT nPos = aMetricLB.InsertEntry( sMetric );
+@@ -265,9 +264,12 @@ BOOL __EXPORT SwLoadOptPage::FillItemSet
+         bRet = TRUE;
+     }
+ 
+-	if(aUseCharUnit.IsChecked() != aUseCharUnit.GetSavedValue())
++	sal_Bool bIsUseCharUnitFlag = aUseCharUnit.IsChecked();
++	SvtCJKOptions aCJKOptions;
++        bIsUseCharUnitFlag = bIsUseCharUnitFlag && aCJKOptions.IsAsianTypographyEnabled();
++	if( bIsUseCharUnitFlag != aUseCharUnit.GetSavedValue())
+ 	{
+-		rSet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, aUseCharUnit.IsChecked()));
++		rSet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bIsUseCharUnitFlag ));
+ 		bRet = TRUE;
+ 	}
+ 
+--- sw/source/ui/misc/pggrid.cxx	2008-04-15 15:27:38.000000000 +0800
++++ sw/source/ui/misc/pggrid.cxx	2008-04-11 16:28:19.000000000 +0800
+@@ -365,9 +365,9 @@ void SwTextGridPage::PutGridItem(SfxItem
+                 m_bHRulerChanged = sal_True;
+             }
+             m_bVRulerChanged = sal_True;
++            pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7));
++            pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7));
+         }
+-        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------------------------------
+ 
+--- sw/source/ui/uiview/view.cxx	2008-04-14 14:05:13.000000000 +0800
++++ sw/source/ui/uiview/view.cxx	2008-04-17 17:27:49.000000000 +0800
+@@ -1068,16 +1068,40 @@ SwView::SwView( SfxViewFrame *_pFrame, S
+ 
+     BOOL bApplyCharUnit = pUsrPref->IsApplyCharUnit();
+     SvtCJKOptions aCJKOptions;
+-    if ( aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit )
+-        pHRuler->SetUnit( FUNIT_CHAR );
++    if ( aCJKOptions.IsAsianTypographyEnabled() )
++    {
++        if ( bApplyCharUnit )
++            eMetric = FUNIT_CHAR;
++        else
++        {
++            if ( eMetric == FUNIT_CHAR )
++                eMetric = FUNIT_CM;
++        }
++    }
+     else
+-        pHRuler->SetUnit( eMetric );
++    {
++        if ( eMetric == FUNIT_CHAR )
++            eMetric = FUNIT_INCH;
++    }
++    pHRuler->SetUnit( eMetric );
+ 
+     eMetric = pUsrPref->GetVScrollMetric();
+-    if ( aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit )
+-        pVRuler->SetUnit(FUNIT_LINE);
++    if ( aCJKOptions.IsAsianTypographyEnabled() )
++    {
++        if ( bApplyCharUnit )
++            eMetric = FUNIT_LINE;
++        else
++        {
++            if ( eMetric == FUNIT_LINE )
++                eMetric = FUNIT_CM;
++        }
++    }
+     else
+-        pVRuler->SetUnit( eMetric );
++    {
++        if ( eMetric == FUNIT_LINE )
++            eMetric = FUNIT_INCH;
++    }
++    pVRuler->SetUnit( eMetric );
+ 
+         pHRuler->SetCharWidth( 371 );  // default character width
+         pVRuler->SetLineHeight( 551 );  // default line height
+--- svx/source/dialog/paragrph.cxx	2008-04-15 15:27:38.000000000 +0800
++++ svx/source/dialog/paragrph.cxx	2008-04-17 18:11:00.000000000 +0800
+@@ -106,6 +106,9 @@
+ #include <svtools/eitem.hxx> //add CHINA001
+ #include <sfx2/request.hxx> //add CHINA001
+ #include <svtools/intitem.hxx> //add CHINA001
++#ifndef _SVTOOLS_CJKOPTIONS_HXX
++#include <svtools/cjkoptions.hxx>
++#endif
+ 
+ // static ----------------------------------------------------------------
+ 
+@@ -485,18 +488,26 @@ void SvxStdParagraphTabPage::Reset( cons
+ 
+ 	BOOL bApplyCharUnit = sal_False ;
+ 	bApplyCharUnit = GetApplyCharUnit( &rSet );
++	
++	SvtCJKOptions aCJKOptions;
++ 	if(aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit )
++		eFUnit = FUNIT_CHAR;
+ 
+-	if ( bApplyCharUnit )
+-		eFUnit = FUNIT_CHAR;  // Amelia
+ 	SetFieldUnit( aLeftIndent, eFUnit );
+ 	SetFieldUnit( aRightIndent, eFUnit );
+ 	SetFieldUnit( aFLineIndent, eFUnit );
+-	if ( bApplyCharUnit )
+-		eFUnit = FUNIT_LINE;   // Amelia
+-	SetFieldUnit( aTopDist, eFUnit );
+-	SetFieldUnit( aBottomDist, eFUnit );
+-	eFUnit = FUNIT_POINT;
+-	SetFieldUnit( aLineDistAtMetricBox, eFUnit );
++	if ( eFUnit == FUNIT_CHAR )
++	{
++		SetFieldUnit( aTopDist, FUNIT_LINE );
++		SetFieldUnit( aBottomDist, FUNIT_LINE );
++		SetFieldUnit( aLineDistAtMetricBox, FUNIT_POINT );
++	}
++	else
++	{
++		SetFieldUnit( aTopDist, eFUnit );
++		SetFieldUnit( aBottomDist, eFUnit );
++		SetFieldUnit( aLineDistAtMetricBox, eFUnit );
++	}
+ 
+     USHORT _nWhich = GetWhich( SID_ATTR_LRSPACE );
+     SfxItemState eItemState = rSet.GetItemState( _nWhich );
+@@ -588,7 +599,10 @@ void SvxStdParagraphTabPage::Reset( cons
+ 			else
+ 			{
+ 				aTopDist.SetRelative();
+-				SetFieldUnit( aTopDist, eFUnit );
++				if ( eFUnit == FUNIT_CHAR )
++					SetFieldUnit( aTopDist, FUNIT_LINE );
++				else
++					SetFieldUnit( aTopDist, eFUnit );
+ 				SetMetricValue( aTopDist, rOldItem.GetUpper(), eUnit );
+ 			}
+ 
+@@ -600,7 +614,10 @@ void SvxStdParagraphTabPage::Reset( cons
+ 			else
+ 			{
+ 				aBottomDist.SetRelative();
+-				SetFieldUnit( aBottomDist, eFUnit );
++				if ( eFUnit == FUNIT_CHAR )
++					SetFieldUnit( aBottomDist, FUNIT_LINE );
++				else
++					SetFieldUnit( aBottomDist, eFUnit );
+ 				SetMetricValue( aBottomDist, rOldItem.GetLower(), eUnit );
+ 			}
+ 		}
+--- svtools/source/control/ruler.cxx	2008-04-15 15:27:38.000000000 +0800
++++ svtools/source/control/ruler.cxx	2008-04-11 16:28:19.000000000 +0800
+@@ -284,6 +284,8 @@ void Ruler::ImplInit( WinBits nWinBits )
+     mnExtraStyle    = 0;                    // Style des Extra-Feldes
+     mnExtraClicks   = 0;                    // Click-Anzahl fuer Extra-Feld
+     mnExtraModifier = 0;                    // Modifier-Tasten beim Click im Extrafeld
++    mnCharWidth     = 371;
++    mnLineHeight    = 551;
+     mbCalc          = TRUE;                 // Muessen Pagebreiten neu berechnet werden
+     mbFormat        = TRUE;                 // Muss neu ausgegeben werden
+     mbDrag          = FALSE;                // Sind wir im Drag-Modus
+@@ -492,6 +494,8 @@ void Ruler::ImplDrawTicks( long nMin, lo
+     long    nTick2 ;
+     if ( mnUnitIndex == RULER_UNIT_CHAR )
+     {
++        if ( mnCharWidth == 0 )
++            mnCharWidth = 371;
+         nTick3 = mnCharWidth*2;
+         nTickCount = mnCharWidth;
+         nTickUnit = mnCharWidth;
+@@ -499,6 +503,8 @@ void Ruler::ImplDrawTicks( long nMin, lo
+     }
+     else if ( mnUnitIndex == RULER_UNIT_LINE )
+     {
++        if ( mnLineHeight == 0 )
++            mnLineHeight = 551;
+         nTick3 = mnLineHeight*2;
+         nTickCount = mnLineHeight;
+         nTickUnit = mnLineHeight;



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