summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-22 12:27:25 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-24 22:51:13 +0200
commit7ab34f414bc14b1cfa491952e259e11a83df5b9e (patch)
tree62d62865d674df2a46b6008a3d3ac37fa231bb65 /sc/source/ui/docshell
parentea9989ad770f31aae379dbe6d2cadece3f4f10d7 (diff)
sc filter: Read "FilterOptions" in HTML export filter
Change-Id: I3644b5d0bf5f485e1261c478996c95981f6055cb
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r--sc/source/ui/docshell/docsh.cxx27
-rw-r--r--sc/source/ui/docshell/impex.cxx9
2 files changed, 25 insertions, 11 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 871adbe8bcc3..87011f08de33 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2424,26 +2424,35 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
SvStream* pStream = rMed.GetOutStream();
if ( pStream )
{
- WaitObject aWait( GetActiveDialogParent() );
- ScImportExport aImExport( &aDocument );
- aImExport.SetStreamPath( rMed.GetName() );
- bRet = aImExport.ExportStream( *pStream, rMed.GetBaseURL( true ), SOT_FORMATSTR_ID_HTML );
- if ( bRet && !aImExport.GetNonConvertibleChars().isEmpty() )
- SetError( *new StringErrorInfo(
+ SfxItemSet* pSet = rMed.GetItemSet();
+ const SfxPoolItem* pItem;
+ OUString sFilterOptions;
+
+ if (pSet->GetItemState(SID_FILE_FILTEROPTIONS, true, &pItem) == SFX_ITEM_SET)
+ sFilterOptions = ((SfxStringItem*)pItem)->GetValue();
+
+ WaitObject aWait(GetActiveDialogParent());
+ ScImportExport aImExport(&aDocument);
+ aImExport.SetStreamPath(rMed.GetName());
+ aImExport.SetFilterOptions(sFilterOptions);
+ bRet = aImExport.ExportStream(*pStream, rMed.GetBaseURL(true), SOT_FORMATSTR_ID_HTML);
+ if (bRet && !aImExport.GetNonConvertibleChars().isEmpty())
+ {
+ SetError(*new StringErrorInfo(
SCWARN_EXPORT_NONCONVERTIBLE_CHARS,
aImExport.GetNonConvertibleChars(),
- ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO ), OUString( OSL_LOG_PREFIX ) );
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO), OUString(OSL_LOG_PREFIX));
+ }
}
}
else
{
if (GetError())
- SetError(SCERR_IMPORT_NI, OUString( OSL_LOG_PREFIX ) );
+ SetError(SCERR_IMPORT_NI, OUString(OSL_LOG_PREFIX));
}
return bRet;
}
-
bool ScDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor )
{
return SfxObjectShell::SaveCompleted( xStor );
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index bb103b5ca020..9882966a1992 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -183,6 +183,11 @@ void ScImportExport::SetExtOptions( const ScAsciiOptions& rOpt )
cStr = rOpt.GetTextSep();
}
+void ScImportExport::SetFilterOptions(const OUString& rFilterOptions)
+{
+ maFilterOptions = rFilterOptions;
+}
+
bool ScImportExport::IsFormatSupported( sal_uLong nFormat )
{
return nFormat == FORMAT_STRING
@@ -2064,7 +2069,7 @@ bool ScImportExport::Doc2HTML( SvStream& rStrm, const OUString& rBaseURL )
{
// rtl_TextEncoding is ignored in ScExportHTML, read from Load/Save HTML options
ScFormatFilter::Get().ScExportHTML( rStrm, rBaseURL, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW, bAll,
- aStreamPath, aNonConvertibleChars );
+ aStreamPath, aNonConvertibleChars, maFilterOptions );
return rStrm.GetError() == SVSTREAM_OK;
}
@@ -2199,7 +2204,7 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
virtual FltError ScExportDif( SvStream&, ScDocument*, const ScAddress&, const rtl_TextEncoding, sal_uInt32 ) SAL_OVERRIDE { return eERR_INTERN; }
virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange&, const rtl_TextEncoding, sal_uInt32 ) SAL_OVERRIDE { return eERR_INTERN; }
virtual FltError ScExportHTML( SvStream&, const OUString&, ScDocument*, const ScRange&, const rtl_TextEncoding, bool,
- const OUString&, OUString& ) SAL_OVERRIDE { return eERR_INTERN; }
+ const OUString&, OUString&, const OUString& ) SAL_OVERRIDE { return eERR_INTERN; }
virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange&, const rtl_TextEncoding ) SAL_OVERRIDE { return eERR_INTERN; }
virtual ScOrcusFilters* GetOrcusFilters() SAL_OVERRIDE { return NULL; }