uppsrc: Removed legacy .iml support, fixed clang warnings

git-svn-id: svn://ultimatepp.org/upp/trunk@13522 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-08-03 13:29:03 +00:00
parent 1bd6b2c6f3
commit f8760ec1a2
7 changed files with 6 additions and 49 deletions

View file

@ -23,11 +23,6 @@ void TagSyntax::Put0(int ink, int n, int paper)
hout->Put(n, hl_style[ink], hl_style[paper]);
}
inline static bool IsXmlNameChar(int c)
{
return IsAlNum(c) || c == '.' || c == '-' || c == '_' || c == ':';
}
const wchar *TagSyntax::Spaces(const wchar *s, const wchar *e)
{
while(s < e && IsSpace(*s)) {

View file

@ -227,10 +227,6 @@ void SizeTextDisplayCls::Paint(Draw& w, const Rect& r, const Value& q,
const Display& SizeTextDisplay() { return Single<SizeTextDisplayCls>(); }
static inline int NScale(int sz, int r) {
return sz ? sz < r ? r / sz * sz : r : 0;
}
class CenteredImageDisplayCls : public Display {
public:
virtual void Paint(Draw& w, const Rect& r, const Value& q,

View file

@ -321,24 +321,6 @@ Image::~Image()
data->Release();
}
Image::Image(const Init& init)
{ // Legacy (before cca 2008) iml support
ASSERT(init.info[0] >= 1);
Size sz;
sz.cx = Peek32le(init.info + 1);
sz.cy = Peek32le(init.info + 5);
ImageBuffer b(sz);
int i = 0;
while(i < init.scan_count) {
UnpackRLE(b[i], (const byte *)init.scans[i], sz.cx);
i++;
}
while(i < sz.cy)
memset(b[i++], 0, sizeof(RGBA) * sz.cx);
b.SetHotSpot(Point(Peek32le(init.info + 9), Peek32le(init.info + 13)));
Set(b);
}
String Image::ToString() const
{
return String("Image ").Cat() << GetSize();

View file

@ -246,14 +246,6 @@ public:
uint64 GetAuxData() const;
// IML support ("private"), deprecated - legacy .iml
struct Init {
const char *const *scans;
int16 scan_count;
char info[24];
};
explicit Image(const Init& init);
// required by system image cache managemenent
int GetRefCount() const { return data ? (int)data->refcount : 0; }
@ -298,7 +290,6 @@ class Iml {
};
Vector<Data> data[4]; // 0 normal, 1 HiDPI - HD, 2 DK - Dark, 3 HDK - HiDPI + dark
VectorMap<String, IImage> map;
const Image::Init *img_init;
const char **name;
dword global_flags = 0;
bool premultiply;
@ -323,7 +314,7 @@ public:
ImageIml GetRaw(int mode, const String& id); // tries to get image for mode by id, can return Null
// these methods serve for .iml import
Iml(const Image::Init *img_init, const char **name, int n);//Deprecated - legacy .iml
Iml(const char **name, int n);//Deprecated - legacy .iml
void AddData(const byte *data, int len, int count, int mode = 0);
void AddId(int mode1, const char *name);
void Premultiplied() { premultiply = false; }

View file

@ -155,9 +155,8 @@ int Iml::GetBinSize() const
}
#endif
Iml::Iml(const Image::Init *img_init, const char **name, int n)
: img_init(img_init),
name(name)
Iml::Iml(const char **name, int n)
: name(name)
{
premultiply = true;
Init(n);

View file

@ -31,13 +31,6 @@
UPP::Iml& IMAGECLASS::Iml() {
static UPP::Image::Init init[] = { // legacy format
#define IMAGE_PACKED(n, d) { COMBINE(COMBINE(IMAGECLASS, _), n##__scans__), __countof(COMBINE(COMBINE(IMAGECLASS, _), n##__scans__)), d },
#include IMAGEFILE
{ NULL }
#undef IMAGE_PACKED
};
static const char *name[IMAGECLASS::COUNT] = {
#define IMAGE_PACKED(n, d) #n,
#undef IMAGE_ID
@ -45,7 +38,7 @@ UPP::Iml& IMAGECLASS::Iml() {
#include IMAGEFILE
};
static UPP::Iml iml(init, name, COUNT);
static UPP::Iml iml(name, COUNT);
#ifdef FIXED_COLORS
#undef FIXED_COLORS

View file

@ -50,11 +50,12 @@ PatchDiff::PatchDiff()
return;
String h = patch.GetPatchedFile(i);
String p = patch.GetPath(i);
if(!h.IsVoid())
if(!h.IsVoid()) {
if(IsNull(h))
FileDelete(p);
else
SaveFile(p, h);
}
}
Break(IDOK);
};