LibreOffice Module xmloff (master) 1
txtflde.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
26#include <txtflde.hxx>
28#include <xmloff/families.hxx>
30#include <xmloff/numehelp.hxx>
31#include <xmloff/xmlement.hxx>
32#include <xmloff/xmlexp.hxx>
33#include <xmloff/xmltoken.hxx>
34#include <xmloff/xmluconv.hxx>
35#include <xmloff/maptype.hxx>
36
39#include <com/sun/star/frame/XModel.hpp>
40#include <com/sun/star/util/DateTime.hpp>
41#include <com/sun/star/lang/XServiceInfo.hpp>
42#include <com/sun/star/text/UserDataPart.hpp>
43#include <com/sun/star/text/PageNumberType.hpp>
44#include <com/sun/star/style/NumberingType.hpp>
45#include <com/sun/star/text/ReferenceFieldPart.hpp>
46#include <com/sun/star/text/ReferenceFieldSource.hpp>
47#include <com/sun/star/beans/XPropertySet.hpp>
48#include <com/sun/star/beans/XPropertyState.hpp>
49#include <com/sun/star/text/XTextField.hpp>
50#include <com/sun/star/text/XDependentTextField.hpp>
51#include <com/sun/star/text/XTextFieldsSupplier.hpp>
52
53#include <com/sun/star/text/SetVariableType.hpp>
54#include <com/sun/star/text/PlaceholderType.hpp>
55#include <com/sun/star/text/FilenameDisplayFormat.hpp>
56#include <com/sun/star/text/ChapterFormat.hpp>
57#include <com/sun/star/text/TemplateDisplayFormat.hpp>
58#include <com/sun/star/container/XNameReplace.hpp>
59#include <com/sun/star/uno/Sequence.h>
60#include <com/sun/star/text/BibliographyDataType.hpp>
61#include <com/sun/star/sdb/CommandType.hpp>
62#include <com/sun/star/rdf/XMetadatable.hpp>
64#include <o3tl/any.hxx>
65#include <o3tl/safeint.hxx>
66#include <rtl/ustrbuf.hxx>
67#include <tools/debug.hxx>
68#include <rtl/math.hxx>
69#include <sal/log.hxx>
70
71#include <vector>
72
73
74using namespace ::com::sun::star;
75using namespace ::com::sun::star::uno;
76using namespace ::com::sun::star::text;
77using namespace ::com::sun::star::lang;
78using namespace ::com::sun::star::beans;
79using namespace ::com::sun::star::util;
80using namespace ::com::sun::star::style;
81using namespace ::com::sun::star::document;
82using namespace ::com::sun::star::container;
83using namespace ::xmloff::token;
84
85
86char const FIELD_SERVICE_SENDER[] = "ExtendedUser";
87char const FIELD_SERVICE_AUTHOR[] = "Author";
88char const FIELD_SERVICE_JUMPEDIT[] = "JumpEdit";
89char const FIELD_SERVICE_GETEXP[] = "GetExpression";
90char const FIELD_SERVICE_SETEXP[] = "SetExpression";
91char const FIELD_SERVICE_USER[] = "User";
92char const FIELD_SERVICE_INPUT[] = "Input";
93char const FIELD_SERVICE_USERINPUT[] = "InputUser";
94char const FIELD_SERVICE_DATETIME[] = "DateTime";
95char const FIELD_SERVICE_PAGENUMBER[] = "PageNumber";
96char const FIELD_SERVICE_DB_NEXT[] = "DatabaseNextSet";
97char const FIELD_SERVICE_DB_SELECT[] = "DatabaseNumberOfSet";
98char const FIELD_SERVICE_DB_NUMBER[] = "DatabaseSetNumber";
99char const FIELD_SERVICE_DB_DISPLAY[] = "Database";
100char const FIELD_SERVICE_DB_NAME[] = "DatabaseName";
101char const FIELD_SERVICE_CONDITIONAL_TEXT[] = "ConditionalText";
102char const FIELD_SERVICE_HIDDEN_TEXT[] = "HiddenText";
103char const FIELD_SERVICE_HIDDEN_PARAGRAPH[] = "HiddenParagraph";
104char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR[] = "DocInfo.ChangeAuthor";
105char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR2[] = "docinfo.ChangeAuthor";
106char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME[] = "DocInfo.ChangeDateTime";
107char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME2[] = "docinfo.ChangeDateTime";
108char const FIELD_SERVICE_DOC_INFO_EDIT_TIME[] = "DocInfo.EditTime";
109char const FIELD_SERVICE_DOC_INFO_EDIT_TIME2[] = "docinfo.EditTime";
110char const FIELD_SERVICE_DOC_INFO_DESCRIPTION[] = "DocInfo.Description";
111char const FIELD_SERVICE_DOC_INFO_DESCRIPTION2[] = "docinfo.Description";
112char const FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR[] = "DocInfo.CreateAuthor";
113char const FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR2[] = "docinfo.CreateAuthor";
114char const FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME[] = "DocInfo.CreateDateTime";
115char const FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME2[] = "docinfo.CreateDateTime";
116char const FIELD_SERVICE_DOC_INFO_CUSTOM[] = "DocInfo.Custom";
117char const FIELD_SERVICE_DOC_INFO_CUSTOM2[] = "docinfo.Custom";
118char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR[] = "DocInfo.PrintAuthor";
119char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR2[] = "docinfo.PrintAuthor";
120char const FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME[] = "DocInfo.PrintDateTime";
121char const FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME2[] = "docinfo.PrintDateTime";
122char const FIELD_SERVICE_DOC_INFO_KEY_WORDS[] = "DocInfo.KeyWords";
123char const FIELD_SERVICE_DOC_INFO_KEY_WORDS2[] = "docinfo.KeyWords";
124char const FIELD_SERVICE_DOC_INFO_SUBJECT[] = "DocInfo.Subject";
125char const FIELD_SERVICE_DOC_INFO_SUBJECT2[] = "docinfo.Subject";
126char const FIELD_SERVICE_DOC_INFO_TITLE[] = "DocInfo.Title";
127char const FIELD_SERVICE_DOC_INFO_TITLE2[] = "docinfo.Title";
128char const FIELD_SERVICE_DOC_INFO_REVISION[] = "DocInfo.Revision";
129char const FIELD_SERVICE_DOC_INFO_REVISION2[] = "docinfo.Revision";
130char const FIELD_SERVICE_FILE_NAME[] = "FileName";
131char const FIELD_SERVICE_CHAPTER[] = "Chapter";
132char const FIELD_SERVICE_TEMPLATE_NAME[] = "TemplateName";
133char const FIELD_SERVICE_PAGE_COUNT[] = "PageCount";
134char const FIELD_SERVICE_PARAGRAPH_COUNT[] = "ParagraphCount";
135char const FIELD_SERVICE_WORD_COUNT[] = "WordCount";
136char const FIELD_SERVICE_CHARACTER_COUNT[] = "CharacterCount";
137char const FIELD_SERVICE_TABLE_COUNT[] = "TableCount";
138char const FIELD_SERVICE_GRAPHIC_COUNT[] = "GraphicObjectCount";
139char const FIELD_SERVICE_OBJECT_COUNT[] = "EmbeddedObjectCount";
140char const FIELD_SERVICE_REFERENCE_PAGE_SET[] = "ReferencePageSet";
141char const FIELD_SERVICE_REFERENCE_PAGE_GET[] = "ReferencePageGet";
142char const FIELD_SERVICE_SHEET_NAME[] = "SheetName";
143char const FIELD_SERVICE_PAGE_NAME[] = "PageName";
144char const FIELD_SERVICE_MACRO[] = "Macro";
145char const FIELD_SERVICE_GET_REFERENCE[] = "GetReference";
146char const FIELD_SERVICE_DDE[] = "DDE";
147char const FIELD_SERVICE_URL[] = "URL";
148char const FIELD_SERVICE_BIBLIOGRAPHY[] = "Bibliography";
149char const FIELD_SERVICE_SCRIPT[] = "Script";
150char const FIELD_SERVICE_ANNOTATION[] = "Annotation";
151char const FIELD_SERVICE_COMBINED_CHARACTERS[] = "CombinedCharacters";
152char const FIELD_SERVICE_META[] = "MetadataField";
153char const FIELD_SERVICE_MEASURE[] = "Measure";
154char const FIELD_SERVICE_TABLE_FORMULA[] = "TableFormula";
155char const FIELD_SERVICE_DROP_DOWN[] = "DropDown";
156
157namespace
158{
160uno::Reference<text::XText> GetToplevelText(const uno::Reference<text::XText>& xText)
161{
162 uno::Reference<text::XText> xRet = xText;
163 while (true)
164 {
165 uno::Reference<beans::XPropertySet> xPropertySet(xRet, uno::UNO_QUERY);
166 if (!xPropertySet.is())
167 return xRet;
168
169 if (!xPropertySet->getPropertySetInfo()->hasPropertyByName("ParentText"))
170 return xRet;
171
172 uno::Reference<text::XText> xParent;
173 if (xPropertySet->getPropertyValue("ParentText") >>= xParent)
174 xRet = xParent;
175 else
176 return xRet;
177 }
178 return xRet;
179}
180}
181
183{
196
201 // workaround for #no-bug#: Database/DataBase
204
231
235
239
247
251
253
256
259
260 // non-writer fields
265
266 // deprecated fields
269
270 { nullptr, 0, FieldIdEnum(0) }
271};
272
273
274// property accessor helper functions
275static bool GetBoolProperty(const OUString&,
276 const Reference<XPropertySet> &);
277static bool GetOptionalBoolProperty(const OUString&,
278 const Reference<XPropertySet> &,
279 const Reference<XPropertySetInfo> &,
280 bool bDefault);
281static double GetDoubleProperty(const OUString&,
282 const Reference<XPropertySet> &);
283static OUString GetStringProperty(const OUString&,
284 const Reference<XPropertySet> &);
285static sal_Int32 GetIntProperty(const OUString&,
286 const Reference<XPropertySet> &);
287static sal_Int16 GetInt16Property(const OUString&,
288 const Reference<XPropertySet> &);
289static sal_Int8 GetInt8Property(const OUString&,
290 const Reference<XPropertySet> &);
291static util::DateTime GetDateTimeProperty( const OUString& sPropName,
292 const Reference<XPropertySet> & xPropSet);
293static Sequence<OUString> GetStringSequenceProperty(
294 const OUString& sPropName,
295 const Reference<XPropertySet> & xPropSet);
296
297
298 // service names
299constexpr OUStringLiteral gsServicePrefix(u"com.sun.star.text.textfield.");
300constexpr OUStringLiteral gsFieldMasterPrefix(u"com.sun.star.text.FieldMaster.");
301constexpr OUStringLiteral gsPresentationServicePrefix(u"com.sun.star.presentation.TextField.");
302
303 // property names
304constexpr OUStringLiteral gsPropertyAdjust(u"Adjust");
305constexpr OUStringLiteral gsPropertyAuthor(u"Author");
306constexpr OUStringLiteral gsPropertyChapterFormat(u"ChapterFormat");
307constexpr OUStringLiteral gsPropertyChapterNumberingLevel(u"ChapterNumberingLevel");
308constexpr OUStringLiteral gsPropertyCharStyleNames(u"CharStyleNames");
309constexpr OUStringLiteral gsPropertyCondition(u"Condition");
310constexpr OUStringLiteral gsPropertyContent(u"Content");
311constexpr OUStringLiteral gsPropertyDataBaseName(u"DataBaseName");
312constexpr OUStringLiteral gsPropertyDataBaseURL(u"DataBaseURL");
313constexpr OUStringLiteral gsPropertyDataColumnName(u"DataColumnName");
314constexpr OUStringLiteral gsPropertyDataCommandType(u"DataCommandType");
315constexpr OUStringLiteral gsPropertyDataTableName(u"DataTableName");
316constexpr OUStringLiteral gsPropertyDateTime(u"DateTime");
317constexpr OUStringLiteral gsPropertyDateTimeValue(u"DateTimeValue");
318constexpr OUStringLiteral gsPropertyDDECommandElement(u"DDECommandElement");
319constexpr OUStringLiteral gsPropertyDDECommandFile(u"DDECommandFile");
320constexpr OUStringLiteral gsPropertyDDECommandType(u"DDECommandType");
321constexpr OUStringLiteral gsPropertyDependentTextFields(u"DependentTextFields");
322constexpr OUStringLiteral gsPropertyFalseContent(u"FalseContent");
323constexpr OUStringLiteral gsPropertyFields(u"Fields");
324constexpr OUStringLiteral gsPropertyFieldSubType(u"UserDataType");
325constexpr OUStringLiteral gsPropertyFileFormat(u"FileFormat");
326constexpr OUStringLiteral gsPropertyFullName(u"FullName");
327constexpr OUStringLiteral gsPropertyHint(u"Hint");
328constexpr OUStringLiteral gsPropertyInitials(u"Initials");
329constexpr OUStringLiteral gsPropertyInstanceName(u"InstanceName");
330constexpr OUStringLiteral gsPropertyIsAutomaticUpdate(u"IsAutomaticUpdate");
331constexpr OUStringLiteral gsPropertyIsConditionTrue(u"IsConditionTrue");
332constexpr OUStringLiteral gsPropertyIsDataBaseFormat(u"DataBaseFormat");
333constexpr OUStringLiteral gsPropertyIsDate(u"IsDate");
334constexpr OUStringLiteral gsPropertyIsExpression(u"IsExpression");
335constexpr OUStringLiteral gsPropertyIsFixed(u"IsFixed");
336constexpr OUStringLiteral gsPropertyIsFixedLanguage(u"IsFixedLanguage");
337constexpr OUStringLiteral gsPropertyIsHidden(u"IsHidden");
338constexpr OUStringLiteral gsPropertyIsInput(u"Input");
339constexpr OUStringLiteral gsPropertyIsShowFormula(u"IsShowFormula");
340constexpr OUStringLiteral gsPropertyIsVisible(u"IsVisible");
341constexpr OUStringLiteral gsPropertyItems(u"Items");
342constexpr OUStringLiteral gsPropertyLevel(u"Level");
343constexpr OUStringLiteral gsPropertyMeasureKind(u"Kind");
344constexpr OUStringLiteral gsPropertyName(u"Name");
345constexpr OUStringLiteral gsPropertyNumberFormat(u"NumberFormat");
346constexpr OUStringLiteral gsPropertyNumberingSeparator(u"NumberingSeparator");
347constexpr OUStringLiteral gsPropertyNumberingType(u"NumberingType");
348constexpr OUStringLiteral gsPropertyOffset(u"Offset");
349constexpr OUStringLiteral gsPropertyOn(u"On");
350constexpr OUStringLiteral gsPropertyPlaceholderType(u"PlaceHolderType");
351constexpr OUStringLiteral gsPropertyReferenceFieldPart(u"ReferenceFieldPart");
352constexpr OUStringLiteral gsPropertyReferenceFieldSource(u"ReferenceFieldSource");
353constexpr OUStringLiteral gsPropertyReferenceFieldLanguage(u"ReferenceFieldLanguage");
354constexpr OUStringLiteral gsPropertyScriptType(u"ScriptType");
355constexpr OUStringLiteral gsPropertySelectedItem(u"SelectedItem");
356constexpr OUStringLiteral gsPropertySequenceNumber(u"SequenceNumber");
357constexpr OUStringLiteral gsPropertySequenceValue(u"SequenceValue");
358constexpr OUStringLiteral gsPropertySetNumber(u"SetNumber");
359constexpr OUStringLiteral gsPropertySourceName(u"SourceName");
360constexpr OUStringLiteral gsPropertySubType(u"SubType");
361constexpr OUStringLiteral gsPropertyTargetFrame(u"TargetFrame");
362constexpr OUStringLiteral gsPropertyTrueContent(u"TrueContent");
363constexpr OUStringLiteral gsPropertyURL(u"URL");
364constexpr OUStringLiteral gsPropertyURLContent(u"URLContent");
365constexpr OUStringLiteral gsPropertyUserText(u"UserText");
366constexpr OUStringLiteral gsPropertyValue(u"Value");
367constexpr OUStringLiteral gsPropertyVariableName(u"VariableName");
368constexpr OUStringLiteral gsPropertyHelp(u"Help");
369constexpr OUStringLiteral gsPropertyTooltip(u"Tooltip");
370constexpr OUStringLiteral gsPropertyTextRange(u"TextRange");
371
373 std::unique_ptr<XMLPropertyState> pCombinedCharState)
374 : rExport(rExp),
375 pCombinedCharactersPropertyState(std::move(pCombinedCharState))
376{
378}
379
381{
382}
383
386 const Reference<XTextField> & rTextField,
387 const Reference<XPropertySet> & xPropSet)
388{
389 // get service names for rTextField (via XServiceInfo service)
390 Reference<XServiceInfo> xService(rTextField, UNO_QUERY);
391 const Sequence<OUString> aServices = xService->getSupportedServiceNames();
392
393 OUString sFieldName; // service name postfix of current field
394
395 // search for TextField service name
396 const OUString* pNames = std::find_if(aServices.begin(), aServices.end(),
397 [](const OUString& rName) { return rName.matchIgnoreAsciiCase(gsServicePrefix); });
398 if (pNames != aServices.end())
399 {
400 // TextField found => postfix is field type!
401 sFieldName = pNames->copy(gsServicePrefix.getLength());
402 }
403
404 // if this is not a normal text field, check if it's a presentation text field
405 if( sFieldName.isEmpty() )
406 {
407 // search for TextField service name
408 pNames = std::find_if(aServices.begin(), aServices.end(),
409 [](const OUString& rName) { return rName.startsWith(gsPresentationServicePrefix); });
410 if (pNames != aServices.end())
411 {
412 // TextField found => postfix is field type!
413 sFieldName = pNames->copy(gsPresentationServicePrefix.getLength());
414 }
415
416 if( !sFieldName.isEmpty() )
417 {
418 if( sFieldName == "Header" )
419 {
421 }
422 else if( sFieldName == "Footer" )
423 {
425 }
426 else if( sFieldName == "DateTime" )
427 {
429 }
430 }
431 }
432
433 // map postfix of service name to field ID
434 DBG_ASSERT(!sFieldName.isEmpty(), "no TextField service found!");
435 return MapFieldName(sFieldName, xPropSet);
436}
437
439 std::u16string_view sFieldName, // field (master) name
440 const Reference<XPropertySet> & xPropSet) // for subtype
441{
442 // we'll proceed in 2 steps:
443 // a) map service name to preliminary FIELD_ID
444 // b) map those prelim. FIELD_IDs that correspond to several field types
445 // (in our (XML) world) to final FIELD IDs
446
447
448 // a) find prelim. FIELD_ID via aFieldServiceMapping
449
450 // check for non-empty service name
451 DBG_ASSERT(!sFieldName.empty(), "no valid service name!");
453 if (!sFieldName.empty())
454 {
455 // map name to prelim. ID
457 nToken, sFieldName, aFieldServiceNameMapping);
458
459 // check return
460 DBG_ASSERT(bRet, "Unknown field service name encountered!");
461 }
462
463 // b) map prelim. to final FIELD_IDs
464 switch (nToken) {
466 if (GetBoolProperty(gsPropertyIsInput, xPropSet))
467 {
469 }
470 else
471 {
472 switch (GetIntProperty(gsPropertySubType, xPropSet))
473 {
474 case SetVariableType::STRING: // text field
475 case SetVariableType::VAR: // num field
477 break;
478 case SetVariableType::SEQUENCE:
480 break;
481 case SetVariableType::FORMULA:
482 default:
484 break;
485 }
486 }
487 break;
488
490 switch (GetIntProperty(gsPropertySubType, xPropSet))
491 {
492 case SetVariableType::STRING: // text field
493 case SetVariableType::VAR: // num field
495 break;
496 case SetVariableType::FORMULA:
498 break;
499 case SetVariableType::SEQUENCE:
500 default:
502 break;
503 }
504 break;
505
506 case FIELD_ID_TIME:
507 if (GetBoolProperty(gsPropertyIsDate, xPropSet))
508 {
510 }
511 break;
512
514 // NumberingType not available in non-Writer apps
515 if (xPropSet->getPropertySetInfo()->
516 hasPropertyByName(gsPropertyNumberingType))
517 {
518 if (NumberingType::CHAR_SPECIAL == GetIntProperty(
519 gsPropertyNumberingType, xPropSet))
520 {
522 }
523 }
524 break;
525
527 if (GetBoolProperty(gsPropertyIsDate, xPropSet))
528 {
530 }
531 break;
532
534 if (GetBoolProperty(gsPropertyIsDate, xPropSet))
535 {
537 }
538 break;
539
541 if (GetBoolProperty(gsPropertyIsDate, xPropSet))
542 {
544 }
545 break;
546
549 {
550 case ReferenceFieldSource::REFERENCE_MARK:
552 break;
553 case ReferenceFieldSource::SEQUENCE_FIELD:
555 break;
556 case ReferenceFieldSource::BOOKMARK:
558 break;
559 case ReferenceFieldSource::FOOTNOTE:
561 break;
562 case ReferenceFieldSource::ENDNOTE:
564 break;
565 default:
567 break;
568 }
569 break;
570
572 case FIELD_ID_SCRIPT:
575 case FIELD_ID_DDE:
576 case FIELD_ID_MACRO:
601 case FIELD_ID_AUTHOR:
602 case FIELD_ID_SENDER:
611 case FIELD_ID_CHAPTER:
613 case FIELD_ID_META:
616 case FIELD_ID_MEASURE:
617 case FIELD_ID_URL:
620 ; // these field IDs are final
621 break;
622
623 default:
625 }
626
627 // ... and return final FIELD_ID
628 return nToken;
629}
630
631// is string or numeric field?
633 FieldIdEnum nFieldType,
634 const Reference<XPropertySet> & xPropSet)
635{
636 switch (nFieldType) {
637
641 {
642 // depends on field sub type
643 return ( GetIntProperty(gsPropertySubType, xPropSet) ==
644 SetVariableType::STRING );
645 }
646
649 {
650 Reference<XTextField> xTextField(xPropSet, UNO_QUERY);
651 DBG_ASSERT(xTextField.is(), "field is no XTextField!");
653 GetMasterPropertySet(xTextField));
654 return !bRet;
655 }
656
657 case FIELD_ID_META:
658 return 0 > GetIntProperty(gsPropertyNumberFormat, xPropSet);
659
661 // TODO: depends on... ???
662 // workaround #no-bug#: no data type
663 return 5100 == GetIntProperty(gsPropertyNumberFormat, xPropSet);
664
666 // legacy field: always a number field (because it always has
667 // a number format)
668 return false;
669
688 case FIELD_ID_DATE:
689 case FIELD_ID_TIME:
694 // always number
695 return false;
696
699 case FIELD_ID_DDE:
705 case FIELD_ID_MACRO:
707 case FIELD_ID_CHAPTER:
721 case FIELD_ID_SENDER:
722 case FIELD_ID_AUTHOR:
726 case FIELD_ID_MEASURE:
727 case FIELD_ID_URL:
729 // always string:
730 return true;
731
732 case FIELD_ID_SCRIPT:
737 case FIELD_ID_UNKNOWN:
741 default:
742 OSL_FAIL("unknown field type/field has no content");
743 return true; // invalid info; string in case of doubt
744 }
745}
746
750 const Reference<XTextField> & rTextField, const bool bProgress,
751 const bool bRecursive )
752{
753 // get property set
754 Reference<XPropertySet> xPropSet(rTextField, UNO_QUERY);
755
756 // add field master to list of used field masters (if desired)
757 if (nullptr != pUsedMasters)
758 {
759 Reference<XDependentTextField> xDepField(rTextField, UNO_QUERY);
760 if (xDepField.is())
761 {
762 // The direct parent may be just the table cell, while we want the topmost parent, e.g.
763 // a header text.
764 Reference<XText> xOurText = GetToplevelText(rTextField->getAnchor()->getText());
765
766 std::map<Reference<XText>, std::set<OUString> >::iterator aMapIter =
767 pUsedMasters->find(xOurText);
768
769 // insert a list for our XText (if necessary)
770 if (aMapIter == pUsedMasters->end())
771 {
772 std::set<OUString> aSet;
773 (*pUsedMasters)[xOurText] = aSet;
774 aMapIter = pUsedMasters->find(xOurText);
775 }
776
777 // insert this text field master
778 OUString sFieldMasterName = GetStringProperty(
779 gsPropertyInstanceName, xDepField->getTextFieldMaster());
780 if (!sFieldMasterName.isEmpty())
781 aMapIter->second.insert( sFieldMasterName );
782 }
783 // else: no dependent field -> no master -> ignore
784 }
785
786 // get Field ID
787 FieldIdEnum nToken = GetFieldID(rTextField, xPropSet);
788
789 // export the character style for all fields
790 // with one exception: combined character fields export their own
791 // text style below
792 Reference <XPropertySet> xRangePropSet(rTextField->getAnchor(), UNO_QUERY);
794 {
796 XmlStyleFamily::TEXT_TEXT, xRangePropSet);
797 }
798
799 // process special styles for each field (e.g. data styles)
800 switch (nToken) {
801
803 {
804 sal_Int32 nFormat = GetIntProperty(gsPropertyNumberFormat, xPropSet);
805 // workaround: #no-bug#; see IsStringField(...)
806 if ( (5100 != nFormat) &&
808 {
809 GetExport().addDataStyle(nFormat);
810 }
811 break;
812 }
813
814 case FIELD_ID_DATE:
815 case FIELD_ID_TIME:
816 {
817 // date and time fields are always number fields, but the
818 // NumberFormat property is optional (e.g. Calc doesn't
819 // support it)
820 Reference<XPropertySetInfo> xPropSetInfo(
821 xPropSet->getPropertySetInfo() );
822 if ( xPropSetInfo->hasPropertyByName( gsPropertyNumberFormat ) )
823 {
824 sal_Int32 nFormat =
826
827 // nFormat may be -1 for numeric fields that display their
828 // variable name. (Maybe this should be a field type, then?)
829 if (nFormat != -1)
830 {
833 xPropSet, xPropSetInfo, false ) )
834 {
835 nFormat =
837 }
838
839 GetExport().addDataStyle( nFormat,
841 }
842 }
843 }
844 break;
845
846 case FIELD_ID_META:
847 // recurse into content (does not export element, so can be done first)
848 if (bRecursive)
849 {
850 bool dummy_for_autostyles(true);
851 ExportMetaField(xPropSet, true, bProgress, dummy_for_autostyles);
852 }
853 [[fallthrough]];
868 // register number format, if this is a numeric field
869 if (! IsStringField(nToken, xPropSet)) {
870
871 sal_Int32 nFormat =
873
874 // nFormat may be -1 for numeric fields that display their
875 // variable name. (Maybe this should be a field type, then?)
876 if (nFormat != -1)
877 {
878 // handle formats for fixed language fields
879 // for all these fields (except table formula)
880 if( ( nToken != FIELD_ID_TABLE_FORMULA ) &&
883 xPropSet, xPropSet->getPropertySetInfo(),
884 false ) )
885 {
886 nFormat =
888 }
889
890 GetExport().addDataStyle(nFormat);
891 }
892 }
893 break;
894
896 {
897 // export text style with the addition of the combined characters
899 "need proper PropertyState for combined characters");
902 XmlStyleFamily::TEXT_TEXT, xRangePropSet,
903 aStates);
904 break;
905 }
906
907 case FIELD_ID_SCRIPT:
910 case FIELD_ID_DDE:
916 case FIELD_ID_MACRO:
941 case FIELD_ID_AUTHOR:
942 case FIELD_ID_SENDER:
951 case FIELD_ID_CHAPTER:
954 case FIELD_ID_MEASURE:
955 case FIELD_ID_URL:
960 ; // no formats for these fields!
961 break;
962
963 case FIELD_ID_UNKNOWN:
964 default:
965 OSL_FAIL("unknown field type!");
966 // ignore -> no format for unknown
967 break;
968 }
969}
970
973 const Reference<XTextField> & rTextField, bool bProgress,
974 bool & rPrevCharIsSpace)
975{
976 // get property set
977 Reference<XPropertySet> xPropSet(rTextField, UNO_QUERY);
978
979 // get property set of range (for the attributes)
980 Reference <XPropertySet> xRangePropSet(rTextField->getAnchor(), UNO_QUERY);
981
982 // get Field ID
983 enum FieldIdEnum nToken = GetFieldID(rTextField, xPropSet);
984
985 // special treatment for combined characters field, because it is
986 // exported as a style
987 const XMLPropertyState* aStates[] = { pCombinedCharactersPropertyState.get(), nullptr };
988 const XMLPropertyState **pStates =
990 ? aStates
991 : nullptr;
992
993 // find out whether we need to set the style
994 bool bIsUICharStyle;
995 bool bHasAutoStyle;
996 OUString sStyle = GetExport().GetTextParagraphExport()->
997 FindTextStyle( xRangePropSet, bIsUICharStyle, bHasAutoStyle, pStates );
998 bool bHasStyle = !sStyle.isEmpty();
999
1000 {
1001 Reference<XPropertySetInfo> xRangePropSetInfo;
1002 XMLTextCharStyleNamesElementExport aCharStylesExport(
1003 GetExport(), bIsUICharStyle &&
1004 GetExport().GetTextParagraphExport()
1005 ->GetCharStyleNamesPropInfoCache().hasProperty(
1006 xRangePropSet, xRangePropSetInfo ), bHasAutoStyle,
1007 xRangePropSet, gsPropertyCharStyleNames );
1008
1009 // export span with style (if necessary)
1010 // (except for combined characters field)
1011 if( bHasStyle )
1012 {
1013 // export <text:span> element
1015 GetExport().EncodeStyleName( sStyle ) );
1016 }
1017 SvXMLElementExport aSpan( GetExport(), bHasStyle,
1019 false, false);
1020
1021 // finally, export the field itself
1022 ExportFieldHelper( rTextField, xPropSet, xRangePropSet, nToken,
1023 bProgress, rPrevCharIsSpace);
1024 }
1025}
1026
1029 const Reference<XTextField> & rTextField,
1030 const Reference<XPropertySet> & rPropSet,
1031 const Reference<XPropertySet> &,
1032 enum FieldIdEnum nToken,
1033 bool bProgress,
1034 bool & rPrevCharIsSpace)
1035{
1036 // get property set info (because some attributes are not support
1037 // in all implementations)
1038 Reference<XPropertySetInfo> xPropSetInfo(rPropSet->getPropertySetInfo());
1039
1040 OUString sPresentation = rTextField->getPresentation(false);
1041
1042 // process each field type
1043 switch (nToken) {
1044 case FIELD_ID_AUTHOR:
1045 // author field: fixed, field (sub-)type
1046 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1047 {
1050 }
1051 ExportElement(MapAuthorFieldName(rPropSet), sPresentation);
1052 break;
1053
1054 case FIELD_ID_SENDER:
1055 // sender field: fixed, field (sub-)type
1057 GetBoolProperty(gsPropertyIsFixed, rPropSet), true);
1058 ExportElement(MapSenderFieldName(rPropSet), sPresentation);
1059 break;
1060
1062 // placeholder field: type, name, description
1067 GetStringProperty(gsPropertyHint,rPropSet), true);
1068 ExportElement(XML_PLACEHOLDER, sPresentation);
1069 break;
1070
1072 {
1073 // variable set field: name, visible, format&value
1077 false);
1080 sPresentation);
1084 sPresentation,
1086 true, true, true,
1089 rPropSet, xPropSetInfo, false ) );
1090 ExportElement(XML_VARIABLE_SET, sPresentation);
1091 break;
1092 }
1094 {
1095 // variable get field: name, format&value
1098 bool bCmd = GetBoolProperty(gsPropertyIsShowFormula, rPropSet);
1099 ProcessDisplay(true, bCmd);
1100 // show style, unless name will be shown
1103 "", u"", 0.0, // values not used
1104 false,
1105 false,
1106 !bCmd,
1109 rPropSet, xPropSetInfo, false ) );
1110 ExportElement(XML_VARIABLE_GET, sPresentation);
1111 break;
1112 }
1114 // variable input field: name, description, format&value
1118 GetStringProperty(gsPropertyHint , rPropSet));
1120 false);
1123 sPresentation);
1127 sPresentation,
1129 true, true, true,
1132 rPropSet, xPropSetInfo, false ) );
1133 ExportElement(XML_VARIABLE_INPUT, sPresentation);
1134 break;
1135
1136 case FIELD_ID_USER_GET:
1137 // user field: name, hidden, style
1138 {
1139 bool bCmd = GetBoolProperty(gsPropertyIsShowFormula, rPropSet);
1141 bCmd);
1144 "", u"", 0.0, // values not used
1145 false, false, !bCmd,
1148 rPropSet, xPropSetInfo, false ) );
1149
1150 // name from FieldMaster
1153 GetMasterPropertySet(rTextField)));
1154 ExportElement(XML_USER_FIELD_GET, sPresentation);
1155 break;
1156 }
1157
1159 // user input field: name (from FieldMaster), description
1160// ProcessString(XML_NAME,
1161// GetStringProperty(sPropertyName,
1162// GetMasterPropertySet(rTextField)));
1167 ExportElement(XML_USER_FIELD_INPUT, sPresentation);
1168 break;
1169
1170 case FIELD_ID_SEQUENCE:
1171 {
1172 // sequence field: name, formula, seq-format
1173 OUString sName = GetStringProperty(gsPropertyVariableName, rPropSet);
1174 // TODO: use reference name only if actually being referenced.
1178 sName));
1182 sPresentation);
1184 rPropSet));
1185 ExportElement(XML_SEQUENCE, sPresentation);
1186 break;
1187 }
1188
1190 {
1191 // formula field: formula, format&value
1192 bool bCmd = GetBoolProperty(gsPropertyIsShowFormula, rPropSet);
1195 sPresentation);
1196 ProcessDisplay(true, bCmd);
1200 sPresentation,
1202 !bCmd, !bCmd, !bCmd,
1205 rPropSet, xPropSetInfo, false ) );
1206 ExportElement(XML_EXPRESSION, sPresentation);
1207 break;
1208 }
1209
1211 // text input field: description and string-value
1215 GetStringProperty(gsPropertyHelp, rPropSet), true);
1217 GetStringProperty(gsPropertyTooltip, rPropSet), true);
1218 ExportElement(XML_TEXT_INPUT, sPresentation);
1219 break;
1220
1221 case FIELD_ID_TIME:
1222 // all properties (except IsDate) are optional!
1223 if (xPropSetInfo->hasPropertyByName(gsPropertyNumberFormat))
1224 {
1225 ProcessValueAndType(false,
1227 "", u"", 0.0, // not used
1228 false, false, true,
1231 rPropSet, xPropSetInfo, false ),
1232 true);
1233 }
1234 if (xPropSetInfo->hasPropertyByName(gsPropertyDateTimeValue))
1235 {
1236 // no value -> current time
1239 rPropSet));
1240 }
1241 if (xPropSetInfo->hasPropertyByName(gsPropertyDateTime))
1242 {
1243 // no value -> current time
1246 }
1247 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1248 {
1251 false);
1252 }
1253 if (xPropSetInfo->hasPropertyByName(gsPropertyAdjust))
1254 {
1255 // adjust value given as integer in minutes
1258 false, true);
1259 }
1260 ExportElement(XML_TIME, sPresentation);
1261 break;
1262
1263 case FIELD_ID_DATE:
1264 // all properties (except IsDate) are optional!
1265 if (xPropSetInfo->hasPropertyByName(gsPropertyNumberFormat))
1266 {
1267 ProcessValueAndType(false,
1269 "", u"", 0.0, // not used
1270 false, false, true,
1273 rPropSet, xPropSetInfo, false ) );
1274 }
1275 if (xPropSetInfo->hasPropertyByName(gsPropertyDateTimeValue))
1276 {
1277 // no value -> current date
1280 rPropSet));
1281 }
1282 // TODO: remove double-handling after SRC614
1283 else if (xPropSetInfo->hasPropertyByName(gsPropertyDateTime))
1284 {
1287 }
1288 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1289 {
1292 false);
1293 }
1294 if (xPropSetInfo->hasPropertyByName(gsPropertyAdjust))
1295 {
1296 // adjust value given as number of days
1299 true, true);
1300 }
1301 ExportElement(XML_DATE, sPresentation);
1302 break;
1303
1305 // all properties are optional
1306 if (xPropSetInfo->hasPropertyByName(gsPropertyNumberingType))
1307 {
1309 rPropSet));
1310 }
1311 if (xPropSetInfo->hasPropertyByName(gsPropertyOffset))
1312 {
1313 sal_Int32 nAdjust = GetIntProperty(gsPropertyOffset, rPropSet);
1314
1315 if (xPropSetInfo->hasPropertyByName(gsPropertySubType))
1316 {
1317 // property SubType used in MapPageNumberName
1319 MapPageNumberName(rPropSet, nAdjust));
1320 }
1322 }
1323 ExportElement(XML_PAGE_NUMBER, sPresentation);
1324 break;
1325
1327 {
1330 sPresentation);
1331 sal_Int32 nDummy = 0; // MapPageNumberName need int
1333 ExportElement(XML_PAGE_CONTINUATION, sPresentation);
1334 break;
1335 }
1336
1342 false);
1344 rPropSet, xPropSetInfo);
1345 break;
1346
1356 false);
1358 rPropSet, xPropSetInfo);
1359 break;
1360
1367 DBG_ASSERT(sPresentation.isEmpty(),
1368 "Unexpected presentation for database next field");
1370 rPropSet, xPropSetInfo);
1371 break;
1372
1381 DBG_ASSERT(sPresentation.isEmpty(),
1382 "Unexpected presentation for database select field");
1384 rPropSet, xPropSetInfo);
1385 break;
1386
1388 {
1389 // get database, table and column name from field master
1390 const Reference<XPropertySet> & xMaster = GetMasterPropertySet(rTextField);
1396 // export number format if available (happens only for numbers!)
1398 {
1399 ProcessValueAndType(false, // doesn't happen for text
1401 "", u"", 0.0, // not used
1402 false, false, true, false);
1403 }
1405 false);
1407 xMaster, xMaster->getPropertySetInfo());
1408 break;
1409 }
1410
1413 GetBoolProperty(gsPropertyIsFixed, rPropSet), false);
1414 ExportElement(MapDocInfoFieldName(nToken), sPresentation);
1415 break;
1416
1424 ProcessValueAndType(false,
1426 "", u"", 0.0,
1427 false, false, true,
1430 rPropSet, xPropSetInfo, false ) );
1431
1432 // todo: export date/time value, but values not available -> core bug
1434 GetBoolProperty(gsPropertyIsFixed, rPropSet), false);
1435 ExportElement(MapDocInfoFieldName(nToken), sPresentation);
1436 break;
1437
1445 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1446 {
1448 GetBoolProperty(gsPropertyIsFixed, rPropSet), false);
1449 }
1450 ExportElement(MapDocInfoFieldName(nToken), sPresentation);
1451 break;
1452
1454 {
1455 ProcessValueAndType(false, // doesn't happen for text
1457 "", u"", 0.0, // not used
1458 false, false, true,
1461 rPropSet, xPropSetInfo, false ));
1462 uno::Any aAny = rPropSet->getPropertyValue( gsPropertyName );
1463 OUString sName;
1464 aAny >>= sName;
1467 ExportElement(XML_USER_DEFINED, sPresentation);
1468 break;
1469 }
1470
1478 // all properties optional (applies to pages only, but I'll do
1479 // it for all for sake of common implementation)
1480 if (xPropSetInfo->hasPropertyByName(gsPropertyNumberingType))
1481 {
1483 rPropSet));
1484 }
1485 ExportElement(MapCountFieldName(nToken), sPresentation);
1486 break;
1487
1497 false);
1498 ExportElement(XML_CONDITIONAL_TEXT, sPresentation);
1499 break;
1500
1508 false);
1509 ExportElement(XML_HIDDEN_TEXT, sPresentation);
1510 break;
1511
1517 false);
1518 DBG_ASSERT(sPresentation.isEmpty(),
1519 "Unexpected presentation for hidden paragraph field");
1521 break;
1522
1527 ExportElement(XML_TEMPLATE_NAME, sPresentation);
1528 break;
1529
1530 case FIELD_ID_CHAPTER:
1534 // API numbers 0..9, we number 1..10
1536 GetInt8Property(gsPropertyLevel, rPropSet) + 1);
1537 ExportElement(XML_CHAPTER, sPresentation);
1538 break;
1539
1540 case FIELD_ID_FILE_NAME:
1541 // all properties are optional
1542 if (xPropSetInfo->hasPropertyByName(gsPropertyFileFormat))
1543 {
1547 }
1548 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1549 {
1552 false);
1553 }
1554 ExportElement(XML_FILE_NAME, sPresentation);
1555 break;
1556
1559 GetBoolProperty(gsPropertyOn, rPropSet), true);
1561 GetInt16Property(gsPropertyOffset, rPropSet), 0);
1562 DBG_ASSERT(sPresentation.isEmpty(),
1563 "Unexpected presentation page variable field");
1565 break;
1566
1570 ExportElement(XML_PAGE_VARIABLE_GET, sPresentation);
1571 break;
1572
1573 case FIELD_ID_MACRO:
1574 ExportMacro( rPropSet, sPresentation );
1575 break;
1576
1578 // reference to sequence: format, name, find value (and element)
1579 // was: if (nSeqNumber != -1) ...
1582 gsPropertyReferenceFieldPart, rPropSet)),
1583 XML_TEMPLATE);
1588 if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) &&
1589 GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)
1590 {
1591 // export text:reference-language attribute, if not empty
1594 }
1598 sPresentation);
1599 break;
1600
1603 // reference to bookmarks, references: format, name (and element)
1606 gsPropertyReferenceFieldPart, rPropSet)),
1607 XML_TEMPLATE);
1610 if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) &&
1611 GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)
1612 {
1613 // export text:reference-language attribute, if not empty
1616 }
1620 sPresentation);
1621 break;
1622
1625 // reference to end-/footnote: format, generate name, (and element)
1630 gsPropertyReferenceFieldPart, rPropSet)),
1631 XML_TEMPLATE);
1634 gsPropertySequenceNumber, rPropSet)));
1635 if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) &&
1636 GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)
1637 {
1638 // export text:reference-language attribute, if not empty
1641 }
1645 sPresentation);
1646 break;
1647
1648 case FIELD_ID_DDE:
1649 // name from field master
1651
1653 GetMasterPropertySet(rTextField)));
1654 ExportElement(XML_DDE_CONNECTION, sPresentation);
1655 break;
1656
1658 // name of spreadsheet (Calc only)
1659 ExportElement(XML_SHEET_NAME, sPresentation);
1660 break;
1661
1662 case FIELD_ID_PAGENAME:
1663 {
1664 if (GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)
1665 {
1667 GetExport().Characters( sPresentation );
1668 }
1669 break;
1670 }
1671
1672 case FIELD_ID_URL:
1673 {
1674 // this field is a special case because it gets mapped onto a
1675 // hyperlink, rather than one of the regular text field.
1676 ProcessString(XML_HREF, GetExport().GetRelativeReference(GetStringProperty(gsPropertyURL, rPropSet)),
1677 false, XML_NAMESPACE_XLINK);
1680 true, XML_NAMESPACE_OFFICE);
1683 false, false);
1684 GetExport().Characters(sPresentation);
1685 break;
1686 }
1687
1689 {
1690 ProcessBibliographyData(rPropSet);
1691 ExportElement(XML_BIBLIOGRAPHY_MARK, sPresentation);
1692 break;
1693 }
1694
1695 case FIELD_ID_SCRIPT:
1698 true, XML_NAMESPACE_SCRIPT);
1699 DBG_ASSERT(sPresentation.isEmpty(),
1700 "Unexpected presentation for script field");
1702 {
1704 GetExport().GetRelativeReference(GetStringProperty(gsPropertyContent, rPropSet)),
1705 false, XML_NAMESPACE_XLINK);
1707 }
1708 else
1709 {
1712 }
1713 break;
1714
1716 {
1717 // check for empty presentation (just in case)
1718 DBG_ASSERT(sPresentation.isEmpty(),
1719 "Unexpected presentation for annotation field");
1720
1721 bool bRemovePersonalInfo = SvtSecurityOptions::IsOptionSet(
1723
1724 // annotation element + content
1725 OUString aName;
1726 rPropSet->getPropertyValue(gsPropertyName) >>= aName;
1727 if (!aName.isEmpty())
1728 {
1730 }
1732 if (eVersion & SvtSaveOptions::ODFSVER_EXTENDED)
1733 {
1734 bool b = GetBoolProperty("Resolved", rPropSet);
1735 OUString aResolvedText;
1736 OUStringBuffer aResolvedTextBuffer;
1737 ::sax::Converter::convertBool(aResolvedTextBuffer, b);
1738 aResolvedText = aResolvedTextBuffer.makeStringAndClear();
1739
1741 }
1743 XML_ANNOTATION, false, true);
1744
1745 // author
1746 OUString aAuthor( GetStringProperty(gsPropertyAuthor, rPropSet) );
1747 if( !aAuthor.isEmpty() )
1748 {
1750 XML_CREATOR, true,
1751 false );
1752 GetExport().Characters( bRemovePersonalInfo
1753 ? "Author" + OUString::number( rExport.GetInfoID(aAuthor) )
1754 : aAuthor );
1755 }
1756
1757 // date time
1758 util::DateTime aDate( GetDateTimeProperty(gsPropertyDateTimeValue, rPropSet) );
1759 if ( !bRemovePersonalInfo )
1760 {
1761 OUStringBuffer aBuffer;
1762 ::sax::Converter::convertDateTime(aBuffer, aDate, nullptr, true);
1764 XML_DATE, true,
1765 false );
1766 GetExport().Characters(aBuffer.makeStringAndClear());
1767 }
1768
1769 if (GetExport().getSaneDefaultVersion() > SvtSaveOptions::ODFSVER_012)
1770 {
1771 // initials
1772 OUString aInitials( GetStringProperty(gsPropertyInitials, rPropSet) );
1773 if( !aInitials.isEmpty() )
1774 {
1775 // ODF 1.3 OFFICE-3776 export meta:creator-initials for ODF 1.3
1776 SvXMLElementExport aCreatorElem( GetExport(),
1777 (SvtSaveOptions::ODFSVER_013 <= GetExport().getSaneDefaultVersion())
1780
1781 (SvtSaveOptions::ODFSVER_013 <= GetExport().getSaneDefaultVersion())
1784 true, false );
1785 GetExport().Characters( bRemovePersonalInfo
1786 ? OUString::number( rExport.GetInfoID(aInitials) )
1787 : aInitials);
1788 }
1789 }
1790
1791 css::uno::Reference < css::text::XText > xText;
1792 try
1793 {
1794 css::uno::Any aRet = rPropSet->getPropertyValue(gsPropertyTextRange);
1795 aRet >>= xText;
1796 }
1797 catch ( css::uno::Exception& )
1798 {}
1799
1800 if ( xText.is() )
1801 GetExport().GetTextParagraphExport()->exportText( xText );
1802 else
1804 break;
1805 }
1806
1808 {
1809 // The style with the combined characters attribute has
1810 // already been handled in the ExportField method. So all that
1811 // is left to do now is to export the characters.
1812 GetExport().Characters(sPresentation);
1813 break;
1814 }
1815
1816 case FIELD_ID_META:
1817 {
1818 ExportMetaField(rPropSet, false, bProgress, rPrevCharIsSpace);
1819 break;
1820 }
1821
1822 case FIELD_ID_MEASURE:
1823 {
1825 ExportElement( XML_MEASURE, sPresentation );
1826 break;
1827 }
1828
1832 ProcessDisplay( true,
1834 ProcessValueAndType( false,
1836 "", u"", 0.0f,
1837 false, false, true,
1838 false );
1839 ExportElement( XML_TABLE_FORMULA, sPresentation );
1840 break;
1841
1842 case FIELD_ID_DROP_DOWN:
1843 {
1844 // tdf#133555 don't export in strict ODF versions that don't have it
1845 if (GetExport().getSaneDefaultVersion() <= SvtSaveOptions::ODFSVER_012)
1846 {
1847 break;
1848 }
1851 GetStringProperty(gsPropertyHelp, rPropSet), true);
1853 GetStringProperty(gsPropertyTooltip, rPropSet), true);
1856 false, false );
1860
1861 GetExport().Characters( sPresentation );
1862 }
1863 break;
1864
1866 {
1868 }
1869 break;
1870
1872 {
1874 }
1875 break;
1876
1878 {
1880 }
1881 break;
1882
1883
1884 case FIELD_ID_UNKNOWN:
1885 default:
1886 OSL_FAIL("unknown field type encountered!");
1887 // always export content
1888 GetExport().Characters(sPresentation);
1889 }
1890}
1891
1892
1895{
1896 Reference<XText> xEmptyText;
1897 ExportFieldDeclarations(xEmptyText);
1898}
1899
1902 const Reference<XText> & rText )
1903{
1904 // store lists for decl elements
1905 std::vector<OUString> aVarName;
1906 std::vector<OUString> aUserName;
1907 std::vector<OUString> aSeqName;
1908 std::vector<OUString> aDdeName;
1909
1910 // get text fields supplier and field master name access
1911 Reference<XTextFieldsSupplier> xTextFieldsSupp(GetExport().GetModel(),
1912 UNO_QUERY);
1913 if( !xTextFieldsSupp.is() )
1914 return;
1915
1916 Reference<container::XNameAccess> xFieldMasterNameAccess =
1917 xTextFieldsSupp->getTextFieldMasters();
1918
1919 // where to get the text field masters from?
1920 // a) we get a specific XText: then use pUsedMasters
1921 // b) the XText is empty: then export all text fields
1922 Sequence<OUString> aFieldMasters;
1923 if (rText.is())
1924 {
1925 // export only used masters
1926 DBG_ASSERT(nullptr != pUsedMasters,
1927 "field masters must be recorded in order to be "
1928 "written out separately" );
1929 if (nullptr != pUsedMasters)
1930 {
1931 std::map<Reference<XText>, std::set<OUString> > ::iterator aMapIter =
1932 pUsedMasters->find(rText);
1933 if (aMapIter != pUsedMasters->end())
1934 {
1935 // found the set of used field masters
1936 aFieldMasters = comphelper::containerToSequence(aMapIter->second);
1937 pUsedMasters->erase(rText);
1938 }
1939 // else: XText not found -> ignore
1940 }
1941 // else: no field masters have been recorded -> ignore
1942 }
1943 else
1944 {
1945 // no XText: export all!
1946 aFieldMasters = xFieldMasterNameAccess->getElementNames();
1947 }
1948
1949 for(const OUString& sFieldMaster : std::as_const(aFieldMasters)) {
1950
1951 // workaround for #no-bug#
1952 if ( sFieldMaster.startsWithIgnoreAsciiCase(
1953 "com.sun.star.text.FieldMaster.DataBase.") )
1954 {
1955 continue;
1956 }
1957
1958
1959 OUString sFieldMasterType;
1960 OUString sVarName;
1961 ExplodeFieldMasterName(sFieldMaster, sFieldMasterType, sVarName);
1962
1963 // get XPropertySet of this field master
1964 Reference<XPropertySet> xPropSet;
1965 Any aAny = xFieldMasterNameAccess->getByName(sFieldMaster);
1966 aAny >>= xPropSet;
1967
1968 // save interesting field masters
1969 if (sFieldMasterType == FIELD_SERVICE_SETEXP)
1970 {
1971 sal_Int32 nType = GetIntProperty(gsPropertySubType, xPropSet);
1972
1973 // sequence or variable?
1974 if ( SetVariableType::SEQUENCE == nType )
1975 {
1976 aSeqName.push_back( sFieldMaster );
1977 }
1978 else
1979 {
1980 aVarName.push_back( sFieldMaster );
1981 }
1982 }
1983 else if (sFieldMasterType == FIELD_SERVICE_USER)
1984 {
1985 aUserName.push_back( sFieldMaster );
1986 }
1987 else if (sFieldMasterType == FIELD_SERVICE_DDE)
1988 {
1989 aDdeName.push_back( sFieldMaster );
1990 }
1991 else
1992 {
1993 ; // ignore
1994 }
1995 }
1996
1997 // now process fields:
1998
1999 // variable field masters:
2000 if ( !aVarName.empty() )
2001 {
2005 true, true );
2006
2007 for (const auto& sName : aVarName)
2008 {
2009 // get field master property set
2010 Reference<XPropertySet> xPropSet;
2011 Any aAny = xFieldMasterNameAccess->getByName(sName);
2012 aAny >>= xPropSet;
2013
2014 // field name and type
2015 OUString sFieldMasterType;
2016 OUString sVarName;
2017 ExplodeFieldMasterName(sName, sFieldMasterType, sVarName);
2018
2019 // determine string/numeric field
2020 bool bIsString = ( GetIntProperty(gsPropertySubType, xPropSet)
2021 == SetVariableType::STRING );
2022
2023 // get dependent field property set
2024 Reference<XPropertySet> xFieldPropSet;
2025 if (GetDependentFieldPropertySet(xPropSet, xFieldPropSet))
2026 {
2027 // process value and type.
2029 bIsString,
2030 GetIntProperty(gsPropertyNumberFormat, xFieldPropSet),
2031 "", u"", 0.0,
2032 false, true, false, false);
2033 }
2034 else
2035 {
2036 // If no dependent field is found, only string and
2037 // float types can be supported
2038
2039 // number format: 0 is default number format for 1st
2040 // language. should be: getDefaultNumberFormat(Locale)
2041 // from NumberFormats
2043 bIsString,
2044 0, "", u"", 0.0,
2045 false, true, false, false);
2046 }
2047
2048 ProcessString(XML_NAME, sVarName);
2050 }
2051 }
2052 // else: no declarations element
2053
2054 // sequence field masters:
2055 if ( !aSeqName.empty() )
2056 {
2060 true, true );
2061
2062 for (const auto& sName : aSeqName)
2063 {
2064 // get field master property set
2065 Reference<XPropertySet> xPropSet;
2066 Any aAny = xFieldMasterNameAccess->getByName(sName);
2067 aAny >>= xPropSet;
2068
2069 // field name and type
2070 OUString sFieldMasterType;
2071 OUString sVarName;
2072 ExplodeFieldMasterName(sName, sFieldMasterType, sVarName);
2073
2074 // outline level
2075 sal_Int32 nLevel = 1 + GetIntProperty(
2077 DBG_ASSERT(nLevel >= 0, "illegal outline level");
2078 DBG_ASSERT(nLevel < 127, "possible illegal outline level");
2080
2081 // separation character
2082 if (nLevel > 0) {
2084 gsPropertyNumberingSeparator, xPropSet));
2085 }
2086 ProcessString(XML_NAME, sVarName);
2088 }
2089 }
2090 // else: no declarations element
2091
2092 // user field masters:
2093 if ( !aUserName.empty() )
2094 {
2098 true, true );
2099
2100 for (const auto& sName : aUserName)
2101 {
2102 // get field master property set
2103 Reference<XPropertySet> xPropSet;
2104 Any aAny = xFieldMasterNameAccess->getByName(sName);
2105 aAny >>= xPropSet;
2106
2107 // field name and type
2108 OUString sFieldMasterType;
2109 OUString sVarName;
2110 ExplodeFieldMasterName(sName, sFieldMasterType, sVarName);
2111
2113 {
2114 // expression:
2116 false,
2117 0, "", u"",
2119 true,
2120 true,
2121 false,
2122 false);
2123 }
2124 else
2125 {
2126 // string: write regardless of default
2131 false, XML_NAMESPACE_OFFICE );
2132 }
2133 ProcessString(XML_NAME, sVarName);
2135 }
2136 }
2137 // else: no declarations element
2138
2139 // DDE field masters:
2140 if ( aDdeName.empty() )
2141 return;
2142
2146 true, true );
2147
2148 for (const auto& sName : aDdeName)
2149 {
2150 // get field master property set
2151 Reference<XPropertySet> xPropSet;
2152 Any aAny = xFieldMasterNameAccess->getByName(sName);
2153 aAny >>= xPropSet;
2154
2155 // check if this connection is being used by a field
2156 Reference<XPropertySet> xDummy;
2157 if (GetDependentFieldPropertySet(xPropSet, xDummy))
2158 {
2159
2162 false, XML_NAMESPACE_OFFICE);
2163
2164 // export elements; can't use ProcessString because
2165 // elements are in office namespace
2168 xPropSet),
2169 false, XML_NAMESPACE_OFFICE);
2172 xPropSet),
2173 false, XML_NAMESPACE_OFFICE);
2176 xPropSet),
2177 false, XML_NAMESPACE_OFFICE);
2178 bool bIsAutomaticUpdate = GetBoolProperty(
2179 gsPropertyIsAutomaticUpdate, xPropSet);
2180 if (bIsAutomaticUpdate)
2181 {
2184 XML_TRUE);
2185 }
2186
2188 }
2189 // else: no dependent field -> no export of field declaration
2190 }
2191 // else: no declarations element
2192}
2193
2195 bool bExportOnlyUsed)
2196{
2197 pUsedMasters.reset();
2198
2199 // create used masters set (if none is used)
2200 if (bExportOnlyUsed)
2201 pUsedMasters.reset( new std::map<Reference<XText>, std::set<OUString> > );
2202}
2203
2204void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName,
2205 bool bAddSpace)
2206{
2207 // can't call ExportElement(eElementName, const OUString&) with empty
2208 // string because xmlprinter only uses empty tags if no content
2209 // (not even empty content) was written.
2210
2211 DBG_ASSERT(XML_TOKEN_INVALID != eElementName, "invalid element name!");
2212 if (XML_TOKEN_INVALID != eElementName)
2213 {
2214 // Element
2216 eElementName, bAddSpace, bAddSpace );
2217 } // else: ignore
2218}
2219
2220void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName,
2221 const OUString& sContent)
2222{
2223 DBG_ASSERT(eElementName != XML_TOKEN_INVALID, "invalid element name!");
2224 if (eElementName != XML_TOKEN_INVALID)
2225 {
2226 // Element
2228 eElementName, false, false );
2229 // export content
2230 GetExport().Characters(sContent);
2231 } else {
2232 // always export content
2233 GetExport().Characters(sContent);
2234 }
2235}
2236
2238 const Reference<XPropertySet> & rPropSet,
2239 const OUString& rContent )
2240{
2241 // some strings we'll need
2242 OUString sEventType( "EventType" );
2243
2244
2245 // the description attribute
2248 rContent);
2249
2250 // the element
2252 XML_EXECUTE_MACRO, false, false );
2253
2254 // the <office:events>-macro:
2255
2256 // 1) build sequence of PropertyValues
2257 Sequence<PropertyValue> aSeq;
2258 OUString sName;
2259 rPropSet->getPropertyValue("ScriptURL") >>= sName;
2260
2261 // if the ScriptURL property is not empty then this is a Scripting
2262 // Framework URL, otherwise treat it as a Basic Macro
2263 if (!sName.isEmpty())
2264 {
2265 OUString sScript( "Script" );
2266 aSeq = Sequence<PropertyValue>
2267 {
2270 };
2271 }
2272 else
2273 {
2274 aSeq = Sequence<PropertyValue>
2275 {
2276 comphelper::makePropertyValue(sEventType, OUString("StarBasic")),
2277 comphelper::makePropertyValue("Library", rPropSet->getPropertyValue( "MacroLibrary" )),
2278 comphelper::makePropertyValue("MacroName", rPropSet->getPropertyValue( "MacroName" ))
2279 };
2280 }
2281
2282 // 2) export the sequence
2283 GetExport().GetEventExport().ExportSingleEvent( aSeq, "OnClick", false );
2284
2285 // and finally, the field presentation
2286 GetExport().Characters(rContent);
2287}
2288
2290 const Reference<XPropertySet> & i_xMeta,
2291 bool i_bAutoStyles, bool i_bProgress,
2292 bool & rPrevCharIsSpace)
2293{
2294 bool doExport(!i_bAutoStyles); // do not export element if autostyles
2295 // check version >= 1.2
2296 switch (GetExport().getSaneDefaultVersion()) {
2297 case SvtSaveOptions::ODFSVER_011: // fall through
2298 case SvtSaveOptions::ODFSVER_010: doExport = false; break;
2299 default: break;
2300 }
2301
2302 const Reference < XEnumerationAccess > xEA( i_xMeta, UNO_QUERY_THROW );
2303 const Reference < XEnumeration > xTextEnum( xEA->createEnumeration() );
2304
2305 if (doExport)
2306 {
2307 const Reference<rdf::XMetadatable> xMeta( i_xMeta, UNO_QUERY_THROW );
2308
2309 // style:data-style-name
2310 ProcessValueAndType(false,
2312 "", u"", 0.0, false, false, true,
2313 false );
2314
2315 // text:meta-field without xml:id is invalid
2316 xMeta->ensureMetadataReference();
2317
2318 // xml:id for RDF metadata
2320 }
2321
2322 SvXMLElementExport aElem( GetExport(), doExport,
2323 XML_NAMESPACE_TEXT, XML_META_FIELD, false, false );
2324
2325 // recurse to export content
2327 exportTextRangeEnumeration(xTextEnum, i_bAutoStyles, i_bProgress, rPrevCharIsSpace);
2328}
2329
2332 bool bIsString,
2333 sal_Int32 nFormatKey,
2334 const OUString& sContent,
2335 std::u16string_view sDefault,
2336 double fValue,
2337 bool bExportValue,
2338 bool bExportValueType,
2339 bool bExportStyle,
2340 bool bForceSystemLanguage,
2341 bool bTimeStyle) // exporting a time style?
2342{
2343 // String or number?
2344 if (bIsString)
2345 {
2346
2347 // string: attributes value-type=string, string-value=...
2348
2349 if (bExportValue || bExportValueType)
2350 {
2352 GetExport(), sContent, sDefault, bExportValue);
2353 }
2354
2355 }
2356 else
2357 {
2358
2359 // number: value-type=..., value...=..., data-style-name=...
2360
2361 DBG_ASSERT(bExportValueType || !bExportValue, "value w/o value type not supported!");
2362
2363 // take care of illegal formats
2364 // (shouldn't happen, but does if document is corrupted)
2365 if (-1 != nFormatKey)
2366 {
2367 if (bExportValue || bExportValueType)
2368 {
2371 GetExport(), nFormatKey, fValue, bExportValue);
2372 }
2373
2374 if (bExportStyle)
2375 {
2376 // don't export language (if desired)
2377 if( bForceSystemLanguage )
2378 nFormatKey =
2380
2381 OUString sDataStyleName =
2382 GetExport().getDataStyleName(nFormatKey, bTimeStyle);
2383 if( !sDataStyleName.isEmpty() )
2384 {
2387 sDataStyleName );
2388 } // else: ignore (no valid number format)
2389 } // else: ignore (no number format)
2390 }
2391 }
2392}
2393
2394
2397 bool bIsCommand)
2398{
2399 enum XMLTokenEnum eValue;
2400
2401 if (bIsVisible)
2402 {
2403 eValue = bIsCommand ? XML_FORMULA : XML_VALUE;
2404 }
2405 else
2406 {
2407 eValue = XML_NONE;
2408 }
2409
2410 // omit attribute if default
2411 if (eValue != XML_VALUE)
2412 {
2414 }
2415}
2416
2417
2420 bool bBool, bool bDefault)
2421{
2422 SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff.text", "invalid element token");
2423 if ( XML_TOKEN_INVALID == eName )
2424 return;
2425
2426 // write attribute (if different than default)
2427 // negate to force 0/1 values (and make sal_Bool comparable)
2428 if ((!bBool) != (!bDefault)) {
2430 (bBool ? XML_TRUE : XML_FALSE) );
2431 }
2432}
2433
2434
2437 const OUString& sValue,
2438 bool bOmitEmpty,
2439 sal_uInt16 nPrefix)
2440{
2441 SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff.text", "invalid element token");
2442 if ( XML_TOKEN_INVALID == eName )
2443 return;
2444
2445 // check for empty string, if applicable
2446 if ( bOmitEmpty && sValue.isEmpty() )
2447 return;
2448
2449 // write attribute
2450 GetExport().AddAttribute(nPrefix, eName, sValue);
2451}
2452
2454 sal_uInt16 nValuePrefix,
2455 const OUString& sValue)
2456{
2457 OUString sQValue =
2458 GetExport().GetNamespaceMap().GetQNameByKey( nValuePrefix, sValue, false );
2459 ProcessString( eName, sQValue );
2460}
2461
2464 const OUString& sValue,
2465 std::u16string_view sDefault)
2466{
2467 if (sValue != sDefault)
2468 {
2469 ProcessString(eName, sValue);
2470 }
2471}
2472
2475 sal_uInt16 nValuePrefix,
2476 const OUString& sValue,
2477 std::u16string_view sDefault)
2478{
2479 if (sValue != sDefault)
2480 {
2481 ProcessString(eName, nValuePrefix, sValue);
2482 }
2483}
2484
2485
2488 enum XMLTokenEnum eName,
2489 enum XMLTokenEnum eValue,
2490 sal_uInt16 nPrefix)
2491{
2492 SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff.text", "invalid element token" );
2493 SAL_WARN_IF( eValue == XML_TOKEN_INVALID, "xmloff.text", "invalid value token" );
2494 if ( XML_TOKEN_INVALID == eName )
2495 return;
2496
2497 GetExport().AddAttribute(nPrefix, eName, eValue);
2498}
2499
2502 enum XMLTokenEnum eName,
2503 enum XMLTokenEnum eValue,
2504 enum XMLTokenEnum eDefault)
2505{
2506 if ( eValue != eDefault )
2507 ProcessString( eName, eValue);
2508}
2509
2510
2513 std::u16string_view sParagraphSequence)
2514{
2515 // iterate over all string-pieces separated by return (0x0a) and
2516 // put each inside a paragraph element.
2517 SvXMLTokenEnumerator aEnumerator(sParagraphSequence, char(0x0a));
2518 std::u16string_view aSubString;
2519 while (aEnumerator.getNextToken(aSubString))
2520 {
2521 SvXMLElementExport aParagraph(
2522 GetExport(), XML_NAMESPACE_TEXT, XML_P, true, false);
2523 GetExport().Characters(OUString(aSubString));
2524 }
2525}
2526
2527// export an integer attribute
2529 sal_Int32 nNum)
2530{
2531 SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff.text", "invalid element token");
2532 if ( XML_TOKEN_INVALID == eName )
2533 return;
2534
2536 OUString::number(nNum));
2537}
2538
2541 sal_Int32 nNum, sal_Int32 nDefault)
2542{
2543 if (nNum != nDefault)
2544 ProcessInteger(eName, nNum);
2545}
2546
2547
2549void XMLTextFieldExport::ProcessNumberingType(sal_Int16 nNumberingType)
2550{
2551 // process only if real format (not: like page descriptor)
2552 if (NumberingType::PAGE_DESCRIPTOR == nNumberingType)
2553 return;
2554
2555 OUStringBuffer sTmp( 10 );
2556 // number type: num format
2558 nNumberingType );
2560 sTmp.makeStringAndClear() );
2561 // and letter sync, if applicable
2562 SvXMLUnitConverter::convertNumLetterSync( sTmp, nNumberingType );
2563
2564 if (!sTmp.isEmpty())
2565 {
2567 sTmp.makeStringAndClear() );
2568 }
2569 // else: like page descriptor => ignore
2570}
2571
2572
2575 double dValue,
2576 bool bIsDate,
2577 bool bIsDuration,
2578 bool bOmitDurationIfZero,
2579 sal_uInt16 nPrefix)
2580{
2581 // truncate for date granularity
2582 if (bIsDate)
2583 {
2584 dValue = ::rtl::math::approxFloor(dValue);
2585 }
2586
2587 OUStringBuffer aBuffer;
2588 if (bIsDuration)
2589 {
2590 // date/time duration handle bOmitDurationIfZero
2591 if (!bOmitDurationIfZero || dValue != 0.0)
2592 {
2593 ::sax::Converter::convertDuration(aBuffer, dValue);
2594 }
2595 }
2596 else
2597 {
2598 // date/time value
2600 }
2601
2602 // output attribute
2603 ProcessString(eName, aBuffer.makeStringAndClear(), true, nPrefix);
2604}
2605
2608 const util::DateTime& rTime)
2609{
2610 OUStringBuffer aBuffer;
2611
2612 util::DateTime aDateTime(rTime);
2613
2614 // date/time value
2615 ::sax::Converter::convertDateTime(aBuffer, aDateTime, nullptr);
2616
2617 // output attribute
2618 ProcessString(eName, aBuffer.makeStringAndClear(), true);
2619}
2620
2623 sal_Int32 nMinutes,
2624 bool bIsDate,
2625 bool bIsDuration)
2626{
2627 // handle bOmitDurationIfZero here, because we can precisely compare ints
2628 if (!(bIsDuration && (nMinutes==0)))
2629 {
2630 ProcessDateTime(eName, static_cast<double>(nMinutes) / double(24*60),
2631 bIsDate, bIsDuration);
2632 }
2633}
2634
2637 const util::DateTime& rTime)
2638{
2639 OUStringBuffer aBuffer;
2640
2641 // date/time value
2643
2644 // output attribute
2645 ProcessString(eName, aBuffer.makeStringAndClear(), true);
2646}
2647
2648
2650{
2651 { XML_ARTICLE, BibliographyDataType::ARTICLE },
2652 { XML_BOOK, BibliographyDataType::BOOK },
2653 { XML_BOOKLET, BibliographyDataType::BOOKLET },
2654 { XML_CONFERENCE, BibliographyDataType::CONFERENCE },
2655 { XML_CUSTOM1, BibliographyDataType::CUSTOM1 },
2656 { XML_CUSTOM2, BibliographyDataType::CUSTOM2 },
2657 { XML_CUSTOM3, BibliographyDataType::CUSTOM3 },
2658 { XML_CUSTOM4, BibliographyDataType::CUSTOM4 },
2659 { XML_CUSTOM5, BibliographyDataType::CUSTOM5 },
2660 { XML_EMAIL, BibliographyDataType::EMAIL },
2661 { XML_INBOOK, BibliographyDataType::INBOOK },
2662 { XML_INCOLLECTION, BibliographyDataType::INCOLLECTION },
2663 { XML_INPROCEEDINGS, BibliographyDataType::INPROCEEDINGS },
2664 { XML_JOURNAL, BibliographyDataType::JOURNAL },
2665 { XML_MANUAL, BibliographyDataType::MANUAL },
2666 { XML_MASTERSTHESIS, BibliographyDataType::MASTERSTHESIS },
2667 { XML_MISC, BibliographyDataType::MISC },
2668 { XML_PHDTHESIS, BibliographyDataType::PHDTHESIS },
2669 { XML_PROCEEDINGS, BibliographyDataType::PROCEEDINGS },
2670 { XML_TECHREPORT, BibliographyDataType::TECHREPORT },
2671 { XML_UNPUBLISHED, BibliographyDataType::UNPUBLISHED },
2672 { XML_WWW, BibliographyDataType::WWW },
2673 { XML_TOKEN_INVALID, 0 }
2674};
2675
2676
2678 const Reference<XPropertySet>& rPropSet)
2679{
2680 // get the values
2681 Any aAny = rPropSet->getPropertyValue(gsPropertyFields);
2682 Sequence<PropertyValue> aValues;
2683 aAny >>= aValues;
2684
2685 // one attribute per value (unless empty)
2686 for (const auto& rProp : std::as_const(aValues))
2687 {
2688 if( rProp.Name == "BibiliographicType" )
2689 {
2690 sal_Int16 nTypeId = 0;
2691 rProp.Value >>= nTypeId;
2692 OUStringBuffer sBuf;
2693
2694 if (SvXMLUnitConverter::convertEnum(sBuf, nTypeId,
2696 {
2699 sBuf.makeStringAndClear());
2700 }
2701 // else: ignore this argument
2702 }
2703 else
2704 {
2705 OUString sStr;
2706 rProp.Value >>= sStr;
2707
2708 if (!sStr.isEmpty())
2709 {
2710 XMLTokenEnum eElement = MapBibliographyFieldName(rProp.Name);
2711 if (eElement == XML_URL || eElement == XML_LOCAL_URL || eElement == XML_TARGET_URL)
2712 {
2713 sStr = GetExport().GetRelativeReference(sStr);
2714 }
2715 sal_uInt16 nPrefix = XML_NAMESPACE_TEXT;
2716 if (eElement == XML_LOCAL_URL || eElement == XML_TARGET_TYPE
2717 || eElement == XML_TARGET_URL)
2718 {
2719 nPrefix = XML_NAMESPACE_LO_EXT;
2720 }
2721 rExport.AddAttribute(nPrefix, eElement, sStr);
2722 }
2723 }
2724 }
2725}
2726
2729 sal_Int32 nCommandType)
2730{
2732 switch( nCommandType )
2733 {
2734 case sdb::CommandType::TABLE: eToken = XML_TABLE; break;
2735 case sdb::CommandType::QUERY: eToken = XML_QUERY; break;
2736 case sdb::CommandType::COMMAND: eToken = XML_COMMAND; break;
2737 }
2738
2739 if( eToken != XML_TOKEN_INVALID )
2741}
2742
2743
2745 const Sequence<OUString>& rSequence,
2746 const OUString& sSelected )
2747{
2748 // find selected element
2749 sal_Int32 nSelected = comphelper::findValue(rSequence, sSelected);
2750
2751 // delegate to ProcessStringSequence(OUString,sal_Int32)
2752 ProcessStringSequence( rSequence, nSelected );
2753}
2754
2756 const Sequence<OUString>& rSequence,
2757 sal_Int32 nSelected )
2758{
2759 sal_Int32 nLength = rSequence.getLength();
2760 const OUString* pSequence = rSequence.getConstArray();
2761 for( sal_Int32 i = 0; i < nLength; i++ )
2762 {
2763 if( i == nSelected )
2768 false, false );
2769 }
2770}
2771
2773 enum XMLTokenEnum eElementName,
2774 const OUString& sPresentation,
2775 const Reference<XPropertySet>& rPropertySet,
2776 const Reference<XPropertySetInfo>& rPropertySetInfo )
2777{
2778 SAL_WARN_IF( eElementName == XML_TOKEN_INVALID, "xmloff.text", "need token" );
2779 SAL_WARN_IF( !rPropertySet.is(), "xmloff.text", "need property set" );
2780 SAL_WARN_IF( !rPropertySetInfo.is(), "xmloff.text", "need property set info" );
2781
2782 // get database properties
2783 OUString sDataBaseName;
2784 OUString sDataBaseURL;
2785 OUString sStr;
2786 if( ( rPropertySet->getPropertyValue( gsPropertyDataBaseName ) >>= sStr )
2787 && !sStr.isEmpty() )
2788 {
2789 sDataBaseName = sStr;
2790 }
2791 else if( rPropertySetInfo->hasPropertyByName( gsPropertyDataBaseURL ) &&
2792 (rPropertySet->getPropertyValue( gsPropertyDataBaseURL ) >>= sStr) &&
2793 !sStr.isEmpty() )
2794 {
2795 sDataBaseURL = sStr;
2796 }
2797
2798 // add database name property (if present)
2799 if( !sDataBaseName.isEmpty() )
2801 sDataBaseName );
2802 SvXMLElementExport aDataBaseElement( GetExport(),
2803 XML_NAMESPACE_TEXT, eElementName,
2804 false, false );
2805
2806 // write URL as children
2807 if( !sDataBaseURL.isEmpty() )
2808 {
2810 SvXMLElementExport aDataSourceElement(
2812 false, false );
2813 }
2814
2815 // write presentation
2816 rExport.Characters( sPresentation );
2817}
2818
2819
2820// explode a field master name into field type and field name
2822 std::u16string_view sMasterName, OUString& sFieldType, OUString& sVarName)
2823{
2824 sal_Int32 nLength = gsFieldMasterPrefix.getLength();
2825 size_t nSeparator = sMasterName.find('.', nLength);
2826
2827 // '.' found?
2828 if (nSeparator == o3tl::make_unsigned(nLength) || nSeparator == std::u16string_view::npos) {
2829 SAL_WARN("xmloff.text", "no field var name!");
2830 }
2831 else
2832 {
2833 sFieldType = sMasterName.substr(nLength, nSeparator-nLength);
2834 sVarName = sMasterName.substr(nSeparator+1);
2835 }
2836}
2837
2838
2839// for XDependentTextFields, get PropertySet of FieldMaster
2841 const Reference<XTextField> & rTextField)
2842{
2843 // name, value => get Property set of TextFieldMaster
2844 Reference<XDependentTextField> xDep(rTextField, UNO_QUERY);
2845 return xDep->getTextFieldMaster();
2846}
2847
2848// get PropertySet of (any; the first) dependent field
2850 const Reference<XPropertySet> & xMaster,
2851 Reference<XPropertySet> & xField)
2852{
2853 Any aAny;
2854 Sequence<Reference<XDependentTextField> > aFields;
2855 aAny = xMaster->getPropertyValue(gsPropertyDependentTextFields);
2856 aAny >>= aFields;
2857
2858 // any fields?
2859 if (aFields.hasElements())
2860 {
2861 // get first one and return
2862 Reference<XDependentTextField> xTField = aFields[0];
2863 xField.set(xTField, UNO_QUERY);
2864 DBG_ASSERT(xField.is(),
2865 "Surprisingly, this TextField refuses to be a PropertySet!");
2866 return true;
2867 }
2868 else
2869 {
2870 return false;
2871 }
2872}
2873
2874
2877{
2879
2880 switch (nType)
2881 {
2882 case PlaceholderType::TEXT:
2883 eType = XML_TEXT;
2884 break;
2885
2886 case PlaceholderType::TABLE:
2887 eType = XML_TABLE;
2888 break;
2889
2890 case PlaceholderType::TEXTFRAME:
2892 break;
2893
2894 case PlaceholderType::GRAPHIC:
2895 eType = XML_IMAGE;
2896 break;
2897
2898 case PlaceholderType::OBJECT:
2899 eType = XML_OBJECT;
2900 break;
2901
2902 default:
2903 // unknown placeholder: XML_TEXT
2904 OSL_FAIL("unknown placeholder type");
2905 }
2906
2907 return eType;
2908}
2909
2910
2913 const Reference<XPropertySet> & xPropSet)
2914{
2915 // Initials or full name?
2916 return GetBoolProperty(gsPropertyFullName, xPropSet)
2918}
2919
2921 const Reference<XPropertySet> & xPropSet,
2922 sal_Int32& nOffset)
2923{
2924 enum XMLTokenEnum eName = XML_TOKEN_INVALID;
2925 PageNumberType ePage;
2926 Any aAny = xPropSet->getPropertyValue(gsPropertySubType);
2927 ePage = *o3tl::doAccess<PageNumberType>(aAny);
2928
2929 switch (ePage)
2930 {
2931 case PageNumberType_PREV:
2932 eName = XML_PREVIOUS;
2933 nOffset += 1;
2934 break;
2935 case PageNumberType_CURRENT:
2936 eName = XML_CURRENT;
2937 break;
2938 case PageNumberType_NEXT:
2939 eName = XML_NEXT;
2940 nOffset -= 1;
2941 break;
2942 default:
2943 OSL_FAIL("unknown page number type");
2944 eName = XML_TOKEN_INVALID;
2945 break;
2946 }
2947
2948 return eName;
2949}
2950
2953{
2954 enum XMLTokenEnum eName = XML_TOKEN_INVALID;
2955
2956 switch (nFormat)
2957 {
2958 case TemplateDisplayFormat::FULL:
2959 eName = XML_FULL;
2960 break;
2961 case TemplateDisplayFormat::PATH:
2962 eName = XML_PATH;
2963 break;
2964 case TemplateDisplayFormat::NAME:
2965 eName = XML_NAME;
2966 break;
2967 case TemplateDisplayFormat::NAME_AND_EXT:
2968 eName = XML_NAME_AND_EXTENSION;
2969 break;
2970 case TemplateDisplayFormat::AREA:
2971 eName = XML_AREA;
2972 break;
2973 case TemplateDisplayFormat::TITLE:
2974 eName = XML_TITLE;
2975 break;
2976 default:
2977 OSL_FAIL("unknown template display format");
2978 eName = XML_TOKEN_INVALID;
2979 break;
2980 }
2981
2982 return eName;
2983}
2984
2987{
2988 enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
2989
2990 switch (nToken)
2991 {
2993 eElement = XML_PAGE_COUNT;
2994 break;
2996 eElement = XML_PARAGRAPH_COUNT;
2997 break;
2999 eElement = XML_WORD_COUNT;
3000 break;
3002 eElement = XML_CHARACTER_COUNT;
3003 break;
3005 eElement = XML_TABLE_COUNT;
3006 break;
3008 eElement = XML_IMAGE_COUNT;
3009 break;
3011 eElement = XML_OBJECT_COUNT;
3012 break;
3013 default:
3014 OSL_FAIL("no count field token");
3015 eElement = XML_TOKEN_INVALID;
3016 break;
3017 }
3018
3019 return eElement;
3020}
3021
3024{
3025 enum XMLTokenEnum eName = XML_TOKEN_INVALID;
3026
3027 switch (nFormat)
3028 {
3029 case ChapterFormat::NAME:
3030 eName = XML_NAME;
3031 break;
3032 case ChapterFormat::NUMBER:
3033 eName = XML_NUMBER;
3034 break;
3035 case ChapterFormat::NAME_NUMBER:
3036 eName = XML_NUMBER_AND_NAME;
3037 break;
3038 case ChapterFormat::NO_PREFIX_SUFFIX:
3040 break;
3041 case ChapterFormat::DIGIT:
3042 eName = XML_PLAIN_NUMBER;
3043 break;
3044 default:
3045 OSL_FAIL("unknown chapter display format");
3046 eName = XML_TOKEN_INVALID;
3047 break;
3048 }
3049
3050 return eName;
3051}
3052
3053
3056{
3057 enum XMLTokenEnum eName = XML_TOKEN_INVALID;
3058
3059 switch (nFormat)
3060 {
3061 case FilenameDisplayFormat::FULL:
3062 eName = XML_FULL;
3063 break;
3064 case FilenameDisplayFormat::PATH:
3065 eName = XML_PATH;
3066 break;
3067 case FilenameDisplayFormat::NAME:
3068 eName = XML_NAME;
3069 break;
3070 case FilenameDisplayFormat::NAME_AND_EXT:
3071 eName = XML_NAME_AND_EXTENSION;
3072 break;
3073 default:
3074 OSL_FAIL("unknown filename display format");
3075 }
3076
3077 return eName;
3078}
3079
3080
3083{
3084 enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
3085
3086 switch (nType)
3087 {
3088 case ReferenceFieldPart::PAGE:
3089 eElement = XML_PAGE;
3090 break;
3091 case ReferenceFieldPart::CHAPTER:
3092 eElement = XML_CHAPTER;
3093 break;
3094 case ReferenceFieldPart::TEXT:
3095 eElement = XML_TEXT;
3096 break;
3097 case ReferenceFieldPart::UP_DOWN:
3098 eElement = XML_DIRECTION;
3099 break;
3100 case ReferenceFieldPart::CATEGORY_AND_NUMBER:
3101 eElement = XML_CATEGORY_AND_VALUE;
3102 break;
3103 case ReferenceFieldPart::ONLY_CAPTION:
3104 eElement = XML_CAPTION;
3105 break;
3106 case ReferenceFieldPart::ONLY_SEQUENCE_NUMBER:
3107 eElement = XML_VALUE;
3108 break;
3109 case ReferenceFieldPart::PAGE_DESC:
3110 // small hack: this value never gets written, because
3111 // XML_TEMPLATE is default
3112 eElement = XML_TEMPLATE;
3113 break;
3114 // Core implementation for direct cross-references (#i81002#)
3115 case ReferenceFieldPart::NUMBER:
3116 eElement = XML_NUMBER;
3117 break;
3118 case ReferenceFieldPart::NUMBER_NO_CONTEXT:
3119 eElement = XML_NUMBER_NO_SUPERIOR;
3120 break;
3121 case ReferenceFieldPart::NUMBER_FULL_CONTEXT:
3122 eElement = XML_NUMBER_ALL_SUPERIOR;
3123 break;
3124 default:
3125 OSL_FAIL("unknown reference type");
3126 eElement = XML_TEMPLATE;
3127 break;
3128 }
3129
3130 return eElement;
3131}
3132
3135{
3136 enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
3137
3138 switch (nType)
3139 {
3140 case ReferenceFieldSource::REFERENCE_MARK:
3141 eElement = XML_REFERENCE_REF;
3142 break;
3143 case ReferenceFieldSource::SEQUENCE_FIELD:
3144 eElement = XML_SEQUENCE_REF;
3145 break;
3146 case ReferenceFieldSource::BOOKMARK:
3147 eElement = XML_BOOKMARK_REF;
3148 break;
3149 case ReferenceFieldSource::FOOTNOTE:
3150 case ReferenceFieldSource::ENDNOTE:
3151 eElement = XML_NOTE_REF;
3152 break;
3153 default:
3154 OSL_FAIL("unknown reference source");
3155 break;
3156 }
3157
3158 return eElement;
3159}
3160
3161
3164 const Reference<XPropertySet> & xPropSet)
3165{
3166 enum XMLTokenEnum eName = XML_TOKEN_INVALID;
3167
3168 // sub-field type
3169 switch (GetInt16Property(gsPropertyFieldSubType, xPropSet))
3170 {
3171 case UserDataPart::COMPANY :
3172 eName = XML_SENDER_COMPANY;
3173 break;
3174 case UserDataPart::FIRSTNAME :
3175 eName = XML_SENDER_FIRSTNAME;
3176 break;
3177 case UserDataPart::NAME :
3178 eName = XML_SENDER_LASTNAME;
3179 break;
3180 case UserDataPart::SHORTCUT :
3181 eName = XML_SENDER_INITIALS;
3182 break;
3183 case UserDataPart::STREET :
3184 eName = XML_SENDER_STREET;
3185 break;
3186 case UserDataPart::COUNTRY :
3187 eName = XML_SENDER_COUNTRY;
3188 break;
3189 case UserDataPart::ZIP :
3190 eName = XML_SENDER_POSTAL_CODE;
3191 break;
3192 case UserDataPart::CITY :
3193 eName = XML_SENDER_CITY;
3194 break;
3195 case UserDataPart::TITLE :
3196 eName = XML_SENDER_TITLE;
3197 break;
3198 case UserDataPart::POSITION :
3199 eName = XML_SENDER_POSITION;
3200 break;
3201 case UserDataPart::PHONE_PRIVATE :
3203 break;
3204 case UserDataPart::PHONE_COMPANY :
3205 eName = XML_SENDER_PHONE_WORK;
3206 break;
3207 case UserDataPart::FAX :
3208 eName = XML_SENDER_FAX;
3209 break;
3210 case UserDataPart::EMAIL :
3211 eName = XML_SENDER_EMAIL;
3212 break;
3213 case UserDataPart::STATE :
3215 break;
3216 default:
3217 SAL_WARN("xmloff.text", "unknown sender type");
3218 eName = XML_TOKEN_INVALID;
3219 break;
3220 }
3221
3222 return eName;
3223}
3224
3226 enum FieldIdEnum nToken)
3227{
3228 enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
3229
3230 switch (nToken)
3231 {
3233 eElement = XML_INITIAL_CREATOR;
3234 break;
3236 eElement = XML_CREATION_DATE;
3237 break;
3239 eElement = XML_CREATION_TIME;
3240 break;
3242 eElement = XML_DESCRIPTION;
3243 break;
3245 eElement = XML_PRINT_TIME;
3246 break;
3248 eElement = XML_PRINT_DATE;
3249 break;
3251 eElement = XML_PRINTED_BY;
3252 break;
3254 eElement = XML_TITLE;
3255 break;
3257 eElement = XML_SUBJECT;
3258 break;
3260 eElement = XML_KEYWORDS;
3261 break;
3263 eElement = XML_EDITING_CYCLES;
3264 break;
3266 eElement = XML_EDITING_DURATION;
3267 break;
3269 eElement = XML_MODIFICATION_TIME;
3270 break;
3272 eElement = XML_MODIFICATION_DATE;
3273 break;
3275 eElement = XML_CREATOR;
3276 break;
3277 default:
3278 SAL_WARN("xmloff.text", "unknown docinfo field type!");
3279 eElement = XML_TOKEN_INVALID;
3280 break;
3281 }
3282
3283 return eElement;
3284}
3285
3287{
3288 enum XMLTokenEnum eName = XML_TOKEN_INVALID;
3289
3290 if( sName == u"Identifier" )
3291 {
3292 eName = XML_IDENTIFIER;
3293 }
3294 else if( sName == u"BibiliographicType" )
3295 {
3296 eName = XML_BIBLIOGRAPHY_TYPE;
3297 }
3298 else if( sName == u"Address" )
3299 {
3300 eName = XML_ADDRESS;
3301 }
3302 else if( sName == u"Annote" )
3303 {
3304 eName = XML_ANNOTE;
3305 }
3306 else if( sName == u"Author" )
3307 {
3308 eName = XML_AUTHOR;
3309 }
3310 else if( sName == u"Booktitle" )
3311 {
3312 eName = XML_BOOKTITLE;
3313 }
3314 else if( sName == u"Chapter" )
3315 {
3316 eName = XML_CHAPTER;
3317 }
3318 else if( sName == u"Edition" )
3319 {
3320 eName = XML_EDITION;
3321 }
3322 else if( sName == u"Editor" )
3323 {
3324 eName = XML_EDITOR;
3325 }
3326 else if( sName == u"Howpublished" )
3327 {
3328 eName = XML_HOWPUBLISHED;
3329 }
3330 else if( sName == u"Institution" )
3331 {
3332 eName = XML_INSTITUTION;
3333 }
3334 else if( sName == u"Journal" )
3335 {
3336 eName = XML_JOURNAL;
3337 }
3338 else if( sName == u"Month" )
3339 {
3340 eName = XML_MONTH;
3341 }
3342 else if( sName == u"Note" )
3343 {
3344 eName = XML_NOTE;
3345 }
3346 else if( sName == u"Number" )
3347 {
3348 eName = XML_NUMBER;
3349 }
3350 else if( sName == u"Organizations" )
3351 {
3352 eName = XML_ORGANIZATIONS;
3353 }
3354 else if( sName == u"Pages" )
3355 {
3356 eName = XML_PAGES;
3357 }
3358 else if( sName == u"Publisher" )
3359 {
3360 eName = XML_PUBLISHER;
3361 }
3362 else if( sName == u"School" )
3363 {
3364 eName = XML_SCHOOL;
3365 }
3366 else if( sName == u"Series" )
3367 {
3368 eName = XML_SERIES;
3369 }
3370 else if( sName == u"Title" )
3371 {
3372 eName = XML_TITLE;
3373 }
3374 else if( sName == u"Report_Type" )
3375 {
3376 eName = XML_REPORT_TYPE;
3377 }
3378 else if( sName == u"Volume" )
3379 {
3380 eName = XML_VOLUME;
3381 }
3382 else if( sName == u"Year" )
3383 {
3384 eName = XML_YEAR;
3385 }
3386 else if( sName == u"URL" )
3387 {
3388 eName = XML_URL;
3389 }
3390 else if( sName == u"Custom1" )
3391 {
3392 eName = XML_CUSTOM1;
3393 }
3394 else if( sName == u"Custom2" )
3395 {
3396 eName = XML_CUSTOM2;
3397 }
3398 else if( sName == u"Custom3" )
3399 {
3400 eName = XML_CUSTOM3;
3401 }
3402 else if( sName == u"Custom4" )
3403 {
3404 eName = XML_CUSTOM4;
3405 }
3406 else if( sName == u"Custom5" )
3407 {
3408 eName = XML_CUSTOM5;
3409 }
3410 else if( sName == u"ISBN" )
3411 {
3412 eName = XML_ISBN;
3413 }
3414 else if (sName == u"LocalURL")
3415 {
3416 eName = XML_LOCAL_URL;
3417 }
3418 else if (sName == u"TargetType")
3419 {
3420 eName = XML_TARGET_TYPE;
3421 }
3422 else if (sName == u"TargetURL")
3423 {
3424 eName = XML_TARGET_URL;
3425 }
3426 else
3427 {
3428 SAL_WARN("xmloff.text", "Unknown bibliography info data");
3429 eName = XML_TOKEN_INVALID;
3430 }
3431
3432 return eName;
3433}
3434
3436{
3437 switch( nKind )
3438 {
3439 case 0:
3440 return XML_VALUE;
3441 case 1:
3442 return XML_UNIT;
3443 }
3444 return XML_GAP;
3445}
3446
3448 sal_Int16 nSeqNo)
3449{
3450 // generate foot-/endnote ID
3451 return "ftn" + OUString::number(static_cast<sal_Int32>(nSeqNo));
3452}
3453
3455 sal_Int16 nSeqNo,
3456 std::u16string_view rSeqName)
3457{
3458 // generate foot-/endnote ID
3459 return OUString::Concat("ref") +rSeqName + OUString::number(static_cast<sal_Int32>(nSeqNo));
3460}
3461
3462
3463// Property accessor helper functions
3464
3465
3466// to be relegated (does that word exist?) to a more appropriate place
3467
3468
3470 const OUString& sPropName,
3471 const Reference<XPropertySet> & xPropSet)
3472{
3473 Any aAny = xPropSet->getPropertyValue(sPropName);
3474 bool bBool = *o3tl::doAccess<bool>(aAny);
3475 return bBool;
3476}
3477
3479 const OUString& sPropName,
3480 const Reference<XPropertySet> & xPropSet,
3481 const Reference<XPropertySetInfo> & xPropSetInfo,
3482 bool bDefault)
3483{
3484 return xPropSetInfo->hasPropertyByName( sPropName )
3485 ? GetBoolProperty( sPropName, xPropSet ) : bDefault;
3486}
3487
3489 const OUString& sPropName,
3490 const Reference<XPropertySet> & xPropSet)
3491{
3492 Any aAny = xPropSet->getPropertyValue(sPropName);
3493 double fDouble = 0.0;
3494 aAny >>= fDouble;
3495 return fDouble;
3496}
3497
3499 const OUString& sPropName,
3500 const Reference<XPropertySet> & xPropSet)
3501{
3502 Any aAny = xPropSet->getPropertyValue(sPropName);
3503 OUString sString;
3504 aAny >>= sString;
3505 return sString;
3506}
3507
3509 const OUString& sPropName,
3510 const Reference<XPropertySet> & xPropSet)
3511{
3512 Any aAny = xPropSet->getPropertyValue(sPropName);
3513 sal_Int32 nInt = 0;
3514 aAny >>= nInt;
3515 return nInt;
3516}
3517
3519 const OUString& sPropName,
3520 const Reference<XPropertySet> & xPropSet)
3521{
3522 Any aAny = xPropSet->getPropertyValue(sPropName);
3523 sal_Int16 nInt = 0;
3524 aAny >>= nInt;
3525 return nInt;
3526}
3527
3529 const OUString& sPropName,
3530 const Reference<XPropertySet> & xPropSet)
3531{
3532 Any aAny = xPropSet->getPropertyValue(sPropName);
3533 sal_Int8 nInt = 0;
3534 aAny >>= nInt;
3535 return nInt;
3536}
3537
3538util::DateTime GetDateTimeProperty(
3539 const OUString& sPropName,
3540 const Reference<XPropertySet> & xPropSet)
3541{
3542 Any aAny = xPropSet->getPropertyValue(sPropName);
3543 util::DateTime aTime;
3544 aAny >>= aTime;
3545 return aTime;
3546}
3547
3548Sequence<OUString> GetStringSequenceProperty(
3549 const OUString& sPropName,
3550 const Reference<XPropertySet> & xPropSet)
3551{
3552 Any aAny = xPropSet->getPropertyValue(sPropName);
3553 Sequence<OUString> aSequence;
3554 aAny >>= aSequence;
3555 return aSequence;
3556}
3557
3558/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SvXMLNamespaceMap & GetNamespaceMap() const
Definition: xmlexp.hxx:385
OUString GetRelativeReference(const OUString &rValue)
Definition: xmlexp.cxx:2057
void AddAttributeXmlId(css::uno::Reference< css::uno::XInterface > const &i_xIfc)
add xml:id attribute (for RDF metadata)
Definition: xmlexp.cxx:2290
XMLEventExport & GetEventExport()
get Event export, with handlers for script types "None" and "StarBasic" already registered; other han...
Definition: xmlexp.cxx:1989
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
Definition: xmlexp.hxx:557
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
Definition: xmlexp.cxx:907
void Characters(const OUString &rChars)
Definition: xmlexp.cxx:2126
sal_Int32 dataStyleForceSystemLanguage(sal_Int32 nFormat) const
Definition: xmlexp.cxx:1832
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat=false) const
Definition: xmlexp.cxx:1820
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
Definition: xmlexp.cxx:2264
virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat=false)
Definition: xmlexp.cxx:1799
const SvXMLUnitConverter & GetMM100UnitConverter() const
Definition: xmlexp.hxx:391
size_t GetInfoID(const OUString sPersonalInfo) const
Definition: xmlexp.hxx:388
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
bool getNextToken(std::u16string_view &rToken)
Definition: xmluconv.cxx:529
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...
Definition: xmluconv.hxx:145
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
Definition: xmluconv.cxx:655
void convertDateTime(OUStringBuffer &rBuffer, const double &fDateTime, bool const bAddTimeIf0AM=false)
convert double to ISO Date Time String
Definition: xmluconv.cxx:377
static void convertNumLetterSync(OUStringBuffer &rBuffer, sal_Int16 nType)
Definition: xmluconv.cxx:752
void ExportSingleEvent(const css::uno::Sequence< css::beans::PropertyValue > &rEventValues, const OUString &rApiEventName, bool bUseWhitespace=true)
export a single event (writes <office:events> element)
static void SetNumberFormatAttributes(SvXMLExport &rXMLExport, const sal_Int32 nNumberFormat, const double &rValue, bool bExportValue=true)
Definition: numehelp.cxx:273
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?
static enum::xmloff::token::XMLTokenEnum MapSenderFieldName(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
element name for sender fields
Definition: txtflde.cxx:3163
void ProcessTimeOrDateTime(enum ::xmloff::token::XMLTokenEnum eXMLName, const css::util::DateTime &rTime)
date/time value
Definition: txtflde.cxx:2636
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?
Definition: txtflde.cxx:2331
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)
Definition: txtflde.hxx:157
static enum::xmloff::token::XMLTokenEnum MapCountFieldName(FieldIdEnum nToken)
map count/statistics field token to XML name
Definition: txtflde.cxx:2986
void ProcessString(enum ::xmloff::token::XMLTokenEnum eXmlName, const OUString &sValue, bool bOmitEmpty=false, sal_uInt16 nPrefix=XML_NAMESPACE_TEXT)
default value
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.
Definition: txtflde.cxx:972
XMLTextFieldExport(SvXMLExport &rExp, std::unique_ptr< XMLPropertyState > pCombinedCharState)
Definition: txtflde.cxx:372
static OUString MakeSequenceRefName(sal_Int16 nSeqNo, std::u16string_view rSeqName)
make reference name for a sequence field
Definition: txtflde.cxx:3454
void ProcessIntegerDef(enum ::xmloff::token::XMLTokenEnum eXmlName, sal_Int32 nNum, sal_Int32 nDefault)
attribute value
Definition: txtflde.cxx:2540
static enum::xmloff::token::XMLTokenEnum MapDocInfoFieldName(enum FieldIdEnum nToken)
Definition: txtflde.cxx:3225
void SetExportOnlyUsedFieldDeclarations(bool bExportOnlyUsed=true)
export all field declarations, or only those that have been used? Calling this method will reset the ...
Definition: txtflde.cxx:2194
void ExportElement(enum ::xmloff::token::XMLTokenEnum eElement, bool bAddSpace=false)
export an empty element
static enum::xmloff::token::XMLTokenEnum MapPlaceholderType(sal_uInt16 nType)
map placeholder type
Definition: txtflde.cxx:2876
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
Definition: txtflde.cxx:2849
static OUString MakeFootnoteRefName(sal_Int16 nSeqNo)
out: variable name
Definition: txtflde.cxx:3447
void ProcessStringSequence(const css::uno::Sequence< OUString > &rSequence, const OUString &sSelected)
css::sdb::CommandType
static enum::xmloff::token::XMLTokenEnum MapChapterDisplayFormat(sal_Int16 nType)
map ChapterDisplayFormat to XML string
Definition: txtflde.cxx:3023
static enum::xmloff::token::XMLTokenEnum MapPageNumberName(const css::uno::Reference< css::beans::XPropertySet > &xPropSet, sal_Int32 &nOffset)
Definition: txtflde.cxx:2920
void ProcessInteger(enum ::xmloff::token::XMLTokenEnum eXmlName, sal_Int32 nNum)
attribute default; omit, if attribute differs
Definition: txtflde.cxx:2528
void ExportFieldDeclarations()
export field declarations.
Definition: txtflde.cxx:1894
void ProcessBibliographyData(const css::uno::Reference< css::beans::XPropertySet > &rPropertySet)
date/time value
Definition: txtflde.cxx:2677
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
Definition: txtflde.cxx:2772
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)
Definition: txtflde.cxx:438
static enum::xmloff::token::XMLTokenEnum MapReferenceType(sal_Int16 nType)
map ReferenceFieldPart to XML string
Definition: txtflde.cxx:3082
static enum::xmloff::token::XMLTokenEnum MapBibliographyFieldName(std::u16string_view sName)
Definition: txtflde.cxx:3286
static enum::xmloff::token::XMLTokenEnum MapFilenameDisplayFormat(sal_Int16 nType)
map FilenameDisplayFormat to XML attribute names
Definition: txtflde.cxx:3055
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)
Definition: txtflde.cxx:2289
static enum::xmloff::token::XMLTokenEnum MapReferenceSource(sal_Int16 nType)
map ReferenceFieldPart to XML string
Definition: txtflde.cxx:3134
std::unique_ptr< XMLPropertyState > pCombinedCharactersPropertyState
Definition: txtflde.hxx:409
SvXMLExport & rExport
Definition: txtflde.hxx:151
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)
Definition: txtflde.cxx:385
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).
Definition: txtflde.cxx:749
static bool IsStringField(FieldIdEnum nFieldType, const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
determine, whether field has string or numeric content
Definition: txtflde.cxx:632
void ProcessCommandType(sal_Int32 nCommandType)
export CommandTypeAttribute
Definition: txtflde.cxx:2728
static enum::xmloff::token::XMLTokenEnum MapTemplateDisplayFormat(sal_Int16 nType)
map TemplateDisplayFormat to XML
Definition: txtflde.cxx:2952
static enum::xmloff::token::XMLTokenEnum MapAuthorFieldName(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
also adjust page offset
Definition: txtflde.cxx:2912
static enum::xmloff::token::XMLTokenEnum MapMeasureKind(sal_Int16 nKind)
Definition: txtflde.cxx:3435
static void ExplodeFieldMasterName(std::u16string_view sMasterName, OUString &sFieldType, OUString &sVarName)
explode a field master name into field type and field name
Definition: txtflde.cxx:2821
void ProcessParagraphSequence(std::u16string_view sParagraphSequence)
default value token
Definition: txtflde.cxx:2512
void ProcessNumberingType(sal_Int16 nNumberingType)
export a numbering format (numeric, roman, alphabetic, etc.)
Definition: txtflde.cxx:2549
void ExportMacro(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &rContent)
element content
Definition: txtflde.cxx:2237
static css::uno::Reference< css::beans::XPropertySet > GetMasterPropertySet(const css::uno::Reference< css::text::XTextField > &rTextField)
for XDependentTextFields, get PropertySet of FieldMaster
Definition: txtflde.cxx:2840
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 <text:span> is already written
Definition: txtflde.cxx:1028
void ProcessDisplay(bool bIsVisible, bool bIsCommand)
numbering type key
Definition: txtflde.cxx:2396
SvXMLExport & GetExport()
Definition: txtflde.hxx:212
void ProcessBoolean(enum ::xmloff::token::XMLTokenEnum eXmlName, bool bBool, bool bDefault)
export a boolean attribute
Definition: txtflde.cxx:2419
static void convertDateTime(OUStringBuffer &rBuffer, const css::util::DateTime &rDateTime, sal_Int16 const *pTimeZoneOffset, bool bAddTimeIf0AM=false)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
static void convertTimeOrDateTime(OUStringBuffer &rBuffer, const css::util::DateTime &rDateTime)
static bool convertBool(bool &rBool, std::u16string_view rString)
#define DBG_ASSERT(sCon, aError)
float u
DocumentType eType
OUString sName
OUString aName
Sequence< sal_Int8 > aSeq
sal_Int16 nAdjust
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
bool IsOptionSet(EOption eOption)
bool hasProperty(const OUString &_rName, const Reference< XPropertySet > &_rxSet)
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
int i
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:50
@ XML_NAME_AND_EXTENSION
Definition: xmltoken.hxx:1371
@ XML_SEPARATION_CHARACTER
Definition: xmltoken.hxx:1718
@ XML_REFERENCE_LANGUAGE
Definition: xmltoken.hxx:3458
@ XML_SENDER_PHONE_PRIVATE
Definition: xmltoken.hxx:1710
@ XML_STRING_VALUE_IF_TRUE
Definition: xmltoken.hxx:1875
@ XML_AUTOMATIC_UPDATE
Definition: xmltoken.hxx:304
@ XML_BIBLIOGRAPHY_MARK
Definition: xmltoken.hxx:331
@ XML_DDE_CONNECTION_DECL
Definition: xmltoken.hxx:637
@ XML_CONDITIONAL_TEXT
Definition: xmltoken.hxx:487
@ XML_DATABASE_ROW_SELECT
Definition: xmltoken.hxx:2747
@ XML_SENDER_POSTAL_CODE
Definition: xmltoken.hxx:1713
@ XML_DATABASE_ROW_NUMBER
Definition: xmltoken.hxx:617
@ XML_CATEGORY_AND_VALUE
Definition: xmltoken.hxx:406
@ XML_NUMBER_NO_SUPERIOR
Definition: xmltoken.hxx:3286
@ XML_PLAIN_NUMBER_AND_NAME
Definition: xmltoken.hxx:1527
@ XML_EDITING_DURATION
Definition: xmltoken.hxx:731
@ XML_CONNECTION_RESOURCE
Definition: xmltoken.hxx:2380
@ XML_BIBLIOGRAPHY_TYPE
Definition: xmltoken.hxx:333
@ XML_DDE_CONNECTION_DECLS
Definition: xmltoken.hxx:638
@ XML_NUMBER_ALL_SUPERIOR
Definition: xmltoken.hxx:3287
@ XML_DISPLAY_OUTLINE_LEVEL
Definition: xmltoken.hxx:691
@ XML_DATABASE_DISPLAY
Definition: xmltoken.hxx:612
@ XML_SENDER_STATE_OR_PROVINCE
Definition: xmltoken.hxx:1714
@ XML_STRING_VALUE_IF_FALSE
Definition: xmltoken.hxx:1874
DefTokenId nToken
QPRO_FUNC_TYPE nType
Map a const char* (with length) to a sal_uInt16 value.
Definition: xmlement.hxx:71
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:140
constexpr OUStringLiteral gsPropertyNumberingSeparator(u"NumberingSeparator")
constexpr OUStringLiteral gsPropertyDateTime(u"DateTime")
constexpr OUStringLiteral gsPropertyOffset(u"Offset")
char const FIELD_SERVICE_USERINPUT[]
Definition: txtflde.cxx:93
constexpr OUStringLiteral gsPropertyPlaceholderType(u"PlaceHolderType")
constexpr OUStringLiteral gsPropertyDateTimeValue(u"DateTimeValue")
constexpr OUStringLiteral gsPropertyDataBaseURL(u"DataBaseURL")
char const FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR2[]
Definition: txtflde.cxx:113
static bool GetOptionalBoolProperty(const OUString &, const Reference< XPropertySet > &, const Reference< XPropertySetInfo > &, bool bDefault)
Definition: txtflde.cxx:3478
constexpr OUStringLiteral gsPropertyDDECommandFile(u"DDECommandFile")
constexpr OUStringLiteral gsPropertyIsExpression(u"IsExpression")
char const FIELD_SERVICE_MACRO[]
Definition: txtflde.cxx:144
char const FIELD_SERVICE_DDE[]
Definition: txtflde.cxx:146
char const FIELD_SERVICE_META[]
Definition: txtflde.cxx:152
char const FIELD_SERVICE_COMBINED_CHARACTERS[]
Definition: txtflde.cxx:151
constexpr OUStringLiteral gsPresentationServicePrefix(u"com.sun.star.presentation.TextField.")
constexpr OUStringLiteral gsPropertyLevel(u"Level")
char const FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME[]
Definition: txtflde.cxx:120
char const FIELD_SERVICE_DOC_INFO_REVISION2[]
Definition: txtflde.cxx:129
constexpr OUStringLiteral gsPropertyTooltip(u"Tooltip")
char const FIELD_SERVICE_ANNOTATION[]
Definition: txtflde.cxx:150
char const FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR[]
Definition: txtflde.cxx:112
constexpr OUStringLiteral gsPropertySetNumber(u"SetNumber")
constexpr OUStringLiteral gsPropertyInstanceName(u"InstanceName")
SvXMLEnumStringMapEntry< FieldIdEnum > const aFieldServiceNameMapping[]
Definition: txtflde.cxx:182
constexpr OUStringLiteral gsPropertyIsHidden(u"IsHidden")
static OUString GetStringProperty(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3498
char const FIELD_SERVICE_PAGE_COUNT[]
Definition: txtflde.cxx:133
constexpr OUStringLiteral gsPropertyIsDate(u"IsDate")
constexpr OUStringLiteral gsPropertySequenceNumber(u"SequenceNumber")
constexpr OUStringLiteral gsPropertyItems(u"Items")
constexpr OUStringLiteral gsPropertyAdjust(u"Adjust")
char const FIELD_SERVICE_TABLE_COUNT[]
Definition: txtflde.cxx:137
constexpr OUStringLiteral gsPropertyOn(u"On")
char const FIELD_SERVICE_URL[]
Definition: txtflde.cxx:147
constexpr OUStringLiteral gsPropertyNumberingType(u"NumberingType")
char const FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME2[]
Definition: txtflde.cxx:121
constexpr OUStringLiteral gsPropertyDataBaseName(u"DataBaseName")
char const FIELD_SERVICE_DB_NEXT[]
Definition: txtflde.cxx:96
constexpr OUStringLiteral gsPropertyDataTableName(u"DataTableName")
static sal_Int16 GetInt16Property(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3518
constexpr OUStringLiteral gsPropertyAuthor(u"Author")
char const FIELD_SERVICE_CHAPTER[]
Definition: txtflde.cxx:131
constexpr OUStringLiteral gsPropertyIsShowFormula(u"IsShowFormula")
char const FIELD_SERVICE_SENDER[]
Definition: txtflde.cxx:86
constexpr OUStringLiteral gsPropertySequenceValue(u"SequenceValue")
constexpr OUStringLiteral gsPropertyDDECommandElement(u"DDECommandElement")
constexpr OUStringLiteral gsPropertySelectedItem(u"SelectedItem")
char const FIELD_SERVICE_DATETIME[]
Definition: txtflde.cxx:94
constexpr OUStringLiteral gsPropertyValue(u"Value")
constexpr OUStringLiteral gsPropertyIsVisible(u"IsVisible")
char const FIELD_SERVICE_PARAGRAPH_COUNT[]
Definition: txtflde.cxx:134
static bool GetBoolProperty(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3469
char const FIELD_SERVICE_DOC_INFO_SUBJECT2[]
Definition: txtflde.cxx:125
constexpr OUStringLiteral gsPropertyFullName(u"FullName")
char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME[]
Definition: txtflde.cxx:106
constexpr OUStringLiteral gsPropertySourceName(u"SourceName")
char const FIELD_SERVICE_DOC_INFO_DESCRIPTION[]
Definition: txtflde.cxx:110
constexpr OUStringLiteral gsPropertyIsDataBaseFormat(u"DataBaseFormat")
char const FIELD_SERVICE_OBJECT_COUNT[]
Definition: txtflde.cxx:139
constexpr OUStringLiteral gsPropertyMeasureKind(u"Kind")
constexpr OUStringLiteral gsPropertyDDECommandType(u"DDECommandType")
char const FIELD_SERVICE_PAGE_NAME[]
Definition: txtflde.cxx:143
char const FIELD_SERVICE_SETEXP[]
Definition: txtflde.cxx:90
constexpr OUStringLiteral gsPropertyIsConditionTrue(u"IsConditionTrue")
constexpr OUStringLiteral gsPropertyURLContent(u"URLContent")
constexpr OUStringLiteral gsPropertyFileFormat(u"FileFormat")
char const FIELD_SERVICE_USER[]
Definition: txtflde.cxx:91
constexpr OUStringLiteral gsFieldMasterPrefix(u"com.sun.star.text.FieldMaster.")
constexpr OUStringLiteral gsPropertyReferenceFieldPart(u"ReferenceFieldPart")
constexpr OUStringLiteral gsPropertyDataColumnName(u"DataColumnName")
char const FIELD_SERVICE_BIBLIOGRAPHY[]
Definition: txtflde.cxx:148
constexpr OUStringLiteral gsPropertyIsAutomaticUpdate(u"IsAutomaticUpdate")
char const FIELD_SERVICE_MEASURE[]
Definition: txtflde.cxx:153
constexpr OUStringLiteral gsPropertyHint(u"Hint")
char const FIELD_SERVICE_HIDDEN_TEXT[]
Definition: txtflde.cxx:102
constexpr OUStringLiteral gsPropertyInitials(u"Initials")
char const FIELD_SERVICE_DB_DISPLAY[]
Definition: txtflde.cxx:99
char const FIELD_SERVICE_SCRIPT[]
Definition: txtflde.cxx:149
constexpr OUStringLiteral gsPropertyTextRange(u"TextRange")
char const FIELD_SERVICE_DOC_INFO_REVISION[]
Definition: txtflde.cxx:128
char const FIELD_SERVICE_WORD_COUNT[]
Definition: txtflde.cxx:135
constexpr OUStringLiteral gsPropertyDataCommandType(u"DataCommandType")
char const FIELD_SERVICE_DOC_INFO_KEY_WORDS[]
Definition: txtflde.cxx:122
char const FIELD_SERVICE_DOC_INFO_KEY_WORDS2[]
Definition: txtflde.cxx:123
static sal_Int8 GetInt8Property(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3528
char const FIELD_SERVICE_GET_REFERENCE[]
Definition: txtflde.cxx:145
char const FIELD_SERVICE_FILE_NAME[]
Definition: txtflde.cxx:130
char const FIELD_SERVICE_DOC_INFO_DESCRIPTION2[]
Definition: txtflde.cxx:111
char const FIELD_SERVICE_DOC_INFO_TITLE2[]
Definition: txtflde.cxx:127
char const FIELD_SERVICE_DB_SELECT[]
Definition: txtflde.cxx:97
char const FIELD_SERVICE_TEMPLATE_NAME[]
Definition: txtflde.cxx:132
char const FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME[]
Definition: txtflde.cxx:114
char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR[]
Definition: txtflde.cxx:104
char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME2[]
Definition: txtflde.cxx:107
constexpr OUStringLiteral gsPropertyChapterNumberingLevel(u"ChapterNumberingLevel")
constexpr OUStringLiteral gsPropertyCondition(u"Condition")
constexpr OUStringLiteral gsPropertyIsFixedLanguage(u"IsFixedLanguage")
char const FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME2[]
Definition: txtflde.cxx:115
constexpr OUStringLiteral gsPropertyUserText(u"UserText")
constexpr OUStringLiteral gsPropertyScriptType(u"ScriptType")
char const FIELD_SERVICE_REFERENCE_PAGE_GET[]
Definition: txtflde.cxx:141
constexpr OUStringLiteral gsPropertyFalseContent(u"FalseContent")
constexpr OUStringLiteral gsPropertyCharStyleNames(u"CharStyleNames")
char const FIELD_SERVICE_CONDITIONAL_TEXT[]
Definition: txtflde.cxx:101
constexpr OUStringLiteral gsPropertyTargetFrame(u"TargetFrame")
constexpr OUStringLiteral gsPropertyHelp(u"Help")
char const FIELD_SERVICE_HIDDEN_PARAGRAPH[]
Definition: txtflde.cxx:103
static double GetDoubleProperty(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3488
static Sequence< OUString > GetStringSequenceProperty(const OUString &sPropName, const Reference< XPropertySet > &xPropSet)
Definition: txtflde.cxx:3548
char const FIELD_SERVICE_DOC_INFO_SUBJECT[]
Definition: txtflde.cxx:124
static util::DateTime GetDateTimeProperty(const OUString &sPropName, const Reference< XPropertySet > &xPropSet)
Definition: txtflde.cxx:3538
char const FIELD_SERVICE_JUMPEDIT[]
Definition: txtflde.cxx:88
constexpr OUStringLiteral gsPropertyReferenceFieldSource(u"ReferenceFieldSource")
constexpr OUStringLiteral gsPropertyName(u"Name")
char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR2[]
Definition: txtflde.cxx:105
char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR[]
Definition: txtflde.cxx:118
constexpr OUStringLiteral gsServicePrefix(u"com.sun.star.text.textfield.")
constexpr OUStringLiteral gsPropertyChapterFormat(u"ChapterFormat")
char const FIELD_SERVICE_PAGENUMBER[]
Definition: txtflde.cxx:95
char const FIELD_SERVICE_DOC_INFO_EDIT_TIME2[]
Definition: txtflde.cxx:109
char const FIELD_SERVICE_DB_NAME[]
Definition: txtflde.cxx:100
constexpr OUStringLiteral gsPropertyIsFixed(u"IsFixed")
char const FIELD_SERVICE_DOC_INFO_CUSTOM2[]
Definition: txtflde.cxx:117
char const FIELD_SERVICE_SHEET_NAME[]
Definition: txtflde.cxx:142
constexpr OUStringLiteral gsPropertyFieldSubType(u"UserDataType")
constexpr OUStringLiteral gsPropertyFields(u"Fields")
char const FIELD_SERVICE_REFERENCE_PAGE_SET[]
Definition: txtflde.cxx:140
char const FIELD_SERVICE_CHARACTER_COUNT[]
Definition: txtflde.cxx:136
constexpr OUStringLiteral gsPropertyIsInput(u"Input")
constexpr OUStringLiteral gsPropertyTrueContent(u"TrueContent")
char const FIELD_SERVICE_GRAPHIC_COUNT[]
Definition: txtflde.cxx:138
char const FIELD_SERVICE_GETEXP[]
Definition: txtflde.cxx:89
constexpr OUStringLiteral gsPropertyNumberFormat(u"NumberFormat")
char const FIELD_SERVICE_TABLE_FORMULA[]
Definition: txtflde.cxx:154
char const FIELD_SERVICE_AUTHOR[]
Definition: txtflde.cxx:87
char const FIELD_SERVICE_DOC_INFO_TITLE[]
Definition: txtflde.cxx:126
char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR2[]
Definition: txtflde.cxx:119
constexpr OUStringLiteral gsPropertyReferenceFieldLanguage(u"ReferenceFieldLanguage")
char const FIELD_SERVICE_DOC_INFO_EDIT_TIME[]
Definition: txtflde.cxx:108
constexpr OUStringLiteral gsPropertyDependentTextFields(u"DependentTextFields")
constexpr OUStringLiteral gsPropertyVariableName(u"VariableName")
char const FIELD_SERVICE_DB_NUMBER[]
Definition: txtflde.cxx:98
char const FIELD_SERVICE_DROP_DOWN[]
Definition: txtflde.cxx:155
constexpr OUStringLiteral gsPropertySubType(u"SubType")
char const FIELD_SERVICE_INPUT[]
Definition: txtflde.cxx:92
constexpr OUStringLiteral gsPropertyURL(u"URL")
char const FIELD_SERVICE_DOC_INFO_CUSTOM[]
Definition: txtflde.cxx:116
SvXMLEnumMapEntry< sal_Int16 > const aBibliographyDataTypeMap[]
Definition: txtflde.cxx:2649
static sal_Int32 GetIntProperty(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3508
constexpr OUStringLiteral gsPropertyContent(u"Content")
FieldIdEnum
field IDs,
Definition: txtflde.hxx:55
@ FIELD_ID_HIDDEN_PARAGRAPH
Definition: txtflde.hxx:102
@ FIELD_ID_DRAW_HEADER
Definition: txtflde.hxx:141
@ FIELD_ID_DOCINFO_CREATION_AUTHOR
Definition: txtflde.hxx:83
@ FIELD_ID_DOCINFO_SAVE_DATE
Definition: txtflde.hxx:97
@ FIELD_ID_CONDITIONAL_TEXT
Definition: txtflde.hxx:100
@ FIELD_ID_SENDER
Definition: txtflde.hxx:56
@ FIELD_ID_MEASURE
Definition: txtflde.hxx:136
@ FIELD_ID_DROP_DOWN
Definition: txtflde.hxx:139
@ FIELD_ID_PAGESTRING
Definition: txtflde.hxx:62
@ FIELD_ID_COUNT_GRAPHICS
Definition: txtflde.hxx:113
@ FIELD_ID_DATABASE_DISPLAY
Definition: txtflde.hxx:79
@ FIELD_ID_DATABASE_NEXT
Definition: txtflde.hxx:77
@ FIELD_ID_DRAW_DATE_TIME
Definition: txtflde.hxx:143
@ FIELD_ID_COUNT_OBJECTS
Definition: txtflde.hxx:114
@ FIELD_ID_URL
Definition: txtflde.hxx:127
@ FIELD_ID_DOCINFO_DESCRIPTION
Definition: txtflde.hxx:86
@ FIELD_ID_DATABASE_SELECT
Definition: txtflde.hxx:78
@ FIELD_ID_USER_INPUT
Definition: txtflde.hxx:72
@ FIELD_ID_TEXT_INPUT
Definition: txtflde.hxx:73
@ FIELD_ID_BIBLIOGRAPHY
Definition: txtflde.hxx:124
@ FIELD_ID_COUNT_TABLES
Definition: txtflde.hxx:112
@ FIELD_ID_DDE
Definition: txtflde.hxx:122
@ FIELD_ID_PAGENAME
Definition: txtflde.hxx:60
@ FIELD_ID_DOCINFO_PRINT_AUTHOR
Definition: txtflde.hxx:90
@ FIELD_ID_UNKNOWN
Definition: txtflde.hxx:145
@ FIELD_ID_DRAW_FOOTER
Definition: txtflde.hxx:142
@ FIELD_ID_COMBINED_CHARACTERS
Definition: txtflde.hxx:132
@ FIELD_ID_FILE_NAME
Definition: txtflde.hxx:106
@ FIELD_ID_REF_SEQUENCE
Definition: txtflde.hxx:118
@ FIELD_ID_SHEET_NAME
Definition: txtflde.hxx:126
@ FIELD_ID_DATE
Definition: txtflde.hxx:58
@ FIELD_ID_REFPAGE_SET
Definition: txtflde.hxx:63
@ FIELD_ID_ANNOTATION
Definition: txtflde.hxx:130
@ FIELD_ID_DOCINFO_SAVE_AUTHOR
Definition: txtflde.hxx:98
@ FIELD_ID_TIME
Definition: txtflde.hxx:59
@ FIELD_ID_DOCINFO_CREATION_TIME
Definition: txtflde.hxx:84
@ FIELD_ID_HIDDEN_TEXT
Definition: txtflde.hxx:101
@ FIELD_ID_DOCINFO_CREATION_DATE
Definition: txtflde.hxx:85
@ FIELD_ID_DOCINFO_KEYWORDS
Definition: txtflde.hxx:93
@ FIELD_ID_AUTHOR
Definition: txtflde.hxx:57
@ FIELD_ID_REF_BOOKMARK
Definition: txtflde.hxx:119
@ FIELD_ID_DOCINFO_REVISION
Definition: txtflde.hxx:94
@ FIELD_ID_COUNT_CHARACTERS
Definition: txtflde.hxx:110
@ FIELD_ID_EXPRESSION
Definition: txtflde.hxx:74
@ FIELD_ID_USER_GET
Definition: txtflde.hxx:71
@ FIELD_ID_VARIABLE_INPUT
Definition: txtflde.hxx:70
@ FIELD_ID_SCRIPT
Definition: txtflde.hxx:129
@ FIELD_ID_DOCINFO_SUBJECT
Definition: txtflde.hxx:92
@ FIELD_ID_REF_FOOTNOTE
Definition: txtflde.hxx:120
@ FIELD_ID_COUNT_PAGES
Definition: txtflde.hxx:111
@ FIELD_ID_COUNT_WORDS
Definition: txtflde.hxx:109
@ FIELD_ID_REF_REFERENCE
Definition: txtflde.hxx:117
@ FIELD_ID_META
Definition: txtflde.hxx:134
@ FIELD_ID_DOCINFO_EDIT_DURATION
Definition: txtflde.hxx:95
@ FIELD_ID_VARIABLE_SET
Definition: txtflde.hxx:69
@ FIELD_ID_COUNT_PARAGRAPHS
Definition: txtflde.hxx:108
@ FIELD_ID_TABLE_FORMULA
Definition: txtflde.hxx:138
@ FIELD_ID_PLACEHOLDER
Definition: txtflde.hxx:66
@ FIELD_ID_CHAPTER
Definition: txtflde.hxx:105
@ FIELD_ID_DOCINFO_TITLE
Definition: txtflde.hxx:91
@ FIELD_ID_TEMPLATE_NAME
Definition: txtflde.hxx:104
@ FIELD_ID_SEQUENCE
Definition: txtflde.hxx:75
@ FIELD_ID_DATABASE_NUMBER
Definition: txtflde.hxx:81
@ FIELD_ID_PAGENUMBER
Definition: txtflde.hxx:61
@ FIELD_ID_MACRO
Definition: txtflde.hxx:116
@ FIELD_ID_DOCINFO_PRINT_DATE
Definition: txtflde.hxx:89
@ FIELD_ID_DATABASE_NAME
Definition: txtflde.hxx:80
@ FIELD_ID_VARIABLE_GET
Definition: txtflde.hxx:68
@ FIELD_ID_REF_ENDNOTE
Definition: txtflde.hxx:121
@ FIELD_ID_REFPAGE_GET
Definition: txtflde.hxx:64
@ FIELD_ID_DOCINFO_SAVE_TIME
Definition: txtflde.hxx:96
@ FIELD_ID_DOCINFO_PRINT_TIME
Definition: txtflde.hxx:88
@ FIELD_ID_DOCINFO_CUSTOM
Definition: txtflde.hxx:87
signed char sal_Int8
constexpr OUStringLiteral sScript
constexpr OUStringLiteral sEventType
std::unique_ptr< char[]> aBuffer
#define ENUM_STRING_MAP_ENTRY(name, tok)
Definition: xmlement.hxx:62
constexpr sal_uInt16 XML_NAMESPACE_META
constexpr sal_uInt16 XML_NAMESPACE_DC
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_TEXT
constexpr sal_uInt16 XML_NAMESPACE_FORM
constexpr sal_uInt16 XML_NAMESPACE_OOOW
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
constexpr sal_uInt16 XML_NAMESPACE_STYLE
constexpr sal_uInt16 XML_NAMESPACE_SCRIPT
sal_Int32 nLength
Definition: xmltoken.cxx:38
XMLTokenEnum eToken
Definition: xmltoken.cxx:40