From c8057f9baae4fdbdf9798dde13530bafab4fcc56 Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Sun, 4 Jan 2004 20:20:14 +0000 Subject: [PATCH] Changed WriteStyledEditFile to be able to write plain text files on volumes that don't support attributes. Contributed by Andrew Bachmann git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5904 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/translation/TranslationUtils.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/kits/translation/TranslationUtils.cpp b/src/kits/translation/TranslationUtils.cpp index 84cd08ec7f..9f6c67de64 100644 --- a/src/kits/translation/TranslationUtils.cpp +++ b/src/kits/translation/TranslationUtils.cpp @@ -721,6 +721,19 @@ BTranslationUtils::WriteStyledEditFile(BTextView *fromView, BFile *intoFile) result = intoFile->SetSize(textLength); if (result != B_OK) return result; + + // get the BVolume that this file is on and + // check the volume for the attribute support + node_ref nref; + result = intoFile->GetNodeRef(&nref); + if (result != B_OK) + return result; + BVolume volume(nref.device); + result = volume.InitCheck(); + if (result != B_OK) + return result; + if (!volume.KnowsAttr()) + return B_OK; // Write attributes // BEOS:TYPE