[Libreoffice-commits] core.git: editeng/source sw/qa

Stephan Bergmann sbergman at redhat.com
Tue Feb 7 12:04:15 UTC 2017


 editeng/source/misc/svxacorr.cxx         |   12 +++++-------
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |    2 +-
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 7edbe6529825f562e2eab0b7c19c8c0883ea4fea
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Feb 7 13:03:13 2017 +0100

    Clean up some OUString creation
    
    Change-Id: I62d312436432939d28aced7cfc4a018adbd94c8c

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 2f88ecc..fef8739 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2124,12 +2124,11 @@ SvxAutocorrWordList* SvxAutoCorrectLanguageLists::LoadAutocorrWordList()
     try
     {
         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( aXMLWordListName, embed::ElementModes::READ );
+        uno::Reference < io::XStream > xStrm = xStg->openStreamElement( pXMLImplAutocorr_ListStr, embed::ElementModes::READ );
         uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
 
         xml::sax::InputSource aParserInput;
-        aParserInput.sSystemId = aXMLWordListName;
+        aParserInput.sSystemId = pXMLImplAutocorr_ListStr;
         aParserInput.aInputStream = xStrm->getInputStream();
 
         // get parser
@@ -2436,11 +2435,10 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
 
 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();
     if( !bRemove )
     {
-        tools::SvRef<SotStorageStream> refList = rStg.OpenSotStream( sStrmName,
+        tools::SvRef<SotStorageStream> refList = rStg.OpenSotStream( pXMLImplAutocorr_ListStr,
                     ( StreamMode::READ | StreamMode::WRITE | StreamMode::SHARE_DENYWRITE ) );
         if( refList.is() )
         {
@@ -2458,7 +2456,7 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
             xWriter->setOutputStream(xOut);
 
             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 );
 
@@ -2481,7 +2479,7 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
 
     if( bRemove )
     {
-        rStg.Remove( sStrmName );
+        rStg.Remove( pXMLImplAutocorr_ListStr );
         rStg.Commit();
     }
 
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ce71175..3797d90 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1389,7 +1389,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf101626, "tdf101626.docx")
         if (rProp.Name == "BulletChar")
         {
             // 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;
         }
     }


More information about the Libreoffice-commits mailing list