Patch level : 2.1 nopact
Files correlati : Ricompilazione Demo : [ ] Commento : Aggiunto supporto per protezione record in cancellazione Corrette TAutoken_string in modo da supportare nuovamente il PIPE inglese git-svn-id: svn://10.65.10.50/trunk@12204 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
19d77b5b53
commit
0845d50a74
@ -646,18 +646,24 @@ int TSpreadsheet::rec2row(int record)
|
|||||||
// Retrieves the corresponding field of the mask from a spredsheet cell
|
// Retrieves the corresponding field of the mask from a spredsheet cell
|
||||||
TOperable_field* TSpreadsheet::test_field(int pos) const
|
TOperable_field* TSpreadsheet::test_field(int pos) const
|
||||||
{
|
{
|
||||||
int num;
|
|
||||||
XI_OBJ** column = xi_get_member_list(_obj, &num);
|
|
||||||
CHECKD(pos >= 0 && pos < num, "Bad column number", pos);
|
|
||||||
|
|
||||||
TOperable_field* good = NULL;
|
TOperable_field* good = NULL;
|
||||||
for (short id = column[pos]->cid; ; id += 100)
|
if (pos > 0)
|
||||||
{
|
{
|
||||||
TOperable_field* f = field(id);
|
int num;
|
||||||
if (f == NULL) break; // Search failed
|
XI_OBJ** column = xi_get_member_list(_obj, &num);
|
||||||
good = f; // We've found a field with the proper ID ...
|
CHECKD(pos >= 0 && pos < num, "Bad column number", pos);
|
||||||
if (f->active()) break; // ... and it's active: end of search
|
|
||||||
}
|
for (short id = column[pos]->cid; ; id += 100)
|
||||||
|
{
|
||||||
|
TOperable_field* f = field(id);
|
||||||
|
if (f == NULL) break; // Search failed
|
||||||
|
good = f; // We've found a field with the proper ID ...
|
||||||
|
if (f->active()) break; // ... and it's active: end of search
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
good = field(DLG_USER);
|
||||||
|
|
||||||
return good;
|
return good;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,4 +394,13 @@ bool user_can_write(const TRelation* rel)
|
|||||||
return user_can_read(rel) && postman().user_can("Scrittura", rel);
|
return user_can_read(rel) && postman().user_can("Scrittura", rel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool user_can_delete(const TRelation* rel)
|
||||||
|
{
|
||||||
|
return user_can_write(rel) && postman().user_can("Eliminazione", rel);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool user_can_do(const char* azione, const TRelation* rel)
|
||||||
|
{
|
||||||
|
return postman().user_can(azione, rel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,16 +1,8 @@
|
|||||||
#ifndef __POSTMAN_H
|
#ifndef __POSTMAN_H
|
||||||
#define __POSTMAN_H
|
#define __POSTMAN_H
|
||||||
|
|
||||||
#ifndef __ISAM_H
|
|
||||||
class TRectype;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __RELATION_H
|
#ifndef __RELATION_H
|
||||||
class TRelation;
|
#include <relation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __STRINGS_H
|
|
||||||
class TFilename;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Mail management
|
// Mail management
|
||||||
@ -24,6 +16,8 @@ const char* get_user_write_filter();
|
|||||||
|
|
||||||
bool user_can_read(const TRelation* rel);
|
bool user_can_read(const TRelation* rel);
|
||||||
bool user_can_write(const TRelation* rel);
|
bool user_can_write(const TRelation* rel);
|
||||||
|
bool user_can_delete(const TRelation* rel);
|
||||||
|
bool user_can_do(const char* azione, const TRelation* rel);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1201,9 +1201,9 @@ bool TRelation_application::relation_remove()
|
|||||||
|
|
||||||
bool TRelation_application::protected_record(TRelation &r)
|
bool TRelation_application::protected_record(TRelation &r)
|
||||||
{
|
{
|
||||||
if (user_can_write(&r))
|
if (user_can_delete(&r))
|
||||||
return protected_record(r.curr());
|
return protected_record(r.curr());
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TRelation_application::remove()
|
bool TRelation_application::remove()
|
||||||
|
@ -384,23 +384,51 @@ const TReport_link* TPrint_preview_window::find_link(const PNT& pnt) const
|
|||||||
|
|
||||||
void TPrint_preview_window::handler(WINDOW win, EVENT* ep)
|
void TPrint_preview_window::handler(WINDOW win, EVENT* ep)
|
||||||
{
|
{
|
||||||
|
static PNT ptPan;
|
||||||
|
|
||||||
switch (ep->type)
|
switch (ep->type)
|
||||||
{
|
{
|
||||||
case E_MOUSE_MOVE:
|
case E_MOUSE_MOVE:
|
||||||
if (find_link(ep->v.mouse.where) != NULL)
|
switch (ep->v.mouse.button)
|
||||||
xvt_win_set_cursor(win, 8004); // Ditino
|
{
|
||||||
else
|
case 2:
|
||||||
xvt_win_set_cursor(win, CURSOR_ARROW); // Freccia
|
{
|
||||||
|
const PNT& ptCur = ep->v.mouse.where;
|
||||||
|
TPoint orig = origin();
|
||||||
|
orig.x += ptPan.h - ptCur.h;
|
||||||
|
orig.y += ptPan.v - ptCur.v;
|
||||||
|
update_thumb(orig.x, orig.y);
|
||||||
|
force_update();
|
||||||
|
ptPan = ptCur;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (find_link(ep->v.mouse.where) != NULL)
|
||||||
|
xvt_win_set_cursor(win, 8004); // Ditino
|
||||||
|
else
|
||||||
|
xvt_win_set_cursor(win, CURSOR_ARROW); // Freccia
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case E_MOUSE_DOWN:
|
case E_MOUSE_DOWN:
|
||||||
if (ep->v.mouse.button == 0)
|
switch (ep->v.mouse.button)
|
||||||
{
|
{
|
||||||
const TReport_link* lnk = find_link(ep->v.mouse.where);
|
case 0:
|
||||||
if (lnk != NULL && _book != NULL)
|
{
|
||||||
_book->on_link(*lnk);
|
const TReport_link* lnk = find_link(ep->v.mouse.where);
|
||||||
}
|
if (lnk != NULL && _book != NULL)
|
||||||
else
|
_book->on_link(*lnk);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
popup_menu(ep);
|
popup_menu(ep);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ptPan = ep->v.mouse.where;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case E_COMMAND:
|
case E_COMMAND:
|
||||||
{
|
{
|
||||||
|
@ -1823,7 +1823,7 @@ TAuto_token_string& TAuto_token_string::create(const char* ts)
|
|||||||
// Calcola il separatore
|
// Calcola il separatore
|
||||||
for (const char* s = ts; s && *s; s++)
|
for (const char* s = ts; s && *s; s++)
|
||||||
{
|
{
|
||||||
if (strchr("|?\t\n^;,!&+", *s) != NULL)
|
if (strchr("|¦?\t\n^;,!&+", *s) != NULL)
|
||||||
{
|
{
|
||||||
separator(*s);
|
separator(*s);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user