[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice
Subject: patch for kspread
From: montel laurent <montell () club-internet ! fr>
Date: 2000-09-02 16:58:05
[Download RAW message or body]
Hi,
I added to my previous patch :
-an other cell merged bug fix :
When you put a table style you mustn't change a cell which is obscuring.
Could you test it please.
Thanks
bye
["patch43.diff" (text/plain)]
? patch29.diff
? patch40.diff
? patch26.diff
? kword.kwd
? fonts.dir
? toto.csv
? toto2.ksp
? KSpreadLocation.diff
? ???
? KSpreadCellIface_stub.h
? KSpreadCellIface_stub.cpp
? toto.ksp
? filters/Makefile.in
? filters/Makefile
? filters/csv/Makefile
? filters/csv/Makefile.in
? filters/csv/csvfilter
? filters/komma/Makefile.in
? filters/komma/Makefile
? pics/@kde_minidir@
cvs server: Diffing .
Index: kspread_canvas.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_canvas.cc,v
retrieving revision 1.148
diff -u -p -r1.148 kspread_canvas.cc
--- kspread_canvas.cc 2000/09/01 04:36:58 1.148
+++ kspread_canvas.cc 2000/09/02 16:57:10
@@ -1019,7 +1019,6 @@ void KSpreadCanvas::mousePressEvent( QMo
selection.setCoords( col, row,
col + cell->extraXCells(),
row + cell->extraYCells() );
-
table->setSelection( selection, this );
m_iMouseStartColumn = col;
m_iMouseStartRow = row;
@@ -1988,7 +1987,12 @@ void KSpreadCanvas::updatePosWidget()
QRect selection = m_pView->activeTable()->selectionRect();
QString buffer;
QString tmp;
- if ( selection.left() == 0 || (selection.width()==1 && selection.height()==1))
+ KSpreadCell *cell=activeTable()->cellAt(markerColumn(),markerRow());
+ QRect extraCell;
+ extraCell.setCoords(markerColumn(),markerRow(),
+ markerColumn()+cell->extraXCells(),markerRow()+cell->extraYCells());
+ if ( selection.left() == 0 || (selection.width()==1 && selection.height()==1)
+ ||extraCell==selection)
{
if(activeTable()->getLcMode())
{
@@ -2586,10 +2590,15 @@ void KSpreadVBorder::paintEvent( QPaintE
QFont boldFont = normalFont;
boldFont.setBold( TRUE );
+ KSpreadCell *cell=table->cellAt(m_pCanvas->markerColumn(),m_pCanvas->markerRow());
+ QRect extraCell;
+ extraCell.setCoords(m_pCanvas->markerColumn(),m_pCanvas->markerRow(),
+ m_pCanvas->markerColumn()+cell->extraXCells(),m_pCanvas->markerRow()+cell->extraYCells());
for ( int y = top_row; y <= bottom_row; y++ )
{
bool highlighted = ( selection.left() != 0 && y >= selection.top() &&
- y <= selection.bottom() && (selection.width()!=1 ||selection.height()!=1));
+ y <= selection.bottom() && (selection.width()!=1 ||selection.height()!=1)
+ &&extraCell!=selection);
bool selected = ( highlighted && selection.right() == 0x7FFF );
RowLayout *row_lay = table->rowLayout( y );
@@ -3043,11 +3052,16 @@ void KSpreadHBorder::paintEvent( QPaintE
QFont normalFont = painter.font();
QFont boldFont = normalFont;
boldFont.setBold( TRUE );
+ KSpreadCell *cell=table->cellAt(m_pCanvas->markerColumn(),m_pCanvas->markerRow());
+ QRect extraCell;
+ extraCell.setCoords(m_pCanvas->markerColumn(),m_pCanvas->markerRow(),
+ m_pCanvas->markerColumn()+cell->extraXCells(),m_pCanvas->markerRow()+cell->extraYCells());
for ( int x = left_col; x <= right_col; x++ )
{
bool highlighted = ( selection.left() != 0 && x >= selection.left() &&
- x <= selection.right() && (selection.width()!=1 || selection.height()!=1));
+ x <= selection.right() && (selection.width()!=1 || selection.height()!=1)
+ &&extraCell!=selection );
bool selected = ( highlighted && selection.bottom() == 0x7FFF );
ColumnLayout *col_lay = table->columnLayout( x );
Index: kspread_cell.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_cell.cc,v
retrieving revision 1.201
diff -u -p -r1.201 kspread_cell.cc
--- kspread_cell.cc 2000/08/29 07:17:29 1.201
+++ kspread_cell.cc 2000/09/02 16:57:24
@@ -2308,15 +2308,25 @@ void KSpreadCell::paintCell( const QRect
if ( m_pObscuringCell )
selected = m_pTable->selectionRect().contains( QPoint( m_pObscuringCell->column(),
m_pObscuringCell->row() ) );
+
// Dont draw any selection when printing.
if ( _painter.device()->isExtDev() )
selected = FALSE;
QColorGroup defaultColorGroup = QApplication::palette().active();
-
QRect m = m_pTable->marker();
+
+ int moveX=0;
+ int moveY=0;
+ if( isObscured() && isObscuringForced() )
+ {
+ moveX=obscuringCellsColumn();
+ moveY=obscuringCellsRow();
+ }
+
// Determine the correct background color
- if ( selected && ( _col != m.left() || _row != m.top() ) )
+ if ( selected && ( _col != m.left() || _row != m.top() )
+ && (moveX!=m.left() || moveY!=m.top()))
_painter.setBackgroundColor( defaultColorGroup.highlight() );
else
{
Index: kspread_dlg_format.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_dlg_format.cc,v
retrieving revision 1.9
diff -u -p -r1.9 kspread_dlg_format.cc
--- kspread_dlg_format.cc 2000/08/15 09:19:21 1.9
+++ kspread_dlg_format.cc 2000/09/02 16:57:25
@@ -148,7 +148,9 @@ void KSpreadFormatDlg::slotOk()
{
int pos = 1 + ( ( x - r.left() - 1 ) % 2 );
KSpreadCell* cell = m_view->activeTable()->nonDefaultCell( x, r.top() );
- cell->copy( *m_cells[ pos ] );
+ if(!cell->isObscuringForced())
+ {
+ cell->copy( *m_cells[ pos ] );
KSpreadLayout* c;
if ( x == r.right() )
@@ -158,14 +160,15 @@ void KSpreadFormatDlg::slotOk()
if ( c )
cell->setTopBorderPen( c->topBorderPen( 0, 0 ) );
-
+
if ( x == r.left() + 1 )
c = m_cells[1];
else
c = m_cells[2];
-
+
if ( c )
cell->setLeftBorderPen( c->leftBorderPen( 0, 0 ) );
+ }
}
cell = m_view->activeTable()->nonDefaultCell( r.right(), r.top() );
@@ -177,14 +180,16 @@ void KSpreadFormatDlg::slotOk()
{
int pos = 4 + ( ( y - r.top() - 1 ) % 2 ) * 4;
KSpreadCell* cell = m_view->activeTable()->nonDefaultCell( r.left(), y );
- cell->copy( *m_cells[ pos ] );
+ if(!cell->isObscuringForced())
+ {
+ cell->copy( *m_cells[ pos ] );
KSpreadLayout* c;
if ( y == r.bottom() )
c = m_cells[8];
else
c = m_cells[4];
-
+
if ( c )
cell->setLeftBorderPen( c->leftBorderPen( 0, 0 ) );
@@ -192,9 +197,10 @@ void KSpreadFormatDlg::slotOk()
c = m_cells[4];
else
c = m_cells[8];
-
+
if ( c )
cell->setTopBorderPen( c->topBorderPen( 0, 0 ) );
+ }
}
// Body
@@ -203,7 +209,9 @@ void KSpreadFormatDlg::slotOk()
{
int pos = 5 + ( ( y - r.top() - 1 ) % 2 ) * 4 + ( ( x - r.left() - 1 ) % 2 );
KSpreadCell* cell = m_view->activeTable()->nonDefaultCell( x, y );
- cell->copy( *m_cells[ pos ] );
+ if(!cell->isObscuringForced())
+ {
+ cell->copy( *m_cells[ pos ] );
KSpreadLayout* c;
if ( x == r.left() + 1 )
@@ -221,12 +229,15 @@ void KSpreadFormatDlg::slotOk()
if ( c )
cell->setTopBorderPen( c->topBorderPen( 0, 0 ) );
+ }
}
// Outer right border
for( y = r.top(); y <= r.bottom(); ++y )
{
KSpreadCell* cell = m_view->activeTable()->nonDefaultCell( r.right(), y );
+ if(!cell->isObscuringForced())
+ {
if ( y == r.top() )
{
if ( m_cells[3] )
@@ -242,14 +253,17 @@ void KSpreadFormatDlg::slotOk()
if ( m_cells[7] )
cell->setRightBorderPen( m_cells[7]->leftBorderPen( 0, 0 ) );
}
+ }
}
// Outer bottom border
for( x = r.left(); x <= r.right(); ++x )
{
KSpreadCell* cell = m_view->activeTable()->nonDefaultCell( x, r.bottom() );
- if ( x == r.left() )
+ if(!cell->isObscuringForced())
{
+ if ( x == r.left() )
+ {
if ( m_cells[12] )
cell->setBottomBorderPen( m_cells[12]->topBorderPen( 0, 0 ) );
}
@@ -263,6 +277,7 @@ void KSpreadFormatDlg::slotOk()
if ( m_cells[13] )
cell->setBottomBorderPen( m_cells[13]->topBorderPen( 0, 0 ) );
}
+ }
}
m_view->activeTable()->setSelection( QRect(), r.topLeft() );
@@ -285,7 +300,7 @@ bool KSpreadFormatDlg::parseXML( const Q
{
KSpreadTable* table = m_view->activeTable();
KSpreadLayout* cell = new KSpreadLayout( table );
-
+
if ( !cell->load( e.namedItem("format").toElement() ) )
return false;
Index: kspread_view.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_view.cc,v
retrieving revision 1.281
diff -u -p -r1.281 kspread_view.cc
--- kspread_view.cc 2000/08/28 16:22:15 1.281
+++ kspread_view.cc 2000/09/02 16:57:51
@@ -2378,7 +2378,7 @@ void KSpreadView::slotChangeSelection( K
// Empty selection ?
// Activate or deactivate some actions. This code is duplicated
// in KSpreadView::slotUnselect
- if ( n.left() == 0 && n.right() == 0 )
+ if ( n.left() == 0 && n.top() == 0 )
m_tableFormat->setEnabled( FALSE );
else
m_tableFormat->setEnabled( TRUE );
cvs server: Diffing dtd
cvs server: Diffing extensions
cvs server: Diffing filters
cvs server: Diffing filters/csv
cvs server: Diffing filters/komma
cvs server: Diffing pics
cvs server: Diffing plugins
cvs server: Diffing plugins/calculator
cvs server: Diffing plugins/calculator/pics
cvs server: Diffing scripts
cvs server: Diffing tablestyles
cvs server: Diffing toolbar
cvs server: Diffing toolbar/hicolor
cvs server: Diffing toolbar/locolor
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic