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 ::std;
75using namespace ::com::sun::star;
76using namespace ::com::sun::star::uno;
77using namespace ::com::sun::star::text;
78using namespace ::com::sun::star::lang;
79using namespace ::com::sun::star::beans;
80using namespace ::com::sun::star::util;
81using namespace ::com::sun::star::style;
82using namespace ::com::sun::star::document;
83using namespace ::com::sun::star::container;
84using namespace ::xmloff::token;
85
86
87char const FIELD_SERVICE_SENDER[] = "ExtendedUser";
88char const FIELD_SERVICE_AUTHOR[] = "Author";
89char const FIELD_SERVICE_JUMPEDIT[] = "JumpEdit";
90char const FIELD_SERVICE_GETEXP[] = "GetExpression";
91char const FIELD_SERVICE_SETEXP[] = "SetExpression";
92char const FIELD_SERVICE_USER[] = "User";
93char const FIELD_SERVICE_INPUT[] = "Input";
94char const FIELD_SERVICE_USERINPUT[] = "InputUser";
95char const FIELD_SERVICE_DATETIME[] = "DateTime";
96char const FIELD_SERVICE_PAGENUMBER[] = "PageNumber";
97char const FIELD_SERVICE_DB_NEXT[] = "DatabaseNextSet";
98char const FIELD_SERVICE_DB_SELECT[] = "DatabaseNumberOfSet";
99char const FIELD_SERVICE_DB_NUMBER[] = "DatabaseSetNumber";
100char const FIELD_SERVICE_DB_DISPLAY[] = "Database";
101char const FIELD_SERVICE_DB_NAME[] = "DatabaseName";
102char const FIELD_SERVICE_CONDITIONAL_TEXT[] = "ConditionalText";
103char const FIELD_SERVICE_HIDDEN_TEXT[] = "HiddenText";
104char const FIELD_SERVICE_HIDDEN_PARAGRAPH[] = "HiddenParagraph";
105char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR[] = "DocInfo.ChangeAuthor";
106char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR2[] = "docinfo.ChangeAuthor";
107char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME[] = "DocInfo.ChangeDateTime";
108char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME2[] = "docinfo.ChangeDateTime";
109char const FIELD_SERVICE_DOC_INFO_EDIT_TIME[] = "DocInfo.EditTime";
110char const FIELD_SERVICE_DOC_INFO_EDIT_TIME2[] = "docinfo.EditTime";
111char const FIELD_SERVICE_DOC_INFO_DESCRIPTION[] = "DocInfo.Description";
112char const FIELD_SERVICE_DOC_INFO_DESCRIPTION2[] = "docinfo.Description";
113char const FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR[] = "DocInfo.CreateAuthor";
114char const FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR2[] = "docinfo.CreateAuthor";
115char const FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME[] = "DocInfo.CreateDateTime";
116char const FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME2[] = "docinfo.CreateDateTime";
117char const FIELD_SERVICE_DOC_INFO_CUSTOM[] = "DocInfo.Custom";
118char const FIELD_SERVICE_DOC_INFO_CUSTOM2[] = "docinfo.Custom";
119char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR[] = "DocInfo.PrintAuthor";
120char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR2[] = "docinfo.PrintAuthor";
121char const FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME[] = "DocInfo.PrintDateTime";
122char const FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME2[] = "docinfo.PrintDateTime";
123char const FIELD_SERVICE_DOC_INFO_KEY_WORDS[] = "DocInfo.KeyWords";
124char const FIELD_SERVICE_DOC_INFO_KEY_WORDS2[] = "docinfo.KeyWords";
125char const FIELD_SERVICE_DOC_INFO_SUBJECT[] = "DocInfo.Subject";
126char const FIELD_SERVICE_DOC_INFO_SUBJECT2[] = "docinfo.Subject";
127char const FIELD_SERVICE_DOC_INFO_TITLE[] = "DocInfo.Title";
128char const FIELD_SERVICE_DOC_INFO_TITLE2[] = "docinfo.Title";
129char const FIELD_SERVICE_DOC_INFO_REVISION[] = "DocInfo.Revision";
130char const FIELD_SERVICE_DOC_INFO_REVISION2[] = "docinfo.Revision";
131char const FIELD_SERVICE_FILE_NAME[] = "FileName";
132char const FIELD_SERVICE_CHAPTER[] = "Chapter";
133char const FIELD_SERVICE_TEMPLATE_NAME[] = "TemplateName";
134char const FIELD_SERVICE_PAGE_COUNT[] = "PageCount";
135char const FIELD_SERVICE_PARAGRAPH_COUNT[] = "ParagraphCount";
136char const FIELD_SERVICE_WORD_COUNT[] = "WordCount";
137char const FIELD_SERVICE_CHARACTER_COUNT[] = "CharacterCount";
138char const FIELD_SERVICE_TABLE_COUNT[] = "TableCount";
139char const FIELD_SERVICE_GRAPHIC_COUNT[] = "GraphicObjectCount";
140char const FIELD_SERVICE_OBJECT_COUNT[] = "EmbeddedObjectCount";
141char const FIELD_SERVICE_REFERENCE_PAGE_SET[] = "ReferencePageSet";
142char const FIELD_SERVICE_REFERENCE_PAGE_GET[] = "ReferencePageGet";
143char const FIELD_SERVICE_SHEET_NAME[] = "SheetName";
144char const FIELD_SERVICE_PAGE_NAME[] = "PageName";
145char const FIELD_SERVICE_MACRO[] = "Macro";
146char const FIELD_SERVICE_GET_REFERENCE[] = "GetReference";
147char const FIELD_SERVICE_DDE[] = "DDE";
148char const FIELD_SERVICE_URL[] = "URL";
149char const FIELD_SERVICE_BIBLIOGRAPHY[] = "Bibliography";
150char const FIELD_SERVICE_SCRIPT[] = "Script";
151char const FIELD_SERVICE_ANNOTATION[] = "Annotation";
152char const FIELD_SERVICE_COMBINED_CHARACTERS[] = "CombinedCharacters";
153char const FIELD_SERVICE_META[] = "MetadataField";
154char const FIELD_SERVICE_MEASURE[] = "Measure";
155char const FIELD_SERVICE_TABLE_FORMULA[] = "TableFormula";
156char const FIELD_SERVICE_DROP_DOWN[] = "DropDown";
157
158namespace
159{
161uno::Reference<text::XText> GetToplevelText(const uno::Reference<text::XText>& xText)
162{
163 uno::Reference<text::XText> xRet = xText;
164 while (true)
165 {
166 uno::Reference<beans::XPropertySet> xPropertySet(xRet, uno::UNO_QUERY);
167 if (!xPropertySet.is())
168 return xRet;
169
170 if (!xPropertySet->getPropertySetInfo()->hasPropertyByName("ParentText"))
171 return xRet;
172
173 uno::Reference<text::XText> xParent;
174 if (xPropertySet->getPropertyValue("ParentText") >>= xParent)
175 xRet = xParent;
176 else
177 return xRet;
178 }
179 return xRet;
180}
181}
182
184{
197
202 // workaround for #no-bug#: Database/DataBase
205
232
236
240
248
252
254
257
260
261 // non-writer fields
266
267 // deprecated fields
270
271 { nullptr, 0, FieldIdEnum(0) }
272};
273
274
275// property accessor helper functions
276static bool GetBoolProperty(const OUString&,
277 const Reference<XPropertySet> &);
278static bool GetOptionalBoolProperty(const OUString&,
279 const Reference<XPropertySet> &,
280 const Reference<XPropertySetInfo> &,
281 bool bDefault);
282static double GetDoubleProperty(const OUString&,
283 const Reference<XPropertySet> &);
284static OUString GetStringProperty(const OUString&,
285 const Reference<XPropertySet> &);
286static sal_Int32 GetIntProperty(const OUString&,
287 const Reference<XPropertySet> &);
288static sal_Int16 GetInt16Property(const OUString&,
289 const Reference<XPropertySet> &);
290static sal_Int8 GetInt8Property(const OUString&,
291 const Reference<XPropertySet> &);
292static util::DateTime GetDateTimeProperty( const OUString& sPropName,
293 const Reference<XPropertySet> & xPropSet);
294static Sequence<OUString> GetStringSequenceProperty(
295 const OUString& sPropName,
296 const Reference<XPropertySet> & xPropSet);
297
298
299 // service names
300constexpr OUStringLiteral gsServicePrefix(u"com.sun.star.text.textfield.");
301constexpr OUStringLiteral gsFieldMasterPrefix(u"com.sun.star.text.FieldMaster.");
302constexpr OUStringLiteral gsPresentationServicePrefix(u"com.sun.star.presentation.TextField.");
303
304 // property names
305constexpr OUStringLiteral gsPropertyAdjust(u"Adjust");
306constexpr OUStringLiteral gsPropertyAuthor(u"Author");
307constexpr OUStringLiteral gsPropertyChapterFormat(u"ChapterFormat");
308constexpr OUStringLiteral gsPropertyChapterNumberingLevel(u"ChapterNumberingLevel");
309constexpr OUStringLiteral gsPropertyCharStyleNames(u"CharStyleNames");
310constexpr OUStringLiteral gsPropertyCondition(u"Condition");
311constexpr OUStringLiteral gsPropertyContent(u"Content");
312constexpr OUStringLiteral gsPropertyDataBaseName(u"DataBaseName");
313constexpr OUStringLiteral gsPropertyDataBaseURL(u"DataBaseURL");
314constexpr OUStringLiteral gsPropertyDataColumnName(u"DataColumnName");
315constexpr OUStringLiteral gsPropertyDataCommandType(u"DataCommandType");
316constexpr OUStringLiteral gsPropertyDataTableName(u"DataTableName");
317constexpr OUStringLiteral gsPropertyDateTime(u"DateTime");
318constexpr OUStringLiteral gsPropertyDateTimeValue(u"DateTimeValue");
319constexpr OUStringLiteral gsPropertyDDECommandElement(u"DDECommandElement");
320constexpr OUStringLiteral gsPropertyDDECommandFile(u"DDECommandFile");
321constexpr OUStringLiteral gsPropertyDDECommandType(u"DDECommandType");
322constexpr OUStringLiteral gsPropertyDependentTextFields(u"DependentTextFields");
323constexpr OUStringLiteral gsPropertyFalseContent(u"FalseContent");
324constexpr OUStringLiteral gsPropertyFields(u"Fields");
325constexpr OUStringLiteral gsPropertyFieldSubType(u"UserDataType");
326constexpr OUStringLiteral gsPropertyFileFormat(u"FileFormat");
327constexpr OUStringLiteral gsPropertyFullName(u"FullName");
328constexpr OUStringLiteral gsPropertyHint(u"Hint");
329constexpr OUStringLiteral gsPropertyInitials(u"Initials");
330constexpr OUStringLiteral gsPropertyInstanceName(u"InstanceName");
331constexpr OUStringLiteral gsPropertyIsAutomaticUpdate(u"IsAutomaticUpdate");
332constexpr OUStringLiteral gsPropertyIsConditionTrue(u"IsConditionTrue");
333constexpr OUStringLiteral gsPropertyIsDataBaseFormat(u"DataBaseFormat");
334constexpr OUStringLiteral gsPropertyIsDate(u"IsDate");
335constexpr OUStringLiteral gsPropertyIsExpression(u"IsExpression");
336constexpr OUStringLiteral gsPropertyIsFixed(u"IsFixed");
337constexpr OUStringLiteral gsPropertyIsFixedLanguage(u"IsFixedLanguage");
338constexpr OUStringLiteral gsPropertyIsHidden(u"IsHidden");
339constexpr OUStringLiteral gsPropertyIsInput(u"Input");
340constexpr OUStringLiteral gsPropertyIsShowFormula(u"IsShowFormula");
341constexpr OUStringLiteral gsPropertyIsVisible(u"IsVisible");
342constexpr OUStringLiteral gsPropertyItems(u"Items");
343constexpr OUStringLiteral gsPropertyLevel(u"Level");
344constexpr OUStringLiteral gsPropertyMeasureKind(u"Kind");
345constexpr OUStringLiteral gsPropertyName(u"Name");
346constexpr OUStringLiteral gsPropertyNumberFormat(u"NumberFormat");
347constexpr OUStringLiteral gsPropertyNumberingSeparator(u"NumberingSeparator");
348constexpr OUStringLiteral gsPropertyNumberingType(u"NumberingType");
349constexpr OUStringLiteral gsPropertyOffset(u"Offset");
350constexpr OUStringLiteral gsPropertyOn(u"On");
351constexpr OUStringLiteral gsPropertyPlaceholderType(u"PlaceHolderType");
352constexpr OUStringLiteral gsPropertyReferenceFieldPart(u"ReferenceFieldPart");
353constexpr OUStringLiteral gsPropertyReferenceFieldSource(u"ReferenceFieldSource");
354constexpr OUStringLiteral gsPropertyReferenceFieldLanguage(u"ReferenceFieldLanguage");
355constexpr OUStringLiteral gsPropertyScriptType(u"ScriptType");
356constexpr OUStringLiteral gsPropertySelectedItem(u"SelectedItem");
357constexpr OUStringLiteral gsPropertySequenceNumber(u"SequenceNumber");
358constexpr OUStringLiteral gsPropertySequenceValue(u"SequenceValue");
359constexpr OUStringLiteral gsPropertySetNumber(u"SetNumber");
360constexpr OUStringLiteral gsPropertySourceName(u"SourceName");
361constexpr OUStringLiteral gsPropertySubType(u"SubType");
362constexpr OUStringLiteral gsPropertyTargetFrame(u"TargetFrame");
363constexpr OUStringLiteral gsPropertyTrueContent(u"TrueContent");
364constexpr OUStringLiteral gsPropertyURL(u"URL");
365constexpr OUStringLiteral gsPropertyURLContent(u"URLContent");
366constexpr OUStringLiteral gsPropertyUserText(u"UserText");
367constexpr OUStringLiteral gsPropertyValue(u"Value");
368constexpr OUStringLiteral gsPropertyVariableName(u"VariableName");
369constexpr OUStringLiteral gsPropertyHelp(u"Help");
370constexpr OUStringLiteral gsPropertyTooltip(u"Tooltip");
371constexpr OUStringLiteral gsPropertyTextRange(u"TextRange");
372
374 std::unique_ptr<XMLPropertyState> pCombinedCharState)
375 : rExport(rExp),
376 pCombinedCharactersPropertyState(std::move(pCombinedCharState))
377{
379}
380
382{
383}
384
387 const Reference<XTextField> & rTextField,
388 const Reference<XPropertySet> & xPropSet)
389{
390 // get service names for rTextField (via XServiceInfo service)
391 Reference<XServiceInfo> xService(rTextField, UNO_QUERY);
392 const Sequence<OUString> aServices = xService->getSupportedServiceNames();
393
394 OUString sFieldName; // service name postfix of current field
395
396 // search for TextField service name
397 const OUString* pNames = std::find_if(aServices.begin(), aServices.end(),
398 [](const OUString& rName) { return rName.matchIgnoreAsciiCase(gsServicePrefix); });
399 if (pNames != aServices.end())
400 {
401 // TextField found => postfix is field type!
402 sFieldName = pNames->copy(gsServicePrefix.getLength());
403 }
404
405 // if this is not a normal text field, check if it's a presentation text field
406 if( sFieldName.isEmpty() )
407 {
408 // search for TextField service name
409 pNames = std::find_if(aServices.begin(), aServices.end(),
410 [](const OUString& rName) { return rName.startsWith(gsPresentationServicePrefix); });
411 if (pNames != aServices.end())
412 {
413 // TextField found => postfix is field type!
414 sFieldName = pNames->copy(gsPresentationServicePrefix.getLength());
415 }
416
417 if( !sFieldName.isEmpty() )
418 {
419 if( sFieldName == "Header" )
420 {
422 }
423 else if( sFieldName == "Footer" )
424 {
426 }
427 else if( sFieldName == "DateTime" )
428 {
430 }
431 }
432 }
433
434 // map postfix of service name to field ID
435 DBG_ASSERT(!sFieldName.isEmpty(), "no TextField service found!");
436 return MapFieldName(sFieldName, xPropSet);
437}
438
440 std::u16string_view sFieldName, // field (master) name
441 const Reference<XPropertySet> & xPropSet) // for subtype
442{
443 // we'll proceed in 2 steps:
444 // a) map service name to preliminary FIELD_ID
445 // b) map those prelim. FIELD_IDs that correspond to several field types
446 // (in our (XML) world) to final FIELD IDs
447
448
449 // a) find prelim. FIELD_ID via aFieldServiceMapping
450
451 // check for non-empty service name
452 DBG_ASSERT(!sFieldName.empty(), "no valid service name!");
454 if (!sFieldName.empty())
455 {
456 // map name to prelim. ID
458 nToken, sFieldName, aFieldServiceNameMapping);
459
460 // check return
461 DBG_ASSERT(bRet, "Unknown field service name encountered!");
462 }
463
464 // b) map prelim. to final FIELD_IDs
465 switch (nToken) {
467 if (GetBoolProperty(gsPropertyIsInput, xPropSet))
468 {
470 }
471 else
472 {
473 switch (GetIntProperty(gsPropertySubType, xPropSet))
474 {
475 case SetVariableType::STRING: // text field
476 case SetVariableType::VAR: // num field
478 break;
479 case SetVariableType::SEQUENCE:
481 break;
482 case SetVariableType::FORMULA:
483 default:
485 break;
486 }
487 }
488 break;
489
491 switch (GetIntProperty(gsPropertySubType, xPropSet))
492 {
493 case SetVariableType::STRING: // text field
494 case SetVariableType::VAR: // num field
496 break;
497 case SetVariableType::FORMULA:
499 break;
500 case SetVariableType::SEQUENCE:
501 default:
503 break;
504 }
505 break;
506
507 case FIELD_ID_TIME:
508 if (GetBoolProperty(gsPropertyIsDate, xPropSet))
509 {
511 }
512 break;
513
515 // NumberingType not available in non-Writer apps
516 if (xPropSet->getPropertySetInfo()->
517 hasPropertyByName(gsPropertyNumberingType))
518 {
519 if (NumberingType::CHAR_SPECIAL == GetIntProperty(
520 gsPropertyNumberingType, xPropSet))
521 {
523 }
524 }
525 break;
526
528 if (GetBoolProperty(gsPropertyIsDate, xPropSet))
529 {
531 }
532 break;
533
535 if (GetBoolProperty(gsPropertyIsDate, xPropSet))
536 {
538 }
539 break;
540
542 if (GetBoolProperty(gsPropertyIsDate, xPropSet))
543 {
545 }
546 break;
547
550 {
551 case ReferenceFieldSource::REFERENCE_MARK:
553 break;
554 case ReferenceFieldSource::SEQUENCE_FIELD:
556 break;
557 case ReferenceFieldSource::BOOKMARK:
559 break;
560 case ReferenceFieldSource::FOOTNOTE:
562 break;
563 case ReferenceFieldSource::ENDNOTE:
565 break;
566 default:
568 break;
569 }
570 break;
571
573 case FIELD_ID_SCRIPT:
576 case FIELD_ID_DDE:
577 case FIELD_ID_MACRO:
602 case FIELD_ID_AUTHOR:
603 case FIELD_ID_SENDER:
612 case FIELD_ID_CHAPTER:
614 case FIELD_ID_META:
617 case FIELD_ID_MEASURE:
618 case FIELD_ID_URL:
621 ; // these field IDs are final
622 break;
623
624 default:
626 }
627
628 // ... and return final FIELD_ID
629 return nToken;
630}
631
632// is string or numeric field?
634 FieldIdEnum nFieldType,
635 const Reference<XPropertySet> & xPropSet)
636{
637 switch (nFieldType) {
638
642 {
643 // depends on field sub type
644 return ( GetIntProperty(gsPropertySubType, xPropSet) ==
645 SetVariableType::STRING );
646 }
647
650 {
651 Reference<XTextField> xTextField(xPropSet, UNO_QUERY);
652 DBG_ASSERT(xTextField.is(), "field is no XTextField!");
654 GetMasterPropertySet(xTextField));
655 return !bRet;
656 }
657
658 case FIELD_ID_META:
659 return 0 > GetIntProperty(gsPropertyNumberFormat, xPropSet);
660
662 // TODO: depends on... ???
663 // workaround #no-bug#: no data type
664 return 5100 == GetIntProperty(gsPropertyNumberFormat, xPropSet);
665
667 // legacy field: always a number field (because it always has
668 // a number format)
669 return false;
670
689 case FIELD_ID_DATE:
690 case FIELD_ID_TIME:
695 // always number
696 return false;
697
700 case FIELD_ID_DDE:
706 case FIELD_ID_MACRO:
708 case FIELD_ID_CHAPTER:
722 case FIELD_ID_SENDER:
723 case FIELD_ID_AUTHOR:
727 case FIELD_ID_MEASURE:
728 case FIELD_ID_URL:
730 // always string:
731 return true;
732
733 case FIELD_ID_SCRIPT:
738 case FIELD_ID_UNKNOWN:
742 default:
743 OSL_FAIL("unknown field type/field has no content");
744 return true; // invalid info; string in case of doubt
745 }
746}
747
751 const Reference<XTextField> & rTextField, const bool bProgress,
752 const bool bRecursive )
753{
754 // get property set
755 Reference<XPropertySet> xPropSet(rTextField, UNO_QUERY);
756
757 // add field master to list of used field masters (if desired)
758 if (nullptr != pUsedMasters)
759 {
760 Reference<XDependentTextField> xDepField(rTextField, UNO_QUERY);
761 if (xDepField.is())
762 {
763 // The direct parent may be just the table cell, while we want the topmost parent, e.g.
764 // a header text.
765 Reference<XText> xOurText = GetToplevelText(rTextField->getAnchor()->getText());
766
767 map<Reference<XText>, set<OUString> >::iterator aMapIter =
768 pUsedMasters->find(xOurText);
769
770 // insert a list for our XText (if necessary)
771 if (aMapIter == pUsedMasters->end())
772 {
773 set<OUString> aSet;
774 (*pUsedMasters)[xOurText] = aSet;
775 aMapIter = pUsedMasters->find(xOurText);
776 }
777
778 // insert this text field master
779 OUString sFieldMasterName = GetStringProperty(
780 gsPropertyInstanceName, xDepField->getTextFieldMaster());
781 if (!sFieldMasterName.isEmpty())
782 aMapIter->second.insert( sFieldMasterName );
783 }
784 // else: no dependent field -> no master -> ignore
785 }
786
787 // get Field ID
788 FieldIdEnum nToken = GetFieldID(rTextField, xPropSet);
789
790 // export the character style for all fields
791 // with one exception: combined character fields export their own
792 // text style below
793 Reference <XPropertySet> xRangePropSet(rTextField->getAnchor(), UNO_QUERY);
795 {
797 XmlStyleFamily::TEXT_TEXT, xRangePropSet);
798 }
799
800 // process special styles for each field (e.g. data styles)
801 switch (nToken) {
802
804 {
805 sal_Int32 nFormat = GetIntProperty(gsPropertyNumberFormat, xPropSet);
806 // workaround: #no-bug#; see IsStringField(...)
807 if ( (5100 != nFormat) &&
809 {
810 GetExport().addDataStyle(nFormat);
811 }
812 break;
813 }
814
815 case FIELD_ID_DATE:
816 case FIELD_ID_TIME:
817 {
818 // date and time fields are always number fields, but the
819 // NumberFormat property is optional (e.g. Calc doesn't
820 // support it)
821 Reference<XPropertySetInfo> xPropSetInfo(
822 xPropSet->getPropertySetInfo() );
823 if ( xPropSetInfo->hasPropertyByName( gsPropertyNumberFormat ) )
824 {
825 sal_Int32 nFormat =
827
828 // nFormat may be -1 for numeric fields that display their
829 // variable name. (Maybe this should be a field type, then?)
830 if (nFormat != -1)
831 {
834 xPropSet, xPropSetInfo, false ) )
835 {
836 nFormat =
838 }
839
840 GetExport().addDataStyle( nFormat,
842 }
843 }
844 }
845 break;
846
847 case FIELD_ID_META:
848 // recurse into content (does not export element, so can be done first)
849 if (bRecursive)
850 {
851 bool dummy_for_autostyles(true);
852 ExportMetaField(xPropSet, true, bProgress, dummy_for_autostyles);
853 }
854 [[fallthrough]];
869 // register number format, if this is a numeric field
870 if (! IsStringField(nToken, xPropSet)) {
871
872 sal_Int32 nFormat =
874
875 // nFormat may be -1 for numeric fields that display their
876 // variable name. (Maybe this should be a field type, then?)
877 if (nFormat != -1)
878 {
879 // handle formats for fixed language fields
880 // for all these fields (except table formula)
881 if( ( nToken != FIELD_ID_TABLE_FORMULA ) &&
884 xPropSet, xPropSet->getPropertySetInfo(),
885 false ) )
886 {
887 nFormat =
889 }
890
891 GetExport().addDataStyle(nFormat);
892 }
893 }
894 break;
895
897 {
898 // export text style with the addition of the combined characters
900 "need proper PropertyState for combined characters");
903 XmlStyleFamily::TEXT_TEXT, xRangePropSet,
904 aStates);
905 break;
906 }
907
908 case FIELD_ID_SCRIPT:
911 case FIELD_ID_DDE:
917 case FIELD_ID_MACRO:
942 case FIELD_ID_AUTHOR:
943 case FIELD_ID_SENDER:
952 case FIELD_ID_CHAPTER:
955 case FIELD_ID_MEASURE:
956 case FIELD_ID_URL:
961 ; // no formats for these fields!
962 break;
963
964 case FIELD_ID_UNKNOWN:
965 default:
966 OSL_FAIL("unknown field type!");
967 // ignore -> no format for unknown
968 break;
969 }
970}
971
974 const Reference<XTextField> & rTextField, bool bProgress,
975 bool & rPrevCharIsSpace)
976{
977 // get property set
978 Reference<XPropertySet> xPropSet(rTextField, UNO_QUERY);
979
980 // get property set of range (for the attributes)
981 Reference <XPropertySet> xRangePropSet(rTextField->getAnchor(), UNO_QUERY);
982
983 // get Field ID
984 enum FieldIdEnum nToken = GetFieldID(rTextField, xPropSet);
985
986 // special treatment for combined characters field, because it is
987 // exported as a style
988 const XMLPropertyState* aStates[] = { pCombinedCharactersPropertyState.get(), nullptr };
989 const XMLPropertyState **pStates =
991 ? aStates
992 : nullptr;
993
994 // find out whether we need to set the style
995 bool bIsUICharStyle;
996 bool bHasAutoStyle;
997 OUString sStyle = GetExport().GetTextParagraphExport()->
998 FindTextStyle( xRangePropSet, bIsUICharStyle, bHasAutoStyle, pStates );
999 bool bHasStyle = !sStyle.isEmpty();
1000
1001 {
1002 Reference<XPropertySetInfo> xRangePropSetInfo;
1003 XMLTextCharStyleNamesElementExport aCharStylesExport(
1004 GetExport(), bIsUICharStyle &&
1005 GetExport().GetTextParagraphExport()
1006 ->GetCharStyleNamesPropInfoCache().hasProperty(
1007 xRangePropSet, xRangePropSetInfo ), bHasAutoStyle,
1008 xRangePropSet, gsPropertyCharStyleNames );
1009
1010 // export span with style (if necessary)
1011 // (except for combined characters field)
1012 if( bHasStyle )
1013 {
1014 // export <text:span> element
1016 GetExport().EncodeStyleName( sStyle ) );
1017 }
1018 SvXMLElementExport aSpan( GetExport(), bHasStyle,
1020 false, false);
1021
1022 // finally, export the field itself
1023 ExportFieldHelper( rTextField, xPropSet, xRangePropSet, nToken,
1024 bProgress, rPrevCharIsSpace);
1025 }
1026}
1027
1030 const Reference<XTextField> & rTextField,
1031 const Reference<XPropertySet> & rPropSet,
1032 const Reference<XPropertySet> &,
1033 enum FieldIdEnum nToken,
1034 bool bProgress,
1035 bool & rPrevCharIsSpace)
1036{
1037 // get property set info (because some attributes are not support
1038 // in all implementations)
1039 Reference<XPropertySetInfo> xPropSetInfo(rPropSet->getPropertySetInfo());
1040
1041 OUString sPresentation = rTextField->getPresentation(false);
1042
1043 // process each field type
1044 switch (nToken) {
1045 case FIELD_ID_AUTHOR:
1046 // author field: fixed, field (sub-)type
1047 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1048 {
1051 }
1052 ExportElement(MapAuthorFieldName(rPropSet), sPresentation);
1053 break;
1054
1055 case FIELD_ID_SENDER:
1056 // sender field: fixed, field (sub-)type
1058 GetBoolProperty(gsPropertyIsFixed, rPropSet), true);
1059 ExportElement(MapSenderFieldName(rPropSet), sPresentation);
1060 break;
1061
1063 // placeholder field: type, name, description
1068 GetStringProperty(gsPropertyHint,rPropSet), true);
1069 ExportElement(XML_PLACEHOLDER, sPresentation);
1070 break;
1071
1073 {
1074 // variable set field: name, visible, format&value
1078 false);
1081 sPresentation);
1085 sPresentation,
1087 true, true, true,
1090 rPropSet, xPropSetInfo, false ) );
1091 ExportElement(XML_VARIABLE_SET, sPresentation);
1092 break;
1093 }
1095 {
1096 // variable get field: name, format&value
1099 bool bCmd = GetBoolProperty(gsPropertyIsShowFormula, rPropSet);
1100 ProcessDisplay(true, bCmd);
1101 // show style, unless name will be shown
1104 "", u"", 0.0, // values not used
1105 false,
1106 false,
1107 !bCmd,
1110 rPropSet, xPropSetInfo, false ) );
1111 ExportElement(XML_VARIABLE_GET, sPresentation);
1112 break;
1113 }
1115 // variable input field: name, description, format&value
1119 GetStringProperty(gsPropertyHint , rPropSet));
1121 false);
1124 sPresentation);
1128 sPresentation,
1130 true, true, true,
1133 rPropSet, xPropSetInfo, false ) );
1134 ExportElement(XML_VARIABLE_INPUT, sPresentation);
1135 break;
1136
1137 case FIELD_ID_USER_GET:
1138 // user field: name, hidden, style
1139 {
1140 bool bCmd = GetBoolProperty(gsPropertyIsShowFormula, rPropSet);
1142 bCmd);
1145 "", u"", 0.0, // values not used
1146 false, false, !bCmd,
1149 rPropSet, xPropSetInfo, false ) );
1150
1151 // name from FieldMaster
1154 GetMasterPropertySet(rTextField)));
1155 ExportElement(XML_USER_FIELD_GET, sPresentation);
1156 break;
1157 }
1158
1160 // user input field: name (from FieldMaster), description
1161// ProcessString(XML_NAME,
1162// GetStringProperty(sPropertyName,
1163// GetMasterPropertySet(rTextField)));
1168 ExportElement(XML_USER_FIELD_INPUT, sPresentation);
1169 break;
1170
1171 case FIELD_ID_SEQUENCE:
1172 {
1173 // sequence field: name, formula, seq-format
1174 OUString sName = GetStringProperty(gsPropertyVariableName, rPropSet);
1175 // TODO: use reference name only if actually being referenced.
1179 sName));
1183 sPresentation);
1185 rPropSet));
1186 ExportElement(XML_SEQUENCE, sPresentation);
1187 break;
1188 }
1189
1191 {
1192 // formula field: formula, format&value
1193 bool bCmd = GetBoolProperty(gsPropertyIsShowFormula, rPropSet);
1196 sPresentation);
1197 ProcessDisplay(true, bCmd);
1201 sPresentation,
1203 !bCmd, !bCmd, !bCmd,
1206 rPropSet, xPropSetInfo, false ) );
1207 ExportElement(XML_EXPRESSION, sPresentation);
1208 break;
1209 }
1210
1212 // text input field: description and string-value
1216 GetStringProperty(gsPropertyHelp, rPropSet), true);
1218 GetStringProperty(gsPropertyTooltip, rPropSet), true);
1219 ExportElement(XML_TEXT_INPUT, sPresentation);
1220 break;
1221
1222 case FIELD_ID_TIME:
1223 // all properties (except IsDate) are optional!
1224 if (xPropSetInfo->hasPropertyByName(gsPropertyNumberFormat))
1225 {
1226 ProcessValueAndType(false,
1228 "", u"", 0.0, // not used
1229 false, false, true,
1232 rPropSet, xPropSetInfo, false ),
1233 true);
1234 }
1235 if (xPropSetInfo->hasPropertyByName(gsPropertyDateTimeValue))
1236 {
1237 // no value -> current time
1240 rPropSet));
1241 }
1242 if (xPropSetInfo->hasPropertyByName(gsPropertyDateTime))
1243 {
1244 // no value -> current time
1247 }
1248 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1249 {
1252 false);
1253 }
1254 if (xPropSetInfo->hasPropertyByName(gsPropertyAdjust))
1255 {
1256 // adjust value given as integer in minutes
1259 false, true);
1260 }
1261 ExportElement(XML_TIME, sPresentation);
1262 break;
1263
1264 case FIELD_ID_DATE:
1265 // all properties (except IsDate) are optional!
1266 if (xPropSetInfo->hasPropertyByName(gsPropertyNumberFormat))
1267 {
1268 ProcessValueAndType(false,
1270 "", u"", 0.0, // not used
1271 false, false, true,
1274 rPropSet, xPropSetInfo, false ) );
1275 }
1276 if (xPropSetInfo->hasPropertyByName(gsPropertyDateTimeValue))
1277 {
1278 // no value -> current date
1281 rPropSet));
1282 }
1283 // TODO: remove double-handling after SRC614
1284 else if (xPropSetInfo->hasPropertyByName(gsPropertyDateTime))
1285 {
1288 }
1289 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1290 {
1293 false);
1294 }
1295 if (xPropSetInfo->hasPropertyByName(gsPropertyAdjust))
1296 {
1297 // adjust value given as number of days
1300 true, true);
1301 }
1302 ExportElement(XML_DATE, sPresentation);
1303 break;
1304
1306 // all properties are optional
1307 if (xPropSetInfo->hasPropertyByName(gsPropertyNumberingType))
1308 {
1310 rPropSet));
1311 }
1312 if (xPropSetInfo->hasPropertyByName(gsPropertyOffset))
1313 {
1314 sal_Int32 nAdjust = GetIntProperty(gsPropertyOffset, rPropSet);
1315
1316 if (xPropSetInfo->hasPropertyByName(gsPropertySubType))
1317 {
1318 // property SubType used in MapPageNumberName
1320 MapPageNumberName(rPropSet, nAdjust));
1321 }
1323 }
1324 ExportElement(XML_PAGE_NUMBER, sPresentation);
1325 break;
1326
1328 {
1331 sPresentation);
1332 sal_Int32 nDummy = 0; // MapPageNumberName need int
1334 ExportElement(XML_PAGE_CONTINUATION, sPresentation);
1335 break;
1336 }
1337
1343 false);
1345 rPropSet, xPropSetInfo);
1346 break;
1347
1357 false);
1359 rPropSet, xPropSetInfo);
1360 break;
1361
1368 DBG_ASSERT(sPresentation.isEmpty(),
1369 "Unexpected presentation for database next field");
1371 rPropSet, xPropSetInfo);
1372 break;
1373
1382 DBG_ASSERT(sPresentation.isEmpty(),
1383 "Unexpected presentation for database select field");
1385 rPropSet, xPropSetInfo);
1386 break;
1387
1389 {
1390 // get database, table and column name from field master
1391 const Reference<XPropertySet> & xMaster = GetMasterPropertySet(rTextField);
1397 // export number format if available (happens only for numbers!)
1399 {
1400 ProcessValueAndType(false, // doesn't happen for text
1402 "", u"", 0.0, // not used
1403 false, false, true, false);
1404 }
1406 false);
1408 xMaster, xMaster->getPropertySetInfo());
1409 break;
1410 }
1411
1414 GetBoolProperty(gsPropertyIsFixed, rPropSet), false);
1415 ExportElement(MapDocInfoFieldName(nToken), sPresentation);
1416 break;
1417
1425 ProcessValueAndType(false,
1427 "", u"", 0.0,
1428 false, false, true,
1431 rPropSet, xPropSetInfo, false ) );
1432
1433 // todo: export date/time value, but values not available -> core bug
1435 GetBoolProperty(gsPropertyIsFixed, rPropSet), false);
1436 ExportElement(MapDocInfoFieldName(nToken), sPresentation);
1437 break;
1438
1446 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1447 {
1449 GetBoolProperty(gsPropertyIsFixed, rPropSet), false);
1450 }
1451 ExportElement(MapDocInfoFieldName(nToken), sPresentation);
1452 break;
1453
1455 {
1456 ProcessValueAndType(false, // doesn't happen for text
1458 "", u"", 0.0, // not used
1459 false, false, true,
1462 rPropSet, xPropSetInfo, false ));
1463 uno::Any aAny = rPropSet->getPropertyValue( gsPropertyName );
1464 OUString sName;
1465 aAny >>= sName;
1468 ExportElement(XML_USER_DEFINED, sPresentation);
1469 break;
1470 }
1471
1479 // all properties optional (applies to pages only, but I'll do
1480 // it for all for sake of common implementation)
1481 if (xPropSetInfo->hasPropertyByName(gsPropertyNumberingType))
1482 {
1484 rPropSet));
1485 }
1486 ExportElement(MapCountFieldName(nToken), sPresentation);
1487 break;
1488
1498 false);
1499 ExportElement(XML_CONDITIONAL_TEXT, sPresentation);
1500 break;
1501
1509 false);
1510 ExportElement(XML_HIDDEN_TEXT, sPresentation);
1511 break;
1512
1518 false);
1519 DBG_ASSERT(sPresentation.isEmpty(),
1520 "Unexpected presentation for hidden paragraph field");
1522 break;
1523
1528 ExportElement(XML_TEMPLATE_NAME, sPresentation);
1529 break;
1530
1531 case FIELD_ID_CHAPTER:
1535 // API numbers 0..9, we number 1..10
1537 GetInt8Property(gsPropertyLevel, rPropSet) + 1);
1538 ExportElement(XML_CHAPTER, sPresentation);
1539 break;
1540
1541 case FIELD_ID_FILE_NAME:
1542 // all properties are optional
1543 if (xPropSetInfo->hasPropertyByName(gsPropertyFileFormat))
1544 {
1548 }
1549 if (xPropSetInfo->hasPropertyByName(gsPropertyIsFixed))
1550 {
1553 false);
1554 }
1555 ExportElement(XML_FILE_NAME, sPresentation);
1556 break;
1557
1560 GetBoolProperty(gsPropertyOn, rPropSet), true);
1562 GetInt16Property(gsPropertyOffset, rPropSet), 0);
1563 DBG_ASSERT(sPresentation.isEmpty(),
1564 "Unexpected presentation page variable field");
1566 break;
1567
1571 ExportElement(XML_PAGE_VARIABLE_GET, sPresentation);
1572 break;
1573
1574 case FIELD_ID_MACRO:
1575 ExportMacro( rPropSet, sPresentation );
1576 break;
1577
1579 // reference to sequence: format, name, find value (and element)
1580 // was: if (nSeqNumber != -1) ...
1583 gsPropertyReferenceFieldPart, rPropSet)),
1584 XML_TEMPLATE);
1589 if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) &&
1590 GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)
1591 {
1592 // export text:reference-language attribute, if not empty
1595 }
1599 sPresentation);
1600 break;
1601
1604 // reference to bookmarks, references: format, name (and element)
1607 gsPropertyReferenceFieldPart, rPropSet)),
1608 XML_TEMPLATE);
1611 if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) &&
1612 GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)
1613 {
1614 // export text:reference-language attribute, if not empty
1617 }
1621 sPresentation);
1622 break;
1623
1626 // reference to end-/footnote: format, generate name, (and element)
1631 gsPropertyReferenceFieldPart, rPropSet)),
1632 XML_TEMPLATE);
1635 gsPropertySequenceNumber, rPropSet)));
1636 if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) &&
1637 GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)
1638 {
1639 // export text:reference-language attribute, if not empty
1642 }
1646 sPresentation);
1647 break;
1648
1649 case FIELD_ID_DDE:
1650 // name from field master
1652
1654 GetMasterPropertySet(rTextField)));
1655 ExportElement(XML_DDE_CONNECTION, sPresentation);
1656 break;
1657
1659 // name of spreadsheet (Calc only)
1660 ExportElement(XML_SHEET_NAME, sPresentation);
1661 break;
1662
1663 case FIELD_ID_PAGENAME:
1664 {
1665 if (GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)
1666 {
1668 GetExport().Characters( sPresentation );
1669 }
1670 break;
1671 }
1672
1673 case FIELD_ID_URL:
1674 {
1675 // this field is a special case because it gets mapped onto a
1676 // hyperlink, rather than one of the regular text field.
1677 ProcessString(XML_HREF, GetExport().GetRelativeReference(GetStringProperty(gsPropertyURL, rPropSet)),
1678 false, XML_NAMESPACE_XLINK);
1681 true, XML_NAMESPACE_OFFICE);
1684 false, false);
1685 GetExport().Characters(sPresentation);
1686 break;
1687 }
1688
1690 {
1691 ProcessBibliographyData(rPropSet);
1692 ExportElement(XML_BIBLIOGRAPHY_MARK, sPresentation);
1693 break;
1694 }
1695
1696 case FIELD_ID_SCRIPT:
1699 true, XML_NAMESPACE_SCRIPT);
1700 DBG_ASSERT(sPresentation.isEmpty(),
1701 "Unexpected presentation for script field");
1703 {
1705 GetExport().GetRelativeReference(GetStringProperty(gsPropertyContent, rPropSet)),
1706 false, XML_NAMESPACE_XLINK);
1708 }
1709 else
1710 {
1713 }
1714 break;
1715
1717 {
1718 // check for empty presentation (just in case)
1719 DBG_ASSERT(sPresentation.isEmpty(),
1720 "Unexpected presentation for annotation field");
1721
1722 bool bRemovePersonalInfo = SvtSecurityOptions::IsOptionSet(
1724
1725 // annotation element + content
1726 OUString aName;
1727 rPropSet->getPropertyValue(gsPropertyName) >>= aName;
1728 if (!aName.isEmpty())
1729 {
1731 }
1733 if (eVersion & SvtSaveOptions::ODFSVER_EXTENDED)
1734 {
1735 bool b = GetBoolProperty("Resolved", rPropSet);
1736 OUString aResolvedText;
1737 OUStringBuffer aResolvedTextBuffer;
1738 ::sax::Converter::convertBool(aResolvedTextBuffer, b);
1739 aResolvedText = aResolvedTextBuffer.makeStringAndClear();
1740
1742 }
1744 XML_ANNOTATION, false, true);
1745
1746 // author
1747 OUString aAuthor( GetStringProperty(gsPropertyAuthor, rPropSet) );
1748 if( !aAuthor.isEmpty() )
1749 {
1751 XML_CREATOR, true,
1752 false );
1753 GetExport().Characters( bRemovePersonalInfo
1754 ? "Author" + OUString::number( rExport.GetInfoID(aAuthor) )
1755 : aAuthor );
1756 }
1757
1758 // date time
1759 util::DateTime aDate( GetDateTimeProperty(gsPropertyDateTimeValue, rPropSet) );
1760 if ( !bRemovePersonalInfo )
1761 {
1762 OUStringBuffer aBuffer;
1763 ::sax::Converter::convertDateTime(aBuffer, aDate, nullptr, true);
1765 XML_DATE, true,
1766 false );
1767 GetExport().Characters(aBuffer.makeStringAndClear());
1768 }
1769
1770 if (GetExport().getSaneDefaultVersion() > SvtSaveOptions::ODFSVER_012)
1771 {
1772 // initials
1773 OUString aInitials( GetStringProperty(gsPropertyInitials, rPropSet) );
1774 if( !aInitials.isEmpty() )
1775 {
1776 // ODF 1.3 OFFICE-3776 export meta:creator-initials for ODF 1.3
1777 SvXMLElementExport aCreatorElem( GetExport(),
1778 (SvtSaveOptions::ODFSVER_013 <= GetExport().getSaneDefaultVersion())
1781
1782 (SvtSaveOptions::ODFSVER_013 <= GetExport().getSaneDefaultVersion())
1785 true, false );
1786 GetExport().Characters( bRemovePersonalInfo
1787 ? OUString::number( rExport.GetInfoID(aInitials) )
1788 : aInitials);
1789 }
1790 }
1791
1792 css::uno::Reference < css::text::XText > xText;
1793 try
1794 {
1795 css::uno::Any aRet = rPropSet->getPropertyValue(gsPropertyTextRange);
1796 aRet >>= xText;
1797 }
1798 catch ( css::uno::Exception& )
1799 {}
1800
1801 if ( xText.is() )
1802 GetExport().GetTextParagraphExport()->exportText( xText );
1803 else
1805 break;
1806 }
1807
1809 {
1810 // The style with the combined characters attribute has
1811 // already been handled in the ExportField method. So all that
1812 // is left to do now is to export the characters.
1813 GetExport().Characters(sPresentation);
1814 break;
1815 }
1816
1817 case FIELD_ID_META:
1818 {
1819 ExportMetaField(rPropSet, false, bProgress, rPrevCharIsSpace);
1820 break;
1821 }
1822
1823 case FIELD_ID_MEASURE:
1824 {
1826 ExportElement( XML_MEASURE, sPresentation );
1827 break;
1828 }
1829
1833 ProcessDisplay( true,
1835 ProcessValueAndType( false,
1837 "", u"", 0.0f,
1838 false, false, true,
1839 false );
1840 ExportElement( XML_TABLE_FORMULA, sPresentation );
1841 break;
1842
1843 case FIELD_ID_DROP_DOWN:
1844 {
1845 // tdf#133555 don't export in strict ODF versions that don't have it
1846 if (GetExport().getSaneDefaultVersion() <= SvtSaveOptions::ODFSVER_012)
1847 {
1848 break;
1849 }
1852 GetStringProperty(gsPropertyHelp, rPropSet), true);
1854 GetStringProperty(gsPropertyTooltip, rPropSet), true);
1857 false, false );
1861
1862 GetExport().Characters( sPresentation );
1863 }
1864 break;
1865
1867 {
1869 }
1870 break;
1871
1873 {
1875 }
1876 break;
1877
1879 {
1881 }
1882 break;
1883
1884
1885 case FIELD_ID_UNKNOWN:
1886 default:
1887 OSL_FAIL("unknown field type encountered!");
1888 // always export content
1889 GetExport().Characters(sPresentation);
1890 }
1891}
1892
1893
1896{
1897 Reference<XText> xEmptyText;
1898 ExportFieldDeclarations(xEmptyText);
1899}
1900
1903 const Reference<XText> & rText )
1904{
1905 // store lists for decl elements
1906 vector<OUString> aVarName;
1907 vector<OUString> aUserName;
1908 vector<OUString> aSeqName;
1909 vector<OUString> aDdeName;
1910
1911 // get text fields supplier and field master name access
1912 Reference<XTextFieldsSupplier> xTextFieldsSupp(GetExport().GetModel(),
1913 UNO_QUERY);
1914 if( !xTextFieldsSupp.is() )
1915 return;
1916
1917 Reference<container::XNameAccess> xFieldMasterNameAccess =
1918 xTextFieldsSupp->getTextFieldMasters();
1919
1920 // where to get the text field masters from?
1921 // a) we get a specific XText: then use pUsedMasters
1922 // b) the XText is empty: then export all text fields
1923 Sequence<OUString> aFieldMasters;
1924 if (rText.is())
1925 {
1926 // export only used masters
1927 DBG_ASSERT(nullptr != pUsedMasters,
1928 "field masters must be recorded in order to be "
1929 "written out separately" );
1930 if (nullptr != pUsedMasters)
1931 {
1932 map<Reference<XText>, set<OUString> > ::iterator aMapIter =
1933 pUsedMasters->find(rText);
1934 if (aMapIter != pUsedMasters->end())
1935 {
1936 // found the set of used field masters
1937 aFieldMasters = comphelper::containerToSequence(aMapIter->second);
1938 pUsedMasters->erase(rText);
1939 }
1940 // else: XText not found -> ignore
1941 }
1942 // else: no field masters have been recorded -> ignore
1943 }
1944 else
1945 {
1946 // no XText: export all!
1947 aFieldMasters = xFieldMasterNameAccess->getElementNames();
1948 }
1949
1950 for(const OUString& sFieldMaster : std::as_const(aFieldMasters)) {
1951
1952 // workaround for #no-bug#
1953 if ( sFieldMaster.startsWithIgnoreAsciiCase(
1954 "com.sun.star.text.FieldMaster.DataBase.") )
1955 {
1956 continue;
1957 }
1958
1959
1960 OUString sFieldMasterType;
1961 OUString sVarName;
1962 ExplodeFieldMasterName(sFieldMaster, sFieldMasterType, sVarName);
1963
1964 // get XPropertySet of this field master
1965 Reference<XPropertySet> xPropSet;
1966 Any aAny = xFieldMasterNameAccess->getByName(sFieldMaster);
1967 aAny >>= xPropSet;
1968
1969 // save interesting field masters
1970 if (sFieldMasterType == FIELD_SERVICE_SETEXP)
1971 {
1972 sal_Int32 nType = GetIntProperty(gsPropertySubType, xPropSet);
1973
1974 // sequence or variable?
1975 if ( SetVariableType::SEQUENCE == nType )
1976 {
1977 aSeqName.push_back( sFieldMaster );
1978 }
1979 else
1980 {
1981 aVarName.push_back( sFieldMaster );
1982 }
1983 }
1984 else if (sFieldMasterType == FIELD_SERVICE_USER)
1985 {
1986 aUserName.push_back( sFieldMaster );
1987 }
1988 else if (sFieldMasterType == FIELD_SERVICE_DDE)
1989 {
1990 aDdeName.push_back( sFieldMaster );
1991 }
1992 else
1993 {
1994 ; // ignore
1995 }
1996 }
1997
1998 // now process fields:
1999
2000 // variable field masters:
2001 if ( !aVarName.empty() )
2002 {
2006 true, true );
2007
2008 for (const auto& sName : aVarName)
2009 {
2010 // get field master property set
2011 Reference<XPropertySet> xPropSet;
2012 Any aAny = xFieldMasterNameAccess->getByName(sName);
2013 aAny >>= xPropSet;
2014
2015 // field name and type
2016 OUString sFieldMasterType;
2017 OUString sVarName;
2018 ExplodeFieldMasterName(sName, sFieldMasterType, sVarName);
2019
2020 // determine string/numeric field
2021 bool bIsString = ( GetIntProperty(gsPropertySubType, xPropSet)
2022 == SetVariableType::STRING );
2023
2024 // get dependent field property set
2025 Reference<XPropertySet> xFieldPropSet;
2026 if (GetDependentFieldPropertySet(xPropSet, xFieldPropSet))
2027 {
2028 // process value and type.
2030 bIsString,
2031 GetIntProperty(gsPropertyNumberFormat, xFieldPropSet),
2032 "", u"", 0.0,
2033 false, true, false, false);
2034 }
2035 else
2036 {
2037 // If no dependent field is found, only string and
2038 // float types can be supported
2039
2040 // number format: 0 is default number format for 1st
2041 // language. should be: getDefaultNumberFormat(Locale)
2042 // from NumberFormats
2044 bIsString,
2045 0, "", u"", 0.0,
2046 false, true, false, false);
2047 }
2048
2049 ProcessString(XML_NAME, sVarName);
2051 }
2052 }
2053 // else: no declarations element
2054
2055 // sequence field masters:
2056 if ( !aSeqName.empty() )
2057 {
2061 true, true );
2062
2063 for (const auto& sName : aSeqName)
2064 {
2065 // get field master property set
2066 Reference<XPropertySet> xPropSet;
2067 Any aAny = xFieldMasterNameAccess->getByName(sName);
2068 aAny >>= xPropSet;
2069
2070 // field name and type
2071 OUString sFieldMasterType;
2072 OUString sVarName;
2073 ExplodeFieldMasterName(sName, sFieldMasterType, sVarName);
2074
2075 // outline level
2076 sal_Int32 nLevel = 1 + GetIntProperty(
2078 DBG_ASSERT(nLevel >= 0, "illegal outline level");
2079 DBG_ASSERT(nLevel < 127, "possible illegal outline level");
2081
2082 // separation character
2083 if (nLevel > 0) {
2085 gsPropertyNumberingSeparator, xPropSet));
2086 }
2087 ProcessString(XML_NAME, sVarName);
2089 }
2090 }
2091 // else: no declarations element
2092
2093 // user field masters:
2094 if ( !aUserName.empty() )
2095 {
2099 true, true );
2100
2101 for (const auto& sName : aUserName)
2102 {
2103 // get field master property set
2104 Reference<XPropertySet> xPropSet;
2105 Any aAny = xFieldMasterNameAccess->getByName(sName);
2106 aAny >>= xPropSet;
2107
2108 // field name and type
2109 OUString sFieldMasterType;
2110 OUString sVarName;
2111 ExplodeFieldMasterName(sName, sFieldMasterType, sVarName);
2112
2114 {
2115 // expression:
2117 false,
2118 0, "", u"",
2120 true,
2121 true,
2122 false,
2123 false);
2124 }
2125 else
2126 {
2127 // string: write regardless of default
2132 false, XML_NAMESPACE_OFFICE );
2133 }
2134 ProcessString(XML_NAME, sVarName);
2136 }
2137 }
2138 // else: no declarations element
2139
2140 // DDE field masters:
2141 if ( aDdeName.empty() )
2142 return;
2143
2147 true, true );
2148
2149 for (const auto& sName : aDdeName)
2150 {
2151 // get field master property set
2152 Reference<XPropertySet> xPropSet;
2153 Any aAny = xFieldMasterNameAccess->getByName(sName);
2154 aAny >>= xPropSet;
2155
2156 // check if this connection is being used by a field
2157 Reference<XPropertySet> xDummy;
2158 if (GetDependentFieldPropertySet(xPropSet, xDummy))
2159 {
2160
2163 false, XML_NAMESPACE_OFFICE);
2164
2165 // export elements; can't use ProcessString because
2166 // elements are in office namespace
2169 xPropSet),
2170 false, XML_NAMESPACE_OFFICE);
2173 xPropSet),
2174 false, XML_NAMESPACE_OFFICE);
2177 xPropSet),
2178 false, XML_NAMESPACE_OFFICE);
2179 bool bIsAutomaticUpdate = GetBoolProperty(
2180 gsPropertyIsAutomaticUpdate, xPropSet);
2181 if (bIsAutomaticUpdate)
2182 {
2185 XML_TRUE);
2186 }
2187
2189 }
2190 // else: no dependent field -> no export of field declaration
2191 }
2192 // else: no declarations element
2193}
2194
2196 bool bExportOnlyUsed)
2197{
2198 pUsedMasters.reset();
2199
2200 // create used masters set (if none is used)
2201 if (bExportOnlyUsed)
2202 pUsedMasters.reset( new map<Reference<XText>, set<OUString> > );
2203}
2204
2205void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName,
2206 bool bAddSpace)
2207{
2208 // can't call ExportElement(eElementName, const OUString&) with empty
2209 // string because xmlprinter only uses empty tags if no content
2210 // (not even empty content) was written.
2211
2212 DBG_ASSERT(XML_TOKEN_INVALID != eElementName, "invalid element name!");
2213 if (XML_TOKEN_INVALID != eElementName)
2214 {
2215 // Element
2217 eElementName, bAddSpace, bAddSpace );
2218 } // else: ignore
2219}
2220
2221void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName,
2222 const OUString& sContent)
2223{
2224 DBG_ASSERT(eElementName != XML_TOKEN_INVALID, "invalid element name!");
2225 if (eElementName != XML_TOKEN_INVALID)
2226 {
2227 // Element
2229 eElementName, false, false );
2230 // export content
2231 GetExport().Characters(sContent);
2232 } else {
2233 // always export content
2234 GetExport().Characters(sContent);
2235 }
2236}
2237
2239 const Reference<XPropertySet> & rPropSet,
2240 const OUString& rContent )
2241{
2242 // some strings we'll need
2243 OUString sEventType( "EventType" );
2244
2245
2246 // the description attribute
2249 rContent);
2250
2251 // the element
2253 XML_EXECUTE_MACRO, false, false );
2254
2255 // the <office:events>-macro:
2256
2257 // 1) build sequence of PropertyValues
2258 Sequence<PropertyValue> aSeq;
2259 OUString sName;
2260 rPropSet->getPropertyValue("ScriptURL") >>= sName;
2261
2262 // if the ScriptURL property is not empty then this is a Scripting
2263 // Framework URL, otherwise treat it as a Basic Macro
2264 if (!sName.isEmpty())
2265 {
2266 OUString sScript( "Script" );
2267 aSeq = Sequence<PropertyValue>
2268 {
2271 };
2272 }
2273 else
2274 {
2275 aSeq = Sequence<PropertyValue>
2276 {
2277 comphelper::makePropertyValue(sEventType, OUString("StarBasic")),
2278 comphelper::makePropertyValue("Library", rPropSet->getPropertyValue( "MacroLibrary" )),
2279 comphelper::makePropertyValue("MacroName", rPropSet->getPropertyValue( "MacroName" ))
2280 };
2281 }
2282
2283 // 2) export the sequence
2284 GetExport().GetEventExport().ExportSingleEvent( aSeq, "OnClick", false );
2285
2286 // and finally, the field presentation
2287 GetExport().Characters(rContent);
2288}
2289
2291 const Reference<XPropertySet> & i_xMeta,
2292 bool i_bAutoStyles, bool i_bProgress,
2293 bool & rPrevCharIsSpace)
2294{
2295 bool doExport(!i_bAutoStyles); // do not export element if autostyles
2296 // check version >= 1.2
2297 switch (GetExport().getSaneDefaultVersion()) {
2298 case SvtSaveOptions::ODFSVER_011: // fall through
2299 case SvtSaveOptions::ODFSVER_010: doExport = false; break;
2300 default: break;
2301 }
2302
2303 const Reference < XEnumerationAccess > xEA( i_xMeta, UNO_QUERY_THROW );
2304 const Reference < XEnumeration > xTextEnum( xEA->createEnumeration() );
2305
2306 if (doExport)
2307 {
2308 const Reference<rdf::XMetadatable> xMeta( i_xMeta, UNO_QUERY_THROW );
2309
2310 // style:data-style-name
2311 ProcessValueAndType(false,
2313 "", u"", 0.0, false, false, true,
2314 false );
2315
2316 // text:meta-field without xml:id is invalid
2317 xMeta->ensureMetadataReference();
2318
2319 // xml:id for RDF metadata
2321 }
2322
2323 SvXMLElementExport aElem( GetExport(), doExport,
2324 XML_NAMESPACE_TEXT, XML_META_FIELD, false, false );
2325
2326 // recurse to export content
2328 exportTextRangeEnumeration(xTextEnum, i_bAutoStyles, i_bProgress, rPrevCharIsSpace);
2329}
2330
2333 bool bIsString,
2334 sal_Int32 nFormatKey,
2335 const OUString& sContent,
2336 std::u16string_view sDefault,
2337 double fValue,
2338 bool bExportValue,
2339 bool bExportValueType,
2340 bool bExportStyle,
2341 bool bForceSystemLanguage,
2342 bool bTimeStyle) // exporting a time style?
2343{
2344 // String or number?
2345 if (bIsString)
2346 {
2347
2348 // string: attributes value-type=string, string-value=...
2349
2350 if (bExportValue || bExportValueType)
2351 {
2353 GetExport(), sContent, sDefault, bExportValue);
2354 }
2355
2356 }
2357 else
2358 {
2359
2360 // number: value-type=..., value...=..., data-style-name=...
2361
2362 DBG_ASSERT(bExportValueType || !bExportValue, "value w/o value type not supported!");
2363
2364 // take care of illegal formats
2365 // (shouldn't happen, but does if document is corrupted)
2366 if (-1 != nFormatKey)
2367 {
2368 if (bExportValue || bExportValueType)
2369 {
2372 GetExport(), nFormatKey, fValue, bExportValue);
2373 }
2374
2375 if (bExportStyle)
2376 {
2377 // don't export language (if desired)
2378 if( bForceSystemLanguage )
2379 nFormatKey =
2381
2382 OUString sDataStyleName =
2383 GetExport().getDataStyleName(nFormatKey, bTimeStyle);
2384 if( !sDataStyleName.isEmpty() )
2385 {
2388 sDataStyleName );
2389 } // else: ignore (no valid number format)
2390 } // else: ignore (no number format)
2391 }
2392 }
2393}
2394
2395
2398 bool bIsCommand)
2399{
2400 enum XMLTokenEnum eValue;
2401
2402 if (bIsVisible)
2403 {
2404 eValue = bIsCommand ? XML_FORMULA : XML_VALUE;
2405 }
2406 else
2407 {
2408 eValue = XML_NONE;
2409 }
2410
2411 // omit attribute if default
2412 if (eValue != XML_VALUE)
2413 {
2415 }
2416}
2417
2418
2421 bool bBool, bool bDefault)
2422{
2423 SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff.text", "invalid element token");
2424 if ( XML_TOKEN_INVALID == eName )
2425 return;
2426
2427 // write attribute (if different than default)
2428 // negate to force 0/1 values (and make sal_Bool comparable)
2429 if ((!bBool) != (!bDefault)) {
2431 (bBool ? XML_TRUE : XML_FALSE) );
2432 }
2433}
2434
2435
2438 const OUString& sValue,
2439 bool bOmitEmpty,
2440 sal_uInt16 nPrefix)
2441{
2442 SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff.text", "invalid element token");
2443 if ( XML_TOKEN_INVALID == eName )
2444 return;
2445
2446 // check for empty string, if applicable
2447 if ( bOmitEmpty && sValue.isEmpty() )
2448 return;
2449
2450 // write attribute
2451 GetExport().AddAttribute(nPrefix, eName, sValue);
2452}
2453
2455 sal_uInt16 nValuePrefix,
2456 const OUString& sValue)
2457{
2458 OUString sQValue =
2459 GetExport().GetNamespaceMap().GetQNameByKey( nValuePrefix, sValue, false );
2460 ProcessString( eName, sQValue );
2461}
2462
2465 const OUString& sValue,
2466 std::u16string_view sDefault)
2467{
2468 if (sValue != sDefault)
2469 {
2470 ProcessString(eName, sValue);
2471 }
2472}
2473
2476 sal_uInt16 nValuePrefix,
2477 const OUString& sValue,
2478 std::u16string_view sDefault)
2479{
2480 if (sValue != sDefault)
2481 {
2482 ProcessString(eName, nValuePrefix, sValue);
2483 }
2484}
2485
2486
2489 enum XMLTokenEnum eName,
2490 enum XMLTokenEnum eValue,
2491 sal_uInt16 nPrefix)
2492{
2493 SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff.text", "invalid element token" );
2494 SAL_WARN_IF( eValue == XML_TOKEN_INVALID, "xmloff.text", "invalid value token" );
2495 if ( XML_TOKEN_INVALID == eName )
2496 return;
2497
2498 GetExport().AddAttribute(nPrefix, eName, eValue);
2499}
2500
2503 enum XMLTokenEnum eName,
2504 enum XMLTokenEnum eValue,
2505 enum XMLTokenEnum eDefault)
2506{
2507 if ( eValue != eDefault )
2508 ProcessString( eName, eValue);
2509}
2510
2511
2514 std::u16string_view sParagraphSequence)
2515{
2516 // iterate over all string-pieces separated by return (0x0a) and
2517 // put each inside a paragraph element.
2518 SvXMLTokenEnumerator aEnumerator(sParagraphSequence, char(0x0a));
2519 std::u16string_view aSubString;
2520 while (aEnumerator.getNextToken(aSubString))
2521 {
2522 SvXMLElementExport aParagraph(
2523 GetExport(), XML_NAMESPACE_TEXT, XML_P, true, false);
2524 GetExport().Characters(OUString(aSubString));
2525 }
2526}
2527
2528// export an integer attribute
2530 sal_Int32 nNum)
2531{
2532 SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff.text", "invalid element token");
2533 if ( XML_TOKEN_INVALID == eName )
2534 return;
2535
2537 OUString::number(nNum));
2538}
2539
2542 sal_Int32 nNum, sal_Int32 nDefault)
2543{
2544 if (nNum != nDefault)
2545 ProcessInteger(eName, nNum);
2546}
2547
2548
2550void XMLTextFieldExport::ProcessNumberingType(sal_Int16 nNumberingType)
2551{
2552 // process only if real format (not: like page descriptor)
2553 if (NumberingType::PAGE_DESCRIPTOR == nNumberingType)
2554 return;
2555
2556 OUStringBuffer sTmp( 10 );
2557 // number type: num format
2559 nNumberingType );
2561 sTmp.makeStringAndClear() );
2562 // and letter sync, if applicable
2563 SvXMLUnitConverter::convertNumLetterSync( sTmp, nNumberingType );
2564
2565 if (!sTmp.isEmpty())
2566 {
2568 sTmp.makeStringAndClear() );
2569 }
2570 // else: like page descriptor => ignore
2571}
2572
2573
2576 double dValue,
2577 bool bIsDate,
2578 bool bIsDuration,
2579 bool bOmitDurationIfZero,
2580 sal_uInt16 nPrefix)
2581{
2582 // truncate for date granularity
2583 if (bIsDate)
2584 {
2585 dValue = ::rtl::math::approxFloor(dValue);
2586 }
2587
2588 OUStringBuffer aBuffer;
2589 if (bIsDuration)
2590 {
2591 // date/time duration handle bOmitDurationIfZero
2592 if (!bOmitDurationIfZero || dValue != 0.0)
2593 {
2594 ::sax::Converter::convertDuration(aBuffer, dValue);
2595 }
2596 }
2597 else
2598 {
2599 // date/time value
2601 }
2602
2603 // output attribute
2604 ProcessString(eName, aBuffer.makeStringAndClear(), true, nPrefix);
2605}
2606
2609 const util::DateTime& rTime)
2610{
2611 OUStringBuffer aBuffer;
2612
2613 util::DateTime aDateTime(rTime);
2614
2615 // date/time value
2616 ::sax::Converter::convertDateTime(aBuffer, aDateTime, nullptr);
2617
2618 // output attribute
2619 ProcessString(eName, aBuffer.makeStringAndClear(), true);
2620}
2621
2624 sal_Int32 nMinutes,
2625 bool bIsDate,
2626 bool bIsDuration)
2627{
2628 // handle bOmitDurationIfZero here, because we can precisely compare ints
2629 if (!(bIsDuration && (nMinutes==0)))
2630 {
2631 ProcessDateTime(eName, static_cast<double>(nMinutes) / double(24*60),
2632 bIsDate, bIsDuration);
2633 }
2634}
2635
2638 const util::DateTime& rTime)
2639{
2640 OUStringBuffer aBuffer;
2641
2642 // date/time value
2644
2645 // output attribute
2646 ProcessString(eName, aBuffer.makeStringAndClear(), true);
2647}
2648
2649
2651{
2652 { XML_ARTICLE, BibliographyDataType::ARTICLE },
2653 { XML_BOOK, BibliographyDataType::BOOK },
2654 { XML_BOOKLET, BibliographyDataType::BOOKLET },
2655 { XML_CONFERENCE, BibliographyDataType::CONFERENCE },
2656 { XML_CUSTOM1, BibliographyDataType::CUSTOM1 },
2657 { XML_CUSTOM2, BibliographyDataType::CUSTOM2 },
2658 { XML_CUSTOM3, BibliographyDataType::CUSTOM3 },
2659 { XML_CUSTOM4, BibliographyDataType::CUSTOM4 },
2660 { XML_CUSTOM5, BibliographyDataType::CUSTOM5 },
2661 { XML_EMAIL, BibliographyDataType::EMAIL },
2662 { XML_INBOOK, BibliographyDataType::INBOOK },
2663 { XML_INCOLLECTION, BibliographyDataType::INCOLLECTION },
2664 { XML_INPROCEEDINGS, BibliographyDataType::INPROCEEDINGS },
2665 { XML_JOURNAL, BibliographyDataType::JOURNAL },
2666 { XML_MANUAL, BibliographyDataType::MANUAL },
2667 { XML_MASTERSTHESIS, BibliographyDataType::MASTERSTHESIS },
2668 { XML_MISC, BibliographyDataType::MISC },
2669 { XML_PHDTHESIS, BibliographyDataType::PHDTHESIS },
2670 { XML_PROCEEDINGS, BibliographyDataType::PROCEEDINGS },
2671 { XML_TECHREPORT, BibliographyDataType::TECHREPORT },
2672 { XML_UNPUBLISHED, BibliographyDataType::UNPUBLISHED },
2673 { XML_WWW, BibliographyDataType::WWW },
2674 { XML_TOKEN_INVALID, 0 }
2675};
2676
2677
2679 const Reference<XPropertySet>& rPropSet)
2680{
2681 // get the values
2682 Any aAny = rPropSet->getPropertyValue(gsPropertyFields);
2683 Sequence<PropertyValue> aValues;
2684 aAny >>= aValues;
2685
2686 // one attribute per value (unless empty)
2687 for (const auto& rProp : std::as_const(aValues))
2688 {
2689 if( rProp.Name == "BibiliographicType" )
2690 {
2691 sal_Int16 nTypeId = 0;
2692 rProp.Value >>= nTypeId;
2693 OUStringBuffer sBuf;
2694
2695 if (SvXMLUnitConverter::convertEnum(sBuf, nTypeId,
2697 {
2700 sBuf.makeStringAndClear());
2701 }
2702 // else: ignore this argument
2703 }
2704 else
2705 {
2706 OUString sStr;
2707 rProp.Value >>= sStr;
2708
2709 if (!sStr.isEmpty())
2710 {
2711 XMLTokenEnum eElement = MapBibliographyFieldName(rProp.Name);
2712 if (eElement == XML_URL || eElement == XML_LOCAL_URL)
2713 {
2714 sStr = GetExport().GetRelativeReference(sStr);
2715 }
2716 sal_uInt16 nPrefix = XML_NAMESPACE_TEXT;
2717 if (eElement == XML_LOCAL_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
3419 {
3420 SAL_WARN("xmloff.text", "Unknown bibliography info data");
3421 eName = XML_TOKEN_INVALID;
3422 }
3423
3424 return eName;
3425}
3426
3428{
3429 switch( nKind )
3430 {
3431 case 0:
3432 return XML_VALUE;
3433 case 1:
3434 return XML_UNIT;
3435 }
3436 return XML_GAP;
3437}
3438
3440 sal_Int16 nSeqNo)
3441{
3442 // generate foot-/endnote ID
3443 return "ftn" + OUString::number(static_cast<sal_Int32>(nSeqNo));
3444}
3445
3447 sal_Int16 nSeqNo,
3448 std::u16string_view rSeqName)
3449{
3450 // generate foot-/endnote ID
3451 return OUString::Concat("ref") +rSeqName + OUString::number(static_cast<sal_Int32>(nSeqNo));
3452}
3453
3454
3455// Property accessor helper functions
3456
3457
3458// to be relegated (does that word exist?) to a more appropriate place
3459
3460
3462 const OUString& sPropName,
3463 const Reference<XPropertySet> & xPropSet)
3464{
3465 Any aAny = xPropSet->getPropertyValue(sPropName);
3466 bool bBool = *o3tl::doAccess<bool>(aAny);
3467 return bBool;
3468}
3469
3471 const OUString& sPropName,
3472 const Reference<XPropertySet> & xPropSet,
3473 const Reference<XPropertySetInfo> & xPropSetInfo,
3474 bool bDefault)
3475{
3476 return xPropSetInfo->hasPropertyByName( sPropName )
3477 ? GetBoolProperty( sPropName, xPropSet ) : bDefault;
3478}
3479
3481 const OUString& sPropName,
3482 const Reference<XPropertySet> & xPropSet)
3483{
3484 Any aAny = xPropSet->getPropertyValue(sPropName);
3485 double fDouble = 0.0;
3486 aAny >>= fDouble;
3487 return fDouble;
3488}
3489
3491 const OUString& sPropName,
3492 const Reference<XPropertySet> & xPropSet)
3493{
3494 Any aAny = xPropSet->getPropertyValue(sPropName);
3495 OUString sString;
3496 aAny >>= sString;
3497 return sString;
3498}
3499
3501 const OUString& sPropName,
3502 const Reference<XPropertySet> & xPropSet)
3503{
3504 Any aAny = xPropSet->getPropertyValue(sPropName);
3505 sal_Int32 nInt = 0;
3506 aAny >>= nInt;
3507 return nInt;
3508}
3509
3511 const OUString& sPropName,
3512 const Reference<XPropertySet> & xPropSet)
3513{
3514 Any aAny = xPropSet->getPropertyValue(sPropName);
3515 sal_Int16 nInt = 0;
3516 aAny >>= nInt;
3517 return nInt;
3518}
3519
3521 const OUString& sPropName,
3522 const Reference<XPropertySet> & xPropSet)
3523{
3524 Any aAny = xPropSet->getPropertyValue(sPropName);
3525 sal_Int8 nInt = 0;
3526 aAny >>= nInt;
3527 return nInt;
3528}
3529
3530util::DateTime GetDateTimeProperty(
3531 const OUString& sPropName,
3532 const Reference<XPropertySet> & xPropSet)
3533{
3534 Any aAny = xPropSet->getPropertyValue(sPropName);
3535 util::DateTime aTime;
3536 aAny >>= aTime;
3537 return aTime;
3538}
3539
3540Sequence<OUString> GetStringSequenceProperty(
3541 const OUString& sPropName,
3542 const Reference<XPropertySet> & xPropSet)
3543{
3544 Any aAny = xPropSet->getPropertyValue(sPropName);
3545 Sequence<OUString> aSequence;
3546 aAny >>= aSequence;
3547 return aSequence;
3548}
3549
3550/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SvXMLNamespaceMap & GetNamespaceMap() const
Definition: xmlexp.hxx:390
OUString GetRelativeReference(const OUString &rValue)
Definition: xmlexp.cxx:2064
void AddAttributeXmlId(css::uno::Reference< css::uno::XInterface > const &i_xIfc)
add xml:id attribute (for RDF metadata)
Definition: xmlexp.cxx:2297
XMLEventExport & GetEventExport()
get Event export, with handlers for script types "None" and "StarBasic" already registered; other han...
Definition: xmlexp.cxx:1993
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
Definition: xmlexp.hxx:562
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
Definition: xmlexp.cxx:911
void Characters(const OUString &rChars)
Definition: xmlexp.cxx:2133
sal_Int32 dataStyleForceSystemLanguage(sal_Int32 nFormat) const
Definition: xmlexp.cxx:1836
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat=false) const
Definition: xmlexp.cxx:1824
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
Definition: xmlexp.cxx:2271
virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat=false)
Definition: xmlexp.cxx:1803
const SvXMLUnitConverter & GetMM100UnitConverter() const
Definition: xmlexp.hxx:396
size_t GetInfoID(const OUString sPersonalInfo) const
Definition: xmlexp.hxx:393
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
bool getNextToken(std::u16string_view &rToken)
Definition: xmluconv.cxx:528
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:654
void convertDateTime(OUStringBuffer &rBuffer, const double &fDateTime, bool const bAddTimeIf0AM=false)
convert double to ISO Date Time String
Definition: xmluconv.cxx:376
static void convertNumLetterSync(OUStringBuffer &rBuffer, sal_Int16 nType)
Definition: xmluconv.cxx:751
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:2637
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:2332
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:973
XMLTextFieldExport(SvXMLExport &rExp, std::unique_ptr< XMLPropertyState > pCombinedCharState)
Definition: txtflde.cxx:373
static OUString MakeSequenceRefName(sal_Int16 nSeqNo, std::u16string_view rSeqName)
make reference name for a sequence field
Definition: txtflde.cxx:3446
void ProcessIntegerDef(enum ::xmloff::token::XMLTokenEnum eXmlName, sal_Int32 nNum, sal_Int32 nDefault)
attribute value
Definition: txtflde.cxx:2541
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:2195
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:3439
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:2529
void ExportFieldDeclarations()
export field declarations.
Definition: txtflde.cxx:1895
void ProcessBibliographyData(const css::uno::Reference< css::beans::XPropertySet > &rPropertySet)
date/time value
Definition: txtflde.cxx:2678
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:439
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:2290
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:386
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:750
static bool IsStringField(FieldIdEnum nFieldType, const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
determine, whether field has string or numeric content
Definition: txtflde.cxx:633
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:3427
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:2513
void ProcessNumberingType(sal_Int16 nNumberingType)
export a numbering format (numeric, roman, alphabetic, etc.)
Definition: txtflde.cxx:2550
void ExportMacro(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &rContent)
element content
Definition: txtflde.cxx:2238
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:1029
void ProcessDisplay(bool bIsVisible, bool bIsCommand)
numbering type key
Definition: txtflde.cxx:2397
SvXMLExport & GetExport()
Definition: txtflde.hxx:212
void ProcessBoolean(enum ::xmloff::token::XMLTokenEnum eXmlName, bool bBool, bool bDefault)
export a boolean attribute
Definition: txtflde.cxx:2420
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 aName
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
const char * sName
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:1366
@ XML_SEPARATION_CHARACTER
Definition: xmltoken.hxx:1712
@ XML_REFERENCE_LANGUAGE
Definition: xmltoken.hxx:3449
@ XML_SENDER_PHONE_PRIVATE
Definition: xmltoken.hxx:1704
@ XML_STRING_VALUE_IF_TRUE
Definition: xmltoken.hxx:1869
@ XML_AUTOMATIC_UPDATE
Definition: xmltoken.hxx:303
@ XML_BIBLIOGRAPHY_MARK
Definition: xmltoken.hxx:329
@ XML_DDE_CONNECTION_DECL
Definition: xmltoken.hxx:635
@ XML_CONDITIONAL_TEXT
Definition: xmltoken.hxx:485
@ XML_DATABASE_ROW_SELECT
Definition: xmltoken.hxx:2740
@ XML_SENDER_POSTAL_CODE
Definition: xmltoken.hxx:1707
@ XML_DATABASE_ROW_NUMBER
Definition: xmltoken.hxx:615
@ XML_CATEGORY_AND_VALUE
Definition: xmltoken.hxx:404
@ XML_NUMBER_NO_SUPERIOR
Definition: xmltoken.hxx:3278
@ XML_PLAIN_NUMBER_AND_NAME
Definition: xmltoken.hxx:1521
@ XML_EDITING_DURATION
Definition: xmltoken.hxx:729
@ XML_CONNECTION_RESOURCE
Definition: xmltoken.hxx:2374
@ XML_BIBLIOGRAPHY_TYPE
Definition: xmltoken.hxx:331
@ XML_DDE_CONNECTION_DECLS
Definition: xmltoken.hxx:636
@ XML_NUMBER_ALL_SUPERIOR
Definition: xmltoken.hxx:3279
@ XML_DISPLAY_OUTLINE_LEVEL
Definition: xmltoken.hxx:689
@ XML_DATABASE_DISPLAY
Definition: xmltoken.hxx:610
@ XML_SENDER_STATE_OR_PROVINCE
Definition: xmltoken.hxx:1708
@ XML_STRING_VALUE_IF_FALSE
Definition: xmltoken.hxx:1868
DefTokenId nToken
QPRO_FUNC_TYPE nType
std::map< OUString, rtl::Reference< Entity > > map
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:141
constexpr OUStringLiteral gsPropertyNumberingSeparator(u"NumberingSeparator")
constexpr OUStringLiteral gsPropertyDateTime(u"DateTime")
constexpr OUStringLiteral gsPropertyOffset(u"Offset")
char const FIELD_SERVICE_USERINPUT[]
Definition: txtflde.cxx:94
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:114
static bool GetOptionalBoolProperty(const OUString &, const Reference< XPropertySet > &, const Reference< XPropertySetInfo > &, bool bDefault)
Definition: txtflde.cxx:3470
constexpr OUStringLiteral gsPropertyDDECommandFile(u"DDECommandFile")
constexpr OUStringLiteral gsPropertyIsExpression(u"IsExpression")
char const FIELD_SERVICE_MACRO[]
Definition: txtflde.cxx:145
char const FIELD_SERVICE_DDE[]
Definition: txtflde.cxx:147
char const FIELD_SERVICE_META[]
Definition: txtflde.cxx:153
char const FIELD_SERVICE_COMBINED_CHARACTERS[]
Definition: txtflde.cxx:152
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:121
char const FIELD_SERVICE_DOC_INFO_REVISION2[]
Definition: txtflde.cxx:130
constexpr OUStringLiteral gsPropertyTooltip(u"Tooltip")
char const FIELD_SERVICE_ANNOTATION[]
Definition: txtflde.cxx:151
char const FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR[]
Definition: txtflde.cxx:113
constexpr OUStringLiteral gsPropertySetNumber(u"SetNumber")
constexpr OUStringLiteral gsPropertyInstanceName(u"InstanceName")
SvXMLEnumStringMapEntry< FieldIdEnum > const aFieldServiceNameMapping[]
Definition: txtflde.cxx:183
constexpr OUStringLiteral gsPropertyIsHidden(u"IsHidden")
static OUString GetStringProperty(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3490
char const FIELD_SERVICE_PAGE_COUNT[]
Definition: txtflde.cxx:134
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:138
constexpr OUStringLiteral gsPropertyOn(u"On")
char const FIELD_SERVICE_URL[]
Definition: txtflde.cxx:148
constexpr OUStringLiteral gsPropertyNumberingType(u"NumberingType")
char const FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME2[]
Definition: txtflde.cxx:122
constexpr OUStringLiteral gsPropertyDataBaseName(u"DataBaseName")
char const FIELD_SERVICE_DB_NEXT[]
Definition: txtflde.cxx:97
constexpr OUStringLiteral gsPropertyDataTableName(u"DataTableName")
static sal_Int16 GetInt16Property(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3510
constexpr OUStringLiteral gsPropertyAuthor(u"Author")
char const FIELD_SERVICE_CHAPTER[]
Definition: txtflde.cxx:132
constexpr OUStringLiteral gsPropertyIsShowFormula(u"IsShowFormula")
char const FIELD_SERVICE_SENDER[]
Definition: txtflde.cxx:87
constexpr OUStringLiteral gsPropertySequenceValue(u"SequenceValue")
constexpr OUStringLiteral gsPropertyDDECommandElement(u"DDECommandElement")
constexpr OUStringLiteral gsPropertySelectedItem(u"SelectedItem")
char const FIELD_SERVICE_DATETIME[]
Definition: txtflde.cxx:95
constexpr OUStringLiteral gsPropertyValue(u"Value")
constexpr OUStringLiteral gsPropertyIsVisible(u"IsVisible")
char const FIELD_SERVICE_PARAGRAPH_COUNT[]
Definition: txtflde.cxx:135
static bool GetBoolProperty(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3461
char const FIELD_SERVICE_DOC_INFO_SUBJECT2[]
Definition: txtflde.cxx:126
constexpr OUStringLiteral gsPropertyFullName(u"FullName")
char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME[]
Definition: txtflde.cxx:107
constexpr OUStringLiteral gsPropertySourceName(u"SourceName")
char const FIELD_SERVICE_DOC_INFO_DESCRIPTION[]
Definition: txtflde.cxx:111
constexpr OUStringLiteral gsPropertyIsDataBaseFormat(u"DataBaseFormat")
char const FIELD_SERVICE_OBJECT_COUNT[]
Definition: txtflde.cxx:140
constexpr OUStringLiteral gsPropertyMeasureKind(u"Kind")
constexpr OUStringLiteral gsPropertyDDECommandType(u"DDECommandType")
char const FIELD_SERVICE_PAGE_NAME[]
Definition: txtflde.cxx:144
char const FIELD_SERVICE_SETEXP[]
Definition: txtflde.cxx:91
constexpr OUStringLiteral gsPropertyIsConditionTrue(u"IsConditionTrue")
constexpr OUStringLiteral gsPropertyURLContent(u"URLContent")
constexpr OUStringLiteral gsPropertyFileFormat(u"FileFormat")
char const FIELD_SERVICE_USER[]
Definition: txtflde.cxx:92
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:149
constexpr OUStringLiteral gsPropertyIsAutomaticUpdate(u"IsAutomaticUpdate")
char const FIELD_SERVICE_MEASURE[]
Definition: txtflde.cxx:154
constexpr OUStringLiteral gsPropertyHint(u"Hint")
char const FIELD_SERVICE_HIDDEN_TEXT[]
Definition: txtflde.cxx:103
constexpr OUStringLiteral gsPropertyInitials(u"Initials")
char const FIELD_SERVICE_DB_DISPLAY[]
Definition: txtflde.cxx:100
char const FIELD_SERVICE_SCRIPT[]
Definition: txtflde.cxx:150
constexpr OUStringLiteral gsPropertyTextRange(u"TextRange")
char const FIELD_SERVICE_DOC_INFO_REVISION[]
Definition: txtflde.cxx:129
char const FIELD_SERVICE_WORD_COUNT[]
Definition: txtflde.cxx:136
constexpr OUStringLiteral gsPropertyDataCommandType(u"DataCommandType")
char const FIELD_SERVICE_DOC_INFO_KEY_WORDS[]
Definition: txtflde.cxx:123
char const FIELD_SERVICE_DOC_INFO_KEY_WORDS2[]
Definition: txtflde.cxx:124
static sal_Int8 GetInt8Property(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3520
char const FIELD_SERVICE_GET_REFERENCE[]
Definition: txtflde.cxx:146
char const FIELD_SERVICE_FILE_NAME[]
Definition: txtflde.cxx:131
char const FIELD_SERVICE_DOC_INFO_DESCRIPTION2[]
Definition: txtflde.cxx:112
char const FIELD_SERVICE_DOC_INFO_TITLE2[]
Definition: txtflde.cxx:128
char const FIELD_SERVICE_DB_SELECT[]
Definition: txtflde.cxx:98
char const FIELD_SERVICE_TEMPLATE_NAME[]
Definition: txtflde.cxx:133
char const FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME[]
Definition: txtflde.cxx:115
char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR[]
Definition: txtflde.cxx:105
char const FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME2[]
Definition: txtflde.cxx:108
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:116
constexpr OUStringLiteral gsPropertyUserText(u"UserText")
constexpr OUStringLiteral gsPropertyScriptType(u"ScriptType")
char const FIELD_SERVICE_REFERENCE_PAGE_GET[]
Definition: txtflde.cxx:142
constexpr OUStringLiteral gsPropertyFalseContent(u"FalseContent")
constexpr OUStringLiteral gsPropertyCharStyleNames(u"CharStyleNames")
char const FIELD_SERVICE_CONDITIONAL_TEXT[]
Definition: txtflde.cxx:102
constexpr OUStringLiteral gsPropertyTargetFrame(u"TargetFrame")
constexpr OUStringLiteral gsPropertyHelp(u"Help")
char const FIELD_SERVICE_HIDDEN_PARAGRAPH[]
Definition: txtflde.cxx:104
static double GetDoubleProperty(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3480
static Sequence< OUString > GetStringSequenceProperty(const OUString &sPropName, const Reference< XPropertySet > &xPropSet)
Definition: txtflde.cxx:3540
char const FIELD_SERVICE_DOC_INFO_SUBJECT[]
Definition: txtflde.cxx:125
static util::DateTime GetDateTimeProperty(const OUString &sPropName, const Reference< XPropertySet > &xPropSet)
Definition: txtflde.cxx:3530
char const FIELD_SERVICE_JUMPEDIT[]
Definition: txtflde.cxx:89
constexpr OUStringLiteral gsPropertyReferenceFieldSource(u"ReferenceFieldSource")
constexpr OUStringLiteral gsPropertyName(u"Name")
char const FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR2[]
Definition: txtflde.cxx:106
char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR[]
Definition: txtflde.cxx:119
constexpr OUStringLiteral gsServicePrefix(u"com.sun.star.text.textfield.")
constexpr OUStringLiteral gsPropertyChapterFormat(u"ChapterFormat")
char const FIELD_SERVICE_PAGENUMBER[]
Definition: txtflde.cxx:96
char const FIELD_SERVICE_DOC_INFO_EDIT_TIME2[]
Definition: txtflde.cxx:110
char const FIELD_SERVICE_DB_NAME[]
Definition: txtflde.cxx:101
constexpr OUStringLiteral gsPropertyIsFixed(u"IsFixed")
char const FIELD_SERVICE_DOC_INFO_CUSTOM2[]
Definition: txtflde.cxx:118
char const FIELD_SERVICE_SHEET_NAME[]
Definition: txtflde.cxx:143
constexpr OUStringLiteral gsPropertyFieldSubType(u"UserDataType")
constexpr OUStringLiteral gsPropertyFields(u"Fields")
char const FIELD_SERVICE_REFERENCE_PAGE_SET[]
Definition: txtflde.cxx:141
char const FIELD_SERVICE_CHARACTER_COUNT[]
Definition: txtflde.cxx:137
constexpr OUStringLiteral gsPropertyIsInput(u"Input")
constexpr OUStringLiteral gsPropertyTrueContent(u"TrueContent")
char const FIELD_SERVICE_GRAPHIC_COUNT[]
Definition: txtflde.cxx:139
char const FIELD_SERVICE_GETEXP[]
Definition: txtflde.cxx:90
constexpr OUStringLiteral gsPropertyNumberFormat(u"NumberFormat")
char const FIELD_SERVICE_TABLE_FORMULA[]
Definition: txtflde.cxx:155
char const FIELD_SERVICE_AUTHOR[]
Definition: txtflde.cxx:88
char const FIELD_SERVICE_DOC_INFO_TITLE[]
Definition: txtflde.cxx:127
char const FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR2[]
Definition: txtflde.cxx:120
constexpr OUStringLiteral gsPropertyReferenceFieldLanguage(u"ReferenceFieldLanguage")
char const FIELD_SERVICE_DOC_INFO_EDIT_TIME[]
Definition: txtflde.cxx:109
constexpr OUStringLiteral gsPropertyDependentTextFields(u"DependentTextFields")
constexpr OUStringLiteral gsPropertyVariableName(u"VariableName")
char const FIELD_SERVICE_DB_NUMBER[]
Definition: txtflde.cxx:99
char const FIELD_SERVICE_DROP_DOWN[]
Definition: txtflde.cxx:156
constexpr OUStringLiteral gsPropertySubType(u"SubType")
char const FIELD_SERVICE_INPUT[]
Definition: txtflde.cxx:93
constexpr OUStringLiteral gsPropertyURL(u"URL")
char const FIELD_SERVICE_DOC_INFO_CUSTOM[]
Definition: txtflde.cxx:117
SvXMLEnumMapEntry< sal_Int16 > const aBibliographyDataTypeMap[]
Definition: txtflde.cxx:2650
static sal_Int32 GetIntProperty(const OUString &, const Reference< XPropertySet > &)
Definition: txtflde.cxx:3500
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