summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui/csvgrid.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-10-11 11:28:48 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-10-11 11:28:48 +0000
commiteb10721f238d4ff7e6be44013ae007654dae5586 (patch)
tree9e14e916101e8416fd7abe15b4ff148739178d92 /sc/source/ui/dbgui/csvgrid.cxx
parent0937c97c605aa972ca5ee2ecf286e0c672338154 (diff)
INTEGRATION: CWS csvio (1.19.134); FILE MERGED
2004/09/08 15:51:16 dr 1.19.134.1: #i834# draw newline characters
Diffstat (limited to 'sc/source/ui/dbgui/csvgrid.cxx')
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 8edbc2fe0c84..668cbca7390a 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: csvgrid.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: hr $ $Date: 2004-09-08 15:53:38 $
+ * last change: $Author: hr $ $Date: 2004-10-11 12:28:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1111,6 +1111,7 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText )
{
String aText( rText );
aText.SearchAndReplaceAll( '\t', ' ' );
+ aText.SearchAndReplaceAll( '\n', ' ' );
mpEditEngine->SetPaperSize( maEdEngSize );
mpEditEngine->SetText( aText );
mpEditEngine->Draw( &maBackgrDev, rPos );
@@ -1123,14 +1124,25 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText )
sal_Int32 nY = rPos.Y() + GetLineHeight() / 2;
Color aColor( maTextColor );
maBackgrDev.SetLineColor( aColor );
- maBackgrDev.DrawLine( Point( nX1, nY ), Point( nX2 - 1, nY ) );
- maBackgrDev.DrawLine( Point( nX2 - 2, nY - 1 ), Point( nX2 - 2, nY + 1 ) );
- aColor.Merge( maBackColor, 50 );
- maBackgrDev.SetLineColor( aColor );
+ maBackgrDev.DrawLine( Point( nX1, nY ), Point( nX2, nY ) );
maBackgrDev.DrawLine( Point( nX2 - 2, nY - 2 ), Point( nX2, nY ) );
maBackgrDev.DrawLine( Point( nX2 - 2, nY + 2 ), Point( nX2, nY ) );
++nCharIx;
}
+ nCharIx = 0;
+ while( (nCharIx = rText.Search( '\n', nCharIx )) != STRING_NOTFOUND )
+ {
+ sal_Int32 nX1 = rPos.X() + GetCharWidth() * nCharIx;
+ sal_Int32 nX2 = nX1 + GetCharWidth() - 2;
+ sal_Int32 nY = rPos.Y() + GetLineHeight() / 2;
+ Color aColor( maTextColor );
+ maBackgrDev.SetLineColor( aColor );
+ maBackgrDev.DrawLine( Point( nX1, nY ), Point( nX2, nY ) );
+ maBackgrDev.DrawLine( Point( nX1 + 2, nY - 2 ), Point( nX1, nY ) );
+ maBackgrDev.DrawLine( Point( nX1 + 2, nY + 2 ), Point( nX1, nY ) );
+ maBackgrDev.DrawLine( Point( nX2, nY - 2 ), Point( nX2, nY ) );
+ ++nCharIx;
+ }
}
void ScCsvGrid::ImplDrawFirstLineSep( bool bSet )