Author: axeld Date: 2010-05-07 09:48:17 +0200 (Fri, 07 May 2010) New Revision: 36705 Changeset: http://dev.haiku-os.org/changeset/36705/haiku Modified: haiku/trunk/src/apps/stylededit/StyledEditWindow.cpp Log: * Adapted to Ingo's suggestions: used a more descriptive attribute name, got rid of the superfluous fSaveMessage check in LoadAttrs(). * Also made the attribute name a proper const variable, and renamed it to kInfoAttributeName. Modified: haiku/trunk/src/apps/stylededit/StyledEditWindow.cpp =================================================================== --- haiku/trunk/src/apps/stylededit/StyledEditWindow.cpp 2010-05-07 05:17:43 UTC (rev 36704) +++ haiku/trunk/src/apps/stylededit/StyledEditWindow.cpp 2010-05-07 07:48:17 UTC (rev 36705) @@ -47,8 +47,8 @@ const float kLineViewWidth = 30.0; +const char* kInfoAttributeName = "StyledEdit-info"; -#define ATTRNAME_SE_INFO "se-info" #undef TR_CONTEXT #define TR_CONTEXT "StyledEditWindow" @@ -348,9 +348,6 @@ void StyledEditWindow::LoadAttrs() { - if (!fSaveMessage) - return; - entry_ref dir; const char* name; if (fSaveMessage->FindRef("directory", &dir) != B_OK @@ -365,7 +362,7 @@ return; BRect newFrame; - ssize_t bytesRead = documentNode.ReadAttr(ATTRNAME_SE_INFO, B_RECT_TYPE, + ssize_t bytesRead = documentNode.ReadAttr(kInfoAttributeName, B_RECT_TYPE, 0, &newFrame, sizeof(BRect)); if (bytesRead != sizeof(BRect)) return; @@ -404,7 +401,7 @@ BRect frame(Frame()); swap_data(B_RECT_TYPE, &frame, sizeof(BRect), B_SWAP_HOST_TO_BENDIAN); - documentNode.WriteAttr(ATTRNAME_SE_INFO, B_RECT_TYPE, 0, &frame, + documentNode.WriteAttr(kInfoAttributeName, B_RECT_TYPE, 0, &frame, sizeof(BRect)); }