Kaydet (Commit) 043bf229 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Don't use RTL_TEXTENCODING_DONTKNOW in OUStringToOString

CppunitTest_sc_subsequent_export_test would run into that as below, so better
find a more suitable encoding here (similar to what RTFDocumentImpl::getEncoding
in writerfilter/source/rtftok/rtfdocumentimpl.cxx does to "Guess based on
locale").

> rtl::OUStringToOString(rtl::OUString const&, unsigned short, unsigned int) at include/rtl/ustring.hxx:3662
> XclExpHyperlink::XclExpHyperlink(XclExpRoot const&, SvxURLField const&, ScAddress const&) at sc/source/filter/excel/xecontent.cxx:370
> XclExpHyperlinkHelper::ProcessUrlField(SvxURLField const&) at sc/source/filter/excel/xehelper.cxx:307
> (anonymous namespace)::lclCreateFormattedString(XclExpRoot const&, EditEngine&, XclExpHyperlinkHelper*, unsigned short, unsigned short) at sc/source/filter/excel/xehelper.cxx:471
> XclExpStringHelper::CreateCellString(XclExpRoot const&, EditTextObject const&, ScPatternAttr const*, XclExpHyperlinkHelper&, unsigned short, unsigned short) at sc/source/filter/excel/xehelper.cxx:583
> XclExpLabelCell::XclExpLabelCell(XclExpRoot const&, XclAddress const&, ScPatternAttr const*, unsigned int, EditTextObject const*, XclExpHyperlinkHelper&) at sc/source/filter/excel/xetable.cxx:708
> XclExpCellTable::XclExpCellTable(XclExpRoot const&) at sc/source/filter/excel/xetable.cxx:2569
> ExcTable::FillAsTableXml() at sc/source/filter/excel/excdoc.cxx:589
> ExcDocument::ReadDoc() at sc/source/filter/excel/excdoc.cxx:771
> XclExpXmlStream::exportDocument() at sc/source/filter/excel/xestream.cxx:1113
> oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at oox/source/core/filterbase.cxx:495
> oox::xls::ExcelFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sc/source/filter/oox/excelfilter.cxx:169
> SfxObjectShell::ExportTo(SfxMedium&) at sfx2/source/doc/objstor.cxx:2380
> SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) at sfx2/source/doc/objstor.cxx:1500
> SfxObjectShell::DoSaveAs(SfxMedium&) at sfx2/source/doc/objstor.cxx:1889
> ScBootstrapFixture::saveAndReload(ScDocShell*, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags) at sc/qa/unit/helper/qahelper.cxx:669
> ScBootstrapFixture::saveAndReload(ScDocShell*, int) at sc/qa/unit/helper/qahelper.cxx:691
> ScExportTest::testTdf111876() at sc/qa/unit/subsequent_export-test.cxx:438
[...]

Change-Id: Ia8a07336bc6fc39573676c227a551fbfe50a519e
Reviewed-on: https://gerrit.libreoffice.org/42789Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 5e54cd87
......@@ -22,6 +22,7 @@
#include <string.h>
#include <utility>
#include <filter/msfilter/util.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/random.h>
......@@ -1053,7 +1054,10 @@ bool XclExpXmlStream::exportDocument()
tools::SvRef<SotStorage> rStorage = static_cast<SotStorage*>(nullptr);
XclExpObjList::ResetCounters();
XclExpRootData aData( EXC_BIFF8, *pShell->GetMedium (), rStorage, rDoc, RTL_TEXTENCODING_DONTKNOW );
XclExpRootData aData(
EXC_BIFF8, *pShell->GetMedium (), rStorage, rDoc,
msfilter::util::getBestTextEncodingFromLocale(
Application::GetSettings().GetLanguageTag().getLocale()));
aData.meOutput = EXC_OUTPUT_XML_2007;
aData.maXclMaxPos.Set( EXC_MAXCOL_XML_2007, EXC_MAXROW_XML_2007, EXC_MAXTAB_XML_2007 );
aData.maMaxPos.SetCol( ::std::min( aData.maScMaxPos.Col(), aData.maXclMaxPos.Col() ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment