[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice
Subject:    2 patches for KWord Tab handling
From:       Werner Trobin <wtrobin () mandrakesoft ! com>
Date:       2000-08-28 14:57:30
[Download RAW message or body]

Hi!

I think I finally fixed the KWord tab handling bugs.
May I apply?

-- 
Werner Trobin - wtrobin@mandrakesoft.com
["kofficeui.diff" (text/plain)]

Index: koRuler.cc
===================================================================
RCS file: /home/kde/koffice/lib/kofficeui/koRuler.cc,v
retrieving revision 1.51
diff -b -u -p -r1.51 koRuler.cc
--- koRuler.cc	2000/08/17 09:04:42	1.51
+++ koRuler.cc	2000/08/28 14:30:18
@@ -245,7 +245,7 @@ void KoRuler::drawTabs( QPainter &_paint
     for ( unsigned int i = 0;i < d->tabList.count();i++ ) {
         _tab = d->tabList.at( i );
         ptPos = double2Int(zoomIt(_tab->ptPos)) - diffx + ( frameStart == -1 ? \
                double2Int( zoomIt(layout.ptLeft) ) :
-                                                            zoomIt(frameStart) );
+                                                            frameStart );
         switch ( _tab->type ) {
         case T_LEFT: {
             ptPos -= 4;
@@ -424,7 +424,7 @@ void KoRuler::mousePressEvent( QMouseEve
             p.setRasterOp( NotROP );
             p.setPen( QPen( black, 1, SolidLine ) );
             double pt=zoomIt(d->tabList.at(d->currTab)->ptPos);
-            pt+= (frameStart == -1 ? zoomIt(layout.ptLeft) : \
static_cast<double>(zoomIt(frameStart))); +            pt+= (frameStart == -1 ? \
zoomIt(layout.ptLeft) : static_cast<double>(frameStart));  int i_pt=double2Int(pt);
             p.drawLine( i_pt, 0, i_pt, d->canvas->height() );
             p.end();
@@ -454,7 +454,7 @@ void KoRuler::mousePressEvent( QMouseEve
             break;
         default: break;
         }
-        _tab->ptPos = static_cast<double>(unZoomIt(e->x() + diffx - (frameStart == \
-1 ? double2Int(zoomIt(layout.ptLeft)) : zoomIt(frameStart)) )); +        _tab->ptPos \
= static_cast<double>(unZoomIt(e->x() + diffx - (frameStart == -1 ? \
double2Int(zoomIt(layout.ptLeft)) : frameStart) ) );  _tab->mmPos = POINT_TO_MM( \
_tab->ptPos );  _tab->inchPos = POINT_TO_INCH( _tab->ptPos );
 
@@ -538,7 +538,7 @@ void KoRuler::mouseReleaseEvent( QMouseE
             p.setRasterOp( NotROP );
             p.setPen( QPen( black, 1, SolidLine ) );
             double pt=zoomIt(d->tabList.at(d->currTab)->ptPos);
-            pt+= (frameStart == -1 ? zoomIt(layout.ptLeft) : \
static_cast<double>(zoomIt(frameStart))); +            pt+= (frameStart == -1 ? \
zoomIt(layout.ptLeft) : static_cast<double>(frameStart));  int i_pt=double2Int(pt);
             p.drawLine( i_pt, 0, i_pt, d->canvas->height() );
             p.end();
@@ -608,8 +608,7 @@ void KoRuler::mouseMoveEvent( QMouseEven
                     d->currTab = -1;
                     for ( unsigned int i = 0; i < d->tabList.count(); i++ ) {
                         pos = double2Int(zoomIt(d->tabList.at( i )->ptPos)) - diffx \
                + ( frameStart == -1 ?
-                                                                             \
                double2Int(zoomIt(layout.ptLeft)) :
-                                                                             \
zoomIt(frameStart)); +                                                                \
double2Int(zoomIt(layout.ptLeft)) : frameStart);  if ( mx > pos - 5 && mx < pos + 5 ) \
{  setCursor( sizeHorCursor );
                             d->action = A_TAB;
@@ -731,7 +730,7 @@ void KoRuler::mouseMoveEvent( QMouseEven
                             p.setRasterOp( NotROP );
                             p.setPen( QPen( black, 1, SolidLine ) );
                             double pt=zoomIt(d->tabList.at( d->currTab )->ptPos);
-                            double fr=(frameStart == -1 ? zoomIt(layout.ptLeft) : \
static_cast<double>(zoomIt(frameStart)) ); +                            double \
fr=(frameStart == -1 ? zoomIt(layout.ptLeft) : static_cast<double>(frameStart) );  \
                int pt_fr=double2Int(pt+fr);
                             p.drawLine( pt_fr, 0, pt_fr, d->canvas->height() );
                             d->tabList.at( d->currTab )->ptPos = \
unZoomIt(static_cast<double>(mx) - fr );


["kword.diff" (text/plain)]

Index: fc.cc
===================================================================
RCS file: /home/kde/koffice/kword/fc.cc,v
retrieving revision 1.129
diff -b -u -p -r1.129 fc.cc
--- fc.cc	2000/08/27 13:21:29	1.129
+++ fc.cc	2000/08/28 14:54:25
@@ -1047,9 +1047,9 @@ bool KWFormatContext::makeLineLayout( bo
         // Change fonts & stuff to match the paragraphs layout
         apply( parag->getParagLayout()->getFormat() );
 
-        indent = static_cast<int>(parag->getParagLayout()->getFirstLineLeftIndent().pt());
 +        indent = static_cast<int>(parag->getParagLayout()->getFirstLineLeftIndent().pt()*doc->getZoom())/100;
  } else {
-        indent = static_cast<int>(parag->getParagLayout()->getLeftIndent().pt());
+        indent = static_cast<int>(parag->getParagLayout()->getLeftIndent().pt()*doc->getZoom())/100;
  }
 
     indent += _left;
Index: kword_view.cc
===================================================================
RCS file: /home/kde/koffice/kword/kword_view.cc,v
retrieving revision 1.271
diff -b -u -p -r1.271 kword_view.cc
--- kword_view.cc	2000/08/24 13:23:52	1.271
+++ kword_view.cc	2000/08/28 14:54:42
@@ -2489,7 +2489,7 @@ void KWordView::newPageLayout( KoPageLay
     gui->getVertRuler()->setPageLayout( _layout );
 
     gui->getPaperWidget()->frameSizeChanged( _layout );
-    gui->getPaperWidget()->repaintScreen( TRUE );
+    gui->getPaperWidget()->forceFullUpdate();
 }
 
 /*================================================================*/
Index: paraglayout.cc
===================================================================
RCS file: /home/kde/koffice/kword/paraglayout.cc,v
retrieving revision 1.64
diff -b -u -p -r1.64 paraglayout.cc
--- paraglayout.cc	2000/08/27 13:21:29	1.64
+++ paraglayout.cc	2000/08/28 14:54:45
@@ -468,12 +468,12 @@ bool KWParagLayout::getNextTab( unsigned
     unsigned int ptPos = 0;
 
     for ( unsigned int i = 0; i < tabList.count(); i++ ) {
-        ptPos = static_cast<int>(tabList.at( i )->ptPos) + _lBorder;
+        ptPos = static_cast<int>(tabList.at( i )->ptPos * document->getZoom()/100) + \
_lBorder;  if ( ptPos > _ptPos && ptPos < _rBorder && ( _best == -1 ||
-                                                     ptPos < static_cast<unsigned \
int>( tabList.at( _best )->ptPos ) ) ) +                                              \
ptPos < static_cast<unsigned int>( tabList.at( _best )->ptPos * \
document->getZoom()/100) ) )  _best = i;
         if ( ptPos <= _ptPos && ptPos > _lBorder && ( _mostLeft == -1 ||
-                                                      ptPos < static_cast<unsigned \
int>( tabList.at( _mostLeft )->ptPos ) ) ) +                                          \
ptPos < static_cast<unsigned int>( tabList.at( _mostLeft )->ptPos * \
document->getZoom()/100) ) )  _mostLeft = i;
     }
 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic