From 1fe24bb1e2fbe44a4bf2c03297e259b3a18b1235 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 19 Apr 2019 02:24:00 +0300 Subject: Further cleanup of FastSerializerHelper's startElement/singleElement[NS] Drop FSEND_t: C-style varargs code was replaced since version 6.0 in commit d43fc40718217d89cc95cc3c0bc0b8e7926abcc0, so it's time to remove the last bits. Drop int-to-string macros that are simple wrappers over OString::number. Avoid unnecessary string type conversions. Change-Id: I86478577b8e469f99b5a90619e5f78a61f4f23fb Reviewed-on: https://gerrit.libreoffice.org/70964 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sw/source/filter/ww8/docxattributeoutput.cxx | 1086 ++++++++++--------------- sw/source/filter/ww8/docxexport.cxx | 103 +-- sw/source/filter/ww8/docxsdrexport.cxx | 167 ++-- sw/source/filter/ww8/docxtablestyleexport.cxx | 56 +- 4 files changed, 571 insertions(+), 841 deletions(-) (limited to 'sw') diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index e7c2f3510da3..509fe1071669 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -188,40 +188,28 @@ class FFDataWriterHelper const OUString& rHelp, const OUString& rHint ) { - m_pSerializer->startElementNS( XML_w, XML_ffData, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_name, - FSNS( XML_w, XML_val ), OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_enabled, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_calcOnExit, - FSNS( XML_w, XML_val ), - "0", FSEND ); + m_pSerializer->startElementNS(XML_w, XML_ffData); + m_pSerializer->singleElementNS(XML_w, XML_name, FSNS(XML_w, XML_val), rName.toUtf8()); + m_pSerializer->singleElementNS(XML_w, XML_enabled); + m_pSerializer->singleElementNS(XML_w, XML_calcOnExit, FSNS(XML_w, XML_val), "0"); if ( !rEntryMacro.isEmpty() ) m_pSerializer->singleElementNS( XML_w, XML_entryMacro, - FSNS(XML_w, XML_val), - OUStringToOString( rEntryMacro, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS(XML_w, XML_val), rEntryMacro.toUtf8() ); if ( !rExitMacro.isEmpty() ) m_pSerializer->singleElementNS( XML_w, XML_exitMacro, - FSNS(XML_w, XML_val), - OUStringToOString( rExitMacro, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS(XML_w, XML_val), rExitMacro.toUtf8() ); if ( !rHelp.isEmpty() ) m_pSerializer->singleElementNS( XML_w, XML_helpText, FSNS(XML_w, XML_type), "text", - FSNS(XML_w, XML_val), - OUStringToOString( rHelp, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS(XML_w, XML_val), rHelp.toUtf8() ); if ( !rHint.isEmpty() ) m_pSerializer->singleElementNS( XML_w, XML_statusText, FSNS(XML_w, XML_type), "text", - FSNS(XML_w, XML_val), - OUStringToOString( rHint, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS(XML_w, XML_val), rHint.toUtf8() ); } void writeFinish() @@ -239,13 +227,13 @@ public: { writeCommonStart( rName, rEntryMacro, rExitMacro, rHelp, rHint ); // Checkbox specific bits - m_pSerializer->startElementNS( XML_w, XML_checkBox, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_checkBox); // currently hardcoding autosize // #TODO check if this defaulted - m_pSerializer->startElementNS( XML_w, XML_sizeAuto, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_sizeAuto); m_pSerializer->endElementNS( XML_w, XML_sizeAuto ); if ( bChecked ) - m_pSerializer->singleElementNS( XML_w, XML_checked, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_checked); m_pSerializer->endElementNS( XML_w, XML_checkBox ); writeFinish(); } @@ -261,25 +249,19 @@ public: { writeCommonStart( rName, rEntryMacro, rExitMacro, rHelp, rHint ); - m_pSerializer->startElementNS( XML_w, XML_textInput, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_textInput); if ( !rType.isEmpty() ) m_pSerializer->singleElementNS( XML_w, XML_type, - FSNS(XML_w, XML_val), - OUStringToOString( rType, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS(XML_w, XML_val), rType.toUtf8() ); if ( !rDefaultText.isEmpty() ) m_pSerializer->singleElementNS( XML_w, XML_default, - FSNS(XML_w, XML_val), - OUStringToOString( rDefaultText, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS(XML_w, XML_val), rDefaultText.toUtf8() ); if ( nMaxLength ) m_pSerializer->singleElementNS( XML_w, XML_maxLength, - FSNS(XML_w, XML_val), OString::number(nMaxLength), FSEND ); + FSNS(XML_w, XML_val), OString::number(nMaxLength) ); if ( !rFormat.isEmpty() ) m_pSerializer->singleElementNS( XML_w, XML_format, - FSNS(XML_w, XML_val), - OUStringToOString( rFormat, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS(XML_w, XML_val), rFormat.toUtf8() ); m_pSerializer->endElementNS( XML_w, XML_textInput ); writeFinish(); @@ -308,7 +290,7 @@ class FieldMarkParamsHelper void DocxAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 /*nScript*/ ) { if (bIsRTL) - m_pSerializer->singleElementNS( XML_w, XML_rtl, FSNS( XML_w, XML_val ), "true", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_rtl, FSNS(XML_w, XML_val), "true"); } /// Are multiple paragraphs disallowed inside this type of SDT? @@ -483,7 +465,7 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText // We will only know if we have to do that later. m_pSerializer->mark(Tag_StartParagraph_1); - m_pSerializer->startElementNS( XML_w, XML_p, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_p); // postpone the output of the run (we get it before the paragraph // properties, but must write it after them) @@ -675,11 +657,9 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT EndSdtBlock(); m_bStartedCharSdt = false; } - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->startElementNS(XML_mc, XML_AlternateContent, FSEND); - m_pSerializer->startElementNS(XML_mc, XML_Choice, - XML_Requires, "wps", - FSEND); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->startElementNS(XML_mc, XML_AlternateContent); + m_pSerializer->startElementNS(XML_mc, XML_Choice, XML_Requires, "wps"); /** This is to avoid AlternateContent within another AlternateContent. So when Choice is Open, only write the DML Drawing instead of both DML @@ -713,7 +693,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT m_rExport.m_pTableInfo = std::make_shared(); //reset the tableReference. - m_pSerializer->startElementNS(XML_mc, XML_Fallback, FSEND); + m_pSerializer->startElementNS(XML_mc, XML_Fallback); { DocxTableExportContext aVMLTableExportContext(*this); m_rExport.SdrExporter().writeVMLTextFrame(&aFrame); @@ -734,7 +714,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT } if (!m_pPostponedCustomShape->empty()) { - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); WritePostponedCustomShape(); m_pSerializer->endElementNS( XML_w, XML_r ); } @@ -819,15 +799,15 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, // sdt start mark m_pSerializer->mark(Tag_WriteSdtBlock); - m_pSerializer->startElementNS( XML_w, XML_sdt, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_sdt); // output sdt properties - m_pSerializer->startElementNS( XML_w, XML_sdtPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_sdtPr); if( nSdtPrToken > 0 && pSdtPrTokenChildren.is() ) { if (!pSdtPrTokenAttributes.is()) - m_pSerializer->startElement( nSdtPrToken, FSEND ); + m_pSerializer->startElement(nSdtPrToken); else { XFastAttributeListRef xAttrList(pSdtPrTokenAttributes.get()); @@ -839,9 +819,7 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, uno::Sequence aChildren = pSdtPrTokenChildren->getFastAttributes(); for( sal_Int32 i=0; i < aChildren.getLength(); ++i ) m_pSerializer->singleElement( aChildren[i].Token, - FSNS(XML_w, XML_val), - OUStringToOString( aChildren[i].Value, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS(XML_w, XML_val), aChildren[i].Value.toUtf8() ); } m_pSerializer->endElement( nSdtPrToken ); @@ -849,7 +827,7 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, else if( (nSdtPrToken > 0) && nSdtPrToken != FSNS( XML_w, XML_id ) && !(m_bRunTextIsOn && m_rExport.SdrExporter().IsParagraphHasDrawing())) { if (!pSdtPrTokenAttributes.is()) - m_pSerializer->singleElement( nSdtPrToken, FSEND ); + m_pSerializer->singleElement(nSdtPrToken); else { XFastAttributeListRef xAttrList(pSdtPrTokenAttributes.get()); @@ -861,25 +839,23 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, if( nSdtPrToken == FSNS( XML_w, XML_id ) || ( bPara && m_bParagraphSdtHasId ) ) //Word won't open a document with an empty id tag, we fill it with a random number m_pSerializer->singleElementNS(XML_w, XML_id, FSNS(XML_w, XML_val), - OString::number(comphelper::rng::uniform_int_distribution(0, std::numeric_limits::max())), - FSEND); + OString::number(comphelper::rng::uniform_int_distribution(0, std::numeric_limits::max()))); if( pSdtPrDataBindingAttrs.is() && !m_rExport.SdrExporter().IsParagraphHasDrawing()) { XFastAttributeListRef xAttrList( pSdtPrDataBindingAttrs.get() ); pSdtPrDataBindingAttrs.clear(); - m_pSerializer->singleElementNS( XML_w, XML_dataBinding, xAttrList ); + m_pSerializer->singleElementNS(XML_w, XML_dataBinding, xAttrList); } if (!rSdtPrAlias.isEmpty()) m_pSerializer->singleElementNS(XML_w, XML_alias, FSNS(XML_w, XML_val), - OUStringToOString(rSdtPrAlias, RTL_TEXTENCODING_UTF8).getStr(), - FSEND); + rSdtPrAlias.toUtf8()); m_pSerializer->endElementNS( XML_w, XML_sdtPr ); // sdt contents start tag - m_pSerializer->startElementNS( XML_w, XML_sdtContent, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_sdtContent); // prepend the tags since the sdt start mark before the paragraph m_pSerializer->mergeTopMarks(Tag_WriteSdtBlock, sax_fastparser::MergeMarks::PREPEND); @@ -929,7 +905,7 @@ void DocxAttributeOutput::SyncNodelessCells(ww8::WW8TableNodeInfoInner::Pointer_ StartTableRow(pInner); StartTableCell(pInner, i, nRow); - m_pSerializer->singleElementNS( XML_w, XML_p, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_p); EndTableCell(i); } } @@ -976,7 +952,7 @@ void DocxAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointe if (bForceEmptyParagraph) { - m_pSerializer->singleElementNS( XML_w, XML_p, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_p); } EndTableCell(nCell); @@ -994,7 +970,7 @@ void DocxAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointe void DocxAttributeOutput::EmptyParagraph() { - m_pSerializer->singleElementNS( XML_w, XML_p, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_p); } void DocxAttributeOutput::SectionBreaks(const SwNode& rNode) @@ -1037,7 +1013,7 @@ void DocxAttributeOutput::StartParagraphProperties() { m_pSerializer->mark(Tag_StartParagraphProperties); - m_pSerializer->startElementNS( XML_w, XML_pPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_pPr); // and output the section break now (if it appeared) if ( m_pSectionInfo && (!m_setFootnote)) @@ -1198,7 +1174,7 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar m_pSerializer->mergeTopMarks(Tag_InitCollectedParagraphProperties); // Write 'Paragraph Mark' properties - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_rPr); // mark() before paragraph mark properties child elements. InitCollectedRunProperties(); @@ -1258,23 +1234,20 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar { m_pSerializer->startElementNS(XML_w, XML_smartTag, FSNS(XML_w, XML_uri), "http://www.w3.org/1999/02/22-rdf-syntax-ns#", - FSNS(XML_w, XML_element), "RDF", - FSEND); - m_pSerializer->startElementNS(XML_w, XML_smartTagPr, FSEND); + FSNS(XML_w, XML_element), "RDF"); + m_pSerializer->startElementNS(XML_w, XML_smartTagPr); for (const auto& rStatement : aStatements) m_pSerializer->singleElementNS(XML_w, XML_attr, FSNS(XML_w, XML_name), rStatement.first.toUtf8(), - FSNS(XML_w, XML_val), rStatement.second.toUtf8(), - FSEND); + FSNS(XML_w, XML_val), rStatement.second.toUtf8()); m_pSerializer->endElementNS(XML_w, XML_smartTagPr); m_pSerializer->endElementNS(XML_w, XML_smartTag); } if ( m_nColBreakStatus == COLBRK_WRITE || m_nColBreakStatus == COLBRK_WRITEANDPOSTPONE ) { - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_br, - FSNS( XML_w, XML_type ), "column", FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->singleElementNS(XML_w, XML_br, FSNS(XML_w, XML_type), "column"); m_pSerializer->endElementNS( XML_w, XML_r ); if ( m_nColBreakStatus == COLBRK_WRITEANDPOSTPONE ) @@ -1285,9 +1258,8 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar if ( m_bPostponedPageBreak && !m_bWritingHeaderFooter ) { - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_br, - FSNS( XML_w, XML_type ), "page", FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->singleElementNS(XML_w, XML_br, FSNS(XML_w, XML_type), "page"); m_pSerializer->endElementNS( XML_w, XML_r ); m_bPostponedPageBreak = false; @@ -1479,33 +1451,30 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool / if( m_closeHyperlinkInThisRun && m_startedHyperlink && !m_hyperLinkAnchor.isEmpty() && m_hyperLinkAnchor.startsWith("_Toc")) { OUString sToken; - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_webHidden, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->startElementNS(XML_w, XML_rPr); + m_pSerializer->singleElementNS(XML_w, XML_webHidden); m_pSerializer->endElementNS( XML_w, XML_rPr ); - m_pSerializer->startElementNS( XML_w, XML_fldChar, - FSNS( XML_w, XML_fldCharType ), "begin", - FSEND ); + m_pSerializer->startElementNS(XML_w, XML_fldChar, FSNS(XML_w, XML_fldCharType), "begin"); m_pSerializer->endElementNS( XML_w, XML_fldChar ); m_pSerializer->endElementNS( XML_w, XML_r ); - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_webHidden, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->startElementNS(XML_w, XML_rPr); + m_pSerializer->singleElementNS(XML_w, XML_webHidden); m_pSerializer->endElementNS( XML_w, XML_rPr ); sToken = "PAGEREF " + m_hyperLinkAnchor + " \\h"; // '\h' Creates a hyperlink to the bookmarked paragraph. DoWriteCmd( sToken ); m_pSerializer->endElementNS( XML_w, XML_r ); // Write the Field separator - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_webHidden, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->startElementNS(XML_w, XML_rPr); + m_pSerializer->singleElementNS(XML_w, XML_webHidden); m_pSerializer->endElementNS( XML_w, XML_rPr ); m_pSerializer->singleElementNS( XML_w, XML_fldChar, - FSNS( XML_w, XML_fldCharType ), "separate", - FSEND ); + FSNS( XML_w, XML_fldCharType ), "separate" ); m_pSerializer->endElementNS( XML_w, XML_r ); // At start of every "PAGEREF" field m_endPageRef value should be true. m_endPageRef = true; @@ -1513,7 +1482,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool / DoWriteBookmarkStartIfExist(nPos); - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); if(GetExport().m_bTabInTOC && m_pHyperlinkAttrList.is()) { RunText("\t") ; @@ -1582,13 +1551,12 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool / if( m_endPageRef ) { // Hyperlink is started and fldchar "end" needs to be written for PAGEREF - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_webHidden, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->startElementNS(XML_w, XML_rPr); + m_pSerializer->singleElementNS(XML_w, XML_webHidden); m_pSerializer->endElementNS( XML_w, XML_rPr ); m_pSerializer->singleElementNS( XML_w, XML_fldChar, - FSNS( XML_w, XML_fldCharType ), "end", - FSEND ); + FSNS( XML_w, XML_fldCharType ), "end" ); m_pSerializer->endElementNS( XML_w, XML_r ); m_endPageRef = false; m_hyperLinkAnchor.clear(); @@ -1641,13 +1609,9 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool / void DocxAttributeOutput::DoWriteBookmarkTagStart(const OUString & bookmarkName) { - const OString rId = OString::number(m_nNextBookmarkId); - const OString rName = OUStringToOString(BookmarkToWord(bookmarkName), RTL_TEXTENCODING_UTF8).getStr(); - m_pSerializer->singleElementNS(XML_w, XML_bookmarkStart, - FSNS(XML_w, XML_id), rId.getStr(), - FSNS(XML_w, XML_name), rName.getStr(), - FSEND); + FSNS(XML_w, XML_id), OString::number(m_nNextBookmarkId), + FSNS(XML_w, XML_name), BookmarkToWord(bookmarkName).toUtf8()); } void DocxAttributeOutput::DoWriteBookmarkTagEnd(const OUString & bookmarkName) @@ -1656,11 +1620,9 @@ void DocxAttributeOutput::DoWriteBookmarkTagEnd(const OUString & bookmarkName) if (nameToIdIter != m_rOpenedBookmarksIds.end()) { const sal_Int32 nId = nameToIdIter->second; - const OString rId = OString::number(nId); m_pSerializer->singleElementNS(XML_w, XML_bookmarkEnd, - FSNS(XML_w, XML_id), rId.getStr(), - FSEND); + FSNS(XML_w, XML_id), OString::number(nId)); } } @@ -1671,7 +1633,7 @@ void DocxAttributeOutput::DoWriteBookmarkStartIfExist(sal_Int32 nRunPos) { DoWriteBookmarkTagStart(aIter->second); m_rOpenedBookmarksIds[aIter->second] = m_nNextBookmarkId; - m_sLastOpenedBookmark = OUStringToOString(BookmarkToWord(aIter->second), RTL_TEXTENCODING_UTF8).getStr(); + m_sLastOpenedBookmark = OUStringToOString(BookmarkToWord(aIter->second), RTL_TEXTENCODING_UTF8); m_nNextBookmarkId++; } } @@ -1701,7 +1663,7 @@ void DocxAttributeOutput::DoWriteBookmarksStart(std::vector& rStarts) DoWriteBookmarkTagStart(bookmarkName); m_rOpenedBookmarksIds[bookmarkName] = m_nNextBookmarkId; - m_sLastOpenedBookmark = OUStringToOString(BookmarkToWord(bookmarkName), RTL_TEXTENCODING_UTF8).getStr(); + m_sLastOpenedBookmark = OUStringToOString(BookmarkToWord(bookmarkName), RTL_TEXTENCODING_UTF8); m_nNextBookmarkId++; } rStarts.clear(); @@ -1742,13 +1704,9 @@ void DocxAttributeOutput::DoWritePermissionTagStart(const OUString & permission) const OUString permissionId = permissionIdAndName.copy(0, sparatorIndex); const OUString permissionName = permissionIdAndName.copy(sparatorIndex + 1); - const OString rId = OUStringToOString(BookmarkToWord(permissionId), RTL_TEXTENCODING_UTF8).getStr(); - const OString rName = OUStringToOString(BookmarkToWord(permissionName), RTL_TEXTENCODING_UTF8).getStr(); - m_pSerializer->singleElementNS(XML_w, XML_permStart, - FSNS(XML_w, XML_id), rId.getStr(), - FSNS(XML_w, XML_edGrp), rName.getStr(), - FSEND); + FSNS(XML_w, XML_id), BookmarkToWord(permissionId).toUtf8(), + FSNS(XML_w, XML_edGrp), BookmarkToWord(permissionName).toUtf8()); } else // if (permission.startsWith("permission-for-user:", &permissionIdAndName)) { @@ -1756,13 +1714,9 @@ void DocxAttributeOutput::DoWritePermissionTagStart(const OUString & permission) const OUString permissionId = permissionIdAndName.copy(0, sparatorIndex); const OUString permissionName = permissionIdAndName.copy(sparatorIndex + 1); - const OString rId = OUStringToOString(BookmarkToWord(permissionId), RTL_TEXTENCODING_UTF8).getStr(); - const OString rName = OUStringToOString(BookmarkToWord(permissionName), RTL_TEXTENCODING_UTF8).getStr(); - m_pSerializer->singleElementNS(XML_w, XML_permStart, - FSNS(XML_w, XML_id), rId.getStr(), - FSNS(XML_w, XML_ed), rName.getStr(), - FSEND); + FSNS(XML_w, XML_id), BookmarkToWord(permissionId).toUtf8(), + FSNS(XML_w, XML_ed), BookmarkToWord(permissionName).toUtf8()); } } @@ -1783,11 +1737,9 @@ void DocxAttributeOutput::DoWritePermissionTagEnd(const OUString & permission) { const sal_Int32 sparatorIndex = permissionIdAndName.indexOf(':'); const OUString permissionId = permissionIdAndName.copy(0, sparatorIndex); - const OString rId = OUStringToOString(BookmarkToWord(permissionId), RTL_TEXTENCODING_UTF8).getStr(); m_pSerializer->singleElementNS(XML_w, XML_permEnd, - FSNS(XML_w, XML_id), rId.getStr(), - FSEND); + FSNS(XML_w, XML_id), BookmarkToWord(permissionId).toUtf8()); } } @@ -1827,8 +1779,7 @@ void DocxAttributeOutput::DoWriteAnnotationMarks() const sal_Int32 nId = m_nNextAnnotationMarkId++; m_rOpenedAnnotationMarksIds[rName] = nId; m_pSerializer->singleElementNS( XML_w, XML_commentRangeStart, - FSNS( XML_w, XML_id ), OString::number( nId ).getStr( ), - FSEND ); + FSNS( XML_w, XML_id ), OString::number(nId) ); m_sLastOpenedAnnotationMark = rName; } } @@ -1843,14 +1794,12 @@ void DocxAttributeOutput::DoWriteAnnotationMarks() { const sal_Int32 nId = ( *pPos ).second; m_pSerializer->singleElementNS( XML_w, XML_commentRangeEnd, - FSNS( XML_w, XML_id ), OString::number( nId ).getStr( ), - FSEND ); + FSNS( XML_w, XML_id ), OString::number(nId) ); m_rOpenedAnnotationMarksIds.erase( rName ); - m_pSerializer->startElementNS(XML_w, XML_r, FSEND); + m_pSerializer->startElementNS(XML_w, XML_r); m_pSerializer->singleElementNS( XML_w, XML_commentReference, FSNS( XML_w, XML_id ), - OString::number( nId ).getStr(), - FSEND ); + OString::number(nId) ); m_pSerializer->endElementNS(XML_w, XML_r); } } @@ -1930,13 +1879,12 @@ void DocxAttributeOutput::StartField_Impl( const SwTextNode* pNode, sal_Int32 nP else if ( rInfos.eType != ww::eNONE ) // HYPERLINK fields are just commands { if ( bWriteRun ) - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); if ( rInfos.eType == ww::eFORMDROPDOWN ) { m_pSerializer->startElementNS( XML_w, XML_fldChar, - FSNS( XML_w, XML_fldCharType ), "begin", - FSEND ); + FSNS( XML_w, XML_fldCharType ), "begin" ); if ( rInfos.pFieldmark && !rInfos.pField ) WriteFFData( rInfos ); if ( rInfos.pField ) @@ -1964,14 +1912,12 @@ void DocxAttributeOutput::StartField_Impl( const SwTextNode* pNode, sal_Int32 nP { m_pSerializer->startElementNS( XML_w, XML_fldChar, FSNS( XML_w, XML_fldCharType ), "begin", - FSNS( XML_w, XML_fldLock ), "true", - FSEND ); + FSNS( XML_w, XML_fldLock ), "true" ); } else { m_pSerializer->startElementNS( XML_w, XML_fldChar, - FSNS( XML_w, XML_fldCharType ), "begin", - FSEND ); + FSNS( XML_w, XML_fldCharType ), "begin" ); } if ( rInfos.pFieldmark ) @@ -1999,7 +1945,7 @@ void DocxAttributeOutput::DoWriteCmd( const OUString& rCmd ) m_aSeqBookmarksNames[sSeqName].push_back(m_sLastOpenedBookmark); } // Write the Field command - m_pSerializer->startElementNS( XML_w, XML_instrText, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_instrText); m_pSerializer->writeEscaped( rCmd ); m_pSerializer->endElementNS( XML_w, XML_instrText ); @@ -2013,7 +1959,7 @@ void DocxAttributeOutput::CmdField_Impl( const SwTextNode* pNode, sal_Int32 nPos { if ( bWriteRun ) { - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); if (rInfos.eType == ww::eEQ) bWriteCombChars = true; @@ -2053,13 +1999,12 @@ void DocxAttributeOutput::CmdField_Impl( const SwTextNode* pNode, sal_Int32 nPos { if ( bWriteRun ) { - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); DoWriteFieldRunProperties( pNode, nPos ); } m_pSerializer->singleElementNS( XML_w, XML_fldChar, - FSNS( XML_w, XML_fldCharType ), "separate", - FSEND ); + FSNS( XML_w, XML_fldCharType ), "separate" ); if ( bWriteRun ) { @@ -2112,12 +2057,12 @@ void DocxAttributeOutput::DoWriteFieldRunProperties( const SwTextNode * pNode, s m_bPreventDoubleFieldsHandling = true; { - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_rPr); // 1. output webHidden flag if(GetExport().m_bHideTabLeaderAndPageNumbers && m_pHyperlinkAttrList.is() ) { - m_pSerializer->singleElementNS( XML_w, XML_webHidden, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_webHidden); } // 2. output color @@ -2171,7 +2116,7 @@ void DocxAttributeOutput::EndField_Impl( const SwTextNode* pNode, sal_Int32 nPos if (rInfos.pField ) // For hyperlinks and TOX { // Write the Field latest value - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); DoWriteFieldRunProperties( pNode, nPos ); OUString sExpand; @@ -2201,11 +2146,9 @@ void DocxAttributeOutput::EndField_Impl( const SwTextNode* pNode, sal_Int32 nPos // Write the Field end if ( rInfos.bClose ) { - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); DoWriteFieldRunProperties( pNode, nPos ); - m_pSerializer->singleElementNS( XML_w, XML_fldChar, - FSNS( XML_w, XML_fldCharType ), "end", - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_fldChar, FSNS(XML_w, XML_fldCharType), "end"); m_pSerializer->endElementNS( XML_w, XML_r ); } // Write the ref field if a bookmark had to be set and the field @@ -2219,10 +2162,9 @@ void DocxAttributeOutput::EndField_Impl( const SwTextNode* pNode, sal_Int32 nPos if ( ( !m_sFieldBkm.isEmpty() ) && bShowRef ) { // Write the field beginning - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); m_pSerializer->singleElementNS( XML_w, XML_fldChar, - FSNS( XML_w, XML_fldCharType ), "begin", - FSEND ); + FSNS( XML_w, XML_fldCharType ), "begin" ); m_pSerializer->endElementNS( XML_w, XML_r ); rInfos.sCmd = FieldString( ww::eREF ); @@ -2245,11 +2187,11 @@ void DocxAttributeOutput::StartRunProperties() // prepend the properties before the text m_pSerializer->mark(Tag_StartRunProperties); - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_rPr); if(GetExport().m_bHideTabLeaderAndPageNumbers && m_pHyperlinkAttrList.is() ) { - m_pSerializer->singleElementNS( XML_w, XML_webHidden, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_webHidden); } InitCollectedRunProperties(); @@ -2636,12 +2578,12 @@ bool DocxAttributeOutput::FootnoteEndnoteRefTag() if ( pCharFormat ) { const OString aStyleId(m_rExport.m_pStyles->GetStyleId(m_rExport.GetId(pCharFormat))); - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); + m_pSerializer->startElementNS(XML_w, XML_rPr); + m_pSerializer->singleElementNS(XML_w, XML_rStyle, FSNS(XML_w, XML_val), aStyleId); m_pSerializer->endElementNS( XML_w, XML_rPr ); } - m_pSerializer->singleElementNS( XML_w, m_footnoteEndnoteRefTag, FSEND ); + m_pSerializer->singleElementNS(XML_w, m_footnoteEndnoteRefTag); m_footnoteEndnoteRefTag = 0; return true; } @@ -2667,10 +2609,10 @@ static bool impl_WriteRunText( FSHelperPtr const & pSerializer, sal_Int32 nTextT // we have to add 'preserve' when starting/ending with space if ( *pBegin == ' ' || *( pEnd - 1 ) == ' ' ) { - pSerializer->startElementNS( XML_w, nTextToken, FSNS( XML_xml, XML_space ), "preserve", FSEND ); + pSerializer->startElementNS(XML_w, nTextToken, FSNS(XML_xml, XML_space), "preserve"); } else - pSerializer->startElementNS( XML_w, nTextToken, FSEND ); + pSerializer->startElementNS(XML_w, nTextToken); pSerializer->writeEscaped( OUString( pBegin, pEnd - pBegin ) ); @@ -2703,26 +2645,26 @@ void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCh { case 0x09: // tab impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt ); - m_pSerializer->singleElementNS( XML_w, XML_tab, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_tab); prevUnicode = *pIt; break; case 0x0b: // line break { if (impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt ) || prevUnicode < 0x0020) { - m_pSerializer->singleElementNS( XML_w, XML_br, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_br); prevUnicode = *pIt; } } break; case 0x1E: //non-breaking hyphen impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt ); - m_pSerializer->singleElementNS( XML_w, XML_noBreakHyphen, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_noBreakHyphen); prevUnicode = *pIt; break; case 0x1F: //soft (on demand) hyphen impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt ); - m_pSerializer->singleElementNS( XML_w, XML_softHyphen, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_softHyphen); prevUnicode = *pIt; break; default: @@ -2751,33 +2693,30 @@ void DocxAttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 nPos, co EndRun( &rNode, nPos ); // end run before starting ruby to avoid nested runs, and overlap assert(!m_closeHyperlinkInThisRun); // check that no hyperlink overlaps ruby assert(!m_closeHyperlinkInPreviousRun); - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_ruby, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_rubyPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->startElementNS(XML_w, XML_ruby); + m_pSerializer->startElementNS(XML_w, XML_rubyPr); m_pSerializer->singleElementNS( XML_w, XML_rubyAlign, - FSNS( XML_w, XML_val ), lclConvertWW8JCToOOXMLRubyAlign(aWW8Ruby.GetJC()), FSEND ); + FSNS( XML_w, XML_val ), lclConvertWW8JCToOOXMLRubyAlign(aWW8Ruby.GetJC()) ); sal_uInt32 nHps = (aWW8Ruby.GetRubyHeight() + 5) / 10; sal_uInt32 nHpsBaseText = (aWW8Ruby.GetBaseHeight() + 5) / 10; - m_pSerializer->singleElementNS( XML_w, XML_hps, - FSNS( XML_w, XML_val ), OString::number(nHps).getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_hps, FSNS(XML_w, XML_val), OString::number(nHps)); m_pSerializer->singleElementNS( XML_w, XML_hpsRaise, - FSNS( XML_w, XML_val ), OString::number(nHpsBaseText).getStr(), FSEND ); + FSNS( XML_w, XML_val ), OString::number(nHpsBaseText) ); m_pSerializer->singleElementNS( XML_w, XML_hpsBaseText, - FSNS( XML_w, XML_val ), OString::number(nHpsBaseText).getStr(), FSEND ); + FSNS( XML_w, XML_val ), OString::number(nHpsBaseText) ); lang::Locale aLocale( SwBreakIt::Get()->GetLocale( rNode.GetLang( nPos ) ) ); OUString sLang( LanguageTag::convertToBcp47( aLocale) ); - m_pSerializer->singleElementNS( XML_w, XML_lid, - FSNS( XML_w, XML_val ), - OUStringToOString( sLang, RTL_TEXTENCODING_UTF8 ).getStr( ), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_lid, FSNS(XML_w, XML_val), sLang.toUtf8()); m_pSerializer->endElementNS( XML_w, XML_rubyPr ); - m_pSerializer->startElementNS( XML_w, XML_rt, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_rt); StartRun( nullptr, nPos ); StartRunProperties( ); @@ -2798,7 +2737,7 @@ void DocxAttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 nPos, co EndRun( &rNode, nPos ); m_pSerializer->endElementNS( XML_w, XML_rt ); - m_pSerializer->startElementNS( XML_w, XML_rubyBase, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_rubyBase); StartRun( nullptr, nPos ); } @@ -2944,10 +2883,9 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData) case nsRedlineType_t::REDLINE_FORMAT: m_pSerializer->startElementNS( XML_w, XML_rPrChange, - FSNS( XML_w, XML_id ), aId.getStr(), - FSNS( XML_w, XML_author ), aAuthor.getStr(), - FSNS( XML_w, XML_date ), aDate.getStr(), - FSEND ); + FSNS( XML_w, XML_id ), aId, + FSNS( XML_w, XML_author ), aAuthor, + FSNS( XML_w, XML_date ), aDate ); // Check if there is any extra data stored in the redline object if (pRedlineData->GetExtraData()) @@ -2964,7 +2902,7 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData) { m_pSerializer->mark(Tag_Redline_1); - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_rPr); // The 'm_pFontsAttrList', 'm_pEastAsianLayoutAttrList', 'm_pCharLangAttrList' are used to hold information // that should be collected by different properties in the core, and are all flushed together @@ -3003,10 +2941,9 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData) case nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT: m_pSerializer->startElementNS( XML_w, XML_pPrChange, - FSNS( XML_w, XML_id ), aId.getStr(), - FSNS( XML_w, XML_author ), aAuthor.getStr(), - FSNS( XML_w, XML_date ), aDate.getStr(), - FSEND ); + FSNS( XML_w, XML_id ), aId, + FSNS( XML_w, XML_author ), aAuthor, + FSNS( XML_w, XML_date ), aDate ); // Check if there is any extra data stored in the redline object if (pRedlineData->GetExtraData()) @@ -3023,7 +2960,7 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData) { m_pSerializer->mark(Tag_Redline_2); - m_pSerializer->startElementNS( XML_w, XML_pPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_pPr); // The 'm_rExport.SdrExporter().getFlyAttrList()', 'm_pParagraphSpacingAttrList' are used to hold information // that should be collected by different properties in the core, and are all flushed together @@ -3081,18 +3018,16 @@ void DocxAttributeOutput::StartRedline( const SwRedlineData * pRedlineData ) { case nsRedlineType_t::REDLINE_INSERT: m_pSerializer->startElementNS( XML_w, XML_ins, - FSNS( XML_w, XML_id ), aId.getStr(), - FSNS( XML_w, XML_author ), aAuthor.getStr(), - FSNS( XML_w, XML_date ), aDate.getStr(), - FSEND ); + FSNS( XML_w, XML_id ), aId, + FSNS( XML_w, XML_author ), aAuthor, + FSNS( XML_w, XML_date ), aDate ); break; case nsRedlineType_t::REDLINE_DELETE: m_pSerializer->startElementNS( XML_w, XML_del, - FSNS( XML_w, XML_id ), aId.getStr(), - FSNS( XML_w, XML_author ), aAuthor.getStr(), - FSNS( XML_w, XML_date ), aDate.getStr(), - FSEND ); + FSNS( XML_w, XML_id ), aId, + FSNS( XML_w, XML_author ), aAuthor, + FSNS( XML_w, XML_date ), aDate ); break; case nsRedlineType_t::REDLINE_FORMAT: @@ -3135,7 +3070,7 @@ void DocxAttributeOutput::ParagraphStyle( sal_uInt16 nStyle ) { OString aStyleId(m_rExport.m_pStyles->GetStyleId(nStyle)); - m_pSerializer->singleElementNS( XML_w, XML_pStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_pStyle, FSNS(XML_w, XML_val), aStyleId); } static void impl_borderLine( FSHelperPtr const & pSerializer, sal_Int32 elementToken, const SvxBorderLine* pBorderLine, sal_uInt16 nDist, @@ -3317,7 +3252,7 @@ static void impl_borders( FSHelperPtr const & pSerializer, if (!tagWritten && rOptions.bWriteTag) { - pSerializer->startElementNS( XML_w, rOptions.tag, FSEND ); + pSerializer->startElementNS(XML_w, rOptions.tag); tagWritten = true; } @@ -3406,13 +3341,12 @@ static void impl_cellMargins( FSHelperPtr const & pSerializer, const SvxBoxItem& } if (!tagWritten) { - pSerializer->startElementNS( XML_w, tag, FSEND ); + pSerializer->startElementNS(XML_w, tag); tagWritten = true; } pSerializer->singleElementNS( XML_w, aXmlElements[i], - FSNS( XML_w, XML_w ), OString::number( nDist ).getStr( ), - FSNS( XML_w, XML_type ), "dxa", - FSEND ); + FSNS( XML_w, XML_w ), OString::number(nDist), + FSNS( XML_w, XML_type ), "dxa" ); } if (tagWritten) { pSerializer->endElementNS( XML_w, tag ); @@ -3421,7 +3355,7 @@ static void impl_cellMargins( FSHelperPtr const & pSerializer, const SvxBoxItem& void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t const & pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow ) { - m_pSerializer->startElementNS( XML_w, XML_tcPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_tcPr); const SwTableBox *pTableBox = pTableTextNodeInfoInner->getTableBox( ); @@ -3435,9 +3369,8 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point if ( nCell ) nWidth = nWidth - GetGridCols( pTableTextNodeInfoInner )->at( nCell - 1 ); m_pSerializer->singleElementNS( XML_w, XML_tcW, - FSNS( XML_w, XML_w ), OString::number( nWidth ).getStr( ), - FSNS( XML_w, XML_type ), "dxa", - FSEND ); + FSNS( XML_w, XML_w ), OString::number(nWidth), + FSNS( XML_w, XML_type ), "dxa" ); // Horizontal spans const SwWriteTableRows& rRows = m_xTableWrt->GetRows( ); @@ -3449,8 +3382,7 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point const sal_uInt16 nColSpan = rCell.GetColSpan(); if ( nColSpan > 1 ) m_pSerializer->singleElementNS( XML_w, XML_gridSpan, - FSNS( XML_w, XML_val ), OString::number( nColSpan ).getStr(), - FSEND ); + FSNS( XML_w, XML_val ), OString::number(nColSpan) ); } // Vertical merges @@ -3458,15 +3390,11 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point sal_Int32 vSpan = (*xRowSpans)[nCell]; if ( vSpan > 1 ) { - m_pSerializer->singleElementNS( XML_w, XML_vMerge, - FSNS( XML_w, XML_val ), "restart", - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vMerge, FSNS(XML_w, XML_val), "restart"); } else if ( vSpan < 0 ) { - m_pSerializer->singleElementNS( XML_w, XML_vMerge, - FSNS( XML_w, XML_val ), "continue", - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vMerge, FSNS(XML_w, XML_val), "continue"); } if (const SfxGrabBagItem* pItem = pTableBox->GetFrameFormat()->GetAttrSet().GetItem(RES_FRMATR_GRABBAG)) @@ -3527,7 +3455,7 @@ void DocxAttributeOutput::StartTable( ww8::WW8TableNodeInfoInner::Pointer_t cons // In case any paragraph SDT's are open, close them here. EndParaSdtBlock(); - m_pSerializer->startElementNS( XML_w, XML_tbl, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_tbl); tableFirstCells.push_back(pTableTextNodeInfoInner); lastOpenCell.push_back(-1); @@ -3562,17 +3490,15 @@ void DocxAttributeOutput::EndTable() void DocxAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t const & pTableTextNodeInfoInner ) { - m_pSerializer->startElementNS( XML_w, XML_tr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_tr); // Output the row properties - m_pSerializer->startElementNS( XML_w, XML_trPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_trPr); // Header row: tblHeader const SwTable *pTable = pTableTextNodeInfoInner->getTable( ); if ( pTable->GetRowsToRepeat( ) > pTableTextNodeInfoInner->getRow( ) ) - m_pSerializer->singleElementNS( XML_w, XML_tblHeader, - FSNS( XML_w, XML_val ), "true", - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_tblHeader, FSNS(XML_w, XML_val), "true"); TableRowRedline( pTableTextNodeInfoInner ); TableHeight( pTableTextNodeInfoInner ); @@ -3608,7 +3534,7 @@ void DocxAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t InitTableHelper( pTableTextNodeInfoInner ); - m_pSerializer->startElementNS( XML_w, XML_tc, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_tc); // Write the cell properties here TableCellProperties( pTableTextNodeInfoInner, nCell, nRow ); @@ -3708,7 +3634,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t bool bEcma = GetExport().GetFilter().getVersion( ) == oox::core::ECMA_DIALECT; // Write the table properties - m_pSerializer->startElementNS( XML_w, XML_tblPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_tblPr); static const sal_Int32 aOrder[] = { @@ -3780,9 +3706,8 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t // Output the table preferred width m_pSerializer->singleElementNS( XML_w, XML_tblW, - FSNS( XML_w, XML_w ), OString::number( nPageSize ).getStr( ), - FSNS( XML_w, XML_type ), widthType, - FSEND ); + FSNS( XML_w, XML_w ), OString::number(nPageSize), + FSNS( XML_w, XML_type ), widthType ); // Look for the table style property in the table grab bag std::map aGrabBag = @@ -3798,9 +3723,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t if( rGrabBagElement.first == "TableStyleName") { OString sStyleName = OUStringToOString( rGrabBagElement.second.get(), RTL_TEXTENCODING_UTF8 ); - m_pSerializer->singleElementNS( XML_w, XML_tblStyle, - FSNS( XML_w, XML_val ), sStyleName.getStr(), - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_tblStyle, FSNS(XML_w, XML_val), sStyleName); } else if( rGrabBagElement.first == "TableStyleTopBorder" ) m_aTableStyleConf[ SvxBoxItemLine::TOP ] = rGrabBagElement.second.get(); @@ -4025,9 +3948,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t break; } } - m_pSerializer->singleElementNS( XML_w, XML_jc, - FSNS( XML_w, XML_val ), pJcVal, - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_jc, FSNS(XML_w, XML_val), pJcVal); // Output the table background color (although cell value still needs to be specified) const SvxBrushItem *pColorProp = pTableFormat->GetAttrSet().GetItem(RES_BACKGROUND); @@ -4036,9 +3957,8 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t { OString sColor = msfilter::util::ConvertColor( aColor ); m_pSerializer->singleElementNS( XML_w, XML_shd, - FSNS( XML_w, XML_fill ), sColor.getStr( ), - FSNS( XML_w, XML_val ), "clear", - FSEND ); + FSNS( XML_w, XML_fill ), sColor, + FSNS( XML_w, XML_val ), "clear" ); } // Output the table borders @@ -4051,9 +3971,8 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t // Table indent (need to get written even if == 0) m_pSerializer->singleElementNS( XML_w, XML_tblInd, - FSNS( XML_w, XML_w ), OString::number( nIndent ).getStr( ), - FSNS( XML_w, XML_type ), "dxa", - FSEND ); + FSNS( XML_w, XML_w ), OString::number(nIndent), + FSNS( XML_w, XML_type ), "dxa" ); // Merge the marks for the ordered elements m_pSerializer->mergeTopMarks(Tag_TableDefinition); @@ -4061,15 +3980,14 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t m_pSerializer->endElementNS( XML_w, XML_tblPr ); // Write the table grid infos - m_pSerializer->startElementNS( XML_w, XML_tblGrid, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_tblGrid); sal_Int32 nPrv = 0; ww8::WidthsPtr pColumnWidths = GetColumnWidths( pTableTextNodeInfoInner ); for ( auto aColumnWidth : *pColumnWidths ) { sal_Int32 nWidth = sal_Int32( aColumnWidth ) - nPrv; m_pSerializer->singleElementNS( XML_w, XML_gridCol, - FSNS( XML_w, XML_w ), OString::number( nWidth ).getStr( ), - FSEND ); + FSNS( XML_w, XML_w ), OString::number(nWidth) ); nPrv = sal_Int32( aColumnWidth ); } @@ -4126,9 +4044,8 @@ void DocxAttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_ { // color changed by the user, or no grab bag: write sColor m_pSerializer->singleElementNS( XML_w, XML_shd, - FSNS( XML_w, XML_fill ), sColor.getStr( ), - FSNS( XML_w, XML_val ), "clear", - FSEND ); + FSNS( XML_w, XML_fill ), sColor, + FSNS( XML_w, XML_val ), "clear" ); } else { @@ -4192,16 +4109,14 @@ void DocxAttributeOutput::TableRowRedline( ww8::WW8TableNodeInfoInner::Pointer_t if (nRedlineType == nsRedlineType_t::REDLINE_TABLE_ROW_INSERT) m_pSerializer->singleElementNS( XML_w, XML_ins, - FSNS( XML_w, XML_id ), aId.getStr(), - FSNS( XML_w, XML_author ), aAuthor.getStr(), - FSNS( XML_w, XML_date ), aDate.getStr(), - FSEND ); + FSNS( XML_w, XML_id ), aId, + FSNS( XML_w, XML_author ), aAuthor, + FSNS( XML_w, XML_date ), aDate ); else if (nRedlineType == nsRedlineType_t::REDLINE_TABLE_ROW_DELETE) m_pSerializer->singleElementNS( XML_w, XML_del, - FSNS( XML_w, XML_id ), aId.getStr(), - FSNS( XML_w, XML_author ), aAuthor.getStr(), - FSNS( XML_w, XML_date ), aDate.getStr(), - FSEND ); + FSNS( XML_w, XML_id ), aId, + FSNS( XML_w, XML_author ), aAuthor, + FSNS( XML_w, XML_date ), aDate ); } break; } @@ -4237,16 +4152,14 @@ void DocxAttributeOutput::TableCellRedline( ww8::WW8TableNodeInfoInner::Pointer_ if (nRedlineType == nsRedlineType_t::REDLINE_TABLE_CELL_INSERT) m_pSerializer->singleElementNS( XML_w, XML_cellIns, - FSNS( XML_w, XML_id ), aId.getStr(), - FSNS( XML_w, XML_author ), aAuthor.getStr(), - FSNS( XML_w, XML_date ), aDate.getStr(), - FSEND ); + FSNS( XML_w, XML_id ), aId, + FSNS( XML_w, XML_author ), aAuthor, + FSNS( XML_w, XML_date ), aDate ); else if (nRedlineType == nsRedlineType_t::REDLINE_TABLE_CELL_DELETE) m_pSerializer->singleElementNS( XML_w, XML_cellDel, - FSNS( XML_w, XML_id ), aId.getStr(), - FSNS( XML_w, XML_author ), aAuthor.getStr(), - FSNS( XML_w, XML_date ), aDate.getStr(), - FSEND ); + FSNS( XML_w, XML_id ), aId, + FSNS( XML_w, XML_author ), aAuthor, + FSNS( XML_w, XML_date ), aDate ); } break; } @@ -4275,9 +4188,8 @@ void DocxAttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTa if ( pRule ) m_pSerializer->singleElementNS( XML_w, XML_trHeight, - FSNS( XML_w, XML_val ), OString::number( nHeight ).getStr( ), - FSNS( XML_w, XML_hRule ), pRule, - FSEND ); + FSNS( XML_w, XML_val ), OString::number(nHeight), + FSNS( XML_w, XML_hRule ), pRule ); } } @@ -4291,9 +4203,7 @@ void DocxAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t p // if rSplittable is true then no need to write // as default row prop is allow row to break across page. if( !rSplittable.GetValue( ) ) - m_pSerializer->singleElementNS( XML_w, XML_cantSplit, - FSNS( XML_w, XML_val ), "true", - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_cantSplit, FSNS(XML_w, XML_val), "true"); } void DocxAttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) @@ -4303,9 +4213,7 @@ void DocxAttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTabl if ( m_rExport.TrueFrameDirection( *pFrameFormat ) == SvxFrameDirection::Horizontal_RL_TB ) { - m_pSerializer->singleElementNS( XML_w, XML_bidiVisual, - FSNS( XML_w, XML_val ), "true", - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_bidiVisual, FSNS(XML_w, XML_val), "true"); } } @@ -4315,14 +4223,10 @@ void DocxAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer const SwFrameFormat *pFrameFormat = pTabBox->GetFrameFormat( ); if ( SvxFrameDirection::Vertical_RL_TB == m_rExport.TrueFrameDirection( *pFrameFormat ) ) - m_pSerializer->singleElementNS( XML_w, XML_textDirection, - FSNS( XML_w, XML_val ), "tbRl", - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_textDirection, FSNS(XML_w, XML_val), "tbRl"); else if ( SvxFrameDirection::Vertical_LR_BT == m_rExport.TrueFrameDirection( *pFrameFormat ) ) { - m_pSerializer->singleElementNS( XML_w, XML_textDirection, - FSNS( XML_w, XML_val ), "btLr", - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_textDirection, FSNS(XML_w, XML_val), "btLr"); } const SwWriteTableRows& rRows = m_xTableWrt->GetRows( ); @@ -4337,12 +4241,10 @@ void DocxAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer case text::VertOrientation::TOP: break; case text::VertOrientation::CENTER: - m_pSerializer->singleElementNS( XML_w, XML_vAlign, - FSNS( XML_w, XML_val ), "center", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vAlign, FSNS(XML_w, XML_val), "center"); break; case text::VertOrientation::BOTTOM: - m_pSerializer->singleElementNS( XML_w, XML_vAlign, - FSNS( XML_w, XML_val ), "bottom", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vAlign, FSNS(XML_w, XML_val), "bottom"); break; } } @@ -4375,11 +4277,10 @@ void DocxAttributeOutput::TableRowEnd( sal_uInt32 /*nDepth*/ ) void DocxAttributeOutput::StartStyles() { m_pSerializer->startElementNS( XML_w, XML_styles, - FSNS( XML_xmlns, XML_w ), OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(doc)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_w14 ), OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(w14)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_mc ), OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(mce)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_mc, XML_Ignorable ), "w14", - FSEND ); + FSNS( XML_xmlns, XML_w ), GetExport().GetFilter().getNamespaceURL(OOX_NS(doc)).toUtf8(), + FSNS( XML_xmlns, XML_w14 ), GetExport().GetFilter().getNamespaceURL(OOX_NS(w14)).toUtf8(), + FSNS( XML_xmlns, XML_mc ), GetExport().GetFilter().getNamespaceURL(OOX_NS(mce)).toUtf8(), + FSNS( XML_mc, XML_Ignorable ), "w14" ); DocDefaults(); LatentStyles(); @@ -4674,10 +4575,10 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt) void DocxAttributeOutput::DocDefaults( ) { // Write the '' section here - m_pSerializer->startElementNS(XML_w, XML_docDefaults, FSEND); + m_pSerializer->startElementNS(XML_w, XML_docDefaults); // Output the default run properties - m_pSerializer->startElementNS(XML_w, XML_rPrDefault, FSEND); + m_pSerializer->startElementNS(XML_w, XML_rPrDefault); StartStyleProperties(false, 0); @@ -4689,7 +4590,7 @@ void DocxAttributeOutput::DocDefaults( ) m_pSerializer->endElementNS(XML_w, XML_rPrDefault); // Output the default paragraph properties - m_pSerializer->startElementNS(XML_w, XML_pPrDefault, FSEND); + m_pSerializer->startElementNS(XML_w, XML_pPrDefault); StartStyleProperties(true, 0); @@ -4770,11 +4671,10 @@ void DocxAttributeOutput::WriteSrcRect(const SdrObject* pSdrObj, const SwFrameFo double bottom = nCropB * heightMultiplier; m_pSerializer->singleElementNS( XML_a, XML_srcRect, - XML_l, I32S(left), - XML_t, I32S(top), - XML_r, I32S(right), - XML_b, I32S(bottom), - FSEND ); + XML_l, OString::number(left), + XML_t, OString::number(top), + XML_r, OString::number(right), + XML_b, OString::number(bottom) ); } } @@ -4904,53 +4804,42 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size // TODO hyperlink // m_pSerializer->singleElementNS( XML_a, XML_hlinkClick, // FSNS( XML_xmlns, XML_a ), "http://schemas.openxmlformats.org/drawingml/2006/main", - // FSNS( XML_r, XML_id ), "rId4", - // FSEND ); + // FSNS( XML_r, XML_id ), "rId4"); m_pSerializer->endElementNS( XML_wp, XML_docPr ); - m_pSerializer->startElementNS( XML_wp, XML_cNvGraphicFramePr, - FSEND ); + m_pSerializer->startElementNS(XML_wp, XML_cNvGraphicFramePr); // TODO change aspect? m_pSerializer->singleElementNS( XML_a, XML_graphicFrameLocks, - FSNS( XML_xmlns, XML_a ), OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8).getStr(), - XML_noChangeAspect, "1", - FSEND ); + FSNS( XML_xmlns, XML_a ), GetExport().GetFilter().getNamespaceURL(OOX_NS(dml)).toUtf8(), + XML_noChangeAspect, "1" ); m_pSerializer->endElementNS( XML_wp, XML_cNvGraphicFramePr ); m_pSerializer->startElementNS( XML_a, XML_graphic, - FSNS( XML_xmlns, XML_a ), OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + FSNS( XML_xmlns, XML_a ), GetExport().GetFilter().getNamespaceURL(OOX_NS(dml)).toUtf8() ); m_pSerializer->startElementNS( XML_a, XML_graphicData, - XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/picture", - FSEND ); + XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/picture" ); m_pSerializer->startElementNS( XML_pic, XML_pic, - FSNS( XML_xmlns, XML_pic ), OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dmlPicture)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + FSNS( XML_xmlns, XML_pic ), GetExport().GetFilter().getNamespaceURL(OOX_NS(dmlPicture)).toUtf8() ); - m_pSerializer->startElementNS( XML_pic, XML_nvPicPr, - FSEND ); + m_pSerializer->startElementNS(XML_pic, XML_nvPicPr); // It seems pic:cNvpr and wp:docPr are pretty much the same thing with the same attributes - m_pSerializer->startElementNS( XML_pic, XML_cNvPr, docPrAttrListRef ); + m_pSerializer->startElementNS(XML_pic, XML_cNvPr, docPrAttrListRef); // TODO hyperlink // m_pSerializer->singleElementNS( XML_a, XML_hlinkClick, - // FSNS( XML_r, XML_id ), "rId4", - // FSEND ); + // FSNS( XML_r, XML_id ), "rId4"); m_pSerializer->endElementNS( XML_pic, XML_cNvPr ); - m_pSerializer->startElementNS( XML_pic, XML_cNvPicPr, - FSEND ); + m_pSerializer->startElementNS(XML_pic, XML_cNvPicPr); // TODO change aspect? m_pSerializer->singleElementNS( XML_a, XML_picLocks, - XML_noChangeAspect, "1", XML_noChangeArrowheads, "1", - FSEND ); + XML_noChangeAspect, "1", XML_noChangeArrowheads, "1" ); m_pSerializer->endElementNS( XML_pic, XML_cNvPicPr ); m_pSerializer->endElementNS( XML_pic, XML_nvPicPr ); // the actual picture - m_pSerializer->startElementNS( XML_pic, XML_blipFill, - FSEND ); + m_pSerializer->startElementNS(XML_pic, XML_blipFill); /* At this point we are certain that, WriteImage returns empty RelId for unhandled graphic type. Therefore we write the picture description @@ -4959,12 +4848,9 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size completely discarding it. */ if ( aRelId.isEmpty() ) - m_pSerializer->startElementNS( XML_a, XML_blip, - FSEND ); + m_pSerializer->startElementNS(XML_a, XML_blip); else - m_pSerializer->startElementNS( XML_a, XML_blip, - FSNS( XML_r, nImageType ), aRelId.getStr(), - FSEND ); + m_pSerializer->startElementNS(XML_a, XML_blip, FSNS(XML_r, nImageType), aRelId); pItem = nullptr; GraphicDrawMode nMode = GraphicDrawMode::Standard; @@ -4973,11 +4859,11 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size { nMode = static_cast(static_cast(pItem)->GetEnumValue()); if (nMode == GraphicDrawMode::Greys) - m_pSerializer->singleElementNS (XML_a, XML_grayscl, FSEND); + m_pSerializer->singleElementNS (XML_a, XML_grayscl); else if (nMode == GraphicDrawMode::Mono) //black/white has a 0,5 threshold in LibreOffice - m_pSerializer->singleElementNS (XML_a, XML_biLevel, XML_thresh, OString::number(50000), FSEND); + m_pSerializer->singleElementNS (XML_a, XML_biLevel, XML_thresh, OString::number(50000)); else if (nMode == GraphicDrawMode::Watermark) //watermark has a brightness/luminance of 0,5 and contrast of -0.7 in LibreOffice - m_pSerializer->singleElementNS( XML_a, XML_lum, XML_bright, OString::number(70000), XML_contrast, OString::number(-70000), FSEND ); + m_pSerializer->singleElementNS( XML_a, XML_lum, XML_bright, OString::number(70000), XML_contrast, OString::number(-70000) ); } m_pSerializer->endElementNS( XML_a, XML_blip ); @@ -4985,36 +4871,24 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size WriteSrcRect(pSdrObj, pFrameFormat); } - m_pSerializer->startElementNS( XML_a, XML_stretch, - FSEND ); - m_pSerializer->singleElementNS( XML_a, XML_fillRect, - FSEND ); + m_pSerializer->startElementNS(XML_a, XML_stretch); + m_pSerializer->singleElementNS(XML_a, XML_fillRect); m_pSerializer->endElementNS( XML_a, XML_stretch ); m_pSerializer->endElementNS( XML_pic, XML_blipFill ); // TODO setup the right values below - m_pSerializer->startElementNS( XML_pic, XML_spPr, - XML_bwMode, "auto", - FSEND ); + m_pSerializer->startElementNS(XML_pic, XML_spPr, XML_bwMode, "auto"); m_pSerializer->startElementNS( XML_a, XML_xfrm, uno::Reference(xFrameAttributes.get())); - m_pSerializer->singleElementNS( XML_a, XML_off, - XML_x, "0", XML_y, "0", - FSEND ); + m_pSerializer->singleElementNS(XML_a, XML_off, XML_x, "0", XML_y, "0"); OString aWidth( OString::number( TwipsToEMU( aSize.Width() ) ) ); OString aHeight( OString::number( TwipsToEMU( aSize.Height() ) ) ); - m_pSerializer->singleElementNS( XML_a, XML_ext, - XML_cx, aWidth.getStr(), - XML_cy, aHeight.getStr(), - FSEND ); + m_pSerializer->singleElementNS(XML_a, XML_ext, XML_cx, aWidth, XML_cy, aHeight); m_pSerializer->endElementNS( XML_a, XML_xfrm ); - m_pSerializer->startElementNS( XML_a, XML_prstGeom, - XML_prst, "rect", - FSEND ); - m_pSerializer->singleElementNS( XML_a, XML_avLst, - FSEND ); + m_pSerializer->startElementNS(XML_a, XML_prstGeom, XML_prst, "rect"); + m_pSerializer->singleElementNS(XML_a, XML_avLst); m_pSerializer->endElementNS( XML_a, XML_prstGeom ); const SvxBoxItem& rBoxItem = pFrameFormat->GetBox(); @@ -5091,22 +4965,16 @@ void DocxAttributeOutput::WritePostponedChart() if( xChartDoc.is() ) { SAL_INFO("sw.ww8", "DocxAttributeOutput::WriteOLE2Obj: export chart "); - m_pSerializer->startElementNS( XML_w, XML_drawing, - FSEND ); + m_pSerializer->startElementNS(XML_w, XML_drawing); m_pSerializer->startElementNS( XML_wp, XML_inline, - XML_distT, "0", XML_distB, "0", XML_distL, "0", XML_distR, "0", - FSEND ); + XML_distT, "0", XML_distB, "0", XML_distL, "0", XML_distR, "0" ); OString aWidth( OString::number( TwipsToEMU( itr.second.Width() ) ) ); OString aHeight( OString::number( TwipsToEMU( itr.second.Height() ) ) ); - m_pSerializer->singleElementNS( XML_wp, XML_extent, - XML_cx, aWidth.getStr(), - XML_cy, aHeight.getStr(), - FSEND ); + m_pSerializer->singleElementNS(XML_wp, XML_extent, XML_cx, aWidth, XML_cy, aHeight); // TODO - the right effectExtent, extent including the effect m_pSerializer->singleElementNS( XML_wp, XML_effectExtent, - XML_l, "0", XML_t, "0", XML_r, "0", XML_b, "0", - FSEND ); + XML_l, "0", XML_t, "0", XML_r, "0", XML_b, "0" ); OUString sName("Object 1"); uno::Reference< container::XNamed > xNamed( xShape, uno::UNO_QUERY ); @@ -5119,20 +4987,16 @@ void DocxAttributeOutput::WritePostponedChart() docPr Id should be unique, ensuring the same here. */ m_pSerializer->singleElementNS( XML_wp, XML_docPr, - XML_id, I32S( m_anchorId++ ), - XML_name, sName.toUtf8(), - FSEND ); + XML_id, OString::number(m_anchorId++), + XML_name, sName.toUtf8() ); - m_pSerializer->singleElementNS( XML_wp, XML_cNvGraphicFramePr, - FSEND ); + m_pSerializer->singleElementNS(XML_wp, XML_cNvGraphicFramePr); m_pSerializer->startElementNS( XML_a, XML_graphic, - FSNS( XML_xmlns, XML_a ), OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + FSNS( XML_xmlns, XML_a ), GetExport().GetFilter().getNamespaceURL(OOX_NS(dml)).toUtf8() ); m_pSerializer->startElementNS( XML_a, XML_graphicData, - XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/chart", - FSEND ); + XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/chart" ); OString aRelId; m_nChartCount++; @@ -5140,10 +5004,9 @@ void DocxAttributeOutput::WritePostponedChart() aRelId = m_rExport.OutputChart( xModel, m_nChartCount, m_pSerializer ); m_pSerializer->singleElementNS( XML_c, XML_chart, - FSNS( XML_xmlns, XML_c ), OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(dmlChart)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_r ), OUStringToOString(GetExport().GetFilter().getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_r, XML_id ), aRelId.getStr(), - FSEND ); + FSNS( XML_xmlns, XML_c ), GetExport().GetFilter().getNamespaceURL(OOX_NS(dmlChart)).toUtf8(), + FSNS( XML_xmlns, XML_r ), GetExport().GetFilter().getNamespaceURL(OOX_NS(officeRel)).toUtf8(), + FSNS( XML_r, XML_id ), aRelId ); m_pSerializer->endElementNS( XML_a, XML_graphicData ); m_pSerializer->endElementNS( XML_a, XML_graphic ); @@ -5277,41 +5140,32 @@ void DocxAttributeOutput::WritePostponedFormControl(const SdrObject* pObject) // output component - m_pSerializer->startElementNS(XML_w, XML_sdt, FSEND); - m_pSerializer->startElementNS(XML_w, XML_sdtPr, FSEND); + m_pSerializer->startElementNS(XML_w, XML_sdt); + m_pSerializer->startElementNS(XML_w, XML_sdtPr); if (!sAlias.isEmpty()) m_pSerializer->singleElementNS(XML_w, XML_alias, - FSNS(XML_w, XML_val), OUStringToOString(sAlias, RTL_TEXTENCODING_UTF8), - FSEND); + FSNS(XML_w, XML_val), OUStringToOString(sAlias, RTL_TEXTENCODING_UTF8)); if (bHasDate) - m_pSerializer->startElementNS(XML_w, XML_date, - FSNS( XML_w, XML_fullDate ), sDate.getStr(), - FSEND); + m_pSerializer->startElementNS(XML_w, XML_date, FSNS(XML_w, XML_fullDate), sDate); else - m_pSerializer->startElementNS(XML_w, XML_date, FSEND); + m_pSerializer->startElementNS(XML_w, XML_date); m_pSerializer->singleElementNS(XML_w, XML_dateFormat, - FSNS(XML_w, XML_val), - OUStringToOString( sDateFormat, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND); + FSNS(XML_w, XML_val), sDateFormat.toUtf8()); m_pSerializer->singleElementNS(XML_w, XML_lid, - FSNS(XML_w, XML_val), - OUStringToOString( sLocale, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND); + FSNS(XML_w, XML_val), sLocale.toUtf8()); m_pSerializer->singleElementNS(XML_w, XML_storeMappedDataAs, - FSNS(XML_w, XML_val), "dateTime", - FSEND); + FSNS(XML_w, XML_val), "dateTime"); m_pSerializer->singleElementNS(XML_w, XML_calendar, - FSNS(XML_w, XML_val), "gregorian", - FSEND); + FSNS(XML_w, XML_val), "gregorian"); m_pSerializer->endElementNS(XML_w, XML_date); m_pSerializer->endElementNS(XML_w, XML_sdtPr); - m_pSerializer->startElementNS(XML_w, XML_sdtContent, FSEND); - m_pSerializer->startElementNS(XML_w, XML_r, FSEND); + m_pSerializer->startElementNS(XML_w, XML_sdtContent); + m_pSerializer->startElementNS(XML_w, XML_r); if (aCharFormat.hasElements()) { @@ -5335,26 +5189,23 @@ void DocxAttributeOutput::WritePostponedFormControl(const SdrObject* pObject) // output component - m_pSerializer->startElementNS(XML_w, XML_sdt, FSEND); - m_pSerializer->startElementNS(XML_w, XML_sdtPr, FSEND); + m_pSerializer->startElementNS(XML_w, XML_sdt); + m_pSerializer->startElementNS(XML_w, XML_sdtPr); - m_pSerializer->startElementNS(XML_w, XML_dropDownList, FSEND); + m_pSerializer->startElementNS(XML_w, XML_dropDownList); for (sal_Int32 i=0; i < aItems.getLength(); ++i) { m_pSerializer->singleElementNS(XML_w, XML_listItem, - FSNS(XML_w, XML_displayText), - OUStringToOString( aItems[i], RTL_TEXTENCODING_UTF8 ).getStr(), - FSNS(XML_w, XML_value), - OUStringToOString( aItems[i], RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND); + FSNS(XML_w, XML_displayText), aItems[i].toUtf8(), + FSNS(XML_w, XML_value), aItems[i].toUtf8()); } m_pSerializer->endElementNS(XML_w, XML_dropDownList); m_pSerializer->endElementNS(XML_w, XML_sdtPr); - m_pSerializer->startElementNS(XML_w, XML_sdtContent, FSEND); - m_pSerializer->startElementNS(XML_w, XML_r, FSEND); + m_pSerializer->startElementNS(XML_w, XML_sdtContent); + m_pSerializer->startElementNS(XML_w, XML_r); RunText(sText); m_pSerializer->endElementNS(XML_w, XML_r); m_pSerializer->endElementNS(XML_w, XML_sdtContent); @@ -5387,14 +5238,14 @@ void DocxAttributeOutput::WriteActiveXControl(const SdrObject* pObject, const Sw if(!bInsideRun) { - m_pSerializer->startElementNS(XML_w, XML_r, FSEND); + m_pSerializer->startElementNS(XML_w, XML_r); } // w:pict for floating embedded control and w:object for inline embedded control if(bAnchoredInline) - m_pSerializer->startElementNS(XML_w, XML_object, FSEND); + m_pSerializer->startElementNS(XML_w, XML_object); else - m_pSerializer->startElementNS(XML_w, XML_pict, FSEND); + m_pSerializer->startElementNS(XML_w, XML_pict); // write ActiveX fragment and ActiveX binary uno::Reference xShape(const_cast(pObject)->getUnoShape(), uno::UNO_QUERY); @@ -5425,10 +5276,9 @@ void DocxAttributeOutput::WriteActiveXControl(const SdrObject* pObject, const Sw // control m_pSerializer->singleElementNS(XML_w, XML_control, - FSNS(XML_r, XML_id), sRelIdAndName.first.getStr(), - FSNS(XML_w, XML_name), sRelIdAndName.second.getStr(), - FSNS(XML_w, XML_shapeid), sShapeId.getStr(), - FSEND); + FSNS(XML_r, XML_id), sRelIdAndName.first, + FSNS(XML_w, XML_name), sRelIdAndName.second, + FSNS(XML_w, XML_shapeid), sShapeId); if(bAnchoredInline) m_pSerializer->endElementNS(XML_w, XML_object); @@ -5563,17 +5413,16 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S m_pSerializer->startElementNS( XML_w, XML_object, FSNS(XML_w, XML_dxaOrig), OString::number(aOriginalSize.Width()), - FSNS(XML_w, XML_dyaOrig), OString::number(aOriginalSize.Height()), - FSEND ); + FSNS(XML_w, XML_dyaOrig), OString::number(aOriginalSize.Height()) ); } catch ( uno::Exception& ) { - m_pSerializer->startElementNS( XML_w, XML_object, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_object); } } else { - m_pSerializer->startElementNS( XML_w, XML_object, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_object); } OStringBuffer sShapeStyle, sShapeId; @@ -5586,26 +5435,23 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S m_pSerializer->startElementNS( XML_v, XML_shape, XML_id, sShapeId.getStr(), XML_style, sShapeStyle.getStr(), - FSNS( XML_o, XML_ole ), "", //compulsory, even if it's empty - FSEND ); + FSNS( XML_o, XML_ole ), ""); //compulsory, even if it's empty // shape filled with the preview image m_pSerializer->singleElementNS( XML_v, XML_imagedata, - FSNS( XML_r, XML_id ), OUStringToOString( sImageId, RTL_TEXTENCODING_UTF8 ).getStr(), - FSNS( XML_o, XML_title ), "", - FSEND ); + FSNS( XML_r, XML_id ), sImageId.toUtf8(), + FSNS( XML_o, XML_title ), "" ); m_pSerializer->endElementNS( XML_v, XML_shape ); // OLE object definition m_pSerializer->singleElementNS( XML_o, XML_OLEObject, XML_Type, "Embed", - XML_ProgID, OUStringToOString( sProgID, RTL_TEXTENCODING_UTF8 ).getStr(), + XML_ProgID, sProgID.toUtf8(), XML_ShapeID, sShapeId.getStr(), - XML_DrawAspect, OUStringToOString( sDrawAspect, RTL_TEXTENCODING_UTF8 ).getStr(), + XML_DrawAspect, sDrawAspect.toUtf8(), XML_ObjectID, "_" + OString::number(comphelper::rng::uniform_int_distribution(0, std::numeric_limits::max())), - FSNS( XML_r, XML_id ), sId.getStr(), - FSEND ); + FSNS( XML_r, XML_id ), sId ); m_pSerializer->endElementNS( XML_w, XML_object ); } @@ -5796,7 +5642,7 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj) sal_Int32 nPara = rEditObj.GetParagraphCount(); - m_pSerializer->startElementNS( XML_w, XML_txbxContent, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_txbxContent); for (sal_Int32 n = 0; n < nPara; ++n) { if( n ) @@ -5817,10 +5663,10 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj) do { const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd); - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); // Write run properties. - m_pSerializer->startElementNS(XML_w, XML_rPr, FSEND); + m_pSerializer->startElementNS(XML_w, XML_rPr); aAttrIter.OutAttr(nCurrentPos); WriteCollectedRunProperties(); m_pSerializer->endElementNS(XML_w, XML_rPr); @@ -6006,48 +5852,42 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType, XFastAttributeListRef xStyleAttributeList(pStyleAttributeList); m_pSerializer->startElementNS( XML_w, XML_style, xStyleAttributeList); m_pSerializer->singleElementNS( XML_w, XML_name, - FSNS( XML_w, XML_val ), pEnglishName ? pEnglishName : OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS( XML_w, XML_val ), pEnglishName ? pEnglishName : rName.toUtf8() ); if ( nBase != 0x0FFF && eType != STYLE_TYPE_LIST) { m_pSerializer->singleElementNS( XML_w, XML_basedOn, - FSNS( XML_w, XML_val ), m_rExport.m_pStyles->GetStyleId(nBase).getStr(), - FSEND ); + FSNS( XML_w, XML_val ), m_rExport.m_pStyles->GetStyleId(nBase) ); } if ( nNext != nId && eType != STYLE_TYPE_LIST) { m_pSerializer->singleElementNS( XML_w, XML_next, - FSNS( XML_w, XML_val ), m_rExport.m_pStyles->GetStyleId(nNext).getStr(), - FSEND ); + FSNS( XML_w, XML_val ), m_rExport.m_pStyles->GetStyleId(nNext) ); } if (!aLink.isEmpty()) m_pSerializer->singleElementNS(XML_w, XML_link, - FSNS(XML_w, XML_val), OUStringToOString(aLink, RTL_TEXTENCODING_UTF8).getStr(), - FSEND); + FSNS(XML_w, XML_val), aLink.toUtf8()); if ( bAutoUpdate ) - m_pSerializer->singleElementNS( XML_w, XML_autoRedefine, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_autoRedefine); if (!aUiPriority.isEmpty()) m_pSerializer->singleElementNS(XML_w, XML_uiPriority, - FSNS(XML_w, XML_val), OUStringToOString(aUiPriority, RTL_TEXTENCODING_UTF8).getStr(), - FSEND); + FSNS(XML_w, XML_val), aUiPriority.toUtf8()); if (bSemiHidden) - m_pSerializer->singleElementNS(XML_w, XML_semiHidden, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_semiHidden); if (bUnhideWhenUsed) - m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed); if (bQFormat || lcl_guessQFormat(rName, nWwId)) - m_pSerializer->singleElementNS(XML_w, XML_qFormat, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_qFormat); if (bLocked) - m_pSerializer->singleElementNS(XML_w, XML_locked, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_locked); if (!aRsid.isEmpty()) m_pSerializer->singleElementNS(XML_w, XML_rsid, - FSNS(XML_w, XML_val), OUStringToOString(aRsid, RTL_TEXTENCODING_UTF8).getStr(), - FSEND); + FSNS(XML_w, XML_val), aRsid.toUtf8()); } void DocxAttributeOutput::EndStyle() @@ -6059,12 +5899,12 @@ void DocxAttributeOutput::StartStyleProperties( bool bParProp, sal_uInt16 /*nSty { if ( bParProp ) { - m_pSerializer->startElementNS( XML_w, XML_pPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_pPr); InitCollectedParagraphProperties(); } else { - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_rPr); InitCollectedRunProperties(); } } @@ -6100,8 +5940,7 @@ void lcl_OutlineLevel(sax_fastparser::FSHelperPtr const & pSerializer, sal_uInt1 nLevel = WW8ListManager::nMaxLevel - 1; pSerializer->singleElementNS(XML_w, XML_outlineLvl, - FSNS(XML_w, XML_val), OString::number(nLevel).getStr(), - FSEND); + FSNS(XML_w, XML_val), OString::number(nLevel)); } } @@ -6120,11 +5959,10 @@ void DocxAttributeOutput::ParaOutlineLevel(const SfxUInt16Item& rItem) void DocxAttributeOutput::PageBreakBefore( bool bBreak ) { if ( bBreak ) - m_pSerializer->singleElementNS( XML_w, XML_pageBreakBefore, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_pageBreakBefore); else m_pSerializer->singleElementNS( XML_w, XML_pageBreakBefore, - FSNS( XML_w, XML_val ), "false", - FSEND ); + FSNS( XML_w, XML_val ), "false" ); } void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo ) @@ -6172,8 +6010,8 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectio if ( !m_bParagraphOpened && !m_bIsFirstParagraph && bEmit ) { // Create a dummy paragraph if needed - m_pSerializer->startElementNS( XML_w, XML_p, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_pPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_p); + m_pSerializer->startElementNS(XML_w, XML_pPr); m_rExport.SectionProperties( *pSectionInfo ); @@ -6189,9 +6027,8 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectio } else if ( m_bParagraphOpened ) { - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_br, - FSNS( XML_w, XML_type ), "page", FSEND ); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->singleElementNS(XML_w, XML_br, FSNS(XML_w, XML_type), "page"); m_pSerializer->endElementNS( XML_w, XML_r ); } else @@ -6216,7 +6053,7 @@ void DocxAttributeOutput::EndParaSdtBlock() void DocxAttributeOutput::StartSection() { - m_pSerializer->startElementNS( XML_w, XML_sectPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_sectPr); m_bOpenedSectPr = true; // Write the elements in the spec order @@ -6273,11 +6110,9 @@ void DocxAttributeOutput::EndSection() void DocxAttributeOutput::SectionFormProtection( bool bProtected ) { if ( bProtected ) - m_pSerializer->singleElementNS( XML_w, XML_formProt, - FSNS( XML_w, XML_val ), "true", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_formProt, FSNS(XML_w, XML_val), "true"); else - m_pSerializer->singleElementNS( XML_w, XML_formProt, - FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_formProt, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::SectionLineNumbering( sal_uLong nRestartNo, const SwLineNumberInfo& rLnNumInfo ) @@ -6296,7 +6131,7 @@ void DocxAttributeOutput::SectionLineNumbering( sal_uLong nRestartNo, const SwLi void DocxAttributeOutput::SectionTitlePage() { - m_pSerializer->singleElementNS( XML_w, XML_titlePg, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_titlePg); } void DocxAttributeOutput::SectionPageBorders( const SwFrameFormat* pFormat, const SwFrameFormat* /*pFirstPageFormat*/ ) @@ -6338,8 +6173,7 @@ void DocxAttributeOutput::SectionPageBorders( const SwFrameFormat* pFormat, cons // All distances are relative to the text margins m_pSerializer->startElementNS(XML_w, XML_pgBorders, FSNS(XML_w, XML_display), "allPages", - FSNS(XML_w, XML_offsetFrom), aOutputBorderOptions.pDistances->bFromEdge ? "page" : "text", - FSEND); + FSNS(XML_w, XML_offsetFrom), aOutputBorderOptions.pDistances->bFromEdge ? "page" : "text"); std::map aEmptyMap; // empty styles map impl_borders( m_pSerializer, rBox, aOutputBorderOptions, aEmptyMap ); @@ -6351,7 +6185,7 @@ void DocxAttributeOutput::SectionPageBorders( const SwFrameFormat* pFormat, cons void DocxAttributeOutput::SectionBiDi( bool bBiDi ) { if ( bBiDi ) - m_pSerializer->singleElementNS( XML_w, XML_bidi, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_bidi); } static OString impl_NumberingType( sal_uInt16 nNumberingType ) @@ -6504,7 +6338,7 @@ void DocxAttributeOutput::SectionType( sal_uInt8 nBreakCode ) default: pType = "continuous"; break; } - m_pSerializer->singleElementNS(XML_w, XML_type, FSNS(XML_w, XML_val), pType, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_type, FSNS(XML_w, XML_val), pType); } void DocxAttributeOutput::TextVerticalAdjustment( const drawing::TextVerticalAdjust nVA ) @@ -6512,16 +6346,13 @@ void DocxAttributeOutput::TextVerticalAdjustment( const drawing::TextVerticalAdj switch( nVA ) { case drawing::TextVerticalAdjust_CENTER: - m_pSerializer->singleElementNS( XML_w, XML_vAlign, - FSNS( XML_w, XML_val ), "center", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vAlign, FSNS(XML_w, XML_val), "center"); break; case drawing::TextVerticalAdjust_BOTTOM: - m_pSerializer->singleElementNS( XML_w, XML_vAlign, - FSNS( XML_w, XML_val ), "bottom", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vAlign, FSNS(XML_w, XML_val), "bottom"); break; case drawing::TextVerticalAdjust_BLOCK: //justify - m_pSerializer->singleElementNS( XML_w, XML_vAlign, - FSNS( XML_w, XML_val ), "both", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vAlign, FSNS(XML_w, XML_val), "both"); break; default: break; @@ -6530,9 +6361,7 @@ void DocxAttributeOutput::TextVerticalAdjustment( const drawing::TextVerticalAdj void DocxAttributeOutput::StartFont( const OUString& rFamilyName ) const { - m_pSerializer->startElementNS( XML_w, XML_font, - FSNS( XML_w, XML_name ), OUStringToOString( rFamilyName, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + m_pSerializer->startElementNS(XML_w, XML_font, FSNS(XML_w, XML_name), rFamilyName.toUtf8()); } void DocxAttributeOutput::EndFont() const @@ -6542,9 +6371,7 @@ void DocxAttributeOutput::EndFont() const void DocxAttributeOutput::FontAlternateName( const OUString& rName ) const { - m_pSerializer->singleElementNS( XML_w, XML_altName, - FSNS( XML_w, XML_val ), OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_altName, FSNS(XML_w, XML_val), rName.toUtf8()); } void DocxAttributeOutput::FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const @@ -6578,7 +6405,7 @@ void DocxAttributeOutput::FontFamilyType( FontFamily eFamily ) const default: pFamily = "auto"; break; // no font family } - m_pSerializer->singleElementNS(XML_w, XML_family, FSNS(XML_w, XML_val), pFamily, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_family, FSNS(XML_w, XML_val), pFamily); } void DocxAttributeOutput::FontPitchType( FontPitch ePitch ) const @@ -6591,7 +6418,7 @@ void DocxAttributeOutput::FontPitchType( FontPitch ePitch ) const default: pPitch = "default"; break; // no info about the pitch } - m_pSerializer->singleElementNS(XML_w, XML_pitch, FSNS(XML_w, XML_val), pPitch, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_pitch, FSNS(XML_w, XML_val), pPitch); } void DocxAttributeOutput::EmbedFont( const OUString& name, FontFamily family, FontPitch pitch ) @@ -6685,8 +6512,7 @@ void DocxAttributeOutput::EmbedFontStyle( const OUString& name, int tag, FontFam } m_pSerializer->singleElementNS( XML_w, tag, FSNS( XML_r, XML_id ), fontFilesMap[ fontUrl ].relId, - FSNS( XML_w, XML_fontKey ), fontFilesMap[ fontUrl ].fontKey, - FSEND ); + FSNS( XML_w, XML_fontKey ), fontFilesMap[ fontUrl ].fontKey ); } OString DocxAttributeOutput::TransHighlightColor( sal_uInt8 nIco ) @@ -6720,13 +6546,9 @@ void DocxAttributeOutput::NumberingDefinition( sal_uInt16 nId, const SwNumRule & // TODO check that this is actually true & fix if not ;-) OString aId( OString::number( nId ) ); - m_pSerializer->startElementNS( XML_w, XML_num, - FSNS( XML_w, XML_numId ), aId.getStr(), - FSEND ); + m_pSerializer->startElementNS(XML_w, XML_num, FSNS(XML_w, XML_numId), aId); - m_pSerializer->singleElementNS( XML_w, XML_abstractNumId, - FSNS( XML_w, XML_val ), aId.getStr(), - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_abstractNumId, FSNS(XML_w, XML_val), aId); #if OSL_DEBUG_LEVEL > 1 // TODO ww8 version writes this, anything to do about it here? @@ -6744,8 +6566,7 @@ void DocxAttributeOutput::StartAbstractNumbering( sal_uInt16 nId ) const SwNumRule* pRule = (*m_rExport.m_pUsedNumTable)[nId - 1]; m_bExportingOutline = pRule && pRule->IsOutlineRule(); m_pSerializer->startElementNS( XML_w, XML_abstractNum, - FSNS( XML_w, XML_abstractNumId ), OString::number( nId ).getStr(), - FSEND ); + FSNS( XML_w, XML_abstractNumId ), OString::number(nId) ); } void DocxAttributeOutput::EndAbstractNumbering() @@ -6767,9 +6588,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, const OUString &rNumberingString, const SvxBrushItem* pBrush) { - m_pSerializer->startElementNS( XML_w, XML_lvl, - FSNS( XML_w, XML_ilvl ), OString::number( nLevel ).getStr(), - FSEND ); + m_pSerializer->startElementNS(XML_w, XML_lvl, FSNS(XML_w, XML_ilvl), OString::number(nLevel)); // start with the nStart value. Do not write w:start if Numbered Lists // starts from zero.As it's an optional parameter. @@ -6777,8 +6596,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, if(!(0 == nLevel && 0 == nStart)) { m_pSerializer->singleElementNS( XML_w, XML_start, - FSNS( XML_w, XML_val ), OString::number( nStart ).getStr(), - FSEND ); + FSNS( XML_w, XML_val ), OString::number(nStart) ); } if (m_bExportingOutline) @@ -6786,16 +6604,13 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, sal_uInt16 nId = m_rExport.m_pStyles->GetHeadingParagraphStyleId( nLevel ); if ( nId != SAL_MAX_UINT16 ) m_pSerializer->singleElementNS( XML_w, XML_pStyle , - FSNS( XML_w, XML_val ), m_rExport.m_pStyles->GetStyleId(nId).getStr(), - FSEND ); + FSNS( XML_w, XML_val ), m_rExport.m_pStyles->GetStyleId(nId) ); } // format OString aFormat( impl_LevelNFC( nNumberingType ,pOutSet) ); if ( !aFormat.isEmpty() ) - m_pSerializer->singleElementNS( XML_w, XML_numFmt, - FSNS( XML_w, XML_val ), aFormat.getStr(), - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_numFmt, FSNS(XML_w, XML_val), aFormat); // suffix const char *pSuffix = nullptr; @@ -6806,9 +6621,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, default: /*pSuffix = "tab";*/ break; } if ( pSuffix ) - m_pSerializer->singleElementNS( XML_w, XML_suff, - FSNS( XML_w, XML_val ), pSuffix, - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_suff, FSNS(XML_w, XML_val), pSuffix); // text OUStringBuffer aBuffer( rNumberingString.getLength() + WW8ListManager::nMaxLevel ); @@ -6836,7 +6649,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, // If bullet char is empty, set lvlText as empty if ( rNumberingString == OUStringLiteral1(0) && nNumberingType == SVX_NUM_CHAR_SPECIAL ) { - m_pSerializer->singleElementNS( XML_w, XML_lvlText, FSNS( XML_w, XML_val ), "", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_lvlText, FSNS(XML_w, XML_val), ""); } else { @@ -6845,7 +6658,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, static OUString aZeroWidthSpace(u'\x200B'); if (aLevelText == aZeroWidthSpace) aLevelText.clear(); - m_pSerializer->singleElementNS(XML_w, XML_lvlText, FSNS(XML_w, XML_val), aLevelText.toUtf8(), FSEND); + m_pSerializer->singleElementNS(XML_w, XML_lvlText, FSNS(XML_w, XML_val), aLevelText.toUtf8()); } // bullet @@ -6855,8 +6668,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, if (nIndex != -1) { m_pSerializer->singleElementNS(XML_w, XML_lvlPicBulletId, - FSNS(XML_w, XML_val), OString::number(nIndex).getStr(), - FSEND); + FSNS(XML_w, XML_val), OString::number(nIndex)); } } @@ -6869,45 +6681,40 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, case SvxAdjust::Right: pJc = !ecmaDialect ? "end" : "right"; break; default: pJc = !ecmaDialect ? "start" : "left"; break; } - m_pSerializer->singleElementNS( XML_w, XML_lvlJc, - FSNS( XML_w, XML_val ), pJc, - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_lvlJc, FSNS(XML_w, XML_val), pJc); // indentation - m_pSerializer->startElementNS( XML_w, XML_pPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_pPr); if( nListTabPos != 0 ) { - m_pSerializer->startElementNS( XML_w, XML_tabs, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_tabs); m_pSerializer->singleElementNS( XML_w, XML_tab, FSNS( XML_w, XML_val ), "num", - FSNS( XML_w, XML_pos ), OString::number( nListTabPos ).getStr(), - FSEND ); + FSNS( XML_w, XML_pos ), OString::number(nListTabPos) ); m_pSerializer->endElementNS( XML_w, XML_tabs ); } sal_Int32 nToken = ecmaDialect ? XML_left : XML_start; sal_Int32 nIndentToken = nFirstLineIndex > 0 ? XML_firstLine : XML_hanging; m_pSerializer->singleElementNS( XML_w, XML_ind, - FSNS( XML_w, nToken ), OString::number( nIndentAt ).getStr(), - FSNS( XML_w, nIndentToken ), OString::number( abs(nFirstLineIndex) ).getStr(), - FSEND ); + FSNS( XML_w, nToken ), OString::number(nIndentAt), + FSNS( XML_w, nIndentToken ), OString::number(abs(nFirstLineIndex)) ); m_pSerializer->endElementNS( XML_w, XML_pPr ); // font if ( pOutSet ) { - m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_rPr); if ( pFont ) { GetExport().GetId( *pFont ); // ensure font info is written to fontTable.xml OString aFamilyName( OUStringToOString( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 ) ); m_pSerializer->singleElementNS( XML_w, XML_rFonts, - FSNS( XML_w, XML_ascii ), aFamilyName.getStr(), - FSNS( XML_w, XML_hAnsi ), aFamilyName.getStr(), - FSNS( XML_w, XML_cs ), aFamilyName.getStr(), - FSNS( XML_w, XML_hint ), "default", - FSEND ); + FSNS( XML_w, XML_ascii ), aFamilyName, + FSNS( XML_w, XML_hAnsi ), aFamilyName, + FSNS( XML_w, XML_cs ), aFamilyName, + FSNS( XML_w, XML_hint ), "default" ); } m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.m_bExportModeRTF ); @@ -6926,14 +6733,14 @@ void DocxAttributeOutput::CharCaseMap( const SvxCaseMapItem& rCaseMap ) switch ( rCaseMap.GetValue() ) { case SvxCaseMap::SmallCaps: - m_pSerializer->singleElementNS( XML_w, XML_smallCaps, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_smallCaps); break; case SvxCaseMap::Uppercase: - m_pSerializer->singleElementNS( XML_w, XML_caps, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_caps); break; default: // Something that ooxml does not support - m_pSerializer->singleElementNS( XML_w, XML_smallCaps, FSNS( XML_w, XML_val ), "false", FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_caps, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_smallCaps, FSNS(XML_w, XML_val), "false"); + m_pSerializer->singleElementNS(XML_w, XML_caps, FSNS(XML_w, XML_val), "false"); break; } } @@ -6956,9 +6763,9 @@ void DocxAttributeOutput::CharColor( const SvxColorItem& rColor ) void DocxAttributeOutput::CharContour( const SvxContourItem& rContour ) { if ( rContour.GetValue() ) - m_pSerializer->singleElementNS( XML_w, XML_outline, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_outline); else - m_pSerializer->singleElementNS( XML_w, XML_outline, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_outline, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ) @@ -6966,14 +6773,14 @@ void DocxAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ) switch ( rCrossedOut.GetStrikeout() ) { case STRIKEOUT_DOUBLE: - m_pSerializer->singleElementNS( XML_w, XML_dstrike, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_dstrike); break; case STRIKEOUT_NONE: - m_pSerializer->singleElementNS( XML_w, XML_dstrike, FSNS( XML_w, XML_val ), "false", FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_strike, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_dstrike, FSNS(XML_w, XML_val), "false"); + m_pSerializer->singleElementNS(XML_w, XML_strike, FSNS(XML_w, XML_val), "false"); break; default: - m_pSerializer->singleElementNS( XML_w, XML_strike, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_strike); break; } } @@ -6997,22 +6804,19 @@ void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement ) } if ( !sIss.isEmpty() ) - m_pSerializer->singleElementNS( XML_w, XML_vertAlign, - FSNS( XML_w, XML_val ), sIss.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vertAlign, FSNS(XML_w, XML_val), sIss); const SvxFontHeightItem& rItem = m_rExport.GetItem(RES_CHRATR_FONTSIZE); if (sIss.isEmpty() || sIss.match("baseline")) { long nHeight = rItem.GetHeight(); OString sPos = OString::number( ( nHeight * nEsc + 500 ) / 1000 ); - m_pSerializer->singleElementNS( XML_w, XML_position, - FSNS( XML_w, XML_val ), sPos.getStr( ), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_position, FSNS(XML_w, XML_val), sPos); if( ( 100 != nProp || sIss.match( "baseline" ) ) && !m_rExport.m_bFontSizeWritten ) { OString sSize = OString::number( ( nHeight * nProp + 500 ) / 1000 ); - m_pSerializer->singleElementNS( XML_w, XML_sz, - FSNS( XML_w, XML_val ), sSize.getStr( ), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_sz, FSNS(XML_w, XML_val), sSize); } } } @@ -7049,10 +6853,10 @@ void DocxAttributeOutput::CharFontSize( const SvxFontHeightItem& rFontSize) { case RES_CHRATR_FONTSIZE: case RES_CHRATR_CJK_FONTSIZE: - m_pSerializer->singleElementNS( XML_w, XML_sz, FSNS( XML_w, XML_val ), fontSize.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_sz, FSNS(XML_w, XML_val), fontSize); break; case RES_CHRATR_CTL_FONTSIZE: - m_pSerializer->singleElementNS( XML_w, XML_szCs, FSNS( XML_w, XML_val ), fontSize.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_szCs, FSNS(XML_w, XML_val), fontSize); break; } } @@ -7060,7 +6864,7 @@ void DocxAttributeOutput::CharFontSize( const SvxFontHeightItem& rFontSize) void DocxAttributeOutput::CharKerning( const SvxKerningItem& rKerning ) { OString aKerning = OString::number( rKerning.GetValue() ); - m_pSerializer->singleElementNS( XML_w, XML_spacing, FSNS(XML_w, XML_val), aKerning.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_spacing, FSNS(XML_w, XML_val), aKerning); } void DocxAttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage ) @@ -7086,17 +6890,17 @@ void DocxAttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage ) void DocxAttributeOutput::CharPosture( const SvxPostureItem& rPosture ) { if ( rPosture.GetPosture() != ITALIC_NONE ) - m_pSerializer->singleElementNS( XML_w, XML_i, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_i); else - m_pSerializer->singleElementNS( XML_w, XML_i, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_i, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::CharShadow( const SvxShadowedItem& rShadow ) { if ( rShadow.GetValue() ) - m_pSerializer->singleElementNS( XML_w, XML_shadow, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_shadow); else - m_pSerializer->singleElementNS( XML_w, XML_shadow, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_shadow, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline ) @@ -7132,22 +6936,21 @@ void DocxAttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline ) // Underline has a color m_pSerializer->singleElementNS( XML_w, XML_u, FSNS( XML_w, XML_val ), pUnderlineValue, - FSNS( XML_w, XML_color ), msfilter::util::ConvertColor( aUnderlineColor ).getStr(), - FSEND ); + FSNS( XML_w, XML_color ), msfilter::util::ConvertColor(aUnderlineColor) ); } else { // Underline has no color - m_pSerializer->singleElementNS( XML_w, XML_u, FSNS( XML_w, XML_val ), pUnderlineValue, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_u, FSNS(XML_w, XML_val), pUnderlineValue); } } void DocxAttributeOutput::CharWeight( const SvxWeightItem& rWeight ) { if ( rWeight.GetWeight() == WEIGHT_BOLD ) - m_pSerializer->singleElementNS( XML_w, XML_b, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_b); else - m_pSerializer->singleElementNS( XML_w, XML_b, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_b, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::CharAutoKern( const SvxAutoKernItem& rAutoKern ) @@ -7155,15 +6958,15 @@ void DocxAttributeOutput::CharAutoKern( const SvxAutoKernItem& rAutoKern ) // auto kerning is bound to a minimum font size in Word - but is just a boolean in Writer :-( // kerning is based on half-point sizes, so 2 enables kerning for fontsize 1pt or higher. (1 is treated as size 12, and 0 is treated as disabled.) const OString sFontSize = OString::number( static_cast(rAutoKern.GetValue()) * 2 ); - m_pSerializer->singleElementNS(XML_w, XML_kern, FSNS( XML_w, XML_val ), sFontSize.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_kern, FSNS(XML_w, XML_val), sFontSize); } void DocxAttributeOutput::CharAnimatedText( const SvxBlinkItem& rBlink ) { if ( rBlink.GetValue() ) - m_pSerializer->singleElementNS(XML_w, XML_effect, FSNS( XML_w, XML_val ), "blinkBackground", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_effect, FSNS(XML_w, XML_val), "blinkBackground"); else - m_pSerializer->singleElementNS(XML_w, XML_effect, FSNS( XML_w, XML_val ), "none", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_effect, FSNS(XML_w, XML_val), "none"); } #define MSWORD_CH_SHADING_FILL "FFFFFF" // The attribute w:fill of w:shd, for MS-Word's character shading, @@ -7178,15 +6981,13 @@ void DocxAttributeOutput::CharBackground( const SvxBrushItem& rBrush ) m_pSerializer->singleElementNS( XML_w, XML_shd, FSNS( XML_w, XML_val ), MSWORD_CH_SHADING_VAL, FSNS( XML_w, XML_color ), MSWORD_CH_SHADING_COLOR, - FSNS( XML_w, XML_fill ), MSWORD_CH_SHADING_FILL, - FSEND ); + FSNS( XML_w, XML_fill ), MSWORD_CH_SHADING_FILL ); } else { m_pSerializer->singleElementNS( XML_w, XML_shd, - FSNS( XML_w, XML_fill ), msfilter::util::ConvertColor( rBrush.GetColor() ).getStr(), - FSNS( XML_w, XML_val ), "clear", - FSEND ); + FSNS( XML_w, XML_fill ), msfilter::util::ConvertColor(rBrush.GetColor()), + FSNS( XML_w, XML_val ), "clear" ); } } @@ -7208,17 +7009,17 @@ void DocxAttributeOutput::CharFontCJK( const SvxFontItem& rFont ) void DocxAttributeOutput::CharPostureCJK( const SvxPostureItem& rPosture ) { if ( rPosture.GetPosture() != ITALIC_NONE ) - m_pSerializer->singleElementNS( XML_w, XML_i, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_i); else - m_pSerializer->singleElementNS( XML_w, XML_i, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_i, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight ) { if ( rWeight.GetWeight() == WEIGHT_BOLD ) - m_pSerializer->singleElementNS( XML_w, XML_b, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_b); else - m_pSerializer->singleElementNS( XML_w, XML_b, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_b, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::CharFontCTL( const SvxFontItem& rFont ) @@ -7239,17 +7040,17 @@ void DocxAttributeOutput::CharFontCTL( const SvxFontItem& rFont ) void DocxAttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture) { if ( rPosture.GetPosture() != ITALIC_NONE ) - m_pSerializer->singleElementNS( XML_w, XML_iCs, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_iCs); else - m_pSerializer->singleElementNS( XML_w, XML_iCs, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_iCs, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight ) { if ( rWeight.GetWeight() == WEIGHT_BOLD ) - m_pSerializer->singleElementNS( XML_w, XML_bCs, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_bCs); else - m_pSerializer->singleElementNS( XML_w, XML_bCs, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_bCs, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::CharBidiRTL( const SfxPoolItem& ) @@ -7288,7 +7089,7 @@ void DocxAttributeOutput::CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasis else pEmphasis = "none"; - m_pSerializer->singleElementNS( XML_w, XML_em, FSNS( XML_w, XML_val ), pEmphasis, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_em, FSNS(XML_w, XML_val), pEmphasis); } void DocxAttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines ) @@ -7322,7 +7123,7 @@ void DocxAttributeOutput::CharScaleWidth( const SvxCharScaleWidthItem& rScaleWid const sal_Int16 nScaleWidth( std::max( 1, std::min( rScaleWidth.GetValue(), 600 ) ) ); m_pSerializer->singleElementNS( XML_w, XML_w, - FSNS( XML_w, XML_val ), OString::number( nScaleWidth ).getStr(), FSEND ); + FSNS( XML_w, XML_val ), OString::number(nScaleWidth) ); } void DocxAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief ) @@ -7330,14 +7131,14 @@ void DocxAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief ) switch ( rRelief.GetValue() ) { case FontRelief::Embossed: - m_pSerializer->singleElementNS( XML_w, XML_emboss, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_emboss); break; case FontRelief::Engraved: - m_pSerializer->singleElementNS( XML_w, XML_imprint, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_imprint); break; default: - m_pSerializer->singleElementNS( XML_w, XML_emboss, FSNS( XML_w, XML_val ), "false", FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_imprint, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_emboss, FSNS(XML_w, XML_val), "false"); + m_pSerializer->singleElementNS(XML_w, XML_imprint, FSNS(XML_w, XML_val), "false"); break; } } @@ -7345,9 +7146,9 @@ void DocxAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief ) void DocxAttributeOutput::CharHidden( const SvxCharHiddenItem& rHidden ) { if ( rHidden.GetValue() ) - m_pSerializer->singleElementNS( XML_w, XML_vanish, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vanish); else - m_pSerializer->singleElementNS( XML_w, XML_vanish, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_vanish, FSNS(XML_w, XML_val), "false"); } void DocxAttributeOutput::CharBorder( @@ -7361,8 +7162,7 @@ void DocxAttributeOutput::CharHighlight( const SvxBrushItem& rHighlight ) const OString sColor = TransHighlightColor( msfilter::util::TransColToIco(rHighlight.GetColor()) ); if ( !sColor.isEmpty() ) { - m_pSerializer->singleElementNS( XML_w, XML_highlight, - FSNS( XML_w, XML_val ), sColor.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_highlight, FSNS(XML_w, XML_val), sColor); } } @@ -7373,14 +7173,14 @@ void DocxAttributeOutput::TextINetFormat( const SwFormatINetFormat& rLink ) OString aStyleId(m_rExport.m_pStyles->GetStyleId(m_rExport.GetId(pCharFormat))); - m_pSerializer->singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_rStyle, FSNS(XML_w, XML_val), aStyleId); } void DocxAttributeOutput::TextCharFormat( const SwFormatCharFormat& rCharFormat ) { OString aStyleId(m_rExport.m_pStyles->GetStyleId(m_rExport.GetId(rCharFormat.GetCharFormat()))); - m_pSerializer->singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_rStyle, FSNS(XML_w, XML_val), aStyleId); } void DocxAttributeOutput::RefField( const SwField& rField, const OUString& rRef ) @@ -7429,7 +7229,7 @@ void DocxAttributeOutput::WritePostitFieldReference() OString idname = OUStringToOString(m_postitFields[m_postitFieldsMaxId].first->GetName(), RTL_TEXTENCODING_UTF8); std::map< OString, sal_Int32 >::iterator it = m_rOpenedAnnotationMarksIds.find( idname ); if ( it == m_rOpenedAnnotationMarksIds.end( ) ) - m_pSerializer->singleElementNS( XML_w, XML_commentReference, FSNS( XML_w, XML_id ), idstr.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_commentReference, FSNS(XML_w, XML_id), idstr); ++m_postitFieldsMaxId; } } @@ -7440,10 +7240,10 @@ void DocxAttributeOutput::WritePostitFields() { OString idstr = OString::number( rPair.second); const SwPostItField* f = rPair.first; - m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, XML_id ), idstr.getStr(), - FSNS( XML_w, XML_author ), OUStringToOString( f->GetPar1(), RTL_TEXTENCODING_UTF8 ).getStr(), - FSNS( XML_w, XML_date ), DateTimeToOString(f->GetDateTime()).getStr(), - FSNS( XML_w, XML_initials ), OUStringToOString( f->GetInitials(), RTL_TEXTENCODING_UTF8 ).getStr(), FSEND ); + m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, XML_id ), idstr, + FSNS( XML_w, XML_author ), f->GetPar1().toUtf8(), + FSNS( XML_w, XML_date ), DateTimeToOString(f->GetDateTime()), + FSNS( XML_w, XML_initials ), f->GetInitials().toUtf8() ); if (f->GetTextObject() != nullptr) { @@ -7454,8 +7254,8 @@ void DocxAttributeOutput::WritePostitFields() { // just plain text - eg. when the field was created via the // .uno:InsertAnnotation API - m_pSerializer->startElementNS(XML_w, XML_p, FSEND); - m_pSerializer->startElementNS(XML_w, XML_r, FSEND); + m_pSerializer->startElementNS(XML_w, XML_p); + m_pSerializer->startElementNS(XML_w, XML_r); RunText(f->GetText()); m_pSerializer->endElementNS(XML_w, XML_r); m_pSerializer->endElementNS(XML_w, XML_p); @@ -7487,17 +7287,17 @@ void DocxAttributeOutput::WritePendingPlaceholder() return; const SwField* pField = pendingPlaceholder; pendingPlaceholder = nullptr; - m_pSerializer->startElementNS( XML_w, XML_sdt, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_sdtPr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_sdt); + m_pSerializer->startElementNS(XML_w, XML_sdtPr); if( !pField->GetPar2().isEmpty()) m_pSerializer->singleElementNS( XML_w, XML_alias, - FSNS( XML_w, XML_val ), OUStringToOString( pField->GetPar2(), RTL_TEXTENCODING_UTF8 ), FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_temporary, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_showingPlcHdr, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_text, FSEND ); + FSNS( XML_w, XML_val ), pField->GetPar2().toUtf8() ); + m_pSerializer->singleElementNS(XML_w, XML_temporary); + m_pSerializer->singleElementNS(XML_w, XML_showingPlcHdr); + m_pSerializer->singleElementNS(XML_w, XML_text); m_pSerializer->endElementNS( XML_w, XML_sdtPr ); - m_pSerializer->startElementNS( XML_w, XML_sdtContent, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_sdtContent); + m_pSerializer->startElementNS(XML_w, XML_r); RunText( pField->GetPar1()); m_pSerializer->endElementNS( XML_w, XML_r ); m_pSerializer->endElementNS( XML_w, XML_sdtContent ); @@ -7645,7 +7445,7 @@ void DocxAttributeOutput::TextFootnote_Impl( const SwFormatFootnote& rFootnote ) OString aStyleId(m_rExport.m_pStyles->GetStyleId(m_rExport.GetId(pCharFormat))); - m_pSerializer->singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_rStyle, FSNS(XML_w, XML_val), aStyleId); // remember the footnote/endnote to // 1) write the footnoteReference/endnoteReference in EndRunProperties() @@ -7676,17 +7476,14 @@ void DocxAttributeOutput::FootnoteEndnoteReference() if ( pFootnote->GetNumStr().isEmpty() ) { // autonumbered - m_pSerializer->singleElementNS( XML_w, nToken, - FSNS( XML_w, XML_id ), OString::number( nId ).getStr(), - FSEND ); + m_pSerializer->singleElementNS(XML_w, nToken, FSNS(XML_w, XML_id), OString::number(nId)); } else { // not autonumbered m_pSerializer->singleElementNS( XML_w, nToken, FSNS( XML_w, XML_customMarkFollows ), "1", - FSNS( XML_w, XML_id ), OString::number( nId ).getStr(), - FSEND ); + FSNS( XML_w, XML_id ), OString::number(nId) ); RunText( pFootnote->GetNumStr() ); } @@ -7706,11 +7503,10 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes ) // separator m_pSerializer->startElementNS( XML_w, nItem, - FSNS( XML_w, XML_id ), OString::number( nIndex++ ).getStr(), - FSNS( XML_w, XML_type ), "separator", - FSEND ); - m_pSerializer->startElementNS( XML_w, XML_p, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + FSNS( XML_w, XML_id ), OString::number(nIndex++), + FSNS( XML_w, XML_type ), "separator" ); + m_pSerializer->startElementNS(XML_w, XML_p); + m_pSerializer->startElementNS(XML_w, XML_r); bool bSeparator = true; if (bFootnotes) @@ -7721,19 +7517,18 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes ) } if (bSeparator) - m_pSerializer->singleElementNS( XML_w, XML_separator, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_separator); m_pSerializer->endElementNS( XML_w, XML_r ); m_pSerializer->endElementNS( XML_w, XML_p ); m_pSerializer->endElementNS( XML_w, nItem ); // separator m_pSerializer->startElementNS( XML_w, nItem, - FSNS( XML_w, XML_id ), OString::number( nIndex++ ).getStr(), - FSNS( XML_w, XML_type ), "continuationSeparator", - FSEND ); - m_pSerializer->startElementNS( XML_w, XML_p, FSEND ); - m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_continuationSeparator, FSEND ); + FSNS( XML_w, XML_id ), OString::number(nIndex++), + FSNS( XML_w, XML_type ), "continuationSeparator" ); + m_pSerializer->startElementNS(XML_w, XML_p); + m_pSerializer->startElementNS(XML_w, XML_r); + m_pSerializer->singleElementNS(XML_w, XML_continuationSeparator); m_pSerializer->endElementNS( XML_w, XML_r ); m_pSerializer->endElementNS( XML_w, XML_p ); m_pSerializer->endElementNS( XML_w, nItem ); @@ -7743,9 +7538,7 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes ) // footnotes/endnotes themselves for ( const auto& rpItem : rVector ) { - m_pSerializer->startElementNS( XML_w, nItem, - FSNS( XML_w, XML_id ), OString::number( nIndex ).getStr(), - FSEND ); + m_pSerializer->startElementNS(XML_w, nItem, FSNS(XML_w, XML_id), OString::number(nIndex)); const SwNodeIndex* pIndex = rpItem->GetTextFootnote()->GetStartNode(); // tag required at the start of each footnote/endnote @@ -7766,7 +7559,7 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes ) void DocxAttributeOutput::WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr const & fs, int tag, const SwEndNoteInfo& info, int listtag ) { - fs->startElementNS( XML_w, tag, FSEND ); + fs->startElementNS(XML_w, tag); const char* fmt = nullptr; switch( info.aFormat.GetNumberingType()) { @@ -7799,10 +7592,10 @@ void DocxAttributeOutput::WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr break; // no format } if( fmt != nullptr ) - fs->singleElementNS( XML_w, XML_numFmt, FSNS( XML_w, XML_val ), fmt, FSEND ); + fs->singleElementNS(XML_w, XML_numFmt, FSNS(XML_w, XML_val), fmt); if( info.nFootnoteOffset != 0 ) fs->singleElementNS( XML_w, XML_numStart, FSNS( XML_w, XML_val ), - OString::number( info.nFootnoteOffset + 1).getStr(), FSEND ); + OString::number(info.nFootnoteOffset + 1) ); const SwFootnoteInfo* pFootnoteInfo = dynamic_cast(&info); if( pFootnoteInfo ) @@ -7814,13 +7607,13 @@ void DocxAttributeOutput::WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr default: fmt = nullptr; break; } if( fmt != nullptr ) - fs->singleElementNS( XML_w, XML_numRestart, FSNS( XML_w, XML_val ), fmt, FSEND ); + fs->singleElementNS(XML_w, XML_numRestart, FSNS(XML_w, XML_val), fmt); } if( listtag != 0 ) // we are writing to settings.xml, write also special footnote/endnote list { // there are currently only two hardcoded ones ( see FootnotesEndnotes()) - fs->singleElementNS( XML_w, listtag, FSNS( XML_w, XML_id ), "0", FSEND ); - fs->singleElementNS( XML_w, listtag, FSNS( XML_w, XML_id ), "1", FSEND ); + fs->singleElementNS(XML_w, listtag, FSNS(XML_w, XML_id), "0"); + fs->singleElementNS(XML_w, listtag, FSNS(XML_w, XML_id), "1"); } fs->endElementNS( XML_w, tag ); } @@ -7915,23 +7708,23 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) default: return; // not supported attribute } - m_pSerializer->singleElementNS( XML_w, XML_jc, FSNS( XML_w, XML_val ), pAdjustString, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_jc, FSNS(XML_w, XML_val), pAdjustString); } void DocxAttributeOutput::ParaSplit( const SvxFormatSplitItem& rSplit ) { if (rSplit.GetValue()) - m_pSerializer->singleElementNS( XML_w, XML_keepLines, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_keepLines, FSNS(XML_w, XML_val), "false"); else - m_pSerializer->singleElementNS( XML_w, XML_keepLines, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_keepLines); } void DocxAttributeOutput::ParaWidows( const SvxWidowsItem& rWidows ) { if (rWidows.GetValue()) - m_pSerializer->singleElementNS( XML_w, XML_widowControl, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_widowControl); else - m_pSerializer->singleElementNS( XML_w, XML_widowControl, FSNS( XML_w, XML_val ), "false", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_widowControl, FSNS(XML_w, XML_val), "false"); } static void impl_WriteTabElement( FSHelperPtr const & pSerializer, @@ -7976,7 +7769,7 @@ static void impl_WriteTabElement( FSHelperPtr const & pSerializer, else pTabElementAttrList->add( FSNS( XML_w, XML_leader ), OString( "none" ) ); - pSerializer->singleElementNS( XML_w, XML_tab, pTabElementAttrList ); + pSerializer->singleElementNS(XML_w, XML_tab, pTabElementAttrList); } void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) @@ -7998,7 +7791,7 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) return; } - m_pSerializer->startElementNS( XML_w, XML_tabs, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_tabs); // Get offset for tabs // In DOCX, w:pos specifies the position of the current custom tab stop with respect to the current page margins. @@ -8018,8 +7811,7 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) { m_pSerializer->singleElementNS( XML_w, XML_tab, FSNS( XML_w, XML_val ), "clear", - FSNS( XML_w, XML_pos ), OString::number(pInheritedTabs->At(i).GetTabPos()), - FSEND ); + FSNS( XML_w, XML_pos ), OString::number(pInheritedTabs->At(i).GetTabPos()) ); } } @@ -8037,8 +7829,7 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) void DocxAttributeOutput::ParaHyphenZone( const SvxHyphenZoneItem& rHyphenZone ) { m_pSerializer->singleElementNS( XML_w, XML_suppressAutoHyphens, - FSNS( XML_w, XML_val ), OString::boolean( !rHyphenZone.IsHyphen() ), - FSEND ); + FSNS( XML_w, XML_val ), OString::boolean( !rHyphenZone.IsHyphen() ) ); } void DocxAttributeOutput::ParaNumRule_Impl( const SwTextNode* pTextNd, sal_Int32 nLvl, sal_Int32 nNumId ) @@ -8052,9 +7843,11 @@ void DocxAttributeOutput::ParaNumRule_Impl( const SwTextNode* pTextNd, sal_Int32 // Do not export outline rules (Chapter Numbering) as paragraph properties, only as style properties. if ( !pTextNd || !bOutlineRule ) { - m_pSerializer->startElementNS( XML_w, XML_numPr, FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_ilvl, FSNS( XML_w, XML_val ), OString::number( nLvl).getStr(), FSEND ); - m_pSerializer->singleElementNS( XML_w, XML_numId, FSNS( XML_w, XML_val ), OString::number( nNumId).getStr(), FSEND ); + m_pSerializer->startElementNS(XML_w, XML_numPr); + m_pSerializer->singleElementNS(XML_w, XML_ilvl, + FSNS(XML_w, XML_val), OString::number(nLvl)); + m_pSerializer->singleElementNS(XML_w, XML_numId, + FSNS(XML_w, XML_val), OString::number(nNumId)); m_pSerializer->endElementNS( XML_w, XML_numPr ); } } @@ -8063,22 +7856,19 @@ void DocxAttributeOutput::ParaNumRule_Impl( const SwTextNode* pTextNd, sal_Int32 void DocxAttributeOutput::ParaScriptSpace( const SfxBoolItem& rScriptSpace ) { m_pSerializer->singleElementNS( XML_w, XML_autoSpaceDE, - FSNS( XML_w, XML_val ), OString::boolean( rScriptSpace.GetValue() ), - FSEND ); + FSNS( XML_w, XML_val ), OString::boolean( rScriptSpace.GetValue() ) ); } void DocxAttributeOutput::ParaHangingPunctuation( const SfxBoolItem& rItem ) { m_pSerializer->singleElementNS( XML_w, XML_overflowPunct, - FSNS( XML_w, XML_val ), OString::boolean( rItem.GetValue() ), - FSEND ); + FSNS( XML_w, XML_val ), OString::boolean( rItem.GetValue() ) ); } void DocxAttributeOutput::ParaForbiddenRules( const SfxBoolItem& rItem ) { m_pSerializer->singleElementNS( XML_w, XML_kinsoku, - FSNS( XML_w, XML_val ), OString::boolean( rItem.GetValue() ), - FSEND ); + FSNS( XML_w, XML_val ), OString::boolean( rItem.GetValue() ) ); } void DocxAttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign ) @@ -8105,14 +7895,13 @@ void DocxAttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign default: return; // not supported attribute } - m_pSerializer->singleElementNS( XML_w, XML_textAlignment, FSNS( XML_w, XML_val ), pAlignString, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_textAlignment, FSNS(XML_w, XML_val), pAlignString); } void DocxAttributeOutput::ParaSnapToGrid( const SvxParaGridItem& rGrid ) { m_pSerializer->singleElementNS( XML_w, XML_snapToGrid, - FSNS( XML_w, XML_val ), OString::boolean( rGrid.GetValue() ), - FSEND ); + FSNS( XML_w, XML_val ), OString::boolean( rGrid.GetValue() ) ); } void DocxAttributeOutput::FormatFrameSize( const SwFormatFrameSize& rSize ) @@ -8311,7 +8100,7 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) m_bParaAfterAutoSpacing = false; if (rULSpace.GetContext()) - m_pSerializer->singleElementNS( XML_w, XML_contextualSpacing, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_contextualSpacing); } } @@ -8489,14 +8278,11 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) } if (!bImageBackground) { - m_pSerializer->startElementNS(XML_a, XML_solidFill, FSEND); - m_pSerializer->startElementNS(XML_a, XML_srgbClr, - XML_val, sColor, - FSEND); + m_pSerializer->startElementNS(XML_a, XML_solidFill); + m_pSerializer->startElementNS(XML_a, XML_srgbClr, XML_val, sColor); if (oAlpha) m_pSerializer->singleElementNS(XML_a, XML_alpha, - XML_val, OString::number(*oAlpha), - FSEND); + XML_val, OString::number(*oAlpha)); m_pSerializer->endElementNS(XML_a, XML_srgbClr); m_pSerializer->endElementNS(XML_a, XML_solidFill); } @@ -8731,7 +8517,7 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox ) // Not inside a section // Open the paragraph's borders tag - m_pSerializer->startElementNS( XML_w, XML_pBdr, FSEND ); + m_pSerializer->startElementNS(XML_w, XML_pBdr); std::map aStyleBorders; const SvxBoxItem* pInherited = nullptr; @@ -8810,8 +8596,7 @@ void DocxAttributeOutput::FormatColumns_Impl( sal_uInt16 nCols, const SwFormatCo void DocxAttributeOutput::FormatKeep( const SvxFormatKeepItem& rItem ) { m_pSerializer->singleElementNS( XML_w, XML_keepNext, - FSNS( XML_w, XML_val ), OString::boolean( rItem.GetValue() ), - FSEND ); + FSNS( XML_w, XML_val ), OString::boolean( rItem.GetValue() ) ); } void DocxAttributeOutput::FormatTextGrid( const SwTextGridItem& rGrid ) @@ -8850,7 +8635,7 @@ void DocxAttributeOutput::FormatTextGrid( const SwTextGridItem& rGrid ) void DocxAttributeOutput::FormatLineNumbering( const SwFormatLineNumber& rNumbering ) { if ( !rNumbering.IsCount( ) ) - m_pSerializer->singleElementNS( XML_w, XML_suppressLineNumbers, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_suppressLineNumbers); } void DocxAttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDirection ) @@ -8880,18 +8665,16 @@ void DocxAttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDi if ( m_rExport.m_bOutPageDescs ) { - m_pSerializer->singleElementNS( XML_w, XML_textDirection, - FSNS( XML_w, XML_val ), sTextFlow.getStr( ), - FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_textDirection, FSNS(XML_w, XML_val), sTextFlow); if ( bBiDi ) - m_pSerializer->singleElementNS( XML_w, XML_bidi, FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_bidi); } else if ( !m_rExport.m_bOutFlyFrameAttrs ) { if ( bBiDi ) - m_pSerializer->singleElementNS( XML_w, XML_bidi, FSNS( XML_w, XML_val ), "1", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_bidi, FSNS(XML_w, XML_val), "1"); else - m_pSerializer->singleElementNS( XML_w, XML_bidi, FSNS( XML_w, XML_val ), "0", FSEND ); + m_pSerializer->singleElementNS(XML_w, XML_bidi, FSNS(XML_w, XML_val), "0"); } } @@ -8901,7 +8684,7 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem) for ( const auto & rGrabBagElement : rMap ) { if (rGrabBagElement.first == "MirrorIndents") - m_pSerializer->singleElementNS(XML_w, XML_mirrorIndents, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_mirrorIndents); else if (rGrabBagElement.first == "ParaTopMarginBeforeAutoSpacing") { m_bParaBeforeAutoSpacing = true; @@ -9372,24 +9155,21 @@ bool DocxAttributeOutput::HasPostitFields() const void DocxAttributeOutput::BulletDefinition(int nId, const Graphic& rGraphic, Size aSize) { m_pSerializer->startElementNS(XML_w, XML_numPicBullet, - FSNS(XML_w, XML_numPicBulletId), OString::number(nId).getStr(), - FSEND); + FSNS(XML_w, XML_numPicBulletId), OString::number(nId)); OStringBuffer aStyle; // Size is in twips, we need it in points. aStyle.append("width:").append(double(aSize.Width()) / 20); aStyle.append("pt;height:").append(double(aSize.Height()) / 20).append("pt"); - m_pSerializer->startElementNS( XML_w, XML_pict, FSEND); + m_pSerializer->startElementNS(XML_w, XML_pict); m_pSerializer->startElementNS( XML_v, XML_shape, XML_style, aStyle.getStr(), - FSNS(XML_o, XML_bullet), "t", - FSEND); + FSNS(XML_o, XML_bullet), "t"); OUString aRelId = m_rDrawingML.WriteImage(rGraphic); m_pSerializer->singleElementNS( XML_v, XML_imagedata, FSNS(XML_r, XML_id), OUStringToOString(aRelId, RTL_TEXTENCODING_UTF8), - FSNS(XML_o, XML_title), "", - FSEND); + FSNS(XML_o, XML_title), ""); m_pSerializer->endElementNS(XML_v, XML_shape); m_pSerializer->endElementNS(XML_w, XML_pict); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 33eb71468d52..7d4d4df1fb3d 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -236,9 +236,7 @@ bool DocxExport::DisallowInheritingOutlineNumbering( const SwFormat& rFormat ) { ::sax_fastparser::FSHelperPtr pSerializer = m_pAttrOutput->GetSerializer( ); // Level 9 disables the outline - pSerializer->singleElementNS( XML_w, XML_outlineLvl, - FSNS( XML_w, XML_val ), "9" , - FSEND ); + pSerializer->singleElementNS(XML_w, XML_outlineLvl, FSNS(XML_w, XML_val), "9"); bRet = true; } @@ -334,25 +332,20 @@ void DocxExport::DoComboBox(const OUString& rName, const OUString& rSelected, uno::Sequence& rListItems) { - m_pDocumentFS->startElementNS( XML_w, XML_ffData, FSEND ); + m_pDocumentFS->startElementNS(XML_w, XML_ffData); - m_pDocumentFS->singleElementNS( XML_w, XML_name, - FSNS( XML_w, XML_val ), OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + m_pDocumentFS->singleElementNS(XML_w, XML_name, FSNS(XML_w, XML_val), rName.toUtf8()); - m_pDocumentFS->singleElementNS( XML_w, XML_enabled, FSEND ); + m_pDocumentFS->singleElementNS(XML_w, XML_enabled); if ( !rHelp.isEmpty() ) - m_pDocumentFS->singleElementNS( XML_w, XML_helpText, - FSNS( XML_w, XML_val ), OUStringToOString( rHelp, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + m_pDocumentFS->singleElementNS(XML_w, XML_helpText, FSNS(XML_w, XML_val), rHelp.toUtf8()); if ( !rToolTip.isEmpty() ) m_pDocumentFS->singleElementNS( XML_w, XML_statusText, - FSNS( XML_w, XML_val ), OUStringToOString( rToolTip, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS( XML_w, XML_val ), rToolTip.toUtf8() ); - m_pDocumentFS->startElementNS( XML_w, XML_ddList, FSEND ); + m_pDocumentFS->startElementNS(XML_w, XML_ddList); // Output the 0-based index of the selected value sal_uInt32 nListItems = rListItems.getLength(); @@ -365,17 +358,14 @@ void DocxExport::DoComboBox(const OUString& rName, nI++; } - m_pDocumentFS->singleElementNS( XML_w, XML_result, - FSNS( XML_w, XML_val ), OString::number( nId ).getStr( ), - FSEND ); + m_pDocumentFS->singleElementNS(XML_w, XML_result, FSNS(XML_w, XML_val), OString::number(nId)); // Loop over the entries for (sal_uInt32 i = 0; i < nListItems; i++) { m_pDocumentFS->singleElementNS( XML_w, XML_listEntry, - FSNS( XML_w, XML_val ), OUStringToOString( rListItems[i], RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS( XML_w, XML_val ), rListItems[i].toUtf8() ); } m_pDocumentFS->endElementNS( XML_w, XML_ddList ); @@ -486,11 +476,11 @@ std::pair DocxExport::WriteActiveXObject(const uno::Reference< sBinaryFileName.copy(sBinaryFileName.lastIndexOf("/") + 1) ); pActiveXFS->singleElementNS(XML_ax, XML_ocx, - FSNS(XML_xmlns, XML_ax), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(ax)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS(XML_xmlns, XML_r), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS(XML_ax, XML_classid), OString("{" + sGUID + "}").getStr(), + FSNS(XML_xmlns, XML_ax), m_pFilter->getNamespaceURL(OOX_NS(ax)).toUtf8(), + FSNS(XML_xmlns, XML_r), m_pFilter->getNamespaceURL(OOX_NS(officeRel)).toUtf8(), + FSNS(XML_ax, XML_classid), "{" + sGUID + "}", FSNS(XML_ax, XML_persistence), "persistStorage", - FSNS(XML_r, XML_id), OUStringToOString(sBinaryId, RTL_TEXTENCODING_UTF8).getStr(), FSEND); + FSNS(XML_r, XML_id), sBinaryId.toUtf8()); OString sXMLId = OUStringToOString(m_pFilter->addRelation(m_pDocumentFS->getOutputStream(), oox::getRelationship(Relationship::CONTROL), @@ -766,11 +756,10 @@ void DocxExport::WriteNumbering() m_pDrawingML->SetFS( pNumberingFS ); pNumberingFS->startElementNS( XML_w, XML_numbering, - FSNS( XML_xmlns, XML_w ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(doc)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_o ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(vmlOffice)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_r ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_v ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(vml)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + FSNS( XML_xmlns, XML_w ), m_pFilter->getNamespaceURL(OOX_NS(doc)).toUtf8(), + FSNS( XML_xmlns, XML_o ), m_pFilter->getNamespaceURL(OOX_NS(vmlOffice)).toUtf8(), + FSNS( XML_xmlns, XML_r ), m_pFilter->getNamespaceURL(OOX_NS(officeRel)).toUtf8(), + FSNS( XML_xmlns, XML_v ), m_pFilter->getNamespaceURL(OOX_NS(vml)).toUtf8() ); BulletDefinitions(); @@ -858,8 +847,7 @@ void DocxExport::WriteHeaderFooter( const SwFormat* pFormat, bool bHeader, const // and write the reference m_pDocumentFS->singleElementNS( XML_w, nReference, FSNS( XML_w, XML_type ), pType, - FSNS( XML_r, XML_id ), aRelId.toUtf8().getStr(), - FSEND ); + FSNS( XML_r, XML_id ), aRelId.toUtf8() ); } void DocxExport::WriteFonts() @@ -873,9 +861,8 @@ void DocxExport::WriteFonts() "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml" ); pFS->startElementNS( XML_w, XML_fonts, - FSNS( XML_xmlns, XML_w ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(doc)), RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_xmlns, XML_r ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + FSNS( XML_xmlns, XML_w ), m_pFilter->getNamespaceURL(OOX_NS(doc)).toUtf8(), + FSNS( XML_xmlns, XML_r ), m_pFilter->getNamespaceURL(OOX_NS(officeRel)).toUtf8() ); // switch the serializer to redirect the output to word/styles.xml m_pAttrOutput->SetSerializer( pFS ); @@ -921,13 +908,12 @@ void DocxExport::WriteSettings() "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml" ); pFS->startElementNS( XML_w, XML_settings, - FSNS( XML_xmlns, XML_w ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(doc)), RTL_TEXTENCODING_UTF8).getStr(), - FSEND ); + FSNS( XML_xmlns, XML_w ), m_pFilter->getNamespaceURL(OOX_NS(doc)).toUtf8() ); // View if (pViewShell && pViewShell->GetViewOptions()->getBrowseMode()) { - pFS->singleElementNS(XML_w, XML_view, FSNS(XML_w, XML_val), "web", FSEND); + pFS->singleElementNS(XML_w, XML_view, FSNS(XML_w, XML_val), "web"); } // Zoom @@ -961,35 +947,35 @@ void DocxExport::WriteSettings() if (boost::optional oBrush = getBackground()) { // Turn on the 'displayBackgroundShape' - pFS->singleElementNS( XML_w, XML_displayBackgroundShape, FSEND ); + pFS->singleElementNS(XML_w, XML_displayBackgroundShape); } // Track Changes if ( m_aSettings.trackRevisions ) - pFS->singleElementNS( XML_w, XML_trackRevisions, FSEND ); + pFS->singleElementNS(XML_w, XML_trackRevisions); // Mirror Margins if(isMirroredMargin()) - pFS->singleElementNS( XML_w, XML_mirrorMargins, FSEND ); + pFS->singleElementNS(XML_w, XML_mirrorMargins); // Embed Fonts if( m_pDoc->getIDocumentSettingAccess().get( DocumentSettingId::EMBED_FONTS )) - pFS->singleElementNS( XML_w, XML_embedTrueTypeFonts, FSEND ); + pFS->singleElementNS(XML_w, XML_embedTrueTypeFonts); // Embed System Fonts if( m_pDoc->getIDocumentSettingAccess().get( DocumentSettingId::EMBED_SYSTEM_FONTS )) - pFS->singleElementNS( XML_w, XML_embedSystemFonts, FSEND ); + pFS->singleElementNS(XML_w, XML_embedSystemFonts); // Default Tab Stop if( m_aSettings.defaultTabStop != 0 ) pFS->singleElementNS( XML_w, XML_defaultTabStop, FSNS( XML_w, XML_val ), - OString::number( m_aSettings.defaultTabStop).getStr(), FSEND ); + OString::number(m_aSettings.defaultTabStop) ); // Do not justify lines with manual break if( m_pDoc->getIDocumentSettingAccess().get( DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK )) { - pFS->startElementNS( XML_w, XML_compat, FSEND ); - pFS->singleElementNS( XML_w, XML_doNotExpandShiftReturn, FSEND ); + pFS->startElementNS(XML_w, XML_compat); + pFS->singleElementNS(XML_w, XML_doNotExpandShiftReturn); pFS->endElementNS( XML_w, XML_compat ); } @@ -1000,13 +986,12 @@ void DocxExport::WriteSettings() if (pColl && SfxItemState::SET == pColl->GetItemState(RES_PARATR_HYPHENZONE, false, &pItem)) { pFS->singleElementNS(XML_w, XML_autoHyphenation, - FSNS(XML_w, XML_val), OString::boolean(static_cast(pItem)->IsHyphen()), - FSEND); + FSNS(XML_w, XML_val), OString::boolean(static_cast(pItem)->IsHyphen())); } // Even and Odd Headers if( m_aSettings.evenAndOddHeaders ) - pFS->singleElementNS( XML_w, XML_evenAndOddHeaders, FSEND ); + pFS->singleElementNS(XML_w, XML_evenAndOddHeaders); // Has Footnotes if( m_pAttrOutput->HasFootnotes()) @@ -1044,14 +1029,13 @@ void DocxExport::WriteSettings() themeFontLangProps[j].Value >>= aValues[2]; } pFS->singleElementNS( XML_w, XML_themeFontLang, - FSNS( XML_w, XML_val ), OUStringToOString( aValues[0], RTL_TEXTENCODING_UTF8 ).getStr(), - FSNS( XML_w, XML_eastAsia ), OUStringToOString( aValues[1], RTL_TEXTENCODING_UTF8 ).getStr(), - FSNS( XML_w, XML_bidi ), OUStringToOString( aValues[2], RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + FSNS( XML_w, XML_val ), aValues[0].toUtf8(), + FSNS( XML_w, XML_eastAsia ), aValues[1].toUtf8(), + FSNS( XML_w, XML_bidi ), aValues[2].toUtf8() ); } else if ( propList[i].Name == "CompatSettings" ) { - pFS->startElementNS( XML_w, XML_compat, FSEND ); + pFS->startElementNS(XML_w, XML_compat); uno::Sequence< beans::PropertyValue > aCompatSettingsSequence; propList[i].Value >>= aCompatSettingsSequence; @@ -1074,10 +1058,9 @@ void DocxExport::WriteSettings() aCompatSetting[k].Value >>= aValue; } pFS->singleElementNS( XML_w, XML_compatSetting, - FSNS( XML_w, XML_name ), OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_w, XML_uri ), OUStringToOString(aUri, RTL_TEXTENCODING_UTF8).getStr(), - FSNS( XML_w, XML_val ), OUStringToOString(aValue, RTL_TEXTENCODING_UTF8).getStr(), - FSEND); + FSNS( XML_w, XML_name ), aName.toUtf8(), + FSNS( XML_w, XML_uri ), aUri.toUtf8(), + FSNS( XML_w, XML_val ), aValue.toUtf8()); } pFS->endElementNS( XML_w, XML_compat ); @@ -1134,8 +1117,7 @@ void DocxExport::WriteSettings() pFS->singleElementNS(XML_w, XML_documentProtection, FSNS(XML_w, XML_edit), "forms", - FSNS(XML_w, XML_enforcement), "true", - FSEND); + FSNS(XML_w, XML_enforcement), "true"); } } @@ -1479,11 +1461,12 @@ void DocxExport::WriteMainText() Color backgroundColor = oBrush->GetColor(); OString aBackgroundColorStr = msfilter::util::ConvertColor(backgroundColor); - m_pDocumentFS->singleElementNS( XML_w, XML_background, FSNS( XML_w, XML_color ), aBackgroundColorStr, FSEND ); + m_pDocumentFS->singleElementNS(XML_w, XML_background, FSNS(XML_w, XML_color), + aBackgroundColorStr); } // body - m_pDocumentFS->startElementNS( XML_w, XML_body, FSEND ); + m_pDocumentFS->startElementNS(XML_w, XML_body); m_pCurPam->GetPoint()->nNode = m_pDoc->GetNodes().GetEndOfContent().StartOfSectionNode()->GetIndex(); diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index e8024024dd9a..f04d6e268de7 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -378,7 +378,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons { m_pImpl->setDrawingOpen(true); m_pImpl->setParagraphHasDrawing(true); - m_pImpl->getSerializer()->startElementNS(XML_w, XML_drawing, FSEND); + m_pImpl->getSerializer()->startElementNS(XML_w, XML_drawing); const SvxLRSpaceItem aLRSpaceItem = pFrameFormat->GetLRSpace(false); const SvxULSpaceItem aULSpaceItem = pFrameFormat->GetULSpace(false); @@ -499,8 +499,8 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons } sax_fastparser::XFastAttributeListRef xAttrList(attrList); m_pImpl->getSerializer()->startElementNS(XML_wp, XML_anchor, xAttrList); - m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_simplePos, XML_x, "0", XML_y, "0", - FSEND); // required, unused + m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_simplePos, XML_x, "0", XML_y, + "0"); // required, unused const char* relativeFromH; const char* relativeFromV; const char* alignH = nullptr; @@ -592,7 +592,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons break; } m_pImpl->getSerializer()->startElementNS(XML_wp, XML_positionH, XML_relativeFrom, - relativeFromH, FSEND); + relativeFromH); /** * Sizes of integral types * climits header defines constants with the limits of integral types for the specific system and compiler implementation used. @@ -602,13 +602,13 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons const sal_Int64 MIN_INTEGER_VALUE = SAL_MIN_INT32; if (alignH != nullptr) { - m_pImpl->getSerializer()->startElementNS(XML_wp, XML_align, FSEND); + m_pImpl->getSerializer()->startElementNS(XML_wp, XML_align); m_pImpl->getSerializer()->write(alignH); m_pImpl->getSerializer()->endElementNS(XML_wp, XML_align); } else { - m_pImpl->getSerializer()->startElementNS(XML_wp, XML_posOffset, FSEND); + m_pImpl->getSerializer()->startElementNS(XML_wp, XML_posOffset); sal_Int64 nPosXEMU = TwipsToEMU(aPos.X); /* Absolute Position Offset Value is of type Int. Hence it should not be greater than @@ -635,7 +635,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons } m_pImpl->getSerializer()->endElementNS(XML_wp, XML_positionH); m_pImpl->getSerializer()->startElementNS(XML_wp, XML_positionV, XML_relativeFrom, - relativeFromV, FSEND); + relativeFromV); sal_Int64 nPosYEMU = TwipsToEMU(aPos.Y); @@ -653,13 +653,13 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons if (alignV != nullptr) { - m_pImpl->getSerializer()->startElementNS(XML_wp, XML_align, FSEND); + m_pImpl->getSerializer()->startElementNS(XML_wp, XML_align); m_pImpl->getSerializer()->write(alignV); m_pImpl->getSerializer()->endElementNS(XML_wp, XML_align); } else { - m_pImpl->getSerializer()->startElementNS(XML_wp, XML_posOffset, FSEND); + m_pImpl->getSerializer()->startElementNS(XML_wp, XML_posOffset); if (nPosYEMU > MAX_INTEGER_VALUE) { nPosYEMU = MAX_INTEGER_VALUE; @@ -716,13 +716,12 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons sal_uInt64 cy = TwipsToEMU(std::clamp(rSize.Height(), 0L, long(SAL_MAX_INT32))); OString aHeight(OString::number(std::min(cy, sal_uInt64(SAL_MAX_INT32)))); - m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_extent, XML_cx, aWidth, XML_cy, aHeight, - FSEND); + m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_extent, XML_cx, aWidth, XML_cy, aHeight); // effectExtent, extent including the effect (shadow only for now) m_pImpl->getSerializer()->singleElementNS( XML_wp, XML_effectExtent, XML_l, OString::number(nLeftExt), XML_t, OString::number(nTopExt), - XML_r, OString::number(nRightExt), XML_b, OString::number(nBottomExt), FSEND); + XML_r, OString::number(nRightExt), XML_b, OString::number(nBottomExt)); // See if we know the exact wrap type from grab-bag. sal_Int32 nWrapToken = 0; @@ -743,14 +742,12 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons SAL_WARN("sw.ww8", "DocxSdrExport::startDMLAnchorInline: unexpected EG_WrapType value"); - m_pImpl->getSerializer()->startElementNS(XML_wp, nWrapToken, XML_wrapText, "bothSides", - FSEND); + m_pImpl->getSerializer()->startElementNS(XML_wp, nWrapToken, XML_wrapText, "bothSides"); it = aGrabBag.find("CT_WrapPath"); if (it != aGrabBag.end()) { - m_pImpl->getSerializer()->startElementNS(XML_wp, XML_wrapPolygon, XML_edited, "0", - FSEND); + m_pImpl->getSerializer()->startElementNS(XML_wp, XML_wrapPolygon, XML_edited, "0"); auto aSeqSeq = it->second.get(); auto aPoints(comphelper::sequenceToContainer>(aSeqSeq[0])); for (auto i = aPoints.begin(); i != aPoints.end(); ++i) @@ -758,7 +755,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons awt::Point& rPoint = *i; m_pImpl->getSerializer()->singleElementNS( XML_wp, (i == aPoints.begin() ? XML_start : XML_lineTo), XML_x, - OString::number(rPoint.X), XML_y, OString::number(rPoint.Y), FSEND); + OString::number(rPoint.X), XML_y, OString::number(rPoint.Y)); } m_pImpl->getSerializer()->endElementNS(XML_wp, XML_wrapPolygon); } @@ -777,15 +774,14 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons { nWrapToken = XML_wrapTight; m_pImpl->getSerializer()->startElementNS(XML_wp, nWrapToken, XML_wrapText, - "bothSides", FSEND); + "bothSides"); - m_pImpl->getSerializer()->startElementNS(XML_wp, XML_wrapPolygon, XML_edited, "0", - FSEND); + m_pImpl->getSerializer()->startElementNS(XML_wp, XML_wrapPolygon, XML_edited, "0"); tools::Polygon aPoly = sw::util::CorrectWordWrapPolygonForExport(*pPolyPoly, pNd); for (sal_uInt16 i = 0; i < aPoly.GetSize(); ++i) m_pImpl->getSerializer()->singleElementNS( XML_wp, (i == 0 ? XML_start : XML_lineTo), XML_x, - OString::number(aPoly[i].X()), XML_y, OString::number(aPoly[i].Y()), FSEND); + OString::number(aPoly[i].X()), XML_y, OString::number(aPoly[i].Y())); m_pImpl->getSerializer()->endElementNS(XML_wp, XML_wrapPolygon); m_pImpl->getSerializer()->endElementNS(XML_wp, nWrapToken); @@ -799,19 +795,19 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons switch (pFrameFormat->GetSurround().GetValue()) { case css::text::WrapTextMode_NONE: - m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_wrapTopAndBottom, FSEND); + m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_wrapTopAndBottom); break; case css::text::WrapTextMode_THROUGH: - m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_wrapNone, FSEND); + m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_wrapNone); break; case css::text::WrapTextMode_PARALLEL: m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_wrapSquare, XML_wrapText, - "bothSides", FSEND); + "bothSides"); break; case css::text::WrapTextMode_DYNAMIC: default: m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_wrapSquare, XML_wrapText, - "largest", FSEND); + "largest"); break; } } @@ -836,7 +832,7 @@ void DocxSdrExport::endDMLAnchorInline(const SwFrameFormat* pFrameFormat) void DocxSdrExport::writeVMLDrawing(const SdrObject* sdrObj, const SwFrameFormat& rFrameFormat) { - m_pImpl->getSerializer()->startElementNS(XML_w, XML_pict, FSEND); + m_pImpl->getSerializer()->startElementNS(XML_w, XML_pict); m_pImpl->getDrawingML()->SetFS(m_pImpl->getSerializer()); // See WinwordAnchoring::SetAnchoring(), these are not part of the SdrObject, have to be passed around manually. @@ -906,22 +902,15 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrameFo pNamespace = "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"; else if (xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape")) pNamespace = "http://schemas.openxmlformats.org/drawingml/2006/picture"; - pFS->startElementNS( - XML_a, XML_graphic, FSNS(XML_xmlns, XML_a), - OUStringToOString(m_pImpl->getExport().GetFilter().getNamespaceURL(OOX_NS(dml)), - RTL_TEXTENCODING_UTF8) - .getStr(), - FSEND); - pFS->startElementNS(XML_a, XML_graphicData, XML_uri, pNamespace, FSEND); + pFS->startElementNS(XML_a, XML_graphic, FSNS(XML_xmlns, XML_a), + m_pImpl->getExport().GetFilter().getNamespaceURL(OOX_NS(dml)).toUtf8()); + pFS->startElementNS(XML_a, XML_graphicData, XML_uri, pNamespace); bool bLockedCanvas = lcl_isLockedCanvas(xShape); if (bLockedCanvas) - pFS->startElementNS(XML_lc, XML_lockedCanvas, FSNS(XML_xmlns, XML_lc), - OUStringToOString(m_pImpl->getExport().GetFilter().getNamespaceURL( - OOX_NS(dmlLockedCanvas)), - RTL_TEXTENCODING_UTF8) - .getStr(), - FSEND); + pFS->startElementNS( + XML_lc, XML_lockedCanvas, FSNS(XML_xmlns, XML_lc), + m_pImpl->getExport().GetFilter().getNamespaceURL(OOX_NS(dmlLockedCanvas)).toUtf8()); m_pImpl->getExport().OutputDML(xShape); @@ -937,9 +926,8 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrameFo pFS->startElementNS(XML_wp14, XML_sizeRelH, XML_relativeFrom, (pSdrObject->GetRelativeWidthRelation() == text::RelOrientation::FRAME ? "margin" - : "page"), - FSEND); - pFS->startElementNS(XML_wp14, XML_pctWidth, FSEND); + : "page")); + pFS->startElementNS(XML_wp14, XML_pctWidth); pFS->writeEscaped( OUString::number(*pSdrObject->GetRelativeWidth() * 100 * oox::drawingml::PER_PERCENT)); pFS->endElementNS(XML_wp14, XML_pctWidth); @@ -950,9 +938,8 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrameFo pFS->startElementNS(XML_wp14, XML_sizeRelV, XML_relativeFrom, (pSdrObject->GetRelativeHeightRelation() == text::RelOrientation::FRAME ? "margin" - : "page"), - FSEND); - pFS->startElementNS(XML_wp14, XML_pctHeight, FSEND); + : "page")); + pFS->startElementNS(XML_wp14, XML_pctHeight); pFS->writeEscaped( OUString::number(*pSdrObject->GetRelativeHeight() * 100 * oox::drawingml::PER_PERCENT)); pFS->endElementNS(XML_wp14, XML_pctHeight); @@ -993,7 +980,7 @@ void DocxSdrExport::Impl::textFrameShadow(const SwFrameFormat& rFrameFormat) OString aShadowColor = msfilter::util::ConvertColor(aShadowItem.GetColor()); m_pSerializer->singleElementNS(XML_v, XML_shadow, XML_on, "t", XML_color, "#" + aShadowColor, - XML_offset, aOffset, FSEND); + XML_offset, aOffset); } bool DocxSdrExport::Impl::isSupportedDMLShape(const uno::Reference& xShape) @@ -1040,15 +1027,15 @@ void DocxSdrExport::writeDMLAndVMLDrawing(const SdrObject* sdrObj, if ((msfilter::util::HasTextBoxContent(eShapeType)) && Impl::isSupportedDMLShape(xShape) && !bDMLAndVMLDrawingOpen) { - m_pImpl->getSerializer()->startElementNS(XML_mc, XML_AlternateContent, FSEND); + m_pImpl->getSerializer()->startElementNS(XML_mc, XML_AlternateContent); auto pObjGroup = dynamic_cast(sdrObj); m_pImpl->getSerializer()->startElementNS(XML_mc, XML_Choice, XML_Requires, - (pObjGroup ? "wpg" : "wps"), FSEND); + (pObjGroup ? "wpg" : "wps")); writeDMLDrawing(sdrObj, &rFrameFormat, nAnchorId); m_pImpl->getSerializer()->endElementNS(XML_mc, XML_Choice); - m_pImpl->getSerializer()->startElementNS(XML_mc, XML_Fallback, FSEND); + m_pImpl->getSerializer()->startElementNS(XML_mc, XML_Fallback); writeVMLDrawing(sdrObj, rFrameFormat); m_pImpl->getSerializer()->endElementNS(XML_mc, XML_Fallback); @@ -1107,18 +1094,15 @@ void DocxSdrExport::writeDMLEffectLst(const SwFrameFormat& rFrameFormat) } OString aShadowDir(OString::number(nShadowDir)); - m_pImpl->getSerializer()->startElementNS(XML_a, XML_effectLst, FSEND); - m_pImpl->getSerializer()->startElementNS(XML_a, XML_outerShdw, XML_dist, aShadowDist.getStr(), - XML_dir, aShadowDir.getStr(), FSEND); + m_pImpl->getSerializer()->startElementNS(XML_a, XML_effectLst); + m_pImpl->getSerializer()->startElementNS(XML_a, XML_outerShdw, XML_dist, aShadowDist, XML_dir, + aShadowDir); if (aShadowAlpha.isEmpty()) - m_pImpl->getSerializer()->singleElementNS(XML_a, XML_srgbClr, XML_val, - aShadowColor.getStr(), FSEND); + m_pImpl->getSerializer()->singleElementNS(XML_a, XML_srgbClr, XML_val, aShadowColor); else { - m_pImpl->getSerializer()->startElementNS(XML_a, XML_srgbClr, XML_val, aShadowColor.getStr(), - FSEND); - m_pImpl->getSerializer()->singleElementNS(XML_a, XML_alpha, XML_val, aShadowAlpha.getStr(), - FSEND); + m_pImpl->getSerializer()->startElementNS(XML_a, XML_srgbClr, XML_val, aShadowColor); + m_pImpl->getSerializer()->singleElementNS(XML_a, XML_alpha, XML_val, aShadowAlpha); m_pImpl->getSerializer()->endElementNS(XML_a, XML_srgbClr); } m_pImpl->getSerializer()->endElementNS(XML_a, XML_outerShdw); @@ -1191,15 +1175,15 @@ void DocxSdrExport::writeBoxItemLine(const SvxBoxItem& rBox) double fConverted(editeng::ConvertBorderWidthToWord(pBorderLine->GetBorderLineStyle(), pBorderLine->GetWidth())); OString sWidth(OString::number(TwipsToEMU(fConverted))); - pFS->startElementNS(XML_a, XML_ln, XML_w, sWidth.getStr(), FSEND); + pFS->startElementNS(XML_a, XML_ln, XML_w, sWidth); - pFS->startElementNS(XML_a, XML_solidFill, FSEND); + pFS->startElementNS(XML_a, XML_solidFill); OString sColor(msfilter::util::ConvertColor(pBorderLine->GetColor())); - pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, sColor, FSEND); + pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, sColor); pFS->endElementNS(XML_a, XML_solidFill); if (SvxBorderLineStyle::DASHED == pBorderLine->GetBorderLineStyle()) // Line Style is Dash type - pFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash", FSEND); + pFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash"); pFS->endElementNS(XML_a, XML_ln); } @@ -1254,17 +1238,12 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho sax_fastparser::XFastAttributeListRef xDocPrAttrListRef(pDocPrAttrList); pFS->singleElementNS(XML_wp, XML_docPr, xDocPrAttrListRef); - pFS->startElementNS( - XML_a, XML_graphic, FSNS(XML_xmlns, XML_a), - OUStringToOString(m_pImpl->getExport().GetFilter().getNamespaceURL(OOX_NS(dml)), - RTL_TEXTENCODING_UTF8) - .getStr(), - FSEND); + pFS->startElementNS(XML_a, XML_graphic, FSNS(XML_xmlns, XML_a), + m_pImpl->getExport().GetFilter().getNamespaceURL(OOX_NS(dml)).toUtf8()); pFS->startElementNS(XML_a, XML_graphicData, XML_uri, - "http://schemas.microsoft.com/office/word/2010/wordprocessingShape", - FSEND); - pFS->startElementNS(XML_wps, XML_wsp, FSEND); - pFS->singleElementNS(XML_wps, XML_cNvSpPr, XML_txBox, "1", FSEND); + "http://schemas.microsoft.com/office/word/2010/wordprocessingShape"); + pFS->startElementNS(XML_wps, XML_wsp); + pFS->singleElementNS(XML_wps, XML_cNvSpPr, XML_txBox, "1"); uno::Any aRotation; m_pImpl->setDMLandVMLTextFrameRotation(0); @@ -1286,20 +1265,19 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho OString sRotation(OString::number( oox::drawingml::ExportRotateClockwisify(m_pImpl->getDMLandVMLTextFrameRotation()))); // Shape properties - pFS->startElementNS(XML_wps, XML_spPr, FSEND); + pFS->startElementNS(XML_wps, XML_spPr); if (m_pImpl->getDMLandVMLTextFrameRotation()) { - pFS->startElementNS(XML_a, XML_xfrm, XML_rot, sRotation.getStr(), FSEND); + pFS->startElementNS(XML_a, XML_xfrm, XML_rot, sRotation); } else { - pFS->startElementNS(XML_a, XML_xfrm, FSEND); + pFS->startElementNS(XML_a, XML_xfrm); } - pFS->singleElementNS(XML_a, XML_off, XML_x, "0", XML_y, "0", FSEND); + pFS->singleElementNS(XML_a, XML_off, XML_x, "0", XML_y, "0"); OString aWidth(OString::number(TwipsToEMU(aSize.Width()))); OString aHeight(OString::number(TwipsToEMU(aSize.Height()))); - pFS->singleElementNS(XML_a, XML_ext, XML_cx, aWidth.getStr(), XML_cy, aHeight.getStr(), - FSEND); + pFS->singleElementNS(XML_a, XML_ext, XML_cx, aWidth, XML_cy, aHeight); pFS->endElementNS(XML_a, XML_xfrm); OUString shapeType = "rect"; if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) @@ -1320,8 +1298,7 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho if (shapeType.isEmpty()) shapeType = "rect"; - pFS->singleElementNS(XML_a, XML_prstGeom, XML_prst, - OUStringToOString(shapeType, RTL_TEXTENCODING_UTF8).getStr(), FSEND); + pFS->singleElementNS(XML_a, XML_prstGeom, XML_prst, shapeType.toUtf8()); m_pImpl->setDMLTextFrameSyntax(true); m_pImpl->getExport().OutputFormat(pParentFrame->GetFrameFormat(), false, false, true); m_pImpl->setDMLTextFrameSyntax(false); @@ -1392,8 +1369,8 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho { //not the first in the chain, so write the tag as linkedTxbx pFS->singleElementNS(XML_wps, XML_linkedTxbx, XML_id, - I32S(linkedTextboxesIter->second.nId), XML_seq, - I32S(linkedTextboxesIter->second.nSeq), FSEND); + OString::number(linkedTextboxesIter->second.nId), XML_seq, + OString::number(linkedTextboxesIter->second.nSeq)); /* no text content should be added to this tag, since the textbox is linked, the entire content is written in txbx block @@ -1405,8 +1382,8 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho /* this is the first textbox in the chaining, we add the text content to this block*/ //since the text box is linked, it needs an id. - pFS->startElementNS(XML_wps, XML_txbx, XML_id, I32S(linkedTextboxesIter->second.nId), - FSEND); + pFS->startElementNS(XML_wps, XML_txbx, XML_id, + OString::number(linkedTextboxesIter->second.nId)); isTxbxLinked = true; } } @@ -1414,10 +1391,9 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho if (!skipTxBxContent) { if (!isTxbxLinked) - pFS->startElementNS(XML_wps, XML_txbx, - FSEND); //text box is not linked, therefore no id. + pFS->startElementNS(XML_wps, XML_txbx); //text box is not linked, therefore no id. - pFS->startElementNS(XML_w, XML_txbxContent, FSEND); + pFS->startElementNS(XML_w, XML_txbxContent); m_pImpl->setFrameBtLr( m_pImpl->checkFrameBtlr(m_pImpl->getExport().m_pDoc->GetNodes()[nStt], /*bDML=*/true)); @@ -1455,8 +1431,7 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho // AutoSize of the Text Frame. const SwFormatFrameSize& rSize = rFrameFormat.GetFrameSize(); pFS->singleElementNS( - XML_a, (rSize.GetHeightSizeType() == ATT_VAR_SIZE ? XML_spAutoFit : XML_noAutofit), - FSEND); + XML_a, (rSize.GetHeightSizeType() == ATT_VAR_SIZE ? XML_spAutoFit : XML_noAutofit)); pFS->endElementNS(XML_wps, XML_bodyPr); pFS->endElementNS(XML_wps, XML_wsp); @@ -1470,9 +1445,8 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho pFS->startElementNS(XML_wp14, XML_sizeRelH, XML_relativeFrom, (rSize.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME ? "page" - : "margin"), - FSEND); - pFS->startElementNS(XML_wp14, XML_pctWidth, FSEND); + : "margin")); + pFS->startElementNS(XML_wp14, XML_pctWidth); pFS->writeEscaped(OUString::number(nWidthPercent * oox::drawingml::PER_PERCENT)); pFS->endElementNS(XML_wp14, XML_pctWidth); pFS->endElementNS(XML_wp14, XML_sizeRelH); @@ -1483,9 +1457,8 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho pFS->startElementNS( XML_wp14, XML_sizeRelV, XML_relativeFrom, (rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME ? "page" - : "margin"), - FSEND); - pFS->startElementNS(XML_wp14, XML_pctHeight, FSEND); + : "margin")); + pFS->startElementNS(XML_wp14, XML_pctHeight); pFS->writeEscaped(OUString::number(nHeightPercent * oox::drawingml::PER_PERCENT)); pFS->endElementNS(XML_wp14, XML_pctHeight); pFS->endElementNS(XML_wp14, XML_sizeRelV); @@ -1552,7 +1525,7 @@ void DocxSdrExport::writeVMLTextFrame(ww8::Frame const* pParentFrame, bool bText if (!bTextBoxOnly) { - pFS->startElementNS(XML_w, XML_pict, FSEND); + pFS->startElementNS(XML_w, XML_pict); pFS->startElementNS(XML_v, XML_rect, xFlyAttrList); m_pImpl->textFrameShadow(rFrameFormat); if (m_pImpl->getFlyFillAttrList().is()) @@ -1571,7 +1544,7 @@ void DocxSdrExport::writeVMLTextFrame(ww8::Frame const* pParentFrame, bool bText } pFS->startElementNS(XML_v, XML_textbox, xTextboxAttrList); } - pFS->startElementNS(XML_w, XML_txbxContent, FSEND); + pFS->startElementNS(XML_w, XML_txbxContent); m_pImpl->setFlyFrameGraphic(true); m_pImpl->getExport().WriteText(); if (m_pImpl->getParagraphSdtOpen()) diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx index 2e3aa4892cdd..cf6ee28cef43 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.cxx +++ b/sw/source/filter/ww8/docxtablestyleexport.cxx @@ -167,7 +167,7 @@ void DocxTableStyleExport::Impl::tableStyleTableCellMar( if (!rTableCellMar.hasElements()) return; - m_pSerializer->startElementNS(XML_w, nType, FSEND); + m_pSerializer->startElementNS(XML_w, nType); for (sal_Int32 i = 0; i < rTableCellMar.getLength(); ++i) { if (sal_Int32 nToken = DocxStringGetToken(aTableCellMarTokens, rTableCellMar[i].Name)) @@ -176,7 +176,7 @@ void DocxTableStyleExport::Impl::tableStyleTableCellMar( rTableCellMar[i].Value.get>()); m_pSerializer->singleElementNS( XML_w, nToken, FSNS(XML_w, XML_w), OString::number(aMap["w"].get()), - FSNS(XML_w, XML_type), aMap["type"].get().toUtf8(), FSEND); + FSNS(XML_w, XML_type), aMap["type"].get().toUtf8()); } } m_pSerializer->endElementNS(XML_w, nType); @@ -225,7 +225,7 @@ void DocxTableStyleExport::Impl::tableStyleTcBorders( if (!rTcBorders.hasElements()) return; - m_pSerializer->startElementNS(XML_w, nToken, FSEND); + m_pSerializer->startElementNS(XML_w, nToken); for (sal_Int32 i = 0; i < rTcBorders.getLength(); ++i) if (sal_Int32 nSubToken = DocxStringGetToken(aTcBordersTokens, rTcBorders[i].Name)) tableStyleTcBorder(nSubToken, @@ -423,7 +423,7 @@ void DocxTableStyleExport::Impl::tableStyleRPr(uno::SequencestartElementNS(XML_w, XML_rPr, FSEND); + m_pSerializer->startElementNS(XML_w, XML_rPr); uno::Sequence aRFonts; uno::Sequence aLang; @@ -484,16 +484,14 @@ void DocxTableStyleExport::Impl::tableStyleRPr(uno::SequencesingleElementNS(XML_w, XML_spacing, FSNS(XML_w, XML_val), - aSpacingSequence[0].Value.get().toUtf8(), FSEND); + aSpacingSequence[0].Value.get().toUtf8()); } if (!aSpacing.isEmpty()) - m_pSerializer->singleElementNS(XML_w, XML_spacing, FSNS(XML_w, XML_val), aSpacing.toUtf8(), - FSEND); + m_pSerializer->singleElementNS(XML_w, XML_spacing, FSNS(XML_w, XML_val), aSpacing.toUtf8()); if (!aSz.isEmpty()) - m_pSerializer->singleElementNS(XML_w, XML_sz, FSNS(XML_w, XML_val), aSz.toUtf8(), FSEND); + m_pSerializer->singleElementNS(XML_w, XML_sz, FSNS(XML_w, XML_val), aSz.toUtf8()); if (!aSzCs.isEmpty()) - m_pSerializer->singleElementNS(XML_w, XML_szCs, FSNS(XML_w, XML_val), aSzCs.toUtf8(), - FSEND); + m_pSerializer->singleElementNS(XML_w, XML_szCs, FSNS(XML_w, XML_val), aSzCs.toUtf8()); m_pSerializer->endElementNS(XML_w, XML_rPr); } @@ -503,7 +501,7 @@ void DocxTableStyleExport::Impl::tableStylePPr(uno::SequencestartElementNS(XML_w, XML_pPr, FSEND); + m_pSerializer->startElementNS(XML_w, XML_pPr); uno::Sequence aSpacing; uno::Sequence aInd; @@ -524,12 +522,12 @@ void DocxTableStyleExport::Impl::tableStylePPr(uno::Sequence(); } if (bWordWrap) - m_pSerializer->singleElementNS(XML_w, XML_wordWrap, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_wordWrap); tableStylePInd(aInd); handleBoolean(aSnapToGrid, XML_snapToGrid); tableStylePSpacing(aSpacing); if (!aJc.isEmpty()) - m_pSerializer->singleElementNS(XML_w, XML_jc, FSNS(XML_w, XML_val), aJc.toUtf8(), FSEND); + m_pSerializer->singleElementNS(XML_w, XML_jc, FSNS(XML_w, XML_val), aJc.toUtf8()); m_pSerializer->endElementNS(XML_w, XML_pPr); } @@ -539,7 +537,7 @@ void DocxTableStyleExport::Impl::tableStyleTablePr(uno::SequencestartElementNS(XML_w, XML_tblPr, FSEND); + m_pSerializer->startElementNS(XML_w, XML_tblPr); uno::Sequence aTableInd; uno::Sequence aTableBorders; @@ -561,10 +559,10 @@ void DocxTableStyleExport::Impl::tableStyleTablePr(uno::SequencesingleElementNS(XML_w, XML_tblStyleRowBandSize, FSNS(XML_w, XML_val), - OString::number(oTableStyleRowBandSize.get()), FSEND); + OString::number(oTableStyleRowBandSize.get())); if (oTableStyleColBandSize) m_pSerializer->singleElementNS(XML_w, XML_tblStyleColBandSize, FSNS(XML_w, XML_val), - OString::number(oTableStyleColBandSize.get()), FSEND); + OString::number(oTableStyleColBandSize.get())); tableStyleTableInd(aTableInd); tableStyleTcBorders(aTableBorders, XML_tblBorders); tableStyleTableCellMar(aTableCellMar); @@ -577,7 +575,7 @@ void DocxTableStyleExport::Impl::tableStyleTcPr(uno::SequencestartElementNS(XML_w, XML_tcPr, FSEND); + m_pSerializer->startElementNS(XML_w, XML_tcPr); uno::Sequence aShd; uno::Sequence aTcBorders; @@ -598,8 +596,7 @@ void DocxTableStyleExport::Impl::tableStyleTcPr(uno::SequencesingleElementNS(XML_w, XML_vAlign, FSNS(XML_w, XML_val), aVAlign.toUtf8(), - FSEND); + m_pSerializer->singleElementNS(XML_w, XML_vAlign, FSNS(XML_w, XML_val), aVAlign.toUtf8()); m_pSerializer->endElementNS(XML_w, XML_tcPr); } @@ -629,8 +626,7 @@ void DocxTableStyleExport::Impl::tableStyleTableStylePr( aTcPr = rTableStylePr[i].Value.get>(); } - m_pSerializer->startElementNS(XML_w, XML_tblStylePr, FSNS(XML_w, XML_type), aType.toUtf8(), - FSEND); + m_pSerializer->startElementNS(XML_w, XML_tblStylePr, FSNS(XML_w, XML_type), aType.toUtf8()); tableStylePPr(aPPr); tableStyleRPr(aRPr); @@ -639,7 +635,7 @@ void DocxTableStyleExport::Impl::tableStyleTableStylePr( else { // Even if we have an empty container, write it out, as Word does. - m_pSerializer->singleElementNS(XML_w, XML_tblPr, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_tblPr); } tableStyleTcPr(aTcPr); @@ -709,22 +705,20 @@ void DocxTableStyleExport::Impl::TableStyle(uno::Sequence& 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), aName.toUtf8(), FSEND); + m_pSerializer->singleElementNS(XML_w, XML_name, FSNS(XML_w, XML_val), aName.toUtf8()); if (!aBasedOn.isEmpty()) - m_pSerializer->singleElementNS(XML_w, XML_basedOn, FSNS(XML_w, XML_val), aBasedOn.toUtf8(), - FSEND); + m_pSerializer->singleElementNS(XML_w, XML_basedOn, FSNS(XML_w, XML_val), aBasedOn.toUtf8()); if (!aUiPriority.isEmpty()) m_pSerializer->singleElementNS(XML_w, XML_uiPriority, FSNS(XML_w, XML_val), - aUiPriority.toUtf8(), FSEND); + aUiPriority.toUtf8()); if (bSemiHidden) - m_pSerializer->singleElementNS(XML_w, XML_semiHidden, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_semiHidden); if (bUnhideWhenUsed) - m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed); if (bQFormat) - m_pSerializer->singleElementNS(XML_w, XML_qFormat, FSEND); + m_pSerializer->singleElementNS(XML_w, XML_qFormat); if (!aRsid.isEmpty()) - m_pSerializer->singleElementNS(XML_w, XML_rsid, FSNS(XML_w, XML_val), aRsid.toUtf8(), - FSEND); + m_pSerializer->singleElementNS(XML_w, XML_rsid, FSNS(XML_w, XML_val), aRsid.toUtf8()); tableStylePPr(aPPr); tableStyleRPr(aRPr); -- cgit