ooo-build r12909 - in trunk: . patches/dev300
- From: ameliaw svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12909 - in trunk: . patches/dev300
- Date: Tue, 17 Jun 2008 09:29:04 +0000 (UTC)
Author: ameliaw
Date: Tue Jun 17 09:29:04 2008
New Revision: 12909
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12909&view=rev
Log:
add a new patch to adjust maximum and minimum values per line and page.
update the cjk-punctuation-compress.diff, and add a part for Windows.
Added:
trunk/patches/dev300/cjk-character-units-in-pggrid-fix.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
trunk/patches/dev300/cjk-punctuation-compress.diff
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Tue Jun 17 09:29:04 2008
@@ -261,6 +261,7 @@
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
+cjk-character-units-in-pggrid-fix.diff, Amelia Wang
# text layout enhancement for better CJK support
cjk-punctuation-compress.diff, Amelia Wang
Added: trunk/patches/dev300/cjk-character-units-in-pggrid-fix.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/cjk-character-units-in-pggrid-fix.diff Tue Jun 17 09:29:04 2008
@@ -0,0 +1,120 @@
+--- sw/source/ui/inc/pggrid.hxx-orig 2008-06-17 01:19:59.000000000 +0800
++++ sw/source/ui/inc/pggrid.hxx 2008-05-30 14:12:08.000000000 +0800
+@@ -96,6 +96,7 @@ class SwTextGridPage: public SfxTabPage
+
+ void UpdatePageSize(const SfxItemSet& rSet);
+ void PutGridItem(SfxItemSet& rSet);
++ void SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue );
+
+ DECL_LINK(GridTypeHdl, RadioButton*);
+ DECL_LINK(CharorLineChangedHdl, SpinField*);
+--- sw/source/ui/misc/pggrid.cxx-orig 2008-05-29 12:07:20.000000000 +0800
++++ sw/source/ui/misc/pggrid.cxx 2008-06-17 01:16:57.000000000 +0800
+@@ -261,6 +261,7 @@ void SwTextGridPage::Reset(const SfxI
+ GridTypeHdl(pButton);
+ aSnapToCharsCB.Check(rGridItem.IsSnapToChars());
+ aLinesPerPageNF.SetValue(rGridItem.GetLines());
++ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
+ m_nRubyUserValue = rGridItem.GetBaseHeight();
+ m_bRubyUserValue = sal_True;
+ aTextSizeMF.SetValue(aTextSizeMF.Normalize(m_nRubyUserValue), FUNIT_TWIP);
+@@ -387,6 +388,12 @@ void SwTextGridPage::UpdatePageSize(cons
+ if ( m_bSquaredMode )
+ {
+ aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize);
++ aCharsPerLineNF.SetMax( aCharsPerLineNF.GetValue() );
++ aLinesPerPageNF.SetMax( m_aPageSize.Height() /
++ ( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) +
++ aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
++ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
++ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
+ }
+ else
+ {
+@@ -396,9 +403,21 @@ void SwTextGridPage::UpdatePageSize(cons
+ aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth);
+ else
+ aCharsPerLineNF.SetValue( 45 );
++ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
++ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
+ }
+ }
+ }
++/* -----------------------------30.05.2008 14:12------------------------------
++
++ ---------------------------------------------------------------------------*/
++void SwTextGridPage::SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue )
++{
++ String aFieldStr = String::CreateFromAscii("( 1 -");
++ aFieldStr += String::CreateFromInt32( nValue );
++ aFieldStr += String::CreateFromAscii(" )");
++ rField.SetText( aFieldStr );
++}
+ /* -----------------------------06.02.2002 15:24------------------------------
+
+ ---------------------------------------------------------------------------*/
+@@ -433,6 +452,8 @@ IMPL_LINK(SwTextGridPage, CharorLineChan
+ aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
+ aLinesPerPageNF.SetMax(nMaxLines);
+ }
++ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
++ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
+ }
+ else//in normal mode
+ {
+@@ -441,10 +462,7 @@ IMPL_LINK(SwTextGridPage, CharorLineChan
+ long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / aLinesPerPageNF.GetValue());
+ aTextSizeMF.SetValue(aTextSizeMF.Normalize(nHeight), FUNIT_TWIP);
+ aRubySizeMF.SetValue(0, FUNIT_TWIP);
+- String aMaxLinesFTStr = String::CreateFromAscii("( 1 - ");
+- aMaxLinesFTStr += String::CreateFromInt32(aLinesPerPageNF.GetValue());
+- aMaxLinesFTStr += String::CreateFromAscii(" )");
+- aLinesRangeFT.SetText( aMaxLinesFTStr );
++ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
+
+ m_nRubyUserValue = nHeight;
+ m_bRubyUserValue = sal_True;
+@@ -453,10 +471,7 @@ IMPL_LINK(SwTextGridPage, CharorLineChan
+ {
+ long nWidth = static_cast< sal_Int32 >(m_aPageSize.Width() / aCharsPerLineNF.GetValue());
+ aCharWidthMF.SetValue(aCharWidthMF.Normalize(nWidth), FUNIT_TWIP);
+- String aMaxCharsFTStr = String::CreateFromAscii("( 1 - ");
+- aMaxCharsFTStr += String::CreateFromInt32(aCharsPerLineNF.GetValue());
+- aMaxCharsFTStr += String::CreateFromAscii(" )");
+- aCharsRangeFT.SetText( aMaxCharsFTStr );
++ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
+ }
+ }
+ GridModifyHdl(0);
+@@ -480,6 +495,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChange
+ ( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) +
+ aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
+ aLinesPerPageNF.SetMax(nMaxLines);
++ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
+ }
+ }
+ else
+@@ -489,10 +505,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChange
+ sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)));
+ aLinesPerPageNF.SetValue(m_aPageSize.Height() / nTextSize);
+ m_bRubyUserValue = sal_False;
+- String aRangesStr = String::CreateFromAscii("( 1 - ");
+- aRangesStr += String::CreateFromInt32( m_aPageSize.Height() / nTextSize );
+- aRangesStr += String::CreateFromAscii(" )");
+- aLinesRangeFT.SetText( aRangesStr );
++ SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
+ }
+ else if (&aCharWidthMF == pField)
+ {
+@@ -501,10 +514,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChange
+ if (nTextWidth)
+ nMaxChar = m_aPageSize.Width() / nTextWidth;
+ aCharsPerLineNF.SetValue( nMaxChar );
+- String aCharRangeStr = String::CreateFromAscii("( 1 - ");
+- aCharRangeStr += String::CreateFromInt32( nMaxChar );
+- aCharRangeStr += String::CreateFromAscii(" )");
+- aCharsRangeFT.SetText( aCharRangeStr );
++ SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
+ }
+ //rubySize is disabled
+ }
Modified: trunk/patches/dev300/cjk-punctuation-compress.diff
==============================================================================
--- trunk/patches/dev300/cjk-punctuation-compress.diff (original)
+++ trunk/patches/dev300/cjk-punctuation-compress.diff Tue Jun 17 09:29:04 2008
@@ -1,21 +1,19 @@
-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
+--- vcl-orig/source/gdi/sallayout.cxx 2008-06-16 17:35:42.000000000 +0800
++++ vcl/source/gdi/sallayout.cxx 2008-06-16 17:36:10.000000000 +0800
+@@ -798,13 +798,16 @@ 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;
-+ */
+- 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;
++ if ( !bVertical )
++ nResult = -2;
+ break;
+ case 0xFF08 : case 0x201C : case 0x2018 :
+ nResult = +2;
@@ -23,7 +21,7 @@
default:
break;
}
-@@ -1240,8 +1247,9 @@ void GenericSalLayout::ApplyAsianKerning
+@@ -1231,8 +1234,9 @@ void GenericSalLayout::ApplyAsianKerning
{
int n = pG->mnCharPos;
if( (n < nLength - 1)
@@ -35,15 +33,7 @@
{
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;
- }
+@@ -1250,7 +1254,7 @@ void GenericSalLayout::ApplyAsianKerning
}
if( pG+1 != pGEnd )
@@ -52,18 +42,36 @@
}
}
-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 );
-
+--- vcl-orig/source/glyphs/gcach_layout.cxx 2008-06-16 17:35:32.000000000 +0800
++++ vcl/source/glyphs/gcach_layout.cxx 2008-06-16 17:36:10.000000000 +0800
+@@ -85,7 +85,7 @@ void ServerFontLayout::AdjustLayout( Imp
// 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
+ if( (rArgs.mnFlags & SAL_LAYOUT_KERNING_ASIAN)
&& !(rArgs.mnFlags & SAL_LAYOUT_VERTICAL) )
- if( (rArgs.mpDXArray != NULL) || (rArgs.mnLayoutWidth != 0) )
-+ //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
+--- vcl-orig/win/source/gdi/winlayout.cxx 2008-03-26 14:50:58.000000000 +0800
++++ vcl/win/source/gdi/winlayout.cxx 2008-04-01 12:33:48.000000000 +0800
+@@ -320,7 +320,7 @@ bool SimpleWinLayout::LayoutText( ImplLa
+ {
+ TEXTMETRICA aTextMetricA;
+ if( ::GetTextMetricsA( mhDC, &aTextMetricA )
+- && !(aTextMetricA.tmPitchAndFamily & TMPF_FIXED_PITCH) )
++ && !(aTextMetricA.tmPitchAndFamily & TMPF_FIXED_PITCH) && !(aTextMetricA.tmCharSet == 0x86) )
+ rArgs.mnFlags &= ~SAL_LAYOUT_KERNING_ASIAN;
+ }
+
+@@ -523,8 +523,8 @@ bool SimpleWinLayout::LayoutText( ImplLa
+ else if( rArgs.mnFlags & SAL_LAYOUT_KERNING_ASIAN )
+ #endif // GCP_KERN_HACK
+
+- if( (0x3000 == (0xFF00 & pBidiStr[i-1]))
+- && (0x3000 == (0xFF00 & pBidiStr[i])) )
++ if( ( (0x3000 == (0xFF00 & pBidiStr[i-1])) || (0x2010 == (0xFFF0 & pBidiStr[i-1])) || (0xFF00 == (0xFF00 & pBidiStr[i-1])))
++ && ( (0x3000 == (0xFF00 & pBidiStr[i])) || (0x2010 == (0xFFF0 & pBidiStr[i])) || (0xFF00 == (0xFF00 & pBidiStr[i])) ) )
+ {
+ long nKernFirst = +CalcAsianKerning( pBidiStr[i-1], true, bVertical );
+ long nKernNext = -CalcAsianKerning( pBidiStr[i], false, bVertical );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]