summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitEnums.h10
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx1
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx8
3 files changed, 18 insertions, 1 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index d6e46e96aee1..d2a03c8ce9b6 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -960,7 +960,13 @@ typedef enum
/**
* Informs the LibreOfficeKit client that the color palettes have changed.
*/
- LOK_CALLBACK_COLOR_PALETTES = 65
+ LOK_CALLBACK_COLOR_PALETTES = 65,
+
+ /**
+ * Informs that the document password has been succesfully changed.
+ * The payload contains the the new password and the type.
+ */
+ LOK_CALLBACK_DOCUMENT_PASSWORD_RESET = 66
}
LibreOfficeKitCallbackType;
@@ -1121,6 +1127,8 @@ static inline const char* lokCallbackTypeToString(int nType)
return "LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED";
case LOK_CALLBACK_COLOR_PALETTES:
return "LOK_CALLBACK_COLOR_PALETTES";
+ case LOK_CALLBACK_DOCUMENT_PASSWORD_RESET:
+ return "LOK_CALLBACK_DOCUMENT_PASSWORD_RESET";
}
assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 305ac5a477d2..7245c8e2096f 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1492,6 +1492,7 @@ callback (gpointer pData)
case LOK_CALLBACK_A11Y_CARET_CHANGED:
case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED:
case LOK_CALLBACK_COLOR_PALETTES:
+ case LOK_CALLBACK_DOCUMENT_PASSWORD_RESET:
{
// TODO: Implement me
break;
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 7d97ab8b3ba8..f702c2ec10c1 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -39,6 +39,8 @@
#include <osl/diagnose.h>
#include <osl/file.hxx>
#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <tools/json_writer.hxx>
#include <memory>
@@ -71,6 +73,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/docfile.hxx>
#include <vcl/abstdlg.hxx>
+#include <sfx2/viewsh.hxx>
#include <documentfontsdialog.hxx>
#include <dinfdlg.hrc>
@@ -792,6 +795,11 @@ IMPL_LINK_NOARG(SfxDocumentPage, ChangePassHdl, weld::Button&, void)
{
sfx2::SetPassword(pFilter, pMedSet, m_xPasswordDialog->GetPasswordToOpen(),
m_xPasswordDialog->GetPasswordToOpen(), true);
+ tools::JsonWriter payloadJson;
+ payloadJson.put("password", m_xPasswordDialog->GetPasswordToOpen());
+ payloadJson.put("isToModify", false);
+ pShell->GetViewShell()->libreOfficeKitViewCallback(
+ LOK_CALLBACK_DOCUMENT_PASSWORD_RESET, payloadJson.finishAndGetAsOString());
pShell->SetModified();
}
m_xPasswordDialog->disposeOnce();