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

List:       kde-commits
Subject:    koffice/kspread
From:       Norbert Andres <nandres () web ! de>
Date:       2003-03-15 15:37:26
[Download RAW message or body]

CVS commit by nandres: 

- save default heights and default row since they are now default font dependant
 but we still wnat the same documents to look the same on different machines or
 with different default fonts
- make it easier to resize columns with the mouse (I saw somebody having problems with it)


  M +2 -2      kspread_canvas.cc   1.371
  M +22 -0     kspread_doc.cc   1.232
  M +2 -2      kspread_scripting.h   1.2


--- koffice/kspread/kspread_canvas.cc  #1.370:1.371
@@ -3607,5 +3607,5 @@ void KSpreadVBorder::mousePressEvent( QM
     if ( row > KS_rowMax )
       row = KS_rowMax;
-    if ( ( ev_PosY >= y + h - 1 ) &&
+    if ( ( ev_PosY >= y + h - 2 ) &&
          ( ev_PosY <= y + h + 1 ) &&
          !( table->rowFormat( row )->isHide() && row == 1 ) )
@@ -3961,5 +3961,5 @@ void KSpreadVBorder::mouseMoveEvent( QMo
       //if col is hide and it's the first column
       //you mustn't resize it.
-      if ( ev_PosY >= y + h - unzoomedPixel &&
+      if ( ev_PosY >= y + h - 2 * unzoomedPixel &&
            ev_PosY <= y + h + unzoomedPixel &&
            !( table->rowFormat( tmpRow )->isHide() && tmpRow == 1 ) )

--- koffice/kspread/kspread_doc.cc  #1.231:1.232
@@ -364,4 +364,9 @@ QDomDocument KSpreadDoc::saveXML()
     }
 
+    QDomElement defaults = doc.createElement( "defaults" );
+    defaults.setAttribute( "row-height", KSpreadFormat::globalRowHeight() );
+    defaults.setAttribute( "col-width", KSpreadFormat::globalColWidth() );
+    spread.appendChild( defaults );
+
     KSpreadPlugin * plugin = m_plugins.first();
     for ( ; plugin != 0; plugin = m_plugins.next() )
@@ -426,4 +431,21 @@ bool KSpreadDoc::loadXML( QIODevice *, c
 
   emit sigProgress( 5 );
+
+  QDomElement defaults = spread.namedItem( "defaults" ).toElement();
+  if ( !defaults.isNull() )
+  {
+    bool ok = false;
+    double d = defaults.attribute( "row-height" ).toDouble( &ok );
+    if ( !ok )
+      return false;
+    KSpreadFormat::setGlobalRowHeight( d );
+
+    d = defaults.attribute( "col-width" ).toDouble( &ok );
+
+    if ( !ok )
+      return false;
+
+    KSpreadFormat::setGlobalColWidth( d );
+  }
 
   m_refs.clear();

--- koffice/kspread/kspread_scripting.h  #1.1:1.2
@@ -55,6 +55,6 @@ class KSpreadScripter
   virtual void setAction( KSpreadScripting::Action /* action*/, int /*data*/ ) {}
   
-  virtual QStringList functions() const { return QStringList(); }
-  virtual bool evaluate( QString const & /*functionName*/ ) const { return false; }
+  virtual QStringList functions() { return QStringList(); }
+  virtual bool evaluate( QString const & /*functionName*/ ) { return false; }
 };
 


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

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