summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextengine_p.h
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-08-12 07:10:59 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-08-12 07:10:59 (GMT)
commit81529d52a76b48aa89b7ac8c9044da4ea5c11f3f (patch)
tree15804758bc6d213044fcacd8d00c88d8321ed1c9 /src/gui/text/qtextengine_p.h
parent03d9d3cf641c8dde22a903870ac2b6e58ada6eec (diff)
parent773512d205df2ba7caa28b7b5cdbfbd6787a0967 (diff)
downloadQt-81529d52a76b48aa89b7ac8c9044da4ea5c11f3f.zip
Qt-81529d52a76b48aa89b7ac8c9044da4ea5c11f3f.tar.gz
Qt-81529d52a76b48aa89b7ac8c9044da4ea5c11f3f.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/gui/text/qtextengine_p.h')
-rw-r--r--src/gui/text/qtextengine_p.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index e623fa5..4cbe81f 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -416,6 +416,11 @@ class QTextFormatCollection;
class Q_GUI_EXPORT QTextEngine {
public:
+ enum LayoutState {
+ LayoutEmpty,
+ InLayout,
+ LayoutFailed,
+ };
struct LayoutData {
LayoutData(const QString &str, void **stack_memory, int mem_size);
LayoutData();
@@ -428,11 +433,11 @@ public:
QGlyphLayout glyphLayout;
mutable int used;
uint hasBidi : 1;
- uint inLayout : 1;
+ uint layoutState : 2;
uint memory_on_stack : 1;
bool haveCharAttributes;
QString string;
- void reallocate(int totalGlyphs);
+ bool reallocate(int totalGlyphs);
};
QTextEngine(LayoutData *data);
@@ -520,9 +525,10 @@ public:
return layoutData->glyphLayout.mid(si->glyph_data_offset, si->num_glyphs);
}
- inline void ensureSpace(int nGlyphs) const {
+ inline bool ensureSpace(int nGlyphs) const {
if (layoutData->glyphLayout.numGlyphs - layoutData->used < nGlyphs)
- layoutData->reallocate((((layoutData->used + nGlyphs)*3/2 + 15) >> 4) << 4);
+ return layoutData->reallocate((((layoutData->used + nGlyphs)*3/2 + 15) >> 4) << 4);
+ return true;
}
void freeMemory();