Clean up some OUString creation
Change-Id: I62d312436432939d28aced7cfc4a018adbd94c8c
This commit is contained in:
@@ -2124,12 +2124,11 @@ SvxAutocorrWordList* SvxAutoCorrectLanguageLists::LoadAutocorrWordList()
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetStorageFromURL( sShareAutoCorrFile, embed::ElementModes::READ );
|
uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetStorageFromURL( sShareAutoCorrFile, embed::ElementModes::READ );
|
||||||
OUString aXMLWordListName( pXMLImplAutocorr_ListStr, strlen(pXMLImplAutocorr_ListStr), RTL_TEXTENCODING_MS_1252 );
|
uno::Reference < io::XStream > xStrm = xStg->openStreamElement( pXMLImplAutocorr_ListStr, embed::ElementModes::READ );
|
||||||
uno::Reference < io::XStream > xStrm = xStg->openStreamElement( aXMLWordListName, embed::ElementModes::READ );
|
|
||||||
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
|
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
|
||||||
|
|
||||||
xml::sax::InputSource aParserInput;
|
xml::sax::InputSource aParserInput;
|
||||||
aParserInput.sSystemId = aXMLWordListName;
|
aParserInput.sSystemId = pXMLImplAutocorr_ListStr;
|
||||||
aParserInput.aInputStream = xStrm->getInputStream();
|
aParserInput.aInputStream = xStrm->getInputStream();
|
||||||
|
|
||||||
// get parser
|
// get parser
|
||||||
@@ -2436,11 +2435,10 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
|
|||||||
|
|
||||||
bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
|
bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
|
||||||
{
|
{
|
||||||
OUString sStrmName( pXMLImplAutocorr_ListStr, strlen(pXMLImplAutocorr_ListStr), RTL_TEXTENCODING_MS_1252 );
|
|
||||||
bool bRet = true, bRemove = !pAutocorr_List || pAutocorr_List->empty();
|
bool bRet = true, bRemove = !pAutocorr_List || pAutocorr_List->empty();
|
||||||
if( !bRemove )
|
if( !bRemove )
|
||||||
{
|
{
|
||||||
tools::SvRef<SotStorageStream> refList = rStg.OpenSotStream( sStrmName,
|
tools::SvRef<SotStorageStream> refList = rStg.OpenSotStream( pXMLImplAutocorr_ListStr,
|
||||||
( StreamMode::READ | StreamMode::WRITE | StreamMode::SHARE_DENYWRITE ) );
|
( StreamMode::READ | StreamMode::WRITE | StreamMode::SHARE_DENYWRITE ) );
|
||||||
if( refList.is() )
|
if( refList.is() )
|
||||||
{
|
{
|
||||||
@@ -2458,7 +2456,7 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
|
|||||||
xWriter->setOutputStream(xOut);
|
xWriter->setOutputStream(xOut);
|
||||||
|
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xHandler(xWriter, uno::UNO_QUERY);
|
uno::Reference<xml::sax::XDocumentHandler> xHandler(xWriter, uno::UNO_QUERY);
|
||||||
rtl::Reference< SvXMLAutoCorrectExport > xExp( new SvXMLAutoCorrectExport( xContext, pAutocorr_List, sStrmName, xHandler ) );
|
rtl::Reference< SvXMLAutoCorrectExport > xExp( new SvXMLAutoCorrectExport( xContext, pAutocorr_List, pXMLImplAutocorr_ListStr, xHandler ) );
|
||||||
|
|
||||||
xExp->exportDoc( XML_BLOCK_LIST );
|
xExp->exportDoc( XML_BLOCK_LIST );
|
||||||
|
|
||||||
@@ -2481,7 +2479,7 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
|
|||||||
|
|
||||||
if( bRemove )
|
if( bRemove )
|
||||||
{
|
{
|
||||||
rStg.Remove( sStrmName );
|
rStg.Remove( pXMLImplAutocorr_ListStr );
|
||||||
rStg.Commit();
|
rStg.Commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1389,7 +1389,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf101626, "tdf101626.docx")
|
|||||||
if (rProp.Name == "BulletChar")
|
if (rProp.Name == "BulletChar")
|
||||||
{
|
{
|
||||||
// the bulletChar has to be 0x2d!
|
// the bulletChar has to be 0x2d!
|
||||||
CPPUNIT_ASSERT_EQUAL(OUString("\x2d", 1, RTL_TEXTENCODING_UTF8), rProp.Value.get<OUString>());
|
CPPUNIT_ASSERT_EQUAL(OUString("\x2d"), rProp.Value.get<OUString>());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user