summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/filter.hxx6
-rw-r--r--sc/source/filter/html/htmlexp.cxx26
-rw-r--r--sc/source/filter/inc/htmlexp.hxx7
-rw-r--r--sc/source/ui/docshell/docsh.cxx9
-rw-r--r--sc/source/ui/docshell/impex.cxx9
-rw-r--r--sc/source/ui/inc/impex.hxx7
6 files changed, 41 insertions, 23 deletions
diff --git a/sc/inc/filter.hxx b/sc/inc/filter.hxx
index b321cd2c3582..9fe72b7469a5 100644
--- a/sc/inc/filter.hxx
+++ b/sc/inc/filter.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filter.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dr $ $Date: 2001-04-05 10:54:23 $
+ * last change: $Author: er $ $Date: 2001-07-20 18:34:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -158,7 +158,7 @@ FltError ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const CharS
UINT32 nDifOption = SC_DIFOPT_EXCEL );
FltError ScExportHTML( SvStream&, ScDocument*, const ScRange& rRange, const CharSet eDest, BOOL bAll,
- const String& rStreamPath );
+ const String& rStreamPath, String& rNonConvertibleChars );
FltError ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const CharSet eDest );
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index b14ddee6d4b3..c9e05b22f5cf 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.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: er $ $Date: 2001-07-17 18:43:35 $
+ * last change: $Author: er $ $Date: 2001-07-20 18:35:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -175,7 +175,8 @@ const sal_Char __FAR_DATA ScHTMLExport::sIndentSource[nIndentMax+1] =
<< ScExportBase::sNewLine)
#define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag )
#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag, FALSE )
-#define OUT_STR( str ) HTMLOutFuncs::Out_String( rStrm, str, eDestEnc )
+#define OUT_STR( str ) HTMLOutFuncs::Out_String( rStrm, str, eDestEnc, &aNonConvertibleChars )
+#define OUT_STR_NO_CONV( str ) HTMLOutFuncs::Out_String( rStrm, str, eDestEnc )
#define OUT_LF() rStrm << ScExportBase::sNewLine << GetIndentStr()
#define lcl_OUT_LF() rStrm << ScExportBase::sNewLine
#define TAG_ON_LF( tag ) (TAG_ON( tag ) << ScExportBase::sNewLine << GetIndentStr())
@@ -184,7 +185,7 @@ const sal_Char __FAR_DATA ScHTMLExport::sIndentSource[nIndentMax+1] =
#define OUT_COMMENT( comment ) (rStrm << sMyBegComment, OUT_STR( comment ) \
<< sMyEndComment << ScExportBase::sNewLine \
<< GetIndentStr())
-#define lcl_OUT_COMMENT( comment ) (rStrm << sMyBegComment, OUT_STR( comment ) \
+#define lcl_OUT_COMMENT( comment ) (rStrm << sMyBegComment, OUT_STR_NO_CONV( comment ) \
<< sMyEndComment << ScExportBase::sNewLine)
#define OUT_SP_CSTR_ASS( s ) rStrm << ' ' << s << '='
@@ -200,10 +201,12 @@ extern BOOL bOderSo;
FltError ScExportHTML( SvStream& rStrm, ScDocument* pDoc,
const ScRange& rRange, const CharSet eNach, BOOL bAll,
- const String& rStreamPath )
+ const String& rStreamPath, String& rNonConvertibleChars )
{
ScHTMLExport aEx( rStrm, pDoc, rRange, bAll, rStreamPath );
- return aEx.Write();
+ FltError nErr = aEx.Write();
+ rNonConvertibleChars = aEx.GetNonConvertibleChars();
+ return nErr;
}
@@ -418,7 +421,7 @@ void ScHTMLExport::WriteHeader()
IncIndent(1); TAG_ON_LF( sHTML_head );
- SfxFrameHTMLWriter::Out_DocInfo( rStrm, &rInfo, sIndent, eDestEnc );
+ SfxFrameHTMLWriter::Out_DocInfo( rStrm, &rInfo, sIndent, eDestEnc, &aNonConvertibleChars );
OUT_LF();
//----------------------------------------------------------
@@ -1145,7 +1148,7 @@ void ScHTMLExport::WriteCell( USHORT nCol, USHORT nRow, USHORT nTab )
}
}
HTMLOutFuncs::CreateTableDataOptionsValNum( aStrTD, bValueData, fVal,
- nFormat, *pFormatter, eDestEnc );
+ nFormat, *pFormatter, eDestEnc, &aNonConvertibleChars );
TAG_ON( aStrTD.GetBuffer() );
@@ -1164,7 +1167,8 @@ void ScHTMLExport::WriteCell( USHORT nCol, USHORT nRow, USHORT nTab )
if ( nFonts == 1 )
{
ByteString aTmpStr;
- HTMLOutFuncs::ConvertStringToHTML( rFontItem.GetFamilyName(), aTmpStr, eDestEnc );
+ HTMLOutFuncs::ConvertStringToHTML( rFontItem.GetFamilyName(),
+ aTmpStr, eDestEnc, &aNonConvertibleChars );
aStr += aTmpStr;
}
else
@@ -1173,7 +1177,9 @@ void ScHTMLExport::WriteCell( USHORT nCol, USHORT nRow, USHORT nTab )
for ( xub_StrLen j = 0, nPos = 0; j < nFonts; j++ )
{
ByteString aTmpStr;
- HTMLOutFuncs::ConvertStringToHTML( rList.GetToken( 0, ';', nPos ), aTmpStr, eDestEnc );
+ HTMLOutFuncs::ConvertStringToHTML(
+ rList.GetToken( 0, ';', nPos ), aTmpStr, eDestEnc,
+ &aNonConvertibleChars );
aStr += aTmpStr;
if ( j < nFonts-1 )
aStr += ',';
diff --git a/sc/source/filter/inc/htmlexp.hxx b/sc/source/filter/inc/htmlexp.hxx
index 7c611371fd69..36f1ee2d3777 100644
--- a/sc/source/filter/inc/htmlexp.hxx
+++ b/sc/source/filter/inc/htmlexp.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: htmlexp.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:45:13 $
+ * last change: $Author: er $ $Date: 2001-07-20 18:35:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -138,6 +138,7 @@ class ScHTMLExport : public ScExportBase
OutputDevice* pAppWin; // fuer Pixelei
SvStringsSortDtor* pSrcArr; // fuer CopyLocalFileToINet
SvStringsSortDtor* pDestArr;
+ String aNonConvertibleChars; // collect nonconvertible characters
rtl_TextEncoding eDestEnc;
USHORT nUsedTables;
short nIndent;
@@ -197,6 +198,8 @@ public:
BOOL bAll, const String& aStreamPath );
virtual ~ScHTMLExport();
ULONG Write();
+ const String& GetNonConvertibleChars() const
+ { return aNonConvertibleChars; }
};
#endif
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 9b8a4f875db4..6b2c7f4e83b0 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docsh.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: nn $ $Date: 2001-06-26 18:52:37 $
+ * last change: $Author: er $ $Date: 2001-07-20 18:37:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1943,6 +1943,11 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
ScImportExport aImExport( &aDocument );
aImExport.SetStreamPath( rMed.GetName() );
bRet = aImExport.ExportStream( *pStream, SOT_FORMATSTR_ID_HTML );
+ if ( bRet && aImExport.GetNonConvertibleChars().Len() )
+ SetError( *new StringErrorInfo(
+ SCWARN_EXPORT_NONCONVERTIBLE_CHARS,
+ aImExport.GetNonConvertibleChars(),
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO ) );
}
}
else
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 177dd1b85d57..79b39fa0bb05 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impex.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: er $ $Date: 2001-07-11 15:59:09 $
+ * last change: $Author: er $ $Date: 2001-07-20 18:37:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1507,8 +1507,9 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
BOOL ScImportExport::Doc2HTML( SvStream& rStrm )
{
- // CharSet is ignored in ScExportHTML
- ScExportHTML( rStrm, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW, bAll, aStreamPath );
+ // CharSet is ignored in ScExportHTML, read from Load/Save HTML options
+ ScExportHTML( rStrm, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW, bAll,
+ aStreamPath, aNonConvertibleChars );
return BOOL( rStrm.GetError() == SVSTREAM_OK );
}
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index b153b7a9babb..dcb0f92a72db 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impex.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: nn $ $Date: 2001-06-29 20:24:44 $
+ * last change: $Author: er $ $Date: 2001-07-20 18:36:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -83,6 +83,7 @@ class ScImportExport
ScDocument* pUndoDoc;
ScRange aRange;
String aStreamPath;
+ String aNonConvertibleChars;
ULONG nSizeLimit;
sal_Unicode cSep; // Separator
sal_Unicode cStr; // String Delimiter
@@ -162,6 +163,8 @@ public:
::com::sun::star::uno::Any & rValue );
BOOL IsOverflow() const { return bOverflow; } // nach dem Importieren
+
+ const String& GetNonConvertibleChars() const { return aNonConvertibleChars; }
};