Kaydet (Commit) b6ca3a82 authored tarafından Takeshi Abe's avatar Takeshi Abe

Use defined macro instead of magic number

This also added a missing READONLY entry
üst 7f585002
...@@ -116,6 +116,7 @@ struct SbiGosubStack { // GOSUB-Stack: ...@@ -116,6 +116,7 @@ struct SbiGosubStack { // GOSUB-Stack:
#define MAXRECURSION 500 #define MAXRECURSION 500
#define Sb_ATTR_NORMAL 0x0000 #define Sb_ATTR_NORMAL 0x0000
#define Sb_ATTR_READONLY 0x0001
#define Sb_ATTR_HIDDEN 0x0002 #define Sb_ATTR_HIDDEN 0x0002
#define Sb_ATTR_SYSTEM 0x0004 #define Sb_ATTR_SYSTEM 0x0004
#define Sb_ATTR_VOLUME 0x0008 #define Sb_ATTR_VOLUME 0x0008
......
...@@ -2877,11 +2877,11 @@ RTLFUNC(GetAttr) ...@@ -2877,11 +2877,11 @@ RTLFUNC(GetAttr)
sal_Bool bHidden = xSFI->isHidden( aPath ); sal_Bool bHidden = xSFI->isHidden( aPath );
sal_Bool bDirectory = xSFI->isFolder( aPath ); sal_Bool bDirectory = xSFI->isFolder( aPath );
if( bReadOnly ) if( bReadOnly )
nFlags |= 0x0001; // ATTR_READONLY nFlags |= Sb_ATTR_READONLY;
if( bHidden ) if( bHidden )
nFlags |= 0x0002; // ATTR_HIDDEN nFlags |= Sb_ATTR_HIDDEN;
if( bDirectory ) if( bDirectory )
nFlags |= 0x0010; // ATTR_DIRECTORY nFlags |= Sb_ATTR_DIRECTORY;
} }
catch(const Exception & ) catch(const Exception & )
{ {
...@@ -2901,9 +2901,9 @@ RTLFUNC(GetAttr) ...@@ -2901,9 +2901,9 @@ RTLFUNC(GetAttr)
FileStatus::Type aType = aFileStatus.getFileType(); FileStatus::Type aType = aFileStatus.getFileType();
sal_Bool bDirectory = isFolder( aType ); sal_Bool bDirectory = isFolder( aType );
if( bReadOnly ) if( bReadOnly )
nFlags |= 0x0001; // ATTR_READONLY nFlags |= Sb_ATTR_READONLY;
if( bDirectory ) if( bDirectory )
nFlags |= 0x0010; // ATTR_DIRECTORY nFlags |= Sb_ATTR_DIRECTORY;
} }
rPar.Get(0)->PutInteger( nFlags ); rPar.Get(0)->PutInteger( nFlags );
} }
...@@ -4259,9 +4259,9 @@ RTLFUNC(SetAttr) ...@@ -4259,9 +4259,9 @@ RTLFUNC(SetAttr)
{ {
try try
{ {
sal_Bool bReadOnly = (nFlags & 0x0001) != 0; // ATTR_READONLY sal_Bool bReadOnly = (nFlags & Sb_ATTR_READONLY) != 0;
xSFI->setReadOnly( aStr, bReadOnly ); xSFI->setReadOnly( aStr, bReadOnly );
sal_Bool bHidden = (nFlags & 0x0002) != 0; // ATTR_HIDDEN sal_Bool bHidden = (nFlags & Sb_ATTR_HIDDEN) != 0;
xSFI->setHidden( aStr, bHidden ); xSFI->setHidden( aStr, bHidden );
} }
catch(const Exception & ) catch(const Exception & )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment