24 #include <rtl/ustrbuf.hxx>
27 #include <osl/diagnose.h>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/container/XEnumerationAccess.hpp>
30 #include <com/sun/star/container/XEnumeration.hpp>
31 #include <com/sun/star/container/XIndexReplace.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/beans/XMultiPropertySet.hpp>
34 #include <com/sun/star/beans/XPropertyState.hpp>
35 #include <com/sun/star/graphic/XGraphic.hpp>
36 #include <com/sun/star/text/XTextDocument.hpp>
37 #include <com/sun/star/text/XTextSectionsSupplier.hpp>
38 #include <com/sun/star/text/XTextTablesSupplier.hpp>
39 #include <com/sun/star/text/XNumberingRulesSupplier.hpp>
40 #include <com/sun/star/text/XChapterNumberingSupplier.hpp>
41 #include <com/sun/star/text/XTextTable.hpp>
42 #include <com/sun/star/text/XText.hpp>
43 #include <com/sun/star/text/XTextContent.hpp>
44 #include <com/sun/star/text/XTextRange.hpp>
45 #include <com/sun/star/text/XTextField.hpp>
46 #include <com/sun/star/container/XNamed.hpp>
47 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
48 #include <com/sun/star/text/XTextFrame.hpp>
49 #include <com/sun/star/container/XNameAccess.hpp>
50 #include <com/sun/star/text/SizeType.hpp>
51 #include <com/sun/star/text/HoriOrientation.hpp>
52 #include <com/sun/star/text/VertOrientation.hpp>
53 #include <com/sun/star/text/TextContentAnchorType.hpp>
54 #include <com/sun/star/text/XTextFramesSupplier.hpp>
55 #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
56 #include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
57 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
58 #include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
59 #include <com/sun/star/document/XEventsSupplier.hpp>
60 #include <com/sun/star/document/XRedlinesSupplier.hpp>
61 #include <com/sun/star/text/XFormField.hpp>
62 #include <com/sun/star/text/XTextSection.hpp>
63 #include <com/sun/star/drawing/XShape.hpp>
64 #include <com/sun/star/style/XAutoStylesSupplier.hpp>
65 #include <com/sun/star/style/XAutoStyleFamily.hpp>
66 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
67 #include <com/sun/star/drawing/XControlShape.hpp>
68 #include <com/sun/star/util/DateTime.hpp>
100 #include <com/sun/star/embed/ElementModes.hpp>
101 #include <com/sun/star/embed/XTransactedObject.hpp>
102 #include <com/sun/star/document/XStorageBasedDocument.hpp>
104 #include <com/sun/star/rdf/XMetadatable.hpp>
106 #include <unordered_map>
111 #include <officecfg/Office/Common.hxx>
113 using namespace ::
std;
129 constexpr OUStringLiteral
gsTitle(u
"Title");
133 constexpr OUStringLiteral
gsBookmark(u
"Bookmark");
137 constexpr OUStringLiteral
gsFrame(u
"Frame");
140 constexpr OUStringLiteral
gsHeight(u
"Height");
149 constexpr OUStringLiteral
gsIsStart(u
"IsStart");
155 constexpr OUStringLiteral
gsRedline(u
"Redline");
159 constexpr OUStringLiteral
gsRuby(u
"Ruby");
161 constexpr OUStringLiteral
gsRubyText(u
"RubyText");
162 constexpr OUStringLiteral
gsServerMap(u
"ServerMap");
163 constexpr OUStringLiteral
gsShapeService(u
"com.sun.star.drawing.Shape");
164 constexpr OUStringLiteral
gsSizeType(u
"SizeType");
166 constexpr OUStringLiteral
gsTableService(u
"com.sun.star.text.TextTable");
167 constexpr OUStringLiteral
gsText(u
"Text");
170 constexpr OUStringLiteral
gsTextField(u
"TextField");
179 constexpr OUStringLiteral
gsWidth(u
"Width");
180 constexpr OUStringLiteral
gsWidthType( u
"WidthType" );
191 typedef back_insert_iterator<contents_t> inserter_t;
192 typedef contents_t::const_iterator const_iterator_t;
194 inserter_t getInserter()
195 {
return back_insert_iterator<contents_t>(m_vTextContents); };
196 const_iterator_t getBegin()
const
197 {
return m_vTextContents.begin(); };
198 const_iterator_t getEnd()
const
199 {
return m_vTextContents.end(); };
202 contents_t m_vTextContents;
207 size_t operator()(
const Reference<XTextFrame>& rFrame)
const
208 {
return sal::static_int_cast<
size_t>(
reinterpret_cast<sal_uIntPtr
>(rFrame.get())); }
211 bool lcl_TextContentsUnfiltered(
const Reference<XTextContent>&)
214 bool lcl_ShapeFilter(
const Reference<XTextContent>& xTxtContent)
216 Reference<XShape> xShape(xTxtContent, UNO_QUERY);
219 Reference<XServiceInfo> xServiceInfo(xTxtContent, UNO_QUERY);
220 return !xServiceInfo->supportsService(
"com.sun.star.text.TextFrame") &&
221 !xServiceInfo->supportsService(
"com.sun.star.text.TextGraphicObject") &&
222 !xServiceInfo->supportsService(
"com.sun.star.text.TextEmbeddedObject");
228 typedef bool (*filter_t)(
const Reference<XTextContent>&);
230 const Reference<XEnumerationAccess>& rEnumAccess,
231 const filter_t& rFilter)
232 : m_xEnumAccess(rEnumAccess)
238 const TextContentSet& GetPageBoundContents()
const
239 {
return m_vPageBounds; };
240 const TextContentSet* GetFrameBoundContents(
const Reference<XTextFrame>& rParentFrame)
const
242 framebound_map_t::const_iterator it = m_vFrameBoundsOf.find(rParentFrame);
243 if(it == m_vFrameBoundsOf.end())
245 return &(it->second);
247 Reference<XEnumeration> createEnumeration()
const
249 if(!m_xEnumAccess.is())
250 return Reference<XEnumeration>();
251 return m_xEnumAccess->createEnumeration();
255 typedef std::unordered_map<
256 Reference<XTextFrame>,
258 FrameRefHash> framebound_map_t;
259 TextContentSet m_vPageBounds;
260 framebound_map_t m_vFrameBoundsOf;
261 const Reference<XEnumerationAccess> m_xEnumAccess;
262 void Fill(
const filter_t& rFilter);
265 class FieldParamExporter
268 FieldParamExporter(
SvXMLExport*
const pExport, Reference<XNameContainer>
const & xFieldParams)
270 , m_xFieldParams(xFieldParams)
276 const Reference<XNameContainer> m_xFieldParams;
332 "ParaConditionalStyleName",
341 NUMBERING_RULES_AUTO = 0,
342 PARA_CONDITIONAL_STYLE_NAME_AUTO = 1,
343 PARA_STYLE_NAME_AUTO = 2
351 "NumberingStyleName",
353 "ParaConditionalStyleName",
356 "OutlineContentVisible",
364 NUMBERING_IS_NUMBER = 0,
365 PARA_NUMBERING_STYLENAME = 1,
366 PARA_OUTLINE_LEVEL=2,
367 PARA_CONDITIONAL_STYLE_NAME = 3,
370 PARA_OUTLINE_CONTENT_VISIBLE = 6
375 void BoundFrames::Fill(
const filter_t& rFilter)
377 if(!m_xEnumAccess.is())
379 const Reference< XEnumeration > xEnum = m_xEnumAccess->createEnumeration();
382 const OUString our_sAnchorType(
"AnchorType");
383 const OUString our_sAnchorFrame(
"AnchorFrame");
384 while(xEnum->hasMoreElements())
387 Reference<XTextContent> xTextContent(xPropSet, UNO_QUERY);
388 if(!xPropSet.is() || !xTextContent.is())
390 TextContentAnchorType eAnchor;
391 xPropSet->getPropertyValue(our_sAnchorType) >>= eAnchor;
392 if(TextContentAnchorType_AT_PAGE != eAnchor && TextContentAnchorType_AT_FRAME != eAnchor)
394 if(!rFilter(xTextContent))
397 TextContentSet::inserter_t pInserter = m_vPageBounds.getInserter();
398 if(TextContentAnchorType_AT_FRAME == eAnchor)
400 Reference<XTextFrame> xAnchorTxtFrame(
401 xPropSet->getPropertyValue(our_sAnchorFrame),
403 pInserter = m_vFrameBoundsOf[xAnchorTxtFrame].getInserter();
405 *pInserter++ = xTextContent;
409 BoundFrameSets::BoundFrameSets(
const Reference<XInterface>& rModel)
410 : m_pTexts(new BoundFrames())
411 , m_pGraphics(new BoundFrames())
412 , m_pEmbeddeds(new BoundFrames())
413 , m_pShapes(new BoundFrames())
415 const Reference<XTextFramesSupplier> xTFS(rModel, UNO_QUERY);
416 const Reference<XTextGraphicObjectsSupplier> xGOS(rModel, UNO_QUERY);
417 const Reference<XTextEmbeddedObjectsSupplier> xEOS(rModel, UNO_QUERY);
418 const Reference<XDrawPageSupplier> xDPS(rModel, UNO_QUERY);
421 Reference<XEnumerationAccess>(xTFS->getTextFrames(), UNO_QUERY),
422 &lcl_TextContentsUnfiltered));
425 Reference<XEnumerationAccess>(xGOS->getGraphicObjects(), UNO_QUERY),
426 &lcl_TextContentsUnfiltered));
429 Reference<XEnumerationAccess>(xEOS->getEmbeddedObjects(), UNO_QUERY),
430 &lcl_TextContentsUnfiltered));
433 Reference<XEnumerationAccess>(xDPS->getDrawPage(), UNO_QUERY),
437 void FieldParamExporter::Export()
444 for(
const auto & rParameter : vParameters)
446 const Any aValue = m_xFieldParams->getByName(rParameter);
447 const Type& aValueType = aValue.getValueType();
448 if(aValueType == aStringType)
458 if (xTargetStg.is()) {
460 "OLELinks", embed::ElementModes::WRITE );
462 if ( !xDstStg->hasByName( sValue ) ) {
463 Reference< XStorageBasedDocument > xStgDoc (
464 m_pExport->GetModel( ), UNO_QUERY );
467 "OLELinks", embed::ElementModes::READ );
469 xOleStg->copyElementTo( sValue, xDstStg, sValue );
470 Reference< embed::XTransactedObject > xTransact( xDstStg, UNO_QUERY );
471 if ( xTransact.is( ) )
472 xTransact->commit( );
475 SAL_WARN(
"xmloff",
"no target storage");
479 else if(aValueType == aBoolType)
485 else if(aValueType == aSeqType)
489 for(
const OUString & i : std::as_const(vValue))
494 else if(aValueType == aIntType)
519 xPropMapper = GetParaPropMapper();
522 xPropMapper = GetTextPropMapper();
525 xPropMapper = GetAutoFramePropMapper();
528 xPropMapper = GetSectionPropMapper();
531 xPropMapper = GetRubyPropMapper();
535 SAL_WARN_IF( !xPropMapper.is(),
"xmloff",
"There is the property mapper?" );
537 vector< XMLPropertyState > aPropStates =
538 xPropMapper->Filter( rPropSet );
542 while( *ppAddStates )
544 aPropStates.push_back( **ppAddStates );
549 if( aPropStates.empty() )
552 Reference< XPropertySetInfo > xPropSetInfo(rPropSet->getPropertySetInfo());
553 OUString sParent, sCondParent;
554 sal_uInt16 nIgnoreProps = 0;
558 if( xPropSetInfo->hasPropertyByName( gsParaStyleName ) )
560 rPropSet->getPropertyValue( gsParaStyleName ) >>= sParent;
568 Reference < XIndexReplace > xNumRule(rPropSet->getPropertyValue(
gsNumberingRules ), uno::UNO_QUERY);
569 if( xNumRule.is() && xNumRule->getCount() )
571 Reference < XNamed > xNamed( xNumRule, UNO_QUERY );
574 sName = xNamed->getName();
575 bool bAdd = sName.isEmpty();
580 if( xNumPropSet.is() &&
581 xNumPropSet->getPropertySetInfo()
582 ->hasPropertyByName(
"IsAutomatic" ) )
584 bAdd = *o3tl::doAccess<bool>(xNumPropSet->getPropertyValue(
"IsAutomatic" ));
587 xNumPropSet->getPropertySetInfo()
588 ->hasPropertyByName(
"NumberingIsOutline" ) )
590 bAdd = !(*o3tl::doAccess<bool>(xNumPropSet->getPropertyValue(
"NumberingIsOutline" )));
599 maListAutoPool.Add( xNumRule );
607 for( ::std::vector< XMLPropertyState >::iterator
i(aPropStates.begin());
608 nIgnoreProps < 2 &&
i != aPropStates.end(); )
610 if(
i->mnIndex == -1 )
616 switch( xPM->GetEntryContextId(
i->mnIndex) )
622 i = aPropStates.erase( i );
632 if( xPropSetInfo->hasPropertyByName( gsFrameStyleName ) )
634 rPropSet->getPropertyValue( gsFrameStyleName ) >>= sParent;
643 if (aPropStates.size() - nIgnoreProps)
645 GetAutoStylePool().Add( nFamily, sParent, aPropStates, bDontSeek );
646 if( !sCondParent.isEmpty() && sParent != sCondParent )
647 GetAutoStylePool().Add( nFamily, sCondParent, aPropStates );
664 xPropMapper = GetParaPropMapper();
668 SAL_WARN_IF( !xPropMapper.is(),
"xmloff",
"There is the property mapper?" );
670 vector< XMLPropertyState > aPropStates(xPropMapper->Filter( rPropSet ));
672 if( rPropSetHelper.
hasProperty( NUMBERING_RULES_AUTO ) )
674 Reference < XIndexReplace > xNumRule(rPropSetHelper.
getValue( NUMBERING_RULES_AUTO,
675 rPropSet,
true ), uno::UNO_QUERY);
676 if( xNumRule.is() && xNumRule->getCount() )
678 Reference < XNamed > xNamed( xNumRule, UNO_QUERY );
681 sName = xNamed->getName();
682 bool bAdd = sName.isEmpty();
687 if( xNumPropSet.is() &&
688 xNumPropSet->getPropertySetInfo()
689 ->hasPropertyByName(
"IsAutomatic" ) )
691 bAdd = *o3tl::doAccess<bool>(xNumPropSet->getPropertyValue(
"IsAutomatic" ));
694 xNumPropSet->getPropertySetInfo()
695 ->hasPropertyByName(
"NumberingIsOutline" ) )
697 bAdd = !(*o3tl::doAccess<bool>(xNumPropSet->getPropertyValue(
"NumberingIsOutline" )));
706 maListAutoPool.Add( xNumRule );
710 if( aPropStates.empty() )
713 OUString sParent, sCondParent;
717 if( rPropSetHelper.
hasProperty( PARA_STYLE_NAME_AUTO ) )
719 rPropSetHelper.
getValue( PARA_STYLE_NAME_AUTO, rPropSet,
722 if( rPropSetHelper.
hasProperty( PARA_CONDITIONAL_STYLE_NAME_AUTO ) )
724 rPropSetHelper.
getValue( PARA_CONDITIONAL_STYLE_NAME_AUTO,
725 rPropSet,
true ) >>= sCondParent;
734 GetAutoStylePool().Add( nFamily, sParent, aPropStates );
735 if( !sCondParent.isEmpty() && sParent != sCondParent )
736 GetAutoStylePool().Add( nFamily, sCondParent, aPropStates );
743 const OUString& rParent,
746 OUString sName( rParent );
751 xPropMapper = GetParaPropMapper();
754 xPropMapper = GetAutoFramePropMapper();
757 xPropMapper = GetSectionPropMapper();
760 xPropMapper = GetRubyPropMapper();
764 SAL_WARN_IF( !xPropMapper.is(),
"xmloff",
"There is the property mapper?" );
765 if( !xPropMapper.is() )
767 vector< XMLPropertyState > aPropStates(xPropMapper->Filter( rPropSet ));
770 while( *ppAddStates )
772 aPropStates.push_back( **ppAddStates );
777 sName = GetAutoStylePool().Find( nFamily, sName, aPropStates );
785 bool& rbHasCharStyle,
786 bool& rbHasAutoStyle,
790 vector< XMLPropertyState > aPropStates(xPropMapper->Filter( rPropSet ));
794 rbHyperlink = rbHasCharStyle = rbHasAutoStyle =
false;
795 sal_uInt16 nIgnoreProps = 0;
797 ::std::vector< XMLPropertyState >::iterator aFirstDel = aPropStates.end();
798 ::std::vector< XMLPropertyState >::iterator aSecondDel = aPropStates.end();
800 for( ::std::vector< XMLPropertyState >::iterator
801 i = aPropStates.begin();
802 nIgnoreProps < 2 &&
i != aPropStates.end();
805 if(
i->mnIndex == -1 )
808 switch( xPM->GetEntryContextId(
i->mnIndex) )
811 i->maValue >>= sName;
813 rbHasCharStyle = !sName.isEmpty();
833 while( *ppAddStates )
835 aPropStates.push_back( **ppAddStates );
839 if (aPropStates.size() - nIgnoreProps)
848 aPropStates.erase( aSecondDel );
849 aPropStates.erase( aFirstDel );
851 sName = GetAutoStylePool().Find(
855 rbHasAutoStyle =
true;
869 sal_Int16 nListLevelsToBeClosed = 0;
874 nListLevelsToBeClosed = rPrevInfo.
GetLevel();
880 "<rPrevInfo.GetLevel() > 0> not hold. Serious defect." );
884 if ( nListLevelsToBeClosed > 0 &&
886 pListElements->size() >= sal::static_int_cast< sal_uInt32 >( 2 * nListLevelsToBeClosed ) )
889 for(
size_t j = 0; j < 2; ++j)
891 OUString aElem(pListElements->back());
892 pListElements->pop_back();
893 GetExport().EndElement(aElem,
true);
897 mpTextListsHelper->PopListFromStack();
899 --nListLevelsToBeClosed;
900 }
while ( nListLevelsToBeClosed > 0 );
904 const bool bExportODF =
907 GetExport().getSaneDefaultVersion();
912 bool bRootListToBeStarted =
false;
913 sal_Int16 nListLevelsToBeOpened = 0;
918 bRootListToBeStarted =
true;
919 nListLevelsToBeOpened = rNextInfo.
GetLevel();
925 "<rPrevInfo.GetLevel() > 0> not hold. Serious defect." );
929 if ( nListLevelsToBeOpened > 0 )
934 const OUString& sListId( rNextInfo.
GetListId() );
935 bool bExportListStyle(
true );
936 bool bRestartNumberingAtContinuedList(
false );
937 sal_Int32 nRestartValueForContinuedList( -1 );
938 bool bContinueingPreviousSubList = !bRootListToBeStarted &&
941 GetExport().CheckAttrList();
943 if ( bRootListToBeStarted )
945 if ( !mpTextListsHelper->IsListProcessed( sListId ) )
958 mpTextListsHelper->KeepListAsProcessed( sListId,
964 const OUString sNewListId(
965 mpTextListsHelper->GenerateNewListId() );
978 const OUString sContinueListId =
979 mpTextListsHelper->GetLastContinuingListId( sListId );
982 mpTextListsHelper->StoreLastContinuingList( sListId,
984 if ( sListStyleName ==
985 mpTextListsHelper->GetListStyleOfLastProcessedList() &&
988 mpTextListsHelper->GetLastProcessedListId() &&
1007 ( nListLevelsToBeOpened != 1 ||
1010 bRestartNumberingAtContinuedList =
true;
1011 nRestartValueForContinuedList =
1016 mpTextListsHelper->KeepListAsProcessed( sNewListId,
1022 GetExport().EncodeStyleName( sListStyleName ) );
1023 bExportListStyle =
false;
1025 bRootListToBeStarted =
false;
1027 else if ( bExportListStyle &&
1028 !mpTextListsHelper->EqualsToTopListStyleOnStack( sListStyleName ) )
1031 GetExport().EncodeStyleName( sListStyleName ) );
1032 bExportListStyle =
false;
1040 bRestartNumberingAtContinuedList =
true;
1041 nRestartValueForContinuedList =
1046 if ( bContinueingPreviousSubList )
1050 bContinueingPreviousSubList =
false;
1055 OUString aElem(GetExport().GetNamespaceMap().GetQNameByKey(
1058 GetExport().IgnorableWhitespace();
1059 GetExport().StartElement(aElem,
false);
1062 pListElements.reset(
new std::vector<OUString> );
1063 pListElements->push_back(aElem);
1065 mpTextListsHelper->PushListOnStack( sListId,
1069 GetExport().CheckAttrList();
1072 if ( nListLevelsToBeOpened == 1 )
1077 aBuffer.append( static_cast<sal_Int32>(rNextInfo.
GetStartValue()) );
1079 aBuffer.makeStringAndClear() );
1081 else if (bRestartNumberingAtContinuedList)
1085 OUString::number(nRestartValueForContinuedList) );
1086 bRestartNumberingAtContinuedList =
false;
1090 eLName = ( rNextInfo.
IsNumbered() || nListLevelsToBeOpened > 1 )
1093 aElem = GetExport().GetNamespaceMap().GetQNameByKey(
1096 GetExport().IgnorableWhitespace();
1097 GetExport().StartElement(aElem,
false);
1098 pListElements->push_back(aElem);
1101 if ( GetExport().exportTextNumberElement() &&
1105 const OUString aTextNumberElem =
1106 GetExport().GetNamespaceMap().GetQNameByKey(
1109 GetExport().IgnorableWhitespace();
1110 GetExport().StartElement( aTextNumberElem,
false );
1112 GetExport().EndElement( aTextNumberElem,
true );
1114 --nListLevelsToBeOpened;
1115 }
while ( nListLevelsToBeOpened > 0 );
1119 bool bEndElement =
false;
1126 assert(pListElements && pListElements->size() >= 2 &&
"list elements missing");
1127 bEndElement = pListElements && pListElements->size() >= 2;
1134 GetExport().EndElement(pListElements->back(), true );
1135 pListElements->pop_back();
1142 GetExport().EndElement(pListElements->back(), true );
1143 GetExport().IgnorableWhitespace();
1144 GetExport().StartElement(pListElements->back(),
false);
1148 GetExport().CheckAttrList();
1152 aBuffer.append( static_cast<sal_Int32>(rNextInfo.
GetStartValue()) );
1154 aBuffer.makeStringAndClear() );
1163 aBuffer.makeStringAndClear() );
1169 if ( !mpTextListsHelper->EqualsToTopListStyleOnStack( sListStyleName ) )
1173 GetExport().EncodeStyleName( sListStyleName ) );
1176 OUString aElem( GetExport().GetNamespaceMap().GetQNameByKey(
1179 GetExport().IgnorableWhitespace();
1180 GetExport().StartElement(aElem,
false );
1181 pListElements->push_back(aElem);
1184 if ( GetExport().exportTextNumberElement() &&
1187 const OUString aTextNumberElem =
1188 GetExport().GetNamespaceMap().GetQNameByKey(
1191 GetExport().IgnorableWhitespace();
1192 GetExport().StartElement( aTextNumberElem,
false );
1194 GetExport().EndElement( aTextNumberElem,
true );
1207 assert(m_FieldMarkMap.find(i_xFieldMark) == m_FieldMarkMap.end());
1208 sal_Int32
const ret(m_FieldMarkMap.size());
1209 m_FieldMarkMap.insert(::std::make_pair(i_xFieldMark, ret));
1214 FieldMarkMap_t::const_iterator
const it(
1215 m_FieldMarkMap.find(i_xFieldMark));
1218 assert(it != m_FieldMarkMap.end());
1229 rAutoStylePool( rASP ),
1230 pBoundFrameSets(new BoundFrameSets(GetExport().GetModel())),
1231 maListAutoPool( GetExport() ),
1235 mpTextListsHelper( nullptr ),
1236 maTextListsHelperStack(),
1238 aCharStyleNamesPropInfoCache( gsCharStyleNames )
1245 OUString aPrefix(
u'P');
1288 Reference<XRedlinesSupplier>(
GetExport().GetModel(), UNO_QUERY ).is())
1311 txtparae_bContainsIllegalCharacters =
false;
1315 "misusage of text lists helper stack - it is not empty. Serious defect" );
1352 const TextContentSet& rTexts =
pBoundFrameSets->GetTexts()->GetPageBoundContents();
1353 const TextContentSet& rGraphics =
pBoundFrameSets->GetGraphics()->GetPageBoundContents();
1354 const TextContentSet& rEmbeddeds =
pBoundFrameSets->GetEmbeddeds()->GetPageBoundContents();
1355 const TextContentSet& rShapes =
pBoundFrameSets->GetShapes()->GetPageBoundContents();
1356 for(TextContentSet::const_iterator_t it = rTexts.getBegin();
1357 it != rTexts.getEnd();
1360 for(TextContentSet::const_iterator_t it = rGraphics.getBegin();
1361 it != rGraphics.getEnd();
1364 for(TextContentSet::const_iterator_t it = rEmbeddeds.getBegin();
1365 it != rEmbeddeds.getEnd();
1368 for(TextContentSet::const_iterator_t it = rShapes.getBegin();
1369 it != rShapes.getEnd();
1377 const Reference < XTextFrame > *pParentTxtFrame )
1379 const TextContentSet*
const pTexts =
pBoundFrameSets->GetTexts()->GetFrameBoundContents(*pParentTxtFrame);
1381 for(TextContentSet::const_iterator_t it = pTexts->getBegin();
1382 it != pTexts->getEnd();
1385 const TextContentSet*
const pGraphics =
pBoundFrameSets->GetGraphics()->GetFrameBoundContents(*pParentTxtFrame);
1387 for(TextContentSet::const_iterator_t it = pGraphics->getBegin();
1388 it != pGraphics->getEnd();
1391 const TextContentSet*
const pEmbeddeds =
pBoundFrameSets->GetEmbeddeds()->GetFrameBoundContents(*pParentTxtFrame);
1393 for(TextContentSet::const_iterator_t it = pEmbeddeds->getBegin();
1394 it != pEmbeddeds->getEnd();
1397 const TextContentSet*
const pShapes =
pBoundFrameSets->GetShapes()->GetFrameBoundContents(*pParentTxtFrame);
1399 for(TextContentSet::const_iterator_t it = pShapes->getBegin();
1400 it != pShapes->getEnd();
1422 const bool bAutoStyles =
true;
1423 const bool bExportContent =
false;
1426 Reference< XAutoStylesSupplier > xAutoStylesSupp(
GetExport().GetModel(), UNO_QUERY );
1427 if ( xAutoStylesSupp.is() )
1429 Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles();
1430 const auto collectFamily = [
this, &xAutoStyleFamilies](
const OUString& sName,
1432 Any aAny = xAutoStyleFamilies->getByName( sName );
1433 Reference< XAutoStyleFamily > xAutoStyles = *o3tl::doAccess<Reference<XAutoStyleFamily>>(aAny);
1434 Reference < XEnumeration > xAutoStylesEnum( xAutoStyles->createEnumeration() );
1436 while ( xAutoStylesEnum->hasMoreElements() )
1438 aAny = xAutoStylesEnum->nextElement();
1439 Reference< XAutoStyle > xAutoStyle = *o3tl::doAccess<Reference<XAutoStyle>>(aAny);
1441 Add( nFamily, xPSet,
nullptr,
true );
1450 Reference< XTextFieldsSupplier > xTextFieldsSupp(
GetExport().GetModel(), UNO_QUERY );
1451 if ( xTextFieldsSupp.is() )
1453 Reference< XEnumerationAccess > xTextFields = xTextFieldsSupp->getTextFields();
1454 Reference < XEnumeration > xTextFieldsEnum( xTextFields->createEnumeration() );
1456 while ( xTextFieldsEnum->hasMoreElements() )
1458 Any aAny = xTextFieldsEnum->nextElement();
1459 Reference< XTextField > xTextField = *o3tl::doAccess<Reference<XTextField>>(aAny);
1461 !xAutoStylesSupp.is(), nullptr );
1465 Reference < XText > xText;
1466 Any a = xSet->getPropertyValue(
"TextRange");
1470 exportText( xText,
true, bIsProgress, bExportContent );
1472 ->collectTextAutoStyles( xText );
1482 Reference<XEnumeration> xTextFramesEnum =
pBoundFrameSets->GetTexts()->createEnumeration();
1483 if(xTextFramesEnum.is())
1484 while(xTextFramesEnum->hasMoreElements())
1486 Reference<XTextContent> xTxtCntnt(xTextFramesEnum->nextElement(), UNO_QUERY);
1492 Reference<XEnumeration> xGraphicsEnum =
pBoundFrameSets->GetGraphics()->createEnumeration();
1493 if(xGraphicsEnum.is())
1494 while(xGraphicsEnum->hasMoreElements())
1496 Reference<XTextContent> xTxtCntnt(xGraphicsEnum->nextElement(), UNO_QUERY);
1502 Reference<XEnumeration> xEmbeddedsEnum =
pBoundFrameSets->GetEmbeddeds()->createEnumeration();
1503 if(xEmbeddedsEnum.is())
1504 while(xEmbeddedsEnum->hasMoreElements())
1506 Reference<XTextContent> xTxtCntnt(xEmbeddedsEnum->nextElement(), UNO_QUERY);
1512 Reference<XEnumeration> xShapesEnum =
pBoundFrameSets->GetShapes()->createEnumeration();
1513 if(xShapesEnum.is())
1514 while(xShapesEnum->hasMoreElements())
1516 Reference<XTextContent> xTxtCntnt(xShapesEnum->nextElement(), UNO_QUERY);
1519 Reference<XServiceInfo> xServiceInfo(xTxtCntnt, UNO_QUERY);
1527 Reference< XTextSectionsSupplier > xSectionsSupp(
GetExport().GetModel(), UNO_QUERY );
1528 if ( xSectionsSupp.is() )
1530 Reference< XIndexAccess > xSections( xSectionsSupp->getTextSections(), UNO_QUERY );
1531 if ( xSections.is() )
1533 nCount = xSections->getCount();
1534 for( sal_Int32
i = 0;
i < nCount; ++
i )
1536 Any aAny = xSections->getByIndex(
i );
1537 Reference< XTextSection > xSection = *o3tl::doAccess<Reference<XTextSection>>(aAny);
1545 Reference< XTextTablesSupplier > xTablesSupp(
GetExport().GetModel(), UNO_QUERY );
1546 if ( xTablesSupp.is() )
1548 Reference< XIndexAccess > xTables( xTablesSupp->getTextTables(), UNO_QUERY );
1551 nCount = xTables->getCount();
1552 for( sal_Int32
i = 0;
i < nCount; ++
i )
1554 Any aAny = xTables->getByIndex(
i );
1555 Reference< XTextTable > xTable = *o3tl::doAccess<Reference<XTextTable>>(aAny);
1561 Reference< XNumberingRulesSupplier > xNumberingRulesSupp(
GetExport().GetModel(), UNO_QUERY );
1562 if ( xNumberingRulesSupp.is() )
1564 Reference< XIndexAccess > xNumberingRules = xNumberingRulesSupp->getNumberingRules();
1565 nCount = xNumberingRules->getCount();
1567 for( sal_Int32
i = 0;
i < nCount; ++
i )
1569 Reference< XIndexReplace > xNumRule( xNumberingRules->getByIndex(
i ), UNO_QUERY );
1570 if( xNumRule.is() && xNumRule->getCount() )
1572 Reference < XNamed > xNamed( xNumRule, UNO_QUERY );
1575 sName = xNamed->getName();
1576 bool bAdd = sName.isEmpty();
1581 if( xNumPropSet.is() &&
1582 xNumPropSet->getPropertySetInfo()
1583 ->hasPropertyByName(
"IsAutomatic" ) )
1585 bAdd = *o3tl::doAccess<bool>(xNumPropSet->getPropertyValue(
"IsAutomatic" ));
1588 xNumPropSet->getPropertySetInfo()
1589 ->hasPropertyByName(
"NumberingIsOutline" ) )
1591 bAdd = !(*o3tl::doAccess<bool>(xNumPropSet->getPropertyValue(
"NumberingIsOutline" )));
1608 const Reference < XText > & rText,
1611 bool bExportParagraph,
1617 Reference < XEnumerationAccess > xEA( rText, UNO_QUERY );
1621 Reference < XEnumeration > xParaEnum(xEA->createEnumeration());
1623 Reference < XTextSection > xBaseSection;
1627 SAL_WARN_IF( !xParaEnum.is(),
"xmloff",
"We need a paragraph enumeration" );
1628 if( ! xParaEnum.is() )
1631 if (xPropertySet.is())
1633 Reference < XPropertySetInfo > xInfo ( xPropertySet->getPropertySetInfo() );
1639 xPropertySet->getPropertyValue(
gsTextSection) >>= xBaseSection ;
1649 bIsProgress, bExportParagraph,
nullptr, eExtensionNS );
1655 const Reference < XText > & rText,
1656 const Reference < XTextSection > & rBaseSection,
1659 bool bExportParagraph)
1664 Reference < XEnumerationAccess > xEA( rText, UNO_QUERY );
1665 Reference < XEnumeration > xParaEnum(xEA->createEnumeration());
1668 if( ! xParaEnum.is() )
1676 xPropertySet.set(rText, uno::UNO_QUERY );
1680 bIsProgress, bExportParagraph );
1686 const Reference < XEnumeration > & rContEnum,
1688 const Reference < XTextSection > & rBaseSection,
1690 bool bExportParagraph,
1694 SAL_WARN_IF( !rContEnum.is(),
"xmloff",
"No enumeration to export!" );
1695 bool bHasMoreElements = rContEnum->hasMoreElements();
1696 if( !bHasMoreElements )
1702 bool bHasContent =
false;
1703 Reference<XTextSection> xCurrentTextSection(rBaseSection);
1706 bAutoStyles ? aParagraphPropertyNamesAuto :
1707 aParagraphPropertyNames );
1709 bool bHoldElement =
false;
1710 Reference < XTextContent > xTxtCntnt;
1711 while( bHoldElement || bHasMoreElements )
1715 bHoldElement =
false;
1719 xTxtCntnt.set(rContEnum->nextElement(), uno::UNO_QUERY);
1725 Reference<XServiceInfo> xServiceInfo( xTxtCntnt, UNO_QUERY );
1731 aPrevNumInfo, aNextNumInfo,
1740 aNextNumInfo.
Set( xTxtCntnt,
1741 GetExport().writeOutlineStyleAsNormalListStyle(),
1743 GetExport().exportTextNumberElement() );
1747 aPrevNumInfo, aNextNumInfo,
1758 while (rContEnum->hasMoreElements() &&
1762 xTxtCntnt.set(rContEnum->nextElement(), uno::UNO_QUERY);
1764 aNextNumInfo.
Reset();
1773 bExportParagraph, aPropSetHelper, eExtensionNS );
1780 aNextNumInfo.
Reset();
1784 aPrevNumInfo, aNextNumInfo,
1793 exportTable( xTxtCntnt, bAutoStyles, bIsProgress );
1798 else if( !bAutoStyles )
1808 exportTextFrame( xTxtCntnt, bAutoStyles, bIsProgress,
true, pRangePropSet );
1820 exportShape( xTxtCntnt, bAutoStyles, pRangePropSet );
1824 SAL_WARN_IF( xTxtCntnt.is(),
"xmloff",
"unknown text content" );
1829 aPrevNumInfo = aNextNumInfo;
1832 bHasMoreElements = rContEnum->hasMoreElements();
1835 if( bHasContent && !bAutoStyles )
1837 aNextNumInfo.
Reset();
1841 aPrevNumInfo, aNextNumInfo,
1847 const Reference < XTextContent > & rTextContent,
1848 bool bAutoStyles,
bool bIsProgress,
bool bExportParagraph,
1851 sal_Int16 nOutlineLevel = -1;
1860 Reference<XMultiPropertySet> xMultiPropSet( rTextContent, UNO_QUERY );
1865 rPropSetHelper.
hasProperties( xPropSet->getPropertySetInfo() );
1872 if( bExportParagraph )
1885 if( rPropSetHelper.
hasProperty( PARA_STYLE_NAME ) )
1887 if( xMultiPropSet.is() )
1888 rPropSetHelper.
getValue( PARA_STYLE_NAME,
1889 xMultiPropSet ) >>= sStyle;
1891 rPropSetHelper.
getValue( PARA_STYLE_NAME,
1892 xPropSet ) >>= sStyle;
1895 if( rTextContent.is() )
1898 if( !rIdentifier.isEmpty() )
1904 uno::Reference<rdf::XMetadatable>
const xMeta(rTextContent,
1906 OSL_ENSURE(!xMeta.is(),
"paragraph that implements "
1907 "XMetadatable used in interfaceToIdentifierMapper?");
1914 if ( sAutoStyle.isEmpty() )
1915 sAutoStyle = sStyle;
1916 if( !sAutoStyle.isEmpty() )
1918 GetExport().EncodeStyleName( sAutoStyle ) );
1920 if( rPropSetHelper.
hasProperty( PARA_CONDITIONAL_STYLE_NAME ) )
1922 OUString sCondStyle;
1923 if( xMultiPropSet.is() )
1924 rPropSetHelper.
getValue( PARA_CONDITIONAL_STYLE_NAME,
1925 xMultiPropSet ) >>= sCondStyle;
1927 rPropSetHelper.
getValue( PARA_CONDITIONAL_STYLE_NAME,
1928 xPropSet ) >>= sCondStyle;
1929 if( sCondStyle != sStyle )
1933 if( !sCondStyle.isEmpty() )
1936 GetExport().EncodeStyleName( sCondStyle ) );
1940 if( rPropSetHelper.
hasProperty( PARA_OUTLINE_LEVEL ) )
1942 if( xMultiPropSet.is() )
1943 rPropSetHelper.
getValue( PARA_OUTLINE_LEVEL,
1944 xMultiPropSet ) >>= nOutlineLevel;
1946 rPropSetHelper.
getValue( PARA_OUTLINE_LEVEL,
1947 xPropSet ) >>= nOutlineLevel;
1949 if( 0 < nOutlineLevel )
1953 OUString::number( sal_Int32( nOutlineLevel) ) );
1955 if ( rPropSetHelper.
hasProperty( PARA_OUTLINE_CONTENT_VISIBLE ) )
1957 uno::Sequence<beans::PropertyValue> propList;
1958 bool bIsOutlineContentVisible =
true;
1959 if( xMultiPropSet.is() )
1961 PARA_OUTLINE_CONTENT_VISIBLE, xMultiPropSet ) >>= propList;
1964 PARA_OUTLINE_CONTENT_VISIBLE, xPropSet ) >>= propList;
1965 for (
const auto& rProp : std::as_const(propList))
1967 OUString propName = rProp.Name;
1968 if (propName ==
"OutlineContentVisibleAttr")
1970 rProp.Value >>= bIsOutlineContentVisible;
1974 if (!bIsOutlineContentVisible)
1982 if( rPropSetHelper.
hasProperty( NUMBERING_IS_NUMBER ) )
1984 bool bIsNumber =
false;
1985 if( xMultiPropSet.is() )
1987 NUMBERING_IS_NUMBER, xMultiPropSet ) >>= bIsNumber;
1990 NUMBERING_IS_NUMBER, xPropSet ) >>= bIsNumber;
1992 OUString sListStyleName;
1993 if( xMultiPropSet.is() )
1995 PARA_NUMBERING_STYLENAME, xMultiPropSet ) >>= sListStyleName;
1998 PARA_NUMBERING_STYLENAME, xPropSet ) >>= sListStyleName;
2000 bool bAssignedtoOutlineStyle =
false;
2002 Reference< XChapterNumberingSupplier > xCNSupplier(
GetExport().GetModel(), UNO_QUERY );
2004 if (xCNSupplier.is())
2006 Reference< XIndexReplace > xNumRule ( xCNSupplier->getChapterNumberingRules() );
2007 SAL_WARN_IF( !xNumRule.is(),
"xmloff",
"no chapter numbering rules" );
2012 OUString sOutlineName;
2013 xNumRulePropSet->getPropertyValue(
2014 "Name" ) >>= sOutlineName;
2015 bAssignedtoOutlineStyle = ( sListStyleName == sOutlineName );
2020 if( ! bIsNumber && bAssignedtoOutlineStyle )
2027 bool bIsRestartNumbering =
false;
2029 Reference< XPropertySetInfo >
2030 xPropSetInfo(xMultiPropSet.is() ?
2031 xMultiPropSet->getPropertySetInfo():
2032 xPropSet->getPropertySetInfo());
2035 hasPropertyByName(
"ParaIsNumberingRestart"))
2037 xPropSet->getPropertyValue(
"ParaIsNumberingRestart")
2038 >>= bIsRestartNumbering;
2041 if (bIsRestartNumbering)
2048 hasPropertyByName(
"NumberingStartValue"))
2050 sal_Int32 nStartValue = 0;
2052 xPropSet->getPropertyValue(
"NumberingStartValue")
2058 OUString::number(nStartValue));
2067 Reference < XEnumerationAccess > xEA( rTextContent, UNO_QUERY );
2068 Reference < XEnumeration > xTextEnum = xEA->createEnumeration();
2069 const bool bHasPortions = xTextEnum.is();
2071 Reference < XEnumeration> xContentEnum;
2072 Reference < XContentEnumerationAccess > xCEA( rTextContent, UNO_QUERY );
2075 const bool bHasContentEnum = xContentEnum.is() &&
2076 xContentEnum->hasMoreElements();
2078 Reference < XTextSection > xSection;
2079 if( bHasContentEnum )
2087 if( xPropSet->getPropertySetInfo()->hasPropertyByName(
gsTextSection ) )
2089 xSection.set(xPropSet->getPropertyValue(
gsTextSection ), uno::UNO_QUERY);
2101 bool bPrevCharIsSpace(
true);
2105 if( bHasContentEnum )
2107 xContentEnum, bAutoStyles, xSection,
2120 if( bHasContentEnum )
2123 xContentEnum, bAutoStyles, xSection,
2131 const Reference < XEnumeration > & rTextEnum,
2132 bool bAutoStyles,
bool bIsProgress,
2133 bool & rPrevCharIsSpace)
2135 static const char sFieldMarkName[] =
"__FieldMark_";
2141 while( rTextEnum->hasMoreElements() )
2144 Reference < XTextRange > xTxtRange(xPropSet, uno::UNO_QUERY);
2145 Reference<XPropertySetInfo> xPropInfo(xPropSet->getPropertySetInfo());
2155 rPrevCharIsSpace, openFieldMark);
2159 exportTextField(xTxtRange, bAutoStyles, bIsProgress, &rPrevCharIsSpace);
2161 else if ( sType ==
"Annotation" )
2163 exportTextField(xTxtRange, bAutoStyles, bIsProgress, &rPrevCharIsSpace);
2165 else if ( sType ==
"AnnotationEnd" )
2169 Reference<XNamed> xBookmark(xPropSet->getPropertyValue(
gsBookmark), UNO_QUERY);
2170 const OUString& rName = xBookmark->getName();
2171 if (!rName.isEmpty())
2180 Reference < XEnumeration> xContentEnum;
2181 Reference < XContentEnumerationAccess > xCEA( xTxtRange,
2184 xContentEnum.set(xCEA->createContentEnumeration(
2187 Reference<XTextSection> xSection;
2188 if( xContentEnum.is() )
2191 xSection, bIsProgress,
true,
2198 xTxtRange->getString(),
2199 bAutoStyles, bIsProgress );
2205 lcl_XmlBookmarkElements,
2212 lcl_XmlReferenceElements,
2224 else if (sType ==
gsRuby)
2228 else if (sType ==
"InContentMetadata")
2230 exportMeta(xPropSet, bAutoStyles, bIsProgress, rPrevCharIsSpace);
2234 Reference< css::text::XFormField > xFormField(xPropSet->getPropertyValue(
gsBookmark), UNO_QUERY);
2241 Reference<XNamed> xBookmark(xPropSet->getPropertyValue(
gsBookmark), UNO_QUERY);
2247 if (xFormField.is())
2253 if (xFormField.is())
2255 FieldParamExporter(&
GetExport(), xFormField->getParameters()).
Export();
2262 if (xFormField.is())
2265 Reference< css::container::XNameAccess > xParameters = xFormField->getParameters();
2266 if (xParameters.is() && xParameters->hasByName(
"Name"))
2268 const Any aValue = xParameters->getByName(
"Name");
2271 if (sName.isEmpty())
2274 sName = sFieldMarkName + OUString::number(
2275 m_xImpl->AddFieldMarkStart(xFormField));
2282 const OUString sFieldType = xFormField->getFieldType();
2285 openFieldMark =
TEXT;
2289 openFieldMark =
CHECK;
2293 openFieldMark =
NONE;
2303 Reference< css::text::XFormField > xFormField(xPropSet->getPropertyValue(
gsBookmark), UNO_QUERY);
2313 if (xFormField.is())
2316 Reference< css::container::XNameAccess > xParameters = xFormField->getParameters();
2317 if (xParameters.is() && xParameters->hasByName(
"Name"))
2319 const Any aValue = xParameters->getByName(
"Name");
2322 if (sName.isEmpty())
2325 sName = sFieldMarkName + OUString::number(
2326 m_xImpl->GetFieldMarkIndex(xFormField));
2343 Reference<XNamed> xBookmark(xPropSet->getPropertyValue(
gsBookmark), UNO_QUERY);
2348 Reference< css::text::XFormField > xFormField(xPropSet->getPropertyValue(
gsBookmark), UNO_QUERY);
2349 if (xFormField.is())
2354 if (xFormField.is())
2356 FieldParamExporter(&
GetExport(), xFormField->getParameters()).
Export();
2362 Reference<XNamed> xBookmark(xPropSet->getPropertyValue(
gsBookmark), UNO_QUERY);
2378 OSL_FAIL(
"unknown text portion type");
2383 Reference<XServiceInfo> xServiceInfo( xTxtRange, UNO_QUERY );
2386 exportTextField(xTxtRange, bAutoStyles, bIsProgress, &rPrevCharIsSpace);
2391 exportTextRange(xTxtRange, bAutoStyles, rPrevCharIsSpace, openFieldMark);
2401 const Reference < XTextContent > &,
2407 const Reference < XTextRange > & rTextRange,
2408 bool bAutoStyles,
bool bIsProgress,
bool *
const pPrevCharIsSpace)
2412 if (!xPropSet->getPropertySetInfo()->hasPropertyByName(
gsTextField ))
2415 Reference < XTextField > xTxtFld(xPropSet->getPropertyValue(
gsTextField ), uno::UNO_QUERY);
2416 SAL_WARN_IF( !xTxtFld.is(),
"xmloff",
"text field missing" );
2419 exportTextField(xTxtFld, bAutoStyles, bIsProgress,
true, pPrevCharIsSpace);
2429 const Reference < XTextField > & xTextField,
2430 const bool bAutoStyles,
const bool bIsProgress,
2431 const bool bRecursive,
bool *
const pPrevCharIsSpace)
2435 pFieldExport->ExportFieldAutoStyle( xTextField, bIsProgress,
2440 assert(pPrevCharIsSpace);
2441 pFieldExport->ExportField(xTextField, bIsProgress, *pPrevCharIsSpace);
2454 const OUString& rProperty,
2470 Reference<XNamed> xName(rPropSet->getPropertyValue(rProperty), UNO_QUERY);
2476 if( *o3tl::doAccess<bool>(rPropSet->getPropertyValue(
gsIsCollapsed)) )
2482 nElement = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(
gsIsStart)) ? 1 : 2;
2486 if( nElement < 2 ) {
2488 const uno::Reference<text::XTextContent> xTextContent(
2489 xName, uno::UNO_QUERY_THROW);
2497 Reference<XPropertySetInfo> bkmkPropInfo = bkmkProps->getPropertySetInfo();
2498 OUString
sHidden(
"BookmarkHidden");
2499 if (bkmkPropInfo->hasPropertyByName(sHidden))
2501 bool bHidden =
false;
2502 bkmkProps->getPropertyValue(sHidden) >>= bHidden;
2506 OUString sCondition(
"BookmarkCondition");
2507 if (bkmkPropInfo->hasPropertyByName(sCondition))
2509 OUString sBookmarkCondition;
2510 bkmkProps->getPropertyValue(sCondition) >>= sBookmarkCondition;
2518 assert(pElements !=
nullptr);
2519 assert(0 <= nElement && nElement <= 2);
2528 const Reference < XPropertySetInfo > & rPropSetInfo )
2530 bool bIsBoundAsChar =
false;
2531 OUString sAnchorType(
"AnchorType" );
2532 if( rPropSetInfo->hasPropertyByName( sAnchorType ) )
2534 TextContentAnchorType eAnchor;
2535 rPropSet->getPropertyValue( sAnchorType ) >>= eAnchor;
2536 bIsBoundAsChar = TextContentAnchorType_AS_CHARACTER == eAnchor;
2539 return bIsBoundAsChar;
2546 OUString* pMinHeightValue,
2547 OUString* pMinWidthValue)
2555 Reference < XNamed > xNamed( rPropSet, UNO_QUERY );
2558 OUString sName( xNamed->getName() );
2559 if( !sName.isEmpty() )
2561 xNamed->getName() );
2565 OUStringBuffer sValue;
2568 TextContentAnchorType eAnchor = TextContentAnchorType_AT_PARAGRAPH;
2569 rPropSet->getPropertyValue(
gsAnchorType ) >>= eAnchor;
2573 aAnchorTypeHdl.
exportXML( sTmp, uno::makeAny(eAnchor),
2579 if( TextContentAnchorType_AT_PAGE == eAnchor )
2581 sal_Int16 nPage = 0;
2584 "ERROR: writing invalid anchor-page-number 0");
2586 OUString::number( nPage ) );
2596 eAnchor != TextContentAnchorType_AS_CHARACTER )
2599 sal_Int16 nHoriOrient = HoriOrientation::NONE;
2600 rPropSet->getPropertyValue(
gsHoriOrient ) >>= nHoriOrient;
2601 if( HoriOrientation::NONE == nHoriOrient )
2608 sValue.makeStringAndClear() );
2609 if(
nullptr != pCenter)
2612 pCenter->
setX(pCenter->
getX() + nPos);
2616 else if( TextContentAnchorType_AS_CHARACTER == eAnchor )
2619 if( !bShape || TextContentAnchorType_AS_CHARACTER == eAnchor )
2622 sal_Int16 nVertOrient = VertOrientation::NONE;
2623 rPropSet->getPropertyValue(
gsVertOrient ) >>= nVertOrient;
2624 if( VertOrientation::NONE == nVertOrient )
2631 sValue.makeStringAndClear() );
2632 if(
nullptr != pCenter)
2635 pCenter->
setY(pCenter->
getY() + nPos);
2642 Reference< XPropertySetInfo > xPropSetInfo(rPropSet->getPropertySetInfo());
2645 sal_Int16 nWidthType = SizeType::FIX;
2646 if( xPropSetInfo->hasPropertyByName(
gsWidthType ) )
2648 rPropSet->getPropertyValue(
gsWidthType ) >>= nWidthType;
2650 if( xPropSetInfo->hasPropertyByName(
gsWidth ) )
2652 sal_Int32 nWidth = 0;
2654 if( SizeType::VARIABLE != nWidthType )
2656 rPropSet->getPropertyValue(
gsWidth ) >>= nWidth;
2659 if( SizeType::FIX != nWidthType )
2664 *pMinWidthValue = sValue.makeStringAndClear();
2670 sValue.makeStringAndClear() );
2671 if(
nullptr != pCenter)
2674 pCenter->
setX(pCenter->
getX() + (0.5 * nWidth));
2678 bool bSyncWidth =
false;
2686 if( !bSyncWidth && xPropSetInfo->hasPropertyByName(
gsRelativeWidth ) )
2688 sal_Int16 nRelWidth = 0;
2690 SAL_WARN_IF( nRelWidth < 0 || nRelWidth > 254,
"xmloff",
2691 "Got illegal relative width from API" );
2696 sValue.makeStringAndClear() );
2701 sal_Int16 nSizeType = SizeType::FIX;
2702 if( xPropSetInfo->hasPropertyByName(
gsSizeType ) )
2704 rPropSet->getPropertyValue(
gsSizeType ) >>= nSizeType;
2706 bool bSyncHeight =
false;
2711 sal_Int16 nRelHeight = 0;
2716 if( xPropSetInfo->hasPropertyByName(
gsHeight ) )
2718 sal_Int32 nHeight = 0;
2719 if( SizeType::VARIABLE != nSizeType )
2721 rPropSet->getPropertyValue(
gsHeight ) >>= nHeight;
2725 if( SizeType::FIX != nSizeType && 0==nRelHeight && !bSyncHeight &&
2728 *pMinHeightValue = sValue.makeStringAndClear();
2733 sValue.makeStringAndClear() );
2734 if(
nullptr != pCenter)
2737 pCenter->
setY(pCenter->
getY() + (0.5 * nHeight));
2747 else if( nRelHeight > 0 )
2750 if( SizeType::MIN == nSizeType )
2753 if (pMinHeightValue)
2755 *pMinHeightValue = sValue.makeStringAndClear();
2760 sValue.makeStringAndClear() );
2763 OUString sZOrder(
"ZOrder" );
2764 if( xPropSetInfo->hasPropertyByName( sZOrder ) )
2766 sal_Int32 nZIndex = 0;
2767 rPropSet->getPropertyValue( sZOrder ) >>= nZIndex;
2771 OUString::number( nZIndex ) );
2775 return nShapeFeatures;
2779 const Reference < XTextContent > & rTxtCntnt,
2783 bool bExportContent,
2797 xPropSet->getPropertySetInfo() ) )
2805 if ( bExportContent )
2807 Reference < XTextFrame > xTxtFrame( rTxtCntnt, UNO_QUERY );
2808 Reference < XText > xTxt(xTxtFrame->getText());
2810 exportText( xTxt, bAutoStyles, bIsProgress,
true );
2816 Reference < XShape > xShape( rTxtCntnt, UNO_QUERY );
2826 Reference< XPropertySetInfo > xPropSetInfo(xPropSet->getPropertySetInfo());
2827 Reference< XPropertyState > xPropState( xPropSet, UNO_QUERY );
2829 bool bAddCharStyles = pRangePropSet &&
2832 bool bIsUICharStyle;
2833 bool bHasAutoStyle =
false;
2837 if( bAddCharStyles )
2843 bIsUICharStyle =
false;
2845 bool bDoSomething = bIsUICharStyle
2848 GetExport(), bDoSomething, bHasAutoStyle,
2852 if( !sStyle.isEmpty() )
2854 GetExport().EncodeStyleName( sStyle ) );
2862 xPropState,xPropSetInfo ),
2877 Reference < XShape > xShape( rTxtCntnt, UNO_QUERY );
2881 ->exportShape( xShape, nFeatures );
2893 const Reference < XPropertySetInfo > & rPropSetInfo,
2896 Reference < XTextFrame > xTxtFrame( rPropSet, UNO_QUERY );
2897 Reference < XText > xTxt(xTxtFrame->getText());
2905 OUString aMinHeightValue;
2906 OUString sMinWidthValue;
2908 if ( sAutoStyle.isEmpty() )
2909 sAutoStyle = sStyle;
2910 if( !sAutoStyle.isEmpty() )
2912 GetExport().EncodeStyleName( sAutoStyle ) );
2918 if( !aMinHeightValue.isEmpty() )
2922 if (!sMinWidthValue.isEmpty())
2932 if( (rPropSet->getPropertyValue(
gsChainNextName ) >>= sNext) && !sNext.isEmpty() )
2945 exportText( xTxt,
false, bIsProgress,
true );
2949 Reference<XEventsSupplier> xEventsSupp( xTxtFrame, UNO_QUERY );
2961 const Reference < XPropertySetInfo > & rPropSetInfo )
2968 PointSequenceSequence aSourcePolyPolygon;
2972 aSourcePolyPolygon));
2973 const sal_uInt32 nPolygonCount(aPolyPolygon.
count());
2985 bPixel = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(
gsIsPixelContour ));
2989 OUStringBuffer aStringBuffer( 10 );
3015 SdXMLImExViewBox aViewBox(0.0, 0.0, aPolyPolygonRange.getWidth(), aPolyPolygonRange.getHeight());
3019 if(1 == nPolygonCount )
3022 const OUString aPointString(
3033 const OUString aPolygonString(
3047 bool bTmp = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(
3060 const Reference < XPropertySetInfo > & rPropSetInfo )
3069 if ( sAutoStyle.isEmpty() )
3070 sAutoStyle = sStyle;
3071 if( !sAutoStyle.isEmpty() )
3073 GetExport().EncodeStyleName( sAutoStyle ) );
3076 sal_Int16 nRotation(0);
3078 const bool bUseRotation(0 != nRotation);
3101 const double fRotate(static_cast< double >(nRotation) * (
F_PI/1800.0));
3128 uno::Reference<graphic::XGraphic>
xGraphic;
3129 rPropSet->getPropertyValue(
"Graphic") >>= xGraphic;
3131 OUString sInternalURL;
3132 OUString sOutMimeType;
3140 if (!sInternalURL.isEmpty())
3149 OUString sGrfFilter;
3151 if( !sGrfFilter.isEmpty() )
3157 if (sOutMimeType.isEmpty())
3161 if (!sOutMimeType.isEmpty())
3167 "mime-type", sOutMimeType);
3180 const bool bAddReplacementImages = officecfg::Office::Common::Save::Graphic::AddReplacementImages::get();
3181 if (bAddReplacementImages)
3185 uno::Reference<graphic::XGraphic> xReplacementGraphic;
3186 rPropSet->getPropertyValue(
"ReplacementGraphic") >>= xReplacementGraphic;
3188 OUString sInternalURL;
3189 OUString sOutMimeType;
3193 if (xReplacementGraphic.is())
3199 if (!sInternalURL.isEmpty())
3209 if (sOutMimeType.isEmpty())
3213 if (!sOutMimeType.isEmpty())
3219 "mime-type", sOutMimeType);
3225 if (xReplacementGraphic.is())
3233 Reference<XEventsSupplier> xEventsSupp( rPropSet, UNO_QUERY );
3248 SAL_WARN(
"xmloff",
"no API implementation available" );
3253 const Reference < XPropertySetInfo > & )
3255 SAL_WARN(
"xmloff",
"no API implementation available" );
3261 Reference<XEventsSupplier> xEventsSupp( rPropSet, UNO_QUERY );
3265 if (rPropSet->getPropertySetInfo()->hasPropertyByName(
"ImageMap"))
3272 const Reference < XPropertySetInfo > & rPropSetInfo )
3275 if( rPropSetInfo->hasPropertyByName(
gsTitle ) )
3278 rPropSet->getPropertyValue(
gsTitle ) >>= sObjTitle;
3279 if( !sObjTitle.isEmpty() )
3292 if( !sObjDesc.isEmpty() )
3303 const Reference< XPropertyState > & rPropState,
3304 const Reference< XPropertySetInfo > & rPropSetInfo )
3306 bool bExport =
false;
3307 OUString sHRef, sName, sTargetFrame, sUStyleName, sVStyleName;
3308 bool bServerMap =
false;
3311 ( !rPropState.is() || PropertyState_DIRECT_VALUE ==
3316 if( !sHRef.isEmpty() )
3320 if ( sHRef.isEmpty() )
3323 OSL_ENSURE(
false,
"hyperlink without a URL --> no export to ODF" );
3328 && ( !rPropState.is()
3329 || PropertyState_DIRECT_VALUE == rPropState->getPropertyState(
gsHyperLinkName ) ) )
3332 if( !sName.isEmpty() )
3337 && ( !rPropState.is()
3338 || PropertyState_DIRECT_VALUE == rPropState->getPropertyState(
gsHyperLinkTarget ) ) )
3341 if( !sTargetFrame.isEmpty() )
3345 if ( rPropSetInfo->hasPropertyByName(
gsServerMap )
3346 && ( !rPropState.is()
3347 || PropertyState_DIRECT_VALUE == rPropState->getPropertyState(
gsServerMap ) ) )
3349 bServerMap = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(
gsServerMap ));
3355 && ( !rPropState.is()
3359 if( !sUStyleName.isEmpty() )
3364 && ( !rPropState.is()
3368 if( !sVStyleName.isEmpty() )
3377 if( !sName.isEmpty() )
3380 if( !sTargetFrame.isEmpty() )
3392 if( !sUStyleName.isEmpty() )
3396 if( !sVStyleName.isEmpty() )
3405 const css::uno::Reference< css::text::XTextRange > & rTextRange,
3407 Reference < XPropertySetInfo > & xPropSetInfo,
3408 const bool bIsUICharStyle,
3409 const bool bHasAutoStyle,
3410 const OUString& sStyle,
3411 bool& rPrevCharIsSpace,
3421 if ( !sStyle.isEmpty() )
3427 const OUString aText( rTextRange->getString() );
3432 openFieldMark =
NONE;
3437 const Reference< XTextRange > & rTextRange,
3439 bool& rPrevCharIsSpace,
3449 bool bHyperlink =
false;
3450 bool bIsUICharStyle =
false;
3451 bool bHasAutoStyle =
false;
3452 const OUString sStyle(
3455 Reference < XPropertySetInfo > xPropSetInfo;
3456 bool bHyperlinkAttrsAdded =
false;
3459 Reference< XPropertyState > xPropState( xPropSet, UNO_QUERY );
3460 xPropSetInfo.set( xPropSet->getPropertySetInfo() );
3464 if ( bHyperlink && bHyperlinkAttrsAdded )
3469 OUString sHyperLinkEvents(
3471 if (xPropSetInfo->hasPropertyByName(sHyperLinkEvents))
3473 Reference< XNameReplace > xName( xPropSet->getPropertyValue( sHyperLinkEvents ), uno::UNO_QUERY );
3477 exportTextRangeSpan( rTextRange, xPropSet, xPropSetInfo, bIsUICharStyle, bHasAutoStyle, sStyle, rPrevCharIsSpace, openFieldMark );
3481 exportTextRangeSpan( rTextRange, xPropSet, xPropSetInfo, bIsUICharStyle, bHasAutoStyle, sStyle, rPrevCharIsSpace, openFieldMark );
3487 bool& rPrevCharIsSpace )
3489 sal_Int32 nExpStartPos = 0;
3490 sal_Int32 nEndPos = rText.getLength();
3491 sal_Int32 nSpaceChars = 0;
3495 bool bExpCharAsText =
true;
3496 bool bExpCharAsElement =
false;
3497 bool bCurrCharIsSpace =
false;
3503 bExpCharAsElement =
true;
3504 bExpCharAsText =
false;
3509 if( rPrevCharIsSpace )
3513 bExpCharAsText =
false;
3515 bCurrCharIsSpace =
true;
3518 if( cChar < 0x0020 )
3521 OSL_ENSURE( txtparae_bContainsIllegalCharacters ||
3523 "illegal character in text content" );
3524 txtparae_bContainsIllegalCharacters =
true;
3526 bExpCharAsText =
false;
3533 if(
nPos > nExpStartPos && !bExpCharAsText )
3535 SAL_WARN_IF( 0 != nSpaceChars,
"xmloff",
"pending spaces" );
3536 OUString sExp( rText.copy( nExpStartPos,
nPos - nExpStartPos ) );
3538 nExpStartPos =
nPos;
3544 if( nSpaceChars > 0 && !bCurrCharIsSpace )
3548 if( nSpaceChars > 1 )
3551 OUString::number(nSpaceChars) );
3555 XML_S,
false,
false );
3562 if( bExpCharAsElement )
3586 if( bCurrCharIsSpace && rPrevCharIsSpace )
3588 rPrevCharIsSpace = bCurrCharIsSpace;
3592 if( !bExpCharAsText )
3594 SAL_WARN_IF( nExpStartPos !=
nPos,
"xmloff",
"wrong export start pos" );
3595 nExpStartPos =
nPos+1;
3599 if( nExpStartPos < nEndPos )
3601 SAL_WARN_IF( 0 != nSpaceChars,
"xmloff",
" pending spaces " );
3602 OUString sExp( rText.copy( nExpStartPos, nEndPos - nExpStartPos ) );
3607 if( nSpaceChars > 0 )
3609 if( nSpaceChars > 1 )
3612 OUString::number(nSpaceChars) );
3627 if (!xPropertySet.is())
3631 OUString sIndexAutoMarkFileURL(
3632 "IndexAutoMarkFileURL");
3633 if (!xPropertySet->getPropertySetInfo()->hasPropertyByName(
3634 sIndexAutoMarkFileURL))
3637 xPropertySet->getPropertyValue(sIndexAutoMarkFileURL) >>= sUrl;
3638 if (!sUrl.isEmpty())
3641 GetExport().GetRelativeReference(sUrl) );
3650 const Reference<XText> & rText )
3657 pFieldExport->SetExportOnlyUsedFieldDeclarations(
false );
3667 const Reference<XText> & rText,
3675 const Reference<XText> & rText )
3713 if (*o3tl::doAccess<bool>(rPropSet->getPropertyValue(
gsIsCollapsed)))
3717 bool bStart = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(
gsIsStart));
3743 SAL_WARN_IF(sStyleName.isEmpty(),
"xmloff",
"Can't find ruby style!");
3790 bool i_bAutoStyles,
bool i_isProgress,
bool & rPrevCharIsSpace)
3792 bool doExport(!i_bAutoStyles);
3794 switch (
GetExport().getSaneDefaultVersion()) {
3800 const Reference< XTextContent > xTextContent(
3801 i_xPortion->getPropertyValue(
"InContentMetadata"), UNO_QUERY_THROW);
3802 const Reference< XEnumerationAccess > xEA( xTextContent, UNO_QUERY_THROW );
3803 const Reference< XEnumeration > xTextEnum( xEA->createEnumeration() );
3807 const Reference<rdf::XMetadatable> xMeta(xTextContent, UNO_QUERY_THROW);
3810 xMeta->ensureMetadataReference();
3825 const Reference<XIndexAccess> & rShapes,
3829 if( ( ! rShapes.is() ) || ( ! xFormExport.is() ) )
3836 Reference<XEnumeration> xShapesEnum =
pBoundFrameSets->GetShapes()->createEnumeration();
3837 if(!xShapesEnum.is())
3839 while( xShapesEnum->hasMoreElements() )
3847 Reference<XControlShape> xControlShape(xShapesEnum->nextElement(), UNO_QUERY);
3848 if( xControlShape.is() )
3854 Reference<XTextContent> xTextContent( xControlShape, UNO_QUERY );
3855 if( xTextContent.is() )
3863 xFormExport->excludeFromExport(
3864 xControlShape->getControl() );
rtl::Reference< SvXMLExportPropertyMapper > xFramePropMapper
constexpr OUStringLiteral gsUnvisitedCharStyleName(u"UnvisitedCharStyleName")
constexpr OUStringLiteral gsRedline(u"Redline")
::std::map< Reference< XFormField >, sal_Int32 > FieldMarkMap_t
constexpr OUStringLiteral gsTextFrameService(u"com.sun.star.text.TextFrame")
static void ExportParameter(OUStringBuffer &rStrBuffer, const css::drawing::EnhancedCustomShapeParameter &rParameter)
std::unique_ptr< XMLSectionExport > pSectionExport
SvXMLAutoStylePoolP & GetAutoStylePool()
rtl::Reference< SvXMLExportPropertyMapper > xAutoFramePropMapper
constexpr OUStringLiteral gsHeight(u"Height")
void exportSoftPageBreak()
constexpr OUStringLiteral gsGraphicRotation(u"GraphicRotation")
const BoundFrames * GetTexts() const
const BoundFrames * GetGraphics() const
bool BelongsToSameList(const XMLTextNumRuleInfo &rCmp) const
enum XMLTokenEnum lcl_XmlReferenceElements[]
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
virtual void _collectTextEmbeddedAutoStyles(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
static const char * aParagraphPropertyNames[]
rtl::Reference< XMLShapeExport > const & GetShapeExport()
constexpr OUStringLiteral gsTextFieldStartEnd(u"TextFieldStartEnd")
void exportContour(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
::std::vector< std::unique_ptr< XMLTextListsHelper > > maTextListsHelperStack
constexpr OUStringLiteral gsVisitedCharStyleName(u"VisitedCharStyleName")
sal_uInt32 GetStartValue() const
::comphelper::UnoInterfaceToUniqueIdentifierMapper & getInterfaceToIdentifierMapper()
constexpr OUStringLiteral gsContourPolyPolygon(u"ContourPolyPolygon")
double normalizeToRange(double v, const double fRange)
constexpr OUStringLiteral gsDocumentIndexMark(u"DocumentIndexMark")
bool IsContinueingPreviousSubTree() const
constexpr OUStringLiteral gsHyperLinkTarget(u"HyperLinkTarget")
constexpr OUStringLiteral gsHyperLinkURL(u"HyperLinkURL")
rtl::Reference< SvXMLExportPropertyMapper > xParaPropMapper
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
bool checkedProperties()
Return whether hasProperties was called (i.e.
unique_ptr< BoundFrames > m_pEmbeddeds
const SvXMLUnitConverter & GetMM100UnitConverter() const
void exportFrameFrames(bool bAutoStyles, bool bProgress, const css::uno::Reference< css::text::XTextFrame > *pParentTxtFrame)
void PopTextListsHelper()
OUString sOpenRubyCharStyle
void AddAttributesRDFa(css::uno::Reference< css::text::XTextContent > const &i_xTextContent)
add RDFa attributes for a metadatable text content
const OUString & GetListId() const
std::unique_ptr< XMLRedlineExport > pRedlineExport
may be NULL (if no redlines should be exported; e.g. in block mode)
void collectTextAutoStylesOptimized(bool bIsProgress)
static constexpr OUStringLiteral gsFootnote
const BoundFrames * GetShapes() const
constexpr sal_uInt16 XML_NAMESPACE_XLINK
information about list and list style for a certain paragraph
constexpr OUStringLiteral gsVertOrientPosition(u"VertOrientPosition")
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr OUStringLiteral gsTextPortionType(u"TextPortionType")
B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(const css::drawing::PointSequenceSequence &rPointSequenceSequenceSource)
static bool txtparae_bContainsIllegalCharacters
static bool convertMeasurePx(sal_Int32 &rValue, std::u16string_view rString)
constexpr OUStringLiteral gsTextField(u"TextField")
const css::uno::Any & getValue(sal_Int16 nIndex)
Get a value from the values array.
static constexpr OUStringLiteral gsCharStyleNames
constexpr OUStringLiteral gsIsAutomaticContour(u"IsAutomaticContour")
void exportMeta(const css::uno::Reference< css::beans::XPropertySet > &i_xPortion, bool i_bAutoStyles, bool i_isProgress, bool &rPrevCharIsSpace)
export a text:meta
void exportParagraph(const css::uno::Reference< css::text::XTextContent > &rTextContent, bool bAutoStyles, bool bProgress, bool bExportParagraph, MultiPropertySetHelper &rPropSetHelper, TextPNS eExtensionNS)
constexpr OUStringLiteral gsChainNextName(u"ChainNextName")
constexpr OUStringLiteral gsAnchorType(u"AnchorType")
void exportTextContentEnumeration(const css::uno::Reference< css::container::XEnumeration > &rContentEnum, bool bAutoStyles, const css::uno::Reference< css::text::XTextSection > &rBaseSection, bool bProgress, bool bExportParagraph=true, const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet=nullptr, TextPNS eExtensionNS=TextPNS::ODF)
constexpr OUStringLiteral gsSizeType(u"SizeType")
void SAL_DLLPRIVATE AddAttributeIdLegacy(sal_uInt16 const nLegacyPrefix, OUString const &rValue)
add xml:id and legacy namespace id
SvXMLExport & GetExport()
constexpr OUStringLiteral gsIsPixelContour(u"IsPixelContour")
static bool lcl_txtpara_isBoundAsChar(const Reference< XPropertySet > &rPropSet, const Reference< XPropertySetInfo > &rPropSetInfo)
B2DRange getB2DRange() const
void exportTextFrame(const css::uno::Reference< css::text::XTextContent > &rTextContent, bool bAutoStyles, bool bProgress, bool bExportContent, const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet=nullptr)
constexpr OUStringLiteral gsTextFieldStart(u"TextFieldStart")
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
constexpr OUStringLiteral gsFrame(u"Frame")
ProgressBarHelper * GetProgressBarHelper()
This class handles the export of index marks for table of content, alphabetical and user index...
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual ~XMLTextParagraphExport() override
void exportEvents(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
constexpr OUStringLiteral gsRuby(u"Ruby")
XMLShapeExportFlags addTextFrameAttributes(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool bShape, basegfx::B2DPoint *pCenter=nullptr, OUString *pMinHeightValue=nullptr, OUString *pMinWidthValue=nullptr)
std::unique_ptr< std::vector< OUString > > pListElements
const BoundFrames * GetEmbeddeds() const
void AddAttribute(sal_uInt16 nPrefix, const char *pName, const OUString &rValue)
void StartElement(sal_uInt16 nPrefix, enum::xmloff::token::XMLTokenEnum eName, bool bIgnWSOutside)
void exportTrackedChanges(bool bAutoStyle)
Export the list of change information (enclosed by ) (or the necessary automatic sty...
constexpr OUStringLiteral gsRubyCharStyleName(u"RubyCharStyleName")
virtual void _exportTextEmbedded(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
constexpr OUStringLiteral gsHoriOrientPosition(u"HoriOrientPosition")
bool hasProperty(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
bool hasProperty(sal_Int16 nIndex)
Find out if this property is supported.
constexpr OUStringLiteral gsReferenceMark(u"ReferenceMark")
XMLTextListsHelper * mpTextListsHelper
constexpr sal_uInt16 XML_NAMESPACE_DRAW
OUString AddEmbeddedXGraphic(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic, OUString &rOutMimeType, OUString const &rRequestedName=OUString())
B2IRange fround(const B2DRange &rRange)
XMLTokenEnum
The enumeration of all XML tokens.
void exportCharacterData(const OUString &rText, bool &rPrevCharWasSpace)
void exportTextField(const css::uno::Reference< css::text::XTextRange > &rTextRange, bool bAutoStyles, bool bProgress, bool *pPrevCharIsSpace)
constexpr OUStringLiteral gsIsSyncWidthToHeight(u"IsSyncWidthToHeight")
#define XML_STYLE_FAMILY_SD_GRAPHICS_NAME
static const char * aParagraphPropertyNamesAuto[]
constexpr OUStringLiteral gsNumberingRules(u"NumberingRules")
bool GetGraphicMimeTypeFromStream(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic, OUString &rOutMimeType)
static constexpr OUStringLiteral gsFrameStyleName
constexpr sal_uInt16 XML_NAMESPACE_XML
The MultiPropertySetHelper performs the following functions:
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
XMLTextListAutoStylePool maListAutoPool
constexpr OUStringLiteral gsTextFieldEnd(u"TextFieldEnd")
constexpr sal_uInt16 XML_NAMESPACE_SVG
constexpr OUStringLiteral gsVertOrient(u"VertOrient")
constexpr OUStringLiteral gsBookmark(u"Bookmark")
unique_ptr< BoundFrames > m_pTexts
constexpr OUStringLiteral gsAnchorPageNo(u"AnchorPageNo")
constexpr OUStringLiteral gsTextGraphicService(u"com.sun.star.text.TextGraphicObject")
BoundFrameSets(const Reference< XInterface > &rModel)
sal_Int16 GetLevel() const
constexpr sal_uInt16 XML_NAMESPACE_FO
void exportListAndSectionChange(css::uno::Reference< css::text::XTextSection > &rOldSection, const css::uno::Reference< css::text::XTextSection > &rNewSection, const XMLTextNumRuleInfo &rOldList, const XMLTextNumRuleInfo &rNewList, bool bAutoStyles)
check if current section or current list has changed; calls exportListChange as appropriate ...
constexpr OUStringLiteral gsShapeService(u"com.sun.star.drawing.Shape")
constexpr OUStringLiteral gsServerMap(u"ServerMap")
XMLEventExport & GetEventExport()
get Event export, with handlers for script types "None" and "StarBasic" already registered; other han...
constexpr OUStringLiteral gsTextFieldService(u"com.sun.star.text.TextField")
constexpr sal_uInt16 XML_NAMESPACE_TEXT
rtl::Reference< SvXMLExportPropertyMapper > xTextPropMapper
constexpr OUStringLiteral gsTitle(u"Title")
const OUString & GetNumRulesName() const
constexpr OUStringLiteral gsWidthType(u"WidthType")
void exportTextDeclarations()
This method exports (text field) declarations etc.
static SvXMLExportPropertyMapper * CreateParaDefaultExtPropMapper(SvXMLExport &rExport)
virtual void exportTable(const css::uno::Reference< css::text::XTextContent > &rTextContent, bool bAutoStyles, bool bProgress)
void recordTrackedChangesForXText(const css::uno::Reference< css::text::XText > &rText)
Record tracked changes for this particular XText (empty reference stop recording) This should be used...
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class...
OUString Add(const css::uno::Reference< css::container::XIndexReplace > &rNumRules)
void PushNewTextListsHelper()
void Export(const css::uno::Reference< css::beans::XPropertySet > &rPropertySet)
Get the ImageMap object from the "ImageMap" property and subsequently export the map (if present)...
void exportTextRangeEnumeration(const css::uno::Reference< css::container::XEnumeration > &rRangeEnum, bool bAutoStyles, bool bProgress, bool &rPrevCharIsSpace)
void AddFamily(XmlStyleFamily nFamily, const OUString &rStrName, SvXMLExportPropertyMapper *pMapper, const OUString &aStrPrefix)
register a new family with its appropriate instance of a derivation of XMLPropertySetMapper for famil...
constexpr OUStringLiteral gsDescription(u"Description")
void exportShape(const css::uno::Reference< css::text::XTextContent > &rTextContent, bool bAutoStyles, const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet=nullptr)
void exportPageFrames(bool bProgress)
static SvXMLExportPropertyMapper * CreateCharExtPropMapper(SvXMLExport &rExport)
void hasProperties(const css::uno::Reference< css::beans::XPropertySetInfo > &)
Call hasPropertiesByName for the provided XPropertySetInfo and build list of allowed properties...
const OUString & getIdentifier(const css::uno::Reference< css::uno::XInterface > &rInterface) const
XMLImageMapExport & GetImageMapExport()
get the export for image maps
constexpr OUStringLiteral gsWidth(u"Width")
css::uno::Type const & get()
constexpr OUStringLiteral gsText(u"Text")
void exportTextRange(const css::uno::Reference< css::text::XTextRange > &rTextRange, bool bAutoStyles, bool &rPrevCharWasSpace, FieldmarkType &openFieldmarkType)
This class handles the export of sections and indices (which are, internally, just sections)...
enum XMLTokenEnum lcl_XmlBookmarkElements[]
void Add(XmlStyleFamily nFamily, MultiPropertySetHelper &rPropSetHelper, const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
add autostyle for specified family
void recordTrackedChangesNoXText()
Stop recording tracked changes.
bool addHyperlinkAttributes(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertyState > &rPropState, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
void exportRuby(const css::uno::Reference< css::beans::XPropertySet > &rPortionPropSet, bool bAutoStyles)
export a ruby
constexpr OUStringLiteral gsTextEmbeddedService(u"com.sun.star.text.TextEmbeddedObject")
void _exportTextFrame(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo, bool bProgress)
constexpr OUStringLiteral gsIsCollapsed(u"IsCollapsed")
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
constexpr OUStringLiteral gsRelativeWidth(u"RelativeWidth")
void PreventExportOfControlsInMuteSections(const css::uno::Reference< css::container::XIndexAccess > &rShapes, const rtl::Reference< xmloff::OFormLayerXMLExport > &xFormExport)
exclude form controls which are in mute sections.
sal_Int32 GetValue() const
void exportTextMark(const css::uno::Reference< css::beans::XPropertySet > &xPropSet, const OUString &rProperty, const enum::xmloff::token::XMLTokenEnum pElements[], bool bAutoStyles)
constexpr OUStringLiteral gsRelativeHeight(u"RelativeHeight")
constexpr OUStringLiteral gsRubyText(u"RubyText")
void exportTextGraphic(const css::uno::Reference< css::text::XTextContent > &rTextContent, bool bAutoStyles, const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet=nullptr)
const ::std::unique_ptr< ::xmloff::BoundFrameSets > pBoundFrameSets
std::unique_ptr< char[]> aBuffer
const OUString & ListLabelString() const
void Set(const css::uno::Reference< css::text::XTextContent > &rTextContent, const bool bOutlineStyleAsNormalListStyle, const XMLTextListAutoStylePool &rListAutoPool, const bool bExportTextNumberElement)
constexpr OUStringLiteral gsTextContentService(u"com.sun.star.text.TextContent")
void EndElement(sal_uInt16 nPrefix, enum::xmloff::token::XMLTokenEnum eName, bool bIgnWSInside)
constexpr OUStringLiteral gsParagraphService(u"com.sun.star.text.Paragraph")
virtual void exportTableAutoStyles()
static constexpr OUStringLiteral gsTextSection
void exportTextRangeSpan(const css::uno::Reference< css::text::XTextRange > &rTextRange, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, css::uno::Reference< css::beans::XPropertySetInfo > &xPropSetInfo, const bool bIsUICharStyle, const bool bHasAutoStyle, const OUString &sStyle, bool &rPrevCharIsSpace, FieldmarkType &openFieldMark)
std::unique_ptr< XMLTextFieldExport > pFieldExport
#define SAL_WARN_IF(condition, area, stream)
void exportTitleAndDescription(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
rtl::Reference< SvXMLExportPropertyMapper > xSectionPropMapper
const XMLTextListAutoStylePool & GetListAutoStylePool() const
void _exportTextGraphic(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
static bool IsInSection(const css::uno::Reference< css::text::XTextSection > &rEnclosingSection, const css::uno::Reference< css::text::XTextContent > &rContent, bool bDefault)
Determine whether rContent is contained in rEnclosingSection.
Handling of tokens in XML:
void exportXML(XmlStyleFamily nFamily) const
Export all item sets ofs a certain class in the order in that they have been added.
void Characters(const OUString &rChars)
void exportTextEmbedded(const css::uno::Reference< css::text::XTextContent > &rTextContent, bool bAutoStyles, const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet=nullptr)
sal_Int32 AddFieldMarkStart(Reference< XFormField > const &i_xFieldMark)
void exportTextFootnote(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &sString, bool bAutoStyles, bool bProgress)
export a footnote and styles
unique_ptr< BoundFrames > m_pGraphics
Smart struct to transport an Any with an index to the appropriate property-name.
constexpr OUStringLiteral gsIsSyncHeightToWidth(u"IsSyncHeightToWidth")
void SetValue(sal_Int32 nValue)
OUString exportToSvgPoints(const B2DPolygon &rPoly)
constexpr OUStringLiteral gsParaConditionalStyleName(u"ParaConditionalStyleName")
constexpr OUStringLiteral gsTableService(u"com.sun.star.text.TextTable")
XMLTextParagraphExport(SvXMLExport &rExp, SvXMLAutoStylePoolP &rASP)
bool HasStartValue() const
SvXMLAutoStylePoolP & rAutoStylePool
constexpr OUStringLiteral gsHoriOrient(u"HoriOrient")
eParagraphPropertyNamesEnumAuto
static bool lcl_validPropState(const XMLPropertyState &rState)
constexpr OUStringLiteral gsGraphicFilter(u"GraphicFilter")
static SvXMLExportPropertyMapper * CreateShapeExtPropMapper(SvXMLExport &rExport)
bool AddEmbeddedXGraphicAsBase64(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic)
void exportTextAutoStyles()
#define CTF_HYPERLINK_URL
FieldMarkMap_t m_FieldMarkMap
std::unique_ptr< XMLIndexMarkExport > pIndexMarkExport
#define SAL_WARN(area, stream)
static SvXMLExportPropertyMapper * CreateParaExtPropMapper(SvXMLExport &rExport)
OUString FindTextStyleAndHyperlink(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool &rbHyperlink, bool &rbHasCharStyle, bool &rbHasAutoStyle, const XMLPropertyState **pAddState=nullptr) const
OUString exportToSvgD(const B2DPolyPolygon &rPolyPoly, bool bUseRelativeCoordinates, bool bDetectQuadraticBeziers, bool bHandleRelativeNextPointCompatible, bool bOOXMLMotionPath=false)
std::unique_ptr< Impl > m_xImpl
void AddAttributeXmlId(css::uno::Reference< css::uno::XInterface > const &i_xIfc)
add xml:id attribute (for RDF metadata)
SinglePropertySetInfoCache aCharStyleNamesPropInfoCache
sal_Int32 GetFieldMarkIndex(Reference< XFormField > const &i_xFieldMark)
OUString Find(XmlStyleFamily nFamily, const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &rParent, const XMLPropertyState **pAddState=nullptr) const
find style name for specified family and parent
unique_ptr< BoundFrames > m_pShapes
eParagraphPropertyNamesEnum
constexpr OUStringLiteral gsSoftPageBreak(u"SoftPageBreak")
css::uno::Any const SvXMLExport & rExport
void exportAnyTextFrame(const css::uno::Reference< css::text::XTextContent > &rTextContent, FrameType eTxpe, bool bAutoStyles, bool bProgress, bool bExportContent, const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet)
constexpr OUStringLiteral gsHyperLinkName(u"HyperLinkName")
#define CTF_CHAR_STYLE_NAME
Reference< XGraphic > xGraphic
This class handles the export of redline portions.
constexpr OUStringLiteral gsIsStart(u"IsStart")
void convertMeasureToXML(OUStringBuffer &rBuffer, sal_Int32 nMeasure) const
convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit
constexpr sal_uInt16 XML_NAMESPACE_STYLE
sal_Int16 GetListLevelStartValue() const
rtl::Reference< SvXMLExportPropertyMapper > xRubyPropMapper
void exportListChange(const XMLTextNumRuleInfo &rPrvInfo, const XMLTextNumRuleInfo &rNextInfo)
void exportUsedDeclarations()
export all declarations
void exportText(const css::uno::Reference< css::text::XText > &rText, bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS eExtensionNS=TextPNS::ODF)
constexpr sal_uInt16 XML_NAMESPACE_FIELD
void Export(css::uno::Reference< css::document::XEventsSupplier > const &xAccess, bool bUseWhitespace=true)
export the events (calls EventExport::Export(Reference) )