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
6 void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; }
7 void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; }
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
18 if ( mnUnitIndex == RULER_UNIT_CHAR )
20 - nTick3 = mnCharWidth;
21 + nTick3 = mnCharWidth*2;
22 nTickCount = mnCharWidth;
23 nTickUnit = 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 +/* ---------------------------------------------------
39 + * ---------------------------------------------------*/
40 +void Ruler::DrawTicks()
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
52 sal_Bool m_bSquaredMode;
53 + sal_Bool m_bHRulerChanged;
54 + sal_Bool m_bVRulerChanged;
56 SwTextGridPage(Window *pParent, const SfxItemSet &rSet);
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
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 )
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();
84 /*-- 06.02.2002 15:25:40---------------------------------------------------
86 aGridItem.SetColor(aColorLB.GetSelectEntryColor());
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 )
94 + SwView * pView = ::GetActiveView();
95 + if ( aGridItem.GetGridType() == GRID_LINES_CHARS )
97 + pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7));
98 + m_bHRulerChanged = sal_True;
100 + pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7));
101 + m_bVRulerChanged = sal_True;
104 /* -----------------------------08.02.2002 10:54------------------------------