1 diff -purN svtools.old/inc/ruler.hxx svtools/inc/ruler.hxx
2 --- svtools.old/inc/ruler.hxx 2009-02-12 14:57:50.000000000 +0100
3 +++ svtools/inc/ruler.hxx 2009-02-13 11:11:54.000000000 +0100
4 @@ -693,6 +693,10 @@ private:
7 USHORT mnExtraModifier;
12 RulerExtra meExtraType;
15 @@ -872,6 +876,9 @@ public:
17 //set text direction right-to-left
18 void SetTextRTL(BOOL bRTL);
20 + void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; }
21 + void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; }
25 diff -purN svtools.old/source/control/ruler.cxx svtools/source/control/ruler.cxx
26 --- svtools.old/source/control/ruler.cxx 2009-02-12 14:57:43.000000000 +0100
27 +++ svtools/source/control/ruler.cxx 2009-02-13 11:11:54.000000000 +0100
28 @@ -470,6 +470,25 @@ void Ruler::ImplDrawTicks( long nMin, lo
30 BOOL bNoTicks = FALSE;
35 + if ( mnUnitIndex == RULER_UNIT_CHAR )
37 + nTick3 = mnCharWidth;
38 + nTickCount = mnCharWidth;
39 + nTickUnit = mnCharWidth;
40 + nTick2 = mnCharWidth;
42 + else if ( mnUnitIndex == RULER_UNIT_LINE )
44 + nTick3 = mnLineHeight;
45 + nTickCount = mnLineHeight;
46 + nTickUnit = mnLineHeight;
47 + nTick2 = mnLineHeight;
49 + aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode );
51 // Groessenvorberechnung
52 BOOL bVertRight = FALSE;
53 if ( mnWinStyle & WB_HORZ )
54 @@ -490,7 +509,11 @@ void Ruler::ImplDrawTicks( long nMin, lo
55 long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width();
58 - nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit;
60 + if (( mnUnitIndex == RULER_UNIT_CHAR ) || ( mnUnitIndex == RULER_UNIT_LINE ))
61 + nMaxWidth /= nTickUnit;
63 + nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit;
64 UniString aNumStr( UniString::CreateFromInt32( nMaxWidth ) );
65 long nTxtWidth = GetTextWidth( aNumStr );
66 if ( (nTxtWidth*2) > nTickWidth )
67 @@ -570,7 +593,11 @@ void Ruler::ImplDrawTicks( long nMin, lo
68 // Tick3 - Ausgabe (Text)
69 if ( !(nTick % nTick3) )
71 - aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit );
72 + //aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit );
73 + if ( ( mnUnitIndex == RULER_UNIT_CHAR ) || ( mnUnitIndex == RULER_UNIT_LINE ) )
74 + aNumStr = UniString::CreateFromInt32( nTick / nTickUnit );
76 + aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit );
77 nTxtWidth2 = GetTextWidth( aNumStr )/2;
80 @@ -597,7 +624,10 @@ void Ruler::ImplDrawTicks( long nMin, lo
81 // Tick/Tick2 - Ausgabe (Striche)
84 - if ( !(nTick % aImplRulerUnitTab[mnUnitIndex].nTick2) )
86 + if ( ( mnUnitIndex != RULER_UNIT_CHAR ) && ( mnUnitIndex != RULER_UNIT_LINE ) )
87 + nTick2 = aImplRulerUnitTab[mnUnitIndex].nTick2;
88 + if ( !(nTick % nTick2 ) )
89 nTickWidth = RULER_TICK2_WIDTH;
91 nTickWidth = RULER_TICK1_WIDTH;
92 @@ -2807,6 +2837,12 @@ void Ruler::SetUnit( FieldUnit eNewUnit
94 mnUnitIndex = RULER_UNIT_PICA;
97 + mnUnitIndex = RULER_UNIT_CHAR;
100 + mnUnitIndex = RULER_UNIT_LINE;
104 DBG_ERRORFILE( "Ruler::SetUnit() - Wrong Unit" );
105 diff -purN svx.old/inc/dlgutil.hxx svx/inc/dlgutil.hxx
106 --- svx.old/inc/dlgutil.hxx 2009-02-12 14:57:31.000000000 +0100
107 +++ svx/inc/dlgutil.hxx 2009-02-13 11:11:54.000000000 +0100
108 @@ -58,6 +58,7 @@ SVX_DLLPUBLIC void SetFieldUnit( MetricB
109 FieldUnit eUnit, BOOL bAll = FALSE );
111 SVX_DLLPUBLIC FieldUnit GetModuleFieldUnit( const SfxItemSet* pSet = NULL );
112 +SVX_DLLPUBLIC BOOL GetApplyCharUnit( const SfxItemSet* pSet = NULL );
114 // Metriken umrechnen
115 SVX_DLLPUBLIC long CalcToUnit( float nIn, SfxMapUnit eUnit );
116 diff -purN svx.old/source/dialog/dlgutil.cxx svx/source/dialog/dlgutil.cxx
117 --- svx.old/source/dialog/dlgutil.cxx 2009-02-12 14:57:23.000000000 +0100
118 +++ svx/source/dialog/dlgutil.cxx 2009-02-13 11:11:54.000000000 +0100
120 #include <sfx2/viewfrm.hxx>
121 #include <sfx2/objsh.hxx>
123 +#ifndef _SFXENUMITEM_HXX
124 +#include <svtools/eitem.hxx>
127 #include <svx/dialogs.hrc>
129 #include "dlgutil.hxx"
130 @@ -112,6 +116,9 @@ void SetFieldUnit( MetricField& rField,
131 rField.SetUnit( eUnit );
134 + // Amelia : sets the step of "char" and "line" unit , they are same as FUNIT_MM
138 rField.SetSpinSize( 50 );
140 @@ -209,6 +216,36 @@ FieldUnit GetModuleFieldUnit( const SfxI
144 +// -----------------------------------------------------------------------
145 +BOOL GetApplyCharUnit( const SfxItemSet* pSet )
147 + BOOL bUseCharUnit = FALSE;
148 + const SfxPoolItem* pItem = NULL;
149 + if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_ATTR_APPLYCHARUNIT, FALSE, &pItem ) )
150 + bUseCharUnit = (BOOL)( (const SfxBoolItem*)pItem )->GetValue();
153 + SfxViewFrame* pFrame = SfxViewFrame::Current();
154 + SfxObjectShell* pSh = NULL;
156 + pSh = pFrame->GetObjectShell();
157 + if ( pSh ) // #93209# the object shell is not always available during reload
159 + SfxModule* pModule = pSh->GetModule();
162 + const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_APPLYCHARUNIT );
164 + bUseCharUnit = (BOOL)( (SfxBoolItem*)pItem )->GetValue();
168 + DBG_ERRORFILE( "GetApplyCharUnit(): no module found" );
172 + return bUseCharUnit;
175 // -----------------------------------------------------------------------
176 void SetMetricValue( MetricField& rField, long nCoreValue, SfxMapUnit eUnit )
177 diff -purN svx.old/source/dialog/paragrph.cxx svx/source/dialog/paragrph.cxx
178 --- svx.old/source/cui/paragrph.cxx
179 +++ svx/source/cui/paragrph.cxx
180 @@ -460,11 +460,20 @@ void SvxStdParagraphTabPage::Reset( cons
183 FieldUnit eFUnit = GetModuleFieldUnit( &rSet );
185 + BOOL bApplyCharUnit = sal_False ;
186 + bApplyCharUnit = GetApplyCharUnit( &rSet );
188 + if ( bApplyCharUnit )
189 + eFUnit = FUNIT_CHAR; // Amelia
190 SetFieldUnit( aLeftIndent, eFUnit );
191 SetFieldUnit( aRightIndent, eFUnit );
192 SetFieldUnit( aFLineIndent, eFUnit );
193 + if ( bApplyCharUnit )
194 + eFUnit = FUNIT_LINE; // Amelia
195 SetFieldUnit( aTopDist, eFUnit );
196 SetFieldUnit( aBottomDist, eFUnit );
197 + eFUnit = FUNIT_POINT;
198 SetFieldUnit( aLineDistAtMetricBox, eFUnit );
200 USHORT _nWhich = GetWhich( SID_ATTR_LRSPACE );
201 diff -purN sw.old/inc/swmodule.hxx sw/inc/swmodule.hxx
202 --- sw.old/inc/swmodule.hxx 2009-02-12 14:53:46.000000000 +0100
203 +++ sw/inc/swmodule.hxx 2009-02-13 11:11:54.000000000 +0100
204 @@ -169,6 +169,8 @@ public:
205 //default page mode for text grid
206 void ApplyDefaultPageMode(sal_Bool bIsSquaredPageMode);
208 + void ApplyUserCharUnit(BOOL bApplyChar, BOOL bWeb); // apply_char_unit
210 // ConfigItems erzeugen
211 SwModuleOptions* GetModuleConfig() { return pModuleConfig;}
212 SwPrintOptions* GetPrtOptions(sal_Bool bWeb);
213 diff -purN sw.old/source/ui/app/appopt.cxx sw/source/ui/app/appopt.cxx
214 --- sw.old/source/ui/app/appopt.cxx 2009-02-12 14:53:36.000000000 +0100
215 +++ sw/source/ui/app/appopt.cxx 2009-02-13 11:11:54.000000000 +0100
216 @@ -139,6 +139,7 @@ SfxItemSet* SwModule::CreateItemSet( US
217 FN_PARAM_WRTSHELL, FN_PARAM_WRTSHELL,
218 FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER,
219 SID_ATTR_METRIC, SID_ATTR_METRIC,
220 + SID_ATTR_APPLYCHARUNIT, SID_ATTR_APPLYCHARUNIT,
221 SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
222 RES_BACKGROUND, RES_BACKGROUND,
223 SID_HTML_MODE, SID_HTML_MODE,
224 @@ -370,6 +371,15 @@ void SwModule::ApplyItemSet( USHORT nId,
225 const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem;
226 ::SetDfltMetric((FieldUnit)pMetricItem->GetValue(), !bTextDialog);
229 + if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT,
232 + SFX_APP()->SetOptions(rSet);
233 + const SfxBoolItem* pCharItem = (const SfxBoolItem*)pItem;
234 + ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog);
237 if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC,
240 diff -purN sw.old/source/ui/app/swmodul1.cxx sw/source/ui/app/swmodul1.cxx
241 --- sw.old/source/ui/app/swmodul1.cxx 2009-02-12 14:53:36.000000000 +0100
242 +++ sw/source/ui/app/swmodul1.cxx 2009-02-13 11:11:54.000000000 +0100
243 @@ -311,6 +311,63 @@ void SwModule::ApplyRulerMetric( FieldUn
244 pTmpView = SwModule::GetNextView(pTmpView);
248 +/*-------------------------------------------------
249 +set the usrpref 's char unit attribute and set ruler
250 +'s unit as char if the "apply char unit" is checked
251 +--------------------------------------------------*/
252 +void SwModule::ApplyUserCharUnit(BOOL bApplyChar, BOOL bWeb)
254 + SwMasterUsrPref* pPref;
258 + GetUsrPref(sal_True);
259 + pPref = pWebUsrPref;
264 + GetUsrPref(sal_False);
267 + BOOL bOldApplyCharUnit = pPref->IsApplyCharUnit();
268 + BOOL bHasChanged = FALSE;
269 + if(bOldApplyCharUnit != bApplyChar)
271 + pPref->SetApplyCharUnit(bApplyChar);
272 + bHasChanged = TRUE;
278 + FieldUnit eHScrollMetric = pPref->IsHScrollMetric() ? pPref->GetHScrollMetric() : pPref->GetMetric();
279 + FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : pPref->GetMetric();
282 + eHScrollMetric = FUNIT_CHAR;
283 + eVScrollMetric = FUNIT_LINE;
287 + eHScrollMetric = FUNIT_CM;
288 + eVScrollMetric = FUNIT_CM;
290 + SwView* pTmpView = SwModule::GetFirstView();
291 + // fuer alle MDI-Fenster das Lineal umschalten
294 + if(bWeb == (0 != PTR_CAST(SwWebView, pTmpView)))
296 + pTmpView->ChangeVLinealMetric(eVScrollMetric);
297 + pTmpView->ChangeTabMetric(eHScrollMetric);
300 + pTmpView = SwModule::GetNextView(pTmpView);
304 /*-----------------13.11.96 11.57-------------------
306 --------------------------------------------------*/
307 diff -purN sw.old/source/ui/config/optload.cxx sw/source/ui/config/optload.cxx
308 --- sw.old/source/ui/config/optload.cxx 2009-02-12 14:53:43.000000000 +0100
309 +++ sw/source/ui/config/optload.cxx 2009-02-13 11:11:54.000000000 +0100
310 @@ -222,6 +222,12 @@ BOOL __EXPORT SwLoadOptPage::FillItemSet
311 (USHORT)aTabMF.Denormalize(aTabMF.GetValue(FUNIT_TWIP))));
315 + if(aUseCharUnit.IsChecked() != aUseCharUnit.GetSavedValue())
317 + rSet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, aUseCharUnit.IsChecked()));
321 sal_Bool bIsSquaredPageModeFlag = aUseSquaredPageMode.IsChecked();
322 if ( bIsSquaredPageModeFlag != aUseSquaredPageMode.GetSavedValue() )
323 @@ -309,6 +315,17 @@ void __EXPORT SwLoadOptPage::Reset( cons
324 aUseSquaredPageMode.Check( bSquaredPageMode );
325 aUseSquaredPageMode.SaveValue();
328 + if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT, FALSE, &pItem))
330 + BOOL bUseCharUnit = ((const SfxBoolItem*)pItem)->GetValue();
331 + aUseCharUnit.Check(bUseCharUnit);
335 + aUseCharUnit.Check(pUsrPref->IsApplyCharUnit());
337 + aUseCharUnit.SaveValue();
339 /*-----------------13.01.97 14.44-------------------
340 Metric des Deftabstops umschalten
341 diff -purN sw.old/source/ui/config/usrpref.cxx sw/source/ui/config/usrpref.cxx
342 --- sw.old/source/ui/config/usrpref.cxx 2009-02-12 14:53:43.000000000 +0100
343 +++ sw/source/ui/config/usrpref.cxx 2009-02-13 11:11:54.000000000 +0100
344 @@ -266,9 +266,10 @@ Sequence<OUString> SwLayoutViewConfig::G
345 "Window/IsVerticalRulerRight", //15
346 "ViewLayout/Columns", //16
347 "ViewLayout/BookMode", //17
348 - "Other/IsSquaredPageMode" //18
349 + "Other/IsSquaredPageMode", //18
350 + "Other/ApplyCharUnit" //19
352 - const int nCount = bWeb ? 14 : 19;
353 + const int nCount = bWeb ? 14 : 20;
354 Sequence<OUString> aNames(nCount);
355 OUString* pNames = aNames.getArray();
356 for(int i = 0; i < nCount; i++)
357 @@ -335,8 +336,9 @@ void SwLayoutViewConfig::Commit()
358 case 16: pValues[nProp] <<= (sal_Int32)rParent.GetViewLayoutColumns(); break;// "ViewLayout/Columns",
359 case 17: bSet = rParent.IsViewLayoutBookMode(); break;// "ViewLayout/BookMode",
360 case 18: bSet = rParent.IsSquaredPageMode(); break;// "Other/IsSquaredPageMode",
361 + case 19: bSet = rParent.IsApplyCharUnit(); break;// "Other/IsApplyCharUnit",
363 - if(nProp < 8 || nProp == 10 || nProp == 15 || nProp == 17 || nProp == 18 )
364 + if(nProp < 8 || nProp == 10 || nProp == 15 || nProp == 17 || nProp == 18 || nProp == 19 )
365 pValues[nProp].setValue(&bSet, ::getBooleanCppuType());
367 PutProperties(aNames, aValues);
368 @@ -356,7 +358,7 @@ void SwLayoutViewConfig::Load()
370 if(pValues[nProp].hasValue())
372 - sal_Bool bSet = nProp < 8 || nProp == 10 || nProp == 17 || nProp == 18 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False;
373 + sal_Bool bSet = nProp < 8 || nProp == 10 || nProp == 17 || nProp == 18 || nProp == 19 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False;
376 case 0: rParent.SetCrossHair(bSet); break;// "Line/Guide",
377 @@ -422,6 +424,7 @@ void SwLayoutViewConfig::Load()
378 break;// "ViewLayout/Columns",
379 case 17: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
380 case 18: rParent.SetDefaultPageMode(bSet,TRUE); break;// "Other/IsSquaredPageMode",
381 + case 19: rParent.SetApplyCharUnit(bSet); break;// "Other/ApplyUserChar"
385 diff -purN sw.old/source/ui/inc/pggrid.hxx sw/source/ui/inc/pggrid.hxx
386 --- sw.old/source/ui/inc/pggrid.hxx 2009-02-12 14:53:45.000000000 +0100
387 +++ sw/source/ui/inc/pggrid.hxx 2009-02-13 11:11:54.000000000 +0100
388 @@ -79,7 +79,7 @@ class SwTextGridPage: public SfxTabPage
390 ColorListBox aColorLB;
392 - Window* aControls[18];
393 + Window* aControls[20];
395 sal_Int32 m_nRubyUserValue;
396 sal_Bool m_bRubyUserValue;
397 diff -purN sw.old/source/ui/inc/uitool.hxx sw/source/ui/inc/uitool.hxx
398 --- sw.old/source/ui/inc/uitool.hxx 2009-02-12 14:53:45.000000000 +0100
399 +++ sw/source/ui/inc/uitool.hxx 2009-02-13 11:11:54.000000000 +0100
400 @@ -76,6 +76,9 @@ void SfxToSwPageDescAttr( const SwWrtShe
401 SW_DLLPUBLIC FieldUnit GetDfltMetric(BOOL bWeb);
402 void SetDfltMetric(FieldUnit eMetric, BOOL bWeb);
404 +SW_DLLPUBLIC BOOL HasCharUnit( BOOL bWeb );
405 +void SetApplyCharUnit(BOOL bApplyChar, BOOL bWeb);
407 // ListBox mit allen Zeichenvorlagen fuellen - ausser Standard!
408 SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, BOOL bSorted = FALSE, BOOL bWithDefault = FALSE);
410 diff -purN sw.old/source/ui/inc/usrpref.hxx sw/source/ui/inc/usrpref.hxx
411 --- sw.old/source/ui/inc/usrpref.hxx 2009-02-12 14:53:45.000000000 +0100
412 +++ sw/source/ui/inc/usrpref.hxx 2009-02-13 11:11:54.000000000 +0100
413 @@ -152,6 +152,7 @@ class SwMasterUsrPref : public SwViewOpt
414 SwCursorConfig aCursorConfig;
415 SwWebColorConfig* pWebColorConfig;
417 + sal_Bool bApplyCharUnit; // apply_char_unit
419 SwMasterUsrPref(BOOL bWeb);
421 @@ -253,6 +254,17 @@ public:
422 aLayoutConfig.SetModified();
425 + sal_Bool IsApplyCharUnit() const
427 + return bApplyCharUnit;
429 + void SetApplyCharUnit(BOOL bSet, sal_Bool bNoModify = sal_False)
431 + bApplyCharUnit = bSet;
433 + aLayoutConfig.SetModified();
436 sal_Int32 GetDefTab() const { return nDefTab;}
437 void SetDefTab( sal_Int32 nSet, sal_Bool bNoModify = sal_False )
439 diff -purN sw.old/source/ui/misc/pggrid.cxx sw/source/ui/misc/pggrid.cxx
440 --- sw.old/source/ui/misc/pggrid.cxx 2009-02-12 14:53:41.000000000 +0100
441 +++ sw/source/ui/misc/pggrid.cxx 2009-02-13 11:11:54.000000000 +0100
442 @@ -116,7 +116,9 @@ SwTextGridPage::SwTextGridPage(Window *p
443 aControls[14] =&aPrintCB;
444 aControls[15] =&aColorFT;
445 aControls[16] =&aColorLB;
447 + aControls[17] =&aLinesRangeFT;
448 + aControls[18] =&aCharsRangeFT;
451 Link aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl);
452 aCharsPerLineNF.SetUpHdl(aLink);
453 @@ -312,6 +314,10 @@ void SwTextGridPage::PutGridItem(SfxItem
454 aGridItem.SetPrintGrid(aPrintCB.IsChecked());
455 aGridItem.SetColor(aColorLB.GetSelectEntryColor());
458 + SwView * pView = ::GetActiveView();
459 + pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7));
460 + pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7));
462 /* -----------------------------08.02.2002 10:54------------------------------
464 @@ -416,6 +422,10 @@ IMPL_LINK(SwTextGridPage, CharorLineChan
465 long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / aLinesPerPageNF.GetValue());
466 aTextSizeMF.SetValue(aTextSizeMF.Normalize(nHeight), FUNIT_TWIP);
467 aRubySizeMF.SetValue(0, FUNIT_TWIP);
468 + String aMaxLinesFTStr = String::CreateFromAscii("( 1 - ");
469 + aMaxLinesFTStr += String::CreateFromInt32(aLinesPerPageNF.GetValue());
470 + aMaxLinesFTStr += String::CreateFromAscii(" )");
471 + aLinesRangeFT.SetText( aMaxLinesFTStr );
473 m_nRubyUserValue = nHeight;
474 m_bRubyUserValue = sal_True;
475 @@ -424,6 +434,10 @@ IMPL_LINK(SwTextGridPage, CharorLineChan
477 long nWidth = static_cast< sal_Int32 >(m_aPageSize.Width() / aCharsPerLineNF.GetValue());
478 aCharWidthMF.SetValue(aCharWidthMF.Normalize(nWidth), FUNIT_TWIP);
479 + String aMaxCharsFTStr = String::CreateFromAscii("( 1 - ");
480 + aMaxCharsFTStr += String::CreateFromInt32(aCharsPerLineNF.GetValue());
481 + aMaxCharsFTStr += String::CreateFromAscii(" )");
482 + aCharsRangeFT.SetText( aMaxCharsFTStr );
486 @@ -439,7 +453,6 @@ IMPL_LINK(SwTextGridPage, TextSizeChange
487 if (&aTextSizeMF == pField)
489 sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)));
490 - aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize);
491 m_bRubyUserValue = sal_False;
493 //set maximum line per page
494 @@ -457,14 +470,22 @@ IMPL_LINK(SwTextGridPage, TextSizeChange
495 sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)));
496 aLinesPerPageNF.SetValue(m_aPageSize.Height() / nTextSize);
497 m_bRubyUserValue = sal_False;
498 + String aRangesStr = String::CreateFromAscii("( 1 - ");
499 + aRangesStr += String::CreateFromInt32( m_aPageSize.Height() / nTextSize );
500 + aRangesStr += String::CreateFromAscii(" )");
501 + aLinesRangeFT.SetText( aRangesStr );
503 else if (&aCharWidthMF == pField)
505 sal_Int32 nTextWidth = static_cast< sal_Int32 >(aCharWidthMF.Denormalize(aCharWidthMF.GetValue(FUNIT_TWIP)));
506 + sal_Int32 nMaxChar = 45 ;
508 - aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth);
510 - aCharsPerLineNF.SetValue( 45 );
511 + nMaxChar = m_aPageSize.Width() / nTextWidth;
512 + aCharsPerLineNF.SetValue( nMaxChar );
513 + String aCharRangeStr = String::CreateFromAscii("( 1 - ");
514 + aCharRangeStr += String::CreateFromInt32( nMaxChar );
515 + aCharRangeStr += String::CreateFromAscii(" )");
516 + aCharsRangeFT.SetText( aCharRangeStr );
518 //rubySize is disabled
520 @@ -492,6 +513,7 @@ IMPL_LINK(SwTextGridPage, GridTypeHdl, R
522 aCharsPerLineFT.Enable(sal_False);
523 aCharsPerLineNF.Enable(sal_False);
524 + aCharsRangeFT.Enable(sal_False);
525 aCharWidthFT.Enable(sal_False);
526 aCharWidthMF.Enable(sal_False);
528 diff -purN sw.old/source/ui/shells/textsh1.cxx sw/source/ui/shells/textsh1.cxx
529 --- sw.old/source/ui/shells/textsh1.cxx 2009-02-12 14:53:41.000000000 +0100
530 +++ sw/source/ui/shells/textsh1.cxx 2009-02-13 11:11:54.000000000 +0100
531 @@ -854,6 +854,10 @@ void SwTextShell::Execute(SfxRequest &rR
533 FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
534 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< UINT16 >(eMetric)));
536 + BOOL bApplyCharUnit = ::HasCharUnit(0 != PTR_CAST(SwWebView, &GetView()));
537 + SW_MOD()->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit));
539 SfxItemSet aCoreSet( GetPool(),
540 RES_PARATR_BEGIN, RES_PARATR_END - 1,
541 // --> OD 2008-02-25 #refactorlists#
542 diff -purN sw.old/source/ui/uiview/view.cxx sw/source/ui/uiview/view.cxx
543 --- sw.old/source/ui/uiview/view.cxx 2009-02-12 14:53:44.000000000 +0100
544 +++ sw/source/ui/uiview/view.cxx 2009-02-13 11:11:54.000000000 +0100
546 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
550 using namespace ::com::sun::star;
551 using namespace ::com::sun::star::uno;
552 using namespace ::com::sun::star::lang;
553 @@ -1009,9 +1010,21 @@ SwView::SwView( SfxViewFrame *_pFrame, S
554 pVRuler->SetZoom( aZoomFract );
555 pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick ));
556 FieldUnit eMetric = pUsrPref->GetHScrollMetric();
557 - pHRuler->SetUnit( eMetric );
559 + BOOL bApplyCharUnit = pUsrPref->IsApplyCharUnit();
560 + if ( bApplyCharUnit )
561 + pHRuler->SetUnit( FUNIT_CHAR );
563 + pHRuler->SetUnit( eMetric );
565 eMetric = pUsrPref->GetVScrollMetric();
566 - pVRuler->SetUnit( eMetric );
567 + if ( bApplyCharUnit )
568 + pVRuler->SetUnit(FUNIT_LINE);
570 + pVRuler->SetUnit( eMetric );
572 + pHRuler->SetCharWidth( 371 ); // default character width
573 + pVRuler->SetLineHeight( 551 ); // default line height
576 pDocSh->SetView( this );
577 diff -purN sw.old/source/ui/utlui/uitool.cxx sw/source/ui/utlui/uitool.cxx
578 --- sw.old/source/ui/utlui/uitool.cxx 2009-02-12 14:53:42.000000000 +0100
579 +++ sw/source/ui/utlui/uitool.cxx 2009-02-13 11:11:54.000000000 +0100
580 @@ -738,6 +738,19 @@ String GetAppLangDateTimeString( const D
584 +/*----------------------------------------------------------------------------
585 + * add a new function which can get and set the current "SID_ATTR_APPLYCHARUNIT" value
586 + *---------------------------------------------------------------------------*/
587 +BOOL HasCharUnit( BOOL bWeb)
589 + return SW_MOD()->GetUsrPref(bWeb)->IsApplyCharUnit();
592 +void SetApplyCharUnit(BOOL bApplyChar, BOOL bWeb)
594 + SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb);
597 /*-- 26.01.2006 08:06:33---------------------------------------------------
599 -----------------------------------------------------------------------*/