summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui/asciiopt.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2009-07-27 11:43:32 -0400
committerKohei Yoshida <kyoshida@novell.com>2009-07-27 11:43:32 -0400
commita1bfe5a5d9abacf9e68f7b87d9b213d65efdbb75 (patch)
tree7a22f121ebea7cb326e0dffd30b63f94591ad33c /sc/source/ui/dbgui/asciiopt.cxx
parentb559137b68a273ef543711995ebf4f140cfe9149 (diff)
#i97416# initial porting of patches from ooo-build, to implement modified
csv import option dialog.
Diffstat (limited to 'sc/source/ui/dbgui/asciiopt.cxx')
-rw-r--r--sc/source/ui/dbgui/asciiopt.cxx38
1 files changed, 32 insertions, 6 deletions
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index fbe13bbd0370..8af7e3e97b06 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -57,8 +57,10 @@ ScAsciiOptions::ScAsciiOptions() :
aFieldSeps ( ';' ),
bMergeFieldSeps ( FALSE ),
bQuotedFieldAsText(false),
+ bDetectSpecialNumber(false),
cTextSep ( cDefaultTextSep ),
eCharSet ( gsl_getSystemTextEncoding() ),
+ eLang ( LANGUAGE_SYSTEM ),
bCharSetSystem ( FALSE ),
nStartRow ( 1 ),
nInfoCount ( 0 ),
@@ -73,8 +75,10 @@ ScAsciiOptions::ScAsciiOptions(const ScAsciiOptions& rOpt) :
aFieldSeps ( rOpt.aFieldSeps ),
bMergeFieldSeps ( rOpt.bMergeFieldSeps ),
bQuotedFieldAsText(rOpt.bQuotedFieldAsText),
+ bDetectSpecialNumber(rOpt.bDetectSpecialNumber),
cTextSep ( rOpt.cTextSep ),
eCharSet ( rOpt.eCharSet ),
+ eLang ( rOpt.eLang ),
bCharSetSystem ( rOpt.bCharSetSystem ),
nStartRow ( rOpt.nStartRow ),
nInfoCount ( rOpt.nInfoCount )
@@ -252,13 +256,20 @@ void ScAsciiOptions::ReadFromString( const String& rString )
eCharSet = ScGlobal::GetCharsetValue( aToken );
}
+ // Language
+ if (nCount >= 4)
+ {
+ aToken = rString.GetToken(3, ',');
+ eLang = static_cast<LanguageType>(aToken.ToInt32());
+ }
+
//
// Startzeile
//
- if ( nCount >= 4 )
+ if ( nCount >= 5 )
{
- aToken = rString.GetToken(3,',');
+ aToken = rString.GetToken(4,',');
nStartRow = aToken.ToInt32();
}
@@ -266,12 +277,12 @@ void ScAsciiOptions::ReadFromString( const String& rString )
// Spalten-Infos
//
- if ( nCount >= 5 )
+ if ( nCount >= 6 )
{
delete[] pColStart;
delete[] pColFormat;
- aToken = rString.GetToken(4,',');
+ aToken = rString.GetToken(5,',');
nSub = aToken.GetTokenCount('/');
nInfoCount = nSub / 2;
if (nInfoCount)
@@ -292,11 +303,18 @@ void ScAsciiOptions::ReadFromString( const String& rString )
}
// Import quoted field as text.
- if (nCount >= 6)
+ if (nCount >= 7)
{
- aToken = rString.GetToken(5, ',');
+ aToken = rString.GetToken(6, ',');
bQuotedFieldAsText = aToken.EqualsAscii("true") ? true : false;
}
+
+ // Detect special nubmers.
+ if (nCount >= 8)
+ {
+ aToken = rString.GetToken(7, ',');
+ bDetectSpecialNumber = aToken.EqualsAscii("true") ? true : false;
+ }
}
@@ -347,6 +365,10 @@ String ScAsciiOptions::WriteToString() const
aOutStr += ScGlobal::GetCharsetString( eCharSet );
aOutStr += ','; // Token-Ende
+ // Language
+ aOutStr += String::CreateFromInt32(eLang);
+ aOutStr += ',';
+
//
// Startzeile
//
@@ -372,6 +394,10 @@ String ScAsciiOptions::WriteToString() const
// Import quoted field as text.
aOutStr += String::CreateFromAscii(bQuotedFieldAsText ? "true" : "false");
+ aOutStr += ',';
+
+ // Detect special nubmers.
+ aOutStr += String::CreateFromAscii(bDetectSpecialNumber ? "true" : "false");
return aOutStr;
}