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

Miklos Vajna vmiklos at collabora.co.uk
Sat Nov 22 07:37:01 PST 2014


 sw/qa/extras/rtfexport/data/num-override-start.rtf |   29 +++++++
 sw/qa/extras/rtfexport/rtfexport.cxx               |    7 +
 sw/source/filter/ww8/docxtablestyleexport.cxx      |   86 ++++++++++-----------
 writerfilter/source/dmapper/NumberingManager.cxx   |   12 --
 writerfilter/source/rtftok/rtfdocumentimpl.cxx     |    2 
 5 files changed, 82 insertions(+), 54 deletions(-)

New commits:
commit 74249cb6f4f52b7c10ebaa92f943920f6f94aaf4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Nov 22 12:34:06 2014 +0100

    RTF import: fix handling of multiple \lfolevel control words
    
    Change-Id: I242853d491c2ef83f192486fa6fe5a3407700047

diff --git a/sw/qa/extras/rtfexport/data/num-override-start.rtf b/sw/qa/extras/rtfexport/data/num-override-start.rtf
new file mode 100644
index 0000000..aa1a2d4
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/num-override-start.rtf
@@ -0,0 +1,29 @@
+{\rtf1
+{\*\listtable
+{\list\listtemplateid-1627985480
+{\listlevel\levelnfc0
+\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'02\'00.;}
+{\levelnumbers\'01;}
+\rtlch\fcs1 \af0 \ltrch\fcs0 \s15\fi-360\li720\lin720 }
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0
+\levelstartat1\levellegal\levelspace0\levelindent0
+{\leveltext\'03\'00.\'01;}
+{\levelnumbers\'01\'03;}
+\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li360\lin360 }
+{\listname ;}
+\listid94861222}
+}
+{\*\listoverridetable
+{\listoverride\listid94861222\listoverridecount2
+{\lfolevel\listoverridestartat\levelstartat1}
+{\lfolevel\listoverridestartat\levelstartat3}
+\ls1}
+}
+\pard\plain \ltrpar\s16\ql \fi-360\li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls1\ilvl1\adjustright\rin0\lin360\itap0\pararsid16599941 \rtlch\fcs1 \ab\af0\afs24\alang1025 \ltrch\fcs0
+\b\fs28\lang3082\langfe3082\cgrid\langnp3082\langfenp3082
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\lang2057\langfe3082\langnp2057\insrsid16599941 This should be 1.3}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\fs20\lang2057\langfe3082\langnp2057\insrsid14181417\charrsid16599941
+\par }
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 12fbfd1..c4118c6 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -836,6 +836,13 @@ DECLARE_RTFEXPORT_TEST(testTableRtl, "table-rtl.rtf")
     CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode"));
 }
 
+DECLARE_RTFEXPORT_TEST(testNumOverrideStart, "num-override-start.rtf")
+{
+    // The numbering on the second level was "3.1", not "1.3".
+    uno::Reference<container::XIndexAccess> xRules = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules");
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(1), comphelper::SequenceAsHashMap(xRules->getByIndex(0))["StartWith"].get<sal_Int16>());
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(3), comphelper::SequenceAsHashMap(xRules->getByIndex(1))["StartWith"].get<sal_Int16>());
+}
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 70cc3da..246cb4f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -5901,7 +5901,7 @@ int RTFDocumentImpl::popState()
             aState.aTableAttributes.set(NS_ooxml::LN_CT_NumLvl_ilvl, pInnerValue);
 
             RTFValue::Pointer_t pValue(new RTFValue(aState.aTableAttributes, aState.aTableSprms));
-            m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Num_lvlOverride, pValue);
+            m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Num_lvlOverride, pValue, OVERWRITE_NO_APPEND);
         }
         break;
     // list override table
commit f2f171a4dbec9e3adac7ff66c1417ced84cd0d8e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Nov 22 12:19:35 2014 +0100

    Use comphelper::SequenceAsVector
    
    Change-Id: I0d2c312f903a2a326961430caa772a4841f4fa87

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 2412f8c..0a1c52f 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -263,7 +263,7 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( )
     };
 
     PropertyNameSupplier& aPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
-    PropertyValueVector_t aNumberingProperties;
+    comphelper::SequenceAsVector<beans::PropertyValue> aNumberingProperties;
 
     if( m_nIStartAt >= 0)
         aNumberingProperties.push_back( MAKE_PROPVAL(PROP_START_WITH, (sal_Int16)m_nIStartAt) );
@@ -343,15 +343,7 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( )
                 beans::PropertyValue( aPropNameSupplier.GetName(PROP_BULLET_FONT_NAME), 0, aPropFont->second, beans::PropertyState_DIRECT_VALUE )
                 );
 
-    uno::Sequence< beans::PropertyValue > aRet(aNumberingProperties.size());
-    beans::PropertyValue* pValues = aRet.getArray();
-    PropertyValueVector_t::const_iterator aIt = aNumberingProperties.begin();
-    PropertyValueVector_t::const_iterator aEndIt = aNumberingProperties.end();
-    for(sal_uInt32 nIndex = 0; aIt != aEndIt; ++aIt,++nIndex)
-    {
-        pValues[nIndex] = *aIt;
-    }
-    return aRet;
+    return aNumberingProperties.getAsConstList();
 }
 
 // Add the properties only if they do not already exist in the sequence.
commit 14058d643896cd963e7909f6ed666735b1b2d1ae
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Nov 22 11:38:31 2014 +0100

    DocxTableStyleExport: these are expected to be proper strings
    
    And not just random sequences of UTF-16 code units
    
    Change-Id: I6ce18dcb916ea9127693b724f53d14a76e162274

diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx
index 566c9a3..23757dd 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.cxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.cxx
@@ -73,7 +73,7 @@ void DocxTableStyleExport::CnfStyle(uno::Sequence<beans::PropertyValue>& rAttrib
     for (sal_Int32 j = 0; j < rAttributeList.getLength(); ++j)
     {
         if (rAttributeList[j].Name == "val")
-            pAttributeList->add(FSNS(XML_w, XML_val), rtl::OUStringToOString(rAttributeList[j].Value.get<OUString>(), RTL_TEXTENCODING_UTF8));
+            pAttributeList->add(FSNS(XML_w, XML_val), rAttributeList[j].Value.get<OUString>().toUtf8());
         else
         {
             static DocxStringTokenMap const aTokens[] =
@@ -94,7 +94,7 @@ void DocxTableStyleExport::CnfStyle(uno::Sequence<beans::PropertyValue>& rAttrib
             };
 
             if (sal_Int32 nToken = DocxStringGetToken(aTokens, rAttributeList[j].Name))
-                pAttributeList->add(FSNS(XML_w, nToken), rtl::OUStringToOString(rAttributeList[j].Value.get<OUString>(), RTL_TEXTENCODING_UTF8));
+                pAttributeList->add(FSNS(XML_w, nToken), rAttributeList[j].Value.get<OUString>().toUtf8());
         }
     }
 
@@ -157,7 +157,7 @@ void DocxTableStyleExport::Impl::tableStyleTblCellMar(uno::Sequence<beans::Prope
             comphelper::SequenceAsHashMap aMap(rTblCellMar[i].Value.get< uno::Sequence<beans::PropertyValue> >());
             m_pSerializer->singleElementNS(XML_w, nToken,
                                            FSNS(XML_w, XML_w), OString::number(aMap["w"].get<sal_Int32>()),
-                                           FSNS(XML_w, XML_type), OUStringToOString(aMap["type"].get<OUString>(), RTL_TEXTENCODING_UTF8).getStr(),
+                                           FSNS(XML_w, XML_type), aMap["type"].get<OUString>().toUtf8(),
                                            FSEND);
         }
     }
@@ -183,7 +183,7 @@ void DocxTableStyleExport::Impl::tableStyleTcBorder(sal_Int32 nToken, const uno:
     sax_fastparser::FastAttributeList* pAttributeList = m_pSerializer->createAttrList();
     for (sal_Int32 i = 0; i < rTcBorder.getLength(); ++i)
         if (sal_Int32 nAttrToken = DocxStringGetToken(aTcBorderTokens, rTcBorder[i].Name))
-            pAttributeList->add(FSNS(XML_w, nAttrToken), OUStringToOString(rTcBorder[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, nAttrToken), rTcBorder[i].Value.get<OUString>().toUtf8());
 
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     m_pSerializer->singleElementNS(XML_w, nToken, xAttributeList);
@@ -225,17 +225,17 @@ void DocxTableStyleExport::Impl::tableStyleShd(uno::Sequence<beans::PropertyValu
     for (sal_Int32 i = 0; i < rShd.getLength(); ++i)
     {
         if (rShd[i].Name == "val")
-            pAttributeList->add(FSNS(XML_w, XML_val), OUStringToOString(rShd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_val), rShd[i].Value.get<OUString>().toUtf8());
         else if (rShd[i].Name == "color")
-            pAttributeList->add(FSNS(XML_w, XML_color), OUStringToOString(rShd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_color), rShd[i].Value.get<OUString>().toUtf8());
         else if (rShd[i].Name == "fill")
-            pAttributeList->add(FSNS(XML_w, XML_fill), OUStringToOString(rShd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_fill), rShd[i].Value.get<OUString>().toUtf8());
         else if (rShd[i].Name == "themeFill")
-            pAttributeList->add(FSNS(XML_w, XML_themeFill), OUStringToOString(rShd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_themeFill), rShd[i].Value.get<OUString>().toUtf8());
         else if (rShd[i].Name == "themeFillShade")
-            pAttributeList->add(FSNS(XML_w, XML_themeFillShade), OUStringToOString(rShd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_themeFillShade), rShd[i].Value.get<OUString>().toUtf8());
         else if (rShd[i].Name == "themeFillTint")
-            pAttributeList->add(FSNS(XML_w, XML_themeFillTint), OUStringToOString(rShd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_themeFillTint), rShd[i].Value.get<OUString>().toUtf8());
     }
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     m_pSerializer->singleElementNS(XML_w, XML_shd, xAttributeList);
@@ -250,13 +250,13 @@ void DocxTableStyleExport::Impl::tableStyleRColor(uno::Sequence<beans::PropertyV
     for (sal_Int32 i = 0; i < rColor.getLength(); ++i)
     {
         if (rColor[i].Name == "val")
-            pAttributeList->add(FSNS(XML_w, XML_val), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_val), rColor[i].Value.get<OUString>().toUtf8());
         else if (rColor[i].Name == "themeColor")
-            pAttributeList->add(FSNS(XML_w, XML_themeColor), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_themeColor), rColor[i].Value.get<OUString>().toUtf8());
         else if (rColor[i].Name == "themeTint")
-            pAttributeList->add(FSNS(XML_w, XML_themeTint), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_themeTint), rColor[i].Value.get<OUString>().toUtf8());
         else if (rColor[i].Name == "themeShade")
-            pAttributeList->add(FSNS(XML_w, XML_themeShade), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_themeShade), rColor[i].Value.get<OUString>().toUtf8());
     }
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     m_pSerializer->singleElementNS(XML_w, XML_color, xAttributeList);
@@ -271,11 +271,11 @@ void DocxTableStyleExport::Impl::tableStyleRLang(uno::Sequence<beans::PropertyVa
     for (sal_Int32 i = 0; i < rLang.getLength(); ++i)
     {
         if (rLang[i].Name == "eastAsia")
-            pAttributeList->add(FSNS(XML_w, XML_eastAsia), OUStringToOString(rLang[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_eastAsia), rLang[i].Value.get<OUString>().toUtf8());
         else if (rLang[i].Name == "val")
-            pAttributeList->add(FSNS(XML_w, XML_val), OUStringToOString(rLang[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_val), rLang[i].Value.get<OUString>().toUtf8());
         else if (rLang[i].Name == "bidi")
-            pAttributeList->add(FSNS(XML_w, XML_bidi), OUStringToOString(rLang[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_bidi), rLang[i].Value.get<OUString>().toUtf8());
     }
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     m_pSerializer->singleElementNS(XML_w, XML_lang, xAttributeList);
@@ -290,13 +290,13 @@ void DocxTableStyleExport::Impl::tableStyleRRFonts(uno::Sequence<beans::Property
     for (sal_Int32 i = 0; i < rRFonts.getLength(); ++i)
     {
         if (rRFonts[i].Name == "eastAsiaTheme")
-            pAttributeList->add(FSNS(XML_w, XML_eastAsiaTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_eastAsiaTheme), rRFonts[i].Value.get<OUString>().toUtf8());
         else if (rRFonts[i].Name == "asciiTheme")
-            pAttributeList->add(FSNS(XML_w, XML_asciiTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_asciiTheme), rRFonts[i].Value.get<OUString>().toUtf8());
         else if (rRFonts[i].Name == "cstheme")
-            pAttributeList->add(FSNS(XML_w, XML_cstheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_cstheme), rRFonts[i].Value.get<OUString>().toUtf8());
         else if (rRFonts[i].Name == "hAnsiTheme")
-            pAttributeList->add(FSNS(XML_w, XML_hAnsiTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_hAnsiTheme), rRFonts[i].Value.get<OUString>().toUtf8());
     }
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     m_pSerializer->singleElementNS(XML_w, XML_rFonts, xAttributeList);
@@ -311,20 +311,20 @@ void DocxTableStyleExport::Impl::tableStylePSpacing(uno::Sequence<beans::Propert
     for (sal_Int32 i = 0; i < rSpacing.getLength(); ++i)
     {
         if (rSpacing[i].Name == "after")
-            pAttributeList->add(FSNS(XML_w, XML_after), OUStringToOString(rSpacing[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_after), rSpacing[i].Value.get<OUString>().toUtf8());
         else if (rSpacing[i].Name == "before")
-            pAttributeList->add(FSNS(XML_w, XML_before), OUStringToOString(rSpacing[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_before), rSpacing[i].Value.get<OUString>().toUtf8());
         else if (rSpacing[i].Name == "line")
-            pAttributeList->add(FSNS(XML_w, XML_line), OUStringToOString(rSpacing[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_line), rSpacing[i].Value.get<OUString>().toUtf8());
         else if (rSpacing[i].Name == "lineRule")
-            pAttributeList->add(FSNS(XML_w, XML_lineRule), OUStringToOString(rSpacing[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_lineRule), rSpacing[i].Value.get<OUString>().toUtf8());
         else if (rSpacing[i].Name == "beforeLines")
-            pAttributeList->add(FSNS(XML_w, XML_beforeLines), OUStringToOString(rSpacing[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_beforeLines), rSpacing[i].Value.get<OUString>().toUtf8());
         else if (rSpacing[i].Name == "ParaTopMarginBeforeAutoSpacing")
             // Auto spacing will be available in grab bag only if it was set to true
             pAttributeList->add(FSNS(XML_w, XML_beforeAutospacing), "1");
         else if (rSpacing[i].Name == "afterLines")
-            pAttributeList->add(FSNS(XML_w, XML_afterLines), OUStringToOString(rSpacing[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_afterLines), rSpacing[i].Value.get<OUString>().toUtf8());
         else if (rSpacing[i].Name == "ParaBottomMarginAfterAutoSpacing")
             // Auto spacing will be available in grab bag only if it was set to true
             pAttributeList->add(FSNS(XML_w, XML_afterAutospacing), "1");
@@ -342,9 +342,9 @@ void DocxTableStyleExport::Impl::tableStylePInd(uno::Sequence<beans::PropertyVal
     for (sal_Int32 i = 0; i < rInd.getLength(); ++i)
     {
         if (rInd[i].Name == "rightChars")
-            pAttributeList->add(FSNS(XML_w, XML_rightChars), OUStringToOString(rInd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_rightChars), rInd[i].Value.get<OUString>().toUtf8());
         else if (rInd[i].Name == "right")
-            pAttributeList->add(FSNS(XML_w, XML_right), OUStringToOString(rInd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_right), rInd[i].Value.get<OUString>().toUtf8());
     }
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     m_pSerializer->singleElementNS(XML_w, XML_ind, xAttributeList);
@@ -361,7 +361,7 @@ void DocxTableStyleExport::Impl::tableStyleTblInd(uno::Sequence<beans::PropertyV
         if (rTblInd[i].Name == "w")
             pAttributeList->add(FSNS(XML_w, XML_w), OString::number(rTblInd[i].Value.get<sal_Int32>()));
         else if (rTblInd[i].Name == "type")
-            pAttributeList->add(FSNS(XML_w, XML_type), OUStringToOString(rTblInd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+            pAttributeList->add(FSNS(XML_w, XML_type), rTblInd[i].Value.get<OUString>().toUtf8());
     }
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     m_pSerializer->singleElementNS(XML_w, XML_tblInd, xAttributeList);
@@ -373,7 +373,7 @@ void DocxTableStyleExport::Impl::handleBoolean(const OUString& aValue, sal_Int32
         return;
     sax_fastparser::FastAttributeList* pAttributeList = m_pSerializer->createAttrList();
     if (aValue != "1")
-        pAttributeList->add(FSNS(XML_w, XML_val), OUStringToOString(aValue, RTL_TEXTENCODING_UTF8).getStr());
+        pAttributeList->add(FSNS(XML_w, XML_val), aValue.toUtf8());
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     m_pSerializer->singleElementNS(XML_w, nToken, xAttributeList);
 }
@@ -434,20 +434,20 @@ void DocxTableStyleExport::Impl::tableStyleRPr(uno::Sequence<beans::PropertyValu
     if (bSequenceFlag)
     {
         m_pSerializer->singleElementNS(XML_w, XML_spacing,
-                                       FSNS(XML_w, XML_val),OUStringToOString(aSpacingSequence[0].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr(),
+                                       FSNS(XML_w, XML_val), aSpacingSequence[0].Value.get<OUString>().toUtf8(),
                                        FSEND);
     }
     if (!aSpacing.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_spacing,
-                                       FSNS(XML_w, XML_val), OUStringToOString(aSpacing, RTL_TEXTENCODING_UTF8).getStr(),
+                                       FSNS(XML_w, XML_val), aSpacing.toUtf8(),
                                        FSEND);
     if (!aSz.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_sz,
-                                       FSNS(XML_w, XML_val), OUStringToOString(aSz, RTL_TEXTENCODING_UTF8).getStr(),
+                                       FSNS(XML_w, XML_val), aSz.toUtf8(),
                                        FSEND);
     if (!aSzCs.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_szCs,
-                                       FSNS(XML_w, XML_val), OUStringToOString(aSzCs, RTL_TEXTENCODING_UTF8).getStr(),
+                                       FSNS(XML_w, XML_val), aSzCs.toUtf8(),
                                        FSEND);
 
     m_pSerializer->endElementNS(XML_w, XML_rPr);
@@ -483,7 +483,7 @@ void DocxTableStyleExport::Impl::tableStylePPr(uno::Sequence<beans::PropertyValu
     tableStylePSpacing(aSpacing);
     if (!aJc.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_jc,
-                                       FSNS(XML_w, XML_val), OUStringToOString(aJc, RTL_TEXTENCODING_UTF8).getStr(),
+                                       FSNS(XML_w, XML_val), aJc.toUtf8(),
                                        FSEND);
 
     m_pSerializer->endElementNS(XML_w, XML_pPr);
@@ -551,7 +551,7 @@ void DocxTableStyleExport::Impl::tableStyleTcPr(uno::Sequence<beans::PropertyVal
     tableStyleShd(aShd);
     if (!aVAlign.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_vAlign,
-                                       FSNS(XML_w, XML_val), OUStringToOString(aVAlign, RTL_TEXTENCODING_UTF8).getStr(),
+                                       FSNS(XML_w, XML_val), aVAlign.toUtf8(),
                                        FSEND);
 
     m_pSerializer->endElementNS(XML_w, XML_tcPr);
@@ -579,7 +579,7 @@ void DocxTableStyleExport::Impl::tableStyleTblStylePr(uno::Sequence<beans::Prope
     }
 
     m_pSerializer->startElementNS(XML_w, XML_tblStylePr,
-                                  FSNS(XML_w, XML_type), OUStringToOString(aType, RTL_TEXTENCODING_UTF8).getStr(),
+                                  FSNS(XML_w, XML_type), aType.toUtf8(),
                                   FSEND);
 
     tableStylePPr(aPPr);
@@ -643,20 +643,20 @@ void DocxTableStyleExport::Impl::TableStyle(uno::Sequence<beans::PropertyValue>&
     if (bCustomStyle)
         pAttributeList->add(FSNS(XML_w, XML_customStyle), "1");
     if (!aStyleId.isEmpty())
-        pAttributeList->add(FSNS(XML_w, XML_styleId), OUStringToOString(aStyleId, RTL_TEXTENCODING_UTF8).getStr());
+        pAttributeList->add(FSNS(XML_w, XML_styleId), aStyleId.toUtf8());
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     m_pSerializer->startElementNS(XML_w, XML_style, xAttributeList);
 
     m_pSerializer->singleElementNS(XML_w, XML_name,
-                                   FSNS(XML_w, XML_val), OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr(),
+                                   FSNS(XML_w, XML_val), aName.toUtf8(),
                                    FSEND);
     if (!aBasedOn.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_basedOn,
-                                       FSNS(XML_w, XML_val), OUStringToOString(aBasedOn, RTL_TEXTENCODING_UTF8).getStr(),
+                                       FSNS(XML_w, XML_val), aBasedOn.toUtf8(),
                                        FSEND);
     if (!aUiPriority.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_uiPriority,
-                                       FSNS(XML_w, XML_val), OUStringToOString(aUiPriority, RTL_TEXTENCODING_UTF8).getStr(),
+                                       FSNS(XML_w, XML_val), aUiPriority.toUtf8(),
                                        FSEND);
     if (bSemiHidden)
         m_pSerializer->singleElementNS(XML_w, XML_semiHidden, FSEND);
@@ -666,7 +666,7 @@ void DocxTableStyleExport::Impl::TableStyle(uno::Sequence<beans::PropertyValue>&
         m_pSerializer->singleElementNS(XML_w, XML_qFormat, FSEND);
     if (!aRsid.isEmpty())
         m_pSerializer->singleElementNS(XML_w, XML_rsid,
-                                       FSNS(XML_w, XML_val), OUStringToOString(aRsid, RTL_TEXTENCODING_UTF8).getStr(),
+                                       FSNS(XML_w, XML_val), aRsid.toUtf8(),
                                        FSEND);
 
     tableStylePPr(aPPr);


More information about the Libreoffice-commits mailing list