diff options
author | Andreas Bregas <ab@openoffice.org> | 2011-02-11 15:06:12 +0100 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2011-02-11 15:06:12 +0100 |
commit | 282392f643d63a1b76e69821a4c19a4162808d21 (patch) | |
tree | 735deb4f2382b39494f7bf5380cf463a1ada2834 /sc | |
parent | 6f68642b7b2310b902264849a5ffc5dca6c15510 (diff) |
ab80: Adding changes of cws mib21, ab77, ab77run2, dr77i to dev300
ab77: #163789# Handle class module factories document specific
ab77: #163732# Defer removal of documents until XCloseListener::notifyClosing
ab77: #163808# make VBA symbols Application.ScreenUpdating and Application.Interactive work globally on all documents
ab77: wae
ab77: #163840# read UTF-8 BOM
ab77: #163732# VBA UserForm_Terminate triggered too late while closing document
ab77: minor correction
ab77: assertion: do not call ::rtl::OUString::copy() with negative index
ab77run2: #163869# do not call Class_Terminate VBA macros when document disposes
dr77i: #163941# do not update drawing layer when pasting from clipboard after cut
mib21: #163944# ignore trailing whitespace in Basic source lines
mib21: #163948# allow to manually pack MSVC DLLs into extensions
mib21: #163948# multiprocess build fix
Authors:
Andreas Bregas <ab@openoffice.org>
Daniel Rentz [dr] <daniel.rentz@oracle.com>
Eike Rathke [er] <eike.rathke@oracle.com>
Diffstat (limited to 'sc')
-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 3711b1b68603..e2b876cfab01 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1983,7 +1983,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SetInsertingFromOtherDoc( 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 2088cc84a791..f35a37eab0c6 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -263,8 +263,7 @@ DifParser::DifParser( SvStream& rNewIn, const UINT32 nOption, ScDocument& rDoc, 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 42f2a2d86933..89a7c9340a9c 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 ); ULONG nUniPos = mpDatStream->Tell(); - if ( nUniPos > 0 ) - bPreselectUnicode = TRUE; // read 0xfeff/0xfffe - else + switch (nUniPos) { - 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 = TRUE; + 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<USHORT>(nCharSet) ); SetSelectedCharSet(); @@ -437,8 +448,7 @@ bool ScImportAsciiDlg::GetLine( 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 a17279f409a9..b9ce9a5b0e9c 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -826,8 +826,7 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm ) SCCOL nEndCol = aRange.aEnd.Col(); SCROW nEndRow = aRange.aEnd.Row(); ULONG nOldPos = rStrm.Tell(); - if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE ) - rStrm.StartReadingUnicodeText(); + rStrm.StartReadingUnicodeText( rStrm.GetStreamCharSet() ); BOOL bData = BOOL( !bSingle ); if( !bSingle) bOk = StartPaste(); @@ -1167,8 +1166,7 @@ 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() ); BOOL bOld = ScColumn::bDoubleAlloc; ScColumn::bDoubleAlloc = TRUE; |