20 #include <config_wasm_strip.h>
27 #include <com/sun/star/beans/XPropertySetInfo.hpp>
46 #include <com/sun/star/container/XNameContainer.hpp>
47 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
48 #include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
49 #include <com/sun/star/io/XOutputStream.hpp>
50 #include <com/sun/star/util/MeasureUnit.hpp>
51 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
52 #include <com/sun/star/frame/XModel.hpp>
53 #include <com/sun/star/document/XBinaryStreamResolver.hpp>
54 #include <com/sun/star/document/XStorageBasedDocument.hpp>
55 #include <com/sun/star/document/XGraphicStorageHandler.hpp>
56 #include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
57 #include <com/sun/star/xml/sax/XLocator.hpp>
58 #include <com/sun/star/xml/sax/FastParser.hpp>
59 #include <com/sun/star/xml/sax/SAXException.hpp>
60 #include <com/sun/star/packages/zip/ZipIOException.hpp>
61 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
74 #include <fasttokenhandler.hxx>
78 #include <com/sun/star/rdf/XMetadatable.hpp>
79 #include <com/sun/star/rdf/XRepositorySupplier.hpp>
82 using ::com::sun::star::beans::XPropertySetInfo;
99 class SvXMLImportEventListener :
public cppu::WeakImplHelper< css::lang::XEventListener >
105 explicit SvXMLImportEventListener(
SvXMLImport* pImport);
108 virtual void SAL_CALL disposing(
const lang::EventObject& rEventObject)
override;
113 SvXMLImportEventListener::SvXMLImportEventListener(
SvXMLImport* pTempImport)
114 : pImport(pTempImport)
119 void SAL_CALL SvXMLImportEventListener::disposing(
const lang::EventObject& )
123 pImport->DisposingModel();
132 getBuildIdsProperty(uno::Reference<beans::XPropertySet>
const& xImportInfo)
134 if (xImportInfo.is())
138 Reference< XPropertySetInfo >
const xSetInfo(
139 xImportInfo->getPropertySetInfo());
140 if (xSetInfo.is() && xSetInfo->hasPropertyByName(
"BuildId"))
143 xImportInfo->getPropertyValue(
"BuildId") >>= aBuildId;
147 catch (Exception
const&)
158 sal_uInt16 mnGeneratorVersion;
162 : mnGeneratorVersion(
SvXMLImport::ProductVersionUnknown )
164 OUString
const buildIds(
166 if (!buildIds.isEmpty())
168 sal_Int32
const ix = buildIds.indexOf(
';');
171 OUString
const loVersion(buildIds.copy(ix + 1));
172 if (!loVersion.isEmpty())
174 if (
'3' == loVersion[0])
178 else if (
'4' == loVersion[0])
180 if (loVersion.getLength() > 1
181 && (loVersion[1] ==
'0' || loVersion[1] ==
'1'))
185 else if (loVersion.getLength() > 1 &&
'2' == loVersion[1])
189 else if (loVersion.getLength() > 1 &&
'3' == loVersion[1])
193 else if (loVersion.getLength() > 1 &&
'4' == loVersion[1])
198 else if (
'5' == loVersion[0])
202 else if (
'6' == loVersion[0])
204 if (loVersion.getLength() > 1
205 && (loVersion[1] ==
'0' || loVersion[1] ==
'1'
206 || loVersion[1] ==
'2'))
215 else if (
'7' == loVersion[0])
221 SAL_INFO(
"xmloff.core",
"unknown LO version: " << loVersion);
227 sal_Int32 nUPD, nBuild;
231 if ( nUPD >= 640 && nUPD <= 645 )
235 else if ( nUPD == 680 )
239 else if ( nUPD == 300 && nBuild <= 9379 )
243 else if ( nUPD == 310 )
247 else if ( nUPD == 320 )
251 else if ( nUPD == 330 )
255 else if ( nUPD == 340 )
259 else if (nUPD == 400 || nUPD == 401)
263 else if (nUPD >= 410)
271 sal_uInt16 getGeneratorVersion()
const
273 return mnGeneratorVersion;
316 OUString
const & theImplementationName,
317 const css::uno::Sequence< OUString > & sSupportedServiceNames = {})
330 SAL_WARN_IF(!mxComponentContext.is(),
"xmloff.core",
"SvXMLImport: no ComponentContext");
331 if (!mxComponentContext.is())
throw uno::RuntimeException();
332 if (!maSupportedServiceNames.hasElements())
333 maSupportedServiceNames = {
"com.sun.star.document.ImportFilter",
"com.sun.star.xml.XMLImportFilter" };
343 return mpDocumentInfo->getGeneratorVersion();
350 const uno::Reference< xml::sax::XFastAttributeList >& )
353 SAL_WARN(
"xmloff.core",
"CreateFastContext should be overridden, for element " << nElement);
412 const css::uno::Reference< css::uno::XComponentContext >& xContext,
413 OUString
const & implementationName,
415 const css::uno::Sequence< OUString > & sSupportedServiceNames )
416 : mpImpl( new
SvXMLImport_Impl(xContext, implementationName, sSupportedServiceNames) ),
423 mnImportFlags( nImportFlags ),
425 mbIsFormsSupported( true ),
426 mbIsTableShapeSupported(
false ),
427 mbNotifyMacroEventRead(
false )
429 SAL_WARN_IF( !xContext.is(),
"xmloff.core",
"got no service manager" );
431 mxParser = xml::sax::FastParser::create( xContext );
452 pStylesContext->dispose();
467 const OUString& fontName,
const char* extra,
468 std::vector<unsigned char>
const & key,
bool eot)
478 return theSvXMLImportUnoTunnelId.
getSeq();
489 class setFastDocumentHandlerGuard
492 css::uno::Reference<css::xml::sax::XFastParser> mxParser;
494 setFastDocumentHandlerGuard(
const css::uno::Reference<css::xml::sax::XFastParser>& Parser,
495 const css::uno::Reference<css::xml::sax::XFastDocumentHandler>& Handler)
498 mxParser->setFastDocumentHandler(Handler);
501 ~setFastDocumentHandlerGuard()
503 mxParser->setFastDocumentHandler(
nullptr);
512 mxParser->parseStream(aInputSource);
522 mxParser->setTokenHandler( Handler );
527 mxParser->registerNamespace( NamespaceURL, NamespaceToken );
532 return mxParser->getNamespaceURL( rPrefix );
537 mxParser->setErrorHandler( Handler );
542 mxParser->setEntityResolver( Resolver );
547 mxParser->setLocale( rLocale );
552 mxParser->setNamespaceHandler( Handler );
557 mxParser->setCustomEntityNames( replacements );
562 SAL_INFO(
"xmloff.core",
"{ SvXMLImport::startDocument" );
566 Reference< lang::XMultiServiceFactory >
xFactory(
mxModel, UNO_QUERY );
576 xFactory->createInstance(
"com.sun.star.document.ImportGraphicStorageHandler"),
585 xFactory->createInstance(
"com.sun.star.document.ImportEmbeddedObjectResolver"),
590 catch( css::uno::Exception& )
597 SAL_INFO(
"xmloff.core",
"} SvXMLImport::endDocument" );
605 const uno::Reference<rdf::XRepositorySupplier> xRS(
mxModel,
609 mpImpl->mpRDFaHelper->InsertRDFa( xRS );
616 uno::Reference< beans::XPropertySetInfo > xPropertySetInfo =
mxImportInfo->getPropertySetInfo();
617 if (xPropertySetInfo.is())
624 if (xPropertySetInfo->hasPropertyByName(sProgressMax) &&
625 xPropertySetInfo->hasPropertyByName(sProgressCurrent))
632 if (xPropertySetInfo->hasPropertyByName(sRepeat))
637 if (
mxNumberStyles.is() && xPropertySetInfo->hasPropertyByName(sNumberStyles))
662 if(
mpImpl->mbOwnGraphicResolver )
668 if(
mpImpl->mbOwnEmbeddedResolver )
682 std::optional<SvXMLNamespaceMap> & rpNamespaceMap,
684 const uno::Reference< xml::sax::XAttributeList >& xAttrList)
686 std::optional<SvXMLNamespaceMap> pRewindMap;
687 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
688 for( sal_Int16
i=0;
i < nAttrCount;
i++ )
690 const OUString& rAttrName = xAttrList->getNameByIndex(
i );
691 if (pImport && rAttrName ==
"office:version" && !pImport->
mpImpl->mxODFVersion)
693 pImport->
mpImpl->mxODFVersion = xAttrList->getValueByIndex(
i );
696 if (pImport->
mpImpl->mStreamName ==
"content.xml"
699 throw xml::sax::SAXException(
"Inconsistent ODF versions in content.xml and manifest.xml!",
700 uno::Reference< uno::XInterface >(),
702 packages::zip::ZipIOException(
"Inconsistent ODF versions in content.xml and manifest.xml!" ) ) );
705 else if( ( rAttrName.getLength() >= 5 ) &&
706 ( rAttrName.startsWith(
GetXMLToken(XML_XMLNS) ) ) &&
707 ( rAttrName.getLength() == 5 ||
':' == rAttrName[5] ) )
711 pRewindMap = std::move(rpNamespaceMap);
712 rpNamespaceMap.emplace(*pRewindMap);
714 const OUString& rAttrValue = xAttrList->getValueByIndex(
i );
716 OUString aPrefix( ( rAttrName.getLength() == 5 )
718 : rAttrName.copy( 6 ) );
720 sal_uInt16 nKey = rpNamespaceMap->AddIfKnown( aPrefix, rAttrValue );
725 OUString aTestName( rAttrValue );
727 nKey = rpNamespaceMap->AddIfKnown( aPrefix, aTestName );
731 rpNamespaceMap->Add( aPrefix, rAttrValue );
756 const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
759 if ( Attribs.is() && !
mpImpl->mxODFVersion)
764 if( aIter != rAttribList.
end() )
766 mpImpl->mxODFVersion = aIter.toString();
771 throw xml::sax::SAXException(
"Inconsistent ODF versions in content.xml and manifest.xml!",
772 uno::Reference< uno::XInterface >(),
774 packages::zip::ZipIOException(
"Inconsistent ODF versions in content.xml and manifest.xml!" ) ) );
789 SAL_INFO(
"xmloff.core",
"calling createFastChildContext on " <<
typeid(*pHandler.get()).
name());
790 auto tmp = pHandler->createFastChildContext( Element, Attribs );
792 assert((tmp && xContext) || (!tmp && !xContext));
798 if (bRootContext && !xContext)
802 { aName },
"Root element " + aName +
" unknown", Reference<xml::sax::XLocator>() );
809 xContext->PutRewindMap(std::move(pRewindMap));
812 xContext->startFastElement( Element, Attribs );
819 const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
821 SAL_INFO(
"xmloff.core",
"startUnknownElement " << rNamespace <<
" " << rName);
827 SAL_INFO(
"xmloff.core",
"calling createUnknownChildContext on " <<
typeid(*pHandler.get()).
name());
828 auto tmp = pHandler->createUnknownChildContext( rNamespace, rName, Attribs );
830 assert((tmp && xContext) || (!tmp && !xContext));
835 SAL_WARN_IF(!xContext.is(),
"xmloff.core",
"No context for unknown-element " << rNamespace <<
" " << rName);
836 if (bRootContext && !xContext)
839 { rName },
"Root element " + rName +
" unknown", Reference<xml::sax::XLocator>() );
851 xContext->startUnknownElement( rNamespace, rName, Attribs );
860 SAL_WARN(
"xmloff.core",
"SvXMLImport::endFastElement: no context left");
866 std::optional<SvXMLNamespaceMap> pRewindMap = xContext->TakeRewindMap();
868 xContext->endFastElement( Element );
876 SAL_INFO(
"xmloff.core",
"endUnknownElement " << rPrefix <<
" " << rLocalName);
879 SAL_WARN(
"xmloff.core",
"SvXMLImport::endUnknownElement: no context left");
885 xContext->endUnknownElement( rPrefix, rLocalName );
888 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
890 const uno::Reference< xml::sax::XFastAttributeList > &)
895 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
897 const uno::Reference< xml::sax::XFastAttributeList > &)
911 mxModel.set( xDoc, UNO_QUERY );
913 throw lang::IllegalArgumentException();
917 uno::Reference<document::XStorageBasedDocument>
const xSBDoc(
mxModel, uno::UNO_QUERY);
918 uno::Reference<embed::XStorage>
const xStor(xSBDoc.is() ? xSBDoc->getDocumentStorage()
927 catch (uno::Exception
const&)
954 for(
const auto& rAny : aArguments )
956 Reference<XInterface> xValue;
959 uno::Reference<task::XStatusIndicator> xTmpStatusIndicator(
961 if( xTmpStatusIndicator.is() )
964 uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler(xValue, UNO_QUERY);
965 if (xGraphicStorageHandler.is())
968 uno::Reference<document::XEmbeddedObjectResolver> xTmpObjectResolver(
970 if( xTmpObjectResolver.is() )
973 uno::Reference<beans::XPropertySet> xTmpPropSet( xValue, UNO_QUERY );
974 if( xTmpPropSet.is() )
977 uno::Reference< beans::XPropertySetInfo > xPropertySetInfo =
mxImportInfo->getPropertySetInfo();
978 if (xPropertySetInfo.is())
981 if (xPropertySetInfo->hasPropertyByName(sPropName))
987 sPropName =
"PrivateData";
988 if (xPropertySetInfo->hasPropertyByName(sPropName))
990 Reference < XInterface > xIfc;
994 StyleMap *pSMap = comphelper::getFromUnoTunnel<StyleMap>( xIfc );
1001 sPropName =
"BaseURI";
1002 if (xPropertySetInfo->hasPropertyByName(sPropName))
1006 mpImpl->aBaseURL.SetURL( sBaseURI );
1007 mpImpl->aDocBase.SetURL( sBaseURI );
1010 sPropName =
"StreamRelPath";
1011 if( xPropertySetInfo->hasPropertyByName(sPropName) )
1017 sPropName =
"StreamName";
1018 if( xPropertySetInfo->hasPropertyByName(sPropName) )
1023 if( !sBaseURI.isEmpty() && !sName.isEmpty() )
1025 if( !sRelPath.isEmpty() )
1026 mpImpl->aBaseURL.insertName( sRelPath );
1027 mpImpl->aBaseURL.insertName( sName );
1029 mpImpl->mStreamName = sName;
1031 sPropName =
"ShapePositionInHoriL2R";
1032 if( xPropertySetInfo->hasPropertyByName(sPropName) )
1035 aAny >>=
mpImpl->mbShapePositionInHoriL2R;
1037 sPropName =
"TextDocInOOoFileFormat";
1038 if( xPropertySetInfo->hasPropertyByName(sPropName) )
1041 aAny >>=
mpImpl->mbTextDocInOOoFileFormat;
1044 sPropName =
"SourceStorage";
1045 if( xPropertySetInfo->hasPropertyByName(sPropName) )
1051 uno::Reference<lang::XInitialization>
const xInit(mxParser, uno::UNO_QUERY_THROW);
1052 xInit->initialize( {
Any(OUString(
"IgnoreMissingNSDecl")) });
1058 return mpImpl->implementationName;
1068 return mpImpl->maSupportedServiceNames;
1088 #if !ENABLE_WASM_STRIP_CHART
1097 return new ::xmloff::OFormLayerXMLImport(*
this);
1110 Reference< lang::XMultiServiceFactory > xServiceFact(
mxModel, UNO_QUERY);
1111 if( xServiceFact.is() )
1116 "com.sun.star.drawing.GradientTable" ), UNO_QUERY);
1118 catch( lang::ServiceNotRegisteredException& )
1133 Reference< lang::XMultiServiceFactory > xServiceFact(
mxModel, UNO_QUERY);
1134 if( xServiceFact.is() )
1139 "com.sun.star.drawing.HatchTable" ), UNO_QUERY);
1141 catch( lang::ServiceNotRegisteredException& )
1156 Reference< lang::XMultiServiceFactory > xServiceFact(
mxModel, UNO_QUERY);
1157 if( xServiceFact.is() )
1162 "com.sun.star.drawing.BitmapTable" ), UNO_QUERY);
1164 catch( lang::ServiceNotRegisteredException& )
1179 Reference< lang::XMultiServiceFactory > xServiceFact(
mxModel, UNO_QUERY);
1180 if( xServiceFact.is() )
1185 "com.sun.star.drawing.TransparencyGradientTable" ), UNO_QUERY);
1187 catch( lang::ServiceNotRegisteredException& )
1202 Reference< lang::XMultiServiceFactory > xServiceFact(
mxModel, UNO_QUERY);
1203 if( xServiceFact.is() )
1207 mxMarkerHelper.set( xServiceFact->createInstance(
"com.sun.star.drawing.MarkerTable" ), UNO_QUERY);
1209 catch( lang::ServiceNotRegisteredException& )
1222 Reference< lang::XMultiServiceFactory > xServiceFact(
mxModel, UNO_QUERY);
1223 if( xServiceFact.is() )
1227 mxDashHelper.set( xServiceFact->createInstance(
"com.sun.star.drawing.DashTable" ), UNO_QUERY);
1229 catch( lang::ServiceNotRegisteredException& )
1248 sal_Int32 nLen = rURL.getLength();
1249 if( nLen > 0 &&
'/' == rURL[0] )
1252 else if( nLen > 1 &&
'.' == rURL[0] )
1254 if(
'.' == rURL[1] )
1258 else if(
'/' == rURL[1] )
1265 while( nPos < nLen )
1267 switch( rURL[nPos] )
1287 uno::Reference<graphic::XGraphic> xGraphic;
1299 Graphic aGraphic(aExternalLink);
1309 uno::Reference<graphic::XGraphic> xGraphic;
1321 Reference< XOutputStream > xOStm;
1324 if( xStmResolver.is() )
1325 xOStm = xStmResolver->createOutputStream();
1331 const OUString& rURL,
1332 std::u16string_view rClassId )
1340 OUString sURL( rURL );
1341 if( !rClassId.empty() )
1343 sURL += OUString::Concat(
"!") + rClassId;
1356 return mpImpl->mxSourceStorage;
1359 Reference < XOutputStream >
1362 Reference < XOutputStream > xOLEStream;
1369 Any aAny = xNA->getByName(
"Obj12345678" );
1370 aAny >>= xOLEStream;
1390 const OUString& rName,
1391 const OUString& rDisplayName )
1398 OUString sPrivateData(
"PrivateData" );
1401 if( xPropertySetInfo.is() &&
1402 xPropertySetInfo->hasPropertyByName(sPrivateData) )
1404 Reference < XInterface > xIfc(
1405 static_cast< XUnoTunnel *>(
mpStyleMap.get() ) );
1411 StyleMap::key_type aKey( nFamily, rName );
1412 StyleMap::value_type aValue( aKey, rDisplayName );
1413 ::std::pair<StyleMap::iterator,bool> aRes(
mpStyleMap->insert( aValue ) );
1416 "duplicate style name of family " << static_cast<int>(nFamily) <<
": \"" << rName <<
"\"");
1421 const OUString& rName )
const
1423 OUString
sName( rName );
1426 StyleMap::key_type aKey( nFamily, rName );
1427 StyleMap::const_iterator aIter =
mpStyleMap->find( aKey );
1429 sName = (*aIter).second;
1454 uno::Reference< beans::XPropertySetInfo > xPropertySetInfo =
mxImportInfo->getPropertySetInfo();
1455 if (xPropertySetInfo.is())
1461 if (xPropertySetInfo->hasPropertyByName(sProgressMax) &&
1462 xPropertySetInfo->hasPropertyByName(sProgressCurrent) &&
1463 xPropertySetInfo->hasPropertyByName(sProgressRange))
1466 sal_Int32 nProgressMax(0);
1467 sal_Int32 nProgressCurrent(0);
1468 sal_Int32 nProgressRange(0);
1470 if (aAny >>= nProgressRange)
1473 if (aAny >>= nProgressMax)
1475 aAny =
mxImportInfo->getPropertyValue(sProgressCurrent);
1476 if (aAny >>= nProgressCurrent)
1479 if (xPropertySetInfo->hasPropertyByName(sRepeat))
1485 SAL_WARN(
"xmloff.core",
"why is it no boolean?" );
1504 catch ( uno::Exception& )
1510 SAL_WARN(
"xmloff.core",
"not possible to create NameContainer");
1523 std::make_unique<XMLStarBasicContextFactory>());
1526 std::make_unique<XMLScriptContextFactory>());
1531 std::make_unique<XMLStarBasicContextFactory>());
1556 const uno::Sequence<OUString> aStyleNames =
mxNumberStyles->getElementNames();
1557 for (
const auto&
name : aStyleNames)
1564 *
this,
name, xAttrList, nKey,
1575 #if !ENABLE_WASM_STRIP_CHART
1620 if( rValue.isEmpty() || rValue[0] ==
'#' )
1624 if(
mpImpl->aBaseURL.GetNewAbsURL( rValue, &aAbsURL ) )
1633 bool bResult =
true;
1635 if ( !aODFVersion.isEmpty() && aODFVersion.compareTo(
ODFVER_012_TEXT ) >= 0 )
1644 uno::Reference< beans::XPropertySet > xStorProps( xStor, uno::UNO_QUERY_THROW );
1649 bool bRepairPackage =
false;
1652 xStorProps->getPropertyValue(
"RepairPackage" )
1654 }
catch ( uno::Exception& )
1658 if ( !bRepairPackage )
1660 OUString aStorVersion;
1661 xStorProps->getPropertyValue(
"Version" )
1668 if ( !aStorVersion.isEmpty() )
1669 bResult = aODFVersion == aStorVersion;
1671 xStorProps->setPropertyValue(
"Version",
1676 bool bInconsistent =
false;
1677 xStorProps->getPropertyValue(
"IsInconsistent" )
1679 bResult = !bInconsistent;
1684 catch( uno::Exception& )
1696 uno::Reference< util::XNumberFormatsSupplier> (
mxModel, uno::UNO_QUERY);
1702 uno::Reference<util::XNumberFormatsSupplier> xNum =
1711 if( !
mpImpl->hBatsFontConv )
1714 FontToSubsFontFlags::IMPORT );
1715 SAL_WARN_IF( !
mpImpl->hBatsFontConv,
"xmloff.core",
"Got no symbol font converter" );
1717 if(
mpImpl->hBatsFontConv )
1728 if( !
mpImpl->hMathFontConv )
1731 FontToSubsFontFlags::IMPORT );
1732 SAL_WARN_IF( !
mpImpl->hMathFontConv,
"xmloff.core",
"Got no symbol font converter" );
1734 if(
mpImpl->hMathFontConv )
1745 const OUString& rExceptionMessage,
1746 const Reference<xml::sax::XLocator>& rLocator )
1754 mpXMLErrors->AddRecord( nId, rMsgParams, rExceptionMessage,
1762 SetError( nId, rMsgParams,
"",
nullptr );
1767 const OUString& rMsg1)
1790 return mpImpl->maInterfaceToIdentifierMapper;
1793 uno::Reference< uno::XComponentContext >
const &
1796 return mpImpl->mxComponentContext;
1812 return mpImpl->mbShapePositionInHoriL2R;
1817 return mpImpl->mbTextDocInOOoFileFormat;
1828 OUString
const aBuildId(getBuildIdsProperty(
mxImportInfo));
1829 if (!aBuildId.isEmpty())
1831 sal_Int32
nIndex = aBuildId.indexOf(
'$');
1835 sal_Int32 nIndexEnd = aBuildId.indexOf(
';', nIndex);
1836 rBuild = (nIndexEnd == -1)
1838 :
o3tl::toInt32(aBuildId.subView(nIndex + 1, nIndexEnd - nIndex - 1));
1848 return mpImpl->getGeneratorVersion( *
this );
1853 sal_uInt16
const nOOoVersion, sal_uInt16
const nLOVersion)
1855 assert( (nLOVersion &
LO_flag));
1856 assert(!(nOOoVersion & LO_flag));
1858 return (nGeneratorVersion & LO_flag)
1859 ? nGeneratorVersion < nLOVersion
1860 : nGeneratorVersion < nOOoVersion;
1866 return mpImpl->mxODFVersion ? *
mpImpl->mxODFVersion : OUString();
1871 return mpImpl->mbIsOOoXML;
1876 if (!
mpImpl->mbIsMSO.has_value())
1878 uno::Reference<document::XDocumentPropertiesSupplier> xSupplier(
GetModel(), uno::UNO_QUERY);
1881 uno::Reference<document::XDocumentProperties> xProps
1882 = xSupplier->getDocumentProperties();
1885 mpImpl->mbIsMSO = xProps->getGenerator().startsWith(
"MicrosoftOffice");
1890 return mpImpl->mbIsMSO.has_value() ? *
mpImpl->mbIsMSO :
false;
1895 OUString
const & i_rXmlId)
1897 if (i_rXmlId.isEmpty())
1901 const uno::Reference<rdf::XMetadatable> xMeta(i_xIfc,
1905 const beans::StringPair mdref(
mpImpl->mStreamName, i_rXmlId );
1907 xMeta->setMetadataReference(mdref);
1908 }
catch (lang::IllegalArgumentException &) {
1910 SAL_INFO(
"xmloff.core",
"SvXMLImport::SetXmlId: cannot set xml:id");
1913 }
catch (uno::Exception &) {
1921 if (!
mpImpl->mpRDFaHelper)
1923 mpImpl->mpRDFaHelper.reset( new ::xmloff::RDFaImportHelper(*
this) );
1925 return *
mpImpl->mpRDFaHelper;
1930 OUString
const & i_rAbout,
1931 OUString
const & i_rProperty,
1932 OUString
const & i_rContent,
1933 OUString
const & i_rDatatype)
1939 i_rAbout, i_rProperty, i_rContent, i_rDatatype);
1961 rv = (*aIter).second.second +
" " + aIter->second.first +
":";
1974 if (!sRet.isEmpty())
1977 return (*aIter).second.first;
1988 return (*aIter).second.second;
1997 return (*aIter).second;
2005 OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr()), rName.getLength() );
2011 auto mapTokenToNamespace = []( sal_Int32
nToken, sal_Int32 nPrefix, sal_Int32
nNamespace )
2018 aNamespaceMap[ nToken + 1 ] = std::make_pair( sPrefix, sNamespace );
2129 const OUString& rPrefix = aNamespaceDefine.m_aPrefix;
2130 const OUString& rNamespaceURI = aNamespaceDefine.m_aNamespaceURI;
2132 if ( rPrefix.isEmpty() )
2135 sDecl =
"xmlns:" + rPrefix;
2136 rAttrList->AddAttribute( sDecl,
"CDATA", rNamespaceURI );
2138 m_aNamespaceDefines.clear();
2145 if ( rNamespacePrefix.isEmpty() )
2150 rNamespacePrefix, rNamespaceURI) );
2159 : mrImport( rImport ),
2166 mrImport->setTargetDocument( xDoc );
2180 const uno::Reference< xml::sax::XAttributeList >& xAttrList )
2186 OUString aLocalName;
2187 sal_uInt16 nPrefix =
mrImport->mxNamespaceMap->GetKeyByAttrName( rName, &aLocalName );
2191 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
2192 for( sal_Int16
i=0;
i < nAttrCount;
i++ )
2194 const OUString& rAttrName = xAttrList->getNameByIndex(
i );
2195 const OUString& rAttrValue = xAttrList->getValueByIndex(
i );
2196 if (rAttrName ==
"xmlns")
2198 sal_uInt16 nNamespaceKey =
mrImport->mxNamespaceMap->GetKeyByName(rAttrValue);
2201 nDefaultNamespace = nNamespaceKey;
2204 assert(
false &&
"unknown namespace");
2223 OUString aLocalAttrName;
2224 OUString aNamespace;
2226 sal_uInt16
const nAttrPrefix =
mrImport->mxNamespaceMap->GetKeyByQName(
2249 OUString aLocalName;
2250 sal_uInt16 nPrefix =
mrImport->mxNamespaceMap->GetKeyByAttrName( rName, &aLocalName );
2252 mrImport->endFastElement( mnElement );
2266 const OUString& aData)
2268 mrImport->processingInstruction( aTarget, aData );
2273 mrImport->setDocumentLocator( rLocator );
exports com.sun.star.lib. util
const css::uno::Reference< css::container::XNameContainer > & GetBitmapHelper()
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
FontToSubsFontConverter hMathFontConv
FastAttributeIter find(sal_Int32 nToken) const
constexpr OUStringLiteral XML_PROGRESSRANGE
constexpr sal_uInt16 XML_NAMESPACE_MATH
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION_SO52
OUString GetBaseURL() const
constexpr sal_uInt16 XML_NAMESPACE_CHART_OOO
static rtl::Reference< xmloff::token::FastTokenHandler > xTokenHandler
rtl::Reference< SvXMLImport > mrImport
rtl::Reference< SvXMLStylesContext > mxMasterStyles
SAL_DLLPRIVATE::xmloff::RDFaImportHelper & GetRDFaImportHelper()
do not dllexport this; only for advanced cases (bookmark-start)
virtual void SAL_CALL setErrorHandler(const css::uno::Reference< css::xml::sax::XErrorHandler > &Handler) override
constexpr sal_uInt16 XML_NAMESPACE_ANIMATION
css::uno::Reference< css::graphic::XGraphic > loadGraphicFromBase64(css::uno::Reference< css::io::XOutputStream > const &rxOutputStream)
constexpr sal_uInt16 XML_NAMESPACE_DB_OASIS
OUString implementationName
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
COMPHELPER_DLLPUBLIC css::uno::Reference< css::container::XNameContainer > NameContainer_createInstance(const css::uno::Type &aType)
virtual void SAL_CALL setFastDocumentHandler(const css::uno::Reference< css::xml::sax::XFastDocumentHandler > &Handler) override
constexpr sal_uInt16 XML_NAMESPACE_VERSIONS_LIST
void SetStyles(SvXMLStylesContext *pStyles)
rtl::Reference< ::xmloff::OFormLayerXMLImport > const & GetFormImport()
static std::unordered_map< sal_Int32, std::pair< OUString, OUString > > aNamespaceMap
virtual void SAL_CALL parseStream(const css::xml::sax::InputSource &aInputSource) override
constexpr sal_uInt16 XML_NAMESPACE_OFFICE_OOO
constexpr sal_uInt16 XML_NAMESPACE_SCRIPT_OOO
constexpr sal_uInt16 XML_NAMESPACE_XFORMS
css::uno::Reference< css::container::XNameContainer > mxTransGradientHelper
constexpr sal_uInt16 XML_NAMESPACE_CHART
constexpr sal_uInt16 XML_NAMESPACE_DR3D
virtual void SAL_CALL endFastElement(sal_Int32 Element) override
std::unique_ptr< SvXMLNumFmtHelper > mpNumImport
rtl::Reference< XMLTextImportHelper > mxTextImport
void SetRepeat(bool bValue)
constexpr sal_uInt16 XML_NAMESPACE_DRAW_EXT
const css::uno::Reference< css::container::XNameContainer > & GetHatchHelper()
SAL_DLLPRIVATE void InitCtor_()
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
constexpr sal_uInt16 XML_NAMESPACE_SCRIPT
constexpr OUStringLiteral XML_PROGRESSCURRENT
constexpr sal_uInt16 XML_NAMESPACE_OOOC
virtual XMLShapeImportHelper * CreateShapeImport()
rtl::Reference< XMLFontStylesContext > mxFontDecls
virtual OUString SAL_CALL getImplementationName() final override
virtual void SAL_CALL registerNamespace(const OUString &NamespaceURL, sal_Int32 NamespaceToken) override
bool mbShapePositionInHoriL2R
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
static const sal_uInt16 OOo_30x
#define SAL_INFO_IF(condition, area, stream)
constexpr sal_uInt16 XML_NAMESPACE_FORMX
css::uno::Reference< css::container::XNameContainer > mxNumberStyles
const css::uno::Reference< css::container::XNameContainer > & GetTransGradientHelper()
sal_Unicode ConvStarMathCharToStarSymbol(sal_Unicode c)
SvXMLImportFastNamespaceHandler()
uno::Reference< embed::XStorage > mxSourceStorage
constexpr sal_uInt16 XML_NAMESPACE_FO_COMPAT
constexpr sal_uInt16 XML_NAMESPACE_SMIL_SO52
::xmloff::OFormLayerXMLImport * CreateFormImport()
constexpr sal_uInt16 XML_NAMESPACE_XLINK
std::unique_ptr< XMLEventImportHelper > mpEventImportHelper
constexpr sal_uInt16 XML_NAMESPACE_OOO
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) final override
std::unique_ptr< ProgressBarHelper > mpProgressBarHelper
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
css::uno::Reference< css::io::XOutputStream > GetStreamForEmbeddedObjectURLFromBase64() const
SvXMLNumFmtHelper * GetDataStylesImport()
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
virtual XMLTextImportHelper * CreateTextImport()
constexpr sal_Int32 NMSP_MASK
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() final override
constexpr sal_uInt16 XML_NAMESPACE_DLG
constexpr OUStringLiteral ODFVER_012_TEXT
constexpr sal_uInt16 XML_NAMESPACE_CSS3TEXT
css::uno::Reference< css::graphic::XGraphic > loadGraphicByURL(OUString const &rURL)
constexpr sal_uInt16 XML_NAMESPACE_FO_SO52
bool IsShapePositionInHoriL2R() const
constexpr sal_uInt16 XML_NAMESPACE_XLINK_SO52
static const sal_uInt16 AOO_40x
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
constexpr sal_uInt16 XML_NAMESPACE_STYLE_OOO
static const sal_uInt16 LO_41x
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
constexpr sal_uInt16 XML_NAMESPACE_ANIMATION_OOO
rtl::Reference< SchXMLImportHelper > const & GetChartImport()
std::optional< bool > mbIsMSO
SvXMLImport(const css::uno::Reference< css::uno::XComponentContext > &xContext, OUString const &implementationName, SvXMLImportFlags nImportFlags=SvXMLImportFlags::ALL, const css::uno::Sequence< OUString > &sSupportedServiceNames={})
constexpr sal_uInt16 XML_NAMESPACE_SMIL_COMPAT
constexpr sal_uInt16 XML_NAMESPACE_DB
constexpr sal_uInt16 XML_NAMESPACE_NUMBER
css::uno::Reference< css::embed::XStorage > const & GetSourceStorage() const
constexpr sal_uInt16 XML_NAMESPACE_DOM
OUString GetDocumentBase() const
::comphelper::UnoInterfaceToUniqueIdentifierMapper maInterfaceToIdentifierMapper
void * FontToSubsFontConverter
static const sal_uInt16 LO_43x
std::set< OUString > embeddedFontUrlsKnown
static const sal_uInt16 OOo_32x
constexpr OUStringLiteral XML_PROGRESSMAX
constexpr sal_uInt16 XML_NAMESPACE_NUMBER_OOO
css::uno::Reference< css::container::XNameContainer > mxMarkerHelper
css::uno::Reference< css::container::XNameContainer > mxHatchHelper
const uno::Reference< uno::XComponentContext > mxComponentContext
constexpr sal_uInt16 XML_NAMESPACE_CALC_EXT
void SetFontDecls(XMLFontStylesContext *pFontDecls)
const sal_uInt16 XML_NAMESPACE_UNKNOWN
constexpr sal_uInt16 XML_NAMESPACE_XSI
const sal_uInt16 XML_NAMESPACE_XMLNS
bool mbNotifyMacroEventRead
static const sal_uInt16 LO_7x
static OUString getNamespaceURIFromToken(sal_Int32 nToken)
virtual void SAL_CALL setLocale(const css::lang::Locale &rLocale) override
std::unique_ptr< XMLErrors > mpXMLErrors
sal_uInt16 getGeneratorVersion() const
this checks the build ID and returns
SvXMLLegacyToFastDocHandler(const rtl::Reference< SvXMLImport > &rImport)
constexpr sal_uInt16 XML_NAMESPACE_CHART_SO52
constexpr sal_uInt16 XML_NAMESPACE_OFFICE_SO52
static const sal_uInt16 OOo_2x
virtual void SetConfigurationSettings(const css::uno::Sequence< css::beans::PropertyValue > &aConfigProps)
css::uno::Reference< css::frame::XModel > mxModel
virtual void SAL_CALL endElement(const OUString &aName) override
static const sal_uInt16 LO_flag
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
std::unique_ptr< xmloff::RDFaImportHelper > mpRDFaHelper
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept
static const sal_uInt16 OOo_34x
virtual OUString SAL_CALL getNamespaceURI(const OUString &rNamespacePrefix) override
OUString ResolveEmbeddedObjectURL(const OUString &rURL, std::u16string_view rClassId)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr sal_uInt16 XML_NAMESPACE_FORM
::comphelper::UnoInterfaceToUniqueIdentifierMapper & getInterfaceToIdentifierMapper()
constexpr OUStringLiteral sStarBasic
SvXMLImport_Impl(const uno::Reference< uno::XComponentContext > &rxContext, OUString const &theImplementationName, const css::uno::Sequence< OUString > &sSupportedServiceNames={})
XMLEventImportHelper & GetEventImport()
static OUString getPrefixAndNameFromToken(sal_Int32 nToken)
static const sal_uInt16 OOo_33x
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
virtual void SAL_CALL setCustomEntityNames(const ::css::uno::Sequence< ::css::beans::Pair<::rtl::OUString,::rtl::OUString > > &replacements) override
static const sal_uInt16 AOO_4x
css::uno::Reference< css::xml::sax::XFastDocumentHandler > mxFastDocumentHandler
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
constexpr OUStringLiteral XML_NUMBERSTYLES
css::uno::Reference< css::lang::XEventListener > mxEventListener
FontToSubsFontConverter hBatsFontConv
constexpr sal_uInt16 XML_NAMESPACE_DRAW
css::uno::Reference< css::io::XOutputStream > GetStreamForGraphicObjectURLFromBase64() const
static std::unordered_map< OUString, OUString > aNamespaceURIPrefixMap
constexpr sal_uInt16 XML_NAMESPACE_TABLE_SO52
virtual void SetViewSettings(const css::uno::Sequence< css::beans::PropertyValue > &aViewProps)
SvXMLStylesContext * GetStyles()
sal_Unicode ConvertFontToSubsFontChar(FontToSubsFontConverter hConverter, sal_Unicode cChar)
virtual void SAL_CALL endUnknownElement(const OUString &Namespace, const OUString &Name) override
constexpr sal_uInt16 XML_NAMESPACE_BLOCKLIST
const css::uno::Sequence< sal_Int8 > & getSeq() const
static const sal_uInt16 LO_63x
void AddRDFa(const css::uno::Reference< css::rdf::XMetadatable > &i_xObject, OUString const &i_rAbout, OUString const &i_rProperty, OUString const &i_rContent, OUString const &i_rDatatype)
Add a RDFa statement; parameters are XML attribute values.
SvXMLImportFlags mnImportFlags
constexpr sal_uInt16 XML_NAMESPACE_CONFIG
static void initializeNamespaceMaps()
constexpr sal_uInt16 XML_NAMESPACE_META_SO52
constexpr sal_uInt16 XML_NAMESPACE_XML
virtual void SAL_CALL characters(const OUString &aChars) override
virtual void SAL_CALL startFastElement(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override
std::vector< NamespaceDefine > m_aNamespaceDefines
#define DBG_UNHANDLED_EXCEPTION(...)
constexpr sal_uInt16 XML_NAMESPACE_SVG
#define TOOLS_WARN_EXCEPTION(area, stream)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
constexpr sal_uInt16 XML_NAMESPACE_TABLE_EXT
constexpr sal_uInt16 XML_NAMESPACE_FO
static const sal_uInt16 LO_44x
bool getBuildIds(sal_Int32 &rUPD, sal_Int32 &rBuild) const
returns the upd and build id (f.e.
sal_Unicode ConvStarBatsCharToStarSymbol(sal_Unicode c)
static bool NormalizeURI(OUString &rName)
virtual OUString SAL_CALL getNamespaceURL(const OUString &rPrefix) override
constexpr sal_uInt16 XML_NAMESPACE_TEXT
bool IsPackageURL(const OUString &rURL) const
rtl::Reference< SvXMLImportFastNamespaceHandler > maNamespaceHandler
constexpr OUStringLiteral XML_PROGRESSREPEAT
virtual void SAL_CALL startDocument() override
constexpr sal_uInt16 XML_NAMESPACE_CHART_EXT
static sal_Int32 GetXStorageFormat(const css::uno::Reference< css::embed::XStorage > &xStorage)
rtl::Reference< StyleMap > mpStyleMap
void SetMasterStyles(SvXMLStylesContext *pMasterStyles)
rtl::Reference< SvXMLStylesContext > mxAutoStyles
css::uno::Reference< css::container::XNameContainer > mxGradientHelper
rtl::Reference< XMLShapeImportHelper > mxShapeImport
bool IsTextDocInOOoFileFormat() const
std::stack< SvXMLImportContextRef, std::vector< SvXMLImportContextRef > > maContexts
constexpr size_t NMSP_SHIFT
static const sal_uInt16 OOo_31x
constexpr sal_uInt16 XML_NAMESPACE_META_OOO
constexpr sal_uInt16 XML_NAMESPACE_TABLE_OOO
friend class SvXMLImportContext
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext(const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
static OUString getNamespacePrefixFromToken(sal_Int32 nToken, const SvXMLNamespaceMap *pMap)
constexpr sal_uInt16 XML_NAMESPACE_GRDDL
ProgressBarHelper * GetProgressBarHelper()
constexpr sal_uInt16 XML_NAMESPACE_XHTML
constexpr sal_uInt16 XML_NAMESPACE_XSD
bool mbTextDocInOOoFileFormat
void CreateDataStylesImport_()
virtual void SAL_CALL setTargetDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
css::uno::Type const & get()
sal_uInt16 getGeneratorVersion(const SvXMLImport &rImport)
bool IsMSO() const
Determines if the document was generated by Microsoft Office.
static const sal_uInt16 LO_42x
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override
constexpr sal_uInt16 XML_NAMESPACE_DC
virtual void SAL_CALL setNamespaceHandler(const css::uno::Reference< css::xml::sax::XFastNamespaceHandler > &Handler) override
css::uno::Sequence< OUString > maSupportedServiceNames
FontToSubsFontConverter CreateFontToSubsFontConverter(std::u16string_view rOrgName, FontToSubsFontFlags nFlags)
bool mbOwnGraphicResolver
std::stack< sal_uInt16 > maDefaultNamespaces
constexpr sal_uInt16 XML_NAMESPACE_DR3D_OOO
With this class you can import a
element containing its data as element o...
css::uno::Reference< css::beans::XPropertySet > mxImportInfo
css::uno::Reference< css::container::XNameContainer > mxDashHelper
constexpr sal_uInt16 XML_NAMESPACE_STYLE_SO52
rtl::Reference< comphelper::AttributeList > maNamespaceAttrList
Helps the XMLEventsImportContext.
void SetXmlId(css::uno::Reference< css::uno::XInterface > const &i_xIfc, OUString const &i_rXmlId)
set the XmlId attribute of given UNO object (for RDF metadata)
static const OUString & getNameFromToken(sal_Int32 nToken)
virtual void SAL_CALL startElement(const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
static const sal_uInt16 LO_3x
constexpr sal_uInt16 XML_NAMESPACE_SVG_COMPAT
static OUString getNamespacePrefixFromURI(const OUString &rURI)
This class deliberately does not support XWeak, to improve performance when loading large documents...
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
virtual void SAL_CALL startDocument() override
static const sal_uInt16 LO_6x
: when adding a new value more specific than "6x", grep for all current uses and adapt them!!! ...
virtual void SAL_CALL cancel() override
void ParseAndAddRDFa(css::uno::Reference< css::rdf::XMetadatable > const &i_xObject, OUString const &i_rAbout, OUString const &i_rProperty, OUString const &i_rContent, OUString const &i_rDatatype)
Parse and add a RDFa statement; parameters are XML attribute values.
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
static bool bIsNSMapsInitialized
#define XMLERROR_FLAG_SEVERE
OUString mStreamName
name of stream in package, e.g., "content.xml"
virtual void SAL_CALL endDocument() override
constexpr sal_uInt16 XML_NAMESPACE_TABLE
virtual void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override
void CreateNumberFormatsSupplier_()
static sal_Int32 getTokenFromName(const OUString &sName)
css::uno::Reference< css::uno::XComponentContext > const & GetComponentContext() const
OUString GetAbsoluteReference(const OUString &rValue) const
OUString GetODFVersion() const
bool mbOwnEmbeddedResolver
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
#define SAL_WARN_IF(condition, area, stream)
void NotifyMacroEventRead()
constexpr OUStringLiteral sScript
virtual void SetDocumentSpecificSettings(const OUString &_rSettingsGroupName, const css::uno::Sequence< css::beans::PropertyValue > &_rSettings)
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
css::uno::Reference< css::xml::sax::XLocator > mxLocator
constexpr sal_uInt16 XML_NAMESPACE_SMIL
rtl::Reference< SvXMLStylesContext > mxStyles
constexpr sal_uInt16 XML_NAMESPACE_REPORT
sal_Int64 getSomethingImpl(const css::uno::Sequence< sal_Int8 > &rId, T *pThis, FallbackToGetSomethingOf< Base >={})
constexpr sal_uInt16 XML_NAMESPACE_CONFIG_OOO
css::uno::Reference< css::util::XNumberFormatsSupplier > mxNumberFormatsSupplier
Handling of tokens in XML:
void AddNumberStyle(sal_Int32 nKey, const OUString &sName)
#define SAL_INFO(area, stream)
const css::uno::Reference< css::container::XNameContainer > & GetMarkerHelper()
virtual SvXMLImportContext * CreateFastContext(sal_Int32 Element, const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList > &xAttrList)
virtual void SetStatistics(const css::uno::Sequence< css::beans::NamedValue > &i_rStats)
static const sal_uInt16 OOo_1x
OReadImagesDocumentHandler::Image_XML_Namespace nNamespace
#define XML_ELEMENT(prefix, name)
FastAttributeIter end() const
const css::uno::Reference< css::frame::XModel > & GetModel() const
constexpr sal_uInt16 XML_NAMESPACE_TEXT_OOO
std::unique_ptr< SvXMLImport_Impl > mpImpl
void SetError(sal_Int32 nId, const css::uno::Sequence< OUString > &rMsgParams, const OUString &rExceptionMessage, const css::uno::Reference< css::xml::sax::XLocator > &rLocator)
Record an error condition that occurred during import.
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Sequence< sal_Int8 > aSeq
const css::uno::Reference< css::container::XNameContainer > & GetDashHelper()
constexpr sal_uInt16 XML_NAMESPACE_OF
rtl::Reference< ::xmloff::OFormLayerXMLImport > mxFormImport
std::optional< SvXMLNamespaceMap > mxNamespaceMap
std::unique_ptr< EmbeddedFontsHelper, o3tl::default_delete< EmbeddedFontsHelper > > mxEmbeddedFontHelper
constexpr sal_Int32 NAMESPACE_TOKEN(sal_uInt16 prefixToken)
virtual void initXForms()
void SetAutoStyles(SvXMLStylesContext *pAutoStyles)
OUString ResolveEmbeddedObjectURLFromBase64()
void AddStyle(SvXMLStyleContext &rNew)
constexpr sal_uInt16 XML_NAMESPACE_OFFICE_EXT
void AddStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName, const OUString &rDisplayName)
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
sal_uInt16 GetKeyByName(const OUString &rName) const
css::uno::Reference< css::container::XNameContainer > mxBitmapHelper
const css::uno::Reference< css::beans::XPropertySet > & getImportInfo() const
bool IsODFVersionConsistent(const OUString &aODFVersion)
static SchXMLImportHelper * CreateChartImport()
void SetReference(sal_Int32 nVal)
virtual sal_Bool SAL_CALL filter(const css::uno::Sequence< css::beans::PropertyValue > &aDescriptor) override
constexpr sal_uInt16 XML_NAMESPACE_NUMBER_SO52
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION_OOO
#define SAL_WARN(area, stream)
Reference< XSingleServiceFactory > xFactory
constexpr sal_Int32 TOKEN_MASK
constexpr sal_uInt16 XML_NAMESPACE_DRAW_SO52
constexpr sal_uInt16 XML_NAMESPACE_DRAW_OOO
void registerNamespaces()
virtual void DisposingModel()
XMLFontStylesContext * GetFontDecls()
#define XMLERROR_UNKNOWN_ROOT
css::uno::Reference< css::document::XEmbeddedObjectResolver > mxEmbeddedResolver
virtual void SAL_CALL setTargetDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
virtual void SAL_CALL setTokenHandler(const css::uno::Reference< css::xml::sax::XFastTokenHandler > &Handler) override
bool addEmbeddedFont(const css::uno::Reference< css::io::XInputStream > &stream, const OUString &fontName, const char *extra, std::vector< unsigned char > const &key, bool eot)
constexpr sal_uInt16 XML_NAMESPACE_META
constexpr sal_uInt16 XML_NAMESPACE_TEXT_SO52
const XMLEventNameTranslation aStandardEventTable[]
a translation table for the events defined in the XEventsSupplier service (implemented in XMLEventExp...
css::uno::Reference< css::document::XGraphicStorageHandler > mxGraphicStorageHandler
bool isGeneratorVersionOlderThan(sal_uInt16 const nOOoVersion, sal_uInt16 const nLOVersion)
depending on whether the generator version indicates LO, compare against either the given LO or given...
COMPHELPER_DLLPUBLIC void notifyMacroEventRead(const css::uno::Reference< css::frame::XModel > &_rxDocument)
const css::uno::Reference< css::container::XNameContainer > & GetGradientHelper()
SvXMLStylesContext * GetAutoStyles()
constexpr sal_uInt16 XML_NAMESPACE_OOOW
std::unique_ptr< DocumentInfo > mpDocumentInfo
const OUString & GetPrefixByKey(sal_uInt16 nKey) const
css::uno::Reference< css::util::XNumberFormatsSupplier > & GetNumberFormatsSupplier()
constexpr sal_uInt16 XML_NAMESPACE_FORM_OOO
constexpr sal_uInt16 XML_NAMESPACE_REPORT_OASIS
static const sal_uInt16 LO_5x
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION_OASIS
static std::optional< SvXMLNamespaceMap > processNSAttributes(std::optional< SvXMLNamespaceMap > &rpNamespaceMap, SvXMLImport *const pImport, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
void addNSDeclAttributes(rtl::Reference< comphelper::AttributeList > const &rAttrList)
virtual ~SvXMLImport() noexcept override
virtual void SAL_CALL characters(const OUString &aChars) override
constexpr sal_uInt16 XML_NAMESPACE_STYLE
rtl::Reference< sax_fastparser::FastAttributeList > mxFastAttributes
virtual void SAL_CALL endDocument() override
bool any2bool(const css::uno::Any &rAny)
std::optional< OUString > mxODFVersion
rtl::Reference< XMLShapeImportHelper > const & GetShapeImport()
virtual void SAL_CALL startUnknownElement(const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual void SAL_CALL registerNamespace(const OUString &rNamespacePrefix, const OUString &rNamespaceURI) override
bool m_bDetectedRangeSegmentation false
constexpr sal_uInt16 XML_NAMESPACE_FIELD
bool embeddedFontAlreadyProcessed(const OUString &url)
Returns true if the embedded font document URL has already been processed.
css::uno::Reference< css::xml::sax::XFastParser > mxParser
virtual void SAL_CALL setEntityResolver(const css::uno::Reference< css::xml::sax::XEntityResolver > &Resolver) override