ooo-build r12362 - in branches/ooo-build-2-4: . patches/src680
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12362 - in branches/ooo-build-2-4: . patches/src680
- Date: Tue, 29 Apr 2008 00:37:56 +0100 (BST)
Author: kyoshida
Date: Mon Apr 28 23:37:56 2008
New Revision: 12362
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12362&view=rev
Log:
2008-04-28 Kohei Yoshida <kyoshida novell com>
* patches/src680/sc-preserve-imp-opts.diff: really fixed a bug where
the character set for csv import is incorrectly set to Unicode after
using the text-to-columns functionality which also uses the same dialog
as csv import (n#376473).
Modified:
branches/ooo-build-2-4/ChangeLog
branches/ooo-build-2-4/patches/src680/sc-preserve-imp-opts.diff
Modified: branches/ooo-build-2-4/patches/src680/sc-preserve-imp-opts.diff
==============================================================================
--- branches/ooo-build-2-4/patches/src680/sc-preserve-imp-opts.diff (original)
+++ branches/ooo-build-2-4/patches/src680/sc-preserve-imp-opts.diff Mon Apr 28 23:37:56 2008
@@ -1,6 +1,7 @@
---- officecfg/registry/schema/org/openoffice/Office/Calc.xcs 2005-07-24 17:09:34.000000000 +0530
-+++ officecfg/registry/schema/org/openoffice/Office/Calc.xcs 2005-09-19 22:38:05.000000000 +0530
-@@ -1041,6 +1041,72 @@
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=officecfg.vpj officecfg.clean/registry/schema/org/openoffice/Office/Calc.xcs officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+--- officecfg.clean/registry/schema/org/openoffice/Office/Calc.xcs 2008-04-28 18:35:57.000000000 -0400
++++ officecfg/registry/schema/org/openoffice/Office/Calc.xcs 2008-04-28 18:36:03.000000000 -0400
+@@ -1024,6 +1024,72 @@
<value>NULL</value>
</prop>
</group>
@@ -73,9 +74,104 @@
<group oor:name="Calculate">
<info>
<desc>Contains settings that affect cell calculation.</desc>
---- sc/source/ui/dbgui/scuiasciiopt.cxx 2005-07-24 17:46:45.000000000 +0530
-+++ sc/source/ui/dbgui/scuiasciiopt.cxx 2005-09-07 23:00:03.494705192 +0530
-@@ -79,6 +79,12 @@
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/dbgui/csvruler.cxx sc/source/ui/dbgui/csvruler.cxx
+--- sc.clean/source/ui/dbgui/csvruler.cxx 2008-04-28 17:33:09.000000000 -0400
++++ sc/source/ui/dbgui/csvruler.cxx 2008-04-28 19:23:31.000000000 -0400
+@@ -48,8 +48,76 @@
+ #endif
+
+
++#include <optutil.hxx>
++#include <com/sun/star/uno/Any.hxx>
++#include <com/sun/star/uno/Sequence.hxx>
++#include "miscuno.hxx"
++
++using namespace rtl;
++using namespace com::sun::star::uno;
++
++
++
++// ============================================================================
++#define SEP_PATH "Office.Calc/Dialogs/CSVImport"
++#define FIXED_WIDTH_LIST "FixedWidthList"
++
++
+ // ============================================================================
+
++static void load_FixedWidthList(ScCsvSplits &aSplits)
++{
++ String sSplits;
++ OUString sFixedWidthLists;
++
++ Sequence<Any>aValues;
++ const Any *pProperties;
++ Sequence<OUString> aNames(1);
++ OUString* pNames = aNames.getArray();
++ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
++
++ pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST );
++ aValues = aItem.GetProperties( aNames );
++ pProperties = aValues.getConstArray();
++
++ if( pProperties[0].hasValue() )
++ {
++ aSplits.Clear();
++ pProperties[0] >>= sFixedWidthLists;
++
++ sSplits = String( sFixedWidthLists );
++
++ // String ends with a semi-colon so there is no 'int' after the last one.
++ for(int i=0;i<sSplits.GetTokenCount()-1;i++ )
++ aSplits.Insert( sSplits.GetToken(i).ToInt32() );
++ }
++}
++static void save_FixedWidthList(ScCsvSplits aSplits)
++{
++ int i;
++ String sSplits;
++ // Create a semi-colon separated string to save the splits
++ for(i=0;i<aSplits.Count();i++)
++ {
++ sSplits.Append( String::CreateFromInt32( aSplits[i] ) );
++ sSplits.Append((char)';');
++ }
++
++ OUString sFixedWidthLists = OUString( sSplits );
++ Sequence<Any> aValues;
++ Any *pProperties;
++ Sequence<OUString> aNames(1);
++ OUString* pNames = aNames.getArray();
++ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
++
++ pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST );
++ aValues = aItem.GetProperties( aNames );
++ pProperties = aValues.getArray();
++ pProperties[0] <<= sFixedWidthLists;
++
++ aItem.PutProperties(aNames, aValues);
++}
++
+ ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) :
+ ScCsvControl( rParent ),
+ mnPosCursorLast( 1 )
+@@ -59,6 +127,13 @@ ScCsvRuler::ScCsvRuler( ScCsvControl& rP
+ InitSizeData();
+ maBackgrDev.SetFont( GetFont() );
+ maRulerDev.SetFont( GetFont() );
++
++ load_FixedWidthList( maSplits );
++}
++
++ScCsvRuler::~ScCsvRuler()
++{
++ save_FixedWidthList( maSplits );
+ }
+
+
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/dbgui/scuiasciiopt.cxx sc/source/ui/dbgui/scuiasciiopt.cxx
+--- sc.clean/source/ui/dbgui/scuiasciiopt.cxx 2008-04-28 17:33:09.000000000 -0400
++++ sc/source/ui/dbgui/scuiasciiopt.cxx 2008-04-28 19:29:34.000000000 -0400
+@@ -56,6 +56,12 @@
// ause
#include "editutil.hxx"
@@ -88,7 +184,7 @@
//! TODO make dynamic
#ifdef WIN
const SCSIZE ASCIIDLG_MAXROWS = 10000;
-@@ -86,6 +92,20 @@ const SCSIZE ASCIIDLG_MAXROWS
+@@ -63,6 +69,20 @@ const SCSIZE ASCIIDLG_MAXROWS
const SCSIZE ASCIIDLG_MAXROWS = MAXROWCOUNT;
#endif
@@ -97,117 +193,143 @@
+using namespace com::sun::star::uno;
+
+// Defines - CSV Import Preserve Options
-+#define FIXED_WIDTH "FixedWidth"
-+#define FROM_ROW "FromRow"
-+#define CHAR_SET "CharSet"
-+#define SEPARATORS "Separators"
-+#define TEXT_SEPARATORS "TextSeparators"
-+#define MERGE_DELIMITERS "MergeDelimiters"
-+#define SEP_PATH "Office.Calc/Dialogs/CSVImport"
++#define FIXED_WIDTH "FixedWidth"
++#define FROM_ROW "FromRow"
++#define CHAR_SET "CharSet"
++#define SEPARATORS "Separators"
++#define TEXT_SEPARATORS "TextSeparators"
++#define MERGE_DELIMITERS "MergeDelimiters"
++#define SEP_PATH "Office.Calc/Dialogs/CSVImport"
+
+
// ============================================================================
void lcl_FillCombo( ComboBox& rCombo, const String& rList, sal_Unicode cSelect )
-@@ -133,6 +153,70 @@ sal_Unicode lcl_CharFromCombo( ComboBox&
+@@ -110,11 +130,75 @@ sal_Unicode lcl_CharFromCombo( ComboBox&
return c;
}
+static void load_Separators( OUString &sFieldSeparators, OUString &sTextSeparators,
-+ bool &bMergeDelimiters, bool &bFixedWidth, sal_Int32 &nFromRow, sal_Int32 &nCharSet )
++ bool &bMergeDelimiters, bool &bFixedWidth, sal_Int32 &nFromRow, sal_Int32 &nCharSet )
+{
-+ Sequence<Any>aValues;
-+ const Any *pProperties;
-+ Sequence<OUString> aNames(6);
-+ OUString* pNames = aNames.getArray();
-+ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
-+
-+ pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS );
-+ pNames[1] = OUString::createFromAscii( SEPARATORS );
-+ pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS );
-+ pNames[3] = OUString::createFromAscii( FIXED_WIDTH );
-+ pNames[4] = OUString::createFromAscii( FROM_ROW );
-+ pNames[5] = OUString::createFromAscii( CHAR_SET );
-+ aValues = aItem.GetProperties( aNames );
-+ pProperties = aValues.getConstArray();
-+ if( pProperties[1].hasValue() )
-+ pProperties[1] >>= sFieldSeparators;
-+
-+ if( pProperties[2].hasValue() )
-+ pProperties[2] >>= sTextSeparators;
-+
-+ if( pProperties[0].hasValue() )
-+ bMergeDelimiters = ScUnoHelpFunctions::GetBoolFromAny( pProperties[0] );
++ Sequence<Any>aValues;
++ const Any *pProperties;
++ Sequence<OUString> aNames(6);
++ OUString* pNames = aNames.getArray();
++ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
++
++ pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS );
++ pNames[1] = OUString::createFromAscii( SEPARATORS );
++ pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS );
++ pNames[3] = OUString::createFromAscii( FIXED_WIDTH );
++ pNames[4] = OUString::createFromAscii( FROM_ROW );
++ pNames[5] = OUString::createFromAscii( CHAR_SET );
++ aValues = aItem.GetProperties( aNames );
++ pProperties = aValues.getConstArray();
++ if( pProperties[1].hasValue() )
++ pProperties[1] >>= sFieldSeparators;
++
++ if( pProperties[2].hasValue() )
++ pProperties[2] >>= sTextSeparators;
++
++ if( pProperties[0].hasValue() )
++ bMergeDelimiters = ScUnoHelpFunctions::GetBoolFromAny( pProperties[0] );
+
-+ if( pProperties[3].hasValue() )
-+ bFixedWidth = ScUnoHelpFunctions::GetBoolFromAny( pProperties[3] );
++ if( pProperties[3].hasValue() )
++ bFixedWidth = ScUnoHelpFunctions::GetBoolFromAny( pProperties[3] );
+
-+ if( pProperties[4].hasValue() )
-+ pProperties[4] >>= nFromRow;
++ if( pProperties[4].hasValue() )
++ pProperties[4] >>= nFromRow;
+
-+ if( pProperties[5].hasValue() )
-+ pProperties[5] >>= nCharSet;
++ if( pProperties[5].hasValue() )
++ pProperties[5] >>= nCharSet;
+}
+
+static void save_Separators( String maSeparators, String maTxtSep, bool bMergeDelimiters,
-+ bool bFixedWidth, sal_Int32 nFromRow, sal_Int32 nCharSet )
++ bool bFixedWidth, sal_Int32 nFromRow, sal_Int32 nCharSet )
+{
-+ OUString sFieldSeparators = OUString( maSeparators );
-+ OUString sTextSeparators = OUString( maTxtSep );
-+ Sequence<Any> aValues;
-+ Any *pProperties;
-+ Sequence<OUString> aNames(6);
-+ OUString* pNames = aNames.getArray();
-+ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
-+
-+ pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS );
-+ pNames[1] = OUString::createFromAscii( SEPARATORS );
-+ pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS );
-+ pNames[3] = OUString::createFromAscii( FIXED_WIDTH );
-+ pNames[4] = OUString::createFromAscii( FROM_ROW );
-+ pNames[5] = OUString::createFromAscii( CHAR_SET );
-+ aValues = aItem.GetProperties( aNames );
-+ pProperties = aValues.getArray();
-+ pProperties[1] <<= sFieldSeparators;
-+ pProperties[2] <<= sTextSeparators;
-+ ScUnoHelpFunctions::SetBoolInAny( pProperties[0], bMergeDelimiters );
-+ ScUnoHelpFunctions::SetBoolInAny( pProperties[3], bFixedWidth );
-+ pProperties[4] <<= nFromRow;
-+ pProperties[5] <<= nCharSet;
++ OUString sFieldSeparators = OUString( maSeparators );
++ OUString sTextSeparators = OUString( maTxtSep );
++ Sequence<Any> aValues;
++ Any *pProperties;
++ Sequence<OUString> aNames(6);
++ OUString* pNames = aNames.getArray();
++ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
++
++ pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS );
++ pNames[1] = OUString::createFromAscii( SEPARATORS );
++ pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS );
++ pNames[3] = OUString::createFromAscii( FIXED_WIDTH );
++ pNames[4] = OUString::createFromAscii( FROM_ROW );
++ pNames[5] = OUString::createFromAscii( CHAR_SET );
++ aValues = aItem.GetProperties( aNames );
++ pProperties = aValues.getArray();
++ pProperties[1] <<= sFieldSeparators;
++ pProperties[2] <<= sTextSeparators;
++ ScUnoHelpFunctions::SetBoolInAny( pProperties[0], bMergeDelimiters );
++ ScUnoHelpFunctions::SetBoolInAny( pProperties[3], bFixedWidth );
++ pProperties[4] <<= nFromRow;
++ pProperties[5] <<= nCharSet;
+
-+ aItem.PutProperties(aNames, aValues);
++ aItem.PutProperties(aNames, aValues);
+}
// ----------------------------------------------------------------------------
-@@ -190,16 +274,42 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
+ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
+- SvStream* pInStream, sal_Unicode cSep ) :
++ SvStream* pInStream, sal_Unicode /*cSep*/ ) :
+ ModalDialog ( pParent, ScResId( RID_SCDLG_ASCII ) ),
+ mpDatStream ( pInStream ),
+ mnStreamPos( pInStream ? pInStream->Tell() : 0 ),
+@@ -158,14 +242,15 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
+ aFldSepList ( ScResId( SCSTR_FIELDSEP ) ),
+ aTextSepList( ScResId( SCSTR_TEXTSEP ) ),
+ mcTextSep ( ScAsciiOptions::cDefaultTextSep ),
+- maStrTextToColumns( ScResId( STR_TEXTTOCOLUMNS ) )
++ maStrTextToColumns( ScResId( STR_TEXTTOCOLUMNS ) ),
++ mbFileImport(true)
+ {
+ FreeResource();
++ mbFileImport = aDatName.Len() > 0;
+
+ String aName = GetText();
+ // aDatName is empty if invoked during paste from clipboard.
+- BOOL bClipboard = (aDatName.Len() == 0);
+- if (!bClipboard)
++ if (mbFileImport)
+ {
+ aName.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" - ["));
+ aName += aDatName;
+@@ -173,20 +258,47 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
}
SetText( aName );
- switch(cSep)
+
-+ OUString sFieldSeparators;
-+ OUString sTextSeparators;
-+ bool bMergeDelimiters = false;
-+ bool bFixedWidth = false;
-+ sal_Int32 nFromRow = 1;
-+ sal_Int32 nCharSet = -1;
-+ load_Separators (sFieldSeparators, sTextSeparators, bMergeDelimiters, bFixedWidth, nFromRow, nCharSet);
-+ maFieldSeparators = String(sFieldSeparators);
-+
-+ if( bMergeDelimiters )
-+ aCkbAsOnce.Check();
-+ if( bFixedWidth )
-+ aRbFixed.Check();
-+ if( nFromRow != 1 )
-+ aNfRow.SetValue( nFromRow );
-+
-+ ByteString bString(maFieldSeparators,RTL_TEXTENCODING_MS_1252);
-+ const sal_Char *aSep = bString.GetBuffer();
-+ int i = 0;
-+ int len = maFieldSeparators.Len();
-+ for(i=0;i<len;i++)
- {
++ OUString sFieldSeparators;
++ OUString sTextSeparators;
++ bool bMergeDelimiters = false;
++ bool bFixedWidth = false;
++ sal_Int32 nFromRow = 1;
++ sal_Int32 nCharSet = -1;
++ if (mbFileImport)
++ // load separators only when importing csv files.
++ load_Separators (sFieldSeparators, sTextSeparators, bMergeDelimiters, bFixedWidth, nFromRow, nCharSet);
++ maFieldSeparators = String(sFieldSeparators);
++
++ if( bMergeDelimiters )
++ aCkbAsOnce.Check();
++ if( bFixedWidth )
++ aRbFixed.Check();
++ if( nFromRow != 1 )
++ aNfRow.SetValue( nFromRow );
++
++ ByteString bString(maFieldSeparators,RTL_TEXTENCODING_MS_1252);
++ const sal_Char *aSep = bString.GetBuffer();
++ int len = maFieldSeparators.Len();
++ for (int i = 0; i < len; ++i)
+ {
- case '\t': aCkbTab.Check(); break;
- case ';': aCkbSemicolon.Check(); break;
- case ',': aCkbComma.Check(); break;
@@ -215,149 +337,75 @@
- default:
- aCkbOther.Check();
- aEdOther.SetText( cSep );
-+ switch( aSep[i] )
-+ {
-+ case '\t': aCkbTab.Check(); break;
-+ case ';': aCkbSemicolon.Check(); break;
-+ case ',': aCkbComma.Check(); break;
-+ case ' ': aCkbSpace.Check(); break;
-+ default:
-+ aCkbOther.Check();
-+ aEdOther.SetText( aEdOther.GetText() + OUString( aSep[i] ) );
-+ }
- }
-+
-+ // Get Separators from the dialog
++ switch( aSep[i] )
++ {
++ case '\t': aCkbTab.Check(); break;
++ case ';': aCkbSemicolon.Check(); break;
++ case ',': aCkbComma.Check(); break;
++ case ' ': aCkbSpace.Check(); break;
++ default:
++ aCkbOther.Check();
++ aEdOther.SetText( aEdOther.GetText() + OUString( aSep[i] ) );
++ }
+ }
++
++ // Get Separators from the dialog
maFieldSeparators = GetSeparators();
- BOOL bPreselectUnicode = FALSE;
-@@ -238,6 +348,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
+ // Clipboard is always Unicode, else detect.
+- BOOL bPreselectUnicode = bClipboard;
++ bool bPreselectUnicode = !mbFileImport;
+ // Sniff for Unicode / not
+ if( !bPreselectUnicode && mpDatStream )
+ {
+@@ -222,6 +334,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
// *** Separator characters ***
lcl_FillCombo( aCbTextSep, aTextSepList, mcTextSep );
-+ aCbTextSep.SetText( sTextSeparators );
++ aCbTextSep.SetText( sTextSeparators );
Link aSeparatorHdl =LINK( this, ScImportAsciiDlg, SeparatorHdl );
aCbTextSep.SetSelectHdl( aSeparatorHdl );
-@@ -241,6 +326,10 @@
+@@ -242,6 +355,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
aLbCharSet.InsertTextEncoding( RTL_TEXTENCODING_DONTKNOW, aCharSetUser );
aLbCharSet.SelectTextEncoding( bPreselectUnicode ?
RTL_TEXTENCODING_UNICODE : gsl_getSystemTextEncoding() );
+
-+ if( nCharSet >= 0 )
-+ aLbCharSet.SelectEntryPos( nCharSet );
++ if( nCharSet >= 0 )
++ aLbCharSet.SelectEntryPos( nCharSet );
+
SetSelectedCharSet();
aLbCharSet.SetSelectHdl( LINK( this, ScImportAsciiDlg, CharSetHdl ) );
-@@ -289,6 +403,8 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
+@@ -273,6 +390,9 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
ScImportAsciiDlg::~ScImportAsciiDlg()
{
-+ save_Separators( maFieldSeparators, aCbTextSep.GetText(), aCkbAsOnce.IsChecked(),
-+ aRbFixed.IsChecked(), aNfRow.GetValue(), aLbCharSet.GetSelectEntryPos());
++ if (mbFileImport)
++ save_Separators( maFieldSeparators, aCbTextSep.GetText(), aCkbAsOnce.IsChecked(),
++ aRbFixed.IsChecked(), aNfRow.GetValue(), aLbCharSet.GetSelectEntryPos());
delete[] mpRowPosArray;
}
---- sc/source/ui/inc/csvruler.hxx 2005-09-18 22:48:04.000000000 +0530
-+++ sc/source/ui/inc/csvruler.hxx 2005-09-18 22:55:37.000000000 +0530
-@@ -112,6 +112,7 @@ private:
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/inc/csvruler.hxx sc/source/ui/inc/csvruler.hxx
+--- sc.clean/source/ui/inc/csvruler.hxx 2008-04-28 17:33:09.000000000 -0400
++++ sc/source/ui/inc/csvruler.hxx 2008-04-28 19:22:57.000000000 -0400
+@@ -86,6 +86,7 @@ private:
// ------------------------------------------------------------------------
public:
explicit ScCsvRuler( ScCsvControl& rParent );
-+ ~ScCsvRuler();
++ ~ScCsvRuler();
// common ruler handling --------------------------------------------------
public:
---- sc/source/ui/dbgui/csvruler.cxx 2005-09-18 22:14:42.000000000 +0530
-+++ sc/source/ui/dbgui/csvruler.cxx 2005-09-19 22:04:55.074689184 +0530
-@@ -75,7 +75,75 @@
- #endif
-
-
-+#include <optutil.hxx>
-+#include <com/sun/star/uno/Any.hxx>
-+#include <com/sun/star/uno/Sequence.hxx>
-+#include "miscuno.hxx"
-+
-+using namespace rtl;
-+using namespace com::sun::star::uno;
-+
-+
-+
- // ============================================================================
-+#define SEP_PATH "Office.Calc/Dialogs/CSVImport"
-+#define FIXED_WIDTH_LIST "FixedWidthList"
-+
-+
-+// ============================================================================
-+
-+static void load_FixedWidthList(ScCsvSplits &aSplits)
-+{
-+ String sSplits;
-+ OUString sFixedWidthLists;
-+
-+ Sequence<Any>aValues;
-+ const Any *pProperties;
-+ Sequence<OUString> aNames(1);
-+ OUString* pNames = aNames.getArray();
-+ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
-+
-+ pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST );
-+ aValues = aItem.GetProperties( aNames );
-+ pProperties = aValues.getConstArray();
-+
-+ if( pProperties[0].hasValue() )
-+ {
-+ aSplits.Clear();
-+ pProperties[0] >>= sFixedWidthLists;
-+
-+ sSplits = String( sFixedWidthLists );
-+
-+ // String ends with a semi-colon so there is no 'int' after the last one.
-+ for(int i=0;i<sSplits.GetTokenCount()-1;i++ )
-+ aSplits.Insert( sSplits.GetToken(i).ToInt32() );
-+ }
-+}
-+static void save_FixedWidthList(ScCsvSplits aSplits)
-+{
-+ int i;
-+ String sSplits;
-+ // Create a semi-colon separated string to save the splits
-+ for(i=0;i<aSplits.Count();i++)
-+ {
-+ sSplits.Append( String::CreateFromInt32( aSplits[i] ) );
-+ sSplits.Append((char)';');
-+ }
-+
-+ OUString sFixedWidthLists = OUString( sSplits );
-+ Sequence<Any> aValues;
-+ Any *pProperties;
-+ Sequence<OUString> aNames(1);
-+ OUString* pNames = aNames.getArray();
-+ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
-+
-+ pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST );
-+ aValues = aItem.GetProperties( aNames );
-+ pProperties = aValues.getArray();
-+ pProperties[0] <<= sFixedWidthLists;
-+
-+ aItem.PutProperties(aNames, aValues);
-+}
-
- ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) :
- ScCsvControl( rParent ),
-@@ -86,6 +154,13 @@ ScCsvRuler::ScCsvRuler( ScCsvControl& rP
- InitSizeData();
- maBackgrDev.SetFont( GetFont() );
- maRulerDev.SetFont( GetFont() );
-+
-+ load_FixedWidthList( maSplits );
-+}
-+
-+ScCsvRuler::~ScCsvRuler()
-+{
-+ save_FixedWidthList( maSplits );
- }
-
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/inc/scuiasciiopt.hxx sc/source/ui/inc/scuiasciiopt.hxx
+--- sc.clean/source/ui/inc/scuiasciiopt.hxx 2008-04-28 17:33:09.000000000 -0400
++++ sc/source/ui/inc/scuiasciiopt.hxx 2008-04-28 18:46:52.000000000 -0400
+@@ -92,6 +92,7 @@ class ScImportAsciiDlg : public ModalDia
+
+ CharSet meCharSet; /// Selected char set.
+ bool mbCharSetSystem; /// Is System char set selected?
++ bool mbFileImport; /// Is this dialog involked for csv file import ?
+ public:
+ ScImportAsciiDlg(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]