mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-05 17:44:55 -06:00
RichText: Fixed parti issue in GetValPos, lz4 now using Function instead of Gate for progress
git-svn-id: svn://ultimatepp.org/upp/trunk@10116 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
97a01e693b
commit
5b916e8d20
3 changed files with 17 additions and 16 deletions
|
|
@ -1,3 +1,5 @@
|
|||
enum CNULLer { CNULL };
|
||||
|
||||
template<typename Res, typename... ArgTypes>
|
||||
class Function<Res(ArgTypes...)> : Moveable<Function<Res(ArgTypes...)>> {
|
||||
struct WrapperBase {
|
||||
|
|
@ -48,6 +50,7 @@ class Function<Res(ArgTypes...)> : Moveable<Function<Res(ArgTypes...)>> {
|
|||
|
||||
public:
|
||||
Function() { ptr = NULL; }
|
||||
Function(CNULLer) { ptr = NULL; }
|
||||
|
||||
template <class F> Function(F fn) { ptr = new Wrapper<F>(pick(fn)); }
|
||||
|
||||
|
|
@ -77,8 +80,6 @@ public:
|
|||
~Function() { Free(ptr); }
|
||||
};
|
||||
|
||||
enum CNULLer { CNULL };
|
||||
|
||||
// we need "isolation level" to avoid overloading issues
|
||||
template <class... ArgTypes>
|
||||
class Event : Moveable<Event<ArgTypes...>> {
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ void RichTxt::GatherValPos(Vector<RichValPos>& f, RichContext rc, int pos, int t
|
|||
int parti = 0;
|
||||
while(parti < part.GetCount()) {
|
||||
RichContext begin;
|
||||
Advance(parti++, rc, begin);
|
||||
Advance(parti, rc, begin);
|
||||
if(part[parti].Is<RichTable>())
|
||||
GetTable(parti).GatherValPos(f, begin, pos, type);
|
||||
else {
|
||||
|
|
@ -336,6 +336,7 @@ void RichTxt::GatherValPos(Vector<RichValPos>& f, RichContext rc, int pos, int t
|
|||
Get(parti, *begin.styles, true).GatherIndexes(f, begin.page, begin.py, pos);
|
||||
}
|
||||
pos += GetPartLength(parti) + 1;
|
||||
parti++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,21 +110,20 @@ public:
|
|||
~LZ4DecompressStream();
|
||||
};
|
||||
|
||||
|
||||
int64 LZ4Compress(Stream& out, Stream& in, Function<bool(int64, int64)> progress = false);
|
||||
int64 LZ4Decompress(Stream& out, Stream& in, Function<bool(int64, int64)> progress = false);
|
||||
String LZ4Compress(const void *data, int64 len, Function<bool(int64, int64)> progress = false);
|
||||
String LZ4Compress(const String& s, Function<bool(int64, int64)> progress = false);
|
||||
String LZ4Decompress(const void *data, int64 len, Function<bool(int64, int64)> progress = false);
|
||||
String LZ4Decompress(const String& s, Function<bool(int64, int64)> progress = false);
|
||||
int64 LZ4Compress(Stream& out, Stream& in, Function<bool(int64, int64)> progress = CNULL);
|
||||
int64 LZ4Decompress(Stream& out, Stream& in, Function<bool(int64, int64)> progress = CNULL);
|
||||
String LZ4Compress(const void *data, int64 len, Function<bool(int64, int64)> progress = CNULL);
|
||||
String LZ4Compress(const String& s, Function<bool(int64, int64)> progress = CNULL);
|
||||
String LZ4Decompress(const void *data, int64 len, Function<bool(int64, int64)> progress = CNULL);
|
||||
String LZ4Decompress(const String& s, Function<bool(int64, int64)> progress = CNULL);
|
||||
|
||||
#ifdef _MULTITHREADED
|
||||
int64 CoLZ4Compress(Stream& out, Stream& in, Function<bool(int64, int64)> progress = false);
|
||||
int64 CoLZ4Decompress(Stream& out, Stream& in, Function<bool(int64, int64)> progress = false);
|
||||
String CoLZ4Compress(const void *data, int64 len, Function<bool(int64, int64)> progress = false);
|
||||
String CoLZ4Compress(const String& s, Function<bool(int64, int64)> progress = false);
|
||||
String CoLZ4Decompress(const void *data, int64 len, Function<bool(int64, int64)> progress = false);
|
||||
String CoLZ4Decompress(const String& s, Function<bool(int64, int64)> progress = false);
|
||||
int64 CoLZ4Compress(Stream& out, Stream& in, Function<bool(int64, int64)> progress = CNULL);
|
||||
int64 CoLZ4Decompress(Stream& out, Stream& in, Function<bool(int64, int64)> progress = CNULL);
|
||||
String CoLZ4Compress(const void *data, int64 len, Function<bool(int64, int64)> progress = CNULL);
|
||||
String CoLZ4Compress(const String& s, Function<bool(int64, int64)> progress = CNULL);
|
||||
String CoLZ4Decompress(const void *data, int64 len, Function<bool(int64, int64)> progress = CNULL);
|
||||
String CoLZ4Decompress(const String& s, Function<bool(int64, int64)> progress = CNULL);
|
||||
#endif
|
||||
|
||||
bool IsLZ4(Stream& s);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue