summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <er@openoffice.org>2002-03-14 15:08:23 +0000
committerEike Rathke <er@openoffice.org>2002-03-14 15:08:23 +0000
commit2ed67b6eac75bfacd19cb42d0d9fd3d4ad871d62 (patch)
treeeee4f29457200023534e435ebedcb5ebff898907
parent96c0f095bbddc547b1d00f59e5a56e695bfc8d2a (diff)
#97251# if clipboard, always write UTF-8 and charset info
-rw-r--r--sc/source/filter/html/htmlexp.cxx50
1 files changed, 26 insertions, 24 deletions
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 32f294b469fc..f00c8b3eff74 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: htmlexp.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: nn $ $Date: 2002-03-11 17:07:12 $
+ * last change: $Author: er $ $Date: 2002-03-14 16:08:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -313,7 +313,7 @@ ScHTMLExport::ScHTMLExport( SvStream& rStrmP, ScDocument* pDocP,
// set HTML configuration
OfaHtmlOptions* pHtmlOptions = ((OfficeApplication*)SFX_APP())->GetHtmlOptions();
- eDestEnc = pHtmlOptions->GetTextEncoding();
+ eDestEnc = (pDoc->IsClipOrUndo() ? RTL_TEXTENCODING_UTF8 : pHtmlOptions->GetTextEncoding());
bCopyLocalFileToINet = pHtmlOptions->IsSaveGraphicsLocal();
for ( USHORT j=0; j < SC_HTML_FONTSIZES; j++ )
{
@@ -401,11 +401,8 @@ ULONG ScHTMLExport::Write()
rStrm << '<' << sHTML_doctype << ' ' << sHTML_doctype32 << '>'
<< sNewLine << sNewLine;
TAG_ON_LF( sHTML_html );
- if ( bAll )
- {
- WriteHeader();
- OUT_LF();
- }
+ WriteHeader();
+ OUT_LF();
WriteBody();
OUT_LF();
TAG_OFF_LF( sHTML_html );
@@ -416,26 +413,31 @@ ULONG ScHTMLExport::Write()
void ScHTMLExport::WriteHeader()
{
- SfxDocumentInfo& rInfo = pDoc->GetDocumentShell()->GetDocInfo();
- String aStrOut;
-
IncIndent(1); TAG_ON_LF( sHTML_head );
- SfxFrameHTMLWriter::Out_DocInfo( rStrm, &rInfo, sIndent, eDestEnc, &aNonConvertibleChars );
- OUT_LF();
-
- //----------------------------------------------------------
- if ( rInfo.GetPrinted().GetName().Len() )
- {
- OUT_COMMENT( GLOBSTR( STR_DOC_INFO ) );
- aStrOut = GLOBSTR( STR_DOC_PRINTED );
- aStrOut.AppendAscii( ": " );
- lcl_AddStamp( aStrOut, rInfo.GetPrinted(), *ScGlobal::pLocaleData );
- OUT_COMMENT( aStrOut );
+ if ( pDoc->IsClipOrUndo() )
+ { // no real DocInfo available, but some META information like charset needed
+ SfxFrameHTMLWriter::Out_DocInfo( rStrm, NULL, sIndent, eDestEnc, &aNonConvertibleChars );
}
- //----------------------------------------------------------
+ else
+ {
+ SfxDocumentInfo& rInfo = pDoc->GetDocumentShell()->GetDocInfo();
+ SfxFrameHTMLWriter::Out_DocInfo( rStrm, &rInfo, sIndent, eDestEnc, &aNonConvertibleChars );
+ OUT_LF();
- lcl_WriteTeamInfo( rStrm, eDestEnc );
+ //----------------------------------------------------------
+ if ( rInfo.GetPrinted().GetName().Len() )
+ {
+ OUT_COMMENT( GLOBSTR( STR_DOC_INFO ) );
+ String aStrOut( GLOBSTR( STR_DOC_PRINTED ) );
+ aStrOut.AppendAscii( ": " );
+ lcl_AddStamp( aStrOut, rInfo.GetPrinted(), *ScGlobal::pLocaleData );
+ OUT_COMMENT( aStrOut );
+ }
+ //----------------------------------------------------------
+
+ lcl_WriteTeamInfo( rStrm, eDestEnc );
+ }
IncIndent(-1); OUT_LF(); TAG_OFF_LF( sHTML_head );
}