diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-12-02 13:40:39 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-12-02 13:40:39 +0100 |
commit | d4fb305ef0e2b8d0332153f34800cd2b9520869b (patch) | |
tree | 1ce5d6e26aeb094e91482f2ea40edf300345ae41 /forms/source/richtext/richtextimplcontrol.cxx | |
parent | d730f4672b31768f62d52ef7e673aec59d3a6a49 (diff) | |
parent | 749127e0507385584bdac9392174bebaba863546 (diff) |
merge with db33a
Diffstat (limited to 'forms/source/richtext/richtextimplcontrol.cxx')
-rw-r--r-- | forms/source/richtext/richtextimplcontrol.cxx | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx index f85bab638499..259197ac71d1 100644 --- a/forms/source/richtext/richtextimplcontrol.cxx +++ b/forms/source/richtext/richtextimplcontrol.cxx @@ -605,21 +605,32 @@ namespace frm _pDev->SetMapMode( aNormalizedMapMode ); // translate coordinates - Point aPos( OutputDevice::LogicToLogic( _rPos, aOriginalMapMode, aNormalizedMapMode ) ); - Size aSize( OutputDevice::LogicToLogic( _rSize, aOriginalMapMode, aNormalizedMapMode ) ); + Point aPos( _rPos ); + Size aSize( _rSize ); + if ( aOriginalMapMode.GetMapUnit() == MAP_PIXEL ) + { + aPos = _pDev->PixelToLogic( _rPos, aNormalizedMapMode ); + aSize = _pDev->PixelToLogic( _rSize, aNormalizedMapMode ); + } + else + { + aPos = OutputDevice::LogicToLogic( _rPos, aOriginalMapMode, aNormalizedMapMode ); + aSize = OutputDevice::LogicToLogic( _rSize, aOriginalMapMode, aNormalizedMapMode ); + } Rectangle aPlayground( aPos, aSize ); Size aOnePixel( _pDev->PixelToLogic( Size( 1, 1 ) ) ); + aPlayground.Right() -= aOnePixel.Width(); + aPlayground.Bottom() -= aOnePixel.Height(); // background _pDev->SetLineColor(); - _pDev->DrawRect( Rectangle( aPlayground.TopLeft(), m_pEngine->GetPaperSize()) ); + _pDev->DrawRect( aPlayground ); - // possibly with border + // do we need to draw a border? bool bBorder = ( m_pAntiImpl->GetStyle() & WB_BORDER ); if ( bBorder ) - // let's draw a border - _pDev->SetLineColor( COL_BLACK ); + _pDev->SetLineColor( m_pAntiImpl->GetSettings().GetStyleSettings().GetMonoColor() ); else _pDev->SetLineColor(); _pDev->SetFillColor( m_pAntiImpl->GetBackground().GetColor() ); @@ -632,7 +643,9 @@ namespace frm // leave a space of one pixel between the "surroundings" of the control // and the content lcl_inflate( aPlayground, -aOnePixel.Width(), -aOnePixel.Height() ); + lcl_inflate( aPlayground, -aOnePixel.Width(), -aOnePixel.Height() ); + // actually draw the content m_pEngine->Draw( _pDev, aPlayground, Point(), TRUE ); _pDev->Pop(); |