47#include <oox/token/namespaces.hxx>
48#include <oox/token/tokens.hxx>
101#include <tools/datetime.hxx>
104#include <rtl/tencinfo.h>
116#include <lineinfo.hxx>
140#include <osl/file.hxx>
144#include <com/sun/star/i18n/ScriptType.hpp>
145#include <com/sun/star/i18n/XBreakIterator.hpp>
146#include <com/sun/star/chart2/XChartDocument.hpp>
147#include <com/sun/star/drawing/ShadingPattern.hpp>
148#include <com/sun/star/text/GraphicCrop.hpp>
149#include <com/sun/star/embed/EmbedStates.hpp>
150#include <com/sun/star/embed/Aspects.hpp>
151#include <com/sun/star/text/ControlCharacter.hpp>
156#include <string_view>
159#include <unicode/regex.h>
161using ::editeng::SvxBorderLine;
173class FFDataWriterHelper
176 void writeCommonStart(
const OUString& rName,
177 const OUString& rEntryMacro,
178 const OUString& rExitMacro,
179 const OUString& rHelp,
180 const OUString& rHint )
182 m_pSerializer->startElementNS(XML_w, XML_ffData);
183 m_pSerializer->singleElementNS(XML_w, XML_name,
FSNS(XML_w, XML_val), rName);
184 m_pSerializer->singleElementNS(XML_w, XML_enabled);
185 m_pSerializer->singleElementNS(XML_w, XML_calcOnExit,
FSNS(XML_w, XML_val),
"0");
187 if ( !rEntryMacro.isEmpty() )
188 m_pSerializer->singleElementNS( XML_w, XML_entryMacro,
189 FSNS(XML_w, XML_val), rEntryMacro );
191 if ( !rExitMacro.isEmpty() )
192 m_pSerializer->singleElementNS(XML_w, XML_exitMacro,
FSNS(XML_w, XML_val), rExitMacro);
194 if ( !rHelp.isEmpty() )
195 m_pSerializer->singleElementNS( XML_w, XML_helpText,
196 FSNS(XML_w, XML_type),
"text",
197 FSNS(XML_w, XML_val), rHelp );
199 if ( !rHint.isEmpty() )
200 m_pSerializer->singleElementNS( XML_w, XML_statusText,
201 FSNS(XML_w, XML_type),
"text",
202 FSNS(XML_w, XML_val), rHint );
207 m_pSerializer->endElementNS( XML_w, XML_ffData );
211 void WriteFormCheckbox(
const OUString& rName,
212 const OUString& rEntryMacro,
213 const OUString& rExitMacro,
214 const OUString& rHelp,
215 const OUString& rHint,
218 writeCommonStart( rName, rEntryMacro, rExitMacro, rHelp, rHint );
220 m_pSerializer->startElementNS(XML_w, XML_checkBox);
223 m_pSerializer->startElementNS(XML_w, XML_sizeAuto);
224 m_pSerializer->endElementNS( XML_w, XML_sizeAuto );
226 m_pSerializer->singleElementNS(XML_w, XML_checked);
227 m_pSerializer->endElementNS( XML_w, XML_checkBox );
231 void WriteFormText(
const OUString& rName,
232 const OUString& rEntryMacro,
233 const OUString& rExitMacro,
234 const OUString& rHelp,
235 const OUString& rHint,
236 const OUString& rType,
237 const OUString& rDefaultText,
238 sal_uInt16 nMaxLength,
239 const OUString& rFormat )
241 writeCommonStart( rName, rEntryMacro, rExitMacro, rHelp, rHint );
243 m_pSerializer->startElementNS(XML_w, XML_textInput);
244 if ( !rType.isEmpty() )
245 m_pSerializer->singleElementNS(XML_w, XML_type,
FSNS(XML_w, XML_val), rType);
246 if ( !rDefaultText.isEmpty() )
247 m_pSerializer->singleElementNS(XML_w, XML_default,
FSNS(XML_w, XML_val), rDefaultText);
249 m_pSerializer->singleElementNS( XML_w, XML_maxLength,
250 FSNS(XML_w, XML_val), OString::number(nMaxLength) );
251 if ( !rFormat.isEmpty() )
252 m_pSerializer->singleElementNS(XML_w, XML_format,
FSNS(XML_w, XML_val), rFormat);
253 m_pSerializer->endElementNS( XML_w, XML_textInput );
259class FieldMarkParamsHelper
261 const sw::mark::IFieldmark& mrFieldmark;
263 explicit FieldMarkParamsHelper(
const sw::mark::IFieldmark& rFieldmark ) : mrFieldmark( rFieldmark ) {}
264 OUString
const & getName()
const {
return mrFieldmark.GetName(); }
265 template <
typename T >
266 bool extractParam(
const OUString& rKey, T& rResult )
268 bool bResult =
false;
269 if ( mrFieldmark.GetParameters() )
271 sw::mark::IFieldmark::parameter_map_t::const_iterator it = mrFieldmark.GetParameters()->find( rKey );
272 if ( it != mrFieldmark.GetParameters()->end() )
273 bResult = ( it->second >>= rResult );
280OUString NumberToHexBinary(sal_Int32 n)
284 return aBuf.makeStringAndClear();
303 return rName ==
u"Title" || rName ==
u"Subtitle" || rName ==
u"Company";
331 const auto& rExport = rDocxAttributeOutput.
GetExport();
333 for( sal_uInt16 nCnt = rExport.m_rDoc.GetSpzFrameFormats()->size(); nCnt; )
335 const SwFrameFormat* pFrameFormat = (*rExport.m_rDoc.GetSpzFrameFormats())[ --nCnt ];
339 if (!pAnchorNode || ! rExport.m_pCurPam->GetPointNode().
GetTextNode())
342 if (*pAnchorNode != *rExport.m_pCurPam->GetPointNode().
GetTextNode())
371 const std::map<OUString, css::uno::Any> & rTableGrabBag = pTableGrabBag->
GetGrabBag();
373 if (rTableGrabBag.find(
"TablePosition") == rTableGrabBag.end())
390 bool bGenerateParaId)
415 if ( pDeepInner->getCell() == 0 )
418 const sal_uInt32 nCell = pDeepInner->getCell();
419 const sal_uInt32 nRow = pDeepInner->getRow();
425 sal_uInt32 nRow = pTextNodeInfo->getRow();
426 sal_uInt32 nCell = pTextNodeInfo->getCell();
432 sal_uInt32 nCurrentDepth = pTextNodeInfo->getDepth();
455 bool bEndParaSdt =
false;
465 const std::map<OUString, css::uno::Any>& rMap = rParaGrabBag.
GetGrabBag();
484 std::optional<OUString> aParaId;
485 sal_Int32 nParaId = 0;
489 aParaId = NumberToHexBinary(nParaId);
511 case text::VertOrientation::CENTER:
512 case text::VertOrientation::LINE_CENTER:
514 case text::VertOrientation::BOTTOM:
516 case text::VertOrientation::LINE_BOTTOM:
518 case text::VertOrientation::TOP:
520 case text::VertOrientation::LINE_TOP:
531 case text::HoriOrientation::LEFT:
532 return bIsPosToggle ?
"inside" :
"left";
533 case text::HoriOrientation::INSIDE:
535 case text::HoriOrientation::RIGHT:
536 return bIsPosToggle ?
"outside" :
"right";
537 case text::HoriOrientation::OUTSIDE:
539 case text::HoriOrientation::CENTER:
540 case text::HoriOrientation::FULL:
551 case text::RelOrientation::PAGE_PRINT_AREA:
553 case text::RelOrientation::PAGE_FRAME:
555 case text::RelOrientation::FRAME:
556 case text::RelOrientation::TEXT_LINE:
566 case text::RelOrientation::PAGE_PRINT_AREA:
568 case text::RelOrientation::PAGE_FRAME:
570 case text::RelOrientation::CHAR:
571 case text::RelOrientation::PAGE_RIGHT:
572 case text::RelOrientation::FRAME:
648 pSerializer->startElementNS(XML_w, XML_sdt);
651 pSerializer->startElementNS(XML_w, XML_sdtPr);
663 const uno::Sequence<xml::FastAttribute> aChildren =
m_pTokenChildren->getFastAttributes();
664 for (
const auto& rChild : aChildren)
665 pSerializer->singleElement(rChild.Token,
FSNS(XML_w, XML_val), rChild.Value);
682 pSerializer->endElementNS(XML_w, XML_sdtPr);
685 pSerializer->startElementNS(XML_w, XML_sdtContent);
702 pSerializer->singleElementNS(XML_w, XML_id,
FSNS(XML_w, XML_val), OString::number(
m_nId));
712 pSerializer->singleElementNS(XML_w, XML_text, detachFrom(
m_pTextAttrs));
717 pSerializer->startElementNS(XML_w, XML_placeholder);
719 pSerializer->endElementNS(XML_w, XML_placeholder);
723 pSerializer->singleElementNS(XML_w, XML_showingPlcHdr);
727 pSerializer->singleElementNS(XML_w15, XML_color,
FSNS(XML_w, XML_val),
m_aColor);
732 pSerializer->singleElementNS(XML_w15, XML_appearance,
FSNS(XML_w15, XML_val),
m_aAppearance);
736 pSerializer->singleElementNS(XML_w, XML_alias,
FSNS(XML_w, XML_val),
m_aAlias);
739 pSerializer->singleElementNS(XML_w, XML_tag,
FSNS(XML_w, XML_val),
m_aTag);
742 pSerializer->singleElementNS(XML_w, XML_tabIndex,
FSNS(XML_w, XML_val),
746 pSerializer->singleElementNS(XML_w, XML_lock,
FSNS(XML_w, XML_val),
m_aLock);
751 pSerializer->endElementNS(XML_w, XML_sdtContent);
752 pSerializer->endElementNS(XML_w, XML_sdt);
758 for (
const beans::PropertyValue& aPropertyValue : aGrabBagSdt)
760 if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_checkbox")
763 uno::Sequence<beans::PropertyValue> aGrabBag;
764 aPropertyValue.Value >>= aGrabBag;
765 for (
const auto& rProp : aGrabBag)
767 if (rProp.Name ==
"ooxml:CT_SdtCheckbox_checked")
769 FSNS(XML_w14, XML_checked), rProp.Value.get<OUString>());
770 else if (rProp.Name ==
"ooxml:CT_SdtCheckbox_checkedState")
772 FSNS(XML_w14, XML_checkedState), rProp.Value.get<OUString>());
773 else if (rProp.Name ==
"ooxml:CT_SdtCheckbox_uncheckedState")
775 FSNS(XML_w14, XML_uncheckedState), rProp.Value.get<OUString>());
780 uno::Sequence<beans::PropertyValue> aGrabBag;
781 aPropertyValue.Value >>= aGrabBag;
782 for (
const auto& rProp : aGrabBag)
784 if (rProp.Name ==
"ooxml:CT_DataBinding_prefixMappings")
786 FSNS( XML_w, XML_prefixMappings ), rProp.Value.get<OUString>());
787 else if (rProp.Name ==
"ooxml:CT_DataBinding_xpath")
789 FSNS( XML_w, XML_xpath ), rProp.Value.get<OUString>());
790 else if (rProp.Name ==
"ooxml:CT_DataBinding_storeItemID")
792 FSNS( XML_w, XML_storeItemID ), rProp.Value.get<OUString>());
795 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_text")
797 uno::Sequence<beans::PropertyValue> aGrabBag;
798 aPropertyValue.Value >>= aGrabBag;
799 if (aGrabBag.hasElements())
801 for (
const auto& rProp : aGrabBag)
803 if (rProp.Name ==
"ooxml:CT_SdtText_multiLine")
805 FSNS(XML_w, XML_multiLine), rProp.Value.get<OUString>());
814 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPlaceholder_docPart")
816 uno::Sequence<beans::PropertyValue> aGrabBag;
817 aPropertyValue.Value >>= aGrabBag;
818 for (
const auto& rProp : std::as_const(aGrabBag))
820 OUString sValue = rProp.Value.get<OUString>();
821 if (rProp.Name ==
"ooxml:CT_SdtPlaceholder_docPart_val")
825 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_color")
827 uno::Sequence<beans::PropertyValue> aGrabBag;
828 aPropertyValue.Value >>= aGrabBag;
829 for (
const auto& rProp : std::as_const(aGrabBag))
831 OUString sValue = rProp.Value.get<OUString>();
832 if (rProp.Name ==
"ooxml:CT_SdtColor_val")
836 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_appearance")
839 SAL_WARN(
"sw.ww8",
"DocxAttributeOutput::GrabBag: unexpected sdt appearance value");
841 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_showingPlcHdr")
844 SAL_WARN(
"sw.ww8",
"DocxAttributeOutput::GrabBag: unexpected sdt ShowingPlcHdr");
846 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_alias" &&
m_aAlias.isEmpty())
848 if (!(aPropertyValue.Value >>=
m_aAlias))
849 SAL_WARN(
"sw.ww8",
"DocxAttributeOutput::GrabBag: unexpected sdt alias value");
851 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_tag" &&
m_aTag.isEmpty())
853 if (!(aPropertyValue.Value >>=
m_aTag))
854 SAL_WARN(
"sw.ww8",
"DocxAttributeOutput::GrabBag: unexpected sdt tag value");
856 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_id")
858 if (!(aPropertyValue.Value >>=
m_nId))
859 SAL_WARN(
"sw.ww8",
"DocxAttributeOutput::GrabBag: unexpected sdt id value");
861 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_tabIndex" && !
m_nTabIndex)
864 SAL_WARN(
"sw.ww8",
"DocxAttributeOutput::GrabBag: unexpected sdt tabIndex value");
866 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_lock" &&
m_aLock.isEmpty())
868 if (!(aPropertyValue.Value >>=
m_aLock))
869 SAL_WARN(
"sw.ww8",
"DocxAttributeOutput::GrabBag: unexpected sdt lock value");
871 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_citation")
873 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_docPartObj" ||
874 aPropertyValue.Name ==
"ooxml:CT_SdtPr_docPartList")
876 if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_docPartObj")
878 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_docPartList")
881 uno::Sequence<beans::PropertyValue> aGrabBag;
882 aPropertyValue.Value >>= aGrabBag;
883 for (
const auto& rProp : aGrabBag)
885 if (rProp.Name ==
"ooxml:CT_SdtDocPart_docPartGallery")
887 FSNS(XML_w, XML_docPartGallery), rProp.Value.get<OUString>());
888 else if (rProp.Name ==
"ooxml:CT_SdtDocPart_docPartCategory")
890 FSNS(XML_w, XML_docPartCategory), rProp.Value.get<OUString>());
891 else if (rProp.Name ==
"ooxml:CT_SdtDocPart_docPartUnique")
893 OUString sValue = rProp.Value.get<OUString>();
894 if (sValue.isEmpty())
901 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_equation")
903 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_picture")
905 else if (aPropertyValue.Name ==
"ooxml:CT_SdtPr_group")
908 SAL_WARN(
"sw.ww8",
"GetSdtParamsFromGrabBag unhandled SdtPr grab bag property " << aPropertyValue.Name);
918 awt::Point aPos(rHoriOrient.
GetPos(), rVertOrient.
GetPos());
931 const sal_uInt32 nLeftBorderSpacing = pFrameFormat->
GetBox().
GetDistance(SvxBoxItemLine::LEFT);
932 const sal_uInt32 nRighttBorderSpacing = pFrameFormat->
GetBox().
GetDistance(SvxBoxItemLine::RIGHT);
933 sal_uInt32 nAdjustedWidth = rSize.
Width();
934 if (nLeftBorderSpacing < 621 && nRighttBorderSpacing < 621
935 && nAdjustedWidth > nLeftBorderSpacing + nRighttBorderSpacing)
937 nAdjustedWidth -= nLeftBorderSpacing + nRighttBorderSpacing;
939 attrList->add(
FSNS( XML_w, XML_w), OString::number(nAdjustedWidth));
940 attrList->add(
FSNS( XML_w, XML_h), OString::number(rSize.
Height()));
942 attrList->add(
FSNS( XML_w, XML_x), OString::number(aPos.X));
943 attrList->add(
FSNS( XML_w, XML_y), OString::number(aPos.Y));
947 if (!aXAlign.isEmpty())
948 attrList->add(
FSNS(XML_w, XML_xAlign), aXAlign);
949 if (!aYAlign.isEmpty())
950 attrList->add(
FSNS(XML_w, XML_yAlign), aYAlign);
959 if (rHoriOrient.
GetHoriOrient() == text::HoriOrientation::LEFT)
961 else if (rHoriOrient.
GetHoriOrient() == text::HoriOrientation::RIGHT)
964 attrList->add(
FSNS(XML_w, XML_hSpace), OString::number((nLeft + nRight) / 2));
965 attrList->add(
FSNS(XML_w, XML_vSpace), OString::number((nUpper + nLower) / 2));
972 case css::text::WrapTextMode_NONE:
973 attrList->add(
FSNS( XML_w, XML_wrap),
"notBeside");
975 case css::text::WrapTextMode_DYNAMIC:
976 attrList->add(
FSNS(XML_w, XML_wrap),
"auto");
978 case css::text::WrapTextMode_PARALLEL:
980 attrList->add(
FSNS(XML_w, XML_wrap),
"around");
983 attrList->add(
FSNS( XML_w, XML_vAnchor), relativeFromV );
984 attrList->add(
FSNS( XML_w, XML_hAnchor), relativeFromH );
985 attrList->add(
FSNS( XML_w, XML_hRule),
"exact");
987 m_pSerializer->singleElementNS( XML_w, XML_framePr, attrList );
996 uno::Reference<beans::XPropertySet> xPropertySet(pSdrObj->
getUnoShape(), uno::UNO_QUERY);
997 if (!xPropertySet.is())
1000 uno::Reference<beans::XPropertySetInfo> xPropSetInfo(xPropertySet->getPropertySetInfo());
1001 if (!xPropSetInfo.is() || !xPropSetInfo->hasPropertyByName(
"FrameInteropGrabBag"))
1005 uno::Sequence<beans::PropertyValue> propList;
1006 xPropertySet->getPropertyValue(
"FrameInteropGrabBag") >>= propList;
1007 auto pProp = std::find_if(std::cbegin(propList), std::cend(propList),
1008 [](
const beans::PropertyValue& rProp) {
return rProp.Name ==
"ParaFrameProperties"; });
1009 if (pProp != std::cend(propList))
1010 pProp->Value >>= bRet;
1019 std::vector< std::shared_ptr <ww8::Frame> > aFramePrTextbox;
1040 std::shared_ptr<ww8::Frame> pFramePr = std::make_shared<ww8::Frame>(aFrame);
1041 aFramePrTextbox.push_back(pFramePr);
1051 m_pSerializer->startElementNS(XML_mc, XML_AlternateContent);
1052 m_pSerializer->startElementNS(XML_mc, XML_Choice, XML_Requires,
"wps");
1112 if (!pTextNodeInfoInner)
1128 for(sal_Int32 nHyperLinkToClose = 0; nHyperLinkToClose <
m_nHyperLinkCount.back(); ++nHyperLinkToClose)
1171 for (
const auto & pFrame : aFramePrTextbox )
1186 aFramePrTextbox.clear();
1198#define MAX_CELL_IN_WORD 62
1207 for (sal_Int32
i = nClosedCell+1;
i < nCell; ++
i)
1227 sal_uInt32 nRow = pInner->getRow();
1228 sal_Int32 nCell = pInner->getCell();
1238 const bool limitWorkaround = (nCell >=
MAX_CELL_IN_WORD && !pInner->isEndOfLine());
1239 const bool bEndCell = pInner->isEndOfCell() && !limitWorkaround;
1240 const bool bEndRow = pInner->isEndOfLine();
1255 if (nCell == nClosedCell)
1263 sal_Int32 nRemainingCells = xRowSpans->size() - nCell;
1264 for (sal_Int32
i = 1;
i < nRemainingCells; ++
i)
1266 if (bForceEmptyParagraph)
1277 if (bForceEmptyParagraph)
1290 if (pInner->isFinalEndOfLine())
1364 static const sal_Int32 aOrder[] =
1366 FSNS( XML_w, XML_pStyle ),
1367 FSNS( XML_w, XML_keepNext ),
1368 FSNS( XML_w, XML_keepLines ),
1369 FSNS( XML_w, XML_pageBreakBefore ),
1370 FSNS( XML_w, XML_framePr ),
1371 FSNS( XML_w, XML_widowControl ),
1372 FSNS( XML_w, XML_numPr ),
1373 FSNS( XML_w, XML_suppressLineNumbers ),
1374 FSNS( XML_w, XML_pBdr ),
1375 FSNS( XML_w, XML_shd ),
1376 FSNS( XML_w, XML_tabs ),
1377 FSNS( XML_w, XML_suppressAutoHyphens ),
1378 FSNS( XML_w, XML_kinsoku ),
1379 FSNS( XML_w, XML_wordWrap ),
1380 FSNS( XML_w, XML_overflowPunct ),
1381 FSNS( XML_w, XML_topLinePunct ),
1382 FSNS( XML_w, XML_autoSpaceDE ),
1383 FSNS( XML_w, XML_autoSpaceDN ),
1384 FSNS( XML_w, XML_bidi ),
1385 FSNS( XML_w, XML_adjustRightInd ),
1386 FSNS( XML_w, XML_snapToGrid ),
1387 FSNS( XML_w, XML_spacing ),
1388 FSNS( XML_w, XML_ind ),
1389 FSNS( XML_w, XML_contextualSpacing ),
1390 FSNS( XML_w, XML_mirrorIndents ),
1391 FSNS( XML_w, XML_suppressOverlap ),
1392 FSNS( XML_w, XML_jc ),
1393 FSNS( XML_w, XML_textDirection ),
1394 FSNS( XML_w, XML_textAlignment ),
1395 FSNS( XML_w, XML_textboxTightWrap ),
1396 FSNS( XML_w, XML_outlineLvl ),
1397 FSNS( XML_w, XML_divId ),
1398 FSNS( XML_w, XML_cnfStyle ),
1399 FSNS( XML_w, XML_rPr ),
1400 FSNS( XML_w, XML_sectPr ),
1401 FSNS( XML_w, XML_pPrChange )
1445 sal_uInt16 nWhichId = aIter.FirstWhich();
1448 bool bFontSizeWritten =
false;
1449 bool bBoldWritten =
false;
1452 if (aIter.GetItemState(
true, &pItem) == SfxItemState::SET)
1459 if (!(bFontSizeWritten && bFontSizeItem) && !(bBoldWritten && bBoldItem))
1462 bFontSizeWritten =
true;
1464 bBoldWritten =
true;
1469 lcl_writeParagraphMarkerProperties(rAttributeOutput, *pAutoFormat->
GetStyleHandle());
1472 nWhichId = aIter.NextWhich();
1477const char *RubyAlignValues[] =
1488const char *lclConvertWW8JCToOOXMLRubyAlign(sal_Int32 nJC)
1491 if ( nJC >=0 && nJC < nElements )
1492 return RubyAlignValues[nJC];
1493 return RubyAlignValues[0];
1528 lcl_writeParagraphMarkerProperties(*
this, rParagraphMarkerProperties);
1538 if ( pRedlineParagraphMarkerDeleted )
1541 EndRedline( pRedlineParagraphMarkerDeleted,
true );
1543 if ( pRedlineParagraphMarkerInserted )
1546 EndRedline( pRedlineParagraphMarkerInserted,
true );
1556 assert(
TextBoxIsFramePr(rFrameFormat) &&
"by definition, because Frame()");
1571 if (pFillStyle && pFillStyle->GetValue() != drawing::FillStyle_NONE)
1573 std::unique_ptr<SvxBrushItem> pBrush(
1575 if (pBrush->GetColor().GetAlpha() > 127)
1586 if (rFrameDir.GetValue() != SvxFrameDirection::Environment)
1607 std::map<OUString, OUString> aStatements;
1610 if (!aStatements.empty())
1613 FSNS(XML_w, XML_uri),
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
1614 FSNS(XML_w, XML_element),
"RDF");
1616 for (
const auto& rStatement : aStatements)
1618 FSNS(XML_w, XML_name), rStatement.first,
1619 FSNS(XML_w, XML_val), rStatement.second);
1701 for ( std::vector<FieldInfos>::iterator pIt =
m_Fields.begin() + nFieldsInPrevHyperlink; pIt !=
m_Fields.end(); )
1733 bool bCloseEarlierSDT =
false;
1742 bCloseEarlierSDT =
true;
1752 for (
int i = 0;
i < nFieldsInPrevHyperlink;
i++ )
1766 bool bIsStartedHyperlink =
false;
1771 bIsStartedHyperlink =
true;
1775 if (!bIsStartedHyperlink)
1781 for ( std::vector<FieldInfos>::iterator pIt =
m_Fields.begin(); pIt !=
m_Fields.end(); )
1802 if (pIt->bSep && !pIt->pField)
1826 bool newStartedHyperlink(
false);
1838 if (it->bClose && !it->pField)
1849 newStartedHyperlink =
true;
1874 m_pSerializer->startElementNS(XML_w, XML_fldChar,
FSNS(XML_w, XML_fldCharType),
"begin");
1893 FSNS( XML_w, XML_fldCharType ),
"separate" );
1906 auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
1907 m_pContentControl = pTextContentControl->GetContentControl().GetContentControl();
1932 sal_Int32 nEnd =
nPos + nLen;
1934 if (pAttr && *pAttr->
GetEnd() == nEnd)
1958 if (bCloseEarlierSDT)
1999 FSNS( XML_w, XML_fldCharType ),
"end" );
2019 bool bIsStartedHyperlink =
false;
2024 bIsStartedHyperlink =
true;
2028 if (!bIsStartedHyperlink)
2033 if (!newStartedHyperlink)
2046 if (it->bClose && !it->pField)
2078 FSNS(XML_w, XML_id), OString::number(
nId));
2087 const OUString &rAuthor(
SW_MOD()->GetRedlineAuthor( pRedlineData->
GetAuthor() ) );
2089 bool bNoDate = bRemovePersonalInfo ||
2096 pAttributeList->add(
FSNS(XML_w, XML_author ), bRemovePersonalInfo
2097 ?
"Author" + OString::number(
GetExport().GetInfoID(rAuthor) )
2101 pAttributeList->add(
FSNS(XML_w, XML_name), bookmarkName);
2102 m_pSerializer->singleElementNS( XML_w, bFrom ? XML_moveFromRangeStart : XML_moveToRangeStart, pAttributeList );
2113 ? XML_moveFromRangeEnd
2114 : XML_moveToRangeEnd,
2115 FSNS(XML_w, XML_id), OString::number(
nId));
2124 for(
auto aIter = aRange.first; aIter != aRange.second; ++aIter)
2136 for(
auto aIter = aRange.first; aIter != aRange.second; ++aIter)
2152 for (
const OUString & bookmarkName : rStarts)
2157 OUString sBookmarkName =
BookmarkToWord(bookmarkName, &bMove, &bFrom);
2164 if ( pRedlineData && pRedlineData->
IsMoved() )
2180 for (
const OUString & bookmarkName : rEnds)
2211 std::u16string_view permissionIdAndName;
2215 const std::size_t separatorIndex = permissionIdAndName.find(
u':');
2216 assert(separatorIndex != std::u16string_view::npos);
2217 const std::u16string_view permissionId = permissionIdAndName.substr(0, separatorIndex);
2218 const std::u16string_view permissionName = permissionIdAndName.substr(separatorIndex + 1);
2227 permission,
u"permission-for-user:", &permissionIdAndName);
2228 assert(ok); (void)ok;
2229 const std::size_t separatorIndex = permissionIdAndName.find(
u':');
2230 assert(separatorIndex != std::u16string_view::npos);
2231 const std::u16string_view permissionId = permissionIdAndName.substr(0, separatorIndex);
2232 const std::u16string_view permissionName = permissionIdAndName.substr(separatorIndex + 1);
2250 std::u16string_view permissionIdAndName;
2252 auto const ok =
o3tl::starts_with(permission,
u"permission-for-group:", &permissionIdAndName) ||
2254 assert(ok); (void)ok;
2256 const std::size_t separatorIndex = permissionIdAndName.find(
u':');
2257 assert(separatorIndex != std::u16string_view::npos);
2258 const std::u16string_view permissionId = permissionIdAndName.substr(0, separatorIndex);
2299 m_pSerializer->singleElementNS( XML_w, XML_commentRangeStart,
2300 FSNS( XML_w, XML_id ), OString::number(
nId) );
2313 const sal_Int32
nId = ( *pPos ).second;
2315 FSNS( XML_w, XML_id ), OString::number(
nId) );
2319 m_pSerializer->singleElementNS( XML_w, XML_commentReference,
FSNS( XML_w, XML_id ),
2320 OString::number(
nId) );
2329 const ::sw::mark::IFieldmark& rFieldmark = *rInfos.
pFieldmark;
2330 FieldMarkParamsHelper params( rFieldmark );
2332 OUString sEntryMacro;
2333 params.extractParam(
"EntryMacro", sEntryMacro);
2334 OUString sExitMacro;
2335 params.extractParam(
"ExitMacro", sExitMacro);
2337 params.extractParam(
"Help", sHelp);
2339 params.extractParam(
"Hint", sHint);
2340 if ( sHint.isEmpty() )
2341 params.extractParam(
"Description", sHint);
2345 uno::Sequence< OUString> vListEntries;
2346 OUString
sName, sSelected;
2352 sName = params.getName();
2353 sal_Int32 nSelectedIndex = 0;
2357 if (nSelectedIndex < vListEntries.getLength() )
2358 sSelected = vListEntries[ nSelectedIndex ];
2365 const OUString
sName = params.getName();
2366 bool bChecked =
false;
2369 if ( pCheckboxFm && pCheckboxFm->
IsChecked() )
2373 ffdataOut.WriteFormCheckbox(
sName, sEntryMacro, sExitMacro, sHelp, sHint, bChecked );
2378 params.extractParam(
"Type",
sType);
2379 OUString sDefaultText;
2380 params.extractParam(
"Content", sDefaultText);
2381 sal_uInt16 nMaxLength = 0;
2382 params.extractParam(
"MaxLength", nMaxLength);
2384 params.extractParam(
"Format", sFormat);
2386 ffdataOut.WriteFormText( params.getName(), sEntryMacro, sExitMacro, sHelp, sHint,
2387 sType, sDefaultText, nMaxLength, sFormat );
2396 if(!sFullDate.isEmpty())
2397 m_pSerializer->startElementNS(XML_w, XML_date,
FSNS(XML_w, XML_fullDate), sFullDate);
2402 OUString sDateFormat1 = sDateFormat.replaceAll(
"\"",
"'");
2404 FSNS(XML_w, XML_val), sDateFormat1);
2406 FSNS(XML_w, XML_val), sLang);
2407 m_pSerializer->singleElementNS(XML_w, XML_storeMappedDataAs,
2408 FSNS(XML_w, XML_val),
"dateTime");
2410 FSNS(XML_w, XML_val),
"gregorian");
2413 if (aGrabBagSdt.hasElements())
2431 if (aGrabBagSdt.hasElements())
2445 OUString sPrefixMapping, sXpath;
2446 for (
const auto& rProp : std::as_const(aGrabBagSdt))
2448 if (rProp.Name ==
"ooxml:CT_SdtPr_dataBinding")
2450 uno::Sequence<beans::PropertyValue> aDataBindingProps;
2451 rProp.Value >>= aDataBindingProps;
2452 for (
const auto& rDBProp : std::as_const(aDataBindingProps))
2454 if (rDBProp.Name ==
"ooxml:CT_DataBinding_prefixMappings")
2455 sPrefixMapping = rDBProp.Value.get<OUString>();
2456 else if (rDBProp.Name ==
"ooxml:CT_DataBinding_xpath")
2457 sXpath = rDBProp.Value.get<OUString>();
2462 if (sXpath.getLength())
2532 const sal_Int32 nTabIndex =
static_cast<sal_Int32
>(
m_pContentControl->GetTabIndex());
2534 OString::number(nTabIndex));
2559 if (!aCheckedState.isEmpty())
2561 m_pSerializer->singleElementNS(XML_w14, XML_checkedState,
FSNS(XML_w14, XML_val),
2562 OString::number(aCheckedState[0], 16));
2565 if (!aUncheckedState.isEmpty())
2567 m_pSerializer->singleElementNS(XML_w14, XML_uncheckedState,
FSNS(XML_w14, XML_val),
2568 OString::number(aUncheckedState[0], 16));
2586 if (!rItem.m_aDisplayText.isEmpty())
2589 xAttributes->add(
FSNS(XML_w, XML_displayText), rItem.m_aDisplayText);
2591 xAttributes->add(
FSNS(XML_w, XML_value), rItem.m_aValue);
2592 m_pSerializer->singleElementNS(XML_w, XML_listItem, xAttributes);
2607 if (aCurrentDate.isEmpty())
2613 m_pSerializer->startElementNS(XML_w, XML_date,
FSNS(XML_w, XML_fullDate), aCurrentDate);
2615 OUString aDateFormat =
m_pContentControl->GetDateFormat().replaceAll(
"\"",
"'");
2616 if (!aDateFormat.isEmpty())
2622 if (!aDateLanguage.isEmpty())
2638 const OUString& rPrefixMapping =
m_pContentControl->GetDataBindingPrefixMappings();
2640 if (!rXpath.isEmpty())
2645 if (pTextNode && pTextAttr)
2649 SwPaM aPam(aMark, aPoint);
2650 OUString aSnippet = aPam.
GetText();
2670 OUString
const& rName,
2671 OUString
const& rSelected,
2672 uno::Sequence<OUString>
const& rListItems)
2678 FSNS(XML_w, XML_val), rName);
2687 FSNS(XML_w, XML_lastValue), OString::number(
nId));
2689 for (
auto const& rItem : rListItems)
2693 FSNS(XML_w, XML_value), item,
2694 FSNS(XML_w, XML_displayText), item);
2704 uno::Sequence<OUString>
const& rListItems)
2715 if (rListItems.size())
2738 FieldMarkParamsHelper params(rFieldmark);
2741 OUString sCurrentDate;
2743 if(!sCurrentDate.isEmpty())
2745 sFullDate = sCurrentDate +
"T00:00:00Z";
2756 OUString sDateFormat;
2761 uno::Sequence<beans::PropertyValue> aSdtParams;
2795 FSNS( XML_w, XML_fldCharType ),
"begin" );
2811 FSNS( XML_w, XML_fldCharType ),
"begin",
2812 FSNS( XML_w, XML_fldLock ),
"true" );
2817 FSNS( XML_w, XML_fldCharType ),
"begin" );
2847 sal_Int32 nTextToken = XML_instrText;
2849 nTextToken = XML_delInstrText;
2851 m_pSerializer->startElementNS(XML_w, nTextToken,
FSNS(XML_xml, XML_space),
"preserve");
2862 bool bWriteCombChars(
false);
2866 bWriteCombChars =
true;
2871 sal_Int32 nIdx { rInfos.
sCmd.isEmpty() ? -1 : 0 };
2874 OUString sToken = rInfos.
sCmd.getToken( 0,
'\t', nIdx );
2881 sToken = sToken.replaceAll(
"NNNN",
"dddd");
2882 sToken = sToken.replaceAll(
"NN",
"ddd");
2887 bool bIsChanged =
true;
2892 OUString sActualFormula = sToken.trim();
2893 const std::map<OUString, uno::Any>& rGrabBag = pItem->GetGrabBag();
2894 std::map<OUString, uno::Any>::const_iterator aStoredFormula = rGrabBag.find(
"CellFormulaConverted");
2895 if ( aStoredFormula != rGrabBag.end() && sActualFormula.indexOf(
'=') == 0 &&
2898 aStoredFormula = rGrabBag.find(
"CellFormula");
2899 if ( aStoredFormula != rGrabBag.end() )
2901 sToken =
" =" + aStoredFormula->second.get<OUString>();
2910 UErrorCode nErr(U_ZERO_ERROR);
2911 icu::UnicodeString sInput(sToken.getStr());
2913 icu::RegexMatcher aMatcher(
"<([A-Z]{1,3}[0-9]+(:[A-Z]{1,3}[0-9]+)?)>", sInput, 0, nErr);
2914 sInput = aMatcher.replaceAll(icu::UnicodeString(
"$1"), nErr);
2916 icu::RegexMatcher aMatcher2(
"\\bMEAN\\b", sInput, UREGEX_CASE_INSENSITIVE, nErr);
2917 sToken = aMatcher2.replaceAll(icu::UnicodeString(
"AVERAGE"), nErr).getTerminatedBuffer();
2936 sal_Int32
const nPos,
bool const bWriteRun)
2946 FSNS( XML_w, XML_fldCharType ),
"separate" );
3070 sExpand = rInfos.
pField->ExpandField(
true,
nullptr);
3073 RunText(sExpand.replace(0x0A, 0x0B));
3092 m_pSerializer->singleElementNS(XML_w, XML_fldChar,
FSNS(XML_w, XML_fldCharType),
"end");
3103 sal_uInt16 nSubType = rInfos.
pField->GetSubType( );
3118 FSNS( XML_w, XML_fldCharType ),
"begin" );
3122 rInfos.
sCmd +=
"\"";
3124 rInfos.
sCmd +=
"\" ";
3167 static const sal_Int32 aOrder[] =
3169 FSNS( XML_w, XML_rStyle ),
3170 FSNS( XML_w, XML_rFonts ),
3171 FSNS( XML_w, XML_b ),
3172 FSNS( XML_w, XML_bCs ),
3173 FSNS( XML_w, XML_i ),
3174 FSNS( XML_w, XML_iCs ),
3175 FSNS( XML_w, XML_caps ),
3176 FSNS( XML_w, XML_smallCaps ),
3177 FSNS( XML_w, XML_strike ),
3178 FSNS( XML_w, XML_dstrike ),
3179 FSNS( XML_w, XML_outline ),
3180 FSNS( XML_w, XML_shadow ),
3181 FSNS( XML_w, XML_emboss ),
3182 FSNS( XML_w, XML_imprint ),
3183 FSNS( XML_w, XML_noProof ),
3184 FSNS( XML_w, XML_snapToGrid ),
3185 FSNS( XML_w, XML_vanish ),
3186 FSNS( XML_w, XML_webHidden ),
3187 FSNS( XML_w, XML_color ),
3188 FSNS( XML_w, XML_spacing ),
3189 FSNS( XML_w, XML_w ),
3190 FSNS( XML_w, XML_kern ),
3191 FSNS( XML_w, XML_position ),
3192 FSNS( XML_w, XML_sz ),
3193 FSNS( XML_w, XML_szCs ),
3194 FSNS( XML_w, XML_highlight ),
3195 FSNS( XML_w, XML_u ),
3196 FSNS( XML_w, XML_effect ),
3197 FSNS( XML_w, XML_bdr ),
3198 FSNS( XML_w, XML_shd ),
3199 FSNS( XML_w, XML_fitText ),
3200 FSNS( XML_w, XML_vertAlign ),
3201 FSNS( XML_w, XML_rtl ),
3202 FSNS( XML_w, XML_cs ),
3203 FSNS( XML_w, XML_em ),
3204 FSNS( XML_w, XML_lang ),
3205 FSNS( XML_w, XML_eastAsianLayout ),
3206 FSNS( XML_w, XML_specVanish ),
3207 FSNS( XML_w, XML_oMath ),
3208 FSNS( XML_w, XML_rPrChange ),
3209 FSNS( XML_w, XML_del ),
3210 FSNS( XML_w, XML_ins ),
3211 FSNS( XML_w, XML_moveFrom ),
3212 FSNS( XML_w, XML_moveTo ),
3213 FSNS( XML_w14, XML_glow ),
3214 FSNS( XML_w14, XML_shadow ),
3215 FSNS( XML_w14, XML_reflection ),
3216 FSNS( XML_w14, XML_textOutline ),
3217 FSNS( XML_w14, XML_textFill ),
3218 FSNS( XML_w14, XML_scene3d ),
3219 FSNS( XML_w14, XML_props3d ),
3220 FSNS( XML_w14, XML_ligatures ),
3221 FSNS( XML_w14, XML_numForm ),
3222 FSNS( XML_w14, XML_numSpacing ),
3223 FSNS( XML_w14, XML_stylisticSets ),
3224 FSNS( XML_w14, XML_cntxtAlts ),
3242const NameToId constNameToIdMapping[] =
3244 { OUString(
"glow"),
FSNS( XML_w14, XML_glow ) },
3245 { OUString(
"shadow"),
FSNS( XML_w14, XML_shadow ) },
3246 { OUString(
"reflection"),
FSNS( XML_w14, XML_reflection ) },
3247 { OUString(
"textOutline"),
FSNS( XML_w14, XML_textOutline ) },
3248 { OUString(
"textFill"),
FSNS( XML_w14, XML_textFill ) },
3249 { OUString(
"scene3d"),
FSNS( XML_w14, XML_scene3d ) },
3250 { OUString(
"props3d"),
FSNS( XML_w14, XML_props3d ) },
3251 { OUString(
"ligatures"),
FSNS( XML_w14, XML_ligatures ) },
3252 { OUString(
"numForm"),
FSNS( XML_w14, XML_numForm ) },
3253 { OUString(
"numSpacing"),
FSNS( XML_w14, XML_numSpacing ) },
3254 { OUString(
"stylisticSets"),
FSNS( XML_w14, XML_stylisticSets ) },
3255 { OUString(
"cntxtAlts"),
FSNS( XML_w14, XML_cntxtAlts ) },
3257 { OUString(
"val"),
FSNS( XML_w14, XML_val ) },
3258 { OUString(
"rad"),
FSNS( XML_w14, XML_rad ) },
3259 { OUString(
"blurRad"),
FSNS( XML_w14, XML_blurRad ) },
3260 { OUString(
"stA"),
FSNS( XML_w14, XML_stA ) },
3261 { OUString(
"stPos"),
FSNS( XML_w14, XML_stPos ) },
3262 { OUString(
"endA"),
FSNS( XML_w14, XML_endA ) },
3263 { OUString(
"endPos"),
FSNS( XML_w14, XML_endPos ) },
3264 { OUString(
"dist"),
FSNS( XML_w14, XML_dist ) },
3265 { OUString(
"dir"),
FSNS( XML_w14, XML_dir ) },
3266 { OUString(
"fadeDir"),
FSNS( XML_w14, XML_fadeDir ) },
3267 { OUString(
"sx"),
FSNS( XML_w14, XML_sx ) },
3268 { OUString(
"sy"),
FSNS( XML_w14, XML_sy ) },
3269 { OUString(
"kx"),
FSNS( XML_w14, XML_kx ) },
3270 { OUString(
"ky"),
FSNS( XML_w14, XML_ky ) },
3271 { OUString(
"algn"),
FSNS( XML_w14, XML_algn ) },
3272 { OUString(
"w"),
FSNS( XML_w14, XML_w ) },
3273 { OUString(
"cap"),
FSNS( XML_w14, XML_cap ) },
3274 { OUString(
"cmpd"),
FSNS( XML_w14, XML_cmpd ) },
3275 { OUString(
"pos"),
FSNS( XML_w14, XML_pos ) },
3276 { OUString(
"ang"),
FSNS( XML_w14, XML_ang ) },
3277 { OUString(
"scaled"),
FSNS( XML_w14, XML_scaled ) },
3278 { OUString(
"path"),
FSNS( XML_w14, XML_path ) },
3279 { OUString(
"l"),
FSNS( XML_w14, XML_l ) },
3280 { OUString(
"t"),
FSNS( XML_w14, XML_t ) },
3281 { OUString(
"r"),
FSNS( XML_w14, XML_r ) },
3282 { OUString(
"b"),
FSNS( XML_w14, XML_b ) },
3283 { OUString(
"lim"),
FSNS( XML_w14, XML_lim ) },
3284 { OUString(
"prst"),
FSNS( XML_w14, XML_prst ) },
3285 { OUString(
"rig"),
FSNS( XML_w14, XML_rig ) },
3286 { OUString(
"lat"),
FSNS( XML_w14, XML_lat ) },
3287 { OUString(
"lon"),
FSNS( XML_w14, XML_lon ) },
3288 { OUString(
"rev"),
FSNS( XML_w14, XML_rev ) },
3289 { OUString(
"h"),
FSNS( XML_w14, XML_h ) },
3290 { OUString(
"extrusionH"),
FSNS( XML_w14, XML_extrusionH ) },
3291 { OUString(
"contourW"),
FSNS( XML_w14, XML_contourW ) },
3292 { OUString(
"prstMaterial"),
FSNS( XML_w14, XML_prstMaterial ) },
3293 { OUString(
"id"),
FSNS( XML_w14, XML_id ) },
3295 { OUString(
"schemeClr"),
FSNS( XML_w14, XML_schemeClr ) },
3296 { OUString(
"srgbClr"),
FSNS( XML_w14, XML_srgbClr ) },
3297 { OUString(
"tint"),
FSNS( XML_w14, XML_tint ) },
3298 { OUString(
"shade"),
FSNS( XML_w14, XML_shade ) },
3299 { OUString(
"alpha"),
FSNS( XML_w14, XML_alpha ) },
3300 { OUString(
"hueMod"),
FSNS( XML_w14, XML_hueMod ) },
3301 { OUString(
"sat"),
FSNS( XML_w14, XML_sat ) },
3302 { OUString(
"satOff"),
FSNS( XML_w14, XML_satOff ) },
3303 { OUString(
"satMod"),
FSNS( XML_w14, XML_satMod ) },
3304 { OUString(
"lum"),
FSNS( XML_w14, XML_lum ) },
3305 { OUString(
"lumOff"),
FSNS( XML_w14, XML_lumOff ) },
3306 { OUString(
"lumMod"),
FSNS( XML_w14, XML_lumMod ) },
3307 { OUString(
"noFill"),
FSNS( XML_w14, XML_noFill ) },
3308 { OUString(
"solidFill"),
FSNS( XML_w14, XML_solidFill ) },
3309 { OUString(
"gradFill"),
FSNS( XML_w14, XML_gradFill ) },
3310 { OUString(
"gsLst"),
FSNS( XML_w14, XML_gsLst ) },
3311 { OUString(
"gs"),
FSNS( XML_w14, XML_gs ) },
3312 { OUString(
"pos"),
FSNS( XML_w14, XML_pos ) },
3313 { OUString(
"lin"),
FSNS( XML_w14, XML_lin ) },
3314 { OUString(
"path"),
FSNS( XML_w14, XML_path ) },
3315 { OUString(
"fillToRect"),
FSNS( XML_w14, XML_fillToRect ) },
3316 { OUString(
"prstDash"),
FSNS( XML_w14, XML_prstDash ) },
3317 { OUString(
"round"),
FSNS( XML_w14, XML_round ) },
3318 { OUString(
"bevel"),
FSNS( XML_w14, XML_bevel ) },
3319 { OUString(
"miter"),
FSNS( XML_w14, XML_miter ) },
3320 { OUString(
"camera"),
FSNS( XML_w14, XML_camera ) },
3321 { OUString(
"lightRig"),
FSNS( XML_w14, XML_lightRig ) },
3322 { OUString(
"rot"),
FSNS( XML_w14, XML_rot ) },
3323 { OUString(
"bevelT"),
FSNS( XML_w14, XML_bevelT ) },
3324 { OUString(
"bevelB"),
FSNS( XML_w14, XML_bevelB ) },
3325 { OUString(
"extrusionClr"),
FSNS( XML_w14, XML_extrusionClr ) },
3326 { OUString(
"contourClr"),
FSNS( XML_w14, XML_contourClr ) },
3327 { OUString(
"styleSet"),
FSNS( XML_w14, XML_styleSet ) },
3330std::optional<sal_Int32> lclGetElementIdForName(std::u16string_view rName)
3332 for (
auto const & i : constNameToIdMapping)
3334 if (rName ==
i.maName)
3339 return std::optional<sal_Int32>();
3342void lclProcessRecursiveGrabBag(sal_Int32 aElementId,
const css::uno::Sequence<css::beans::PropertyValue>& rElements,
sax_fastparser::FSHelperPtr const & pSerializer)
3344 css::uno::Sequence<css::beans::PropertyValue> aAttributes;
3347 for (
const auto& rElement : rElements)
3349 if (rElement.Name ==
"attributes")
3351 rElement.Value >>= aAttributes;
3355 for (
const auto& rAttribute : std::as_const(aAttributes))
3362 aValue = OString::number(aAny.get<sal_Int32>());
3369 std::optional<sal_Int32> aSubElementId = lclGetElementIdForName(rAttribute.Name);
3371 pAttributes->add(*aSubElementId, aValue);
3374 pSerializer->startElement(aElementId, pAttributes);
3376 for (
const auto& rElement : rElements)
3378 css::uno::Sequence<css::beans::PropertyValue> aSumElements;
3380 std::optional<sal_Int32> aSubElementId = lclGetElementIdForName(rElement.Name);
3383 rElement.Value >>= aSumElements;
3384 lclProcessRecursiveGrabBag(*aSubElementId, aSumElements, pSerializer);
3388 pSerializer->endElement(aElementId);
3419 std::string_view pVal;
3421 if (!pVal.empty() && pVal !=
"auto")
3425 m_pSerializer->startElementNS(XML_w14, XML_srgbClr,
FSNS(XML_w14, XML_val), pVal.data());
3427 m_pSerializer->singleElementNS(XML_w14, XML_alpha,
FSNS(XML_w14, XML_val), OString::number(nTransparence));
3437 std::optional<sal_Int32> aElementId = lclGetElementIdForName(
i.Name);
3440 uno::Sequence<beans::PropertyValue> aGrabBagSeq;
3441 i.Value >>= aGrabBagSeq;
3442 lclProcessRecursiveGrabBag(*aElementId, aGrabBagSeq,
m_pSerializer);
3494 uno::Reference<drawing::XShape> xShape(
const_cast<SdrObject*
>(pSdrObj)->getUnoShape());
3495 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY );
3496 if( !xPropSet.is() )
3499 uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
3500 uno::Sequence< beans::PropertyValue > aGrabBag;
3501 if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(
"FrameInteropGrabBag"))
3503 xPropSet->getPropertyValue(
"FrameInteropGrabBag") >>= aGrabBag;
3505 else if(xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(
"InteropGrabBag"))
3507 xPropSet->getPropertyValue(
"InteropGrabBag") >>= aGrabBag;
3510 auto pProp = std::find_if(std::cbegin(aGrabBag), std::cend(aGrabBag),
3511 [
this](
const beans::PropertyValue& rProp) {
3513 if (pProp != std::cend(aGrabBag))
3522 rPostponedDiagram.pSdrObj);
3547 m_pSerializer->singleElementNS(XML_w, XML_rStyle,
FSNS(XML_w, XML_val), aStyleId);
3567 const OUString& rSymbolFont = OUString() )
3575 if ( pBegin >= pEnd )
3578 bool bIsSymbol = !rSymbolFont.isEmpty();
3580 std::u16string_view aView( pBegin, pEnd - pBegin );
3583 for (
char16_t aChar : aView)
3585 pSerializer->singleElementNS(XML_w, XML_sym,
3586 FSNS(XML_w, XML_font), rSymbolFont,
3587 FSNS(XML_w, XML_char), OString::number(aChar, 16));
3593 if ( *pBegin ==
' ' || *( pEnd - 1 ) ==
' ' )
3594 pSerializer->startElementNS(XML_w, nTextToken,
FSNS(XML_xml, XML_space),
"preserve");
3596 pSerializer->startElementNS(XML_w, nTextToken);
3598 pSerializer->writeEscaped( aView );
3599 pSerializer->endElementNS( XML_w, nTextToken );
3614 const sal_Unicode *pEnd = pBegin + rText.getLength();
3617 sal_Int32 nTextToken = XML_t;
3625 nTextToken = XML_delText;
3630 for (
const sal_Unicode *pIt = pBegin; pIt < pEnd; ++pIt )
3640 case static_cast<sal_Unicode>(text::ControlCharacter::LINE_BREAK):
3660 if ( *pIt < 0x0020 )
3663 SAL_INFO(
"sw.ww8",
"Ignored control code in a text run: " <<
unsigned(*pIt) );
3681 SAL_INFO(
"sw.ww8",
"TODO DocxAttributeOutput::StartRuby( const SwTextNode& rNode, const SwFormatRuby& rRuby )" );
3690 FSNS( XML_w, XML_val ), lclConvertWW8JCToOOXMLRubyAlign(aWW8Ruby.
GetJC()) );
3692 sal_uInt32 nHpsBaseText = (aWW8Ruby.
GetBaseHeight() + 5) / 10;
3693 m_pSerializer->singleElementNS(XML_w, XML_hps,
FSNS(XML_w, XML_val), OString::number(nHps));
3696 FSNS( XML_w, XML_val ), OString::number(nHpsBaseText) );
3699 FSNS( XML_w, XML_val ), OString::number(nHpsBaseText) );
3735 SAL_INFO(
"sw.ww8",
"TODO DocxAttributeOutput::EndRuby()" );
3747 if (!pMark->isEmpty() && (bBookMarkOnly ||
rTarget.isEmpty()))
3749 OUString sURL = *pLinkURL;
3751 if ( bBookMarkOnly )
3756 sURL +=
" \\l \"" + *pMark +
"\"";
3764 return bBookMarkOnly;
3782 if (!sMark.isEmpty() && !bBookmarkOnly &&
rTarget.isEmpty())
3791 if ( !bBookmarkOnly )
3798 if (!sMark.isEmpty())
3800 sMark = sMark.replace(
' ',
'_');
3809 if (sMark.endsWith(
"|sequence"))
3811 sal_Int32
nPos = sMark.indexOf(
'!');
3815 OUString aSequenceName = sMark.copy(0,
nPos);
3821 std::vector<OUString>& rNames = it->second;
3822 if (rNames.size() >
nIndex)
3828 else if (sMark.endsWith(
"|toxmark"))
3830 if (
auto const it =
GetExport().m_TOXMarkBookmarksByURL.find(sMark);
3831 it !=
GetExport().m_TOXMarkBookmarksByURL.end())
3837 sMark = sMark.replace(
' ',
'_');
3862 ww::eField const eType, OUString
const*
const pBookmarkName)
3872 if ( !pRedlineData )
3878 OString aId( OString::number( pRedlineData->
GetSeqNo() ) );
3879 const OUString &rAuthor(
SW_MOD()->GetRedlineAuthor( pRedlineData->
GetAuthor() ) );
3881 bool bNoDate = bRemovePersonalInfo ||
3884 switch( pRedlineData->
GetType() )
3886 case RedlineType::Insert:
3889 case RedlineType::Delete:
3892 case RedlineType::Format:
3897 pAttributeList->add(
FSNS( XML_w, XML_id ), aId);
3898 pAttributeList->add(
FSNS( XML_w, XML_author ), bRemovePersonalInfo
3899 ?
"Author" + OString::number(
GetExport().GetInfoID(rAuthor) )
3900 : rAuthor.toUtf8());
3903 m_pSerializer->startElementNS( XML_w, XML_rPrChange, pAttributeList );
3912 if (pFormattingChanges)
3936 case RedlineType::ParagraphFormat:
3941 pAttributeList->add(
FSNS( XML_w, XML_id ), aId);
3942 pAttributeList->add(
FSNS( XML_w, XML_author ), bRemovePersonalInfo
3943 ?
"Author" + OString::number(
GetExport().GetInfoID(rAuthor) )
3944 : rAuthor.toUtf8());
3947 m_pSerializer->startElementNS( XML_w, XML_pPrChange, pAttributeList );
3956 if (pFormattingChanges)
3960 const OUString & sParaStyleName = pFormattingChanges->
GetFormatName();
3961 if (pChangesSet || !sParaStyleName.isEmpty())
3967 if (!sParaStyleName.isEmpty())
3976 if (sStyleName.isEmpty())
3978 if (!sStyleName.isEmpty())
3979 m_pSerializer->singleElementNS(XML_w, XML_pStyle,
FSNS(XML_w, XML_val), sStyleName);
4023 if ( !pRedlineData )
4035 const OUString &rAuthor(
SW_MOD()->GetRedlineAuthor( pRedlineData->
GetAuthor() ) );
4037 ?
"Author" + OUString::number(
GetExport().GetInfoID(rAuthor) )
4038 : rAuthor, RTL_TEXTENCODING_UTF8 ) );
4041 bool bNoDate = bRemovePersonalInfo ||
4043 bool bMoved = pRedlineData->
IsMoved() &&
4046 switch ( pRedlineData->
GetType() )
4048 case RedlineType::Insert:
4049 case RedlineType::Delete:
4051 sal_Int32 eElement = RedlineType::Insert == pRedlineData->
GetType()
4052 ? ( bMoved ? XML_moveTo : XML_ins )
4053 : ( bMoved ? XML_moveFrom : XML_del );
4056 FSNS( XML_w, XML_id ), aId,
4057 FSNS( XML_w, XML_author ), aAuthor );
4060 FSNS( XML_w, XML_id ), aId,
4061 FSNS( XML_w, XML_author ), aAuthor,
4065 case RedlineType::Format:
4066 SAL_INFO(
"sw.ww8",
"TODO DocxAttributeOutput::StartRedline()" );
4078 bool bMoved = pRedlineData->
IsMoved() &&
4081 switch ( pRedlineData->
GetType() )
4083 case RedlineType::Insert:
4084 m_pSerializer->endElementNS( XML_w, bMoved ? XML_moveTo : XML_ins );
4087 case RedlineType::Delete:
4088 m_pSerializer->endElementNS( XML_w, bMoved ? XML_moveFrom : XML_del );
4091 case RedlineType::Format:
4092 SAL_INFO(
"sw.ww8",
"TODO DocxAttributeOutput::EndRedline()" );
4105 SAL_INFO(
"sw.ww8",
"TODO DocxAttributeOutput::FormatDrop( const SwTextNode& rNode, const SwFormatDrop& rSwFormatDrop, sal_uInt16 nStyle )" );
4112 m_pSerializer->singleElementNS(XML_w, XML_pStyle,
FSNS(XML_w, XML_val), aStyleId);
4116 bool bWriteShadow,
const table::BorderLine2* pStyleProps =
nullptr)
4125 const char* pVal =
"nil";
4126 if ( pBorderLine && !pBorderLine->isEmpty( ) )
4128 switch (pBorderLine->GetBorderLineStyle())
4130 case SvxBorderLineStyle::SOLID:
4133 case SvxBorderLineStyle::DOTTED:
4136 case SvxBorderLineStyle::DASHED:
4139 case SvxBorderLineStyle::DOUBLE:
4140 case SvxBorderLineStyle::DOUBLE_THIN:
4143 case SvxBorderLineStyle::THINTHICK_SMALLGAP:
4144 pVal =
"thinThickSmallGap";
4146 case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
4147 pVal =
"thinThickMediumGap";
4149 case SvxBorderLineStyle::THINTHICK_LARGEGAP:
4150 pVal =
"thinThickLargeGap";
4152 case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
4153 pVal =
"thickThinSmallGap";
4155 case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
4156 pVal =
"thickThinMediumGap";
4158 case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
4159 pVal =
"thickThinLargeGap";
4161 case SvxBorderLineStyle::EMBOSSED:
4162 pVal =
"threeDEmboss";
4164 case SvxBorderLineStyle::ENGRAVED:
4165 pVal =
"threeDEngrave";
4167 case SvxBorderLineStyle::OUTSET:
4170 case SvxBorderLineStyle::INSET:
4173 case SvxBorderLineStyle::FINE_DASHED:
4174 pVal =
"dashSmallGap";
4176 case SvxBorderLineStyle::DASH_DOT:
4179 case SvxBorderLineStyle::DASH_DOT_DOT:
4180 pVal =
"dotDotDash";
4182 case SvxBorderLineStyle::NONE:
4187 else if (!pStyleProps || !pStyleProps->LineWidth)
4195 if (pStyleProps && pBorderLine && !pBorderLine->isEmpty()
4196 && pBorderLine->GetBorderLineStyle()
4205 pAttr->add(
FSNS( XML_w, XML_val ), pVal );
4207 if ( pBorderLine && !pBorderLine->isEmpty() )
4211 double const fConverted( ::editeng::ConvertBorderWidthToWord(
4212 pBorderLine->GetBorderLineStyle(), pBorderLine->GetWidth()));
4214 sal_Int32 nWidth = sal_Int32( fConverted / 2.5 );
4215 const sal_Int32 nMinWidth = 2;
4216 const sal_Int32 nMaxWidth = 96;
4218 if ( nWidth > nMaxWidth )
4220 else if ( nWidth < nMinWidth )
4223 pAttr->add(
FSNS( XML_w, XML_sz ), OString::number( nWidth ) );
4226 pAttr->add(
FSNS(XML_w, XML_space), OString::number(rtl::math::round(nDist / 20.0)));
4230 pAttr->add(
FSNS( XML_w, XML_color ),
sColor );
4236 pAttr->add(
FSNS( XML_w, XML_shadow ),
"1" );
4239 pSerializer->singleElementNS( XML_w, elementToken, pAttr );
4246 rOptions.
tag = XML_tcBorders;
4258 rOptions.
tag = XML_pBdr;
4270 css::table::BorderLine2> &rTableStyleConf,
4275 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
4278 const sal_Int32 aXmlElements[] =
4285 bool tagWritten =
false;
4288 for(
int i = 0;
i < 4; ++
i, ++pBrd )
4290 const SvxBorderLine* pLn = rBox.
GetLine( *pBrd );
4291 const table::BorderLine2 *aStyleProps =
nullptr;
4292 if( rTableStyleConf.find( *pBrd ) != rTableStyleConf.end() )
4293 aStyleProps = &rTableStyleConf[ *pBrd ];
4297 pSerializer->startElementNS(XML_w, rOptions.
tag);
4301 bool bWriteShadow =
false;
4314 bWriteShadow =
true;
4321 ((rOptions.
aShadowLocation == SvxShadowLocation::TopLeft || rOptions.
aShadowLocation == SvxShadowLocation::TopRight ) && *pBrd == SvxBoxItemLine::TOP ) ||
4322 ((rOptions.
aShadowLocation == SvxShadowLocation::TopLeft || rOptions.
aShadowLocation == SvxShadowLocation::BottomLeft) && *pBrd == SvxBoxItemLine::LEFT ) ||
4323 ((rOptions.
aShadowLocation == SvxShadowLocation::BottomLeft ) && *pBrd == SvxBoxItemLine::BOTTOM) ||
4324 ((rOptions.
aShadowLocation == SvxShadowLocation::TopRight ) && *pBrd == SvxBoxItemLine::RIGHT )
4327 bWriteShadow =
true;
4331 sal_uInt16 nDist = 0;
4336 if ( *pBrd == SvxBoxItemLine::TOP)
4338 else if ( *pBrd == SvxBoxItemLine::LEFT)
4340 else if ( *pBrd == SvxBoxItemLine::BOTTOM)
4342 else if ( *pBrd == SvxBoxItemLine::RIGHT)
4364 && (*pBrd == SvxBoxItemLine::LEFT || *pBrd == SvxBoxItemLine::RIGHT))
4376 pLn = rFramePrBox.
GetLine(*pBrd);
4379 impl_borderLine( pSerializer, aXmlElements[
i], pLn, nDist, bWriteShadow, aStyleProps );
4382 pSerializer->endElementNS( XML_w, rOptions.
tag );
4390 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
4393 const sal_Int32 aXmlElements[] =
4396 bUseStartEnd ? XML_start : XML_left,
4398 bUseStartEnd ? XML_end : XML_right
4400 bool tagWritten =
false;
4402 for(
int i = 0;
i < 4; ++
i, ++pBrd )
4404 sal_Int32 nDist = sal_Int32( rBox.
GetDistance( *pBrd ) );
4406 if (pDefaultMargins)
4409 if (sal_Int32( pDefaultMargins->
GetDistance( *pBrd ) ) == nDist)
4414 pSerializer->startElementNS(XML_w, tag);
4417 pSerializer->singleElementNS( XML_w, aXmlElements[
i],
4418 FSNS( XML_w, XML_w ), OString::number(nDist),
4422 pSerializer->endElementNS( XML_w, tag );
4430 const SwTableBox *pTableBox = pTableTextNodeInfoInner->getTableBox( );
4440 nWidth = nWidth -
GetGridCols( pTableTextNodeInfoInner )->at( nCell - 1 );
4442 FSNS( XML_w, XML_w ), OString::number(nWidth),
4447 if (nRow >= rRows.
size())
4448 SAL_WARN(
"sw.ww8",
"DocxAttributeOutput::TableCellProperties: out of range row: " << nRow);
4453 if (nCell < rTableCells.size() )
4456 const sal_uInt16 nColSpan = rCell.
GetColSpan();
4459 FSNS( XML_w, XML_val ), OString::number(nColSpan) );
4465 sal_Int32 vSpan = (*xRowSpans)[nCell];
4468 m_pSerializer->singleElementNS(XML_w, XML_vMerge,
FSNS(XML_w, XML_val),
"restart");
4470 else if ( vSpan < 0 )
4472 m_pSerializer->singleElementNS(XML_w, XML_vMerge,
FSNS(XML_w, XML_val),
"continue");
4477 const std::map<OUString, uno::Any>& rGrabBag = pItem->GetGrabBag();
4478 std::map<OUString, uno::Any>::const_iterator it = rGrabBag.find(
"CellCnfStyle");
4479 if (it != rGrabBag.end())
4481 uno::Sequence<beans::PropertyValue> aAttributes = it->second.get< uno::Sequence<beans::PropertyValue> >();
4509 const SwTable* pTable = pTableTextNodeInfoInner->getTable();
4514 bool bRelBoxSize =
false;
4577 const SwTable *pTable = pTableTextNodeInfoInner->getTable( );
4578 if ( pTable->
GetRowsToRepeat( ) > pTableTextNodeInfoInner->getRow( ) )
4579 m_pSerializer->singleElementNS(XML_w, XML_tblHeader,
FSNS(XML_w, XML_val),
"true");
4585 const SwTableBox *pTableBox = pTableTextNodeInfoInner->getTableBox();
4589 const std::map<OUString, uno::Any>& rGrabBag = pItem->GetGrabBag();
4590 std::map<OUString, uno::Any>::const_iterator it = rGrabBag.find(
"RowCnfStyle");
4591 if (it != rGrabBag.end())
4593 uno::Sequence<beans::PropertyValue> aAttributes = it->second.get< uno::Sequence<beans::PropertyValue> >();
4640 FSNS( XML_xmlns, XML_w ),
GetExport().GetFilter().getNamespaceURL(OOX_NS(doc)),
4641 FSNS( XML_xmlns, XML_w14 ),
GetExport().GetFilter().getNamespaceURL(OOX_NS(w14)),
4642 FSNS( XML_xmlns, XML_mc ),
GetExport().GetFilter().getNamespaceURL(OOX_NS(mce)),
4643 FSNS( XML_mc, XML_Ignorable ),
"w14" );
4665 {
"defQFormat", XML_defQFormat},
4666 {
"defUnhideWhenUsed", XML_defUnhideWhenUsed},
4667 {
"defSemiHidden", XML_defSemiHidden},
4668 {
"count", XML_count},
4669 {
"defUIPriority", XML_defUIPriority},
4670 {
"defLockedState", XML_defLockedState},
4676 {
"locked", XML_locked},
4677 {
"uiPriority", XML_uiPriority},
4678 {
"semiHidden", XML_semiHidden},
4679 {
"unhideWhenUsed", XML_unhideWhenUsed},
4680 {
"qFormat", XML_qFormat},
4690 uno::Sequence<beans::PropertyValue> aInteropGrabBag;
4691 xPropertySet->getPropertyValue(
"InteropGrabBag") >>= aInteropGrabBag;
4692 uno::Sequence<beans::PropertyValue> aLatentStyles;
4693 auto pProp = std::find_if(std::cbegin(aInteropGrabBag), std::cend(aInteropGrabBag),
4694 [](
const beans::PropertyValue& rProp) {
return rProp.Name ==
"latentStyles"; });
4695 if (pProp != std::cend(aInteropGrabBag))
4696 pProp->Value >>= aLatentStyles;
4697 if (!aLatentStyles.hasElements())
4702 uno::Sequence<beans::PropertyValue> aLsdExceptions;
4703 for (
const auto& rLatentStyle : std::as_const(aLatentStyles))
4706 pAttributeList->add(
FSNS(XML_w,
nToken), rLatentStyle.Value.get<OUString>());
4707 else if (rLatentStyle.Name ==
"lsdExceptions")
4708 rLatentStyle.Value >>= aLsdExceptions;
4711 m_pSerializer->startElementNS(XML_w, XML_latentStyles, detachFrom(pAttributeList));
4714 for (
const auto& rLsdException : std::as_const(aLsdExceptions))
4716 pAttributeList = FastSerializerHelper::createAttrList();
4718 uno::Sequence<beans::PropertyValue> aAttributes;
4719 rLsdException.Value >>= aAttributes;
4720 for (
const auto& rAttribute : std::as_const(aAttributes))
4722 pAttributeList->add(
FSNS(XML_w,
nToken), rAttribute.Value.get<OUString>());
4724 m_pSerializer->singleElementNS(XML_w, XML_lsdException, detachFrom(pAttributeList));
4732 bool bMustWrite =
true;
4733 switch (rHt.
Which())
4748 bMustWrite =
static_cast< const SvxEscapementItem&
>(rHt).GetEscapement() != SvxEscapement::Off;
4826 bMustWrite =
static_cast< const SvxEmphasisMarkItem&
>(rHt).GetEmphasisMark() != FontEmphasisMark::NONE;
4859 bMustWrite =
static_cast< const SvxLineSpacingItem&
>(rHt).GetInterLineSpaceRule() != SvxInterLineSpaceRule::Off;
4862 bMustWrite =
static_cast< const SvxAdjustItem&
>(rHt).GetAdjust() != SvxAdjust::Left;
4899 SAL_INFO(
"sw.ww8",
"Unhandled SfxPoolItem with id " << rHt.
Which() );
4953 SAL_INFO(
"sw.ww8",
"TODO DocxAttributeOutput::DefaultStyle()");
4960 const css::uno::Reference<css::beans::XPropertySet>& xShapePropSet,
4963 uno::Reference<graphic::XGraphic> xGraphic;
4964 xShapePropSet->getPropertyValue(
"Graphic") >>= xGraphic;
4965 const Graphic aGraphic(xGraphic);
4969 const MapMode aMap100mm( MapUnit::Map100thMM );
4971 if (rMapMode.
GetMapUnit() == MapUnit::MapPixel)
4976 css::text::GraphicCrop aGraphicCropStruct;
4977 xShapePropSet->getPropertyValue(
"GraphicCrop") >>= aGraphicCropStruct;
4978 sal_Int32 nCropL = aGraphicCropStruct.Left;
4979 sal_Int32 nCropR = aGraphicCropStruct.Right;
4980 sal_Int32 nCropT = aGraphicCropStruct.Top;
4981 sal_Int32 nCropB = aGraphicCropStruct.Bottom;
4987 nCropL -= pBoxItem->
GetDistance( SvxBoxItemLine::LEFT );
4988 nCropR -= pBoxItem->
GetDistance( SvxBoxItemLine::RIGHT );
4989 nCropT -= pBoxItem->
GetDistance( SvxBoxItemLine::TOP );
4990 nCropB -= pBoxItem->
GetDistance( SvxBoxItemLine::BOTTOM );
4993 if ( !((0 != nCropL) || (0 != nCropT) || (0 != nCropR) || (0 != nCropB)) )
4996 double widthMultiplier = 100000.0/aOriginalSize.
Width();
4997 double heightMultiplier = 100000.0/aOriginalSize.
Height();
4999 sal_Int32
left =
static_cast<sal_Int32
>(rtl::math::round(nCropL * widthMultiplier));
5000 sal_Int32
right =
static_cast<sal_Int32
>(rtl::math::round(nCropR * widthMultiplier));
5001 sal_Int32
top =
static_cast<sal_Int32
>(rtl::math::round(nCropT * heightMultiplier));
5002 sal_Int32
bottom =
static_cast<sal_Int32
>(rtl::math::round(nCropB * heightMultiplier));
5005 XML_l, OString::number(
left),
5006 XML_t, OString::number(
top),
5007 XML_r, OString::number(
right),
5008 XML_b, OString::number(
bottom) );
5012 css::uno::Reference<css::drawing::XShape> xShape)
5018 DocxExport & rExport,
int const nAnchorId, std::u16string_view
const& rName,
5019 std::u16string_view
const& rTitle, std::u16string_view
const& rDescription)
5022 pAttrs->add(XML_id, OString::number(nAnchorId));
5023 pAttrs->add(XML_name, rName);
5026 pAttrs->add(XML_descr, rDescription);
5027 pAttrs->add(XML_title, rTitle);
5031 OUString
const value(rTitle.empty()
5032 ? OUString(rDescription)
5033 : rDescription.empty()
5035 : OUString::Concat(rTitle) +
"\n" + rDescription);
5036 pAttrs->add(XML_descr,
value);
5043 SAL_INFO(
"sw.ww8",
"TODO DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrameFormat* pOLEFrameFormat, SwOLENode* pOLENode, const SdrObject* pSdrObj ) - some stuff still missing" );
5048 assert(pGrfNode || (pOLEFrameFormat && pOLENode));
5052 sal_Int32 nImageType;
5059 sal_Int32
const nFragment(aFileName.indexOf(
'#'));
5060 sal_Int32
const nForbiddenU(aFileName.indexOf(
"%5C"));
5061 sal_Int32
const nForbiddenL(aFileName.indexOf(
"%5c"));
5062 if ( (nForbiddenU != -1 && (nFragment == -1 || nForbiddenU < nFragment))
5063 || (nForbiddenL != -1 && (nFragment == -1 || nForbiddenL < nFragment)))
5065 SAL_WARN(
"sw.ww8",
"DocxAttributeOutput::FlyFrameGraphic: ignoring image with invalid link URL");
5075 nImageType = XML_link;
5082 aGraphic = pGrfNode->
GetGrf();
5090 nImageType = XML_embed;