24 #include <com/sun/star/container/XEnumerationAccess.hpp>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
28 #include <com/sun/star/text/ReferenceFieldSource.hpp>
29 #include <com/sun/star/text/XChapterNumberingSupplier.hpp>
30 #include <com/sun/star/text/XTextFrame.hpp>
31 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
32 #include <com/sun/star/text/XTextFramesSupplier.hpp>
33 #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
34 #include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
35 #include <com/sun/star/text/XFormField.hpp>
36 #include <com/sun/star/ucb/XAnyCompareFactory.hpp>
37 #include <com/sun/star/container/XNamed.hpp>
38 #include <com/sun/star/style/XStyle.hpp>
69 #include <com/sun/star/beans/XPropertyState.hpp>
74 using ::com::sun::star::ucb::XAnyCompare;
76 using namespace ::
std;
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>>
field_stack_item_t;
177 Impl( uno::Reference<frame::XModel>
const& rModel,
179 bool const bInsertMode,
bool const bStylesOnlyMode,
180 bool const bProgress,
bool const bBlockMode,
181 bool const bOrganizerMode)
184 , m_xServiceFactory( rModel, UNO_QUERY )
185 , m_rSvXMLImport( rImport )
202 size_t const size(m_xChapterNumbering->getCount());
204 new ::std::vector< OUString >[
size] );
223 return m_xImpl->m_xCursorAsRange;
233 return m_xImpl->m_bStylesOnlyMode;
243 return m_xImpl->m_bOrganizerMode;
251 uno::Reference<container::XNameContainer>
const&
257 uno::Reference<container::XNameContainer>
const&
263 uno::Reference<container::XNameContainer>
const&
269 uno::Reference<container::XNameContainer>
const&
272 return m_xImpl->m_xFrameStyles;
275 uno::Reference<container::XNameContainer>
const&
281 uno::Reference<container::XNameContainer>
const&
287 uno::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 pair<OUString,OUString> field_param_t;
343 typedef 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())
382 copy(vListEntries.begin(), vListEntries.end(), vListEntriesSeq.begin());
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,
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();
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() )
459 const OUString aParaStyles(
"ParagraphStyles");
460 if( xFamilies->hasByName( aParaStyles ) )
462 m_xImpl->m_xParaStyles.set(xFamilies->getByName(aParaStyles),
466 const OUString aCharStyles(
"CharacterStyles");
467 if( xFamilies->hasByName( aCharStyles ) )
469 m_xImpl->m_xTextStyles.set(xFamilies->getByName(aCharStyles),
473 const OUString aNumStyles(
"NumberingStyles");
474 if( xFamilies->hasByName( aNumStyles ) )
476 m_xImpl->m_xNumStyles.set(xFamilies->getByName(aNumStyles),
480 const OUString aFrameStyles(
"FrameStyles");
481 if( xFamilies->hasByName( aFrameStyles ) )
483 m_xImpl->m_xFrameStyles.set(xFamilies->getByName(aFrameStyles),
487 const OUString aPageStyles(
"PageStyles");
488 if( xFamilies->hasByName( aPageStyles ) )
490 m_xImpl->m_xPageStyles.set(xFamilies->getByName(aPageStyles),
494 const OUString aCellStyles(
"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;
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;
645 if(
m_xImpl->m_xTextFrames.is() &&
m_xImpl->m_xTextFrames->hasByName(sName))
646 xOtherFrame.set(
m_xImpl->m_xTextFrames->getByName(sName), uno::UNO_QUERY);
647 else if(
m_xImpl->m_xGraphics.is() &&
m_xImpl->m_xGraphics->hasByName(sName))
648 xOtherFrame.set(
m_xImpl->m_xGraphics->getByName(sName), uno::UNO_QUERY);
649 else if (
m_xImpl->m_xObjects.is() &&
m_xImpl->m_xObjects->hasByName(sName))
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;
686 return m_xImpl->msLastImportedFrameName == sName;
693 m_xImpl->msLastImportedFrameName = rName;
698 m_xImpl->msLastImportedFrameName.clear();
713 bool& rIgnoreLeadingSpace )
719 sal_Int32 nLen = rChars.getLength();
720 OUStringBuffer sChars( nLen );
722 for( sal_Int32
i=0;
i < nLen;
i++ )
731 if( !rIgnoreLeadingSpace )
732 sChars.append(
u' ' );
733 rIgnoreLeadingSpace =
true;
736 rIgnoreLeadingSpace =
false;
742 sChars.makeStringAndClear(),
false);
752 m_xImpl->m_xText->insertControlCharacter(
753 m_xImpl->m_xCursorAsRange, nControl,
false);
758 Reference < XTextContent >
const & xContent )
765 m_xImpl->m_xText->insertTextContent(
m_xImpl->m_xCursorAsRange, xContent,
false);
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,
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();
842 for( sal_Int32
i=0;
i < nCount;
i++ )
845 sal_Int32 nIdx = rProp.
mnIndex;
846 sal_uInt32 nContextId = rPropMapper->GetEntryContextId(nIdx);
852 if( sFontName.equalsIgnoreAsciiCase(
"StarBats" ) )
854 else if( sFontName.equalsIgnoreAsciiCase(
"StarMath" ) )
879 return bConverted ? sChars.makeStringAndClear() : rChars;
889 const Reference < XNameContainer >& xParaStyles,
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 )
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 )
968 xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
969 if ( !sListStyle.isEmpty() &&
970 sListStyle == sOutlineStyleName )
978 else if ( sListStyle.isEmpty() &&
981 ( ( nUPD == 641 ) || ( nUPD == 645 ) ||
982 ( nUPD == 680 && nBuild <= 9238 ) ) ) ) )
992 Reference<XStyle> xParentStyle(xPropState, UNO_QUERY);
993 if (xStyle == xParentStyle)
998 xStyle = xParentStyle;
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 );
1040 Reference< XPropertySetInfo > xPropSetInfo(
1041 xPropSet->getPropertySetInfo());
1044 if( !sStyleName.isEmpty() )
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,
makeAny(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);
1091 bNumberingIsNumber =
false;
1097 : pListBlock->GetNumRules() );
1098 nLevel =
static_cast<sal_Int8>(pListBlock->GetLevel());
1105 sListId =
m_xImpl->m_xTextListsHelper->GetListIdForListBlock(
1108 else if (pNumberedParagraph)
1110 xNewNumRules.set(pNumberedParagraph->
GetNumRules());
1112 sListId = pNumberedParagraph->
GetListId();
1117 if (pListBlock || pNumberedParagraph)
1121 if ( !bApplyNumRules )
1123 bool bSameNumRules = xNewNumRules == xNumRules;
1124 if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
1130 Reference< XNamed > xNewNamed( xNewNumRules, UNO_QUERY );
1131 Reference< XNamed > xNamed( xNumRules, UNO_QUERY );
1132 if( xNewNamed.is() && xNamed.is() )
1134 bSameNumRules = xNewNamed->getName() == xNamed->getName();
1138 Reference< XAnyCompare > xNumRuleCompare( xNumRules, UNO_QUERY );
1139 if( xNumRuleCompare.is() )
1141 bSameNumRules = (xNumRuleCompare->compare(
Any(xNumRules),
Any(xNewNumRules) ) == 0);
1145 bApplyNumRules = !bSameNumRules;
1148 if ( bApplyNumRules )
1157 xPropSet->setPropertyValue(
1158 s_NumberingRules,
makeAny(xNewNumRules) );
1168 if (!bNumberingIsNumber &&
1169 xPropSetInfo->hasPropertyByName(s_NumberingIsNumber))
1171 xPropSet->setPropertyValue(s_NumberingIsNumber,
Any(
false));
1174 xPropSet->setPropertyValue( s_NumberingLevel,
Any(nLevel) );
1176 if( pListBlock && pListBlock->IsRestartNumbering() )
1179 if (xPropSetInfo->hasPropertyByName(s_ParaIsNumberingRestart))
1181 xPropSet->setPropertyValue(s_ParaIsNumberingRestart,
1184 pListBlock->ResetRestartNumbering();
1187 if ( 0 <= nStartValue &&
1188 xPropSetInfo->hasPropertyByName(s_NumberingStartValue))
1190 xPropSet->setPropertyValue(s_NumberingStartValue,
1194 if (xPropSetInfo->hasPropertyByName(s_PropNameListId))
1196 if (!sListId.isEmpty()) {
1197 xPropSet->setPropertyValue(s_PropNameListId,
1210 if( xNumRules.is() )
1212 bool bRemove(
true );
1214 sal_Int32 nUPD( 0 );
1215 sal_Int32 nBuild( 0 );
1216 const bool bBuildIdFound = rImport.
getBuildIds( nUPD, nBuild );
1217 if ( ( bBuildIdFound && nUPD == 680 ) ||
1220 if (
m_xImpl->m_xChapterNumbering.is())
1222 Reference< XNamed > xNumNamed( xNumRules, UNO_QUERY );
1223 Reference< XNamed >
const xChapterNumNamed (
1224 m_xImpl->m_xChapterNumbering, UNO_QUERY);
1225 if ( xNumNamed.is() && xChapterNumNamed.is() &&
1226 xNumNamed->getName() == xChapterNumNamed->getName() )
1230 bApplyOutlineLevelAsListLevel =
true;
1238 "automatic paragraph style with list style name, but paragraph not in list???");
1242 xPropSet->setPropertyValue( s_NumberingRules,
Any() );
1253 xPropSetInfo->hasPropertyByName(s_PageDescName))
1259 if( sDisplayName.isEmpty() ||
1260 (
m_xImpl->m_xPageStyles.is() &&
1261 m_xImpl->m_xPageStyles->hasByName( sDisplayName)))
1263 xPropSet->setPropertyValue(s_PageDescName,
1274 if (
m_xImpl->m_xTextStyles->hasByName(sDisplayName) &&
1275 xPropSetInfo->hasPropertyByName(
"DropCapCharStyleName"))
1277 xPropSet->setPropertyValue(
"DropCapCharStyleName",
makeAny(sDisplayName));
1285 if (
m_xImpl->m_xServiceFactory.is())
1287 uno::Reference<beans::XPropertySet>
const xTmp(
1288 m_xImpl->m_xServiceFactory->createInstance(
1289 "com.sun.star.text.TextField.CombinedCharacters"), UNO_QUERY);
1294 if (rCursor->getString().getLength() >
1297 rCursor->gotoRange(rCursor->getStart(),
false);
1302 xTmp->setPropertyValue(
"Content",
1303 makeAny(rCursor->getString()));
1306 Reference<XTextContent> xTextContent(xTmp, UNO_QUERY);
1307 if (
m_xImpl->m_xText.is() && rCursor.is())
1311 m_xImpl->m_xText->insertTextContent( rCursor->getStart(), xTextContent, true );
1313 if( !rCursor->getString().isEmpty() )
1317 uno::Reference< text::XTextCursor > xCrsr = rCursor->getText()->createTextCursorByRange( rCursor->getStart() );
1318 xCrsr->goLeft( 1,
true );
1319 uno::Reference< beans::XPropertySet> xCrsrProperties( xCrsr, uno::UNO_QUERY_THROW );
1322 xCrsr->collapseToEnd();
1323 xCrsr->gotoRange( rCursor->getEnd(), true );
1324 xCrsr->setString( OUString() );
1326 catch(
const uno::Exception&)
1349 sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
1350 const bool bHasOutlineLevelProp(
1351 xPropSetInfo->hasPropertyByName(s_OutlineLevel));
1352 if ( bHasOutlineLevelProp )
1354 xPropSet->getPropertyValue(s_OutlineLevel)
1355 >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
1357 if ( nOutlineLevel > 0 )
1359 if ( bHasOutlineLevelProp )
1363 if ( nCurrentOutlineLevelInheritedFromParagraphStyle != nOutlineLevel )
1365 xPropSet->setPropertyValue( s_OutlineLevel,
1366 makeAny( static_cast<sal_Int16>(nOutlineLevel) ) );
1369 if (!bOutlineContentVisible)
1371 uno::Sequence<beans::PropertyValue> aGrabBag;
1372 xPropSet->getPropertyValue(
"ParaInteropGrabBag") >>= aGrabBag;
1373 sal_Int32
length = aGrabBag.getLength();
1374 aGrabBag.realloc(length + 1);
1375 aGrabBag[length].Name =
"OutlineContentVisibleAttr";
1376 aGrabBag[length].Value <<= bool(bOutlineContentVisible);
1377 xPropSet->setPropertyValue(
"ParaInteropGrabBag", uno::makeAny(aGrabBag));
1380 if ( bApplyOutlineLevelAsListLevel )
1382 sal_Int16 nNumLevel = -1;
1383 xPropSet->getPropertyValue( s_NumberingLevel ) >>= nNumLevel;
1384 if ( nNumLevel == -1 ||
1385 nNumLevel != (nOutlineLevel - 1) )
1387 xPropSet->setPropertyValue( s_NumberingLevel,
1388 makeAny( static_cast<sal_Int8>(nOutlineLevel - 1) ) );
1400 if (
m_xImpl->m_xParaStyles.is() &&
m_xImpl->m_xParaStyles->hasByName(sStyleName))
1402 bool bOutlineStyleCandidate(
false );
1404 sal_Int32 nUPD( 0 );
1405 sal_Int32 nBuild( 0 );
1406 const bool bBuildIdFound = rImport.
getBuildIds( nUPD, nBuild );
1411 ( nUPD == 645 || nUPD == 641 ) ) )
1413 bOutlineStyleCandidate =
true;
1415 else if ( nUPD == 680 && nBuild <= 9073 )
1417 bOutlineStyleCandidate = bOutlineLevelAttrFound;
1419 if ( bOutlineStyleCandidate )
1425 !bOutlineStyleCandidate &&
1426 m_xImpl->m_xChapterNumbering.is())
1430 u"NumberingStyleName",
1434 xPropSet->setPropertyValue( s_NumberingRules,
1436 xPropSet->setPropertyValue( s_NumberingLevel,
1437 makeAny(static_cast<sal_Int8>(nOutlineLevel - 1)));
1443 else if( bHasOutlineLevelProp )
1445 if ( nCurrentOutlineLevelInheritedFromParagraphStyle != 0 )
1447 xPropSet->setPropertyValue(s_OutlineLevel,
1460 if( rStyleName.isEmpty() )
1463 if (
m_xImpl->m_xChapterNumbering.is() &&
1464 ( nOutlineLevel > 0 ) &&
1465 (nOutlineLevel <= m_xImpl->m_xChapterNumbering->getCount()))
1472 m_xImpl->InitOutlineStylesCandidates();
1473 if (
m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel].empty())
1479 m_xImpl->m_xChapterNumbering->getByIndex( nOutlineLevel )
1481 auto pProp = std::find_if(aProperties.begin(), aProperties.end(),
1482 [](
const PropertyValue& rProp) {
return rProp.Name ==
"HeadingStyleName"; });
1483 if (pProp != aProperties.end())
1485 OUString aOutlineStyle;
1486 pProp->Value >>= aOutlineStyle;
1487 m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel]
1488 .push_back( aOutlineStyle );
1496 m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel].back();
1504 const OUString& rStyleName )
1506 if (!rStyleName.isEmpty()
1507 &&
m_xImpl->m_xChapterNumbering.is()
1508 && (nOutlineLevel > 0)
1509 && (nOutlineLevel <= m_xImpl->m_xChapterNumbering->getCount()))
1511 m_xImpl->InitOutlineStylesCandidates();
1512 m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel-1].push_back(
1519 if (!(
m_xImpl->m_xOutlineStylesCandidates !=
nullptr || bSetEmptyLevels) ||
1520 !
m_xImpl->m_xChapterNumbering.is() ||
1524 bool bChooseLastOne(
false );
1528 bChooseLastOne =
true;
1532 sal_Int32 nUPD( 0 );
1533 sal_Int32 nBuild( 0 );
1537 bChooseLastOne = ( nUPD == 641 ) || ( nUPD == 645 ) ||
1538 ( nUPD == 680 && nBuild <= 9073 );
1543 OUString sOutlineStyleName;
1546 m_xImpl->m_xChapterNumbering, UNO_QUERY);
1547 xChapterNumRule->getPropertyValue(
"Name") >>= sOutlineStyleName;
1550 const sal_Int32
nCount =
m_xImpl->m_xChapterNumbering->getCount();
1557 ::std::vector<OUString> sChosenStyles(nCount);
1558 for( sal_Int32
i=0;
i < nCount; ++
i )
1560 if ( bSetEmptyLevels ||
1561 (
m_xImpl->m_xOutlineStylesCandidates &&
1562 !
m_xImpl->m_xOutlineStylesCandidates[
i].empty()))
1566 if (
m_xImpl->m_xOutlineStylesCandidates &&
1567 !
m_xImpl->m_xOutlineStylesCandidates[
i].empty())
1569 if ( bChooseLastOne )
1572 m_xImpl->m_xOutlineStylesCandidates[
i].back();
1577 j <
m_xImpl->m_xOutlineStylesCandidates[
i].size();
1581 m_xImpl->m_xOutlineStylesCandidates[
i][j],
1584 "NumberingStyleName",
1588 m_xImpl->m_xOutlineStylesCandidates[
i][j];
1597 Sequence < PropertyValue > aProps( 1 );
1598 PropertyValue *pProps = aProps.getArray();
1599 pProps->Name =
"HeadingStyleName";
1600 for ( sal_Int32
i = 0;
i < nCount; ++
i )
1603 if ( bSetEmptyLevels || !sChosenStyles[
i].isEmpty() )
1605 pProps->Value <<= sChosenStyles[
i];
1606 m_xImpl->m_xChapterNumbering->replaceByIndex(
i,
1615 const Reference < XTextCursor >& rCursor,
1616 const OUString& rHRef,
1617 const OUString& rName,
1618 const OUString& rTargetFrameName,
1619 const OUString& rStyleName,
1620 const OUString& rVisitedStyleName,
1623 static constexpr OUStringLiteral s_HyperLinkURL =
u"HyperLinkURL";
1624 static constexpr OUStringLiteral s_HyperLinkName =
u"HyperLinkName";
1625 static constexpr OUStringLiteral s_HyperLinkTarget =
u"HyperLinkTarget";
1626 static constexpr OUStringLiteral s_UnvisitedCharStyleName =
u"UnvisitedCharStyleName";
1627 static constexpr OUStringLiteral s_VisitedCharStyleName =
u"VisitedCharStyleName";
1628 static constexpr OUStringLiteral s_HyperLinkEvents =
u"HyperLinkEvents";
1631 Reference < XPropertySetInfo > xPropSetInfo(
1632 xPropSet->getPropertySetInfo());
1633 if (!xPropSetInfo.is() || !xPropSetInfo->hasPropertyByName(s_HyperLinkURL))
1636 xPropSet->setPropertyValue(s_HyperLinkURL,
makeAny(rHRef));
1638 if (xPropSetInfo->hasPropertyByName(s_HyperLinkName))
1640 xPropSet->setPropertyValue(s_HyperLinkName,
makeAny(rName));
1643 if (xPropSetInfo->hasPropertyByName(s_HyperLinkTarget))
1645 xPropSet->setPropertyValue(s_HyperLinkTarget,
1649 if ( (pEvents !=
nullptr) &&
1650 xPropSetInfo->hasPropertyByName(s_HyperLinkEvents))
1656 uno::Reference<XNameReplace>
const xReplace(
1657 xPropSet->getPropertyValue(s_HyperLinkEvents), UNO_QUERY);
1664 xPropSet->setPropertyValue(s_HyperLinkEvents,
makeAny(xReplace));
1668 if (
m_xImpl->m_xTextStyles.is())
1674 xPropSetInfo->hasPropertyByName(s_UnvisitedCharStyleName) &&
1677 xPropSet->setPropertyValue(s_UnvisitedCharStyleName,
1685 xPropSetInfo->hasPropertyByName(s_VisitedCharStyleName) &&
1688 xPropSet->setPropertyValue(s_VisitedCharStyleName,
1696 const Reference < XTextCursor >& rCursor,
1697 const OUString& rStyleName,
1698 const OUString& rTextStyleName,
1699 const OUString& rText )
1703 OUString sRubyText(
"RubyText");
1706 if (xPropSet.is() &&
1707 xPropSet->getPropertySetInfo()->hasPropertyByName( sRubyText ))
1710 xPropSet->setPropertyValue(sRubyText,
makeAny(rText));
1713 if (!rStyleName.isEmpty() &&
m_xImpl->m_xAutoStyles.is())
1720 if (
nullptr != pStyle)
1725 if (
m_xImpl->m_xTextStyles.is())
1741 m_xImpl->m_xAutoStyles = pStyles;
1747 const Reference< XFastAttributeList > & xAttrList,
1752 bool bContent =
true;
1769 rImport, nElement, xAttrList );
1825 TextContentAnchorType eAnchorType =
1827 : TextContentAnchorType_AT_PAGE;
1838 TextContentAnchorType eAnchorType =
1840 : TextContentAnchorType_AT_PAGE;
1898 Reference < XShapes > xShapes;
1900 rImport, nElement, xAttrList, xShapes );
1915 m_xImpl->m_bBodyContentStarted =
false;
1930 const Reference< XFastAttributeList > & )
1937 bool* pIsSystemLanguage )
1939 if (!
m_xImpl->m_xAutoStyles.is())
1962 if( pIsSystemLanguage !=
nullptr )
1966 return pNumStyle->
GetKey();
1975 if (
m_xImpl->m_xAutoStyles.is())
1989 if (
m_xImpl->m_xAutoStyles.is())
2001 const OUString& rName )
const
2004 if (
m_xImpl->m_xAutoStyles.is())
2007 m_xImpl->m_xAutoStyles->FindStyleChildContext(
2017 const OUString& rName )
const
2020 if (
m_xImpl->m_xAutoStyles.is())
2023 m_xImpl->m_xAutoStyles->FindStyleChildContext(
2034 if (!
m_xImpl->m_xAutoStyles.is())
2039 m_xImpl->m_xAutoStyles->FindStyleChildContext(
2041 assert(pStyle ==
nullptr || dynamic_cast<XMLPropStyleContext const*>(pStyle) !=
nullptr);
2062 return *
m_xImpl->m_xRenameMap;
2066 const OUString & sName,
2067 const Reference<XTextRange> & rRange,
2068 OUString
const& i_rXmlId,
2069 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & i_rpRDFaAttributes)
2071 m_xImpl->m_BookmarkStartRanges[sName] =
2072 std::make_tuple(rRange, i_rXmlId, i_rpRDFaAttributes);
2073 m_xImpl->m_BookmarkVector.push_back(sName);
2077 const OUString & sName,
2078 Reference<XTextRange> & o_rRange,
2079 OUString & o_rXmlId,
2080 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes)
2082 if (
m_xImpl->m_BookmarkStartRanges.count(sName))
2085 (*
m_xImpl->m_BookmarkStartRanges.find(sName)).second;
2086 o_rRange.set(std::get<0>(rEntry));
2087 o_rXmlId = std::get<1>(rEntry);
2088 o_rpRDFaAttributes = std::get<2>(rEntry);
2089 m_xImpl->m_BookmarkStartRanges.erase(sName);
2090 auto it = std::find(
m_xImpl->m_BookmarkVector.begin(),
m_xImpl->m_BookmarkVector.end(), sName);
2091 if (it!=
m_xImpl->m_BookmarkVector.end())
2093 m_xImpl->m_BookmarkVector.erase(it);
2109 uno::Reference<text::XFormField>
2112 uno::Reference<text::XFormField> xRet;
2113 if ( !
m_xImpl->m_FieldStack.empty() )
2115 xRet = std::get<2>(
m_xImpl->m_FieldStack.top());
2120 SAL_INFO(
"xmloff.text",
"unexpected fieldmark end");
2128 if (!
m_xImpl->m_FieldStack.empty()) {
2130 std::get<1>(FieldStackItem).emplace_back( name, value );
2137 if (!
m_xImpl->m_FieldStack.empty())
2139 return std::get<0>(
m_xImpl->m_FieldStack.top()).second;
2149 return !
m_xImpl->m_FieldStack.empty();
2155 if (!
m_xImpl->m_FieldStack.empty() && xFormField.is())
2157 FieldParamImporter(&std::get<1>(
m_xImpl->m_FieldStack.top()),
2158 xFormField->getParameters()).
Import();
2159 std::get<2>(
m_xImpl->m_FieldStack.top()) = xFormField;
2165 const OUString& rFrmName,
2166 const OUString& rNextFrmName,
2169 if( rFrmName.isEmpty() )
2172 if( !rNextFrmName.isEmpty() )
2176 if (
m_xImpl->m_xTextFrames.is()
2177 &&
m_xImpl->m_xTextFrames->hasByName(sNextFrmName))
2179 rFrmPropSet->setPropertyValue(
"ChainNextName",
2184 if (!
m_xImpl->m_xPrevFrmNames)
2186 m_xImpl->m_xPrevFrmNames.reset(
new std::vector<OUString> );
2187 m_xImpl->m_xNextFrmNames.reset(
new std::vector<OUString> );
2189 m_xImpl->m_xPrevFrmNames->push_back(rFrmName);
2190 m_xImpl->m_xNextFrmNames->push_back(sNextFrmName);
2193 if (
m_xImpl->m_xPrevFrmNames && !
m_xImpl->m_xPrevFrmNames->empty())
2195 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)
2197 if((*j) == rFrmName)
2201 rFrmPropSet->setPropertyValue(
"ChainPrevName",
makeAny(*
i));
2204 j =
m_xImpl->m_xNextFrmNames->erase(j);
2215 static constexpr OUStringLiteral s_TextFrame =
u"TextFrame";
2217 bool bIsInFrame =
false;
2224 if (xPropSet->getPropertySetInfo()->hasPropertyByName(s_TextFrame))
2226 uno::Reference<XTextFrame>
const xFrame(
2227 xPropSet->getPropertyValue(s_TextFrame), UNO_QUERY);
2249 sal_Int32 , sal_Int32 )
2260 sal_Int32 , sal_Int32 )
2271 sal_Int32 , sal_Int32 )
2279 sal_Int32 , sal_Int32 )
2288 sal_Int32 , sal_Int32 )
2296 std::map < const OUString, OUString > &)
2304 const util::DateTime& ,
2311 Reference<XTextCursor> & ,
2315 Reference<XTextCursor> xRet;
2349 return m_xImpl->m_sOpenRedlineIdentifier;
2354 m_xImpl->m_sOpenRedlineIdentifier = rId;
2365 m_xImpl->m_sCellParaStyleDefault = rNewValue;
2370 return m_xImpl->m_sCellParaStyleDefault;
2375 if (!
m_xImpl->m_pCrossRefHeadingBookmarkMap)
2377 m_xImpl->m_pCrossRefHeadingBookmarkMap.reset(
new std::map<OUString, OUString>);
2379 m_xImpl->m_pCrossRefHeadingBookmarkMap->insert(std::make_pair(rFrom, rTo));
2387 if (!
m_xImpl->m_pCrossRefHeadingBookmarkMap)
2392 uno::Reference<text::XTextFieldsSupplier>
const xFieldsSupplier(
2393 m_xImpl->m_rSvXMLImport.GetModel(), uno::UNO_QUERY);
2394 if (!xFieldsSupplier.is())
2398 uno::Reference<container::XEnumerationAccess>
const xFieldsEA(
2399 xFieldsSupplier->getTextFields());
2400 uno::Reference<container::XEnumeration>
const xFields(
2401 xFieldsEA->createEnumeration());
2402 while (xFields->hasMoreElements())
2404 uno::Reference<lang::XServiceInfo>
const xFieldInfo(
2405 xFields->nextElement(), uno::UNO_QUERY);
2406 if (!xFieldInfo->supportsService(
"com.sun.star.text.textfield.GetReference"))
2410 uno::Reference<beans::XPropertySet>
const xField(
2411 xFieldInfo, uno::UNO_QUERY);
2412 sal_uInt16
nType(0);
2413 xField->getPropertyValue(
"ReferenceFieldSource") >>= nType;
2414 if (text::ReferenceFieldSource::BOOKMARK != nType)
2419 xField->getPropertyValue(
"SourceName") >>= name;
2420 auto const iter(
m_xImpl->m_pCrossRefHeadingBookmarkMap->find(name));
2421 if (iter ==
m_xImpl->m_pCrossRefHeadingBookmarkMap->end())
2425 xField->setPropertyValue(
"SourceName", uno::makeAny(iter->second));
2431 m_xImpl->m_bBookmarkHidden[bookmark] = hidden;
2432 m_xImpl->m_sBookmarkCondition[bookmark] = condition;
2437 return m_xImpl->m_bBookmarkHidden[bookmark];
2442 return m_xImpl->m_sBookmarkCondition[bookmark];
const css::uno::Reference< css::container::XIndexReplace > & GetNumRulesOverride() const
virtual void SetShowChanges(bool bShowChanges)
bool IsOrganizerMode() const
#define XML_TEXT_RENAME_TYPE_FRAME
static SvXMLImportPropertyMapper * CreateShapeExtPropMapper(SvXMLImport &)
void SetInsideDeleteContext(bool const bNew)
redlining : Setter to remember the fact we are inside/outside a element (deleted redl...
bool m_bInsideDeleteContext
Are we inside a element (deleted redline section)
css::uno::Reference< css::text::XTextCursor > & GetCursor()
uno::Reference< text::XText > m_xText
std::unique_ptr< Impl > m_xImpl
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertPlugin(const OUString &rMimeType, const OUString &rHRef, sal_Int32 nWidth, sal_Int32 nHeight)
void AddCrossRefHeadingMapping(OUString const &rFrom, OUString const &rTo)
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...
virtual css::uno::Reference< css::text::XTextCursor > RedlineCreateText(css::uno::Reference< css::text::XTextCursor > &rOldCursor, const OUString &rId)
XMLPropStyleContext * FindDrawingPage(OUString const &rName) const
XMLPropStyleContext * FindSectionStyle(const OUString &rName) const
rtl::Reference< SvXMLImportPropertyMapper > m_xParaImpPrMap
uno::Reference< container::XNameContainer > m_xFrameStyles
void MapCrossRefHeadingFieldsHorribly()
rtl::Reference< SvXMLImportPropertyMapper > const & GetRubyImportPropertySetMapper() const
virtual void RedlineSetCursor(const OUString &rId, bool bStart, bool bIsOutsideOfParagraph)
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
#define SAL_INFO_IF(condition, area, stream)
Reference< XFrame > xFrame
sal_Unicode ConvStarMathCharToStarSymbol(sal_Unicode c)
#define CONV_FROM_STAR_MATH
const SvxXMLListStyleContext * FindAutoListStyle(const OUString &rName) const
const ::std::vector< XMLPropertyState > & GetProperties_()
void PopListContext()
pop the list context stack
std::unique_ptr< XMLTextListsHelper > m_xTextListsHelper
void SetOpenRedlineId(OUString const &rId)
modify the last open redline ID
std::map< OUString, BookmarkMapEntry_t > m_BookmarkStartRanges
start ranges for open bookmarks
SvI18NMap & GetRenameMap()
const OUString & GetDropCapStyleName() const
const css::uno::Reference< css::container::XNameContainer > & GetParaStyles() const
rtl::Reference< SvXMLImportPropertyMapper > m_xFrameImpPrMap
uno::Reference< container::XNameAccess > m_xTextFrames
std::unique_ptr< std::vector< OUString >[]> m_xOutlineStylesCandidates
#define CONV_FROM_STAR_BATS
#define CTF_FONTFAMILYNAME
void ResetOpenRedlineId()
reset the last open redline ID
#define ODF_FORMDROPDOWN_RESULT
virtual bool IsInHeaderFooter() const
#define ODF_FORMCHECKBOX_RESULT
virtual void SetChangesProtectionKey(const css::uno::Sequence< sal_Int8 > &rProtectionKey)
bool HasStartValue() const
SvXMLImportContext * CreateTextChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, XMLTextType eType=XMLTextType::Shape)
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)
PropertiesInfo aProperties
OUString ConvertStarFonts(const OUString &rChars, const OUString &rStyleName, sal_uInt8 &rFlags, bool bPara, SvXMLImport &rImport) const
variable declaration container for all variable fields (variable-decls, user-field-decls, sequence-decls)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void InsertString(const OUString &rChars)
OUString msLastImportedFrameName
virtual void RedlineAdd(const OUString &rType, const OUString &rId, const OUString &rAuthor, const OUString &rComment, const css::util::DateTime &rDateTime, bool bMergeLastParagraph)
sal_Int32 GetDrawKey() const
const css::uno::Reference< css::container::XNameContainer > & GetFrameStyles() const
void ListContextTop(XMLTextListBlockContext *&o_pListBlockContext, XMLTextListItemContext *&o_pListItemContext, XMLNumberedParaContext *&o_pNumberedParagraphContext)
peek at the top of the list context stack
uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory
std::unique_ptr< std::vector< OUString > > m_xNextFrmNames
const OUString & getBookmarkCondition(OUString const &bookmark) const
void addFieldParam(const OUString &name, const OUString &value)
uno::Reference< container::XNameContainer > m_xCellStyles
uno::Reference< container::XNameContainer > m_xNumStyles
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)
static SvXMLImportPropertyMapper * CreateTableDefaultExtPropMapper(SvXMLImport &)
void ConnectFrameChains(const OUString &rFrmName, const OUString &rNextFrmName, const css::uno::Reference< css::beans::XPropertySet > &rFrmPropSet)
OUString m_sOpenRedlineIdentifier
name of the last 'open' redline that started between paragraphs
css::uno::Reference< css::text::XText > & GetText()
#define MAX_COMBINED_CHARACTERS
::std::tuple< field_name_type_t, field_params_t, uno::Reference< text::XFormField > > field_stack_item_t
void Increment(sal_Int32 nInc=1)
css::uno::Reference< css::text::XTextRange > & GetCursorAsRange()
uno::Reference< container::XIndexReplace > m_xChapterNumbering
uno::Reference< text::XTextCursor > m_xCursor
OUString getCurrentFieldType()
SvXMLImport & GetXMLImport()
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
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)
bool getBuildIds(sal_Int32 &rUPD, sal_Int32 &rBuild) const
returns the upd and build id (f.e.
const css::uno::Reference< css::container::XNameContainer > & GetPageStyles() const
sal_Unicode ConvStarBatsCharToStarSymbol(sal_Unicode c)
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
void SetCellParaStyleDefault(OUString const &rNewValue)
::std::vector< field_param_t > field_params_t
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)
bool IsTextDocInOOoFileFormat() const
const OUString & GetMasterPageName() const
uno::Reference< text::XTextRange > m_xCursorAsRange
bool getBookmarkHidden(OUString const &bookmark) const
ProgressBarHelper * GetProgressBarHelper()
static SvXMLImportPropertyMapper * CreateParaDefaultExtPropMapper(SvXMLImport &)
const css::uno::Reference< css::container::XIndexReplace > & GetChapterNumbering() const
std::vector< OUString > m_BookmarkVector
void PushListContext()
push a list context on the list context stack
static bool lcl_HasListStyle(const OUString &sStyleName, const Reference< XNameContainer > &xParaStyles, SvXMLImport const &rImport, const OUString &sNumberingStyleName, std::u16string_view sOutlineStyleName)
bool IsInsertMode() const
void FindOutlineStyleName(OUString &rStyleName, sal_Int8 nOutlineLevel)
Find a suitable name for the given outline level.
std::unique_ptr< SvI18NMap > m_xRenameMap
bool hasCurrentFieldCtx() const
uno::Reference< container::XNameContainer > m_xTextStyles
void InsertControlCharacter(sal_Int16 nControl)
void SetAutoStyles(SvXMLStylesContext *pStyles)
virtual ~XMLTextImportHelper() override
::std::pair< OUString, OUString > field_param_t
XMLPropertyMapEntry const g_XMLPageMasterDrawingPageStyleMap[]
virtual SvXMLImportContext * CreateTableChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
bool HasMasterPageName() const
void PushListContext(XMLTextListBlockContext *i_pListBlock)
list stack for importing:
const css::uno::Reference< css::container::XIndexReplace > & GetNumRules() const
Impl(uno::Reference< frame::XModel > const &rModel, SvXMLImport &rImport, bool const bInsertMode, bool const bStylesOnlyMode, bool const bProgress, bool const bBlockMode, bool const bOrganizerMode)
OUString m_sCellParaStyleDefault
XMLTextListsHelper & GetTextListHelper()
rtl::Reference< SvXMLImportPropertyMapper > m_xTextImpPrMap
const css::uno::Reference< css::container::XNameContainer > & GetNumberingStyles() const
rtl::Reference< SvXMLImportPropertyMapper > m_xRubyImpPrMap
static SvXMLImportPropertyMapper * CreateTableCellExtPropMapper(SvXMLImport &)
void SetRuby(SvXMLImport const &rImport, const css::uno::Reference< css::text::XTextCursor > &rCursor, const OUString &rStyleName, const OUString &rTextStyleName, const OUString &rText)
This class deliberately does not support XWeak, to improve performance when loading large documents...
bool IsListStyleSet() const
void InsertTextContent(css::uno::Reference< css::text::XTextContent > const &xContent)
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 RedlineAdjustStartNodeCursor()
bool m_bBodyContentStarted
std::unique_ptr< std::map< OUString, OUString > > m_pCrossRefHeadingBookmarkMap
void StoreLastImportedFrameName(const OUString &rName)
::std::pair< OUString, OUString > field_name_type_t
const css::uno::Reference< css::container::XNameContainer > & GetTextStyles() const
void SetOutlineStyles(bool bSetEmpty)
css::uno::Reference< css::text::XFormField > popFieldCtx()
const OUString & GetParentName() const
uno::Reference< container::XNameContainer > m_xParaStyles
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)
uno::Reference< container::XNameContainer > m_xPageStyles
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
#define SAL_WARN_IF(condition, area, stream)
sal_Int16 GetStartValue() const
uno::Reference< container::XNameAccess > m_xGraphics
void SetListItem(XMLTextListItemContext *pListItem)
set list item on top of the list context stack
bool IsStylesOnlyMode() const
#define CONV_STAR_FONT_FLAGS_VALID
Handling of tokens in XML:
XMLTextImportHelper(const XMLTextImportHelper &)=delete
XMLPropStyleContext * FindAutoFrameStyle(const OUString &rName) const
#define SAL_INFO(area, stream)
#define ODF_FORMDROPDOWN_LISTENTRY
void PopListContext()
pop the list context stack
const OUString & GetListId() const
void AddOutlineStyleCandidate(const sal_Int8 nOutlineLevel, const OUString &rStyleName)
void ClearLastImportedTextFrameName()
void pushFieldCtx(const OUString &name, const OUString &type)
rtl::Reference< SvXMLImportPropertyMapper > const & GetParaImportPropertySetMapper() const
#define XML_ELEMENT(prefix, name)
Smart struct to transport an Any with an index to the appropriate property-name.
void copy(const fs::path &src, const fs::path &dest)
sal_Int16 GetStartValue() const
bool HasNumRulesOverride() const
rtl::Reference< SvXMLStylesContext > m_xAutoStyles
SvXMLImport & m_rSvXMLImport
void SetCursor(const css::uno::Reference< css::text::XTextCursor > &rCursor)
bool HasFrameByName(const OUString &rName) const
static SvXMLImportPropertyMapper * CreateDrawingPageExtPropMapper(SvXMLImport &)
std::map< OUString, OUString > m_sBookmarkCondition
bool IsDuplicateFrame(const OUString &sName, sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight) const
rtl::Reference< SvXMLImportPropertyMapper > const & GetSectionImportPropertySetMapper() const
rtl::Reference< SvXMLImportPropertyMapper > const & GetTextImportPropertySetMapper() const
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
void InitOutlineStylesCandidates()
sal_Int16 GetLevel() const
uno::Reference< container::XNameAccess > m_xObjects
bool HasCombinedCharactersLetter() const
::std::stack< field_stack_item_t > field_stack_t
virtual css::uno::Reference< css::beans::XPropertySet > createAndInsertFloatingFrame(const OUString &rName, const OUString &rHRef, const OUString &rStyleName, sal_Int32 nWidth, sal_Int32 nHeight)
import dde field declaration container ()
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)
bool IsInsideDeleteContext() const
redlining : Getter to know if we are inside a element (deleted redline section) ...
XMLPropStyleContext * FindPageMaster(const OUString &rName) const
static SvXMLImportPropertyMapper * CreateParaExtPropMapper(SvXMLImport &)
void setBookmarkAttributes(OUString const &bookmark, bool hidden, OUString const &condition)
virtual void SetRecordChanges(bool bRecordChanges)
static SvXMLImportPropertyMapper * CreateTableRowDefaultExtPropMapper(SvXMLImport &)
void ChainImportMapper(const rtl::Reference< SvXMLImportPropertyMapper > &rMapper)
import change tracking/redlining markers , , ...
std::unique_ptr< std::vector< OUString > > m_xPrevFrmNames
const OUString & GetListStyle() const
const css::uno::Reference< css::container::XNameContainer > & GetCellStyles() const
bool IsSystemLanguage() const
determine whether number format uses the system language
Impl & operator=(const Impl &)=delete
rtl::Reference< SvXMLImportPropertyMapper > m_xSectionImpPrMap
std::map< OUString, bool > m_bBookmarkHidden
void setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField > const &xFormField)
virtual void endAppletOrPlugin(const css::uno::Reference< css::beans::XPropertySet > &rPropSet,::std::map< const OUString, OUString > &rParamMap)
std::tuple< uno::Reference< text::XTextRange >, OUString, std::shared_ptr< ::xmloff::ParsedRDFaAttributes > > BookmarkMapEntry_t
OUString const & GetCellParaStyleDefault() const
field_stack_t m_FieldStack
OUString const & GetOpenRedlineId() const
get the last open redline ID
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...
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)