diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2011-02-16 13:08:06 +0100 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2011-02-16 13:08:06 +0100 |
commit | 0eb12dbec57938d9c418ead57c403983af033650 (patch) | |
tree | 4102e4de8cd1e7227f7a46f675283671e4ce61df | |
parent | 127e62d7db88c98b88e660b4d28d9adbf11a6cb6 (diff) | |
parent | ab2aee29e144452c6c2980854eaccfe5c354c007 (diff) |
CWS-TOOLING: integrate CWS ab80
-rw-r--r-- | sc/source/core/data/document.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/dif/difimp.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/scuiasciiopt.cxx | 62 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 6 |
4 files changed, 40 insertions, 33 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index a64387ec8..c340bcde1 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1986,7 +1986,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SetInsertingFromOtherDoc( sal_True); UpdateReference( URM_MOVE, nCol1, nRow1, i, nCol2, nRow2, i+nFollow, - nDx, nDy, nDz, pCBFCP->pRefUndoDoc ); + nDx, nDy, nDz, pCBFCP->pRefUndoDoc, FALSE ); SetInsertingFromOtherDoc( bOldInserting); } else diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index 7f458d7b3..23e08b602 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -263,8 +263,7 @@ DifParser::DifParser( SvStream& rNewIn, const sal_uInt32 nOption, ScDocument& rD DBG_ERRORFILE( "CharSet passed overrides and modifies StreamCharSet" ); rIn.SetStreamCharSet( eCharSet ); } - if ( eCharSet == RTL_TEXTENCODING_UNICODE ) - rIn.StartReadingUnicodeText(); + rIn.StartReadingUnicodeText( eCharSet ); bPlain = ( nOption == SC_DIFOPT_PLAIN ); diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 7dbe9b24b..dcd7fb40c 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -316,34 +316,45 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, maFieldSeparators = GetSeparators(); // Clipboard is always Unicode, else detect. - bool bPreselectUnicode = !mbFileImport; + rtl_TextEncoding ePreselectUnicode = (mbFileImport ? + RTL_TEXTENCODING_DONTKNOW : RTL_TEXTENCODING_UNICODE); // Sniff for Unicode / not - if( !bPreselectUnicode && mpDatStream ) + if( ePreselectUnicode == RTL_TEXTENCODING_DONTKNOW && mpDatStream ) { Seek( 0 ); - mpDatStream->StartReadingUnicodeText(); + mpDatStream->StartReadingUnicodeText( RTL_TEXTENCODING_DONTKNOW ); sal_uLong nUniPos = mpDatStream->Tell(); - if ( nUniPos > 0 ) - bPreselectUnicode = sal_True; // read 0xfeff/0xfffe - else + switch (nUniPos) { - sal_uInt16 n; - *mpDatStream >> n; - // Assume that normal ASCII/ANSI/ISO/etc. text doesn't start with - // control characters except CR,LF,TAB - if ( (n & 0xff00) < 0x2000 ) - { - switch ( n & 0xff00 ) + case 2: + ePreselectUnicode = RTL_TEXTENCODING_UNICODE; // UTF-16 + break; + case 3: + ePreselectUnicode = RTL_TEXTENCODING_UTF8; // UTF-8 + break; + case 0: { - case 0x0900 : - case 0x0a00 : - case 0x0d00 : - break; - default: - bPreselectUnicode = sal_True; + sal_uInt16 n; + *mpDatStream >> n; + // Assume that normal ASCII/ANSI/ISO/etc. text doesn't start with + // control characters except CR,LF,TAB + if ( (n & 0xff00) < 0x2000 ) + { + switch ( n & 0xff00 ) + { + case 0x0900 : + case 0x0a00 : + case 0x0d00 : + break; + default: + ePreselectUnicode = RTL_TEXTENCODING_UNICODE; // UTF-16 + } + } + mpDatStream->Seek(0); } - } - mpDatStream->Seek(0); + break; + default: + ; // nothing } mnStreamPos = mpDatStream->Tell(); } @@ -373,10 +384,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, // Insert one "SYSTEM" entry for compatibility in AsciiOptions and system // independent document linkage. aLbCharSet.InsertTextEncoding( RTL_TEXTENCODING_DONTKNOW, aCharSetUser ); - aLbCharSet.SelectTextEncoding( bPreselectUnicode ? - RTL_TEXTENCODING_UNICODE : gsl_getSystemTextEncoding() ); + aLbCharSet.SelectTextEncoding( ePreselectUnicode == RTL_TEXTENCODING_DONTKNOW ? + gsl_getSystemTextEncoding() : ePreselectUnicode ); - if( nCharSet >= 0 ) + if( nCharSet >= 0 && ePreselectUnicode == RTL_TEXTENCODING_DONTKNOW ) aLbCharSet.SelectEntryPos( static_cast<sal_uInt16>(nCharSet) ); SetSelectedCharSet(); @@ -437,8 +448,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, String &rText ) memset( mpRowPosArray, 0, sizeof(mpRowPosArray[0]) * (ASCIIDLG_MAXROWS+2)); Seek(0); - if ( mpDatStream->GetStreamCharSet() == RTL_TEXTENCODING_UNICODE ) - mpDatStream->StartReadingUnicodeText(); + mpDatStream->StartReadingUnicodeText( mpDatStream->GetStreamCharSet() ); mnStreamPos = mpDatStream->Tell(); mpRowPosArray[mnRowPosCount] = mnStreamPos; diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index e5c7d4e45..98f2453ff 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -826,8 +826,7 @@ sal_Bool ScImportExport::Text2Doc( SvStream& rStrm ) SCCOL nEndCol = aRange.aEnd.Col(); SCROW nEndRow = aRange.aEnd.Row(); sal_uLong nOldPos = rStrm.Tell(); - if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE ) - rStrm.StartReadingUnicodeText(); + rStrm.StartReadingUnicodeText( rStrm.GetStreamCharSet() ); sal_Bool bData = sal_Bool( !bSingle ); if( !bSingle) bOk = StartPaste(); @@ -1167,8 +1166,7 @@ sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm ) ::std::auto_ptr<ScProgress> xProgress( new ScProgress( pDocSh, ScGlobal::GetRscString( STR_LOAD_DOC ), rStrm.Tell() - nOldPos )); rStrm.Seek( nOldPos ); - if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE ) - rStrm.StartReadingUnicodeText(); + rStrm.StartReadingUnicodeText( rStrm.GetStreamCharSet() ); sal_Bool bOld = ScColumn::bDoubleAlloc; ScColumn::bDoubleAlloc = sal_True; |