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;
93#define MAX_COMBINED_CHARACTERS 6
117 std::unique_ptr< std::vector< OUString > []>
122 uno::Reference<text::XTextRange>, OUString,
123 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > >
169 typedef ::std::tuple<field_name_type_t, field_params_t, uno::Reference<text::XFormField>>
field_stack_item_t;
178 Impl( uno::Reference<frame::XModel>
const& rModel,
180 bool const bInsertMode,
bool const bStylesOnlyMode,
181 bool const bProgress,
bool const bBlockMode,
182 bool const bOrganizerMode)
205 new ::std::vector< OUString >[
size] );
224 return m_xImpl->m_xCursorAsRange;
234 return m_xImpl->m_bStylesOnlyMode;
244 return m_xImpl->m_bOrganizerMode;
252uno::Reference<container::XNameContainer>
const&
258uno::Reference<container::XNameContainer>
const&
264uno::Reference<container::XNameContainer>
const&
270uno::Reference<container::XNameContainer>
const&
273 return m_xImpl->m_xFrameStyles;
276uno::Reference<container::XNameContainer>
const&
282uno::Reference<container::XNameContainer>
const&
288uno::Reference<container::XIndexReplace>
const&
291 return m_xImpl->m_xChapterNumbering;
297 return m_xImpl->m_xParaImpPrMap;
303 return m_xImpl->m_xTextImpPrMap;
309 return m_xImpl->m_xSectionImpPrMap;
315 return m_xImpl->m_xRubyImpPrMap;
320 m_xImpl->m_bInsideDeleteContext = bNew;
325 return m_xImpl->m_bInsideDeleteContext;
330 return m_xImpl->m_rSvXMLImport;
335 return *
m_xImpl->m_xTextListsHelper;
340 class FieldParamImporter
343 typedef pair<OUString,OUString> field_param_t;
344 typedef vector<field_param_t> field_params_t;
345 FieldParamImporter(
const field_params_t*
const pInParams, Reference<XNameContainer>
const & xOutParams)
346 : m_pInParams(pInParams)
347 , m_xOutParams(xOutParams)
352 const field_params_t*
const m_pInParams;
353 Reference<XNameContainer> m_xOutParams;
356 void FieldParamImporter::Import()
358 ::std::vector<OUString> vListEntries;
359 ::std::map<OUString, Any> vOutParams;
360 for(
const auto& rCurrent : *m_pInParams)
365 vOutParams[rCurrent.first] <<= rCurrent.second.toInt32();
370 vOutParams[rCurrent.first] <<= rCurrent.second.toBoolean();
375 vListEntries.push_back(rCurrent.second);
378 vOutParams[rCurrent.first] <<= rCurrent.second;
380 if(!vListEntries.empty())
382 Sequence<OUString> vListEntriesSeq(vListEntries.size());
383 copy(vListEntries.begin(), vListEntries.end(), vListEntriesSeq.getArray());
386 for(
const auto& rCurrent : vOutParams)
390 m_xOutParams->insertByName(rCurrent.first, rCurrent.second);
392 catch(
const ElementExistException&)
394 SAL_INFO(
"xmloff.text",
"duplicate fieldmark param");
401 uno::Reference<frame::XModel>
const& rModel,
403 bool const bInsertMode,
bool const bStylesOnlyMode,
404 bool const bProgress,
bool const bBlockMode,
405 bool const bOrganizerMode)
406 : m_xImpl( new Impl(rModel, rImport, bInsertMode, bStylesOnlyMode,
407 bProgress, bBlockMode, bOrganizerMode) )
408 , m_xBackpatcherImpl( MakeBackpatcherImpl() )
410 static constexpr OUStringLiteral s_PropNameDefaultListId =
u"DefaultListId";
412 Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY );
414 if (xCNSupplier.is())
417 m_xImpl->m_xChapterNumbering = xCNSupplier->getChapterNumberingRules();
421 Reference< XPropertySet >
const xNumRuleProps(
422 m_xImpl->m_xChapterNumbering, UNO_QUERY);
423 if ( xNumRuleProps.is() )
425 Reference< XPropertySetInfo > xNumRulePropSetInfo(
426 xNumRuleProps->getPropertySetInfo());
427 if (xNumRulePropSetInfo.is() &&
428 xNumRulePropSetInfo->hasPropertyByName(
429 s_PropNameDefaultListId))
432 xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
434 assert( !sListId.isEmpty() &&
435 "no default list id found at chapter numbering rules instance. Serious defect." );
436 if ( !sListId.isEmpty() )
438 Reference< XNamed >
const xChapterNumNamed(
439 m_xImpl->m_xChapterNumbering, UNO_QUERY);
440 if ( xChapterNumNamed.is() )
442 m_xImpl->m_xTextListsHelper->KeepListAsProcessed(
444 xChapterNumNamed->getName(),
453 Reference< XStyleFamiliesSupplier > xFamiliesSupp( rModel, UNO_QUERY );
456 if( xFamiliesSupp.is() )
458 Reference< XNameAccess > xFamilies(xFamiliesSupp->getStyleFamilies());
460 static const OUStringLiteral aParaStyles(u
"ParagraphStyles");
461 if( xFamilies->hasByName( aParaStyles ) )
463 m_xImpl->m_xParaStyles.set(xFamilies->getByName(aParaStyles),
467 static const OUStringLiteral aCharStyles(u
"CharacterStyles");
468 if( xFamilies->hasByName( aCharStyles ) )
470 m_xImpl->m_xTextStyles.set(xFamilies->getByName(aCharStyles),
474 static const OUStringLiteral aNumStyles(u
"NumberingStyles");
475 if( xFamilies->hasByName( aNumStyles ) )
477 m_xImpl->m_xNumStyles.set(xFamilies->getByName(aNumStyles),
481 static const OUStringLiteral aFrameStyles(u
"FrameStyles");
482 if( xFamilies->hasByName( aFrameStyles ) )
484 m_xImpl->m_xFrameStyles.set(xFamilies->getByName(aFrameStyles),
488 static const OUStringLiteral aPageStyles(u
"PageStyles");
489 if( xFamilies->hasByName( aPageStyles ) )
491 m_xImpl->m_xPageStyles.set(xFamilies->getByName(aPageStyles),
495 static const OUStringLiteral aCellStyles(u
"CellStyles");
496 if( xFamilies->hasByName( aCellStyles ) )
498 m_xImpl->m_xCellStyles.set(xFamilies->getByName(aCellStyles),
503 Reference < XTextFramesSupplier > xTFS( rModel, UNO_QUERY );
506 m_xImpl->m_xTextFrames.set(xTFS->getTextFrames());
509 Reference < XTextGraphicObjectsSupplier > xTGOS( rModel, UNO_QUERY );
512 m_xImpl->m_xGraphics.set(xTGOS->getGraphicObjects());
515 Reference < XTextEmbeddedObjectsSupplier > xTEOS( rModel, UNO_QUERY );
518 m_xImpl->m_xObjects.set(xTEOS->getEmbeddedObjects());
550 m_xImpl->m_xAutoStyles->dispose();
577 return pImportMapper;
618 m_xImpl->m_xCursor.set(rCursor);
619 m_xImpl->m_xText.set(rCursor->getText());
620 m_xImpl->m_xCursorAsRange = rCursor;
625 m_xImpl->m_xCursor.set(
nullptr);
627 m_xImpl->m_xCursorAsRange.set(
nullptr);
633 return (
m_xImpl->m_xTextFrames.is() &&
634 m_xImpl->m_xTextFrames->hasByName(rName))
635 || (
m_xImpl->m_xGraphics.is() &&
636 m_xImpl->m_xGraphics->hasByName(rName))
637 || (
m_xImpl->m_xObjects.is() &&
638 m_xImpl->m_xObjects->hasByName(rName));
645 uno::Reference<beans::XPropertySet> xOtherFrame;
647 xOtherFrame.set(
m_xImpl->m_xTextFrames->getByName(
sName), uno::UNO_QUERY);
649 xOtherFrame.set(
m_xImpl->m_xGraphics->getByName(
sName), uno::UNO_QUERY);
651 xOtherFrame.set(
m_xImpl->m_xObjects->getByName(
sName), uno::UNO_QUERY);
653 Reference< XPropertySetInfo > xPropSetInfo = xOtherFrame->getPropertySetInfo();
654 if(xPropSetInfo->hasPropertyByName(
"Width"))
656 sal_Int32 nOtherWidth = 0;
657 xOtherFrame->getPropertyValue(
"Width") >>= nOtherWidth;
658 if(nWidth != nOtherWidth)
662 if (xPropSetInfo->hasPropertyByName(
"Height"))
664 sal_Int32 nOtherHeight = 0;
665 xOtherFrame->getPropertyValue(
"Height") >>= nOtherHeight;
666 if (nHeight != nOtherHeight)
670 if (xPropSetInfo->hasPropertyByName(
"HoriOrientPosition"))
672 sal_Int32 nOtherX = 0;
673 xOtherFrame->getPropertyValue(
"HoriOrientPosition") >>= nOtherX;
678 if (xPropSetInfo->hasPropertyByName(
"VertOrientPosition"))
680 sal_Int32 nOtherY = 0;
681 xOtherFrame->getPropertyValue(
"VertOrientPosition") >>= nOtherY;
694 m_xImpl->msLastImportedFrameName = rName;
699 m_xImpl->msLastImportedFrameName.clear();
705 assert(
m_xImpl->m_xCursorAsRange.is());
714 bool& rIgnoreLeadingSpace )
717 assert(
m_xImpl->m_xCursorAsRange.is());
721 sal_Int32 nLen = rChars.getLength();
722 OUStringBuffer sChars( nLen );
724 for( sal_Int32
i=0;
i < nLen;
i++ )
733 if( !rIgnoreLeadingSpace )
734 sChars.append(
u' ' );
735 rIgnoreLeadingSpace =
true;
738 rIgnoreLeadingSpace =
false;
744 sChars.makeStringAndClear(),
false);
750 assert(
m_xImpl->m_xCursorAsRange.is());
753 m_xImpl->m_xText->insertControlCharacter(
754 m_xImpl->m_xCursorAsRange, nControl,
false);
759 Reference < XTextContent >
const & xContent )
762 assert(
m_xImpl->m_xCursorAsRange.is());
773 assert(
m_xImpl->m_xCursor.is());
774 assert(
m_xImpl->m_xCursorAsRange.is());
777 Reference < XEnumerationAccess >
const xEnumAccess(
778 m_xImpl->m_xCursor, UNO_QUERY);
779 if( xEnumAccess.is() )
781 Reference < XEnumeration > xEnum(xEnumAccess->createEnumeration());
782 SAL_WARN_IF(!xEnum->hasMoreElements(),
"xmloff.text",
783 "empty text enumeration");
784 if( xEnum->hasMoreElements() )
786 Reference < XComponent > xComp( xEnum->nextElement(), UNO_QUERY );
797 if (
m_xImpl->m_xCursor->goLeft( 1,
true ))
806 const OUString& rStyleName,
811 OUStringBuffer sChars( rChars );
812 bool bConverted =
false;
813 for( sal_Int32 j=0; j<rChars.getLength(); j++ )
816 if( c >= 0xf000 && c <= 0xf0ff )
823 if (!rStyleName.isEmpty() &&
m_xImpl->m_xAutoStyles.is())
827 FindStyleChildContext( nFamily, rStyleName,
838 m_xImpl->m_xAutoStyles->GetImportPropertyMapper(nFamily);
842 xImpPrMap->getPropertySetMapper();
846 sal_Int32 nIdx = rProp.
mnIndex;
847 sal_uInt32 nContextId = rPropMapper->GetEntryContextId(nIdx);
853 if( sFontName.equalsIgnoreAsciiCase(
"StarBats" ) )
855 else if( sFontName.equalsIgnoreAsciiCase(
"StarMath" ) )
880 return bConverted ? sChars.makeStringAndClear() : rChars;
890 const Reference < XNameContainer >& xParaStyles,
892 const OUString& sNumberingStyleName,
893 std::u16string_view sOutlineStyleName )
897 if ( !xParaStyles->hasByName( sStyleName ) )
903 Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ),
905 if ( !xPropState.is() )
911 if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
916 Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
920 xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
921 if ( !sListStyle.isEmpty() &&
922 sListStyle == sOutlineStyleName )
932 sal_Int32 nBuild( 0 );
934 const bool bBuildIdFound = rImport.
getBuildIds( nUPD, nBuild );
936 Reference<XStyle> xStyle( xPropState, UNO_QUERY );
937 while ( xStyle.is() )
939 OUString aParentStyle( xStyle->getParentStyle() );
940 if ( !aParentStyle.isEmpty() )
946 if ( aParentStyle.isEmpty() || !xParaStyles->hasByName( aParentStyle ) )
953 xPropState.set( xParaStyles->getByName( aParentStyle ),
955 if ( !xPropState.is() )
960 if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
965 Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
969 xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
970 if ( !sListStyle.isEmpty() &&
971 sListStyle == sOutlineStyleName )
979 else if ( sListStyle.isEmpty() &&
982 ( ( nUPD == 641 ) || ( nUPD == 645 ) ||
983 ( nUPD == 680 && nBuild <= 9238 ) ) ) ) )
993 Reference<XStyle> xParentStyle(xPropState, UNO_QUERY);
994 if (xStyle == xParentStyle)
999 xStyle = xParentStyle;
1009 const Reference < XTextCursor >& rCursor,
1010 const OUString& rStyleName,
1012 bool bOutlineLevelAttrFound,
1016 bool bOutlineContentVisible)
1018 static constexpr OUStringLiteral s_NumberingRules =
u"NumberingRules";
1019 static constexpr OUStringLiteral s_NumberingIsNumber =
u"NumberingIsNumber";
1020 static constexpr OUStringLiteral s_NumberingLevel =
u"NumberingLevel";
1021 static constexpr OUStringLiteral s_ParaIsNumberingRestart =
u"ParaIsNumberingRestart";
1022 static constexpr OUStringLiteral s_NumberingStartValue =
u"NumberingStartValue";
1023 static constexpr OUStringLiteral s_PropNameListId =
u"ListId";
1024 static constexpr OUStringLiteral s_PageDescName =
u"PageDescName";
1025 static constexpr OUStringLiteral s_OutlineLevel =
u"OutlineLevel";
1030 OUString sStyleName( rStyleName );
1031 if (!sStyleName.isEmpty() &&
m_xImpl->m_xAutoStyles.is())
1034 m_xImpl->m_xAutoStyles->FindStyleChildContext( nFamily, sStyleName,
true );
1040 Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
1041 Reference< XPropertySetInfo > xPropSetInfo(
1042 xPropSet->getPropertySetInfo());
1045 if( !sStyleName.isEmpty() )
1048 const OUString rPropName = bPara ? OUString(
"ParaStyleName") : OUString(
"CharStyleName");
1049 const Reference < XNameContainer > & rStyles = bPara
1053 xPropSetInfo->hasPropertyByName( rPropName ) &&
1054 rStyles->hasByName( sStyleName ) )
1056 xPropSet->setPropertyValue( rPropName,
Any(sStyleName) );
1065 bool bApplyOutlineLevelAsListLevel(
false );
1067 if (bSetListAttrs && bPara
1068 && xPropSetInfo->hasPropertyByName( s_NumberingRules))
1071 Reference< XIndexReplace >
const xNumRules(
1072 xPropSet->getPropertyValue(s_NumberingRules), UNO_QUERY);
1078 pListBlock, pListItem, pNumberedParagraph);
1080 assert(!(pListBlock && pNumberedParagraph) &&
"XMLTextImportHelper::"
1081 "SetStyleAndAttrs: both list and numbered-paragraph???");
1083 Reference < XIndexReplace > xNewNumRules;
1086 sal_Int16 nStartValue(-1);
1087 bool bNumberingIsNumber(
true);
1092 bNumberingIsNumber =
false;
1106 sListId =
m_xImpl->m_xTextListsHelper->GetListIdForListBlock(
1109 else if (pNumberedParagraph)
1111 xNewNumRules.set(pNumberedParagraph->
GetNumRules());
1113 sListId = pNumberedParagraph->
GetListId();
1118 if (pListBlock || pNumberedParagraph)
1122 if ( !bApplyNumRules )
1124 bool bSameNumRules = xNewNumRules == xNumRules;
1125 if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
1131 Reference< XNamed > xNewNamed( xNewNumRules, UNO_QUERY );
1132 Reference< XNamed > xNamed( xNumRules, UNO_QUERY );
1133 if( xNewNamed.is() && xNamed.is() )
1135 bSameNumRules = xNewNamed->getName() == xNamed->getName();
1139 Reference< XAnyCompare > xNumRuleCompare( xNumRules, UNO_QUERY );
1140 if( xNumRuleCompare.is() )
1142 bSameNumRules = (xNumRuleCompare->compare(
Any(xNumRules),
Any(xNewNumRules) ) == 0);
1146 bApplyNumRules = !bSameNumRules;
1149 if ( bApplyNumRules )
1158 xPropSet->setPropertyValue(
1159 s_NumberingRules,
Any(xNewNumRules) );
1169 if (!bNumberingIsNumber &&
1170 xPropSetInfo->hasPropertyByName(s_NumberingIsNumber))
1172 xPropSet->setPropertyValue(s_NumberingIsNumber,
Any(
false));
1175 xPropSet->setPropertyValue( s_NumberingLevel,
Any(nLevel) );
1180 if (xPropSetInfo->hasPropertyByName(s_ParaIsNumberingRestart))
1182 xPropSet->setPropertyValue(s_ParaIsNumberingRestart,
1188 if ( 0 <= nStartValue &&
1189 xPropSetInfo->hasPropertyByName(s_NumberingStartValue))
1191 xPropSet->setPropertyValue(s_NumberingStartValue,
1195 if (xPropSetInfo->hasPropertyByName(s_PropNameListId))
1197 if (!sListId.isEmpty()) {
1198 xPropSet->setPropertyValue(s_PropNameListId,
1211 if( xNumRules.is() )
1213 bool bRemove(
true );
1215 sal_Int32 nUPD( 0 );
1216 sal_Int32 nBuild( 0 );
1217 const bool bBuildIdFound = rImport.
getBuildIds( nUPD, nBuild );
1218 if ( ( bBuildIdFound && nUPD == 680 ) ||
1221 if (
m_xImpl->m_xChapterNumbering.is())
1223 Reference< XNamed > xNumNamed( xNumRules, UNO_QUERY );
1224 Reference< XNamed >
const xChapterNumNamed (
1225 m_xImpl->m_xChapterNumbering, UNO_QUERY);
1226 if ( xNumNamed.is() && xChapterNumNamed.is() &&
1227 xNumNamed->getName() == xChapterNumNamed->getName() )
1231 bApplyOutlineLevelAsListLevel =
true;
1239 "automatic paragraph style with list style name, but paragraph not in list???");
1243 xPropSet->setPropertyValue( s_NumberingRules,
Any() );
1254 xPropSetInfo->hasPropertyByName(s_PageDescName))
1261 (
m_xImpl->m_xPageStyles.is() &&
1264 xPropSet->setPropertyValue(s_PageDescName,
1276 xPropSetInfo->hasPropertyByName(
"DropCapCharStyleName"))
1278 xPropSet->setPropertyValue(
"DropCapCharStyleName",
Any(
sDisplayName));
1286 if (
m_xImpl->m_xServiceFactory.is())
1288 uno::Reference<beans::XPropertySet>
const xTmp(
1289 m_xImpl->m_xServiceFactory->createInstance(
1290 "com.sun.star.text.TextField.CombinedCharacters"), UNO_QUERY);
1295 if (rCursor->getString().getLength() >
1298 rCursor->gotoRange(rCursor->getStart(),
false);
1303 xTmp->setPropertyValue(
"Content",
1304 Any(rCursor->getString()));
1307 Reference<XTextContent> xTextContent(xTmp, UNO_QUERY);
1308 if (
m_xImpl->m_xText.is() && rCursor.is())
1312 m_xImpl->m_xText->insertTextContent( rCursor->getStart(), xTextContent,
true );
1314 if( !rCursor->getString().isEmpty() )
1318 uno::Reference< text::XTextCursor > xCrsr = rCursor->getText()->createTextCursorByRange( rCursor->getStart() );
1319 xCrsr->goLeft( 1,
true );
1320 uno::Reference< beans::XPropertySet> xCrsrProperties( xCrsr, uno::UNO_QUERY_THROW );
1323 xCrsr->collapseToEnd();
1324 xCrsr->gotoRange( rCursor->getEnd(),
true );
1325 xCrsr->setString( OUString() );
1327 catch(
const uno::Exception&)
1350 sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
1351 const bool bHasOutlineLevelProp(
1352 xPropSetInfo->hasPropertyByName(s_OutlineLevel));
1353 if ( bHasOutlineLevelProp )
1355 xPropSet->getPropertyValue(s_OutlineLevel)
1356 >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
1358 if ( nOutlineLevel > 0 )
1360 if ( bHasOutlineLevelProp )
1364 if ( nCurrentOutlineLevelInheritedFromParagraphStyle != nOutlineLevel )
1366 xPropSet->setPropertyValue( s_OutlineLevel,
1367 Any(
static_cast<sal_Int16
>(nOutlineLevel) ) );
1370 if (!bOutlineContentVisible)
1372 uno::Sequence<beans::PropertyValue> aGrabBag;
1373 xPropSet->getPropertyValue(
"ParaInteropGrabBag") >>= aGrabBag;
1374 sal_Int32
length = aGrabBag.getLength();
1375 aGrabBag.realloc(
length + 1);
1376 auto pGrabBag = aGrabBag.getArray();
1377 pGrabBag[
length].Name =
"OutlineContentVisibleAttr";
1378 pGrabBag[
length].Value <<= bool(bOutlineContentVisible);
1379 xPropSet->setPropertyValue(
"ParaInteropGrabBag",
uno::Any(aGrabBag));
1382 if ( bApplyOutlineLevelAsListLevel )
1384 sal_Int16 nNumLevel = -1;
1385 xPropSet->getPropertyValue( s_NumberingLevel ) >>= nNumLevel;
1386 if ( nNumLevel == -1 ||
1387 nNumLevel != (nOutlineLevel - 1) )
1389 xPropSet->setPropertyValue( s_NumberingLevel,
1390 Any(
static_cast<sal_Int8>(nOutlineLevel - 1) ) );
1402 if (
m_xImpl->m_xParaStyles.is() &&
m_xImpl->m_xParaStyles->hasByName(sStyleName))
1404 bool bOutlineStyleCandidate(
false );
1406 sal_Int32 nUPD( 0 );
1407 sal_Int32 nBuild( 0 );
1408 const bool bBuildIdFound = rImport.
getBuildIds( nUPD, nBuild );
1413 ( nUPD == 645 || nUPD == 641 ) ) )
1415 bOutlineStyleCandidate =
true;
1417 else if ( nUPD == 680 && nBuild <= 9073 )
1419 bOutlineStyleCandidate = bOutlineLevelAttrFound;
1421 if ( bOutlineStyleCandidate )
1427 !bOutlineStyleCandidate &&
1428 m_xImpl->m_xChapterNumbering.is())
1432 u"NumberingStyleName",
1436 xPropSet->setPropertyValue( s_NumberingRules,
1438 xPropSet->setPropertyValue( s_NumberingLevel,
1445 else if( bHasOutlineLevelProp )
1447 if ( nCurrentOutlineLevelInheritedFromParagraphStyle != 0 )
1449 xPropSet->setPropertyValue(s_OutlineLevel,
1450 Any( sal_Int16(0) ));
1462 if( !rStyleName.isEmpty() )
1466 if (
m_xImpl->m_xChapterNumbering.is() &&
1467 ( nOutlineLevel > 0 ) &&
1468 (nOutlineLevel <= m_xImpl->m_xChapterNumbering->getCount()))
1475 m_xImpl->InitOutlineStylesCandidates();
1476 if (
m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel].empty())
1482 m_xImpl->m_xChapterNumbering->getByIndex( nOutlineLevel )
1485 [](
const PropertyValue& rProp) {
return rProp.Name ==
"HeadingStyleName"; });
1488 OUString aOutlineStyle;
1489 pProp->Value >>= aOutlineStyle;
1490 m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel]
1491 .push_back( aOutlineStyle );
1499 m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel].back();
1506 const OUString& rStyleName )
1508 if (!rStyleName.isEmpty()
1509 &&
m_xImpl->m_xChapterNumbering.is()
1510 && (nOutlineLevel > 0)
1511 && (nOutlineLevel <= m_xImpl->m_xChapterNumbering->getCount()))
1513 m_xImpl->InitOutlineStylesCandidates();
1514 m_xImpl->m_xOutlineStylesCandidates[nOutlineLevel-1].push_back(
1521 if (!(
m_xImpl->m_xOutlineStylesCandidates !=
nullptr || bSetEmptyLevels) ||
1522 !
m_xImpl->m_xChapterNumbering.is() ||
1526 bool bChooseLastOne(
false );
1530 bChooseLastOne =
true;
1534 sal_Int32 nUPD( 0 );
1535 sal_Int32 nBuild( 0 );
1539 bChooseLastOne = ( nUPD == 641 ) || ( nUPD == 645 ) ||
1540 ( nUPD == 680 && nBuild <= 9073 );
1545 OUString sOutlineStyleName;
1547 Reference<XPropertySet> xChapterNumRule(
1548 m_xImpl->m_xChapterNumbering, UNO_QUERY);
1549 xChapterNumRule->getPropertyValue(
"Name") >>= sOutlineStyleName;
1552 const sal_Int32
nCount =
m_xImpl->m_xChapterNumbering->getCount();
1559 ::std::vector<OUString> sChosenStyles(
nCount);
1562 if ( bSetEmptyLevels ||
1563 (
m_xImpl->m_xOutlineStylesCandidates &&
1564 !
m_xImpl->m_xOutlineStylesCandidates[
i].empty()))
1568 if (
m_xImpl->m_xOutlineStylesCandidates &&
1569 !
m_xImpl->m_xOutlineStylesCandidates[
i].empty())
1571 if ( bChooseLastOne )
1574 m_xImpl->m_xOutlineStylesCandidates[
i].back();
1579 j <
m_xImpl->m_xOutlineStylesCandidates[
i].size();
1583 m_xImpl->m_xOutlineStylesCandidates[
i][j],
1586 "NumberingStyleName",
1590 m_xImpl->m_xOutlineStylesCandidates[
i][j];
1599 Sequence < PropertyValue > aProps( 1 );
1600 PropertyValue *pProps = aProps.getArray();
1601 pProps->Name =
"HeadingStyleName";
1602 for ( sal_Int32
i = 0;
i <
nCount; ++
i )
1605 if ( bSetEmptyLevels || !sChosenStyles[
i].isEmpty() )
1607 pProps->Value <<= sChosenStyles[
i];
1608 m_xImpl->m_xChapterNumbering->replaceByIndex(
i,
1617 const Reference < XTextCursor >& rCursor,
1618 const OUString& rHRef,
1619 const OUString& rName,
1620 const OUString& rTargetFrameName,
1621 const OUString& rStyleName,
1622 const OUString& rVisitedStyleName,
1625 static constexpr OUStringLiteral s_HyperLinkURL =
u"HyperLinkURL";
1626 static constexpr OUStringLiteral s_HyperLinkName =
u"HyperLinkName";
1627 static constexpr OUStringLiteral s_HyperLinkTarget =
u"HyperLinkTarget";
1628 static constexpr OUStringLiteral s_UnvisitedCharStyleName =
u"UnvisitedCharStyleName";
1629 static constexpr OUStringLiteral s_VisitedCharStyleName =
u"VisitedCharStyleName";
1630 static constexpr OUStringLiteral s_HyperLinkEvents =
u"HyperLinkEvents";
1632 Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
1633 Reference < XPropertySetInfo > xPropSetInfo(
1634 xPropSet->getPropertySetInfo());
1635 if (!xPropSetInfo.is() || !xPropSetInfo->hasPropertyByName(s_HyperLinkURL))
1638 xPropSet->setPropertyValue(s_HyperLinkURL,
Any(rHRef));
1640 if (xPropSetInfo->hasPropertyByName(s_HyperLinkName))
1642 xPropSet->setPropertyValue(s_HyperLinkName,
Any(rName));
1645 if (xPropSetInfo->hasPropertyByName(s_HyperLinkTarget))
1647 xPropSet->setPropertyValue(s_HyperLinkTarget,
1648 Any(rTargetFrameName));
1651 if ( (pEvents !=
nullptr) &&
1652 xPropSetInfo->hasPropertyByName(s_HyperLinkEvents))
1658 uno::Reference<XNameReplace>
const xReplace(
1659 xPropSet->getPropertyValue(s_HyperLinkEvents), UNO_QUERY);
1666 xPropSet->setPropertyValue(s_HyperLinkEvents,
Any(xReplace));
1670 if (!
m_xImpl->m_xTextStyles.is())
1677 xPropSetInfo->hasPropertyByName(s_UnvisitedCharStyleName) &&
1680 xPropSet->setPropertyValue(s_UnvisitedCharStyleName,
1688 xPropSetInfo->hasPropertyByName(s_VisitedCharStyleName) &&
1691 xPropSet->setPropertyValue(s_VisitedCharStyleName,
1698 const Reference < XTextCursor >& rCursor,
1699 const OUString& rStyleName,
1700 const OUString& rTextStyleName,
1701 const OUString& rText )
1703 Reference<XPropertySet> xPropSet(rCursor, UNO_QUERY);
1705 OUString sRubyText(
"RubyText");
1708 if (!xPropSet.is() ||
1709 !xPropSet->getPropertySetInfo()->hasPropertyByName( sRubyText ))
1713 xPropSet->setPropertyValue(sRubyText,
Any(rText));
1716 if (!rStyleName.isEmpty() &&
m_xImpl->m_xAutoStyles.is())
1723 if (
nullptr != pStyle)
1728 if (
m_xImpl->m_xTextStyles.is())
1743 m_xImpl->m_xAutoStyles = pStyles;
1749 const Reference< XFastAttributeList > & xAttrList,
1754 bool bContent =
true;
1771 rImport, nElement, xAttrList );
1827 TextContentAnchorType eAnchorType =
1829 : TextContentAnchorType_AT_PAGE;
1840 TextContentAnchorType eAnchorType =
1842 : TextContentAnchorType_AT_PAGE;
1900 Reference < XShapes > xShapes;
1902 rImport, nElement, xAttrList, xShapes );
1917 m_xImpl->m_bBodyContentStarted =
false;
1932 const Reference< XFastAttributeList > & )
1939 bool* pIsSystemLanguage )
1941 if (!
m_xImpl->m_xAutoStyles.is())
1964 if( pIsSystemLanguage !=
nullptr )
1968 return pNumStyle->
GetKey();
1977 if (
m_xImpl->m_xAutoStyles.is())
1991 if (
m_xImpl->m_xAutoStyles.is())
2003 const OUString& rName )
const
2006 if (
m_xImpl->m_xAutoStyles.is())
2009 m_xImpl->m_xAutoStyles->FindStyleChildContext(
2019 const OUString& rName )
const
2022 if (
m_xImpl->m_xAutoStyles.is())
2025 m_xImpl->m_xAutoStyles->FindStyleChildContext(
2036 if (!
m_xImpl->m_xAutoStyles.is())
2041 m_xImpl->m_xAutoStyles->FindStyleChildContext(
2064 return *
m_xImpl->m_xRenameMap;
2068 const OUString & sName,
2069 const Reference<XTextRange> & rRange,
2070 OUString
const& i_rXmlId,
2071 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & i_rpRDFaAttributes)
2074 std::make_tuple(rRange, i_rXmlId, i_rpRDFaAttributes);
2079 const OUString & sName,
2080 Reference<XTextRange> & o_rRange,
2081 OUString & o_rXmlId,
2082 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes)
2088 o_rRange.set(std::get<0>(rEntry));
2089 o_rXmlId = std::get<1>(rEntry);
2090 o_rpRDFaAttributes = std::get<2>(rEntry);
2092 auto it = std::find(
m_xImpl->m_BookmarkVector.begin(),
m_xImpl->m_BookmarkVector.end(),
sName);
2093 if (it!=
m_xImpl->m_BookmarkVector.end())
2095 m_xImpl->m_BookmarkVector.erase(it);
2111uno::Reference<text::XFormField>
2114 uno::Reference<text::XFormField> xRet;
2115 if ( !
m_xImpl->m_FieldStack.empty() )
2117 xRet = std::get<2>(
m_xImpl->m_FieldStack.top());
2122 SAL_INFO(
"xmloff.text",
"unexpected fieldmark end");
2129 assert(!
m_xImpl->m_FieldStack.empty());
2130 if (!
m_xImpl->m_FieldStack.empty()) {
2132 std::get<1>(FieldStackItem).emplace_back(
name,
value );
2138 assert(!
m_xImpl->m_FieldStack.empty());
2139 if (!
m_xImpl->m_FieldStack.empty())
2141 return std::get<0>(
m_xImpl->m_FieldStack.top()).second;
2151 return !
m_xImpl->m_FieldStack.empty();
2156 assert(!
m_xImpl->m_FieldStack.empty());
2157 if (!
m_xImpl->m_FieldStack.empty() && xFormField.is())
2159 FieldParamImporter(&std::get<1>(
m_xImpl->m_FieldStack.top()),
2160 xFormField->getParameters()).Import();
2161 std::get<2>(
m_xImpl->m_FieldStack.top()) = xFormField;
2167 const OUString& rFrmName,
2168 const OUString& rNextFrmName,
2169 const Reference < XPropertySet >& rFrmPropSet )
2171 if( rFrmName.isEmpty() )
2174 if( !rNextFrmName.isEmpty() )
2178 if (
m_xImpl->m_xTextFrames.is()
2179 &&
m_xImpl->m_xTextFrames->hasByName(sNextFrmName))
2181 rFrmPropSet->setPropertyValue(
"ChainNextName",
2186 if (!
m_xImpl->m_xPrevFrmNames)
2188 m_xImpl->m_xPrevFrmNames.emplace();
2189 m_xImpl->m_xNextFrmNames.emplace();
2191 m_xImpl->m_xPrevFrmNames->push_back(rFrmName);
2192 m_xImpl->m_xNextFrmNames->push_back(sNextFrmName);
2195 if (!
m_xImpl->m_xPrevFrmNames ||
m_xImpl->m_xPrevFrmNames->empty())
2198 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)
2200 if((*j) == rFrmName)
2204 rFrmPropSet->setPropertyValue(
"ChainPrevName",
Any(*
i));
2207 j =
m_xImpl->m_xNextFrmNames->erase(j);
2217 static constexpr OUStringLiteral s_TextFrame =
u"TextFrame";
2219 bool bIsInFrame =
false;
2226 if (xPropSet->getPropertySetInfo()->hasPropertyByName(s_TextFrame))
2228 uno::Reference<XTextFrame>
const xFrame(
2229 xPropSet->getPropertyValue(s_TextFrame), UNO_QUERY);
2251 sal_Int32 , sal_Int32 )
2253 Reference< XPropertySet> xPropSet;
2262 sal_Int32 , sal_Int32 )
2264 Reference< XPropertySet> xPropSet;
2273 sal_Int32 , sal_Int32 )
2275 Reference< XPropertySet> xPropSet;
2281 sal_Int32 , sal_Int32 )
2283 Reference< XPropertySet> xPropSet;
2290 sal_Int32 , sal_Int32 )
2292 Reference< XPropertySet> xPropSet;
2297 const Reference < XPropertySet> &,
2298 std::map < const OUString, OUString > &)
2306 const util::DateTime& ,
2313 Reference<XTextCursor> & ,
2317 Reference<XTextCursor> xRet;
2351 return m_xImpl->m_sOpenRedlineIdentifier;
2356 m_xImpl->m_sOpenRedlineIdentifier = rId;
2367 m_xImpl->m_sCellParaStyleDefault = rNewValue;
2372 return m_xImpl->m_sCellParaStyleDefault;
2377 if (!
m_xImpl->m_xCrossRefHeadingBookmarkMap)
2379 m_xImpl->m_xCrossRefHeadingBookmarkMap.emplace();
2381 m_xImpl->m_xCrossRefHeadingBookmarkMap->insert(std::make_pair(rFrom, rTo));
2389 if (!
m_xImpl->m_xCrossRefHeadingBookmarkMap)
2394 uno::Reference<text::XTextFieldsSupplier>
const xFieldsSupplier(
2395 m_xImpl->m_rSvXMLImport.GetModel(), uno::UNO_QUERY);
2396 if (!xFieldsSupplier.is())
2400 uno::Reference<container::XEnumerationAccess>
const xFieldsEA(
2401 xFieldsSupplier->getTextFields());
2402 uno::Reference<container::XEnumeration>
const xFields(
2403 xFieldsEA->createEnumeration());
2404 while (xFields->hasMoreElements())
2406 uno::Reference<lang::XServiceInfo>
const xFieldInfo(
2407 xFields->nextElement(), uno::UNO_QUERY);
2408 if (!xFieldInfo->supportsService(
"com.sun.star.text.textfield.GetReference"))
2412 uno::Reference<beans::XPropertySet>
const xField(
2413 xFieldInfo, uno::UNO_QUERY);
2414 sal_uInt16
nType(0);
2415 xField->getPropertyValue(
"ReferenceFieldSource") >>=
nType;
2416 if (text::ReferenceFieldSource::BOOKMARK !=
nType)
2421 xField->getPropertyValue(
"SourceName") >>=
name;
2422 auto const iter(
m_xImpl->m_xCrossRefHeadingBookmarkMap->find(
name));
2423 if (iter ==
m_xImpl->m_xCrossRefHeadingBookmarkMap->end())
2427 xField->setPropertyValue(
"SourceName",
uno::Any(iter->second));
2434 m_xImpl->m_sBookmarkCondition[bookmark] = condition;
2439 return m_xImpl->m_bBookmarkHidden[bookmark];
2444 return m_xImpl->m_sBookmarkCondition[bookmark];
XMLPropertyMapEntry const g_XMLPageMasterDrawingPageStyleMap[]
PropertiesInfo aProperties
void Increment(sal_Int32 nInc=1)
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 IsTextDocInOOoFileFormat() const
ProgressBarHelper * GetProgressBarHelper()
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
bool getBuildIds(sal_Int32 &rUPD, sal_Int32 &rBuild) const
returns the upd and build id (f.e.
sal_Unicode ConvStarBatsCharToStarSymbol(sal_Unicode c)
sal_Unicode ConvStarMathCharToStarSymbol(sal_Unicode c)
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 &)
XMLPropStyleContext * FindPageMaster(const OUString &rName) const
rtl::Reference< SvXMLImportPropertyMapper > const & GetParaImportPropertySetMapper() 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)
virtual ~XMLTextImportHelper() override
virtual void SetChangesProtectionKey(const css::uno::Sequence< sal_Int8 > &rProtectionKey)
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 getCurrentFieldType()
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 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)
::rtl::Reference< OContentHelper > xContent
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::tuple< field_name_type_t, field_params_t, uno::Reference< text::XFormField > > field_stack_item_t
::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
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)