diff options
author | gt <gt@openoffice.org> | 2001-10-10 07:55:40 +0000 |
---|---|---|
committer | gt <gt@openoffice.org> | 2001-10-10 07:55:40 +0000 |
commit | 8254982b132c071b8ae6162c805a7d44c960e231 (patch) | |
tree | b5d6ec9b34c1ca147bc5ebb6dec87169201c73b7 /svx | |
parent | ca504ac0662befc56bb11aad5dba2b2d03bcdd7c (diff) |
#88961# set/view FontWidthScale in FontPreview
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/chardlg.cxx | 87 | ||||
-rw-r--r-- | svx/source/dialog/fntctrl.cxx | 193 |
2 files changed, 211 insertions, 69 deletions
diff --git a/svx/source/dialog/chardlg.cxx b/svx/source/dialog/chardlg.cxx index 03bfd643ddd5..0fe7893fe6b6 100644 --- a/svx/source/dialog/chardlg.cxx +++ b/svx/source/dialog/chardlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: chardlg.cxx,v $ * - * $Revision: 1.61 $ + * $Revision: 1.62 $ * - * last change: $Author: os $ $Date: 2001-09-06 10:47:48 $ + * last change: $Author: gt $ $Date: 2001-10-10 08:55:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -266,6 +266,35 @@ inline BOOL StateToAttr( TriState aState ) return ( STATE_CHECK == aState ); } +// class SvxCharBasePage ------------------------------------------------- + +SvxCharBasePage::SvxCharBasePage( Window* pParent, const ResId& rResId, const SfxItemSet& rItemset, + USHORT nResIdPrewievWin, USHORT nResIdFontTypeFT ): + SfxTabPage( pParent, rResId, rItemset ), + m_aPreviewWin( this, ResId( nResIdPrewievWin ) ), + m_aFontTypeFT( this, ResId( nResIdFontTypeFT ) ) +{ +} + +// ----------------------------------------------------------------------- + +SvxCharBasePage::~SvxCharBasePage() +{ +} + +// ----------------------------------------------------------------------- + +void SvxCharBasePage::SetFontWidthScale( const SfxItemSet& rSet ) +{ + USHORT nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH ); + if( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT ) + { + const SvxCharScaleWidthItem& rItem = ( SvxCharScaleWidthItem& ) rSet.Get( nWhich ); + + m_aPreviewWin.SetFontWidthScale( rItem.GetValue() ); + } +} + // SvxCharNamePage_Impl -------------------------------------------------- struct SvxCharNamePage_Impl @@ -302,9 +331,7 @@ struct SvxCharNamePage_Impl SvxCharNamePage::SvxCharNamePage( Window* pParent, const SfxItemSet& rInSet ) : - SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_CHAR_NAME ), rInSet ), - m_aPreviewWin ( this, ResId( WIN_CHAR_PREVIEW ) ), - m_aFontTypeFT ( this, ResId( FT_CHAR_FONTTYPE ) ), + SvxCharBasePage( pParent, SVX_RES( RID_SVXPAGE_CHAR_NAME ), rInSet, WIN_CHAR_PREVIEW, FT_CHAR_FONTTYPE ), m_pImpl ( new SvxCharNamePage_Impl ) { m_pImpl->m_aNoStyleText = String( ResId( STR_CHARNAME_NOSTYLE ) ); @@ -456,7 +483,7 @@ void SvxCharNamePage::Initialize() m_pEastFontSizeLB->SetModifyHdl( aLink ); m_pImpl->m_aUpdateTimer.SetTimeoutHdl( LINK( this, SvxCharNamePage, UpdateHdl_Impl ) ); - m_pImpl->m_aUpdateTimer.Start(); +// m_pImpl->m_aUpdateTimer.Start(); } // ----------------------------------------------------------------------- @@ -594,6 +621,8 @@ void SvxCharNamePage::UpdatePreview_Impl() rCJKFont.SetItalic( aCJKFontInfo.GetItalic() ); rCJKFont.SetSize( aCJKFontInfo.GetSize() ); + SetFontWidthScale( GetItemSet() ); + m_aPreviewWin.Invalidate(); m_aFontTypeFT.SetText( pFontList->GetFontMapText( aFontInfo ) ); } @@ -1296,7 +1325,11 @@ void SvxCharNamePage::ActivatePage( const SfxItemSet& rSet ) m_aPreviewWin.SetBackColor(COL_TRANSPARENT); } + SetFontWidthScale( rSet ); + m_aPreviewWin.Invalidate(); + + UpdatePreview_Impl(); // instead of asynchronous calling in ctor } // ----------------------------------------------------------------------- @@ -1330,6 +1363,8 @@ void SvxCharNamePage::Reset( const SfxItemSet& rSet ) ResetWestOrEast_Impl( rSet, FALSE ); ResetColor_Impl( rSet ); m_pColorLB->SaveValue(); + + SetFontWidthScale( rSet ); } // ----------------------------------------------------------------------- @@ -1415,7 +1450,7 @@ void SvxCharNamePage::SetPreviewBackgroundToCharacter() SvxCharEffectsPage::SvxCharEffectsPage( Window* pParent, const SfxItemSet& rInSet ) : - SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_CHAR_EFFECTS ), rInSet ), + SvxCharBasePage( pParent, SVX_RES( RID_SVXPAGE_CHAR_EFFECTS ), rInSet, WIN_EFFECTS_PREVIEW, FT_EFFECTS_FONTTYPE ), m_aUnderlineFT ( this, ResId( FT_UNDERLINE ) ), m_aUnderlineLB ( this, ResId( LB_UNDERLINE ) ), @@ -1442,8 +1477,6 @@ SvxCharEffectsPage::SvxCharEffectsPage( Window* pParent, const SfxItemSet& rInSe m_aShadowBtn ( this, ResId( CB_SHADOW ) ), m_aBlinkingBtn ( this, ResId( CB_BLINKING ) ), - m_aPreviewWin ( this, ResId( WIN_EFFECTS_PREVIEW ) ), - m_aFontTypeFT ( this, ResId( FT_EFFECTS_FONTTYPE ) ), m_bPreviewBackgroundToCharacter(FALSE) { @@ -1782,6 +1815,8 @@ void SvxCharEffectsPage::ActivatePage( const SfxItemSet& rSet ) m_aPreviewWin.SetBackColor(COL_TRANSPARENT); } + SetFontWidthScale( rSet ); + m_aPreviewWin.Invalidate(); } @@ -2059,6 +2094,8 @@ void SvxCharEffectsPage::Reset( const SfxItemSet& rSet ) m_aBlinkingBtn.Check( rItem.GetValue() ); } + SetFontWidthScale( rSet ); + // preview update m_aPreviewWin.Invalidate(); @@ -2335,7 +2372,7 @@ void SvxCharEffectsPage::SetPreviewBackgroundToCharacter() SvxCharPositionPage::SvxCharPositionPage( Window* pParent, const SfxItemSet& rInSet ) : - SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_CHAR_POSITION ), rInSet ), + SvxCharBasePage( pParent, SVX_RES( RID_SVXPAGE_CHAR_POSITION ), rInSet, WIN_POS_PREVIEW, FT_POS_FONTTYPE ), m_aPositionLine ( this, ResId( FL_POSITION ) ), m_aHighPosBtn ( this, ResId( RB_HIGHPOS ) ), @@ -2361,9 +2398,6 @@ SvxCharPositionPage::SvxCharPositionPage( Window* pParent, const SfxItemSet& rIn m_aKerningEdit ( this, ResId( ED_KERNING2 ) ), m_aPairKerningBtn ( this, ResId( CB_PAIRKERNING ) ), - m_aPreviewWin ( this, ResId( WIN_POS_PREVIEW ) ), - m_aFontTypeFT ( this, ResId( FT_POS_FONTTYPE ) ), - m_nSuperEsc ( (short)DFLT_ESC_SUPER ), m_nSubEsc ( (short)DFLT_ESC_SUB ), m_nScaleWidthItemSetVal ( 100 ), @@ -2414,6 +2448,7 @@ void SvxCharPositionPage::Initialize() m_aKerningLB.SetSelectHdl( LINK( this, SvxCharPositionPage, KerningSelectHdl_Impl ) ); m_aKerningEdit.SetModifyHdl( LINK( this, SvxCharPositionPage, KerningModifyHdl_Impl ) ); m_aPairKerningBtn.SetClickHdl( LINK( this, SvxCharPositionPage, PairKerningHdl_Impl ) ); + m_aScaleWidthMF.SetModifyHdl( LINK( this, SvxCharPositionPage, ScaleWidthModifyHdl_Impl ) ); } // ----------------------------------------------------------------------- @@ -2544,6 +2579,8 @@ IMPL_LINK( SvxCharPositionPage, FitToLineHdl_Impl, CheckBox*, pBox ) if (m_aFitToLineCB.IsChecked()) nVal = m_nScaleWidthItemSetVal; m_aScaleWidthMF.SetValue( nVal ); + + m_aPreviewWin.SetFontWidthScale( nVal ); } return 0; } @@ -2637,6 +2674,15 @@ IMPL_LINK( SvxCharPositionPage, LoseFocusHdl_Impl, MetricField*, pField ) // ----------------------------------------------------------------------- +IMPL_LINK( SvxCharPositionPage, ScaleWidthModifyHdl_Impl, MetricField*, pField ) +{ + m_aPreviewWin.SetFontWidthScale( USHORT( m_aScaleWidthMF.GetValue() ) ); + + return 0; +} + +// ----------------------------------------------------------------------- + void SvxCharPositionPage::ActivatePage( const SfxItemSet& rSet ) { BOOL bInReset = FALSE; //!!!! @@ -2850,7 +2896,7 @@ void SvxCharPositionPage::ActivatePage( const SfxItemSet& rSet ) m_aPreviewWin.SetBackColor(COL_TRANSPARENT); } - m_aPreviewWin.Invalidate(); + m_aPreviewWin.SetFontWidthScale( USHORT( m_aScaleWidthMF.GetValue() ) ); } // ----------------------------------------------------------------------- @@ -3036,8 +3082,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH ); if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT ) { - const SvxCharScaleWidthItem& rItem = - (SvxCharScaleWidthItem&) rSet.Get( nWhich ); + const SvxCharScaleWidthItem& rItem = ( SvxCharScaleWidthItem& ) rSet.Get( nWhich ); m_nScaleWidthInitialVal = rItem.GetValue(); m_aScaleWidthMF.SetValue( m_nScaleWidthInitialVal ); } @@ -3046,9 +3091,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) nWhich = GetWhich( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ); if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT ) - { m_nScaleWidthItemSetVal = ((SfxUInt16Item&) rSet.Get( nWhich )).GetValue(); - } // Rotation nWhich = GetWhich( SID_ATTR_CHAR_ROTATED ); @@ -3287,7 +3330,7 @@ void SvxCharPositionPage::SetPreviewBackgroundToCharacter() SvxCharTwoLinesPage::SvxCharTwoLinesPage( Window* pParent, const SfxItemSet& rInSet ) : - SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_CHAR_TWOLINES ), rInSet ), + SvxCharBasePage( pParent, SVX_RES( RID_SVXPAGE_CHAR_TWOLINES ), rInSet, WIN_TWOLINES_PREVIEW, FT_TWOLINES_FONTTYPE ), m_aSwitchOnLine ( this, ResId( FL_SWITCHON ) ), m_aTwoLinesBtn ( this, ResId( CB_TWOLINES ) ), @@ -3298,8 +3341,6 @@ SvxCharTwoLinesPage::SvxCharTwoLinesPage( Window* pParent, const SfxItemSet& rIn m_aEndBracketFT ( this, ResId( FT_ENDBRACKET ) ), m_aEndBracketLB ( this, ResId( ED_ENDBRACKET ) ), - m_aPreviewWin ( this, ResId( WIN_TWOLINES_PREVIEW ) ), - m_aFontTypeFT ( this, ResId( FT_TWOLINES_FONTTYPE ) ), m_bPreviewBackgroundToCharacter(FALSE) { @@ -3618,6 +3659,8 @@ void SvxCharTwoLinesPage::ActivatePage( const SfxItemSet& rSet ) m_aPreviewWin.SetBackColor(COL_TRANSPARENT); } + SetFontWidthScale( rSet ); + m_aPreviewWin.Invalidate(); } @@ -3664,6 +3707,8 @@ void SvxCharTwoLinesPage::Reset( const SfxItemSet& rSet ) } } TwoLinesHdl_Impl( NULL ); + + SetFontWidthScale( rSet ); } // ----------------------------------------------------------------------- diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 1c287caa2c72..2bdcec2eda27 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fntctrl.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: ama $ $Date: 2001-07-19 07:42:36 $ + * last change: $Author: gt $ $Date: 2001-10-10 08:55:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -115,34 +115,75 @@ using namespace ::com::sun::star::i18n; class FontPrevWin_Impl { friend class SvxFontPrevWindow; - Reference < XBreakIterator > xBreak; - SvULongs aTextWidth; - SvXub_StrLens aScriptChg; - SvUShorts aScriptType; - SvxFont aCJKFont; - String aText; - String aScriptText; - Color* pColor; - Color* pBackColor; - long nAscent; - sal_Unicode cStartBracket; - sal_Unicode cEndBracket; - BOOL bSelection : 1, - bGetSelection : 1, - bUseResText : 1, - bTwoLines : 1; - void _CheckScript(); + + SvxFont aFont; + Printer* pPrinter; + BOOL bDelPrinter; + + Reference < XBreakIterator > xBreak; + SvULongs aTextWidth; + SvXub_StrLens aScriptChg; + SvUShorts aScriptType; + SvxFont aCJKFont; + String aText; + String aScriptText; + Color* pColor; + Color* pBackColor; + long nAscent; + sal_Unicode cStartBracket; + sal_Unicode cEndBracket; + + long n100PercentFontWidth; // initial -1 -> not set yet + long n100PercentFontWidthCJK; + UINT16 nFontWidthScale; + + BOOL bSelection : 1, + bGetSelection : 1, + bUseResText : 1, + bTwoLines : 1; + + void _CheckScript(); public: FontPrevWin_Impl() : - cStartBracket(0), cEndBracket(0), pColor( NULL ), pBackColor( 0 ), + pPrinter( NULL ), bDelPrinter( FALSE ), + cStartBracket( 0 ), cEndBracket( 0 ), pColor( NULL ), pBackColor( 0 ), nFontWidthScale( 100 ), bSelection( FALSE ), bGetSelection( FALSE ), bUseResText( FALSE ), - bTwoLines( FALSE ) {} - void CheckScript() { if( aText != aScriptText ) _CheckScript(); } - Size CalcTextSize( OutputDevice* pWin, OutputDevice* pPrt, SvxFont &rFont ); - void DrawPrev( OutputDevice* pWin, Printer* pPrt, Point &rPt, - SvxFont &rFont ); + bTwoLines( FALSE ) + { + Invalidate100PercentFontWidth(); + } + + void CheckScript(); + Size CalcTextSize( OutputDevice* pWin, OutputDevice* pPrt, SvxFont &rFont ); + void DrawPrev( OutputDevice* pWin, Printer* pPrt, Point &rPt, SvxFont &rFont ); + + BOOL SetFontWidthScale( UINT16 nScaleInPercent ); + inline void Invalidate100PercentFontWidth(); + inline BOOL Is100PercentFontWidthValid() const; + void ScaleFontWidth( const OutputDevice& rOutDev ); + // scales rNonCJKFont and aCJKFont depending on nFontWidthScale and + // sets the 100%-Font-Widths }; +void FontPrevWin_Impl::CheckScript() +{ + if( aText != aScriptText ) + _CheckScript(); +} + +inline void FontPrevWin_Impl::Invalidate100PercentFontWidth() +{ + n100PercentFontWidth = n100PercentFontWidthCJK = -1; +} + +inline BOOL FontPrevWin_Impl::Is100PercentFontWidthValid() const +{ + DBG_ASSERT( ( n100PercentFontWidth == -1 && n100PercentFontWidthCJK == -1 ) || + ( n100PercentFontWidth != -1 && n100PercentFontWidthCJK != -1 ), + "*FontPrevWin_Impl::Is100PercentFontWidthValid(): 100PercentFontWidth's not synchronous" ); + return n100PercentFontWidth != -1; +} + // class FontPrevWin_Impl ----------------------------------------------- /*-----------------19.7.2001 08:44------------------ @@ -332,6 +373,36 @@ void FontPrevWin_Impl::DrawPrev( OutputDevice* pWin, Printer* pPrinter, pPrinter->SetFont( aOldFont ); } +// ----------------------------------------------------------------------- + +BOOL FontPrevWin_Impl::SetFontWidthScale( UINT16 nScale ) +{ + if( nFontWidthScale != nScale ) + { + nFontWidthScale = nScale; + return TRUE; + } + + return FALSE; +} + +// ----------------------------------------------------------------------- + +void FontPrevWin_Impl::ScaleFontWidth( const OutputDevice& rOutDev ) +{ + if( !Is100PercentFontWidthValid() ) + { + aFont.SetWidth( 0 ); + aCJKFont.SetWidth( 0 ); + + n100PercentFontWidth = rOutDev.GetFontMetric( aFont ).GetWidth(); + n100PercentFontWidthCJK = rOutDev.GetFontMetric( aCJKFont ).GetWidth(); + } + + aFont.SetWidth( n100PercentFontWidth * nFontWidthScale / 100 ); + aCJKFont.SetWidth( n100PercentFontWidthCJK * nFontWidthScale / 100 ); +} + // class SvxFontPrevWindow ----------------------------------------------- void SvxFontPrevWindow::InitSettings( BOOL bForeground, BOOL bBackground ) @@ -361,25 +432,23 @@ void SvxFontPrevWindow::InitSettings( BOOL bForeground, BOOL bBackground ) SvxFontPrevWindow::SvxFontPrevWindow( Window* pParent, const ResId& rId ) : - Window ( pParent, rId ), - pPrinter ( NULL ), - bDelPrinter( FALSE ) + Window ( pParent, rId ) { pImpl = new FontPrevWin_Impl; SfxViewShell* pSh = SfxViewShell::Current(); if ( pSh ) - pPrinter = pSh->GetPrinter(); + pImpl->pPrinter = pSh->GetPrinter(); - if ( !pPrinter ) + if ( !pImpl->pPrinter ) { - pPrinter = new Printer; - bDelPrinter = TRUE; + pImpl->pPrinter = new Printer; + pImpl->bDelPrinter = TRUE; } SetMapMode( MapMode( MAP_TWIP ) ); - aFont.SetTransparent(TRUE); + pImpl->aFont.SetTransparent(TRUE); pImpl->aCJKFont.SetTransparent(TRUE); - aFont.SetAlign(ALIGN_BASELINE); + pImpl->aFont.SetAlign(ALIGN_BASELINE); pImpl->aCJKFont.SetAlign(ALIGN_BASELINE); InitSettings( TRUE, TRUE ); SetBorderStyle( WINDOW_BORDER_MONO ); @@ -391,10 +460,10 @@ SvxFontPrevWindow::~SvxFontPrevWindow() { delete pImpl->pColor; delete pImpl->pBackColor; - delete pImpl; + if ( pImpl->bDelPrinter ) + delete pImpl->pPrinter; - if ( bDelPrinter ) - delete pPrinter; + delete pImpl; } // ----------------------------------------------------------------------- @@ -426,13 +495,27 @@ void SvxFontPrevWindow::DataChanged( const DataChangedEvent& rDCEvt ) Window::DataChanged( rDCEvt ); } +SvxFont& SvxFontPrevWindow::GetFont() +{ + pImpl->Invalidate100PercentFontWidth(); // because the user might change the size + return pImpl->aFont; +} + +const SvxFont& SvxFontPrevWindow::GetFont() const +{ + return pImpl->aFont; +} + // ----------------------------------------------------------------------- void SvxFontPrevWindow::SetFont(const SvxFont &rOutFont) { - aFont = rOutFont; - aFont.SetTransparent(TRUE); - aFont.SetAlign(ALIGN_BASELINE); + SvxFont& rFont = pImpl->aFont; + rFont = rOutFont; + rFont.SetTransparent(TRUE); + rFont.SetAlign(ALIGN_BASELINE); + pImpl->Invalidate100PercentFontWidth(); + Invalidate(); } @@ -465,6 +548,9 @@ void SvxFontPrevWindow::UseResourceText( BOOL bUse ) void SvxFontPrevWindow::Paint( const Rectangle& rRect ) { + Printer* pPrinter = pImpl->pPrinter; + SvxFont& rFont = pImpl->aFont; + if ( pImpl->bUseResText ) pImpl->aText = GetText(); else if ( !pImpl->bSelection ) @@ -479,7 +565,7 @@ void SvxFontPrevWindow::Paint( const Rectangle& rRect ) } if ( !pImpl->bSelection ) - pImpl->aText = aFont.GetName(); + pImpl->aText = rFont.GetName(); if ( !pImpl->aText.Len() ) pImpl->aText = GetText(); @@ -488,8 +574,11 @@ void SvxFontPrevWindow::Paint( const Rectangle& rRect ) pImpl->aText.Erase( pImpl->aText.Search( sal_Unicode( ' ' ), 16 ) ); } + // calculate text width scaling + pImpl->ScaleFontWidth( *this/*, rFont*/ ); + pImpl->CheckScript(); - Size aTxtSize = pImpl->CalcTextSize( this, pPrinter, aFont ); + Size aTxtSize = pImpl->CalcTextSize( this, pPrinter, rFont ); const Size aLogSize( GetOutputSize() ); @@ -527,7 +616,7 @@ void SvxFontPrevWindow::Paint( const Rectangle& rRect ) if(pImpl->bTwoLines) { - SvxFont aSmallFont(aFont); + SvxFont aSmallFont( rFont ); Size aSize( aSmallFont.GetSize() ); aSize.Height() = ( aSize.Height() * 3 ) / 5; aSize.Width() = ( aSize.Width() * 3 ) / 5; @@ -546,12 +635,12 @@ void SvxFontPrevWindow::Paint( const Rectangle& rRect ) if(pImpl->cStartBracket) { String sBracket(pImpl->cStartBracket); - nStartBracketWidth = aFont.GetTxtSize( pPrinter, sBracket ).Width(); + nStartBracketWidth = rFont.GetTxtSize( pPrinter, sBracket ).Width(); } if(pImpl->cEndBracket) { String sBracket(pImpl->cEndBracket); - nEndBracketWidth = aFont.GetTxtSize( pPrinter, sBracket ).Width(); + nEndBracketWidth = rFont.GetTxtSize( pPrinter, sBracket ).Width(); } nTextWidth = pImpl->CalcTextSize( this, pPrinter, aSmallFont ).Width(); long nResultWidth = nStartBracketWidth; @@ -568,7 +657,7 @@ void SvxFontPrevWindow::Paint( const Rectangle& rRect ) if(pImpl->cStartBracket) { String sBracket(pImpl->cStartBracket); - aFont.DrawPrev( this, pPrinter, Point( nX, nY - nOffset - 4), sBracket ); + rFont.DrawPrev( this, pPrinter, Point( nX, nY - nOffset - 4), sBracket ); nX += nStartBracketWidth; } @@ -579,7 +668,7 @@ void SvxFontPrevWindow::Paint( const Rectangle& rRect ) if(pImpl->cEndBracket) { String sBracket(pImpl->cEndBracket); - aFont.DrawPrev( this, pPrinter, Point( nX + 1, nY - nOffset - 4), sBracket ); + rFont.DrawPrev( this, pPrinter, Point( nX + 1, nY - nOffset - 4), sBracket ); } pImpl->aCJKFont.SetSize( aSize ); } @@ -587,7 +676,7 @@ void SvxFontPrevWindow::Paint( const Rectangle& rRect ) { DrawLine( Point( 0, nY ), Point( nX, nY ) ); DrawLine( Point( nX + aTxtSize.Width(), nY ), Point( aLogSize.Width(), nY ) ); - pImpl->DrawPrev( this, pPrinter, Point( nX, nY ), aFont ); + pImpl->DrawPrev( this, pPrinter, Point( nX, nY ), rFont ); } } /* -----------------------------04.12.00 16:26-------------------------------- @@ -613,3 +702,11 @@ void SvxFontPrevWindow::SetBrackets(sal_Unicode cStart, sal_Unicode cEnd) pImpl->cEndBracket = cEnd; } +// ----------------------------------------------------------------------- + +void SvxFontPrevWindow::SetFontWidthScale( UINT16 n ) +{ + if( pImpl->SetFontWidthScale( n ) ) + Invalidate(); +} + |