ooo-build r14891 - in trunk: . patches/dev300



Author: kyoshida
Date: Thu Dec 18 22:55:03 2008
New Revision: 14891
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14891&view=rev

Log:
2008-12-18  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/sc-preserve-imp-opts.diff: updated to allow an option
	of importing quoted fields as text. (n#433378)

	* patches/dev300/apply: moved this patch from CustomUserConfig to 
	CalcFixes so that it would get applied for all distros.


Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply
   trunk/patches/dev300/sc-preserve-imp-opts.diff

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Thu Dec 18 22:55:03 2008
@@ -670,6 +670,10 @@
 
 
 [ CalcFixes ]
+# To make CSV Text Import settings persistent, and also allow importing of
+# quoted fields as text.
+sc-preserve-imp-opts.diff, i#3687, n#433378, muthusub/kohei
+
 # Replace usability numb Zoom dialog with a Combo Box
 # FIXME: this conflicts with Sun's duplication of this work,
 # eg. print preview
@@ -1000,10 +1004,6 @@
 # migrate keyboard shortcuts & reset character set for CSV import dialog.
 desktop-config-migration.diff n#367160, n#376473, n#421070, kohei/jholesov
 
-# To make CSV Text Import settings persistent.
-sc-preserve-imp-opts.diff, i#3687, muthusub
-
-
 [ DebianBaseOnly ]
 SectionOwner => rengelha
 

Modified: trunk/patches/dev300/sc-preserve-imp-opts.diff
==============================================================================
--- trunk/patches/dev300/sc-preserve-imp-opts.diff	(original)
+++ trunk/patches/dev300/sc-preserve-imp-opts.diff	Thu Dec 18 22:55:03 2008
@@ -1,84 +1,237 @@
-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 @@
+diff --git officecfg/registry/schema/org/openoffice/Office/Calc.xcs officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+index 3c3fe6b..09e5c52 100644
+--- officecfg/registry/schema/org/openoffice/Office/Calc.xcs
++++ officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+@@ -1019,6 +1019,81 @@
  				<value>NULL</value>
  			</prop>
  		</group>
-+		<group oor:name="Dialogs">
-+			<info>
-+				<desc>Contains the dialogs settings.</desc>
-+			</info>
-+			<group oor:name="CSVImport">
-+				<info>
-+					<desc>Contains setting for Text CSV Import</desc>
-+				</info>
-+				<prop oor:name="MergeDelimiters" oor:type="xs:boolean">
-+					<info>
-+						<author>muthusuba</author>
-+						<desc>Merge Delimiter check box status</desc>
-+						<label>MergeDelimiters</label>
-+					</info>
-+					<value>false</value>
-+				</prop>
-+				<prop oor:name="Separators" oor:type="xs:string">
-+					<info>
-+						<author>muthusuba</author>
-+						<desc>List of Separators - as a String</desc>
-+						<label>Separators</label>
-+					</info>
-+					<value>;	</value>
-+				</prop>
-+				<prop oor:name="TextSeparators" oor:type="xs:string">
-+					<info>
-+						<author>muthusuba</author>
-+						<desc>Text Separators</desc>
-+						<label>TextSeparators</label>
-+					</info>
-+					<value>"</value>
-+				</prop>
-+				<prop oor:name="FixedWidth" oor:type="xs:boolean">
-+					<info>
-+						<author>muthusuba</author>
-+						<desc>Fixed width</desc>
-+						<label>FixedWidth</label>
-+					</info>
-+					<value>false</value>
-+				</prop>
-+				<prop oor:name="FromRow" oor:type="xs:int">
-+					<info>
-+						<author>muthusuba</author>
-+						<desc>From Row</desc>
-+						<label>FromRow</label>
-+					</info>
-+					<value>1</value>
-+				</prop>
-+				<prop oor:name="CharSet" oor:type="xs:int">
-+					<info>
-+						<author>muthusuba</author>
-+						<desc>Char Set</desc>
-+						<label>CharSet</label>
-+					</info>
-+					<value>-1</value>
-+				</prop>
-+				<prop oor:name="FixedWidthList" oor:type="xs:string">
-+					<info>
-+						<author>muthusuba</author>
-+						<desc>Fixed Width List of separators</desc>
-+						<label>FixedWidthList</label>
-+					</info>
-+					<value></value>
-+				</prop>
-+			</group>
-+		</group>
++        <group oor:name="Dialogs">
++            <info>
++                <desc>Contains the dialogs settings.</desc>
++            </info>
++            <group oor:name="CSVImport">
++                <info>
++                    <desc>Contains setting for Text CSV Import</desc>
++                </info>
++                <prop oor:name="MergeDelimiters" oor:type="xs:boolean">
++                    <info>
++                        <author>muthusuba</author>
++                        <desc>Merge Delimiter check box status</desc>
++                        <label>MergeDelimiters</label>
++                    </info>
++                    <value>false</value>
++                </prop>
++                <prop oor:name="QuotedFieldAsText" oor:type="xs:boolean">
++                    <info>
++                        <author>kyoshida</author>
++                        <desc>If true, quoted field is always imported as text 
++                            with no exception.</desc>
++                        <label>QuotedFieldAsText</label>
++                    </info>
++                    <value>false</value>
++                </prop>
++                <prop oor:name="Separators" oor:type="xs:string">
++                    <info>
++                        <author>muthusuba</author>
++                        <desc>List of Separators - as a String</desc>
++                        <label>Separators</label>
++                    </info>
++                    <value>;    </value>
++                </prop>
++                <prop oor:name="TextSeparators" oor:type="xs:string">
++                    <info>
++                        <author>muthusuba</author>
++                        <desc>Text Separators</desc>
++                        <label>TextSeparators</label>
++                    </info>
++                    <value>"</value>
++                </prop>
++                <prop oor:name="FixedWidth" oor:type="xs:boolean">
++                    <info>
++                        <author>muthusuba</author>
++                        <desc>Fixed width</desc>
++                        <label>FixedWidth</label>
++                    </info>
++                    <value>false</value>
++                </prop>
++                <prop oor:name="FromRow" oor:type="xs:int">
++                    <info>
++                        <author>muthusuba</author>
++                        <desc>From Row</desc>
++                        <label>FromRow</label>
++                    </info>
++                    <value>1</value>
++                </prop>
++                <prop oor:name="CharSet" oor:type="xs:int">
++                    <info>
++                        <author>muthusuba</author>
++                        <desc>Char Set</desc>
++                        <label>CharSet</label>
++                    </info>
++                    <value>-1</value>
++                </prop>
++                <prop oor:name="FixedWidthList" oor:type="xs:string">
++                    <info>
++                        <author>muthusuba</author>
++                        <desc>Fixed Width List of separators</desc>
++                        <label>FixedWidthList</label>
++                    </info>
++                    <value></value>
++                </prop>
++            </group>
++        </group>
  		<group oor:name="Calculate">
  			<info>
  				<desc>Contains settings that affect cell calculation.</desc>
-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
+diff --git sc/source/ui/dbgui/asciiopt.cxx sc/source/ui/dbgui/asciiopt.cxx
+index bf6521e..df25128 100644
+--- sc/source/ui/dbgui/asciiopt.cxx
++++ sc/source/ui/dbgui/asciiopt.cxx
+@@ -56,6 +56,7 @@ ScAsciiOptions::ScAsciiOptions() :
+ 	bFixedLen		( FALSE ),
+ 	aFieldSeps		( ';' ),
+ 	bMergeFieldSeps	( FALSE ),
++    bQuotedFieldAsText(false),
+ 	cTextSep		( cDefaultTextSep ),
+ 	eCharSet		( gsl_getSystemTextEncoding() ),
+ 	bCharSetSystem	( FALSE ),
+@@ -71,6 +72,7 @@ ScAsciiOptions::ScAsciiOptions(const ScAsciiOptions& rOpt) :
+ 	bFixedLen		( rOpt.bFixedLen ),
+ 	aFieldSeps		( rOpt.aFieldSeps ),
+ 	bMergeFieldSeps	( rOpt.bMergeFieldSeps ),
++    bQuotedFieldAsText(rOpt.bQuotedFieldAsText),
+ 	cTextSep		( rOpt.cTextSep ),
+ 	eCharSet		( rOpt.eCharSet ),
+ 	bCharSetSystem	( rOpt.bCharSetSystem ),
+@@ -155,6 +157,7 @@ ScAsciiOptions&	ScAsciiOptions::operator=( const ScAsciiOptions& rCpy )
+ 	bFixedLen		= rCpy.bFixedLen;
+ 	aFieldSeps		= rCpy.aFieldSeps;
+ 	bMergeFieldSeps	= rCpy.bMergeFieldSeps;
++    bQuotedFieldAsText = rCpy.bQuotedFieldAsText;
+ 	cTextSep		= rCpy.cTextSep;
+ 	eCharSet		= rCpy.eCharSet;
+ 	bCharSetSystem	= rCpy.bCharSetSystem;
+@@ -169,6 +172,7 @@ BOOL ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const
+ 	if ( bFixedLen		 == rCmp.bFixedLen &&
+ 		 aFieldSeps		 == rCmp.aFieldSeps &&
+ 		 bMergeFieldSeps == rCmp.bMergeFieldSeps &&
++         bQuotedFieldAsText == rCmp.bQuotedFieldAsText &&
+ 		 cTextSep		 == rCmp.cTextSep &&
+ 		 eCharSet		 == rCmp.eCharSet &&
+ 		 bCharSetSystem  == rCmp.bCharSetSystem &&
+@@ -286,6 +290,13 @@ void ScAsciiOptions::ReadFromString( const String& rString )
+ 			pColFormat = NULL;
+ 		}
+ 	}
++
++    // Import quoted field as text.
++    if (nCount >= 6)
++    {
++        aToken = rString.GetToken(5, ',');
++        bQuotedFieldAsText = aToken.EqualsAscii("true") ? true : false;
++    }
+ }
+ 
+ 
+@@ -357,6 +368,11 @@ String ScAsciiOptions::WriteToString() const
+ 		aOutStr += String::CreateFromInt32(pColFormat[nInfo]);
+ 	}
+ 
++    aOutStr += ',';
++
++    // Import quoted field as text.
++    aOutStr += String::CreateFromAscii(bQuotedFieldAsText ? "true" : "false");
++
+ 	return aOutStr;
+ }
+ 
+diff --git sc/source/ui/dbgui/asciiopt.hrc sc/source/ui/dbgui/asciiopt.hrc
+index 2dcfe00..60c8500 100644
+--- sc/source/ui/dbgui/asciiopt.hrc
++++ sc/source/ui/dbgui/asciiopt.hrc
+@@ -56,4 +56,5 @@
+ #define FT_AT_ROW 59
+ #define NF_AT_ROW 60
+ #define CB_ASONCE 90
++#define CB_QUOTED_AS_TEXT 91
+ #define STR_TEXTTOCOLUMNS 100
+diff --git sc/source/ui/dbgui/asciiopt.src sc/source/ui/dbgui/asciiopt.src
+index e6cc493..da10a39 100644
+--- sc/source/ui/dbgui/asciiopt.src
++++ sc/source/ui/dbgui/asciiopt.src
+@@ -34,24 +34,24 @@ ModalDialog RID_SCDLG_ASCII
+ {
+ 	OutputSize = TRUE ;
+ 	SVLook = TRUE ;
+-    Size = MAP_APPFONT ( 320 , 247 ) ;
++    Size = MAP_APPFONT ( 320 , 264 ) ;
+ 	Text [ en-US ] = "Text Import" ;
+ 	Moveable = TRUE ;
+     FixedLine FL_WIDTH
+ 	{
+-        Pos = MAP_APPFONT ( 6 , 132 ) ;
++        Pos = MAP_APPFONT ( 6 , 147 ) ;
+         Size = MAP_APPFONT ( 252 , 8 ) ;
+ 		Text [ en-US ] = "Fields" ;
+ 	};
+ 	FixedText FT_TYPE
+ 	{
+-        Pos = MAP_APPFONT ( 12 , 145 ) ;
++        Pos = MAP_APPFONT ( 12 , 160 ) ;
+         Size = MAP_APPFONT ( 60 , 8 ) ;
+ 		Text [ en-US ] = "Column t~ype";
+ 	};
+ 	ListBox LB_TYPE1
+ 	{
+-        Pos = MAP_APPFONT ( 76 , 143 ) ;
++        Pos = MAP_APPFONT ( 76 , 158 ) ;
+         Size = MAP_APPFONT ( 60 , 68 ) ;
+ 		TabStop = TRUE ;
+ 		DropDown = TRUE ;
+@@ -194,7 +194,7 @@ ModalDialog RID_SCDLG_ASCII
+ 		HelpId = HID_SC_ASCII_TABCTR ;
+ 		Border = TRUE ;
+         DialogControl = TRUE ;
+-        Pos = MAP_APPFONT ( 12 , 159 ) ;
++        Pos = MAP_APPFONT ( 12 , 176 ) ;
+         Size = MAP_APPFONT ( 243 , 82 ) ;
+ 	};
+ 	CheckBox CB_ASONCE
+@@ -204,6 +204,13 @@ ModalDialog RID_SCDLG_ASCII
+ 		TabStop = TRUE ;
+ 		Text [ en-US ] = "Merge ~delimiters" ;
+ 	};
++    CheckBox CB_QUOTED_AS_TEXT
++    {
++        Pos = MAP_APPFONT ( 20 , 129 ) ;
++        Size = MAP_APPFONT ( 130 , 10 ) ;
++        TabStop = TRUE ;
++        Text [ en-US ] = "~Quoted field as text" ;
++    };
+     String STR_TEXTTOCOLUMNS
+     {
+         Text [ en-US ] = "Text to Columns" ;
+diff --git sc/source/ui/dbgui/csvgrid.cxx sc/source/ui/dbgui/csvgrid.cxx
+index ddbfb44..5725645 100644
+--- sc/source/ui/dbgui/csvgrid.cxx
++++ sc/source/ui/dbgui/csvgrid.cxx
+@@ -737,7 +737,8 @@ void ScCsvGrid::ImplSetTextLineSep(
+     while( *pChar && (nColIx < sal::static_int_cast<sal_uInt32>(CSV_MAXCOLCOUNT)) )
+     {
+         // scan for next cell text
+-        pChar = ScImportExport::ScanNextFieldFromString( pChar, aCellText, cTextSep, pSepChars, bMergeSep );
++        bool bIsQuoted = false;
++        pChar = ScImportExport::ScanNextFieldFromString( pChar, aCellText, cTextSep, pSepChars, bMergeSep, bIsQuoted );
+ 
+         // update column width
+         sal_Int32 nWidth = Max( CSV_MINCOLWIDTH, aCellText.Len() + sal_Int32( 1 ) );
+diff --git sc/source/ui/dbgui/csvruler.cxx sc/source/ui/dbgui/csvruler.cxx
+index 5437f9b..b42ebaf 100644
+--- sc/source/ui/dbgui/csvruler.cxx
++++ sc/source/ui/dbgui/csvruler.cxx
+@@ -37,8 +37,76 @@
+ #include "AccessibleCsvControl.hxx"
  
  
 +#include <optutil.hxx>
@@ -154,7 +307,7 @@
  ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) :
      ScCsvControl( rParent ),
      mnPosCursorLast( 1 )
-@@ -59,6 +127,13 @@ ScCsvRuler::ScCsvRuler( ScCsvControl& rP
+@@ -48,6 +116,13 @@ ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) :
      InitSizeData();
      maBackgrDev.SetFont( GetFont() );
      maRulerDev.SetFont( GetFont() );
@@ -168,10 +321,11 @@
  }
  
  
-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 @@
+diff --git sc/source/ui/dbgui/scuiasciiopt.cxx sc/source/ui/dbgui/scuiasciiopt.cxx
+index 2c31e08..a10e8fb 100644
+--- sc/source/ui/dbgui/scuiasciiopt.cxx
++++ sc/source/ui/dbgui/scuiasciiopt.cxx
+@@ -44,6 +44,12 @@
  // ause
  #include "editutil.hxx"
  
@@ -184,7 +338,7 @@
  //! TODO make dynamic
  #ifdef WIN
  const SCSIZE ASCIIDLG_MAXROWS                = 10000;
-@@ -63,6 +69,20 @@ const SCSIZE ASCIIDLG_MAXROWS           
+@@ -51,6 +57,20 @@ const SCSIZE ASCIIDLG_MAXROWS                = 10000;
  const SCSIZE ASCIIDLG_MAXROWS                = MAXROWCOUNT;
  #endif
  
@@ -199,22 +353,23 @@
 +#define SEPARATORS          "Separators"
 +#define TEXT_SEPARATORS     "TextSeparators"
 +#define MERGE_DELIMITERS    "MergeDelimiters"
++#define QUOTED_AS_TEXT      "QuotedFieldAsText"
 +#define SEP_PATH            "Office.Calc/Dialogs/CSVImport"
 +
-+
  // ============================================================================
  
  void lcl_FillCombo( ComboBox& rCombo, const String& rList, sal_Unicode cSelect )
-@@ -110,11 +130,75 @@ sal_Unicode lcl_CharFromCombo( ComboBox&
+@@ -98,11 +118,78 @@ sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const String& rList )
  	return c;
  }
  
 +static void load_Separators( OUString &sFieldSeparators, OUString &sTextSeparators, 
-+                             bool &bMergeDelimiters, bool &bFixedWidth, sal_Int32 &nFromRow, sal_Int32 &nCharSet )
++                             bool &bMergeDelimiters, bool& bQuotedAsText, bool &bFixedWidth, 
++                             sal_Int32 &nFromRow, sal_Int32 &nCharSet )
 +{
 +    Sequence<Any>aValues;
 +    const Any *pProperties;
-+    Sequence<OUString> aNames(6);
++    Sequence<OUString> aNames(7);
 +    OUString* pNames = aNames.getArray();
 +    ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
 +
@@ -224,6 +379,7 @@
 +    pNames[3] = OUString::createFromAscii( FIXED_WIDTH );
 +    pNames[4] = OUString::createFromAscii( FROM_ROW );
 +    pNames[5] = OUString::createFromAscii( CHAR_SET );
++    pNames[6] = OUString::createFromAscii( QUOTED_AS_TEXT );
 +    aValues = aItem.GetProperties( aNames );
 +    pProperties = aValues.getConstArray();
 +    if( pProperties[1].hasValue() )
@@ -245,14 +401,14 @@
 +        pProperties[5] >>= nCharSet;
 +}
 +
-+static void save_Separators( String maSeparators, String maTxtSep, bool bMergeDelimiters, 
++static void save_Separators( String maSeparators, String maTxtSep, bool bMergeDelimiters, bool bQuotedAsText,
 +                             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);
++    Sequence<OUString> aNames(7);
 +    OUString* pNames = aNames.getArray();
 +    ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
 +
@@ -262,6 +418,7 @@
 +    pNames[3] = OUString::createFromAscii( FIXED_WIDTH );
 +    pNames[4] = OUString::createFromAscii( FROM_ROW );
 +    pNames[5] = OUString::createFromAscii( CHAR_SET );
++    pNames[6] = OUString::createFromAscii( QUOTED_AS_TEXT );
 +    aValues = aItem.GetProperties( aNames );
 +    pProperties = aValues.getArray();
 +    pProperties[1] <<= sFieldSeparators;
@@ -282,7 +439,15 @@
  		ModalDialog	( pParent, ScResId( RID_SCDLG_ASCII ) ),
          mpDatStream  ( pInStream ),
          mnStreamPos( pInStream ? pInStream->Tell() : 0 ),
-@@ -158,14 +242,15 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
+@@ -128,6 +215,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
+ 		aCkbOther	( this, ScResId( CKB_OTHER ) ),
+ 		aEdOther	( this, ScResId( ED_OTHER ) ),
+ 		aCkbAsOnce	( this, ScResId( CB_ASONCE) ),
++        aCkbQuotedAsText( this, ScResId(CB_QUOTED_AS_TEXT) ),
+ 		aFtTextSep	( this, ScResId( FT_TEXTSEP ) ),
+ 		aCbTextSep	( this, ScResId( CB_TEXTSEP ) ),
+ 
+@@ -146,14 +234,15 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
  		aFldSepList	( ScResId( SCSTR_FIELDSEP ) ),
  		aTextSepList( ScResId( SCSTR_TEXTSEP ) ),
          mcTextSep   ( ScAsciiOptions::cDefaultTextSep ),
@@ -301,7 +466,7 @@
      {
          aName.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" - ["));
          aName += aDatName;
-@@ -173,20 +258,47 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
+@@ -161,20 +250,51 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
      }
  	SetText( aName );
  
@@ -311,15 +476,19 @@
 +    OUString sTextSeparators;
 +    bool bMergeDelimiters = false;
 +    bool bFixedWidth = false;
++    bool bQuotedFieldAsText = 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);
++        load_Separators (sFieldSeparators, sTextSeparators, bMergeDelimiters, 
++                         bQuotedFieldAsText, bFixedWidth, nFromRow, nCharSet);
 +    maFieldSeparators = String(sFieldSeparators);
 +
 +    if( bMergeDelimiters )
 +        aCkbAsOnce.Check();
++    if (bQuotedFieldAsText)
++        aCkbQuotedAsText.Check();
 +    if( bFixedWidth )
 +        aRbFixed.Check();
 +    if( nFromRow != 1 )
@@ -358,7 +527,7 @@
  	// Sniff for Unicode / not
      if( !bPreselectUnicode && mpDatStream )
  	{
-@@ -222,6 +334,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
+@@ -210,6 +330,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
  
      // *** Separator characters ***
      lcl_FillCombo( aCbTextSep, aTextSepList, mcTextSep );
@@ -366,7 +535,15 @@
  
      Link aSeparatorHdl =LINK( this, ScImportAsciiDlg, SeparatorHdl );
      aCbTextSep.SetSelectHdl( aSeparatorHdl );
-@@ -242,6 +355,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
+@@ -218,6 +339,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
+     aCkbSemicolon.SetClickHdl( aSeparatorHdl );
+     aCkbComma.SetClickHdl( aSeparatorHdl );
+     aCkbAsOnce.SetClickHdl( aSeparatorHdl );
++    aCkbQuotedAsText.SetClickHdl( aSeparatorHdl );
+     aCkbSpace.SetClickHdl( aSeparatorHdl );
+     aCkbOther.SetClickHdl( aSeparatorHdl );
+     aEdOther.SetModifyHdl( aSeparatorHdl );
+@@ -230,6 +352,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
  	aLbCharSet.InsertTextEncoding( RTL_TEXTENCODING_DONTKNOW, aCharSetUser );
  	aLbCharSet.SelectTextEncoding( bPreselectUnicode ?
  		RTL_TEXTENCODING_UNICODE : gsl_getSystemTextEncoding() );
@@ -377,20 +554,139 @@
      SetSelectedCharSet();
  	aLbCharSet.SetSelectHdl( LINK( this, ScImportAsciiDlg, CharSetHdl ) );
  
-@@ -273,6 +390,9 @@ ScImportAsciiDlg::ScImportAsciiDlg( Wind
+@@ -261,6 +387,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
  
  ScImportAsciiDlg::~ScImportAsciiDlg()
  {
 +    if (mbFileImport)
 +        save_Separators( maFieldSeparators, aCbTextSep.GetText(), aCkbAsOnce.IsChecked(), 
-+                         aRbFixed.IsChecked(), aNfRow.GetValue(), aLbCharSet.GetSelectEntryPos());
++                         aCkbQuotedAsText.IsChecked(), aRbFixed.IsChecked(), 
++                         aNfRow.GetValue(), aLbCharSet.GetSelectEntryPos());
  	delete[] mpRowPosArray;
  }
  
-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:
+@@ -346,6 +476,7 @@ void ScImportAsciiDlg::GetOptions( ScAsciiOptions& rOpt )
+     {
+         rOpt.SetFieldSeps( GetSeparators() );
+         rOpt.SetMergeSeps( aCkbAsOnce.IsChecked() );
++        rOpt.SetQuotedAsText(aCkbQuotedAsText.IsChecked());
+         rOpt.SetTextSep( lcl_CharFromCombo( aCbTextSep, aTextSepList ) );
+     }
+ }
+@@ -357,6 +488,10 @@ void ScImportAsciiDlg::SetTextToColumnsMode()
+     aLbCharSet.Disable();
+     aFtRow.Disable();
+     aNfRow.Disable();
++
++    // Quoted field as text option is not used for text to columns mode.
++    aCkbQuotedAsText.Check(false);
++    aCkbQuotedAsText.Disable();
+ }
+ 
+ void ScImportAsciiDlg::SetSelectedCharSet()
+@@ -393,6 +528,7 @@ void ScImportAsciiDlg::SetupSeparatorCtrls()
+     aCkbOther.Enable( bEnable );
+     aEdOther.Enable( bEnable );
+     aCkbAsOnce.Enable( bEnable );
++    aCkbQuotedAsText.Enable( bEnable );
+     aFtTextSep.Enable( bEnable );
+     aCbTextSep.Enable( bEnable );
+ }
+diff --git sc/source/ui/docshell/impex.cxx sc/source/ui/docshell/impex.cxx
+index 344dcae..d2cb0cd 100644
+--- sc/source/ui/docshell/impex.cxx
++++ sc/source/ui/docshell/impex.cxx
+@@ -792,12 +792,10 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm )
+ 		//
+ 
+ 
+-bool lcl_PutString( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab,
+-					const String& rStr, BYTE nColFormat,
+-                    ::utl::TransliterationWrapper& rTransliteration,
+-					CalendarWrapper& rCalendar,
+-                    ::utl::TransliterationWrapper* pSecondTransliteration,
+-					CalendarWrapper* pSecondCalendar )
++static bool lcl_PutString( 
++    ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rStr, BYTE nColFormat,
++    ::utl::TransliterationWrapper& rTransliteration, CalendarWrapper& rCalendar,
++    ::utl::TransliterationWrapper* pSecondTransliteration, CalendarWrapper* pSecondCalendar )
+ {
+     bool bMultiLine = false;
+ 	if ( nColFormat == SC_COL_SKIP || !rStr.Len() || !ValidCol(nCol) || !ValidRow(nRow) )
+@@ -1168,7 +1166,8 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
+                 // SC_COL_SKIP.
+                 while (*p && nCol <= MAXCOL+1)
+                 {
+-                    p = ScImportExport::ScanNextFieldFromString( p, aCell, cStr, pSeps, bMerge );
++                    bool bIsQuoted = false;
++                    p = ScImportExport::ScanNextFieldFromString( p, aCell, cStr, pSeps, bMerge, bIsQuoted );
+ 
+                     BYTE nFmt = SC_COL_STANDARD;
+                     for ( i=nInfoStart; i<nInfoCount; i++ )
+@@ -1185,10 +1184,15 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
+                         if (nCol > MAXCOL)
+                             bOverflow = TRUE;       // display warning on import
+                         else if (!bDetermineRange)
++                        {
++                            if (bIsQuoted && pExtOptions && pExtOptions->IsQuotedAsText())
++                                nFmt = SC_COL_TEXT;
++
+                             bMultiLine |= lcl_PutString( pDoc, nCol, nRow,
+                                     nTab, aCell, nFmt, aTransliteration,
+                                     aCalendar, pEnglishTransliteration,
+                                     pEnglishCalendar);
++                        }
+                         ++nCol;
+                     }
+ 
+@@ -1262,11 +1266,13 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
+ 
+ // static
+ const sal_Unicode* ScImportExport::ScanNextFieldFromString( const sal_Unicode* p,
+-		String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, BOOL bMergeSeps )
++		String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted )
+ {
++    rbIsQuoted = false;
+ 	rField.Erase();
+ 	if ( *p == cStr )			// String in Anfuehrungszeichen
+ 	{
++        rbIsQuoted = true;
+         const sal_Unicode* p1;
+ 		p1 = p = lcl_ScanString( p, rField, cStr, DQM_ESCAPE );
+ 		while ( *p && !ScGlobal::UnicodeStrChr( pSeps, *p ) )
+diff --git sc/source/ui/inc/asciiopt.hxx sc/source/ui/inc/asciiopt.hxx
+index 1d12606..394f2dc 100644
+--- sc/source/ui/inc/asciiopt.hxx
++++ sc/source/ui/inc/asciiopt.hxx
+@@ -65,6 +65,7 @@ private:
+ 	BOOL		bFixedLen;
+ 	String		aFieldSeps;
+ 	BOOL		bMergeFieldSeps;
++    bool        bQuotedFieldAsText;
+ 	sal_Unicode	cTextSep;
+ 	CharSet		eCharSet;
+ 	BOOL		bCharSetSystem;
+@@ -93,6 +94,7 @@ public:
+ 	BOOL				GetCharSetSystem() const	{ return bCharSetSystem; }
+ 	const String&		GetFieldSeps() const	{ return aFieldSeps; }
+ 	BOOL				IsMergeSeps() const		{ return bMergeFieldSeps; }
++    bool                IsQuotedAsText() const  { return bQuotedFieldAsText; }
+ 	sal_Unicode			GetTextSep() const		{ return cTextSep; }
+ 	BOOL				IsFixedLen() const		{ return bFixedLen; }
+ 	USHORT				GetInfoCount() const	{ return nInfoCount; }
+@@ -105,6 +107,7 @@ public:
+ 	void	SetFixedLen( BOOL bSet )			{ bFixedLen = bSet; }
+ 	void	SetFieldSeps( const String& rStr )	{ aFieldSeps = rStr; }
+ 	void	SetMergeSeps( BOOL bSet )			{ bMergeFieldSeps = bSet; }
++    void    SetQuotedAsText(bool bSet)          { bQuotedFieldAsText = bSet; }
+ 	void	SetTextSep( sal_Unicode c )			{ cTextSep = c; }
+ 	void	SetStartRow( long nRow)				{ nStartRow= nRow; }
+ 
+diff --git sc/source/ui/inc/csvruler.hxx sc/source/ui/inc/csvruler.hxx
+index c251831..cd67708 100644
+--- sc/source/ui/inc/csvruler.hxx
++++ sc/source/ui/inc/csvruler.hxx
+@@ -71,6 +71,7 @@ private:
      // ------------------------------------------------------------------------
  public:
      explicit                    ScCsvRuler( ScCsvControl& rParent );
@@ -398,10 +694,32 @@
  
      // common ruler handling --------------------------------------------------
  public:
-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
+diff --git sc/source/ui/inc/impex.hxx sc/source/ui/inc/impex.hxx
+index 515063a..aaddeeb 100644
+--- sc/source/ui/inc/impex.hxx
++++ sc/source/ui/inc/impex.hxx
+@@ -98,7 +98,7 @@ public:
+ 
+ 	static BOOL  IsFormatSupported( ULONG nFormat );
+ 	static const sal_Unicode* ScanNextFieldFromString( const sal_Unicode* p,
+-			String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, BOOL bMergeSeps );
++			String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted );
+ 	static	void	WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, BOOL bZero = FALSE );
+ 	static	void	WriteUnicodeOrByteEndl( SvStream& rStrm );
+ 	static	inline	BOOL	IsEndianSwap( const SvStream& rStrm );
+diff --git sc/source/ui/inc/scuiasciiopt.hxx sc/source/ui/inc/scuiasciiopt.hxx
+index 6712193..45c3e71 100644
+--- sc/source/ui/inc/scuiasciiopt.hxx
++++ sc/source/ui/inc/scuiasciiopt.hxx
+@@ -64,6 +64,7 @@ class ScImportAsciiDlg : public ModalDialog
+     CheckBox                    aCkbOther;
+     Edit                        aEdOther;
+     CheckBox                    aCkbAsOnce;
++    CheckBox                    aCkbQuotedAsText;
+     FixedText                   aFtTextSep;
+     ComboBox                    aCbTextSep;
+ 
+@@ -87,6 +88,7 @@ class ScImportAsciiDlg : public ModalDialog
  
      CharSet                     meCharSet;          /// Selected char set.
      bool                        mbCharSetSystem;    /// Is System char set selected?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]