diff options
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/dbgui/asciiopt.cxx | 228 | ||||
-rw-r--r-- | sc/source/ui/dbgui/asciiopt.src | 15 | ||||
-rw-r--r-- | sc/source/ui/dbgui/imoptdlg.cxx | 137 | ||||
-rw-r--r-- | sc/source/ui/dbgui/imoptdlg.hrc | 5 | ||||
-rw-r--r-- | sc/source/ui/dbgui/imoptdlg.src | 68 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 104 | ||||
-rw-r--r-- | sc/source/ui/inc/asciiopt.hxx | 17 | ||||
-rw-r--r-- | sc/source/ui/inc/imoptdlg.hxx | 26 | ||||
-rw-r--r-- | sc/source/ui/src/scstring.src | 44 |
9 files changed, 190 insertions, 454 deletions
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index f3cfd10a5aeb..88ce69d6943a 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: asciiopt.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:44:53 $ + * last change: $Author: er $ $Date: 2000-12-20 12:16:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,10 +65,6 @@ #pragma hdrstop -#ifndef PCH -#include "segmentc.hxx" -#endif - #include "global.hxx" #include "scresid.hxx" #include "impex.hxx" @@ -76,6 +72,9 @@ #include "asciiopt.hrc" #include <vcl/system.hxx> +#ifndef _RTL_TENCINFO_H +#include <rtl/tencinfo.h> +#endif //------------------------------------------------------------------------ @@ -95,20 +94,6 @@ static const sal_Char __FAR_DATA pStrFix[] = "FIX"; static const sal_Char __FAR_DATA pStrMrg[] = "MRG"; -// Liste der CharSet-Werte passend zum String SCSTR_CHARSET_USER - -static CharSet eCharSetList[] = - { RTL_TEXTENCODING_MS_1252, // "Ansi" - RTL_TEXTENCODING_APPLE_ROMAN, // "Mac" - RTL_TEXTENCODING_IBM_850, // "IBMPC" - RTL_TEXTENCODING_IBM_437, // "IBMPC (437)" - RTL_TEXTENCODING_IBM_850, // "IBMPC (850)" - RTL_TEXTENCODING_IBM_860, // "IBMPC (860)" - RTL_TEXTENCODING_IBM_861, // "IBMPC (861)" - RTL_TEXTENCODING_IBM_863, // "IBMPC (863)" - RTL_TEXTENCODING_IBM_865, // "IBMPC (865)" - RTL_TEXTENCODING_DONTKNOW }; // "System" (handled in GetCharSetFromList) - // Liste der Spaltentypen passend zum String SCSTR_COLUMN_USER @@ -117,39 +102,7 @@ static BYTE nColTypeList[] = SC_COL_ENGLISH, SC_COL_SKIP }; -SEG_EOFGLOBALS() - -#pragma SEG_FUNCDEF(asciiopt_07) - -String lcl_GetCharsetString(CharSet eCharSet) //! nach global oder so verschieben -{ - const sal_Char* pChar; - switch (eCharSet) - { - case RTL_TEXTENCODING_MS_1252: pChar = "ANSI"; break; - case RTL_TEXTENCODING_APPLE_ROMAN: pChar = "MAC"; break; - // IBMPC == IBMPC_850 - case RTL_TEXTENCODING_IBM_437: pChar = "IBMPC_437"; break; - case RTL_TEXTENCODING_IBM_850: pChar = "IBMPC_850"; break; - case RTL_TEXTENCODING_IBM_860: pChar = "IBMPC_860"; break; - case RTL_TEXTENCODING_IBM_861: pChar = "IBMPC_861"; break; - case RTL_TEXTENCODING_IBM_863: pChar = "IBMPC_863"; break; - case RTL_TEXTENCODING_IBM_865: pChar = "IBMPC_865"; break; - default: pChar = "SYSTEM"; break; - } - return String::CreateFromAscii(pChar); -} - -CharSet lcl_GetCharSetFromList( USHORT nPos ) -{ - CharSet eRet = eCharSetList[nPos]; - if (eRet == RTL_TEXTENCODING_DONTKNOW) - eRet = gsl_getSystemTextEncoding(); - return eRet; -} - //------------------------------------------------------------------------ -#pragma SEG_FUNCDEF(asciiopt_01) ScAsciiOptions::ScAsciiOptions() : bFixedLen ( FALSE ), @@ -157,6 +110,7 @@ ScAsciiOptions::ScAsciiOptions() : bMergeFieldSeps ( FALSE ), cTextSep ( 34 ), eCharSet ( gsl_getSystemTextEncoding() ), + bCharSetSystem ( FALSE ), nStartRow ( 1 ), nInfoCount ( 0 ), pColStart ( NULL ), @@ -164,7 +118,6 @@ ScAsciiOptions::ScAsciiOptions() : { } -#pragma SEG_FUNCDEF(asciiopt_02) ScAsciiOptions::ScAsciiOptions(const ScAsciiOptions& rOpt) : bFixedLen ( rOpt.bFixedLen ), @@ -172,6 +125,7 @@ ScAsciiOptions::ScAsciiOptions(const ScAsciiOptions& rOpt) : bMergeFieldSeps ( rOpt.bMergeFieldSeps ), cTextSep ( rOpt.cTextSep ), eCharSet ( rOpt.eCharSet ), + bCharSetSystem ( rOpt.bCharSetSystem ), nStartRow ( rOpt.nStartRow ), nInfoCount ( rOpt.nInfoCount ) { @@ -192,7 +146,6 @@ ScAsciiOptions::ScAsciiOptions(const ScAsciiOptions& rOpt) : } } -#pragma SEG_FUNCDEF(asciiopt_03) ScAsciiOptions::~ScAsciiOptions() { @@ -200,7 +153,6 @@ ScAsciiOptions::~ScAsciiOptions() delete[] pColFormat; } -#pragma SEG_FUNCDEF(asciiopt_0a) void ScAsciiOptions::SetColInfo( USHORT nCount, const xub_StrLen* pStart, const BYTE* pFormat ) { @@ -226,7 +178,6 @@ void ScAsciiOptions::SetColInfo( USHORT nCount, const xub_StrLen* pStart, const } } -#pragma SEG_FUNCDEF(asciiopt_04) ScAsciiOptions& ScAsciiOptions::operator=( const ScAsciiOptions& rCpy ) { @@ -237,12 +188,12 @@ ScAsciiOptions& ScAsciiOptions::operator=( const ScAsciiOptions& rCpy ) bMergeFieldSeps = rCpy.bMergeFieldSeps; cTextSep = rCpy.cTextSep; eCharSet = rCpy.eCharSet; + bCharSetSystem = rCpy.bCharSetSystem; nStartRow = rCpy.nStartRow; return *this; } -#pragma SEG_FUNCDEF(asciiopt_08) BOOL ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const { @@ -251,6 +202,7 @@ BOOL ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const bMergeFieldSeps == rCmp.bMergeFieldSeps && cTextSep == rCmp.cTextSep && eCharSet == rCmp.eCharSet && + bCharSetSystem == rCmp.bCharSetSystem && nStartRow == rCmp.nStartRow && nInfoCount == rCmp.nInfoCount ) { @@ -271,7 +223,6 @@ BOOL ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const // darum ab Version 336 Komma stattdessen // -#pragma SEG_FUNCDEF(asciiopt_05) void ScAsciiOptions::ReadFromString( const String& rString ) { @@ -325,7 +276,7 @@ void ScAsciiOptions::ReadFromString( const String& rString ) if ( nCount >= 3 ) { aToken = rString.GetToken(2,','); - eCharSet = GetCharsetValue( aToken ); + eCharSet = ScGlobal::GetCharsetValue( aToken ); } // @@ -368,7 +319,6 @@ void ScAsciiOptions::ReadFromString( const String& rString ) } } -#pragma SEG_FUNCDEF(asciiopt_06) String ScAsciiOptions::WriteToString() const { @@ -411,7 +361,10 @@ String ScAsciiOptions::WriteToString() const // Zeichensatz // - aOutStr += lcl_GetCharsetString( eCharSet ); + if ( bCharSetSystem ) // force "SYSTEM" + aOutStr += ScGlobal::GetCharsetString( RTL_TEXTENCODING_DONTKNOW ); + else + aOutStr += ScGlobal::GetCharsetString( eCharSet ); aOutStr += ','; // Token-Ende // @@ -441,7 +394,6 @@ String ScAsciiOptions::WriteToString() const #if 0 // Code, um die Spalten-Liste aus einem Excel-kompatiblen String zu erzeugen: // (im Moment nicht benutzt) -#pragma SEG_FUNCDEF(asciiopt_09) void ScAsciiOptions::InterpretColumnList( const String& rString ) { @@ -517,7 +469,6 @@ void ScAsciiOptions::InterpretColumnList( const String& rString ) //------------------------------------------------------------------------ -#pragma SEG_FUNCDEF(asciiopt_0b) void lcl_FillCombo( ComboBox& rCombo, const String& rList, sal_Unicode cSelect ) { @@ -539,7 +490,6 @@ void lcl_FillCombo( ComboBox& rCombo, const String& rList, sal_Unicode cSelect ) } } -#pragma SEG_FUNCDEF(asciiopt_0c) sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const String& rList ) { @@ -560,7 +510,6 @@ sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const String& rList ) return c; } -#pragma SEG_FUNCDEF(asciiopt_0d) ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, SvStream* pInStream, sal_Unicode cSep ) : @@ -581,6 +530,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, aTableBox ( this, ScResId( CTR_TABLE ) ), aFtCharSet ( this, ScResId( FT_CHARSET ) ), aLbCharSet ( this, ScResId( LB_CHARSET ) ), + bCharSetSystem ( FALSE ), aGbSepOpt ( this, ScResId( GB_SEPOPT ) ), aFtTextSep ( this, ScResId( FT_TEXTSEP ) ), aCbTextSep ( this, ScResId( CB_TEXTSEP ) ), @@ -689,21 +639,25 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, aTableBox.SetSelectionHdl(LINK( this, ScImportAsciiDlg, SelectHdl )); - // Zeichensatz - Listbox - - xub_StrLen nCount = aCharSetUser.GetTokenCount(); - xub_StrLen i; - for (i=0; i<nCount; i++) - aLbCharSet.InsertEntry(aCharSetUser.GetToken(i)); - aLbCharSet.SelectEntryPos( nCount - 1 ); // "System" ganz hinten + // CharacterSet / TextEncoding - Listbox + + // All TextEncodings but raw Unicode; Unicode would need a special handling + // in preview and import, not ByteString -> UniString but UniString only. + //!TODO: should be implemented though + aLbCharSet.FillFromTextEncodingTable( RTL_TEXTENCODING_INFO_UNICODE, + RTL_TEXTENCODING_INFO_MIME ); + // Insert one "SYSTEM" entry for compatibility in AsciiOptions and system + // independent document linkage. + aLbCharSet.InsertTextEncoding( RTL_TEXTENCODING_DONTKNOW, aCharSetUser ); + aLbCharSet.SelectTextEncoding( gsl_getSystemTextEncoding() ); GetCharSet(); aLbCharSet.SetSelectHdl( LINK( this, ScImportAsciiDlg, CharSetHdl ) ); - // Spaltentyp - Listboxen + // Column type - Listboxes ListBox* pType =&aLbType; - nCount = aColumnUser.GetTokenCount(); - for (i=0; i<nCount; i++) + xub_StrLen nCount = aColumnUser.GetTokenCount(); + for (xub_StrLen i=0; i<nCount; i++) { String aToken = aColumnUser.GetToken(i); pType->InsertEntry(aToken); @@ -734,7 +688,6 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, VarFixHdl(&aRbFixed); } -#pragma SEG_FUNCDEF(asciiopt_0e) ScImportAsciiDlg::~ScImportAsciiDlg() { @@ -744,7 +697,6 @@ ScImportAsciiDlg::~ScImportAsciiDlg() } -#pragma SEG_FUNCDEF(asciiopt_0f) IMPL_LINK( ScImportAsciiDlg, VarFixHdl, void *, pCtr ) { @@ -795,7 +747,6 @@ IMPL_LINK( ScImportAsciiDlg, VarSepHdl, void*, pCtr ) return 0; } -#pragma SEG_FUNCDEF(asciiopt_10) IMPL_LINK( ScImportAsciiDlg, ScrollHdl, void*, pScroll ) { @@ -828,22 +779,18 @@ IMPL_LINK( ScImportAsciiDlg, ScrollHdl, void*, pScroll ) return 0; } -#pragma SEG_FUNCDEF(asciiopt_11) IMPL_LINK( ScImportAsciiDlg, CharSetHdl, void*, EMPTY_ARG ) { if ( aLbCharSet.GetSelectEntryCount() == 1 ) { - USHORT nSel = aLbCharSet.GetSelectEntryPos(); - eCharSet = lcl_GetCharSetFromList(nSel); - + GetCharSet(); CheckValues(); // Preview anpassen } return 0; } -#pragma SEG_FUNCDEF(asciiopt_12) IMPL_LINK( ScImportAsciiDlg, ColTypeHdl, void*, pCtr ) { @@ -852,7 +799,6 @@ IMPL_LINK( ScImportAsciiDlg, ColTypeHdl, void*, pCtr ) return 0; } -#pragma SEG_FUNCDEF(asciiopt_13) IMPL_LINK( ScImportAsciiDlg, SelectHdl, ScTableWithRuler*, pModified ) { @@ -896,7 +842,6 @@ void ScImportAsciiDlg::CheckScrollRange() } } -#pragma SEG_FUNCDEF(asciiopt_14) void ScImportAsciiDlg::CheckValues( BOOL bReadVal, USHORT nEditField ) { @@ -1077,7 +1022,6 @@ void ScImportAsciiDlg::DelimitedPreview() } } -#pragma SEG_FUNCDEF(asciiopt_15) void ScImportAsciiDlg::CheckScrollPos() { @@ -1147,7 +1091,6 @@ void ScImportAsciiDlg::UpdateVertical() } -#pragma SEG_FUNCDEF(asciiopt_16) void ScImportAsciiDlg::CheckColTypes(BOOL bReadVal,void *pCtr) { @@ -1186,7 +1129,6 @@ void ScImportAsciiDlg::CheckColTypes(BOOL bReadVal,void *pCtr) } } -#pragma SEG_FUNCDEF(asciiopt_17) void lcl_DoEnable( Window& rWin, BOOL bEnable ) { @@ -1199,7 +1141,6 @@ void lcl_DoEnable( Window& rWin, BOOL bEnable ) } -#pragma SEG_FUNCDEF(asciiopt_18) void ScImportAsciiDlg::CheckDisable() { @@ -1217,29 +1158,26 @@ void ScImportAsciiDlg::CheckDisable() lcl_DoEnable( aCbTextSep, bVar ); } -#pragma SEG_FUNCDEF(asciiopt_19) void ScImportAsciiDlg::GetCharSet() { - String aUser = aLbCharSet.GetSelectEntry(); - xub_StrLen nPos = 0; - xub_StrLen nCount = aCharSetUser.GetTokenCount(); - for (xub_StrLen i=0; i<nCount; i++) - if ( ScGlobal::pScInternational->CompareEqual( - aUser, aCharSetUser.GetToken(i), INTN_COMPARE_IGNORECASE ) ) - { - nPos = i; - } - eCharSet = lcl_GetCharSetFromList(nPos); + eCharSet = aLbCharSet.GetSelectTextEncoding(); + if ( eCharSet == RTL_TEXTENCODING_DONTKNOW ) + { + eCharSet = gsl_getSystemTextEncoding(); + bCharSetSystem = TRUE; + } + else + bCharSetSystem = FALSE; } -#pragma SEG_FUNCDEF(asciiopt_1a) void ScImportAsciiDlg::GetOptions( ScAsciiOptions& rOpt ) { BOOL bFix = aRbFixed.IsChecked(); rOpt.SetCharSet( eCharSet ); + rOpt.SetCharSetSystem( bCharSetSystem ); rOpt.SetFixedLen( bFix ); USHORT nRow=(USHORT)aNfRow.GetText().ToInt32(); @@ -1314,91 +1252,3 @@ void ScImportAsciiDlg::GetOptions( ScAsciiOptions& rOpt ) } } - -/*------------------------------------------------------------------------ - - $Log: not supported by cvs2svn $ - Revision 1.25 2000/09/17 14:08:55 willem.vandorp - OpenOffice header added. - - Revision 1.24 2000/08/31 16:38:19 willem.vandorp - Header and footer replaced - - Revision 1.23 2000/05/22 18:05:11 nn - DelimitedPreview: right Field len - - Revision 1.22 2000/05/19 18:35:33 nn - CreateFromInt32 - - Revision 1.21 2000/04/28 18:55:41 nn - include - - Revision 1.20 2000/04/14 17:38:02 nn - unicode changes - - Revision 1.19 2000/02/11 12:22:37 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.18 1998/12/02 10:17:56 ANK - #59981# Horizontale Begrenzung aufgehoben - - - Rev 1.17 02 Dec 1998 11:17:56 ANK - #59981# Horizontale Begrenzung aufgehoben - - Rev 1.16 19 Nov 1998 11:48:30 ER - #59519# hmblgrmbl.. BSE und Alzheimer - - Rev 1.15 16 Nov 1998 20:51:54 ER - #59519# DelimitedPreview: letzte Spalte auch anzeigen wenn gerade leer - - Rev 1.14 26 Aug 1998 17:11:36 ANK - #55355# Positionierung nach Umschalten - - Rev 1.13 04 Jul 1998 19:57:22 ER - opt: ScanNextFieldFromString mit const char* statt const String& - - Rev 1.12 23 Jun 1998 22:59:32 NN - US-Englisch in Typ-Liste - - Rev 1.11 08 Jan 1998 16:19:38 ANK - Flackern des Focus beseitigt - - Rev 1.10 18 Dec 1997 15:38:40 ANK - VScroll- Verhalten geaendert - - Rev 1.9 16 Dec 1997 12:09:56 ANK - Anfangszeile geaendert - - Rev 1.8 11 Dec 1997 17:24:22 ANK - Erweiterungen fuer Tabellen-Control - - Rev 1.7 04 Dec 1997 17:20:58 ANK - neue Controls - - Rev 1.6 15 Jul 1997 17:20:50 ER - #41637# 3 Zeilen Preview im Ascii-Import Dialog - - Rev 1.5 07 Jul 1997 17:18:26 NN - #41318# Spaltentyp/Preview auch bei Import mit Feldtrennern - - Rev 1.4 26 Mar 1997 13:05:28 NN - ModifyHdl: Anpassung der benutzten Spalten richtig - - Rev 1.3 29 Oct 1996 14:02:40 NN - ueberall ScResId statt ResId - - Rev 1.2 16 Sep 1996 20:05:00 NN - kein Semikolon in Options-String - - Rev 1.1 05 Jun 1996 15:50:32 NN - ImportAsciiDlg - - Rev 1.0 31 May 1996 19:30:02 NN - Initial revision. - -------------------------------------------------------------------------*/ - -#pragma SEG_EOFMODULE - - diff --git a/sc/source/ui/dbgui/asciiopt.src b/sc/source/ui/dbgui/asciiopt.src index b817a1e748cc..a0df9ee12a6f 100644 --- a/sc/source/ui/dbgui/asciiopt.src +++ b/sc/source/ui/dbgui/asciiopt.src @@ -2,9 +2,9 @@ * * $RCSfile: asciiopt.src,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: kz $ $Date: 2000-12-08 17:58:59 $ + * last change: $Author: er $ $Date: 2000-12-20 12:16:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -230,7 +230,7 @@ ModalDialog RID_SCDLG_ASCII }; FixedText FT_CHARSET { - Pos = MAP_APPFONT ( 139 , 14 ) ; + Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 46 , 10 ) ; Text = "Z~eichensatz" ; Text [ ENGLISH ] = "Charset" ; @@ -258,10 +258,11 @@ ModalDialog RID_SCDLG_ASCII }; ListBox LB_CHARSET { - Pos = MAP_APPFONT ( 186 , 13 ) ; - Size = MAP_APPFONT ( 65 , 61 ) ; + Pos = MAP_APPFONT ( 59 , 13 ) ; + Size = MAP_APPFONT ( 115 , 61 ) ; TabStop = TRUE ; DropDown = TRUE ; + Sort = TRUE; }; GroupBox GB_FIELDOPT { @@ -552,7 +553,7 @@ ModalDialog RID_SCDLG_ASCII }; FixedText FT_AT_ROW { - Pos = MAP_APPFONT ( 12 , 14 ) ; + Pos = MAP_APPFONT ( 182 , 14 ) ; Size = MAP_APPFONT ( 43 , 10 ) ; Text = "Ab ~Zeile" ; Text [ ENGLISH ] = "At Row" ; @@ -582,7 +583,7 @@ ModalDialog RID_SCDLG_ASCII { Border = TRUE ; SVLook = TRUE ; - Pos = MAP_APPFONT ( 56 , 13 ) ; + Pos = MAP_APPFONT ( 226 , 13 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; TabStop = TRUE ; Spin = TRUE ; diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx index e213412b4796..ae377f615525 100644 --- a/sc/source/ui/dbgui/imoptdlg.cxx +++ b/sc/source/ui/dbgui/imoptdlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: imoptdlg.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:44:54 $ + * last change: $Author: er $ $Date: 2000-12-20 12:18:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,15 +65,13 @@ #pragma hdrstop -#ifndef PCH -#include <segmentc.hxx> -#endif - #include "imoptdlg.hxx" #include "scresid.hxx" #include "imoptdlg.hrc" -SEG_EOFGLOBALS() +#ifndef _RTL_TENCINFO_H +#include <rtl/tencinfo.h> +#endif //======================================================================== // ScDelimiterTable @@ -103,7 +101,6 @@ private: }; //------------------------------------------------------------------------ -#pragma SEG_FUNCDEF(imoptdlg_02) USHORT ScDelimiterTable::GetCode( const String& rDel ) const { @@ -128,7 +125,6 @@ USHORT ScDelimiterTable::GetCode( const String& rDel ) const } //------------------------------------------------------------------------ -#pragma SEG_FUNCDEF(imoptdlg_03) String ScDelimiterTable::GetDelimiter( USHORT nCode ) const { @@ -155,12 +151,12 @@ String ScDelimiterTable::GetDelimiter( USHORT nCode ) const //======================================================================== // ScImportOptionsDlg //======================================================================== -#pragma SEG_FUNCDEF(imoptdlg_04) ScImportOptionsDlg::ScImportOptionsDlg( Window* pParent, BOOL bAsciiImport, const ScImportOptions* pOptions, - const String* pStrTitle ) + const String* pStrTitle, + BOOL bMultiByte ) : ModalDialog ( pParent, ScResId( RID_SCDLG_IMPORTOPT ) ), aBtnOk ( this, ScResId( BTN_OK ) ), @@ -172,9 +168,7 @@ ScImportOptionsDlg::ScImportOptionsDlg( Window* pParent, aEdTextSep ( this, ScResId( ED_TEXTSEP ) ), aFtFont ( this, ScResId( FT_FONT ) ), aLbFont ( this, ScResId( bAsciiImport ? DDLB_FONT : LB_FONT ) ), - aGbFieldOpt ( this, ScResId( GB_FIELDOPT ) ), - - aCharKeyList( ScResId( STR_CHARSETKEYS ) ) + aGbFieldOpt ( this, ScResId( GB_FIELDOPT ) ) { // im Ctor-Initializer nicht moeglich (MSC kann das nicht): pFieldSepTab = new ScDelimiterTable( String(ScResId(SCSTR_FIELDSEP)) ); @@ -197,15 +191,19 @@ ScImportOptionsDlg::ScImportOptionsDlg( Window* pParent, aStr = pTextSepTab->NextDel(); } - aLbFont.SelectEntryPos( aLbFont.GetEntryCount()-1 ); aEdFieldSep.SetText( aEdFieldSep.GetEntry(0) ); aEdTextSep.SetText( aEdTextSep.GetEntry(0) ); - if ( pOptions ) - aLbFont.SelectEntry( pOptions->aStrFont ); - if ( !bAsciiImport ) { + //!TODO: Unicode and MultiByte would need work in each filter + // (e.g. think of MultiByte and dBase export field lengths) + if ( bMultiByte ) + aLbFont.FillFromTextEncodingTable( RTL_TEXTENCODING_INFO_UNICODE, + RTL_TEXTENCODING_INFO_MIME ); + else + aLbFont.FillFromTextEncodingTable( RTL_TEXTENCODING_INFO_UNICODE | + RTL_TEXTENCODING_INFO_MULTIBYTE | RTL_TEXTENCODING_INFO_MIME ); aGbFieldOpt.SetText( aFtFont.GetText() ); aFtFieldSep.Hide(); aFtTextSep .Hide(); @@ -234,8 +232,14 @@ ScImportOptionsDlg::ScImportOptionsDlg( Window* pParent, else aEdTextSep.SetText( aStr ); } + //!TODO: raw Unicode would need work in AsciiFilter + aLbFont.FillFromTextEncodingTable( RTL_TEXTENCODING_INFO_UNICODE, + RTL_TEXTENCODING_INFO_MIME ); } + aLbFont.SelectTextEncoding( pOptions ? pOptions->eCharSet : + gsl_getSystemTextEncoding() ); + // optionaler Titel: if ( pStrTitle ) SetText( *pStrTitle ); @@ -244,7 +248,6 @@ ScImportOptionsDlg::ScImportOptionsDlg( Window* pParent, } //------------------------------------------------------------------------ -#pragma SEG_FUNCDEF(imoptdlg_05) __EXPORT ScImportOptionsDlg::~ScImportOptionsDlg() { @@ -253,17 +256,10 @@ __EXPORT ScImportOptionsDlg::~ScImportOptionsDlg() } //------------------------------------------------------------------------ -#pragma SEG_FUNCDEF(imoptdlg_06) void ScImportOptionsDlg::GetImportOptions( ScImportOptions& rOptions ) const { - USHORT nKeyIdx = aLbFont.GetEntryCount()-1; - - if ( aLbFont.GetSelectEntryCount() != 0 ) - nKeyIdx = aLbFont.GetSelectEntryPos(); - - rOptions.aStrFont = aCharKeyList.GetToken( nKeyIdx ); - rOptions.eCharSet = (CharSet)((long)aLbFont.GetEntryData( nKeyIdx )); + rOptions.SetTextEncoding( aLbFont.GetSelectTextEncoding() ); if ( aFtFieldSep.IsEnabled() ) { @@ -273,7 +269,6 @@ void ScImportOptionsDlg::GetImportOptions( ScImportOptions& rOptions ) const } //------------------------------------------------------------------------ -#pragma SEG_FUNCDEF(imoptdlg_07) USHORT ScImportOptionsDlg::GetCodeFromCombo( const ComboBox& rEd ) const { @@ -305,7 +300,6 @@ USHORT ScImportOptionsDlg::GetCodeFromCombo( const ComboBox& rEd ) const // Der Options-String darf kein Semikolon mehr enthalten (wegen Pickliste) // darum ab Version 336 Komma stattdessen -#pragma SEG_FUNCDEF(imoptdlg_08) ScImportOptions::ScImportOptions( const String& rStr ) { @@ -314,12 +308,11 @@ ScImportOptions::ScImportOptions( const String& rStr ) nFieldSepCode = (USHORT) rStr.GetToken(0,',').ToInt32(); nTextSepCode = (USHORT) rStr.GetToken(1,',').ToInt32(); aStrFont = rStr.GetToken(2,','); - eCharSet = GetCharsetValue(aStrFont); + eCharSet = ScGlobal::GetCharsetValue(aStrFont); } } //------------------------------------------------------------------------ -#pragma SEG_FUNCDEF(imoptdlg_0a) String ScImportOptions::BuildString() const { @@ -335,84 +328,10 @@ String ScImportOptions::BuildString() const } //------------------------------------------------------------------------ -#pragma SEG_FUNCDEF(imoptdlg_09) -String ScImportOptions::BuildParaString( const String& rTyp, const String& rDsn ) const +void ScImportOptions::SetTextEncoding( rtl_TextEncoding nEnc ) { - String aResult; - - aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM("Typ=")); - aResult += rTyp; - aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM(";Dsn=")); - aResult += rDsn; - aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM(";Charset=")); - aResult += aStrFont; - aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM(";del=")); - aResult += (sal_Unicode)nFieldSepCode; - aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM(";strdel=")); - aResult += (sal_Unicode)nTextSepCode; - aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM(";deleted;HDR;")); - - return aResult; + eCharSet = (nEnc == RTL_TEXTENCODING_DONTKNOW ? + gsl_getSystemTextEncoding() : nEnc); + aStrFont = ScGlobal::GetCharsetString( nEnc ); } - - -/*------------------------------------------------------------------------ - - $Log: not supported by cvs2svn $ - Revision 1.16 2000/09/17 14:08:56 willem.vandorp - OpenOffice header added. - - Revision 1.15 2000/08/31 16:38:20 willem.vandorp - Header and footer replaced - - Revision 1.14 2000/04/14 17:38:03 nn - unicode changes - - Revision 1.13 1997/12/05 18:55:10 ANK - Includes geaendert - - - Rev 1.12 05 Dec 1997 19:55:10 ANK - Includes geaendert - - Rev 1.11 29 Oct 1996 14:03:36 NN - ueberall ScResId statt ResId - - Rev 1.10 16 Sep 1996 20:05:00 NN - kein Semikolon in Options-String - - Rev 1.9 05 Jun 1996 15:49:34 NN - STR_FIELD/TEXTSEP jetzt SCSTR... - - Rev 1.8 15 Jan 1996 11:45:20 NN - #24293# String mit Ascii-Codes, #24246# leere Trenner erlauben - - Rev 1.7 07 Dec 1995 17:22:32 MO - Cancel wieder aktiviert, GrabFocus auf Lb im Non-ASCII Modus - - Rev 1.6 06 Dec 1995 14:11:48 MO - bei nicht-ASCII-Import nur FontListBox (BugId: 21193) - - Rev 1.5 19 Nov 1995 11:54:46 OG - pragma korrigiert - - Rev 1.4 15 Nov 1995 16:44:08 JN - Optimierungen - - Rev 1.3 16 Oct 1995 19:19:38 JN - richtigen Zeichensatz ausgeben - - Rev 1.2 28 Jul 1995 10:27:32 MO - Feldtrenner-Delimiter auf TAB geandert - - Rev 1.1 28 Jul 1995 09:33:46 MO - Dialog-Titel als optionalen Parameter - - Rev 1.0 20 Jul 1995 15:33:24 MO - Initial revision. - ------------------------------------------------------------------------- */ - -#pragma SEG_EOFMODULE - diff --git a/sc/source/ui/dbgui/imoptdlg.hrc b/sc/source/ui/dbgui/imoptdlg.hrc index 5dfc2e3f4152..45a12771d6e9 100644 --- a/sc/source/ui/dbgui/imoptdlg.hrc +++ b/sc/source/ui/dbgui/imoptdlg.hrc @@ -2,9 +2,9 @@ * * $RCSfile: imoptdlg.hrc,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:44:54 $ + * last change: $Author: er $ $Date: 2000-12-20 12:18:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,5 +73,4 @@ #define DDLB_FONT 9 #define LB_FONT 10 #define GB_FIELDOPT 11 -#define STR_CHARSETKEYS 14 diff --git a/sc/source/ui/dbgui/imoptdlg.src b/sc/source/ui/dbgui/imoptdlg.src index 93c59a5eef31..d286d21fc89e 100644 --- a/sc/source/ui/dbgui/imoptdlg.src +++ b/sc/source/ui/dbgui/imoptdlg.src @@ -2,9 +2,9 @@ * * $RCSfile: imoptdlg.src,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: kz $ $Date: 2000-12-08 18:04:03 $ + * last change: $Author: er $ $Date: 2000-12-20 12:18:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,30 +62,12 @@ #include "imoptdlg.hrc" -//! modify CharSet handling like in asciiopt - -#define FONTLISTBOX \ - Border = TRUE; \ - StringList = { \ - < "Ansi"; 1; >; \ - < "Mac"; 2; >; \ - < "IBMPC"; 4; >; \ - < "IBMPC (437)"; 3; >; \ - < "IBMPC (850)"; 4; >; \ - < "IBMPC (860)"; 5; >; \ - < "IBMPC (861)"; 6; >; \ - < "IBMPC (863)"; 7; >; \ - < "IBMPC (865)"; 8; >; \ - < "System"; 9; >; \ - }; - - ModalDialog RID_SCDLG_IMPORTOPT { HelpId = HID_SC_INPORTOPT ; OutputSize = TRUE ; SVLook = TRUE ; - Size = MAP_APPFONT ( 196 , 77 ) ; + Size = MAP_APPFONT ( 256 , 77 ) ; Moveable = TRUE ; Closeable = FALSE ; Text = "Datei Importieren" ; @@ -103,7 +85,7 @@ ModalDialog RID_SCDLG_IMPORTOPT Text [ english_us ] = "Import File" ; FixedText FT_FIELDSEP { - Pos = MAP_APPFONT ( 12 , 16 ) ; + Pos = MAP_APPFONT ( 12 , 35 ) ; Size = MAP_APPFONT ( 55 , 10 ) ; Text = "~Feldtrenner" ; Text [ ENGLISH ] = "~Field delimiter" ; @@ -131,13 +113,13 @@ ModalDialog RID_SCDLG_IMPORTOPT }; ComboBox ED_FIELDSEP { - Pos = MAP_APPFONT ( 70 , 14 ) ; - Size = MAP_APPFONT ( 60 , 60 ) ; + Pos = MAP_APPFONT ( 70 , 33 ) ; + Size = MAP_APPFONT ( 120 , 60 ) ; DropDown = TRUE ; }; FixedText FT_TEXTSEP { - Pos = MAP_APPFONT ( 12 , 35 ) ; + Pos = MAP_APPFONT ( 12 , 53 ) ; Size = MAP_APPFONT ( 55 , 10 ) ; Text = "~Texttrenner" ; Text [ ENGLISH ] = "~Text delimiter" ; @@ -165,13 +147,13 @@ ModalDialog RID_SCDLG_IMPORTOPT }; ComboBox ED_TEXTSEP { - Pos = MAP_APPFONT ( 70 , 33 ) ; - Size = MAP_APPFONT ( 60 , 60 ) ; + Pos = MAP_APPFONT ( 70 , 51 ) ; + Size = MAP_APPFONT ( 120 , 60 ) ; DropDown = TRUE ; }; FixedText FT_FONT { - Pos = MAP_APPFONT ( 12 , 53 ) ; + Pos = MAP_APPFONT ( 12 , 16 ) ; Size = MAP_APPFONT ( 55 , 10 ) ; Text = "~Zeichensatz" ; Text [ ENGLISH ] = "F~ont" ; @@ -199,22 +181,24 @@ ModalDialog RID_SCDLG_IMPORTOPT }; ListBox DDLB_FONT { - FONTLISTBOX + Border = TRUE; + Sort = TRUE; DropDown = TRUE ; - Pos = MAP_APPFONT ( 70 , 51 ) ; - Size = MAP_APPFONT ( 60 , 81 ) ; + Pos = MAP_APPFONT ( 70 , 14 ) ; + Size = MAP_APPFONT ( 120 , 52 ) ; }; ListBox LB_FONT { - FONTLISTBOX + Border = TRUE; + Sort = TRUE; DropDown = FALSE ; Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 119 , 50 ) ; + Size = MAP_APPFONT ( 179 , 50 ) ; }; GroupBox GB_FIELDOPT { Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 130 , 68 ) ; + Size = MAP_APPFONT ( 190 , 68 ) ; Text = "Feld Optionen" ; Text [ ENGLISH ] = "Field Options" ; Text [ norwegian ] = "Field Options" ; @@ -241,30 +225,20 @@ ModalDialog RID_SCDLG_IMPORTOPT }; OKButton BTN_OK { - Pos = MAP_APPFONT ( 142 , 6 ) ; + Pos = MAP_APPFONT ( 202 , 6 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; DefButton = TRUE ; }; CancelButton BTN_CANCEL { - Pos = MAP_APPFONT ( 142 , 24 ) ; + Pos = MAP_APPFONT ( 202 , 24 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; }; HelpButton BTN_HELP { - Pos = MAP_APPFONT ( 142 , 43 ) ; + Pos = MAP_APPFONT ( 202 , 43 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; }; - String STR_CHARSETKEYS // DO NOT TRANSLATE - // DO NOT TRANSLATE - // DO NOT TRANSLATE - // DO NOT TRANSLATE - // DO NOT TRANSLATE - // DO NOT TRANSLATE - { - // DO NOT TRANSLATE - Text = "ANSI;MAC;IBMPC;IBMPC_437;IBMPC_850;IBMPC_860;IBMPC_861;IBMPC_863;IBMPC_865;SYSTEM" ; - }; Text[ chinese_simplified ] = "ļ"; Text[ russian ] = " "; Text[ polish ] = "Importuj plik"; diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index ac0e06f10f3a..37659d0e9869 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docsh.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sab $ $Date: 2000-12-08 14:45:20 $ + * last change: $Author: er $ $Date: 2000-12-20 12:15:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -727,7 +727,6 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) // if (pStream) { FltError eError; - String sCharSet; String sItStr; SfxItemSet* pSet = rMedium.GetItemSet(); const SfxPoolItem* pItem; @@ -740,10 +739,9 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) if (sItStr.Len() == 0) { String aTitle = ScGlobal::GetRscString( STR_IMPORT_LOTUS ); - sCharSet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "IBMPC (437)" )); - ScImportOptions aOptions(59, 34, sCharSet); - ScImportOptionsDlg* pDlg = - new ScImportOptionsDlg( NULL, FALSE, &aOptions, &aTitle ); + ScImportOptions aOptions(59, 34, RTL_TEXTENCODING_IBM_437); + ScImportOptionsDlg* pDlg = new ScImportOptionsDlg( NULL, + FALSE, &aOptions, &aTitle, TRUE ); int nDlgRet; { // WarteCursor aus und wieder einschalten ScWaitCursorOff aWait( GetDialogParent() ); @@ -752,15 +750,13 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) if ( RET_OK == nDlgRet ) { pDlg->GetImportOptions( aOptions ); - sCharSet = aOptions.aStrFont; SfxItemSet* pItemSet = rMedium.GetItemSet(); if (pItemSet) - pItemSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, sCharSet)); -// eError = ScImportLotus123( *pStream, &aDocument, -// GetCharsetValue(sCharSet)); + pItemSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, + aOptions.aStrFont)); ScColumn::bDoubleAlloc = TRUE; eError = ScImportLotus123( rMedium, &aDocument, - GetCharsetValue(sCharSet)); + aOptions.eCharSet ); ScColumn::bDoubleAlloc = FALSE; if (eError != eERR_OK) { @@ -784,12 +780,9 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) } else { - sCharSet = sItStr; -// eError = ScImportLotus123( *pStream, &aDocument, -// GetCharsetValue(sCharSet)); ScColumn::bDoubleAlloc = TRUE; eError = ScImportLotus123( rMedium, &aDocument, - GetCharsetValue(sCharSet)); + ScGlobal::GetCharsetValue(sItStr)); ScColumn::bDoubleAlloc = FALSE; if (eError != eERR_OK) { @@ -945,7 +938,6 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) } else if (aFltName.EqualsAscii(pFilterDBase)) { - String sCharSet; String sItStr; SfxItemSet* pSet = rMedium.GetItemSet(); const SfxPoolItem* pItem; @@ -957,12 +949,10 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) if (sItStr.Len() == 0) { String aTitle = ScGlobal::GetRscString(STR_IMPORT_DBF); - sCharSet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "IBMPC" )); ScImportOptions aOptions; - aOptions.aStrFont = sCharSet; - aOptions.eCharSet = GetCharsetValue( sCharSet ); - ScImportOptionsDlg* pDlg = - new ScImportOptionsDlg( NULL, FALSE, &aOptions, &aTitle ); + aOptions.SetTextEncoding( RTL_TEXTENCODING_IBM_850 ); + ScImportOptionsDlg* pDlg = new ScImportOptionsDlg( NULL, + FALSE, &aOptions, &aTitle, TRUE ); int nDlgRet; { // WarteCursor aus und wieder einschalten ScWaitCursorOff aWait( GetDialogParent() ); @@ -971,13 +961,13 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) if ( nDlgRet == RET_OK ) { pDlg->GetImportOptions( aOptions ); - sCharSet = aOptions.aStrFont; SfxItemSet* pItemSet = rMedium.GetItemSet(); if (pItemSet) - pItemSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, sCharSet)); + pItemSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, + aOptions.aStrFont)); ULONG eError = DBaseImport( rMedium.GetPhysicalName(), - GetCharsetValue(sCharSet), bSimpleColWidth ); + aOptions.eCharSet, bSimpleColWidth ); if (eError != eERR_OK) { @@ -999,10 +989,8 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) } else { - sCharSet = sItStr; - ULONG eError = DBaseImport( rMedium.GetPhysicalName(), - GetCharsetValue(sCharSet), bSimpleColWidth ); + ScGlobal::GetCharsetValue(sItStr), bSimpleColWidth ); if (eError != eERR_OK) { @@ -1029,7 +1017,6 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) if (pStream) { FltError eError; - String sCharSet; String sItStr; SfxItemSet* pSet = rMedium.GetItemSet(); const SfxPoolItem* pItem; @@ -1042,10 +1029,9 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) if (sItStr.Len() == 0) { String aTitle = ScGlobal::GetRscString( STR_IMPORT_DIF ); - sCharSet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "ANSI" )); - ScImportOptions aOptions(59, 34, sCharSet); - ScImportOptionsDlg* pDlg = - new ScImportOptionsDlg( NULL, FALSE, &aOptions, &aTitle ); + ScImportOptions aOptions(59, 34, RTL_TEXTENCODING_MS_1252); + ScImportOptionsDlg* pDlg = new ScImportOptionsDlg( NULL, + FALSE, &aOptions, &aTitle, TRUE ); int nDlgRet; { // WarteCursor aus und wieder einschalten ScWaitCursorOff aWait( GetDialogParent() ); @@ -1054,12 +1040,12 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) if ( RET_OK == nDlgRet ) { pDlg->GetImportOptions( aOptions ); - sCharSet = aOptions.aStrFont; SfxItemSet* pItemSet = rMedium.GetItemSet(); if (pItemSet) - pItemSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, sCharSet)); + pItemSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, + aOptions.aStrFont)); eError = ScImportDif( *pStream, &aDocument, ScAddress(0,0,0), - GetCharsetValue(sCharSet)); + aOptions.eCharSet); if (eError != eERR_OK) { if (!GetError()) @@ -1082,9 +1068,8 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) } else { - sCharSet = sItStr; eError = ScImportDif( *pStream, &aDocument, ScAddress(0,0,0), - GetCharsetValue(sCharSet)); + ScGlobal::GetCharsetValue(sItStr)); if (eError != eERR_OK) { if (!GetError()) @@ -1622,7 +1607,6 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) SvStream* pStream = rMed.GetOutStream(); if (pStream) { - String sCharSet; sal_Unicode cAsciiDel; sal_Unicode cStrDel; String sItStr; @@ -1649,30 +1633,27 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) if (aDocument.GetTableCount() > 1) if (!rMed.GetError()) rMed.SetError(SCWARN_EXPORT_ASCII); - sCharSet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "SYSTEM" )); cStrDel = '"'; String aExt = rMed.GetName().Copy(rMed.GetName().Len()-3, 3); if (aExt.EqualsIgnoreCaseAscii("CSV")) cAsciiDel = ','; else cAsciiDel = '\t'; - ScImportOptions aOptions((USHORT)cAsciiDel, (USHORT)cStrDel, sCharSet); + ScImportOptions aOptions((USHORT)cAsciiDel, (USHORT)cStrDel, RTL_TEXTENCODING_DONTKNOW); String aTitle = ScGlobal::GetRscString( STR_EXPORT_ASCII ); - ScImportOptionsDlg* pDlg = - new ScImportOptionsDlg( NULL, TRUE, &aOptions, &aTitle ); + ScImportOptionsDlg* pDlg = new ScImportOptionsDlg( NULL, + TRUE, &aOptions, &aTitle, TRUE ); if ( pDlg->Execute() == RET_OK ) { WaitObject aWait( GetDialogParent() ); pDlg->GetImportOptions( aOptions ); cAsciiDel = (sal_Unicode) aOptions.nFieldSepCode; cStrDel = (sal_Unicode) aOptions.nTextSepCode; - sCharSet = aOptions.aStrFont; sItStr = aOptions.BuildString(); SfxItemSet* pItemSet = rMed.GetItemSet(); if (pItemSet) pItemSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, sItStr)); - AsciiSave( *pStream, cAsciiDel, cStrDel, - GetCharsetValue(sCharSet)); + AsciiSave( *pStream, cAsciiDel, cStrDel, aOptions.eCharSet ); } else { @@ -1687,8 +1668,7 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) ScImportOptions aOptions( sItStr ); cAsciiDel = (sal_Unicode)aOptions.nFieldSepCode; cStrDel = (sal_Unicode)aOptions.nTextSepCode; - sCharSet = aOptions.aStrFont; - AsciiSave( *pStream, cAsciiDel, cStrDel, GetCharsetValue(sCharSet)); + AsciiSave( *pStream, cAsciiDel, cStrDel, aOptions.eCharSet ); } bRet = !bCancel; } @@ -1712,11 +1692,10 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) } if (sCharSet.Len() == 0) { - sCharSet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "IBMPC" )); - ScImportOptions aOptions(59, 34, sCharSet); + ScImportOptions aOptions(59, 34, RTL_TEXTENCODING_IBM_850); String aTitle = ScGlobal::GetRscString( STR_EXPORT_DBF ); - ScImportOptionsDlg* pDlg = - new ScImportOptionsDlg( NULL, FALSE, &aOptions, &aTitle ); + ScImportOptionsDlg* pDlg = new ScImportOptionsDlg( NULL, + FALSE, &aOptions, &aTitle, FALSE ); if ( pDlg->Execute() == RET_OK ) { pDlg->GetImportOptions( aOptions ); @@ -1742,7 +1721,7 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) BOOL bHasMemo = FALSE; ULONG eError = DBaseExport( rMed.GetPhysicalName(), - GetCharsetValue(sCharSet), bHasMemo ); + ScGlobal::GetCharsetValue(sCharSet), bHasMemo ); if ( eError != eERR_OK && (eError & ERRCODE_WARNING_MASK) ) { @@ -1792,7 +1771,6 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) if (pStream) { BOOL bCancel = FALSE; - String sCharSet; String sItStr; SfxItemSet* pSet = rMed.GetItemSet(); const SfxPoolItem* pItem; @@ -1807,21 +1785,21 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) if (!rMed.GetError()) rMed.SetError(SCWARN_EXPORT_ASCII); - sCharSet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "ANSI" )); - ScImportOptions aOptions(59, 34, sCharSet); + ScImportOptions aOptions(59, 34, RTL_TEXTENCODING_MS_1252); String aTitle = ScGlobal::GetRscString( STR_EXPORT_DIF ); - ScImportOptionsDlg* pDlg = - new ScImportOptionsDlg( NULL, FALSE, &aOptions, &aTitle ); + ScImportOptionsDlg* pDlg = new ScImportOptionsDlg( NULL, + FALSE, &aOptions, &aTitle, TRUE ); if ( pDlg->Execute() == RET_OK ) { WaitObject aWait( GetDialogParent() ); pDlg->GetImportOptions( aOptions ); - sCharSet = aOptions.aStrFont; SfxItemSet* pItemSet = rMed.GetItemSet(); if (pItemSet) - pItemSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, sCharSet)); + pItemSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, + aOptions.aStrFont)); USHORT nTab = GetSaveTab(); - ScExportDif( *pStream, &aDocument, ScAddress(0,0,nTab), GetCharsetValue(sCharSet) ); + ScExportDif( *pStream, &aDocument, ScAddress(0,0,nTab), + aOptions.eCharSet ); } else { @@ -1833,8 +1811,8 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) else { WaitObject aWait( GetDialogParent() ); - sCharSet = sItStr; - ScExportDif( *pStream, &aDocument, ScAddress(0,0,0), GetCharsetValue(sCharSet) ); + ScExportDif( *pStream, &aDocument, ScAddress(0,0,0), + ScGlobal::GetCharsetValue(sItStr) ); } bRet = !bCancel; } diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx index 07f3ce90df7e..b5b27cd3c7fc 100644 --- a/sc/source/ui/inc/asciiopt.hxx +++ b/sc/source/ui/inc/asciiopt.hxx @@ -2,9 +2,9 @@ * * $RCSfile: asciiopt.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:44:57 $ + * last change: $Author: er $ $Date: 2000-12-20 12:08:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,9 @@ #ifndef _STREAM_HXX //autogen #include <tools/stream.hxx> #endif +#ifndef _SVX_TXENCBOX_HXX +#include <svx/txencbox.hxx> +#endif #ifndef _SVSTDARR_ULONGS #define _SVSTDARR_ULONGS @@ -128,6 +131,7 @@ private: BOOL bMergeFieldSeps; sal_Unicode cTextSep; CharSet eCharSet; + BOOL bCharSetSystem; long nStartRow; USHORT nInfoCount; xub_StrLen* pColStart; @@ -148,6 +152,7 @@ public: void InterpretColumnList( const String& rString ); CharSet GetCharSet() const { return eCharSet; } + BOOL GetCharSetSystem() const { return bCharSetSystem; } const String& GetFieldSeps() const { return aFieldSeps; } BOOL IsMergeSeps() const { return bMergeFieldSeps; } sal_Unicode GetTextSep() const { return cTextSep; } @@ -158,6 +163,7 @@ public: long GetStartRow() const { return nStartRow; } void SetCharSet( CharSet eNew ) { eCharSet = eNew; } + void SetCharSetSystem( BOOL bSet ) { bCharSetSystem = bSet; } void SetFixedLen( BOOL bSet ) { bFixedLen = bSet; } void SetFieldSeps( const String& rStr ) { aFieldSeps = rStr; } void SetMergeSeps( BOOL bSet ) { bMergeFieldSeps = bSet; } @@ -178,12 +184,13 @@ class ScImportAsciiDlg : public ModalDialog BOOL bVFlag; + FixedText aFtCharSet; + SvxTextEncodingBox aLbCharSet; + BOOL bCharSetSystem; + FixedText aFtRow; NumericField aNfRow; - FixedText aFtCharSet; - ListBox aLbCharSet; - RadioButton aRbFixed; RadioButton aRbSeparated; diff --git a/sc/source/ui/inc/imoptdlg.hxx b/sc/source/ui/inc/imoptdlg.hxx index e355940de04b..06aa3cb14c5d 100644 --- a/sc/source/ui/inc/imoptdlg.hxx +++ b/sc/source/ui/inc/imoptdlg.hxx @@ -2,9 +2,9 @@ * * $RCSfile: imoptdlg.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:44:59 $ + * last change: $Author: er $ $Date: 2000-12-20 12:08:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,6 +86,9 @@ #include <vcl/group.hxx> #endif +#ifndef _SVX_TXENCBOX_HXX +#include <svx/txencbox.hxx> +#endif #ifndef SC_SCGLOB_HXX #include "global.hxx" @@ -102,19 +105,20 @@ public: ScImportOptionsDlg( Window* pParent, BOOL bAsciiImport = TRUE, const ScImportOptions* pOptions = NULL, - const String* pStrTitle = NULL ); + const String* pStrTitle = NULL, + BOOL bMultiByte = FALSE ); ~ScImportOptionsDlg(); void GetImportOptions( ScImportOptions& rOptions ) const; private: + FixedText aFtFont; + SvxTextEncodingBox aLbFont; FixedText aFtFieldSep; ComboBox aEdFieldSep; FixedText aFtTextSep; ComboBox aEdTextSep; - FixedText aFtFont; - ListBox aLbFont; GroupBox aGbFieldOpt; OKButton aBtnOk; CancelButton aBtnCancel; @@ -122,7 +126,6 @@ private: ScDelimiterTable* pFieldSepTab; ScDelimiterTable* pTextSepTab; - String aCharKeyList; private: USHORT GetCodeFromCombo( const ComboBox& rEd ) const; @@ -139,8 +142,12 @@ public: ScImportOptions( const String& rStr ); ScImportOptions( USHORT nFieldSep, USHORT nTextSep, const String& rStr ) - : nFieldSepCode(nFieldSep),nTextSepCode(nTextSep),aStrFont(rStr),eCharSet(RTL_TEXTENCODING_DONTKNOW) - { eCharSet = GetCharsetValue(aStrFont); } + : nFieldSepCode(nFieldSep),nTextSepCode(nTextSep),aStrFont(rStr) + { eCharSet = ScGlobal::GetCharsetValue(aStrFont); } + + ScImportOptions( USHORT nFieldSep, USHORT nTextSep, rtl_TextEncoding nEnc ) + : nFieldSepCode(nFieldSep),nTextSepCode(nTextSep) + { SetTextEncoding( nEnc ); } ScImportOptions( const ScImportOptions& rCpy ) : nFieldSepCode (rCpy.nFieldSepCode), @@ -167,7 +174,8 @@ public: && aStrFont == rCmp.aStrFont; } String BuildString() const; - String BuildParaString( const String& rTyp, const String& rDsn ) const; + + void SetTextEncoding( rtl_TextEncoding nEnc ); USHORT nFieldSepCode; USHORT nTextSepCode; diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src index 76c9825e76bf..da5cb0ebabe8 100644 --- a/sc/source/ui/src/scstring.src +++ b/sc/source/ui/src/scstring.src @@ -2,9 +2,9 @@ * * $RCSfile: scstring.src,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: kz $ $Date: 2000-12-08 18:27:34 $ + * last change: $Author: er $ $Date: 2000-12-20 12:12:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2576,26 +2576,26 @@ String SCSTR_VALUE String SCSTR_CHARSET_USER { - Text = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);System" ; - Text [ ENGLISH ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);System" ; - Text [ english_us ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);System" ; - Text [ italian ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);Sistema" ; - Text [ spanish ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);Sistema" ; - Text [ french ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);Systeme" ; - Text [ dutch ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);System" ; - Text [ swedish ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);System" ; - Text [ danish ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);System" ; - Text [ portuguese ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);Sistema" ; - Text [ portuguese_brazilian ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);System" ; - Text[ chinese_simplified ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);ϵͳ"; - Text[ russian ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);"; - Text[ polish ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);System"; - Text[ japanese ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);"; - Text[ chinese_traditional ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);t"; - Text[ arabic ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);"; - Text[ greek ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);"; - Text[ korean ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);ý"; - Text[ turkish ] = "Ansi;Mac;IBMPC;IBMPC (437);IBMPC (850);IBMPC (860);IBMPC (861);IBMPC (863);IBMPC (865);Sistem"; + Text = "System" ; + Text [ ENGLISH ] = "System" ; + Text [ english_us ] = "System" ; + Text [ italian ] = "Sistema" ; + Text [ spanish ] = "Sistema" ; + Text [ french ] = "Systeme" ; + Text [ dutch ] = "System" ; + Text [ swedish ] = "System" ; + Text [ danish ] = "System" ; + Text [ portuguese ] = "Sistema" ; + Text [ portuguese_brazilian ] = "System" ; + Text[ chinese_simplified ] = "ϵͳ"; + Text[ russian ] = ""; + Text[ polish ] = "System"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "t"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "ý"; + Text[ turkish ] = "Sistem"; Text[ language_user1 ] = " "; }; |