25#include <com/sun/star/container/XEnumerationAccess.hpp>
26#include <com/sun/star/frame/XModel.hpp>
27#include <com/sun/star/lang/XMultiServiceFactory.hpp>
28#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
29#include <com/sun/star/text/ReferenceFieldSource.hpp>
30#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
31#include <com/sun/star/text/XTextFrame.hpp>
32#include <com/sun/star/text/XTextFieldsSupplier.hpp>
33#include <com/sun/star/text/XTextFramesSupplier.hpp>
34#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
35#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
36#include <com/sun/star/text/XFormField.hpp>
37#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
38#include <com/sun/star/container/XNamed.hpp>
39#include <com/sun/star/style/XStyle.hpp>
70#include <com/sun/star/beans/XPropertyState.hpp>
75using ::com::sun::star::ucb::XAnyCompare;
92#define MAX_COMBINED_CHARACTERS 6
116 std::unique_ptr< std::vector< OUString > []>
121 uno::Reference<text::XTextRange>, OUString,
122 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > >
168 typedef ::std::tuple<field_name_type_t, field_params_t, uno::Reference<text::XFormField>, uno::Reference<text::XTextRange>>
field_stack_item_t;
177 Impl( uno::Reference<frame::XModel>
const& rModel,
178 SvXMLImport & rImport,
179 bool const bInsertMode,
bool const bStylesOnlyMode,
180 bool const bProgress,
bool const bBlockMode,
181 bool const bOrganizerMode)
204 new ::std::vector< OUString >[
size] );
223 return m_xImpl->m_xCursorAsRange;
233 return m_xImpl->m_bStylesOnlyMode;
243 return m_xImpl->m_bOrganizerMode;
251uno::Reference<container::XNameContainer>
const&
257uno::Reference<container::XNameContainer>
const&
263uno::Reference<container::XNameContainer>
const&
269uno::Reference<container::XNameContainer>
const&
272 return m_xImpl->m_xFrameStyles;
275uno::Reference<container::XNameContainer>
const&
281uno::Reference<container::XNameContainer>
const&
287uno::Reference<container::XIndexReplace>
const&
290 return m_xImpl->m_xChapterNumbering;
296 return m_xImpl->m_xParaImpPrMap;
302 return m_xImpl->m_xTextImpPrMap;
308 return m_xImpl->m_xSectionImpPrMap;
314 return m_xImpl->m_xRubyImpPrMap;
319 m_xImpl->m_bInsideDeleteContext = bNew;
324 return m_xImpl->m_bInsideDeleteContext;
329 return m_xImpl->m_rSvXMLImport;
334 return *
m_xImpl->m_xTextListsHelper;
339 class FieldParamImporter
342 typedef std::pair<OUString,OUString> field_param_t;
343 typedef std::vector<field_param_t> field_params_t;
344 FieldParamImporter(
const field_params_t*
const pInParams, Reference<XNameContainer>
const & xOutParams)
345 : m_pInParams(pInParams)
346 , m_xOutParams(xOutParams)
351 const field_params_t*
const m_pInParams;
352 Reference<XNameContainer> m_xOutParams;
355 void FieldParamImporter::Import()
357 ::std::vector<OUString> vListEntries;
358 ::std::map<OUString, Any> vOutParams;
359 for(
const auto& rCurrent : *m_pInParams)
364 vOutParams[rCurrent.first] <<= rCurrent.second.toInt32();
369 vOutParams[rCurrent.first] <<= rCurrent.second.toBoolean();
374 vListEntries.push_back(rCurrent.second);
377 vOutParams[rCurrent.first] <<= rCurrent.second;
379 if(!vListEntries.empty())
381 Sequence<OUString> vListEntriesSeq(vListEntries.size());
382 copy(vListEntries.begin(), vListEntries.end(), vListEntriesSeq.getArray());
385 for(
const auto& rCurrent : vOutParams)
389 m_xOutParams->insertByName(rCurrent.first, rCurrent.second);
391 catch(
const ElementExistException&)
393 SAL_INFO(
"xmloff.text",
"duplicate fieldmark param");
400 uno::Reference<frame::XModel>
const& rModel,
401 SvXMLImport& rImport,
402 bool const bInsertMode,
bool const bStylesOnlyMode,
403 bool const bProgress,
bool const bBlockMode,
404 bool const bOrganizerMode)
405 : m_xImpl( new Impl(rModel, rImport, bInsertMode, bStylesOnlyMode,
406 bProgress, bBlockMode, bOrganizerMode) )
407 , m_xBackpatcherImpl( MakeBackpatcherImpl() )
409 static constexpr OUStringLiteral s_PropNameDefaultListId =
u"DefaultListId";
411 Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY );
413 if (xCNSupplier.is())
416 m_xImpl->m_xChapterNumbering = xCNSupplier->getChapterNumberingRules();
420 Reference< XPropertySet >
const xNumRuleProps(
421 m_xImpl->m_xChapterNumbering, UNO_QUERY);
422 if ( xNumRuleProps.is() )
424 Reference< XPropertySetInfo > xNumRulePropSetInfo(
425 xNumRuleProps->getPropertySetInfo());
426 if (xNumRulePropSetInfo.is() &&
427 xNumRulePropSetInfo->hasPropertyByName(
428 s_PropNameDefaultListId))
431 xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
433 assert( !sListId.isEmpty() &&
434 "no default list id found at chapter numbering rules instance. Serious defect." );
435 if ( !sListId.isEmpty() )
437 Reference< XNamed >
const xChapterNumNamed(
438 m_xImpl->m_xChapterNumbering, UNO_QUERY);
439 if ( xChapterNumNamed.is() )
441 m_xImpl->m_xTextListsHelper->KeepListAsProcessed(
443 xChapterNumNamed->getName(),
452 Reference< XStyleFamiliesSupplier > xFamiliesSupp( rModel, UNO_QUERY );
455 if( xFamiliesSupp.is() )
457 Reference< XNameAccess > xFamilies(xFamiliesSupp->getStyleFamilies());
459 static constexpr OUStringLiteral aParaStyles(u
"ParagraphStyles");
460 if( xFamilies->hasByName( aParaStyles ) )
462 m_xImpl->m_xParaStyles.set(xFamilies->getByName(aParaStyles),
466 static constexpr OUStringLiteral aCharStyles(u
"CharacterStyles");
467 if( xFamilies->hasByName( aCharStyles ) )
469 m_xImpl->m_xTextStyles.set(xFamilies->getByName(aCharStyles),
473 static constexpr OUStringLiteral aNumStyles(u
"NumberingStyles");
474 if( xFamilies->hasByName( aNumStyles ) )
476 m_xImpl->m_xNumStyles.set(xFamilies->getByName(aNumStyles),
480 static constexpr OUStringLiteral aFrameStyles(u
"FrameStyles");
481 if( xFamilies->hasByName( aFrameStyles ) )
483 m_xImpl->m_xFrameStyles.set(xFamilies->getByName(aFrameStyles),
487 static constexpr OUStringLiteral aPageStyles(u
"PageStyles");
488 if( xFamilies->hasByName( aPageStyles ) )
490 m_xImpl->m_xPageStyles.set(xFamilies->getByName(aPageStyles),
494 static constexpr OUStringLiteral aCellStyles(u
"CellStyles");
495 if( xFamilies->hasByName( aCellStyles ) )
497 m_xImpl->m_xCellStyles.set(xFamilies->getByName(aCellStyles),
502 Reference < XTextFramesSupplier > xTFS( rModel, UNO_QUERY );
505 m_xImpl->m_xTextFrames.set(xTFS->getTextFrames());
508 Reference < XTextGraphicObjectsSupplier > xTGOS( rModel, UNO_QUERY );
511 m_xImpl->m_xGraphics.set(xTGOS->getGraphicObjects());
514 Reference < XTextEmbeddedObjectsSupplier > xTEOS( rModel, UNO_QUERY );
517 m_xImpl->m_xObjects.set(xTEOS->getEmbeddedObjects());
549 m_xImpl->m_xAutoStyles->dispose();
576 return pImportMapper;
581 SvXMLImport& rImport )
590 SvXMLImport& rImport )
599 SvXMLImport& rImport )
617 m_xImpl->m_xCursor.set(rCursor);
618 m_xImpl->m_xText.set(rCursor->getText());
619 m_xImpl->m_xCursorAsRange = rCursor;
624 m_xImpl->m_xCursor.set(
nullptr);
626 m_xImpl->m_xCursorAsRange.set(
nullptr);
632 return (
m_xImpl->m_xTextFrames.is() &&
633 m_xImpl->m_xTextFrames->hasByName(rName))
634 || (
m_xImpl->m_xGraphics.is() &&
635 m_xImpl->m_xGraphics->hasByName(rName))
636 || (
m_xImpl->m_xObjects.is() &&
637 m_xImpl->m_xObjects->hasByName(rName));
644 uno::Reference<beans::XPropertySet> xOtherFrame;
646 xOtherFrame.set(
m_xImpl->m_xTextFrames->getByName(
sName), uno::UNO_QUERY);
648 xOtherFrame.set(
m_xImpl->m_xGraphics->getByName(
sName), uno::UNO_QUERY);
650 xOtherFrame.set(
m_xImpl->m_xObjects->getByName(
sName), uno::UNO_QUERY);
652 Reference< XPropertySetInfo > xPropSetInfo = xOtherFrame->getPropertySetInfo();
653 if(xPropSetInfo->hasPropertyByName(
"Width"))
655 sal_Int32 nOtherWidth = 0;
656 xOtherFrame->getPropertyValue(
"Width") >>= nOtherWidth;
657 if(nWidth != nOtherWidth)
661 if (xPropSetInfo->hasPropertyByName(
"Height"))
663 sal_Int32 nOtherHeight = 0;
664 xOtherFrame->getPropertyValue(
"Height") >>= nOtherHeight;
665 if (nHeight != nOtherHeight)
669 if (xPropSetInfo->hasPropertyByName(
"HoriOrientPosition"))
671 sal_Int32 nOtherX = 0;
672 xOtherFrame->getPropertyValue(
"HoriOrientPosition") >>= nOtherX;
677 if (xPropSetInfo->hasPropertyByName(
"VertOrientPosition"))
679 sal_Int32 nOtherY = 0;
680 xOtherFrame->getPropertyValue(
"VertOrientPosition") >>= nOtherY;
693 m_xImpl->msLastImportedFrameName = rName;
698 m_xImpl->msLastImportedFrameName.clear();
704 assert(
m_xImpl->m_xCursorAsRange.is());
713 bool& rIgnoreLeadingSpace )
716 assert(
m_xImpl->m_xCursorAsRange.is());
720 sal_Int32 nLen = rChars.size();
721 OUStringBuffer sChars( nLen );
723 for( sal_Int32
i=0;
i < nLen;
i++ )
732 if( !rIgnoreLeadingSpace )
733 sChars.append(
u' ' );
734 rIgnoreLeadingSpace =
true;
737 rIgnoreLeadingSpace =
false;
743 sChars.makeStringAndClear(),
false);
749 assert(
m_xImpl->m_xCursorAsRange.is());
752 m_xImpl->m_xText->insertControlCharacter(
753 m_xImpl->m_xCursorAsRange, nControl,
false);
758 Reference < XTextContent >
const & xContent )
761 assert(
m_xImpl->m_xCursorAsRange.is());
765 m_xImpl->m_xText->insertTextContent(
m_xImpl->m_xCursorAsRange, xContent,
false);
772 assert(
m_xImpl->m_xCursor.is());
773 assert(
m_xImpl->m_xCursorAsRange.is());
776 Reference < XEnumerationAccess >
const xEnumAccess(
777 m_xImpl->m_xCursor, UNO_QUERY);
778 if( xEnumAccess.is() )
780 Reference < XEnumeration > xEnum(xEnumAccess->createEnumeration());
781 SAL_WARN_IF(!xEnum->hasMoreElements(),
"xmloff.text",
782 "empty text enumeration");
783 if( xEnum->hasMoreElements() )
785 Reference < XComponent > xComp( xEnum->nextElement(), UNO_QUERY );
796 if (
m_xImpl->m_xCursor->goLeft( 1,
true ))
805 const OUString& rStyleName,
808 SvXMLImport& rImport )
const
810 OUStringBuffer sChars( rChars );
811 bool bConverted =
false;
812 for( sal_Int32 j=0; j<rChars.getLength(); j++ )
815 if( c >= 0xf000 && c <= 0xf0ff )
822 if (!rStyleName.isEmpty() &&
m_xImpl->m_xAutoStyles.is())
826 FindStyleChildContext( nFamily, rStyleName,
837 m_xImpl->m_xAutoStyles->GetImportPropertyMapper(nFamily);
841 xImpPrMap->getPropertySetMapper();
845 sal_Int32 nIdx = rProp.
mnIndex;
846 sal_uInt32 nContextId = rPropMapper->GetEntryContextId(nIdx);
852 if( sFontName.equalsIgnoreAsciiCase(
"StarBats" ) )
854 else if( sFontName.equalsIgnoreAsciiCase(
"StarMath" ) )
868 sChars[j] = rImport.ConvStarBatsCharToStarSymbol( c );
873 sChars[j] = rImport.ConvStarMathCharToStarSymbol( c );
879 return bConverted ? sChars.makeStringAndClear() : rChars;
889 const Reference < XNameContainer >& xParaStyles,
890 SvXMLImport
const & rImport,
891 const OUString& sNumberingStyleName,
892 std::u16string_view sOutlineStyleName )
896 if ( !xParaStyles->hasByName( sStyleName ) )
902 Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ),
904 if ( !xPropState.is() )
910 if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
915 Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
919 xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
920 if ( !sListStyle.isEmpty() &&
921 sListStyle == sOutlineStyleName )
931 sal_Int32 nBuild( 0 );
933 const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
935 Reference<XStyle> xStyle( xPropState, UNO_QUERY );
936 while ( xStyle.is() )
938 OUString aParentStyle( xStyle->getParentStyle() );
939 if ( !aParentStyle.isEmpty() )
945 if ( aParentStyle.isEmpty() || !xParaStyles->hasByName( aParentStyle ) )
952 xPropState.set( xParaStyles->getByName( aParentStyle ),
954 if ( !xPropState.is() )
959 if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
964 Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
968 xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
969 if ( !sListStyle.isEmpty() &&
970 sListStyle == sOutlineStyleName )
978 else if ( sListStyle.isEmpty() &&
979 ( rImport.IsTextDocInOOoFileFormat() ||
981 ( ( nUPD == 641 ) || ( nUPD == 645 ) ||
982 ( nUPD == 680 && nBuild <= 9238 ) ) ) ) )
992 Reference<XStyle> xParentStyle(xPropState, UNO_QUERY);
993 if (xStyle == xParentStyle)
998 xStyle = xParentStyle;
1007 SvXMLImport
const & rImport,
1008 const Reference < XTextCursor >& rCursor,
1009 const OUString& rStyleName,
1011 bool bOutlineLevelAttrFound,
1015 bool bOutlineContentVisible)
1017 static constexpr OUStringLiteral s_NumberingRules =
u"NumberingRules";
1018 static constexpr OUStringLiteral s_NumberingIsNumber =
u"NumberingIsNumber";
1019 static constexpr OUStringLiteral s_NumberingLevel =
u"NumberingLevel";
1020 static constexpr OUStringLiteral s_ParaIsNumberingRestart =
u"ParaIsNumberingRestart";
1021 static constexpr OUStringLiteral s_NumberingStartValue =
u"NumberingStartValue";
1022 static constexpr OUStringLiteral s_PropNameListId =
u"ListId";
1023 static constexpr OUStringLiteral s_PageDescName =
u"PageDescName";
1024 static constexpr OUStringLiteral s_OutlineLevel =
u"OutlineLevel";
1029 OUString sStyleName( rStyleName );
1030 if (!sStyleName.isEmpty() &&
m_xImpl->m_xAutoStyles.is())
1033 m_xImpl->m_xAutoStyles->FindStyleChildContext( nFamily, sStyleName,
true );
1039 Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
1040 Reference< XPropertySetInfo > xPropSetInfo(
1041 xPropSet->getPropertySetInfo());
1044 if( !sStyleName.isEmpty() )
1046 sStyleName = rImport.GetStyleDisplayName( nFamily, sStyleName );
1047 const OUString rPropName = bPara ? OUString(
"ParaStyleName") : OUString(
"CharStyleName");
1048 const Reference < XNameContainer > & rStyles = bPara
1052 xPropSetInfo->hasPropertyByName( rPropName ) &&
1053 rStyles->hasByName( sStyleName ) )
1055 xPropSet->setPropertyValue( rPropName,
Any(sStyleName) );
1064 bool bApplyOutlineLevelAsListLevel(
false );
1066 if (bSetListAttrs && bPara
1067 && xPropSetInfo->hasPropertyByName( s_NumberingRules))
1070 Reference< XIndexReplace >
const xNumRules(
1071 xPropSet->getPropertyValue(s_NumberingRules), UNO_QUERY);
1077 pListBlock, pListItem, pNumberedParagraph);
1079 assert(!(pListBlock && pNumberedParagraph) &&
"XMLTextImportHelper::"
1080 "SetStyleAndAttrs: both list and numbered-paragraph???");
1082 Reference < XIndexReplace > xNewNumRules;
1085 sal_Int16 nStartValue(-1);
1086 bool bNumberingIsNumber(
true);
1095 bApplyNumRules =
true;
1099 bNumberingIsNumber =
false;
1114 sListId =
m_xImpl->m_xTextListsHelper->GetListIdForListBlock(
1117 else if (pNumberedParagraph)
1119 xNewNumRules.set(pNumberedParagraph->
GetNumRules());
1121 sListId = pNumberedParagraph->
GetListId();
1126 if (pListBlock || pNumberedParagraph)
1128 if ( !bApplyNumRules )
1130 bool bSameNumRules = xNewNumRules == xNumRules;
1131 if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
1137 Reference< XNamed > xNewNamed( xNewNumRules, UNO_QUERY );
1138 Reference< XNamed > xNamed( xNumRules, UNO_QUERY );
1139 if( xNewNamed.is() && xNamed.is() )
1141 bSameNumRules = xNewNamed->getName() == xNamed->getName();
1145 Reference< XAnyCompare > xNumRuleCompare( xNumRules, UNO_QUERY );
1146 if( xNumRuleCompare.is() )
1148 bSameNumRules = (xNumRuleCompare->compare(
Any(xNumRules),
Any(xNewNumRules) ) == 0);
1152 bApplyNumRules = !bSameNumRules;
1155 if ( bApplyNumRules )
1164 xPropSet->setPropertyValue(
1165 s_NumberingRules,
Any(xNewNumRules) );
1175 if (!bNumberingIsNumber &&
1176 xPropSetInfo->hasPropertyByName(s_NumberingIsNumber))
1178 xPropSet->setPropertyValue(s_NumberingIsNumber,
Any(
false));
1181 xPropSet->setPropertyValue( s_NumberingLevel,
Any(nLevel) );
1186 if (xPropSetInfo->hasPropertyByName(s_ParaIsNumberingRestart))
1188 xPropSet->setPropertyValue(s_ParaIsNumberingRestart,
1194 if ( 0 <= nStartValue &&
1195 xPropSetInfo->hasPropertyByName(s_NumberingStartValue))
1197 xPropSet->setPropertyValue(s_NumberingStartValue,
1201 if (xPropSetInfo->hasPropertyByName(s_PropNameListId))
1203 if (!sListId.isEmpty()) {
1204 xPropSet->setPropertyValue(s_PropNameListId,
1217 if( xNumRules.is() )
1219 bool bRemove(
true );
1221 sal_Int32 nUPD( 0 );
1222 sal_Int32 nBuild( 0 );
1223 const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
1224 if ( ( bBuildIdFound && nUPD == 680 ) ||
1227 if (
m_xImpl->m_xChapterNumbering.is())
1229 Reference< XNamed > xNumNamed( xNumRules, UNO_QUERY );
1230 Reference< XNamed >
const xChapterNumNamed (
1231 m_xImpl->m_xChapterNumbering, UNO_QUERY);
1232 if ( xNumNamed.is() && xChapterNumNamed.is() &&
1233 xNumNamed->getName() == xChapterNumNamed->getName() )
1237 bApplyOutlineLevelAsListLevel =
true;
1245 "automatic paragraph style with list style name, but paragraph not in list???");
1249 xPropSet->setPropertyValue( s_NumberingRules,
Any() );
1260 xPropSetInfo->hasPropertyByName(s_PageDescName))
1263 rImport.GetStyleDisplayName(
1267 (
m_xImpl->m_xPageStyles.is() &&
1270 xPropSet->setPropertyValue(s_PageDescName,
1278 rImport.GetStyleDisplayName(
1282 xPropSetInfo->hasPropertyByName(
"DropCapCharStyleName"))
1284 xPropSet->setPropertyValue(
"DropCapCharStyleName",
Any(
sDisplayName));
1292 if (
m_xImpl->m_xServiceFactory.is())
1294 uno::Reference<beans::XPropertySet>
const xTmp(
1295 m_xImpl->m_xServiceFactory->createInstance(
1296 "com.sun.star.text.TextField.CombinedCharacters"), UNO_QUERY);
1301 if (rCursor->getString().getLength() >
1304 rCursor->gotoRange(rCursor->getStart(),
false);
1309 xTmp->setPropertyValue(
"Content",
1310 Any(rCursor->getString()));
1313 Reference<XTextContent> xTextContent(xTmp, UNO_QUERY);
1314 if (
m_xImpl->m_xText.is() && rCursor.is())
1318 m_xImpl->m_xText->insertTextContent( rCursor->getStart(), xTextContent,
true );
1320 if( !rCursor->getString().isEmpty() )
1324 uno::Reference< text::XTextCursor > xCrsr = rCursor->getText()->createTextCursorByRange( rCursor->getStart() );
1325 xCrsr->goLeft( 1,
true );
1326 uno::Reference< beans::XPropertySet> xCrsrProperties( xCrsr, uno::UNO_QUERY_THROW );
1329 xCrsr->collapseToEnd();
1330 xCrsr->gotoRange( rCursor->getEnd(),
true );
1331 xCrsr->setString( OUString() );
1333 catch(
const uno::Exception&)
1356 sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
1357 const bool bHasOutlineLevelProp(
1358 xPropSetInfo->hasPropertyByName(s_OutlineLevel));
1359 if ( bHasOutlineLevelProp )
1361 xPropSet->getPropertyValue(s_OutlineLevel)
1362 >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
1364 if ( nOutlineLevel > 0 )
1366 if ( bHasOutlineLevelProp )
1370 if ( nCurrentOutlineLevelInheritedFromParagraphStyle != nOutlineLevel )
1372 xPropSet->setPropertyValue( s_OutlineLevel,
1373 Any(
static_cast<sal_Int16
>(nOutlineLevel) ) );
1376 if (!bOutlineContentVisible)
1378 uno::Sequence<beans::PropertyValue> aGrabBag;
1379 xPropSet->getPropertyValue(
"ParaInteropGrabBag") >>= aGrabBag;
1380 sal_Int32
length = aGrabBag.getLength();
1381 aGrabBag.realloc(
length + 1);
1382 auto pGrabBag = aGrabBag.getArray();
1383 pGrabBag[
length].Name =
"OutlineContentVisibleAttr";
1384 pGrabBag[
length].Value <<= bool(bOutlineContentVisible);
1385 xPropSet->setPropertyValue(
"ParaInteropGrabBag",
uno::Any(aGrabBag));
1388 if ( bApplyOutlineLevelAsListLevel )
1390 sal_Int16 nNumLevel = -1;
1391 xPropSet->getPropertyValue( s_NumberingLevel ) >>= nNumLevel;
1392 if ( nNumLevel == -1 ||
1393 nNumLevel != (nOutlineLevel - 1) )
1395 xPropSet->setPropertyValue( s_NumberingLevel,
1396 Any(
static_cast<sal_Int8>(nOutlineLevel - 1) ) );
1408 if (
m_xImpl->m_xParaStyles.is() &&
m_xImpl->m_xParaStyles->hasByName(sStyleName))
1410 bool bOutlineStyleCandidate(
false );
1412 sal_Int32 nUPD( 0 );
1413 sal_Int32 nBuild( 0 );
1414 const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
1417 if ( rImport.IsTextDocInOOoFileFormat() ||
1419 ( nUPD == 645 || nUPD == 641 ) ) )
1421 bOutlineStyleCandidate =
true;
1423 else if ( nUPD == 680 && nBuild <= 9073 )
1425 bOutlineStyleCandidate = bOutlineLevelAttrFound;
1427 if ( bOutlineStyleCandidate )
1433 !bOutlineStyleCandidate &&
1434 m_xImpl->m_xChapterNumbering.is())
1438 u"NumberingStyleName",
1442 xPropSet->setPropertyValue( s_NumberingRules,
1444 xPropSet->setPropertyValue( s_NumberingLevel,
1451 else if( bHasOutlineLevelProp )
1453 if ( nCurrentOutlineLevelInheritedFromParagraphStyle != 0 )
1455 xPropSet->setPropertyValue(s_OutlineLevel,
1456 Any( sal_Int16(0) ));
1468 if( !rStyleName.isEmpty() )
1472 if (
m_xImpl->m_xChapterNumbering.is() &&
1473 ( nOutlineLevel > 0 ) &&
1474 (nOutlineLevel <= m_xImpl->m_xChapterNumbering->getCount()))
1481 m_xImpl->InitOutlineStylesCandidates();
1482 if (
m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel].empty())
1488 m_xImpl->m_xChapterNumbering->getByIndex( nOutlineLevel )
1491 [](
const PropertyValue& rProp) {
return rProp.Name ==
"HeadingStyleName"; });
1494 OUString aOutlineStyle;
1495 pProp->Value >>= aOutlineStyle;
1496 m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel]
1497 .push_back( aOutlineStyle );
1505 m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel].back();
1512 const OUString& rStyleName )
1514 if (!rStyleName.isEmpty()
1515 &&
m_xImpl->m_xChapterNumbering.is()
1516 && (nOutlineLevel > 0)
1517 && (nOutlineLevel <= m_xImpl->m_xChapterNumbering->getCount()))
1519 m_xImpl->InitOutlineStylesCandidates();
1520 m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel-1].push_back(
1527 if (!(
m_xImpl->m_xOutlineStylesCandidates !=
nullptr || bSetEmptyLevels) ||
1528 !
m_xImpl->m_xChapterNumbering.is() ||
1532 bool bChooseLastOne(
false );
1536 bChooseLastOne =
true;
1540 sal_Int32 nUPD( 0 );
1541 sal_Int32 nBuild( 0 );
1545 bChooseLastOne = ( nUPD == 641 ) || ( nUPD == 645 ) ||
1546 ( nUPD == 680 && nBuild <= 9073 );
1551 OUString sOutlineStyleName;
1553 Reference<XPropertySet> xChapterNumRule(
1554 m_xImpl->m_xChapterNumbering, UNO_QUERY);
1555 xChapterNumRule->getPropertyValue(
"Name") >>= sOutlineStyleName;
1558 const sal_Int32
nCount =
m_xImpl->m_xChapterNumbering->getCount();
1565 ::std::vector<OUString> sChosenStyles(
nCount);
1568 if ( bSetEmptyLevels ||
1569 (
m_xImpl->m_xOutlineStylesCandidates &&
1570 !
m_xImpl->m_xOutlineStylesCandidates[
i].empty()))
1574 if (
m_xImpl->m_xOutlineStylesCandidates &&
1575 !
m_xImpl->m_xOutlineStylesCandidates[
i].empty())
1577 if ( bChooseLastOne )
1580 m_xImpl->m_xOutlineStylesCandidates[
i].back();
1585 j <
m_xImpl->m_xOutlineStylesCandidates[
i].size();
1589 m_xImpl->m_xOutlineStylesCandidates[
i][j],
1592 "NumberingStyleName",
1596 m_xImpl->m_xOutlineStylesCandidates[
i][j];
1605 Sequence < PropertyValue > aProps( 1 );
1606 PropertyValue *pProps = aProps.getArray();
1607 pProps->Name =
"HeadingStyleName";
1608 for ( sal_Int32
i = 0;
i <
nCount; ++
i )
1611 if ( bSetEmptyLevels || !sChosenStyles[
i].isEmpty() )
1613 pProps->Value <<= sChosenStyles[
i];
1614 m_xImpl->m_xChapterNumbering->replaceByIndex(
i,
1622 SvXMLImport
const & rImport,
1623 const Reference < XTextCursor >& rCursor,
1624 const OUString& rHRef,
1625 const OUString& rName,
1626 const OUString& rTargetFrameName,
1627 const OUString& rStyleName,
1628 const OUString& rVisitedStyleName,
1631 static constexpr OUStringLiteral s_HyperLinkURL =
u"HyperLinkURL";
1632 static constexpr OUStringLiteral s_HyperLinkName =
u"HyperLinkName";
1633 static constexpr OUStringLiteral s_HyperLinkTarget =
u"HyperLinkTarget";
1634 static constexpr OUStringLiteral s_UnvisitedCharStyleName =
u"UnvisitedCharStyleName";
1635 static constexpr OUStringLiteral s_VisitedCharStyleName =
u"VisitedCharStyleName";
1636 static constexpr OUStringLiteral s_HyperLinkEvents =
u"HyperLinkEvents";
1638 Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
1639 Reference < XPropertySetInfo > xPropSetInfo(
1640 xPropSet->getPropertySetInfo());
1641 if (!xPropSetInfo.is() || !xPropSetInfo->hasPropertyByName(s_HyperLinkURL))
1644 xPropSet->setPropertyValue(s_HyperLinkURL,
Any(rHRef));
1646 if (xPropSetInfo->hasPropertyByName(s_HyperLinkName))
1648 xPropSet->setPropertyValue(s_HyperLinkName,
Any(rName));
1651 if (xPropSetInfo->hasPropertyByName(s_HyperLinkTarget))
1653 xPropSet->setPropertyValue(s_HyperLinkTarget,
1654 Any(rTargetFrameName));
1657 if ( (pEvents !=
nullptr) &&
1658 xPropSetInfo->hasPropertyByName(s_HyperLinkEvents))
1664 uno::Reference<XNameReplace>
const xReplace(
1665 xPropSet->getPropertyValue(s_HyperLinkEvents), UNO_QUERY);
1672 xPropSet->setPropertyValue(s_HyperLinkEvents,
Any(xReplace));
1676 if (!
m_xImpl->m_xTextStyles.is())
1680 rImport.GetStyleDisplayName(
1683 xPropSetInfo->hasPropertyByName(s_UnvisitedCharStyleName) &&
1686 xPropSet->setPropertyValue(s_UnvisitedCharStyleName,
1691 rImport.GetStyleDisplayName(
1694 xPropSetInfo->hasPropertyByName(s_VisitedCharStyleName) &&
1697 xPropSet->setPropertyValue(s_VisitedCharStyleName,
1703 SvXMLImport
const & rImport,
1704 const Reference < XTextCursor >& rCursor,
1705 const OUString& rStyleName,
1706 const OUString& rTextStyleName,
1707 const OUString& rText )
1709 Reference<XPropertySet> xPropSet(rCursor, UNO_QUERY);
1711 OUString sRubyText(
"RubyText");
1714 if (!xPropSet.is() ||
1715 !xPropSet->getPropertySetInfo()->hasPropertyByName( sRubyText ))
1719 xPropSet->setPropertyValue(sRubyText,
Any(rText));
1722 if (!rStyleName.isEmpty() &&
m_xImpl->m_xAutoStyles.is())
1729 if (
nullptr != pStyle)
1734 if (
m_xImpl->m_xTextStyles.is())
1737 rImport.GetStyleDisplayName(
1749 m_xImpl->m_xAutoStyles = pStyles;
1753 SvXMLImport& rImport,
1755 const Reference< XFastAttributeList > & xAttrList,
1760 bool bContent =
true;
1771 rImport.GetProgressBarHelper()->Increment();
1777 rImport, nElement, xAttrList );
1833 TextContentAnchorType eAnchorType =
1835 : TextContentAnchorType_AT_PAGE;
1846 TextContentAnchorType eAnchorType =
1848 : TextContentAnchorType_AT_PAGE;
1906 Reference < XShapes > xShapes;
1908 rImport, nElement, xAttrList, xShapes );
1923 m_xImpl->m_bBodyContentStarted =
false;
1938 const Reference< XFastAttributeList > & )
1945 bool* pIsSystemLanguage )
1947 if (!
m_xImpl->m_xAutoStyles.is())
1970 if( pIsSystemLanguage !=
nullptr )
1974 return pNumStyle->
GetKey();
1983 if (
m_xImpl->m_xAutoStyles.is())
1997 if (
m_xImpl->m_xAutoStyles.is())
2009 const OUString& rName )
const
2012 if (
m_xImpl->m_xAutoStyles.is())
2015 m_xImpl->m_xAutoStyles->FindStyleChildContext(
2025 const OUString& rName )
const
2028 if (
m_xImpl->m_xAutoStyles.is())
2031 m_xImpl->m_xAutoStyles->FindStyleChildContext(
2051 if (!
m_xImpl->m_xAutoStyles.is())
2056 m_xImpl->m_xAutoStyles->FindStyleChildContext(
2079 return *
m_xImpl->m_xRenameMap;
2083 const OUString & sName,
2084 const Reference<XTextRange> & rRange,
2085 OUString
const& i_rXmlId,
2086 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & i_rpRDFaAttributes)
2089 std::make_tuple(rRange, i_rXmlId, i_rpRDFaAttributes);
2094 const OUString & sName,
2095 Reference<XTextRange> & o_rRange,
2096 OUString & o_rXmlId,
2097 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes)
2103 o_rRange.set(std::get<0>(rEntry));
2104 o_rXmlId = std::get<1>(rEntry);
2105 o_rpRDFaAttributes = std::get<2>(rEntry);
2107 auto it = std::find(
m_xImpl->m_BookmarkVector.begin(),
m_xImpl->m_BookmarkVector.end(),
sName);
2108 if (it!=
m_xImpl->m_BookmarkVector.end())
2110 m_xImpl->m_BookmarkVector.erase(it);
2126uno::Reference<text::XFormField>
2129 uno::Reference<text::XFormField> xRet;
2130 if ( !
m_xImpl->m_FieldStack.empty() )
2132 xRet = std::get<2>(
m_xImpl->m_FieldStack.top());
2137 SAL_INFO(
"xmloff.text",
"unexpected fieldmark end");
2144 assert(!
m_xImpl->m_FieldStack.empty());
2146 std::get<1>(FieldStackItem).emplace_back(
name,
value );
2151 assert(!
m_xImpl->m_FieldStack.empty());
2152 return std::get<0>(
m_xImpl->m_FieldStack.top());
2157 assert(!
m_xImpl->m_FieldStack.empty());
2158 return std::get<3>(
m_xImpl->m_FieldStack.top());
2163 assert(!
m_xImpl->m_FieldStack.empty());
2164 return std::get<2>(
m_xImpl->m_FieldStack.top()).is();
2169 return !
m_xImpl->m_FieldStack.empty();
2174 assert(!
m_xImpl->m_FieldStack.empty());
2175 if (xFormField.is())
2177 FieldParamImporter(&std::get<1>(
m_xImpl->m_FieldStack.top()),
2178 xFormField->getParameters()).Import();
2179 std::get<2>(
m_xImpl->m_FieldStack.top()) = xFormField;
2185 const OUString& rFrmName,
2186 const OUString& rNextFrmName,
2187 const Reference < XPropertySet >& rFrmPropSet )
2189 if( rFrmName.isEmpty() )
2192 if( !rNextFrmName.isEmpty() )
2196 if (
m_xImpl->m_xTextFrames.is()
2197 &&
m_xImpl->m_xTextFrames->hasByName(sNextFrmName))
2199 rFrmPropSet->setPropertyValue(
"ChainNextName",
2204 if (!
m_xImpl->m_xPrevFrmNames)
2206 m_xImpl->m_xPrevFrmNames.emplace();
2207 m_xImpl->m_xNextFrmNames.emplace();
2209 m_xImpl->m_xPrevFrmNames->push_back(rFrmName);
2210 m_xImpl->m_xNextFrmNames->push_back(sNextFrmName);
2213 if (!
m_xImpl->m_xPrevFrmNames ||
m_xImpl->m_xPrevFrmNames->empty())
2216 for(std::vector<OUString>::iterator
i =
m_xImpl->m_xPrevFrmNames->begin(), j =
m_xImpl->m_xNextFrmNames->begin();
i !=
m_xImpl->m_xPrevFrmNames->end() && j !=
m_xImpl->m_xNextFrmNames->end(); ++
i, ++j)
2218 if((*j) == rFrmName)
2222 rFrmPropSet->setPropertyValue(
"ChainPrevName",
Any(*
i));
2225 j =
m_xImpl->m_xNextFrmNames->erase(j);
2235 static constexpr OUStringLiteral s_TextFrame =
u"TextFrame";
2237 bool bIsInFrame =
false;
2244 if (xPropSet->getPropertySetInfo()->hasPropertyByName(s_TextFrame))
2246 uno::Reference<XTextFrame>
const xFrame(
2247 xPropSet->getPropertyValue(s_TextFrame), UNO_QUERY);
2269 sal_Int32 , sal_Int32 )
2271 Reference< XPropertySet> xPropSet;
2280 sal_Int32 , sal_Int32 )
2282 Reference< XPropertySet> xPropSet;
2291 sal_Int32 , sal_Int32 )
2293 Reference< XPropertySet> xPropSet;
2299 sal_Int32 , sal_Int32 )
2301 Reference< XPropertySet> xPropSet;
2308 sal_Int32 , sal_Int32 )
2310 Reference< XPropertySet> xPropSet;
2315 const Reference < XPropertySet> &,
2316 std::map < const OUString, OUString > &)
2324 const util::DateTime& ,
2331 Reference<XTextCursor> & ,
2335 Reference<XTextCursor> xRet;
2369 return m_xImpl->m_sOpenRedlineIdentifier;
2374 m_xImpl->m_sOpenRedlineIdentifier = rId;
2385 m_xImpl->m_sCellParaStyleDefault = rNewValue;
2390 return m_xImpl->m_sCellParaStyleDefault;
2395 if (!
m_xImpl->m_xCrossRefHeadingBookmarkMap)
2397 m_xImpl->m_xCrossRefHeadingBookmarkMap.emplace();
2399 m_xImpl->m_xCrossRefHeadingBookmarkMap->insert(std::make_pair(rFrom, rTo));
2407 if (!
m_xImpl->m_xCrossRefHeadingBookmarkMap)
2412 uno::Reference<text::XTextFieldsSupplier>
const xFieldsSupplier(
2413 m_xImpl->m_rSvXMLImport.GetModel(), uno::UNO_QUERY);
2414 if (!xFieldsSupplier.is())
2418 uno::Reference<container::XEnumerationAccess>
const xFieldsEA(
2419 xFieldsSupplier->getTextFields());
2420 uno::Reference<container::XEnumeration>
const xFields(
2421 xFieldsEA->createEnumeration());
2422 while (xFields->hasMoreElements())
2424 uno::Reference<lang::XServiceInfo>
const xFieldInfo(
2425 xFields->nextElement(), uno::UNO_QUERY);
2426 if (!xFieldInfo->supportsService(
"com.sun.star.text.textfield.GetReference"))
2430 uno::Reference<beans::XPropertySet>
const xField(
2431 xFieldInfo, uno::UNO_QUERY);
2432 sal_uInt16
nType(0);
2433 xField->getPropertyValue(
"ReferenceFieldSource") >>=
nType;
2434 if (text::ReferenceFieldSource::BOOKMARK !=
nType)
2439 xField->getPropertyValue(
"SourceName") >>=
name;
2440 auto const iter(
m_xImpl->m_xCrossRefHeadingBookmarkMap->find(
name));
2441 if (iter ==
m_xImpl->m_xCrossRefHeadingBookmarkMap->end())
2445 xField->setPropertyValue(
"SourceName",
uno::Any(iter->second));
2452 m_xImpl->m_sBookmarkCondition[bookmark] = condition;
2457 return m_xImpl->m_bBookmarkHidden[bookmark];
2462 return m_xImpl->m_sBookmarkCondition[bookmark];
XMLPropertyMapEntry const g_XMLPageMasterDrawingPageStyleMap[]
PropertiesInfo aProperties
sal_Int32 GetDrawKey() const
This class deliberately does not support XWeak, to improve performance when loading large documents.
void ChainImportMapper(const rtl::Reference< SvXMLImportPropertyMapper > &rMapper)
bool IsSystemLanguage() const
determine whether number format uses the system language
const OUString & GetParentName() const
import change tracking/redlining markers <text:change>, <text:change-start>, <text:change-end>
import dde field declaration container (<text:dde-connection-decls>)
Import <script:events> element.
void SetEvents(const css::uno::Reference< css::document::XEventsSupplier > &xEventsSupplier)
if the import operates in delayed mode, you can use this method to set all events that have been read...
sal_Int16 GetStartValue() const
const OUString & GetListId() const
sal_Int16 GetLevel() const
const css::uno::Reference< css::container::XIndexReplace > & GetNumRules() const
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
static SvXMLShapeContext * CreateGroupChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape=false)
Used for hyperlinks attached to objects (drawing objects, text boxes, Writer frames)
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertOOoLink(SvXMLImport &rImport, const OUString &rHRef, const OUString &rStyleName, const OUString &rTblName, sal_Int32 nWidth, sal_Int32 nHeight)
void pushFieldCtx(const OUString &name, const OUString &type)
OUString ConvertStarFonts(const OUString &rChars, const OUString &rStyleName, sal_uInt8 &rFlags, bool bPara, SvXMLImport &rImport) const
bool IsOrganizerMode() const
void FindOutlineStyleName(OUString &rStyleName, sal_Int8 nOutlineLevel)
Find a suitable name for the given outline level.
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertFloatingFrame(const OUString &rName, const OUString &rHRef, const OUString &rStyleName, sal_Int32 nWidth, sal_Int32 nHeight)
OUString const & GetCellParaStyleDefault() const
void InsertControlCharacter(sal_Int16 nControl)
void InsertTextContent(css::uno::Reference< css::text::XTextContent > const &xContent)
XMLTextListsHelper & GetTextListHelper()
virtual void RedlineAdd(const OUString &rType, const OUString &rId, const OUString &rAuthor, const OUString &rComment, const css::util::DateTime &rDateTime, bool bMergeLastParagraph)
XMLPropStyleContext * FindDrawingPage(OUString const &rName) const
static SvXMLImportPropertyMapper * CreateParaExtPropMapper(SvXMLImport &)
bool getBookmarkHidden(OUString const &bookmark) const
const css::uno::Reference< css::container::XIndexReplace > & GetChapterNumbering() const
void SetInsideDeleteContext(bool const bNew)
redlining : Setter to remember the fact we are inside/outside a <text:deletion> element (deleted redl...
bool FindAndRemoveBookmarkStartRange(const OUString &sName, css::uno::Reference< css::text::XTextRange > &o_rRange, OUString &o_rXmlId, std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &o_rpRDFaAttributes)
process the start of a range reference
virtual bool IsInHeaderFooter() const
rtl::Reference< SvXMLImportPropertyMapper > const & GetSectionImportPropertySetMapper() const
const css::uno::Reference< css::container::XNameContainer > & GetPageStyles() const
void SetOutlineStyles(bool bSetEmpty)
css::uno::Reference< css::text::XTextCursor > & GetCursor()
rtl::Reference< SvXMLImportPropertyMapper > const & GetTextImportPropertySetMapper() const
rtl::Reference< SvXMLImportPropertyMapper > const & GetRubyImportPropertySetMapper() const
css::uno::Reference< css::text::XText > & GetText()
void setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField > const &xFormField)
static SvXMLImportPropertyMapper * CreateTableRowDefaultExtPropMapper(SvXMLImport &)
virtual void SetShowChanges(bool bShowChanges)
void SetHyperlink(SvXMLImport const &rImport, const css::uno::Reference< css::text::XTextCursor > &rCursor, const OUString &rHRef, const OUString &rName, const OUString &rTargetFrameName, const OUString &rStyleName, const OUString &rVisitedStyleName, XMLEventsImportContext *pEvents)
css::uno::Reference< css::text::XFormField > popFieldCtx()
void InsertBookmarkStartRange(const OUString &sName, const css::uno::Reference< css::text::XTextRange > &rRange, OUString const &i_rXmlId, std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &i_rpRDFaAttributes)
save the start of a range reference
virtual void RedlineSetCursor(const OUString &rId, bool bStart, bool bIsOutsideOfParagraph)
virtual void endAppletOrPlugin(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, ::std::map< const OUString, OUString > &rParamMap)
void PopListContext()
pop the list context stack
void addFieldParam(const OUString &name, const OUString &value)
void SetOpenRedlineId(OUString const &rId)
modify the last open redline ID
SvI18NMap & GetRenameMap()
void PushListContext()
push a list context on the list context stack
static SvXMLImportPropertyMapper * CreateTableCellExtPropMapper(SvXMLImport &)
void SetCellParaStyleDefault(OUString const &rNewValue)
void SetRuby(SvXMLImport const &rImport, const css::uno::Reference< css::text::XTextCursor > &rCursor, const OUString &rStyleName, const OUString &rTextStyleName, const OUString &rText)
XMLPropStyleContext * FindSectionStyle(const OUString &rName) const
void AddOutlineStyleCandidate(const sal_Int8 nOutlineLevel, const OUString &rStyleName)
const css::uno::Reference< css::container::XNameContainer > & GetParaStyles() const
static SvXMLImportPropertyMapper * CreateParaDefaultExtPropMapper(SvXMLImport &)
css::uno::Reference< css::text::XTextRange > getCurrentFieldStart() const
XMLPropStyleContext * FindPageMaster(const OUString &rName) const
rtl::Reference< SvXMLImportPropertyMapper > const & GetParaImportPropertySetMapper() const
XMLPropStyleContext * FindAutoCharStyle(const OUString &rName) const
bool HasFrameByName(const OUString &rName) const
XMLTextImportHelper(const XMLTextImportHelper &)=delete
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertPlugin(const OUString &rMimeType, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight)
virtual void SetRecordChanges(bool bRecordChanges)
static SvXMLImportPropertyMapper * CreateDrawingPageExtPropMapper(SvXMLImport &)
bool IsDuplicateFrame(const OUString &sName, sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight) const
bool IsStylesOnlyMode() const
bool hasCurrentFieldCtx() const
void StoreLastImportedFrameName(const OUString &rName)
void SetCursor(const css::uno::Reference< css::text::XTextCursor > &rCursor)
bool hasCurrentFieldSeparator() const
virtual ~XMLTextImportHelper() override
virtual void SetChangesProtectionKey(const css::uno::Sequence< sal_Int8 > &rProtectionKey)
::std::pair< OUString, OUString > getCurrentFieldType() const
void setBookmarkAttributes(OUString const &bookmark, bool hidden, OUString const &condition)
static SvXMLImportPropertyMapper * CreateTableDefaultExtPropMapper(SvXMLImport &)
const OUString & getBookmarkCondition(OUString const &bookmark) const
XMLPropStyleContext * FindAutoFrameStyle(const OUString &rName) const
void AddCrossRefHeadingMapping(OUString const &rFrom, OUString const &rTo)
bool IsInsideDeleteContext() const
redlining : Getter to know if we are inside a <text:deletion> element (deleted redline section)
SvXMLImport & GetXMLImport()
void MapCrossRefHeadingFieldsHorribly()
std::unique_ptr< Impl > m_xImpl
const css::uno::Reference< css::container::XNameContainer > & GetFrameStyles() const
void ResetOpenRedlineId()
reset the last open redline ID
const SvxXMLListStyleContext * FindAutoListStyle(const OUString &rName) const
const css::uno::Reference< css::container::XNameContainer > & GetNumberingStyles() const
const css::uno::Reference< css::container::XNameContainer > & GetTextStyles() const
virtual void RedlineAdjustStartNodeCursor()
void ClearLastImportedTextFrameName()
OUString SetStyleAndAttrs(SvXMLImport const &rImport, const css::uno::Reference< css::text::XTextCursor > &rCursor, const OUString &rStyleName, bool bPara, bool bOutlineLevelAttrFound=false, sal_Int8 nOutlineLevel=-1, bool bSetListAttrs=true, bool bOutlineContentVisible=true)
static SvXMLImportPropertyMapper * CreateShapeExtPropMapper(SvXMLImport &)
sal_Int32 GetDataStyleKey(const OUString &sStyleName, bool *pIsSystemLanguage=nullptr)
return key appropriate for use with NumberFormat property return -1 if style is not found (may return...
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertOLEObject(SvXMLImport &rImport, const OUString &rHRef, const OUString &rStyleName, const OUString &rTblName, sal_Int32 nWidth, sal_Int32 nHeight)
const css::uno::Reference< css::container::XNameContainer > & GetCellStyles() const
bool IsInsertMode() const
void InsertString(const OUString &rChars)
OUString const & GetOpenRedlineId() const
get the last open redline ID
SvXMLImportContext * CreateTextChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, XMLTextType eType=XMLTextType::Shape)
void ConnectFrameChains(const OUString &rFrmName, const OUString &rNextFrmName, const css::uno::Reference< css::beans::XPropertySet > &rFrmPropSet)
virtual SvXMLImportContext * CreateTableChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
void SetAutoStyles(SvXMLStylesContext *pStyles)
css::uno::Reference< css::text::XTextRange > & GetCursorAsRange()
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertApplet(const OUString &rName, const OUString &rCode, bool bMayScript, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight)
virtual css::uno::Reference< css::text::XTextCursor > RedlineCreateText(css::uno::Reference< css::text::XTextCursor > &rOldCursor, const OUString &rId)
const css::uno::Reference< css::container::XIndexReplace > & GetNumRules() const
void ResetRestartNumbering()
sal_Int16 GetLevel() const
bool IsRestartNumbering() const
bool HasListStyleName()
does this list have (possibly inherited from parent) list-style-name?
bool HasNumRulesOverride() const
bool HasStartValue() const
sal_Int16 GetStartValue() const
const css::uno::Reference< css::container::XIndexReplace > & GetNumRulesOverride() const
void PopListContext()
pop the list context stack
void SetListItem(XMLTextListItemContext *pListItem)
set list item on top of the list context stack
void PushListContext(XMLTextListBlockContext *i_pListBlock)
list stack for importing:
void ListContextTop(XMLTextListBlockContext *&o_pListBlockContext, XMLTextListItemContext *&o_pListItemContext, XMLNumberedParaContext *&o_pNumberedParagraphContext)
peek at the top of the list context stack
const ::std::vector< XMLPropertyState > & GetProperties_()
const OUString & GetDropCapStyleName() const
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
bool HasCombinedCharactersLetter() const
bool IsListStyleSet() const
bool HasMasterPageName() const
const OUString & GetMasterPageName() const
const OUString & GetListStyle() const
variable declaration container for all variable fields (variable-decls, user-field-decls,...
#define SAL_INFO_IF(condition, area, stream)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
void copy(const fs::path &src, const fs::path &dest)
Handling of tokens in XML:
@ XML_ALPHABETICAL_INDEX_AUTO_MARK_FILE
@ XML_DDE_CONNECTION_DECLS
@ XML_CALCULATION_SETTINGS
constexpr OUStringLiteral ODF_FORMCHECKBOX_RESULT
constexpr OUStringLiteral ODF_FORMDROPDOWN_RESULT
constexpr OUStringLiteral ODF_FORMDROPDOWN_LISTENTRY
Smart struct to transport an Any with an index to the appropriate property-name.
rtl::Reference< SvXMLImportPropertyMapper > m_xFrameImpPrMap
OUString m_sCellParaStyleDefault
uno::Reference< container::XNameAccess > m_xObjects
::std::vector< field_param_t > field_params_t
OUString msLastImportedFrameName
rtl::Reference< SvXMLImportPropertyMapper > m_xSectionImpPrMap
std::tuple< uno::Reference< text::XTextRange >, OUString, std::shared_ptr< ::xmloff::ParsedRDFaAttributes > > BookmarkMapEntry_t
std::vector< OUString > m_BookmarkVector
OUString m_sOpenRedlineIdentifier
name of the last 'open' redline that started between paragraphs
::std::pair< OUString, OUString > field_name_type_t
std::optional< std::map< OUString, OUString > > m_xCrossRefHeadingBookmarkMap
std::optional< std::vector< OUString > > m_xPrevFrmNames
std::unique_ptr< SvI18NMap > m_xRenameMap
::std::tuple< field_name_type_t, field_params_t, uno::Reference< text::XFormField >, uno::Reference< text::XTextRange > > field_stack_item_t
uno::Reference< container::XNameAccess > m_xGraphics
uno::Reference< container::XNameContainer > m_xCellStyles
std::map< OUString, OUString > m_sBookmarkCondition
std::map< OUString, BookmarkMapEntry_t > m_BookmarkStartRanges
start ranges for open bookmarks
uno::Reference< container::XNameContainer > m_xFrameStyles
Impl(const Impl &)=delete
uno::Reference< text::XTextCursor > m_xCursor
std::unique_ptr< std::vector< OUString >[]> m_xOutlineStylesCandidates
uno::Reference< text::XText > m_xText
uno::Reference< container::XNameAccess > m_xTextFrames
uno::Reference< text::XTextRange > m_xCursorAsRange
rtl::Reference< SvXMLStylesContext > m_xAutoStyles
uno::Reference< container::XNameContainer > m_xPageStyles
Impl & operator=(const Impl &)=delete
SvXMLImport & m_rSvXMLImport
rtl::Reference< SvXMLImportPropertyMapper > m_xTextImpPrMap
void InitOutlineStylesCandidates()
Impl(uno::Reference< frame::XModel > const &rModel, SvXMLImport &rImport, bool const bInsertMode, bool const bStylesOnlyMode, bool const bProgress, bool const bBlockMode, bool const bOrganizerMode)
field_stack_t m_FieldStack
uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory
std::optional< std::vector< OUString > > m_xNextFrmNames
uno::Reference< container::XNameContainer > m_xParaStyles
uno::Reference< container::XIndexReplace > m_xChapterNumbering
std::unique_ptr< XMLTextListsHelper > m_xTextListsHelper
rtl::Reference< SvXMLImportPropertyMapper > m_xRubyImpPrMap
uno::Reference< container::XNameContainer > m_xTextStyles
::std::stack< field_stack_item_t > field_stack_t
rtl::Reference< SvXMLImportPropertyMapper > m_xParaImpPrMap
std::map< OUString, bool > m_bBookmarkHidden
bool m_bBodyContentStarted
bool m_bInsideDeleteContext
Are we inside a <text:deletion> element (deleted redline section)
::std::pair< OUString, OUString > field_param_t
uno::Reference< container::XNameContainer > m_xNumStyles
Reference< XFrame > xFrame
#define MAX_COMBINED_CHARACTERS
static bool lcl_HasListStyle(const OUString &sStyleName, const Reference< XNameContainer > &xParaStyles, SvXMLImport const &rImport, const OUString &sNumberingStyleName, std::u16string_view sOutlineStyleName)
#define XML_TEXT_RENAME_TYPE_FRAME
#define CONV_FROM_STAR_BATS
#define CONV_FROM_STAR_MATH
#define CONV_STAR_FONT_FLAGS_VALID
#define CTF_FONTFAMILYNAME
@ TEXT_ADDITIONAL_DEFAULTS
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
#define XML_ELEMENT(prefix, name)