update dev300-m57
[ooovba.git] / applied_patches / 0036-cjk-character-units-in-pggrid-fix.diff
blobd37f3e6c0a4711d738e359e3c417916711d62b53
1 --- sw/source/ui/inc/pggrid.hxx-orig 2008-06-17 01:19:59.000000000 +0800
2 +++ sw/source/ui/inc/pggrid.hxx 2008-05-30 14:12:08.000000000 +0800
3 @@ -96,6 +96,7 @@ class SwTextGridPage: public SfxTabPage
5 void UpdatePageSize(const SfxItemSet& rSet);
6 void PutGridItem(SfxItemSet& rSet);
7 + void SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue );
9 DECL_LINK(GridTypeHdl, RadioButton*);
10 DECL_LINK(CharorLineChangedHdl, SpinField*);
11 --- sw/source/ui/misc/pggrid.cxx-orig 2008-05-29 12:07:20.000000000 +0800
12 +++ sw/source/ui/misc/pggrid.cxx 2008-06-17 01:16:57.000000000 +0800
13 @@ -261,6 +261,7 @@ void SwTextGridPage::Reset(const SfxI
14 GridTypeHdl(pButton);
15 aSnapToCharsCB.Check(rGridItem.IsSnapToChars());
16 aLinesPerPageNF.SetValue(rGridItem.GetLines());
17 + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
18 m_nRubyUserValue = rGridItem.GetBaseHeight();
19 m_bRubyUserValue = sal_True;
20 aTextSizeMF.SetValue(aTextSizeMF.Normalize(m_nRubyUserValue), FUNIT_TWIP);
21 @@ -387,6 +388,12 @@ void SwTextGridPage::UpdatePageSize(cons
22 if ( m_bSquaredMode )
24 aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize);
25 + aCharsPerLineNF.SetMax( aCharsPerLineNF.GetValue() );
26 + aLinesPerPageNF.SetMax( m_aPageSize.Height() /
27 + ( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) +
28 + aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
29 + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
30 + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
32 else
34 @@ -396,9 +403,21 @@ void SwTextGridPage::UpdatePageSize(cons
35 aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth);
36 else
37 aCharsPerLineNF.SetValue( 45 );
38 + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
39 + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
43 +/* -----------------------------30.05.2008 14:12------------------------------
45 + ---------------------------------------------------------------------------*/
46 +void SwTextGridPage::SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue )
48 + String aFieldStr = String::CreateFromAscii("( 1 -");
49 + aFieldStr += String::CreateFromInt32( nValue );
50 + aFieldStr += String::CreateFromAscii(" )");
51 + rField.SetText( aFieldStr );
53 /* -----------------------------06.02.2002 15:24------------------------------
55 ---------------------------------------------------------------------------*/
56 @@ -433,6 +452,8 @@ IMPL_LINK(SwTextGridPage, CharorLineChan
57 aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
58 aLinesPerPageNF.SetMax(nMaxLines);
60 + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
61 + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
63 else//in normal mode
65 @@ -441,10 +462,7 @@ IMPL_LINK(SwTextGridPage, CharorLineChan
66 long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / aLinesPerPageNF.GetValue());
67 aTextSizeMF.SetValue(aTextSizeMF.Normalize(nHeight), FUNIT_TWIP);
68 aRubySizeMF.SetValue(0, FUNIT_TWIP);
69 - String aMaxLinesFTStr = String::CreateFromAscii("( 1 - ");
70 - aMaxLinesFTStr += String::CreateFromInt32(aLinesPerPageNF.GetValue());
71 - aMaxLinesFTStr += String::CreateFromAscii(" )");
72 - aLinesRangeFT.SetText( aMaxLinesFTStr );
73 + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
75 m_nRubyUserValue = nHeight;
76 m_bRubyUserValue = sal_True;
77 @@ -453,10 +471,7 @@ IMPL_LINK(SwTextGridPage, CharorLineChan
79 long nWidth = static_cast< sal_Int32 >(m_aPageSize.Width() / aCharsPerLineNF.GetValue());
80 aCharWidthMF.SetValue(aCharWidthMF.Normalize(nWidth), FUNIT_TWIP);
81 - String aMaxCharsFTStr = String::CreateFromAscii("( 1 - ");
82 - aMaxCharsFTStr += String::CreateFromInt32(aCharsPerLineNF.GetValue());
83 - aMaxCharsFTStr += String::CreateFromAscii(" )");
84 - aCharsRangeFT.SetText( aMaxCharsFTStr );
85 + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
88 GridModifyHdl(0);
89 @@ -480,6 +495,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChange
90 ( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) +
91 aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
92 aLinesPerPageNF.SetMax(nMaxLines);
93 + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
96 else
97 @@ -489,10 +505,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChange
98 sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)));
99 aLinesPerPageNF.SetValue(m_aPageSize.Height() / nTextSize);
100 m_bRubyUserValue = sal_False;
101 - String aRangesStr = String::CreateFromAscii("( 1 - ");
102 - aRangesStr += String::CreateFromInt32( m_aPageSize.Height() / nTextSize );
103 - aRangesStr += String::CreateFromAscii(" )");
104 - aLinesRangeFT.SetText( aRangesStr );
105 + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() );
107 else if (&aCharWidthMF == pField)
109 @@ -501,10 +514,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChange
110 if (nTextWidth)
111 nMaxChar = m_aPageSize.Width() / nTextWidth;
112 aCharsPerLineNF.SetValue( nMaxChar );
113 - String aCharRangeStr = String::CreateFromAscii("( 1 - ");
114 - aCharRangeStr += String::CreateFromInt32( nMaxChar );
115 - aCharRangeStr += String::CreateFromAscii(" )");
116 - aCharsRangeFT.SetText( aCharRangeStr );
117 + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() );
119 //rubySize is disabled