merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0049-cjk-character-units-rulers-sync-with-pggrid-fix.diff
blob5d33b6dfceaf1e27ec16bfe61941a5cfa1e8d7fd
1 diff -uNr svtools/inc/ruler.hxx svtools/inc/ruler.hxx
2 --- svtools/inc/ruler.hxx 2007-12-26 14:54:40.000000000 +0800
3 +++ svtools/inc/ruler.hxx 2007-12-26 15:01:40.000000000 +0800
4 @@ -894,6 +894,8 @@
6 void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; }
7 void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; }
9 + void DrawTicks();
12 #endif // _RULER_HXX
13 diff -uNr svtools/source/control/ruler.cxx svtools/source/control/ruler.cxx
14 --- svtools/source/control/ruler.cxx 2007-12-26 14:54:42.000000000 +0800
15 +++ svtools/source/control/ruler.cxx 2007-12-26 15:01:48.000000000 +0800
16 @@ -492,14 +492,14 @@
17 long nTick2 ;
18 if ( mnUnitIndex == RULER_UNIT_CHAR )
20 - nTick3 = mnCharWidth;
21 + nTick3 = mnCharWidth*2;
22 nTickCount = mnCharWidth;
23 nTickUnit = mnCharWidth;
24 nTick2 = mnCharWidth;
26 else if ( mnUnitIndex == RULER_UNIT_LINE )
28 - nTick3 = mnLineHeight;
29 + nTick3 = mnLineHeight*2;
30 nTickCount = mnLineHeight;
31 nTickUnit = mnLineHeight;
32 nTick2 = mnLineHeight;
33 @@ -3235,3 +3235,12 @@
34 USHORT Ruler::GetIndentCount() const { return mpData->nIndents; }
35 const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; }
37 +/* ---------------------------------------------------
38 + *
39 + * ---------------------------------------------------*/
40 +void Ruler::DrawTicks()
42 + mbFormat = TRUE;
43 + ImplDraw();
46 diff -uNr sw/source/ui/inc/pggrid.hxx sw/source/ui/inc/pggrid.hxx
47 --- sw/source/ui/inc/pggrid.hxx 2007-12-26 14:54:15.000000000 +0800
48 +++ sw/source/ui/inc/pggrid.hxx 2007-12-26 15:00:30.000000000 +0800
49 @@ -99,6 +99,8 @@
50 Size m_aPageSize;
51 sal_Bool m_bVertical;
52 sal_Bool m_bSquaredMode;
53 + sal_Bool m_bHRulerChanged;
54 + sal_Bool m_bVRulerChanged;
56 SwTextGridPage(Window *pParent, const SfxItemSet &rSet);
57 ~SwTextGridPage();
58 diff -uNr sw/source/ui/misc/pggrid.cxx sw/source/ui/misc/pggrid.cxx
59 --- sw/source/ui/misc/pggrid.cxx 2007-12-26 14:54:15.000000000 +0800
60 +++ sw/source/ui/misc/pggrid.cxx 2007-12-26 15:00:31.000000000 +0800
61 @@ -128,7 +128,9 @@
62 m_bRubyUserValue(sal_False),
63 m_aPageSize(MM50, MM50),
64 m_bVertical(sal_False),
65 - m_bSquaredMode(sal_False)
66 + m_bSquaredMode(sal_False),
67 + m_bHRulerChanged( sal_False ),
68 + m_bVRulerChanged( sal_False )
70 FreeResource();
72 @@ -262,6 +264,12 @@
73 bRet = TRUE;
76 + // draw ticks of ruler
77 + SwView * pView = ::GetActiveView();
78 + if ( m_bHRulerChanged )
79 + pView->GetHLineal().DrawTicks();
80 + if ( m_bVRulerChanged )
81 + pView->GetVLineal().DrawTicks();
82 return bRet;
84 /*-- 06.02.2002 15:25:40---------------------------------------------------
85 @@ -349,9 +357,17 @@
86 aGridItem.SetColor(aColorLB.GetSelectEntryColor());
87 rSet.Put(aGridItem);
88 /// Amelia
89 - SwView * pView = ::GetActiveView();
90 - pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7));
91 - pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7));
92 + if ( aGridItem.GetGridType() != GRID_NONE )
93 + {
94 + SwView * pView = ::GetActiveView();
95 + if ( aGridItem.GetGridType() == GRID_LINES_CHARS )
96 + {
97 + pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7));
98 + m_bHRulerChanged = sal_True;
99 + }
100 + pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7));
101 + m_bVRulerChanged = sal_True;
104 /* -----------------------------08.02.2002 10:54------------------------------