diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 2d9bc93ccddc..24e31b69b66d 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -30,10 +30,6 @@ #include <svx/txenctab.hxx> #include <unotools/sharedunocomponent.hxx> -#if HAVE_FEATURE_DBCONNECTIVITY -#include <svx/dbcharsethelper.hxx> -#endif - #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/SQLException.hpp> @@ -124,26 +120,13 @@ namespace OUString aConnUrl("sdbc:dbase:"); aConnUrl += aPath; - ::std::vector< rtl_TextEncoding > aEncodings; - svxform::charset_helper::getSupportedTextEncodings( aEncodings ); - ::std::vector< rtl_TextEncoding >::iterator aIter = ::std::find(aEncodings.begin(),aEncodings.end(), eCharSet); - if ( aIter == aEncodings.end() ) - { - OSL_FAIL( "DBaseImport: dbtools::OCharsetMap doesn't know text encoding" ); - return SCERR_IMPORT_CONNECT; - } // if ( aIter == aMap.end() ) - OUString aCharSetStr; - if ( RTL_TEXTENCODING_DONTKNOW != *aIter ) - { // it's not the virtual "system charset" - const char* pIanaName = rtl_getMimeCharsetFromTextEncoding( *aIter ); - OSL_ENSURE( pIanaName, "invalid mime name!" ); - if ( pIanaName ) - aCharSetStr = OUString::createFromAscii( pIanaName ); - } - + // sdbc:dbase is based on the css.sdbc.FILEConnectionProperties UNOIDL service, so we can + // transport the raw rtl_TextEncoding value instead of having to translate it into a IANA + // character set name string (which might not exist for certain eCharSet values, like + // RTL_TEXTENCODING_MS_950): uno::Sequence<beans::PropertyValue> aProps( comphelper::InitPropertySequence({ { SC_DBPROP_EXTENSION, uno::Any(aExtension) }, - { SC_DBPROP_CHARSET, uno::Any(aCharSetStr) } + { SC_DBPROP_CHARSET, uno::Any(eCharSet) } })); _rConnection = _rDrvMgr->getConnectionWithInfo( aConnUrl, aProps ); |