sw/inc/iodetect.hxx                  |    2 --
 sw/source/filter/basflt/iodetect.cxx |    4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 4f3b6eac84e0a5381f6a9637d29418ae9353deb5
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Mon Jan 31 11:19:18 2022 +0100
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Mon Jan 31 14:23:08 2022 +0100

    tdf#106899 - Remove header definition of buffer size
    
    Change-Id: Ia7e3cc32c067afa0f376e52e0eb5cdc83ca2e4b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129082
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>

diff --git a/sw/inc/iodetect.hxx b/sw/inc/iodetect.hxx
index 7deb65fcdd91..1441815877b7 100644
--- a/sw/inc/iodetect.hxx
+++ b/sw/inc/iodetect.hxx
@@ -28,8 +28,6 @@
 #include <tools/solar.h>
 #include "swdllapi.h"
 
-#define DETECT_ENCODING_BUFFER_SIZE 4096
-
 inline constexpr OUStringLiteral FILTER_RTF = u"RTF";       ///< RTF filter
 inline constexpr OUStringLiteral sRtfWH = u"WH_RTF";
 inline constexpr OUStringLiteral FILTER_TEXT = u"TEXT"; ///< text filter with 
default codeset
diff --git a/sw/source/filter/basflt/iodetect.cxx 
b/sw/source/filter/basflt/iodetect.cxx
index 44f0a492833a..9e80ade94244 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -242,8 +242,8 @@ std::shared_ptr<const SfxFilter> 
SwIoSystem::GetFileFilter(const OUString& rFile
 rtl_TextEncoding SwIoSystem::GetTextEncoding(SvStream& rStrm)
 {
     sal_Size nLen, nOrig;
-    char aBuf[DETECT_ENCODING_BUFFER_SIZE];
-    nOrig = nLen = rStrm.ReadBytes(aBuf, DETECT_ENCODING_BUFFER_SIZE);
+    char aBuf[4096];
+    nOrig = nLen = rStrm.ReadBytes(aBuf, sizeof(aBuf));
 
     rtl_TextEncoding eCharSet;
     const bool bRet = SwIoSystem::IsDetectableText(aBuf, nLen, &eCharSet, 
nullptr, nullptr, nullptr);

Reply via email to