38 #include <com/sun/star/frame/XModel.hpp>
39 #include <com/sun/star/util/DateTime.hpp>
40 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #include <com/sun/star/text/UserDataPart.hpp>
42 #include <com/sun/star/text/PageNumberType.hpp>
43 #include <com/sun/star/style/NumberingType.hpp>
44 #include <com/sun/star/text/ReferenceFieldPart.hpp>
45 #include <com/sun/star/text/ReferenceFieldSource.hpp>
46 #include <com/sun/star/beans/XPropertySet.hpp>
47 #include <com/sun/star/beans/XPropertyState.hpp>
48 #include <com/sun/star/text/XTextField.hpp>
49 #include <com/sun/star/text/XDependentTextField.hpp>
50 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
52 #include <com/sun/star/text/SetVariableType.hpp>
53 #include <com/sun/star/text/PlaceholderType.hpp>
54 #include <com/sun/star/text/FilenameDisplayFormat.hpp>
55 #include <com/sun/star/text/ChapterFormat.hpp>
56 #include <com/sun/star/text/TemplateDisplayFormat.hpp>
57 #include <com/sun/star/container/XNameReplace.hpp>
58 #include <com/sun/star/uno/Sequence.h>
59 #include <com/sun/star/text/BibliographyDataType.hpp>
60 #include <com/sun/star/sdb/CommandType.hpp>
61 #include <com/sun/star/rdf/XMetadatable.hpp>
64 #include <rtl/ustrbuf.hxx>
66 #include <rtl/math.hxx>
72 using namespace ::
std;
159 uno::Reference<text::XText> GetToplevelText(
const uno::Reference<text::XText>& xText)
161 uno::Reference<text::XText> xRet = xText;
164 uno::Reference<beans::XPropertySet> xPropertySet(xRet, uno::UNO_QUERY);
165 if (!xPropertySet.is())
168 if (!xPropertySet->getPropertySetInfo()->hasPropertyByName(
"ParentText"))
171 uno::Reference<text::XText> xParent;
172 if (xPropertySet->getPropertyValue(
"ParentText") >>= xParent)
278 const Reference<XPropertySetInfo> &,
293 const OUString& sPropName,
298 constexpr OUStringLiteral
gsServicePrefix(u
"com.sun.star.text.textfield.");
372 std::unique_ptr<XMLPropertyState> pCombinedCharState)
374 pCombinedCharactersPropertyState(
std::move(pCombinedCharState))
385 const Reference<XTextField> & rTextField,
389 Reference<XServiceInfo> xService(rTextField, UNO_QUERY);
395 const OUString* pNames = std::find_if(aServices.begin(), aServices.end(),
396 [](
const OUString& rName) {
return rName.matchIgnoreAsciiCase(
gsServicePrefix); });
397 if (pNames != aServices.end())
404 if( sFieldName.isEmpty() )
407 pNames = std::find_if(aServices.begin(), aServices.end(),
409 if (pNames != aServices.end())
415 if( !sFieldName.isEmpty() )
417 if( sFieldName ==
"Header" )
421 else if( sFieldName ==
"Footer" )
425 else if( sFieldName ==
"DateTime" )
433 DBG_ASSERT(!sFieldName.isEmpty(),
"no TextField service found!");
438 std::u16string_view sFieldName,
450 DBG_ASSERT(!sFieldName.empty(),
"no valid service name!");
452 if (!sFieldName.empty())
456 nToken, sFieldName, aFieldServiceNameMapping);
459 DBG_ASSERT(bRet,
"Unknown field service name encountered!");
473 case SetVariableType::STRING:
474 case SetVariableType::VAR:
477 case SetVariableType::SEQUENCE:
480 case SetVariableType::FORMULA:
491 case SetVariableType::STRING:
492 case SetVariableType::VAR:
495 case SetVariableType::FORMULA:
498 case SetVariableType::SEQUENCE:
514 if (xPropSet->getPropertySetInfo()->
549 case ReferenceFieldSource::REFERENCE_MARK:
552 case ReferenceFieldSource::SEQUENCE_FIELD:
555 case ReferenceFieldSource::BOOKMARK:
558 case ReferenceFieldSource::FOOTNOTE:
561 case ReferenceFieldSource::ENDNOTE:
635 switch (nFieldType) {
643 SetVariableType::STRING );
649 Reference<XTextField> xTextField(xPropSet, UNO_QUERY);
650 DBG_ASSERT(xTextField.is(),
"field is no XTextField!");
741 OSL_FAIL(
"unknown field type/field has no content");
749 const Reference<XTextField> & rTextField,
const bool bProgress,
750 const bool bRecursive )
758 Reference<XDependentTextField> xDepField(rTextField, UNO_QUERY);
763 Reference<XText> xOurText = GetToplevelText(rTextField->getAnchor()->getText());
765 map<Reference<XText>, set<OUString> >::iterator aMapIter =
772 (*pUsedMasters)[xOurText] = aSet;
779 if (!sFieldMasterName.isEmpty())
780 aMapIter->second.insert( sFieldMasterName );
805 if ( (5100 != nFormat) &&
819 Reference<XPropertySetInfo> xPropSetInfo(
820 xPropSet->getPropertySetInfo() );
832 xPropSet, xPropSetInfo,
false ) )
849 bool dummy_for_autostyles(
true);
882 xPropSet, xPropSet->getPropertySetInfo(),
898 "need proper PropertyState for combined characters");
964 OSL_FAIL(
"unknown field type!");
972 const Reference<XTextField> & rTextField,
bool bProgress,
973 bool & rPrevCharIsSpace)
997 FindTextStyleAndHyperlink( xRangePropSet, bHasHyperlink, bIsUICharStyle,
998 bHasAutoStyle, pStates );
999 bool bHasStyle = !sStyle.isEmpty();
1002 Reference < XPropertySetInfo > xRangePropSetInfo;
1005 Reference<XPropertyState> xRangePropState( xRangePropSet, UNO_QUERY );
1006 xRangePropSetInfo = xRangePropSet->getPropertySetInfo();
1009 xRangePropSet, xRangePropState,
1010 xRangePropSetInfo );
1019 OUString sHyperLinkEvents(
"HyperLinkEvents");
1020 if (xRangePropSetInfo->hasPropertyByName(sHyperLinkEvents))
1022 Any aAny = xRangePropSet->getPropertyValue(sHyperLinkEvents);
1023 Reference<XNameReplace> xName;
1034 xRangePropSet, xRangePropSetInfo ), bHasAutoStyle,
1043 GetExport().EncodeStyleName( sStyle ) );
1051 bProgress, rPrevCharIsSpace);
1057 const Reference<XTextField> & rTextField,
1062 bool & rPrevCharIsSpace)
1066 Reference<XPropertySetInfo> xPropSetInfo(rPropSet->getPropertySetInfo());
1068 OUString sPresentation = rTextField->getPresentation(
false);
1117 rPropSet, xPropSetInfo,
false ) );
1137 rPropSet, xPropSetInfo,
false ) );
1160 rPropSet, xPropSetInfo,
false ) );
1173 false,
false, !bCmd,
1176 rPropSet, xPropSetInfo,
false ) );
1230 !bCmd, !bCmd, !bCmd,
1233 rPropSet, xPropSetInfo,
false ) );
1259 rPropSet, xPropSetInfo,
false ),
1301 rPropSet, xPropSetInfo,
false ) );
1359 sal_Int32 nDummy = 0;
1372 rPropSet, xPropSetInfo);
1386 rPropSet, xPropSetInfo);
1396 "Unexpected presentation for database next field");
1398 rPropSet, xPropSetInfo);
1410 "Unexpected presentation for database select field");
1412 rPropSet, xPropSetInfo);
1430 false,
false,
true,
false);
1435 xMaster, xMaster->getPropertySetInfo());
1458 rPropSet, xPropSetInfo,
false ) );
1489 rPropSet, xPropSetInfo,
false ));
1547 "Unexpected presentation for hidden paragraph field");
1591 "Unexpected presentation page variable field");
1728 "Unexpected presentation for script field");
1747 "Unexpected presentation for annotation field");
1752 if (!aName.isEmpty())
1759 OUString aResolvedText;
1760 OUStringBuffer aResolvedTextBuffer;
1762 aResolvedText = aResolvedTextBuffer.makeStringAndClear();
1773 if( !aAuthor.isEmpty() )
1796 if( !aInitials.isEmpty() )
1812 css::uno::Reference < css::text::XText > xText;
1818 catch ( css::uno::Exception& )
1907 OSL_FAIL(
"unknown field type encountered!");
1917 Reference<XText> xEmptyText;
1923 const Reference<XText> & rText )
1926 vector<OUString> aVarName;
1927 vector<OUString> aUserName;
1928 vector<OUString> aSeqName;
1929 vector<OUString> aDdeName;
1932 Reference<XTextFieldsSupplier> xTextFieldsSupp(
GetExport().GetModel(),
1934 if( !xTextFieldsSupp.is() )
1938 xTextFieldsSupp->getTextFieldMasters();
1948 "field masters must be recorded in order to be "
1949 "written out separately" );
1952 map<Reference<XText>, set<OUString> > ::iterator aMapIter =
1967 aFieldMasters = xFieldMasterNameAccess->getElementNames();
1970 for(
const OUString& sFieldMaster : std::as_const(aFieldMasters)) {
1973 if ( sFieldMaster.startsWithIgnoreAsciiCase(
1974 "com.sun.star.text.FieldMaster.DataBase.") )
1980 OUString sFieldMasterType;
1986 Any aAny = xFieldMasterNameAccess->getByName(sFieldMaster);
1995 if ( SetVariableType::SEQUENCE == nType )
1997 aSeqName.push_back( sFieldMaster );
2001 aVarName.push_back( sFieldMaster );
2006 aUserName.push_back( sFieldMaster );
2010 aDdeName.push_back( sFieldMaster );
2021 if ( !aVarName.empty() )
2028 for (
const auto& sName : aVarName)
2032 Any aAny = xFieldMasterNameAccess->getByName(sName);
2036 OUString sFieldMasterType;
2042 == SetVariableType::STRING );
2053 false,
true,
false,
false);
2066 false,
true,
false,
false);
2076 if ( !aSeqName.empty() )
2083 for (
const auto& sName : aSeqName)
2087 Any aAny = xFieldMasterNameAccess->getByName(sName);
2091 OUString sFieldMasterType;
2098 DBG_ASSERT(nLevel >= 0,
"illegal outline level");
2099 DBG_ASSERT(nLevel < 127,
"possible illegal outline level");
2114 if ( !aUserName.empty() )
2121 for (
const auto& sName : aUserName)
2125 Any aAny = xFieldMasterNameAccess->getByName(sName);
2129 OUString sFieldMasterType;
2161 if ( aDdeName.empty() )
2169 for (
const auto& sName : aDdeName)
2173 Any aAny = xFieldMasterNameAccess->getByName(sName);
2201 if (bIsAutomaticUpdate)
2216 bool bExportOnlyUsed)
2221 if (bExportOnlyUsed)
2237 eElementName, bAddSpace, bAddSpace );
2242 const OUString& sContent)
2249 eElementName,
false,
false );
2260 const OUString& rContent )
2264 OUString sPropertyScriptURL(
"ScriptURL" );
2279 Sequence<PropertyValue>
aSeq;
2281 rPropSet->getPropertyValue( sPropertyScriptURL ) >>= sName;
2285 if (!sName.isEmpty())
2288 aSeq = Sequence<PropertyValue> (2);
2289 PropertyValue* pArr = aSeq.getArray();
2290 pArr[0].Name = sEventType;
2291 pArr[0].Value <<= sScript;
2292 pArr[1].Name = sScript;
2293 pArr[1].Value = rPropSet->getPropertyValue( sPropertyScriptURL );
2297 aSeq = Sequence<PropertyValue> (3);
2298 PropertyValue* pArr = aSeq.getArray();
2299 pArr[0].Name = sEventType;
2300 pArr[0].Value <<= OUString(
"StarBasic");
2301 pArr[1].Name =
"Library";
2302 pArr[1].Value = rPropSet->getPropertyValue(
"MacroLibrary" );
2303 pArr[2].Name =
"MacroName";
2304 pArr[2].Value = rPropSet->getPropertyValue(
"MacroName" );
2316 bool i_bAutoStyles,
bool i_bProgress,
2317 bool & rPrevCharIsSpace)
2319 bool doExport(!i_bAutoStyles);
2321 switch (
GetExport().getSaneDefaultVersion()) {
2327 const Reference < XEnumerationAccess > xEA( i_xMeta, UNO_QUERY_THROW );
2328 const Reference < XEnumeration > xTextEnum( xEA->createEnumeration() );
2332 const Reference<rdf::XMetadatable> xMeta( i_xMeta, UNO_QUERY_THROW );
2337 "",
u"", 0.0,
false,
false,
true,
2341 xMeta->ensureMetadataReference();
2352 exportTextRangeEnumeration(xTextEnum, i_bAutoStyles, i_bProgress, rPrevCharIsSpace);
2358 sal_Int32 nFormatKey,
2359 const OUString& sContent,
2360 std::u16string_view sDefault,
2363 bool bExportValueType,
2365 bool bForceSystemLanguage,
2374 if (bExportValue || bExportValueType)
2377 GetExport(), sContent, sDefault, bExportValue);
2386 DBG_ASSERT(bExportValueType || !bExportValue,
"value w/o value type not supported!");
2390 if (-1 != nFormatKey)
2392 if (bExportValue || bExportValueType)
2396 GetExport(), nFormatKey, fValue, bExportValue);
2402 if( bForceSystemLanguage )
2406 OUString sDataStyleName =
2408 if( !sDataStyleName.isEmpty() )
2445 bool bBool,
bool bDefault)
2453 if ((!bBool) != (!bDefault)) {
2462 const OUString& sValue,
2471 if ( bOmitEmpty && sValue.isEmpty() )
2479 sal_uInt16 nValuePrefix,
2480 const OUString& sValue)
2489 const OUString& sValue,
2490 std::u16string_view sDefault)
2492 if (sValue != sDefault)
2500 sal_uInt16 nValuePrefix,
2501 const OUString& sValue,
2502 std::u16string_view sDefault)
2504 if (sValue != sDefault)
2531 if ( eValue != eDefault )
2538 std::u16string_view sParagraphSequence)
2543 std::u16string_view aSubString;
2561 OUString::number(nNum));
2566 sal_Int32 nNum, sal_Int32 nDefault)
2568 if (nNum != nDefault)
2577 if (NumberingType::PAGE_DESCRIPTOR == nNumberingType)
2580 OUStringBuffer sTmp( 10 );
2585 sTmp.makeStringAndClear() );
2589 if (!sTmp.isEmpty())
2592 sTmp.makeStringAndClear() );
2603 bool bOmitDurationIfZero,
2609 dValue = ::rtl::math::approxFloor(dValue);
2616 if (!bOmitDurationIfZero || dValue != 0.0)
2628 ProcessString(eName, aBuffer.makeStringAndClear(),
true, nPrefix);
2633 const util::DateTime& rTime)
2635 OUStringBuffer aBuffer;
2637 util::DateTime aDateTime(rTime);
2653 if (!(bIsDuration && (nMinutes==0)))
2656 bIsDate, bIsDuration);
2662 const util::DateTime& rTime)
2664 OUStringBuffer aBuffer;
2677 {
XML_BOOK, BibliographyDataType::BOOK },
2685 {
XML_EMAIL, BibliographyDataType::EMAIL },
2686 {
XML_INBOOK, BibliographyDataType::INBOOK },
2690 {
XML_MANUAL, BibliographyDataType::MANUAL },
2692 {
XML_MISC, BibliographyDataType::MISC },
2697 {
XML_WWW, BibliographyDataType::WWW },
2707 Sequence<PropertyValue> aValues;
2711 for (
const auto& rProp : std::as_const(aValues))
2713 if( rProp.Name ==
"BibiliographicType" )
2715 sal_Int16 nTypeId = 0;
2716 rProp.Value >>= nTypeId;
2717 OUStringBuffer sBuf;
2720 aBibliographyDataTypeMap))
2724 sBuf.makeStringAndClear());
2731 rProp.Value >>= sStr;
2733 if (!sStr.isEmpty())
2745 sal_Int32 nCommandType)
2748 switch( nCommandType )
2750 case sdb::CommandType::TABLE: eToken =
XML_TABLE;
break;
2751 case sdb::CommandType::QUERY: eToken =
XML_QUERY;
break;
2752 case sdb::CommandType::COMMAND: eToken =
XML_COMMAND;
break;
2762 const OUString& sSelected )
2773 sal_Int32 nSelected )
2775 sal_Int32
nLength = rSequence.getLength();
2776 const OUString* pSequence = rSequence.getConstArray();
2777 for( sal_Int32 i = 0;
i <
nLength;
i++ )
2779 if( i == nSelected )
2790 const OUString& sPresentation,
2792 const Reference<XPropertySetInfo>& rPropertySetInfo )
2795 SAL_WARN_IF( !rPropertySet.is(),
"xmloff.text",
"need property set" );
2796 SAL_WARN_IF( !rPropertySetInfo.is(),
"xmloff.text",
"need property set info" );
2799 OUString sDataBaseName;
2800 OUString sDataBaseURL;
2803 && !sStr.isEmpty() )
2805 sDataBaseName = sStr;
2811 sDataBaseURL = sStr;
2815 if( !sDataBaseName.isEmpty() )
2823 if( !sDataBaseURL.isEmpty() )
2838 const OUString& sMasterName, OUString& sFieldType, OUString& sVarName)
2841 sal_Int32 nSeparator = sMasterName.indexOf(
'.', nLength);
2844 if (nSeparator <= nLength) {
2845 SAL_WARN(
"xmloff.text",
"no field var name!");
2849 sFieldType = sMasterName.copy(nLength, nSeparator-nLength);
2850 sVarName = sMasterName.copy(nSeparator+1);
2857 const Reference<XTextField> & rTextField)
2860 Reference<XDependentTextField> xDep(rTextField, UNO_QUERY);
2861 return xDep->getTextFieldMaster();
2870 Sequence<Reference<XDependentTextField> > aFields;
2875 if (aFields.hasElements())
2878 Reference<XDependentTextField> xTField = aFields[0];
2879 xField.set(xTField, UNO_QUERY);
2881 "Surprisingly, this TextField refuses to be a PropertySet!");
2898 case PlaceholderType::TEXT:
2902 case PlaceholderType::TABLE:
2906 case PlaceholderType::TEXTFRAME:
2910 case PlaceholderType::GRAPHIC:
2914 case PlaceholderType::OBJECT:
2920 OSL_FAIL(
"unknown placeholder type");
2941 PageNumberType ePage;
2943 ePage = *o3tl::doAccess<PageNumberType>(aAny);
2947 case PageNumberType_PREV:
2951 case PageNumberType_CURRENT:
2954 case PageNumberType_NEXT:
2959 OSL_FAIL(
"unknown page number type");
2974 case TemplateDisplayFormat::FULL:
2977 case TemplateDisplayFormat::PATH:
2980 case TemplateDisplayFormat::NAME:
2983 case TemplateDisplayFormat::NAME_AND_EXT:
2986 case TemplateDisplayFormat::AREA:
2989 case TemplateDisplayFormat::TITLE:
2993 OSL_FAIL(
"unknown template display format");
3030 OSL_FAIL(
"no count field token");
3045 case ChapterFormat::NAME:
3048 case ChapterFormat::NUMBER:
3051 case ChapterFormat::NAME_NUMBER:
3054 case ChapterFormat::NO_PREFIX_SUFFIX:
3057 case ChapterFormat::DIGIT:
3061 OSL_FAIL(
"unknown chapter display format");
3077 case FilenameDisplayFormat::FULL:
3080 case FilenameDisplayFormat::PATH:
3083 case FilenameDisplayFormat::NAME:
3086 case FilenameDisplayFormat::NAME_AND_EXT:
3090 OSL_FAIL(
"unknown filename display format");
3104 case ReferenceFieldPart::PAGE:
3107 case ReferenceFieldPart::CHAPTER:
3110 case ReferenceFieldPart::TEXT:
3113 case ReferenceFieldPart::UP_DOWN:
3116 case ReferenceFieldPart::CATEGORY_AND_NUMBER:
3119 case ReferenceFieldPart::ONLY_CAPTION:
3122 case ReferenceFieldPart::ONLY_SEQUENCE_NUMBER:
3125 case ReferenceFieldPart::PAGE_DESC:
3131 case ReferenceFieldPart::NUMBER:
3134 case ReferenceFieldPart::NUMBER_NO_CONTEXT:
3137 case ReferenceFieldPart::NUMBER_FULL_CONTEXT:
3141 OSL_FAIL(
"unknown reference type");
3156 case ReferenceFieldSource::REFERENCE_MARK:
3159 case ReferenceFieldSource::SEQUENCE_FIELD:
3162 case ReferenceFieldSource::BOOKMARK:
3165 case ReferenceFieldSource::FOOTNOTE:
3166 case ReferenceFieldSource::ENDNOTE:
3170 OSL_FAIL(
"unknown reference source");
3187 case UserDataPart::COMPANY :
3190 case UserDataPart::FIRSTNAME :
3193 case UserDataPart::NAME :
3196 case UserDataPart::SHORTCUT :
3199 case UserDataPart::STREET :
3202 case UserDataPart::COUNTRY :
3205 case UserDataPart::ZIP :
3208 case UserDataPart::CITY :
3211 case UserDataPart::TITLE :
3214 case UserDataPart::POSITION :
3217 case UserDataPart::PHONE_PRIVATE :
3220 case UserDataPart::PHONE_COMPANY :
3223 case UserDataPart::FAX :
3226 case UserDataPart::EMAIL :
3229 case UserDataPart::STATE :
3233 SAL_WARN(
"xmloff.text",
"unknown sender type");
3294 SAL_WARN(
"xmloff.text",
"unknown docinfo field type!");
3306 if( sName ==
u"Identifier" )
3310 else if( sName ==
u"BibiliographicType" )
3314 else if( sName ==
u"Address" )
3318 else if( sName ==
u"Annote" )
3322 else if( sName ==
u"Author" )
3326 else if( sName ==
u"Booktitle" )
3330 else if( sName ==
u"Chapter" )
3334 else if( sName ==
u"Edition" )
3338 else if( sName ==
u"Editor" )
3342 else if( sName ==
u"Howpublished" )
3346 else if( sName ==
u"Institution" )
3350 else if( sName ==
u"Journal" )
3354 else if( sName ==
u"Month" )
3358 else if( sName ==
u"Note" )
3362 else if( sName ==
u"Number" )
3366 else if( sName ==
u"Organizations" )
3370 else if( sName ==
u"Pages" )
3374 else if( sName ==
u"Publisher" )
3378 else if( sName ==
u"School" )
3382 else if( sName ==
u"Series" )
3386 else if( sName ==
u"Title" )
3390 else if( sName ==
u"Report_Type" )
3394 else if( sName ==
u"Volume" )
3398 else if( sName ==
u"Year" )
3402 else if( sName ==
u"URL" )
3406 else if( sName ==
u"Custom1" )
3410 else if( sName ==
u"Custom2" )
3414 else if( sName ==
u"Custom3" )
3418 else if( sName ==
u"Custom4" )
3422 else if( sName ==
u"Custom5" )
3426 else if( sName ==
u"ISBN" )
3432 OSL_FAIL(
"Unknown bibliography info data");
3455 return "ftn" + OUString::number(static_cast<sal_Int32>(nSeqNo));
3460 std::u16string_view rSeqName)
3463 return OUString::Concat(
"ref") +rSeqName + OUString::number(static_cast<sal_Int32>(nSeqNo));
3474 const OUString& sPropName,
3477 Any aAny = xPropSet->getPropertyValue(sPropName);
3478 bool bBool = *o3tl::doAccess<bool>(aAny);
3483 const OUString& sPropName,
3485 const Reference<XPropertySetInfo> & xPropSetInfo,
3488 return xPropSetInfo->hasPropertyByName( sPropName )
3493 const OUString& sPropName,
3496 Any aAny = xPropSet->getPropertyValue(sPropName);
3497 double fDouble = 0.0;
3503 const OUString& sPropName,
3506 Any aAny = xPropSet->getPropertyValue(sPropName);
3513 const OUString& sPropName,
3516 Any aAny = xPropSet->getPropertyValue(sPropName);
3523 const OUString& sPropName,
3526 Any aAny = xPropSet->getPropertyValue(sPropName);
3533 const OUString& sPropName,
3536 Any aAny = xPropSet->getPropertyValue(sPropName);
3543 const OUString& sPropName,
3546 Any aAny = xPropSet->getPropertyValue(sPropName);
3547 util::DateTime aTime;
3553 const OUString& sPropName,
3556 Any aAny = xPropSet->getPropertyValue(sPropName);
char const FIELD_SERVICE_HIDDEN_TEXT[]
constexpr OUStringLiteral gsPropertyVariableName(u"VariableName")
static bool IsStringField(FieldIdEnum nFieldType, const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
determine, whether field has string or numeric content
char const FIELD_SERVICE_REFERENCE_PAGE_GET[]
void ProcessStringSequence(const css::uno::Sequence< OUString > &rSequence, const OUString &sSelected)
css::sdb::CommandType
constexpr OUStringLiteral gsPropertyIsDate(u"IsDate")
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
static enum::xmloff::token::XMLTokenEnum MapFilenameDisplayFormat(sal_Int16 nType)
map FilenameDisplayFormat to XML attribute names
constexpr OUStringLiteral gsPropertyReferenceFieldPart(u"ReferenceFieldPart")
char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR2[]
void ExportElement(enum::xmloff::token::XMLTokenEnum eElement, bool bAddSpace=false)
export an empty element
constexpr OUStringLiteral gsPropertyLevel(u"Level")
constexpr OUStringLiteral gsPropertyNumberingType(u"NumberingType")
static bool GetBoolProperty(const OUString &, const Reference< XPropertySet > &)
void ExportMetaField(const css::uno::Reference< css::beans::XPropertySet > &i_xMeta, bool i_bAutoStyles, bool i_bProgress, bool &rPrevCharIsSpace)
export text:meta-field (RDF metadata)
constexpr OUStringLiteral gsPropertyInstanceName(u"InstanceName")
constexpr OUStringLiteral gsPropertyNumberFormat(u"NumberFormat")
constexpr OUStringLiteral gsPropertyName(u"Name")
char const FIELD_SERVICE_DB_NEXT[]
char const FIELD_SERVICE_DOC_INFO_EDIT_TIME2[]
void ExportFieldAutoStyle(const css::uno::Reference< css::text::XTextField > &rTextField, const bool bProgress, const bool bRecursive)
collect styles (character styles, data styles, ...) for this field (if appropriate).
constexpr sal_uInt16 XML_NAMESPACE_SCRIPT
char const FIELD_SERVICE_DROP_DOWN[]
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
char const FIELD_SERVICE_PARAGRAPH_COUNT[]
static Sequence< OUString > GetStringSequenceProperty(const OUString &sPropName, const Reference< XPropertySet > &xPropSet)
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
static OUString MakeSequenceRefName(sal_Int16 nSeqNo, std::u16string_view rSeqName)
make reference name for a sequence field
char const FIELD_SERVICE_DOC_INFO_KEY_WORDS2[]
const SvXMLUnitConverter & GetMM100UnitConverter() const
char const FIELD_SERVICE_DATETIME[]
constexpr OUStringLiteral gsPropertyTooltip(u"Tooltip")
void ProcessInteger(enum::xmloff::token::XMLTokenEnum eXmlName, sal_Int32 nNum)
attribute default; omit, if attribute differs
constexpr OUStringLiteral gsPropertyValue(u"Value")
static enum::xmloff::token::XMLTokenEnum MapCountFieldName(FieldIdEnum nToken)
map count/statistics field token to XML name
char const FIELD_SERVICE_PAGE_COUNT[]
static enum::xmloff::token::XMLTokenEnum MapReferenceType(sal_Int16 nType)
map ReferenceFieldPart to XML string
void ExportFieldDeclarations()
export field declarations.
static double GetDoubleProperty(const OUString &, const Reference< XPropertySet > &)
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr OUStringLiteral gsPropertyContent(u"Content")
constexpr OUStringLiteral gsPropertyChapterNumberingLevel(u"ChapterNumberingLevel")
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
std::unique_ptr< ::std::map< css::uno::Reference< css::text::XText >,::std::set< OUString > > > pUsedMasters
store used text field master names (NULL means: don't collect)
void ExportField(const css::uno::Reference< css::text::XTextField > &rTextField, bool bProgress, bool &rPrevCharIsSpace)
Export this field and the surrounding span element with the formatting.
char const FIELD_SERVICE_MEASURE[]
void ProcessParagraphSequence(std::u16string_view sParagraphSequence)
default value token
void ProcessDisplay(bool bIsVisible, bool bIsCommand)
numbering type key
constexpr OUStringLiteral gsPropertyDataCommandType(u"DataCommandType")
constexpr OUStringLiteral gsPropertyDDECommandElement(u"DDECommandElement")
SvXMLExport & GetExport()
constexpr OUStringLiteral gsPropertySequenceValue(u"SequenceValue")
SvXMLEnumMapEntry< sal_Int16 > const aBibliographyDataTypeMap[]
static enum FieldIdEnum GetFieldID(const css::uno::Reference< css::text::XTextField > &rTextField, const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
get field ID from XTextField (and it's Property-Set)
constexpr OUStringLiteral gsPropertyInitials(u"Initials")
constexpr OUStringLiteral gsPropertyIsHidden(u"IsHidden")
char const FIELD_SERVICE_TEMPLATE_NAME[]
constexpr OUStringLiteral gsPropertyHelp(u"Help")
constexpr OUStringLiteral gsPropertyDependentTextFields(u"DependentTextFields")
constexpr OUStringLiteral gsPropertyDDECommandType(u"DDECommandType")
char const FIELD_SERVICE_HIDDEN_PARAGRAPH[]
constexpr OUStringLiteral gsPropertySelectedItem(u"SelectedItem")
char const FIELD_SERVICE_DOC_INFO_KEY_WORDS[]
char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR[]
char const FIELD_SERVICE_CHAPTER[]
static enum::xmloff::token::XMLTokenEnum MapChapterDisplayFormat(sal_Int16 nType)
map ChapterDisplayFormat to XML string
constexpr OUStringLiteral gsPropertyIsExpression(u"IsExpression")
static sal_Int16 GetInt16Property(const OUString &, const Reference< XPropertySet > &)
char const FIELD_SERVICE_DB_NAME[]
char const FIELD_SERVICE_DDE[]
char const FIELD_SERVICE_DOC_INFO_SUBJECT2[]
char const FIELD_SERVICE_REFERENCE_PAGE_SET[]
char const FIELD_SERVICE_TABLE_FORMULA[]
XMLTextFieldExport(SvXMLExport &rExp, std::unique_ptr< XMLPropertyState > pCombinedCharState)
constexpr OUStringLiteral gsPropertyDateTime(u"DateTime")
constexpr OUStringLiteral gsPropertyFalseContent(u"FalseContent")
constexpr OUStringLiteral gsPropertyIsConditionTrue(u"IsConditionTrue")
void AddAttribute(sal_uInt16 nPrefix, const char *pName, const OUString &rValue)
SvXMLEnumStringMapEntry< FieldIdEnum > const aFieldServiceNameMapping[]
constexpr sal_uInt16 XML_NAMESPACE_FORM
void ProcessString(enum::xmloff::token::XMLTokenEnum eXmlName, const OUString &sValue, bool bOmitEmpty=false, sal_uInt16 nPrefix=XML_NAMESPACE_TEXT)
default value
constexpr OUStringLiteral gsPropertyURLContent(u"URLContent")
char const FIELD_SERVICE_COMBINED_CHARACTERS[]
constexpr OUStringLiteral gsPropertyAdjust(u"Adjust")
char const FIELD_SERVICE_DOC_INFO_SUBJECT[]
char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR[]
static bool GetOptionalBoolProperty(const OUString &, const Reference< XPropertySet > &, const Reference< XPropertySetInfo > &, bool bDefault)
char const FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR[]
char const FIELD_SERVICE_TABLE_COUNT[]
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat=false) const
constexpr OUStringLiteral gsPropertyOffset(u"Offset")
void ProcessTimeOrDateTime(enum::xmloff::token::XMLTokenEnum eXMLName, const css::util::DateTime &rTime)
date/time value
XMLTokenEnum
The enumeration of all XML tokens.
constexpr OUStringLiteral gsPropertyNumberingSeparator(u"NumberingSeparator")
bool convertNumFormat(sal_Int16 &rType, const OUString &rNumFormat, std::u16string_view rNumLetterSync, bool bNumberNone=false) const
convert num-format and num-letter-sync values to NumberingType
constexpr OUStringLiteral gsPropertyPlaceholderType(u"PlaceHolderType")
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
char const FIELD_SERVICE_CHARACTER_COUNT[]
static util::DateTime GetDateTimeProperty(const OUString &sPropName, const Reference< XPropertySet > &xPropSet)
constexpr OUStringLiteral gsFieldMasterPrefix(u"com.sun.star.text.FieldMaster.")
constexpr OUStringLiteral gsPropertySetNumber(u"SetNumber")
constexpr OUStringLiteral gsPropertyTextRange(u"TextRange")
static enum::xmloff::token::XMLTokenEnum MapMeasureKind(sal_Int16 nKind)
Map a const char* (with length) to a sal_uInt16 value.
char const FIELD_SERVICE_META[]
char const FIELD_SERVICE_SCRIPT[]
void ProcessValueAndType(bool bIsString, sal_Int32 nFormatKey, const OUString &sContent, std::u16string_view sDefault, double fValue, bool bExportValue, bool bExportValueType, bool bExportStyle, bool bForceSystemLanguage, bool bTimeStyle=false)
is show command/show name?
void ProcessBoolean(enum::xmloff::token::XMLTokenEnum eXmlName, bool bBool, bool bDefault)
export a boolean attribute
char const FIELD_SERVICE_SETEXP[]
void ExportDataBaseElement(enum::xmloff::token::XMLTokenEnum eElement, const OUString &sContent, const css::uno::Reference< css::beans::XPropertySet > &rPropertySet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropertySetInfo)
export attributes that describe a data source
char const FIELD_SERVICE_AUTHOR[]
#define DBG_ASSERT(sCon, aError)
char const FIELD_SERVICE_GET_REFERENCE[]
char const FIELD_SERVICE_OBJECT_COUNT[]
char const FIELD_SERVICE_DOC_INFO_REVISION2[]
XMLEventExport & GetEventExport()
get Event export, with handlers for script types "None" and "StarBasic" already registered; other han...
bool getNextToken(std::u16string_view &rToken)
constexpr sal_uInt16 XML_NAMESPACE_TEXT
char const FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME[]
char const FIELD_SERVICE_USER[]
char const FIELD_SERVICE_DOC_INFO_TITLE2[]
void ExportSingleEvent(css::uno::Sequence< css::beans::PropertyValue > &rEventValues, const OUString &rApiEventName, bool bUseWhitespace=true)
export a single event (writes element)
void ProcessDateTime(enum::xmloff::token::XMLTokenEnum eXMLName, double dValue, bool bIsDate, bool bIsDuration, bool bOmitDurationIfZero=true, sal_uInt16 nPrefix=XML_NAMESPACE_TEXT)
exporting a time style?
char const FIELD_SERVICE_USERINPUT[]
constexpr OUStringLiteral gsPropertyDateTimeValue(u"DateTimeValue")
static enum::xmloff::token::XMLTokenEnum MapReferenceSource(sal_Int16 nType)
map ReferenceFieldPart to XML string
char const FIELD_SERVICE_PAGE_NAME[]
char const FIELD_SERVICE_MACRO[]
void convertDateTime(OUStringBuffer &rBuffer, const double &fDateTime, bool const bAddTimeIf0AM=false)
convert double to ISO Date Time String
constexpr OUStringLiteral gsPropertySubType(u"SubType")
char const FIELD_SERVICE_DOC_INFO_CUSTOM[]
char const FIELD_SERVICE_WORD_COUNT[]
static void convertDateTime(OUStringBuffer &rBuffer, const css::util::DateTime &rDateTime, sal_Int16 const *pTimeZoneOffset, bool bAddTimeIf0AM=false)
static OUString MakeFootnoteRefName(sal_Int16 nSeqNo)
out: variable name
constexpr OUStringLiteral gsPresentationServicePrefix(u"com.sun.star.presentation.TextField.")
static void ExplodeFieldMasterName(const OUString &sMasterName, OUString &sFieldType, OUString &sVarName)
explode a field master name into field type and field name
void ProcessCommandType(sal_Int32 nCommandType)
export CommandTypeAttribute
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
void ExportFieldHelper(const css::uno::Reference< css::text::XTextField > &rTextField, const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySet > &rRangePropSet, enum FieldIdEnum nToken, bool bProgress, bool &rPrevCharIsSpace)
export a field after is already written
constexpr OUStringLiteral gsPropertyIsVisible(u"IsVisible")
constexpr OUStringLiteral gsPropertyCondition(u"Condition")
char const FIELD_SERVICE_FILE_NAME[]
constexpr OUStringLiteral gsPropertySourceName(u"SourceName")
constexpr OUStringLiteral gsPropertyReferenceFieldLanguage(u"ReferenceFieldLanguage")
static void convertTimeOrDateTime(OUStringBuffer &rBuffer, const css::util::DateTime &rDateTime)
char const FIELD_SERVICE_DOC_INFO_CUSTOM2[]
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
constexpr OUStringLiteral gsPropertyTrueContent(u"TrueContent")
constexpr sal_uInt16 XML_NAMESPACE_DC
char const FIELD_SERVICE_DB_NUMBER[]
char const FIELD_SERVICE_GETEXP[]
static enum::xmloff::token::XMLTokenEnum MapSenderFieldName(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
element name for sender fields
void SetExportOnlyUsedFieldDeclarations(bool bExportOnlyUsed=true)
export all field declarations, or only those that have been used? Calling this method will reset the ...
const SvXMLNamespaceMap & GetNamespaceMap() const
static css::uno::Reference< css::beans::XPropertySet > GetMasterPropertySet(const css::uno::Reference< css::text::XTextField > &rTextField)
for XDependentTextFields, get PropertySet of FieldMaster
static bool convertBool(bool &rBool, std::u16string_view rString)
static OUString GetStringProperty(const OUString &, const Reference< XPropertySet > &)
constexpr OUStringLiteral gsPropertyFields(u"Fields")
char const FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR2[]
constexpr OUStringLiteral gsPropertyFullName(u"FullName")
constexpr OUStringLiteral gsPropertyFieldSubType(u"UserDataType")
constexpr OUStringLiteral gsPropertyHint(u"Hint")
static enum::xmloff::token::XMLTokenEnum MapTemplateDisplayFormat(sal_Int16 nType)
map TemplateDisplayFormat to XML
void ProcessBibliographyData(const css::uno::Reference< css::beans::XPropertySet > &rPropertySet)
date/time value
static bool GetDependentFieldPropertySet(const css::uno::Reference< css::beans::XPropertySet > &xmaster, css::uno::Reference< css::beans::XPropertySet > &xField)
get PropertySet of (any) DependentTextField for this FieldMaster
std::unique_ptr< XMLPropertyState > pCombinedCharactersPropertyState
constexpr OUStringLiteral gsPropertyDataBaseName(u"DataBaseName")
Map an XMLTokenEnum to an enum value.
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
static void convertNumLetterSync(OUStringBuffer &rBuffer, sal_Int16 nType)
std::unique_ptr< char[]> aBuffer
char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR2[]
constexpr OUStringLiteral gsPropertyURL(u"URL")
char const FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME[]
char const FIELD_SERVICE_DOC_INFO_REVISION[]
constexpr OUStringLiteral gsPropertyDataColumnName(u"DataColumnName")
char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME[]
char const FIELD_SERVICE_ANNOTATION[]
char const FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME2[]
#define SAL_WARN_IF(condition, area, stream)
char const FIELD_SERVICE_DOC_INFO_TITLE[]
static sal_Int32 GetIntProperty(const OUString &, const Reference< XPropertySet > &)
constexpr OUStringLiteral sScript
char const FIELD_SERVICE_DOC_INFO_DESCRIPTION[]
constexpr OUStringLiteral gsPropertyReferenceFieldSource(u"ReferenceFieldSource")
constexpr OUStringLiteral gsPropertyChapterFormat(u"ChapterFormat")
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
char const FIELD_SERVICE_CONDITIONAL_TEXT[]
Handling of tokens in XML:
void Characters(const OUString &rChars)
char const FIELD_SERVICE_BIBLIOGRAPHY[]
std::map< OUString, rtl::Reference< Entity > > map
constexpr OUStringLiteral gsPropertyIsInput(u"Input")
void ProcessNumberingType(sal_Int16 nNumberingType)
export a numbering format (numeric, roman, alphabetic, etc.)
Smart struct to transport an Any with an index to the appropriate property-name.
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
char const FIELD_SERVICE_JUMPEDIT[]
constexpr OUStringLiteral gsPropertyTargetFrame(u"TargetFrame")
Sequence< sal_Int8 > aSeq
static enum::xmloff::token::XMLTokenEnum MapBibliographyFieldName(std::u16string_view sName)
char const FIELD_SERVICE_SHEET_NAME[]
char const FIELD_SERVICE_DB_DISPLAY[]
static enum::xmloff::token::XMLTokenEnum MapDocInfoFieldName(enum FieldIdEnum nToken)
sal_Int32 dataStyleForceSystemLanguage(sal_Int32 nFormat) const
constexpr OUStringLiteral gsPropertyFileFormat(u"FileFormat")
static enum::xmloff::token::XMLTokenEnum MapPageNumberName(const css::uno::Reference< css::beans::XPropertySet > &xPropSet, sal_Int32 &nOffset)
static sal_Int8 GetInt8Property(const OUString &, const Reference< XPropertySet > &)
constexpr OUStringLiteral gsPropertyMeasureKind(u"Kind")
char const FIELD_SERVICE_DOC_INFO_EDIT_TIME[]
char const FIELD_SERVICE_GRAPHIC_COUNT[]
bool hasProperty(const OUString &_rName, const Reference< XPropertySet > &_rxSet)
char const FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME2[]
#define SAL_WARN(area, stream)
char const FIELD_SERVICE_DOC_INFO_DESCRIPTION2[]
void(* f)(TrueTypeTable *)
constexpr OUStringLiteral gsPropertyScriptType(u"ScriptType")
constexpr OUStringLiteral gsPropertyOn(u"On")
char const FIELD_SERVICE_PAGENUMBER[]
char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME2[]
void AddAttributeXmlId(css::uno::Reference< css::uno::XInterface > const &i_xIfc)
add xml:id attribute (for RDF metadata)
constexpr sal_uInt16 XML_NAMESPACE_META
constexpr OUStringLiteral gsPropertyItems(u"Items")
void ExportMacro(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &rContent)
element content
constexpr OUStringLiteral gsPropertyDataTableName(u"DataTableName")
char const FIELD_SERVICE_SENDER[]
virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat=false)
constexpr OUStringLiteral gsPropertyDataBaseURL(u"DataBaseURL")
constexpr OUStringLiteral gsPropertyUserText(u"UserText")
constexpr sal_uInt16 XML_NAMESPACE_OOOW
css::uno::Any const SvXMLExport & rExport
char const FIELD_SERVICE_INPUT[]
char const FIELD_SERVICE_URL[]
static enum FieldIdEnum MapFieldName(std::u16string_view sFieldName, const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
get field ID from XTextField service name (and it's PropertySet)
void ProcessIntegerDef(enum::xmloff::token::XMLTokenEnum eXmlName, sal_Int32 nNum, sal_Int32 nDefault)
attribute value
constexpr OUStringLiteral gsPropertyIsShowFormula(u"IsShowFormula")
constexpr OUStringLiteral gsServicePrefix(u"com.sun.star.text.textfield.")
constexpr OUStringLiteral gsPropertyIsAutomaticUpdate(u"IsAutomaticUpdate")
constexpr OUStringLiteral gsPropertyAuthor(u"Author")
constexpr OUStringLiteral gsPropertyIsFixedLanguage(u"IsFixedLanguage")
constexpr sal_uInt16 XML_NAMESPACE_STYLE
constexpr OUStringLiteral gsPropertySequenceNumber(u"SequenceNumber")
constexpr OUStringLiteral gsPropertyDDECommandFile(u"DDECommandFile")
constexpr OUStringLiteral gsPropertyIsDataBaseFormat(u"DataBaseFormat")
constexpr OUStringLiteral gsPropertyCharStyleNames(u"CharStyleNames")
constexpr OUStringLiteral gsPropertyIsFixed(u"IsFixed")
void Export(css::uno::Reference< css::document::XEventsSupplier > const &xAccess, bool bUseWhitespace=true)
export the events (calls EventExport::Export(Reference) )
static enum::xmloff::token::XMLTokenEnum MapAuthorFieldName(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
also adjust page offset
char const FIELD_SERVICE_DB_SELECT[]
static enum::xmloff::token::XMLTokenEnum MapPlaceholderType(sal_uInt16 nType)
map placeholder type
#define ENUM_STRING_MAP_ENTRY(name, tok)