From 7b93487d2d41ed4864221ba54fe4b4570e69dee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 23 Jan 2007 21:15:07 +0000 Subject: [PATCH] I accidently prevented the STXTTranslator from adding the styles section to the styled text output. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19932 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/translators/stxt/STXTTranslator.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/add-ons/translators/stxt/STXTTranslator.cpp b/src/add-ons/translators/stxt/STXTTranslator.cpp index c51de576d0..f62bc9bd1c 100644 --- a/src/add-ons/translators/stxt/STXTTranslator.cpp +++ b/src/add-ons/translators/stxt/STXTTranslator.cpp @@ -1233,9 +1233,10 @@ translate_from_text(BPositionIO* source, const char* encoding, bool forceEncodin } } while (bytesRead > 0); - if (outType == B_STYLED_TEXT_FORMAT) { - if (encodingBuffer.Size() == 0 || size == outputSize) - return B_OK; + if (outType != B_STYLED_TEXT_FORMAT) + return B_OK; + + if (encodingBuffer.Size() != 0 && size != outputSize) { if (outputSize > UINT32_MAX) return B_NOT_SUPPORTED; @@ -1243,8 +1244,11 @@ translate_from_text(BPositionIO* source, const char* encoding, bool forceEncodin status = destination->Seek(0, SEEK_SET); if (status == B_OK) status = output_headers(destination, (uint32)outputSize); + if (status == B_OK) + status = destination->Seek(0, SEEK_END); - return status; + if (status < B_OK) + return status; } // Read file attributes if outputting styled data