summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2006-03-22 09:38:14 +0000
committerOliver Bolte <obo@openoffice.org>2006-03-22 09:38:14 +0000
commit16053ce033a345622533ea36506115c79f4e2949 (patch)
tree8ed4292c4c3f9a17f9b317d11e378b7b88518945
parenta87e1d69291df661d1f74697a03c6b74092bcbed (diff)
INTEGRATION: CWS nwfrtl (1.75.106); FILE MERGED
2006/02/20 17:51:15 pl 1.75.106.4: #i54929# ensure correct cursor position in ImplSetText 2006/02/20 14:00:38 pl 1.75.106.3: #i54929# mirroring issue for subedits 2006/02/17 11:35:39 pl 1.75.106.2: #i59503# paint rectangle was still not mirrored correctly 2006/02/16 15:01:03 pl 1.75.106.1: #i59503# handle remirroring in case border is RTL and edit is not
-rw-r--r--vcl/source/control/edit.cxx33
1 files changed, 27 insertions, 6 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index d310db92b227..a8b33acfe4a6 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: edit.cxx,v $
*
- * $Revision: 1.78 $
+ * $Revision: 1.79 $
*
- * last change: $Author: vg $ $Date: 2006-03-16 16:49:41 $
+ * last change: $Author: obo $ $Date: 2006-03-22 10:38:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -1012,13 +1012,16 @@ void Edit::ImplSetText( const XubString& rText, const Selection* pNewSelection )
mnXOffset = 0;
maText = ImplGetValidString( rText );
+ // #i54929# recalculate mnXOffset before ImplSetSelection,
+ // else cursor ends up in wrong position
+ ImplAlign();
+
if ( pNewSelection )
ImplSetSelection( *pNewSelection, FALSE );
if ( mnXOffset && !pNewSelection )
maSelection.Max() = 0;
- ImplAlign();
Invalidate();
}
else
@@ -1108,9 +1111,27 @@ void Edit::ImplClearBackground( long nXStart, long nXEnd )
if( !aClipRgn.IsNull() )
{
// transform clipping region to border window's coordinate system
- Point aBorderOffs;
- aBorderOffs = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aBorderOffs ) );
- aClipRgn.Move( aBorderOffs.X(), aBorderOffs.Y() );
+ if( IsRTLEnabled() != pBorder->IsRTLEnabled() && Application::GetSettings().GetLayoutRTL() )
+ {
+ // need to mirror in case border is not RTL but edit is (or vice versa)
+
+ // mirror
+ Rectangle aBounds( aClipRgn.GetBoundRect() );
+ int xNew = GetOutputSizePixel().Width() - aBounds.GetWidth() - aBounds.Left();
+ aClipRgn.Move( xNew - aBounds.Left(), 0 );
+
+ // move offset of border window
+ Point aBorderOffs;
+ aBorderOffs = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aBorderOffs ) );
+ aClipRgn.Move( aBorderOffs.X(), aBorderOffs.Y() );
+ }
+ else
+ {
+ // normal case
+ Point aBorderOffs;
+ aBorderOffs = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aBorderOffs ) );
+ aClipRgn.Move( aBorderOffs.X(), aBorderOffs.Y() );
+ }
Region oldRgn( pBorder->GetClipRegion() );
pBorder->SetClipRegion( aClipRgn );