Kaydet (Commit) 9fe96856 authored tarafından Julien Nabet's avatar Julien Nabet

tdf#55631: DBASE import with CP850 encoding

Don't consider RTL_TEXTENCODING_IBM_850 as RTL_TEXTENCODING_DONTKNOW
partially reverts https://cgit.freedesktop.org/libreoffice/core/commit/?id=b00c4ec0967f8712d721b31ccb2dd0778c9e973b)

Indeed DBaseImport method is only called from ScDocShell::ConvertFrom (sc/source/ui/docshell/docsh.cxx)
it calls it with "ScGlobal::GetCharsetValue(sItStr)"
sItStr is initialized with these lines:
   1272             if ( pSet && SfxItemState::SET ==
   1273                  pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
   1274             {
   1275                 sItStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
   1276             }
   1277
   1278             if (sItStr.isEmpty())
   1279             {
   1280                 //  default for dBase import (from API without options):
   1281                 //  IBM_850 encoding
   1282
   1283                 sItStr = ScGlobal::GetCharsetString( RTL_TEXTENCODING_IBM_850 );
   1284             }

In our case, Calc asks for encoding and we provide RTL_TEXTENCODING_IBM_850
so we're not even sure sItStr could be empty after the first if

Change-Id: I023b89a98d6430300ac147353ad6cbed1f2d3410
Reviewed-on: https://gerrit.libreoffice.org/38620Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst a680f698
......@@ -301,10 +301,6 @@ sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncodi
sal_uLong nErr = ERRCODE_NONE;
// Try to get the Text Encoding from the driver
if( eCharSet == RTL_TEXTENCODING_IBM_850 )
eCharSet = RTL_TEXTENCODING_DONTKNOW;
try
{
long i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment