diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-01-29 00:44:01 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-01-29 01:17:26 +0900 |
commit | b6ca3a8287ac10c6877d5e7dd43622dbd138cde5 (patch) | |
tree | a701ccf53b2622ff092c0c6b9c4ec127e31d110c /basic/source | |
parent | 7f585002c460a095693eeec4453b869b3915118b (diff) |
Use defined macro instead of magic number
This also added a missing READONLY entry
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/inc/runtime.hxx | 1 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index 890b658f0b33..8c9064d333cc 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -116,6 +116,7 @@ struct SbiGosubStack { // GOSUB-Stack: #define MAXRECURSION 500 #define Sb_ATTR_NORMAL 0x0000 +#define Sb_ATTR_READONLY 0x0001 #define Sb_ATTR_HIDDEN 0x0002 #define Sb_ATTR_SYSTEM 0x0004 #define Sb_ATTR_VOLUME 0x0008 diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index e457b2e2e8f1..efcf67ffd5cd 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2877,11 +2877,11 @@ RTLFUNC(GetAttr) sal_Bool bHidden = xSFI->isHidden( aPath ); sal_Bool bDirectory = xSFI->isFolder( aPath ); if( bReadOnly ) - nFlags |= 0x0001; // ATTR_READONLY + nFlags |= Sb_ATTR_READONLY; if( bHidden ) - nFlags |= 0x0002; // ATTR_HIDDEN + nFlags |= Sb_ATTR_HIDDEN; if( bDirectory ) - nFlags |= 0x0010; // ATTR_DIRECTORY + nFlags |= Sb_ATTR_DIRECTORY; } catch(const Exception & ) { @@ -2901,9 +2901,9 @@ RTLFUNC(GetAttr) FileStatus::Type aType = aFileStatus.getFileType(); sal_Bool bDirectory = isFolder( aType ); if( bReadOnly ) - nFlags |= 0x0001; // ATTR_READONLY + nFlags |= Sb_ATTR_READONLY; if( bDirectory ) - nFlags |= 0x0010; // ATTR_DIRECTORY + nFlags |= Sb_ATTR_DIRECTORY; } rPar.Get(0)->PutInteger( nFlags ); } @@ -4259,9 +4259,9 @@ RTLFUNC(SetAttr) { try { - sal_Bool bReadOnly = (nFlags & 0x0001) != 0; // ATTR_READONLY + sal_Bool bReadOnly = (nFlags & Sb_ATTR_READONLY) != 0; xSFI->setReadOnly( aStr, bReadOnly ); - sal_Bool bHidden = (nFlags & 0x0002) != 0; // ATTR_HIDDEN + sal_Bool bHidden = (nFlags & Sb_ATTR_HIDDEN) != 0; xSFI->setHidden( aStr, bHidden ); } catch(const Exception & ) |