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

List:       koffice
Subject:    Re: KOffice on IRIX
From:       Jesse Barnes <jbarnes () spamtin ! engr ! sgi ! com>
Date:       2000-10-13 18:17:42
[Download RAW message or body]

Ok, here it is.

Jesse

On Fri, 13 Oct 2000, David Faure wrote:

> On Friday 13 October 2000 17:55, Jesse Barnes wrote :
> >Yup, both of those compile just fine.  FYI, in kab, there's a line like
> >(see below) 'namespace std { };' in at least one spot, which is one way to
> >workaround things.  As for the STL, I think that is declared in the std
> >namespace for MIPSPro.  At any rate, since all of qt, kdesupport, kdelibs,
> >and kdebase compile for me, shouldn't koffice?
> 
> Sure, but the question is how :-)
> 
> You're saying your compiler chokes on "using namespace std;"
> but it accepts it fine in kdelibs. The question is why.....
> 
> Is it that it only works if some STL file has been included, so that the compiler
> knows about the namespace ? In this case, the solution might be to include 
> such a file, or do define "namespace std {};" as you suggested.
> 
> Please come up with an appropriate patch, if this solution works.
> 
> Commenting out the "using" statement is not the right solution 
> (because of some other compilers). 
> 
> -- 
> David FAURE, david@mandrakesoft.com, faure@kde.org
> http://www.mandrakesoft.com/~david/, http://www.konqueror.org/
> KDE, Making The Future of Computing Available Today
> See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2
> 

["koffice-irix.patch" (TEXT/PLAIN)]

diff -ur koffice-2.0rc2.orig/kchart/enginehelper.cc \
                koffice-2.0rc2/kchart/enginehelper.cc
--- koffice-2.0rc2.orig/kchart/enginehelper.cc	Sat Apr  8 09:43:12 2000
+++ koffice-2.0rc2/kchart/enginehelper.cc	Wed Oct 11 17:30:34 2000
@@ -163,7 +163,7 @@
 		if( whole<0 && numr<0.0 )
 			numr = -numr;
 		*numorator = (int)numr;
-		*demoninator = (int)pow(2.0, (float)cnt);
+		*demoninator = (int)pow((float)2.0, (float)cnt);
 		*decimal = whole;
 		sprintf( rtn, "%d %d/%d", whole,(int)numr,*demoninator );
 		}
diff -ur koffice-2.0rc2.orig/killustrator/filter/XfigImport.cc \
                koffice-2.0rc2/killustrator/filter/XfigImport.cc
--- koffice-2.0rc2.orig/killustrator/filter/XfigImport.cc	Thu Oct  5 03:32:14 2000
+++ koffice-2.0rc2/killustrator/filter/XfigImport.cc	Fri Oct 13 10:36:01 2000
@@ -38,6 +38,7 @@
 #include <qtl.h>
 #include <kdebug.h>
 
+namespace std { };
 using namespace std;
 
 #define RAD_FACTOR 180.0 / M_PI
diff -ur koffice-2.0rc2.orig/killustrator/share/GObject.h \
                koffice-2.0rc2/killustrator/share/GObject.h
--- koffice-2.0rc2.orig/killustrator/share/GObject.h	Wed Sep  6 23:43:47 2000
+++ koffice-2.0rc2/killustrator/share/GObject.h	Wed Oct 11 17:35:53 2000
@@ -427,7 +427,7 @@
 inline float seg_length (const Coord& c1, const Coord& c2) {
     float dx = c2.x () - c1.x ();
     float dy = c2.y () - c1.y ();
-    return std::sqrt (dx * dx + dy * dy);
+    return sqrt (dx * dx + dy * dy);
 }
 
 namespace KIllustrator {
diff -ur koffice-2.0rc2.orig/killustrator/share/GOval.cc \
                koffice-2.0rc2/killustrator/share/GOval.cc
--- koffice-2.0rc2.orig/killustrator/share/GOval.cc	Wed Sep  6 23:43:47 2000
+++ koffice-2.0rc2/killustrator/share/GOval.cc	Wed Oct 11 17:36:35 2000
@@ -222,8 +222,8 @@
 }
 
 void GOval::movePoint (int idx, float dx, float dy, bool /*ctrlPressed*/) {
-  float adx = std::fabs (dx);
-  float ady = std::fabs (dy);
+  float adx = fabs (dx);
+  float ady = fabs (dy);
   float angle = 0;
 
   if (idx == 0 && segPoint[0] == segPoint[1])
@@ -243,7 +243,7 @@
       x = r.right ();
 
     x -= (r.left () + a);
-    angle = std::acos (x / a) * RAD_FACTOR;
+    angle = acos (x / a) * RAD_FACTOR;
     if (segPoint[idx].y () < r.center ().y ())
       angle = 360 - angle;
   }
@@ -255,7 +255,7 @@
       y = r.bottom ();
 
     y -= (r.top () + b);
-    angle = std::asin (y / b) * RAD_FACTOR;
+    angle = asin (y / b) * RAD_FACTOR;
     if (segPoint[idx].y () < r.center ().y ()) {
       if (segPoint[idx].x () > r.center ().x ())
         angle += 360;
@@ -294,15 +294,15 @@
   float b = r.height () / 2.0;
 
   float angle = sAngle * M_PI / 180.0;
-  x = a * std::cos (angle) + r.left () + a;
-  y = b * std::sin (angle) + r.top () + b;
+  x = a * cos (angle) + r.left () + a;
+  y = b * sin (angle) + r.top () + b;
 
   segPoint[0].x (x);
   segPoint[0].y (y);
 
   angle = eAngle * M_PI / 180.0;
-  x = a * std::cos (angle) + r.left () + a;
-  y = b * std::sin (angle) + r.top () + b;
+  x = a * cos (angle) + r.left () + a;
+  y = b * sin (angle) + r.top () + b;
 
   segPoint[1].x (x);
   segPoint[1].y (y);
@@ -395,8 +395,8 @@
         x1 = m.x () - segPoint[1].x ();
         y1 = m.y () - segPoint[1].y ();
 
-        x = x1 * std::cos (WINKEL) - y1 * std::sin (WINKEL);
-        y = x1 * std::sin (WINKEL) + y1 * std::cos (WINKEL);
+        x = x1 * cos (WINKEL) - y1 * sin (WINKEL);
+        y = x1 * sin (WINKEL) + y1 * cos (WINKEL);
 
         x *= 1.5; y *= 1.5;
 
@@ -428,8 +428,8 @@
         x1 = m.x () - segPoint[1].x ();
         y1 = m.y () - segPoint[1].y ();
 
-        x = x1 * std::cos (-WINKEL) - y1 * std::sin (-WINKEL);
-        y = x1 * std::sin (-WINKEL) + y1 * std::cos (-WINKEL);
+        x = x1 * cos (-WINKEL) - y1 * sin (-WINKEL);
+        y = x1 * sin (-WINKEL) + y1 * cos (-WINKEL);
 
         x *= 1.5; y *= 1.5;
 
diff -ur koffice-2.0rc2.orig/killustrator/share/PolygonPreview.cc \
                koffice-2.0rc2/killustrator/share/PolygonPreview.cc
--- koffice-2.0rc2.orig/killustrator/share/PolygonPreview.cc	Thu Jul 27 05:32:28 2000
+++ koffice-2.0rc2/killustrator/share/PolygonPreview.cc	Wed Oct 11 17:40:37 2000
@@ -62,12 +62,12 @@
         for (int i = 1; i < nCorners * 2; ++i) {
             double xp, yp;
             if (i % 2) {
-                xp =  r * std::sin(a);
-                yp = -r * std::cos(a);
+                xp =  r * sin(a);
+                yp = -r * cos(a);
             }
             else {
-                xp = radius * std::sin(a);
-                yp = -radius * std::cos(a);
+                xp = radius * sin(a);
+                yp = -radius * cos(a);
             }
             a += angle;
             points.setPoint (i, (int) xp, (int) yp);
@@ -76,8 +76,8 @@
     else {
         double a = angle;
         for (int i = 1; i < nCorners; i++) {
-            double xp = radius * std::sin(a);
-            double yp = -radius * std::cos(a);
+            double xp = radius * sin(a);
+            double yp = -radius * cos(a);
             a += angle;
             points.setPoint (i, (int) xp, (int) yp);
         }
diff -ur koffice-2.0rc2.orig/killustrator/share/PolylineTool.cc \
                koffice-2.0rc2/killustrator/share/PolylineTool.cc
--- koffice-2.0rc2.orig/killustrator/share/PolylineTool.cc	Fri Jul 28 13:11:48 2000
+++ koffice-2.0rc2/killustrator/share/PolylineTool.cc	Wed Oct 11 17:37:49 2000
@@ -160,7 +160,7 @@
 
     if (me->state () & ControlButton) {
       Coord oldp = line->getPoint (last > 0 ? last - 1 : 0);
-      if (std::fabs (xpos - oldp.x ()) > std::fabs (ypos - oldp.y ()))
+      if (fabs (xpos - oldp.x ()) > fabs (ypos - oldp.y ()))
         ypos = oldp.y ();
       else
         xpos = oldp.x ();
diff -ur koffice-2.0rc2.orig/kpresenter/kpresenter_view.cc \
                koffice-2.0rc2/kpresenter/kpresenter_view.cc
--- koffice-2.0rc2.orig/kpresenter/kpresenter_view.cc	Mon Oct  2 16:23:37 2000
+++ koffice-2.0rc2/kpresenter/kpresenter_view.cc	Wed Oct 11 17:51:15 2000
@@ -28,7 +28,7 @@
 #include <qfileinfo.h>
 #include <qtextstream.h>
 #include <qfiledialog.h>
-#include <cassert>
+#include <assert.h>
 #include <qtoolbutton.h>
 #include <qtooltip.h>
 #include <qradiobutton.h>
diff -ur koffice-2.0rc2.orig/kspread/kspread_cell.cc \
                koffice-2.0rc2/kspread/kspread_cell.cc
--- koffice-2.0rc2.orig/kspread/kspread_cell.cc	Wed Sep 27 15:08:41 2000
+++ koffice-2.0rc2/kspread/kspread_cell.cc	Thu Oct 12 10:28:31 2000
@@ -1419,7 +1419,7 @@
                         double q=0;
                         double val2=rint(result);
 
-                        precision=pow(10,(-1*index));
+                        precision=pow((float)10,(-1*index));
                         numerator=rint(result);
                         denominator=1;
                         while(fabs(numerator/denominator-result)>precision)
@@ -1793,8 +1793,8 @@
     // Rotated text ?
     else if( m_rotateAngle != 0 )
     {
-        m_iOutTextHeight = \
static_cast<int>(std::cos(m_rotateAngle*M_PI/180)*(fm.ascent() + \
                fm.descent())+abs((int)(fm.width( m_strOutText \
                )*sin(m_rotateAngle*M_PI/180))));
-        m_iOutTextWidth = \
static_cast<int>(std::abs((int)(sin(m_rotateAngle*M_PI/180)*(fm.ascent() + \
fm.descent())))+fm.width( m_strOutText )*cos(m_rotateAngle*M_PI/180)); +        \
m_iOutTextHeight = static_cast<int>(cos(m_rotateAngle*M_PI/180)*(fm.ascent() + \
fm.descent())+abs((int)(fm.width( m_strOutText )*sin(m_rotateAngle*M_PI/180)))); +    \
m_iOutTextWidth = static_cast<int>(abs((int)(sin(m_rotateAngle*M_PI/180)*(fm.ascent() \
                + fm.descent())))+fm.width( m_strOutText \
                )*cos(m_rotateAngle*M_PI/180));
         //kdDebug(36001)<<"m_iOutTextWidth"<<m_iOutTextWidth<<"m_iOutTextHeight"<<m_iOutTextHeight<<endl;
  }
     // Vertical text ?
diff -ur koffice-2.0rc2.orig/kspread/kspread_dlg_layout.cc \
                koffice-2.0rc2/kspread/kspread_dlg_layout.cc
--- koffice-2.0rc2.orig/kspread/kspread_dlg_layout.cc	Sun Sep 17 15:03:51 2000
+++ koffice-2.0rc2/kspread/kspread_dlg_layout.cc	Thu Oct 12 10:26:56 2000
@@ -1169,7 +1169,7 @@
                         double q=0;
                         double val2=rint(result);
 
-                        preci=pow(10,(-1*index));
+                        preci=pow((float)10,(-1*index));
                         numerator=rint(result);
                         denominator=1;
                         while(fabs(numerator/denominator-result)>preci)
diff -ur koffice-2.0rc2.orig/kspread/plugins/calculator/kcalc_core.cpp \
                koffice-2.0rc2/kspread/plugins/calculator/kcalc_core.cpp
--- koffice-2.0rc2.orig/kspread/plugins/calculator/kcalc_core.cpp	Tue Sep 19 14:57:07 \
                2000
+++ koffice-2.0rc2/kspread/plugins/calculator/kcalc_core.cpp	Thu Oct 12 10:36:03 2000
@@ -182,7 +182,7 @@
   sigaction(SIGFPE, &fpe_trap, NULL);
 
   RefreshCalculator();
-  pi = ASIN(1L) * 2L;
+  pi = ASIN(1.0) * 2L;
 }
 
 void fpe_handler(int fpe_parm)
@@ -261,12 +261,12 @@
     if (DISPLAY_AMOUNT < 0)
       DISPLAY_AMOUNT = decimal_point ?
         DISPLAY_AMOUNT - ((CALCAMNT)data /
-                          POW(current_base, decimal_point++)) :
+                          POW((float)current_base, decimal_point++)) :
     (current_base * DISPLAY_AMOUNT) - data;
     else
       DISPLAY_AMOUNT = decimal_point ?
         DISPLAY_AMOUNT + ((CALCAMNT)data /
-                          POW(current_base, decimal_point++)) :
+                          POW((float)current_base, decimal_point++)) :
     (current_base * DISPLAY_AMOUNT) + data;
 
   if (decimal_point){
diff -ur koffice-2.0rc2.orig/kword/serialletter.cc \
                koffice-2.0rc2/kword/serialletter.cc
--- koffice-2.0rc2.orig/kword/serialletter.cc	Sun Sep  3 11:26:42 2000
+++ koffice-2.0rc2/kword/serialletter.cc	Thu Oct 12 10:45:34 2000
@@ -367,12 +367,12 @@
 /*================================================================*/
 KWSerialLetterEditorList::~KWSerialLetterEditorList()
 {
-    if ( currentRecord == -1 )
-        return;
+//    if ( currentRecord == -1 )
+//        return;
 
     QListViewItemIterator lit( this );
     QMap< QString, QString >::ConstIterator it = db->getRecordEntries().begin();
-    for ( ; it != db->getRecordEntries().end(); ++it ) {
+    for ( ; it != db->getRecordEntries().end() && currentRecord != -1; ++it ) {
         QListViewItem *item = 0;
         item = lit.current();
         ++lit;
diff -ur koffice-2.0rc2.orig/lib/kofficecore/handler.cpp \
                koffice-2.0rc2/lib/kofficecore/handler.cpp
--- koffice-2.0rc2.orig/lib/kofficecore/handler.cpp	Sun Sep 24 12:51:01 2000
+++ koffice-2.0rc2/lib/kofficecore/handler.cpp	Wed Oct 11 17:19:21 2000
@@ -114,11 +114,11 @@
 
         double dx = x2_x - x1_x;
         double dy = x2_y - x1_y;
-        int x = int( std::sqrt( dx * dx + dy * dy ) * ( d->m_mouseStart.x() < p.x() \
? 1.0 : -1.0 ) ); +        int x = int( sqrt( dx * dx + dy * dy ) * ( \
d->m_mouseStart.x() < p.x() ? 1.0 : -1.0 ) );  
         dx = y2_x - y1_x;
         dy = y2_y - y1_y;
-        int y = int( std::sqrt( dx * dx + dy * dy ) * ( d->m_mouseStart.y() < p.y() \
? 1.0 : -1.0 ) ); +        int y = int( sqrt( dx * dx + dy * dy ) * ( \
d->m_mouseStart.y() < p.y() ? 1.0 : -1.0 ) );  
         switch( d->m_gadget )
         {
diff -ur koffice-2.0rc2.orig/lib/kofficecore/koApplication.h \
                koffice-2.0rc2/lib/kofficecore/koApplication.h
--- koffice-2.0rc2.orig/lib/kofficecore/koApplication.h	Mon Oct  9 00:06:46 2000
+++ koffice-2.0rc2/lib/kofficecore/koApplication.h	Fri Oct 13 10:06:57 2000
@@ -20,6 +20,7 @@
 #ifndef __ko_app_h__
 #define __ko_app_h__
 
+#include <list>
 #include <kapp.h>
 
 #define KOAPP ((KoApplication *)KApplication::kApplication())
diff -ur koffice-2.0rc2.orig/lib/kofficecore/koDocument.h \
                koffice-2.0rc2/lib/kofficecore/koDocument.h
--- koffice-2.0rc2.orig/lib/kofficecore/koDocument.h	Sun Sep 24 12:51:01 2000
+++ koffice-2.0rc2/lib/kofficecore/koDocument.h	Fri Oct 13 10:18:56 2000
@@ -20,6 +20,8 @@
 #ifndef __ko_document_h__
 #define __ko_document_h__
 
+#include <list>
+
 #include <qwmatrix.h>
 
 #include <kparts/part.h>
@@ -512,7 +514,7 @@
   void resetURL() { m_url = KURL(); }
 
   /// @internal
-  virtual void setModified() { ReadWritePart::setModified(); }
+  virtual void setModified() { KParts::ReadWritePart::setModified(); }
 
   /// @internal
   virtual void insertChild(QObject *o) { QObject::insertChild(o); }
diff -ur koffice-2.0rc2.orig/lib/kofficecore/koMainWindow.cc \
                koffice-2.0rc2/lib/kofficecore/koMainWindow.cc
--- koffice-2.0rc2.orig/lib/kofficecore/koMainWindow.cc	Wed Oct  4 11:22:40 2000
+++ koffice-2.0rc2/lib/kofficecore/koMainWindow.cc	Wed Oct 11 17:16:19 2000
@@ -73,7 +73,7 @@
   {
     if ( !obj->isWidgetType() || obj->inherits( "KoFrame" ) )
       return false;
-    return PartManager::eventFilter( obj, ev );
+    return KParts::PartManager::eventFilter( obj, ev );
   }
 };
 
diff -ur koffice-2.0rc2.orig/lib/kofficecore/koView.cc \
                koffice-2.0rc2/lib/kofficecore/koView.cc
--- koffice-2.0rc2.orig/lib/kofficecore/koView.cc	Sat Sep 23 14:37:37 2000
+++ koffice-2.0rc2/lib/kofficecore/koView.cc	Wed Oct 11 17:17:58 2000
@@ -63,7 +63,7 @@
   //kdDebug(30003) << "KoView::KoView " << this << endl;
   d = new KoViewPrivate;
   d->m_doc = document;
-  PartBase::setPartObject( this );
+  KParts::PartBase::setPartObject( this );
 
   setFocusPolicy( StrongFocus );
 



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

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