[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KOFFICE_1_3_BRANCH: koffice/lib/kotext
From: Nicolas Goutte <nicolasg () snafu ! de>
Date: 2004-10-04 0:06:12
Message-ID: 20041004000612.EA2B1126E7 () office ! kde ! org
[Download RAW message or body]
CVS commit by goutte:
One step more toward being able to compile on Qt 3.1 (#83972)
M +6 -12 korichtext.cpp 1.133.2.7
M +3 -1 korichtext.h 1.68.2.5
M +23 -0 kotextformat.cc 1.79.2.2
M +5 -3 kotextformatter.cc 1.81.2.11
M +3 -1 kotextparag.cc 1.186.2.6
--- koffice/lib/kotext/korichtext.cpp #1.133.2.6:1.133.2.7
@@ -34,7 +34,4 @@
**********************************************************************/
-// ### TODO: make it depend on Qt version
-#define INDIC
-
#include "korichtext.h"
#include "kotextformat.h"
@@ -4517,17 +4514,14 @@ bool KoTextFormatterBase::isStretchable(
bool KoTextFormatterBase::isBreakable( KoTextString *string, int pos ) const
{
-#ifndef INDIC
- const QChar &c = string->at( pos ).c;
- char ch = c.latin1();
- if ( c.isSpace() && ch != '\n' && c.unicode() != 0x00a0U )
-#else
+#ifdef INDIC
//if (string->at(pos).nobreak)
// return FALSE;
return (pos < string->length()-1 && string->at(pos+1).softBreak);
-
-#if 0
- const QChar &c = string->at(pos).c;
- if ( c.isSpace() && c.unicode() != '\n' && c.unicode() != 0x00a0U )
#endif
+
+#ifndef INDIC
+ const QChar &c = string->at( pos ).c;
+ char ch = c.latin1();
+ if ( c.isSpace() && ch != '\n' && c.unicode() != 0x00a0U )
return TRUE;
if ( c == '-' || c.unicode() == 0xad ) // hyphen or soft hyphen
--- koffice/lib/kotext/korichtext.h #1.68.2.4:1.68.2.5
@@ -84,6 +84,8 @@
#endif // QT_H
-// ### TODO: make it depend on Qt version
+#include <qglobal.h>
+#if QT_VERSION >= 0x030200
#define INDIC
+#endif
class KoTextParag;
--- koffice/lib/kotext/kotextformat.cc #1.79.2.1:1.79.2.2
@@ -18,4 +18,9 @@
*/
+#include <qglobal.h>
+#if QT_VERSION >= 0x030200
+#define INDIC
+#endif
+
#include "kotextformat.h"
#include "korichtext.h" // for KoTextParag etc.
@@ -734,6 +739,11 @@ int KoTextFormat::charWidth( const KoZoo
{
ushort unicode = c->c.unicode();
+#ifndef INDIC
+ if ( unicode == 0xad ) // soft hyphen
+ return 0;
+#else
if ( !c->charStop || unicode == 0xad || unicode == 0x2028 )
return 0;
+#endif
Q_ASSERT( !c->isCustom() ); // actually it's a bit stupid to call this for custom items
if( c->isCustom() ) {
@@ -748,5 +758,9 @@ int KoTextFormat::charWidth( const KoZoo
int pixelww;
int r = c->c.row();
+#ifndef INDIC
+ if( r < 0x06 || r > 0x1f )
+#else
if( /*r < 0x06 || r > 0x1f*/ r < 0x06 || (r > 0x1f && !(r > 0xd7 && r < 0xe0)) )
+#endif
{
// Small caps -> we can't use the cached font metrics from KoTextFormat
@@ -783,8 +797,17 @@ int KoTextFormat::charWidth( const KoZoo
QString str;
int pos = 0;
+#ifndef INDIC
+ if( i > 4 )
+ pos = i - 4;
+#else
if( i > 8 )
pos = i - 8;
+#endif
int off = i - pos;
+#ifndef INDIC
+ int end = QMIN( parag->length(), i + 4 );
+#else
int end = QMIN( parag->length(), i + 8 );
+#endif
while ( pos < end ) {
str += displayedChar( parag->at(pos)->c );
--- koffice/lib/kotext/kotextformatter.cc #1.81.2.10:1.81.2.11
@@ -18,4 +18,9 @@
*/
+#include <qglobal.h>
+#if QT_VERSION >= 0x030200
+#define INDIC
+#endif
+
#include "kotextformatter.h"
#include "kotextformat.h"
@@ -41,7 +46,4 @@
//#define REF_IS_LU
-// ### TODO: check Qt version
-#define INDIC
-
KoTextFormatter::KoTextFormatter()
{
--- koffice/lib/kotext/kotextparag.cc #1.186.2.5:1.186.2.6
@@ -31,6 +31,8 @@
//#define DEBUG_PAINT
-// ### TODO: make it depend on the Qt version
+#include <qglobal.h>
+#if QT_VERSION >= 0x030200
#define INDIC
+#endif
// Return the counter associated with this paragraph.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic