20#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
21#include <com/sun/star/document/XDocumentProperties.hpp>
22#include <com/sun/star/frame/XModel.hpp>
24#include <osl/diagnose.h>
45struct HTMLNumFormatTableEntry
47 std::string_view
pName;
203 while( pOptEnums->
pName )
214 bool bKnownType =
false, bFixed =
false,
215 bHasNumFormat =
false, bHasNumValue =
false;
217 OUString aValue, aNumFormat, aNumValue,
aName;
218 const HTMLOption *pSubOption=
nullptr, *pFormatOption=
nullptr;
223 for (
i = rHTMLOptions.size();
i; )
228 case HtmlOptionId::TYPE:
231 case HtmlOptionId::SUBTYPE:
232 pSubOption = &rOption;
234 case HtmlOptionId::FORMAT:
235 pFormatOption = &rOption;
237 case HtmlOptionId::NAME:
240 case HtmlOptionId::VALUE:
243 case HtmlOptionId::SDNUM:
245 bHasNumFormat =
true;
247 case HtmlOptionId::SDVAL:
251 case HtmlOptionId::SDFIXED:
271 OSL_ENSURE(pDocShell,
"no SwDocShell");
273 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
274 pDocShell->
GetModel(), uno::UNO_QUERY_THROW);
275 uno::Reference<document::XDocumentProperties> xDocProps(
276 xDPS->getDocumentProperties());
277 OSL_ENSURE(xDocProps.is(),
"Doc has no DocumentProperties");
278 const OUString& rChanged = xDocProps->getModifiedBy();
279 const OUString& rCreated = xDocProps->getAuthor();
280 if( rUser.isEmpty() ||
281 (!rChanged.isEmpty() ? rUser != rChanged : rUser != rCreated) )
290 SwFieldType* pType =
m_xDoc->getIDocumentFieldsAccess().GetSysFieldType( nWhich );
291 std::unique_ptr<SwField> xNewField;
292 bool bInsOnEndTag =
false;
329 sal_uInt32 nNumFormat = 0;
331 sal_Int64 nTime = aDateTime.
GetTime();
332 sal_Int32 nDate = aDateTime.
GetDate();
334 bool bValidFormat =
false;
335 HTMLNumFormatTableEntry
const * pFormatTable;
341 if( !aValue.isEmpty() )
342 nDate = aValue.toInt32();
348 if( !aValue.isEmpty() )
349 nTime =
static_cast<sal_uLong>(aValue.toInt32());
351 if( !aValue.isEmpty() )
357 const OUString& rFormat = pFormatOption->GetString();
358 for(
int k = 0; !pFormatTable[k].pName.empty(); ++k )
360 if( rFormat.equalsIgnoreAsciiCaseAscii( pFormatTable[k].pName ) )
386 sal_uInt32 nNumFormat;
389 nNumFormat, eLang, aNumValue, aNumFormat,
390 *
m_xDoc->GetNumberFormatter() );
392 switch( nFormatType )
394 case SvNumFormatType::DATE: nSub =
DATEFLD;
break;
395 case SvNumFormatType::TIME: nSub =
TIMEFLD;
break;
424 nOff =
static_cast<short>(aValue.toInt32());
447 sal_uInt16 nExtSub = 0;
457 sal_uInt32 nNumFormat = 0;
463 nNumFormat, eLang, aNumValue, aNumFormat,
464 *
m_xDoc->GetNumberFormatter() );
465 bFixed &= bHasNumValue;
468 bHasNumValue =
false;
547 "Field DocInfo should not have been saved" );
553 "Field ExtUser should not have been saved" );
559 "Field Author should not have been saved" );
565 "Field FileName should not have been saved" );
595 if( bEmpty && !pTag.empty() )
603 OUString aComment( rComment );
607 OUString::createFromAscii(pTag) +
616 bool bMoveFwd =
false;
sal_Int32 GetDate() const
SwNodeOffset GetStartParagraphIdx() const
std::unique_ptr< SfxPoolItem > m_pItem
sal_Int32 GetStartContent() const
HtmlOptionId GetToken() const
const OUString & GetString() const
EnumT GetEnum(const HTMLOptionEnum< EnumT > *pOptEnums, EnumT nDflt=static_cast< EnumT >(0)) const
static double GetTableDataOptionsValNum(sal_uInt32 &nNumForm, LanguageType &eNumLang, const OUString &aValStr, std::u16string_view aNumStr, SvNumberFormatter &rFormatter)
css::uno::Reference< css::frame::XModel3 > GetModel() const
OUString GetFullName() const
Instances of SwFields and those derived from it occur 0 to n times.
SwFieldType * GetTyp() const
void InsertComment(const OUString &rName, std::string_view pTag={})
void InsertAttr(const SfxPoolItem &rItem, bool bInsAtStart)
static SvxNumType GetNumType(std::u16string_view rStr, SvxNumType eDfltType)
rtl::Reference< SwDoc > m_xDoc
std::unique_ptr< SwField > m_xField
OUString m_InfoNames[4]
the names corresponding to the DOCINFO field subtypes INFO[1-4]
void InsertCommentText(std::string_view pTag)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNode & GetPointNode() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * GetPoint() const
SwTextNode is a paragraph in the document model.
const OUString & GetText() const
virtual void SetValue(tools::Long nNew) override
sal_uInt16 SwDocInfoSubType
@ Database
For old documents the Field-Which IDs must be preserved !!!
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
HTMLOptionEnum< SwPageNumSubType > const aHTMLPageNumFieldSubTable[]
HTMLOptionEnum< SwExtUserSubType > const aHTMLExtUsrFieldSubTable[]
HTMLOptionEnum< SwFieldIds > const aHTMLFieldTypeTable[]
HTMLOptionEnum< sal_uInt16 > const aHTMLDocInfoFieldSubTable[]
HTMLOptionEnum< SwDocStatSubType > const aHTMLDocStatFieldSubTable[]
HTMLOptionEnum< SvxNumType > const aHTMLPageNumFieldFormatTable[]
HTMLOptionEnum< sal_uInt16 > const aHTMLDocInfoFieldFormatTable[]
HTMLOptionEnum< SwFileNameFormat > const aHTMLFileNameFieldFormatTable[]
const SwDocInfoSubType DI_INFO3
const SwDocInfoSubType DI_INFO4
HTMLNumFormatTableEntry const aHTMLTimeFieldFormatTable[]
const SwDocInfoSubType DI_INFO2
HTMLNumFormatTableEntry const aHTMLDateFieldFormatTable[]
HTMLOptionEnum< SwAuthorFormat > const aHTMLAuthorFieldFormatTable[]
const SwDocInfoSubType DI_INFO1
#define OOO_STRING_SW_HTML_FF_char
#define OOO_STRING_SW_HTML_FS_custom
#define OOO_STRING_SW_HTML_FF_lletter
#define OOO_STRING_SW_HTML_FF_arabic
#define OOO_STRING_SW_HTML_FS_company
#define OOO_STRING_SW_HTML_FS_tbl
#define OOO_STRING_SW_HTML_FS_street
#define OOO_STRING_SW_HTML_FS_zip
#define OOO_STRING_SW_HTML_FS_prev
#define OOO_STRING_SW_HTML_FS_shortcut
#define OOO_STRING_SW_HTML_FS_email
#define OOO_STRING_SW_HTML_FS_grf
#define OOO_STRING_SW_HTML_FF_uletter
#define OOO_STRING_SW_HTML_FF_page
#define OOO_STRING_SW_HTML_FS_pphone
#define OOO_STRING_SW_HTML_FS_char
#define OOO_STRING_SW_HTML_FF_date
#define OOO_STRING_SW_HTML_FF_name
#define OOO_STRING_SW_HTML_FS_title
#define OOO_STRING_SW_HTML_FS_theme
#define OOO_STRING_SW_HTML_FS_fax
#define OOO_STRING_SW_HTML_FS_change
#define OOO_STRING_SW_HTML_FF_none
#define OOO_STRING_SW_HTML_FS_word
#define OOO_STRING_SW_HTML_FS_para
#define OOO_STRING_SW_HTML_FS_random
#define OOO_STRING_SW_HTML_FF_lroman
#define OOO_STRING_SW_HTML_FS_next
#define OOO_STRING_SW_HTML_FT_author
#define OOO_STRING_SW_HTML_FF_ulettern
#define OOO_STRING_SW_HTML_FT_docstat
#define OOO_STRING_SW_HTML_FS_create
#define OOO_STRING_SW_HTML_FS_cphone
#define OOO_STRING_SW_HTML_FS_name
#define OOO_STRING_SW_HTML_FT_datetime
#define OOO_STRING_SW_HTML_FT_docinfo
#define OOO_STRING_SW_HTML_FS_position
#define OOO_STRING_SW_HTML_FF_author
#define OOO_STRING_SW_HTML_FF_time
#define OOO_STRING_SW_HTML_FT_sender
#define OOO_STRING_SW_HTML_FF_pathname
#define OOO_STRING_SW_HTML_FS_city
#define OOO_STRING_SW_HTML_FS_firstname
#define OOO_STRING_SW_HTML_FT_filename
#define OOO_STRING_SW_HTML_FF_shortcut
#define OOO_STRING_SW_HTML_FT_page
#define OOO_STRING_SW_HTML_FS_ole
#define OOO_STRING_SW_HTML_FS_comment
#define OOO_STRING_SW_HTML_FS_state
#define OOO_STRING_SW_HTML_FS_country
#define OOO_STRING_SW_HTML_FS_page
#define OOO_STRING_SW_HTML_FF_name_noext
#define OOO_STRING_SW_HTML_FF_uroman
#define OOO_STRING_SW_HTML_FF_path
#define OOO_STRING_SW_HTML_FS_keys
#define OOO_STRING_SW_HTML_FF_llettern
const SwDocInfoSubType DI_SUB_AUTHOR
const SwDocInfoSubType DI_CUSTOM
const SwDocInfoSubType DI_CHANGE
const SwDocInfoSubType DI_COMMENT
const SwDocInfoSubType DI_SUBTYPE_END
const SwDocInfoSubType DI_SUB_FIXED
const SwDocInfoSubType DI_SUB_DATE
const SwDocInfoSubType DI_KEYS
const SwDocInfoSubType DI_SUBJECT
const SwDocInfoSubType DI_TITLE
const SwDocInfoSubType DI_SUB_TIME
const SwDocInfoSubType DI_CREATE
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
::std::vector< HTMLOption > HTMLOptions
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
SVX_NUM_CHARS_UPPER_LETTER_N
NF_DATE_SYS_NNNNDMMMMYYYY