summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-02-14 07:35:44 -0500
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-02-19 11:50:22 +0100
commit48fd0d45288bd8501f14c993cf613fe7743fabcd (patch)
tree699af2cfc519dc218c6f98c44b269b28eb2c1b31 /sw/source
parentbd22f1be6739c9d90e129e5b094206157893c030 (diff)
tdf#115569 don't sign or validate text in tables
Both undoing signatures and updating the metafield are causing seg-faults. Clearly more work is needed to support paragraph signing within tables, so disabled for now. Change-Id: Ia20c8b07069689b0e8b7d11a634a2a48ef1f0fa3 Reviewed-on: https://gerrit.libreoffice.org/49722 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/edit/edfcol.cxx29
1 files changed, 23 insertions, 6 deletions
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index f4e4736b02e0..8ace8092a783 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -480,12 +480,20 @@ bool lcl_DoUpdateParagraphSignatureField(SwDoc* pDoc,
pDoc->GetIDocumentUndoRedo().DoUndo(isUndoEnabled);
});
- uno::Reference<css::text::XTextRange> xText(xField, uno::UNO_QUERY);
- const OUString curText = xText->getString();
- if (curText != sDisplayText)
+ try
+ {
+ uno::Reference<css::text::XTextRange> xText(xField, uno::UNO_QUERY);
+ const OUString curText = xText->getString();
+ if (curText != sDisplayText)
+ {
+ xText->setString(sDisplayText);
+ return true;
+ }
+ }
+ catch (const uno::Exception& ex)
{
- xText->setString(sDisplayText);
- return true;
+ // We failed; avoid crashing.
+ SAL_WARN("sw.uno", "Failed to update paragraph signature: " << ex);
}
return false;
@@ -1734,6 +1742,10 @@ void SwEditShell::SignParagraph()
if (!pNode)
return;
+ // Table text signing is not supported.
+ if (pNode->FindTableNode() != nullptr)
+ return;
+
// 1. Get the text (without fields).
const uno::Reference<text::XTextContent> xParagraph = SwXParagraph::CreateXParagraph(*pNode->GetDoc(), pNode);
const OString utf8Text = lcl_getParagraphBodyText(xParagraph);
@@ -1808,7 +1820,12 @@ void SwEditShell::ValidateCurrentParagraphSignatures(bool updateDontRemove)
SetParagraphSignatureValidation(bOldValidationFlag);
});
- lcl_ValidateParagraphSignatures(GetDoc(), SwXParagraph::CreateXParagraph(*pNode->GetDoc(), pNode), updateDontRemove);
+ // Table text signing is not supported.
+ if (pNode->FindTableNode() != nullptr)
+ return;
+
+ uno::Reference<text::XTextContent> xParentText = SwXParagraph::CreateXParagraph(*pNode->GetDoc(), pNode);
+ lcl_ValidateParagraphSignatures(GetDoc(), xParentText, updateDontRemove);
}
void SwEditShell::ValidateAllParagraphSignatures(bool updateDontRemove)