diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-08-26 23:41:17 -0400 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2017-08-28 05:01:16 +0200 |
commit | 8d912300ad1559ebd2ab2005e683753b361ba671 (patch) | |
tree | 42cf048c6ddb80944365d9f9826553c340f6474a | |
parent | 3daf54cb807b1841335d0da935c17149f9d9873f (diff) |
sw: insert paragraph signature field
Change-Id: Ibf062c19b9896841df765bc39716cddad8bc12f2
Reviewed-on: https://gerrit.libreoffice.org/41602
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
-rw-r--r-- | sw/inc/fldbas.hxx | 5 | ||||
-rw-r--r-- | sw/inc/strings.hrc | 1 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/fldui/fldmgr.cxx | 14 |
4 files changed, 19 insertions, 4 deletions
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index 91aa97657955..f8030874a782 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -74,7 +74,8 @@ enum class SwFieldIds : sal_uInt16 { TableOfAuthorities, CombinedChars, Dropdown, - LAST = Dropdown, + ParagraphSignature, + LAST = ParagraphSignature, Unknown = USHRT_MAX, // used as default value in some method calls }; @@ -125,6 +126,8 @@ enum SwFieldTypesEnum { TYP_AUTHORITY, // 40 TYP_COMBINED_CHARS, TYP_DROPDOWN, + TYP_CUSTOM, // Unused - necessary for alignment with aSwFields in fldmgr.cxx + TYP_PARAGRAPHSIGFLD, TYP_END }; enum SwAttrFieldTYpe { diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 9e77c736bdd8..915c0bab463b 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -1343,6 +1343,7 @@ #define STR_VALID NC_("STR_VALID", "Valid") #define STR_INVALID NC_("STR_INVALID", "Invalid") #define STR_SIGNED_BY NC_("STR_SIGNED_BY", "Signed-by") +#define STR_PARAGRAPH_SIGNATURE NC_("STR_PARAGRAPH_SIGNATURE", "Paragraph Signature") #endif diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 0fa69f428aec..2b8e111e726f 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -119,7 +119,8 @@ namespace /* SwFieldIds::DateTime */ TYP_BEGIN, // dynamic /* SwFieldIds::TableOfAuthorities*/ TYP_AUTHORITY, /* SwFieldIds::CombinedChars */ TYP_COMBINED_CHARS, - /* SwFieldIds::Dropdown */ TYP_DROPDOWN + /* SwFieldIds::Dropdown */ TYP_DROPDOWN, + /* SwFieldIds::ParagraphSignature */ TYP_PARAGRAPHSIGFLD }; } diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index ab5c79b6aa9d..875b923ffdc8 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -95,7 +95,7 @@ using namespace nsSwDocInfoSubType; enum { GRP_DOC_BEGIN = 0, - GRP_DOC_END = GRP_DOC_BEGIN + 11, + GRP_DOC_END = GRP_DOC_BEGIN + 12, GRP_FKT_BEGIN = GRP_DOC_END, GRP_FKT_END = GRP_FKT_BEGIN + 8, @@ -310,6 +310,7 @@ static const SwFieldPack aSwFields[] = { TYP_CHAPTERFLD, nullptr, 0, FMT_CHAPTER_ARY, SAL_N_ELEMENTS(FMT_CHAPTER_ARY) }, { TYP_TEMPLNAMEFLD, nullptr, 0, FMT_FF_ARY, SAL_N_ELEMENTS(FMT_FF_ARY) }, + { TYP_PARAGRAPHSIGFLD, nullptr, 0, nullptr, 0 }, // Functions { TYP_CONDTXTFLD, nullptr, 0, nullptr, 0 }, @@ -1456,6 +1457,14 @@ bool SwFieldMgr::InsertField( static_cast<SwDropDownField*>(pField)->SetName(rData.m_sPar1); } break; + + // Insert Paragraph Signature field by signing the paragraph. + // The resulting field is really a metadata field, created and added via signing. + case TYP_PARAGRAPHSIGFLD: + pCurShell->SignParagraph(pCurShell->GetCursor()); + return true; + break; + default: { OSL_ENSURE(false, "wrong field type"); return false; @@ -1750,7 +1759,8 @@ void SwFieldType::GetFieldName_() STR_AUTHORITY, STR_COMBINED_CHARS, STR_DROPDOWN, - STR_CUSTOM_FIELD + STR_CUSTOM_FIELD, + STR_PARAGRAPH_SIGNATURE }; // insert infos for fields |